@parcha/agentrun-computer 0.1.0-beta.37 → 0.1.0-beta.39

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.
Files changed (124) hide show
  1. package/README.md +341 -260
  2. package/box/Dockerfile +18 -1
  3. package/box/README.md +14 -0
  4. package/box/build-daytona.py +2 -2
  5. package/box/build-e2b.mjs +41 -18
  6. package/box/recipe.d.mts +5 -0
  7. package/box/recipe.mjs +43 -0
  8. package/dist/agent37.d.ts +18 -66
  9. package/dist/agent37.js +187 -464
  10. package/dist/box-image.d.ts +14 -0
  11. package/dist/box-image.js +24 -0
  12. package/dist/browserbase.d.ts +0 -6
  13. package/dist/browserbase.js +1 -5
  14. package/dist/client.d.ts +12 -3
  15. package/dist/client.js +39 -4
  16. package/dist/computerd-linux-amd64 +0 -0
  17. package/dist/computerd-linux-arm64 +0 -0
  18. package/dist/computerd.json +4 -0
  19. package/dist/conformance/agent37.d.ts +9 -4
  20. package/dist/conformance/agent37.js +23 -11
  21. package/dist/conformance/browserbase.js +3 -3
  22. package/dist/conformance/cases/apps.d.ts +6 -0
  23. package/dist/conformance/cases/apps.js +18 -5
  24. package/dist/conformance/cases/isolation.d.ts +22 -5
  25. package/dist/conformance/cases/isolation.js +97 -16
  26. package/dist/conformance/cases/mount.js +5 -3
  27. package/dist/conformance/cases/provider.js +41 -0
  28. package/dist/conformance/cli.js +72 -11
  29. package/dist/conformance/daytona.d.ts +9 -20
  30. package/dist/conformance/daytona.js +12 -21
  31. package/dist/conformance/e2b.js +9 -4
  32. package/dist/conformance/exec-stream.d.ts +52 -0
  33. package/dist/conformance/exec-stream.js +493 -0
  34. package/dist/conformance/kernel.js +2 -2
  35. package/dist/conformance/modal.js +1 -1
  36. package/dist/conformance/orgo.js +2 -2
  37. package/dist/conformance/sweep.js +8 -8
  38. package/dist/conformance/types.d.ts +2 -2
  39. package/dist/create-requests.d.ts +1 -1
  40. package/dist/daytona.d.ts +17 -133
  41. package/dist/daytona.js +396 -1452
  42. package/dist/descriptor.d.ts +11 -4
  43. package/dist/descriptor.js +7 -0
  44. package/dist/descriptors/agent37.d.ts +3 -11
  45. package/dist/descriptors/agent37.js +9 -10
  46. package/dist/descriptors/daytona.d.ts +7 -6
  47. package/dist/descriptors/daytona.js +14 -7
  48. package/dist/descriptors/docker.d.ts +13 -1
  49. package/dist/descriptors/docker.js +3 -1
  50. package/dist/descriptors/e2b.d.ts +2 -9
  51. package/dist/descriptors/e2b.js +8 -8
  52. package/dist/descriptors/index.d.ts +25 -24
  53. package/dist/descriptors/index.js +1 -3
  54. package/dist/descriptors/modal.d.ts +2 -6
  55. package/dist/descriptors/modal.js +8 -6
  56. package/dist/descriptors/orgo.js +2 -1
  57. package/dist/descriptors/shared.d.ts +1 -1
  58. package/dist/descriptors/shared.js +2 -2
  59. package/dist/desktop.d.ts +18 -4
  60. package/dist/desktop.js +89 -9
  61. package/dist/docker/egress-main.js +23 -15
  62. package/dist/docker/egress.d.ts +6 -4
  63. package/dist/docker/egress.js +24 -16
  64. package/dist/docker/inspect.d.ts +2 -2
  65. package/dist/docker/inspect.js +5 -5
  66. package/dist/docker.d.ts +6 -11
  67. package/dist/docker.js +13 -16
  68. package/dist/drift.js +4 -4
  69. package/dist/e2b.d.ts +22 -130
  70. package/dist/e2b.js +163 -243
  71. package/dist/host.d.ts +136 -104
  72. package/dist/host.js +8 -1
  73. package/dist/hosted/network.d.ts +23 -0
  74. package/dist/hosted/network.js +77 -0
  75. package/dist/hosted/process.d.ts +24 -8
  76. package/dist/hosted/process.js +80 -44
  77. package/dist/hosted/provider.d.ts +38 -22
  78. package/dist/hosted/provider.js +500 -341
  79. package/dist/hosted/rest.d.ts +74 -0
  80. package/dist/hosted/rest.js +126 -0
  81. package/dist/hosted/scripts.d.ts +21 -3
  82. package/dist/hosted/scripts.js +76 -14
  83. package/dist/hosted/ssh-exec.d.ts +99 -0
  84. package/dist/hosted/ssh-exec.js +464 -0
  85. package/dist/hosted/values.d.ts +26 -0
  86. package/dist/hosted/values.js +63 -0
  87. package/dist/index.d.ts +2 -2
  88. package/dist/index.js +2 -2
  89. package/dist/isolation.d.ts +0 -2
  90. package/dist/isolation.js +3 -4
  91. package/dist/kernel.d.ts +0 -6
  92. package/dist/kernel.js +1 -5
  93. package/dist/kinds.d.ts +3 -1
  94. package/dist/local-chrome.d.ts +0 -6
  95. package/dist/local-chrome.js +1 -5
  96. package/dist/modal.d.ts +15 -86
  97. package/dist/modal.js +67 -185
  98. package/dist/mount-archil.d.ts +13 -8
  99. package/dist/mount-archil.js +27 -17
  100. package/dist/mount.d.ts +10 -4
  101. package/dist/mount.js +8 -4
  102. package/dist/orgo.d.ts +0 -9
  103. package/dist/orgo.js +8 -13
  104. package/dist/phone-harness.d.ts +0 -6
  105. package/dist/phone-harness.js +0 -4
  106. package/dist/protocol.d.ts +4 -1
  107. package/dist/protocol.js +1 -0
  108. package/dist/provider.d.ts +2 -2
  109. package/dist/providers.d.ts +15 -13
  110. package/dist/screen-watch.js +34 -6
  111. package/dist/surface/api.d.ts +14 -11
  112. package/dist/surface/core.d.ts +23 -5
  113. package/dist/surface/core.js +105 -15
  114. package/dist/surface/index.d.ts +1 -1
  115. package/dist/surface/index.js +1 -1
  116. package/dist/surface/outline.d.ts +2 -0
  117. package/dist/surface/outline.js +2 -1
  118. package/dist/surface/script.d.ts +4 -0
  119. package/dist/surface/script.js +11 -3
  120. package/dist/ui-engine.js +19 -3
  121. package/package.json +2 -3
  122. package/box/build-agent37.mjs +0 -177
  123. package/dist/conformance/daytona-sweep.d.ts +0 -18
  124. package/dist/conformance/daytona-sweep.js +0 -126
package/dist/daytona.d.ts CHANGED
@@ -1,37 +1,5 @@
1
- import type { KindCapabilities } from "./kinds.js";
2
- import { type MountKind } from "./mount.js";
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
- export interface DaytonaProviderOptions {
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?: string;
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,23 @@ 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: DaytonaCreateOptions): DaytonaProvider;
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
- * The three commands the provider sends into a sandbox, exactly: install (through /process/execute), init and stdio
118
- * (each a session command), the child daemon's commands (childCommands). Exported so a test can run them where Daytona
119
- * would, in a root container.
66
+ * Computers that are Daytona sandboxes, on the shared adapter. A spec's image is a Daytona snapshot (its id or name),
67
+ * which gives the class and the size; "default" is Daytona's default snapshot. See the README's Daytona section for
68
+ * every call, and its citation.
120
69
  */
121
- export declare function daytonaCommands({ staging, deadline, user }?: {
122
- staging?: string;
123
- deadline?: string;
124
- user?: string;
125
- }): {
126
- install: string;
127
- init: string;
128
- stdio: string;
129
- };
130
- /**
131
- * Computers that are Daytona sandboxes. A spec's image is a Daytona snapshot (its id or name), which gives the class and
132
- * the size. See the README's Daytona section for every call, and its citation.
133
- */
134
- export declare class DaytonaProvider implements ComputerProvider {
135
- #private;
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>>;
70
+ export declare class DaytonaProvider extends HostedProvider {
71
+ constructor(options: DaytonaProviderOptions);
188
72
  }