withruntime 0.35.0 → 0.37.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 +207 -204
- package/COMPATIBILITY.md +367 -337
- package/DAYTONA.md +180 -173
- package/E2B.md +246 -230
- package/README.md +182 -142
- package/README.src.md +182 -142
- package/VERCEL.md +173 -168
- package/agent-platforms-inventory.json +387 -0
- package/dist/agents-cli.d.ts +7 -1
- package/dist/agents-cli.js +219 -2
- package/dist/ci-cli.d.ts +7 -1
- package/dist/ci-cli.js +25 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +16 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +4 -1
- package/dist/index.d.ts +3 -3
- package/dist/inngest/index.d.ts +96 -0
- package/dist/inngest/index.js +183 -0
- package/dist/jobs-code/cron.d.ts +12 -0
- package/dist/jobs-code/cron.js +93 -0
- package/dist/jobs-code/registry.d.ts +31 -0
- package/dist/jobs-code/registry.js +30 -0
- package/dist/jobs-code/runner.d.ts +1 -0
- package/dist/jobs-code/runner.js +74 -0
- package/dist/jobs-deploy.d.ts +22 -0
- package/dist/jobs-deploy.js +247 -0
- package/dist/jobs-import.d.ts +15 -0
- package/dist/jobs-import.js +231 -0
- package/dist/products/agents.d.ts +161 -1
- package/dist/products/agents.js +40 -0
- package/dist/products/ci.d.ts +19 -1
- package/dist/products/jobs.d.ts +77 -0
- package/dist/products/jobs.js +5 -0
- package/dist/transport.d.ts +5 -1
- package/dist/transport.js +7 -1
- package/dist/trigger/index.d.ts +202 -0
- package/dist/trigger/index.js +244 -0
- 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.
|
|
5
|
-
Runtime's SDK (`withruntime`)
|
|
6
|
-
retries, idempotency keys and errors. Importing `withruntime` alone does
|
|
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
|
|
15
|
-
and `blaxel` 0.4.18 on PyPI on 16 October 2026 (below, "0.3.30 and
|
|
16
|
-
The exact releases and artifact hashes are kept in
|
|
17
|
-
|
|
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
|
|
23
|
-
`RUNTIME_API_KEY`, a Runtime key (`rtcloud_...`) left
|
|
24
|
-
key `npx withruntime login` saved on this machine.
|
|
25
|
-
anywhere
|
|
26
|
-
`RUNTIME_API_KEY` is not set it throws
|
|
27
|
-
|
|
28
|
-
`CredentialsError
|
|
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
|
-
|
|
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)
|
|
40
|
-
prepaid credit
|
|
41
|
-
|
|
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
|
|
44
|
-
24.04 with Node.js 24, Python 3.12, Bun, git and a compiler
|
|
45
|
-
`sudo enable-docker
|
|
46
|
-
image named `ns-name
|
|
47
|
-
tag `tag
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
call
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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,
|
|
67
|
-
the TTL
|
|
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)
|
|
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
|
|
75
|
-
|
|
76
|
-
- **Paths:** Blaxel's images work in `/blaxel
|
|
77
|
-
Relative paths, `~` and paths under `/blaxel` resolve against
|
|
78
|
-
file calls and
|
|
79
|
-
`/blaxel` finds a link to `/workspace`. Other absolute paths
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
|
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
|
|
93
|
-
| `createIfNotExists` | `create` with `getOrCreate
|
|
94
|
-
| `get(name)`, `getByExternalId`, `list({ limit, externalId, showTerminated })` | The live sandbox with that name, or with the `externalId` label
|
|
95
|
-
| `delete` (static and on the sandbox) | `stop`: the sandbox ends
|
|
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
|
|
97
|
-
| `updateMetadata`, `updateTtl`, `updateLifecycle`, `updateNetwork` | Labels
|
|
98
|
-
| `archive`, `unarchive` | `pause`, `wake`. Runtime keeps memory and processes too
|
|
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
|
|
102
|
-
| `process.exec` without `waitForCompletion` | One Runtime process,
|
|
103
|
-
| `process.exec({ waitForCompletion: true })` | One streamed call,
|
|
104
|
-
| `onLog`, `onStdout`, `onStderr`, `streamLogs` | The process's output as it comes
|
|
105
|
-
| `process.get`, `wait`, `list`, `logs`, `stop`, `kill`, `writeStdin`, `closeStdin` | Runtime processes by id or name. `wait` follows output with one deadline
|
|
106
|
-
| `keepAlive`, `timeout` | The sandbox does not pause for idleness while the process may run
|
|
107
|
-
| `restartOnFailure`, `maxRestarts`, `waitForPorts`, `workingDir`, `env`, `stdin` | A restart loop in the same process
|
|
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
|
|
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)
|
|
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? }`
|
|
112
|
-
| `preview.tokens.createIfExpired(expiresAt?, minValidity?)` | The token this call made last in this process for the sandbox's port
|
|
113
|
-
| `isBlaxelError`, `getBlaxelErrorCode`, `getBlaxelErrorStatus`, `getBlaxelErrorMessage`, `getBlaxelErrorRequestId` | Blaxel's readers
|
|
114
|
-
| `settings.integration`, `initialize({ integration })`, `BL_INTEGRATION` | Kept and checked as Blaxel does (`<name>/<semver>`, warned once and `""` otherwise)
|
|
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
|
|
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
|
|
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
|
|
120
|
-
| `SandboxInstance.fromSession(session)` | The sandbox, driven with the session's token alone
|
|
121
|
-
| `ResponseError`, `SandboxGatewayError`, `isGatewayError`, `isGatewayTimeout` | Runtime's errors
|
|
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.
|
|
126
|
-
names the gap
|
|
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
|
|
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
|
|
133
|
-
| Read-only and ephemeral volumes; a volume with no Runtime volume of that name | Mount read-write
|
|
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
|
|
137
|
-
| `preview.tokens.list()`; a token for over a week | Keep the tokens you create
|
|
138
|
-
| `runCode` with `envs` for one run; a language Runtime's interpreter lacks |
|
|
139
|
-
| Listing by `cursor`, `q`, `anchor`, a status other than `DEPLOYED`, or newest first | List and filter the result yourself
|
|
140
|
-
| `schedules`, `codegen`, `system`, `drives` | A Runtime job (`runtime.jobs.create`, a fresh sandbox each run) or your own scheduler
|
|
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
|
|
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
|
|
149
|
-
(`exec`, `keepAlive`, restart loops) hands over to passwordless `sudo
|
|
150
|
-
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
|
|
171
|
-
|
|
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
|
|
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)
|
|
176
|
-
reports exit code -1
|
|
177
|
-
time limit), from any client.
|
|
178
|
-
- **Runtime records a command's first 256 characters.** A process started with
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
- **`fs.search`** scores matches by its own rule
|
|
182
|
-
word starts first
|
|
183
|
-
accepted
|
|
184
|
-
- **`ls`, `find`, `grep`, `search` and `writeTree` run a short Python script
|
|
185
|
-
|
|
186
|
-
|
|
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
|
|
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
|
|
197
|
-
when checked. The pinned files matched `compatibility-lock.json
|
|
198
|
-
their registry's SHA-512 integrity or SHA-256 digest
|
|
199
|
-
byte for byte its sdist's. They were compared file by file
|
|
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
|
|
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
|
|
208
|
-
| Custom domains' `validationMethod`, the `kernelExtensions` extra argument, and doc text (the 60 s floor of `ttl-idle`). | Nothing new to do
|
|
209
|
-
|
|
210
|
-
`tests/blaxel/blaxel-0-3-30.test.ts` (2)
|
|
211
|
-
`sdks/python/tests/test_blaxel_0_4_18.py` (2)
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
blaxel-python 375, 11
|
|
215
|
-
inventory counts the Python stand-ins
|
|
216
|
-
|
|
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
|
|
222
|
-
to 0.4.16 came out between, all on 13 October
|
|
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
|
|
225
|
-
SHA-256 digest
|
|
226
|
-
They were compared file by file
|
|
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
|
|
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
|
|
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
|
|
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
|
|
242
|
-
|
|
243
|
-
`tests/blaxel/blaxel-0-3-29.test.ts` (9)
|
|
244
|
-
`sdks/python/tests/test_blaxel_0_4_17.py` (9)
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
903, 0.4.13 exported fewer names from `blaxel.core`)
|
|
249
|
-
1038). The pinned
|
|
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
|
-
|
|
255
|
-
(`processLine` in `src/blaxel/context.ts`)
|
|
256
|
-
other's processes.
|
|
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
|
|
264
|
-
command or its env names `/blaxel`. `<run>` is `eval "$__rt_cmd"
|
|
265
|
-
`restartOnFailure
|
|
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
|
-
|
|
268
|
-
|
|
269
|
-
|
|
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
|
|
275
|
-
`@blaxel/core` 0.3.30 exports is exported here.
|
|
276
|
-
|
|
277
|
-
The end-to-end test runs Blaxel's guides
|
|
278
|
-
|
|
279
|
-
log streaming and files) and `tests/fixtures/blaxel-previews.mjs`
|
|
280
|
-
previews, snapshots and forks).
|
|
281
|
-
|
|
282
|
-
|
|
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
|