withruntime 0.9.0 → 0.11.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 (124) hide show
  1. package/BLAXEL.md +4 -4
  2. package/DAYTONA.md +52 -40
  3. package/E2B.md +65 -62
  4. package/README.md +15 -7
  5. package/README.src.md +15 -7
  6. package/VERCEL.md +34 -22
  7. package/compatibility-lock.json +16 -16
  8. package/dist/blaxel/errors.js +1 -1
  9. package/dist/blaxel/lookup.d.ts +3 -2
  10. package/dist/blaxel/lookup.js +3 -2
  11. package/dist/blaxel/pagination.d.ts +2 -2
  12. package/dist/blaxel/pagination.js +45 -17
  13. package/dist/blaxel/preview.d.ts +2 -1
  14. package/dist/blaxel/preview.js +15 -13
  15. package/dist/blaxel/process.js +56 -10
  16. package/dist/blaxel/sandbox.d.ts +2 -0
  17. package/dist/blaxel/sandbox.js +2 -0
  18. package/dist/blaxel/snapshot.js +3 -5
  19. package/dist/cli.d.ts +2 -0
  20. package/dist/cli.js +262 -56
  21. package/dist/client.d.ts +41 -3
  22. package/dist/client.js +67 -11
  23. package/dist/cloudflare/identity.d.ts +7 -0
  24. package/dist/cloudflare/identity.js +13 -0
  25. package/dist/cloudflare/index.d.ts +9 -0
  26. package/dist/cloudflare/index.js +47 -9
  27. package/dist/cloudflare/worker.d.ts +4 -0
  28. package/dist/cloudflare/worker.js +166 -16
  29. package/dist/codesandbox/guest-service.js +57 -20
  30. package/dist/codesandbox/index.js +42 -8
  31. package/dist/compat/core.d.ts +9 -8
  32. package/dist/compat/core.js +60 -21
  33. package/dist/compat/files.js +22 -4
  34. package/dist/compat/lease.d.ts +36 -0
  35. package/dist/compat/lease.js +87 -0
  36. package/dist/credentials.d.ts +6 -1
  37. package/dist/credentials.js +107 -38
  38. package/dist/daytona/computer-use.d.ts +162 -0
  39. package/dist/daytona/computer-use.js +324 -0
  40. package/dist/daytona/context.d.ts +10 -0
  41. package/dist/daytona/context.js +24 -0
  42. package/dist/daytona/daytona.d.ts +20 -0
  43. package/dist/daytona/daytona.js +134 -20
  44. package/dist/daytona/filesystem.d.ts +17 -4
  45. package/dist/daytona/filesystem.js +129 -38
  46. package/dist/daytona/index.d.ts +3 -27
  47. package/dist/daytona/index.js +2 -7
  48. package/dist/daytona/process.d.ts +63 -6
  49. package/dist/daytona/process.js +224 -23
  50. package/dist/daytona/sandbox.d.ts +20 -6
  51. package/dist/daytona/sandbox.js +55 -32
  52. package/dist/e2b/client.d.ts +5 -0
  53. package/dist/e2b/client.js +6 -2
  54. package/dist/e2b/commands.d.ts +43 -12
  55. package/dist/e2b/commands.js +217 -64
  56. package/dist/e2b/errors.d.ts +7 -0
  57. package/dist/e2b/errors.js +20 -0
  58. package/dist/e2b/filesystem.d.ts +2 -1
  59. package/dist/e2b/filesystem.js +43 -6
  60. package/dist/e2b/index.d.ts +3 -2
  61. package/dist/e2b/index.js +2 -1
  62. package/dist/e2b/pty.d.ts +24 -0
  63. package/dist/e2b/pty.js +83 -0
  64. package/dist/e2b/sandbox.d.ts +17 -6
  65. package/dist/e2b/sandbox.js +239 -43
  66. package/dist/e2b/users.d.ts +30 -0
  67. package/dist/e2b/users.js +185 -0
  68. package/dist/file-source.d.ts +16 -0
  69. package/dist/file-source.js +162 -0
  70. package/dist/freestyle/index.d.ts +9 -1
  71. package/dist/freestyle/index.js +38 -5
  72. package/dist/index.d.ts +3 -1
  73. package/dist/login.js +16 -10
  74. package/dist/mcp.d.ts +2 -1
  75. package/dist/mcp.js +6 -1
  76. package/dist/modal/index.js +2 -1
  77. package/dist/network-cli.js +139 -43
  78. package/dist/openai-agents/index.js +9 -45
  79. package/dist/page.d.ts +1 -1
  80. package/dist/page.js +2 -2
  81. package/dist/products/browser.d.ts +60 -0
  82. package/dist/products/browser.js +37 -0
  83. package/dist/products/desktop.d.ts +2 -2
  84. package/dist/products/desktop.js +2 -2
  85. package/dist/products/images.d.ts +3 -1
  86. package/dist/products/images.js +14 -2
  87. package/dist/products/index.d.ts +14 -0
  88. package/dist/products/index.js +12 -0
  89. package/dist/products/network-products.d.ts +7 -0
  90. package/dist/products/network-products.js +3 -0
  91. package/dist/products/observability.d.ts +44 -0
  92. package/dist/products/observability.js +6 -0
  93. package/dist/products/previews.d.ts +8 -2
  94. package/dist/products/previews.js +11 -3
  95. package/dist/products/private-network.d.ts +22 -0
  96. package/dist/products/private-network.js +10 -0
  97. package/dist/products/volumes.d.ts +42 -0
  98. package/dist/products/volumes.js +36 -0
  99. package/dist/products/watch.js +61 -8
  100. package/dist/proxy.js +3 -1
  101. package/dist/runloop/index.d.ts +13 -27
  102. package/dist/runloop/index.js +149 -52
  103. package/dist/sandbox.d.ts +59 -8
  104. package/dist/sandbox.js +479 -68
  105. package/dist/snapshots.d.ts +9 -4
  106. package/dist/sprites/index.js +69 -33
  107. package/dist/tar.d.ts +3 -1
  108. package/dist/tar.js +140 -14
  109. package/dist/transport.d.ts +4 -7
  110. package/dist/transport.js +205 -122
  111. package/dist/types.d.ts +5 -2
  112. package/dist/vercel/command.d.ts +1 -1
  113. package/dist/vercel/command.js +3 -2
  114. package/dist/vercel/errors.d.ts +1 -1
  115. package/dist/vercel/errors.js +7 -1
  116. package/dist/vercel/index.d.ts +1 -7
  117. package/dist/vercel/index.js +1 -3
  118. package/dist/vercel/sandbox-user.d.ts +70 -0
  119. package/dist/vercel/sandbox-user.js +206 -0
  120. package/dist/vercel/sandbox.d.ts +55 -20
  121. package/dist/vercel/sandbox.js +353 -99
  122. package/dist/vercel/snapshot.d.ts +3 -2
  123. package/dist/vercel/snapshot.js +9 -5
  124. package/package.json +2 -1
@@ -2,8 +2,8 @@ import type { Runtime } from "../client.js";
2
2
  import type { Snapshot as RuntimeSnapshot } from "../snapshots.js";
3
3
  import { type Credentials, type WithRuntime } from "./client.js";
4
4
  type Status = "created" | "failed" | "deleted";
5
- /** A saved sandbox, as Vercel's Snapshot, over a Runtime snapshot: files,
6
- * memory and running processes. `sourceSessionId` is the Runtime id of the
5
+ /** A saved filesystem, as Vercel's Snapshot, over a Runtime disk snapshot.
6
+ * Restoring it starts fresh processes. `sourceSessionId` is the Runtime id of the
7
7
  * sandbox it came from. */
8
8
  export declare class Snapshot {
9
9
  #private;
@@ -26,6 +26,7 @@ export declare class Snapshot {
26
26
  static list(params?: {
27
27
  name?: string;
28
28
  limit?: number;
29
+ signal?: AbortSignal;
29
30
  } & Credentials & {
30
31
  withruntime?: WithRuntime;
31
32
  } & Record<string, unknown>): Promise<{
@@ -20,8 +20,8 @@ function metadataOf(snapshot) {
20
20
  expiresAt: Date.parse(snapshot.expiresAt),
21
21
  };
22
22
  }
23
- /** A saved sandbox, as Vercel's Snapshot, over a Runtime snapshot: files,
24
- * memory and running processes. `sourceSessionId` is the Runtime id of the
23
+ /** A saved filesystem, as Vercel's Snapshot, over a Runtime disk snapshot.
24
+ * Restoring it starts fresh processes. `sourceSessionId` is the Runtime id of the
25
25
  * sandbox it came from. */
26
26
  export class Snapshot {
27
27
  #snapshot;
@@ -60,13 +60,14 @@ export class Snapshot {
60
60
  }
61
61
  /** Snapshots, oldest first; `name` narrows to one sandbox's. */
62
62
  static async list(params = {}) {
63
+ params.signal?.throwIfAborted();
63
64
  for (const field of ["since", "until", "cursor", "sortOrder"])
64
65
  if (params[field] !== undefined)
65
66
  throw new NotSupportedError(`Listing snapshots by ${field}`, "List them all and filter the result yourself.");
66
67
  const client = clientFor(params);
67
68
  let sandboxId;
68
69
  if (params.name !== undefined) {
69
- const found = (await guard(() => client.sandboxes.list({ name: params.name, includeStopped: true }))).data[0];
70
+ const found = (await guard(() => client.sandboxes.list({ name: params.name, includeStopped: true }, signalOf(params)))).data[0];
70
71
  if (!found)
71
72
  return paginate([], null);
72
73
  sandboxId = found.id;
@@ -74,7 +75,7 @@ export class Snapshot {
74
75
  const page = await guard(() => client.snapshots.list({
75
76
  ...(sandboxId ? { sandboxId } : {}),
76
77
  ...(params.limit ? { limit: params.limit } : {}),
77
- }));
78
+ }, signalOf(params)));
78
79
  return paginate(page.data, page.nextCursor, page);
79
80
  }
80
81
  static tree() {
@@ -83,10 +84,13 @@ export class Snapshot {
83
84
  async delete(opts = {}) {
84
85
  try {
85
86
  await guard(() => this.#client.snapshots.delete(this.#snapshot.id, signalOf(opts)));
87
+ Object.assign(this.#snapshot, await guard(() => this.#client.snapshots.get(this.#snapshot.id, signalOf(opts))));
86
88
  }
87
89
  catch (error) {
88
- if (error instanceof APIError && error.response.status === 404)
90
+ if (error instanceof APIError && error.response.status === 404) {
91
+ this.#snapshot.state = "deleted";
89
92
  return;
93
+ }
90
94
  throw error;
91
95
  }
92
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "withruntime",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "license": "Apache-2.0",
5
5
  "mcpName": "com.withruntime/runtime",
6
6
  "type": "module",
@@ -169,6 +169,7 @@
169
169
  "bugs": "https://github.com/withruntime/runtime/issues",
170
170
  "sideEffects": false,
171
171
  "browser": {
172
+ "./dist/file-source.js": "./dist/browser-stub.js",
172
173
  "./dist/tar.js": "./dist/browser-stub.js",
173
174
  "./dist/image-context.js": "./dist/browser-stub.js",
174
175
  "./dist/credentials.js": "./dist/browser-stub.js",