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.
Files changed (164) hide show
  1. package/BLAXEL.md +2 -2
  2. package/COMPATIBILITY.md +74 -9
  3. package/DAYTONA.md +33 -5
  4. package/E2B.md +85 -24
  5. package/README.md +9 -8
  6. package/README.src.md +8 -7
  7. package/VERCEL.md +43 -5
  8. package/compatibility-lock.json +58 -49
  9. package/dist/billing-cli.d.ts +1 -1
  10. package/dist/billing-cli.js +77 -1
  11. package/dist/blaxel/errors.d.ts +14 -0
  12. package/dist/blaxel/errors.js +29 -0
  13. package/dist/blaxel/index.d.ts +2 -2
  14. package/dist/blaxel/index.js +4 -4
  15. package/dist/blaxel/interpreter.d.ts +2 -5
  16. package/dist/blaxel/sandbox.d.ts +14 -5
  17. package/dist/blaxel/sandbox.js +63 -7
  18. package/dist/blaxel/snapshot.d.ts +4 -0
  19. package/dist/blaxel/snapshot.js +4 -0
  20. package/dist/cli/logs.d.ts +21 -0
  21. package/dist/cli/logs.js +188 -0
  22. package/dist/cli/logs.test.d.ts +1 -0
  23. package/dist/cli/logs.test.js +272 -0
  24. package/dist/cli-extras.d.ts +3 -3
  25. package/dist/cli-extras.js +17 -12
  26. package/dist/cli-words.d.ts +10 -1
  27. package/dist/cli-words.js +18 -0
  28. package/dist/cli.d.ts +5 -1
  29. package/dist/cli.js +405 -204
  30. package/dist/client.d.ts +2 -4
  31. package/dist/client.js +27 -11
  32. package/dist/cloudflare/errors.d.ts +143 -0
  33. package/dist/cloudflare/errors.js +167 -0
  34. package/dist/cloudflare/index.d.ts +175 -6
  35. package/dist/cloudflare/index.js +416 -26
  36. package/dist/cloudflare/interpreter.d.ts +119 -0
  37. package/dist/cloudflare/interpreter.js +223 -0
  38. package/dist/cloudflare/streams.d.ts +38 -0
  39. package/dist/cloudflare/streams.js +145 -0
  40. package/dist/cloudflare/watch.d.ts +9 -0
  41. package/dist/cloudflare/watch.js +24 -0
  42. package/dist/codesandbox/index.d.ts +216 -28
  43. package/dist/codesandbox/index.js +478 -78
  44. package/dist/compat/core.d.ts +18 -0
  45. package/dist/compat/core.js +29 -0
  46. package/dist/compat/files.d.ts +1 -0
  47. package/dist/compat/files.js +25 -5
  48. package/dist/daytona/computer-use.d.ts +13 -4
  49. package/dist/daytona/computer-use.js +66 -8
  50. package/dist/daytona/daytona.d.ts +6 -0
  51. package/dist/daytona/daytona.js +30 -3
  52. package/dist/daytona/errors.d.ts +11 -0
  53. package/dist/daytona/errors.js +18 -0
  54. package/dist/daytona/filesystem.js +2 -1
  55. package/dist/daytona/image.d.ts +13 -9
  56. package/dist/daytona/image.js +18 -12
  57. package/dist/daytona/index.d.ts +1 -1
  58. package/dist/daytona/sandbox.d.ts +8 -2
  59. package/dist/daytona/sandbox.js +16 -2
  60. package/dist/domains/index.d.ts +9 -0
  61. package/dist/domains/index.js +10 -0
  62. package/dist/e2b/commands.d.ts +1 -1
  63. package/dist/e2b/commands.js +6 -7
  64. package/dist/e2b/errors.d.ts +17 -0
  65. package/dist/e2b/errors.js +40 -1
  66. package/dist/e2b/index.d.ts +2 -2
  67. package/dist/e2b/index.js +1 -1
  68. package/dist/e2b/sandbox.d.ts +27 -21
  69. package/dist/e2b/sandbox.js +34 -8
  70. package/dist/e2b/unsupported.js +1 -1
  71. package/dist/errors.d.ts +10 -1
  72. package/dist/errors.js +16 -4
  73. package/dist/freestyle/index.d.ts +285 -37
  74. package/dist/freestyle/index.js +656 -144
  75. package/dist/identity.d.ts +3 -0
  76. package/dist/identity.js +27 -0
  77. package/dist/images/index.d.ts +9 -0
  78. package/dist/images/index.js +10 -0
  79. package/dist/index.d.ts +1 -0
  80. package/dist/ips/index.d.ts +9 -0
  81. package/dist/ips/index.js +10 -0
  82. package/dist/jobs/index.d.ts +9 -0
  83. package/dist/jobs/index.js +10 -0
  84. package/dist/keys.js +2 -0
  85. package/dist/login.js +2 -0
  86. package/dist/machine.d.ts +12 -3
  87. package/dist/machine.js +20 -3
  88. package/dist/mcp.js +1 -1
  89. package/dist/modal/index.d.ts +339 -61
  90. package/dist/modal/index.js +781 -121
  91. package/dist/network-cli.d.ts +3 -1
  92. package/dist/network-cli.js +78 -36
  93. package/dist/networks/index.d.ts +11 -0
  94. package/dist/networks/index.js +10 -0
  95. package/dist/ports/index.d.ts +9 -0
  96. package/dist/ports/index.js +10 -0
  97. package/dist/product-names.d.ts +52 -0
  98. package/dist/product-names.js +164 -0
  99. package/dist/product-renames.d.ts +103 -0
  100. package/dist/product-renames.js +189 -0
  101. package/dist/products/apps.d.ts +176 -0
  102. package/dist/products/apps.js +165 -0
  103. package/dist/products/billing.d.ts +41 -0
  104. package/dist/products/billing.js +13 -0
  105. package/dist/products/browser.d.ts +10 -0
  106. package/dist/products/browsers.d.ts +71 -0
  107. package/dist/products/browsers.js +102 -0
  108. package/dist/products/builds.d.ts +126 -0
  109. package/dist/products/builds.js +221 -0
  110. package/dist/products/index.d.ts +3 -16
  111. package/dist/products/index.js +3 -14
  112. package/dist/products/jobs.d.ts +17 -0
  113. package/dist/products/jobs.js +27 -10
  114. package/dist/products/logs.d.ts +245 -0
  115. package/dist/products/logs.js +274 -0
  116. package/dist/products/logs.test.d.ts +1 -0
  117. package/dist/products/logs.test.js +343 -0
  118. package/dist/products/network-products.d.ts +38 -7
  119. package/dist/products/network-products.js +31 -18
  120. package/dist/products/observability.d.ts +3 -2
  121. package/dist/products/private-network.js +1 -1
  122. package/dist/products/queues.d.ts +149 -0
  123. package/dist/products/queues.js +213 -0
  124. package/dist/products/referrals.d.ts +21 -7
  125. package/dist/products/referrals.js +3 -3
  126. package/dist/products/secrets.d.ts +7 -3
  127. package/dist/products/secrets.js +39 -18
  128. package/dist/products/signed-requests.d.ts +21 -0
  129. package/dist/products/signed-requests.js +11 -0
  130. package/dist/products/streams.d.ts +73 -0
  131. package/dist/products/streams.js +17 -0
  132. package/dist/products/switching.d.ts +35 -7
  133. package/dist/products/switching.js +4 -3
  134. package/dist/products/volumes.d.ts +3 -0
  135. package/dist/record-cli.d.ts +23 -0
  136. package/dist/record-cli.js +308 -0
  137. package/dist/renamed-products.d.ts +38 -0
  138. package/dist/renamed-products.js +34 -0
  139. package/dist/runloop/index.d.ts +9 -2
  140. package/dist/runloop/index.js +29 -8
  141. package/dist/runloop/sdk.d.ts +131 -0
  142. package/dist/runloop/sdk.js +167 -0
  143. package/dist/sandbox.d.ts +3 -2
  144. package/dist/sandbox.js +14 -9
  145. package/dist/sandboxes/index.d.ts +11 -0
  146. package/dist/sandboxes/index.js +12 -0
  147. package/dist/snapshots/index.d.ts +9 -0
  148. package/dist/snapshots/index.js +11 -0
  149. package/dist/snapshots.d.ts +7 -4
  150. package/dist/sprites/index.d.ts +343 -31
  151. package/dist/sprites/index.js +866 -84
  152. package/dist/ssh.d.ts +1 -1
  153. package/dist/ssh.js +11 -11
  154. package/dist/terminal.d.ts +24 -0
  155. package/dist/terminal.js +32 -0
  156. package/dist/transport.d.ts +15 -1
  157. package/dist/transport.js +56 -3
  158. package/dist/tunnel.js +1 -1
  159. package/dist/types.d.ts +63 -0
  160. package/dist/vercel/sandbox.js +5 -3
  161. package/dist/vercel/snapshot.js +10 -2
  162. package/dist/volumes/index.d.ts +9 -0
  163. package/dist/volumes/index.js +10 -0
  164. package/package.json +48 -2
@@ -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} sandbox desktop ${sbx.id} record stop ${rec.id}`, rec);
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} sandbox desktop ${sbx.id} record fetch ${rec.id}`, rec);
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} sandbox desktop <id> record start|stop|ls|fetch|rm`);
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 sandbox mcp <id> start github fetch");
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} sandbox mcp ${sbx.id}\` shows when they are ready.`, gw);
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} sandbox mcp <id> start|status|stop, or ${me} sandbox mcp catalog`);
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} sandbox cp\` and read it there.`), { code: "usage" }));
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} sandbox cp ${id}:/workspace/out.txt .`;
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 sandbox shell` from standard input. When piped input ends,
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 sandbox shell <id>` runs `ls`
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 snapshot get`, as `runtime sandbox get` reads: one fact a line.
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
- ["kept until", `${s.expiresAt} (${s.retentionDays} days)`],
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)
@@ -1,4 +1,5 @@
1
- import type { RuntimeError } from "./errors.js";
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