Skip to content

Releases: torkbot/code-mode-sandbox

v0.3.0

Choose a tag to compare

@ggoodman ggoodman released this 02 Aug 14:26
7c45e4f

Typed results in Sandbox runtimes

Sandbox-backed programs can now return ordered text and image content explicitly:

export default function ({ result }: AgentProgramScope) {
  result.appendText("Sandbox execution complete");
  result.appendImage({
    data: imageBase64,
    mimeType: "image/png",
  });
}

Successful outcomes expose these values through outcome.content. Console output remains diagnostic telemetry, and buffered results are discarded if the program fails.

This release adopts the current program-contract API and updates its runtime dependencies to @torkbot/code-mode@^0.6.0 and @torkbot/sandbox@^0.16.0. Create clients with an explicit contract:

const contract = createProgramContract({ tools: [] });
const client = createClient({ runtime, contract });

v0.2.0

Choose a tag to compare

@ggoodman ggoodman released this 23 Jul 11:17
d330984

Boot a connected Sandbox runtime directly

createSandboxNodeRuntime() now boots and returns a ready, persistent code-mode
runtime. The caller still chooses and owns the Sandbox; the runtime owns only
the Node.js 24 process running inside it:

await using runtime = await createSandboxNodeRuntime(
  {
    sandbox,
    cwd: "/workspace",
    nodePath: "/usr/bin/node",
  },
  bootSignal,
);

const client = createClient({ runtime, toolbox });

One runner can serve multiple concurrent executions. Cancelling one execution
does not stop the runtime or its other work, and disposing the runtime does not
close the caller-owned Sandbox.

Run ordinary ESM agent programs

Programs are now TypeScript-flavoured ECMAScript modules with native static
imports and a callable default export:

import { basename } from "node:path";

export default async function ({ codemode, console }: AgentProgramScope) {
  const result = await codemode.lookup({
    name: basename("/workspace/example.txt"),
  });
  console.log(result);
}

Static imports resolve from the configured guest working directory. Only the
console passed to the default export is captured, with stdout/stderr
provenance; ambient process output remains ordinary guest output.

Migrating from v0.1.0

This is an intentionally breaking release with no compatibility layer:

  • Replace Node24Runtime, runtime hosts, Runtime.start(), and termination
    methods with the async createSandboxNodeRuntime(options, bootSignal)
    factory and Runtime async disposal.
  • Replace expression-shaped programs with ESM containing a callable default
    export that receives { codemode, console }.
  • Use @torkbot/code-mode@^0.3.1.

v0.1.0

Choose a tag to compare

@ggoodman ggoodman released this 16 Jul 03:42
a731bf7

This is the first release of @torkbot/code-mode-sandbox. It lets
@torkbot/code-mode run Node.js 24 programs inside a caller-owned
@torkbot/sandbox microVM without taking ownership of the machine.

Create a host with createSandboxNodeRuntimeHost({ sandbox, cwd, nodePath })
and pass it to new Node24Runtime(host). The caller remains in control of the
Sandbox image, persistence, mounts, resources, network access, reuse, and
lifecycle; the host owns only the guest processes it launches. Runtime traffic
uses the Sandbox process pipe's readable and writable Web Streams directly.