Backplane.AgentRuntime.Codex.CodeMode (backplane_agent_runtime v1.10.14)

Copy Markdown

Opt-in, capability-limited JavaScript Code Mode.

JavaScript runs in a Deno worker with all Deno permissions denied. The only host capability exposed to the program is codex.tool/2 (and its raw-input variant), which is routed back through a host-supplied admitted dispatcher. A yielded generator is retained in a run-owned ResourceRegistry handle.

Summary

Functions

call(operation)

@spec call(map()) :: {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

cancel(registry, handle, owner)

@spec cancel(pid(), map(), String.t()) ::
  {:ok, term()} | {:error, Backplane.AgentRuntime.Error.t()}

contracts(context)

@spec contracts(map()) :: [map()]

execute(registry, owner, code, opts \\ [])

@spec execute(pid(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

lifecycle_capability(context)

@spec lifecycle_capability(map()) :: :verified | {:unsupported, atom()}

Returns whether the host can verify and clean up a Code Mode process.

resume(registry, handle, value, opts \\ [])

@spec resume(pid(), map(), term(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}