@parcha/agentrun-computer 0.1.0-beta.57 → 0.1.0-beta.59
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 +187 -62
- package/box/Dockerfile +4 -3
- package/box/install.sh +57 -11
- package/dist/agent37.js +6 -9
- package/dist/attach.d.ts +24 -4
- package/dist/attach.js +50 -19
- package/dist/boxd.js +22 -9
- package/dist/browserbase.d.ts +6 -2
- package/dist/browserbase.js +50 -7
- package/dist/child-env.d.ts +11 -0
- package/dist/child-env.js +22 -0
- package/dist/chrome.d.ts +5 -2
- package/dist/chrome.js +5 -2
- package/dist/cloudflare.d.ts +2 -0
- package/dist/cloudflare.js +5 -3
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/computerd.json +1 -1
- package/dist/conformance/agent37.d.ts +10 -38
- package/dist/conformance/agent37.js +25 -113
- package/dist/conformance/archil.d.ts +13 -3
- package/dist/conformance/archil.js +22 -17
- package/dist/conformance/boxd.d.ts +8 -31
- package/dist/conformance/boxd.js +19 -74
- package/dist/conformance/browserbase.d.ts +3 -6
- package/dist/conformance/browserbase.js +6 -17
- package/dist/conformance/cases/health.js +6 -3
- package/dist/conformance/cli.d.ts +3 -1
- package/dist/conformance/cli.js +69 -9
- package/dist/conformance/cloudflare.d.ts +3 -6
- package/dist/conformance/cloudflare.js +7 -15
- package/dist/conformance/daytona.d.ts +6 -20
- package/dist/conformance/daytona.js +22 -57
- package/dist/conformance/dial-only.d.ts +4 -3
- package/dist/conformance/dial-only.js +3 -3
- package/dist/conformance/docker.d.ts +4 -5
- package/dist/conformance/docker.js +8 -14
- package/dist/conformance/e2b.d.ts +10 -36
- package/dist/conformance/e2b.js +27 -84
- package/dist/conformance/fly.d.ts +3 -6
- package/dist/conformance/fly.js +2 -6
- package/dist/conformance/groundbox.d.ts +7 -23
- package/dist/conformance/groundbox.js +16 -56
- package/dist/conformance/index.d.ts +1 -0
- package/dist/conformance/index.js +1 -0
- package/dist/conformance/kernel.d.ts +3 -6
- package/dist/conformance/kernel.js +5 -15
- package/dist/conformance/kind.d.ts +0 -6
- package/dist/conformance/kind.js +0 -4
- package/dist/conformance/local-chrome.d.ts +5 -7
- package/dist/conformance/local-chrome.js +7 -11
- package/dist/conformance/modal.d.ts +10 -38
- package/dist/conformance/modal.js +27 -74
- package/dist/conformance/module-kit.d.ts +87 -0
- package/dist/conformance/module-kit.js +88 -0
- package/dist/conformance/morph.d.ts +7 -23
- package/dist/conformance/morph.js +20 -66
- package/dist/conformance/orgo.d.ts +5 -10
- package/dist/conformance/orgo.js +15 -27
- package/dist/conformance/phone-harness.d.ts +3 -5
- package/dist/conformance/phone-harness.js +3 -11
- package/dist/conformance/runner.d.ts +13 -3
- package/dist/conformance/runner.js +32 -11
- package/dist/conformance/smolcloud.d.ts +7 -23
- package/dist/conformance/smolcloud.js +16 -49
- package/dist/conformance/sweep.d.ts +10 -5
- package/dist/conformance/sweep.js +91 -38
- package/dist/conformance/tti.d.ts +69 -0
- package/dist/conformance/tti.js +205 -0
- package/dist/conformance/types.d.ts +9 -2
- package/dist/daytona.js +60 -20
- package/dist/descriptor.d.ts +10 -0
- package/dist/descriptor.js +7 -0
- package/dist/descriptors/browserbase.d.ts +3 -0
- package/dist/descriptors/browserbase.js +4 -0
- package/dist/descriptors/docker.d.ts +1 -0
- package/dist/descriptors/docker.js +3 -0
- package/dist/descriptors/env-names.d.ts +32 -0
- package/dist/descriptors/env-names.js +60 -0
- package/dist/descriptors/index.d.ts +9 -2
- package/dist/descriptors/kernel.d.ts +3 -0
- package/dist/descriptors/kernel.js +2 -0
- package/dist/descriptors/local-chrome.d.ts +1 -1
- package/dist/descriptors/local-chrome.js +5 -3
- package/dist/descriptors/phone-harness.d.ts +1 -1
- package/dist/descriptors/phone-harness.js +4 -2
- package/dist/docker/egress.d.ts +7 -0
- package/dist/docker/egress.js +8 -0
- package/dist/docker/image.d.ts +5 -1
- package/dist/docker/image.js +12 -8
- package/dist/docker.d.ts +63 -15
- package/dist/docker.js +181 -98
- package/dist/drift.js +6 -6
- package/dist/e2b.d.ts +2 -2
- package/dist/e2b.js +2 -3
- package/dist/groundbox.js +6 -6
- package/dist/host.d.ts +23 -0
- package/dist/hosted/download.d.ts +23 -0
- package/dist/hosted/download.js +144 -0
- package/dist/hosted/process.d.ts +5 -0
- package/dist/hosted/process.js +20 -0
- package/dist/hosted/provider.js +120 -48
- package/dist/hosted/rest.d.ts +19 -8
- package/dist/hosted/rest.js +47 -14
- package/dist/hosted/scripts.d.ts +10 -0
- package/dist/hosted/scripts.js +23 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/janitor.d.ts +7 -1
- package/dist/janitor.js +2 -2
- package/dist/kernel.js +1 -1
- package/dist/local-chrome.d.ts +5 -2
- package/dist/local-chrome.js +4 -2
- package/dist/local-supervisor.js +1 -0
- package/dist/modal.d.ts +6 -5
- package/dist/modal.js +7 -7
- package/dist/morph.js +5 -8
- package/dist/orgo-channel.d.ts +3 -2
- package/dist/orgo-channel.js +3 -3
- package/dist/orgo-desktop.js +2 -4
- package/dist/orgo.js +2 -4
- package/dist/phone-harness.d.ts +7 -5
- package/dist/phone-harness.js +60 -61
- package/dist/protocol.d.ts +10 -0
- package/dist/protocol.js +17 -0
- package/dist/provider.d.ts +6 -2
- package/dist/screen-watch.d.ts +6 -1
- package/dist/screen-watch.js +166 -12
- package/dist/vendor-sdk.d.ts +9 -0
- package/dist/vendor-sdk.js +26 -0
- package/package.json +8 -1
package/dist/docker.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type DesktopOptions } from "./desktop.js";
|
|
2
2
|
import { type DockerHost } from "./docker/inspect.js";
|
|
3
|
+
import { type HostEnv } from "./child-env.js";
|
|
3
4
|
import { type EnsureImageOptions, type ImageSource } from "./docker/image.js";
|
|
4
5
|
import { type AttachedComputer, type CallContext, type CreateContext, type ComputerCapabilities, type ComputerConnection, type ComputerInfo, type ComputerProvider, type ComputerRef, type ComputerSpec, type NetworkPolicy, type NetworkSpec, type Refusal, type ReleaseHow } from "./provider.js";
|
|
5
6
|
import { type Result } from "./result.js";
|
|
@@ -65,6 +66,22 @@ export interface DockerProviderOptions {
|
|
|
65
66
|
name: string;
|
|
66
67
|
root: string;
|
|
67
68
|
};
|
|
69
|
+
/** The host's environment variables, of which every docker CLI call holds the names docker reads (DOCKER_ENV_NAMES:
|
|
70
|
+
* where the daemon is, its config and credential helpers, PATH and HOME) and nothing else, so no key the host holds
|
|
71
|
+
* reaches docker or what it starts. The provider reads no environment: without env, docker starts with none. */
|
|
72
|
+
env?: HostEnv;
|
|
73
|
+
/**
|
|
74
|
+
* For tests: the bound, in ms, on the clean-up after a create that failed or was cut off, and on waiting for a removal
|
|
75
|
+
* Docker says is already under way (a release's, a stop's, a sweep's): past it, the container still there is the
|
|
76
|
+
* failure, in words naming this bound. Default 10 s. A test of a removal that never ends sets it short.
|
|
77
|
+
*/
|
|
78
|
+
settleMs?: number;
|
|
79
|
+
/**
|
|
80
|
+
* For tests: how long, in ms, the looks after a docker run cut off before its own exit must find nothing in a row
|
|
81
|
+
* before what it may have made counts as gone, so a create Docker finishes a moment after the abort is still seen.
|
|
82
|
+
* Default 3 s. One as long as settleMs leaves nothing confirmed gone: that create's answer then says so.
|
|
83
|
+
*/
|
|
84
|
+
settleQuietMs?: number;
|
|
68
85
|
}
|
|
69
86
|
/** What create() takes: the provider's options, the daemon optional. */
|
|
70
87
|
export interface DockerCreateOptions extends Partial<DockerProviderOptions> {
|
|
@@ -73,28 +90,48 @@ export interface DockerCreateOptions extends Partial<DockerProviderOptions> {
|
|
|
73
90
|
}
|
|
74
91
|
/**
|
|
75
92
|
* Docker's architecture as `docker version` reports it (amd64, arm64), within timeoutMs, or an error in words. The docker
|
|
76
|
-
* CLI runs with
|
|
93
|
+
* CLI runs with the names of `env` docker reads (dockerEnv), as every call of the provider does, so it asks the Docker the
|
|
94
|
+
* provider uses.
|
|
77
95
|
*/
|
|
78
|
-
export declare function dockerArch({ docker, timeoutMs }?: Pick<DockerCreateOptions, "docker" | "timeoutMs">): Promise<string>;
|
|
96
|
+
export declare function dockerArch({ docker, timeoutMs, env }?: Pick<DockerCreateOptions, "docker" | "timeoutMs" | "env">): Promise<string>;
|
|
97
|
+
/**
|
|
98
|
+
* The daemon a Docker computer binds for Docker's architecture `arch` (dockerArch): computerd-linux-<arch> in `dir`,
|
|
99
|
+
* default this package's own build, and, when no such file is there, why, with the command that builds it. create()
|
|
100
|
+
* takes its daemon here, and so does a server's start check of Docker, so the two can't disagree.
|
|
101
|
+
*/
|
|
102
|
+
export declare function dockerDaemonOf(arch: string, dir?: string): {
|
|
103
|
+
path: string;
|
|
104
|
+
missing?: string;
|
|
105
|
+
};
|
|
79
106
|
/**
|
|
80
107
|
* A DockerProvider from its options alone; it reads no environment. Without options.daemonPath it asks Docker its
|
|
81
|
-
* architecture and takes this package's daemon for it, and says when that daemon is not built. The image
|
|
82
|
-
* too (default the provider's own recipe): no image name is read from the environment.
|
|
108
|
+
* architecture and takes this package's daemon for it (dockerDaemonOf), and says when that daemon is not built. The image
|
|
109
|
+
* is an option too (default the provider's own recipe): no image name is read from the environment.
|
|
83
110
|
*/
|
|
84
111
|
export declare function create(options?: DockerCreateOptions): Promise<DockerProvider>;
|
|
85
112
|
/** The conformance CLI's module for Docker: the drifted twin. */
|
|
86
113
|
export declare const conformance: () => Promise<typeof import("./conformance/docker.js")>;
|
|
114
|
+
/** After a docker run cut off before its own exit: how long, at most, the leftovers are removed and looked for again,
|
|
115
|
+
* how often, and for how long in a row the looks must find none of them before they count as gone (#settle). */
|
|
116
|
+
export declare const SETTLE_MS = 10000;
|
|
117
|
+
export declare const SETTLE_QUIET_MS = 3000;
|
|
118
|
+
/** The bounds of #settle: its whole bound and its quiet window, in ms (the settleMs and settleQuietMs options). */
|
|
119
|
+
export interface SettleBounds {
|
|
120
|
+
settleMs: number;
|
|
121
|
+
quietMs: number;
|
|
122
|
+
}
|
|
87
123
|
/**
|
|
88
|
-
* Why #settle could not show its leftovers gone within
|
|
89
|
-
* last look still found; or, when the last look found none
|
|
90
|
-
* checked (`checked`), which could not be confirmed gone. Exported
|
|
124
|
+
* Why #settle could not show its leftovers gone within its bound (`bounds`, the defaults unless the provider was given
|
|
125
|
+
* its own), in words that always name them: `there`, what its last look still found; or, when the last look found none
|
|
126
|
+
* but the quiet window was not complete, every name it checked (`checked`), which could not be confirmed gone. Exported
|
|
127
|
+
* for its test.
|
|
91
128
|
*/
|
|
92
|
-
export declare function settleWords(checked: readonly string[], there: readonly string[]): string;
|
|
129
|
+
export declare function settleWords(checked: readonly string[], there: readonly string[], bounds?: SettleBounds): string;
|
|
93
130
|
export declare class DockerProvider implements ComputerProvider {
|
|
94
131
|
#private;
|
|
95
132
|
readonly id = "docker";
|
|
96
133
|
readonly version: string;
|
|
97
|
-
constructor({ daemonPath, daemonCache, docker, user, desktop, egress, image, volume }: DockerProviderOptions);
|
|
134
|
+
constructor({ daemonPath, daemonCache, docker, user, desktop, egress, image, volume, env, settleMs, settleQuietMs }: DockerProviderOptions);
|
|
98
135
|
/** The uid:gid a computer runs as when its spec names no user: the user a bound run folder must be writable by. */
|
|
99
136
|
get user(): string;
|
|
100
137
|
capabilities(): ComputerCapabilities;
|
|
@@ -135,16 +172,21 @@ export declare class DockerProvider implements ComputerProvider {
|
|
|
135
172
|
list(labels: Record<string, string>, { signal }?: CallContext): Promise<Result<ComputerInfo[]>>;
|
|
136
173
|
/**
|
|
137
174
|
* The janitor's second pass (sweep calls it after the computers): every egress proxy container and egress volume
|
|
138
|
-
* labelled EGRESS_LABEL, and with all of `labels`, whose
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* volume
|
|
175
|
+
* labelled EGRESS_LABEL, and with all of `labels`, whose computer is not there, read by its name right before that
|
|
176
|
+
* part's removal, and that is past its deadline label (or the label is missing or unreadable, fail closed) or older
|
|
177
|
+
* than a create could take (#leftoverGraceMs). Per part, in this order: its labels and age; then `mine`, when given
|
|
178
|
+
* (serve's: a run of its own store that no claim holds); then its computer, by name (there, or a read that fails,
|
|
179
|
+
* keeps the part); then its removal by what its label found, a proxy before its volume, never by a name alone.
|
|
180
|
+
* `mine` comes before the computer so a create under the caller's claim that finishes between the two reads is seen:
|
|
181
|
+
* once the caller says no claim holds the run, nothing at that claim makes the computer, and a later claim's computer
|
|
182
|
+
* has another name. A part with an owner label is never removed: Docker makes no agent's computer (no persistence),
|
|
183
|
+
* so that label is a caller's, never a run's leftover. Returns the names removed, a volume's as "<name> (volume)".
|
|
143
184
|
*/
|
|
144
|
-
sweepLeftovers({ labels, now, signal }?: {
|
|
185
|
+
sweepLeftovers({ labels, now, signal, mine }?: {
|
|
145
186
|
labels?: Record<string, string>;
|
|
146
187
|
now?: Date;
|
|
147
188
|
signal?: AbortSignal;
|
|
189
|
+
mine?: (labels: Record<string, string>) => boolean | Promise<boolean>;
|
|
148
190
|
}): Promise<Result<string[]>>;
|
|
149
191
|
network(ref: ComputerRef, policy?: NetworkSpec, { signal }?: CallContext): Promise<Result<NetworkPolicy>>;
|
|
150
192
|
/**
|
|
@@ -154,3 +196,9 @@ export declare class DockerProvider implements ComputerProvider {
|
|
|
154
196
|
*/
|
|
155
197
|
release(ref: ComputerRef, how: ReleaseHow): Promise<Result<void>>;
|
|
156
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* The settleMs and settleQuietMs options as #settle's bounds, with their defaults (SETTLE_MS, SETTLE_QUIET_MS), or a throw
|
|
201
|
+
* in words: each is a whole number of milliseconds above 0 that a timer can hold. The one place the defaults are applied:
|
|
202
|
+
* the constructor and settleWords both read it. Exported for its test, which reads the defaults instead of waiting them out.
|
|
203
|
+
*/
|
|
204
|
+
export declare function settleBoundsOf({ settleMs, settleQuietMs }: Pick<DockerProviderOptions, "settleMs" | "settleQuietMs">): SettleBounds;
|