withruntime 0.11.1 → 0.11.2

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 (53) hide show
  1. package/BLAXEL.md +1 -1
  2. package/DAYTONA.md +1 -1
  3. package/E2B.md +57 -29
  4. package/README.md +4 -3
  5. package/README.src.md +4 -3
  6. package/compatibility-lock.json +14 -14
  7. package/dist/blaxel/errors.js +4 -4
  8. package/dist/blaxel/sandbox.d.ts +1 -2
  9. package/dist/blaxel/sandbox.js +1 -2
  10. package/dist/cli.d.ts +1 -1
  11. package/dist/cli.js +63 -15
  12. package/dist/client.d.ts +11 -59
  13. package/dist/client.js +8 -113
  14. package/dist/daytona/daytona.d.ts +1 -2
  15. package/dist/daytona/daytona.js +1 -2
  16. package/dist/daytona/sandbox.d.ts +1 -1
  17. package/dist/daytona/sandbox.js +1 -1
  18. package/dist/e2b/client.d.ts +15 -2
  19. package/dist/e2b/client.js +61 -7
  20. package/dist/e2b/commands.d.ts +3 -0
  21. package/dist/e2b/commands.js +16 -5
  22. package/dist/e2b/errors.d.ts +26 -2
  23. package/dist/e2b/errors.js +38 -5
  24. package/dist/e2b/filesystem.d.ts +1 -1
  25. package/dist/e2b/filesystem.js +82 -16
  26. package/dist/e2b/index.d.ts +2 -2
  27. package/dist/e2b/index.js +2 -2
  28. package/dist/e2b/sandbox.d.ts +23 -14
  29. package/dist/e2b/sandbox.js +195 -178
  30. package/dist/e2b/unsupported.d.ts +19 -0
  31. package/dist/e2b/unsupported.js +21 -0
  32. package/dist/e2b/users.d.ts +9 -0
  33. package/dist/e2b/users.js +22 -0
  34. package/dist/errors.d.ts +4 -4
  35. package/dist/errors.js +12 -10
  36. package/dist/machine.d.ts +180 -0
  37. package/dist/machine.js +504 -0
  38. package/dist/openai-agents/index.d.ts +1 -1
  39. package/dist/openai-agents/index.js +1 -1
  40. package/dist/products/jobs.d.ts +2 -3
  41. package/dist/products/jobs.js +1 -2
  42. package/dist/products/limits.d.ts +4 -10
  43. package/dist/products/network.d.ts +1 -1
  44. package/dist/products/secrets.d.ts +1 -1
  45. package/dist/products/switching.d.ts +2 -3
  46. package/dist/sandbox.d.ts +7 -92
  47. package/dist/sandbox.js +8 -362
  48. package/dist/transport.d.ts +4 -2
  49. package/dist/transport.js +6 -4
  50. package/dist/types.d.ts +53 -8
  51. package/dist/vercel/sandbox.d.ts +1 -2
  52. package/dist/vercel/sandbox.js +1 -2
  53. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -33,7 +33,10 @@ export type SandboxInfo = {
33
33
  persistent?: boolean;
34
34
  /** The last exec, file, terminal, desktop or preview request, to within a minute. */
35
35
  lastActiveAt?: string | null;
36
- onLeaseEnd: "pause" | "stop";
36
+ /** What happens when its time limit, credit or a spending limit ends it. */
37
+ onLeaseEnd: "pause" | "stop" | "delete";
38
+ /** onLeaseEnd's newer name (0381): the same value. */
39
+ onTimeout?: "pause" | "stop" | "delete";
37
40
  createdAt: string;
38
41
  readyAt: string | null;
39
42
  /** Paid up to: a time ahead of now that moves on by itself while it runs.
@@ -85,7 +88,7 @@ export type CreateSandbox = {
85
88
  * `env`. At most 32 variables and 32 KiB. Values are never shown again;
86
89
  * answers list only `envNames`. Copies made by fork() keep them. */
87
90
  env?: Record<string, string>;
88
- /** Omit to use the free trial while it lasts, then prepaid credit. */
91
+ /** Omit to use the included usage while it lasts, then prepaid credit. */
89
92
  funding?: "trial" | "paid";
90
93
  region?: string;
91
94
  vcpu?: number;
@@ -93,14 +96,16 @@ export type CreateSandbox = {
93
96
  diskMiB?: number;
94
97
  cpu?: "shared" | "reserved";
95
98
  cpuFloorMillis?: number;
96
- /** A time limit, 60 to 3600 seconds. Leave it out (or 0) for none: the
97
- * sandbox runs while it works and pauses when idle, until you stop it or
98
- * credit runs out. */
99
+ /** A time limit, 60 to 86400 seconds (24 hours). Leave it out (or 0) for
100
+ * none: the sandbox runs while it works and pauses when idle, until you
101
+ * stop it or credit runs out. */
99
102
  timeoutSeconds?: number;
100
103
  /** @deprecated Ignored since 5 October 2026: every sandbox can pause. */
101
104
  pausable?: boolean;
102
- /** What happens when its time limit or credit runs out: "pause" (default) or "stop". */
103
- onLeaseEnd?: "pause" | "stop";
105
+ /** What happens when its time limit, credit or a spending limit ends it:
106
+ * "pause" (default), "stop", or "delete" (when the time limit runs out,
107
+ * delete it and its files; credit or a spending limit only stops it). */
108
+ onLeaseEnd?: "pause" | "stop" | "delete";
104
109
  /** Pause after this many seconds in which nothing happens in it: no
105
110
  * request, no command or terminal running, no open connection, no network
106
111
  * traffic and no CPU use. Default 60 unless persistent; 0 never;
@@ -260,13 +265,41 @@ export type Usage = {
260
265
  available: string;
261
266
  /** The part of spent that refunds and disputes took. */
262
267
  takenBack: string;
268
+ /** Machine time the account can still run without credit, in
269
+ * milliseconds, or null when it has none. `totalMs` and `usedMs` count free
270
+ * hours given before 5 October 2026 (0 for an account given none);
271
+ * `availableMs` is the larger of those hours left and this month's included
272
+ * usage, as time at 2 vCPU and 4 GiB. The field keeps its older name. */
263
273
  trial: {
264
274
  totalMs: number;
265
275
  usedMs: number;
266
276
  /** @deprecated Read `availableMs`. Still sent for older clients. */
267
277
  reservedMs: number;
268
278
  availableMs: number;
279
+ /** `monthly`: the included usage every month only. `hours`: free hours
280
+ * given before 5 October 2026, kept, beside the included usage. Absent
281
+ * from an API older than 5 October 2026. */
282
+ offer?: "monthly" | "hours";
283
+ /** When the included usage renews: the 1st of next month, 00:00 UTC. */
284
+ renewsAt?: string;
269
285
  } | null;
286
+ /** What the account uses free this calendar month (UTC), one row per
287
+ * product, drawn before credit and never charged
288
+ * (https://withruntime.com/docs/included-usage). */
289
+ allowances?: Array<{
290
+ /** machine-memory, machine-cpu, saved-copies or disks. */
291
+ pool: string;
292
+ /** GiB-hour, vCPU-hour or GB-month. */
293
+ unit: string;
294
+ quantity: number;
295
+ used: number;
296
+ /** Held for what is running now; given back unless used. */
297
+ reserved: number;
298
+ left: number;
299
+ /** The month's first day, YYYY-MM-DD. */
300
+ month: string;
301
+ renewsAt: string;
302
+ }>;
270
303
  /** Outbound traffic this calendar month, UTC: the first `allowanceBytes` an
271
304
  * account sends are free, and the rest is charged at the rate in the pricing
272
305
  * guide (https://withruntime.com/docs/pricing#network-products). */
@@ -282,7 +315,9 @@ export type Usage = {
282
315
  } | null;
283
316
  /** The account's pilot while it serves its sandboxes, a free run agreed
284
317
  * with Runtime: `hours` sandbox-hours of running time, `usedMs` and
285
- * `leftMs` of it used and left. Null on every other account. */
318
+ * `leftMs` of it used and left, and `running`, its sandboxes running now:
319
+ * `leftMs / running` is how long the hours last at this rate. Null on every
320
+ * other account. */
286
321
  pilot?: {
287
322
  id: string;
288
323
  sandboxes: number;
@@ -296,7 +331,17 @@ export type Usage = {
296
331
  hours: number;
297
332
  usedMs: number;
298
333
  leftMs: number;
334
+ running?: number;
299
335
  } | null;
336
+ /** Everything this key acts for, a row a kind, past the hundred newest
337
+ * `resources` lists: how many, and what was charged and is held, in
338
+ * integer microdollars as strings. Absent from an API before 6 October 2026. */
339
+ kinds?: Array<{
340
+ kind: string;
341
+ resources: number;
342
+ chargedMicros: string;
343
+ heldMicros: string;
344
+ }>;
300
345
  resources: Array<Record<string, unknown>>;
301
346
  [key: string]: unknown;
302
347
  };
@@ -147,8 +147,7 @@ export declare class Sandbox {
147
147
  /** Creates a sandbox and waits until it runs. Vercel's defaults: 2 vCPUs,
148
148
  * 2048 MiB per vCPU, persistent. With no `timeout` it has no time limit: it
149
149
  * runs while it works and pauses when idle. A `timeout` is kept as given. Funding is left to
150
- * Runtime: the free trial while the account has trial time, then prepaid
151
- * credit, exactly as withruntime's own create. */
150
+ * Runtime: the included usage first, then prepaid credit, exactly as withruntime's own create. */
152
151
  static create(params?: CreateSandboxParams): Promise<Sandbox & AsyncDisposable>;
153
152
  /** A sandbox by name (or Runtime id), woken if it is paused unless
154
153
  * `resume: false`. */
@@ -260,8 +260,7 @@ export class Sandbox {
260
260
  /** Creates a sandbox and waits until it runs. Vercel's defaults: 2 vCPUs,
261
261
  * 2048 MiB per vCPU, persistent. With no `timeout` it has no time limit: it
262
262
  * runs while it works and pauses when idle. A `timeout` is kept as given. Funding is left to
263
- * Runtime: the free trial while the account has trial time, then prepaid
264
- * credit, exactly as withruntime's own create. */
263
+ * Runtime: the included usage first, then prepaid credit, exactly as withruntime's own create. */
265
264
  static async create(params = {}) {
266
265
  refuseCreate(params);
267
266
  const client = clientFor(params);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "withruntime",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "license": "Apache-2.0",
5
5
  "mcpName": "com.withruntime/runtime",
6
6
  "type": "module",