withruntime 0.11.2 → 0.12.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 +2 -2
- package/COMPATIBILITY.md +74 -9
- package/DAYTONA.md +33 -5
- package/E2B.md +85 -24
- package/README.md +9 -8
- package/README.src.md +8 -7
- package/VERCEL.md +43 -5
- package/compatibility-lock.json +58 -49
- package/dist/billing-cli.d.ts +1 -1
- package/dist/billing-cli.js +77 -1
- package/dist/blaxel/errors.d.ts +14 -0
- package/dist/blaxel/errors.js +29 -0
- package/dist/blaxel/index.d.ts +2 -2
- package/dist/blaxel/index.js +4 -4
- package/dist/blaxel/interpreter.d.ts +2 -5
- package/dist/blaxel/sandbox.d.ts +14 -5
- package/dist/blaxel/sandbox.js +63 -7
- package/dist/blaxel/snapshot.d.ts +4 -0
- package/dist/blaxel/snapshot.js +4 -0
- package/dist/cli/logs.d.ts +21 -0
- package/dist/cli/logs.js +188 -0
- package/dist/cli/logs.test.d.ts +1 -0
- package/dist/cli/logs.test.js +272 -0
- package/dist/cli-extras.d.ts +3 -3
- package/dist/cli-extras.js +17 -12
- package/dist/cli-words.d.ts +10 -1
- package/dist/cli-words.js +18 -0
- package/dist/cli.d.ts +5 -1
- package/dist/cli.js +405 -204
- package/dist/client.d.ts +2 -4
- package/dist/client.js +27 -11
- package/dist/cloudflare/errors.d.ts +143 -0
- package/dist/cloudflare/errors.js +167 -0
- package/dist/cloudflare/index.d.ts +175 -6
- package/dist/cloudflare/index.js +416 -26
- package/dist/cloudflare/interpreter.d.ts +119 -0
- package/dist/cloudflare/interpreter.js +223 -0
- package/dist/cloudflare/streams.d.ts +38 -0
- package/dist/cloudflare/streams.js +145 -0
- package/dist/cloudflare/watch.d.ts +9 -0
- package/dist/cloudflare/watch.js +24 -0
- package/dist/codesandbox/index.d.ts +216 -28
- package/dist/codesandbox/index.js +478 -78
- package/dist/compat/core.d.ts +18 -0
- package/dist/compat/core.js +29 -0
- package/dist/compat/files.d.ts +1 -0
- package/dist/compat/files.js +25 -5
- package/dist/daytona/computer-use.d.ts +13 -4
- package/dist/daytona/computer-use.js +66 -8
- package/dist/daytona/daytona.d.ts +6 -0
- package/dist/daytona/daytona.js +30 -3
- package/dist/daytona/errors.d.ts +11 -0
- package/dist/daytona/errors.js +18 -0
- package/dist/daytona/filesystem.js +2 -1
- package/dist/daytona/image.d.ts +13 -9
- package/dist/daytona/image.js +18 -12
- package/dist/daytona/index.d.ts +1 -1
- package/dist/daytona/sandbox.d.ts +8 -2
- package/dist/daytona/sandbox.js +16 -2
- package/dist/domains/index.d.ts +9 -0
- package/dist/domains/index.js +10 -0
- package/dist/e2b/commands.d.ts +1 -1
- package/dist/e2b/commands.js +6 -7
- package/dist/e2b/errors.d.ts +17 -0
- package/dist/e2b/errors.js +40 -1
- package/dist/e2b/index.d.ts +2 -2
- package/dist/e2b/index.js +1 -1
- package/dist/e2b/sandbox.d.ts +27 -21
- package/dist/e2b/sandbox.js +34 -8
- package/dist/e2b/unsupported.js +1 -1
- package/dist/errors.d.ts +10 -1
- package/dist/errors.js +16 -4
- package/dist/freestyle/index.d.ts +285 -37
- package/dist/freestyle/index.js +656 -144
- package/dist/identity.d.ts +3 -0
- package/dist/identity.js +27 -0
- package/dist/images/index.d.ts +9 -0
- package/dist/images/index.js +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/ips/index.d.ts +9 -0
- package/dist/ips/index.js +10 -0
- package/dist/jobs/index.d.ts +9 -0
- package/dist/jobs/index.js +10 -0
- package/dist/keys.js +2 -0
- package/dist/login.js +2 -0
- package/dist/machine.d.ts +12 -3
- package/dist/machine.js +20 -3
- package/dist/mcp.js +1 -1
- package/dist/modal/index.d.ts +339 -61
- package/dist/modal/index.js +781 -121
- package/dist/network-cli.d.ts +3 -1
- package/dist/network-cli.js +78 -36
- package/dist/networks/index.d.ts +11 -0
- package/dist/networks/index.js +10 -0
- package/dist/ports/index.d.ts +9 -0
- package/dist/ports/index.js +10 -0
- package/dist/product-names.d.ts +52 -0
- package/dist/product-names.js +164 -0
- package/dist/product-renames.d.ts +103 -0
- package/dist/product-renames.js +189 -0
- package/dist/products/apps.d.ts +176 -0
- package/dist/products/apps.js +165 -0
- package/dist/products/billing.d.ts +41 -0
- package/dist/products/billing.js +13 -0
- package/dist/products/browser.d.ts +10 -0
- package/dist/products/browsers.d.ts +71 -0
- package/dist/products/browsers.js +102 -0
- package/dist/products/builds.d.ts +126 -0
- package/dist/products/builds.js +221 -0
- package/dist/products/index.d.ts +3 -16
- package/dist/products/index.js +3 -14
- package/dist/products/jobs.d.ts +17 -0
- package/dist/products/jobs.js +27 -10
- package/dist/products/logs.d.ts +245 -0
- package/dist/products/logs.js +274 -0
- package/dist/products/logs.test.d.ts +1 -0
- package/dist/products/logs.test.js +343 -0
- package/dist/products/network-products.d.ts +38 -7
- package/dist/products/network-products.js +31 -18
- package/dist/products/observability.d.ts +3 -2
- package/dist/products/private-network.js +1 -1
- package/dist/products/queues.d.ts +149 -0
- package/dist/products/queues.js +213 -0
- package/dist/products/referrals.d.ts +21 -7
- package/dist/products/referrals.js +3 -3
- package/dist/products/secrets.d.ts +7 -3
- package/dist/products/secrets.js +39 -18
- package/dist/products/signed-requests.d.ts +21 -0
- package/dist/products/signed-requests.js +11 -0
- package/dist/products/streams.d.ts +73 -0
- package/dist/products/streams.js +17 -0
- package/dist/products/switching.d.ts +35 -7
- package/dist/products/switching.js +4 -3
- package/dist/products/volumes.d.ts +3 -0
- package/dist/record-cli.d.ts +23 -0
- package/dist/record-cli.js +308 -0
- package/dist/renamed-products.d.ts +38 -0
- package/dist/renamed-products.js +34 -0
- package/dist/runloop/index.d.ts +9 -2
- package/dist/runloop/index.js +29 -8
- package/dist/runloop/sdk.d.ts +131 -0
- package/dist/runloop/sdk.js +167 -0
- package/dist/sandbox.d.ts +3 -2
- package/dist/sandbox.js +14 -9
- package/dist/sandboxes/index.d.ts +11 -0
- package/dist/sandboxes/index.js +12 -0
- package/dist/snapshots/index.d.ts +9 -0
- package/dist/snapshots/index.js +11 -0
- package/dist/snapshots.d.ts +7 -4
- package/dist/sprites/index.d.ts +343 -31
- package/dist/sprites/index.js +866 -84
- package/dist/ssh.d.ts +1 -1
- package/dist/ssh.js +11 -11
- package/dist/terminal.d.ts +24 -0
- package/dist/terminal.js +32 -0
- package/dist/transport.d.ts +15 -1
- package/dist/transport.js +56 -3
- package/dist/tunnel.js +1 -1
- package/dist/types.d.ts +63 -0
- package/dist/vercel/sandbox.js +5 -3
- package/dist/vercel/snapshot.js +10 -2
- package/dist/volumes/index.d.ts +9 -0
- package/dist/volumes/index.js +10 -0
- package/package.json +48 -2
package/dist/cli-extras.js
CHANGED
|
@@ -13,12 +13,12 @@ export async function recordCommand(sbx, argv, out, kit) {
|
|
|
13
13
|
...(integer(args, "max-seconds") ? { maxSeconds: integer(args, "max-seconds") } : {}),
|
|
14
14
|
...(integer(args, "max-mib") ? { maxMiB: integer(args, "max-mib") } : {}),
|
|
15
15
|
});
|
|
16
|
-
print(`Recording ${rec.id}. Stop it: ${me}
|
|
16
|
+
print(`Recording ${rec.id}. Stop it: ${me} sandboxes desktop ${sbx.id} record stop ${rec.id}`, rec);
|
|
17
17
|
return 0;
|
|
18
18
|
}
|
|
19
19
|
case "stop": {
|
|
20
20
|
const rec = await r.stop(need(rest[0], "the recording id"));
|
|
21
|
-
print(`Stopped ${rec.id}: ${(rec.bytes / 1_048_576).toFixed(1)} MiB (${rec.reason ?? "stopped"}). Fetch it: ${me}
|
|
21
|
+
print(`Stopped ${rec.id}: ${(rec.bytes / 1_048_576).toFixed(1)} MiB (${rec.reason ?? "stopped"}). Fetch it: ${me} sandboxes desktop ${sbx.id} record fetch ${rec.id}`, rec);
|
|
22
22
|
return 0;
|
|
23
23
|
}
|
|
24
24
|
case "ls": {
|
|
@@ -47,7 +47,7 @@ export async function recordCommand(sbx, argv, out, kit) {
|
|
|
47
47
|
print("Deleted.", await r.delete(need(rest[0], "the recording id")));
|
|
48
48
|
return 0;
|
|
49
49
|
}
|
|
50
|
-
throw usage(`${me}
|
|
50
|
+
throw usage(`${me} sandboxes desktop <id> record start|stop|ls|fetch|rm`);
|
|
51
51
|
}
|
|
52
52
|
export async function watchCommand(sbx, argv, out, kit) {
|
|
53
53
|
const { parse, flag, has, need } = kit;
|
|
@@ -110,7 +110,7 @@ export async function mcpCommand(sbx, argv, out, kit) {
|
|
|
110
110
|
case "start": {
|
|
111
111
|
const args = parse(rest, ["replace"], ["secret", "env", "option", "port"]);
|
|
112
112
|
if (!args.positional.length)
|
|
113
|
-
throw usage("Name the servers: runtime
|
|
113
|
+
throw usage("Name the servers: runtime sandboxes mcp <id> start github fetch");
|
|
114
114
|
const scoped = (name) => {
|
|
115
115
|
const found = {};
|
|
116
116
|
for (const [key, value] of Object.entries(pairs(args, name))) {
|
|
@@ -134,7 +134,7 @@ export async function mcpCommand(sbx, argv, out, kit) {
|
|
|
134
134
|
...(integer(args, "port") ? { port: integer(args, "port") } : {}),
|
|
135
135
|
...(has(args, "replace") ? { replace: true } : {}),
|
|
136
136
|
});
|
|
137
|
-
print(`${show(gw)}\nServers are installing; \`${me}
|
|
137
|
+
print(`${show(gw)}\nServers are installing; \`${me} sandboxes mcp ${sbx.id}\` shows when they are ready.`, gw);
|
|
138
138
|
return 0;
|
|
139
139
|
}
|
|
140
140
|
case "status": {
|
|
@@ -146,7 +146,7 @@ export async function mcpCommand(sbx, argv, out, kit) {
|
|
|
146
146
|
print("Stopped.", await sbx.mcp.stop());
|
|
147
147
|
return 0;
|
|
148
148
|
}
|
|
149
|
-
throw usage(`${me}
|
|
149
|
+
throw usage(`${me} sandboxes mcp <id> start|status|stop, or ${me} sandboxes mcp catalog`);
|
|
150
150
|
}
|
|
151
151
|
/** Standard input when it is piped or redirected from a file, read whole, up
|
|
152
152
|
* to the API's 1 MiB; undefined for a terminal. A pipe that says nothing for
|
|
@@ -184,7 +184,7 @@ export async function pipedStdin(options = {}) {
|
|
|
184
184
|
clearTimeout(quiet);
|
|
185
185
|
size += chunk.length;
|
|
186
186
|
if (size > limit)
|
|
187
|
-
return done(undefined, Object.assign(new Error(`Standard input is over ${limit / 1_048_576} MiB. Copy the file in with \`${me}
|
|
187
|
+
return done(undefined, Object.assign(new Error(`Standard input is over ${limit / 1_048_576} MiB. Copy the file in with \`${me} sandboxes cp\` and read it there.`), { code: "usage" }));
|
|
188
188
|
chunks.push(chunk);
|
|
189
189
|
};
|
|
190
190
|
const onEnd = () => done(size ? new Uint8Array(Buffer.concat(chunks)) : undefined);
|
|
@@ -201,11 +201,11 @@ export async function pipedStdin(options = {}) {
|
|
|
201
201
|
export function lostOutput(result, id) {
|
|
202
202
|
if (!result.stdoutTruncated && !result.stderrTruncated)
|
|
203
203
|
return undefined;
|
|
204
|
-
return `runtime: some of the command's output was lost: it wrote faster than it was read, and the sandbox keeps the latest 1 MiB. Write it to a file and copy it out: ${me}
|
|
204
|
+
return `runtime: some of the command's output was lost: it wrote faster than it was read, and the sandbox keeps the latest 1 MiB. Write it to a file and copy it out: ${me} sandboxes cp ${id}:/workspace/out.txt .`;
|
|
205
205
|
}
|
|
206
|
-
/** Feeds `runtime
|
|
206
|
+
/** Feeds `runtime sandboxes shell` from standard input. When piped input ends,
|
|
207
207
|
* the shell is told so the way a terminal says it, Ctrl-D, after a newline
|
|
208
|
-
* if the last line had none: `echo ls | runtime
|
|
208
|
+
* if the last line had none: `echo ls | runtime sandboxes shell <id>` runs `ls`
|
|
209
209
|
* and exits, as ssh does, where it used to wait forever (25 September 2026).
|
|
210
210
|
* A keyboard never ends, so a terminal's input is left alone. Returns the
|
|
211
211
|
* function that unhooks it. */
|
|
@@ -229,7 +229,7 @@ export function pipeShellInput(stdin, terminal) {
|
|
|
229
229
|
stdin.off("end", onEnd);
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
/** `runtime
|
|
232
|
+
/** `runtime snapshots get`, as `runtime sandboxes get` reads: one fact a line.
|
|
233
233
|
* It printed raw JSON until 25 September 2026; `--json` still does. */
|
|
234
234
|
export function describeSnapshot(s, table) {
|
|
235
235
|
const mib = (bytes) => bytes === null ? "-" : `${Math.ceil(bytes / 1_048_576).toLocaleString("en-US")} MiB`;
|
|
@@ -249,7 +249,12 @@ export function describeSnapshot(s, table) {
|
|
|
249
249
|
: s.durability.state,
|
|
250
250
|
],
|
|
251
251
|
["created", s.createdAt],
|
|
252
|
-
[
|
|
252
|
+
[
|
|
253
|
+
"kept until",
|
|
254
|
+
s.expiresAt === null
|
|
255
|
+
? "kept while you have credit"
|
|
256
|
+
: `${s.expiresAt} (${s.retentionDays} days)`,
|
|
257
|
+
],
|
|
253
258
|
[
|
|
254
259
|
"labels",
|
|
255
260
|
Object.entries(labels)
|
package/dist/cli-words.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RuntimeError } from "./errors.js";
|
|
2
|
+
import type { ProductName } from "./product-names.js";
|
|
2
3
|
import type { SandboxMetrics } from "./products/observability.js";
|
|
3
4
|
/** A refusal of what a command sent, reworded for the command line: every
|
|
4
5
|
* issue named by its option, since the CLI never prints details.issues, and
|
|
@@ -25,3 +26,11 @@ export declare function newestCpu(m: SandboxMetrics, now?: number): {
|
|
|
25
26
|
* help` filed "help" as feedback, and `runtime support help` sent it to
|
|
26
27
|
* support, until 30 September 2026. */
|
|
27
28
|
export declare function topicHelp(help: string, command: string): string | null;
|
|
29
|
+
/** A command line's product words (CLOUD.md section 4): the plural, or the
|
|
30
|
+
* singular as a typing shortcut, reach the product silently; an old word
|
|
31
|
+
* reaches it with `warning` to print, and from its date throws name_retired
|
|
32
|
+
* naming the new command. Anything else passes through. */
|
|
33
|
+
export declare function productWords(argv: string[], now?: Date, table?: readonly ProductName[]): {
|
|
34
|
+
argv: string[];
|
|
35
|
+
warning?: string;
|
|
36
|
+
};
|
package/dist/cli-words.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { RuntimeError } from "./errors.js";
|
|
2
|
+
import { cliWords } from "./product-renames.js";
|
|
1
3
|
/* What the CLI says in its own words where the API's would mislead: the
|
|
2
4
|
option a refusal is about rather than the request field it was sent as,
|
|
3
5
|
one fact a line for a resource read, and the newest CPU reading a
|
|
@@ -133,3 +135,19 @@ export function topicHelp(help, command) {
|
|
|
133
135
|
}
|
|
134
136
|
return out.length ? out.join("\n") : null;
|
|
135
137
|
}
|
|
138
|
+
/** A command line's product words (CLOUD.md section 4): the plural, or the
|
|
139
|
+
* singular as a typing shortcut, reach the product silently; an old word
|
|
140
|
+
* reaches it with `warning` to print, and from its date throws name_retired
|
|
141
|
+
* naming the new command. Anything else passes through. */
|
|
142
|
+
export function productWords(argv, now = new Date(), table) {
|
|
143
|
+
const found = cliWords(argv, now, table);
|
|
144
|
+
if (!found)
|
|
145
|
+
return { argv };
|
|
146
|
+
const { use } = found;
|
|
147
|
+
if (use.kind === "retired")
|
|
148
|
+
throw new RuntimeError({ ...use.error });
|
|
149
|
+
return {
|
|
150
|
+
argv: found.args,
|
|
151
|
+
...(use.kind === "renamed" ? { warning: use.warning } : {}),
|
|
152
|
+
};
|
|
153
|
+
}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { RuntimeError } from "./errors.js";
|
|
3
|
-
import type { Usage } from "./types.js";
|
|
3
|
+
import type { OutOfMemory, Usage } from "./types.js";
|
|
4
4
|
import type { SwitchProvider } from "./products/switching.js";
|
|
5
5
|
import type { SecretRule } from "./products/secrets.js";
|
|
6
6
|
type Out = {
|
|
@@ -38,6 +38,10 @@ export declare function run(argv: string[], env?: NodeJS.ProcessEnv, out?: Out):
|
|
|
38
38
|
* microdollar (the API's integer microdollars moved six places), so a column
|
|
39
39
|
* sums to the ledger to the last digit. */
|
|
40
40
|
export declare function usageCsv(u: Usage): string;
|
|
41
|
+
/** What a person reads when the sandbox's out-of-memory killer ended a
|
|
42
|
+
* command: the API's message and hint, on standard error. A bare exit -9 (or
|
|
43
|
+
* 137) said nothing of memory until 9 October 2026. */
|
|
44
|
+
export declare function outOfMemoryLines(memory: OutOfMemory | undefined): string | undefined;
|
|
41
45
|
/** How to move a rival's code across, when one import does it. */
|
|
42
46
|
export declare function dropInLines(provider: SwitchProvider | undefined): string[];
|
|
43
47
|
/** `--allow` values as secret rules: each is `[METHOD[,METHOD]...] PATH`, and
|