@parcha/agentrun-computer 0.1.0-beta.35 → 0.1.0-beta.37
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/NOTICE +2 -0
- package/README.md +423 -323
- package/box/Dockerfile +3 -1
- package/box/agentrun-archil +59 -7
- package/box/build-agent37.mjs +177 -0
- package/box/build-daytona.py +20 -4
- package/dist/agent37.d.ts +165 -0
- package/dist/agent37.js +759 -0
- package/dist/attach.d.ts +146 -0
- package/dist/attach.js +469 -0
- package/dist/browser.d.ts +61 -10
- package/dist/browser.js +125 -3
- package/dist/browserbase.d.ts +46 -23
- package/dist/browserbase.js +162 -17
- package/dist/chrome.d.ts +3 -4
- package/dist/chrome.js +6 -11
- package/dist/client.d.ts +33 -1
- package/dist/client.js +53 -0
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/conformance/agent37.d.ts +96 -0
- package/dist/conformance/agent37.js +154 -0
- package/dist/conformance/cases/apps.d.ts +5 -0
- package/dist/conformance/cases/apps.js +160 -73
- package/dist/conformance/cases/health.js +14 -0
- package/dist/conformance/cases/index.js +2 -0
- package/dist/conformance/cases/provider.js +27 -1
- package/dist/conformance/cases/screen.d.ts +3 -0
- package/dist/conformance/cases/screen.js +18 -0
- package/dist/conformance/cases/settings.d.ts +29 -23
- package/dist/conformance/cases/settings.js +76 -58
- package/dist/conformance/cases/touch.js +19 -17
- package/dist/conformance/cases/ui.d.ts +2 -0
- package/dist/conformance/cases/ui.js +475 -0
- package/dist/conformance/cli.d.ts +9 -0
- package/dist/conformance/cli.js +28 -3
- package/dist/conformance/daytona.d.ts +4 -0
- package/dist/conformance/daytona.js +5 -0
- package/dist/conformance/e2b.d.ts +6 -0
- package/dist/conformance/e2b.js +9 -2
- package/dist/conformance/fixture.d.ts +1 -1
- package/dist/conformance/fixture.js +25 -1
- package/dist/conformance/modal.d.ts +17 -13
- package/dist/conformance/modal.js +18 -9
- package/dist/conformance/orgo.d.ts +3 -3
- package/dist/conformance/orgo.js +6 -8
- package/dist/conformance/phone-harness.d.ts +6 -2
- package/dist/conformance/phone-harness.js +21 -4
- package/dist/conformance/report.js +1 -1
- package/dist/conformance/runner.js +23 -4
- package/dist/conformance/sweep.d.ts +50 -0
- package/dist/conformance/sweep.js +187 -0
- package/dist/conformance/types.d.ts +11 -3
- package/dist/conformance/ui-fixture.d.ts +56 -0
- package/dist/conformance/ui-fixture.js +43 -0
- package/dist/create-requests.d.ts +51 -0
- package/dist/create-requests.js +121 -0
- package/dist/daytona.d.ts +15 -5
- package/dist/daytona.js +58 -38
- package/dist/descriptor.d.ts +29 -2
- package/dist/descriptor.js +13 -0
- package/dist/descriptors/agent37.d.ts +41 -0
- package/dist/descriptors/agent37.js +28 -0
- package/dist/descriptors/browserbase.d.ts +1 -0
- package/dist/descriptors/browserbase.js +2 -0
- package/dist/descriptors/daytona.d.ts +23 -2
- package/dist/descriptors/daytona.js +34 -2
- package/dist/descriptors/index.d.ts +66 -3
- package/dist/descriptors/index.js +5 -3
- package/dist/descriptors/kernel.d.ts +1 -0
- package/dist/descriptors/kernel.js +2 -0
- package/dist/descriptors/modal.d.ts +4 -0
- package/dist/descriptors/modal.js +11 -1
- package/dist/descriptors/orgo.d.ts +13 -1
- package/dist/descriptors/orgo.js +9 -3
- package/dist/descriptors/phone-harness.d.ts +6 -1
- package/dist/descriptors/phone-harness.js +5 -2
- package/dist/docker/egress.d.ts +4 -3
- package/dist/docker/egress.js +7 -6
- package/dist/docker.d.ts +7 -4
- package/dist/docker.js +278 -34
- package/dist/e2b.d.ts +9 -165
- package/dist/e2b.js +282 -1342
- package/dist/fake-ui-driver.d.ts +97 -0
- package/dist/fake-ui-driver.js +717 -0
- package/dist/host.d.ts +182 -0
- package/dist/host.js +1 -0
- package/dist/hosted/process.d.ts +67 -0
- package/dist/hosted/process.js +228 -0
- package/dist/hosted/provider.d.ts +146 -0
- package/dist/hosted/provider.js +1364 -0
- package/dist/hosted/scripts.d.ts +76 -0
- package/dist/{child.js → hosted/scripts.js} +93 -12
- package/dist/index.d.ts +11 -7
- package/dist/index.js +10 -7
- package/dist/janitor.d.ts +5 -4
- package/dist/janitor.js +1 -1
- package/dist/kernel.d.ts +17 -27
- package/dist/kernel.js +94 -18
- package/dist/kinds.d.ts +17 -5
- package/dist/kinds.js +20 -4
- package/dist/labels.d.ts +10 -2
- package/dist/labels.js +30 -7
- package/dist/local-chrome.d.ts +5 -5
- package/dist/local-chrome.js +10 -5
- package/dist/modal.d.ts +23 -181
- package/dist/modal.js +273 -1232
- package/dist/mount-archil.d.ts +25 -3
- package/dist/mount-archil.js +39 -8
- package/dist/orgo-channel.d.ts +3 -2
- package/dist/orgo-channel.js +5 -2
- package/dist/orgo-desktop.d.ts +23 -9
- package/dist/orgo-desktop.js +328 -66
- package/dist/orgo-names.d.ts +129 -3
- package/dist/orgo-names.js +211 -8
- package/dist/orgo-workspaces.d.ts +47 -0
- package/dist/orgo-workspaces.js +94 -0
- package/dist/orgo.d.ts +27 -10
- package/dist/orgo.js +411 -81
- package/dist/phone-harness.d.ts +31 -21
- package/dist/phone-harness.js +510 -681
- package/dist/png.d.ts +4 -0
- package/dist/png.js +27 -0
- package/dist/protocol.d.ts +338 -30
- package/dist/protocol.js +96 -3
- package/dist/provider.d.ts +97 -7
- package/dist/provider.js +24 -3
- package/dist/result.d.ts +1 -1
- package/dist/surface/api.d.ts +248 -0
- package/dist/surface/api.js +1 -0
- package/dist/surface/core.d.ts +42 -0
- package/dist/surface/core.js +393 -0
- package/dist/surface/index.d.ts +5 -0
- package/dist/surface/index.js +3 -0
- package/dist/surface/outline.d.ts +8 -0
- package/dist/surface/outline.js +50 -0
- package/dist/surface/script.d.ts +10 -0
- package/dist/surface/script.js +92 -0
- package/dist/ui-engine.d.ts +114 -0
- package/dist/ui-engine.js +798 -0
- package/package.json +17 -1
- package/dist/child.d.ts +0 -42
- package/dist/conformance/e2b-diagnose.d.ts +0 -16
- package/dist/conformance/e2b-diagnose.js +0 -61
- package/dist/conformance/e2b-sweep.d.ts +0 -18
- package/dist/conformance/e2b-sweep.js +0 -132
- package/dist/conformance/modal-sweep.d.ts +0 -22
- package/dist/conformance/modal-sweep.js +0 -213
package/dist/e2b.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { HostedProvider, type HostedOptions, type HostedTimeouts } from "./hosted/provider.js";
|
|
2
2
|
import type { KindCapabilities } from "./kinds.js";
|
|
3
|
-
import {
|
|
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, type ReleaseHow } from "./provider.js";
|
|
6
|
-
import { type ComputerErrorCode, type Result } from "./result.js";
|
|
7
|
-
import { type ScreenWatch, type ScreenWatchHandlers, type WatchOptions } from "./screen-watch.js";
|
|
3
|
+
import type { MountKind } from "./mount.js";
|
|
8
4
|
/** What every SDK call is given: the key, the domain and the API URL explicitly, and debug false (index.mjs:1126-1152). */
|
|
9
5
|
export interface E2BConnectionOptions {
|
|
10
6
|
apiKey: string;
|
|
@@ -132,59 +128,19 @@ export interface E2BSandboxClass {
|
|
|
132
128
|
limit: number;
|
|
133
129
|
}): E2BPaginator;
|
|
134
130
|
}
|
|
135
|
-
/** The
|
|
136
|
-
export interface
|
|
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 {
|
|
131
|
+
/** The E2B provider's options: the key and the SDK, then the shared adapter's (HostedOptions). */
|
|
132
|
+
export interface E2BProviderOptions extends Omit<HostedOptions, "label" | "maxLifetimeMs"> {
|
|
161
133
|
/** The E2B API key. The caller passes it; this provider never reads it from the environment or puts it in a computer. */
|
|
162
134
|
apiKey: string;
|
|
163
|
-
/**
|
|
164
|
-
onNote?: ProviderNote;
|
|
165
|
-
/** The SDK's Sandbox class: the host's `e2b` package's, or a fake. */
|
|
135
|
+
/** The SDK's Sandbox class: the host's `e2b` package's, or anything with the same slice. */
|
|
166
136
|
Sandbox: E2BSandboxClass;
|
|
167
137
|
/** E2B's domain: the API is https://api.<domain>. Default e2b.app. */
|
|
168
138
|
domain?: string;
|
|
169
|
-
/** The daemon binary for linux/amd64 on this machine. Default this package's dist/computerd-linux-amd64. */
|
|
170
|
-
daemonPath?: string;
|
|
171
139
|
/** desktop (default): a template with an X server, started through the daemon; linux: no screen. */
|
|
172
140
|
kind?: "desktop" | "linux";
|
|
173
|
-
/** The display and its X server, for kind desktop. Default Xvfb on :0, 1280x800. */
|
|
174
|
-
desktop?: DesktopOptions;
|
|
175
141
|
/** The longest lifetime check takes: E2B Hobby's 1 h by default, Pro's 24 h at most. */
|
|
176
142
|
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[];
|
|
143
|
+
timeouts?: Partial<HostedTimeouts>;
|
|
188
144
|
}
|
|
189
145
|
/**
|
|
190
146
|
* What create() takes: the provider's options, the SDK's Sandbox class optional (default the host's e2b package's).
|
|
@@ -212,122 +168,10 @@ export declare const conformance: () => Promise<typeof import("./conformance/e2b
|
|
|
212
168
|
export declare const MOUNT: readonly MountKind[];
|
|
213
169
|
/** The machine kind and groups of each configuration: kind linux (the plain template), and kind desktop (the default). */
|
|
214
170
|
export declare const CAPABILITIES: readonly KindCapabilities[];
|
|
215
|
-
/** The E2B timeout of the diagnostic's sandbox: E2B ends it at 10 minutes whatever happens to the run. */
|
|
216
|
-
export declare const DIAGNOSE_LIFETIME_MS: number;
|
|
217
|
-
/**
|
|
218
|
-
* What diagnoseNetworkNone learned, one JSON object: the sandbox it made (none when create made nothing), E2B's
|
|
219
|
-
* read-back of its network, the provider's own network-none check from inside (`passed`, or its refusal in words, which
|
|
220
|
-
* stands: the diagnostic never relaxes it), what `computerd probe --diagnose` printed, why it stopped short of that, and
|
|
221
|
-
* whether the sandbox was killed and read back gone.
|
|
222
|
-
*/
|
|
223
|
-
export interface E2BNetworkDiagnosis {
|
|
224
|
-
template: string;
|
|
225
|
-
computer?: ComputerRef;
|
|
226
|
-
readBack?: {
|
|
227
|
-
allowInternetAccess?: boolean;
|
|
228
|
-
allowPublicTraffic?: boolean;
|
|
229
|
-
allowOut?: string[];
|
|
230
|
-
denyOut?: string[];
|
|
231
|
-
};
|
|
232
|
-
check?: string;
|
|
233
|
-
/** What the provider's check recorded that does not refuse the sandbox: its silent accepts, in words. */
|
|
234
|
-
notes?: string[];
|
|
235
|
-
diagnosis?: unknown;
|
|
236
|
-
error?: {
|
|
237
|
-
code: ComputerErrorCode;
|
|
238
|
-
message: string;
|
|
239
|
-
};
|
|
240
|
-
released: {
|
|
241
|
-
gone: boolean;
|
|
242
|
-
words: string;
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* The network diagnostic: one sandbox made exactly as create makes one for network none (the same options, read-back,
|
|
247
|
-
* upload and sha256 check, daemon and display start, and the provider's own check from inside, recorded), then
|
|
248
|
-
* `computerd probe --diagnose` in it, and the sandbox killed and read back gone whatever happened, an abort included.
|
|
249
|
-
* Its E2B timeout is 10 minutes. It never relaxes create: create still refuses what the check refuses.
|
|
250
|
-
*/
|
|
251
|
-
export declare function diagnoseNetworkNone(provider: E2BProvider, { image, signal }: {
|
|
252
|
-
image: string;
|
|
253
|
-
signal?: AbortSignal;
|
|
254
|
-
}): Promise<E2BNetworkDiagnosis>;
|
|
255
171
|
/**
|
|
256
|
-
* Computers that are E2B sandboxes. A spec's image is an E2B template (its name or id):
|
|
257
|
-
* Xvfb, x11vnc and noVNC (e2b-dev/desktop template.py:21-65).
|
|
258
|
-
* citation.
|
|
172
|
+
* Computers that are E2B sandboxes, on the shared adapter. A spec's image is an E2B template (its name or id):
|
|
173
|
+
* "desktop" is E2B Desktop's, with Xvfb, x11vnc and noVNC (e2b-dev/desktop template.py:21-65).
|
|
259
174
|
*/
|
|
260
|
-
export declare class E2BProvider
|
|
261
|
-
#private;
|
|
262
|
-
readonly id = "e2b";
|
|
263
|
-
readonly version: string;
|
|
175
|
+
export declare class E2BProvider extends HostedProvider {
|
|
264
176
|
constructor(options: E2BProviderOptions);
|
|
265
|
-
/**
|
|
266
|
-
* daemon child: E2B's envd is the sandbox's first process, under systemd with Restart=always (e2b-dev/infra
|
|
267
|
-
* envd.service.tpl:26-30), and init is a background command it runs (#prepare), so init's exit leaves the sandbox. Its
|
|
268
|
-
* 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
|
|
269
|
-
* 49983, so init starts with --own-network, and network none is all a computer takes until a proxy carries open out
|
|
270
|
-
* of the daemon's own network.
|
|
271
|
-
*/
|
|
272
|
-
capabilities(): ComputerCapabilities;
|
|
273
|
-
check(spec: ComputerSpec): Refusal[];
|
|
274
|
-
create(spec: ComputerSpec, { signal }?: CallContext): Promise<Result<CreatedComputer>>;
|
|
275
|
-
/** The live view: screen.watch on a connection of the watch's own (daemonWatch); a linux computer has no screen. */
|
|
276
|
-
watch(ref: ComputerRef, handlers: ScreenWatchHandlers, options?: WatchOptions): Promise<Result<ScreenWatch>>;
|
|
277
|
-
connect(ref: ComputerRef): Promise<Result<ComputerConnection>>;
|
|
278
|
-
attach(ref: {
|
|
279
|
-
id: string;
|
|
280
|
-
} | {
|
|
281
|
-
labels: Record<string, string>;
|
|
282
|
-
}, { signal }?: CallContext): Promise<Result<AttachedComputer>>;
|
|
283
|
-
/**
|
|
284
|
-
* Settings' test: one page of the account's sandboxes by the provider's own metadata, which makes nothing. The count is
|
|
285
|
-
* read from the listing, with no getInfo of each: a busy account answers as fast, and one sandbox's read never fails a
|
|
286
|
-
* working key. A further page is "or more".
|
|
287
|
-
*/
|
|
288
|
-
testConnection({ signal }?: CallContext): Promise<Result<{
|
|
289
|
-
detail: string;
|
|
290
|
-
}>>;
|
|
291
|
-
/**
|
|
292
|
-
* Every computer this provider made that carries all of these labels, running or paused (stopped), each one's
|
|
293
|
-
* network read back by getInfo, since a listing does not carry it. One deadline, listMs from the call, bounds every
|
|
294
|
-
* page and every read-back.
|
|
295
|
-
*/
|
|
296
|
-
list(labels: Record<string, string>, { signal }?: CallContext): Promise<Result<ComputerInfo[]>>;
|
|
297
|
-
/** For the sweep: every sandbox E2B lists with agentrun.computer=1, whatever its name, as E2B reports it, with its
|
|
298
|
-
* metadata as its labels (the sweep kills only a conformance run's). */
|
|
299
|
-
listLabelled({ signal }?: CallContext): Promise<Result<Array<{
|
|
300
|
-
id: string;
|
|
301
|
-
state: string;
|
|
302
|
-
labels: Record<string, string>;
|
|
303
|
-
}>>>;
|
|
304
|
-
/** For the sweep: whether E2B still has a sandbox, read once by getInfo; not_found is gone. */
|
|
305
|
-
probeGone(id: string, { signal }?: CallContext): Promise<Result<{
|
|
306
|
-
gone: boolean;
|
|
307
|
-
state?: string;
|
|
308
|
-
}>>;
|
|
309
|
-
/** For the sweep: Sandbox.kill of any sandbox the label query listed. Not found is done. */
|
|
310
|
-
killById(id: string): Promise<Result<void>>;
|
|
311
|
-
/** E2B reads the policy back (getInfo). A change is refused: the provider fixes the network at create. */
|
|
312
|
-
network(ref: ComputerRef, policy?: NetworkSpec, { signal }?: CallContext): Promise<Result<NetworkPolicy>>;
|
|
313
|
-
/**
|
|
314
|
-
* Moves E2B's timer to now + ttlMs (setTimeout, index.mjs:5529-5541), then init's own deadline to the end E2B reads
|
|
315
|
-
* back, and returns the deadline init took; never earlier than the current end, never past create's time plus the
|
|
316
|
-
* cap, which init was given as its maximum. There is no label to move: E2B has no call that changes metadata, and
|
|
317
|
-
* list() reads the vendor's end. A provider runs one extend of a computer at a time, each reading the deadline the one
|
|
318
|
-
* before it left, so a slow, shorter extend never pulls E2B's timer under a longer one's.
|
|
319
|
-
*/
|
|
320
|
-
extend(ref: ComputerRef, ttlMs: number, { signal }?: CallContext): Promise<Result<{
|
|
321
|
-
deadline: Date;
|
|
322
|
-
}>>;
|
|
323
|
-
/**
|
|
324
|
-
* delete reads the sandbox back to check it is this provider's, then kills it, both never signalled, so a release
|
|
325
|
-
* after an abort, or one aborted during the read, still sends the kill; it is idempotent: one E2B no longer has is ok.
|
|
326
|
-
* E2B answers a kill before the sandbox is gone, so release then waits (#settle) until E2B reads it gone and no longer
|
|
327
|
-
* lists it, within goneMs and the caller's signal, the one step the signal ends. A running Archil computer lets go of
|
|
328
|
-
* the run's folder first (archilRelease: the final sync through computerd, then checkin as root); the kill runs
|
|
329
|
-
* whatever that answers. A folder not let go cleanly loses nothing (every call that changed it synced, and the next
|
|
330
|
-
* claim revokes the hold), so it is said through onNote, and the release succeeds once the sandbox is gone.
|
|
331
|
-
*/
|
|
332
|
-
release(ref: ComputerRef, how: ReleaseHow, { signal }?: CallContext): Promise<Result<void>>;
|
|
333
177
|
}
|