withruntime 0.35.0 → 0.45.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.
Files changed (60) hide show
  1. package/BLAXEL.md +207 -204
  2. package/COMPATIBILITY.md +367 -337
  3. package/DAYTONA.md +180 -173
  4. package/E2B.md +246 -230
  5. package/README.md +182 -142
  6. package/README.src.md +182 -142
  7. package/VERCEL.md +173 -168
  8. package/agent-platforms-inventory.json +387 -0
  9. package/dist/agents-cli.d.ts +7 -1
  10. package/dist/agents-cli.js +470 -6
  11. package/dist/agents-deploy.d.ts +1 -1
  12. package/dist/agents-deploy.js +62 -1
  13. package/dist/apps-cli.d.ts +3 -3
  14. package/dist/apps-cli.js +10 -5
  15. package/dist/browsers-cli.d.ts +1 -1
  16. package/dist/browsers-cli.js +122 -3
  17. package/dist/ci-cli.d.ts +11 -1
  18. package/dist/ci-cli.js +69 -6
  19. package/dist/cli-update.d.ts +11 -0
  20. package/dist/cli-update.js +46 -0
  21. package/dist/cli-words.js +1 -0
  22. package/dist/cli.d.ts +4 -6
  23. package/dist/cli.js +249 -58
  24. package/dist/daytona/daytona.js +1 -1
  25. package/dist/e2b/sandbox.d.ts +6 -5
  26. package/dist/e2b/sandbox.js +6 -5
  27. package/dist/errors.d.ts +4 -3
  28. package/dist/errors.js +7 -3
  29. package/dist/index.d.ts +5 -5
  30. package/dist/inngest/index.d.ts +96 -0
  31. package/dist/inngest/index.js +183 -0
  32. package/dist/jobs-code/cron.d.ts +12 -0
  33. package/dist/jobs-code/cron.js +93 -0
  34. package/dist/jobs-code/registry.d.ts +31 -0
  35. package/dist/jobs-code/registry.js +30 -0
  36. package/dist/jobs-code/runner.d.ts +1 -0
  37. package/dist/jobs-code/runner.js +74 -0
  38. package/dist/jobs-deploy.d.ts +22 -0
  39. package/dist/jobs-deploy.js +247 -0
  40. package/dist/jobs-import.d.ts +15 -0
  41. package/dist/jobs-import.js +231 -0
  42. package/dist/products/agents.d.ts +413 -2
  43. package/dist/products/agents.js +176 -0
  44. package/dist/products/apps.d.ts +2 -1
  45. package/dist/products/browsers.d.ts +87 -0
  46. package/dist/products/browsers.js +67 -0
  47. package/dist/products/builds.d.ts +11 -2
  48. package/dist/products/ci.d.ts +21 -1
  49. package/dist/products/jobs.d.ts +77 -0
  50. package/dist/products/jobs.js +5 -0
  51. package/dist/products/observability.d.ts +31 -3
  52. package/dist/products/plans.d.ts +5 -3
  53. package/dist/products/secrets.d.ts +67 -14
  54. package/dist/products/secrets.js +41 -12
  55. package/dist/transport.d.ts +6 -1
  56. package/dist/transport.js +38 -1
  57. package/dist/trigger/index.d.ts +202 -0
  58. package/dist/trigger/index.js +244 -0
  59. package/dist/types.d.ts +14 -0
  60. package/package.json +14 -3
package/BLAXEL.md CHANGED
@@ -1,34 +1,34 @@
1
1
  # Code written for Blaxel, on Runtime
2
2
 
3
3
  Run code written for [Blaxel](https://docs.blaxel.ai/Sandboxes/Overview)'s
4
- TypeScript sandbox SDK on Runtime Cloud by changing one import. It is part of
5
- Runtime's SDK (`withruntime`), built on the same client, so it gets that SDK's
6
- retries, idempotency keys and errors. Importing `withruntime` alone does not
7
- load it.
4
+ TypeScript sandbox SDK on Runtime Cloud by changing one import. This is part of
5
+ Runtime's SDK (`withruntime`). It is built on the same client, so it gets that
6
+ SDK's retries, idempotency keys and errors. Importing `withruntime` alone does
7
+ not load it.
8
8
 
9
9
  ```ts no-run
10
10
  import { SandboxInstance } from "withruntime/blaxel"; // was: from "@blaxel/core"
11
11
  ```
12
12
 
13
13
  The mapping was written against `@blaxel/core` 0.3.24 and Blaxel's sandbox API
14
- source, checked 30 September 2026, and checked against `@blaxel/core` 0.3.30
15
- and `blaxel` 0.4.18 on PyPI on 16 October 2026 (below, "0.3.30 and 0.4.18").
16
- The exact releases and artifact hashes are kept in `compatibility-lock.json`.
17
- Every name `@blaxel/core` exports can be imported: code that only mentions an
18
- agent, model or MCP helper still loads.
14
+ source, checked 30 September 2026. It was checked again against `@blaxel/core`
15
+ 0.3.30 and `blaxel` 0.4.18 on PyPI on 16 October 2026 (below, "0.3.30 and
16
+ 0.4.18"). The exact releases and artifact hashes are kept in
17
+ `compatibility-lock.json`. You can import every name that `@blaxel/core`
18
+ exports. Code that only mentions an agent, model or MCP helper still loads.
19
19
 
20
20
  ## Keys
21
21
 
22
- The package uses, in order: a Runtime key given to `initialize({ apikey })`,
23
- `RUNTIME_API_KEY`, a Runtime key (`rtcloud_...`) left in `BL_API_KEY`, and the
24
- key `npx withruntime login` saved on this machine. A Blaxel key is never sent
25
- anywhere: in `BL_API_KEY` it is ignored, and passed to `initialize` while
26
- `RUNTIME_API_KEY` is not set it throws `CredentialsError`. `BL_WORKSPACE` means
27
- nothing on Runtime. With no Runtime key at all, the first call throws
28
- `CredentialsError` saying what to set.
22
+ The package uses these keys, in this order: a Runtime key given to
23
+ `initialize({ apikey })`, `RUNTIME_API_KEY`, a Runtime key (`rtcloud_...`) left
24
+ in `BL_API_KEY`, and the key that `npx withruntime login` saved on this machine.
25
+ A Blaxel key is never sent anywhere. In `BL_API_KEY` it is ignored. If you pass
26
+ it to `initialize` while `RUNTIME_API_KEY` is not set, it throws
27
+ `CredentialsError`. `BL_WORKSPACE` has no effect on Runtime. With no Runtime key
28
+ at all, the first call throws `CredentialsError`. The error says what to set.
29
29
 
30
- **A key sees only the sandboxes it created.** A sandbox made with another of
31
- the account's keys answers 404, though its name stays taken
30
+ **A key sees only the sandboxes it created.** A sandbox made with another of the
31
+ account's keys returns 404, though its name stays taken
32
32
  ([teams](https://withruntime.com/docs/teams)). Services that share sandboxes by
33
33
  name, or through `getByExternalId`, use the same Runtime key.
34
34
 
@@ -36,156 +36,159 @@ name, or through `getByExternalId`, use the same Runtime key.
36
36
 
37
37
  - **Machine:** Blaxel's default of 4096 MB. vCPUs follow Blaxel's rule of one
38
38
  per 2048 MB (at least one, at most 16): 2 for the default, 4 for 8192 MB. A
39
- trial sandbox has at most 4096 MB (2 vCPUs); `memory: 8192` or more needs
40
- prepaid credit, and on the trial is refused with a 400 (`no_credit_size_limit`)
41
- saying so.
39
+ trial sandbox has at most 4096 MB (2 vCPUs). `memory: 8192` or more needs
40
+ prepaid credit. On the trial, the call is refused with a 400
41
+ (`no_credit_size_limit`), and the response says so.
42
42
  - **Image:** Blaxel's `base-image`, `py-app`, `ts-app`, `node`,
43
- `docker-in-sandbox` and `jupyter-server` are Runtime's stock image (Ubuntu
44
- 24.04 with Node.js 24, Python 3.12, Bun, git and a compiler; Docker after
45
- `sudo enable-docker`). Any other image `ns/name:tag` is the ready Runtime
46
- image named `ns-name` (every `/` becomes `-`, as Runtime names hold none) at
47
- tag `tag` (`latest` when none is given). Build it once with
48
- `npx withruntime images build --dockerfile Dockerfile --name ns-name -t ns-name:tag`,
49
- and the code keeps `image: "ns/name:tag"` as it is.
50
- - **Standby and lifetime:** a Blaxel sandbox goes to standby when unused and
51
- resumes on the next call. On Runtime it pauses after 60 seconds without a
52
- call (Runtime's shortest idle pause; Blaxel's is about 15 seconds), keeping
53
- its memory, files and processes, and wakes by itself on the next command,
54
- file call or preview visit. It has no time limit, so a sandbox in use is
55
- never paused on a clock.
56
- - **How long it is kept:** Blaxel keeps a sandbox until it is deleted or its
57
- TTL ends. A paused Runtime sandbox is kept 365 days when no TTL, expiry or
58
- lifecycle is given. With one, it is never deleted before Blaxel would delete
59
- it, and may be kept longer:
60
- - a `ttl`, `expires`, `ttl-max-age` or `date` within the hour is a time limit
61
- that ends the sandbox at that time, or later if the sandbox paused and woke;
62
- - any other deadline, and any `ttl-idle`, keeps a paused sandbox that many
63
- days, rounded up, counted from each pause; with several, the shortest wins;
43
+ `docker-in-sandbox` and `jupyter-server` are Runtime's stock image. The stock
44
+ image is Ubuntu 24.04 with Node.js 24, Python 3.12, Bun, git and a compiler.
45
+ Docker is available after `sudo enable-docker`. Any other image `ns/name:tag`
46
+ is the ready Runtime image named `ns-name`. Every `/` becomes `-`, because a
47
+ Runtime name has no `/`. The tag is `tag`, or `latest` when none is given.
48
+ Build the image once with
49
+ `npx withruntime images build --dockerfile Dockerfile --name ns-name -t ns-name:tag`.
50
+ The code keeps `image: "ns/name:tag"` as it is.
51
+ - **Standby and lifetime:** A Blaxel sandbox goes to standby when it is unused.
52
+ It resumes on the next call. On Runtime, the sandbox pauses after 60 seconds
53
+ without a call. This is Runtime's shortest idle pause. Blaxel's is about 15
54
+ seconds. A paused sandbox keeps its memory, files and processes. It wakes by
55
+ itself on the next command, file call or preview visit. The sandbox has no
56
+ time limit, so a sandbox in use is never paused on a clock.
57
+ - **How long it is kept:** Blaxel keeps a sandbox until it is deleted or its TTL
58
+ ends. A paused Runtime sandbox is kept 365 days when no TTL, expiry or
59
+ lifecycle is given. When one is given, the sandbox is never deleted before
60
+ Blaxel would delete it. It may be kept longer:
61
+ - a `ttl`, `expires`, `ttl-max-age` or `date` within the hour is a time limit.
62
+ It ends the sandbox at that time. If the sandbox paused and woke, it ends
63
+ later;
64
+ - any other deadline, and any `ttl-idle`, keeps a paused sandbox for that many
65
+ days, rounded up. The count starts from each pause. With several, the
66
+ shortest wins;
64
67
  - at most 365 days.
65
68
 
66
- On the free trial a paused sandbox is kept the trial's seven days, whatever
67
- the TTL; on credit, as above.
69
+ On the free trial, a paused sandbox is kept for the trial's seven days,
70
+ whatever the TTL. On credit, the rules above apply.
68
71
 
69
72
  - **Envs:** `envs` are written once at create to a file on the sandbox
70
73
  (`/etc/runtime-blaxel/env`, readable by the sandbox user, changed only with
71
- sudo), and every process the adapter starts reads it, from any client, so
74
+ sudo). Every process the adapter starts reads that file, from any client. So
72
75
  `SandboxInstance.get(name)` in another program sees them too. A process's own
73
76
  `env` wins over the sandbox's. Values never appear in a command line.
74
- - **Region:** `us-pdx-1`, `us-was-1` and `auto` are accepted (Runtime runs in
75
- one US region, east); any other, from `region` or `BL_REGION`, is refused.
76
- - **Paths:** Blaxel's images work in `/blaxel`; Runtime's in `/workspace`.
77
- Relative paths, `~` and paths under `/blaxel` resolve against `/workspace`, in
78
- file calls and as a process's `workingDir`, and a command that names
79
- `/blaxel` finds a link to `/workspace`. Other absolute paths are themselves.
80
- - **Funding:** left to Runtime, as `withruntime`'s own create: the free trial
81
- while the account has trial time, then prepaid credit. Pass
82
- `withruntime: { create: { funding: "trial" } }` to use only the trial.
77
+ - **Region:** `us-pdx-1`, `us-was-1` and `auto` are accepted. Runtime runs in one
78
+ US region, east. Any other region, from `region` or `BL_REGION`, is refused.
79
+ - **Paths:** Blaxel's images work in `/blaxel`. Runtime's images work in
80
+ `/workspace`. Relative paths, `~` and paths under `/blaxel` resolve against
81
+ `/workspace`. This applies to file calls and to a process's `workingDir`. A
82
+ command that names `/blaxel` finds a link to `/workspace`. Other absolute paths
83
+ stay as they are.
84
+ - **Funding:** Runtime chooses, as `withruntime`'s own create does. The free
85
+ trial is used while the account has trial time. After that, prepaid credit is
86
+ used. To use only the trial, pass `withruntime: { create: { funding: "trial" } }`.
83
87
  - **Anything else Runtime offers:** `withruntime: { create: { ... } }` sends
84
- Runtime's create fields as they are; `sandbox.withruntime` is the Runtime
88
+ Runtime's create fields as they are. `sandbox.withruntime` is the Runtime
85
89
  sandbox underneath. Static calls take `{ withruntime: { client } }` as a last
86
90
  argument to use a given Runtime client.
87
91
 
88
92
  ## Mapping
89
93
 
90
- | Blaxel | On Runtime |
91
- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
92
- | `SandboxInstance.create({ name, image, memory, labels, ports, envs, ... })` | `sandboxes.create`. A name another live sandbox holds is a 409, as in Blaxel; one held by a sandbox still being deleted is waited for. |
93
- | `createIfNotExists` | `create` with `getOrCreate`: Runtime settles two callers racing for one name, and both get the one sandbox. An existing sandbox is answered as it is. |
94
- | `get(name)`, `getByExternalId`, `list({ limit, externalId, showTerminated })` | The live sandbox with that name, or with the `externalId` label; Blaxel's paginated list (`data`, `nextPage`, `for await`, `autoPagingToArray`). |
95
- | `delete` (static and on the sandbox) | `stop`: the sandbox ends at once. Using that object afterwards is a 404. |
96
- | `metadata`, `spec`, `status`, `state`, `lastUsedAt`, `expiresIn` | From the Runtime sandbox and its `blaxel/` labels (image, memory, ports, region, TTL, expiry, lifecycle, archived), which any client reads; `state` is `STANDBY` while paused. |
97
- | `updateMetadata`, `updateTtl`, `updateLifecycle`, `updateNetwork` | Labels (the display name and `externalId` are labels); the paused retention, as at create; network rules. |
98
- | `archive`, `unarchive` | `pause`, `wake`. Runtime keeps memory and processes too, and the next call wakes it. |
99
- | `network: { allowedDomains, forbiddenDomains, proxy }` | Runtime network rules: `allow` and `deny`. |
100
- | `volumes: [{ name, mountPath }]` | The Runtime volume with that name, mounted read-write. |
101
- | `fetch(port, path, init)` | The request goes to a private Runtime preview of the port (made on first use, then reused) with its token. |
102
- | `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. |
103
- | `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. |
104
- | `onLog`, `onStdout`, `onStderr`, `streamLogs` | The process's output as it comes; `streamLogs` gives whole lines, as Blaxel's does. |
105
- | `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. |
106
- | `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. |
107
- | `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. |
108
- | `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. |
109
- | `fs.ls`, `find`, `grep`, `search` | One command each, with Blaxel's defaults, limits and excluded directories. `ls` reports owners. |
110
- | `fs.watch(path, callback, { withContent, ignore })`, `fs.download` | A Runtime watch (`path/**` for subdirectories); a download to the local disk. |
111
- | `previews.create`, `createIfNotExists`, `get`, `list`, `delete` | Runtime previews of `spec.port`, public or private. The Blaxel name is kept in a label, so any client finds it by name. The shorthand `{ port, name?, public? }` is a private `preview-<port>` unless it says otherwise; `createIfNotExists` answers an existing one as it is. |
112
- | `preview.tokens.createIfExpired(expiresAt?, minValidity?)` | The token this call made last in this process for the sandbox's port, while it lasts `minValidity` more and ends by `expiresAt`; else a new one. Runtime keeps no list of tokens, so a new process makes a new one. |
113
- | `isBlaxelError`, `getBlaxelErrorCode`, `getBlaxelErrorStatus`, `getBlaxelErrorMessage`, `getBlaxelErrorRequestId` | Blaxel's readers over the errors here. A `ResponseError`'s code is its HTTP status, as its `code` is; its request id is Runtime's. |
114
- | `settings.integration`, `initialize({ integration })`, `BL_INTEGRATION` | Kept and checked as Blaxel does (`<name>/<semver>`, warned once and `""` otherwise); never sent, as Runtime does not attribute traffic by it. |
115
- | `preview.tokens.create(expiresAt)` | A token for that long: at least a minute, at most a week. It is read from Blaxel's `X-Blaxel-Preview-Token` header or `?bl_preview_token=` as from Runtime's `x-runtime-preview-token` and `?runtime_preview_token=`, and never passed on to your server. |
116
- | `snapshots.create`, `list`, `get`, `delete`; `Snapshot.create`, `get`, `list`, `fork` | Runtime snapshots, kept 365 days: files, memory and running processes. |
117
- | `fork(name)`, `fork(name, { snapshotId, envs })` | A Runtime fork of the running sandbox, or a new sandbox from the snapshot (by id, or by name among this sandbox's); `envs` are added over the source's. |
118
- | `CodeInterpreter.create`, `runCode`, `createCodeContext` | Runtime's interpreter, with the same result classes. The sandbox's envs reach every context. |
119
- | `sandbox.sessions.create`, `createIfExpired`, `list`, `get`, `delete` | A Runtime sandbox session: a token for commands, files and previews of this one sandbox, for a day unless `expiresAt` says sooner (a day at most). `responseHeaders["Access-Control-Allow-Origin"]` names the pages that may use it; `*`, other response headers and `requestHeaders` are refused. `createIfExpired` reuses the session this process made last; a token is shown only when made. |
120
- | `SandboxInstance.fromSession(session)` | The sandbox, driven with the session's token alone; anything that manages the sandbox is refused. |
121
- | `ResponseError`, `SandboxGatewayError`, `isGatewayError`, `isGatewayTimeout` | Runtime's errors by Blaxel's names: `status` and `code` are the HTTP status; `runtimeCode`, `hint` and `requestId` are Runtime's. |
94
+ | Blaxel | On Runtime |
95
+ | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
96
+ | `SandboxInstance.create({ name, image, memory, labels, ports, envs, ... })` | `sandboxes.create`. A name that another live sandbox holds returns a 409, as in Blaxel. A name held by a sandbox that is still being deleted is waited for. |
97
+ | `createIfNotExists` | `create` with `getOrCreate`. When two callers race for one name, Runtime gives both the same sandbox. An existing sandbox is returned as it is. |
98
+ | `get(name)`, `getByExternalId`, `list({ limit, externalId, showTerminated })` | The live sandbox with that name, or with the `externalId` label. Blaxel's paginated list (`data`, `nextPage`, `for await`, `autoPagingToArray`). |
99
+ | `delete` (static and on the sandbox) | `stop`: the sandbox ends immediately. Using that object afterwards returns a 404. |
100
+ | `metadata`, `spec`, `status`, `state`, `lastUsedAt`, `expiresIn` | From the Runtime sandbox and its `blaxel/` labels (image, memory, ports, region, TTL, expiry, lifecycle, archived), which any client reads. `state` is `STANDBY` while paused. |
101
+ | `updateMetadata`, `updateTtl`, `updateLifecycle`, `updateNetwork` | Labels. The display name and `externalId` are labels. The paused retention is set as at create. Network rules. |
102
+ | `archive`, `unarchive` | `pause`, `wake`. Runtime keeps memory and processes too. The next call wakes the sandbox. |
103
+ | `network: { allowedDomains, forbiddenDomains, proxy }` | Runtime network rules: `allow` and `deny`. |
104
+ | `volumes: [{ name, mountPath }]` | The Runtime volume with that name, mounted read-write. |
105
+ | `fetch(port, path, init)` | The request goes to a private Runtime preview of the port. The preview is made on first use and then reused. The request carries its token. |
106
+ | `process.exec` without `waitForCompletion` | One Runtime process, returned as running. Its Blaxel name is kept in its command line, so `get("name")` finds it from any client. |
107
+ | `process.exec({ waitForCompletion: true })` | One streamed call, returned with `status`, `exitCode`, `stdout`, `stderr` and `logs`. If the call runs past `timeout`, the wait ends with a 422, and the process keeps running. |
108
+ | `onLog`, `onStdout`, `onStderr`, `streamLogs` | The process's output as it comes. `streamLogs` gives whole lines, as Blaxel's does. |
109
+ | `process.get`, `wait`, `list`, `logs`, `stop`, `kill`, `writeStdin`, `closeStdin` | Runtime processes, by id or name. `wait` follows output with one deadline that covers both the lookup and the output. Cancellation leaves the process running. `stop` sends SIGTERM. `kill` sends SIGKILL. |
110
+ | `keepAlive`, `timeout` | The sandbox does not pause for idleness while the process may run. The process's `timeout` is 600 s by default. 0 means as long as a lease allows. Once no `keepAlive` process runs, the sandbox gets its idle pause back. |
111
+ | `restartOnFailure`, `maxRestarts`, `waitForPorts`, `workingDir`, `env`, `stdin` | A restart loop in the same process. The output has Blaxel's note (`restartCount` counts the notes). The sandbox waits for the ports. Otherwise as in Blaxel. |
112
+ | `fs.read`, `write`, `readBinary`, `writeBinary`, `writeTree`, `mkdir`, `rm`, `cp` | Runtime's files API, or one command. A path that only root may read or write goes through sudo. This covers paths outside `/workspace` and files made by a root process. Blaxel's root-owned API could do the same. |
113
+ | `fs.ls`, `find`, `grep`, `search` | One command each, with Blaxel's defaults, limits and excluded directories. `ls` reports owners. |
114
+ | `fs.watch(path, callback, { withContent, ignore })`, `fs.download` | A Runtime watch (`path/**` for subdirectories). `fs.download` saves to the local disk. |
115
+ | `previews.create`, `createIfNotExists`, `get`, `list`, `delete` | Runtime previews of `spec.port`, public or private. The Blaxel name is kept in a label, so any client finds it by name. The shorthand `{ port, name?, public? }` makes a private `preview-<port>` unless it says otherwise. `createIfNotExists` returns an existing preview as it is. |
116
+ | `preview.tokens.createIfExpired(expiresAt?, minValidity?)` | The token this call made last in this process for the sandbox's port is reused while it lasts `minValidity` more and ends by `expiresAt`. Otherwise, a new token is made. Runtime keeps no list of tokens, so a new process makes a new one. |
117
+ | `isBlaxelError`, `getBlaxelErrorCode`, `getBlaxelErrorStatus`, `getBlaxelErrorMessage`, `getBlaxelErrorRequestId` | Blaxel's readers for the errors here. A `ResponseError`'s code is its HTTP status, as its `code` is. Its request id is Runtime's. |
118
+ | `settings.integration`, `initialize({ integration })`, `BL_INTEGRATION` | Kept and checked as Blaxel does (`<name>/<semver>`, warned once and `""` otherwise). Never sent, because Runtime does not attribute traffic by it. |
119
+ | `preview.tokens.create(expiresAt)` | A token for that long: at least a minute, at most a week. It is read from Blaxel's `X-Blaxel-Preview-Token` header or `?bl_preview_token=`, as from Runtime's `x-runtime-preview-token` and `?runtime_preview_token=`. It is never passed on to your server. |
120
+ | `snapshots.create`, `list`, `get`, `delete`; `Snapshot.create`, `get`, `list`, `fork` | Runtime snapshots, kept 365 days: files, memory and running processes. |
121
+ | `fork(name)`, `fork(name, { snapshotId, envs })` | A Runtime fork of the running sandbox. Or a new sandbox from the snapshot, found by id or by name among this sandbox's snapshots. `envs` are added over the source's. |
122
+ | `CodeInterpreter.create`, `runCode`, `createCodeContext` | Runtime's interpreter, with the same result classes. The sandbox's envs reach every context. |
123
+ | `sandbox.sessions.create`, `createIfExpired`, `list`, `get`, `delete` | A Runtime sandbox session: a token for commands, files and previews of this one sandbox. It lasts a day unless `expiresAt` says sooner. A day is the maximum. `responseHeaders["Access-Control-Allow-Origin"]` names the pages that may use it. `*`, other response headers and `requestHeaders` are refused. `createIfExpired` reuses the session this process made last. A token is shown only when it is made. |
124
+ | `SandboxInstance.fromSession(session)` | The sandbox, driven with the session's token alone. Anything that manages the sandbox is refused. |
125
+ | `ResponseError`, `SandboxGatewayError`, `isGatewayError`, `isGatewayTimeout` | Runtime's errors under Blaxel's names. `status` and `code` are the HTTP status. `runtimeCode`, `hint` and `requestId` are Runtime's. |
122
126
 
123
127
  ## Gaps
124
128
 
125
- Each of these throws `NotSupportedError` before anything happens. Its `feature`
126
- names the gap and its `alternative` says what to use.
127
-
128
- | Blaxel | Use instead |
129
- | ------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
130
- | An `image` with no ready Runtime image of the name it maps to (Blaxel's other templates too) | Build it: `npx withruntime images build --dockerfile Dockerfile --name ns-name -t ns-name:tag`; the error gives the exact command. |
131
- | A region outside the US | Runtime runs in one US region. |
132
- | `extraArgs` other than `iptables`; network `egress`, `firewall`, `subnet`, and a `proxy` with more than its domain lists | Remove them; `allowedDomains` and `forbiddenDomains` (on the network or its proxy); Runtime secrets. |
133
- | Read-only and ephemeral volumes; a volume with no Runtime volume of that name | Mount read-write; write scratch files under `/workspace`; `runtime.volumes.create`. |
134
- | `snapshots.restore`, `restore` | Fork from the snapshot into a new sandbox. |
135
- | Forking into an application | Fork into a sandbox and share its port. |
136
- | A preview's `prefixUrl`, `customDomain`, `requestHeaders`, `responseHeaders`, `ttl` | Runtime's fixed preview address; set headers (CORS) in your server; delete the preview. |
137
- | `preview.tokens.list()`; a token for over a week | Keep the tokens you create; create a new one when it runs out. |
138
- | `runCode` with `envs` for one run; a language Runtime's interpreter lacks | Sandbox envs at create, or set them in the code; `process.exec`. |
139
- | Listing by `cursor`, `q`, `anchor`, a status other than `DEPLOYED`, or newest first | List and filter the result yourself; `nextPage()` walks the pages. |
140
- | `schedules`, `codegen`, `system`, `drives` | A Runtime job (`runtime.jobs.create`, a fresh sandbox each run) or your own scheduler; `fs.write`; nothing to upgrade; Runtime volumes. |
141
- | Agents, models, tools, MCP transports, jobs, applications, images, volumes, drives | Your own agent with Runtime sandboxes, `withruntime/tools`, `npx withruntime mcp`, `runtime.images`, `runtime.volumes`. |
142
- | Blaxel's generated API functions (`createSandbox`, `postProcess`, ...) | `SandboxInstance` here, or `import { Runtime } from "withruntime"`. |
129
+ Each of these throws `NotSupportedError` before anything happens. The `feature`
130
+ names the gap. The `alternative` says what to use.
131
+
132
+ | Blaxel | Use instead |
133
+ | ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
134
+ | An `image` with no ready Runtime image of the name it maps to (Blaxel's other templates too) | Build it: `npx withruntime images build --dockerfile Dockerfile --name ns-name -t ns-name:tag`. The error gives the exact command. |
135
+ | A region outside the US | Runtime runs in one US region. |
136
+ | `extraArgs` other than `iptables`; network `egress`, `firewall`, `subnet`, and a `proxy` with more than its domain lists | Remove them. Use `allowedDomains` and `forbiddenDomains` (on the network or its proxy), or Runtime secrets. |
137
+ | Read-only and ephemeral volumes; a volume with no Runtime volume of that name | Mount read-write. Write scratch files under `/workspace`. Or use `runtime.volumes.create`. |
138
+ | `snapshots.restore`, `restore` | Fork from the snapshot into a new sandbox. |
139
+ | Forking into an application | Fork into a sandbox and share its port. |
140
+ | A preview's `prefixUrl`, `customDomain`, `requestHeaders`, `responseHeaders`, `ttl` | Use Runtime's fixed preview address. Set headers (CORS) in your server. Delete the preview. |
141
+ | `preview.tokens.list()`; a token for over a week | Keep the tokens you create. Create a new one when it runs out. |
142
+ | `runCode` with `envs` for one run; a language Runtime's interpreter lacks | Set sandbox envs at create, or set them in the code. Or use `process.exec`. |
143
+ | Listing by `cursor`, `q`, `anchor`, a status other than `DEPLOYED`, or newest first | List and filter the result yourself. `nextPage()` walks the pages. |
144
+ | `schedules`, `codegen`, `system`, `drives` | A Runtime job (`runtime.jobs.create`, a fresh sandbox each run), or your own scheduler. `fs.write`. Nothing to upgrade. Runtime volumes. |
145
+ | Agents, models, tools, MCP transports, jobs, applications, images, volumes, drives | Your own agent with Runtime sandboxes, `withruntime/tools`, `npx withruntime mcp`, `runtime.images`, `runtime.volumes`. |
146
+ | Blaxel's generated API functions (`createSandbox`, `postProcess`, ...) | `SandboxInstance` here, or `import { Runtime } from "withruntime"`. |
143
147
 
144
148
  Some differences are not refusals:
145
149
 
146
- - **A public preview needs a paid sandbox;** on the trial, share a port
150
+ - **A public preview needs a paid sandbox.** On the trial, share a port
147
151
  privately and use a token.
148
- - **Commands run as root,** as on Blaxel: every process the adapter starts
149
- (`exec`, `keepAlive`, restart loops) hands over to passwordless `sudo`,
150
- keeping the envs, the sandbox user's `PATH` and `HOME` (`/workspace`, which
151
- stands for Blaxel's `/blaxel`). `id -u` prints 0 and `pwd` prints
152
- `/workspace`. Stopping or killing a process ends it and everything it
153
- started. The file calls act as the sandbox user and fall back to `sudo`
154
- where only root may go, so files a root process made stay readable,
155
- writable and removable through `fs`; a file the adapter rewrites that way
156
- becomes the sandbox user's. `ls`, `find`, `grep`, `search` and `writeTree`
157
- run as the sandbox user, so they skip what only root may read. The code
158
- interpreter's contexts run as the sandbox user (Blaxel's Jupyter server runs
159
- as root).
160
- - **A paused sandbox keeps its memory and processes** across `archive`, where
161
- Blaxel's archive keeps only files and starts the processes again.
162
- - **Standby starts after 60 seconds idle** rather than about 15, and a running
163
- process does not count as use unless it was started with `keepAlive`. A
164
- `keepAlive` process raises the sandbox's idle pause to its `timeout` (off for
165
- `timeout: 0`) and keeps the old one in the `blaxel/idlePauseSeconds` label.
166
- The old idle pause comes back once no `keepAlive` process runs, when a client
152
+ - **Commands run as root,** as on Blaxel. Every process the adapter starts
153
+ (`exec`, `keepAlive`, restart loops) hands over to passwordless `sudo`. It
154
+ keeps the envs, the sandbox user's `PATH` and `HOME` (`/workspace`, which
155
+ stands for Blaxel's `/blaxel`). `id -u` prints 0, and `pwd` prints
156
+ `/workspace`. Stopping or killing a process ends it and everything it started.
157
+ The file calls act as the sandbox user. They fall back to `sudo` where only
158
+ root may go. So files a root process made stay readable, writable and
159
+ removable through `fs`. A file that the adapter rewrites that way becomes the
160
+ sandbox user's. `ls`, `find`, `grep`, `search` and `writeTree` run as the
161
+ sandbox user, so they skip what only root may read. The code interpreter's
162
+ contexts run as the sandbox user. Blaxel's Jupyter server runs as root.
163
+ - **A paused sandbox keeps its memory and processes** across `archive`. Blaxel's
164
+ archive keeps only files and starts the processes again.
165
+ - **Standby starts after 60 seconds idle,** not about 15. A running process does
166
+ not count as use unless it was started with `keepAlive`. A `keepAlive` process
167
+ raises the sandbox's idle pause to its `timeout` (off for `timeout: 0`). The
168
+ old idle pause is kept in the `blaxel/idlePauseSeconds` label. The old idle
169
+ pause comes back once no `keepAlive` process runs. That happens when a client
167
170
  sees one end (a waited exec, `wait` or `get`), stops or kills one, or calls
168
171
  `SandboxInstance.get`. With no such call, the sandbox pauses when it has been
169
- idle for that `timeout`. On a sandbox with a time limit, a `keepAlive`
170
- process past it is paused with the sandbox when the limit ends with no call
171
- to renew it, and carries on at the next call.
172
+ idle for that `timeout`. On a sandbox with a time limit, a `keepAlive` process
173
+ past the limit is paused with the sandbox when the limit ends, if no call
174
+ renews it. The process carries on at the next call.
172
175
  - **A name is not refused while its process runs:** a second process may take a
173
- running process's name, and `get(name)` answers the newest.
176
+ running process's name. `get(name)` returns the newest.
174
177
  - **`process.list()` leaves each process's output empty** (Blaxel includes a
175
- tail of it); `get(name)` or `logs(name)` reads it. A process ended by a signal
176
- reports exit code -1 and `stopped` (SIGTERM) or `killed` (SIGKILL, or its
177
- time limit), from any client.
178
- - **Runtime records a command's first 256 characters.** A process started with
179
- a longer command keeps its name; from another client its `command` is the
180
- start of what was run.
181
- - **`fs.search`** scores matches by its own rule (characters in order, runs and
182
- word starts first), not Blaxel's fzf scores. `grep`'s `contextLines` is
183
- accepted and, as in Blaxel's API, not used.
184
- - **`ls`, `find`, `grep`, `search` and `writeTree` run a short Python script,**
185
- so on an image without `python3` they throw `NotSupportedError`; `ls` then
186
- lists through the files API, without owners.
178
+ tail of it). `get(name)` or `logs(name)` reads the output. A process ended by
179
+ a signal reports exit code -1. It reports `stopped` (SIGTERM) or `killed`
180
+ (SIGKILL, or its time limit), from any client.
181
+ - **Runtime records a command's first 256 characters.** A process started with a
182
+ longer command keeps its name. From another client, its `command` is the start
183
+ of what was run.
184
+ - **`fs.search`** scores matches by its own rule: characters in order, with runs
185
+ and word starts first. It does not use Blaxel's fzf scores. `grep`'s
186
+ `contextLines` is accepted. As in Blaxel's API, it is not used.
187
+ - **`ls`, `find`, `grep`, `search` and `writeTree` run a short Python script.**
188
+ On an image without `python3`, they throw `NotSupportedError`. `ls` then lists
189
+ through the files API, without owners.
187
190
  - **`spec.runtime.envs`, `network` and `volumes`** are known only to the client
188
- that created the sandbox; the envs themselves reach every process from any
191
+ that created the sandbox. The envs themselves reach every process from any
189
192
  client. Port names are not kept: `ports` come back as numbers.
190
193
  - A preview token shorter than a minute lasts a minute. Deleting one token
191
194
  revokes every token of that preview.
@@ -193,94 +196,94 @@ Some differences are not refusals:
193
196
  ## 0.3.30 and 0.4.18, 16 October 2026
194
197
 
195
198
  Reviewed the published npm tarball of `@blaxel/core` 0.3.29 → 0.3.30 and the
196
- PyPI wheel and sdist of `blaxel` 0.4.17 → 0.4.18, each its registry's latest
197
- when checked. The pinned files matched `compatibility-lock.json`, the new ones
198
- their registry's SHA-512 integrity or SHA-256 digest, and the wheel's source is
199
- byte for byte its sdist's. They were compared file by file; nothing was
199
+ PyPI wheel and sdist of `blaxel` 0.4.17 → 0.4.18. Each was its registry's latest
200
+ when checked. The pinned files matched `compatibility-lock.json`. The new files
201
+ matched their registry's SHA-512 integrity or SHA-256 digest. The wheel's source
202
+ is byte for byte its sdist's. They were compared file by file. Nothing was
200
203
  installed or run outside the oracle. The npm package's dependencies did not
201
204
  change.
202
205
 
203
- | Upstream change | Drop-in disposition |
204
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
205
- | Workspace secrets, which Blaxel's proxy puts into a sandbox's routing as `{{SECRET:name}}`: the generated API calls `listSecrets`, `upsertSecret`, `deleteSecret`, `deleteSecretByQuery`; Python `SecretInstance`, `SyncSecretInstance` (`set`, `list`, `delete`), `SecretAPIError` and `blaxel.core.secret`. | Importable and refused with `NotSupportedError` naming Runtime secrets, `runtime.secrets.set(name, { value, hosts })`: a Runtime secret names the hosts it may reach, which Blaxel's calls do not, and the drop-in already refuses Blaxel's proxy routing. `SecretAPIError` is a `BlaxelError`, never raised. Before, the imports failed. |
206
- | `deleteDriveFolder` in the generated API. | Importable and refused, as every drive call is. |
207
- | The SDK sends an "Installed SDK" event to PostHog once per version (internal `common/posthog`, not exported). | Nothing to follow: the drop-in sends nothing to Blaxel or its analytics. |
208
- | Custom domains' `validationMethod`, the `kernelExtensions` extra argument, and doc text (the 60 s floor of `ttl-idle`). | Nothing new to do: custom domains are refused, an extra argument other than `iptables` is refused, and the drop-in has no `ttl-idle` floor (a paused sandbox is kept whole days). |
209
-
210
- `tests/blaxel/blaxel-0-3-30.test.ts` (2) and
211
- `sdks/python/tests/test_blaxel_0_4_18.py` (2) fail without this change; the
212
- export list moves to 0.3.30's 275 names. `compat-inventory.json`: blaxel 611
213
- present, 123 refused, 31 missing of 765 before; 616, 123, 31 of 770 now.
214
- blaxel-python 375, 11, 652 of 1038 before; 388, 11, 672 of 1071 now (the
215
- inventory counts the Python stand-ins, as `ImageInstance` before them, as
216
- missing).
206
+ | Upstream change | Drop-in disposition |
207
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
208
+ | Workspace secrets, which Blaxel's proxy puts into a sandbox's routing as `{{SECRET:name}}`: the generated API calls `listSecrets`, `upsertSecret`, `deleteSecret`, `deleteSecretByQuery`; Python `SecretInstance`, `SyncSecretInstance` (`set`, `list`, `delete`), `SecretAPIError` and `blaxel.core.secret`. | Importable. Refused with `NotSupportedError` that names Runtime secrets: `runtime.secrets.set(name, { value, hosts })`. A Runtime secret names the hosts it may reach. Blaxel's calls do not. The drop-in already refuses Blaxel's proxy routing. `SecretAPIError` is a `BlaxelError`, and it is never raised. Before, the imports failed. |
209
+ | `deleteDriveFolder` in the generated API. | Importable and refused, as every drive call is. |
210
+ | The SDK sends an "Installed SDK" event to PostHog once per version (internal `common/posthog`, not exported). | Nothing to follow. The drop-in sends nothing to Blaxel or its analytics. |
211
+ | Custom domains' `validationMethod`, the `kernelExtensions` extra argument, and doc text (the 60 s floor of `ttl-idle`). | Nothing new to do. Custom domains are refused. An extra argument other than `iptables` is refused. The drop-in has no `ttl-idle` floor, so a paused sandbox is kept whole days. |
212
+
213
+ These tests fail without this change: `tests/blaxel/blaxel-0-3-30.test.ts` (2)
214
+ and `sdks/python/tests/test_blaxel_0_4_18.py` (2). The export list moves to
215
+ 0.3.30's 275 names. In `compat-inventory.json`, blaxel had 611 present, 123
216
+ refused and 31 missing, of 765, before. It has 616, 123 and 31, of 770, now.
217
+ blaxel-python had 375, 11 and 652, of 1038, before. It has 388, 11 and 672, of
218
+ 1071, now. The inventory counts the Python stand-ins as missing, as it did
219
+ `ImageInstance` before them.
217
220
 
218
221
  ## 0.3.29 and 0.4.17, 15 October 2026
219
222
 
220
223
  Reviewed the published npm tarball of `@blaxel/core` 0.3.25 → 0.3.29 and the
221
- PyPI wheel and sdist of `blaxel` 0.4.13 → 0.4.17 (0.3.26 to 0.3.28 and 0.4.14
222
- to 0.4.16 came out between, all on 13 October). Each was its registry's latest
224
+ PyPI wheel and sdist of `blaxel` 0.4.13 → 0.4.17. 0.3.26 to 0.3.28 and 0.4.14
225
+ to 0.4.16 came out between, all on 13 October. Each was its registry's latest
223
226
  when checked. The pinned files matched the hashes already in
224
- `compatibility-lock.json`, the new ones their registry's SHA-512 integrity or
225
- SHA-256 digest, and each wheel's Python source is byte for byte its sdist's.
226
- They were compared file by file; nothing was installed or run outside the
227
- oracle, which runs 0.3.29 and passes. The npm package's dependencies did not
227
+ `compatibility-lock.json`. The new files matched their registry's SHA-512
228
+ integrity or SHA-256 digest. Each wheel's Python source is byte for byte its
229
+ sdist's. They were compared file by file. Nothing was installed or run outside
230
+ the oracle, which runs 0.3.29 and passes. The npm package's dependencies did not
228
231
  change. Python's `withruntime.blaxel` follows the same changes under Python's
229
232
  names: `BlaxelError`, `is_blaxel_error(err, code=None)`,
230
233
  `SandboxPreviewCreateConfiguration`, `create_if_expired(expires_at=None,
231
234
  min_validity=timedelta(hours=1))`, `settings.integration`.
232
235
 
233
- | Upstream change | Drop-in disposition |
234
- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
235
- | Error helpers `isBlaxelError`, `getBlaxelErrorCode`, `getBlaxelErrorStatus`, `getBlaxelErrorMessage`, `getBlaxelErrorRequestId` and the error code and body types. Python: `BlaxelError` becomes the base of `ResponseError` and every `*APIError`, with `status`, `code`, `request_id`, `retryable` and the rest, and `is_blaxel_error`. | Followed. The helpers read the drop-in's errors with Blaxel's rules; a request id with no Blaxel header is Runtime's. In Python every API error the drop-in raises is a `BlaxelError`: `status` is the HTTP status, `code` Runtime's code, `request_id` Runtime's, `retryable` Runtime's own judgement; Blaxel's gateway fields are None. `VolumeAPIError` and `blaxel.core.errors` import. |
236
- | `previews.create` and `createIfNotExists` take `{ port, name?, public? }` (Python: a dict or `SandboxPreviewCreateConfiguration`): a private `preview-<port>` by default, checked with `RangeError` (Python `ValueError`); an existing preview is answered as it is. | Followed, with Blaxel's checks and messages, before anything is shared. Before, the shorthand failed (`spec.port is required`, or a TypeError in `createIfNotExists`). |
237
- | `preview.tokens.createIfExpired(expiresAt?, minValidity?)` reuses the latest listed token that lasts `minValidity` (an hour) more and ends by `expiresAt` (a day), else makes one; a public preview is refused. | Followed. Runtime keeps no list of the tokens it signs, so the token reused is the one this call made last in this process for the sandbox's port; arguments and the public refusal are Blaxel's, checked before any request. Revoking the preview's tokens (`tokens.delete`) forgets it. |
238
- | `SandboxPreview.url`, `SandboxPreviewToken.name`. | Followed. |
239
- | `settings.integration`, `Config.integration` and `BL_INTEGRATION`: a `<name>/<semver>` token appended to Blaxel's User-Agent. | Kept and checked as Blaxel does, warned once when invalid, never sent: it only attributes traffic to Blaxel. Before, `settings.integration` threw `NotSupportedError`. Python's `settings.user_agent` and other settings still raise `NotSupportedError`. |
240
- | `fs.search` now sends its query (it was dropped). | Nothing to do: the drop-in's search always used it. |
241
- | `ImageInstance` takes `buildMemory`, `buildVolume`, `buildRegion`; generated API clients gain `headFilesystemByPath`, service-account `role`, and doc text; Python's resource errors keep the response. | Nothing to follow: `ImageInstance` and the generated API calls stay refused with Runtime's alternative (`runtime.images`, `SandboxInstance`). Python's `ResponseError.from_api_response`, which wraps a generated-client response, now raises `NotSupportedError` saying so. |
242
-
243
- `tests/blaxel/blaxel-0-3-29.test.ts` (9) and
244
- `sdks/python/tests/test_blaxel_0_4_17.py` (9) fail without this change. The
245
- export list moves to 0.3.29's 270 names. `compat-inventory.json`, regenerated
246
- from the verified packages: blaxel 596 present, 123 refused, 31 missing before
247
- (of 750); 611, 123, 31 now (of 765). blaxel-python 252, 9, 642 before (of
248
- 903, 0.4.13 exported fewer names from `blaxel.core`); 375, 11, 652 now (of
249
- 1038). The pinned-official Python tests (`RUNTIME_COMPAT_OFFICIAL=1`) were not
250
- run against 0.4.17.
236
+ | Upstream change | Drop-in disposition |
237
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
238
+ | Error helpers `isBlaxelError`, `getBlaxelErrorCode`, `getBlaxelErrorStatus`, `getBlaxelErrorMessage`, `getBlaxelErrorRequestId` and the error code and body types. Python: `BlaxelError` becomes the base of `ResponseError` and every `*APIError`, with `status`, `code`, `request_id`, `retryable` and the rest, and `is_blaxel_error`. | Followed. The helpers read the drop-in's errors with Blaxel's rules. A request id with no Blaxel header is Runtime's. In Python, every API error the drop-in raises is a `BlaxelError`. `status` is the HTTP status. `code` is Runtime's code. `request_id` is Runtime's. `retryable` is Runtime's own judgement. Blaxel's gateway fields are None. `VolumeAPIError` and `blaxel.core.errors` import. |
239
+ | `previews.create` and `createIfNotExists` take `{ port, name?, public? }` (Python: a dict or `SandboxPreviewCreateConfiguration`): a private `preview-<port>` by default, checked with `RangeError` (Python `ValueError`); an existing preview is answered as it is. | Followed, with Blaxel's checks and messages, before anything is shared. Before, the shorthand failed (`spec.port is required`, or a TypeError in `createIfNotExists`). |
240
+ | `preview.tokens.createIfExpired(expiresAt?, minValidity?)` reuses the latest listed token that lasts `minValidity` (an hour) more and ends by `expiresAt` (a day), else makes one; a public preview is refused. | Followed. Runtime keeps no list of the tokens it signs, so the token reused is the one this call made last in this process for the sandbox's port. Arguments and the public refusal are Blaxel's, checked before any request. Revoking the preview's tokens (`tokens.delete`) forgets it. |
241
+ | `SandboxPreview.url`, `SandboxPreviewToken.name`. | Followed. |
242
+ | `settings.integration`, `Config.integration` and `BL_INTEGRATION`: a `<name>/<semver>` token appended to Blaxel's User-Agent. | Kept and checked as Blaxel does, and warned about once when invalid. Never sent: it only attributes traffic to Blaxel. Before, `settings.integration` threw `NotSupportedError`. Python's `settings.user_agent` and other settings still raise `NotSupportedError`. |
243
+ | `fs.search` now sends its query (it was dropped). | Nothing to do: the drop-in's search always used it. |
244
+ | `ImageInstance` takes `buildMemory`, `buildVolume`, `buildRegion`; generated API clients gain `headFilesystemByPath`, service-account `role`, and doc text; Python's resource errors keep the response. | Nothing to follow. `ImageInstance` and the generated API calls stay refused, with Runtime's alternative (`runtime.images`, `SandboxInstance`). Python's `ResponseError.from_api_response`, which wraps a generated-client response, now raises `NotSupportedError` and says so. |
245
+
246
+ These tests fail without this change: `tests/blaxel/blaxel-0-3-29.test.ts` (9)
247
+ and `sdks/python/tests/test_blaxel_0_4_17.py` (9). The export list moves to
248
+ 0.3.29's 270 names. `compat-inventory.json` was regenerated from the verified
249
+ packages. blaxel had 596 present, 123 refused and 31 missing before (of 750). It
250
+ has 611, 123 and 31 now (of 765). blaxel-python had 252, 9 and 642 before (of
251
+ 903, since 0.4.13 exported fewer names from `blaxel.core`). It has 375, 11 and
252
+ 652 now (of 1038). The pinned official Python tests (`RUNTIME_COMPAT_OFFICIAL=1`)
253
+ were not run against 0.4.17.
251
254
 
252
255
  ## The process line
253
256
 
254
- A process's command line, which both this package and the Python one write
255
- (`processLine` in `src/blaxel/context.ts`), so either finds and follows the
256
- other's processes. One line, parts joined by `; `, quotes single with `'`
257
- written `'\''`:
257
+ Both this package and the Python one write a process's command line
258
+ (`processLine` in `src/blaxel/context.ts`). So either one finds and follows the
259
+ other's processes. It is one line. Parts are joined by `; `. A single quote `'`
260
+ is written `'\''`:
258
261
 
259
262
  ```text
260
263
  : rt-blaxel '<name>'; [: rt-blaxel-keep; ]export HOST="${HOST:-0.0.0.0}"; [ -r /etc/runtime-blaxel/env ] && . /etc/runtime-blaxel/env; unset RUNTIME_BLAXEL_KEEP; [{ [ -e /blaxel ] || sudo ln -s /workspace /blaxel; } 2>/dev/null; ]__rt_cmd='<command>'; export __rt_cmd; exec sudo -E env "PATH=$PATH" "HOME=$HOME" bash -c '<run>'
261
264
  ```
262
265
 
263
- `: rt-blaxel-keep;` is there for a `keepAlive` process; the link part when the
264
- command or its env names `/blaxel`. `<run>` is `eval "$__rt_cmd"`, or with
265
- `restartOnFailure` the restart loop:
266
+ `: rt-blaxel-keep;` is there for a `keepAlive` process. The link part is there
267
+ when the command or its env names `/blaxel`. `<run>` is `eval "$__rt_cmd"`. With
268
+ `restartOnFailure`, it is the restart loop:
266
269
  `__rt_n=0; while :; do ( eval "$__rt_cmd" ); __rt_c=$?; [ $__rt_c -eq 0 ] && exit 0; [ $__rt_n -ge <max> ] && exit $__rt_c; __rt_n=$((__rt_n+1)); printf '\n[Process failed with exit code %d. Attempting restart %d/%s...]\n' $__rt_c $__rt_n '<max or unlimited>'; done`
267
- (the `-ge` test left out when `maxRestarts` is negative). A process's own
268
- `env` is sent with `RUNTIME_BLAXEL_KEEP=":NAME1:NAME2:"`, so the env file
269
- leaves those names alone.
270
+ The `-ge` test is left out when `maxRestarts` is negative. A process's own `env`
271
+ is sent with `RUNTIME_BLAXEL_KEEP=":NAME1:NAME2:"`. So the env file leaves those
272
+ names alone.
270
273
 
271
274
  ## Tests
272
275
 
273
276
  `bun run test` in `packages/cloud-sdk` runs the unit tests against a fake of
274
- Runtime's SDK: `tests/blaxel`, including a check that every name
275
- `@blaxel/core` 0.3.30 exports is exported here.
276
-
277
- The end-to-end test runs Blaxel's guides, unmodified but for the import,
278
- against the real API: `tests/fixtures/blaxel-quickstart.mjs` (create, processes,
279
- log streaming and files) and `tests/fixtures/blaxel-previews.mjs` (envs, ports,
280
- previews, snapshots and forks). It then times a new sandbox's first command
281
- through the adapter and through `withruntime`. It refuses to start unless the
282
- free trial has an hour left, and ends every sandbox it creates. It is not part
283
- of `bun run test`.
277
+ Runtime's SDK. The tests are in `tests/blaxel`. They include a check that every
278
+ name that `@blaxel/core` 0.3.30 exports is also exported here.
279
+
280
+ The end-to-end test runs Blaxel's guides against the real API. The only change
281
+ is the import. The guides are `tests/fixtures/blaxel-quickstart.mjs` (create,
282
+ processes, log streaming and files) and `tests/fixtures/blaxel-previews.mjs`
283
+ (envs, ports, previews, snapshots and forks). The test then times a new
284
+ sandbox's first command. It does this through the adapter and through
285
+ `withruntime`. The test does not start unless the free trial has an hour left.
286
+ It ends every sandbox it creates. It is not part of `bun run test`.
284
287
 
285
288
  ```bash no-run
286
289
  bun packages/cloud-sdk/scripts/dropin-e2e.ts --only blaxel