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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/NOTICE +2 -0
  2. package/README.md +321 -308
  3. package/box/build-agent37.mjs +177 -0
  4. package/dist/agent37.d.ts +165 -0
  5. package/dist/agent37.js +759 -0
  6. package/dist/attach.d.ts +146 -0
  7. package/dist/attach.js +469 -0
  8. package/dist/browserbase.d.ts +2 -4
  9. package/dist/browserbase.js +2 -1
  10. package/dist/client.d.ts +33 -1
  11. package/dist/client.js +53 -0
  12. package/dist/computerd-linux-amd64 +0 -0
  13. package/dist/computerd-linux-arm64 +0 -0
  14. package/dist/conformance/agent37.d.ts +96 -0
  15. package/dist/conformance/agent37.js +154 -0
  16. package/dist/conformance/cases/apps.d.ts +5 -0
  17. package/dist/conformance/cases/apps.js +160 -73
  18. package/dist/conformance/cases/health.js +14 -0
  19. package/dist/conformance/cases/index.js +2 -0
  20. package/dist/conformance/cases/provider.js +27 -1
  21. package/dist/conformance/cases/screen.d.ts +3 -0
  22. package/dist/conformance/cases/screen.js +18 -0
  23. package/dist/conformance/cases/settings.d.ts +29 -23
  24. package/dist/conformance/cases/settings.js +76 -58
  25. package/dist/conformance/cases/touch.js +19 -17
  26. package/dist/conformance/cases/ui.d.ts +2 -0
  27. package/dist/conformance/cases/ui.js +475 -0
  28. package/dist/conformance/cli.d.ts +9 -0
  29. package/dist/conformance/cli.js +28 -3
  30. package/dist/conformance/e2b.d.ts +6 -0
  31. package/dist/conformance/e2b.js +9 -2
  32. package/dist/conformance/fixture.d.ts +1 -1
  33. package/dist/conformance/fixture.js +25 -1
  34. package/dist/conformance/modal.d.ts +17 -13
  35. package/dist/conformance/modal.js +18 -9
  36. package/dist/conformance/orgo.d.ts +3 -3
  37. package/dist/conformance/orgo.js +6 -8
  38. package/dist/conformance/phone-harness.d.ts +6 -2
  39. package/dist/conformance/phone-harness.js +21 -4
  40. package/dist/conformance/report.js +1 -1
  41. package/dist/conformance/runner.js +23 -4
  42. package/dist/conformance/sweep.d.ts +50 -0
  43. package/dist/conformance/sweep.js +187 -0
  44. package/dist/conformance/types.d.ts +11 -3
  45. package/dist/conformance/ui-fixture.d.ts +56 -0
  46. package/dist/conformance/ui-fixture.js +43 -0
  47. package/dist/create-requests.d.ts +51 -0
  48. package/dist/create-requests.js +121 -0
  49. package/dist/daytona.d.ts +2 -4
  50. package/dist/daytona.js +3 -2
  51. package/dist/descriptor.d.ts +5 -0
  52. package/dist/descriptor.js +2 -0
  53. package/dist/descriptors/agent37.d.ts +41 -0
  54. package/dist/descriptors/agent37.js +28 -0
  55. package/dist/descriptors/index.d.ts +38 -2
  56. package/dist/descriptors/index.js +4 -2
  57. package/dist/descriptors/orgo.d.ts +2 -1
  58. package/dist/descriptors/orgo.js +3 -2
  59. package/dist/descriptors/phone-harness.d.ts +1 -1
  60. package/dist/descriptors/phone-harness.js +2 -2
  61. package/dist/docker.d.ts +7 -4
  62. package/dist/docker.js +271 -29
  63. package/dist/e2b.d.ts +9 -165
  64. package/dist/e2b.js +282 -1342
  65. package/dist/fake-ui-driver.d.ts +97 -0
  66. package/dist/fake-ui-driver.js +717 -0
  67. package/dist/host.d.ts +182 -0
  68. package/dist/host.js +1 -0
  69. package/dist/hosted/process.d.ts +67 -0
  70. package/dist/hosted/process.js +228 -0
  71. package/dist/hosted/provider.d.ts +146 -0
  72. package/dist/hosted/provider.js +1364 -0
  73. package/dist/hosted/scripts.d.ts +76 -0
  74. package/dist/{child.js → hosted/scripts.js} +93 -12
  75. package/dist/index.d.ts +7 -3
  76. package/dist/index.js +7 -4
  77. package/dist/kernel.d.ts +2 -4
  78. package/dist/kernel.js +2 -1
  79. package/dist/kinds.d.ts +8 -1
  80. package/dist/kinds.js +20 -4
  81. package/dist/local-chrome.d.ts +2 -4
  82. package/dist/local-chrome.js +2 -1
  83. package/dist/modal.d.ts +23 -181
  84. package/dist/modal.js +271 -1244
  85. package/dist/orgo-channel.d.ts +3 -2
  86. package/dist/orgo-channel.js +5 -2
  87. package/dist/orgo-desktop.d.ts +9 -4
  88. package/dist/orgo-desktop.js +33 -13
  89. package/dist/orgo-workspaces.d.ts +47 -0
  90. package/dist/orgo-workspaces.js +94 -0
  91. package/dist/orgo.d.ts +10 -4
  92. package/dist/orgo.js +30 -12
  93. package/dist/phone-harness.d.ts +31 -22
  94. package/dist/phone-harness.js +510 -698
  95. package/dist/png.d.ts +4 -0
  96. package/dist/png.js +27 -0
  97. package/dist/protocol.d.ts +335 -32
  98. package/dist/protocol.js +96 -3
  99. package/dist/provider.d.ts +34 -6
  100. package/dist/provider.js +16 -0
  101. package/dist/result.d.ts +1 -1
  102. package/dist/surface/api.d.ts +248 -0
  103. package/dist/surface/api.js +1 -0
  104. package/dist/surface/core.d.ts +42 -0
  105. package/dist/surface/core.js +393 -0
  106. package/dist/surface/index.d.ts +5 -0
  107. package/dist/surface/index.js +3 -0
  108. package/dist/surface/outline.d.ts +8 -0
  109. package/dist/surface/outline.js +50 -0
  110. package/dist/surface/script.d.ts +10 -0
  111. package/dist/surface/script.js +92 -0
  112. package/dist/ui-engine.d.ts +114 -0
  113. package/dist/ui-engine.js +798 -0
  114. package/package.json +17 -1
  115. package/dist/child.d.ts +0 -42
  116. package/dist/conformance/e2b-diagnose.d.ts +0 -16
  117. package/dist/conformance/e2b-diagnose.js +0 -61
  118. package/dist/conformance/e2b-sweep.d.ts +0 -18
  119. package/dist/conformance/e2b-sweep.js +0 -132
  120. package/dist/conformance/modal-sweep.d.ts +0 -22
  121. package/dist/conformance/modal-sweep.js +0 -213
package/README.md CHANGED
@@ -40,7 +40,7 @@ full VM, a machine. The protocol has two layers:
40
40
  inside. It never runs commands itself: the daemon does. This package has four: Docker, Modal's VM runtime, Daytona
41
41
  and E2B (desktops), each one line of the provider registry (see [Adding a computer](#adding-a-computer)).
42
42
 
43
- The protocol is published as a spec, [`spec/computer/`](../../spec/computer/README.md), at protocol version 0.1
43
+ The protocol is published as a spec, [`spec/computer/`](../../spec/computer/README.md), at protocol version 0.2
44
44
  (`PROTOCOL_VERSION`, which `hello` carries as `protocol`). Its JSON Schema and constants are generated from
45
45
  `src/protocol.ts` by `node scripts/generate-computer-spec.mjs`, and a test fails when they drift.
46
46
 
@@ -54,7 +54,7 @@ extension](#the-protocol-extension-kind-daemon-modes-screen-input-apps-lifetime)
54
54
 
55
55
  ```text
56
56
  → {"jsonrpc":"2.0","id":1,"method":"hello","params":{"client":"me"}}
57
- ← {"jsonrpc":"2.0","id":1,"result":{"protocol":"0.1","version":"0.1.0-beta.30","os":"linux","kind":"linux","arch":"arm64","groups":["exec","files","processes"]}}
57
+ ← {"jsonrpc":"2.0","id":1,"result":{"protocol":"0.2","version":"0.1.0-beta.30","os":"linux","kind":"linux","arch":"arm64","groups":["exec","files","processes"]}}
58
58
  → {"jsonrpc":"2.0","id":2,"method":"exec.run","params":{"argv":["uname","-m"],"timeoutMs":5000}}
59
59
  ← {"jsonrpc":"2.0","id":2,"result":{"exitCode":0,"stdout":"YWFyY2g2NAo=","stderr":"","timedOut":false,"truncated":false}}
60
60
  ```
@@ -169,8 +169,8 @@ extension](#the-protocol-extension-kind-daemon-modes-screen-input-apps-lifetime)
169
169
  environment, and exits with its code; a binary without cgo runs its tests itself, and a `-race` build (which needs
170
170
  cgo) skips the tests of the drop. On a host as another user the refusal for EPERM and both deadline tests run (init
171
171
  takes its deadline and refuses for the bounding set). The root path (`TestBecome...`, `TestUnprivilegedLeavesRoot...`)
172
- needs root with capabilities and skips there; CI's `computer-docker` job covers it with the Modal commands matrix
173
- (`test/docker/modal-commands.docker.test.mjs`: root containers with Docker's default capabilities and the two
172
+ needs root with capabilities and skips there; CI's `computer-docker` job covers it with the pid1 commands matrix
173
+ (`test/docker/pid1-commands.docker.test.mjs`: root containers with Docker's default capabilities and the two
174
174
  `--own-network` needs, or `--cap-add ALL`, as 1000:1000, the refusal of 0:0 and the refusal without CAP_SETPCAP), and
175
175
  computerd's end at its deadline with the Docker live tests. The test binaries (`CGO_ENABLED=0 go test -c`) also run
176
176
  as root in a container by hand: `internal/isolate`'s and the isolated `TestBecome...` need CAP_SYS_ADMIN and
@@ -251,7 +251,7 @@ provider.
251
251
  - **What it changes.** Only a provider that probes, on a vendor whose firewall accepts first, reads differently: E2B
252
252
  ([below](#network)), whose computers with network none the accept-counts rule refused, and are now kept with notes.
253
253
  Docker reads its network back from `docker inspect` (`--network none` leaves no interface but `lo`, so a TCP
254
- connection is refused outright and a UDP datagram has no route, which `test/docker/modal-commands.docker.test.mjs`
254
+ connection is refused outright and a UDP datagram has no route, which `test/docker/pid1-commands.docker.test.mjs`
255
255
  pins with the probe itself, every default target refused); Daytona reads `networkBlockAll` back from its API and runs
256
256
  no probe; Modal's live run with `blockNetwork` read back no TCP accept at any target under the earlier accept-counts
257
257
  rule, so nothing it accepted is newly let through. The UDP targets have not yet run live on Modal.
@@ -403,8 +403,8 @@ in the kernel's tool registry, keyed by these groups.
403
403
  | --- | --- | --- | --- |
404
404
  | `none` | | | (the run's folder only: no computer) |
405
405
  | `sandbox` | `linux` | `exec`, `files`, `processes` | |
406
- | `desktop` | `desktop` | `screen`, `input.pointer`, `input.keys` | `exec`, `files`, `processes`, `apps`, `stream` |
407
- | `phone` | `android`, `ios` | `screen`, `input.touch`, `apps` | `input.keys`, `apps.install`, `apps.ui_tree`, `stream` |
406
+ | `desktop` | `desktop` | `screen`, `input.pointer`, `input.keys` | `exec`, `files`, `processes`, `apps`, `ui`, `stream` |
407
+ | `phone` | `android`, `ios` | `screen`, `input.touch`, `apps` | `input.keys`, `apps.install`, `ui`, `stream` |
408
408
  | `browser` | `browser` | `cdp` | `stream`, `downloads` |
409
409
 
410
410
  - `serves(capabilities, kind)` is true when `capabilities().kind` is one of the kind's machine kinds and every required
@@ -486,7 +486,7 @@ itself, from our server (adb, a vendor API). Either way a connection's `client`
486
486
  params, { signal })` and `close()`): `DaemonClient` over a stream, or a provider's in-process client.
487
487
 
488
488
  **Groups.** `capabilities().groups` is one flat list, repeated in hello's `groups`: `exec`, `files`, `processes`,
489
- `screen`, `input.pointer`, `input.keys`, `input.touch`, `apps`, `apps.install`, `apps.ui_tree`, and the provider's
489
+ `screen`, `input.pointer`, `input.keys`, `input.touch`, `apps`, `apps.install`, `ui`, and the provider's
490
490
  `cdp`, `stream`, `downloads`. Each is optional unless kind makes it Core. The drift check and Docker's `connect` refuse a hello whose kind or groups differ from what the
491
491
  provider declares, either way.
492
492
 
@@ -496,8 +496,8 @@ provider declares, either way.
496
496
  | `input.pointer` | `input.actions`: `move`, `down`, `up`, `click` (`count` 1-3, held `keys`), `drag` (a path of 2 or more points), `scroll` (`unit` clicks or px) |
497
497
  | `input.keys` | `input.actions`: `key` (one key pressed, or a combo released in reverse; `repeat`), `hold` (`ms`), `type` |
498
498
  | `input.touch` | `input.actions`: `tap`, `long_press`, `swipe`, `pinch` (`scale` above 1 apart, below together), `button` (back, home, app_switch) |
499
- | `apps`, `apps.install` | `apps.list` (`{ apps, foreground }`), `apps.launch`, `apps.terminate`; `apps.install({ path })` of a file already in the computer |
500
- | `apps.ui_tree` | `apps.ui_tree`: `{ root: UiNode, nodes, truncated }`, at most 5000 nodes; a node has `role`, `id?`, `text?`, `label?`, `bounds` in screenshot pixels, `enabled`, the optional booleans and `children` |
499
+ | `apps`, `apps.install` | `apps.list` (`{ apps, foreground }`), `apps.launch({ id, url?, background? })`, `apps.terminate`; `apps.install({ path })` of a file already in the computer |
500
+ | `ui` | `ui.observe({ target?, full?, image?, since? })`: `{ state, app, window, nodes, diff?, image?, truncated }`, at most 5000 flat nodes, each `{ ref, role, name?, value?, id?, bounds, parent?, flags?, actions? }` with an ARIA role and bounds in window points. `ui.act({ target?, state?, steps, expect?, foreground? })`: `{ steps, state?, window?, changed, expect? }`, each step's `route` and `verified`, or its refusal (`stale`, `denied`, ...) as the last; `window: "closed"` in place of `state` when the app has no window left. `expect` is `{ text?, ref?, gone?, timeoutMs? }`, or `{ window: { title?, role? } }` to wait for a window. The rules are in [`wire.md`](../../spec/computer/wire.md#the-ui-group); `UiEngine` (`src/ui-engine.ts`) keeps them over a `UiSource`, `UiSession` (`src/client.ts`) is the typed caller, and `@parcha/agentrun-computer/fake-ui-driver` answers them from scripted apps for tests |
501
501
 
502
502
  **The live view's seam** (`src/screen-watch.ts`). The runner's viewer reads a computer through
503
503
  `provider.watch?(ref, handlers, { signal?, maxWidth?, quality? })`:
@@ -663,7 +663,7 @@ fixtures of every evasion it catches.
663
663
  import { DockerProvider } from "@parcha/agentrun-computer/docker";
664
664
 
665
665
  const docker = new DockerProvider({ daemonPath: "dist/computerd-linux-amd64" });
666
- const made = await docker.create({ image: "debian:bookworm-slim", lifetimeMs: 600_000, network: "none" });
666
+ const made = await docker.create({ image: "debian:bookworm-slim", lifetimeMs: 600_000, network: "none" }, { requestId: "r1#3" });
667
667
  if (!made.ok) throw new Error(made.error.message);
668
668
  const connected = await docker.connect(made.value);
669
669
  if (connected.ok) {
@@ -673,6 +673,13 @@ if (connected.ok) {
673
673
  await docker.release(made.value, "delete");
674
674
  ```
675
675
 
676
+ Every `create` takes a request id (`CreateContext.requestId`, required): the request, not the computer, so a retry of
677
+ the same request passes the same id. The contract makes one computer per id, named `computer-<12 hex of sha256(id)>`
678
+ (`computerNameFor`), answers it again while it starts or runs, and refuses `exists` once it has ended
679
+ ([`spec/computer/provider.md`](../../spec/computer/provider.md#idempotent-create)). Docker names the container for the
680
+ request: a retry finds the name taken and answers that container, or `exists` when it is stopped, of another spec, or
681
+ was deleted.
682
+
676
683
  - `capabilities()` declares kind `linux`, daemon `pid1`, groups `exec`, `files` and `processes`, `maxLifetimeMs`
677
684
  of 30 days, and `mount: ["bind"]` (below); there is no `extend()` or `stream()`, and init gets no `--max-deadline`.
678
685
  - `new DockerProvider({ daemonPath, desktop: {} })` makes desktops: kind `desktop`, with `screen`, `input.pointer` and
@@ -724,7 +731,7 @@ await docker.release(made.value, "delete");
724
731
  PID 1 included. What lasts is the run's folder, bound at `/workspace` when the spec asks (below).
725
732
  - `create` ends with the drift check (below): a computer that is not what was declared is deleted, and `create`
726
733
  refuses with every mismatch in words.
727
- - `create(spec, { signal })` passes the signal to every step: `docker info` before `docker run` (an abort there makes
734
+ - `create(spec, { requestId, signal })` passes the signal to every step: `docker info` before `docker run` (an abort there makes
728
735
  nothing), `docker run`, and after it inspect and hello (hello also has its own 30 s limit). An abort at any step after `docker run` deletes the computer and returns
729
736
  `aborted`; `create` never returns ok once its signal has aborted.
730
737
  - `connect` runs `docker exec -i <name> /opt/agentrun/computerd stdio`, the bridge to init's socket, and says hello.
@@ -767,7 +774,7 @@ daemon, or run past its deadline.
767
774
  ### An allowlist: the egress proxy
768
775
 
769
776
  ```ts
770
- const made = await docker.create({ image: "debian:bookworm-slim", lifetimeMs: 600_000, network: { allow: ["pypi.org", "*.pythonhosted.org", "93.184.215.0/24"] } });
777
+ const made = await docker.create({ image: "debian:bookworm-slim", lifetimeMs: 600_000, network: { allow: ["pypi.org", "*.pythonhosted.org", "93.184.215.0/24"] } }, { requestId: "r1#3" });
771
778
  // In the computer, HTTP_PROXY and HTTPS_PROXY name port 3128 on its own loopback for every program computerd starts.
772
779
  ```
773
780
 
@@ -852,7 +859,7 @@ import { DockerProvider } from "@parcha/agentrun-computer/docker";
852
859
 
853
860
  const docker = new DockerProvider({ daemonPath: "dist/computerd-linux-amd64" });
854
861
  // The run folder must exist, by its canonical path, and be writable by docker.user (below).
855
- const made = await docker.create({ image: "debian:bookworm-slim", lifetimeMs: 600_000, network: "none", mount: { kind: "bind", path: "/data/runs/r1/work" } });
862
+ 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" });
856
863
  // In the computer: files.read({ path: `${WORKSPACE}/notes.md` }), exec.run({ argv: ["make"], cwd: WORKSPACE, ... })
857
864
  ```
858
865
 
@@ -920,7 +927,7 @@ const docker = new DockerProvider({
920
927
  daemonCache: "/data/computer-cache", // at or below volume.root
921
928
  volume: { name: "agentrun_agentrun-data", root: "/data" },
922
929
  });
923
- await docker.create({ image: "debian:bookworm-slim", lifetimeMs: 600_000, network: "none", mount: { kind: "bind", path: "/data/disk/agents/a1/runs/r1/work" } });
930
+ await docker.create({ image: "debian:bookworm-slim", lifetimeMs: 600_000, network: "none", mount: { kind: "bind", path: "/data/disk/agents/a1/runs/r1/work" } }, { requestId: "r1#3" });
924
931
  ```
925
932
 
926
933
  - `volume: { name, root }`: `name` is the named volume, as `docker volume ls` names it; `root` is where this process
@@ -972,7 +979,7 @@ import { DockerProvider } from "@parcha/agentrun-computer/docker";
972
979
  const docker = new DockerProvider({ daemonPath: "dist/computerd-linux-amd64" }); // image: the default recipe
973
980
  const image = await docker.image({ signal }); // built once; one inspect when Docker has it
974
981
  if (!image.ok) throw new Error(image.error.message);
975
- const made = await docker.create({ image: image.value, lifetimeMs: 600_000, network: "none" });
982
+ const made = await docker.create({ image: image.value, lifetimeMs: 600_000, network: "none" }, { requestId: "r1#3" });
976
983
  ```
977
984
 
978
985
  - `ensureImage(source, { docker?, signal?, timeoutMs?, onWait? })` (`src/docker/image.ts`) gives the tag. `source` is
@@ -1154,7 +1161,7 @@ const docker = new DockerProvider({ daemonPath: "dist/computerd-linux-amd64" });
1154
1161
  // A claim at epoch 3 takes the run over: the computers of epochs 1 and 2 go first.
1155
1162
  const older = await releaseOlder(docker, "r1", 3);
1156
1163
  if (!older.ok) throw new Error(older.error.message); // fenced, or a computer that could not be released
1157
- await docker.create({ image: "debian:bookworm-slim", lifetimeMs: 600_000, network: "none", labels: runLabels("r1", 3) });
1164
+ await docker.create({ image: "debian:bookworm-slim", lifetimeMs: 600_000, network: "none", labels: runLabels("r1", 3) }, { requestId: "r1#3" });
1158
1165
  ```
1159
1166
 
1160
1167
  ### Waiting for a vendor: `waitUntil`
@@ -1165,9 +1172,9 @@ reads at once, then after pauses that double from `minMs` (250 ms) to `maxMs` (5
1165
1172
  returns the first state `done` accepts. Each read gets a signal that aborts at the bound or on the caller's abort; a
1166
1173
  read still pending then is not waited for, and one that throws is not done. Past the bound it returns a `timeout`, on
1167
1174
  the caller's abort an `aborted`, each naming `what` was waited for and the last state read (`describe`). It has no
1168
- vendor's types: Modal's `untilFinished`, its one wait after a terminate, is built on it, and Modal's release, a create
1169
- that refuses its sandbox, and the Modal sweep all wait through that; Daytona's release, a create that deletes its
1170
- sandbox, and the Daytona sweep wait through it too.
1175
+ vendor's types: the shared adapter's release and the one live sweep wait through it (`settleGone`, until a machine reads
1176
+ gone and is no longer listed); Daytona's release, a create that deletes its sandbox, and the Daytona sweep wait through
1177
+ it too.
1171
1178
 
1172
1179
  ## Modal
1173
1180
 
@@ -1180,168 +1187,79 @@ const modal = new ModalProvider({
1180
1187
  app: "computers",
1181
1188
  // daemonPath: the daemon to upload; default this package's dist/computerd-linux-amd64 (npm run build:daemon)
1182
1189
  });
1183
- const made = await modal.create({ image: "debian:bookworm-slim", lifetimeMs: 600_000, network: "none" });
1190
+ const made = await modal.create({ image: "debian:bookworm-slim", lifetimeMs: 600_000, network: "none" }, { requestId: "r1#3" });
1184
1191
  ```
1185
1192
 
1186
- `ModalProvider` makes Modal sandboxes on the VM runtime, or on gVisor for a GPU computer (below), through the slice of Modal's JS SDK named by `ModalSdk`
1187
- (apps, images, sandboxes and five methods of a sandbox). It has not yet run against real Modal: every test uses a fake
1188
- of that slice, and the live conformance file waits for a key (below).
1193
+ Modal runs on the shared machine-host adapter ([PROVIDERS.md](PROVIDERS.md)): `src/modal.ts` is Modal's `MachineHost`,
1194
+ its SDK slice (`ModalSdk`: apps, images, sandboxes and five methods of a sandbox) and the client it is made with, and
1195
+ `src/hosted/provider.ts` does everything below that is not Modal's own. `create` takes the caller's request id
1196
+ (`{ requestId }`, serve's is the run's claim): the computer's name is `computer-` and the first 12 hex digits of its
1197
+ sha256, and a retry of the same request finds the computer the first made instead of making a second. A Modal sandbox
1198
+ runs on the VM runtime, or on gVisor for a GPU computer (below). Its unit tests read what the provider hands the SDK
1199
+ (a recorder of the slice), never how Modal behaves; Modal's own lifecycle is proven by the live conformance kit.
1189
1200
 
1190
1201
  - **Capabilities.** Kind `linux`, daemon `pid1`, groups `exec`, `files` and `processes`, `maxLifetimeMs` the
1191
1202
  instance's cap (24 hours, or less with the `maxLifetimeMs` option), and user `uid` only, never `root` (below). Daemon
1192
1203
  `pid1` because init is the sandbox's main process and its exit ends the computer (next item); no `extend` or
1193
1204
  `stream`. Network `none` alone, and `vendorAgentPorts` empty: no listener of Modal's inside a sandbox is documented,
1194
1205
  and isolation.vendor-agent checks the interfaces alone.
1195
- - **The loopback block.** Init starts with `--own-network` (see [Init, the socket and the
1196
- bridge](#init-the-socket-and-the-bridge)) whatever Modal runs inside the sandbox: the daemon's programs reach their
1197
- own loopback and nothing else, and the default computer user is 2510:2510 (`user` option or spec.user for another;
1198
- init refuses one another process holds). On the VM runtime Modal's root holds every capability, so the namespace is
1199
- made there. On gVisor, a GPU computer's runtime, root may not make it, so init makes it inside a user namespace
1200
- (below). Known
1201
- gap: network `open` is refused in words until a proxy carries it out of the daemon's own network, the next feature
1202
- after this one; a computer that needs pip, npm or git from the internet cannot be made on Modal until then.
1203
- - **The daemon is uploaded at create.** The sandbox's command is a small POSIX sh entrypoint (BusyBox and coreutils
1204
- alike): it waits for `/opt/agentrun/computerd` to be there and executable, then `exec`s `computerd init --deadline
1205
- <iso> --user <uid:gid> --own-network` with `HOME=/work`. Modal runs the command as the sandbox's main process and finishes the
1206
- sandbox when it exits, so after the `exec`, init is that process and the sandbox lives as long as init does. Whether
1207
- that process is PID 1 is not documented; init reaps as a subreaper either way. The wait is bounded (`uploadMs` plus
1208
- one call, 360 s by default): if no daemon arrives by then, the entrypoint says so on stderr and exits 3, which ends
1209
- the sandbox.
1210
-
1211
- Right after create the provider runs `sh -c '<upload>' sh /opt/agentrun/computerd <sha256>` through
1212
- `sandbox.exec([...], { mode: "binary" })` and streams `dist/computerd-linux-amd64` into its stdin, in the SDK's own
1213
- 256 KiB stdin chunks, then closes it. The script `cat`s stdin to `/opt/agentrun/.computerd.part`, makes it 0755,
1214
- prints `sha256 <hex>` (`sha256sum`, BusyBox's is fine), and only when that is the sha256 it was given moves the part
1215
- into place with `mv -f`. The rename is what the entrypoint waits for, so it never starts a half-written daemon or the
1216
- wrong one. The provider compares the printed sha256 with its own, as the Daytona provider does. A failed, aborted,
1217
- nonzero or mismatched upload, or one past `uploadMs` (5 min), terminates the sandbox and refuses in words. Then the
1218
- drift check connects as below, trying the bridge again until init listens, within `helloMs`. Exec's stdin goes
1219
- through Modal's command router, not the sandbox's network, so network none still works. The binary cannot go as an
1220
- argument: the SDK refuses more than 64 KiB of argv. `modalCommands()` (in `dist/modal.js`) returns the entrypoint,
1221
- upload and bridge exactly as sent. A Docker-gated test runs them in a root container with no network.
1222
- - **Or as an image layer**, with `daemonImage`: `create` gives the spec's image `COPY --from=<daemonImage> /computerd
1223
- /opt/agentrun/computerd`, and the command is `computerd init` itself. The JS SDK refuses a COPY from local files but
1224
- takes `COPY --from` an image, so `daemonImage` is a registry image holding this version's daemon for linux/amd64 at
1225
- `/computerd`, pinned by digest (the constructor refuses a tag, and `daemonImage` with `daemonPath`). One is two
1226
- lines:
1227
-
1228
- ```dockerfile
1229
- FROM scratch
1230
- COPY dist/computerd-linux-amd64 /computerd
1231
- ```
1232
-
1233
- Either way the image also gets `ENV HOME=/work` and `WORKDIR <workdir>`, and the computer needs no network to get
1234
- its daemon.
1206
+ - **The daemon goes in through exec.** The sandbox's command is the adapter's pid1 entrypoint (`src/hosted/scripts.ts`,
1207
+ POSIX sh, BusyBox and coreutils alike): it waits, bounded, for `/opt/agentrun/computerd` to be there and executable,
1208
+ then `exec`s `computerd init --deadline <iso> --user <uid:gid> --own-network --max-deadline <iso>` with `HOME=/work`.
1209
+ Modal runs the command as the sandbox's main process and finishes the sandbox when it exits, so after the `exec`
1210
+ init is that process and the sandbox lives as long as init does. Whether that process is PID 1 is not documented;
1211
+ init reaps as a subreaper either way. If no daemon arrives within the wait, the entrypoint says so on stderr and
1212
+ exits 3, which ends the sandbox. Modal has no file API, so the adapter streams the daemon into `cat` as root through
1213
+ `sandbox.exec([...], { mode: "binary" })` (stdin in 256 KiB writes, the SDK's own chunk), then runs the shared install:
1214
+ it puts the daemon beside its path, `/opt/agentrun/computerd.part`, and moves it into place only once it reads the
1215
+ sha256 uploaded, so the entrypoint never starts a half-written daemon or another one. Exec's stdin goes through
1216
+ Modal's command router, not the sandbox's network, so network none still works. A Docker-gated test
1217
+ (`test/docker/pid1-commands.docker.test.mjs`) runs the entrypoint, the install and the bridge in a root container with
1218
+ no network.
1235
1219
  - **The daemon becomes the computer's user.** Modal containers always run as root and ignore an image's `USER`, so
1236
- `--user` is how a Modal computer gets the non-root default the protocol asks for (`1000:1000`, or the `user` option),
1237
- or the uid its spec asks for. Init leaves itself and every program no capability in any set (see Init, above): Modal
1238
- starts the container with every one, and a live run read `CapEff` `000001ffffffffff` from a root computer before the
1239
- daemon dropped them itself.
1240
- - **A Modal computer never runs as root.** `check()` and `create()` refuse a spec whose `user` is root (`"0"`,
1241
- `"0:<gid>"`, `"root"`, `"root:<gid>"`) in words, before any Modal call, and `connect`, `attach` and `network`
1242
- refuse a computer whose spec tag records root before they run anything in it. Every connection is Modal's own exec
1243
- of `/opt/agentrun/computerd stdio`, outside the daemon, with Modal's root capabilities. A computer's user without
1244
- root cannot touch that path: after the upload `/opt/agentrun/computerd` is `0:0 755` (the part file is `chmod
1245
- 0755` by the root upload, then renamed into place), `/opt/agentrun` is made by the root upload's `mkdir -p`, `0:0
1246
- 755`, and `/` and `/opt` are the image's, `0:0 755` in Debian and Alpine; with `daemonImage`, `COPY --from` makes
1247
- `/opt/agentrun` and the daemon owned by root (COPY's default; the daemon keeps its mode from the daemon image), not
1248
- yet read back on Modal. Root with no capability still owns every one of them, so it could rename another program over
1249
- the daemon and the next connection would run it with Modal's capabilities; no file mode closes that for the owner
1250
- of every directory above the path. The Docker-gated `modal-commands` test shows uid 1000 cannot write the daemon,
1251
- `/opt/agentrun`, `/opt` or `/`, and that init `--own-network` refuses uid 0 for its programs outright.
1252
- - **The stream** is `computerd stdio` through `sandbox.exec([...], { mode: "binary" })`: its stdin and stdout are the
1253
- `DaemonClient`'s stream. Modal has no kill for an exec, so `close()` ends the bridge's stdin and waits up to 5 s for
1254
- it to exit. One deadline, `helloMs`, covers the exec's start (at most `callMs` of it) and the hello after it, so a
1255
- connection fails at `helloMs` in all. An exec given up on (past its bound, or on the caller's abort) goes on at
1256
- Modal; a bridge that lands after that has its stdin closed as it lands, so it ends.
1220
+ `--user` is how a Modal computer gets the non-root default the protocol asks for (2510:2510, or the `daemonUser`
1221
+ option), or the uid its spec asks for (`spec.user`, a uid or uid:gid in numbers). Init leaves itself and every program
1222
+ no capability in any set (see Init, above).
1223
+ - **A Modal computer never runs as root.** `check()` and `create()` refuse a spec whose `user` is root, in words, before
1224
+ any Modal call. Every connection is Modal's own exec of the adapter's stdio command, outside the daemon, with Modal's
1225
+ root capabilities; after the install `/opt/agentrun/computerd` and `/opt/agentrun` are `0:0 755`, and `/` and `/opt`
1226
+ are the image's, `0:0 755` in Debian and Alpine, so a computer user that is not root cannot touch that path, and the
1227
+ stdio command runs the daemon only while its path is root's alone. Root with no capability would still own every one
1228
+ of them. attach reads the user back from inside and refuses root.
1229
+ - **The stream** is the adapter's stdio command through `sandbox.exec`: its stdin and stdout are the `DaemonClient`'s
1230
+ stream. Modal has no kill for an exec, so the host's `kill` ends the bridge's stdin, which ends it.
1257
1231
  - **Lifetime is Modal's.** Every sandbox's `timeoutMs` is its lifetime, rounded up to whole seconds, so Modal ends it
1258
- then whatever runs in it. The longest is 24 hours, or less with the `maxLifetimeMs` option, declared as
1259
- `capabilities().maxLifetimeMs`; `check` refuses a longer one with `checkLifetime`, the rule every provider shares. The daemon's deadline ends it first. `sweep` refuses a Modal provider.
1260
- - **Network.** `none` is `blockNetwork: true`, and the daemon's programs have their own loopback alone besides (the
1261
- loopback block); `open` and an allowlist are refused in words for now, and a computer recorded open (made before)
1262
- reads back open. The probe's `interfaces` must read `["lo"]`, or the computer is refused as drift. Modal has no read-back of a sandbox's
1263
- policy, so `networkReadBack` is false and the daemon's probe stands for one: `create`, `attach` and `network(ref)` run
1264
- `computerd probe` through `exec.run`, as the computer's user, against public addresses (`1.1.1.1:443`,
1265
- `8.8.8.8:443`, `[2606:4700:4700::1111]:443`, and DNS over UDP to `1.1.1.1:53/udp` and
1266
- `[2606:4700:4700::1111]:53/udp`, or the `probeTargets` option). A computer with network none that any of
1267
- them answers is terminated at create, refused by attach, and reads back as another network in words; one that only
1268
- accepted, sending nothing back, is kept, the targets named in `notes` (see
1269
- [Network none, read from inside](#network-none-read-from-inside-nothing-answers)). This shows those addresses are
1270
- blocked, not every one. An allowlist is refused: Modal's CIDR allowlist (any protocol,
1271
- every port) and its domain allowlist (beta, TLS on 443 by SNI only) cannot be read back, so per ruling 9 an
1272
- allowlist counts only once the live bypass cases pass. A change of network is refused: blockNetwork cannot be
1273
- updated, and an allowlist only if one was set at create.
1274
- - **The drift check** after create: `poll()` is null (it runs), `getTags()` reads back exactly the tags given, hello's
1275
- version, os, arch (`amd64`), kind (`linux`) and exact groups match, and the probe's uid:gid is the computer's user, its kernel is
1276
- not gVisor's (`4.19.0-gvisor`), and with network none none of its targets answered. A mismatch, an abort or a timeout
1277
- terminates the sandbox and refuses in words. The SDK reads back no runtime, image or size: the probe's kernel is the
1278
- only runtime read-back, and image and sizes are what create recorded in a tag only the host's token writes.
1232
+ then whatever runs in it. The longest is 24 hours, or less with the `maxLifetimeMs` option; `check` refuses a longer
1233
+ one with `checkLifetime`, the rule every provider shares. `sweep` refuses a Modal provider.
1234
+ - **Network.** `none` is `blockNetwork: true`, and the daemon's programs have their own loopback alone besides; an
1235
+ Archil computer's sandbox keeps Modal's network on for root to reach Archil, and its tools' none is init's own. Modal
1236
+ has no read-back of a sandbox's policy, so `networkReadBack` is false and the probe from inside stands for one, at
1237
+ create, attach and `network(ref)` (see [Network none, read from inside](#network-none-read-from-inside-nothing-answers)).
1238
+ `open` and an allowlist are refused in words, and a change of network after create is refused.
1279
1239
  - **Sizes are limits**, as in Docker: `cpus` (at least 0.25) becomes `cpuLimit` in physical cores (2 CPUs each) and
1280
- `memoryMb` becomes `memoryLimitMiB`, each with Modal's default request (0.125 cores, 128 MiB) or less. `pids` is
1281
- refused: Modal has no pids limit.
1282
- - **Tags.** A sandbox carries `agentrun.computer`, `agentrun.computer.name`, `agentrun.computer.deadline` and
1283
- `agentrun.computer.spec` (what create recorded), so a computer takes at most 6 labels of its own. `list(labels)` is
1284
- `sandboxes.list({ appId, tags })` over the provider's app: running sandboxes only, so every one is `running`, and its
1285
- network is the one create recorded (`network(ref)` probes it). Modal still lists a sandbox for a while after its
1286
- terminate, so each one listed is polled, and one `poll()` reads finished, or that Modal no longer knows, is left out.
1287
- - **attach** by id or labels runs the same drift check on what it finds and refuses a drifted computer in words, left
1288
- running. Its `spec.user` is the probe's uid:gid and its `spec.kind` hello's; the rest is as recorded.
1289
- - **release** `delete` is `terminate()`, idempotent: a sandbox that has finished, or that Modal no longer knows, is ok.
1290
- Modal ends a sandbox asynchronously, so after the terminate `release` polls (`untilFinished`, on `waitUntil` above) until `poll()` reads
1291
- an exit code or Modal no longer knows the sandbox, with pauses that double from `releasePollMs` (500 ms) to 5 s,
1292
- within `releaseMs` (120 s) and the caller's signal. Past the bound it is a `timeout` that says what `poll()` last
1293
- read; it never reports a delete done that it did not read back. A caller that bounds release (the conformance
1294
- runner's `cleanupTimeoutMs`) gives it more than 120 s: the live suite passes 150 s.
1295
- `capabilities().release` is `["delete"]`, so `stop` is refused as `unsupported`, in words, and the sandbox runs on:
1296
- terminate is a sandbox's only end, and Modal has no stopped state. `release`, `connect` and
1297
- `network` act only on a sandbox whose tags name it as this provider's, with the ref's name.
1298
- - **Every call is bounded** (`timeouts`: create 10 min, which covers the layer's build and scheduling; the upload 5
1299
- min; other calls 60 s; a connection, from the bridge's exec to hello, and the probe 30 s; a whole list 120 s; release's wait 120 s) and takes the caller's
1300
- signal. A create that gives up has its
1301
- sandbox terminated if one lands later. A create that refuses its sandbox (drift, an abort, a failed upload)
1302
- terminates it and waits as release does, within `releaseMs`, so nothing is left listed when it returns. The terminate
1303
- is sent whatever the caller's signal; the wait takes it, so an aborted create returns at once, and a wait past the
1304
- bound or cut short by an abort says the sandbox may still be ending and what `poll()` last read. Before that
1305
- terminate, a create whose sandbox's own command had ended says so: its exit code and the tail of its output. When
1306
- Modal refuses an exec with FAILED_PRECONDITION ("Modal Sandbox is shutting down", code `gone`), the command, init, has
1307
- just exited and Modal ends the sandbox asynchronously, so create first waits up to `endedMs` (30 s) for `poll()` to
1308
- read it finished, then reads init's words. The first GPU live run on gVisor ended this way, with no words.
1240
+ `memoryMb` becomes `memoryLimitMiB`, each with Modal's default request (0.125 cores, 128 MiB) or less. `pids` and
1241
+ `workdir` are refused: Modal has no pids limit, and a computer works in `/work`, its home.
1242
+ - **Tags.** A sandbox's tags are the adapter's labels (`agentrun.computer`, its name, deadline, image and the most its
1243
+ deadline may reach) and the caller's, so a computer takes at most 5 labels of its caller's (Modal's 10 tags). Modal
1244
+ holds a sandbox's tags to 512 bytes, names and values together: `check()` counts them and refuses past it in words.
1245
+ An Archil computer's mount label names its folder, `agents/<agent>/runs/<run>/work`, whose run is the `agentrun.run`
1246
+ label's, so the tag records the agent alone and the host reads the folder back from it (`tagsOf`, `labelsOf`).
1247
+ `list` is `sandboxes.list({ appId, tags })` over the provider's app: running sandboxes only, and one Modal still
1248
+ lists after its terminate is polled and left out once `poll()` reads it finished.
1249
+ - **release** `delete` is `terminate()`, and the adapter waits until the sandbox reads gone and is no longer listed.
1250
+ `stop` is refused as `unsupported`: terminate is a sandbox's only end.
1309
1251
  - **GPU.** `capabilities().gpu` declares Modal's GPU types by its own names (guide/gpu): `T4`, `L4`, `A10`, `L40S`,
1310
- `A100` (40 GB), `A100-40GB`, `A100-80GB`, `RTX-PRO-6000`, `H100`, `H200`, `B200`, `B300`, at most 8 to a computer
1311
- (Modal refuses an `A10` past 4, in its words). Its `H100!` and `B200+` variants are not offered: a computer gets the
1312
- type it asked for. `spec.gpu: { type, count }` becomes the SDK's `gpu` (`"T4"`, `"A100-80GB:2"`), and since Modal
1313
- offers GPUs on gVisor only, such a sandbox runs with `runtime: "gvisor"`; every other computer stays on the VM
1314
- runtime. The drift check holds the runtime from both sides: the probe's kernel must be gVisor's on a GPU computer, and a
1315
- VM's on any other. Modal reads no GPU back: the
1316
- spec tag records the GPUs, and attach reports them on a computer the probe reads as gVisor. `capabilities().isolation`
1317
- stays `vm`, every other computer's; a GPU computer's is declared apart, `gpu.isolation: "gvisor"`, so a caller that
1318
- needs a VM's isolation can tell. Modal's GPUs are `preemptible: true`: Modal may move a GPU workload, so a run on one
1319
- can be cut short (guide/preemption). `gpu.mounts` is `[]`: a GPU with an Archil mount is refused (checkGpu), since the
1320
- Archil client's FUSE mount is not proven on gVisor yet. That keeps serve from giving a run a Modal GPU sandbox in either
1321
- mode, as a serve sandbox always mounts the run's folder; the library takes one without a mount.
1322
- - **The loopback fence on gVisor.** A GPU computer's init gets the same network namespace of its own, loopback alone,
1323
- made another way.
1324
- - Modal's gVisor gives root no CAP_SYS_ADMIN, so `unshare(CLONE_NEWNET)` is EPERM. With `--own-network`, init refused
1325
- to start there (live on a T4, 11-10).
1326
- - It does let root make a user namespace with a network namespace inside it (`unshare -Urn`, live on a T4, 11-11, as
1327
- root and as nobody; nothing of Modal's runs or listens inside a gVisor sandbox, and every loopback port answered
1328
- nothing).
1329
- - So init, given the same `--own-network` on every runtime, makes the namespace inside a user namespace when root's
1330
- own attempt is EPERM (the daemon's fallback, any vendor: see "Where root may not make the network namespace").
1331
- - The first init stays PID 1 with no capability and no_new_privs set. It passes SIGTERM and SIGINT on and ends with
1332
- the init that serves, so the sandbox lives as long as that one does.
1333
- - Declared: `gpu.fence: "userns-netns"`. Read back: hello's `fence` on every connect, which the drift check requires
1334
- to be one of the two. Create notes it when it is `userns-netns`, and the conformance report records it under the GPU
1335
- computer's own name and role (`daemons[].fence`).
1336
- - Proven in Docker. In `test/docker/modal-commands.docker.test.mjs`, a root container with Docker's default
1337
- capabilities and no seccomp profile stands in for gVisor:
1338
- - `--own-network` falls back and serves;
1339
- - hello says `userns-netns`;
1340
- - the programs run as 1000 with no capability, in another network and user namespace than PID 1's, on the loopback
1341
- alone;
1342
- - what they write in HOME is 1000's from outside;
1343
- - with Docker's default seccomp profile (no user namespace either), init refuses in words that name both ways.
1344
- - Not yet proven live on Modal.
1252
+ `A100` (40 GB), `A100-40GB`, `A100-80GB`, `RTX-PRO-6000`, `H100`, `H200`, `B200`, `B300`, at most 8 to a computer.
1253
+ `spec.gpu: { type, count }` becomes the SDK's `gpu` (`"T4"`, `"A100-80GB:2"`), and since Modal offers GPUs on gVisor
1254
+ only, such a sandbox runs with `runtime: "gvisor"`; every other computer stays on the VM runtime. The probe's kernel
1255
+ is held to it at create: gVisor's on a GPU computer, a VM's on any other. Modal reads no GPU back, so attach reports
1256
+ none. `gpu.mounts` is `[]`: a GPU with an Archil mount is refused (checkGpu).
1257
+ - **The loopback fence on gVisor.** Modal's gVisor gives root no CAP_SYS_ADMIN, so init, given the same
1258
+ `--own-network`, makes its programs' network namespace inside a user namespace (the daemon's fallback, any vendor).
1259
+ Declared: `gpu.fence: "userns-netns"`; read back: hello's `fence`, and create notes it. Proven in Docker
1260
+ (`test/docker/pid1-commands.docker.test.mjs` and `loopback-block.docker.test.mjs`), not yet live on Modal.
1261
+ - **Settings' test** reads the app with `createIfMissing: false`, which makes nothing; an app not made yet is a
1262
+ connection all the same.
1345
1263
 
1346
1264
  ### What every Modal fact rests on
1347
1265
 
@@ -1363,7 +1281,7 @@ unless they start with `modal_proto/`. Docs: modal.com, read 2026-11-05.
1363
1281
  | Whether the main process is PID 1 | not documented (searched `modal-docs`, `js/src`, `modal-libmodal`: none) |
1364
1282
  | Modal containers always run as root; `USER` is ignored | [guide/existing-images#user](https://modal.com/docs/guide/existing-images#user) |
1365
1283
  | Images must be `linux/amd64` | [guide/existing-images](https://modal.com/docs/guide/existing-images) |
1366
- | `images.fromRegistry(tag)`; `dockerfileCommands(commands)` adds a layer; a COPY from local context is refused, `COPY --from=` is not | `image.ts:196-210`, `351-401` |
1284
+ | `images.fromRegistry(tag)`; `dockerfileCommands(commands)` adds a layer | `image.ts:196-210`, `351-401` |
1367
1285
  | Modal's Dockerfile lacks only `EXPOSE`, `HEALTHCHECK`, `LABEL`, `ONBUILD`, `STOPSIGNAL`, `VOLUME` | [guide/existing-images](https://modal.com/docs/guide/existing-images) |
1368
1286
  | `sandbox.exec(argv, { mode: "binary" })` gives `stdin` (`writeBytes`, `close`), `stdout`, `stderr` and `wait()` | `sandbox.ts:1272-1290`, `1881-1949`, `2774-2914`; `streams.ts:13-39`, `114-140` |
1369
1287
  | exec starts through the task command router; each stdin write is one `TaskExecStdinWrite` at the running offset, and close sends EOF | `sandbox.ts:1915-1926`, `3126-3154`; `modal_proto/task_command_router.proto:420-421` |
@@ -1376,7 +1294,6 @@ unless they start with `modal_proto/`. Docs: modal.com, read 2026-11-05.
1376
1294
  | `getTags()`, `poll()` (null while running, else the exit code), `terminate()` | `sandbox.ts:1813-1838`, `2761-2772`, `2238-2252` |
1377
1295
  | `terminate()` returns once the request is sent; it waits for the sandbox to finish only with `{ wait: true }` | `sandbox.ts:1292-1296`, `2238-2251` |
1378
1296
  | `poll()` is `SandboxWait` with timeout 0: null until the server reports a result, then its exit code (137 when terminated) | `sandbox.ts:1491-1511`, `1974-1980`, `2761-2771` |
1379
- | `sandboxes.fromId(id)` makes a handle with no call | `sandbox.ts:960-962` |
1380
1297
  | terminate sends SIGKILL: a terminated sandbox's code is 137 | [guide/sandboxes#return-codes](https://modal.com/docs/guide/sandboxes#return-codes) |
1381
1298
  | A sandbox carries up to 10 tags | [guide/sandboxes#tagging](https://modal.com/docs/guide/sandboxes#tagging) |
1382
1299
  | `apps.fromName(name, { createIfMissing })` | `app.ts:32-61` |
@@ -1395,25 +1312,7 @@ unless they start with `modal_proto/`. Docs: modal.com, read 2026-11-05.
1395
1312
  | `ModalClient` declares `endpoint` and never reads it; `getProfile` runs once, at construction, and the control-plane client is made then | `client.ts:51`, `123`, `175`, `281` |
1396
1313
  | With a profile's `sandboxV2`, create and list go to the V2 backend, and list then covers both | `sandbox.ts:808-815`, `884-889`, `1116-1122`, `1161-1175` |
1397
1314
 
1398
- ### What waits for a live probe
1399
-
1400
- Nothing here has run against Modal. Once the lead OKs a key by name, `AGENTRUN_COMPUTER_LIVE_MODAL=1 npm run test:modal
1401
- -w @parcha/agentrun-computer` runs the conformance suite (`test/modal/`), and should settle:
1402
-
1403
- - that the image's `sh` runs the entrypoint as the main process, and the upload streams in through exec's stdin with
1404
- network none, within `uploadMs`, and its sha256 reads back;
1405
- - with `COMPUTER_MODAL_DAEMON_IMAGE` only: that Modal's builder takes `COPY --from=<registry image>@sha256:...` and
1406
- keeps the file's mode 0755;
1407
- - that `computerd init` starts as root and `--user` drops as it does under Docker; whether it is PID 1 on the VM runtime
1408
- (init says so on stderr when it is not, and still reaps as a subreaper);
1409
- - that a workdir other than `/work` exists before the command starts, and `/run` is writable there;
1410
- - the tag value's longest length (the spec tag is JSON) and whether `getTags` answers for a terminated sandbox;
1411
- - that `terminate` of a finished sandbox does not throw; a live run saw `list` still yield a sandbox right after its
1412
- terminate, which `release` and `list` now wait out and leave out (above);
1413
- - the probe's view of `blockNetwork`, and the bypass cases before any allowlist is declared.
1414
-
1415
- Core `provider.stop` expects Modal's refusal (it declares no stop), and the Full `provider.janitor` case is skipped
1416
- (`lifetime:janitor`, `release:stop`).
1315
+ ### The token, the server and the live run
1417
1316
 
1418
1317
  `create(options)` in `dist/modal.js` builds a real client from `options.tokenId` and `options.tokenSecret`, and the
1419
1318
  provider in `options.app` (required: without it, it refuses in words naming the option, before any client). It reads no
@@ -1421,45 +1320,29 @@ setting from the environment (see [Settings](#settings)) and passes the token to
1421
1320
  `MODAL_TOKEN_ID` or `MODAL_TOKEN_SECRET` on the host is never used. The key goes only to `options.serverUrl`, else the
1422
1321
  SDK's default `https://api.modal.com:443`: since the client cannot take a server, it refuses while `MODAL_SERVER_URL`
1423
1322
  is set, and sets it to its choice only while it constructs the client, one construction at a time and put back after
1424
- each, so neither `MODAL_PROFILE` nor a profile in `MODAL_CONFIG_PATH` or `~/.modal.toml` can redirect the key. With
1425
- `options.daemonImage` the daemon is copied from that image (given `options.daemonPath` too, the image wins and nothing
1426
- is uploaded); without it, it is uploaded from `options.daemonPath`, else `dist/computerd-linux-amd64`, so a run
1427
- publishes nothing.
1323
+ each, so neither `MODAL_PROFILE` nor a profile in `MODAL_CONFIG_PATH` or `~/.modal.toml` can redirect the key. The
1324
+ daemon is uploaded from `options.daemonPath`, else `dist/computerd-linux-amd64`, so a run publishes nothing.
1428
1325
 
1429
1326
  The conformance module, `dist/conformance/modal.js` (`--provider modal`), reads the run's settings from its own names
1430
1327
  (`settingsFromEnv`) and passes each to `create()` as its option: `COMPUTER_MODAL_TOKEN_ID` and
1431
1328
  `COMPUTER_MODAL_TOKEN_SECRET` (never `MODAL_TOKEN_ID` or `MODAL_TOKEN_SECRET`: a host may hold a production token under
1432
1329
  those names, and with only them set it refuses, naming the `COMPUTER_MODAL_` pair), `COMPUTER_MODAL_APP`, and, if set,
1433
- `COMPUTER_MODAL_SERVER_URL` and `COMPUTER_MODAL_DAEMON_IMAGE`. It builds its provider only with
1434
- `AGENTRUN_COMPUTER_LIVE_MODAL=1` set, checked before anything else. Its
1435
- `createDriftedProvider()` uploads a daemon it builds with Go as version `<version>-drift` into a
1436
- temporary directory, so Go must be on PATH. Every computer of a run gets `maxLifetimeMs` 30 minutes: Modal's timeout
1437
- is its lifetime, and a longer one is refused in words. The modal package is the host's; it is imported only when a
1438
- provider is made.
1330
+ `COMPUTER_MODAL_SERVER_URL`. It builds its provider only with `AGENTRUN_COMPUTER_LIVE_MODAL=1` set, checked before
1331
+ anything else. Its `createDriftedProvider()` uploads a daemon it builds with Go as version `<version>-drift`, so Go must
1332
+ be on PATH. Every computer of a run gets `maxLifetimeMs` 30 minutes. Core `provider.stop` expects Modal's refusal (it
1333
+ declares no stop), and the Full `provider.janitor` case is skipped (`lifetime:janitor`, `release:stop`).
1439
1334
 
1440
- A live run is wrapped in the sweep, `dist/conformance/modal-sweep.js`. It reads only `COMPUTER_MODAL_TOKEN_ID`,
1441
- `COMPUTER_MODAL_TOKEN_SECRET`, `COMPUTER_MODAL_APP` and `COMPUTER_MODAL_SERVER_URL`, through the conformance module's
1442
- `settingsFromEnv`, and makes its client the same pinned way (an ambient `MODAL_SERVER_URL` is refused; it needs no live switch, since it makes nothing):
1335
+ A live run is wrapped in the one sweep, with the same settings (it needs no live switch, since it makes nothing):
1443
1336
 
1444
1337
  ```sh
1445
- node packages/computer/dist/conformance/modal-sweep.js --before /tmp/modal-before.json
1338
+ node packages/computer/dist/conformance/sweep.js --provider modal --before /tmp/modal-before.json
1446
1339
  AGENTRUN_COMPUTER_LIVE_MODAL=1 npm run test:modal -w @parcha/agentrun-computer
1447
- node packages/computer/dist/conformance/modal-sweep.js --after /tmp/modal-before.json
1340
+ node packages/computer/dist/conformance/sweep.js --provider modal --after /tmp/modal-before.json
1448
1341
  ```
1449
1342
 
1450
- `--before` records the app, the server (`COMPUTER_MODAL_SERVER_URL`, else the SDK's default) and the id of every
1451
- sandbox in the app carrying `agentrun.computer=1` (`sandboxes.list({ appId, tags })`, which lists running sandboxes
1452
- only, so a finished one needs no sweep). `--after` refuses, exit 2, before it lists anything, a file whose app or
1453
- server is not the one the environment names now, or that names none: every computer of another app would read as
1454
- new. Otherwise it reads the tags (`getTags()`) of every such sandbox not in that file and terminates each that carries
1455
- a conformance run's label (`agentrun.conformance`, which every computer of a run carries): one another user of the app
1456
- made during the run, with no such label, is left alone, and so is one whose tags it cannot read (said on stderr). It
1457
- reads each terminated sandbox back through `sandboxes.fromId` and `poll()` until it reports an exit code or Modal no
1458
- longer knows it (up to 60 s each), and prints one line, `{"swept":n,"gone":m,"stillThere":[ids],"leftAlone":k}`, where
1459
- `leftAlone` counts the new sandboxes it did not terminate. It exits 0 when
1460
- every swept sandbox has finished, 1 when one still runs, and 2 on a usage error, an unreadable before file or one of
1461
- another app or server, a missing token or app, or a listing Modal refused, having terminated nothing. A sandbox in the before file is never
1462
- named by any call.
1343
+ Its output is `{"swept":n,"gone":m,"stillThere":[ids],"leftAlone":k}`, as for every provider on the adapter. The before
1344
+ file records where it listed, the app and the server (`sweepScope`), and `--after` refuses, exit 2, before it lists
1345
+ anything, a file of another app or server, or one that names none: every computer there would read as new.
1463
1346
 
1464
1347
  ## Daytona
1465
1348
 
@@ -1467,11 +1350,11 @@ named by any call.
1467
1350
  import { DaytonaProvider } from "@parcha/agentrun-computer/daytona";
1468
1351
 
1469
1352
  const daytona = new DaytonaProvider({ apiKey, daemonPath: "dist/computerd-linux-amd64" });
1470
- const made = await daytona.create({ image: "my-snapshot", lifetimeMs: 600_000, network: "none" });
1353
+ const made = await daytona.create({ image: "my-snapshot", lifetimeMs: 600_000, network: "none" }, { requestId: "r1#3" });
1471
1354
  ```
1472
1355
 
1473
- A Daytona computer is a sandbox made through Daytona's v0 REST API with `fetch`, as pi-transport's Daytona box does:
1474
- no SDK, and no package beyond this one. `fetch` and the WebSocket factory are options, so the tests run against a fake.
1356
+ A Daytona computer is a sandbox made through Daytona's v0 REST API with `fetch`: no SDK, and no package beyond this
1357
+ one. `fetch` and the WebSocket factory are options, so the tests run against a fake.
1475
1358
  The key is the caller's to pass: the provider never reads the environment, never sends the key over a redirect or to a
1476
1359
  toolbox URL that is not https, and never puts it in a computer. `image` is a Daytona snapshot, by id or name: the
1477
1360
  snapshot gives the sandbox its class and its size. `image: "default"` sends no snapshot field at all, and Daytona makes
@@ -1625,8 +1508,8 @@ the TTL.
1625
1508
  /sandbox/{id}/network-settings` and reads it back whatever the answer: as asked, it is returned; unchanged, the
1626
1509
  change is refused in Daytona's words; anything else is put back, or, if that fails, the network is blocked, and the
1627
1510
  change is refused. A network is never left wider than asked.
1628
- - `release(ref, "delete")` deletes as pi-transport does: retried on a 5xx, checked against the sandbox, with a forced
1629
- stop before the last attempt. `release(ref, "stop")` stops. Both are idempotent, and both refuse a sandbox that is
1511
+ - `release(ref, "delete")` deletes: retried on a 5xx, checked against the sandbox, with a forced stop before the last
1512
+ attempt. `release(ref, "stop")` stops. Both are idempotent, and both refuse a sandbox that is
1630
1513
  not this provider's.
1631
1514
  - Daytona is asynchronous: it answers a delete by setting the sandbox's desired state to `destroyed` and a stop by
1632
1515
  setting it to `stopped`, and the sandbox gets there later, through `destroying` or `stopping`. Its listing trails
@@ -1641,7 +1524,7 @@ the TTL.
1641
1524
  the sandbox it made (a failure, a mismatch, an abort) waits the same way before it returns.
1642
1525
  - `connect(ref)` refuses a computer that is not `started`, and a daemon whose hello is not the provider's.
1643
1526
  - Every call has its own timeout and takes the caller's signal; reads, the upload and deletes are retried (three tries,
1644
- backoff), as in pi-transport; creates, session commands, input and network changes are not.
1527
+ backoff); creates, session commands, input and network changes are not.
1645
1528
 
1646
1529
  ### The drift check
1647
1530
 
@@ -1796,9 +1679,15 @@ import { providerFor } from "@parcha/agentrun-computer";
1796
1679
 
1797
1680
  // The key is the caller's to pass (serve's E2B_API_KEY), and the e2b package is the host's own (npm e2b 2.63.0).
1798
1681
  const e2b = await providerFor("e2b", { apiKey });
1799
- const made = await e2b.create({ image: "desktop", lifetimeMs: 600_000, network: "none" });
1682
+ const made = await e2b.create({ image: "desktop", lifetimeMs: 600_000, network: "none" }, { requestId: "r1#3" });
1800
1683
  ```
1801
1684
 
1685
+ E2B runs on the shared machine-host adapter ([PROVIDERS.md](PROVIDERS.md)): `src/e2b.ts` is E2B's `MachineHost`, its
1686
+ SDK slice and the mapping of a sandbox to a machine, and `src/hosted/provider.ts` does everything below that is not
1687
+ E2B's own. `create` takes the caller's request id (`{ requestId }`, serve's is the run's claim): the computer's name is
1688
+ `computer-` and the first 12 hex digits of its sha256, and a retry of the same request finds the computer the first
1689
+ made instead of making a second.
1690
+
1802
1691
  An E2B computer is a sandbox made from an E2B template, by default `desktop`, E2B Desktop's (Ubuntu 22.04 with Xvfb,
1803
1692
  Xfce, x11vnc and noVNC, e2b-dev/desktop `template/template.py:3-65`). It is kind `desktop`: computerd starts the X
1804
1693
  server itself, as on a Docker desktop, and its X11 shim drives it. With `kind: "linux"` it is kind `linux`
@@ -1838,14 +1727,14 @@ E2B's envd is the sandbox's first process, a systemd service with `Restart=alway
1838
1727
  passes, and the sandbox found is killed and read back gone, as release waits for one.
1839
1728
  2. `getInfo` reads the sandbox back (below).
1840
1729
  3. `files.write` uploads the daemon as root to `/tmp/agentrun-computerd-<random>` (`index.mjs:2332-2435`), and the
1841
- same install command as Daytona's (`src/child.ts`) moves it to `/opt/agentrun/computerd`, root-owned, and prints its
1842
- sha256, which must be the uploaded one's.
1843
- 4. `commands.run(init, { background: true, user: "root", timeoutMs: 0 })` starts `computerd init --deadline <time>
1844
- --user 2510:2510 --own-network --max-deadline <create's time plus the cap>` with `DISPLAY=:0`, in a clean
1845
- environment. envd runs
1846
- the command under `bash -l -c` (`index.mjs:5123-5146`). Its timeout is 0 because envd kills a command whose
1847
- timeout passes, and keeps one running when its stream ends (envd `process/start.go:39-44`); the SDK's default
1848
- would end init after 60 s (`index.mjs:4978`). Create disconnects from it after.
1730
+ same install command as Daytona's (`src/hosted/scripts.ts`) moves it to `/opt/agentrun/computerd`, root-owned, and
1731
+ prints its sha256, which must be the uploaded one's, and who installed it (a create note).
1732
+ 4. The adapter's start command, a background command as root, starts `computerd init --deadline <time> --user
1733
+ 2510:2510 --own-network --max-deadline <create's time plus the cap>` with `DISPLAY=:0`, in a clean environment,
1734
+ detached: in a session of its own (`setsid`), its output to `/run/agentrun-init.log`, so the command ends at once
1735
+ and a daemon that never answers is reported with init's own words. envd runs every command under `bash -l -c`
1736
+ (`index.mjs:5123-5146`), each with timeout 0, because envd kills a command whose timeout passes (envd
1737
+ `process/start.go:39-44`); the SDK's default would end it after 60 s (`index.mjs:4978`).
1849
1738
  5. `connect()` starts `computerd stdio` the same way, as root, with `stdin: true` and `retainOutput: false` (so a long
1850
1739
  connection keeps no copy of its output, `index.mjs:2708-2711`, `5150-5153`): its stdout comes through `onStdout`
1851
1740
  (decoded as a stream, `index.mjs:2860`), and requests go in with `sendStdin`, one call after another.
@@ -1911,7 +1800,7 @@ hostname from the connection's first bytes, decides, and closes a denied connect
1911
1800
  E2B documents no stricter setting: `allowInternetAccess: false` is `denyOut 0.0.0.0/0`, and `dnsServers` matters only
1912
1801
  with a domain in `allowOut`. Under the shared rule only an answer refuses network none, so such a sandbox is kept, and
1913
1802
  create's and attach's `notes` name the accepted targets: `network: none; accepted with no answer (no bytes came back):
1914
- 1.1.1.1:443, 8.8.8.8:443`. The one live diagnostic (below) read that: every IPv4 target on 443/tcp and 80/tcp accepted
1803
+ 1.1.1.1:443, 8.8.8.8:443`. The one live diagnostic (2026-11-07, a tool since removed) read that: every IPv4 target on 443/tcp and 80/tcp accepted
1915
1804
  and closed with 0 bytes, no answer on 53/udp, and, in the provider's own probe, no accept from the IPv6 target. UDP
1916
1805
  is not proxied: the same firewall drops non-TCP to the user deny set, which `denyOut` fills, in nftables
1917
1806
  (`e2b-dev/infra@ff3922213` `packages/orchestrator/pkg/sandbox/network/firewall.go`, `installRules`, rule 5), so the probe's UDP targets get no reply within the 10 s window
@@ -1925,14 +1814,6 @@ both ways, since the first byte back refuses network none; it does not catch a o
1925
1814
  inside can. That is the rule for every provider, confirmed on 11-07, and why every
1926
1815
  accept is recorded in words rather than dropped.
1927
1816
 
1928
- `dist/conformance/e2b-diagnose.js` (live switch
1929
- `AGENTRUN_COMPUTER_LIVE_E2B=1`) makes one sandbox exactly as create does for network none, with a 10-minute E2B
1930
- timeout, records the read-back and the provider's own check (`passed` with its `notes`, or its refusal), runs
1931
- `computerd probe --diagnose` in it (each check judged as `--connect` judges a target: any byte back is answered),
1932
- prints one JSON line, and kills the sandbox and reads it back gone, after an error or an abort too (SIGINT, SIGTERM,
1933
- or its own 8-minute bound). Exit 0 when a diagnosis came back and the sandbox reads gone, 1 otherwise, 2 with no live
1934
- switch or a refused setting.
1935
-
1936
1817
  ### Extend and stream
1937
1818
 
1938
1819
  `extend(ref, ttlMs)` sets E2B's timer to now + `ttlMs` (`Sandbox.setTimeout`, `index.mjs:5529-5541`), reads the end
@@ -2001,17 +1882,12 @@ computer capped at 30 minutes, Hobby's plan for conformance
2001
1882
  `test/e2b/conformance.e2b.test.mjs` runs the suite with `computerd-fixture` built for linux/amd64, and skips unless the
2002
1883
  switch and `COMPUTER_E2B_API_KEY` are both set; `E2B_API_KEY` never counts.
2003
1884
 
2004
- `dist/conformance/e2b-sweep.js --before <file>` records every sandbox E2B lists with `agentrun.computer=1`; `--after
2005
- <file>` kills every one not in the file whose metadata carries a conformance run's label (`agentrun.conformance`),
2006
- leaving alone one another user of the account made during the run, reads each killed one back until `getInfo` no longer
2007
- finds it and the listing no longer shows it, up to 60 s each, and prints
2008
- `{"swept":n,"gone":m,"stillThere":[ids],"leftAlone":k}` (`leftAlone`: the new labelled sandboxes with no conformance
2009
- label, which no call names). Exit 0 when every swept sandbox is
2010
- gone, 1 when one is still there, 2 on a usage error, an unreadable before file, no key, or a refused listing (nothing is
2011
- killed then). It reads `COMPUTER_E2B_API_KEY` and `COMPUTER_E2B_DOMAIN` as the conformance module does, and needs no
2012
- live switch.
2013
-
2014
- The conformance module's `settingsFromEnv` reads these names, and the sweep and `e2b-diagnose.js` read them through it,
1885
+ The live sweep is the shared one, `dist/conformance/sweep.js --provider e2b --before <file>` and `--after <file>`
1886
+ ([PROVIDERS.md](PROVIDERS.md), "The live sweep"): it prints `{"swept":n,"gone":m,"stillThere":[ids],"leftAlone":k}`
1887
+ and reads its settings through the conformance module's `createHost`, with no live switch. A conformance run of E2B
1888
+ also sweeps its own label through the host at its end (the report's `cleanup.sweep`).
1889
+
1890
+ The conformance module's `settingsFromEnv` reads these names, and the sweep reads them through it (`createHost`),
2015
1891
  each passed to `create()` as the option in brackets: `COMPUTER_E2B_API_KEY` (`apiKey`, required),
2016
1892
  `COMPUTER_E2B_DOMAIN` (`domain`), `COMPUTER_E2B_DAEMON` (`daemonPath`), `COMPUTER_E2B_KIND` (`kind`),
2017
1893
  `COMPUTER_E2B_MAX_LIFETIME_MS` (`maxLifetimeMs`, a whole number of ms) and `COMPUTER_E2B_USER` (`daemonUser`). It
@@ -2042,6 +1918,146 @@ A live run must show:
2042
1918
  `packages/envd/internal/services/process/start.go`, `.../process/handler/handler.go:395-420`), and E2B's docs
2043
1919
  (network/restrict-public-access and network/internet-access, read 2026-11-07). Each is cited where it is used above and in `src/e2b.ts`.
2044
1920
 
1921
+ ## Agent37
1922
+
1923
+ ```ts
1924
+ import { providerFor } from "@parcha/agentrun-computer";
1925
+
1926
+ // Both keys are the caller's to pass (serve's AGENT37_API_KEY and AGENT37_SSH_KEY), and ssh2 is the host's own (npm ssh2 1.17.0).
1927
+ const agent37 = await providerFor("agent37", { apiKey, sshKey });
1928
+ const made = await agent37.create({ image: "agent37-base", lifetimeMs: 600_000, network: "none" }, { requestId: "r1#3" });
1929
+ ```
1930
+
1931
+ Agent37 runs on the shared machine-host adapter ([PROVIDERS.md](PROVIDERS.md)): `src/agent37.ts` is Agent37's
1932
+ `MachineHost`, and `src/hosted/provider.ts` does everything that is not Agent37's own (the upload, the install, init's
1933
+ start, the stdio bridge, the probe, the janitor's extend, idempotent create by the request's name label). An Agent37
1934
+ computer is an instance made from a workspace template, by default `agent37-base`, Agent37's plain Debian 12. It is
1935
+ kind `linux`, on type `vm` (a VM with its own kernel, the default) or `default` (Agent37's gVisor sandbox). With
1936
+ `kind: "desktop"` it is a Linux desktop on `agentrun-box`, our box image as a template of the key's workspace
1937
+ ([below](#the-desktop-agentrun-box)).
1938
+
1939
+ ### Two keys
1940
+
1941
+ `create(options)` takes the workspace's API key as `options.apiKey` and the private half of an SSH key registered on
1942
+ the same workspace (`POST /v1/ssh-keys`, or `agent37 ssh-keys add`) as `options.sshKey`, its contents, never a path:
1943
+ the provider reads no file and no environment. A key pasted into Settings comes back on one line (a password field
1944
+ drops line breaks), so the provider wraps a one-line key's body again before ssh2 reads it. REST takes the API key as
1945
+ `Authorization: Bearer <key>`; the SSH tunnel's edge takes the same key in `X-Agent37-Key` (npm `agent37@0.4.1`
1946
+ `src/cli.js`, `wsHandshake` and `runTunnel`). Neither key appears in an error, a note or a label: the sweep's scope
1947
+ names the API key by its sha256 prefix alone.
1948
+
1949
+ ### The mapping
1950
+
1951
+ | MachineHost | Agent37 |
1952
+ | --- | --- |
1953
+ | `create` | `POST /v1/instances` with the template, `type`, `region`, the size when the spec asks one, `name` (the adapter's name label), the labels as `metadata`, `network: "deny-all"` (`"allow-all"` for an Archil computer's root, whose own namespace is still loopback-only), `auto_sleep: false` and `public_ports: []`. It answers 201 once the instance runs |
1954
+ | `get` | `GET /v1/instances/{id}`; 404 is none |
1955
+ | `list` | `GET /v1/instances`, the whole workspace in one answer (`{ data }`, no paging keys, seen live), matched on the labels here. An answer that says it has more is refused, never read as all |
1956
+ | `delete` | `DELETE /v1/instances/{id}`, never signalled; a repeat's 404 is done |
1957
+ | `setLabels` | `GET`, then `PATCH` of the whole `metadata`, which a PATCH replaces |
1958
+ | `exec` | SSH as root over a binary WebSocket to `wss://{id}-22022.agent37.app/`, one connection per process (below) |
1959
+ | `errorCode` | the envelope's `error.code` (or a flat `error` string), then the HTTP status; ssh2's `client-authentication` is `denied` |
1960
+ | `check` | a template name with an optional `@version`; one of Agent37's four shapes; at most 4 CPUs; metadata within 4096 bytes with the provider's own labels |
1961
+
1962
+ Agent37 has no request id and no unique name, so a retried POST makes a second instance: the adapter lists the name
1963
+ label and keeps the oldest by `created` (whole seconds; ties go to the lowest id), as it does for every vendor.
1964
+
1965
+ ### Exec over SSH
1966
+
1967
+ Agent37 has no SSH port on the internet: the instance's sshd answers on 22022 inside it, and the edge carries the SSH
1968
+ stream as binary WebSocket frames. `exec` opens a WebSocket (Node's global one takes `headers`), wraps it as a Duplex
1969
+ for ssh2's `Client.connect({ sock })`, and runs argv as `sh -c` under a wrapper that writes the shell's pid to
1970
+ `/tmp/.agentrun-exec-<random>` and removes it when the command ends. stdout and stderr are the channel's, piped; with no
1971
+ stdin, end of file is sent at once. `wait()` answers at the channel's close with the exit-status, or -1 for an exit by
1972
+ signal or none; its listeners go on inside ssh2's callback, since one read off the tunnel can hold the open, the exit
1973
+ and the close together (seen live: a listener added after an `await` missed the exit). `kill()` runs a second command
1974
+ on the same connection that kills the pid's process group (the sshd starts each command as a session and group leader,
1975
+ seen live), then closes the channel and the connection. An SSH signal request is not used: ssh2 sends one only while
1976
+ stdin is open (`ssh2@1.17.0` `lib/Channel.js:237-246`), and it reaches one process, not its children.
1977
+
1978
+ ### Capabilities
1979
+
1980
+ | Capability | Declared | Why |
1981
+ | --- | --- | --- |
1982
+ | `kind` | `linux` or `desktop` | `options.kind`: `linux` (default), or `desktop` with `screen`, `input.pointer` and `input.keys`, on the box template (below) |
1983
+ | `daemon` | `child` | the image's entrypoint is a template field, not a create field; init is a detached command over SSH |
1984
+ | `isolation` | `vm` or `gvisor` | `options.type`: `vm` (default) or `default` |
1985
+ | `lifetime` | `janitor` | Agent37 never ends an instance on its own; init's deadline and the deadline label do, and the run's sweep is the backstop |
1986
+ | `maxLifetimeMs` | 24 h | the janitor's cap; `options.maxLifetimeMs` sets less |
1987
+ | `network` | `none` | `deny-all`, read back, and the daemon's own network namespace |
1988
+ | `networkReadBack` | `true` | `GET` reports `network` and `public_ports`; any public port reads `other` |
1989
+ | `vendorAgentPorts` | `[22022, 7681]` | the platform's sshd (root for whoever holds the key) and its web terminal (ttyd), both seen listening on every VM |
1990
+ | `mount` | `archil` | the run's folder on an Archil disk; `/dev/fuse` is there on both types (live), and the mount needs the box template |
1991
+ | `release` | `delete` | `DELETE`; no release maps to Agent37's stop here |
1992
+ | `specFields` | `cpus`, `memoryMb` | 2/4, 4/8, 4/16 or 4/32 (CPUs/GB); more than 4 CPUs is refused, since Agent37 gives 4 without saying so |
1993
+
1994
+ Every instance is made with `auto_sleep: false`: a VM that sleeps wakes cold, its daemon gone. A read-back with
1995
+ `auto_sleep` on, another type, region or template is drift, and the adapter refuses the computer.
1996
+
1997
+ ### Conformance on Agent37
1998
+
1999
+ ```sh
2000
+ AGENTRUN_COMPUTER_LIVE_AGENT37=1 COMPUTER_AGENT37_API_KEY=... COMPUTER_AGENT37_SSH_KEY="$(cat key)" \
2001
+ npm run conformance -w @parcha/agentrun-computer -- --provider agent37
2002
+ ```
2003
+
2004
+ The conformance module, `dist/conformance/agent37.js`, checks `AGENTRUN_COMPUTER_LIVE_AGENT37=1` first, then reads
2005
+ `COMPUTER_AGENT37_API_KEY` (`apiKey`, required), `COMPUTER_AGENT37_SSH_KEY` (`sshKey`, required, the key's contents),
2006
+ `COMPUTER_AGENT37_KIND` (`linux`, the default, or `desktop`), `COMPUTER_AGENT37_TEMPLATE` (the run's image, default
2007
+ `agent37-base`, or `agentrun-box` for kind `desktop`), `COMPUTER_AGENT37_TYPE`, `COMPUTER_AGENT37_REGION`,
2008
+ `COMPUTER_AGENT37_API_URL`, `COMPUTER_AGENT37_DAEMON` (`daemonPath`), `COMPUTER_AGENT37_MAX_LIFETIME_MS` and
2009
+ `COMPUTER_AGENT37_USER` (`daemonUser`), never `AGENT37_API_KEY`. Every computer of a run lives at most 30 minutes.
2010
+ `createDriftedProvider()` uploads a daemon built as `<version>-drift`. The live sweep is the shared one,
2011
+ `dist/conformance/sweep.js --provider agent37 --before <file>` and `--after <file>`; its scope is the key's workspace.
2012
+
2013
+ ### Seen live (2026-11-13)
2014
+
2015
+ Twelve instances, at most two at once, every one labelled for the sweep and deleted; the workspace listed no instance
2016
+ after. One fresh VM's tunnel failed to open for the daemon's upload, so a tunnel that fails before its SSH handshake is
2017
+ opened again (four tries in all, within the call's bound). On type `vm` with `agent37-base`: the POST answered `running` in about 1 s (the provider's whole create,
2018
+ daemon included, 4 to 8 s); the read-back held `deny-all`, no public port, `auto_sleep: false`, 2 CPUs and 4 GB,
2019
+ dotted metadata keys and odd values; metadata's cap is 4096 bytes serialized, exactly; commands run as uid 0 on
2020
+ Debian 12 under the platform's own init; 3 MiB of stdin took half a second over the tunnel; the daemon started, hello
2021
+ answered with fence `netns`, and its programs ran as 2510 with no capability and no DNS. On type `default` (gVisor,
2022
+ kernel `4.19.0-gvisor`): root has no `CAP_SYS_ADMIN`, and init made its namespace inside a user namespace of its own
2023
+ (fence `userns-netns`); the rest as on `vm`. The Archil mount itself is the conformance run's to show, on the box template.
2024
+
2025
+ ### The desktop: agentrun-box
2026
+
2027
+ `create({ kind: "desktop", ... })` (serve builds the descriptor's desktop configuration so) makes a desktop: the
2028
+ adapter gives init `DISPLAY` and starts `Xvfb :0 -screen 0 1280x800x24 -nolisten tcp` through the daemon as the tool
2029
+ user (`src/desktop.ts`), as on E2B, so the X server is one process in init's table, in its own network namespace, and
2030
+ ends with the computer. Its default image is `agentrun-box` (`AGENT37_BOX_TEMPLATE`): `box/Dockerfile` (the archil
2031
+ client, the helper, the tool user, FUSE, no sudo) plus Xvfb, built as a template of the key's own workspace by
2032
+ `box/build-agent37.mjs`:
2033
+
2034
+ ```sh
2035
+ AGENT37_API_KEY=... node packages/computer/box/build-agent37.mjs # prints template=agentrun-box
2036
+ ```
2037
+
2038
+ Agent37 keeps a template's revisions under one name, so the name is fixed and the recipe's hash (the Dockerfile, the
2039
+ helper and the desktop's lines in the script) is in the template's description: a workspace whose template names the
2040
+ hash already is built nothing, and a changed recipe publishes a new revision, which every instance made after it starts
2041
+ from. The script's calls: `GET /v1/templates/agentrun-box`, then `POST /v1/template-builds` (`name`, `size_bytes`,
2042
+ `description`), a `PUT` of the gzipped context (the Dockerfile and the helper at its root) to the presigned
2043
+ `upload_url` with no Agent37 key, `POST .../{id}/start`, and `GET .../{id}/logs?offset=N` until `succeeded` or `failed`.
2044
+ Builds are free, at most three at once per workspace and 45 minutes each (docs: templates, "Build an image in the
2045
+ cloud"). A workspace template is the workspace's own, so each workspace that runs desktops builds it once first.
2046
+
2047
+ Why not Agent37's own `agent37-ubuntu`, which ships a desktop: its image (`ghcr.io/agent37-platform/ubuntu:2026.10.13c`,
2048
+ entrypoint `images/vm/ubuntu/entrypoint.sh` of agent37-platform/templates) runs `Xtigervnc :1 ... -ac` as root, with
2049
+ access control off, and an XFCE session as root on it. Any process in the machine can open that display, so a tool
2050
+ driving it, or merely connecting to `/tmp/.X11-unix/X1`, could type into root's terminal: the tool user would have a way
2051
+ to root. It has no Xvfb, no archil client and no helper either, and it is Ubuntu with `sudo` installed. The box image is
2052
+ also the one an Archil computer needs, so one template serves both.
2053
+
2054
+ ### Sources
2055
+
2056
+ Agent37's docs under `https://www.agent37.com/docs/agents-api/` (instances create, get, list, edit, delete and object;
2057
+ errors; instance-sizing; vm-instances; instance-network; ssh; templates; custom-image), read 2026-11-13; npm
2058
+ `agent37@0.4.1` `src/cli.js` (the tunnel); `ssh2@1.17.0` (`lib/client.js`, `lib/Channel.js`, `lib/utils.js`); and
2059
+ the live runs above.
2060
+
2045
2061
  ## Orgo: Windows and macOS desktops (parked)
2046
2062
 
2047
2063
  Orgo offers its Linux desktop alone, which runs computerd (`src/orgo.ts`). Its Windows and macOS desktops are parked:
@@ -2159,7 +2175,7 @@ and are never in a ref, a list, an error's words or a report. `client` stays a `
2159
2175
  | groups (`CAPABILITIES`) | `cdp`, `stream` | `cdp`, `stream` |
2160
2176
  | test connection | one `GET /v1/sessions?status=RUNNING` | one `GET /browsers?status=active` page |
2161
2177
  | release | `REQUEST_RELEASE`, then read back until it is no longer `RUNNING` or `PENDING` | `DELETE`, then read back until 404 or `deleted_at` |
2162
- | options | `apiKey` (or `api`, a host's own calls), `projectId`, `apiUrl` | `apiKey` (or `request`, a host's own), `apiUrl` |
2178
+ | options | `apiKey`, `projectId`, `apiUrl`, `fetch` | `apiKey`, `apiUrl`, `fetch` |
2163
2179
  | conformance reads | `COMPUTER_BROWSERBASE_API_KEY`, `COMPUTER_BROWSERBASE_PROJECT_ID`, `COMPUTER_BROWSERBASE_API_URL` | `COMPUTER_KERNEL_API_KEY`, `COMPUTER_KERNEL_API_URL` |
2164
2180
 
2165
2181
  Both declare `lifetime: "vendor"`, `network: ["open"]`, `isolation: "vm"`, `release: ["delete"]`, and no `extend`
@@ -2194,10 +2210,9 @@ kind browser that declares them.
2194
2210
  A pointer is a capability: whoever holds it opens the profile, so no error's words carry one.
2195
2211
 
2196
2212
  A vendor call is one request, never retried where a retry could open a second paid browser, and a failure names the
2197
- call and the HTTP status alone, never the vendor's words. A host that already talks to the vendor passes its own
2198
- transport: `BrowserbaseApi` (its optional calls back the features of the same name: one without them declares none of
2199
- those) or `KernelRequest`. Its thrown error rides the failure as a hidden
2200
- cause (`causeOf(result)`), not enumerable, so it is in no JSON.
2213
+ call and the HTTP status alone, never the vendor's words. The calls are the provider's own, over `fetch` (a test passes
2214
+ its own `fetch`). A thrown error rides the failure as a hidden cause (`causeOf(result)`), not enumerable, so it is in no
2215
+ JSON.
2201
2216
 
2202
2217
  Each create writes one more label beside the spec's, `agentrun.create` (`CREATE_LABEL`), with a value of its own. A
2203
2218
  create whose outcome is unknown (its reply lost, cut short, answered 5xx or with no browser, or the caller's signal
@@ -2226,7 +2241,7 @@ on the machine AgentRun runs on. No vendor, no key, nothing billed.
2226
2241
  import { LocalBrowserProvider } from "@parcha/agentrun-computer/local-chrome";
2227
2242
 
2228
2243
  const local = new LocalBrowserProvider({ env: { PATH: process.env.PATH } }); // or { executablePath: "/usr/bin/chromium" }
2229
- const made = await local.create({ image: "chromium", lifetimeMs: 30 * 60_000, network: "open" });
2244
+ const made = await local.create({ image: "chromium", lifetimeMs: 30 * 60_000, network: "open" }, { requestId: "r1#3" });
2230
2245
  const connected = await local.connect(made.value); // connected.value.cdp.url: ws://127.0.0.1:<port>/devtools/browser/<id>
2231
2246
  await local.release(made.value, "delete");
2232
2247
  ```
@@ -2300,17 +2315,30 @@ AGENTRUN_COMPUTER_LIVE_LOCAL_CHROME=1 [COMPUTER_LOCAL_CHROME_PATH=/usr/bin/chrom
2300
2315
  import { providerFor } from "@parcha/agentrun-computer";
2301
2316
 
2302
2317
  const phones = await providerFor("phone-harness", { apiKey }); // serve passes PHONE_HARNESS_API_KEY
2303
- const made = await phones.create({ image: "android", lifetimeMs: 10 * 60_000, network: "open", labels: { run } });
2318
+ const made = await phones.create({ image: "android", lifetimeMs: 10 * 60_000, network: "open", labels: { run } }, { requestId: "r1#3" });
2304
2319
  ```
2305
2320
 
2306
2321
  `src/phone-harness.ts`, provider id `phone-harness`, rents a temporary cloud Android emulator from the phone harness
2307
2322
  (phone-harness.com). The phone harness bills it at 5 cents a minute from the account's credit. A cloud iPhone (driven by
2308
2323
  the API's control URL) is a later change: `platform: "ios"` is refused in words.
2309
2324
 
2310
- - **No daemon.** Nothing runs on the phone. `connect()` asks the phone harness for the session's adb link, runs
2311
- connects to it, unlocks the phone with the session's code (never in a result or an error) and probes it. Its hello
2312
- carries what the probe read: `arch` from `getprop ro.product.cpu.abi`, and `osVersion`, the Android release from
2313
- `getprop ro.build.version.release` (such as `"15"`; absent when the phone says none).
2325
+ - **phoned, the phone's driver.** `connect()` asks the phone harness for the session's adb link, connects to it,
2326
+ unlocks the phone with the session's code (never in a result or an error) and probes it. Then it starts phoned
2327
+ (`daemon-android/`, one dex jar built by `npm run build:phoned` into `dist/phoned.jar`) and speaks the protocol to it:
2328
+ - The jar goes to `/data/local/tmp/phoned-<sha256 prefix>.jar` only when the phone lacks it: pushed beside that name,
2329
+ moved there and its sha256 checked, so a jar of that name is always whole.
2330
+ - phoned runs as the shell user through `app_process`, scrcpy's way in, on adb's `exec:` service, whose socket
2331
+ carries its stdin and stdout raw; its stderr goes to a log beside the jar, which a failed hello names.
2332
+ - The hello is phoned's own, checked for this provider's version and protocol (`drift.version`'s words).
2333
+ - UiAutomation is one per phone, so one phoned answers every connection to a phone. Closing a connection cancels
2334
+ its own calls; the last close ends phoned (its stdin closes), then drops the adb transport. A phoned that ends on
2335
+ its own fails its connections' calls with `gone`, and the next connect starts another.
2336
+ - A phoned holds the phone's UiAutomation until it exits, a moment after its stdin closes, so the next phoned on a
2337
+ phone starts only once the last is gone: the provider keeps each phoned's pid and start time (its shell writes them
2338
+ before `app_process` takes its place, so a pid another process took later is not it) and waits on the phone up to
2339
+ 10 s for that process to end, kills it then, and fails
2340
+ the connect in words if a kill leaves it running. A UiAutomation held by something else (`uiautomator dump`, an
2341
+ instrumentation test, Appium) is not waited for: the first ui call is `unsupported` in words that name them.
2314
2342
  - Neither the endpoint nor the code is ever in a spawned adb's argv, which `/proc` shows to every user of the host.
2315
2343
  The endpoint goes to the local adb server over its socket protocol (`host:connect`, `host:devices-l`,
2316
2344
  `host:disconnect`). The unlock is the vendor's shell command `unlock <code>`, once per connection; every shell
@@ -2319,34 +2347,15 @@ the API's control URL) is a later change: `platform: "ios"` is refused in words.
2319
2347
  spawned adb names the phone by the adb server's transport id (`-t <id>`). A shell's stdin cannot carry the unlock:
2320
2348
  a shell with no command string is answered `locked` (live run 3); the socket path unlocked a phone live (probe 1).
2321
2349
 
2322
- Then it gives
2323
- a client in this process that answers each protocol method with adb commands:
2324
- - `screen.shot`/`screen.read`: a raw `screencap`, cropped to the region and encoded as an RGBA PNG; `scale` is the
2325
- density over 160;
2326
- - `screen.watch`: PNG frames (`format: "png"`) from `screencap`, read once a second at most, across calls too (an
2327
- animated screen acked at once is no faster), a new frame only when the pixels changed; `maxWidth` scales by the
2328
- nearest pixel, and `quality` has no effect on a PNG. A cancel or the connection's close ends a screencap and a
2329
- wait in flight;
2330
- - `input.actions`: checked whole first (`checkActions`). Then:
2331
- - tap and long press;
2332
- - swipe: `input swipe`, or `input motionevent` for a path of three points or more. Its `ms` is shared between the
2333
- moves as `sleep`s, by each segment's length, so it lasts `ms` at least;
2334
- - the back, home and app switch buttons;
2335
- - `type`, by `input text`: ASCII and line breaks. A literal `%s` is split across two calls, so it is not read as
2336
- a space;
2337
- - one key at a time (`input keyevent`), and `wait`.
2338
-
2339
- A cancelled batch stops at the action it is on, a `wait` included, and answers failed, kind `aborted`, there;
2340
- - `apps.list` (`pm list packages`, and the app in front from `dumpsys activity activities`), `apps.launch` (its
2341
- launcher activity, `am start -W --activity-clear-task`, so the app named is in front and not what its task last
2342
- held: on Android 15 Settings' task keeps search, another package, on top) and `apps.terminate` (`am force-stop`);
2343
- - `apps.ui_tree`: `uiautomator dump`.
2344
-
2345
- exec, files, processes and tar are refused in words: a phone has no shell in the computer protocol. So are pinch
2346
- (adb's `input` has one finger), hold, a combo of keys, `apps.install` and `deadline.extend`.
2347
- - **Capabilities.** Kind and os `android`, daemon `none`, lifetime `vendor`, network `open`, release `delete` only.
2348
- Groups `screen`, `input.touch`, `input.keys`, `apps` and `apps.ui_tree`. `maxLifetimeMs` is 30 min by default. No
2349
- mount, no extend.
2350
+ phoned answers on the phone itself (`daemon-android/README.md` has each method): `exec.run` as the shell user,
2351
+ `screen.shot`/`screen.read`/`screen.watch` scaled on the phone, `input.actions` through InputManager (taps, swipes,
2352
+ a pinch, key combos and holds, Unicode text through the clipboard), `apps.list`/`apps.launch`/`apps.terminate`, and
2353
+ the `ui` group (`ui.observe`, `ui.act`) from UiAutomation. files, processes and tar are refused in words, as are `apps.install` and
2354
+ `deadline.extend`.
2355
+ - **Capabilities.** Kind and os `android`, daemon `none` (nothing is installed: phoned lives as long as the phone's
2356
+ connections), lifetime `vendor`, network `open`, release `delete` only.
2357
+ Groups `exec`, `screen`, `input.touch`, `input.keys`, `apps` and `ui`. `maxLifetimeMs` is 30 min by default.
2358
+ No mount, no extend.
2350
2359
  - **create** asks for `timeout_seconds` = the lifetime, and the phone harness ends the session then, whatever happens.
2351
2360
  The lifetime includes the boot, so a phone ready past its deadline fails `timeout`.
2352
2361
  - Each POST carries an Idempotency-Key, and a create whose answer is uncertain is found by it, never sent twice.
@@ -2399,17 +2408,19 @@ Conformance (`src/conformance/phone-harness.ts`) reads `COMPUTER_PHONE_HARNESS_A
2399
2408
  `maxLifetimeMs`.
2400
2409
 
2401
2410
  With no fixture app (it takes no files), the touch, keys and apps cases drive the stock Settings app and read back
2402
- through `apps.ui_tree` (`src/conformance/cases/settings.ts`):
2411
+ through `ui.observe` (`src/conformance/cases/settings.ts`):
2403
2412
  - `touch.tap`: a tap on a row opens its page: the row's title shows, as a text or a label (Android 15's page has it
2404
2413
  only as its toolbar's content-desc), and the next row is gone. Back comes back. When the page does not
2405
2414
  come, its words say what it saw: the screen in px and dp, what is in front, the tap point and the row's bounds,
2406
2415
  whether the title shows outside the list, and whether the next row is still shown;
2407
2416
  - `touch.swipe`: a swipe up moves the list up;
2408
2417
  - `input.type-text` and `input.key-table-refuses-unknown`: the text read back from the search field;
2409
- - `apps.launch-terminate`, which needs the apps group alone: Settings is listed; once launched it is in front, and
2410
- shown, in `apps.ui_tree` when the phone has one, else in a screenshot other than the one before; once terminated it
2411
- is not in front;
2412
- - `apps.ui-tree-shape`: the tree's shape, on Settings.
2418
+ - `apps.launch-terminate`, which needs the apps group alone: the ui fixture where it is installed, else Settings, is
2419
+ listed; once launched it is in front, and shown, in `ui.observe` when the phone reads its elements, else in a
2420
+ screenshot (or `ui.observe`'s image) other than the one before; once terminated it is not in front;
2421
+ - `apps.launch-window`: once `apps.launch` answers, a `ui.observe` sent at once finds the app's window (launch waits
2422
+ for it, at most 10 s), on the ui fixture where it is installed, else on Settings;
2423
+ - `ui.observe-shape`: the observation's shape, on the ui fixture where it is installed, else on Settings.
2413
2424
 
2414
2425
  `touch.pinch` skips in the provider's own refusal.
2415
2426
 
@@ -2427,7 +2438,8 @@ npm run conformance -w @parcha/agentrun-computer -- --provider ./my-provider.js
2427
2438
 
2428
2439
  ```text
2429
2440
  computer conformance · docker · linux, daemon pid1 · computerd 0.1.0-beta.30 linux/amd64
2430
- core health hello ping unknown-method kind-consistent ✓ 4
2441
+ core health hello ping unknown-method kind-consistent ✓ 5
2442
+ kind-served
2431
2443
  core exec argv streams exit-code cwd env timeout abort ✓ 11
2432
2444
  truncation setsid-escapee unprivileged user
2433
2445
  ...
@@ -2436,7 +2448,7 @@ full lifetime extend - 1
2436
2448
  optional screen screenshot-size - 1
2437
2449
  - screen.screenshot-size: the provider does not declare screen
2438
2450
  ...
2439
- core PASS 54/54 · 10 optional cases skipped, not declared · full 10/13 · mount:archil screen input.pointer input.keys input.touch apps.install apps apps.ui_tree extend not declared
2451
+ core PASS 55/55 · 10 optional cases skipped, not declared · full 10/13 · mount:archil screen input.pointer input.keys input.touch apps.install apps ui extend not declared
2440
2452
  ```
2441
2453
 
2442
2454
  An id is resolved through the provider registry, and only there; the usage lists every id it holds. A module path is
@@ -2521,7 +2533,8 @@ Core and Full follow the Kubernetes agent-sandbox conformance levels (KEP-539.2)
2521
2533
  [The protocol extension](#the-protocol-extension-kind-daemon-modes-screen-input-apps-lifetime)): exec, files,
2522
2534
  processes and network `none` wherever computerd runs, screen and keyboard and pointer on a desktop, screen and touch
2523
2535
  on a phone. `health.kind-consistent` checks the kind, os and daemon pair, that hello's kind and groups are the
2524
- provider's, and that kind's Core groups are declared; `provider.check-refuses` also asks `check` for
2536
+ provider's, and that kind's Core groups are declared; `health.kind-served` that hello declares every group its
2537
+ setting kind needs to be given to an agent (`kindServed`); `provider.check-refuses` also asks `check` for
2525
2538
  `maxLifetimeMs + 1`. Where the kind makes them Core: `screen.screenshot-size` (every pixel of the PNG decodes, its
2526
2539
  IHDR size is `width` x `height`, `scale` is above 0, a region shot decodes and has the region's size, and on a
2527
2540
  desktop the fixture's four colors are where it paints them; the suite reads 8-bit, non-interlaced PNGs of at most
@@ -2531,8 +2544,8 @@ Core and Full follow the Kubernetes agent-sandbox conformance levels (KEP-539.2)
2531
2544
  kind `invalid`, and runs nothing), `input.actions-stops-at-first-failure` (move, left button down, move off the screen,
2532
2545
  click: `done` 2, the press released where it was, no click, and a later click lands, so nothing was left held), `touch.tap` and `touch.swipe` (the
2533
2546
  fixture app logs the tap at its point, and the swipe's start and end), `apps.install-launch` (installed, listed, in
2534
- front when launched and not when terminated) and `apps.ui-tree-shape` (every node typed as the protocol says, inside
2535
- the screenshot, with the fixture's button found by its id and text).
2547
+ front when launched and not when terminated) and `ui.observe-shape` (every node typed as the protocol says, inside
2548
+ its window, with the fixture's button found by its id and text).
2536
2549
  - **Full** is each optional capability a provider declares: network `open` (`network:open`), a network allowlist
2537
2550
  (`network:allow`), each with a change of a computer's network to it and back to `none`, refused or applied
2538
2551
  truthfully, on a computer of the case's own (`provider.network-switch`, `provider.network-switch-allow`), the janitor for a provider whose lifetime is `"janitor"` and that stops computers and keeps them
@@ -2577,8 +2590,8 @@ installed with `apps.install` and launched, logging to its files directory, with
2577
2590
  `ai.agentrun.fixture:id/button` that reads `agentrun fixture`). Each event is one JSON line (`ready`, `down`/`up` with
2578
2591
  button and point, `wheel`, `key`, `text`, `touch` with finger and phase); `src/conformance/fixture.ts` is the
2579
2592
  contract. A case that needs it and was given none skips, so Core cannot pass on a desktop or phone without it. The
2580
- fixture is stopped when its case ends, once launched, even when it never logged ready. A phone that declares neither files nor `apps.ui_tree` skips the touch cases:
2581
- `no way to observe the effect: declare files or apps.ui_tree`.
2593
+ fixture is stopped when its case ends, once launched, even when it never logged ready. A phone that declares neither files nor `ui` skips the touch cases:
2594
+ `no way to observe the effect: declare files or ui`.
2582
2595
 
2583
2596
  The suite makes every computer with the label `agentrun.conformance=<run id>`, image `--image`, a 30-minute lifetime
2584
2597
  and network `none` (`open` for a phone that declares no `none`, since its kind does not require it). It deletes each computer a case made when the case ends, and the shared one at the end; for a
@@ -2590,8 +2603,8 @@ its case ended is deleted or closed as it arrives and named in `cleanup.late`; t
2590
2603
  create a case started, a refused one included, so a late computer is deleted before the report returns. A call still
2591
2604
  pending when that bound (a minute) runs out is named in `cleanup.errors`, since what it makes may be left, and Core
2592
2605
  fails, as it does for a computer left behind. A case calls
2593
- `t.create(extra)` for a computer it needs, or `t.attempt(spec, by?)` for create's result as it is (a refusal it
2594
- expects, or the drifted provider's computer). With `--provider docker` and no
2606
+ `t.create(extra)` for a computer it needs, or `t.attempt(spec, by?, requestId?)` for create's result as it is (a refusal it
2607
+ expects, or the drifted provider's computer; each attempt is a new request unless `requestId` retries one). With `--provider docker` and no
2595
2608
  `COMPUTER_DOCKER_DAEMON`, a `docker version` that does not answer within 30 s is killed and the run fails, naming the call. The CLI exits once the report
2596
2609
  is out. Cases do not assume root: the suite assumes only that the
2597
2610
  computer's `HOME`, which the provider sets, is a directory its user can write, and works under
@@ -2735,7 +2748,7 @@ and `alpine:3.20` pulled, both builds, and Go on PATH (the drift case builds a d
2735
2748
  the daemon for Docker's own architecture, and remove every container they make by its exact name, pass or fail.
2736
2749
  `test/docker/image.docker.test.mjs` builds fresh `alpine:3.20` recipes: once for three concurrent callers, reused on
2737
2750
  the next call, from three processes at once, and a broken one refused in words; it removes each tag it made. Another,
2738
- `test/docker/modal-commands.docker.test.mjs`, runs the Modal provider's entrypoint and upload exactly as sent, in
2751
+ `test/docker/pid1-commands.docker.test.mjs`, runs the adapter's pid1 entrypoint and install (Modal's) exactly as sent, in
2739
2752
  a Debian and an Alpine root container with no network, and checks that init comes up as uid 1000 with no capabilities
2740
2753
  and `no_new_privs`, and answers hello over `computerd stdio`. Those root containers keep Docker's default
2741
2754
  capabilities and add CAP_SYS_ADMIN and CAP_NET_ADMIN (init `--own-network` needs both, and Modal's root holds every