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.
- package/BLAXEL.md +4 -4
- package/DAYTONA.md +52 -40
- package/E2B.md +65 -62
- package/README.md +15 -7
- package/README.src.md +15 -7
- package/VERCEL.md +34 -22
- package/compatibility-lock.json +16 -16
- package/dist/blaxel/errors.js +1 -1
- package/dist/blaxel/lookup.d.ts +3 -2
- package/dist/blaxel/lookup.js +3 -2
- package/dist/blaxel/pagination.d.ts +2 -2
- package/dist/blaxel/pagination.js +45 -17
- package/dist/blaxel/preview.d.ts +2 -1
- package/dist/blaxel/preview.js +15 -13
- package/dist/blaxel/process.js +56 -10
- package/dist/blaxel/sandbox.d.ts +2 -0
- package/dist/blaxel/sandbox.js +2 -0
- package/dist/blaxel/snapshot.js +3 -5
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +262 -56
- package/dist/client.d.ts +41 -3
- package/dist/client.js +67 -11
- package/dist/cloudflare/identity.d.ts +7 -0
- package/dist/cloudflare/identity.js +13 -0
- package/dist/cloudflare/index.d.ts +9 -0
- package/dist/cloudflare/index.js +47 -9
- package/dist/cloudflare/worker.d.ts +4 -0
- package/dist/cloudflare/worker.js +166 -16
- package/dist/codesandbox/guest-service.js +57 -20
- package/dist/codesandbox/index.js +42 -8
- package/dist/compat/core.d.ts +9 -8
- package/dist/compat/core.js +60 -21
- package/dist/compat/files.js +22 -4
- package/dist/compat/lease.d.ts +36 -0
- package/dist/compat/lease.js +87 -0
- package/dist/credentials.d.ts +6 -1
- package/dist/credentials.js +107 -38
- package/dist/daytona/computer-use.d.ts +162 -0
- package/dist/daytona/computer-use.js +324 -0
- package/dist/daytona/context.d.ts +10 -0
- package/dist/daytona/context.js +24 -0
- package/dist/daytona/daytona.d.ts +20 -0
- package/dist/daytona/daytona.js +134 -20
- package/dist/daytona/filesystem.d.ts +17 -4
- package/dist/daytona/filesystem.js +129 -38
- package/dist/daytona/index.d.ts +3 -27
- package/dist/daytona/index.js +2 -7
- package/dist/daytona/process.d.ts +63 -6
- package/dist/daytona/process.js +224 -23
- package/dist/daytona/sandbox.d.ts +20 -6
- package/dist/daytona/sandbox.js +55 -32
- package/dist/e2b/client.d.ts +5 -0
- package/dist/e2b/client.js +6 -2
- package/dist/e2b/commands.d.ts +43 -12
- package/dist/e2b/commands.js +217 -64
- package/dist/e2b/errors.d.ts +7 -0
- package/dist/e2b/errors.js +20 -0
- package/dist/e2b/filesystem.d.ts +2 -1
- package/dist/e2b/filesystem.js +43 -6
- package/dist/e2b/index.d.ts +3 -2
- package/dist/e2b/index.js +2 -1
- package/dist/e2b/pty.d.ts +24 -0
- package/dist/e2b/pty.js +83 -0
- package/dist/e2b/sandbox.d.ts +17 -6
- package/dist/e2b/sandbox.js +239 -43
- package/dist/e2b/users.d.ts +30 -0
- package/dist/e2b/users.js +185 -0
- package/dist/file-source.d.ts +16 -0
- package/dist/file-source.js +162 -0
- package/dist/freestyle/index.d.ts +9 -1
- package/dist/freestyle/index.js +38 -5
- package/dist/index.d.ts +3 -1
- package/dist/login.js +16 -10
- package/dist/mcp.d.ts +2 -1
- package/dist/mcp.js +6 -1
- package/dist/modal/index.js +2 -1
- package/dist/network-cli.js +139 -43
- package/dist/openai-agents/index.js +9 -45
- package/dist/page.d.ts +1 -1
- package/dist/page.js +2 -2
- package/dist/products/browser.d.ts +60 -0
- package/dist/products/browser.js +37 -0
- package/dist/products/desktop.d.ts +2 -2
- package/dist/products/desktop.js +2 -2
- package/dist/products/images.d.ts +3 -1
- package/dist/products/images.js +14 -2
- package/dist/products/index.d.ts +14 -0
- package/dist/products/index.js +12 -0
- package/dist/products/network-products.d.ts +7 -0
- package/dist/products/network-products.js +3 -0
- package/dist/products/observability.d.ts +44 -0
- package/dist/products/observability.js +6 -0
- package/dist/products/previews.d.ts +8 -2
- package/dist/products/previews.js +11 -3
- package/dist/products/private-network.d.ts +22 -0
- package/dist/products/private-network.js +10 -0
- package/dist/products/volumes.d.ts +42 -0
- package/dist/products/volumes.js +36 -0
- package/dist/products/watch.js +61 -8
- package/dist/proxy.js +3 -1
- package/dist/runloop/index.d.ts +13 -27
- package/dist/runloop/index.js +149 -52
- package/dist/sandbox.d.ts +59 -8
- package/dist/sandbox.js +479 -68
- package/dist/snapshots.d.ts +9 -4
- package/dist/sprites/index.js +69 -33
- package/dist/tar.d.ts +3 -1
- package/dist/tar.js +140 -14
- package/dist/transport.d.ts +4 -7
- package/dist/transport.js +205 -122
- package/dist/types.d.ts +5 -2
- package/dist/vercel/command.d.ts +1 -1
- package/dist/vercel/command.js +3 -2
- package/dist/vercel/errors.d.ts +1 -1
- package/dist/vercel/errors.js +7 -1
- package/dist/vercel/index.d.ts +1 -7
- package/dist/vercel/index.js +1 -3
- package/dist/vercel/sandbox-user.d.ts +70 -0
- package/dist/vercel/sandbox-user.js +206 -0
- package/dist/vercel/sandbox.d.ts +55 -20
- package/dist/vercel/sandbox.js +353 -99
- package/dist/vercel/snapshot.d.ts +3 -2
- package/dist/vercel/snapshot.js +9 -5
- 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
|
|
6
|
-
*
|
|
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<{
|
package/dist/vercel/snapshot.js
CHANGED
|
@@ -20,8 +20,8 @@ function metadataOf(snapshot) {
|
|
|
20
20
|
expiresAt: Date.parse(snapshot.expiresAt),
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
/** A saved
|
|
24
|
-
*
|
|
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.
|
|
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",
|