Util

codemode-gatewaysourcetypescript
Path: codemode-gateway/src/providers/util.tsRelative: src/providers/util.tsSubproject: codemode-gatewayCategory: codemode-gateway
Lines: 25Bytes: 1,065Imports: 0Exports: 1

Content Preview

  1. /**
  2. * Implementations for the `util` namespace: `util.echo(x)`, `util.now()`,
  3. * `util.rand()`. Contains only trivial, side-effect-free helpers — safe to
  4. * expose to untrusted LLM-written code.
  5. *
  6. * These functions execute on the HOST Worker (via the `ToolDispatcher` RPC
  7. * bridge), not in the sandbox — so they have host access to `crypto` and
  8. * `Date`, and no access to the sandbox's isolated globals. The sandbox calls
  9. * them through a `Proxy` that serializes args and deserializes results.