@parcha/agentrun-computer 0.1.0-beta.37 → 0.1.0-beta.38
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 +259 -203
- package/box/Dockerfile +18 -1
- package/box/README.md +13 -0
- package/box/build-agent37.mjs +8 -27
- package/box/build-daytona.py +2 -2
- package/box/build-e2b.mjs +41 -18
- package/box/recipe.mjs +43 -0
- package/dist/agent37-ssh.d.ts +89 -0
- package/dist/agent37-ssh.js +445 -0
- package/dist/agent37.d.ts +2 -63
- package/dist/agent37.js +104 -461
- package/dist/browserbase.d.ts +0 -6
- package/dist/browserbase.js +1 -5
- package/dist/client.d.ts +12 -3
- package/dist/client.js +39 -4
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/computerd.json +4 -0
- package/dist/conformance/cases/apps.d.ts +6 -0
- package/dist/conformance/cases/apps.js +18 -5
- package/dist/conformance/cases/isolation.d.ts +7 -5
- package/dist/conformance/cases/isolation.js +44 -14
- package/dist/conformance/cases/mount.js +1 -1
- package/dist/conformance/cli.js +66 -6
- package/dist/conformance/daytona.d.ts +9 -20
- package/dist/conformance/daytona.js +12 -21
- package/dist/conformance/exec-stream.d.ts +45 -0
- package/dist/conformance/exec-stream.js +486 -0
- package/dist/conformance/sweep.js +8 -8
- package/dist/conformance/types.d.ts +2 -2
- package/dist/create-requests.d.ts +1 -1
- package/dist/daytona.d.ts +20 -131
- package/dist/daytona.js +405 -1450
- package/dist/descriptor.d.ts +6 -1
- package/dist/descriptor.js +7 -0
- package/dist/descriptors/agent37.d.ts +1 -1
- package/dist/descriptors/agent37.js +1 -1
- package/dist/descriptors/daytona.d.ts +6 -5
- package/dist/descriptors/daytona.js +9 -5
- package/dist/descriptors/index.d.ts +4 -5
- package/dist/descriptors/shared.d.ts +1 -1
- package/dist/descriptors/shared.js +2 -2
- package/dist/desktop.d.ts +18 -4
- package/dist/desktop.js +89 -9
- package/dist/docker.d.ts +0 -6
- package/dist/docker.js +1 -5
- package/dist/drift.js +4 -4
- package/dist/e2b.d.ts +10 -128
- package/dist/e2b.js +130 -233
- package/dist/host.d.ts +106 -87
- package/dist/host.js +8 -1
- package/dist/hosted/process.d.ts +22 -8
- package/dist/hosted/process.js +75 -44
- package/dist/hosted/provider.d.ts +35 -21
- package/dist/hosted/provider.js +312 -261
- package/dist/hosted/rest.d.ts +66 -0
- package/dist/hosted/rest.js +121 -0
- package/dist/hosted/scripts.d.ts +8 -2
- package/dist/hosted/scripts.js +27 -2
- package/dist/hosted/values.d.ts +5 -0
- package/dist/hosted/values.js +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/kernel.d.ts +0 -6
- package/dist/kernel.js +1 -5
- package/dist/kinds.d.ts +3 -1
- package/dist/local-chrome.d.ts +0 -6
- package/dist/local-chrome.js +1 -5
- package/dist/modal.d.ts +7 -84
- package/dist/modal.js +50 -174
- package/dist/mount-archil.d.ts +8 -4
- package/dist/mount-archil.js +22 -11
- package/dist/mount.d.ts +10 -4
- package/dist/mount.js +8 -4
- package/dist/orgo.d.ts +0 -9
- package/dist/orgo.js +2 -9
- package/dist/phone-harness.d.ts +0 -6
- package/dist/phone-harness.js +0 -4
- package/dist/protocol.d.ts +4 -1
- package/dist/protocol.js +1 -0
- package/dist/provider.d.ts +2 -2
- package/dist/providers.d.ts +11 -12
- package/dist/screen-watch.js +34 -6
- package/dist/surface/api.d.ts +14 -2
- package/dist/surface/core.d.ts +16 -3
- package/dist/surface/core.js +95 -13
- package/dist/surface/outline.d.ts +2 -0
- package/dist/surface/outline.js +2 -1
- package/dist/surface/script.js +2 -0
- package/dist/ui-engine.js +19 -3
- package/package.json +2 -3
- package/dist/conformance/daytona-sweep.d.ts +0 -18
- package/dist/conformance/daytona-sweep.js +0 -126
package/dist/daytona.d.ts
CHANGED
|
@@ -1,37 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
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 CreateContext, 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";
|
|
7
|
-
/** The longest each kind of call may take, and the pauses between polls and retries. */
|
|
8
|
-
export interface DaytonaTimeouts {
|
|
9
|
-
/** One control-plane or toolbox call. */
|
|
10
|
-
requestMs: number;
|
|
11
|
-
/** POST /sandbox. */
|
|
12
|
-
createMs: number;
|
|
13
|
-
/** From the create's answer to a started sandbox. */
|
|
14
|
-
startMs: number;
|
|
15
|
-
/** One DELETE. */
|
|
16
|
-
deleteMs: number;
|
|
17
|
-
/** From the delete's answer to a sandbox Daytona reads as gone (404) and no longer lists. */
|
|
18
|
-
goneMs: number;
|
|
19
|
-
/** From the stop's answer to a sandbox Daytona reads, and lists, as stopped (or gone, when a stop deletes). */
|
|
20
|
-
stopMs: number;
|
|
21
|
-
/** The daemon's upload. */
|
|
22
|
-
uploadMs: number;
|
|
23
|
-
/** The install script. */
|
|
24
|
-
execMs: number;
|
|
25
|
-
/** From a connect's start to the daemon's hello, and each read-back call after it. */
|
|
26
|
-
helloMs: number;
|
|
27
|
-
pollMs: number;
|
|
28
|
-
/** The first pause before a retry; each next one doubles. */
|
|
29
|
-
retryMs: number;
|
|
30
|
-
/** How long create waits for the listing to show the new computer steadily, and for how long it must. */
|
|
31
|
-
listedMs: number;
|
|
32
|
-
listedStableMs: number;
|
|
33
|
-
}
|
|
34
|
-
/** The parts of a WebSocket the provider uses: Node's global WebSocket, or a fake in tests. */
|
|
1
|
+
import { HostedProvider, type HostedOptions, type HostedTimeouts } from "./hosted/provider.js";
|
|
2
|
+
/** The parts of a WebSocket the host uses: Node's global WebSocket, or a stand-in in tests. */
|
|
35
3
|
export interface WebSocketLike {
|
|
36
4
|
binaryType: string;
|
|
37
5
|
addEventListener(type: "open" | "message" | "close" | "error", listener: (event: {
|
|
@@ -45,38 +13,28 @@ export type WebSocketFactory = (url: string, init: {
|
|
|
45
13
|
headers: Record<string, string>;
|
|
46
14
|
protocols: string[];
|
|
47
15
|
}) => WebSocketLike;
|
|
48
|
-
|
|
16
|
+
/** The adapter's bounds, and Daytona's own: the first pause before a retried request (each next one doubles). */
|
|
17
|
+
export type DaytonaTimeouts = HostedTimeouts & {
|
|
18
|
+
retryMs: number;
|
|
19
|
+
};
|
|
20
|
+
/** The Daytona provider's options: the key and Daytona's own settings, then the shared adapter's (HostedOptions). */
|
|
21
|
+
export interface DaytonaProviderOptions extends Omit<HostedOptions, "kind" | "desktop" | "maxLifetimeMs" | "timeouts" | "archilEgress"> {
|
|
49
22
|
/** The Daytona API key. The caller passes it; this provider never reads the environment and never puts it in a computer. */
|
|
50
23
|
apiKey: string;
|
|
51
|
-
/** Told what is no failure of the call it came from: a release that did not let an Archil folder go cleanly. */
|
|
52
|
-
onNote?: ProviderNote;
|
|
53
24
|
/** Default https://app.daytona.io/api. */
|
|
54
25
|
apiUrl?: string;
|
|
55
|
-
/** The daemon binary on this machine, for the sandboxes' architecture (dist/computerd-linux-<arch>). */
|
|
56
|
-
daemonPath: string;
|
|
57
26
|
/** Go's name for the sandboxes' architecture, which hello must report. Default amd64. */
|
|
58
|
-
arch?:
|
|
27
|
+
arch?: "amd64" | "arm64";
|
|
59
28
|
/** The class the snapshots this provider is given make: container (default) or linux-vm. */
|
|
60
29
|
sandboxClass?: "container" | "linux-vm";
|
|
61
30
|
/** The Daytona target (region); default the organization's. */
|
|
62
31
|
target?: string;
|
|
63
|
-
/**
|
|
64
|
-
* The egress gateway an Archil computer's archil client reaches Archil through, `<IPv4 gateway>:<mount lane>:<data
|
|
65
|
-
* lane>` such as 10.60.0.40:18100:42050 (parcha-proxy's archil-egress): for a target whose runners reach Archil only
|
|
66
|
-
* through it. Unset, the client reaches Archil as the sandbox's network allows, as before.
|
|
67
|
-
*/
|
|
68
|
-
archilEgress?: string;
|
|
69
32
|
/**
|
|
70
33
|
* The snapshot GPU computers are made from: one of ours, box/Dockerfile built with a GPU (box/build-daytona.py --gpu
|
|
71
34
|
* H100 prints its name, agentrun-archil-gpu-h100-<hash>), whose user is root; its GPU is the one its name says.
|
|
72
35
|
* Default Daytona's own daytona-gpu. Either way a GPU computer takes no mount: Daytona's GPU host gives no /dev/fuse.
|
|
73
36
|
*/
|
|
74
37
|
gpuSnapshot?: string;
|
|
75
|
-
/**
|
|
76
|
-
* Who the daemon runs as, uid:gid in numbers, never root. Default 2510:2510 (TOOL_USER), a uid no process of Daytona's
|
|
77
|
-
* holds: init refuses to start while another process does.
|
|
78
|
-
*/
|
|
79
|
-
daemonUser?: string;
|
|
80
38
|
/**
|
|
81
39
|
* Daytona's autoStopInterval: minutes without outside activity after which Daytona stops the sandbox, whatever runs in
|
|
82
40
|
* it; 0 (default) is never. A whole number, 0 or more.
|
|
@@ -92,97 +50,28 @@ export interface DaytonaProviderOptions {
|
|
|
92
50
|
fetch?: typeof fetch;
|
|
93
51
|
/** For tests: every log stream opens through it. Default Node's global WebSocket. */
|
|
94
52
|
webSocket?: WebSocketFactory;
|
|
53
|
+
/** For tests: the pause before a request is tried again, given its ms and the call's signal. Default a timer. */
|
|
54
|
+
pause?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
95
55
|
timeouts?: Partial<DaytonaTimeouts>;
|
|
96
56
|
}
|
|
97
|
-
/**
|
|
98
|
-
* The mount kinds a Daytona computer takes: an Archil mount of the run's folder (mount-archil.ts), made as root through
|
|
99
|
-
* the toolbox, from a snapshot of box/Dockerfile, with the daemon user agentrun-tool (daemonUser "2510:2510").
|
|
100
|
-
*/
|
|
101
|
-
export declare const MOUNT: readonly MountKind[];
|
|
102
|
-
/** The machine kind, groups and GPUs of its one configuration (its descriptor's): a linux computer, with GPUs when asked. */
|
|
103
|
-
export declare const CAPABILITIES: readonly KindCapabilities[];
|
|
104
|
-
/** What create() takes: the provider's options, the daemon optional (default this package's build for the arch). */
|
|
105
|
-
export type DaytonaCreateOptions = Omit<DaytonaProviderOptions, "daemonPath"> & {
|
|
106
|
-
daemonPath?: string;
|
|
107
|
-
};
|
|
108
57
|
/**
|
|
109
58
|
* A DaytonaProvider from its options alone; it reads no environment, so the key, the API URL (default Daytona's own) and
|
|
110
59
|
* the target are the caller's: serve passes its DAYTONA_API_KEY, DAYTONA_API_URL and DAYTONA_TARGET, the conformance
|
|
111
60
|
* module the settings it reads. Throws in words when an option is missing or wrong, never echoing the key.
|
|
112
61
|
*/
|
|
113
|
-
export declare function create(options:
|
|
62
|
+
export declare function create(options: DaytonaProviderOptions): DaytonaProvider;
|
|
114
63
|
/** The conformance CLI's module for Daytona: the run's idle stop and auto-delete, its snapshot, notes and drifted twin. */
|
|
115
64
|
export declare const conformance: () => Promise<typeof import("./conformance/daytona.js")>;
|
|
116
65
|
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* would, in a root container.
|
|
66
|
+
* Daytona's own path sockets outside /run: its D-Bus session bus, /tmp/dbus-<10 characters> (the live baseline's
|
|
67
|
+
* isolation.vendor-agent connected to /tmp/dbus-Y8OW6E3FDx as the tool user). Create closes them to the tool user.
|
|
120
68
|
*/
|
|
121
|
-
export declare
|
|
122
|
-
staging?: string;
|
|
123
|
-
deadline?: string;
|
|
124
|
-
user?: string;
|
|
125
|
-
}): {
|
|
126
|
-
install: string;
|
|
127
|
-
init: string;
|
|
128
|
-
stdio: string;
|
|
129
|
-
};
|
|
69
|
+
export declare const DAYTONA_SOCKETS: readonly string[];
|
|
130
70
|
/**
|
|
131
|
-
* Computers that are Daytona sandboxes. A spec's image is a Daytona snapshot (its id or name),
|
|
132
|
-
* the size. See the README's Daytona section for
|
|
71
|
+
* Computers that are Daytona sandboxes, on the shared adapter. A spec's image is a Daytona snapshot (its id or name),
|
|
72
|
+
* which gives the class and the size; "default" is Daytona's default snapshot. See the README's Daytona section for
|
|
73
|
+
* every call, and its citation.
|
|
133
74
|
*/
|
|
134
|
-
export declare class DaytonaProvider
|
|
135
|
-
|
|
136
|
-
readonly id = "daytona";
|
|
137
|
-
readonly version: string;
|
|
138
|
-
constructor({ apiKey, onNote, apiUrl, daemonPath, arch, sandboxClass, target, archilEgress, gpuSnapshot, daemonUser, autoStopMinutes, autoDeleteMinutes, fetch: fetcher, webSocket, timeouts, }: DaytonaProviderOptions);
|
|
139
|
-
/**
|
|
140
|
-
* daemon child: Daytona's toolbox daemon is the sandbox's first process, and init is a command it runs in a session
|
|
141
|
-
* (#prepare), so deleting that session ends init and leaves the sandbox. maxLifetimeMs is the 30 days check() has
|
|
142
|
-
* always given; Daytona's TTL is in whole minutes and documents no cap of its own. The toolbox listens on 2280 on
|
|
143
|
-
* every interface and runs commands for whoever reaches it, so init starts with --own-network, and network none is
|
|
144
|
-
* all a computer takes until a proxy carries open and allowlists out of the daemon's own network.
|
|
145
|
-
*/
|
|
146
|
-
capabilities(): ComputerCapabilities;
|
|
147
|
-
check(spec: ComputerSpec): Refusal[];
|
|
148
|
-
create(spec: ComputerSpec, context: CreateContext): Promise<Result<CreatedComputer>>;
|
|
149
|
-
/** The live view: screen.watch on a connection of the watch's own (daemonWatch); a sandbox has no screen. */
|
|
150
|
-
watch(ref: ComputerRef, handlers: ScreenWatchHandlers, options?: WatchOptions): Promise<Result<ScreenWatch>>;
|
|
151
|
-
connect(ref: ComputerRef): Promise<Result<ComputerConnection>>;
|
|
152
|
-
attach(ref: {
|
|
153
|
-
id: string;
|
|
154
|
-
} | {
|
|
155
|
-
labels: Record<string, string>;
|
|
156
|
-
}, { signal }?: CallContext): Promise<Result<AttachedComputer>>;
|
|
157
|
-
/**
|
|
158
|
-
* For the sweep after a live run: every sandbox Daytona lists with agentrun.computer=1, whatever its name or state, as
|
|
159
|
-
* Daytona reports it, with its labels (the sweep deletes only a conformance run's). list() keeps only this provider's
|
|
160
|
-
* computers; this keeps everything the label query returns.
|
|
161
|
-
*/
|
|
162
|
-
listLabelled({ signal }?: CallContext): Promise<Result<Array<{
|
|
163
|
-
id: string;
|
|
164
|
-
name?: string;
|
|
165
|
-
state?: string;
|
|
166
|
-
labels: Record<string, string>;
|
|
167
|
-
}>>>;
|
|
168
|
-
/** For the sweep: GET /sandbox/{id} once, retried as every read is, and the status Daytona answered (404: none). */
|
|
169
|
-
probe(id: string, { signal }?: CallContext): Promise<Result<{
|
|
170
|
-
status: number;
|
|
171
|
-
state?: string;
|
|
172
|
-
}>>;
|
|
173
|
-
/**
|
|
174
|
-
* Settings' test: one page of the account's sandboxes by the provider's own label, which makes nothing. The count is
|
|
175
|
-
* read from the listing, with no read of each sandbox: a busy account answers as fast, and one sandbox's read never
|
|
176
|
-
* fails a working key. A further page is "or more".
|
|
177
|
-
*/
|
|
178
|
-
testConnection({ signal }?: CallContext): Promise<Result<{
|
|
179
|
-
detail: string;
|
|
180
|
-
}>>;
|
|
181
|
-
list(labels: Record<string, string>, { signal }?: CallContext): Promise<Result<ComputerInfo[]>>;
|
|
182
|
-
network(ref: ComputerRef, policy?: NetworkSpec, { signal }?: CallContext): Promise<Result<NetworkPolicy>>;
|
|
183
|
-
/**
|
|
184
|
-
* Daytona answers a delete or a stop before the sandbox is gone or stopped, and its listing trails both: release
|
|
185
|
-
* returns once Daytona reads the computer as release left it, or fails naming the last state it read.
|
|
186
|
-
*/
|
|
187
|
-
release(ref: ComputerRef, how: ReleaseHow, { signal }?: CallContext): Promise<Result<void>>;
|
|
75
|
+
export declare class DaytonaProvider extends HostedProvider {
|
|
76
|
+
constructor(options: DaytonaProviderOptions);
|
|
188
77
|
}
|