@parcha/agentrun-computer 0.1.0-beta.36 → 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 +321 -308
- package/box/build-agent37.mjs +177 -0
- 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/browserbase.d.ts +2 -4
- package/dist/browserbase.js +2 -1
- 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/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 +2 -4
- package/dist/daytona.js +3 -2
- package/dist/descriptor.d.ts +5 -0
- package/dist/descriptor.js +2 -0
- package/dist/descriptors/agent37.d.ts +41 -0
- package/dist/descriptors/agent37.js +28 -0
- package/dist/descriptors/index.d.ts +38 -2
- package/dist/descriptors/index.js +4 -2
- package/dist/descriptors/orgo.d.ts +2 -1
- package/dist/descriptors/orgo.js +3 -2
- package/dist/descriptors/phone-harness.d.ts +1 -1
- package/dist/descriptors/phone-harness.js +2 -2
- package/dist/docker.d.ts +7 -4
- package/dist/docker.js +271 -29
- 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 +7 -3
- package/dist/index.js +7 -4
- package/dist/kernel.d.ts +2 -4
- package/dist/kernel.js +2 -1
- package/dist/kinds.d.ts +8 -1
- package/dist/kinds.js +20 -4
- package/dist/local-chrome.d.ts +2 -4
- package/dist/local-chrome.js +2 -1
- package/dist/modal.d.ts +23 -181
- package/dist/modal.js +271 -1244
- package/dist/orgo-channel.d.ts +3 -2
- package/dist/orgo-channel.js +5 -2
- package/dist/orgo-desktop.d.ts +9 -4
- package/dist/orgo-desktop.js +33 -13
- package/dist/orgo-workspaces.d.ts +47 -0
- package/dist/orgo-workspaces.js +94 -0
- package/dist/orgo.d.ts +10 -4
- package/dist/orgo.js +30 -12
- package/dist/phone-harness.d.ts +31 -22
- package/dist/phone-harness.js +510 -698
- package/dist/png.d.ts +4 -0
- package/dist/png.js +27 -0
- package/dist/protocol.d.ts +335 -32
- package/dist/protocol.js +96 -3
- package/dist/provider.d.ts +34 -6
- package/dist/provider.js +16 -0
- 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/modal.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
+
import { HostedProvider, type HostedOptions, type HostedTimeouts } from "./hosted/provider.js";
|
|
1
2
|
import type { KindCapabilities } from "./kinds.js";
|
|
2
|
-
import {
|
|
3
|
-
import { type ProviderNote } from "./mount-archil.js";
|
|
4
|
-
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";
|
|
5
|
-
import { type Result } from "./result.js";
|
|
6
|
-
import { type ScreenWatch, type ScreenWatchHandlers, type WatchOptions } from "./screen-watch.js";
|
|
3
|
+
import type { MountKind } from "./mount.js";
|
|
7
4
|
/** The App sandboxes are made in (modal-client@64880502:js/src/app.ts:32-61). */
|
|
8
5
|
export interface ModalApp {
|
|
9
6
|
readonly appId: string;
|
|
@@ -50,13 +47,6 @@ export interface ModalSandbox {
|
|
|
50
47
|
poll(): Promise<number | null>;
|
|
51
48
|
getTags(): Promise<Record<string, string>>;
|
|
52
49
|
terminate(): Promise<void>;
|
|
53
|
-
/** The sandbox's own command's output (the SDK's ModalReadStream): read only to say why a create's sandbox ended. */
|
|
54
|
-
readonly stdout?: {
|
|
55
|
-
readText(): Promise<string>;
|
|
56
|
-
};
|
|
57
|
-
readonly stderr?: {
|
|
58
|
-
readText(): Promise<string>;
|
|
59
|
-
};
|
|
60
50
|
}
|
|
61
51
|
/** The part of the SDK's ModalClient this provider calls. The host passes its own client. */
|
|
62
52
|
export interface ModalSdk {
|
|
@@ -79,66 +69,15 @@ export interface ModalSdk {
|
|
|
79
69
|
}): AsyncIterable<ModalSandbox>;
|
|
80
70
|
};
|
|
81
71
|
}
|
|
82
|
-
/** The
|
|
83
|
-
export interface
|
|
84
|
-
/** sandboxes.create, which builds the image layer and waits for the sandbox to be scheduled. */
|
|
85
|
-
createMs: number;
|
|
86
|
-
/** Every other SDK call: apps.fromName, fromId, getTags, poll, terminate, exec's start. */
|
|
87
|
-
callMs: number;
|
|
88
|
-
/** A new connection, from the start of the bridge's exec (at most callMs of it) to the daemon's hello. */
|
|
89
|
-
helloMs: number;
|
|
90
|
-
/** The probe, run through the daemon. */
|
|
91
|
-
probeMs: number;
|
|
92
|
-
/** One whole list, every page and every sandbox's tags. */
|
|
93
|
-
listMs: number;
|
|
94
|
-
/** The daemon's upload, from the exec's start to its exit. The entrypoint waits this long and one call more. */
|
|
95
|
-
uploadMs: number;
|
|
96
|
-
/**
|
|
97
|
-
* How long release delete, and a create that refuses its sandbox (drift, an abort, a failed upload), wait after the
|
|
98
|
-
* terminate for poll to read the sandbox finished: Modal ends a sandbox asynchronously, and lists it until then. Each
|
|
99
|
-
* wait also ends on the caller's abort.
|
|
100
|
-
*/
|
|
101
|
-
releaseMs: number;
|
|
102
|
-
/** The first pause between two of those polls; the pauses double up to 5 s. */
|
|
103
|
-
releasePollMs: number;
|
|
104
|
-
/**
|
|
105
|
-
* How long a create whose sandbox Modal says is shutting down on its own (its command, init, exited) waits for poll to
|
|
106
|
-
* read it finished, to give the command's exit code and words in its failure.
|
|
107
|
-
*/
|
|
108
|
-
endedMs: number;
|
|
109
|
-
/** Each root step of an Archil mount through exec (the preflight, mount or revoke, serve), and its checkin at release. */
|
|
110
|
-
mountMs: number;
|
|
111
|
-
}
|
|
112
|
-
export interface ModalProviderOptions {
|
|
72
|
+
/** The Modal provider's options: the client and the app, then the shared adapter's (HostedOptions). */
|
|
73
|
+
export interface ModalProviderOptions extends Omit<HostedOptions, "label" | "kind" | "desktop" | "maxLifetimeMs"> {
|
|
113
74
|
/** The host's Modal client, or anything with the same slice. */
|
|
114
75
|
sdk: ModalSdk;
|
|
115
|
-
/** Told what is no failure of the call it came from: a release that did not let an Archil folder go cleanly. */
|
|
116
|
-
onNote?: ProviderNote;
|
|
117
76
|
/** The Modal App the sandboxes live in; made when missing. */
|
|
118
77
|
app: string;
|
|
119
|
-
/**
|
|
120
|
-
* A registry image holding the daemon for linux/amd64 at /computerd, pinned by digest (name@sha256:<64 hex>), copied
|
|
121
|
-
* into each computer's image with COPY --from. Without it the daemon is uploaded (daemonPath).
|
|
122
|
-
*/
|
|
123
|
-
daemonImage?: string;
|
|
124
|
-
/**
|
|
125
|
-
* The daemon binary for linux/amd64 on this machine, streamed into each computer right after create when no
|
|
126
|
-
* daemonImage is given. Default this package's dist/computerd-linux-amd64 (npm run build:daemon).
|
|
127
|
-
*/
|
|
128
|
-
daemonPath?: string;
|
|
129
|
-
/** The longest lifetime check takes, in ms, declared as capabilities().maxLifetimeMs: at most 24 hours, Modal's longest timeout, which is the default. */
|
|
78
|
+
/** The longest lifetime check takes, in ms: at most 24 hours, Modal's longest timeout, which is the default. */
|
|
130
79
|
maxLifetimeMs?: number;
|
|
131
|
-
|
|
132
|
-
* Who a computer runs as when its spec does not say: uid:gid in numbers, never root or root's group. Default 2510:2510
|
|
133
|
-
* (TOOL_USER). Init refuses to start while another process in the sandbox holds the uid.
|
|
134
|
-
*/
|
|
135
|
-
user?: string;
|
|
136
|
-
timeouts?: Partial<ModalTimeouts>;
|
|
137
|
-
/**
|
|
138
|
-
* The addresses the probe tries, to show none of them answers a computer with network none: host:port over TCP, or
|
|
139
|
-
* host:port/udp, a DNS query over UDP.
|
|
140
|
-
*/
|
|
141
|
-
probeTargets?: string[];
|
|
80
|
+
timeouts?: Partial<HostedTimeouts>;
|
|
142
81
|
}
|
|
143
82
|
/** The mount kinds a Modal computer takes, as capabilities().mount declares them: the run's folder on an Archil disk. */
|
|
144
83
|
export declare const MOUNT: readonly MountKind[];
|
|
@@ -185,126 +124,29 @@ export interface ModalCreateOptions extends Omit<ModalProviderOptions, "sdk">, M
|
|
|
185
124
|
*/
|
|
186
125
|
export declare function modalClient({ tokenId, tokenSecret, serverUrl, ModalClient }: ModalClientOptions): Promise<ModalSdk>;
|
|
187
126
|
/**
|
|
188
|
-
* A ModalProvider from its options alone: the client as modalClient makes it from the token and server passed in,
|
|
189
|
-
* app (required)
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
* AGENTRUN_BOX_APP, the conformance module the settings it reads. The app and the token are checked before any client
|
|
193
|
-
* is made, and neither is ever echoed.
|
|
127
|
+
* A ModalProvider from its options alone: the client as modalClient makes it from the token and server passed in, and
|
|
128
|
+
* the app (required). It reads no environment but the guard modalClient keeps: serve passes its MODAL_TOKEN_ID,
|
|
129
|
+
* MODAL_TOKEN_SECRET and AGENTRUN_BOX_APP, the conformance module the settings it reads. The app and the token are
|
|
130
|
+
* checked before any client is made, and neither is ever echoed.
|
|
194
131
|
*/
|
|
195
132
|
export declare function create(options: ModalCreateOptions): Promise<ModalProvider>;
|
|
196
133
|
/** The conformance CLI's module for Modal: its live switch, the run's 30-minute cap and the drifted twin. */
|
|
197
134
|
export declare const conformance: () => Promise<typeof import("./conformance/modal.js")>;
|
|
198
135
|
/**
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
|
|
202
|
-
export declare const ARCHIL_GATE = "/opt/agentrun/archil-mounted";
|
|
203
|
-
/**
|
|
204
|
-
* The commands the provider sends into a sandbox when it uploads the daemon, exactly: the sandbox's command
|
|
205
|
-
* (entrypoint, which also waits for `gate` when given: an Archil computer's), the upload, and a connection's bridge
|
|
206
|
-
* (stdio). Exported so a test can run them where Modal would.
|
|
207
|
-
*/
|
|
208
|
-
export declare function modalCommands({ deadline, user, waitSeconds, sha256, daemon, home, gate, }?: {
|
|
209
|
-
deadline?: string;
|
|
210
|
-
user?: string;
|
|
211
|
-
waitSeconds?: number;
|
|
212
|
-
sha256?: string;
|
|
213
|
-
daemon?: string;
|
|
214
|
-
home?: string;
|
|
215
|
-
gate?: string;
|
|
216
|
-
}): {
|
|
217
|
-
entrypoint: string[];
|
|
218
|
-
upload: string[];
|
|
219
|
-
hold: string[];
|
|
220
|
-
stdio: string[];
|
|
221
|
-
};
|
|
222
|
-
export interface UntilFinishedOptions {
|
|
223
|
-
/** The sandbox in words, for the errors, such as its name or id. */
|
|
224
|
-
name: string;
|
|
225
|
-
/** The longest the whole wait takes, in ms. */
|
|
226
|
-
boundMs: number;
|
|
227
|
-
/** The longest one poll may take, in ms. */
|
|
228
|
-
callMs: number;
|
|
229
|
-
/** The first pause between two polls, in ms; each pause doubles up to maxMs. */
|
|
230
|
-
minMs: number;
|
|
231
|
-
/** The longest pause between two polls, in ms. */
|
|
232
|
-
maxMs: number;
|
|
233
|
-
/** Ends the wait early, as aborted; a wait that must finish whatever its caller does is given none. */
|
|
234
|
-
signal?: AbortSignal;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* The one wait after a terminate, which returns before Modal has ended the sandbox (sandbox.ts:1292-1296, 2238-2251):
|
|
238
|
-
* polls through waitUntil until poll reads an exit code (null while it runs, sandbox.ts:2761-2771) or Modal no longer
|
|
239
|
-
* knows the sandbox. Past boundMs it is a timeout, and on the signal's abort an abort, each saying what poll last read;
|
|
240
|
-
* it never reports a sandbox finished that it did not read finished. release delete, a create that refuses its
|
|
241
|
-
* sandbox, and modal-sweep --after all wait through it.
|
|
136
|
+
* The tags a sandbox carries for a machine's labels. Every label is its own tag, with one exception that keeps an
|
|
137
|
+
* Archil computer within Modal's 512 bytes: the mount label's folder, agents/<agent>/runs/<run>/work, names the run its
|
|
138
|
+
* agentrun.run label holds, so the tag records the agent alone, and labelsOf puts the folder back.
|
|
242
139
|
*/
|
|
243
|
-
export declare function
|
|
140
|
+
export declare function tagsOf(labels: Record<string, string>): Record<string, string>;
|
|
141
|
+
/** A sandbox's labels from its tags: tagsOf undone. */
|
|
142
|
+
export declare function labelsOf(tags: Record<string, string>): Record<string, string>;
|
|
244
143
|
/**
|
|
245
|
-
* Computers that are Modal sandboxes on the VM runtime, or on gVisor with a GPU. The daemon is
|
|
246
|
-
* exec's stdin, while the sandbox's command,
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
* network policy back, so the daemon's probe stands for one: network none is honoured only when none of its addresses
|
|
251
|
-
* answers (an address that accepts and sends nothing back is named in the read-back's notes), and an allowlist is
|
|
252
|
-
* refused until the live bypass cases pass.
|
|
144
|
+
* Computers that are Modal sandboxes on the VM runtime, or on gVisor with a GPU, on the shared adapter. The daemon is
|
|
145
|
+
* streamed in through an exec's stdin right after create, while the sandbox's command, the entrypoint, waits for it and
|
|
146
|
+
* then becomes `computerd init`. A connection is `computerd stdio` through exec, so a computer with network none is still
|
|
147
|
+
* reached. Modal ends each sandbox at its timeout, so the lifetime is the vendor's. A spec may size a computer (cpus,
|
|
148
|
+
* memoryMb) and name the uid its programs run as, never root.
|
|
253
149
|
*/
|
|
254
|
-
export declare class ModalProvider
|
|
255
|
-
|
|
256
|
-
readonly id = "modal";
|
|
257
|
-
readonly version: string;
|
|
258
|
-
constructor({ sdk, app, daemonImage, daemonPath, maxLifetimeMs, user, timeouts, probeTargets, onNote }: ModalProviderOptions);
|
|
259
|
-
/**
|
|
260
|
-
* daemon pid1: the sandbox's command is init itself (with daemonImage) or the entrypoint that execs into it, and Modal
|
|
261
|
-
* finishes the sandbox when that main process exits (sandbox.ts:384-388), so init's exit ends the computer. Whether
|
|
262
|
-
* Modal gives that process the number 1 is not documented; init reaps as a subreaper either way. maxLifetimeMs is this
|
|
263
|
-
* instance's cap: Modal's 24 hours unless the provider was made with less. Init starts with --own-network whatever
|
|
264
|
-
* Modal runs in the sandbox (no listener of its own there is documented, so no port is declared), and network none is
|
|
265
|
-
* all a computer takes until a proxy carries open out of the daemon's own network.
|
|
266
|
-
*/
|
|
267
|
-
capabilities(): ComputerCapabilities;
|
|
268
|
-
check(spec: ComputerSpec): Refusal[];
|
|
269
|
-
create(spec: ComputerSpec, { signal }?: CallContext): Promise<Result<CreatedComputer>>;
|
|
270
|
-
/**
|
|
271
|
-
* Settings' test: the provider's app read without making it (createIfMissing false), which makes nothing. An app not
|
|
272
|
-
* made yet is a connection all the same: the token was taken, and the first computer makes the app.
|
|
273
|
-
*/
|
|
274
|
-
testConnection({ signal }?: CallContext): Promise<Result<{
|
|
275
|
-
detail: string;
|
|
276
|
-
}>>;
|
|
277
|
-
/** The live view: screen.watch on a connection of the watch's own (daemonWatch); a sandbox has no screen. */
|
|
278
|
-
watch(ref: ComputerRef, handlers: ScreenWatchHandlers, options?: WatchOptions): Promise<Result<ScreenWatch>>;
|
|
279
|
-
connect(ref: ComputerRef): Promise<Result<ComputerConnection>>;
|
|
280
|
-
attach(ref: {
|
|
281
|
-
id: string;
|
|
282
|
-
} | {
|
|
283
|
-
labels: Record<string, string>;
|
|
284
|
-
}, { signal }?: CallContext): Promise<Result<AttachedComputer>>;
|
|
285
|
-
/**
|
|
286
|
-
* Every running computer this provider made that carries all of these labels. Modal's list asks for running sandboxes
|
|
287
|
-
* only (includeFinished: false, sandbox.ts:1135-1140), yet a sandbox terminated a moment ago is still listed: each one
|
|
288
|
-
* listed is polled, and one that poll reads finished (an exit code, not null, sandbox.ts:2761-2771) or no longer
|
|
289
|
-
* finds is left out.
|
|
290
|
-
*/
|
|
291
|
-
list(labels: Record<string, string>, { signal }?: CallContext): Promise<Result<ComputerInfo[]>>;
|
|
292
|
-
/**
|
|
293
|
-
* Modal reads no policy back. A computer here is made with none, read back by the probe from inside, and is another
|
|
294
|
-
* network in words when any of its addresses answered (an address that only accepted, and sent nothing back, leaves it
|
|
295
|
-
* none). A change is refused: it is fixed at create.
|
|
296
|
-
*/
|
|
297
|
-
network(ref: ComputerRef, policy?: NetworkSpec, { signal }?: CallContext): Promise<Result<NetworkPolicy>>;
|
|
298
|
-
/**
|
|
299
|
-
* delete terminates, and is idempotent: a sandbox already finished, or one Modal no longer knows, is ok. Modal ends a
|
|
300
|
-
* sandbox asynchronously (terminate returns before it has finished unless asked to wait, sandbox.ts:1292-1296 and
|
|
301
|
-
* 2238-2251), so delete then polls through untilFinished, as a refusing create does, with pauses that double from
|
|
302
|
-
* releasePollMs to 5 s, until poll reads an exit code (null while it runs, sandbox.ts:2761-2771) or Modal no longer
|
|
303
|
-
* knows it, within releaseMs and the caller's signal. Past releaseMs it is a timeout that says what poll last read,
|
|
304
|
-
* never done. An Archil computer that still runs lets go of the run's folder first (archilRelease: the final sync
|
|
305
|
-
* through computerd, then checkin as root); the terminate runs whatever that answers. A folder not let go cleanly
|
|
306
|
-
* loses nothing (every call that changed it synced, and the next claim revokes the hold), so it is said through
|
|
307
|
-
* onNote, and the release succeeds once the sandbox is gone.
|
|
308
|
-
*/
|
|
309
|
-
release(ref: ComputerRef, how: ReleaseHow, { signal }?: CallContext): Promise<Result<void>>;
|
|
150
|
+
export declare class ModalProvider extends HostedProvider {
|
|
151
|
+
constructor(options: ModalProviderOptions);
|
|
310
152
|
}
|