@parcha/agentrun-computer 0.1.0-beta.58 → 0.1.0-beta.60
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 +285 -81
- package/box/Dockerfile +4 -3
- package/box/install.sh +57 -11
- package/dist/agent37.d.ts +11 -4
- package/dist/agent37.js +217 -19
- package/dist/attach.d.ts +24 -4
- package/dist/attach.js +50 -19
- package/dist/boxd.js +22 -9
- package/dist/browser.d.ts +56 -11
- package/dist/browser.js +76 -17
- package/dist/browserbase.d.ts +20 -5
- package/dist/browserbase.js +186 -21
- 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 +20 -40
- package/dist/conformance/agent37.js +31 -118
- 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/cases/provider.js +4 -1
- 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 +37 -0
- package/dist/descriptor.js +9 -0
- package/dist/descriptors/agent37.d.ts +4 -1
- package/dist/descriptors/agent37.js +5 -2
- package/dist/descriptors/browserbase.d.ts +3 -0
- package/dist/descriptors/browserbase.js +4 -0
- package/dist/descriptors/docker.d.ts +2 -0
- package/dist/descriptors/docker.js +5 -0
- package/dist/descriptors/env-names.d.ts +32 -0
- package/dist/descriptors/env-names.js +60 -0
- package/dist/descriptors/index.d.ts +14 -3
- 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 +52 -13
- package/dist/docker.js +166 -92
- 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/hosted/ssh-exec.d.ts +7 -1
- package/dist/hosted/ssh-exec.js +19 -14
- package/dist/hosted/ssh-key.d.ts +18 -0
- package/dist/hosted/ssh-key.js +36 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +4 -2
- package/dist/janitor.d.ts +7 -1
- package/dist/janitor.js +2 -2
- package/dist/kernel.d.ts +14 -4
- package/dist/kernel.js +141 -18
- package/dist/local-chrome.d.ts +12 -3
- package/dist/local-chrome.js +108 -10
- 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.d.ts +6 -0
- package/dist/orgo.js +158 -15
- 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/README.md
CHANGED
|
@@ -710,7 +710,7 @@ fixtures of every evasion it catches.
|
|
|
710
710
|
```ts
|
|
711
711
|
import { DockerProvider } from "@parcha/agentrun-computer/docker";
|
|
712
712
|
|
|
713
|
-
const docker = new DockerProvider({ daemonPath: "dist/computerd-linux-amd64" });
|
|
713
|
+
const docker = new DockerProvider({ daemonPath: "dist/computerd-linux-amd64", env: process.env });
|
|
714
714
|
const made = await docker.create({ image: "debian:bookworm-slim", lifetimeMs: 600_000, network: "none" }, { requestId: "r1#3" });
|
|
715
715
|
if (!made.ok) throw new Error(made.error.message);
|
|
716
716
|
const connected = await docker.connect(made.value);
|
|
@@ -807,10 +807,11 @@ was deleted.
|
|
|
807
807
|
reported as a policy. `network(ref, policy)` returns the policy when it is the computer's (an allowlist with the same
|
|
808
808
|
entries, normalized, in any order); any change is refused: a Docker computer's network is fixed at create, since
|
|
809
809
|
Docker cannot move a container with no network onto one, and an allowlist needs its volume mounted at create.
|
|
810
|
-
- `release(ref, "stop" | "delete")`
|
|
811
|
-
computer
|
|
812
|
-
|
|
813
|
-
|
|
810
|
+
- `release(ref, "stop" | "delete")` finds the computer's egress proxy by its label (below), then runs `docker stop` on
|
|
811
|
+
the computer and then the proxy, or one `docker rm --force --volumes` of the computer and the proxy together, then on
|
|
812
|
+
delete removes its volume, found by its label too. A computer whose own stop or removal fails still has its proxy and
|
|
813
|
+
volume stopped or removed, and the computer's failure is the answer. `capabilities().release` declares both, and
|
|
814
|
+
`stopDeletes` is false: a stopped container is kept until it is deleted. A computer already gone is ok.
|
|
814
815
|
- Only containers with the label `agentrun.computer=1` and a computer's name count for `attach`, `list` and `network`;
|
|
815
816
|
any other container is `not_found`.
|
|
816
817
|
|
|
@@ -890,13 +891,18 @@ key.
|
|
|
890
891
|
then `docker pull` for one that is not; a failed pull fails create in words, with nothing made). It then makes the
|
|
891
892
|
volume, starts the proxy and waits for its ready line (`egress.readyMs`, 10 s), then runs the computer; both runs
|
|
892
893
|
take `--pull never`, so no pull happens between the volume and the computer. A proxy that ends first, or is not ready in time, fails create in its own words; the proxy and the
|
|
893
|
-
volume are removed, and the computer is never run. `release` removes the proxy
|
|
894
|
-
found by the label `agentrun.computer.egress=<computer>`, never by name alone,
|
|
895
|
-
`releaseOlder` remove them too.
|
|
894
|
+
volume are removed, and the computer is never run. `release` removes the proxy with the computer, in the same
|
|
895
|
+
`docker rm`, and then the volume, each found by the label `agentrun.computer.egress=<computer>`, never by name alone,
|
|
896
|
+
so the janitor's sweep and `releaseOlder` remove them too. A release cut off once that call is made leaves no proxy
|
|
897
|
+
running without its computer. Parts left with no computer (one removed by hand, or a provider that died between its
|
|
896
898
|
proxy and its computer) the sweep removes too (`sweepLeftovers`): a proxy or volume with the egress label, and the
|
|
897
|
-
sweep's labels,
|
|
898
|
-
|
|
899
|
-
|
|
899
|
+
sweep's labels, past its deadline label or older than a create could take (its ready wait and two minutes), and
|
|
900
|
+
whose computer is not there, read by name right before that part's removal (a read that fails keeps it). A sweep
|
|
901
|
+
given `mine` removes only the ones whose labels it answers true for, asked before the computer is read, so callers
|
|
902
|
+
sharing a Docker host each remove their own (serve: a run of its store that no claim holds). A part with an owner
|
|
903
|
+
label is never removed: Docker makes no agent's computer. Each is removed by what the label found, never by a name.
|
|
904
|
+
The volume carries the computer's deadline and the spec's labels for this. Until then the proxy stops forwarding at
|
|
905
|
+
its deadline.
|
|
900
906
|
- **Read-back.** `network`, `list` and `attach` read open or the allowlist from Docker: network mode none, the egress volume
|
|
901
907
|
read-only at its path, init's relay in its command, and a proxy container that carries the computer's label and
|
|
902
908
|
deadline, runs while the computer runs, is hardened and bounded as above (its memory and swap, pids limit, private
|
|
@@ -917,7 +923,7 @@ Docker): `/workspace` is only the mount.
|
|
|
917
923
|
import { WORKSPACE } from "@parcha/agentrun-computer";
|
|
918
924
|
import { DockerProvider } from "@parcha/agentrun-computer/docker";
|
|
919
925
|
|
|
920
|
-
const docker = new DockerProvider({ daemonPath: "dist/computerd-linux-amd64" });
|
|
926
|
+
const docker = new DockerProvider({ daemonPath: "dist/computerd-linux-amd64", env: process.env });
|
|
921
927
|
// The run folder must exist, by its canonical path, and be writable by docker.user (below).
|
|
922
928
|
const made = await docker.create({ image: "debian:bookworm-slim", lifetimeMs: 600_000, network: "none", mount: { kind: "bind", path: "/data/runs/r1/work" } }, { requestId: "r1#3" });
|
|
923
929
|
// In the computer: files.read({ path: `${WORKSPACE}/notes.md` }), exec.run({ argv: ["make"], cwd: WORKSPACE, ... })
|
|
@@ -1036,13 +1042,13 @@ no other process to wait on: Docker's own tag is the shared state.
|
|
|
1036
1042
|
```ts
|
|
1037
1043
|
import { DockerProvider } from "@parcha/agentrun-computer/docker";
|
|
1038
1044
|
|
|
1039
|
-
const docker = new DockerProvider({ daemonPath: "dist/computerd-linux-amd64" }); // image: the default recipe
|
|
1045
|
+
const docker = new DockerProvider({ daemonPath: "dist/computerd-linux-amd64", env: process.env }); // image: the default recipe
|
|
1040
1046
|
const image = await docker.image({ signal }); // built once; one inspect when Docker has it
|
|
1041
1047
|
if (!image.ok) throw new Error(image.error.message);
|
|
1042
1048
|
const made = await docker.create({ image: image.value, lifetimeMs: 600_000, network: "none" }, { requestId: "r1#3" });
|
|
1043
1049
|
```
|
|
1044
1050
|
|
|
1045
|
-
- `ensureImage(source, { docker?, signal?, timeoutMs?, onWait? })` (`src/docker/image.ts`) gives the tag. `source` is
|
|
1051
|
+
- `ensureImage(source, { docker?, env?, signal?, timeoutMs?, onWait? })` (`src/docker/image.ts`) gives the tag. `source` is
|
|
1046
1052
|
`{ recipe }`, a Dockerfile with no build context, or `{ image }`, an image by name.
|
|
1047
1053
|
- A recipe is built with `docker build --quiet --label agentrun.computer.recipe=<sha256> --tag
|
|
1048
1054
|
agentrun-computer:<first 12 hex digits> -`, the recipe on stdin (`recipeTag(recipe)`, `recipeHash(recipe)`,
|
|
@@ -1054,6 +1060,22 @@ const made = await docker.create({ image: image.value, lifetimeMs: 600_000, netw
|
|
|
1054
1060
|
image (`DEFAULT_DOCKER_IMAGE`): `python:3.12-slim` pinned by its index digest (`DOCKER_BASE`), with git, curl,
|
|
1055
1061
|
nodejs, npm, ripgrep and socat from apt. `docker.image({ signal?, timeoutMs?, onWait? })` is `ensureImage` of it with the
|
|
1056
1062
|
provider's docker CLI. A source that is neither throws at construction, in words.
|
|
1063
|
+
- **The docker CLI gets only what it reads.** The provider reads no environment: its `env` option is the host's (serve
|
|
1064
|
+
passes its own values of the docker descriptor's `hostEnv`), and every docker call it makes (`dockerArch`,
|
|
1065
|
+
`ensureImage` and the provider's own, each taking `env` too) is started with the names of it docker reads
|
|
1066
|
+
(`DOCKER_ENV_NAMES`), and none of the rest. Library callers pass `env` (serve does): without it docker gets no
|
|
1067
|
+
environment at all, so a bare `docker` is found only on the default path (`/usr/bin:/bin`), not in `/usr/local/bin` or
|
|
1068
|
+
a snap, and no credential helper is found on PATH; the `docker` option, the CLI's absolute path, is the other way to
|
|
1069
|
+
name it. The names: PATH, HOME, TMPDIR, the
|
|
1070
|
+
locale, `DOCKER_HOST`, `DOCKER_CONTEXT`, `DOCKER_CONFIG` and Docker's TLS, API and buildx settings, ssh's agent socket,
|
|
1071
|
+
`XDG_RUNTIME_DIR` and the proxy (either case), for a daemon or registry that is not local, and the places a pull's
|
|
1072
|
+
credential helper (`docker-credential-<name>` on PATH) looks: the Secret Service's bus, GnuPG's home and agent, an AWS
|
|
1073
|
+
profile, region and config file, gcloud's config. No key passes (`AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`,
|
|
1074
|
+
`AZURE_CLIENT_SECRET`, `DOCKER_CUSTOM_HEADERS`, a content trust passphrase), nor a name shaped as one, a pointer to a
|
|
1075
|
+
credential included (`AWS_SHARED_CREDENTIALS_FILE`, `AWS_WEB_IDENTITY_TOKEN_FILE`,
|
|
1076
|
+
`AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`, `GOOGLE_APPLICATION_CREDENTIALS`, `PASSWORD_STORE_DIR`). A helper that
|
|
1077
|
+
signs in from keys in the server's environment (ECR's, with access keys in env) gets none: give it a profile, the
|
|
1078
|
+
default credentials file or a role instead.
|
|
1057
1079
|
- **The image is an option only; there is no env name for it.** Another image is named with the `image` option, to
|
|
1058
1080
|
`new DockerProvider(...)` or to `create({ image: { image: "..." } })`. The library reads no environment (see
|
|
1059
1081
|
[Settings](#settings)), and Docker's conformance module reads no image name either: a `COMPUTER_DOCKER_IMAGE` in its
|
|
@@ -1217,7 +1239,7 @@ as a caller's labels, with no code of its own: Docker writes them with `--label`
|
|
|
1217
1239
|
import { releaseOlder, runLabels } from "@parcha/agentrun-computer";
|
|
1218
1240
|
import { DockerProvider } from "@parcha/agentrun-computer/docker";
|
|
1219
1241
|
|
|
1220
|
-
const docker = new DockerProvider({ daemonPath: "dist/computerd-linux-amd64" });
|
|
1242
|
+
const docker = new DockerProvider({ daemonPath: "dist/computerd-linux-amd64", env: process.env });
|
|
1221
1243
|
// A claim at epoch 3 takes the run over: the computers of epochs 1 and 2 go first.
|
|
1222
1244
|
const older = await releaseOlder(docker, "r1", 3);
|
|
1223
1245
|
if (!older.ok) throw new Error(older.error.message); // fenced, or a computer that could not be released
|
|
@@ -1238,7 +1260,7 @@ vendor's types: the shared adapter's release, a create that deletes its machine,
|
|
|
1238
1260
|
## Modal
|
|
1239
1261
|
|
|
1240
1262
|
```ts
|
|
1241
|
-
import { ModalClient } from "modal"; //
|
|
1263
|
+
import { ModalClient } from "modal"; // this package's optional dependency; it imports nothing from the SDK at load
|
|
1242
1264
|
import { ModalProvider } from "@parcha/agentrun-computer/modal";
|
|
1243
1265
|
|
|
1244
1266
|
const modal = new ModalProvider({
|
|
@@ -1378,7 +1400,7 @@ unless they start with `modal_proto/`. Docs: modal.com, read 2026-11-05.
|
|
|
1378
1400
|
provider in `options.app` (required: without it, it refuses in words naming the option, before any client). It reads no
|
|
1379
1401
|
setting from the environment (see [Settings](#settings)) and passes the token to `ModalClient` explicitly, so a
|
|
1380
1402
|
`MODAL_TOKEN_ID` or `MODAL_TOKEN_SECRET` on the host is never used. The key goes only to `options.serverUrl` (https
|
|
1381
|
-
alone), else the SDK's default `https://api.modal.com
|
|
1403
|
+
alone), else the SDK's default `https://api.modal.com`: since the client cannot take a server, it refuses while `MODAL_SERVER_URL`
|
|
1382
1404
|
is set, and sets it to its choice only while it constructs the client, one construction at a time and put back after
|
|
1383
1405
|
each, so neither `MODAL_PROFILE` nor a profile in `MODAL_CONFIG_PATH` or `~/.modal.toml` can redirect the key. The
|
|
1384
1406
|
daemon is uploaded from `options.daemonPath`, else `dist/computerd-linux-amd64`, so a run publishes nothing.
|
|
@@ -1395,12 +1417,15 @@ declares no stop), and the Full `provider.janitor` case is skipped (`lifetime:ja
|
|
|
1395
1417
|
A live run is wrapped in the one sweep, with the same settings (it needs no live switch, since it makes nothing):
|
|
1396
1418
|
|
|
1397
1419
|
```sh
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1420
|
+
before="$(mktemp -d)/before.json" # each run its own: --before refuses a file that is already there
|
|
1421
|
+
node packages/computer/dist/conformance/sweep.js --provider modal --before "$before"
|
|
1422
|
+
AGENTRUN_COMPUTER_LIVE_MODAL=1 npm run conformance -w @parcha/agentrun-computer -- --provider modal --run "$(node -p 'require(process.argv[1]).run' "$before")"
|
|
1423
|
+
node packages/computer/dist/conformance/sweep.js --provider modal --after "$before"
|
|
1401
1424
|
```
|
|
1402
1425
|
|
|
1403
|
-
|
|
1426
|
+
`--after` deletes only the computers of the run the before file minted, the one `--run` names ([PROVIDERS.md](PROVIDERS.md),
|
|
1427
|
+
"The live sweep"). `npm run test:modal` runs the suite under its own run id, so it is no run this sweep wraps: its
|
|
1428
|
+
runner and its after hook delete what it made. Its output is `{"swept":n,"gone":m,"stillThere":[ids],"leftAlone":k}`, as for every provider on the adapter. The before
|
|
1404
1429
|
file records where it listed, the app and the server (`sweepScope`), and `--after` refuses, exit 2, before it lists
|
|
1405
1430
|
anything, a file of another app or server, or one that names none: every computer there would read as new.
|
|
1406
1431
|
|
|
@@ -1688,11 +1713,14 @@ The live sweep is the shared one, `dist/conformance/sweep.js --provider daytona
|
|
|
1688
1713
|
`COMPUTER_DAYTONA_API_URL` through the conformance module's `createHost`, with no live switch:
|
|
1689
1714
|
|
|
1690
1715
|
```sh
|
|
1691
|
-
|
|
1692
|
-
node packages/computer/dist/conformance/sweep.js --provider daytona --
|
|
1716
|
+
before="$(mktemp -d)/before.json" # each run its own: --before refuses a file that is already there
|
|
1717
|
+
node packages/computer/dist/conformance/sweep.js --provider daytona --before "$before" # before the run
|
|
1718
|
+
npm run conformance -w @parcha/agentrun-computer -- --provider daytona --run "$(node -p 'require(process.argv[1]).run' "$before")"
|
|
1719
|
+
node packages/computer/dist/conformance/sweep.js --provider daytona --after "$before" # after it
|
|
1693
1720
|
```
|
|
1694
1721
|
|
|
1695
|
-
|
|
1722
|
+
`--after` deletes only the computers of the run `--run` names, the id `--before` minted, so another run on the same
|
|
1723
|
+
account keeps its computers. It prints `{"swept":n,"gone":m,"stillThere":[ids],"leftAlone":k}` (`gone` was `notFound`). A conformance run of
|
|
1696
1724
|
Daytona also sweeps its own label through the host at its end (the report's `cleanup.sweep`).
|
|
1697
1725
|
|
|
1698
1726
|
### Daytona on dial
|
|
@@ -1711,9 +1739,13 @@ launch line E2B's dial runs (`dialLaunch`), with no rootOnly paths here. The URL
|
|
|
1711
1739
|
env, which the command inherits, and is on no command line. A session Daytona refuses fails create in its words, and
|
|
1712
1740
|
the sandbox is deleted. So the snapshot's entrypoint is not relied on: a box snapshot registered without one (name,
|
|
1713
1741
|
image and resources alone) dials too, and one whose entrypoint is the box CMD sleeps, with no `AGENTRUN_ATTACH_URL` in
|
|
1714
|
-
its env, so `agentrun-dial` never runs twice
|
|
1715
|
-
|
|
1716
|
-
|
|
1742
|
+
its env, so `agentrun-dial` never runs twice on its own. While create waits for the socket, it reads that command's
|
|
1743
|
+
exit (`dialExit`, the session's command of the id its start returned): an `agentrun-dial` that exited fails create at
|
|
1744
|
+
once, and an exit of 3 (its daemon fetch failed, after its own retries) or 5 (its init never listened, and was ended)
|
|
1745
|
+
starts it once more, by the same line, in a session of its own, `agentrun-dial-2` (`redial`), with a create note. One
|
|
1746
|
+
that runs and keeps writing is waited for past `createMs`, up to twice it. A machine that does not dial fails with that
|
|
1747
|
+
command's log first, its last 10 lines within 800 characters (`dialLog`; the adapter replaces every machine token in it
|
|
1748
|
+
by `<token>`), or "agentrun-dial never started" when create started none. No Archil mount, no GPU, and not `image: "default"` (Daytona's default snapshot holds
|
|
1717
1749
|
no `agentrun-dial`): `check()` refuses each in words. Labels as on exec. A dial sandbox may be a desktop
|
|
1718
1750
|
(`kind: "desktop"`): the box snapshot's X server, started over the socket it dialed, and xfwm4, which computerd starts
|
|
1719
1751
|
(init's `--window-manager`), at the snapshot's 2 CPUs and 4 GiB, with no GPU. On exec a Daytona computer is kind
|
|
@@ -1768,7 +1800,9 @@ What each part of a dial sandbox rests on:
|
|
|
1768
1800
|
`attachEgress` (`DAYTONA_ATTACH_EGRESS` in Settings), `<IPv4 relay>:<port>`, checked at construction: create puts it
|
|
1769
1801
|
in the boot env as `AGENTRUN_ATTACH_EGRESS`, and `agentrun-dial`'s daemon fetch (curl `--connect-to`) and
|
|
1770
1802
|
`computerd attach` both open TCP to it and speak TLS and HTTP to the public host through it, so the SNI, the
|
|
1771
|
-
certificate checked and `Host` stay the public host's and TLS is end to end. Unset, nothing changes.
|
|
1803
|
+
certificate checked and `Host` stay the public host's and TLS is end to end. Unset, nothing changes. A relay that
|
|
1804
|
+
closes a connection during TLS (curl exit 35) or resets it (56) costs a retry: the fetch is tried again after 1, 2, 4
|
|
1805
|
+
then 8 s, for at most 45 s, on any failed connection or HTTP 5xx, and never on a 4xx (exit 7).
|
|
1772
1806
|
- **No GPU on dial**, refused in words: `daytona-gpu` holds no `agentrun-dial`, and Daytona runs a GPU sandbox
|
|
1773
1807
|
unprivileged (`Privileged: gpuIndex == nil`,
|
|
1774
1808
|
[runner container_configs.go:205](https://github.com/daytonaio/daytona/blob/b5a5d9e7/apps/runner/pkg/docker/container_configs.go#L205)),
|
|
@@ -1871,7 +1905,7 @@ repository's main; the docs were read on 2026-11-05.
|
|
|
1871
1905
|
```ts
|
|
1872
1906
|
import { providerFor } from "@parcha/agentrun-computer";
|
|
1873
1907
|
|
|
1874
|
-
// The key is the caller's to pass (serve's E2B_API_KEY)
|
|
1908
|
+
// The key is the caller's to pass (serve's E2B_API_KEY); the e2b package (2.63.0) is an optional dependency.
|
|
1875
1909
|
const e2b = await providerFor("e2b", { apiKey });
|
|
1876
1910
|
const made = await e2b.create({ image: "desktop", lifetimeMs: 600_000, network: "none" }, { requestId: "r1#3" });
|
|
1877
1911
|
```
|
|
@@ -1892,8 +1926,10 @@ and its X11 shim drives it. With `kind: "linux"` it is kind `linux` on any templ
|
|
|
1892
1926
|
provider, minus the X server, so it costs nothing to offer. A caller that names a template (`create({ image })`) gets
|
|
1893
1927
|
that one: E2B Desktop's own, `desktop`, still works for kind `desktop`, since computerd needs only Xvfb and xfwm4 from
|
|
1894
1928
|
it. Every call goes through the host's E2B JS SDK, the `e2b` package's `Sandbox` class, whose types `src/e2b.ts` imports
|
|
1895
|
-
as types only (held as `typeof Sandbox` inside, `object` in the published types), so nothing loads from it at import
|
|
1896
|
-
|
|
1929
|
+
as types only (held as `typeof Sandbox` inside, `object` in the published types), so nothing loads from it at import. The
|
|
1930
|
+
package is one of this package's `optionalDependencies`, pinned exactly, as Modal's, boxd's, ssh2 and Archil's `disk`
|
|
1931
|
+
are: a plain `npm install` brings it, and after `npm install --omit=optional` `create` refuses with `E2B needs the e2b
|
|
1932
|
+
package: npm install e2b@2.63.0`. `@e2b/desktop` is not used: it starts Xvfb and Xfce with `commands.run`, outside computerd's process table
|
|
1897
1933
|
and with no bound or abort (`@e2b/desktop@2.5.0` `dist/index.mjs:387-415`), and the provider needs none of its other
|
|
1898
1934
|
calls.
|
|
1899
1935
|
|
|
@@ -2158,8 +2194,9 @@ A live run must show:
|
|
|
2158
2194
|
```ts
|
|
2159
2195
|
import { providerFor } from "@parcha/agentrun-computer";
|
|
2160
2196
|
|
|
2161
|
-
//
|
|
2162
|
-
|
|
2197
|
+
// The API key is the caller's to pass (serve's AGENT37_API_KEY); the SSH key is the provider's own unless the caller
|
|
2198
|
+
// gives one (sshKey, serve's AGENT37_SSH_KEY). ssh2 (1.17.0) is an optional dependency.
|
|
2199
|
+
const agent37 = await providerFor("agent37", { apiKey, secrets });
|
|
2163
2200
|
const made = await agent37.create({ image: "agent37-base", lifetimeMs: 600_000, network: "none" }, { requestId: "r1#3" });
|
|
2164
2201
|
```
|
|
2165
2202
|
|
|
@@ -2171,16 +2208,54 @@ kind `linux`, on type `vm` (a VM with its own kernel, the default) or `default`
|
|
|
2171
2208
|
`kind: "desktop"` it is a Linux desktop on `agentrun-box-<recipe hash>`, our public box image registered as a template
|
|
2172
2209
|
of the key's workspace on its first run ([below](#the-desktop-agentrun-box)).
|
|
2173
2210
|
|
|
2174
|
-
###
|
|
2175
|
-
|
|
2176
|
-
`create(options)` takes the workspace's API key as `options.apiKey
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2211
|
+
### The API key, and the SSH key
|
|
2212
|
+
|
|
2213
|
+
`create(options)` takes the workspace's API key as `options.apiKey`, the one key it needs: the provider reads no file
|
|
2214
|
+
and no environment. REST takes it as `Authorization: Bearer <key>`; the SSH tunnel's edge takes the same key in
|
|
2215
|
+
`X-Agent37-Key` (npm `agent37@0.4.1` `src/cli.js`, `wsHandshake` and `runTunnel`).
|
|
2216
|
+
|
|
2217
|
+
Every command then logs in to the instance's sshd with an SSH key registered on the workspace. By default it is the
|
|
2218
|
+
provider's own:
|
|
2219
|
+
|
|
2220
|
+
- On first use (the first `create` or exec, never at construction) the provider reads `ssh_key` from `options.secrets`,
|
|
2221
|
+
the store it is given (`get(name)` and `putIfAbsent(name, value)`, `ProviderSecrets`; its descriptor declares the
|
|
2222
|
+
option as `secrets`). With none there, it makes an Ed25519 key with `node:crypto` and hands its private half (PKCS#8
|
|
2223
|
+
PEM) to `putIfAbsent`, which keeps it only where no key is and answers the one kept. Of first uses racing on one
|
|
2224
|
+
store, in one process or in several, every one takes the key the store kept, and only that key is registered. In one
|
|
2225
|
+
process, every provider on the same store shares one making of the key and one registration of it on a workspace.
|
|
2226
|
+
Serve's store is the server's sealed one: the row `computer.agent37.ssh_key` in `sealed_keys`, sealed under
|
|
2227
|
+
`AGENTRUN_SEAL_KEY` (AES-256-GCM, as every saved key) and written only where no row is (`ON CONFLICT DO NOTHING`), one
|
|
2228
|
+
key per server store. Given no store (the conformance module, a caller of the package alone), the key lives in the
|
|
2229
|
+
process's memory, one shared by its providers until it exits.
|
|
2230
|
+
- So a server with no seal key (`AGENTRUN_SEAL_KEY` unset) makes and registers a new key each time it restarts. The
|
|
2231
|
+
old one stays on the workspace and counts toward its 20 keys until someone deletes it.
|
|
2232
|
+
- It registers the public half before its first instance, so the instance has it from boot: `GET /v1/ssh-keys` (which
|
|
2233
|
+
echoes no key) matched by fingerprint (`SHA256:`, as `ssh-keygen -l` prints it), else `POST /v1/ssh-keys` with the
|
|
2234
|
+
OpenSSH line and the name `agentrun-<first 12 hex of the key's SHA-256>`. A 409 `ssh_key_exists` is a registration
|
|
2235
|
+
another made, and taken as done. The registration is listed once per store and workspace in a process; the key is
|
|
2236
|
+
reused for every instance.
|
|
2237
|
+
- Agent37 takes at most 20 keys a workspace, and the 21st POST answers 400 `invalid_request`. A workspace at 20 is
|
|
2238
|
+
refused before any instance, code `limit`, in words that name the cap, the `agentrun-…` keys AgentRun registered
|
|
2239
|
+
(`DELETE /v1/ssh-keys/{id}`) and `AGENT37_SSH_KEY`. No key is deleted. A 400 to the POST is read as the cap only when
|
|
2240
|
+
its words say so or the workspace holds 20 keys when listed again; any other is code `vendor`, in Agent37's words.
|
|
2241
|
+
- Agent37 hands a new key to instances already running within about two minutes (docs: agents-api/ssh). A login an
|
|
2242
|
+
sshd refuses within three minutes of the key's registration is tried again every 2 s within the call's own bound; past
|
|
2243
|
+
them, it is `denied`, in words naming the instance, the key's fingerprint and its registration time, and the next call
|
|
2244
|
+
lists the workspace's keys again.
|
|
2245
|
+
- The registration is a note (`onNote`) naming the key by its fingerprint and name. The private half is in no call, note,
|
|
2246
|
+
error, label or log.
|
|
2247
|
+
|
|
2248
|
+
`options.sshKey` (serve's optional `AGENT37_SSH_KEY`) overrides it: the private half of a key already registered on the
|
|
2249
|
+
workspace (`POST /v1/ssh-keys`, or `agent37 ssh-keys add`), its contents, never a path. It is used as given, and nothing
|
|
2250
|
+
is made, stored or registered. A key pasted into Settings comes back on one line (a password field drops line breaks),
|
|
2251
|
+
so the provider wraps a one-line key's body again before ssh2 reads it. A PKCS#8 key (PEM label `PRIVATE KEY`), which
|
|
2252
|
+
ssh2 does not read, is converted first: RSA to PKCS#1, EC to SEC1, Ed25519 to OpenSSH's format. Neither key appears in
|
|
2253
|
+
an error, a note or a label: the sweep's scope names the API key by its sha256 prefix alone.
|
|
2254
|
+
|
|
2255
|
+
What this leaves: a key a server made stays registered after that server's store is gone (its seal key changed, or its
|
|
2256
|
+
store deleted), one more of the workspace's 20, and the next key is made afresh; so does each conformance process's.
|
|
2257
|
+
Two servers on one store that both make the first key at once can register two; the store keeps one, and the other
|
|
2258
|
+
stays on the workspace unused.
|
|
2184
2259
|
|
|
2185
2260
|
### The mapping
|
|
2186
2261
|
|
|
@@ -2246,12 +2321,13 @@ read back.
|
|
|
2246
2321
|
### Conformance on Agent37
|
|
2247
2322
|
|
|
2248
2323
|
```sh
|
|
2249
|
-
AGENTRUN_COMPUTER_LIVE_AGENT37=1 COMPUTER_AGENT37_API_KEY=...
|
|
2324
|
+
AGENTRUN_COMPUTER_LIVE_AGENT37=1 COMPUTER_AGENT37_API_KEY=... \
|
|
2250
2325
|
npm run conformance -w @parcha/agentrun-computer -- --provider agent37
|
|
2251
2326
|
```
|
|
2252
2327
|
|
|
2253
2328
|
The conformance module, `dist/conformance/agent37.js`, checks `AGENTRUN_COMPUTER_LIVE_AGENT37=1` first, then reads
|
|
2254
|
-
`COMPUTER_AGENT37_API_KEY` (`apiKey`, required), `COMPUTER_AGENT37_SSH_KEY` (`sshKey`,
|
|
2329
|
+
`COMPUTER_AGENT37_API_KEY` (`apiKey`, required), `COMPUTER_AGENT37_SSH_KEY` (`sshKey`, optional, the contents of a key
|
|
2330
|
+
already on the workspace; unset, the run makes its own for its process and registers it, and it stays on the workspace),
|
|
2255
2331
|
`COMPUTER_AGENT37_KIND` (`linux`, the default, or `desktop`), `COMPUTER_AGENT37_TEMPLATE` (the run's image, default
|
|
2256
2332
|
`agent37-base`, or for kind `desktop` the box template `prepareImage()` registers), `COMPUTER_AGENT37_TYPE`, `COMPUTER_AGENT37_REGION`,
|
|
2257
2333
|
`COMPUTER_AGENT37_API_URL`, `COMPUTER_AGENT37_DAEMON` (`daemonPath`), `COMPUTER_AGENT37_MAX_LIFETIME_MS` and
|
|
@@ -2312,7 +2388,7 @@ the live runs above.
|
|
|
2312
2388
|
```ts
|
|
2313
2389
|
import { providerFor } from "@parcha/agentrun-computer";
|
|
2314
2390
|
|
|
2315
|
-
// The key is the caller's to pass (serve's MORPH_API_KEY)
|
|
2391
|
+
// The key is the caller's to pass (serve's MORPH_API_KEY); ssh2 is an optional dependency.
|
|
2316
2392
|
const morph = await providerFor("morph", { apiKey });
|
|
2317
2393
|
const box = await morph.prepareImage(); // the box image as a snapshot in the key's account
|
|
2318
2394
|
const made = await morph.create({ image: box.value, lifetimeMs: 600_000, network: "none" }, { requestId: "r1#3" });
|
|
@@ -2389,6 +2465,18 @@ the protocol's methods in process over Orgo's REST API, as the phone harness and
|
|
|
2389
2465
|
`"windows"` (`ORGO_WINDOWS_IMAGE`, Orgo's Windows Server 2019) or `"macos"` (`ORGO_MACOS_IMAGE`): the one the provider was
|
|
2390
2466
|
built for.
|
|
2391
2467
|
|
|
2468
|
+
The Linux desktop makes one computer per request id. Its Orgo name begins with the request's name,
|
|
2469
|
+
`computer-<12 hex of sha256(requestId)>`, then the run's hash, the epoch and the deadline (`src/orgo-names.ts`). Before
|
|
2470
|
+
it makes a computer it lists the workspace's computers and takes the oldest whose name begins with the request's: one
|
|
2471
|
+
that runs with the same labels, image and sizes (its labels file) is answered, one of another spec or no longer
|
|
2472
|
+
running is refused `exists`, and one still being made is waited for. Two processes whose creates of one request
|
|
2473
|
+
both find nothing make two computers, so after Orgo's answer, and again once its computer is up, a create reads the
|
|
2474
|
+
workspace once more: where an older computer of the request is there (by `created_at`, then id), it deletes its own
|
|
2475
|
+
and answers the older, and the oldest keeps its own. A caller's signal that aborts one of those reads deletes the
|
|
2476
|
+
create's own computer (not under that signal) and the create is `aborted`. A name Orgo already holds (two creates in the same second) is
|
|
2477
|
+
answered the same way. The parked desktops name each computer at random, so a create retried there makes a second
|
|
2478
|
+
computer.
|
|
2479
|
+
|
|
2392
2480
|
- **What each offers.** The protocol groups, by Orgo's calls:
|
|
2393
2481
|
- `screen`: Orgo's screenshot (`response_format=base64&format=png`). A region is cropped in process. The live view
|
|
2394
2482
|
polls it about once a second, scaled by Orgo past `maxWidth`.
|
|
@@ -2519,7 +2607,7 @@ kind browser that declares them.
|
|
|
2519
2607
|
|
|
2520
2608
|
| | Browserbase | Kernel | Local Chrome |
|
|
2521
2609
|
| --- | --- | --- | --- |
|
|
2522
|
-
| `capabilities().browser` | wall-clock, `stealth`, `profiles` (settle
|
|
2610
|
+
| `capabilities().browser` | wall-clock, `stealth`, `profiles` (settle 10 s, its descriptor's `profiles`), `downloads` (`downloads/`) | inactivity, `headless`, `profiles` (settle 0) | wall-clock |
|
|
2523
2611
|
| `viewport` | `browserSettings.viewport` | `viewport` | the window's size |
|
|
2524
2612
|
| `stealth` | `browserSettings.verified` and `solveCaptchas` (the solver is off otherwise: Browserbase's default is on) | not declared (Kernel's stealth brings a proxy nothing prices yet) | not declared |
|
|
2525
2613
|
| `profile` | a context: `browserSettings.context { id, persist }` | a profile by name: `profile { name, save_changes }`, made first if Kernel does not know it | not declared |
|
|
@@ -2539,11 +2627,26 @@ call and the HTTP status alone, never the vendor's words. The calls are the prov
|
|
|
2539
2627
|
its own `fetch`). A thrown error rides the failure as a hidden cause (`causeOf(result)`), not enumerable, so it is in no
|
|
2540
2628
|
JSON.
|
|
2541
2629
|
|
|
2542
|
-
Each create writes one more label beside the spec's, `agentrun.create` (`CREATE_LABEL`),
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2630
|
+
Each create writes one more label beside the spec's, `agentrun.create` (`CREATE_LABEL`), whose value is the request's
|
|
2631
|
+
name, `computer-<12 hex of sha256(requestId)>`. Before it makes a browser, create lists the running and starting
|
|
2632
|
+
browsers with that label: one with the spec's labels is answered, so a retried create, in this process or another,
|
|
2633
|
+
makes no second browser, and one with other labels is refused `exists`; where it finds several, it takes the oldest (by
|
|
2634
|
+
the time the vendor made each, then id). Two processes whose creates of one request both find nothing make two
|
|
2635
|
+
browsers, so after the vendor's answer a create lists the label again: where an older browser of the request is
|
|
2636
|
+
there, it releases its own and answers the older, refused `exists` when the older has ended by then, and the oldest
|
|
2637
|
+
keeps its own. A caller's signal that aborts that listing releases the create's own browser (not under that signal)
|
|
2638
|
+
and the create is `aborted`. The browser's own options (viewport, stealth, profile) are not read back from the vendor, so a create
|
|
2639
|
+
from another process compares the labels alone. A browser released here, or one this provider answered that the vendor
|
|
2640
|
+
has ended on its own (its timeout), leaves its request refused `exists`: the provider keeps each request's browser id. A create whose outcome is unknown (its reply lost, cut short, answered 5xx or with no browser, or the caller's signal
|
|
2641
|
+
aborted it) never sends a second create: each POST also writes `agentrun.attempt` (`ATTEMPT_LABEL`), a random value of
|
|
2642
|
+
its own, and a lost create finds the browsers carrying its attempt label as list does, in every state not ended, under
|
|
2643
|
+
a signal of its own, releases each under it, and its failure says so; that request is then refused `exists`. Every
|
|
2644
|
+
release a create runs for itself (this one, the newer browser's, and the one after an abort) is bounded by the
|
|
2645
|
+
provider's `cleanupMs` option (default `RECOVER_MS`, 30 s), never by the caller's signal: one that does not finish in
|
|
2646
|
+
time fails the create in words that say the browser may still be running, and a retry is answered as above, never
|
|
2647
|
+
stuck behind it. Another create's browser of the same request, even one another process answered, carries another attempt
|
|
2648
|
+
label and is left running. A 4xx refusal made nothing, so nothing is looked for. Both labels are the provider's own:
|
|
2649
|
+
`check()` refuses them in a spec, and no list or attach shows them.
|
|
2547
2650
|
|
|
2548
2651
|
The conformance CLI runs the browser case set for a provider of kind browser: the health cases, then `browser.*`
|
|
2549
2652
|
(check past the cap, attach by id and by labels, list, CDP `Browser.getVersion` and `Runtime.evaluate` on a `data:`
|
|
@@ -2578,6 +2681,17 @@ removes its profile and every other file of it. `list()` and attach by labels fi
|
|
|
2578
2681
|
`browser.json` in each browser's directory under the root (default `<tmpdir>/agentrun-local-browser-<uid>`, made 0700,
|
|
2579
2682
|
refused when another user can write it). That file holds the labels and the deadline.
|
|
2580
2683
|
|
|
2684
|
+
A browser's id, and its directory's name, is its request's name, `computer-<12 hex of sha256(requestId)>`, and create
|
|
2685
|
+
makes that directory with `mkdir`, which one create alone wins, then writes `claim.json` in it (its process's pid and
|
|
2686
|
+
the time) before `browser.json`. A create that finds the directory there already, in this process or another on the
|
|
2687
|
+
same root, answers that browser once its Chrome answers, when its labels and network are the ones asked; one of another
|
|
2688
|
+
spec, past its deadline or whose supervisor has ended is refused `exists`. A directory with no `browser.json` whose
|
|
2689
|
+
claim names a process that is gone, or that is older than a create takes (the directory's own time where there is no
|
|
2690
|
+
claim), is a create that crashed: refused `exists` at once ("an earlier create of this request did not finish: create
|
|
2691
|
+
with a new request id"), never waited on past a create's time. A browser released
|
|
2692
|
+
here, or one this provider made that ended on its own (its deadline removed its directory), leaves its request refused
|
|
2693
|
+
`exists`.
|
|
2694
|
+
|
|
2581
2695
|
Lifetime: each browser runs under a supervisor of its own (`local-supervisor.ts`), a small detached Node process. It
|
|
2582
2696
|
ends Chrome and removes its files at the deadline, on release, or when Chrome exits, whatever became of the process
|
|
2583
2697
|
that made the browser. So a run that crashes leaves no Chrome behind once its deadline passes. `list()` reads the
|
|
@@ -2586,7 +2700,11 @@ deadline, so the janitor's `sweep` also ends a browser whose supervisor was kill
|
|
|
2586
2700
|
|
|
2587
2701
|
Finding Chrome: the `executablePath` option, else `PI_BROWSER_CHROME` or `CHROME_PATH` in the `env` option, else the
|
|
2588
2702
|
first `google-chrome`, `google-chrome-stable`, `chromium` or `chromium-browser` on that env's `PATH`, else the usual
|
|
2589
|
-
install places. The library reads no environment of its own: the host passes `env`.
|
|
2703
|
+
install places. The library reads no environment of its own: the host passes `env`. Of it, the supervisor and the Chrome
|
|
2704
|
+
it starts, and `testConnection()`'s Chrome, hold the names Chrome reads (`CHROME_ENV_NAMES`: PATH, HOME, TMPDIR, the
|
|
2705
|
+
locale, the display and `XAUTHORITY`, the XDG directories, fontconfig's files, the session bus, `CHROME_DEVEL_SANDBOX`)
|
|
2706
|
+
and nothing else, so no key the host holds reaches Chrome; serve passes its own values of these (the descriptor's
|
|
2707
|
+
`hostEnv`). With none found, `check()`,
|
|
2590
2708
|
`create()` and `testConnection()` say what to install and which setting names one. `testConnection()` starts the Chrome
|
|
2591
2709
|
once, headless on a blank page with a proxy that reaches nothing, to prove it starts here with its sandbox on. It
|
|
2592
2710
|
keeps nothing.
|
|
@@ -2688,8 +2806,10 @@ the API's control URL) is a later change: `platform: "ios"` is refused in words.
|
|
|
2688
2806
|
- **create** asks for `timeout_seconds` = the lifetime, and the phone harness ends the session then, whatever happens.
|
|
2689
2807
|
The lifetime includes the boot, so a phone ready past its deadline fails `timeout`.
|
|
2690
2808
|
- Each POST carries an Idempotency-Key, and a create whose answer is uncertain is found by it, never sent twice.
|
|
2691
|
-
Only a refusal (a 4xx, or `phones_busy`) says nothing was made. No answer, a 5xx, or a 2xx with no
|
|
2692
|
-
uncertain: create asks `GET /sessions/requests/<key>` before it forgets the key, and records the phone it
|
|
2809
|
+
Only a refusal (a 4xx, or `phones_busy`) says nothing was made. No answer, a 5xx, a redirect, or a 2xx with no
|
|
2810
|
+
session is uncertain: create asks `GET /sessions/requests/<key>` before it forgets the key, and records the phone it
|
|
2811
|
+
finds. A redirect is never followed: the API's calls go through the shared REST client (`hosted/rest.ts`), which
|
|
2812
|
+
refuses it in its own words. Its answer is unread, and a 303 after a create is the usual answer to a POST.
|
|
2693
2813
|
- A create cancelled during its POST is recovered by its key all the same, and the phone the service made is ended.
|
|
2694
2814
|
- A phone that fails, or is not ready within `readyMs` (240 s), is ended.
|
|
2695
2815
|
- Each request has a bound of its own, `requestMs` (30 s), beside the caller's signal, and a readiness read takes no
|
|
@@ -2720,11 +2840,13 @@ the API's control URL) is a later change: `platform: "ios"` is refused in words.
|
|
|
2720
2840
|
the `adb` CLI (Android platform-tools; default `adb` on PATH, which the phone's descriptor names as its
|
|
2721
2841
|
`hostCommand`, so a server says it is missing before any phone is rented), whose server it starts and speaks to on
|
|
2722
2842
|
the loopback (port 5037, adb's own, or `adbCli(path, { port })`). Every spawned adb names that port with `-P`, so the CLI and the
|
|
2723
|
-
socket requests reach one server. `adbCli(path, { env })` spawns adb
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
`
|
|
2727
|
-
|
|
2843
|
+
socket requests reach one server. `adbCli(path, { env })` spawns adb with only the names in `ADB_ENV_NAMES`
|
|
2844
|
+
taken from the environment given (`adbEnv(env)`): the base names (`PATH`, `HOME`, `TMPDIR`, locale) and the SDK's
|
|
2845
|
+
`ANDROID_HOME`, `ANDROID_SDK_ROOT`, `ANDROID_USER_HOME`, `ANDROID_SDK_HOME`. Nothing else reaches adb or the server it
|
|
2846
|
+
starts: no `ADB_*`, `ANDROID_ADB_*` or `ANDROID_SERIAL` that would point it at another server or device, no proxy, no
|
|
2847
|
+
key. The library reads no environment of its own, so a caller must pass `env`: the conformance module passes its own,
|
|
2848
|
+
and serve passes the phone's `hostEnv`. Without `env`, adb starts with no environment at all, and a bare `adb` is
|
|
2849
|
+
found only on the default path (`/usr/bin:/bin`): pass `env`, or give adb's absolute path. Without adb, connect says so in words.
|
|
2728
2850
|
- **testConnection** is list(): one `GET /sessions` joined to the ledger, and a GET of any phone the listing leaves out.
|
|
2729
2851
|
It rents nothing and reaches no phone: ok with the
|
|
2730
2852
|
count of this provider's phones, `unauthorized` for a refused key, `unreachable` when the phone harness is not
|
|
@@ -2758,7 +2880,7 @@ through `ui.observe` (`src/conformance/cases/settings.ts`):
|
|
|
2758
2880
|
```ts
|
|
2759
2881
|
import { providerFor } from "@parcha/agentrun-computer";
|
|
2760
2882
|
|
|
2761
|
-
// The key is the caller's to pass (serve's BOXD_API_KEY)
|
|
2883
|
+
// The key is the caller's to pass (serve's BOXD_API_KEY); the @boxd-sh/sdk package (0.3.1) is an optional dependency.
|
|
2762
2884
|
const boxd = await providerFor("boxd", { apiKey, org: "my-org", region: "fra" });
|
|
2763
2885
|
const made = await boxd.create({ image: "default", lifetimeMs: 600_000, network: "none" }, { requestId: "r1#3" });
|
|
2764
2886
|
```
|
|
@@ -2771,19 +2893,21 @@ to a machine, and `src/hosted/provider.ts` does everything that is not boxd's ow
|
|
|
2771
2893
|
create, the upload, the install, init's start, the stdio bridge, the probe, the janitor's extend, delete-then-wait-gone,
|
|
2772
2894
|
the sweep of a create that lands late). Every call goes through the host's boxd TypeScript SDK, the `@boxd-sh/sdk`
|
|
2773
2895
|
package's `Boxd` class, of which `src/boxd.ts` names only the slice it calls and imports nothing at load. The package is
|
|
2774
|
-
|
|
2896
|
+
an optional dependency, pinned exactly, as E2B's and Modal's are.
|
|
2775
2897
|
|
|
2776
2898
|
### The desktop snapshot
|
|
2777
2899
|
|
|
2778
|
-
boxd's own image (`"default"`) has Xvfb
|
|
2779
|
-
|
|
2900
|
+
boxd's own image (`"default"`) has Xvfb, xdotool and Thunar but not Xfce's text editor and terminal or a browser, so
|
|
2901
|
+
a boxd desktop starts from a snapshot that adds them. `prepareImage()` answers it by name,
|
|
2780
2902
|
`agentrun-desktop-<12 hex>`, the hash of the recipe in `src/boxd.ts`, so a new recipe is a new snapshot. When the
|
|
2781
2903
|
key's org has none, it builds it once, telling `onWait` "build" first:
|
|
2782
2904
|
|
|
2783
2905
|
1. `machines.create` of an isolated machine of boxd's own image, named `agentrun-desktop-build-<8 hex>`, with no labels
|
|
2784
2906
|
(a restore carries a snapshot's labels over to every machine made from it) and boxd's delete timer at 2 hours;
|
|
2785
|
-
2. the recipe as root through the image user's passwordless sudo: `
|
|
2786
|
-
`
|
|
2907
|
+
2. the recipe as root through the image user's passwordless sudo: `mousepad` and `xfce4-terminal` from Ubuntu's
|
|
2908
|
+
universe, and `firefox-esr` from Mozilla's APT repository (Ubuntu 24.04's `firefox` is a snap, and a microVM runs no
|
|
2909
|
+
snapd), its signing key held to a pinned sha256 before apt reads anything it signs; each program and its desktop
|
|
2910
|
+
file (`org.xfce.mousepad`, `xfce4-terminal`, `firefox-esr`) checked;
|
|
2787
2911
|
3. `snapshots.create` under the name, read until boxd says `ready`;
|
|
2788
2912
|
4. the build machine deleted and read gone, pass, fail or cancel: the id create answered, read through `get` (a
|
|
2789
2913
|
lagging list can't hide it), and any machine of its name in the org's list, so a create whose reply was lost is
|
|
@@ -2865,9 +2989,12 @@ alone (see [Init, the socket and the bridge](#init-the-socket-and-the-bridge)):
|
|
|
2865
2989
|
### Conformance on boxd
|
|
2866
2990
|
|
|
2867
2991
|
```sh
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
node packages/computer/dist/conformance/sweep.js --provider boxd --before
|
|
2992
|
+
export COMPUTER_BOXD_API_KEY=...
|
|
2993
|
+
before="$(mktemp -d)/before.json" # each run its own: --before refuses a file that is already there
|
|
2994
|
+
node packages/computer/dist/conformance/sweep.js --provider boxd --before "$before"
|
|
2995
|
+
AGENTRUN_COMPUTER_LIVE_BOXD=1 npm run conformance -w @parcha/agentrun-computer -- --provider boxd --run "$(node -p 'require(process.argv[1]).run' "$before")"
|
|
2996
|
+
node packages/computer/dist/conformance/sweep.js --provider boxd --after "$before"
|
|
2997
|
+
AGENTRUN_COMPUTER_LIVE_BOXD=1 npm run test:boxd -w @parcha/agentrun-computer # its own run id: it deletes what it made
|
|
2871
2998
|
```
|
|
2872
2999
|
|
|
2873
3000
|
The conformance module, `dist/conformance/boxd.js`, checks `AGENTRUN_COMPUTER_LIVE_BOXD=1` before it reads anything
|
|
@@ -2934,9 +3061,12 @@ What smol cloud refuses or this host works around:
|
|
|
2934
3061
|
### Conformance on smol cloud
|
|
2935
3062
|
|
|
2936
3063
|
```sh
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
node packages/computer/dist/conformance/sweep.js --provider smolcloud --before
|
|
3064
|
+
export COMPUTER_SMOLCLOUD_API_KEY=...
|
|
3065
|
+
before="$(mktemp -d)/before.json" # each run its own: --before refuses a file that is already there
|
|
3066
|
+
node packages/computer/dist/conformance/sweep.js --provider smolcloud --before "$before"
|
|
3067
|
+
AGENTRUN_COMPUTER_LIVE_SMOLCLOUD=1 npm run conformance -w @parcha/agentrun-computer -- --provider smolcloud --long --concurrency 4 \
|
|
3068
|
+
--run "$(node -p 'require(process.argv[1]).run' "$before")"
|
|
3069
|
+
node packages/computer/dist/conformance/sweep.js --provider smolcloud --after "$before"
|
|
2940
3070
|
```
|
|
2941
3071
|
|
|
2942
3072
|
The conformance module, `dist/conformance/smolcloud.js`, checks `AGENTRUN_COMPUTER_LIVE_SMOLCLOUD=1` first, then reads
|
|
@@ -3017,8 +3147,8 @@ What Groundbox refuses or this host works around:
|
|
|
3017
3147
|
templates it runs as the image's user, `runner` (uid 1001), with passwordless sudo, which the adapter's scripts use;
|
|
3018
3148
|
`daemonUser` may not be 1001 there.
|
|
3019
3149
|
- A desktop needs Xvfb and xfwm4 in its image. Groundbox's own image has Xvfb but not xfwm4, so `check()` refuses
|
|
3020
|
-
`"default"` for kind desktop; the box image has both, and Xfce's terminal
|
|
3021
|
-
its apps.
|
|
3150
|
+
`"default"` for kind desktop; the box image has both, and Xfce's terminal, text editor and file manager (Thunar),
|
|
3151
|
+
Firefox ESR and xdotool as its apps.
|
|
3022
3152
|
- Groundbox's own image keeps toolchains under `/opt` (corepack's pnpm under
|
|
3023
3153
|
`/opt/corepack/v1/pnpm/<version>/dist/node_modules/...`, and `/opt/hostedtoolcache`), deeper than the isolation probe's
|
|
3024
3154
|
8 levels, so `isolation.vendor-agent` can't prove the socket fence on it. That is why the box image is the default.
|
|
@@ -3035,13 +3165,20 @@ What Groundbox refuses or this host works around:
|
|
|
3035
3165
|
### Conformance on Groundbox
|
|
3036
3166
|
|
|
3037
3167
|
```sh
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3168
|
+
export COMPUTER_GROUNDBOX_API_KEY=...
|
|
3169
|
+
before="$(mktemp -d)/before.json" # each run its own: --before refuses a file that is already there
|
|
3170
|
+
node packages/computer/dist/conformance/sweep.js --provider groundbox --before "$before"
|
|
3171
|
+
run="$(node -p 'require(process.argv[1]).run' "$before")"
|
|
3172
|
+
AGENTRUN_COMPUTER_LIVE_GROUNDBOX=1 \
|
|
3173
|
+
npm run conformance -w @parcha/agentrun-computer -- --provider groundbox --long --run "$run"
|
|
3174
|
+
AGENTRUN_COMPUTER_LIVE_GROUNDBOX=1 COMPUTER_GROUNDBOX_KIND=desktop \
|
|
3175
|
+
npm run conformance -w @parcha/agentrun-computer -- --provider groundbox --kind desktop --long --fixture <computerd-fixture for linux/amd64> --run "$run"
|
|
3176
|
+
node packages/computer/dist/conformance/sweep.js --provider groundbox --after "$before"
|
|
3043
3177
|
```
|
|
3044
3178
|
|
|
3179
|
+
Both runs share the before file's `--run`, at once or one after the other: each run's own end-of-run sweep deletes only
|
|
3180
|
+
its own computers ([PROVIDERS.md](PROVIDERS.md), "The live sweep").
|
|
3181
|
+
|
|
3045
3182
|
The conformance module, `dist/conformance/groundbox.js`, checks `AGENTRUN_COMPUTER_LIVE_GROUNDBOX=1` first, then reads
|
|
3046
3183
|
`COMPUTER_GROUNDBOX_API_KEY` (`apiKey`, required), `COMPUTER_GROUNDBOX_API_URL` (`apiUrl`), `COMPUTER_GROUNDBOX_IMAGE`
|
|
3047
3184
|
(the run's image, default the box image), `COMPUTER_GROUNDBOX_DAEMON` (`daemonPath`), `COMPUTER_GROUNDBOX_USER`
|
|
@@ -3077,9 +3214,15 @@ A provider for another vendor passes the same suite as Docker's, with one comman
|
|
|
3077
3214
|
|
|
3078
3215
|
```sh
|
|
3079
3216
|
npm run conformance -w @parcha/agentrun-computer -- --provider docker # or modal, daytona: any registry id
|
|
3080
|
-
npm run conformance -w @parcha/agentrun-computer -- --provider ./my-provider.js [--image debian:bookworm-slim] [--only exec,files] [--fixture <path>] [--long] [--concurrency <n>] [--json]
|
|
3217
|
+
npm run conformance -w @parcha/agentrun-computer -- --provider ./my-provider.js [--image debian:bookworm-slim] [--only exec,files] [--fixture <path>] [--long] [--concurrency <n>] [--run <id>] [--json]
|
|
3081
3218
|
```
|
|
3082
3219
|
|
|
3220
|
+
`--run <id>` (`run` in `runConformance`'s options) is the run's id, which every computer it makes carries as
|
|
3221
|
+
`agentrun.conformance`: the one the live sweep's `--before` printed, so its `--after` deletes this run's computers and no
|
|
3222
|
+
other's ([PROVIDERS.md](PROVIDERS.md), "The live sweep"). Without it, the run mints a fresh one. Every computer also
|
|
3223
|
+
carries `agentrun.conformance.runner`, an id each run mints for itself, and the run's own end-of-run sweep and list go
|
|
3224
|
+
by both labels, so two processes given one `--run` never delete each other's computers.
|
|
3225
|
+
|
|
3083
3226
|
```text
|
|
3084
3227
|
computer conformance · docker · linux, daemon pid1 · computerd 0.1.0-beta.30 linux/amd64
|
|
3085
3228
|
core health hello ping unknown-method kind-consistent ✓ 5
|
|
@@ -3283,6 +3426,66 @@ computer's `HOME`, which the provider sets, is a directory its user can write, a
|
|
|
3283
3426
|
From code: `runConformance(provider, { image, only?, signal?, drifted?, mountFor?, caseTimeoutMs?, cleanupTimeoutMs?,
|
|
3284
3427
|
fixture?, fetch? })` returns the report, and `formatReport(report)` the text above.
|
|
3285
3428
|
|
|
3429
|
+
### Provider health: time to interactive (`--tti`, `--burst`)
|
|
3430
|
+
|
|
3431
|
+
Whether a provider works today, and how fast, measured through this package's own provider layer. Time to interactive
|
|
3432
|
+
(TTI) is the time from a computer's `create` call to the answer of its first command: `create`, `connect` (computerd's
|
|
3433
|
+
hello) and one `exec.run`, read on the run's clock; the delete comes after and is not timed. `--tti <n>` makes `n`
|
|
3434
|
+
computers one at a time, each deleted before the next; `--burst <n>` makes `n` at once. Either runs alone, or both, the
|
|
3435
|
+
burst after. It runs as cases of the conformance runner (`src/conformance/tti.ts`), so a provider the CLI can make gets
|
|
3436
|
+
it with nothing more: the module's settings and keys by name, its image, the run's label, the deletes, the sweep and
|
|
3437
|
+
the list that shows nothing is left.
|
|
3438
|
+
|
|
3439
|
+
```sh
|
|
3440
|
+
npm run conformance -w @parcha/agentrun-computer -- --provider daytona --tti 100 --burst 100 [--image <image>] [--json]
|
|
3441
|
+
```
|
|
3442
|
+
|
|
3443
|
+
```text
|
|
3444
|
+
computer tti · daytona · linux, daemon pid1 · image default
|
|
3445
|
+
came up: yes
|
|
3446
|
+
serial n 100 · ok 100/100 (100%) · median 512 ms · p95 640 ms · p99 702 ms · score 94.28
|
|
3447
|
+
burst n 100 at once · ok 98/100 (98%) · median 830 ms · p95 1410 ms · p99 1630 ms · score 87.27
|
|
3448
|
+
✗ 2x create failed (limit): ...
|
|
3449
|
+
cleanup ✓ 0 left · 200 deleted
|
|
3450
|
+
computers alive at once: 100 at most
|
|
3451
|
+
tti FAIL: 2 of 200 computers did not come up
|
|
3452
|
+
```
|
|
3453
|
+
|
|
3454
|
+
(The numbers above show the shape, not a measurement.) `came up` is `yes` when any computer ran its first command, else
|
|
3455
|
+
`no` with the first reason one did not. It exits 0 when every computer came up and the run left nothing behind, else 1,
|
|
3456
|
+
and 2 on a usage error; `--tti` and `--burst` take `--image` and `--json` and refuse the suite's flags. `--json` prints
|
|
3457
|
+
`{ provider, providerVersion, kind, daemonMode, image, command, cameUp, why?, serial?, burst?, pass, cleanup, computers,
|
|
3458
|
+
daemons, notes?, providerNotes? }`, each shape `{ n, ok, successRate, ttiMs, stats: { median, p95, p99 }, score, errors:
|
|
3459
|
+
[{ words, count }] }`. From code: `measureTti(provider, { image, iterations, burst, clock?, signal? })`, `formatTti`,
|
|
3460
|
+
`ttiStats` and `ttiScore`.
|
|
3461
|
+
|
|
3462
|
+
The yardstick is ComputeSDK's sandbox benchmark ([computesdk/benchmarks](https://github.com/computesdk/benchmarks), MIT;
|
|
3463
|
+
`benchmarks/sandbox/tti.bench.ts`, `scoring.ts`, `src/util/stats.ts`), and three things are theirs as they wrote them:
|
|
3464
|
+
TTI from create's call to the first command's success, with destroy left out; the statistics, 5% of the times trimmed
|
|
3465
|
+
from each end, the median of the rest, p95 and p99 by nearest rank; and the score, each of median, p95 and p99 as
|
|
3466
|
+
`100 * (1 - ms / 10000)` (0 at 10 s or more), weighted 0.6, 0.25 and 0.15, times the success rate. Their board's runs are
|
|
3467
|
+
100 computers through 100 slots, all launched at once: `--burst 100`. Where this differs:
|
|
3468
|
+
|
|
3469
|
+
- The first command is `echo agentrun` through computerd's `exec.run` (no shell; `cmd.exe /d /c echo agentrun` on
|
|
3470
|
+
Windows), not `node -v`: a run's image need not carry Node.
|
|
3471
|
+
- TTI is through this layer, so it holds what a provider does in `create` beyond the vendor's own call (on most remote
|
|
3472
|
+
providers, putting computerd in the machine and starting it) and `connect`'s hello. It is the time an agent waits
|
|
3473
|
+
here, not the vendor's SDK alone.
|
|
3474
|
+
- Each computer is made as the suite makes them: the run's label, a 30-minute lifetime, network `none` where the kind
|
|
3475
|
+
requires it, and the module's image (`conformanceImage()`, such as Daytona's `default` snapshot or E2B's `desktop`
|
|
3476
|
+
template) unless `--image` names one. ComputeSDK's sandboxes have an open network and each vendor's default image.
|
|
3477
|
+
- One computer has 150 s to come up in all (their bounds: 120 s for create, 30 s for the command), and the clock reads
|
|
3478
|
+
whole milliseconds.
|
|
3479
|
+
- The serial shape is their `sequential` one, retired from their board on 2026-08-11; it is kept here because a provider
|
|
3480
|
+
that fails only under a burst is a different finding from one that fails alone.
|
|
3481
|
+
- A burst's computers are deleted one after another once the burst ends, outside the time; theirs each destroy its own.
|
|
3482
|
+
|
|
3483
|
+
What it cannot drive, and why: a browser (Browserbase, Kernel, local Chrome) runs no command, only CDP, so it is not
|
|
3484
|
+
measured (`came up: no: the provider declares no exec`). A dial host (Cloudflare, Fly, and E2B, Modal or Daytona with
|
|
3485
|
+
`COMPUTER_<ID>_CONNECT=dial`) makes machines that dial a server the internet reaches, so from this CLI every create is
|
|
3486
|
+
refused in words; its Core runs inside `packages/serve/scripts/dial-conformance.mjs`, which has no TTI mode. Archil is a
|
|
3487
|
+
mount here, not a computer provider, so there is no Archil sandbox to time.
|
|
3488
|
+
|
|
3286
3489
|
## Persistent computers: an agent's own
|
|
3287
3490
|
|
|
3288
3491
|
A run's computer belongs to its run: it has a deadline (`lifetimeMs`, required), and the janitor or the vendor ends it
|
|
@@ -3355,7 +3558,8 @@ that, when set, names the image of every computer of the provider, as Daytona's
|
|
|
3355
3558
|
(whether its machines dial the server: `dial` always, as Fly Machines' and Cloudflare's; `either`, as its `connect`
|
|
3356
3559
|
option says, which one of its settings fills, as E2B's, Daytona's and Modal's; absent, never), `local`
|
|
3357
3560
|
(a computer on this host), and
|
|
3358
|
-
`ledger` (the option a provider's ledger fills)
|
|
3561
|
+
`ledger` (the option a provider's ledger fills), and `secrets` (the option a store of the secrets the provider makes for
|
|
3562
|
+
itself fills, `ProviderSecrets`: Agent37's SSH key; serve passes its sealed store). `connectOf(descriptor, options)` answers `dial` or `exec` for a provider
|
|
3359
3563
|
made with those options, without building it; its built host's `facts.connect` is the same answer, and a server reads
|
|
3360
3564
|
it to say where its runs can't take a dial (a runner in a process of its own). `providerFor(id, options)` builds a provider by id from its options and
|
|
3361
3565
|
refuses an id it does not hold, naming the ones it does. The provider file, `src/<vendor>.ts`, exports what a
|