@parcha/agentrun-computer 0.0.0-stage → 0.1.0-beta.32
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/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +2401 -2
- package/box/Dockerfile +69 -0
- package/box/agentrun-archil +168 -0
- package/box/build-daytona.py +26 -0
- package/box/build-e2b.mjs +32 -0
- package/box/build-modal.py +17 -0
- package/dist/actions.d.ts +18 -0
- package/dist/actions.js +139 -0
- package/dist/browser.d.ts +151 -0
- package/dist/browser.js +305 -0
- package/dist/browserbase.d.ts +139 -0
- package/dist/browserbase.js +408 -0
- package/dist/child.d.ts +40 -0
- package/dist/child.js +127 -0
- package/dist/client.d.ts +22 -0
- package/dist/client.js +136 -0
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/conformance/archil.d.ts +68 -0
- package/dist/conformance/archil.js +152 -0
- package/dist/conformance/browserbase.d.ts +35 -0
- package/dist/conformance/browserbase.js +45 -0
- package/dist/conformance/cases/apps.d.ts +2 -0
- package/dist/conformance/cases/apps.js +155 -0
- package/dist/conformance/cases/browser.d.ts +4 -0
- package/dist/conformance/cases/browser.js +105 -0
- package/dist/conformance/cases/drift.d.ts +2 -0
- package/dist/conformance/cases/drift.js +64 -0
- package/dist/conformance/cases/exec.d.ts +2 -0
- package/dist/conformance/cases/exec.js +125 -0
- package/dist/conformance/cases/files.d.ts +2 -0
- package/dist/conformance/cases/files.js +294 -0
- package/dist/conformance/cases/health.d.ts +2 -0
- package/dist/conformance/cases/health.js +71 -0
- package/dist/conformance/cases/index.d.ts +9 -0
- package/dist/conformance/cases/index.js +37 -0
- package/dist/conformance/cases/input.d.ts +12 -0
- package/dist/conformance/cases/input.js +109 -0
- package/dist/conformance/cases/isolation.d.ts +21 -0
- package/dist/conformance/cases/isolation.js +92 -0
- package/dist/conformance/cases/lifetime.d.ts +2 -0
- package/dist/conformance/cases/lifetime.js +64 -0
- package/dist/conformance/cases/mount.d.ts +2 -0
- package/dist/conformance/cases/mount.js +252 -0
- package/dist/conformance/cases/process.d.ts +2 -0
- package/dist/conformance/cases/process.js +240 -0
- package/dist/conformance/cases/provider.d.ts +2 -0
- package/dist/conformance/cases/provider.js +302 -0
- package/dist/conformance/cases/screen.d.ts +9 -0
- package/dist/conformance/cases/screen.js +230 -0
- package/dist/conformance/cases/settings.d.ts +57 -0
- package/dist/conformance/cases/settings.js +142 -0
- package/dist/conformance/cases/touch.d.ts +2 -0
- package/dist/conformance/cases/touch.js +117 -0
- package/dist/conformance/cases/util.d.ts +7 -0
- package/dist/conformance/cases/util.js +8 -0
- package/dist/conformance/cdp.d.ts +13 -0
- package/dist/conformance/cdp.js +88 -0
- package/dist/conformance/cli.d.ts +29 -0
- package/dist/conformance/cli.js +231 -0
- package/dist/conformance/daytona-sweep.d.ts +18 -0
- package/dist/conformance/daytona-sweep.js +118 -0
- package/dist/conformance/daytona.d.ts +83 -0
- package/dist/conformance/daytona.js +107 -0
- package/dist/conformance/docker.d.ts +38 -0
- package/dist/conformance/docker.js +70 -0
- package/dist/conformance/drift-daemon.d.ts +8 -0
- package/dist/conformance/drift-daemon.js +41 -0
- package/dist/conformance/e2b-diagnose.d.ts +16 -0
- package/dist/conformance/e2b-diagnose.js +61 -0
- package/dist/conformance/e2b-sweep.d.ts +18 -0
- package/dist/conformance/e2b-sweep.js +125 -0
- package/dist/conformance/e2b.d.ts +74 -0
- package/dist/conformance/e2b.js +111 -0
- package/dist/conformance/fixture.d.ts +65 -0
- package/dist/conformance/fixture.js +98 -0
- package/dist/conformance/index.d.ts +8 -0
- package/dist/conformance/index.js +8 -0
- package/dist/conformance/kernel.d.ts +31 -0
- package/dist/conformance/kernel.js +40 -0
- package/dist/conformance/kind.d.ts +23 -0
- package/dist/conformance/kind.js +58 -0
- package/dist/conformance/modal-sweep.d.ts +22 -0
- package/dist/conformance/modal-sweep.js +190 -0
- package/dist/conformance/modal.d.ts +69 -0
- package/dist/conformance/modal.js +76 -0
- package/dist/conformance/orgo.d.ts +41 -0
- package/dist/conformance/orgo.js +69 -0
- package/dist/conformance/phone-harness.d.ts +61 -0
- package/dist/conformance/phone-harness.js +241 -0
- package/dist/conformance/png.d.ts +16 -0
- package/dist/conformance/png.js +132 -0
- package/dist/conformance/report.d.ts +2 -0
- package/dist/conformance/report.js +86 -0
- package/dist/conformance/runner.d.ts +11 -0
- package/dist/conformance/runner.js +585 -0
- package/dist/conformance/tar.d.ts +13 -0
- package/dist/conformance/tar.js +105 -0
- package/dist/conformance/types.d.ts +257 -0
- package/dist/conformance/types.js +24 -0
- package/dist/daemon-copy.d.ts +40 -0
- package/dist/daemon-copy.js +259 -0
- package/dist/daytona.d.ts +178 -0
- package/dist/daytona.js +1484 -0
- package/dist/desktop.d.ts +24 -0
- package/dist/desktop.js +68 -0
- package/dist/docker/egress-main.d.ts +1 -0
- package/dist/docker/egress-main.js +68 -0
- package/dist/docker/egress-proxy.d.ts +53 -0
- package/dist/docker/egress-proxy.js +450 -0
- package/dist/docker/egress-table.d.ts +39 -0
- package/dist/docker/egress-table.js +197 -0
- package/dist/docker/egress.d.ts +109 -0
- package/dist/docker/egress.js +318 -0
- package/dist/docker/image.d.ts +49 -0
- package/dist/docker/image.js +302 -0
- package/dist/docker/stage.d.ts +21 -0
- package/dist/docker/stage.js +290 -0
- package/dist/docker/volume.d.ts +24 -0
- package/dist/docker/volume.js +67 -0
- package/dist/docker.d.ts +150 -0
- package/dist/docker.js +1200 -0
- package/dist/drift.d.ts +200 -0
- package/dist/drift.js +416 -0
- package/dist/e2b.d.ts +335 -0
- package/dist/e2b.js +1515 -0
- package/dist/entry.d.ts +2 -0
- package/dist/entry.js +24 -0
- package/dist/files.d.ts +50 -0
- package/dist/files.js +208 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +26 -0
- package/dist/isolation.d.ts +29 -0
- package/dist/isolation.js +71 -0
- package/dist/janitor.d.ts +50 -0
- package/dist/janitor.js +135 -0
- package/dist/kernel.d.ts +113 -0
- package/dist/kernel.js +358 -0
- package/dist/kinds.d.ts +79 -0
- package/dist/kinds.js +133 -0
- package/dist/labels.d.ts +23 -0
- package/dist/labels.js +50 -0
- package/dist/modal.d.ts +302 -0
- package/dist/modal.js +1374 -0
- package/dist/mount-archil.d.ts +164 -0
- package/dist/mount-archil.js +471 -0
- package/dist/mount.d.ts +57 -0
- package/dist/mount.js +104 -0
- package/dist/orgo-channel.d.ts +96 -0
- package/dist/orgo-channel.js +391 -0
- package/dist/orgo.d.ts +139 -0
- package/dist/orgo.js +1006 -0
- package/dist/phone-harness.d.ts +185 -0
- package/dist/phone-harness.js +1420 -0
- package/dist/processes.d.ts +24 -0
- package/dist/processes.js +40 -0
- package/dist/protocol.d.ts +729 -0
- package/dist/protocol.js +54 -0
- package/dist/provider.d.ts +245 -0
- package/dist/provider.js +37 -0
- package/dist/providers.d.ts +68 -0
- package/dist/providers.js +25 -0
- package/dist/result.d.ts +15 -0
- package/dist/result.js +2 -0
- package/dist/screen-watch.d.ts +150 -0
- package/dist/screen-watch.js +490 -0
- package/dist/test-connection.d.ts +17 -0
- package/dist/test-connection.js +26 -0
- package/dist/wait.d.ts +23 -0
- package/dist/wait.js +65 -0
- package/package.json +62 -4
package/dist/e2b.d.ts
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { type DesktopOptions } from "./desktop.js";
|
|
2
|
+
import type { KindCapabilities } from "./kinds.js";
|
|
3
|
+
import { type MountKind } from "./mount.js";
|
|
4
|
+
import { type ProviderNote } from "./mount-archil.js";
|
|
5
|
+
import { type AttachedComputer, type CallContext, type ComputerCapabilities, type ComputerConnection, type ComputerInfo, type ComputerProvider, type ComputerRef, type ComputerSpec, type CreatedComputer, type NetworkPolicy, type NetworkSpec, type Refusal } from "./provider.js";
|
|
6
|
+
import { type ComputerErrorCode, type Result } from "./result.js";
|
|
7
|
+
import { type ScreenWatch, type ScreenWatchHandlers, type WatchOptions } from "./screen-watch.js";
|
|
8
|
+
/** What every SDK call is given: the key, the domain and the API URL explicitly, and debug false (index.mjs:1126-1152). */
|
|
9
|
+
export interface E2BConnectionOptions {
|
|
10
|
+
apiKey: string;
|
|
11
|
+
domain: string;
|
|
12
|
+
apiUrl: string;
|
|
13
|
+
debug: false;
|
|
14
|
+
requestTimeoutMs?: number;
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
}
|
|
17
|
+
/** Sandbox.create's options as the provider gives them (SandboxOpts, index.d.mts:10140-10245). */
|
|
18
|
+
export interface E2BCreateOptions extends E2BConnectionOptions {
|
|
19
|
+
timeoutMs: number;
|
|
20
|
+
metadata: Record<string, string>;
|
|
21
|
+
envs: Record<string, string>;
|
|
22
|
+
allowInternetAccess: boolean;
|
|
23
|
+
network: {
|
|
24
|
+
allowPublicTraffic: boolean;
|
|
25
|
+
};
|
|
26
|
+
lifecycle: {
|
|
27
|
+
onTimeout: "kill";
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** What getInfo reports of a sandbox, as far as this provider reads it (index.mjs:5432-5465). */
|
|
31
|
+
export interface E2BSandboxInfo {
|
|
32
|
+
sandboxId: string;
|
|
33
|
+
templateId: string;
|
|
34
|
+
name?: string;
|
|
35
|
+
metadata: Record<string, string>;
|
|
36
|
+
allowInternetAccess?: boolean;
|
|
37
|
+
startedAt: Date;
|
|
38
|
+
endAt: Date;
|
|
39
|
+
state: string;
|
|
40
|
+
network?: {
|
|
41
|
+
allowOut?: string[];
|
|
42
|
+
denyOut?: string[];
|
|
43
|
+
allowPublicTraffic?: boolean;
|
|
44
|
+
egressProxy?: unknown;
|
|
45
|
+
rules?: unknown;
|
|
46
|
+
dnsServers?: unknown;
|
|
47
|
+
};
|
|
48
|
+
lifecycle?: {
|
|
49
|
+
onTimeout?: string;
|
|
50
|
+
autoResume?: boolean;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** One sandbox in a page of Sandbox.list (index.mjs:5820-5838). */
|
|
54
|
+
export interface E2BListedSandbox {
|
|
55
|
+
sandboxId: string;
|
|
56
|
+
metadata: Record<string, string>;
|
|
57
|
+
state: string;
|
|
58
|
+
startedAt: Date;
|
|
59
|
+
endAt: Date;
|
|
60
|
+
}
|
|
61
|
+
/** The result of a command that has ended (index.mjs:2751-2757); CommandExitError carries the same fields. */
|
|
62
|
+
export interface E2BCommandResult {
|
|
63
|
+
exitCode: number;
|
|
64
|
+
stdout: string;
|
|
65
|
+
stderr: string;
|
|
66
|
+
}
|
|
67
|
+
/** A background command (CommandHandle, index.mjs:2683-2810). */
|
|
68
|
+
export interface E2BCommandHandle {
|
|
69
|
+
readonly pid: number;
|
|
70
|
+
readonly stderr: string;
|
|
71
|
+
wait(): Promise<E2BCommandResult>;
|
|
72
|
+
kill(): Promise<boolean>;
|
|
73
|
+
disconnect(): Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
export interface E2BRunOptions {
|
|
76
|
+
user: "root";
|
|
77
|
+
timeoutMs: number;
|
|
78
|
+
requestTimeoutMs: number;
|
|
79
|
+
signal?: AbortSignal;
|
|
80
|
+
}
|
|
81
|
+
/** The part of a connected Sandbox called here: commands and files (index.mjs:5917-5989). */
|
|
82
|
+
export interface E2BSandbox {
|
|
83
|
+
readonly sandboxId: string;
|
|
84
|
+
readonly files: {
|
|
85
|
+
write(path: string, data: ArrayBuffer, options: {
|
|
86
|
+
user: "root";
|
|
87
|
+
requestTimeoutMs: number;
|
|
88
|
+
signal?: AbortSignal;
|
|
89
|
+
}): Promise<unknown>;
|
|
90
|
+
};
|
|
91
|
+
readonly commands: {
|
|
92
|
+
run(command: string, options: E2BRunOptions & {
|
|
93
|
+
background?: false;
|
|
94
|
+
}): Promise<E2BCommandResult>;
|
|
95
|
+
run(command: string, options: E2BRunOptions & {
|
|
96
|
+
background: true;
|
|
97
|
+
stdin?: boolean;
|
|
98
|
+
retainOutput?: boolean;
|
|
99
|
+
onStdout?: (data: string) => void;
|
|
100
|
+
onStderr?: (data: string) => void;
|
|
101
|
+
}): Promise<E2BCommandHandle>;
|
|
102
|
+
sendStdin(pid: number, data: Uint8Array, options: {
|
|
103
|
+
requestTimeoutMs: number;
|
|
104
|
+
}): Promise<void>;
|
|
105
|
+
/** Ends a command's stdin, so it reads end of file (index.mjs:5071-5082). */
|
|
106
|
+
closeStdin(pid: number, options: {
|
|
107
|
+
requestTimeoutMs: number;
|
|
108
|
+
}): Promise<void>;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** The paginator Sandbox.list returns (SandboxPaginator, index.mjs:5785-5849). */
|
|
112
|
+
export interface E2BPaginator {
|
|
113
|
+
readonly hasNext: boolean;
|
|
114
|
+
nextItems(options: {
|
|
115
|
+
requestTimeoutMs: number;
|
|
116
|
+
signal?: AbortSignal;
|
|
117
|
+
}): Promise<E2BListedSandbox[]>;
|
|
118
|
+
}
|
|
119
|
+
/** The statics of the SDK's Sandbox class this provider calls. The host's own, or anything with the same slice. */
|
|
120
|
+
export interface E2BSandboxClass {
|
|
121
|
+
create(template: string, options: E2BCreateOptions): Promise<E2BSandbox>;
|
|
122
|
+
connect(sandboxId: string, options: E2BConnectionOptions & {
|
|
123
|
+
timeoutMs: number;
|
|
124
|
+
}): Promise<E2BSandbox>;
|
|
125
|
+
getInfo(sandboxId: string, options: E2BConnectionOptions): Promise<E2BSandboxInfo>;
|
|
126
|
+
setTimeout(sandboxId: string, timeoutMs: number, options: E2BConnectionOptions): Promise<void>;
|
|
127
|
+
kill(sandboxId: string, options: E2BConnectionOptions): Promise<boolean>;
|
|
128
|
+
list(options: Omit<E2BConnectionOptions, "signal"> & {
|
|
129
|
+
query: {
|
|
130
|
+
metadata: Record<string, string>;
|
|
131
|
+
};
|
|
132
|
+
limit: number;
|
|
133
|
+
}): E2BPaginator;
|
|
134
|
+
}
|
|
135
|
+
/** The longest each kind of call may take, and the pauses between polls. */
|
|
136
|
+
export interface E2BTimeouts {
|
|
137
|
+
/** One control-plane or envd call: getInfo, kill, setTimeout, connect, a page of list, a bridge's start. */
|
|
138
|
+
requestMs: number;
|
|
139
|
+
/** Sandbox.create. */
|
|
140
|
+
createMs: number;
|
|
141
|
+
/** The daemon's upload. */
|
|
142
|
+
uploadMs: number;
|
|
143
|
+
/** The install command. */
|
|
144
|
+
execMs: number;
|
|
145
|
+
/** From a connect's start to the daemon's hello, and each read-back call after it. */
|
|
146
|
+
helloMs: number;
|
|
147
|
+
/** The probe, run through the daemon: it takes at most 20 s (10 s to connect, 10 s to answer, every target at once). */
|
|
148
|
+
probeMs: number;
|
|
149
|
+
/** One whole list, every page and every sandbox's read-back. */
|
|
150
|
+
listMs: number;
|
|
151
|
+
/** From a kill to a sandbox E2B no longer has and no longer lists. */
|
|
152
|
+
goneMs: number;
|
|
153
|
+
/** The first pause between two reads while release waits; the pauses double up to 5 s. */
|
|
154
|
+
pollMs: number;
|
|
155
|
+
/** How long create waits for the listing to show the new computer. */
|
|
156
|
+
listedMs: number;
|
|
157
|
+
/** Each root step of an Archil mount (the preflight, mount or revoke, serve), and its checkin at release. */
|
|
158
|
+
mountMs: number;
|
|
159
|
+
}
|
|
160
|
+
export interface E2BProviderOptions {
|
|
161
|
+
/** The E2B API key. The caller passes it; this provider never reads it from the environment or puts it in a computer. */
|
|
162
|
+
apiKey: string;
|
|
163
|
+
/** Told what is no failure of the call it came from: a release that did not let an Archil folder go cleanly. */
|
|
164
|
+
onNote?: ProviderNote;
|
|
165
|
+
/** The SDK's Sandbox class: the host's `e2b` package's, or a fake. */
|
|
166
|
+
Sandbox: E2BSandboxClass;
|
|
167
|
+
/** E2B's domain: the API is https://api.<domain>. Default e2b.app. */
|
|
168
|
+
domain?: string;
|
|
169
|
+
/** The daemon binary for linux/amd64 on this machine. Default this package's dist/computerd-linux-amd64. */
|
|
170
|
+
daemonPath?: string;
|
|
171
|
+
/** desktop (default): a template with an X server, started through the daemon; linux: no screen. */
|
|
172
|
+
kind?: "desktop" | "linux";
|
|
173
|
+
/** The display and its X server, for kind desktop. Default Xvfb on :0, 1280x800. */
|
|
174
|
+
desktop?: DesktopOptions;
|
|
175
|
+
/** The longest lifetime check takes: E2B Hobby's 1 h by default, Pro's 24 h at most. */
|
|
176
|
+
maxLifetimeMs?: number;
|
|
177
|
+
/**
|
|
178
|
+
* Who the daemon runs as, uid:gid in numbers, never root. Default 2510:2510 (TOOL_USER), a uid no process of E2B's
|
|
179
|
+
* holds: init refuses to start while another process does.
|
|
180
|
+
*/
|
|
181
|
+
daemonUser?: string;
|
|
182
|
+
timeouts?: Partial<E2BTimeouts>;
|
|
183
|
+
/**
|
|
184
|
+
* The addresses the probe tries, to show none of them answers a computer with network none: host:port over TCP, or
|
|
185
|
+
* host:port/udp, a DNS query over UDP.
|
|
186
|
+
*/
|
|
187
|
+
probeTargets?: string[];
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* What create() takes: the provider's options, the SDK's Sandbox class optional (default the host's e2b package's).
|
|
191
|
+
* Not E2BCreateOptions, which is the SDK's own Sandbox.create options.
|
|
192
|
+
*/
|
|
193
|
+
export interface E2BOptions extends Omit<E2BProviderOptions, "Sandbox"> {
|
|
194
|
+
/** The SDK's Sandbox class; imported from the host's e2b package by default. */
|
|
195
|
+
Sandbox?: E2BSandboxClass;
|
|
196
|
+
}
|
|
197
|
+
/** The connection options every SDK call is given. Exported for the test that hands them to the real SDK. */
|
|
198
|
+
export declare function connectionOptions({ apiKey, domain }: {
|
|
199
|
+
apiKey: string;
|
|
200
|
+
domain: string;
|
|
201
|
+
}): E2BConnectionOptions;
|
|
202
|
+
/**
|
|
203
|
+
* An E2BProvider from its options alone; it reads no environment but the guard ambientProblem keeps. The key is
|
|
204
|
+
* options.apiKey and nowhere else (serve passes its E2B_API_KEY, the conformance module the key it reads), and the
|
|
205
|
+
* SDK's Sandbox class is the host's e2b package's unless given. Throws in words when an option is missing or wrong,
|
|
206
|
+
* never echoing the key.
|
|
207
|
+
*/
|
|
208
|
+
export declare function create(options: E2BOptions): Promise<E2BProvider>;
|
|
209
|
+
/** The conformance CLI's module for E2B: its live switch, the run's 30-minute cap, its template and the drifted twin. */
|
|
210
|
+
export declare const conformance: () => Promise<typeof import("./conformance/e2b.js")>;
|
|
211
|
+
/** E2B Desktop's template: a screen with an X server, the default for kind desktop. */
|
|
212
|
+
export declare const E2B_DESKTOP_TEMPLATE = "desktop";
|
|
213
|
+
/** E2B's plain template: no screen, the default for kind linux (a sandbox). */
|
|
214
|
+
export declare const E2B_BASE_TEMPLATE = "base";
|
|
215
|
+
/** The mount kinds an E2B computer takes, as capabilities().mount declares them: the run's folder on an Archil disk. */
|
|
216
|
+
export declare const MOUNT: readonly MountKind[];
|
|
217
|
+
/** The machine kind and groups of each configuration: kind linux (the plain template), and kind desktop (the default). */
|
|
218
|
+
export declare const CAPABILITIES: readonly KindCapabilities[];
|
|
219
|
+
/** The E2B timeout of the diagnostic's sandbox: E2B ends it at 10 minutes whatever happens to the run. */
|
|
220
|
+
export declare const DIAGNOSE_LIFETIME_MS: number;
|
|
221
|
+
/**
|
|
222
|
+
* What diagnoseNetworkNone learned, one JSON object: the sandbox it made (none when create made nothing), E2B's
|
|
223
|
+
* read-back of its network, the provider's own network-none check from inside (`passed`, or its refusal in words, which
|
|
224
|
+
* stands: the diagnostic never relaxes it), what `computerd probe --diagnose` printed, why it stopped short of that, and
|
|
225
|
+
* whether the sandbox was killed and read back gone.
|
|
226
|
+
*/
|
|
227
|
+
export interface E2BNetworkDiagnosis {
|
|
228
|
+
template: string;
|
|
229
|
+
computer?: ComputerRef;
|
|
230
|
+
readBack?: {
|
|
231
|
+
allowInternetAccess?: boolean;
|
|
232
|
+
allowPublicTraffic?: boolean;
|
|
233
|
+
allowOut?: string[];
|
|
234
|
+
denyOut?: string[];
|
|
235
|
+
};
|
|
236
|
+
check?: string;
|
|
237
|
+
/** What the provider's check recorded that does not refuse the sandbox: its silent accepts, in words. */
|
|
238
|
+
notes?: string[];
|
|
239
|
+
diagnosis?: unknown;
|
|
240
|
+
error?: {
|
|
241
|
+
code: ComputerErrorCode;
|
|
242
|
+
message: string;
|
|
243
|
+
};
|
|
244
|
+
released: {
|
|
245
|
+
gone: boolean;
|
|
246
|
+
words: string;
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* The network diagnostic: one sandbox made exactly as create makes one for network none (the same options, read-back,
|
|
251
|
+
* upload and sha256 check, daemon and display start, and the provider's own check from inside, recorded), then
|
|
252
|
+
* `computerd probe --diagnose` in it, and the sandbox killed and read back gone whatever happened, an abort included.
|
|
253
|
+
* Its E2B timeout is 10 minutes. It never relaxes create: create still refuses what the check refuses.
|
|
254
|
+
*/
|
|
255
|
+
export declare function diagnoseNetworkNone(provider: E2BProvider, { image, signal }: {
|
|
256
|
+
image: string;
|
|
257
|
+
signal?: AbortSignal;
|
|
258
|
+
}): Promise<E2BNetworkDiagnosis>;
|
|
259
|
+
/**
|
|
260
|
+
* Computers that are E2B sandboxes. A spec's image is an E2B template (its name or id): "desktop" is E2B Desktop's, with
|
|
261
|
+
* Xvfb, x11vnc and noVNC (e2b-dev/desktop template.py:21-65). See the README's E2B section for every call and its
|
|
262
|
+
* citation.
|
|
263
|
+
*/
|
|
264
|
+
export declare class E2BProvider implements ComputerProvider {
|
|
265
|
+
#private;
|
|
266
|
+
readonly id = "e2b";
|
|
267
|
+
readonly version: string;
|
|
268
|
+
constructor(options: E2BProviderOptions);
|
|
269
|
+
/**
|
|
270
|
+
* daemon child: E2B's envd is the sandbox's first process, under systemd with Restart=always (e2b-dev/infra
|
|
271
|
+
* envd.service.tpl:26-30), and init is a background command it runs (#prepare), so init's exit leaves the sandbox. Its
|
|
272
|
+
* cap is E2B's: Hobby's 1 h unless the provider was made with more, up to Pro's 24 h. envd runs as root and answers on
|
|
273
|
+
* 49983, so init starts with --own-network, and network none is all a computer takes until a proxy carries open out
|
|
274
|
+
* of the daemon's own network.
|
|
275
|
+
*/
|
|
276
|
+
capabilities(): ComputerCapabilities;
|
|
277
|
+
check(spec: ComputerSpec): Refusal[];
|
|
278
|
+
create(spec: ComputerSpec, { signal }?: CallContext): Promise<Result<CreatedComputer>>;
|
|
279
|
+
/** The live view: screen.watch on a connection of the watch's own (daemonWatch); a linux computer has no screen. */
|
|
280
|
+
watch(ref: ComputerRef, handlers: ScreenWatchHandlers, options?: WatchOptions): Promise<Result<ScreenWatch>>;
|
|
281
|
+
connect(ref: ComputerRef): Promise<Result<ComputerConnection>>;
|
|
282
|
+
attach(ref: {
|
|
283
|
+
id: string;
|
|
284
|
+
} | {
|
|
285
|
+
labels: Record<string, string>;
|
|
286
|
+
}, { signal }?: CallContext): Promise<Result<AttachedComputer>>;
|
|
287
|
+
/**
|
|
288
|
+
* Settings' test: one page of the account's sandboxes by the provider's own metadata, which makes nothing. The count is
|
|
289
|
+
* read from the listing, with no getInfo of each: a busy account answers as fast, and one sandbox's read never fails a
|
|
290
|
+
* working key. A further page is "or more".
|
|
291
|
+
*/
|
|
292
|
+
testConnection({ signal }?: CallContext): Promise<Result<{
|
|
293
|
+
detail: string;
|
|
294
|
+
}>>;
|
|
295
|
+
/**
|
|
296
|
+
* Every computer this provider made that carries all of these labels, running or paused (stopped), each one's
|
|
297
|
+
* network read back by getInfo, since a listing does not carry it. One deadline, listMs from the call, bounds every
|
|
298
|
+
* page and every read-back.
|
|
299
|
+
*/
|
|
300
|
+
list(labels: Record<string, string>, { signal }?: CallContext): Promise<Result<ComputerInfo[]>>;
|
|
301
|
+
/** For the sweep: every sandbox E2B lists with agentrun.computer=1, whatever its name, as E2B reports it. */
|
|
302
|
+
listLabelled({ signal }?: CallContext): Promise<Result<Array<{
|
|
303
|
+
id: string;
|
|
304
|
+
state: string;
|
|
305
|
+
}>>>;
|
|
306
|
+
/** For the sweep: whether E2B still has a sandbox, read once by getInfo; not_found is gone. */
|
|
307
|
+
probeGone(id: string, { signal }?: CallContext): Promise<Result<{
|
|
308
|
+
gone: boolean;
|
|
309
|
+
state?: string;
|
|
310
|
+
}>>;
|
|
311
|
+
/** For the sweep: Sandbox.kill of any sandbox the label query listed. Not found is done. */
|
|
312
|
+
killById(id: string): Promise<Result<void>>;
|
|
313
|
+
/** E2B reads the policy back (getInfo). A change is refused: the provider fixes the network at create. */
|
|
314
|
+
network(ref: ComputerRef, policy?: NetworkSpec, { signal }?: CallContext): Promise<Result<NetworkPolicy>>;
|
|
315
|
+
/**
|
|
316
|
+
* Moves E2B's timer to now + ttlMs (setTimeout, index.mjs:5529-5541), then init's own deadline to the end E2B reads
|
|
317
|
+
* back, and returns the deadline init took; never earlier than the current end, never past create's time plus the
|
|
318
|
+
* cap, which init was given as its maximum. There is no label to move: E2B has no call that changes metadata, and
|
|
319
|
+
* list() reads the vendor's end. A provider runs one extend of a computer at a time, each reading the deadline the one
|
|
320
|
+
* before it left, so a slow, shorter extend never pulls E2B's timer under a longer one's.
|
|
321
|
+
*/
|
|
322
|
+
extend(ref: ComputerRef, ttlMs: number, { signal }?: CallContext): Promise<Result<{
|
|
323
|
+
deadline: Date;
|
|
324
|
+
}>>;
|
|
325
|
+
/**
|
|
326
|
+
* delete reads the sandbox back to check it is this provider's, then kills it, both never signalled, so a release
|
|
327
|
+
* after an abort, or one aborted during the read, still sends the kill; it is idempotent: one E2B no longer has is ok.
|
|
328
|
+
* E2B answers a kill before the sandbox is gone, so release then waits (#settle) until E2B reads it gone and no longer
|
|
329
|
+
* lists it, within goneMs and the caller's signal, the one step the signal ends. A running Archil computer lets go of
|
|
330
|
+
* the run's folder first (archilRelease: the final sync through computerd, then checkin as root); the kill runs
|
|
331
|
+
* whatever that answers. A folder not let go cleanly loses nothing (every call that changed it synced, and the next
|
|
332
|
+
* claim revokes the hold), so it is said through onNote, and the release succeeds once the sandbox is gone.
|
|
333
|
+
*/
|
|
334
|
+
release(ref: ComputerRef, how: "stop" | "delete", { signal }?: CallContext): Promise<Result<void>>;
|
|
335
|
+
}
|