withruntime 0.8.4 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BLAXEL.md +4 -4
- package/COMPATIBILITY.md +145 -0
- package/DAYTONA.md +13 -7
- package/E2B.md +34 -20
- package/README.md +22 -11
- package/README.src.md +22 -11
- package/VERCEL.md +13 -3
- package/compatibility-lock.json +357 -0
- package/dist/ai-harness/index.js +2 -2
- package/dist/api-defaults.d.ts +17 -0
- package/dist/api-defaults.js +22 -0
- package/dist/blaxel/errors.js +1 -1
- package/dist/blaxel/lookup.d.ts +3 -2
- package/dist/blaxel/lookup.js +3 -2
- package/dist/blaxel/pagination.d.ts +2 -2
- package/dist/blaxel/pagination.js +45 -17
- package/dist/blaxel/preview.d.ts +3 -2
- package/dist/blaxel/preview.js +16 -14
- package/dist/blaxel/process.d.ts +1 -1
- package/dist/blaxel/process.js +66 -11
- package/dist/blaxel/sandbox.d.ts +2 -0
- package/dist/blaxel/sandbox.js +2 -0
- package/dist/blaxel/snapshot.js +3 -5
- package/dist/cli-words.d.ts +27 -0
- package/dist/cli-words.js +135 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +351 -85
- package/dist/client.d.ts +33 -4
- package/dist/client.js +47 -12
- package/dist/cloudflare/identity.d.ts +7 -0
- package/dist/cloudflare/identity.js +13 -0
- package/dist/cloudflare/index.d.ts +303 -0
- package/dist/cloudflare/index.js +592 -0
- package/dist/cloudflare/worker.d.ts +419 -0
- package/dist/cloudflare/worker.js +447 -0
- package/dist/codesandbox/guest-service.d.ts +31 -0
- package/dist/codesandbox/guest-service.js +490 -0
- package/dist/codesandbox/index.d.ts +386 -0
- package/dist/codesandbox/index.js +1347 -0
- package/dist/compat/core.d.ts +40 -0
- package/dist/compat/core.js +238 -0
- package/dist/compat/files.d.ts +26 -0
- package/dist/compat/files.js +133 -0
- package/dist/compat/shell.d.ts +4 -0
- package/dist/compat/shell.js +165 -0
- package/dist/credentials.d.ts +6 -1
- package/dist/credentials.js +107 -38
- package/dist/daytona/context.js +2 -1
- package/dist/daytona/daytona.js +11 -4
- package/dist/daytona/filesystem.d.ts +17 -4
- package/dist/daytona/filesystem.js +121 -38
- package/dist/daytona/index.d.ts +1 -1
- package/dist/daytona/process.d.ts +1 -1
- package/dist/daytona/process.js +27 -4
- package/dist/daytona/sandbox.d.ts +1 -1
- package/dist/daytona/sandbox.js +16 -7
- package/dist/e2b/client.js +1 -1
- package/dist/e2b/code-interpreter.d.ts +4 -5
- package/dist/e2b/code-interpreter.js +54 -56
- package/dist/e2b/commands.d.ts +35 -12
- package/dist/e2b/commands.js +169 -73
- package/dist/e2b/errors.js +1 -1
- package/dist/e2b/filesystem.d.ts +8 -6
- package/dist/e2b/filesystem.js +127 -28
- package/dist/e2b/index.d.ts +1 -0
- package/dist/e2b/index.js +1 -0
- package/dist/e2b/pty.d.ts +24 -0
- package/dist/e2b/pty.js +80 -0
- package/dist/e2b/sandbox.d.ts +6 -4
- package/dist/e2b/sandbox.js +59 -25
- package/dist/errors.d.ts +8 -0
- package/dist/errors.js +15 -2
- package/dist/file-source.d.ts +16 -0
- package/dist/file-source.js +162 -0
- package/dist/freestyle/index.d.ts +309 -0
- package/dist/freestyle/index.js +343 -0
- package/dist/index.d.ts +3 -1
- package/dist/login.js +16 -10
- package/dist/mcp.js +2 -2
- package/dist/modal/index.d.ts +205 -0
- package/dist/modal/index.js +486 -0
- package/dist/network-cli.js +112 -44
- package/dist/openai-agents/index.js +18 -71
- package/dist/page.d.ts +1 -1
- package/dist/page.js +2 -2
- package/dist/products/audit.d.ts +3 -0
- package/dist/products/index.d.ts +14 -0
- package/dist/products/index.js +12 -0
- package/dist/products/interpreter.d.ts +11 -4
- package/dist/products/interpreter.js +33 -9
- package/dist/products/jobs.js +3 -2
- package/dist/products/limits.d.ts +10 -0
- package/dist/products/observability.d.ts +44 -0
- package/dist/products/observability.js +6 -0
- package/dist/products/previews.d.ts +18 -4
- package/dist/products/previews.js +14 -5
- package/dist/products/tailscale.d.ts +57 -0
- package/dist/products/tailscale.js +17 -0
- package/dist/products/volumes.d.ts +42 -0
- package/dist/products/volumes.js +36 -0
- package/dist/products/watch.d.ts +25 -4
- package/dist/products/watch.js +132 -18
- package/dist/proxy.js +3 -1
- package/dist/runloop/index.d.ts +326 -0
- package/dist/runloop/index.js +535 -0
- package/dist/runloop/pagination.d.ts +46 -0
- package/dist/runloop/pagination.js +82 -0
- package/dist/runloop/snapshots.d.ts +52 -0
- package/dist/runloop/snapshots.js +244 -0
- package/dist/sandbox.d.ts +76 -16
- package/dist/sandbox.js +696 -135
- package/dist/snapshots.d.ts +20 -5
- package/dist/snapshots.js +11 -1
- package/dist/sprites/index.d.ts +251 -0
- package/dist/sprites/index.js +588 -0
- package/dist/tar.d.ts +10 -1
- package/dist/tar.js +311 -35
- package/dist/tools/index.js +2 -1
- package/dist/transport.d.ts +23 -8
- package/dist/transport.js +247 -127
- package/dist/types.d.ts +52 -3
- package/dist/vercel/command.d.ts +1 -1
- package/dist/vercel/command.js +15 -3
- package/dist/vercel/errors.d.ts +2 -2
- package/dist/vercel/errors.js +19 -2
- package/dist/vercel/filesystem.d.ts +21 -18
- package/dist/vercel/filesystem.js +95 -48
- package/dist/vercel/sandbox.d.ts +8 -8
- package/dist/vercel/sandbox.js +159 -64
- package/dist/vercel/snapshot.d.ts +3 -2
- package/dist/vercel/snapshot.js +9 -5
- package/package.json +46 -3
package/BLAXEL.md
CHANGED
|
@@ -10,8 +10,8 @@ load it.
|
|
|
10
10
|
import { SandboxInstance } from "withruntime/blaxel"; // was: from "@blaxel/core"
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
The mapping was written against `@blaxel/core` 0.3.
|
|
14
|
-
source, checked
|
|
13
|
+
The mapping was written against `@blaxel/core` 0.3.24 and Blaxel's sandbox API
|
|
14
|
+
source, checked 30 September 2026. Every name `@blaxel/core` exports can be
|
|
15
15
|
imported: code that only mentions an agent, model or MCP helper still loads.
|
|
16
16
|
|
|
17
17
|
## Keys
|
|
@@ -100,7 +100,7 @@ name, or through `getByExternalId`, use the same Runtime key.
|
|
|
100
100
|
| `process.exec` without `waitForCompletion` | One Runtime process, answered running. Its Blaxel name is kept in its command line, so `get("name")` finds it from any client. |
|
|
101
101
|
| `process.exec({ waitForCompletion: true })` | One streamed call, answered with `status`, `exitCode`, `stdout`, `stderr` and `logs`. Past `timeout` the wait ends with a 422 and the process runs on. |
|
|
102
102
|
| `onLog`, `onStdout`, `onStderr`, `streamLogs` | The process's output as it comes; `streamLogs` gives whole lines, as Blaxel's does. |
|
|
103
|
-
| `process.get`, `wait`, `list`, `logs`, `stop`, `kill`, `writeStdin`, `closeStdin` | Runtime processes by id or name. `wait` follows
|
|
103
|
+
| `process.get`, `wait`, `list`, `logs`, `stop`, `kill`, `writeStdin`, `closeStdin` | Runtime processes by id or name. `wait` follows output with one deadline covering lookup and output. Cancellation leaves the process running. `stop` is SIGTERM, `kill` SIGKILL. |
|
|
104
104
|
| `keepAlive`, `timeout` | The sandbox does not pause for idleness while the process may run (its `timeout`, 600 s by default, 0 for as long as a lease allows); once no `keepAlive` process runs, it gets its idle pause back. |
|
|
105
105
|
| `restartOnFailure`, `maxRestarts`, `waitForPorts`, `workingDir`, `env`, `stdin` | A restart loop in the same process, with Blaxel's note in the output (`restartCount` counts the notes); a wait in the sandbox for the ports; as in Blaxel. |
|
|
106
106
|
| `fs.read`, `write`, `readBinary`, `writeBinary`, `writeTree`, `mkdir`, `rm`, `cp` | Runtime's files API, or one command. A path only root may read or write (outside `/workspace`, or made by a root process) goes through sudo, as Blaxel's root-owned API could. |
|
|
@@ -208,7 +208,7 @@ leaves those names alone.
|
|
|
208
208
|
|
|
209
209
|
`bun run test` in `packages/cloud-sdk` runs the unit tests against a fake of
|
|
210
210
|
Runtime's SDK: `tests/blaxel`, including a check that every name
|
|
211
|
-
`@blaxel/core` 0.3.
|
|
211
|
+
`@blaxel/core` 0.3.24 exports is exported here.
|
|
212
212
|
|
|
213
213
|
The end-to-end test runs Blaxel's guides, unmodified but for the import,
|
|
214
214
|
against the real API: `tests/fixtures/blaxel-quickstart.mjs` (create, processes,
|
package/COMPATIBILITY.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Sandbox compatibility evidence
|
|
2
|
+
|
|
3
|
+
The compatibility modules are **partial, version-pinned sandbox adapters**. Their
|
|
4
|
+
exported methods translate to Runtime's native client. They are not replacements
|
|
5
|
+
for every service in a competitor's SDK, and this document does not claim that
|
|
6
|
+
all applications switch unchanged.
|
|
7
|
+
|
|
8
|
+
The four established modules are documented in `E2B.md`, `DAYTONA.md`, `VERCEL.md`
|
|
9
|
+
and `BLAXEL.md`. The six additional TypeScript modules below were checked against
|
|
10
|
+
published package declarations downloaded on 29 September 2026. Prime Intellect
|
|
11
|
+
publishes a Python sandbox SDK; Runtime does not invent a TypeScript drop-in
|
|
12
|
+
interface for it. Python coverage is in the Python SDK's compatibility documents.
|
|
13
|
+
|
|
14
|
+
The Cloudflare module implements the 0.x `@cloudflare/sandbox` API. Version 1.0.0,
|
|
15
|
+
published 30 September 2026, is a different package: it removes `getSandbox`, the
|
|
16
|
+
`Sandbox` class, `exec`, processes, sessions and preview proxying, and keeps only
|
|
17
|
+
`Files`, `S3Mount` and `DirectoryBackup` for the caller's own Durable Object. The
|
|
18
|
+
pin stays 0.12.10; `compatibility-lock.json` records 1.0.0 as reviewed and
|
|
19
|
+
unsupported, and `bun run compat:upstream` flags any other release.
|
|
20
|
+
|
|
21
|
+
| Provider | Published package inspected | Runtime import | Implemented sandbox surface |
|
|
22
|
+
| ----------- | --------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| Runloop | `@runloop/api-client` 1.32.0 | `withruntime/runloop` | `Runloop`, devbox create/get/list/suspend/resume/shutdown, disk snapshots; synchronous and asynchronous commands, resident named shells with variables, functions, aliases, options and working directory, execution completion/output/stdin/signals, text files |
|
|
24
|
+
| CodeSandbox | `@codesandbox/sdk` 2.4.2 | `withruntime/codesandbox` | `CodeSandbox`, `VMTier`, create/fork/resume/shutdown/restart/hibernate/delete/list/get; connected command and file clients; output/status subscriptions and same-client command restart; configured tasks and setup steps; public preview ports and readiness checks |
|
|
25
|
+
| Fly Sprites | `@fly/sprites` 0.2.3 | `withruntime/sprites` | `SpritesClient`, create/lookup/list/delete/restart; `exec`, `execFile`, Node streams and event-based `spawn`; attachable native processes; binary/text/JSON files, directory traversal, append, chmod; preview access settings |
|
|
26
|
+
| Freestyle | `freestyle` 0.2.16 | `withruntime/freestyle` | `Freestyle`, VM create/ref/get/list/start/pause/delete/update; command execution, binary/text files and streams, filesystem metadata; native snapshots; explicit deny-all or outbound-public firewall intent |
|
|
27
|
+
| Modal | `modal` 0.11.0 | `withruntime/modal` | `ModalClient`, app-name grouping, registry images and Dockerfile layers, CPU sandbox create/get/list/name lookup, text/binary process streams and stdin, command completion, filesystem transfer and metadata, tags, encrypted public previews, outbound allowlists, memory snapshot capture |
|
|
28
|
+
| Cloudflare | `@cloudflare/sandbox` 0.12.10 (0.x API) | `withruntime/cloudflare` | `getSandbox`, named Runtime sandboxes, explicit execution sessions, text exec and SSE output, background processes, logs/signals/waits, binary/text files, recursive listings, environment updates, signed Runtime previews, conditional Worker Durable Object entry, Worker preview proxy, destruction |
|
|
29
|
+
|
|
30
|
+
## Authentication and resources
|
|
31
|
+
|
|
32
|
+
Set `RUNTIME_API_KEY` or sign in with `runtime login`. An explicitly supplied
|
|
33
|
+
Runtime key begins with `rtcloud_`. Vendor credentials supplied to a replaced
|
|
34
|
+
constructor are discarded locally, never forwarded to Runtime. Every adapter
|
|
35
|
+
also accepts an injected native `Runtime` client for testing or configured
|
|
36
|
+
transports. The conditional Worker entry reads the `RUNTIME_API_KEY` Worker secret and optional
|
|
37
|
+
`RUNTIME_API_URL`; a Durable Object binding is not a Runtime credential.
|
|
38
|
+
|
|
39
|
+
CodeSandbox, Sprites and Freestyle request Runtime persistence to preserve their
|
|
40
|
+
resource-lifetime intent. Persistent sandboxes require paid credit. Runloop enables persistence only when the caller
|
|
41
|
+
explicitly suspends: native stop retains its disk and resume boots that disk afresh,
|
|
42
|
+
without restoring old processes. Paid admission must succeed before stopping. An
|
|
43
|
+
uncertain stop keeps persistence enabled so the caller can retry without discarding
|
|
44
|
+
data. Lifecycle calls serialize within one client; competing opposite intents from
|
|
45
|
+
different clients rely on native transition admission. Runtime
|
|
46
|
+
admission, credit, disk and CPU limits remain authoritative; an adapter does not
|
|
47
|
+
buy resources, override account limits or promise another provider's capacity.
|
|
48
|
+
Supported explicit regions use Runtime's region names. Unsupported provider
|
|
49
|
+
regions, GPU requests and fractional CPU shapes fail before allocation rather
|
|
50
|
+
than silently receiving different hardware.
|
|
51
|
+
|
|
52
|
+
Environment variables are stored in a sandbox-private file with mode 0600, not
|
|
53
|
+
in resource labels. Reconnecting clients read the file; snapshots preserve it
|
|
54
|
+
unless an explicit replacement environment is supplied. Python and TypeScript
|
|
55
|
+
share the file path and `compat.provider` resource label.
|
|
56
|
+
|
|
57
|
+
## Evidence that can be repeated locally
|
|
58
|
+
|
|
59
|
+
Run `bun test tests/compat` from the SDK package and run `bun run check-types`.
|
|
60
|
+
The test run compiles unchanged typed consumer bodies from
|
|
61
|
+
`tests/compat/consumers/workflows.ts.txt` against all ten TypeScript adapters,
|
|
62
|
+
including E2B's interpreter. Run
|
|
63
|
+
`bun tests/compat/check-consumers.ts <verified-cache>` to compile the
|
|
64
|
+
same bodies against the pinned upstream declarations; the script checks each
|
|
65
|
+
package name and version against the lock before compiling. Both targets passed
|
|
66
|
+
on 29 September 2026. Only import resolution changes between the two runs.
|
|
67
|
+
|
|
68
|
+
The published-package behavior checks are also reproducible. Prepare the integrity-verified
|
|
69
|
+
cache with the SDK's compatibility preparation command. Run
|
|
70
|
+
`bun tests/compat/prepare-runtime.ts <verified-cache> <reference-directory>`;
|
|
71
|
+
it copies published packages without modifying the cache, removes build-only development
|
|
72
|
+
dependencies from copied manifests, and installs runtime dependencies with scripts disabled
|
|
73
|
+
and the checked-in frozen `tests/compat/reference.bun.lock`. Then run
|
|
74
|
+
`bun tests/compat/compare-upstream.ts <verified-cache> <reference-directory>` and
|
|
75
|
+
`bun tests/compat/worker-local.ts <reference-directory>/node_modules/miniflare <reference-directory>`.
|
|
76
|
+
|
|
77
|
+
| Published implementation executed | Shared behavior compared | Instrument boundary |
|
|
78
|
+
| -------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
79
|
+
| Sprites filesystem | Binary/text/JSON files, dotfiles, directory entries, missing-file errors | Controlled HTTP versus native API router and simulated guest |
|
|
80
|
+
| Freestyle filesystem | Blob/string writes, progress, byte ranges, streamed slices | Controlled HTTP versus native API router and simulated guest |
|
|
81
|
+
| Runloop client | Create, text files, command results, shutdown | Controlled HTTP versus native API router and simulated guest |
|
|
82
|
+
| CodeSandbox client | Creation defaults, tags, metadata, hibernate/delete | Controlled HTTP; native metadata/lifecycle modeled because fixture has no orchestration database |
|
|
83
|
+
| Modal client and Sandbox | Tag replacement/clearing and terminate | Published injected control-plane client; native metadata/lifecycle modeled |
|
|
84
|
+
| Cloudflare getSandbox/session wrappers | ID validation, sessions, file calls, exec, process waits | Both run in pinned local workerd against Runtime's Durable Object and simulated guest; the official Container daemon is not run |
|
|
85
|
+
|
|
86
|
+
All six comparisons passed locally on 29 September 2026. They establish the stated
|
|
87
|
+
client behavior with controlled responses, not equivalence of hosted vendor services.
|
|
88
|
+
|
|
89
|
+
The new adapter contract tests drive Runtime's actual API router, request
|
|
90
|
+
validation and response schemas with a simulated guest. They exercise:
|
|
91
|
+
|
|
92
|
+
- Command failures and asynchronous execution output.
|
|
93
|
+
- Reconnection with retained environment and unchanged dotfile paths.
|
|
94
|
+
- Binary file transfers larger than the native single-request limit.
|
|
95
|
+
- Large append staging and cleanup.
|
|
96
|
+
- Refusal of unsupported resource options before allocation.
|
|
97
|
+
- Failed initialization cleanup, including a second failure during cleanup.
|
|
98
|
+
- Preserving a snapshot's environment when no override was given.
|
|
99
|
+
- Never forwarding vendor credentials to Runtime.
|
|
100
|
+
- Stopping paused persistent sandboxes before releasing their disk, including a
|
|
101
|
+
pause racing a client's cached state, without waking them.
|
|
102
|
+
- Named-shell environment and working-directory persistence in real local Bash,
|
|
103
|
+
nonzero exits, variable-name collisions, and explicit per-call overrides. The resident
|
|
104
|
+
broker also exercises function/alias/option persistence, return/exit/exec, concurrent
|
|
105
|
+
calls, cancellation, overridden printf and an invalid command PATH.
|
|
106
|
+
- Cloudflare session callbacks/files/process waits and Modal process streams,
|
|
107
|
+
stdin, files and entrypoint completion. These two tests replace create/image
|
|
108
|
+
orchestration because the simulated-guest fixture has no database/image builder.
|
|
109
|
+
|
|
110
|
+
The optional `tests/compat/live.ts` runner requires `--run`, an explicit Runtime
|
|
111
|
+
key, and at least one remaining trial hour. It allocates at most six resources,
|
|
112
|
+
forces trial funding and short leases, records every created ID, and attempts
|
|
113
|
+
cleanup for all IDs even after a failure. It does not build images, create
|
|
114
|
+
snapshots or expose public previews. Its explicit persistence override makes it
|
|
115
|
+
an execution/file smoke test, not evidence of paid persistent lifetime behavior.
|
|
116
|
+
|
|
117
|
+
Local tests do not prove cross-host durability, Linux isolation, vendor runtime
|
|
118
|
+
image equivalence, public Worker hosting, or performance against a competitor.
|
|
119
|
+
The measured results of live acceptance belong in its run report.
|
|
120
|
+
|
|
121
|
+
## Exact boundaries of this version
|
|
122
|
+
|
|
123
|
+
These boundaries describe present behavior, rather than a second worklist.
|
|
124
|
+
Remaining implementation work is tracked only in the repository `WORKLIST.md`.
|
|
125
|
+
|
|
126
|
+
| Provider | Boundary |
|
|
127
|
+
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
128
|
+
| All six | Default sandboxes use Runtime's environment. Explicit vendor image/template/snapshot IDs require migration to Runtime; arbitrary foreign IDs are not substituted with a stock image. Provider credential formats, wire protocols, error hierarchies and every optional transport hook are not interchangeable. Retained process output is bounded. Binary process mode requires the native byte-output capability (`outputEncoding`); an API or guest without it refuses before execution. This capability has only local release evidence here. |
|
|
129
|
+
| Runloop | Blueprints name Runtime image IDs/names; snapshots name Runtime snapshots. No provider blueprint builds, mounts, secret gateways, MCP grants, lifecycle hooks or ARM placement. `X_SMALL`/fractional CPU shapes are refused. Named shells use a resident Bash process. Interactive stdin in named shells is explicitly refused. `snapshotDisk` takes a blocking disk-only native snapshot; `snapshotDiskAsync` is refused, a memory snapshot is refused as a disk snapshot, and snapshot metadata beyond Runtime's label bounds is refused. `diskSnapshots` lists, updates, polls and deletes them. Devbox and snapshot lists return cursor pages that can be awaited or iterated across pages; the generated `APIPromise` wrapper and its response helpers are not reproduced. |
|
|
130
|
+
| CodeSandbox | No browser editor/Pitcher protocol, browser-session tokens, interpreters, live VM resizing, fork tier changes, read-only or global editor sessions, or private host-token emulation. Configured tasks run under a guest supervisor and setup steps under a guest runner, both started by the adapter and surviving client disconnects; a task's port must be configured with `task.preview.port`, because automatic task-to-port discovery is refused. Private host-only preview requests fail explicitly; native signed preview URLs remain available. Public port discovery lists registered previews, not all listening sockets. Default workspace is prepared at `/project/sandbox`. Command restart preserves the originating client's captured argv, environment and working directory; a command discovered by another client refuses restart because its private spawn recipe is unavailable. |
|
|
131
|
+
| Sprites | No control-mode WebSocket protocol, managed services, provider health/upgrade, port watchers, URL role policy, filesystem checkpoint restoration in place, or full network/privilege/resource policy surfaces. Checkpoint operations fail explicitly because native snapshots also include memory. Session handles use native process IDs, not tmux. The sprite URL maps port 8080. File bytes and process byte streams preserve binary data. |
|
|
132
|
+
| Freestyle | Provider catalog snapshot slugs are not Runtime snapshots and are refused. Firewall support is limited to an explicit empty rule set or the exact allow-public-outbound shape; arbitrary rule selectors, TLS policies and private networks are refused. No automatic-restart guarantee, retention scheduler, placement constraints, live resize, Linux-user switching, PTY namespace, public IPv6 or account-owned egress address emulation. Native snapshot retention is positive whole days. |
|
|
133
|
+
| Modal | CPU sandboxes only; different resource reservation/limit values, fractional CPU, GPU and foreign placement are refused. Named Apps group Runtime sandboxes; they do not deploy Functions. Registry authentication uses Runtime's registry configuration. No Functions/Cls, volumes/bucket mounts, GPU image steps, readiness probes, sidecars, directory mounts, filesystem-only images from snapshots, or snapshot restoration API. Entry-point completion stops the sandbox while the originating client is alive; the native lease remains the bound if that client disappears. A different client can reconnect using the saved entrypoint process ID. |
|
|
134
|
+
| Cloudflare | The conditional Worker entry supplies a Durable Object bridge and custom-hostname preview proxy; infrastructure configuration must still remove the vendor Container declaration and provide Runtime secrets. Custom preview routing is implemented but has no live public-hostname acceptance evidence. No isolated PID namespaces, interpreter contexts, bucket mounts, backup format, terminal WebSocket protocol, watchers/change versions, custom process IDs or provider cleanup-record semantics. Foreground named sessions use resident Bash; background processes inherit exported state/cwd but do not yet inherit every local variable/function/option. |
|
|
135
|
+
|
|
136
|
+
## Keeping compatibility current
|
|
137
|
+
|
|
138
|
+
`compatibility-lock.json` records the inspected versions and package integrity.
|
|
139
|
+
The repository's upstream check detects new releases and changed package contents.
|
|
140
|
+
A deprecated npm package or yanked Python release also requires review; a
|
|
141
|
+
registry failure cannot count as a pass. The daily workflow is source-controlled
|
|
142
|
+
but does not run until pushed to a repository with working GitHub Actions.
|
|
143
|
+
A changed pin is evidence to review, not permission to announce compatibility:
|
|
144
|
+
compare the published declarations, replay the relevant unchanged consumer,
|
|
145
|
+
exercise its failure paths, and update this coverage table with the same change.
|
package/DAYTONA.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Code written for Daytona, on Runtime
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Supported sandbox calls from [Daytona](https://www.daytona.io)'s SDK keep
|
|
4
|
+
their call shapes on Runtime Cloud after changing the import. It is part of Runtime's SDK (`withruntime`), built on
|
|
5
5
|
the same client, so it gets that SDK's retries, idempotency keys and errors.
|
|
6
6
|
Importing `withruntime` alone does not load it.
|
|
7
7
|
|
|
@@ -16,8 +16,9 @@ from withruntime.daytona import Daytona # was: from daytona import Daytona
|
|
|
16
16
|
from withruntime.daytona import AsyncDaytona # was: from daytona import AsyncDaytona
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
The mapping was written against `@daytona/sdk` 0.
|
|
20
|
-
on PyPI, checked
|
|
19
|
+
The mapping was written against `@daytona/sdk` 0.220.0 and `daytona` 0.220.0
|
|
20
|
+
on PyPI, checked 29 September 2026. The exact releases and artifact hashes
|
|
21
|
+
are kept in `compatibility-lock.json`.
|
|
21
22
|
|
|
22
23
|
## Keys
|
|
23
24
|
|
|
@@ -60,6 +61,7 @@ package talks only to Runtime.
|
|
|
60
61
|
| `create({ image: "python:3.12" })` | Built once as a Runtime image from the registry reference (named after it), then reused. `onSnapshotCreateLogs` receives the build log. |
|
|
61
62
|
| `create({ image: Image.debianSlim(...).pipInstall(...)... })` | The Dockerfile Daytona's `Image` stands for, with its local files, built as a Runtime image named after its content and reused. |
|
|
62
63
|
| `resources`, `envVars`, `labels`, `name`, `volumes` | `vcpu`, `memoryMiB`, `diskMiB`; environment given to every command; labels; name; Runtime volumes by id or by name. |
|
|
64
|
+
| `setLabels` (Python `set_labels`) | Replaces customer labels while preserving the language and Runtime compatibility labels; reconnects retain the language. |
|
|
63
65
|
| `networkBlockAll`, `networkAllowList`, `domainAllowList`, `outboundProxyUrl` | Runtime network rules (`internet: false`, or an `allow` list); the proxy as `HTTP_PROXY` and `HTTPS_PROXY` for commands. |
|
|
64
66
|
| `public: true` | `getPreviewLink(port)` shares the port publicly; without it, privately with a token. |
|
|
65
67
|
| `language` | The language of `codeRun`, kept in Daytona's `code-toolbox-language` label so a sandbox found later keeps it. |
|
|
@@ -93,7 +95,7 @@ Each of these throws `NotSupportedError` before anything happens. Its
|
|
|
93
95
|
| `user` other than `daytona` | Commands run as the sandbox owner with passwordless `sudo`. |
|
|
94
96
|
| PTY sessions, the entrypoint session, language servers | `sandbox.withruntime.terminal(...)`, and sessions with `runAsync`. |
|
|
95
97
|
| `computerUse` | Runtime's desktop, `sandbox.withruntime.desktop`. |
|
|
96
|
-
| `
|
|
98
|
+
| `resize`, `recover` | Set labels and resources at create; create a new sandbox. |
|
|
97
99
|
| Signed preview URLs, signed upload and download URLs, SSH access | `getPreviewLink`, `fs.uploadFile` and `downloadFile`, `npx withruntime sandbox ssh <id>`. |
|
|
98
100
|
| `getMetrics` | `sandbox.withruntime.metrics()`: its CPU and memory over time. |
|
|
99
101
|
| `Image.pipInstallFromPyproject`, snapshot `resources` or `entrypoint` | `pipInstallFromRequirements`; resources at create; a session after create. |
|
|
@@ -102,10 +104,14 @@ Each of these throws `NotSupportedError` before anything happens. Its
|
|
|
102
104
|
| `runCode(code, { envs })` | `envVars` at create, or `os.environ` in the code. |
|
|
103
105
|
| Listing by anything but name, labels and states | Filter the result yourself. |
|
|
104
106
|
|
|
107
|
+
File download timeouts are seconds, including buffer and local-path overloads
|
|
108
|
+
and batches. A batch shares one deadline and stops starting later files once
|
|
109
|
+
it expires. JavaScript `downloadFileStream(path, { timeout, signal })` also
|
|
110
|
+
bounds and cancels the stream. An incomplete local download is never published
|
|
111
|
+
as the completed file.
|
|
112
|
+
|
|
105
113
|
Some differences are not refusals:
|
|
106
114
|
|
|
107
|
-
- Sandbox `envVars` live in the object that created the sandbox;
|
|
108
|
-
`daytona.get(id)` from another process does not know them.
|
|
109
115
|
- A session runs one command at a time. A command sent while another runs
|
|
110
116
|
waits for it, as it would typed into a shell. Sessions made by another
|
|
111
117
|
client are found by name, but only their output from then on is known.
|
package/E2B.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Code written for E2B, on Runtime
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Supported sandbox calls from [E2B](https://e2b.dev)'s SDK keep their call
|
|
4
|
+
shapes on Runtime Cloud after changing the import. It is part of Runtime's SDK (`withruntime`), built on the same
|
|
5
5
|
client, so it gets that SDK's retries, idempotency keys and errors. Importing
|
|
6
6
|
`withruntime` alone does not load it.
|
|
7
7
|
|
|
@@ -22,7 +22,8 @@ from withruntime.e2b.code_interpreter import Sandbox # was: from e2b_code_inter
|
|
|
22
22
|
|
|
23
23
|
The mapping was written against `e2b` 2.51.0 and `@e2b/code-interpreter`
|
|
24
24
|
2.8.0 (Python: `e2b` 2.51.0, `e2b-code-interpreter` 2.10.0), checked
|
|
25
|
-
|
|
25
|
+
29 September 2026. The exact package releases and artifact hashes are kept in
|
|
26
|
+
`compatibility-lock.json`.
|
|
26
27
|
|
|
27
28
|
## Keys
|
|
28
29
|
|
|
@@ -58,14 +59,15 @@ machine. An E2B key (`e2b_...`) is never sent anywhere. If one is passed as
|
|
|
58
59
|
| `envs` | Given to every command and code run through this object. |
|
|
59
60
|
| `allowInternetAccess: false` | `network: { internet: false }`. |
|
|
60
61
|
| `lifecycle.onTimeout` | `onLeaseEnd`: `kill` is `stop`, `pause` is `pause`. |
|
|
61
|
-
| `commands.run(cmd, { cwd, envs, timeoutMs, onStdout, onStderr })` |
|
|
62
|
+
| `commands.run(cmd, { cwd, envs, timeoutMs, onStdout, onStderr })` | A native process with streamed output; output lost before it was read sets `truncated` and warns. The default command connection deadline is 60 s; `0` disables it. The sandbox lease still bounds the process. |
|
|
62
63
|
| Non-zero exit | Throws `CommandExitError` with `exitCode`, `stdout`, `stderr` and `error` (`exit status N`). A command killed by a signal has `exitCode` -1. |
|
|
63
|
-
| Command past its timeout |
|
|
64
|
+
| Command past its timeout | Disconnects with `TimeoutError` (Python: `TimeoutException`) without killing the command; reconnect by pid to keep reading. |
|
|
64
65
|
| `commands.run(cmd, { background: true })` | `spawn`. Returns a `CommandHandle` with `pid`, `wait()`, `kill()` (SIGKILL), `sendStdin`, `closeStdin`, `disconnect`, `stdout`, `stderr`, `exitCode`. |
|
|
65
66
|
| `commands.list`, `kill(pid)`, `sendStdin(pid)`, `closeStdin(pid)`, `connect(pid)` | Runtime's processes. A pid is a number derived from Runtime's process id, not the Linux pid. |
|
|
67
|
+
| `pty.create`, `connect`, `sendInput`, `resize`, `kill` (Python snake_case) | Native PTY processes with lossless byte callbacks. A reader timeout or disconnect detaches without killing the process; reconnect resumes reading. |
|
|
66
68
|
| `files.read(path, { format })` | `files.read`. `text`, `bytes`, `blob` and `stream` (Python: `text`, `bytes`, `stream`). |
|
|
67
69
|
| `files.write(path, data)`, `write([...])`, `writeFiles` | `files.write`. Parent directories are made, and a file that exists is replaced. |
|
|
68
|
-
| `files.list(path, { depth })` | `files.list`, hidden files included. `owner` and `group`
|
|
70
|
+
| `files.list(path, { depth })` | `files.list`, hidden files included. `owner` and `group` come from native metadata, with `""` for older guests that omit them. |
|
|
69
71
|
| `files.makeDir`, `exists`, `getInfo`, `rename`, `remove` | `files.stat`, `mkdir`, `rename` (replacing a file that exists) and `remove` (recursive). A missing file throws `FileNotFoundError`. |
|
|
70
72
|
| Relative paths | Resolved against the home directory, `/workspace` on Runtime. |
|
|
71
73
|
| `/home/user` (E2B's home) | The first time a path, `cwd` or command names it, it becomes a link to `/workspace`, unless something is already there. |
|
|
@@ -75,12 +77,12 @@ machine. An E2B key (`e2b_...`) is never sent anywhere. If one is passed as
|
|
|
75
77
|
| `sandbox.pause()`, `betaPause`, `Sandbox.pause(id)` | `pause`, keeping memory and files. `false` when it was already paused. |
|
|
76
78
|
| `getInfo`, `isRunning` | `get`. `templateId` is `base` or the image or snapshot id. `envdVersion` is `runtime`. |
|
|
77
79
|
| `Sandbox.list({ query: { metadata, state }, limit })` | `sandboxes.list` by labels and state, oldest first, with E2B's paginator (`hasNext`, `nextItems()`). |
|
|
78
|
-
| `fork`, `createSnapshot`, `deleteSnapshot` | Runtime's forks and snapshots
|
|
80
|
+
| `fork`, `createSnapshot`, `deleteSnapshot` | Runtime's memory-preserving forks and snapshots; deleting a snapshot removes that saved capture. |
|
|
79
81
|
| `getHost(port)` | `<port>-<id>.runtimehost.com` at once, as E2B answers it, and the port is shared as a public Runtime preview beside the caller (the sync Python sandbox shares it before returning). `await sandbox.getPublicHost(port)` returns once the share has landed. |
|
|
80
|
-
| `runCode(code, { language, context, onStdout, onStderr, onResult, onError, timeoutMs })` | Runtime's interpreter
|
|
82
|
+
| `runCode(code, { language, context, onStdout, onStderr, onResult, onError, timeoutMs })` | Runtime's interpreter: Python, JavaScript, TypeScript, R, Java and Bash, plus Go. The sandbox's `envs` reach code through a context made once for them. `onResult` streams each result and waits for asynchronous callbacks. |
|
|
81
83
|
| `Execution`, `Result`, `Logs`, `ExecutionError`, `OutputMessage` | The same shapes. Results that are too large to send inline are fetched and inlined. `logs.stdout` has one entry per line. |
|
|
82
84
|
| `createCodeContext`, `listCodeContexts`, `restartCodeContext`, `removeCodeContext` | Runtime's interpreter contexts. |
|
|
83
|
-
| `getMetrics({ start, end })`, `Sandbox.getMetrics(id)` | Runtime's measured CPU and memory, one entry per host reading
|
|
85
|
+
| `getMetrics({ start, end })`, `Sandbox.getMetrics(id)` | Runtime's measured CPU and memory, one entry per host reading. `diskUsed` is null: Runtime does not read disk use inside the sandbox. |
|
|
84
86
|
| Error classes | E2B's names and parents. Each also carries Runtime's `code`, `hint` and `requestId`, with the original error as `cause`. |
|
|
85
87
|
|
|
86
88
|
## Gaps
|
|
@@ -103,28 +105,40 @@ before anything happens. The error's `feature` names the gap and its
|
|
|
103
105
|
| `mcp`, `getMcpUrl`, `getMcpToken` | Runtime's own MCP server, `npx withruntime mcp`. |
|
|
104
106
|
| `iam`, `Secret` | A Runtime secret (`npx withruntime secrets set NAME --host <host>`): the sandbox sees a placeholder. |
|
|
105
107
|
| `volumeMounts`, `Volume` | Runtime volumes: `runtime: { create: { volumes: [{ volumeId, path }] } }`. |
|
|
106
|
-
| `pty` | `sandbox.runtime.terminal(...)`. |
|
|
107
108
|
| `git` | `commands.run("git ...")`. E2B has deprecated its git module too. |
|
|
108
|
-
| `files.watchDir` | Poll with `files.list`. |
|
|
109
109
|
| File `metadata` | Keep it in a file beside the data. |
|
|
110
110
|
| `uploadUrl`, `downloadUrl` | `files.write` and `files.read`. |
|
|
111
111
|
| `Sandbox.list` by `template` or `startedAfter`, `order: "desc"`, or from a saved `nextToken` | Filter by metadata, and keep the paginator. |
|
|
112
|
-
| `runCode` in `bash`, `r`, `java` or `typescript` | `commands.run(...)`. |
|
|
113
112
|
| `runCode(code, { envs })` | A context made with them: `sandbox.runtime.interpreter.contexts.create({ env })`. |
|
|
114
113
|
| `domain`, `apiUrl`, `sandboxUrl`, `headers`, `proxy`, `debug` | Remove them. `RUNTIME_API_URL` sets Runtime's origin, and `HTTPS_PROXY` sets a proxy. |
|
|
115
114
|
|
|
115
|
+
Directory watches use Runtime's native watch stream. JavaScript uses
|
|
116
|
+
`files.watchDir(path, onEvent, options)`. Python's synchronous `watch_dir(path)`
|
|
117
|
+
returns a handle with `get_new_events()` and `stop()`; asynchronous
|
|
118
|
+
`watch_dir(path, on_event, on_exit=...)` delivers callbacks. Stop is safe inside
|
|
119
|
+
a callback. Stream failures and lost events are reported, never treated as a
|
|
120
|
+
successful empty watch. A positive watch timeout bounds the client subscription and stops its owned watch;
|
|
121
|
+
zero leaves the subscription unlimited. The sandbox lease still applies. Both languages refuse watching network mounts.
|
|
122
|
+
|
|
123
|
+
PTY `timeoutMs` (Python `timeout`, seconds) defaults to sixty seconds, including
|
|
124
|
+
the opening handshake; zero leaves the reader unlimited. Callbacks receive raw
|
|
125
|
+
bytes while the handle's `stdout` and `stderr` stay empty. PTYs made before
|
|
126
|
+
lossless output support cannot reconnect through this adapter; create a new one.
|
|
127
|
+
The sandbox lease still applies.
|
|
128
|
+
|
|
116
129
|
Some differences are not refusals, so code that depends on them should check:
|
|
117
130
|
|
|
118
|
-
- Sandbox-level `envs` live in the object that created the sandbox.
|
|
119
|
-
`Sandbox.connect(id)` from another process does not know them.
|
|
120
131
|
- Runtime's stock image is Ubuntu 24.04 with Python 3.12, Node.js 24 and Bun.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
build them into an image. Results never carry `chart`. A DataFrame arrives in
|
|
132
|
+
The current stock image includes NumPy, pandas and matplotlib; build an image
|
|
133
|
+
for additional dependencies. Results never carry `chart`. A DataFrame arrives in
|
|
124
134
|
`extra` under `application/vnd.runtime.table+json`, not in E2B's `data`.
|
|
125
|
-
-
|
|
126
|
-
|
|
127
|
-
|
|
135
|
+
- JavaScript file operations, command creation and reads, stdin/EOF, lookup, kill and reconnect honor `requestTimeoutMs` and `signal`.
|
|
136
|
+
Python file `request_timeout` bounds the request, including streamed reads. `retries`, `logger`, `secure` and `validateApiKey` are
|
|
137
|
+
accepted without changing the native transport settings.
|
|
138
|
+
- Interpreter deadlines follow the pinned packages: JavaScript defaults to
|
|
139
|
+
sixty seconds and Python to five minutes; zero disables the read deadline.
|
|
140
|
+
A client timeout detaches the reader without interrupting the cell. The
|
|
141
|
+
sandbox lease still applies.
|
|
128
142
|
|
|
129
143
|
## Tests
|
|
130
144
|
|
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ The client uses `RUNTIME_API_KEY` when it is set, and otherwise the connection
|
|
|
12
12
|
this machine saved when the CLI connected it (one browser approval, no key to
|
|
13
13
|
copy). On a server or a CI runner, set `RUNTIME_API_KEY` from your secret
|
|
14
14
|
manager: `npx withruntime keys create` prints a new key once after an account
|
|
15
|
-
owner approves it in the browser, or create one at
|
|
15
|
+
owner, admin or developer approves it in the browser, or create one at
|
|
16
16
|
https://withruntime.com/account/keys. Never put a key in browser code, a URL or
|
|
17
17
|
a command-line argument.
|
|
18
18
|
|
|
@@ -20,7 +20,8 @@ a command-line argument.
|
|
|
20
20
|
import { Sandbox } from "withruntime";
|
|
21
21
|
|
|
22
22
|
await using sbx = await Sandbox.create();
|
|
23
|
-
|
|
23
|
+
await sbx.files.write("/workspace/invoice.py", "print(sum([125, 250, 375]))\n");
|
|
24
|
+
const result = await sbx.exec("python3 /workspace/invoice.py");
|
|
24
25
|
console.log(result.exitCode, result.stdout);
|
|
25
26
|
```
|
|
26
27
|
|
|
@@ -30,6 +31,8 @@ Node 22 call `await sbx.stop()`). With no arguments you get the free
|
|
|
30
31
|
trial while it lasts (100 free hours, up to eight sandboxes running at once), 2 vCPU, 4 GiB of
|
|
31
32
|
memory and a 4 GiB disk. The current default image includes NumPy, pandas and
|
|
32
33
|
matplotlib; see the [sandbox environment](https://withruntime.com/docs/sandbox-environment).
|
|
34
|
+
Omitting `funding` can use prepaid credit after the trial is exhausted. Use
|
|
35
|
+
`Sandbox.create({ funding: "trial" })` for free use only; it never falls back to paid.
|
|
33
36
|
|
|
34
37
|
The sandbox object does the rest:
|
|
35
38
|
|
|
@@ -41,11 +44,14 @@ The sandbox object does the rest:
|
|
|
41
44
|
- `files` to read, write, list, glob, stat, move and remove, and to copy whole
|
|
42
45
|
directories with `upload` and `download`;
|
|
43
46
|
- `pause`, `wake`, `extend`, `fork` and `snapshot` (a paused sandbox also wakes
|
|
44
|
-
by itself on the next call), `update` for its name,
|
|
45
|
-
and persistence,
|
|
47
|
+
by itself on the next call), `update` for its name, environment, automatic
|
|
48
|
+
wake, idle pause and persistence, `keepAlive` to extend its lease while your
|
|
49
|
+
process runs, `switchImage` to move it to a new image keeping /workspace,
|
|
50
|
+
and `delete` to remove it for good;
|
|
46
51
|
- `interpreter`, `network`, `previews`, `desktop`, `mounts` (your S3, R2 or
|
|
47
|
-
Google Cloud Storage bucket as a folder), `
|
|
48
|
-
the MCP catalog, run in the
|
|
52
|
+
Google Cloud Storage bucket as a folder), `tailscale` (a paid sandbox on your
|
|
53
|
+
own tailnet), `metrics` and `mcp` (servers from the MCP catalog, run in the
|
|
54
|
+
sandbox) for the other products.
|
|
49
55
|
|
|
50
56
|
A sandbox pauses itself after 60 seconds with nothing happening in it, keeping
|
|
51
57
|
its memory and processes, and the next call wakes it, so an idle sandbox costs
|
|
@@ -54,7 +60,9 @@ no compute; `idlePauseSeconds` sets 10 to 86,400, or 0 for never.
|
|
|
54
60
|
`Sandbox.getOrCreate(name)` returns the sandbox with that name, woken if it is
|
|
55
61
|
paused, or creates it.
|
|
56
62
|
|
|
57
|
-
|
|
63
|
+
`runtime.sandbox`, `snapshot`, `image`, `volume`, `job`, `domain`, `port` and
|
|
64
|
+
`address` name the products as the CLI does. Their existing plural names
|
|
65
|
+
remain aliases of the same product clients. The client has `sandboxes`, `images`, `volumes`, `snapshots`, `jobs`, `secrets`,
|
|
58
66
|
`limits`, `feedback` and `support`; `webhooks`, `events`, `otel` and `audit`
|
|
59
67
|
to watch the account; `domains`, `ports`, `addresses`, `tunnel` and `network`
|
|
60
68
|
to connect sandboxes to your own world (paid accounts); and `mcp`, `sso`,
|
|
@@ -62,6 +70,8 @@ to connect sandboxes to your own world (paid accounts); and `mcp`, `sso`,
|
|
|
62
70
|
the key is read-only and what its agent may still spend today. Every write carries an idempotency key, made for you, so the SDK's
|
|
63
71
|
own retries (timeouts, 429, 503) never do anything twice. Errors are typed and
|
|
64
72
|
carry a `code`, a `hint` and a `requestId`.
|
|
73
|
+
`runtime.usageRequests("7d")` reads the account's API call counts and error rates;
|
|
74
|
+
counts are exact decimal strings, and an empty window has a null `errorPercent`.
|
|
65
75
|
|
|
66
76
|
## Behind a proxy
|
|
67
77
|
|
|
@@ -84,7 +94,7 @@ Runtime improves fast because agents tell us what they run into: reports go stra
|
|
|
84
94
|
|
|
85
95
|
## Code written for E2B
|
|
86
96
|
|
|
87
|
-
`withruntime/e2b`
|
|
97
|
+
`withruntime/e2b` translates supported E2B sandbox calls to Runtime. Change the
|
|
88
98
|
import and set `RUNTIME_API_KEY`. The
|
|
89
99
|
[switch guide](https://withruntime.com/docs/migrate) covers the other providers
|
|
90
100
|
and how to work out what you save:
|
|
@@ -118,7 +128,7 @@ package list every mapping and gap.
|
|
|
118
128
|
|
|
119
129
|
## Code written for Blaxel
|
|
120
130
|
|
|
121
|
-
`withruntime/blaxel`
|
|
131
|
+
`withruntime/blaxel` translates supported Blaxel sandbox calls. Change the
|
|
122
132
|
import:
|
|
123
133
|
|
|
124
134
|
```ts no-run
|
|
@@ -129,7 +139,7 @@ Sandboxes get Blaxel's default of 4096 MB, with one vCPU for every 2048 MB.
|
|
|
129
139
|
Standby becomes Runtime's pause: after 60 seconds without a call a sandbox
|
|
130
140
|
pauses with its memory and processes, and the next call wakes it. Envs,
|
|
131
141
|
processes by name, files, previews, snapshots, forks and the code interpreter
|
|
132
|
-
|
|
142
|
+
are supported by the adapter, along with sessions: `sandbox.sessions` makes a
|
|
133
143
|
Runtime sandbox session and `SandboxInstance.fromSession` drives the sandbox
|
|
134
144
|
with its token. A Blaxel key is never sent anywhere. Drives, codegen, schedules and Blaxel's agent, model and MCP hosting throw
|
|
135
145
|
`NotSupportedError` before anything happens, naming what to use instead.
|
|
@@ -149,7 +159,8 @@ https://withruntime.com/docs/frameworks.
|
|
|
149
159
|
## CLI
|
|
150
160
|
|
|
151
161
|
```bash no-run
|
|
152
|
-
|
|
162
|
+
printf '%s\n' 'print(sum([125, 250, 375]))' > invoice.py
|
|
163
|
+
npx withruntime sandbox run -- python3 - < invoice.py # connects on first use
|
|
153
164
|
npx withruntime sandbox create
|
|
154
165
|
npx withruntime help
|
|
155
166
|
```
|
package/README.src.md
CHANGED
|
@@ -14,7 +14,7 @@ The client uses `RUNTIME_API_KEY` when it is set, and otherwise the connection
|
|
|
14
14
|
this machine saved when the CLI connected it (one browser approval, no key to
|
|
15
15
|
copy). On a server or a CI runner, set `RUNTIME_API_KEY` from your secret
|
|
16
16
|
manager: `npx withruntime keys create` prints a new key once after an account
|
|
17
|
-
owner approves it in the browser, or create one at
|
|
17
|
+
owner, admin or developer approves it in the browser, or create one at
|
|
18
18
|
https://withruntime.com/account/keys. Never put a key in browser code, a URL or
|
|
19
19
|
a command-line argument.
|
|
20
20
|
|
|
@@ -22,7 +22,8 @@ a command-line argument.
|
|
|
22
22
|
import { Sandbox } from "withruntime";
|
|
23
23
|
|
|
24
24
|
await using sbx = await Sandbox.create();
|
|
25
|
-
|
|
25
|
+
await sbx.files.write("/workspace/invoice.py", "print(sum([125, 250, 375]))\n");
|
|
26
|
+
const result = await sbx.exec("python3 /workspace/invoice.py");
|
|
26
27
|
console.log(result.exitCode, result.stdout);
|
|
27
28
|
```
|
|
28
29
|
|
|
@@ -32,6 +33,8 @@ Node 22 call `await sbx.stop()`). With no arguments you get the free
|
|
|
32
33
|
trial while it lasts ({{trial-hours}} free hours, up to {{trial-sandboxes}} sandboxes running at once), 2 vCPU, 4 GiB of
|
|
33
34
|
memory and a 4 GiB disk. The current default image includes NumPy, pandas and
|
|
34
35
|
matplotlib; see the [sandbox environment](https://withruntime.com/docs/sandbox-environment).
|
|
36
|
+
Omitting `funding` can use prepaid credit after the trial is exhausted. Use
|
|
37
|
+
`Sandbox.create({ funding: "trial" })` for free use only; it never falls back to paid.
|
|
35
38
|
|
|
36
39
|
The sandbox object does the rest:
|
|
37
40
|
|
|
@@ -43,11 +46,14 @@ The sandbox object does the rest:
|
|
|
43
46
|
- `files` to read, write, list, glob, stat, move and remove, and to copy whole
|
|
44
47
|
directories with `upload` and `download`;
|
|
45
48
|
- `pause`, `wake`, `extend`, `fork` and `snapshot` (a paused sandbox also wakes
|
|
46
|
-
by itself on the next call), `update` for its name,
|
|
47
|
-
and persistence,
|
|
49
|
+
by itself on the next call), `update` for its name, environment, automatic
|
|
50
|
+
wake, idle pause and persistence, `keepAlive` to extend its lease while your
|
|
51
|
+
process runs, `switchImage` to move it to a new image keeping /workspace,
|
|
52
|
+
and `delete` to remove it for good;
|
|
48
53
|
- `interpreter`, `network`, `previews`, `desktop`, `mounts` (your S3, R2 or
|
|
49
|
-
Google Cloud Storage bucket as a folder), `
|
|
50
|
-
the MCP catalog, run in the
|
|
54
|
+
Google Cloud Storage bucket as a folder), `tailscale` (a paid sandbox on your
|
|
55
|
+
own tailnet), `metrics` and `mcp` (servers from the MCP catalog, run in the
|
|
56
|
+
sandbox) for the other products.
|
|
51
57
|
|
|
52
58
|
A sandbox pauses itself after {{idle-pause}} with nothing happening in it, keeping
|
|
53
59
|
its memory and processes, and the next call wakes it, so an idle sandbox costs
|
|
@@ -56,7 +62,9 @@ no compute; `idlePauseSeconds` sets {{idle-pause-min}} to {{idle-pause-max}}, or
|
|
|
56
62
|
`Sandbox.getOrCreate(name)` returns the sandbox with that name, woken if it is
|
|
57
63
|
paused, or creates it.
|
|
58
64
|
|
|
59
|
-
|
|
65
|
+
`runtime.sandbox`, `snapshot`, `image`, `volume`, `job`, `domain`, `port` and
|
|
66
|
+
`address` name the products as the CLI does. Their existing plural names
|
|
67
|
+
remain aliases of the same product clients. The client has `sandboxes`, `images`, `volumes`, `snapshots`, `jobs`, `secrets`,
|
|
60
68
|
`limits`, `feedback` and `support`; `webhooks`, `events`, `otel` and `audit`
|
|
61
69
|
to watch the account; `domains`, `ports`, `addresses`, `tunnel` and `network`
|
|
62
70
|
to connect sandboxes to your own world (paid accounts); and `mcp`, `sso`,
|
|
@@ -64,6 +72,8 @@ to connect sandboxes to your own world (paid accounts); and `mcp`, `sso`,
|
|
|
64
72
|
the key is read-only and what its agent may still spend today. Every write carries an idempotency key, made for you, so the SDK's
|
|
65
73
|
own retries (timeouts, 429, 503) never do anything twice. Errors are typed and
|
|
66
74
|
carry a `code`, a `hint` and a `requestId`.
|
|
75
|
+
`runtime.usageRequests("7d")` reads the account's API call counts and error rates;
|
|
76
|
+
counts are exact decimal strings, and an empty window has a null `errorPercent`.
|
|
67
77
|
|
|
68
78
|
## Behind a proxy
|
|
69
79
|
|
|
@@ -86,7 +96,7 @@ Runtime improves fast because agents tell us what they run into: reports go stra
|
|
|
86
96
|
|
|
87
97
|
## Code written for E2B
|
|
88
98
|
|
|
89
|
-
`withruntime/e2b`
|
|
99
|
+
`withruntime/e2b` translates supported E2B sandbox calls to Runtime. Change the
|
|
90
100
|
import and set `RUNTIME_API_KEY`. The
|
|
91
101
|
[switch guide](https://withruntime.com/docs/migrate) covers the other providers
|
|
92
102
|
and how to work out what you save:
|
|
@@ -120,7 +130,7 @@ package list every mapping and gap.
|
|
|
120
130
|
|
|
121
131
|
## Code written for Blaxel
|
|
122
132
|
|
|
123
|
-
`withruntime/blaxel`
|
|
133
|
+
`withruntime/blaxel` translates supported Blaxel sandbox calls. Change the
|
|
124
134
|
import:
|
|
125
135
|
|
|
126
136
|
```ts no-run
|
|
@@ -131,7 +141,7 @@ Sandboxes get Blaxel's default of 4096 MB, with one vCPU for every 2048 MB.
|
|
|
131
141
|
Standby becomes Runtime's pause: after 60 seconds without a call a sandbox
|
|
132
142
|
pauses with its memory and processes, and the next call wakes it. Envs,
|
|
133
143
|
processes by name, files, previews, snapshots, forks and the code interpreter
|
|
134
|
-
|
|
144
|
+
are supported by the adapter, along with sessions: `sandbox.sessions` makes a
|
|
135
145
|
Runtime sandbox session and `SandboxInstance.fromSession` drives the sandbox
|
|
136
146
|
with its token. A Blaxel key is never sent anywhere. Drives, codegen, schedules and Blaxel's agent, model and MCP hosting throw
|
|
137
147
|
`NotSupportedError` before anything happens, naming what to use instead.
|
|
@@ -151,7 +161,8 @@ https://withruntime.com/docs/frameworks.
|
|
|
151
161
|
## CLI
|
|
152
162
|
|
|
153
163
|
```bash no-run
|
|
154
|
-
|
|
164
|
+
printf '%s\n' 'print(sum([125, 250, 375]))' > invoice.py
|
|
165
|
+
npx withruntime sandbox run -- python3 - < invoice.py # connects on first use
|
|
155
166
|
npx withruntime sandbox create
|
|
156
167
|
npx withruntime help
|
|
157
168
|
```
|