@agent-relay/sandbox 0.0.0 → 0.1.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/README.md +8 -4
- package/dist/daytona/runtime.d.ts +117 -0
- package/dist/daytona/runtime.d.ts.map +1 -0
- package/dist/daytona/runtime.js +765 -0
- package/dist/daytona/runtime.js.map +1 -0
- package/dist/e2b/runtime.d.ts +167 -0
- package/dist/e2b/runtime.d.ts.map +1 -0
- package/dist/e2b/runtime.js +362 -0
- package/dist/e2b/runtime.js.map +1 -0
- package/dist/index.d.ts +26 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/dist/local/runtime.d.ts +63 -0
- package/dist/local/runtime.d.ts.map +1 -0
- package/dist/local/runtime.js +315 -0
- package/dist/local/runtime.js.map +1 -0
- package/dist/mount-script.d.ts +162 -0
- package/dist/mount-script.d.ts.map +1 -0
- package/dist/mount-script.js +461 -0
- package/dist/mount-script.js.map +1 -0
- package/dist/orchestrator.d.ts +110 -0
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +553 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/port.d.ts +126 -0
- package/dist/port.d.ts.map +1 -0
- package/dist/port.js +35 -0
- package/dist/port.js.map +1 -0
- package/dist/types.d.ts +71 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +16 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@agent-relay/sandbox` — provider-agnostic sandbox runtimes and orchestration.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Two planes live here, and they are deliberately NOT merged:
|
|
5
|
+
*
|
|
6
|
+
* - The **runtime port** (`SandboxRuntime` and friends) is the outer
|
|
7
|
+
* orchestration plane: launch, look up, run, tear down. Capabilities on this
|
|
8
|
+
* plane are `SandboxRuntimeCapabilities`.
|
|
9
|
+
* - The **bootstrap plane** (`WorkflowRuntime`, `RuntimeCapabilities`,
|
|
10
|
+
* `RuntimeHandle`) describes a live in-sandbox session. Its
|
|
11
|
+
* `RuntimeCapabilities` is a different concept from
|
|
12
|
+
* `SandboxRuntimeCapabilities` and must not be conflated with it.
|
|
13
|
+
*
|
|
14
|
+
* Configuration is injected, never baked in: templates, home directories, and
|
|
15
|
+
* state directories are required arguments, because no default is correct for
|
|
16
|
+
* every consumer.
|
|
7
17
|
*/
|
|
8
18
|
/** Package name, exported so consumers can identify the module at runtime. */
|
|
9
19
|
export declare const PACKAGE_NAME = "@agent-relay/sandbox";
|
|
20
|
+
export type { AsyncRunStartResult, AsyncRunStatus, DeclaredSandboxRuntimeCapabilities, RunScriptResult, SandboxCountOptions, SandboxLookupOptions, SandboxRuntime, SandboxRuntimeCapabilities, } from "./port.js";
|
|
21
|
+
export { resolveSandboxRuntimeCapabilities } from "./port.js";
|
|
22
|
+
export type { AsyncExecStartResult, AsyncExecStatus, ExecOptions, ExecResult, IsolationLevel, LaunchOptions, RuntimeCapabilities, RuntimeHandle, WorkflowRuntime, } from "./types.js";
|
|
23
|
+
export { DaytonaRuntime, SnapshotNotFoundError } from "./daytona/runtime.js";
|
|
24
|
+
export type { DaytonaAttachedSandboxOptions, DaytonaBundleFile, DaytonaCountByLabelsOptions, DaytonaFindByLabelsOptions, DaytonaRunScriptOptions, DaytonaRunScriptResult, DaytonaRuntimeOptions, DaytonaUploadBundleOptions, } from "./daytona/runtime.js";
|
|
25
|
+
export { E2BSandboxRuntime } from "./e2b/runtime.js";
|
|
26
|
+
export type { E2BSandboxRuntimeOptions, E2BSandboxStatics } from "./e2b/runtime.js";
|
|
27
|
+
export { LocalSandboxRuntime } from "./local/runtime.js";
|
|
28
|
+
export type { LocalSandboxRuntimeOptions } from "./local/runtime.js";
|
|
29
|
+
export { SandboxOrchestrator } from "./orchestrator.js";
|
|
30
|
+
export { buildRelayfileMountCleanupInvocationShell, buildRelayfileMountLifecycleShell, } from "./orchestrator.js";
|
|
31
|
+
export type { FlushMountOptions, RelayfileMountHandle, RelayfileMountLifecycleShellOptions, SandboxBundleFile, SandboxCapturedOutput, SandboxCommandResult, SandboxOrchestratorRuntime, SandboxOutputChunk, SandboxProvisionOptions, SandboxRunScriptOptions, StartMountOptions, StopMountOptions, } from "./orchestrator.js";
|
|
32
|
+
export * from "./mount-script.js";
|
|
10
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,8EAA8E;AAC9E,eAAO,MAAM,YAAY,yBAAyB,CAAC;AAGnD,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,kCAAkC,EAClC,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iCAAiC,EAAE,MAAM,WAAW,CAAC;AAG9D,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,eAAe,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,YAAY,EACV,6BAA6B,EAC7B,iBAAiB,EACjB,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,YAAY,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,YAAY,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,yCAAyC,EACzC,iCAAiC,GAClC,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,mCAAmC,EACnC,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAG3B,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@agent-relay/sandbox` — provider-agnostic sandbox runtimes and orchestration.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Two planes live here, and they are deliberately NOT merged:
|
|
5
|
+
*
|
|
6
|
+
* - The **runtime port** (`SandboxRuntime` and friends) is the outer
|
|
7
|
+
* orchestration plane: launch, look up, run, tear down. Capabilities on this
|
|
8
|
+
* plane are `SandboxRuntimeCapabilities`.
|
|
9
|
+
* - The **bootstrap plane** (`WorkflowRuntime`, `RuntimeCapabilities`,
|
|
10
|
+
* `RuntimeHandle`) describes a live in-sandbox session. Its
|
|
11
|
+
* `RuntimeCapabilities` is a different concept from
|
|
12
|
+
* `SandboxRuntimeCapabilities` and must not be conflated with it.
|
|
13
|
+
*
|
|
14
|
+
* Configuration is injected, never baked in: templates, home directories, and
|
|
15
|
+
* state directories are required arguments, because no default is correct for
|
|
16
|
+
* every consumer.
|
|
7
17
|
*/
|
|
8
18
|
/** Package name, exported so consumers can identify the module at runtime. */
|
|
9
19
|
export const PACKAGE_NAME = "@agent-relay/sandbox";
|
|
20
|
+
export { resolveSandboxRuntimeCapabilities } from "./port.js";
|
|
21
|
+
// --- providers -------------------------------------------------------------
|
|
22
|
+
export { DaytonaRuntime, SnapshotNotFoundError } from "./daytona/runtime.js";
|
|
23
|
+
export { E2BSandboxRuntime } from "./e2b/runtime.js";
|
|
24
|
+
export { LocalSandboxRuntime } from "./local/runtime.js";
|
|
25
|
+
// --- orchestration ---------------------------------------------------------
|
|
26
|
+
export { SandboxOrchestrator } from "./orchestrator.js";
|
|
27
|
+
export { buildRelayfileMountCleanupInvocationShell, buildRelayfileMountLifecycleShell, } from "./orchestrator.js";
|
|
28
|
+
// --- relayfile-mount shell builders ----------------------------------------
|
|
29
|
+
export * from "./mount-script.js";
|
|
10
30
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,CAAC;AAanD,OAAO,EAAE,iCAAiC,EAAE,MAAM,WAAW,CAAC;AAe9D,8EAA8E;AAC9E,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAY7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD,8EAA8E;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,yCAAyC,EACzC,iCAAiC,GAClC,MAAM,mBAAmB,CAAC;AAgB3B,8EAA8E;AAC9E,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import type { RuntimeHandle } from "../types.js";
|
|
3
|
+
import type { AsyncRunStartResult, AsyncRunStatus, RunScriptResult, SandboxCountOptions, SandboxLookupOptions, SandboxRuntime } from "../port.js";
|
|
4
|
+
export type LocalSandboxRuntimeOptions = {
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
authToken: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class LocalSandboxRuntime implements SandboxRuntime {
|
|
9
|
+
readonly id = "local";
|
|
10
|
+
readonly declaredCapabilities: {
|
|
11
|
+
readonly warmLease: true;
|
|
12
|
+
readonly lifecycle: true;
|
|
13
|
+
};
|
|
14
|
+
private readonly baseUrl;
|
|
15
|
+
private readonly authToken;
|
|
16
|
+
constructor(options: LocalSandboxRuntimeOptions);
|
|
17
|
+
findByLabels(labels: Record<string, string>, options?: SandboxLookupOptions): Promise<RuntimeHandle | null>;
|
|
18
|
+
findAllByLabels(labels: Record<string, string>, options?: SandboxLookupOptions): Promise<RuntimeHandle[]>;
|
|
19
|
+
countByLabels(labels: Record<string, string>, options?: SandboxCountOptions): Promise<number>;
|
|
20
|
+
launch(options?: {
|
|
21
|
+
name?: string;
|
|
22
|
+
env?: Record<string, string>;
|
|
23
|
+
labels?: Record<string, string>;
|
|
24
|
+
createTimeoutSeconds?: number;
|
|
25
|
+
}): Promise<RuntimeHandle>;
|
|
26
|
+
launchDetached(options?: {
|
|
27
|
+
name?: string;
|
|
28
|
+
env?: Record<string, string>;
|
|
29
|
+
labels?: Record<string, string>;
|
|
30
|
+
createTimeoutSeconds?: number;
|
|
31
|
+
}): Promise<RuntimeHandle>;
|
|
32
|
+
getById(id: string, options?: {
|
|
33
|
+
states?: readonly string[] | null;
|
|
34
|
+
owned?: boolean;
|
|
35
|
+
}): Promise<RuntimeHandle | null>;
|
|
36
|
+
uploadBundle(handle: RuntimeHandle, options: {
|
|
37
|
+
files: Array<{
|
|
38
|
+
source: string | Buffer;
|
|
39
|
+
destination: string;
|
|
40
|
+
}>;
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
runScript(handle: RuntimeHandle, options: {
|
|
43
|
+
command: string;
|
|
44
|
+
sessionId?: string;
|
|
45
|
+
timeoutMs?: number;
|
|
46
|
+
env?: Record<string, string>;
|
|
47
|
+
}): Promise<RunScriptResult>;
|
|
48
|
+
startScript(handle: RuntimeHandle, options: {
|
|
49
|
+
command: string;
|
|
50
|
+
sessionId?: string;
|
|
51
|
+
timeoutMs?: number;
|
|
52
|
+
env?: Record<string, string>;
|
|
53
|
+
suppressInputEcho?: boolean;
|
|
54
|
+
}): Promise<AsyncRunStartResult>;
|
|
55
|
+
getScriptStatus(handle: RuntimeHandle, sessionId: string, commandId: string): Promise<AsyncRunStatus>;
|
|
56
|
+
getScriptLogs(handle: RuntimeHandle, sessionId: string, commandId: string): Promise<RunScriptResult>;
|
|
57
|
+
destroy(handle: RuntimeHandle): Promise<void>;
|
|
58
|
+
stop(handle: RuntimeHandle): Promise<void>;
|
|
59
|
+
start(handle: RuntimeHandle): Promise<RuntimeHandle>;
|
|
60
|
+
private headers;
|
|
61
|
+
private asyncExecUrl;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/local/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CA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CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAW1C,KAAK,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAa1D,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,YAAY;CAGrB"}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
const DEFAULT_LOCAL_SANDBOX_LOOKUP_TIMEOUT_MS = 10_000;
|
|
3
|
+
export class LocalSandboxRuntime {
|
|
4
|
+
id = "local";
|
|
5
|
+
// Both true, declared explicitly rather than by omission so the reasoning is
|
|
6
|
+
// on the record: `start`/`stop` issue real HTTP and only degrade to a no-op
|
|
7
|
+
// when the mini-sandbox server answers 501, and `findAllByLabels` is a real
|
|
8
|
+
// server-side query. Declaring lifecycle false here would make the delivery
|
|
9
|
+
// path skip stop calls that a capable server does honor.
|
|
10
|
+
declaredCapabilities = { warmLease: true, lifecycle: true };
|
|
11
|
+
baseUrl;
|
|
12
|
+
authToken;
|
|
13
|
+
constructor(options) {
|
|
14
|
+
this.baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
15
|
+
this.authToken = options.authToken;
|
|
16
|
+
}
|
|
17
|
+
async findByLabels(labels, options = {}) {
|
|
18
|
+
const handles = await this.findAllByLabels(labels, options);
|
|
19
|
+
const excludedIds = new Set(options.excludeIds ?? []);
|
|
20
|
+
return handles.find((handle) => !excludedIds.has(handle.id)) ?? null;
|
|
21
|
+
}
|
|
22
|
+
async findAllByLabels(labels, options = {}) {
|
|
23
|
+
const states = options.states === undefined ? ["STARTED"] : options.states;
|
|
24
|
+
const limit = options.limit ?? options.pageSize;
|
|
25
|
+
const handles = [];
|
|
26
|
+
let cursor;
|
|
27
|
+
do {
|
|
28
|
+
const url = new URL(`${this.baseUrl}/sandboxes`);
|
|
29
|
+
for (const [key, value] of Object.entries(labels)) {
|
|
30
|
+
url.searchParams.append(key, value);
|
|
31
|
+
url.searchParams.append(`label.${key}`, value);
|
|
32
|
+
}
|
|
33
|
+
if (limit) {
|
|
34
|
+
url.searchParams.set("limit", String(limit));
|
|
35
|
+
}
|
|
36
|
+
if (cursor) {
|
|
37
|
+
url.searchParams.set("cursor", cursor);
|
|
38
|
+
}
|
|
39
|
+
const response = await globalThis.fetch(url, {
|
|
40
|
+
headers: this.headers(),
|
|
41
|
+
});
|
|
42
|
+
if (response.status === 404 || response.status === 501) {
|
|
43
|
+
return handles;
|
|
44
|
+
}
|
|
45
|
+
await assertOk(response, "find local sandbox");
|
|
46
|
+
const body = await response.json();
|
|
47
|
+
const items = body.items ?? body.sandboxes ?? [];
|
|
48
|
+
handles.push(...items
|
|
49
|
+
.filter((item) => matchesState(item, states))
|
|
50
|
+
.map((item) => handleFromLocalRecord(item)));
|
|
51
|
+
cursor = readNextCursor(body, cursor);
|
|
52
|
+
} while (cursor);
|
|
53
|
+
return handles;
|
|
54
|
+
}
|
|
55
|
+
async countByLabels(labels, options = {}) {
|
|
56
|
+
const states = options.states === undefined ? ["STARTED"] : options.states;
|
|
57
|
+
const maxCount = options.maxCount === undefined
|
|
58
|
+
? Number.POSITIVE_INFINITY
|
|
59
|
+
: Math.max(0, Math.floor(options.maxCount));
|
|
60
|
+
if (maxCount === 0) {
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
const configuredPageSize = options.limit ?? options.pageSize;
|
|
64
|
+
const deadline = localSandboxLookupDeadline(options.timeoutMs);
|
|
65
|
+
let count = 0;
|
|
66
|
+
let cursor;
|
|
67
|
+
do {
|
|
68
|
+
const url = new URL(`${this.baseUrl}/sandboxes`);
|
|
69
|
+
for (const [key, value] of Object.entries(labels)) {
|
|
70
|
+
url.searchParams.append(key, value);
|
|
71
|
+
url.searchParams.append(`label.${key}`, value);
|
|
72
|
+
}
|
|
73
|
+
const remainingCount = Number.isFinite(maxCount) ? maxCount - count : undefined;
|
|
74
|
+
const requestLimit = remainingCount === undefined
|
|
75
|
+
? configuredPageSize
|
|
76
|
+
: Math.min(configuredPageSize ?? remainingCount, remainingCount);
|
|
77
|
+
if (requestLimit) {
|
|
78
|
+
url.searchParams.set("limit", String(requestLimit));
|
|
79
|
+
}
|
|
80
|
+
if (cursor) {
|
|
81
|
+
url.searchParams.set("cursor", cursor);
|
|
82
|
+
}
|
|
83
|
+
const response = await awaitLocalSandboxLookupOperation(globalThis.fetch(url, { headers: this.headers() }), deadline, "counting matching sandboxes");
|
|
84
|
+
if (response.status === 404 || response.status === 501) {
|
|
85
|
+
return count;
|
|
86
|
+
}
|
|
87
|
+
await awaitLocalSandboxLookupOperation(assertOk(response, "count local sandboxes"), deadline, "checking the local sandbox count response");
|
|
88
|
+
const body = await awaitLocalSandboxLookupOperation(response.json(), deadline, "reading the local sandbox count response");
|
|
89
|
+
for (const item of body.items ?? body.sandboxes ?? []) {
|
|
90
|
+
if (!matchesState(item, states)) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
count += 1;
|
|
94
|
+
if (count >= maxCount) {
|
|
95
|
+
return count;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
cursor = readNextCursor(body, cursor);
|
|
99
|
+
} while (cursor);
|
|
100
|
+
return count;
|
|
101
|
+
}
|
|
102
|
+
async launch(options = {}) {
|
|
103
|
+
const response = await globalThis.fetch(`${this.baseUrl}/sandboxes`, {
|
|
104
|
+
method: "POST",
|
|
105
|
+
headers: this.headers(true),
|
|
106
|
+
body: JSON.stringify({
|
|
107
|
+
name: options.name,
|
|
108
|
+
env: options.env ?? {},
|
|
109
|
+
envVars: options.env ?? {},
|
|
110
|
+
labels: options.labels ?? {},
|
|
111
|
+
timeoutSeconds: options.createTimeoutSeconds,
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
114
|
+
await assertOk(response, "create local sandbox");
|
|
115
|
+
return handleFromLocalRecord(await response.json());
|
|
116
|
+
}
|
|
117
|
+
async launchDetached(options = {}) {
|
|
118
|
+
return this.launch(options);
|
|
119
|
+
}
|
|
120
|
+
async getById(id, options = {}) {
|
|
121
|
+
const response = await globalThis.fetch(`${this.baseUrl}/sandboxes/${encodeURIComponent(id)}`, {
|
|
122
|
+
headers: this.headers(),
|
|
123
|
+
});
|
|
124
|
+
if (response.status === 404) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
await assertOk(response, "get local sandbox");
|
|
128
|
+
const handle = handleFromLocalRecord(await response.json());
|
|
129
|
+
return matchesState(handle, options.states === undefined ? null : options.states) ? handle : null;
|
|
130
|
+
}
|
|
131
|
+
async uploadBundle(handle, options) {
|
|
132
|
+
const response = await globalThis.fetch(`${this.baseUrl}/sandboxes/${encodeURIComponent(handle.id)}/files`, {
|
|
133
|
+
method: "PUT",
|
|
134
|
+
headers: this.headers(true),
|
|
135
|
+
body: JSON.stringify({
|
|
136
|
+
entries: options.files.map((file) => ({
|
|
137
|
+
source: Buffer.isBuffer(file.source)
|
|
138
|
+
? file.source.toString("base64")
|
|
139
|
+
: Buffer.from(file.source, "utf8").toString("base64"),
|
|
140
|
+
destination: file.destination,
|
|
141
|
+
})),
|
|
142
|
+
}),
|
|
143
|
+
});
|
|
144
|
+
await assertOk(response, "upload local sandbox files");
|
|
145
|
+
}
|
|
146
|
+
async runScript(handle, options) {
|
|
147
|
+
const response = await globalThis.fetch(`${this.baseUrl}/sandboxes/${encodeURIComponent(handle.id)}/exec`, {
|
|
148
|
+
method: "POST",
|
|
149
|
+
headers: this.headers(true),
|
|
150
|
+
body: JSON.stringify({
|
|
151
|
+
command: options.command,
|
|
152
|
+
sessionId: options.sessionId,
|
|
153
|
+
env: options.env,
|
|
154
|
+
timeoutSeconds: options.timeoutMs ? Math.ceil(options.timeoutMs / 1000) : undefined,
|
|
155
|
+
}),
|
|
156
|
+
});
|
|
157
|
+
await assertOk(response, "execute local sandbox command");
|
|
158
|
+
const body = await response.json();
|
|
159
|
+
return {
|
|
160
|
+
output: body.output ?? body.stdout ?? body.stderr ?? body.result ?? "",
|
|
161
|
+
...(body.stdout ? { stdout: body.stdout } : {}),
|
|
162
|
+
...(body.stderr ? { stderr: body.stderr } : {}),
|
|
163
|
+
exitCode: typeof body.exitCode === "number" ? body.exitCode : null,
|
|
164
|
+
...(body.cmdId ? { cmdId: body.cmdId } : {}),
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
async startScript(handle, options) {
|
|
168
|
+
const response = await globalThis.fetch(`${this.baseUrl}/sandboxes/${encodeURIComponent(handle.id)}/exec/async`, {
|
|
169
|
+
method: "POST",
|
|
170
|
+
headers: this.headers(true),
|
|
171
|
+
body: JSON.stringify({
|
|
172
|
+
command: options.command,
|
|
173
|
+
sessionId: options.sessionId,
|
|
174
|
+
env: options.env,
|
|
175
|
+
timeoutSeconds: options.timeoutMs ? Math.ceil(options.timeoutMs / 1000) : undefined,
|
|
176
|
+
}),
|
|
177
|
+
});
|
|
178
|
+
await assertOk(response, "start local sandbox command");
|
|
179
|
+
const body = await response.json();
|
|
180
|
+
if (!body.sessionId || !body.commandId) {
|
|
181
|
+
throw new Error("Local sandbox async command did not return sessionId and commandId");
|
|
182
|
+
}
|
|
183
|
+
return { sessionId: body.sessionId, commandId: body.commandId };
|
|
184
|
+
}
|
|
185
|
+
async getScriptStatus(handle, sessionId, commandId) {
|
|
186
|
+
const response = await globalThis.fetch(this.asyncExecUrl(handle, sessionId, commandId), { headers: this.headers() });
|
|
187
|
+
await assertOk(response, "inspect local sandbox command");
|
|
188
|
+
const body = await response.json();
|
|
189
|
+
return { exitCode: typeof body.exitCode === "number" ? body.exitCode : null };
|
|
190
|
+
}
|
|
191
|
+
async getScriptLogs(handle, sessionId, commandId) {
|
|
192
|
+
const response = await globalThis.fetch(`${this.asyncExecUrl(handle, sessionId, commandId)}/logs`, { headers: this.headers() });
|
|
193
|
+
await assertOk(response, "read local sandbox command logs");
|
|
194
|
+
const body = await response.json();
|
|
195
|
+
return {
|
|
196
|
+
output: body.output ?? body.stdout ?? body.stderr ?? "",
|
|
197
|
+
...(typeof body.stdout === "string" ? { stdout: body.stdout } : {}),
|
|
198
|
+
...(typeof body.stderr === "string" ? { stderr: body.stderr } : {}),
|
|
199
|
+
exitCode: typeof body.exitCode === "number" ? body.exitCode : null,
|
|
200
|
+
cmdId: body.cmdId ?? commandId,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
async destroy(handle) {
|
|
204
|
+
const response = await globalThis.fetch(`${this.baseUrl}/sandboxes/${encodeURIComponent(handle.id)}`, {
|
|
205
|
+
method: "DELETE",
|
|
206
|
+
headers: this.headers(),
|
|
207
|
+
});
|
|
208
|
+
if (response.status === 404) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
await assertOk(response, "delete local sandbox");
|
|
212
|
+
}
|
|
213
|
+
async stop(handle) {
|
|
214
|
+
const response = await globalThis.fetch(`${this.baseUrl}/sandboxes/${encodeURIComponent(handle.id)}/stop`, {
|
|
215
|
+
method: "POST",
|
|
216
|
+
headers: this.headers(),
|
|
217
|
+
});
|
|
218
|
+
if (response.status === 404 || response.status === 501) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
await assertOk(response, "stop local sandbox");
|
|
222
|
+
}
|
|
223
|
+
async start(handle) {
|
|
224
|
+
const response = await globalThis.fetch(`${this.baseUrl}/sandboxes/${encodeURIComponent(handle.id)}/start`, {
|
|
225
|
+
method: "POST",
|
|
226
|
+
headers: this.headers(),
|
|
227
|
+
});
|
|
228
|
+
if (response.status === 404 || response.status === 501) {
|
|
229
|
+
return handle;
|
|
230
|
+
}
|
|
231
|
+
await assertOk(response, "start local sandbox");
|
|
232
|
+
const body = await response.json().catch(() => null);
|
|
233
|
+
return body ? handleFromLocalRecord(body) : { ...handle, state: "STARTED" };
|
|
234
|
+
}
|
|
235
|
+
headers(json = false) {
|
|
236
|
+
return {
|
|
237
|
+
authorization: `Bearer ${this.authToken}`,
|
|
238
|
+
...(json ? { "content-type": "application/json" } : {}),
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
asyncExecUrl(handle, sessionId, commandId) {
|
|
242
|
+
return `${this.baseUrl}/sandboxes/${encodeURIComponent(handle.id)}/exec/async/${encodeURIComponent(sessionId)}/${encodeURIComponent(commandId)}`;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
function handleFromLocalRecord(record) {
|
|
246
|
+
const id = record.sandboxId ?? record.id;
|
|
247
|
+
if (!id) {
|
|
248
|
+
throw new Error("Local sandbox response is missing sandboxId");
|
|
249
|
+
}
|
|
250
|
+
return {
|
|
251
|
+
id,
|
|
252
|
+
...((record.state ?? record.status) ? { state: record.state ?? record.status } : {}),
|
|
253
|
+
...(record.createdAt ? { createdAt: record.createdAt } : {}),
|
|
254
|
+
...(record.updatedAt ? { updatedAt: record.updatedAt } : {}),
|
|
255
|
+
...(record.lastActivityAt ? { lastActivityAt: record.lastActivityAt } : {}),
|
|
256
|
+
...(record.homeDir ? { homeDir: record.homeDir } : {}),
|
|
257
|
+
...(record.workdir ? { workdir: record.workdir } : {}),
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function readNextCursor(body, currentCursor) {
|
|
261
|
+
for (const value of [body.nextCursor, body.nextToken, body.cursor]) {
|
|
262
|
+
if (typeof value === "string" && value.length > 0 && value !== currentCursor) {
|
|
263
|
+
return value;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return undefined;
|
|
267
|
+
}
|
|
268
|
+
function matchesState(record, states) {
|
|
269
|
+
if (states === null) {
|
|
270
|
+
return true;
|
|
271
|
+
}
|
|
272
|
+
const rawState = (record.state ?? record.status ?? "STARTED").toUpperCase();
|
|
273
|
+
const state = rawState === "RUNNING" ? "STARTED" : rawState;
|
|
274
|
+
return states.includes(state);
|
|
275
|
+
}
|
|
276
|
+
function localSandboxLookupDeadline(timeoutMs) {
|
|
277
|
+
const effectiveTimeoutMs = timeoutMs ?? DEFAULT_LOCAL_SANDBOX_LOOKUP_TIMEOUT_MS;
|
|
278
|
+
const normalizedTimeoutMs = Number.isFinite(effectiveTimeoutMs) && effectiveTimeoutMs > 0
|
|
279
|
+
? Math.max(1, Math.ceil(effectiveTimeoutMs))
|
|
280
|
+
: DEFAULT_LOCAL_SANDBOX_LOOKUP_TIMEOUT_MS;
|
|
281
|
+
return {
|
|
282
|
+
endsAt: Date.now() + normalizedTimeoutMs,
|
|
283
|
+
timeoutMs: normalizedTimeoutMs,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
async function awaitLocalSandboxLookupOperation(operation, deadline, description) {
|
|
287
|
+
const remainingMs = deadline.endsAt - Date.now();
|
|
288
|
+
if (remainingMs <= 0) {
|
|
289
|
+
throw new Error(`Local sandbox lookup exceeded ${deadline.timeoutMs}ms while ${description}`);
|
|
290
|
+
}
|
|
291
|
+
let timer;
|
|
292
|
+
try {
|
|
293
|
+
return await Promise.race([
|
|
294
|
+
operation,
|
|
295
|
+
new Promise((_resolve, reject) => {
|
|
296
|
+
timer = setTimeout(() => {
|
|
297
|
+
reject(new Error(`Local sandbox lookup exceeded ${deadline.timeoutMs}ms while ${description}`));
|
|
298
|
+
}, remainingMs);
|
|
299
|
+
}),
|
|
300
|
+
]);
|
|
301
|
+
}
|
|
302
|
+
finally {
|
|
303
|
+
if (timer !== undefined) {
|
|
304
|
+
clearTimeout(timer);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
async function assertOk(response, action) {
|
|
309
|
+
if (response.ok) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
const body = await response.text().catch(() => "");
|
|
313
|
+
throw new Error(`Failed to ${action}: HTTP ${response.status}${body ? `: ${body.slice(0, 500)}` : ""}`);
|
|
314
|
+
}
|
|
315
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/local/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAiBrC,MAAM,uCAAuC,G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