@parcha/agentrun-serve 0.1.0-beta.34 → 0.1.0-beta.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +263 -0
- package/README.md +339 -179
- package/dist/adapters.d.ts +15 -2
- package/dist/adapters.js +34 -2
- package/dist/agent-rows.d.ts +3 -1
- package/dist/agents-store.d.ts +2 -0
- package/dist/agents-store.js +25 -5
- package/dist/api-only.d.ts +2 -1
- package/dist/api-only.js +3 -1
- package/dist/archil-routes.d.ts +40 -7
- package/dist/archil-routes.js +167 -54
- package/dist/archil-settings.d.ts +90 -8
- package/dist/archil-settings.js +150 -14
- package/dist/attach-images.d.ts +15 -0
- package/dist/attach-images.js +59 -0
- package/dist/background.d.ts +0 -6
- package/dist/background.js +0 -28
- package/dist/bash-read-only.d.ts +13 -0
- package/dist/bash-read-only.js +77 -0
- package/dist/box-image.d.ts +1 -97
- package/dist/box-image.js +4 -284
- package/dist/box-paths.d.ts +2 -7
- package/dist/box-paths.js +7 -13
- package/dist/box-settings.d.ts +0 -11
- package/dist/box-settings.js +4 -29
- package/dist/browser-commands.js +1 -1
- package/dist/browser-computer.d.ts +47 -3
- package/dist/browser-computer.js +286 -18
- package/dist/browser-cost.d.ts +2 -2
- package/dist/browser-cost.js +6 -4
- package/dist/browser-person.d.ts +19 -2
- package/dist/browser-person.js +55 -6
- package/dist/browser-wait-ended.d.ts +23 -0
- package/dist/browser-wait-ended.js +42 -0
- package/dist/cap.d.ts +19 -44
- package/dist/cap.js +31 -77
- package/dist/cli.js +36 -27
- package/dist/computer-keys.d.ts +20 -10
- package/dist/computer-keys.js +36 -57
- package/dist/computer-routes.d.ts +1 -4
- package/dist/computer-routes.js +3 -5
- package/dist/computer-setting.d.ts +8 -5
- package/dist/computer-setting.js +91 -26
- package/dist/computer-view.d.ts +11 -2
- package/dist/computer-view.js +2 -1
- package/dist/computers.d.ts +54 -8
- package/dist/computers.js +101 -22
- package/dist/console/assets/index-BI4Byidu.js +550 -0
- package/dist/console/assets/index-C19gUF2n.css +1 -0
- package/dist/console/index.html +2 -2
- package/dist/content-filter.d.ts +7 -0
- package/dist/content-filter.js +23 -0
- package/dist/decision-cap.d.ts +7 -29
- package/dist/decision-cap.js +3 -94
- package/dist/docker-daemon.d.ts +2 -2
- package/dist/docker-daemon.js +2 -2
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +8 -5
- package/dist/explain.js +3 -1
- package/dist/faux-computers.js +4 -0
- package/dist/files.d.ts +1 -9
- package/dist/files.js +1 -9
- package/dist/github-connection.js +25 -7
- package/dist/github-faux.d.ts +26 -0
- package/dist/github-faux.js +76 -0
- package/dist/github.d.ts +28 -4
- package/dist/github.js +46 -10
- package/dist/gpu-words.d.ts +14 -0
- package/dist/gpu-words.js +21 -0
- package/dist/graph-served.d.ts +5 -3
- package/dist/graph-served.js +14 -6
- package/dist/graph-view.d.ts +2 -0
- package/dist/graph-view.js +29 -2
- package/dist/handed-values.d.ts +1 -1
- package/dist/handed-values.js +1 -1
- package/dist/harness-install.d.ts +60 -3
- package/dist/harness-install.js +322 -34
- package/dist/harness-opencode/harness.js +0 -1
- package/dist/harness-opencode/host/policy.js +2 -2
- package/dist/harness.js +1 -1
- package/dist/host-tools.d.ts +8 -9
- package/dist/host-tools.js +7 -7
- package/dist/index.d.ts +2 -3
- package/dist/index.js +2 -2
- package/dist/key-refusal.d.ts +1 -1
- package/dist/key-refusal.js +2 -2
- package/dist/learn/check.d.ts +10 -2
- package/dist/learn/check.js +126 -8
- package/dist/learn/commit.d.ts +40 -6
- package/dist/learn/commit.js +164 -20
- package/dist/learn/folder.d.ts +11 -3
- package/dist/learn/folder.js +40 -16
- package/dist/learn/grade.d.ts +22 -2
- package/dist/learn/grade.js +127 -19
- package/dist/learn/index.d.ts +2 -2
- package/dist/learn/index.js +2 -2
- package/dist/learn/learning.sh +11 -13
- package/dist/learn/notes.d.ts +17 -3
- package/dist/learn/notes.js +19 -6
- package/dist/learn/reflect.d.ts +5 -2
- package/dist/learn/reflect.js +48 -32
- package/dist/learn/skills.d.ts +52 -5
- package/dist/learn/skills.js +104 -21
- package/dist/learned-nodes.d.ts +18 -0
- package/dist/learned-nodes.js +8 -0
- package/dist/learned-workflow.d.ts +27 -13
- package/dist/learned-workflow.js +110 -38
- package/dist/learning-cost.d.ts +79 -0
- package/dist/learning-cost.js +69 -0
- package/dist/learning-routes.d.ts +48 -2
- package/dist/learning-routes.js +99 -28
- package/dist/learning-run.d.ts +7 -5
- package/dist/learning-run.js +9 -6
- package/dist/learning-words.d.ts +3 -0
- package/dist/learning-words.js +6 -2
- package/dist/learning.d.ts +13 -28
- package/dist/learning.js +4 -18
- package/dist/llm.d.ts +4 -1
- package/dist/llm.js +4 -2
- package/dist/mcp-gateway.d.ts +6 -0
- package/dist/mcp-gateway.js +11 -1
- package/dist/mcp-probe.d.ts +8 -1
- package/dist/mcp-probe.js +62 -20
- package/dist/mcp-secret-writes.js +4 -0
- package/dist/mcp-servers-store.d.ts +12 -12
- package/dist/mcp-servers-store.js +8 -3
- package/dist/model.d.ts +8 -5
- package/dist/model.js +14 -6
- package/dist/openapi.d.ts +2 -0
- package/dist/openapi.js +236 -55
- package/dist/owner.d.ts +0 -1
- package/dist/owner.js +0 -2
- package/dist/pause.d.ts +2 -19
- package/dist/pause.js +5 -74
- package/dist/place-offers.d.ts +97 -0
- package/dist/place-offers.js +206 -0
- package/dist/place.d.ts +9 -13
- package/dist/place.js +22 -32
- package/dist/port-models.d.ts +12 -4
- package/dist/port-models.js +31 -9
- package/dist/print.d.ts +1 -8
- package/dist/print.js +1 -14
- package/dist/propose.d.ts +3 -0
- package/dist/propose.js +25 -19
- package/dist/run-cut.d.ts +5 -0
- package/dist/run-cut.js +19 -0
- package/dist/run-db.js +3 -3
- package/dist/run-launch.d.ts +18 -3
- package/dist/run-launch.js +11 -5
- package/dist/run-learning-served.d.ts +12 -1
- package/dist/run-manifest.d.ts +2 -2
- package/dist/run-manifest.js +2 -2
- package/dist/run-reads-over-store.d.ts +4 -2
- package/dist/run-reads-over-store.js +10 -8
- package/dist/run-secrets.js +3 -3
- package/dist/run-timeline-served.js +60 -38
- package/dist/run-view.d.ts +35 -16
- package/dist/run-view.js +64 -35
- package/dist/runnable.d.ts +6 -3
- package/dist/runnable.js +20 -4
- package/dist/runner/adapter-loop.d.ts +46 -5
- package/dist/runner/adapter-loop.js +381 -56
- package/dist/runner/adapter-run-spec.d.ts +46 -4
- package/dist/runner/adapter-run-spec.js +200 -45
- package/dist/runner/adapters/pi.d.ts +39 -3
- package/dist/runner/adapters/pi.js +124 -29
- package/dist/runner/beside.d.ts +8 -0
- package/dist/runner/beside.js +24 -2
- package/dist/runner/claim-secrets.d.ts +6 -0
- package/dist/runner/claim-secrets.js +15 -1
- package/dist/runner/cli-run-spec.d.ts +10 -0
- package/dist/runner/cli-run-spec.js +207 -64
- package/dist/runner/commands.d.ts +5 -1
- package/dist/runner/commands.js +3 -3
- package/dist/runner/conformance/harness.d.ts +1 -1
- package/dist/runner/conformance/harness.js +13 -10
- package/dist/runner/github-app.d.ts +7 -2
- package/dist/runner/github-app.js +46 -15
- package/dist/runner/harness-loops.d.ts +6 -1
- package/dist/runner/harness-loops.js +24 -1
- package/dist/runner/journal-kinds.d.ts +53 -7
- package/dist/runner/journal-kinds.js +29 -1
- package/dist/runner/learning-end.d.ts +15 -0
- package/dist/runner/learning-end.js +113 -20
- package/dist/runner/learning-factory.js +6 -2
- package/dist/runner/learning-loop.d.ts +75 -1
- package/dist/runner/learning-loop.js +215 -22
- package/dist/runner/learning-seed.d.ts +8 -0
- package/dist/runner/learning-seed.js +7 -1
- package/dist/runner/loop-contract.d.ts +12 -0
- package/dist/runner/loop-contract.js +6 -0
- package/dist/runner/loop.d.ts +5 -1
- package/dist/runner/loop.js +20 -0
- package/dist/runner/main.d.ts +9 -4
- package/dist/runner/main.js +38 -13
- package/dist/runner/mcp-claim.d.ts +7 -0
- package/dist/runner/mcp-claim.js +35 -2
- package/dist/runner/mcp-github.d.ts +15 -4
- package/dist/runner/mcp-github.js +55 -11
- package/dist/runner/mcp-run.d.ts +2 -0
- package/dist/runner/mcp-run.js +2 -0
- package/dist/runner/metrics.d.ts +18 -1
- package/dist/runner/metrics.js +81 -1
- package/dist/runner/model-route.d.ts +6 -0
- package/dist/runner/model-route.js +5 -2
- package/dist/runner/pr-checkout.d.ts +59 -0
- package/dist/runner/pr-checkout.js +176 -0
- package/dist/runner/reflect-hook.d.ts +1 -0
- package/dist/runner/reflect-hook.js +3 -3
- package/dist/runner/runner.js +136 -19
- package/dist/runner/spec-holds.d.ts +13 -3
- package/dist/runner/spec-holds.js +13 -10
- package/dist/runner/store-port.d.ts +4 -1
- package/dist/runner/store-secrets.js +17 -1
- package/dist/runner/subagent.d.ts +44 -0
- package/dist/runner/subagent.js +188 -0
- package/dist/runner/workflow-host.d.ts +25 -4
- package/dist/runner/workflow-host.js +26 -4
- package/dist/runner/workflow-loop.d.ts +9 -3
- package/dist/runner/workflow-loop.js +17 -10
- package/dist/runner/workflow-spec.d.ts +28 -13
- package/dist/runner/workflow-spec.js +247 -102
- package/dist/runs-over-store.d.ts +18 -7
- package/dist/runs-over-store.js +149 -31
- package/dist/seal-key.d.ts +0 -2
- package/dist/seal-key.js +0 -2
- package/dist/sealing.js +1 -2
- package/dist/secret-cut.d.ts +1 -1
- package/dist/secret-cut.js +1 -1
- package/dist/server-lock.js +4 -5
- package/dist/server.d.ts +49 -63
- package/dist/server.js +429 -230
- package/dist/stop-signals.d.ts +4 -2
- package/dist/stop-signals.js +5 -3
- package/dist/store/agent-body.d.ts +14 -3
- package/dist/store/agent-body.js +22 -8
- package/dist/store/deadline.d.ts +18 -0
- package/dist/store/deadline.js +49 -0
- package/dist/store/index.d.ts +3 -3
- package/dist/store/index.js +2 -2
- package/dist/store/journal/storage.js +2 -1
- package/dist/store/postgres/connection.d.ts +4 -0
- package/dist/store/postgres/connection.js +64 -13
- package/dist/store/postgres/migrations/0004_runs_outcome_stop_or_cancel.sql +11 -0
- package/dist/store/schema.d.ts +2 -1
- package/dist/store/schema.js +11 -8
- package/dist/store/seal.d.ts +13 -0
- package/dist/store/seal.js +19 -0
- package/dist/store/sqlite/connection.d.ts +5 -0
- package/dist/store/sqlite/connection.js +88 -82
- package/dist/store/sqlite/run-patch.d.ts +18 -2
- package/dist/store/sqlite/run-patch.js +31 -2
- package/dist/store/sqlite/store.js +65 -11
- package/dist/store/store.d.ts +62 -12
- package/dist/store/store.js +22 -1
- package/dist/store-reads/analytics.js +3 -2
- package/dist/store-reads/cap.d.ts +1 -3
- package/dist/store-reads/cap.js +8 -6
- package/dist/store-reads/decisions.d.ts +2 -2
- package/dist/store-reads/decisions.js +3 -6
- package/dist/store-reads/journal.js +83 -15
- package/dist/store-reads/learning.d.ts +73 -3
- package/dist/store-reads/learning.js +232 -9
- package/dist/store-reads/runs.d.ts +6 -4
- package/dist/store-reads/runs.js +17 -10
- package/dist/store-reads/stats.js +5 -1
- package/dist/store-view.d.ts +15 -1
- package/dist/store-view.js +88 -29
- package/dist/template-eval.js +2 -1
- package/dist/templates.d.ts +73 -4
- package/dist/templates.js +113 -23
- package/dist/timeline/timeline.d.ts +11 -1
- package/dist/timeline/timeline.js +19 -4
- package/dist/tool-blurbs.js +1 -0
- package/dist/tool-budget.d.ts +26 -0
- package/dist/tool-budget.js +56 -0
- package/dist/tool-gate.d.ts +13 -3
- package/dist/tool-gate.js +15 -7
- package/dist/tool-plane.d.ts +42 -29
- package/dist/tool-plane.js +64 -27
- package/dist/tools.d.ts +53 -39
- package/dist/tools.js +174 -79
- package/dist/trigger-signatures.d.ts +1 -0
- package/dist/trigger-signatures.js +3 -1
- package/dist/triggers.d.ts +3 -3
- package/dist/triggers.js +2 -2
- package/dist/turn-end.d.ts +0 -3
- package/dist/turn-end.js +0 -3
- package/dist/uploads.d.ts +28 -5
- package/dist/uploads.js +82 -9
- package/dist/usage-lines.d.ts +1 -1
- package/dist/usage.d.ts +1 -47
- package/dist/usage.js +3 -82
- package/dist/validate.d.ts +8 -0
- package/dist/validate.js +40 -3
- package/dist/webhooks.d.ts +2 -1
- package/dist/webhooks.js +5 -2
- package/dist/workflow/decision-recovery.d.ts +23 -0
- package/dist/workflow/decision-recovery.js +80 -0
- package/dist/workflow/decisions.d.ts +134 -0
- package/dist/workflow/decisions.js +46 -0
- package/dist/workflow/host-session.d.ts +5 -0
- package/dist/workflow/host-session.js +85 -0
- package/dist/workflow/host-tools.d.ts +3 -0
- package/dist/workflow/host-tools.js +3 -0
- package/dist/workflow/node-runner.d.ts +112 -0
- package/dist/workflow/node-runner.js +270 -0
- package/dist/workflow/node.d.ts +88 -0
- package/dist/workflow/node.js +99 -0
- package/dist/workflow/operator-error.d.ts +4 -0
- package/dist/workflow/operator-error.js +4 -0
- package/dist/workflow/pi-versions.d.ts +9 -0
- package/dist/workflow/pi-versions.js +8 -0
- package/dist/workflow/readers.d.ts +36 -0
- package/dist/workflow/readers.js +145 -0
- package/dist/workflow/record-file.d.ts +10 -0
- package/dist/workflow/record-file.js +56 -0
- package/dist/workflow/record-tool.d.ts +76 -0
- package/dist/workflow/record-tool.js +126 -0
- package/dist/workflow/record.d.ts +151 -0
- package/dist/workflow/record.js +401 -0
- package/dist/workflow/run-error.d.ts +16 -0
- package/dist/workflow/run-error.js +26 -0
- package/dist/workflow/runner.d.ts +6 -0
- package/dist/workflow/runner.js +240 -0
- package/dist/workflow/store.d.ts +23 -0
- package/dist/workflow/store.js +242 -0
- package/dist/workflow/task.d.ts +133 -0
- package/dist/workflow/task.js +411 -0
- package/dist/workflow/thinking.d.ts +3 -0
- package/dist/workflow/thinking.js +7 -0
- package/dist/workflow/tool-context.d.ts +21 -0
- package/dist/workflow/tool-context.js +13 -0
- package/dist/workflow/types.d.ts +126 -0
- package/dist/workflow/types.js +1 -0
- package/dist/workflow/wal.d.ts +11 -0
- package/dist/workflow/wal.js +106 -0
- package/dist/workflow-run.d.ts +1 -1
- package/dist/workspace/agent-computer.d.ts +137 -0
- package/dist/workspace/agent-computer.js +292 -0
- package/dist/workspace/archil-claim.d.ts +13 -2
- package/dist/workspace/archil-claim.js +22 -13
- package/dist/workspace/archil-disk.d.ts +10 -1
- package/dist/workspace/archil-disk.js +4 -0
- package/dist/workspace/archil-disks.d.ts +49 -0
- package/dist/workspace/archil-disks.js +185 -0
- package/dist/workspace/archil-exec.d.ts +12 -2
- package/dist/workspace/archil-exec.js +18 -3
- package/dist/workspace/archil-mount-credential.d.ts +20 -4
- package/dist/workspace/archil-mount-credential.js +13 -4
- package/dist/workspace/archil.d.ts +2 -2
- package/dist/workspace/archil.js +25 -5
- package/dist/workspace/attach.js +2 -0
- package/dist/workspace/computer-deps.d.ts +18 -11
- package/dist/workspace/computer-deps.js +64 -40
- package/dist/workspace/computer-for-claim.d.ts +47 -9
- package/dist/workspace/computer-for-claim.js +236 -24
- package/dist/workspace/computer-janitor.d.ts +3 -2
- package/dist/workspace/computer-janitor.js +43 -9
- package/dist/workspace/computer-ledger.d.ts +3 -8
- package/dist/workspace/computer-ledger.js +7 -3
- package/dist/workspace/computer-providers.d.ts +5 -3
- package/dist/workspace/computer-providers.js +11 -9
- package/dist/workspace/hands.d.ts +5 -2
- package/dist/workspace/hands.js +4 -3
- package/dist/workspace/index.d.ts +5 -4
- package/dist/workspace/index.js +2 -1
- package/dist/workspace/local.d.ts +3 -0
- package/dist/workspace/local.js +9 -0
- package/dist/workspace/paths.js +3 -2
- package/dist/workspace/pi-env.d.ts +4 -0
- package/dist/workspace/pi-env.js +3 -2
- package/dist/workspace/resolve-computer.d.ts +48 -12
- package/dist/workspace/resolve-computer.js +88 -19
- package/dist/workspace/run-disk.d.ts +34 -0
- package/dist/workspace/run-disk.js +91 -0
- package/dist/workspace/run-tools.d.ts +6 -4
- package/dist/workspace/run-tools.js +17 -9
- package/dist/workspace/server-run-workspace.d.ts +3 -2
- package/dist/workspace/server-run-workspace.js +17 -4
- package/dist/workspace/workspace.d.ts +5 -0
- package/dist/workspace.d.ts +0 -3
- package/dist/workspace.js +2 -15
- package/package.json +11 -16
- package/skills/agentrun-serve/SKILL.md +1 -1
- package/templates/README.md +11 -8
- package/templates/code-review/agent.md +27 -11
- package/templates/code-review/evals/clean-refactor/graders/coverage.md +4 -0
- package/templates/code-review/evals/clean-refactor/graders/risk.md +5 -0
- package/templates/code-review/evals/injection/graders/ignores.md +1 -1
- package/templates/code-review/evals/mentions-defused/case.yaml +15 -0
- package/templates/code-review/evals/mentions-defused/fixtures/github-mcp.json +254 -0
- package/templates/code-review/evals/mentions-defused/graders/no-pings.md +16 -0
- package/templates/code-review/evals/mentions-defused/graders/posted-a-review.md +5 -0
- package/templates/code-review/evals/mentions-defused/graders/schema.md +5 -0
- package/templates/code-review/evals/mentions-defused/prompt.md +10 -0
- package/templates/code-review/evals/never-flag/case.yaml +3 -0
- package/templates/code-review/evals/never-flag/graders/only-p0.md +4 -0
- package/templates/code-review/evals/never-flag/graders/schema.md +5 -0
- package/templates/code-review/evals/never-flag/prompt.md +30 -0
- package/templates/code-review/evals/null-name/graders/finds.md +1 -1
- package/templates/code-review/evals/off-by-one/graders/finds.md +1 -1
- package/templates/code-review/evals/off-by-one/graders/no-repo-reads.md +6 -5
- package/templates/code-review/evals/re-review/graders/resolves.md +1 -1
- package/templates/code-review/evals/re-review/prompt.md +1 -1
- package/templates/code-review/evals/re-review-open/case.yaml +3 -0
- package/templates/code-review/evals/re-review-open/graders/schema.md +5 -0
- package/templates/code-review/evals/re-review-open/graders/stays-open.md +4 -0
- package/templates/code-review/evals/re-review-open/prompt.md +27 -0
- package/templates/code-review/evals/repo-rule/graders/cites.md +1 -1
- package/templates/code-review/evals/two-defects/case.yaml +3 -0
- package/templates/code-review/evals/two-defects/graders/both.md +4 -0
- package/templates/code-review/evals/two-defects/graders/schema.md +5 -0
- package/templates/code-review/evals/two-defects/prompt.md +25 -0
- package/templates/code-review/findings.schema.json +131 -27
- package/templates/code-review/rules/CODEREVIEW.md +76 -0
- package/templates/code-review/skills/review/DEEP.md +130 -0
- package/templates/code-review/skills/review/REVIEWER.md +116 -0
- package/templates/code-review/skills/review/SKILL.md +104 -154
- package/templates/kyb/evals/clean-public-company/graders/no-opensanctions.md +5 -0
- package/templates/kyb/evals/opensanctions-on/case.yaml +5 -0
- package/templates/kyb/evals/opensanctions-on/graders/licence-and-evidence.md +18 -0
- package/templates/kyb/evals/opensanctions-on/graders/schema.md +5 -0
- package/templates/kyb/evals/opensanctions-on/prompt.md +11 -0
- package/templates/release-notes/agent.md +11 -0
- package/dist/box/record.d.ts +0 -6
- package/dist/box/record.js +0 -41
- package/dist/box/sweep.d.ts +0 -53
- package/dist/box/sweep.js +0 -193
- package/dist/box-egress-vm.d.ts +0 -118
- package/dist/box-egress-vm.js +0 -354
- package/dist/box-egress.d.ts +0 -105
- package/dist/box-egress.js +0 -256
- package/dist/box-relay-vm.d.ts +0 -84
- package/dist/box-relay-vm.js +0 -437
- package/dist/box-relay.d.ts +0 -36
- package/dist/box-relay.js +0 -207
- package/dist/boxes.d.ts +0 -109
- package/dist/boxes.js +0 -249
- package/dist/budget.d.ts +0 -76
- package/dist/budget.js +0 -204
- package/dist/console/assets/index-RPHGlXmM.js +0 -540
- package/dist/console/assets/index-opTN5Naq.css +0 -1
- package/dist/daytona-api.d.ts +0 -10
- package/dist/daytona-api.js +0 -20
- package/dist/egress-proxy.d.ts +0 -45
- package/dist/egress-proxy.js +0 -416
- package/dist/egress-table.d.ts +0 -24
- package/dist/egress-table.js +0 -165
- package/templates/code-review/rules/REVIEW.md +0 -41
|
@@ -5,7 +5,7 @@ import type { ProviderFactories } from "../computer-keys.js";
|
|
|
5
5
|
import type { FauxComputers } from "../faux-computers.js";
|
|
6
6
|
import { type KeyEnv } from "../key-meta.js";
|
|
7
7
|
import type { Store } from "../store/index.js";
|
|
8
|
-
import { type ClaimComputer, type ClaimLaunch, computerForClaim, type ComputerForClaimDeps, type OpenComputerView } from "./computer-for-claim.js";
|
|
8
|
+
import { type ClaimComputer, type ClaimLaunch, computerForClaim, type ComputerForClaimDeps, type ComputerSaid, type OpenComputerView } from "./computer-for-claim.js";
|
|
9
9
|
import { type ProviderLoad } from "./computer-providers.js";
|
|
10
10
|
import { type KindRegistry } from "./resolve-computer.js";
|
|
11
11
|
/** How long a run's computer lives whatever happens to the server: a bound on a leaked one, never its clean end (the old
|
|
@@ -27,9 +27,6 @@ export declare function dockerLimitsOf(env: KeyEnv): DockerLimits;
|
|
|
27
27
|
* container): a comma list of IP addresses. The Docker provider's egress proxy refuses them as the host's, so a
|
|
28
28
|
* computer's allow-list never reaches the host itself; without them it refuses any allow-list there. */
|
|
29
29
|
export declare const DOCKER_HOST_ADDRESSES_ENV = "AGENTRUN_DOCKER_HOST_ADDRESSES";
|
|
30
|
-
/** The variables the local browser's provider finds its Chrome by (the computer package's findChrome): the server's own
|
|
31
|
-
* values are handed to it, and no other variable of the server's. */
|
|
32
|
-
export declare const CHROME_LOOKUP: readonly ["CHROME_PATH", "PI_BROWSER_CHROME", "PATH"];
|
|
33
30
|
/** `env`'s AGENTRUN_DOCKER_HOST_ADDRESSES: its addresses, each once; undefined when unset or empty, never one made up.
|
|
34
31
|
* An entry that is not an IP address throws, naming it: the server's start checks the setting, so no run meets one. */
|
|
35
32
|
export declare function dockerHostAddressesOf(env: KeyEnv): string[] | undefined;
|
|
@@ -71,23 +68,33 @@ export interface ComputerDepsOptions {
|
|
|
71
68
|
/** This machine's Docker daemon, asked when a Docker launch fails (docker-daemon.ts dockerDaemonCheck over `env`
|
|
72
69
|
* unless given; none under --faux, whose launch is its own). */
|
|
73
70
|
readonly daemon?: ComputerForClaimDeps["daemon"];
|
|
71
|
+
/** Why this machine cannot run a provider's computers, by its id (computers.ts hostCommandRefusals over this process's
|
|
72
|
+
* PATH): the claim refuses such a computer before it rents anything. Absent: not asked. */
|
|
73
|
+
readonly hostWhy?: Readonly<Record<string, string>>;
|
|
74
74
|
/** The live view's registration for a desktop or a phone (proxy-only): absent, no view is opened. */
|
|
75
75
|
readonly openComputerView?: OpenComputerView;
|
|
76
76
|
/** --faux's computers (faux-computers.ts), in place of the computer package's: their kind registry, key table, launch
|
|
77
77
|
* and factories. */
|
|
78
78
|
readonly faux?: FauxComputers;
|
|
79
79
|
}
|
|
80
|
-
/** The spec a computer of `kind` on `entry` is made with, besides its labels and its mount: its image (
|
|
81
|
-
* owner's AGENTRUN_DOCKER_IMAGE when set, else for a sandbox
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
80
|
+
/** The spec a computer of `kind` on `entry` is made with, besides its labels and its mount: its image (a provider that
|
|
81
|
+
* prepares its own image, its descriptor's prepareImage: the owner's AGENTRUN_DOCKER_IMAGE when set, else for a sandbox
|
|
82
|
+
* the package's recipe, which its prepareImage() builds; a provider whose descriptor declares imageEnv (Daytona's
|
|
83
|
+
* AGENTRUN_DAYTONA_SNAPSHOT): that variable's value in `env` when set; any other provider's, and such a one's while it
|
|
84
|
+
* is unset: its descriptor's defaultImage for the kind, the computer package's
|
|
85
|
+
* PROVIDERS[].defaultImage; a kind with none refused in words, a prepared desktop's saying it needs an image with an X
|
|
86
|
+
* server, which the recipe lacks), the leak bound for its lifetime (its clean end is the run's release), and its
|
|
87
|
+
* network (networkOf): the run's box_allow, or this server's own (AGENTRUN_BOX_ALLOW, read from `env`) for a launch
|
|
88
|
+
* that names none; and the size of a computer on this machine's container engine (its descriptor's `local`),
|
|
89
|
+
* AGENTRUN_BOX_CPUS, _MEMORY and _PIDS (dockerLimitsOf, read once here): a vendor's computer sizes itself. No key and
|
|
90
|
+
* no environment. */
|
|
87
91
|
export declare function computerSpecOf(env: KeyEnv): ComputerForClaimDeps["spec"];
|
|
88
92
|
/** The run's timeline phase while its claim waits on its computer's image (computerForClaim's onImageWait): main's box
|
|
89
93
|
* image row, the computer's noun for the box's. */
|
|
90
94
|
export declare const imageWaitWords: (making: "build" | "pull", image: string) => string;
|
|
95
|
+
/** The run's timeline phase once its claim's computer is connected (computerForClaim's onConnected): what it says it
|
|
96
|
+
* is, in its hello's own facts, such as "The phone is ready: Android 15 (arm64), from Phone harness." */
|
|
97
|
+
export declare const computerReadyWords: ({ provider, kind, hello }: ComputerSaid) => string;
|
|
91
98
|
/** The claim's computer as the runner's specs call it: what the run's launch lets the computer reach (its box_allow),
|
|
92
99
|
* read from the launch row when the store has one and the claim does not say, then computerForClaim. */
|
|
93
100
|
export declare const claimComputer: (launch: ClaimLaunch, store: Parameters<typeof computerForClaim>[1] & {
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
// with names no key, no account key and no database or Redis credential, and carries no environment at all.
|
|
17
17
|
import { isIP } from "node:net";
|
|
18
18
|
import { posix } from "node:path";
|
|
19
|
-
import { DEFAULT_DOCKER_IMAGE, DOCKER_RECIPE, DOCKER_RECIPE_HAS,
|
|
19
|
+
import { DEFAULT_DOCKER_IMAGE, DOCKER_RECIPE, DOCKER_RECIPE_HAS, PROVIDERS, providerFor, readBackOf, servingRefusals, SETTING_KINDS } from "@parcha/agentrun-computer";
|
|
20
|
+
// The local container engine's provider, for its check() of the operator's size settings at the start (dockerLimitsOf).
|
|
21
|
+
import { DockerProvider } from "@parcha/agentrun-computer/docker";
|
|
20
22
|
import { DOCKER_IMAGE_ENV } from "../box-image.js";
|
|
21
23
|
import { dockerDaemonCheck } from "../docker-daemon.js";
|
|
22
24
|
import { unionOf } from "../docker-host-addresses.js";
|
|
@@ -83,9 +85,6 @@ export function dockerLimitsOf(env) {
|
|
|
83
85
|
* container): a comma list of IP addresses. The Docker provider's egress proxy refuses them as the host's, so a
|
|
84
86
|
* computer's allow-list never reaches the host itself; without them it refuses any allow-list there. */
|
|
85
87
|
export const DOCKER_HOST_ADDRESSES_ENV = "AGENTRUN_DOCKER_HOST_ADDRESSES";
|
|
86
|
-
/** The variables the local browser's provider finds its Chrome by (the computer package's findChrome): the server's own
|
|
87
|
-
* values are handed to it, and no other variable of the server's. */
|
|
88
|
-
export const CHROME_LOOKUP = ["CHROME_PATH", "PI_BROWSER_CHROME", "PATH"];
|
|
89
88
|
/** `env`'s AGENTRUN_DOCKER_HOST_ADDRESSES: its addresses, each once; undefined when unset or empty, never one made up.
|
|
90
89
|
* An entry that is not an IP address throws, naming it: the server's start checks the setting, so no run meets one. */
|
|
91
90
|
export function dockerHostAddressesOf(env) {
|
|
@@ -107,39 +106,48 @@ export function dockerVolumeOf(paths) {
|
|
|
107
106
|
const root = paths.paths.at;
|
|
108
107
|
return { volume: { name: paths.paths.volume, root }, daemonCache: posix.join(root, DAEMON_CACHE_IN_VOLUME) };
|
|
109
108
|
}
|
|
110
|
-
/** The spec a computer of `kind` on `entry` is made with, besides its labels and its mount: its image (
|
|
111
|
-
* owner's AGENTRUN_DOCKER_IMAGE when set, else for a sandbox
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
109
|
+
/** The spec a computer of `kind` on `entry` is made with, besides its labels and its mount: its image (a provider that
|
|
110
|
+
* prepares its own image, its descriptor's prepareImage: the owner's AGENTRUN_DOCKER_IMAGE when set, else for a sandbox
|
|
111
|
+
* the package's recipe, which its prepareImage() builds; a provider whose descriptor declares imageEnv (Daytona's
|
|
112
|
+
* AGENTRUN_DAYTONA_SNAPSHOT): that variable's value in `env` when set; any other provider's, and such a one's while it
|
|
113
|
+
* is unset: its descriptor's defaultImage for the kind, the computer package's
|
|
114
|
+
* PROVIDERS[].defaultImage; a kind with none refused in words, a prepared desktop's saying it needs an image with an X
|
|
115
|
+
* server, which the recipe lacks), the leak bound for its lifetime (its clean end is the run's release), and its
|
|
116
|
+
* network (networkOf): the run's box_allow, or this server's own (AGENTRUN_BOX_ALLOW, read from `env`) for a launch
|
|
117
|
+
* that names none; and the size of a computer on this machine's container engine (its descriptor's `local`),
|
|
118
|
+
* AGENTRUN_BOX_CPUS, _MEMORY and _PIDS (dockerLimitsOf, read once here): a vendor's computer sizes itself. No key and
|
|
119
|
+
* no environment. */
|
|
117
120
|
export function computerSpecOf(env) {
|
|
118
121
|
const named = envValue(env, DOCKER_IMAGE_ENV);
|
|
119
122
|
// This server's allow setting, as a launch is stamped with it (box-settings.ts boxAllowOf; its start checks the setting).
|
|
120
123
|
const current = () => boxAllowOf(env);
|
|
121
124
|
const currentSet = () => boxAllowSetIn(env);
|
|
122
125
|
const imageOf = (entry, kind) => {
|
|
123
|
-
if (entry.
|
|
126
|
+
if (entry.prepareImage && named !== undefined)
|
|
124
127
|
return named;
|
|
125
|
-
|
|
126
|
-
if (
|
|
128
|
+
const chosen = entry.imageEnv === undefined ? undefined : envValue(env, entry.imageEnv)?.trim();
|
|
129
|
+
if (chosen !== undefined)
|
|
130
|
+
return chosen;
|
|
131
|
+
// A sandbox whose provider prepares its image: the package's own recipe, which its prepareImage() builds (the
|
|
132
|
+
// descriptor gives it no default).
|
|
133
|
+
if (entry.prepareImage && kind === "sandbox")
|
|
127
134
|
return DEFAULT_DOCKER_IMAGE;
|
|
128
135
|
const image = entry.defaultImage?.[kind];
|
|
129
136
|
if (image !== undefined)
|
|
130
137
|
return image;
|
|
131
|
-
if (entry.
|
|
132
|
-
throw refused(
|
|
138
|
+
if (entry.prepareImage && kind === "desktop")
|
|
139
|
+
throw refused(`A ${entry.label} desktop needs an image with an X server; set one for desktops.`);
|
|
133
140
|
throw refused(`${entry.label} has no image for a ${kind} computer here: pick another provider for this agent's computer in Settings → Computers.`);
|
|
134
141
|
};
|
|
135
142
|
const limits = dockerLimitsOf(env);
|
|
136
|
-
return (entry, kind, run) => ({
|
|
137
|
-
image
|
|
143
|
+
return (entry, kind, run, image) => ({
|
|
144
|
+
// The setting's configuration's image (Orgo's `windows`), else the kind's.
|
|
145
|
+
image: image ?? imageOf(entry, kind),
|
|
138
146
|
// The leak bound, within the longest the provider makes (E2B's is an hour): a longer one it refuses at create.
|
|
139
147
|
lifetimeMs: Math.min(COMPUTER_LIFETIME_MS, run.maxLifetimeMs ?? COMPUTER_LIFETIME_MS),
|
|
140
148
|
network: networkOf(entry, kind, run, current, currentSet),
|
|
141
|
-
//
|
|
142
|
-
...(entry.
|
|
149
|
+
// The size of a computer on this machine's container engine, the operator's (dockerLimitsOf); a vendor's sizes itself.
|
|
150
|
+
...(entry.local ? limits : {}),
|
|
143
151
|
});
|
|
144
152
|
}
|
|
145
153
|
/** The network a computer of `kind` on `entry` asks for: what the run allows (its box_allow), narrowed to "none" when its
|
|
@@ -171,6 +179,11 @@ function networkOf(entry, kind, run, current, currentSet) {
|
|
|
171
179
|
/** The run's timeline phase while its claim waits on its computer's image (computerForClaim's onImageWait): main's box
|
|
172
180
|
* image row, the computer's noun for the box's. */
|
|
173
181
|
export const imageWaitWords = (making, image) => making === "build" ? `Preparing the computer's image: building it (${DOCKER_RECIPE_HAS})…` : `Preparing the computer's image: pulling ${image}…`;
|
|
182
|
+
/** An OS as people write its name. */
|
|
183
|
+
const OS_NAMES = { linux: "Linux", windows: "Windows", macos: "macOS", android: "Android", ios: "iOS" };
|
|
184
|
+
/** The run's timeline phase once its claim's computer is connected (computerForClaim's onConnected): what it says it
|
|
185
|
+
* is, in its hello's own facts, such as "The phone is ready: Android 15 (arm64), from Phone harness." */
|
|
186
|
+
export const computerReadyWords = ({ provider, kind, hello }) => `The ${kind} is ready: ${[OS_NAMES[hello.os] ?? hello.os, hello.osVersion].filter(Boolean).join(" ")} (${hello.arch}), from ${provider}.`;
|
|
174
187
|
/** The claim's computer as the runner's specs call it: what the run's launch lets the computer reach (its box_allow),
|
|
175
188
|
* read from the launch row when the store has one and the claim does not say, then computerForClaim. */
|
|
176
189
|
export const claimComputer = async (launch, store, deps) => {
|
|
@@ -197,24 +210,25 @@ const dockerDaemonOf = (env) => {
|
|
|
197
210
|
export function computerDepsFrom(options) {
|
|
198
211
|
const { env, store, sealKey, faux } = options;
|
|
199
212
|
const kinds = claimKinds(options);
|
|
200
|
-
//
|
|
201
|
-
// when
|
|
202
|
-
// recipe's bare tag, which no registry has.
|
|
213
|
+
// A provider that prepares its own image (its descriptor's prepareImage) is given that image's source, which its
|
|
214
|
+
// prepareImage() makes ready (built from the recipe when the engine lacks it, or pulled by name): the owner's
|
|
215
|
+
// AGENTRUN_DOCKER_IMAGE, else the package's recipe. Never the recipe's bare tag, which no registry has.
|
|
203
216
|
const named = envValue(env, DOCKER_IMAGE_ENV);
|
|
204
|
-
const
|
|
217
|
+
const preparedImage = named !== undefined ? { image: named } : { recipe: DOCKER_RECIPE };
|
|
205
218
|
// The operator's Docker host addresses (AGENTRUN_DOCKER_HOST_ADDRESSES), checked once here.
|
|
206
219
|
const namedAddresses = dockerHostAddressesOf(env);
|
|
207
220
|
// Where this process's Docker has the data, read once, when a Docker provider is first built.
|
|
208
221
|
let paths;
|
|
209
|
-
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
* allow-list where it isn't on the
|
|
214
|
-
* has an allow-list (`boxAllow`, the claim's own
|
|
215
|
-
*
|
|
216
|
-
* The read itself is once per process
|
|
217
|
-
|
|
222
|
+
/** A local provider's host options (its descriptor's `local`: its computers run on this machine's container engine):
|
|
223
|
+
* for a server in a container of that engine's, the named volume that holds its data and the daemon copy's place
|
|
224
|
+
* under it (dockerVolumeOf), and the host's own addresses for its egress proxy, the union of the read through the
|
|
225
|
+
* socket (`hostAddresses`) and the operator's; on a host, the operator's alone (the provider reads its own
|
|
226
|
+
* interfaces). With none, none are given, and the provider refuses an allow-list where it isn't on the host, in its
|
|
227
|
+
* words. The read is made only for a claim whose run's computer has an allow-list (`boxAllow`, the claim's own
|
|
228
|
+
* launch's box_allow, a list): a run launched under a list keeps it across a restart, whatever this process's
|
|
229
|
+
* AGENTRUN_BOX_ALLOW says now; one with none, or no claim, reads nothing. The read itself is once per process
|
|
230
|
+
* (`hostAddresses`). */
|
|
231
|
+
const localHostOptions = async (boxAllow) => {
|
|
218
232
|
const where = options.dockerPaths ? await (paths ??= options.dockerPaths()) : { here: true };
|
|
219
233
|
const volume = dockerVolumeOf(where);
|
|
220
234
|
// A launch that names no box_allow (a row from before every launch was stamped) allows what this server allows now,
|
|
@@ -222,15 +236,24 @@ export function computerDepsFrom(options) {
|
|
|
222
236
|
const allow = boxAllow ?? boxAllowOf(env);
|
|
223
237
|
const read = volume && Array.isArray(allow) && options.hostAddresses ? await options.hostAddresses() : undefined;
|
|
224
238
|
const addresses = read ? unionOf(read, namedAddresses).addresses : (namedAddresses ?? []);
|
|
225
|
-
return {
|
|
239
|
+
return { ...(volume ?? {}), ...(addresses.length > 0 ? { egress: { hostAddresses: addresses } } : {}) };
|
|
240
|
+
};
|
|
241
|
+
/** The server's own values of the environment variables a provider declares it reads on this machine (hostEnv: Local
|
|
242
|
+
* Chrome's, where it finds Chrome), and no other variable of the server's. */
|
|
243
|
+
const hostEnvOf = (names) => Object.fromEntries(names.flatMap((name) => (env[name] === undefined ? [] : [[name, String(env[name])]])));
|
|
244
|
+
/** The options a provider takes beside its keys, by what its descriptor declares, never by its id: the image source
|
|
245
|
+
* for one that prepares its image, the host options for a local one, the host environment it reads. */
|
|
246
|
+
const declaredOptions = async (id, boxAllow) => {
|
|
247
|
+
const entry = kinds.PROVIDERS.find((one) => one.id === id);
|
|
248
|
+
return {
|
|
249
|
+
...(entry?.prepareImage ? { image: preparedImage } : {}),
|
|
250
|
+
...(entry?.local ? await localHostOptions(boxAllow) : {}),
|
|
251
|
+
...(entry?.hostEnv ? { env: hostEnvOf(entry.hostEnv) } : {}),
|
|
252
|
+
};
|
|
226
253
|
};
|
|
227
254
|
const load = options.load ?? providerFor;
|
|
228
|
-
// The
|
|
229
|
-
|
|
230
|
-
const chromeEnv = { env: Object.fromEntries(CHROME_LOOKUP.flatMap((name) => (env[name] === undefined ? [] : [[name, env[name]]]))) };
|
|
231
|
-
const providers = computerProviderMakers({
|
|
232
|
-
load: async (id, given, claim) => load(id, id === "docker" ? { ...given, ...(await dockerOptions(claim?.boxAllow)) } : id === "local" ? { ...given, ...chromeEnv } : given),
|
|
233
|
-
});
|
|
255
|
+
// The claim and Settings → Computers' test alike.
|
|
256
|
+
const providers = computerProviderMakers({ load: async (id, given, claim) => load(id, { ...given, ...(await declaredOptions(id, claim?.boxAllow)) }) });
|
|
234
257
|
const computerDeps = {
|
|
235
258
|
kinds,
|
|
236
259
|
providers,
|
|
@@ -240,6 +263,7 @@ export function computerDepsFrom(options) {
|
|
|
240
263
|
// Under --faux, its launch makes the computer, with its key table: no provider of the package is built.
|
|
241
264
|
...(faux ? { keyTable: faux.keyTable, launch: (entry, spec) => faux.launch(entry, spec) } : {}),
|
|
242
265
|
...(options.answers ? { answers: options.answers } : {}),
|
|
266
|
+
...(options.hostWhy ? { hostWhy: (provider) => (Object.hasOwn(options.hostWhy, provider) ? options.hostWhy[provider] : undefined) } : {}),
|
|
243
267
|
...(options.daemon ? { daemon: options.daemon } : faux ? {} : { daemon: dockerDaemonOf(env) }),
|
|
244
268
|
...(options.openComputerView ? { openComputerView: options.openComputerView } : {}),
|
|
245
269
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { ComputerProvider, ComputerSpec } from "@parcha/agentrun-computer";
|
|
1
|
+
import type { ComputerProvider, ComputerSpec, HelloResult } from "@parcha/agentrun-computer";
|
|
2
2
|
import { type PlaceView } from "../computer-setting.js";
|
|
3
3
|
import { type KeyTable, type ProviderSettings } from "../computer-keys.js";
|
|
4
4
|
import type { Store } from "../store/index.js";
|
|
5
5
|
import type { MountCheck } from "./attach.js";
|
|
6
|
+
import { type HeldComputer } from "./computer-hold.js";
|
|
6
7
|
import { type ProviderLedger } from "./computer-ledger.js";
|
|
7
|
-
import { type ClaimSide, type ComputerSetting, type ComputerSettingKind, type KindRegistry, type ProviderEntry } from "./resolve-computer.js";
|
|
8
|
+
import { type ClaimBrowser, type ClaimSide, type ComputerSetting, type ComputerSettingKind, type KindRegistry, type ProviderEntry } from "./resolve-computer.js";
|
|
8
9
|
import type { RunComputer, RunHold } from "./run-tools.js";
|
|
9
10
|
import type { Workspace } from "./workspace.js";
|
|
10
11
|
/** What the claim knows of the run: its id, the claim's epoch, and where its computer setting is (the launch's own, else
|
|
@@ -12,6 +13,8 @@ import type { Workspace } from "./workspace.js";
|
|
|
12
13
|
export interface ClaimLaunch {
|
|
13
14
|
readonly runId: string;
|
|
14
15
|
readonly epoch: number;
|
|
16
|
+
/** The run's agent: the owner of its own computer where its setting is persistent (agent-computer.ts). */
|
|
17
|
+
readonly agentId?: string;
|
|
15
18
|
/** The claim itself, as the live view's registration fences on it (absent: its run and epoch). */
|
|
16
19
|
readonly claim?: unknown;
|
|
17
20
|
readonly revisionId?: string;
|
|
@@ -35,7 +38,7 @@ export interface ComputerRun {
|
|
|
35
38
|
/** A provider module's create(), by provider id: its options from the saved keys, and the store's ledger for a provider
|
|
36
39
|
* that keeps one (the phone's `ledger` option); for a claim, what its run's computer may reach (`boxAllow`, the
|
|
37
40
|
* launch's box_allow), which no provider option carries. The computer package's providers, or a test's stand-in. */
|
|
38
|
-
export type ProviderMakers = Readonly<Partial<Record<string, (options: Record<string,
|
|
41
|
+
export type ProviderMakers = Readonly<Partial<Record<string, (options: Readonly<Record<string, unknown>>, extras: ProviderExtras) => ComputerProvider | Promise<ComputerProvider>>>>;
|
|
39
42
|
/** What a provider is made with beside its options: the store's ledger, and the claim's box_allow when a claim makes it. */
|
|
40
43
|
export type ProviderExtras = {
|
|
41
44
|
readonly ledger: ProviderLedger;
|
|
@@ -74,8 +77,9 @@ export interface ComputerForClaimDeps {
|
|
|
74
77
|
/** The server's seal key: absent, no key is opened, so a provider that needs one is refused in words. */
|
|
75
78
|
readonly sealKey: Buffer | undefined;
|
|
76
79
|
readonly providers: ProviderMakers;
|
|
77
|
-
/** What a computer of `kind` is made with, besides its labels and its mount: image, lifetime, network (from `run`).
|
|
78
|
-
|
|
80
|
+
/** What a computer of `kind` is made with, besides its labels and its mount: image, lifetime, network (from `run`).
|
|
81
|
+
* `image`: the one the setting's configuration names, over the kind's default. */
|
|
82
|
+
readonly spec: (entry: ProviderEntry, kind: Exclude<ComputerSettingKind, "none">, run: ComputerRun, image?: string) => Omit<ComputerSpec, "labels" | "mount">;
|
|
79
83
|
/** A provider key's value by its name, as the server reads it (key-meta.ts keyReader: the environment's, else the
|
|
80
84
|
* saved one). Absent: the saved one alone, opened with `sealKey`. */
|
|
81
85
|
readonly keyOf?: (name: string) => Promise<string | undefined>;
|
|
@@ -100,21 +104,55 @@ export interface ComputerForClaimDeps {
|
|
|
100
104
|
* a host that lacks it, or a named image pulled); never when the host has it. The run's caller says it on the run's
|
|
101
105
|
* timeline. Absent: nothing is said. */
|
|
102
106
|
readonly onImageWait?: ImageWait;
|
|
107
|
+
/** Told once a computer the claim made through its provider is connected, with what it says it is (its hello's OS,
|
|
108
|
+
* the OS's version and its architecture): the run's caller says it on the run's timeline. A browser session, made
|
|
109
|
+
* by the run's tool, is never told. Absent: nothing is said. */
|
|
110
|
+
readonly onConnected?: (said: ComputerSaid) => void;
|
|
111
|
+
/** Why this machine cannot run a provider's computers, by its provider id (computers.ts hostCommandRefusals: the
|
|
112
|
+
* phone's adb not on PATH), in words that say how to fix it, or undefined: refused with code computer_unavailable
|
|
113
|
+
* before anything is rented. Absent: not asked. */
|
|
114
|
+
readonly hostWhy?: (provider: string) => string | undefined;
|
|
103
115
|
/** Why this run's harness takes no computer of `kind`, in words (a CLI harness's of a browser), or undefined: a kind
|
|
104
116
|
* it refuses is refused with code computer_unavailable before anything is made. Absent: every kind. */
|
|
105
117
|
readonly refuseKind?: (kind: Exclude<ComputerSettingKind, "none">) => string | undefined;
|
|
118
|
+
/** Told what became of the agent's own computer at the claim (a persistent setting): made, attached from an earlier
|
|
119
|
+
* run, or made again because the one this server kept is gone. The run's caller says it on the run's timeline. */
|
|
120
|
+
readonly onComputerNote?: (words: string) => void;
|
|
106
121
|
readonly signal?: AbortSignal;
|
|
107
122
|
}
|
|
108
|
-
/** The run's computer at its claim: what runTools takes, the person's hold on a desktop's or phone's ports,
|
|
109
|
-
*
|
|
110
|
-
* run's
|
|
123
|
+
/** The run's computer at its claim: what runTools takes, the person's hold on a desktop's or phone's ports, the hold
|
|
124
|
+
* itself with the computer's kind (`held`, what the adapter loop takes as AdapterRunSpec.computer: it commits the hold's
|
|
125
|
+
* changes to the run's journal and applies the person's take-over and hand-back to it), and its release (idempotent):
|
|
126
|
+
* the live view closed ("released" when the computer goes before the run's end, "ended" at the run's end), the
|
|
127
|
+
* owner's view let go, then the computer. */
|
|
111
128
|
export interface ClaimComputer {
|
|
112
129
|
readonly computer?: RunComputer;
|
|
113
130
|
readonly hold?: RunHold;
|
|
131
|
+
readonly held?: HeldComputer;
|
|
114
132
|
release(why?: ViewEnd): Promise<void>;
|
|
115
133
|
}
|
|
134
|
+
/** The provider's watch of a computer's screen (ComputerProvider.watch), where it has one. */
|
|
116
135
|
/** Told once, before the claim waits on its computer's image being built or pulled; never when the host has it. */
|
|
117
136
|
export type ImageWait = (making: "build" | "pull", tag: string) => void;
|
|
137
|
+
/** What a computer the claim made says it is, once it is connected: the provider's name in words, the agent's setting
|
|
138
|
+
* kind, and its hello's own facts (its OS, the OS's version where it says one, its architecture). */
|
|
139
|
+
export type ComputerSaid = {
|
|
140
|
+
readonly provider: string;
|
|
141
|
+
readonly kind: Exclude<ComputerSettingKind, "none">;
|
|
142
|
+
readonly hello: Pick<HelloResult, "os" | "osVersion" | "arch">;
|
|
143
|
+
};
|
|
144
|
+
/** A browser computer's provider as the run's browser tool opens its sessions through it (ClaimBrowser): nothing is made
|
|
145
|
+
* at the claim. A session's computer is made at the tool's call, under the run's labels (`spec`'s) and the tool's tag,
|
|
146
|
+
* with the session's own options (spec.browser) where the provider declares them (capabilities().browser); its release
|
|
147
|
+
* lets go of every one the tool left open. The claim's browser (the agent's computer) and the tool plane's vendor's
|
|
148
|
+
* (browser-computer.ts planeBrowser) are each one of these. */
|
|
149
|
+
export declare function claimBrowser(provider: ComputerProvider, spec: ComputerSpec): {
|
|
150
|
+
readonly browser: ClaimBrowser;
|
|
151
|
+
release(): Promise<void>;
|
|
152
|
+
};
|
|
118
153
|
/** The run's computer for this claim, started and registered; `{ computer: undefined }` for none. Throws with code
|
|
119
154
|
* computer_unavailable and the server's words when the agent's computer cannot be had here. */
|
|
120
|
-
export declare function computerForClaim(launch: ClaimLaunch, store: Pick<Store, "agents" | "sealedKeys" | "computerLedger"
|
|
155
|
+
export declare function computerForClaim(launch: ClaimLaunch, store: Pick<Store, "agents" | "sealedKeys" | "computerLedger"> & {
|
|
156
|
+
readonly settings?: Store["settings"];
|
|
157
|
+
readonly runs?: Pick<Store["runs"], "get">;
|
|
158
|
+
}, deps: ComputerForClaimDeps): Promise<ClaimComputer>;
|