withruntime 0.11.1 → 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 (176) hide show
  1. package/BLAXEL.md +3 -3
  2. package/COMPATIBILITY.md +74 -9
  3. package/DAYTONA.md +33 -5
  4. package/E2B.md +137 -48
  5. package/README.md +11 -9
  6. package/README.src.md +11 -9
  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 +33 -4
  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 +15 -7
  17. package/dist/blaxel/sandbox.js +64 -9
  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 +6 -2
  29. package/dist/cli.js +468 -219
  30. package/dist/client.d.ts +13 -63
  31. package/dist/client.js +35 -124
  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 +7 -2
  51. package/dist/daytona/daytona.js +31 -5
  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 +9 -3
  59. package/dist/daytona/sandbox.js +17 -3
  60. package/dist/domains/index.d.ts +9 -0
  61. package/dist/domains/index.js +10 -0
  62. package/dist/e2b/client.d.ts +15 -2
  63. package/dist/e2b/client.js +61 -7
  64. package/dist/e2b/commands.d.ts +4 -1
  65. package/dist/e2b/commands.js +17 -7
  66. package/dist/e2b/errors.d.ts +43 -2
  67. package/dist/e2b/errors.js +78 -6
  68. package/dist/e2b/filesystem.d.ts +1 -1
  69. package/dist/e2b/filesystem.js +82 -16
  70. package/dist/e2b/index.d.ts +3 -3
  71. package/dist/e2b/index.js +2 -2
  72. package/dist/e2b/sandbox.d.ts +50 -35
  73. package/dist/e2b/sandbox.js +228 -185
  74. package/dist/e2b/unsupported.d.ts +19 -0
  75. package/dist/e2b/unsupported.js +22 -1
  76. package/dist/e2b/users.d.ts +9 -0
  77. package/dist/e2b/users.js +22 -0
  78. package/dist/errors.d.ts +14 -5
  79. package/dist/errors.js +28 -14
  80. package/dist/freestyle/index.d.ts +285 -37
  81. package/dist/freestyle/index.js +656 -144
  82. package/dist/identity.d.ts +3 -0
  83. package/dist/identity.js +27 -0
  84. package/dist/images/index.d.ts +9 -0
  85. package/dist/images/index.js +10 -0
  86. package/dist/index.d.ts +1 -0
  87. package/dist/ips/index.d.ts +9 -0
  88. package/dist/ips/index.js +10 -0
  89. package/dist/jobs/index.d.ts +9 -0
  90. package/dist/jobs/index.js +10 -0
  91. package/dist/keys.js +2 -0
  92. package/dist/login.js +2 -0
  93. package/dist/machine.d.ts +189 -0
  94. package/dist/machine.js +521 -0
  95. package/dist/mcp.js +1 -1
  96. package/dist/modal/index.d.ts +339 -61
  97. package/dist/modal/index.js +781 -121
  98. package/dist/network-cli.d.ts +3 -1
  99. package/dist/network-cli.js +78 -36
  100. package/dist/networks/index.d.ts +11 -0
  101. package/dist/networks/index.js +10 -0
  102. package/dist/openai-agents/index.d.ts +1 -1
  103. package/dist/openai-agents/index.js +1 -1
  104. package/dist/ports/index.d.ts +9 -0
  105. package/dist/ports/index.js +10 -0
  106. package/dist/product-names.d.ts +52 -0
  107. package/dist/product-names.js +164 -0
  108. package/dist/product-renames.d.ts +103 -0
  109. package/dist/product-renames.js +189 -0
  110. package/dist/products/apps.d.ts +176 -0
  111. package/dist/products/apps.js +165 -0
  112. package/dist/products/billing.d.ts +41 -0
  113. package/dist/products/billing.js +13 -0
  114. package/dist/products/browser.d.ts +10 -0
  115. package/dist/products/browsers.d.ts +71 -0
  116. package/dist/products/browsers.js +102 -0
  117. package/dist/products/builds.d.ts +126 -0
  118. package/dist/products/builds.js +221 -0
  119. package/dist/products/index.d.ts +3 -16
  120. package/dist/products/index.js +3 -14
  121. package/dist/products/jobs.d.ts +19 -3
  122. package/dist/products/jobs.js +28 -12
  123. package/dist/products/limits.d.ts +4 -10
  124. package/dist/products/logs.d.ts +245 -0
  125. package/dist/products/logs.js +274 -0
  126. package/dist/products/logs.test.d.ts +1 -0
  127. package/dist/products/logs.test.js +343 -0
  128. package/dist/products/network-products.d.ts +38 -7
  129. package/dist/products/network-products.js +31 -18
  130. package/dist/products/network.d.ts +1 -1
  131. package/dist/products/observability.d.ts +3 -2
  132. package/dist/products/private-network.js +1 -1
  133. package/dist/products/queues.d.ts +149 -0
  134. package/dist/products/queues.js +213 -0
  135. package/dist/products/referrals.d.ts +21 -7
  136. package/dist/products/referrals.js +3 -3
  137. package/dist/products/secrets.d.ts +8 -4
  138. package/dist/products/secrets.js +39 -18
  139. package/dist/products/signed-requests.d.ts +21 -0
  140. package/dist/products/signed-requests.js +11 -0
  141. package/dist/products/streams.d.ts +73 -0
  142. package/dist/products/streams.js +17 -0
  143. package/dist/products/switching.d.ts +37 -10
  144. package/dist/products/switching.js +4 -3
  145. package/dist/products/volumes.d.ts +3 -0
  146. package/dist/record-cli.d.ts +23 -0
  147. package/dist/record-cli.js +308 -0
  148. package/dist/renamed-products.d.ts +38 -0
  149. package/dist/renamed-products.js +34 -0
  150. package/dist/runloop/index.d.ts +9 -2
  151. package/dist/runloop/index.js +29 -8
  152. package/dist/runloop/sdk.d.ts +131 -0
  153. package/dist/runloop/sdk.js +167 -0
  154. package/dist/sandbox.d.ts +10 -94
  155. package/dist/sandbox.js +22 -371
  156. package/dist/sandboxes/index.d.ts +11 -0
  157. package/dist/sandboxes/index.js +12 -0
  158. package/dist/snapshots/index.d.ts +9 -0
  159. package/dist/snapshots/index.js +11 -0
  160. package/dist/snapshots.d.ts +7 -4
  161. package/dist/sprites/index.d.ts +343 -31
  162. package/dist/sprites/index.js +866 -84
  163. package/dist/ssh.d.ts +1 -1
  164. package/dist/ssh.js +11 -11
  165. package/dist/terminal.d.ts +24 -0
  166. package/dist/terminal.js +32 -0
  167. package/dist/transport.d.ts +18 -2
  168. package/dist/transport.js +61 -6
  169. package/dist/tunnel.js +1 -1
  170. package/dist/types.d.ts +116 -8
  171. package/dist/vercel/sandbox.d.ts +1 -2
  172. package/dist/vercel/sandbox.js +6 -5
  173. package/dist/vercel/snapshot.js +10 -2
  174. package/dist/volumes/index.d.ts +9 -0
  175. package/dist/volumes/index.js +10 -0
  176. package/package.json +48 -2
@@ -9,14 +9,35 @@ export declare const DEFAULT_SHAPE: {
9
9
  readonly vcpu: 2;
10
10
  readonly memoryMiB: 512;
11
11
  };
12
- /** E2B's default sandbox timeout, 300 s. Not sent: a sandbox created with no
13
- * timeoutMs has no time limit on Runtime, running while it works and pausing
14
- * when idle (0300). Kept for code that imports it. */
12
+ /** E2B's default sandbox timeout, 300 s. A sandbox created without timeoutMs
13
+ * gets it, and is paused when it runs out rather than killed, since nobody
14
+ * asked for it to end: nothing in it is lost, and the next call wakes it. On
15
+ * a pilot account the server keeps every sandbox running instead (0254). */
15
16
  export declare const DEFAULT_TIMEOUT_MS = 300000;
17
+ /** The label that keeps the template a sandbox was made from, so getInfo
18
+ * and list name it whichever client asks; it is not shown in `metadata`. */
19
+ export declare const TEMPLATE_LABEL = "e2b-template";
16
20
  export type SandboxState = "running" | "paused";
21
+ /** What a pause or snapshot keeps (E2B 2.55): `"full"` keeps memory and
22
+ * files, `"filesystem"` only files, so what starts from it boots afresh. */
23
+ export type SnapshotMode = "full" | "filesystem";
17
24
  export type SandboxOnTimeout = "pause" | "kill" | {
18
- action: "pause" | "kill";
25
+ action: "pause";
26
+ mode?: SnapshotMode;
27
+ /** @deprecated E2B 2.55: use `mode`. */
19
28
  keepMemory?: boolean;
29
+ } | {
30
+ action: "kill";
31
+ };
32
+ /** E2B's pause options: `mode`, or the deprecated `keepMemory`. */
33
+ export type SandboxPauseOpts = SandboxApiOpts & {
34
+ mode?: SnapshotMode;
35
+ /** @deprecated E2B 2.55: use `mode`. */
36
+ keepMemory?: boolean;
37
+ };
38
+ export type CreateSnapshotOpts = SandboxApiOpts & {
39
+ name?: string;
40
+ mode?: SnapshotMode;
20
41
  };
21
42
  export type SandboxLifecycle = {
22
43
  onTimeout: SandboxOnTimeout;
@@ -92,10 +113,10 @@ export type SandboxListOpts = SandboxApiOpts & {
92
113
  limit?: number;
93
114
  nextToken?: string;
94
115
  };
95
- /** Test hook: renew every kept lease now, as the five-minute timer would. */
96
- export declare function renewLeases(): Promise<void>;
97
- /** Test hook: the end each kept sandbox is kept until. */
98
- export declare function keptLeases(): Map<string, number>;
116
+ /** The Runtime image name an E2B template name stands for: E2B's
117
+ * `team/name:tag` without the team, since a Runtime account's images are its
118
+ * own. `name`, `name:tag` and `name@version` are Runtime image names too. */
119
+ export declare function imageNameFor(template: string): string;
99
120
  export declare class Sandbox {
100
121
  #private;
101
122
  protected readonly requestTimeoutMs: number;
@@ -112,8 +133,7 @@ export declare class Sandbox {
112
133
  protected get client(): Runtime;
113
134
  /** Creates a sandbox from `template` (default "base", Runtime's stock image)
114
135
  * with E2B's default machine, 2 vCPU and 512 MiB, and waits until it runs.
115
- * Funding is left to Runtime: the free trial while the account has trial
116
- * time, then prepaid credit, exactly as withruntime's own create. */
136
+ * Funding is left to Runtime: the included usage first, then prepaid credit, exactly as withruntime's own create. */
117
137
  static create<S extends typeof Sandbox>(this: S, opts?: SandboxOpts): Promise<InstanceType<S>>;
118
138
  static create<S extends typeof Sandbox>(this: S, template: string, opts?: SandboxOpts): Promise<InstanceType<S>>;
119
139
  /** Connects to a sandbox by id, waking it if it is paused, as E2B does. A
@@ -123,31 +143,29 @@ export declare class Sandbox {
123
143
  connect(opts?: SandboxConnectOpts): Promise<this>;
124
144
  /** Running and paused sandboxes, a page at a time, as E2B's paginator. */
125
145
  static list(opts?: SandboxListOpts): SandboxPaginator;
126
- /** Stops the sandbox. False when it was not found or had already ended. */
146
+ /** Deletes the sandbox for good, as E2B's kill destroys it: its disk,
147
+ * memory and shared ports go. False when it was not found or was already
148
+ * deleted. */
127
149
  static kill(sandboxId: string, opts?: SandboxApiOpts): Promise<boolean>;
128
150
  kill(opts?: Pick<ConnectionOpts, "requestTimeoutMs" | "signal">): Promise<boolean>;
129
- /** Sets the sandbox to end `timeoutMs` from now, up to 24 hours; past an
130
- * hour the lease is moved on while this process runs. Runtime cannot end a
131
- * lease early, so an end sooner than the lease's is refused. A sandbox
132
- * created with no timeout has no end to move, and nothing changes. */
151
+ /** Sets the sandbox to end `timeoutMs` from now, up to 24 hours, as E2B
152
+ * does; the server keeps the deadline. Runtime cannot bring an end
153
+ * sooner, so that is refused. A sandbox with no time limit (one on a pilot
154
+ * account, kept running by the server) has no end to move, and nothing
155
+ * changes. */
133
156
  static setTimeout(sandboxId: string, timeoutMs: number, opts?: SandboxApiOpts): Promise<void>;
134
157
  setTimeout(timeoutMs: number, opts?: Pick<ConnectionOpts, "requestTimeoutMs" | "signal">): Promise<void>;
135
158
  static getInfo(sandboxId: string, opts?: SandboxApiOpts): Promise<SandboxInfo>;
136
159
  getInfo(opts?: Pick<ConnectionOpts, "requestTimeoutMs" | "signal">): Promise<SandboxInfo>;
160
+ /** Whether the sandbox answers calls, as E2B's health check says: true
161
+ * while it runs, and while Runtime has paused it for being idle, since the
162
+ * next call wakes it. False once paused on request, ended or deleted. */
137
163
  isRunning(opts?: Pick<ConnectionOpts, "requestTimeoutMs" | "signal">): Promise<boolean>;
138
164
  /** Pauses the sandbox, keeping memory and files. False when it was paused. */
139
- static pause(sandboxId: string, opts?: SandboxApiOpts & {
140
- keepMemory?: boolean;
141
- }): Promise<boolean>;
142
- static betaPause(sandboxId: string, opts?: SandboxApiOpts & {
143
- keepMemory?: boolean;
144
- }): Promise<boolean>;
145
- pause(opts?: SandboxApiOpts & {
146
- keepMemory?: boolean;
147
- }): Promise<boolean>;
148
- betaPause(opts?: SandboxApiOpts & {
149
- keepMemory?: boolean;
150
- }): Promise<boolean>;
165
+ static pause(sandboxId: string, opts?: SandboxPauseOpts): Promise<boolean>;
166
+ static betaPause(sandboxId: string, opts?: SandboxPauseOpts): Promise<boolean>;
167
+ pause(opts?: SandboxPauseOpts): Promise<boolean>;
168
+ betaPause(opts?: SandboxPauseOpts): Promise<boolean>;
151
169
  /** Copies of this sandbox, memory and all. While Runtime's forks are
152
170
  * switched off this throws NotSupportedError with Runtime's own words. */
153
171
  static fork<S extends typeof Sandbox>(this: S, sandboxId: string, opts?: SandboxApiOpts & {
@@ -158,14 +176,11 @@ export declare class Sandbox {
158
176
  count?: number;
159
177
  timeoutMs?: number;
160
178
  }): Promise<Array<this | Error>>;
161
- /** Keeps the sandbox's whole machine as a Runtime snapshot; start from it
162
- * with Sandbox.create(snapshotId). */
163
- createSnapshot(opts?: SandboxApiOpts & {
164
- name?: string;
165
- }): Promise<SnapshotInfo>;
166
- static createSnapshot(sandboxId: string, opts?: SandboxApiOpts & {
167
- name?: string;
168
- }): Promise<SnapshotInfo>;
179
+ /** Keeps the sandbox's whole machine as a Runtime snapshot, or with
180
+ * `mode: "filesystem"` its disk alone, from which a sandbox boots afresh;
181
+ * start from it with Sandbox.create(snapshotId). */
182
+ createSnapshot(opts?: CreateSnapshotOpts): Promise<SnapshotInfo>;
183
+ static createSnapshot(sandboxId: string, opts?: CreateSnapshotOpts): Promise<SnapshotInfo>;
169
184
  static deleteSnapshot(snapshotId: string, opts?: SandboxApiOpts): Promise<boolean>;
170
185
  /** E2B's getHost, answered at once as E2B answers it:
171
186
  * `<port>-<id>.runtimehost.com`. A Runtime preview's address is made from