@parcha/agentrun-serve 0.1.0-beta.33 → 0.1.0-beta.35
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 +368 -0
- package/README.md +341 -208
- package/dist/adapters.d.ts +3 -4
- package/dist/adapters.js +18 -15
- package/dist/agent-rows.d.ts +99 -0
- package/dist/agent-rows.js +1 -0
- package/dist/agents-store.d.ts +6 -2
- package/dist/agents-store.js +75 -25
- package/dist/agents.d.ts +9 -125
- package/dist/agents.js +15 -305
- package/dist/answer-json.d.ts +23 -0
- package/dist/answer-json.js +58 -0
- package/dist/api-only.d.ts +1 -1
- package/dist/api-only.js +2 -2
- package/dist/archil-settings.d.ts +11 -1
- package/dist/archil-settings.js +10 -0
- package/dist/bash-read-only.d.ts +35 -0
- package/dist/bash-read-only.js +778 -0
- package/dist/box-settings.d.ts +3 -23
- package/dist/box-settings.js +7 -51
- package/dist/boxes.d.ts +17 -0
- package/dist/boxes.js +27 -20
- package/dist/browser-commands.d.ts +5 -2
- package/dist/browser-commands.js +4 -4
- package/dist/browser-computer.d.ts +5 -0
- package/dist/browser-computer.js +21 -0
- package/dist/browser-cost.d.ts +9 -6
- package/dist/browser-cost.js +95 -51
- package/dist/browser-live.d.ts +7 -20
- package/dist/browser-live.js +15 -93
- package/dist/browser-person.d.ts +18 -51
- package/dist/browser-person.js +94 -277
- package/dist/budget.d.ts +0 -5
- package/dist/budget.js +0 -5
- package/dist/cap.d.ts +14 -8
- package/dist/cap.js +19 -9
- package/dist/cli.js +71 -18
- package/dist/closed-pipes.d.ts +2 -0
- package/dist/closed-pipes.js +13 -0
- package/dist/computer-commands.d.ts +2 -0
- package/dist/computer-commands.js +2 -0
- package/dist/computer-keys.d.ts +20 -10
- package/dist/computer-keys.js +36 -54
- package/dist/computer-setting.d.ts +20 -3
- package/dist/computer-setting.js +58 -10
- package/dist/computers.d.ts +35 -2
- package/dist/computers.js +72 -11
- package/dist/confine.d.ts +120 -0
- package/dist/confine.js +436 -0
- package/dist/console/assets/index-B7NKTU8E.css +1 -0
- package/dist/console/assets/index-CXZMgJE7.js +550 -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/decision-rows.d.ts +1 -1
- package/dist/decision-rows.js +1 -1
- package/dist/docker-daemon.d.ts +31 -0
- package/dist/docker-daemon.js +56 -0
- package/dist/effort-guidance.js +4 -3
- package/dist/environment.d.ts +0 -3
- package/dist/environment.js +3 -5
- package/dist/errors.d.ts +1 -2
- package/dist/errors.js +9 -9
- package/dist/explain.js +3 -1
- package/dist/filed-answer.d.ts +32 -0
- package/dist/filed-answer.js +160 -0
- package/dist/files.d.ts +1 -3
- package/dist/files.js +2 -4
- package/dist/github-connection.d.ts +1 -1
- 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 +6 -2
- package/dist/github.js +5 -3
- package/dist/graph-served.d.ts +5 -3
- package/dist/graph-served.js +14 -6
- package/dist/graph-view.d.ts +3 -5
- package/dist/graph-view.js +9 -16
- package/dist/handed-values.d.ts +9 -0
- package/dist/handed-values.js +26 -0
- package/dist/harness-install.d.ts +1 -7
- package/dist/harness-install.js +1 -18
- package/dist/harness-opencode/adapter.d.ts +7 -0
- package/dist/harness-opencode/adapter.js +23 -6
- package/dist/harness-opencode/harness.js +0 -1
- package/dist/harness-opencode/host/policy.js +2 -2
- package/dist/harness-opencode/index.d.ts +1 -1
- package/dist/harness-opencode/index.js +1 -1
- package/dist/harness-opencode/verify.d.ts +17 -0
- package/dist/harness-opencode/verify.js +30 -10
- package/dist/harness-table.js +6 -1
- package/dist/heard.js +1 -1
- package/dist/held-fd.d.ts +5 -0
- package/dist/held-fd.js +14 -0
- package/dist/host-calls.d.ts +20 -0
- package/dist/host-calls.js +12 -0
- package/dist/host-tools.d.ts +4 -21
- package/dist/host-tools.js +4 -61
- package/dist/host.d.ts +2 -4
- package/dist/host.js +2 -7
- package/dist/import-summary.d.ts +1 -5
- package/dist/import-summary.js +0 -21
- package/dist/import.d.ts +6 -6
- package/dist/import.js +14 -15
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/key-refusal.d.ts +5 -1
- package/dist/key-refusal.js +19 -4
- package/dist/learn/check.d.ts +8 -2
- package/dist/learn/check.js +85 -31
- package/dist/learn/folder.d.ts +11 -4
- package/dist/learn/folder.js +17 -19
- package/dist/learn/grade.d.ts +18 -1
- package/dist/learn/grade.js +108 -14
- package/dist/learn/index.d.ts +5 -5
- package/dist/learn/index.js +5 -5
- package/dist/learn/learning.sh +1 -14
- package/dist/learn/notes.d.ts +14 -3
- package/dist/learn/notes.js +16 -6
- package/dist/learn/reflect.d.ts +31 -2
- package/dist/learn/reflect.js +83 -6
- package/dist/learn/relevance.d.ts +24 -0
- package/dist/learn/relevance.js +91 -0
- package/dist/learn/secrets.d.ts +7 -1
- package/dist/learn/secrets.js +86 -19
- package/dist/learn/skills.d.ts +159 -18
- package/dist/learn/skills.js +644 -64
- package/dist/learned-nodes.d.ts +14 -0
- package/dist/learned-nodes.js +8 -0
- package/dist/learned-workflow.d.ts +41 -6
- package/dist/learned-workflow.js +153 -18
- package/dist/learning-routes.d.ts +49 -4
- package/dist/learning-routes.js +113 -31
- package/dist/learning-run.d.ts +16 -31
- package/dist/learning-run.js +31 -38
- package/dist/learning-words.d.ts +12 -5
- package/dist/learning-words.js +18 -9
- package/dist/learning.d.ts +91 -97
- package/dist/learning.js +176 -320
- package/dist/live/stream.js +1 -1
- package/dist/live/translate.js +12 -2
- package/dist/llm.d.ts +4 -1
- package/dist/llm.js +4 -2
- package/dist/local-models.d.ts +11 -5
- package/dist/local-models.js +13 -8
- package/dist/mcp-gateway.d.ts +17 -49
- package/dist/mcp-gateway.js +55 -136
- package/dist/mcp-oauth.d.ts +10 -14
- package/dist/mcp-oauth.js +14 -32
- package/dist/mcp-probe.d.ts +0 -7
- package/dist/mcp-probe.js +4 -10
- package/dist/mcp-servers-store.d.ts +18 -18
- package/dist/mcp-servers-store.js +12 -14
- package/dist/mcp-store.js +3 -4
- package/dist/mcp.js +4 -3
- package/dist/model.d.ts +9 -7
- package/dist/model.js +51 -27
- package/dist/monid.d.ts +0 -2
- package/dist/monid.js +3 -6
- package/dist/openapi.d.ts +8 -1
- package/dist/openapi.js +156 -58
- package/dist/page.d.ts +1 -3
- package/dist/page.js +6 -18
- package/dist/paid-calls.d.ts +21 -27
- package/dist/paid-calls.js +26 -61
- package/dist/pause.d.ts +2 -19
- package/dist/pause.js +5 -74
- package/dist/port-models.d.ts +10 -3
- package/dist/port-models.js +26 -6
- package/dist/propose.d.ts +2 -0
- package/dist/propose.js +80 -45
- package/dist/push-handler.d.ts +1 -1
- package/dist/reflect-range.d.ts +25 -0
- package/dist/reflect-range.js +30 -0
- package/dist/refusal-words.d.ts +5 -1
- package/dist/refusal-words.js +5 -1
- package/dist/rows.d.ts +1 -1
- package/dist/run-cut.d.ts +0 -6
- package/dist/run-cut.js +0 -6
- package/dist/run-db.d.ts +2 -11
- package/dist/run-db.js +2 -37
- package/dist/run-launch.d.ts +21 -2
- package/dist/run-launch.js +14 -5
- package/dist/run-learning-served.d.ts +21 -4
- package/dist/run-learning-served.js +23 -13
- package/dist/run-reads-over-store.d.ts +5 -3
- package/dist/run-reads-over-store.js +25 -14
- package/dist/run-secrets.d.ts +1 -1
- package/dist/run-timeline-served.d.ts +5 -1
- package/dist/run-timeline-served.js +27 -6
- package/dist/run-view.d.ts +37 -22
- package/dist/run-view.js +85 -38
- package/dist/runnable.d.ts +21 -10
- package/dist/runnable.js +35 -12
- package/dist/runner/adapter-loop.d.ts +36 -5
- package/dist/runner/adapter-loop.js +663 -69
- package/dist/runner/adapter-run-spec.d.ts +42 -8
- package/dist/runner/adapter-run-spec.js +186 -52
- package/dist/runner/adapters/index.js +11 -1
- package/dist/runner/adapters/pi.d.ts +40 -2
- package/dist/runner/adapters/pi.js +110 -27
- package/dist/runner/beside.d.ts +38 -3
- package/dist/runner/beside.js +54 -5
- package/dist/runner/claim-secrets.d.ts +16 -1
- package/dist/runner/claim-secrets.js +62 -14
- package/dist/runner/cli-run-spec.d.ts +5 -0
- package/dist/runner/cli-run-spec.js +159 -41
- package/dist/runner/commands.js +1 -1
- package/dist/runner/computer-journal.d.ts +15 -2
- package/dist/runner/computer-journal.js +41 -5
- package/dist/runner/conformance/harness.d.ts +1 -0
- package/dist/runner/conformance/harness.js +123 -13
- package/dist/runner/conformance/subject.d.ts +4 -1
- package/dist/runner/dispatch.d.ts +8 -1
- package/dist/runner/dispatch.js +81 -7
- package/dist/runner/end-of-run.d.ts +8 -2
- package/dist/runner/end-of-run.js +10 -4
- package/dist/runner/github-app.d.ts +7 -2
- package/dist/runner/github-app.js +47 -16
- package/dist/runner/harness-loops.d.ts +15 -2
- package/dist/runner/harness-loops.js +38 -2
- package/dist/runner/journal-kinds.d.ts +60 -6
- package/dist/runner/journal-kinds.js +43 -5
- package/dist/runner/journal-reader.d.ts +1 -1
- package/dist/runner/journal-reader.js +2 -2
- package/dist/runner/learning-ask.d.ts +4 -0
- package/dist/runner/learning-ask.js +15 -1
- package/dist/runner/learning-end.d.ts +18 -3
- package/dist/runner/learning-end.js +194 -20
- package/dist/runner/learning-loop.d.ts +7 -0
- package/dist/runner/learning-loop.js +36 -8
- package/dist/runner/learning-seed.d.ts +6 -0
- package/dist/runner/learning-seed.js +6 -0
- package/dist/runner/loop-contract.d.ts +4 -0
- package/dist/runner/main.d.ts +61 -9
- package/dist/runner/main.js +144 -20
- package/dist/runner/mcp-claim.d.ts +3 -0
- package/dist/runner/mcp-claim.js +7 -3
- package/dist/runner/mcp-github.d.ts +11 -2
- package/dist/runner/mcp-github.js +55 -4
- package/dist/runner/mcp-run.d.ts +2 -0
- package/dist/runner/mcp-run.js +16 -5
- package/dist/runner/memory-claim.d.ts +9 -0
- package/dist/runner/memory-claim.js +25 -0
- package/dist/runner/metrics.d.ts +46 -1
- package/dist/runner/metrics.js +156 -1
- package/dist/runner/model-route.d.ts +16 -0
- package/dist/runner/model-route.js +134 -10
- package/dist/runner/reflect-hook.d.ts +12 -1
- package/dist/runner/reflect-hook.js +33 -3
- package/dist/runner/runner.d.ts +20 -0
- package/dist/runner/runner.js +146 -18
- package/dist/runner/spec-holds.d.ts +7 -2
- package/dist/runner/spec-holds.js +4 -3
- package/dist/runner/store-port.d.ts +1 -1
- package/dist/runner/store-secrets.d.ts +3 -3
- package/dist/runner/store-secrets.js +8 -12
- package/dist/runner/text-tools.d.ts +44 -0
- package/dist/runner/text-tools.js +237 -0
- package/dist/runner/workflow-host.d.ts +7 -2
- package/dist/runner/workflow-host.js +3 -1
- package/dist/runner/workflow-loop.d.ts +10 -1
- package/dist/runner/workflow-loop.js +14 -6
- package/dist/runner/workflow-spec.d.ts +21 -0
- package/dist/runner/workflow-spec.js +217 -93
- package/dist/runs-over-store.d.ts +14 -3
- package/dist/runs-over-store.js +100 -23
- package/dist/seal-key.d.ts +0 -2
- package/dist/seal-key.js +5 -45
- package/dist/sealed-settings-store.d.ts +19 -4
- package/dist/sealed-settings-store.js +9 -9
- package/dist/sealing.d.ts +4 -0
- package/dist/sealing.js +20 -0
- package/dist/secret-cut.d.ts +1 -1
- package/dist/secret-cut.js +1 -1
- package/dist/secret-name.d.ts +9 -0
- package/dist/secret-name.js +15 -0
- package/dist/secret-writes.d.ts +0 -1
- package/dist/secret-writes.js +0 -1
- package/dist/server-fs.d.ts +4 -0
- package/dist/server-fs.js +8 -2
- package/dist/server-lock.d.ts +0 -24
- package/dist/server-lock.js +5 -85
- package/dist/server-secrets-store.d.ts +4 -4
- package/dist/server-secrets-store.js +9 -31
- package/dist/server-secrets.d.ts +4 -9
- package/dist/server-secrets.js +12 -36
- package/dist/server.d.ts +37 -56
- package/dist/server.js +322 -134
- package/dist/sign-ins-store.d.ts +34 -36
- package/dist/sign-ins-store.js +27 -38
- package/dist/sign-ins.d.ts +2 -119
- package/dist/sign-ins.js +5 -311
- package/dist/standard-webhooks.d.ts +1 -1
- package/dist/standard-webhooks.js +1 -1
- package/dist/stats.d.ts +3 -2
- package/dist/stats.js +1 -1
- package/dist/stop-signals.d.ts +4 -2
- package/dist/stop-signals.js +5 -3
- package/dist/store/agent-body.d.ts +12 -2
- package/dist/store/agent-body.js +22 -4
- package/dist/store/deadline.d.ts +18 -0
- package/dist/store/deadline.js +45 -0
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +2 -2
- package/dist/store/open.d.ts +6 -3
- package/dist/store/open.js +2 -2
- package/dist/store/postgres/connection.d.ts +22 -2
- package/dist/store/postgres/connection.js +211 -41
- package/dist/store/postgres/migrate.d.ts +4 -0
- package/dist/store/postgres/migrate.js +9 -2
- package/dist/store/postgres/migrations/0003_commands_one_answer.check.sql +19 -0
- package/dist/store/postgres/migrations/0003_commands_one_answer.sql +13 -0
- package/dist/store/postgres/store.d.ts +9 -2
- package/dist/store/postgres/store.js +9 -0
- package/dist/store/schema.js +1 -1
- package/dist/store/seal.js +2 -2
- package/dist/store/sqlite/connection.js +14 -5
- package/dist/store/sqlite/run-patch.d.ts +3 -0
- package/dist/store/sqlite/run-patch.js +3 -0
- package/dist/store/sqlite/store.js +41 -12
- package/dist/store/store.d.ts +35 -6
- package/dist/store/store.js +12 -2
- package/dist/store-reads/cap.d.ts +1 -1
- package/dist/store-reads/cap.js +22 -4
- package/dist/store-reads/journal.d.ts +9 -6
- package/dist/store-reads/journal.js +129 -18
- package/dist/store-reads/learning.d.ts +82 -8
- package/dist/store-reads/learning.js +184 -11
- package/dist/store-reads/workflow.d.ts +1 -1
- package/dist/store-reads/workflow.js +1 -1
- package/dist/store-view.d.ts +19 -1
- package/dist/store-view.js +95 -27
- package/dist/template-eval.d.ts +60 -4
- package/dist/template-eval.js +120 -54
- package/dist/templates.d.ts +33 -14
- package/dist/templates.js +82 -46
- package/dist/timeline/group.d.ts +33 -0
- package/dist/timeline/group.js +77 -0
- package/dist/timeline/index.d.ts +7 -0
- package/dist/timeline/index.js +7 -0
- package/dist/timeline/labels.d.ts +79 -0
- package/dist/timeline/labels.js +150 -0
- package/dist/timeline/origin.d.ts +56 -0
- package/dist/timeline/origin.js +92 -0
- package/dist/timeline/render-text.d.ts +11 -0
- package/dist/timeline/render-text.js +62 -0
- package/dist/timeline/timeline.d.ts +282 -0
- package/dist/timeline/timeline.js +1308 -0
- package/dist/timeline/util.d.ts +17 -0
- package/dist/timeline/util.js +49 -0
- package/dist/tool-budget.d.ts +18 -0
- package/dist/tool-budget.js +50 -0
- package/dist/tool-gate.d.ts +47 -218
- package/dist/tool-gate.js +87 -545
- package/dist/tool-keys-store.d.ts +11 -12
- package/dist/tool-keys-store.js +24 -31
- package/dist/tool-keys.d.ts +5 -101
- package/dist/tool-keys.js +8 -267
- package/dist/tool-plane.d.ts +23 -52
- package/dist/tool-plane.js +23 -81
- package/dist/tool-settings-store.d.ts +1 -2
- package/dist/tool-settings-store.js +5 -8
- package/dist/tools.d.ts +67 -25
- package/dist/tools.js +170 -119
- package/dist/trigger-adapter.d.ts +2 -2
- package/dist/trigger-targets.d.ts +13 -1
- package/dist/trigger-targets.js +31 -1
- package/dist/triggers.d.ts +2 -2
- package/dist/triggers.js +3 -3
- package/dist/turn-end.d.ts +1 -1
- package/dist/turn-end.js +1 -1
- package/dist/turns.d.ts +0 -6
- package/dist/turns.js +0 -19
- package/dist/uploads.d.ts +28 -5
- package/dist/uploads.js +83 -10
- package/dist/usage.d.ts +1 -49
- package/dist/usage.js +3 -84
- package/dist/validate.d.ts +4 -0
- package/dist/validate.js +33 -14
- package/dist/webhooks.d.ts +102 -76
- package/dist/webhooks.js +266 -233
- package/dist/workflow-run.d.ts +114 -0
- package/dist/workflow-run.js +144 -0
- package/dist/workspace/archil-claim.d.ts +2 -2
- package/dist/workspace/archil-claim.js +4 -3
- package/dist/workspace/archil-disk.d.ts +10 -1
- package/dist/workspace/archil-disk.js +4 -0
- package/dist/workspace/archil-exec.d.ts +12 -2
- package/dist/workspace/archil-exec.js +16 -0
- 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/beneath.d.ts +19 -0
- package/dist/workspace/beneath.js +106 -0
- package/dist/workspace/computer-deps.d.ts +26 -9
- package/dist/workspace/computer-deps.js +144 -43
- package/dist/workspace/computer-for-claim.d.ts +17 -14
- package/dist/workspace/computer-for-claim.js +99 -26
- package/dist/workspace/computer-hold.d.ts +6 -1
- package/dist/workspace/computer-hold.js +6 -1
- package/dist/workspace/computer-janitor.d.ts +47 -0
- package/dist/workspace/computer-janitor.js +182 -0
- package/dist/workspace/computer-ledger.d.ts +1 -8
- package/dist/workspace/computer-ledger.js +0 -3
- package/dist/workspace/computer-providers.d.ts +5 -3
- package/dist/workspace/computer-providers.js +11 -9
- package/dist/workspace/grep-worker.d.ts +5 -0
- package/dist/workspace/grep-worker.js +9 -6
- package/dist/workspace/hands.d.ts +5 -2
- package/dist/workspace/hands.js +4 -3
- package/dist/workspace/index.d.ts +6 -5
- package/dist/workspace/index.js +4 -4
- package/dist/workspace/local.d.ts +14 -2
- package/dist/workspace/local.js +170 -43
- 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 +55 -10
- package/dist/workspace/resolve-computer.js +66 -14
- package/dist/workspace/run-tools.d.ts +15 -31
- package/dist/workspace/run-tools.js +19 -30
- package/dist/workspace/workspace.d.ts +5 -0
- package/dist/workspace-paths.d.ts +0 -17
- package/dist/workspace-paths.js +1 -41
- package/dist/workspace.d.ts +0 -17
- package/dist/workspace.js +4 -110
- package/package.json +14 -14
- package/skills/agentrun-serve/SKILL.md +1 -1
- package/templates/README.md +11 -5
- 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/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/market-monitor/agent.md +2 -2
- package/templates/market-monitor/skills/monitor/SKILL.md +6 -4
- package/templates/release-notes/agent.md +11 -0
- package/dist/bound-files.d.ts +0 -4
- package/dist/bound-files.js +0 -164
- package/dist/coding-tools.d.ts +0 -47
- package/dist/coding-tools.js +0 -189
- package/dist/computer-adb.d.ts +0 -12
- package/dist/computer-adb.js +0 -14
- package/dist/console/assets/index-Dn0ngwG9.js +0 -535
- package/dist/console/assets/index-DvW6Aled.css +0 -1
- package/dist/grade.d.ts +0 -63
- package/dist/grade.js +0 -150
- package/dist/mcp-servers.d.ts +0 -269
- package/dist/mcp-servers.js +0 -456
- package/dist/packs.d.ts +0 -71
- package/dist/packs.js +0 -180
- package/dist/sealed-settings.d.ts +0 -60
- package/dist/sealed-settings.js +0 -171
- package/dist/sessions.d.ts +0 -6
- package/dist/sessions.js +0 -109
- package/dist/workspace/computer-serves.d.ts +0 -12
- package/dist/workspace/computer-serves.js +0 -15
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { checkGpu, configurationOf, imagesOf } from "@parcha/agentrun-computer";
|
|
2
|
+
import { noDockerWords } from "../docker-daemon.js";
|
|
1
3
|
/** A provider's keys as the claim reads them: each key its registry entry declares, by `keyOf` (the server's reader:
|
|
2
4
|
* key-meta.ts keyReader, the environment's value, else the saved one); a key with no value is left out. */
|
|
3
5
|
export const providerKeys = (registry, keyOf) => async (provider) => {
|
|
@@ -9,15 +11,28 @@ export const providerKeys = (registry, keyOf) => async (provider) => {
|
|
|
9
11
|
}
|
|
10
12
|
return keys;
|
|
11
13
|
};
|
|
14
|
+
/** Whether a provider's computers run only on the vendor's own network: the network forms it declares (its
|
|
15
|
+
* descriptor's, its capabilities().network) are "open" alone, as a cloud phone's and a hosted browser's are. */
|
|
16
|
+
export const vendorNetworkOnly = (network) => network !== undefined && network.length > 0 && network.every((one) => one === "open");
|
|
17
|
+
/** Whether a provider's computers can't have no network: it declares its network forms and "none" isn't one (a cloud
|
|
18
|
+
* phone, a hosted browser, Local Chrome). */
|
|
19
|
+
export const needsNetwork = (network) => network !== undefined && network.length > 0 && !network.includes("none");
|
|
20
|
+
/** Why a computer that needs a network is refused where this server's AGENTRUN_BOX_ALLOW is none, in words that name the
|
|
21
|
+
* fix: the operator said no network at all, and the computer can't run without one. */
|
|
22
|
+
export const noNetworkRefusal = (label, kind) => `This agent's computer is a ${label} ${kind}, which needs a network (the vendor's own, or public addresses from this machine), and this server's AGENTRUN_BOX_ALLOW is none (no network): pick a computer that runs with no network in ${SETTINGS}, or set AGENTRUN_BOX_ALLOW to a host list.`;
|
|
12
23
|
/** Whether an agent's computer `setting` can be had in `mode` now, by the answers the claim gives (resolveComputer: the
|
|
13
24
|
* kind, the provider and what it serves, the mode's mount, the provider's keys by `keyOf`): ok, or its refusal in words
|
|
14
25
|
* that name the fix. Nothing starts. A run's start asks it before the run is made (runnable.ts).
|
|
15
26
|
*
|
|
16
|
-
* `answers`: whether a provider that binds a folder of this machine (Docker) answers here now, or why not
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
|
|
27
|
+
* `answers`: whether a provider that binds a folder of this machine (Docker) answers here now, or why not (the server's
|
|
28
|
+
* daemon check, docker-daemon.ts). Any computer on such a provider, a sandbox or a desktop in either mode, is refused
|
|
29
|
+
* here, at the start, where the claim would only fail to launch it: no daemon at all in the one wording Settings →
|
|
30
|
+
* Computers and the claim say (noDockerWords), another reason in its own words. Asked here, not in resolveComputer: the
|
|
31
|
+
* claim launches it, and asks only once its launch fails (ClaimSide.daemon). Absent: not asked.
|
|
32
|
+
*
|
|
33
|
+
* `boxAllow`: this server's allow setting (box-settings.ts boxAllowOf). Under "none", a computer whose provider makes no
|
|
34
|
+
* "none" is refused (noNetworkRefusal), as the claim refuses it. Absent: not asked. */
|
|
35
|
+
export async function computerReadiness(setting, mode, registry, keyOf, answers, boxAllow) {
|
|
21
36
|
const resolved = await resolveComputer(setting, mode, registry, {
|
|
22
37
|
keysOf: providerKeys(registry, keyOf),
|
|
23
38
|
// A setting is given, so the Mode 1 default (the only asker) is never read; and nothing is launched.
|
|
@@ -27,10 +42,16 @@ export async function computerReadiness(setting, mode, registry, keyOf, answers)
|
|
|
27
42
|
if ("refused" in resolved)
|
|
28
43
|
return { refused: resolved.refused };
|
|
29
44
|
const entry = registry.PROVIDERS.find((one) => one.id === resolved.provider);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
45
|
+
if (entry && entry.mounts.includes("bind") && answers) {
|
|
46
|
+
const said = await answers(entry.id);
|
|
47
|
+
// It names the box whose probe said no (a refusal's details.box), as the box check did.
|
|
48
|
+
if (!said.up && said.absent)
|
|
49
|
+
return { refused: noDockerWords(resolved.kind, registry.PROVIDERS, mode), box: entry.id };
|
|
50
|
+
if (!said.up)
|
|
51
|
+
return { refused: `This agent's computer is a ${entry.label} ${resolved.kind}, and this server cannot run it: ${said.reason.replace(/[.!?]+$/, "")}.`, box: entry.id };
|
|
52
|
+
}
|
|
53
|
+
if (boxAllow === "none" && entry && needsNetwork(entry.network))
|
|
54
|
+
return { refused: noNetworkRefusal(entry.label, resolved.kind) };
|
|
34
55
|
return { ok: true };
|
|
35
56
|
}
|
|
36
57
|
const SETTINGS = "Settings → Computers";
|
|
@@ -61,6 +82,11 @@ function mountsFolder(kind, entry, serving, mode) {
|
|
|
61
82
|
}
|
|
62
83
|
/** The configurations of `entry` that serve `kind`. */
|
|
63
84
|
const servingOf = (registry, entry, kind) => entry.capabilities.filter((one) => registry.servingRefusals(one, kind).length === 0);
|
|
85
|
+
/** The one configuration of `serving` the setting selects (configurationOf), as a list: [] when its image names none. */
|
|
86
|
+
const selectedOf = (serving, setting, entry, kind) => {
|
|
87
|
+
const one = configurationOf(serving, setting.image, entry.defaultImage?.[kind]);
|
|
88
|
+
return one ? [one] : [];
|
|
89
|
+
};
|
|
64
90
|
/**
|
|
65
91
|
* Where a run of an agent with computer `setting` has its shell in `mode` (shellPlaceOf), read off the setting and the
|
|
66
92
|
* kind registry before anything starts: what the claim's runTools gives the run once its computer is started. "computer"
|
|
@@ -80,7 +106,7 @@ export function runShellOf(setting, mode, registry) {
|
|
|
80
106
|
const entry = registry.PROVIDERS.find((one) => one.id === setting.provider);
|
|
81
107
|
if (!entry)
|
|
82
108
|
return "none";
|
|
83
|
-
const serving = servingOf(registry, entry, kind);
|
|
109
|
+
const serving = selectedOf(servingOf(registry, entry, kind), setting, entry, kind);
|
|
84
110
|
if (serving.length === 0)
|
|
85
111
|
return "none";
|
|
86
112
|
const mounts = mountsFolder(kind, entry, serving, mode);
|
|
@@ -125,8 +151,21 @@ export async function resolveComputer(given, mode, registry, side) {
|
|
|
125
151
|
const why = entry.capabilities.map((one) => registry.servingRefusals(one, kind)).sort((a, b) => a.length - b.length)[0] ?? [];
|
|
126
152
|
return { refused: `${entry.label} gives no ${kind} computer${why.length > 0 ? `: ${why.join("; ")}` : ""}. Pick ${pick}` };
|
|
127
153
|
}
|
|
128
|
-
// The
|
|
129
|
-
|
|
154
|
+
// The configuration the setting's image selects: one the provider does not offer for the kind is refused, naming those
|
|
155
|
+
// it does.
|
|
156
|
+
const [configuration] = selectedOf(serving, setting, entry, kind);
|
|
157
|
+
if (!configuration) {
|
|
158
|
+
const images = imagesOf(serving, entry.defaultImage?.[kind]);
|
|
159
|
+
const offers = images.length === 0 ? `offers no ${kind} image to choose: remove the image` : `offers the ${kind} image${images.length === 1 ? "" : "s"} ${images.join(", ")}: pick one`;
|
|
160
|
+
// A configuration its descriptor parks (built, not offered yet): refused saying so, never as an unknown image.
|
|
161
|
+
const parked = entry.parked?.find((one) => one.image === setting.image);
|
|
162
|
+
if (parked)
|
|
163
|
+
return { refused: `${parked.why}, so this agent's ${JSON.stringify(setting.image)} ${kind} is parked. It ${offers} for this agent's computer in ${SETTINGS}.` };
|
|
164
|
+
return { refused: `${entry.label} has no ${kind} image ${JSON.stringify(setting.image)}. It ${offers} for this agent's computer in ${SETTINGS}.` };
|
|
165
|
+
}
|
|
166
|
+
// The run's folder: mounted where the selected configuration has files and exec and the provider mounts the mode's
|
|
167
|
+
// folder.
|
|
168
|
+
const mounts = mountsFolder(kind, entry, [configuration], mode);
|
|
130
169
|
if (kind === "sandbox" && !mounts) {
|
|
131
170
|
if (mode === 1)
|
|
132
171
|
return { refused: `Mode 1 runs a sandbox only on Docker: a ${entry.label} sandbox can't reach the run's folder on this machine. Pick Docker for this agent's computer in ${SETTINGS}, or another kind of computer.` };
|
|
@@ -134,6 +173,14 @@ export async function resolveComputer(given, mode, registry, side) {
|
|
|
134
173
|
return { refused: `Mode 2 keeps workspaces on Archil; a local Docker computer can't mount them. Pick a remote sandbox for this agent's computer in ${SETTINGS}, or no computer.` };
|
|
135
174
|
return { refused: `A ${entry.label} sandbox can't mount the run's folder from Archil: pick another sandbox for this agent's computer in ${SETTINGS}.` };
|
|
136
175
|
}
|
|
176
|
+
// Its GPUs, a sandbox's alone: in checkGpu's words, against what the configuration the setting selected declares, with
|
|
177
|
+
// the mode's folder as the mount it takes (a sandbox here always mounts it).
|
|
178
|
+
const gpu = kind === "sandbox" && setting.gpu ? setting.gpu : undefined;
|
|
179
|
+
if (gpu) {
|
|
180
|
+
const [refusal] = checkGpu(gpu, configuration, { kind: mode === 1 ? "bind" : "archil" });
|
|
181
|
+
if (refusal)
|
|
182
|
+
return { refused: `A ${entry.label} sandbox can't have this agent's GPUs: ${refusal.message}. Change the GPUs or the provider for this agent's computer in ${SETTINGS}.` };
|
|
183
|
+
}
|
|
137
184
|
// Its keys: every required one saved, before anything starts; only declared names go to the provider.
|
|
138
185
|
const saved = await side.keysOf(entry.id);
|
|
139
186
|
const has = (name) => typeof saved[name] === "string" && saved[name] !== "";
|
|
@@ -154,9 +201,13 @@ export async function resolveComputer(given, mode, registry, side) {
|
|
|
154
201
|
const mount = mounts ? await workspace.mountSpec() : undefined;
|
|
155
202
|
let launched;
|
|
156
203
|
try {
|
|
157
|
-
launched = await side.launch(entry, { kind, keys, ...(mount ? { mount } : {}), ...(signal ? { signal } : {}) });
|
|
204
|
+
launched = await side.launch(entry, { kind, keys, configuration, ...(mount ? { mount } : {}), ...(gpu ? { gpu: { type: gpu.type, count: gpu.count } } : {}), ...(signal ? { signal } : {}) });
|
|
158
205
|
}
|
|
159
206
|
catch (error) {
|
|
207
|
+
// A provider that binds a folder of this machine (Docker) whose daemon does not answer: the one wording.
|
|
208
|
+
const said = entry.mounts.includes("bind") && side.daemon ? await side.daemon(entry.id).catch(() => undefined) : undefined;
|
|
209
|
+
if (said && !said.up && said.absent)
|
|
210
|
+
throw unavailable(noDockerWords(kind, registry.PROVIDERS, mode));
|
|
160
211
|
throw unavailable(`${entry.label} could not start a ${kind} computer: ${error instanceof Error ? error.message : String(error)}`);
|
|
161
212
|
}
|
|
162
213
|
const computer = runComputerOf(kind, launched, mounts ? check : undefined);
|
|
@@ -171,8 +222,9 @@ export async function resolveComputer(given, mode, registry, side) {
|
|
|
171
222
|
/** The started computer as runTools takes it, or what it lacks, in words. */
|
|
172
223
|
function runComputerOf(kind, launched, check) {
|
|
173
224
|
const groups = launched.groups;
|
|
225
|
+
// The run's browser tool opens a browser's sessions through its provider.
|
|
174
226
|
if (kind === "browser")
|
|
175
|
-
return launched.
|
|
227
|
+
return launched.browser ? { kind, browser: launched.browser } : "it gave no CDP connection";
|
|
176
228
|
const { client } = launched;
|
|
177
229
|
if (!client)
|
|
178
230
|
return "it gave no computer protocol client";
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { Context } from "@earendil-works/chord";
|
|
2
2
|
import type { HostTool } from "@parcha/agentrun-kernel";
|
|
3
|
-
import { type CapabilityKind, type
|
|
3
|
+
import { type CapabilityKind, type Registry } from "@parcha/agentrun-kernel/kernel";
|
|
4
4
|
import type { ComputerClient, Group } from "@parcha/agentrun-computer";
|
|
5
|
-
import type { Park, RunGate } from "../tool-gate.js";
|
|
6
5
|
import type { AttachableComputer, MountCheck } from "./attach.js";
|
|
7
6
|
import { type PiAnswer, type PiExecutor } from "./executors.js";
|
|
8
7
|
import { type Hands } from "./hands.js";
|
|
9
|
-
import { type ShellPlace } from "./resolve-computer.js";
|
|
8
|
+
import { type ClaimBrowser, type ShellPlace } from "./resolve-computer.js";
|
|
10
9
|
import type { Workspace } from "./workspace.js";
|
|
11
10
|
/**
|
|
12
11
|
* The run's computer, as runTools takes it, by its kind:
|
|
@@ -15,7 +14,8 @@ import type { Workspace } from "./workspace.js";
|
|
|
15
14
|
* - desktop: a screen and input; the folder is attached only when its provider mounts it (`check` given) and it offers
|
|
16
15
|
* files and exec;
|
|
17
16
|
* - phone: a screen, touch and apps; never attached;
|
|
18
|
-
* - browser: its CDP
|
|
17
|
+
* - browser: what the run's browser tool drives it by (its CDP URL through its provider); no tools of the registry's,
|
|
18
|
+
* never attached.
|
|
19
19
|
* `groups`: what the computer offers (its hello's groups), which fill its kind's ports.
|
|
20
20
|
*/
|
|
21
21
|
export type RunComputer = {
|
|
@@ -35,7 +35,7 @@ export type RunComputer = {
|
|
|
35
35
|
readonly groups: readonly Group[];
|
|
36
36
|
} | {
|
|
37
37
|
readonly kind: "browser";
|
|
38
|
-
readonly
|
|
38
|
+
readonly browser: ClaimBrowser;
|
|
39
39
|
};
|
|
40
40
|
/** A desktop's or a phone's ports as a person's hold on the computer gives them back: each call made while the person
|
|
41
41
|
* holds it waits for hand-back; a read then runs, an action then is refused (the take-over's own words). With them, the
|
|
@@ -81,6 +81,7 @@ export declare function runHands(workspace: Workspace, computer: RunComputer | u
|
|
|
81
81
|
readonly context: Context;
|
|
82
82
|
readonly aliases?: readonly string[];
|
|
83
83
|
readonly hold?: RunHold;
|
|
84
|
+
readonly bashPolicy?: string;
|
|
84
85
|
}): Promise<RunHands>;
|
|
85
86
|
/** A tool as the kernel's registry lists it: what bindTools reads of its ToolDef. */
|
|
86
87
|
export type RegistryDef = {
|
|
@@ -105,17 +106,12 @@ export type ToolResults = Map<string, {
|
|
|
105
106
|
}>;
|
|
106
107
|
/**
|
|
107
108
|
* `registry`'s tools that `names` names, in that order, bound to `run`: each as the kernel's HostTool, which an adapter's
|
|
108
|
-
* session takes.
|
|
109
|
-
* run of an approved call): a refused one runs nothing, a parked one says it waits. Then the registry runs it on the
|
|
109
|
+
* session takes. The run's gate decided the call before its intent (the adapter loop's). The registry runs it on the
|
|
110
110
|
* run's hands, and its answer is the text a model reads (executors.ts answerText): the output, the failure's words, the
|
|
111
111
|
* diagnostics; in a failure, a write's or an edit's answer a path in the run's folder is named relative to it. A
|
|
112
112
|
* failure the registry throws is the answer's text. `results` keeps each answer by its call id.
|
|
113
113
|
*/
|
|
114
114
|
export declare function bindTools(run: RunHands, registry: RunRegistry, names: readonly string[], options?: {
|
|
115
|
-
readonly gated?: {
|
|
116
|
-
readonly gate: RunGate;
|
|
117
|
-
readonly park: Park;
|
|
118
|
-
};
|
|
119
115
|
readonly results?: ToolResults;
|
|
120
116
|
}): HostTool[];
|
|
121
117
|
/** A run's tools: what E2's harness start calls runTools for. */
|
|
@@ -125,47 +121,35 @@ export type RunTools = {
|
|
|
125
121
|
/** The run's registry: the kernel's definitions, words and limits, over this run's hands and executors. */
|
|
126
122
|
readonly registry: Registry;
|
|
127
123
|
readonly hands: Hands;
|
|
124
|
+
/** Where the run's shell is (runHands' shell): its gate reads its defaults by it (tool-gate.ts defaultPermission). */
|
|
125
|
+
readonly shell: ShellPlace;
|
|
128
126
|
/** The tools the claimed computer brings by its kind, as its groups offer them: a desktop's (desktop_screen,
|
|
129
127
|
* desktop_input, computer_request_handoff) or a phone's, by the kernel registry's own list. None with no computer, for
|
|
130
128
|
* a sandbox, or for a browser (its own binding lists its tools). An agent names its computer, never these tools
|
|
131
129
|
* (definition.tools refuses them), so a run binds them beside what it was granted (withKindTools). */
|
|
132
130
|
readonly kindTools: readonly string[];
|
|
133
131
|
/** The registry's tools `names` names, as the kernel's HostTool an adapter's session takes, each call through the
|
|
134
|
-
* run's gate
|
|
135
|
-
hostTools(names: readonly string[],
|
|
136
|
-
readonly gate: RunGate;
|
|
137
|
-
readonly park: Park;
|
|
138
|
-
}, results?: ToolResults): HostTool[];
|
|
132
|
+
* run's gate decided before its intent, each answer kept in `results` (bindTools). */
|
|
133
|
+
hostTools(names: readonly string[], results?: ToolResults): HostTool[];
|
|
139
134
|
/** The run's end, before the computer is let go: its background processes ended (TERM, then KILL 3 s later; none with
|
|
140
135
|
* no computer), then bash's full outputs and TMPDIR swept. */
|
|
141
136
|
end(): Promise<void>;
|
|
142
137
|
};
|
|
143
|
-
/** A browser computer's tools as the run's start gives them: pi-browser's runs by tool name (over hands.browser), and
|
|
144
|
-
* what the browser offers, which lists browser_downloads, browser_upload and browser_request_handoff (pi-browser's
|
|
145
|
-
* listedFor). */
|
|
146
|
-
export type RunBrowser = {
|
|
147
|
-
readonly executors: Readonly<Record<string, Executor>>;
|
|
148
|
-
readonly offers: {
|
|
149
|
-
readonly downloads: boolean;
|
|
150
|
-
readonly upload: boolean;
|
|
151
|
-
readonly handoff: boolean;
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
138
|
/**
|
|
155
139
|
* A run's tools on `workspace`, attached to `computer` when its kind has files and exec and its provider mounts the
|
|
156
140
|
* folder (RunComputer). `computer.check` is the mount check attach runs (attach.ts MountCheck: `{ readBackOf, epoch }`),
|
|
157
141
|
* which the caller builds with the claim's epoch, so a read-back under another epoch is refused. `options.mode`: 1, or 2
|
|
158
142
|
* (the run's folder on Archil); `options.aliases`: other absolute names of the run's folder a tool call may give (the
|
|
159
|
-
* harness's scratch folder)
|
|
160
|
-
*
|
|
161
|
-
*
|
|
143
|
+
* harness's scratch folder). The tools' definitions, words and limits come only from the kernel's registry; this binds
|
|
144
|
+
* their executors to the run. A browser computer brings none of the registry's: the run's browser tool (tools.ts,
|
|
145
|
+
* pi-browser's durable extension) drives it.
|
|
162
146
|
*/
|
|
163
147
|
export declare function runTools(workspace: Workspace, computer: RunComputer | undefined, options: {
|
|
164
148
|
readonly mode: 1 | 2;
|
|
165
149
|
readonly context: Context;
|
|
166
150
|
readonly aliases?: readonly string[];
|
|
167
|
-
readonly browser?: RunBrowser;
|
|
168
151
|
readonly hold?: RunHold;
|
|
152
|
+
readonly bashPolicy?: string;
|
|
169
153
|
}): Promise<RunTools>;
|
|
170
154
|
/** The names a run binds as host tools: what it was granted, then the tools its claimed computer brings by its kind
|
|
171
155
|
* (RunTools.kindTools), each once. Each goes through the run's one gate under its own settings key (a desktop's under
|
|
@@ -2,6 +2,7 @@ import { capabilityToolDefs, createRegistry, endBackground } from "@parcha/agent
|
|
|
2
2
|
import { inputOf, phoneOf, screenOf } from "./computer-ports.js";
|
|
3
3
|
import { answerText, piExecutor } from "./executors.js";
|
|
4
4
|
import { ARCHIL_MAX_EXEC_S, handsOf, MAX_EXEC_S, shellEnv } from "./hands.js";
|
|
5
|
+
import { policyEnv, policyPrelude } from "../bash-read-only.js";
|
|
5
6
|
import { COMPUTER_ROOT, realOf, workspaceRelative } from "./paths.js";
|
|
6
7
|
import { bashTool, fileTools, OUTPUT_DIR, piEnv, readAnywhereInComputer } from "./pi-env.js";
|
|
7
8
|
import { shellPlaceOf } from "./resolve-computer.js";
|
|
@@ -15,7 +16,7 @@ function mountedIn(computer) {
|
|
|
15
16
|
return undefined;
|
|
16
17
|
}
|
|
17
18
|
/** The kind's ports, as the computer's groups offer them, the kinds whose tools the run gets (a desktop's with a screen
|
|
18
|
-
* and input, a phone's with a screen and touch
|
|
19
|
+
* and input, a phone's with a screen and touch; a browser's none), and the kind's tools its groups do not offer: a
|
|
19
20
|
* phone's tree without apps.ui_tree, its keys without input.keys (an iPhone's today). */
|
|
20
21
|
function portsOf(computer) {
|
|
21
22
|
if (computer?.kind === "desktop") {
|
|
@@ -31,8 +32,6 @@ function portsOf(computer) {
|
|
|
31
32
|
const keys = computer.groups.includes("input.keys");
|
|
32
33
|
return { ports: { phone: phoneOf(computer.computer.client, { tree, keys }) }, kinds: ["phone"], without: [...(tree ? [] : ["phone_tree"]), ...(keys ? [] : ["phone_key"])] };
|
|
33
34
|
}
|
|
34
|
-
if (computer?.kind === "browser")
|
|
35
|
-
return { ports: { browser: { connect: computer.connect } }, kinds: ["browser"], without: [] };
|
|
36
35
|
return { ports: {}, kinds: [], without: [] };
|
|
37
36
|
}
|
|
38
37
|
/** The run's scratch in its own folder: bash's TMPDIR. */
|
|
@@ -55,8 +54,13 @@ export async function runHands(workspace, computer, options) {
|
|
|
55
54
|
const names = [cwd, ...(here !== undefined && here !== cwd ? [here] : []), ...(options.aliases ?? [])];
|
|
56
55
|
const maxExecS = mounted === undefined && options.mode === 2 ? ARCHIL_MAX_EXEC_S : MAX_EXEC_S;
|
|
57
56
|
await attached.mkdir(TMP_DIR);
|
|
58
|
-
|
|
59
|
-
const
|
|
57
|
+
// Under a bash policy (an agent's tool_settings.bash.policy), what the policy adds: git's config locked down.
|
|
58
|
+
const env = { ...shellEnv({ tmpdir: `${cwd}/${TMP_DIR}`, ...(mounted === undefined ? { home: cwd } : {}) }), ...policyEnv(options.bashPolicy) };
|
|
59
|
+
// And a prelude: git run only where it holds the whole lock-down (policyPrelude).
|
|
60
|
+
const prelude = policyPrelude(options.bashPolicy);
|
|
61
|
+
// And on Archil's serverless exec, no network for the shell's commands.
|
|
62
|
+
const network = options.bashPolicy !== undefined && mounted === undefined && options.mode === 2 ? { network: "deny" } : {};
|
|
63
|
+
const fileEnv = piEnv(attached, { cwd, aliases: names.slice(1), env, defaultTimeoutS: maxExecS, ...(prelude ? { prelude } : {}), ...network });
|
|
60
64
|
const tools = Object.fromEntries([...fileTools(), bashTool()].map((tool) => [tool.name, tool]));
|
|
61
65
|
const read = mounted === undefined ? tools.read : readAnywhereInComputer(tools.read, attached, names, env);
|
|
62
66
|
const executor = (tool) => piExecutor(tool, fileEnv, options.context);
|
|
@@ -67,7 +71,7 @@ export async function runHands(workspace, computer, options) {
|
|
|
67
71
|
workspace: attached,
|
|
68
72
|
// The computer's processes, for the five background tools: the attached Workspace's own; none when the folder is not
|
|
69
73
|
// attached. The kind's ports beside them.
|
|
70
|
-
hands: { ...handsOf(attached, { maxExecS, env, ...(mounted === undefined ? {} : { processes: attached.process }) }), ...ports },
|
|
74
|
+
hands: { ...handsOf(attached, { maxExecS, env, ...(prelude ? { prelude } : {}), ...network, ...(mounted === undefined ? {} : { processes: attached.process }) }), ...ports },
|
|
71
75
|
shell,
|
|
72
76
|
kinds,
|
|
73
77
|
without,
|
|
@@ -86,8 +90,7 @@ export async function runHands(workspace, computer, options) {
|
|
|
86
90
|
const SAYS_PATH = new Set(["write", "edit"]);
|
|
87
91
|
/**
|
|
88
92
|
* `registry`'s tools that `names` names, in that order, bound to `run`: each as the kernel's HostTool, which an adapter's
|
|
89
|
-
* session takes.
|
|
90
|
-
* run of an approved call): a refused one runs nothing, a parked one says it waits. Then the registry runs it on the
|
|
93
|
+
* session takes. The run's gate decided the call before its intent (the adapter loop's). The registry runs it on the
|
|
91
94
|
* run's hands, and its answer is the text a model reads (executors.ts answerText): the output, the failure's words, the
|
|
92
95
|
* diagnostics; in a failure, a write's or an edit's answer a path in the run's folder is named relative to it. A
|
|
93
96
|
* failure the registry throws is the answer's text. `results` keeps each answer by its call id.
|
|
@@ -104,14 +107,7 @@ export function bindTools(run, registry, names, options = {}) {
|
|
|
104
107
|
description: def.description,
|
|
105
108
|
inputSchema: def.parameters,
|
|
106
109
|
replay: def.replaySafe ? "safe" : "never",
|
|
107
|
-
async call(args, { callId, signal,
|
|
108
|
-
// A replay (the kernel's attempt above 0) may follow an attempt that was sent: the gate's refusal then says so.
|
|
109
|
-
const refused = await options.gated?.gate.enter(name, args, callId, options.gated.park, (attempt ?? 0) > 0 ? { replayed: true } : {});
|
|
110
|
-
if (refused) {
|
|
111
|
-
const answer = { text: refused.text, isError: refused.isError === true };
|
|
112
|
-
options.results?.set(callId, answer);
|
|
113
|
-
return refused.parked ? { ...answer, parked: true } : answer;
|
|
114
|
-
}
|
|
110
|
+
async call(args, { callId, signal, model, output }) {
|
|
115
111
|
let given;
|
|
116
112
|
try {
|
|
117
113
|
// The calling model and the call's output stream, as the session gave them: pi's read sizes an image by the
|
|
@@ -136,28 +132,21 @@ export function bindTools(run, registry, names, options = {}) {
|
|
|
136
132
|
* folder (RunComputer). `computer.check` is the mount check attach runs (attach.ts MountCheck: `{ readBackOf, epoch }`),
|
|
137
133
|
* which the caller builds with the claim's epoch, so a read-back under another epoch is refused. `options.mode`: 1, or 2
|
|
138
134
|
* (the run's folder on Archil); `options.aliases`: other absolute names of the run's folder a tool call may give (the
|
|
139
|
-
* harness's scratch folder)
|
|
140
|
-
*
|
|
141
|
-
*
|
|
135
|
+
* harness's scratch folder). The tools' definitions, words and limits come only from the kernel's registry; this binds
|
|
136
|
+
* their executors to the run. A browser computer brings none of the registry's: the run's browser tool (tools.ts,
|
|
137
|
+
* pi-browser's durable extension) drives it.
|
|
142
138
|
*/
|
|
143
139
|
export async function runTools(workspace, computer, options) {
|
|
144
140
|
const run = await runHands(workspace, computer, options);
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const { BROWSER_TOOLS, listedFor } = await import("@parcha/pi-browser");
|
|
148
|
-
const offers = options.browser?.offers;
|
|
149
|
-
const browserTools = run.kinds.includes("browser") ? BROWSER_TOOLS.filter((contract) => listedFor(contract, offers ?? { downloads: false, upload: false, handoff: false })) : BROWSER_TOOLS;
|
|
150
|
-
const registry = createRegistry({
|
|
151
|
-
maxExecS: run.maxExecS, shell: run.shell, kinds: run.kinds, browserTools, without: run.without,
|
|
152
|
-
executors: { ...run.executors, ...(options.browser ? { browser: options.browser.executors } : {}) },
|
|
153
|
-
});
|
|
154
|
-
const brought = new Set(run.kinds.filter((kind) => kind !== "browser").flatMap((kind) => capabilityToolDefs(kind).map((def) => def.name)));
|
|
141
|
+
const registry = createRegistry({ maxExecS: run.maxExecS, shell: run.shell, kinds: run.kinds, without: run.without, executors: run.executors });
|
|
142
|
+
const brought = new Set(run.kinds.flatMap((kind) => capabilityToolDefs(kind).map((def) => def.name)));
|
|
155
143
|
return {
|
|
156
144
|
workspace: run.workspace,
|
|
157
145
|
registry,
|
|
158
146
|
hands: run.hands,
|
|
147
|
+
shell: run.shell,
|
|
159
148
|
kindTools: registry.list().map((def) => def.name).filter((name) => brought.has(name)),
|
|
160
|
-
hostTools: (names,
|
|
149
|
+
hostTools: (names, results) => bindTools(run, registry, names, results ? { results } : {}),
|
|
161
150
|
async end() {
|
|
162
151
|
await endBackground(run.hands);
|
|
163
152
|
await run.sweep();
|
|
@@ -99,6 +99,11 @@ export type ExecOptions = {
|
|
|
99
99
|
/** Ends the call: the whole process group is killed, and exec rejects with the signal's reason (an AbortError). A
|
|
100
100
|
* signal already aborted runs nothing. */
|
|
101
101
|
readonly signal?: AbortSignal;
|
|
102
|
+
/** "deny": the program reaches no network (a bash policy's shell, run-tools.ts). Archil's serverless exec sends it as
|
|
103
|
+
* the container's network policy; where Archil's plan takes none, the program runs with the network open and its
|
|
104
|
+
* stderr starts with a line saying so (archil.ts). A backend that cannot deny a program's network refuses the call
|
|
105
|
+
* (REFUSED) and runs nothing. */
|
|
106
|
+
readonly network?: "deny";
|
|
102
107
|
};
|
|
103
108
|
export type ExecResult = {
|
|
104
109
|
readonly stdout: Uint8Array;
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import type { ToolRegistration } from "@earendil-works/pi-durable";
|
|
2
1
|
export { realOf, workspaceRelative } from "./workspace/paths.js";
|
|
3
|
-
/**
|
|
4
|
-
* Refuses `given`, a path a call gave that leaves the workspace, in the one words every refusal uses:
|
|
5
|
-
* `<given>: outside the workspace`, and no other path (not the workspace, a box's work dir, or where it resolves). It is
|
|
6
|
-
* the confinement's typed refusal (`PathOutsideWorkError`, `outside_work`), so its type tells it from any other error.
|
|
7
|
-
* For a tool that checks a path itself (a box's file tools); pi's own tools refuse through the confinement, named by
|
|
8
|
-
* `asGivenRefusals`.
|
|
9
|
-
*/
|
|
10
|
-
export declare function refuseOutsideWorkspace(given: string): never;
|
|
11
|
-
/**
|
|
12
|
-
* pi's file `tools`, each with its confinement's refusal named by the path the call gave, as it gave it:
|
|
13
|
-
* `../../.token: outside the workspace`. The confinement names no path itself: pi's tools resolve a path against the
|
|
14
|
-
* workspace before they ask for it, so every path it sees is the host's own (`<data>/runs/.token`), and the call's
|
|
15
|
-
* `path` is the only one the model gave. A refusal is told by its type (`PathOutsideWorkError`), never by its text; one
|
|
16
|
-
* already named (`refuseOutsideWorkspace`), every other error, and every result are the tool's own.
|
|
17
|
-
*/
|
|
18
|
-
export declare function asGivenRefusals(tools: readonly ToolRegistration[]): ToolRegistration[];
|
|
19
2
|
/** How a run's rows name a file path, a whole path (never a text): one in the run's directory relative to its workspace
|
|
20
3
|
* (`<run>/work`: `hello.md`, `.`, `../work 2024/a.md`, `..`), and any other path, or one that is not absolute, exactly
|
|
21
4
|
* as given. Checked against the workspace as serve names it and as the kernel resolves it (a harness's CLI sends the
|
package/dist/workspace-paths.js
CHANGED
|
@@ -1,50 +1,10 @@
|
|
|
1
1
|
// How serve names a path in the run's workspace to a person or a model: relative to the workspace, never by the server's
|
|
2
2
|
// data directory. The rule is one for every place that shows a path: a host tool's error or write result
|
|
3
|
-
// (host-tools.ts), and a
|
|
4
|
-
// outside the workspace names the path the call gave, as it gave it, and no other (`asGivenRefusals`), wherever the
|
|
5
|
-
// coding tools come from (coding-tools.ts: pi's own runs and the other harnesses' host tools, on the runner and in a box).
|
|
3
|
+
// (host-tools.ts), and a row's file path (rowPaths).
|
|
6
4
|
import { dirname, isAbsolute, join, relative, sep } from "node:path";
|
|
7
|
-
import { PathOutsideWorkError } from "@parcha/pi-durable-disk";
|
|
8
5
|
import { realOf } from "./workspace/paths.js";
|
|
9
6
|
// How a text names the run's folder, and a path as the kernel resolves it, are the Workspace's (workspace/paths.ts).
|
|
10
7
|
export { realOf, workspaceRelative } from "./workspace/paths.js";
|
|
11
|
-
/** A refusal already named by the path the call gave: `asGivenRefusals` passes it on as it is. */
|
|
12
|
-
class GivenPathRefusal extends PathOutsideWorkError {
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Refuses `given`, a path a call gave that leaves the workspace, in the one words every refusal uses:
|
|
16
|
-
* `<given>: outside the workspace`, and no other path (not the workspace, a box's work dir, or where it resolves). It is
|
|
17
|
-
* the confinement's typed refusal (`PathOutsideWorkError`, `outside_work`), so its type tells it from any other error.
|
|
18
|
-
* For a tool that checks a path itself (a box's file tools); pi's own tools refuse through the confinement, named by
|
|
19
|
-
* `asGivenRefusals`.
|
|
20
|
-
*/
|
|
21
|
-
export function refuseOutsideWorkspace(given) {
|
|
22
|
-
throw new GivenPathRefusal(given, "outside_work", `${given}: outside the workspace`);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* pi's file `tools`, each with its confinement's refusal named by the path the call gave, as it gave it:
|
|
26
|
-
* `../../.token: outside the workspace`. The confinement names no path itself: pi's tools resolve a path against the
|
|
27
|
-
* workspace before they ask for it, so every path it sees is the host's own (`<data>/runs/.token`), and the call's
|
|
28
|
-
* `path` is the only one the model gave. A refusal is told by its type (`PathOutsideWorkError`), never by its text; one
|
|
29
|
-
* already named (`refuseOutsideWorkspace`), every other error, and every result are the tool's own.
|
|
30
|
-
*/
|
|
31
|
-
export function asGivenRefusals(tools) {
|
|
32
|
-
return tools.map((tool) => ({
|
|
33
|
-
...tool,
|
|
34
|
-
async execute(args, api, context) {
|
|
35
|
-
try {
|
|
36
|
-
return await tool.execute(args, api, context);
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
const reason = error instanceof PathOutsideWorkError ? error.reason : undefined;
|
|
40
|
-
const given = args?.path;
|
|
41
|
-
if (reason === undefined || error instanceof GivenPathRefusal || typeof given !== "string" || given === "")
|
|
42
|
-
throw error;
|
|
43
|
-
throw new GivenPathRefusal(given, reason, `${given}: ${error.message}`);
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
8
|
/** How a run's rows name a file path, a whole path (never a text): one in the run's directory relative to its workspace
|
|
49
9
|
* (`<run>/work`: `hello.md`, `.`, `../work 2024/a.md`, `..`), and any other path, or one that is not absolute, exactly
|
|
50
10
|
* as given. Checked against the workspace as serve names it and as the kernel resolves it (a harness's CLI sends the
|
package/dist/workspace.d.ts
CHANGED
|
@@ -34,8 +34,6 @@ export declare function openWorkFile(work: string, rel: string): Promise<{
|
|
|
34
34
|
handle: FileHandle;
|
|
35
35
|
stats: Stats;
|
|
36
36
|
}>;
|
|
37
|
-
/** `rel` under `work` as text, read as `openWorkFile` reads it. */
|
|
38
|
-
export declare function readWorkText(work: string, rel: string): Promise<string>;
|
|
39
37
|
/** `rel` under `work`, its bytes, read as `openWorkFile` reads it; refused ("over_cap") when larger than `maxBytes`. */
|
|
40
38
|
export declare function readWorkBytes(work: string, rel: string, { maxBytes }: {
|
|
41
39
|
maxBytes: number;
|
|
@@ -54,18 +52,3 @@ export declare function walkWork(work: string, visit: (path: string, stats: Stat
|
|
|
54
52
|
depth?: number;
|
|
55
53
|
refused?: (path: string, reason: RefusedReason) => void;
|
|
56
54
|
}): Promise<void>;
|
|
57
|
-
/**
|
|
58
|
-
* Writes `bytes` to `rel` under `work` whole and durably (files.ts writeDurable), as a file of `mode`: through a temporary
|
|
59
|
-
* file in the same directory, a dot-name of the server's own, renamed over the file. The directories on the way are made
|
|
60
|
-
* when missing, and each is synced into its parent before this resolves. A link on the way or at the file, or a directory
|
|
61
|
-
* there, is refused: never followed and never replaced. Answers the stats of the file this call wrote. `asTool`, a run's
|
|
62
|
-
* file tool writing a bound box's work/ (bound-files.ts): a file with another hard link is refused, a file already there
|
|
63
|
-
* keeps its mode, and a new one gets `mode` as given, whatever this process's umask.
|
|
64
|
-
*/
|
|
65
|
-
export declare function writeWorkFile(work: string, rel: string, bytes: Uint8Array, mode?: number, asTool?: boolean): Promise<Stats>;
|
|
66
|
-
/** Removes the regular file `rel` under `work`, reached through no link: refused when it is missing, a link, or not a
|
|
67
|
-
* regular file. A directory it leaves empty stays. */
|
|
68
|
-
export declare function removeWorkFile(work: string, rel: string): Promise<void>;
|
|
69
|
-
/** Throws unless the kernel refuses a hard link to a file the linker cannot write (fs.protected_hardlinks = 1): with a
|
|
70
|
-
* run's commands under a uid of their own, it keeps them from linking this server's files into their workspace. */
|
|
71
|
-
export declare function assertHardlinkProtection(read?: () => string): void;
|
package/dist/workspace.js
CHANGED
|
@@ -4,12 +4,10 @@
|
|
|
4
4
|
// check and the open is refused, not followed. On top of it: the path must be the root joined with its own names (a link
|
|
5
5
|
// anywhere on the way, even one pointing inside the root, is refused), only regular files and directories are read, and a
|
|
6
6
|
// file with a second hard link is refused, since it could be one of this server's own files linked in.
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { Confinement } from "@parcha/pi-durable-disk/internals";
|
|
12
|
-
import { syncDir, writeDurable } from "./files.js";
|
|
7
|
+
import { closeSync, constants, openSync, realpathSync, statSync } from "node:fs";
|
|
8
|
+
import { access, lstat, readdir } from "node:fs/promises";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { Confinement } from "./confine.js";
|
|
13
11
|
/** A path under work/ this server does not read, and why. */
|
|
14
12
|
export class WorkRefused extends Error {
|
|
15
13
|
path;
|
|
@@ -90,16 +88,6 @@ export async function openWorkFile(work, rel) {
|
|
|
90
88
|
await pin.close();
|
|
91
89
|
}
|
|
92
90
|
}
|
|
93
|
-
/** `rel` under `work` as text, read as `openWorkFile` reads it. */
|
|
94
|
-
export async function readWorkText(work, rel) {
|
|
95
|
-
const { handle } = await openWorkFile(work, rel);
|
|
96
|
-
try {
|
|
97
|
-
return await handle.readFile("utf8");
|
|
98
|
-
}
|
|
99
|
-
finally {
|
|
100
|
-
await handle.close();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
91
|
/** `rel` under `work`, its bytes, read as `openWorkFile` reads it; refused ("over_cap") when larger than `maxBytes`. */
|
|
104
92
|
export async function readWorkBytes(work, rel, { maxBytes }) {
|
|
105
93
|
const { handle, stats } = await openWorkFile(work, rel);
|
|
@@ -202,97 +190,3 @@ export async function walkWork(work, visit, { skip = () => false, depth = WALK_D
|
|
|
202
190
|
};
|
|
203
191
|
await into("", 0);
|
|
204
192
|
}
|
|
205
|
-
/** A write's or a removal's failure that is a refusal: a link on the way (the confinement's refusal), a directory that
|
|
206
|
-
* is missing or this server may not enter, or a file where a directory is on the way (a directory where the file is).
|
|
207
|
-
* Any other failure, a full disk say, is thrown as it is. */
|
|
208
|
-
const REFUSALS = { permission_denied: "link", ELOOP: "link", ENOENT: "missing", EACCES: "unreadable", ENOTDIR: "not_regular", EISDIR: "not_regular" };
|
|
209
|
-
const refusing = (rel) => (error) => {
|
|
210
|
-
const reason = error instanceof WorkRefused ? error.reason : REFUSALS[error?.code ?? ""];
|
|
211
|
-
throw reason ? new WorkRefused(rel, reason) : error;
|
|
212
|
-
};
|
|
213
|
-
/** Pins the directory holding `rel` under `work` for writing, every directory on the way reached through no link (and,
|
|
214
|
-
* with `parents`, made when missing). Close the pin. */
|
|
215
|
-
async function pinForWrite(work, rel, parents) {
|
|
216
|
-
if (!writesHeld())
|
|
217
|
-
throw new WorkRefused(rel, "unheld");
|
|
218
|
-
const { real, confinement } = confinementOf(work);
|
|
219
|
-
const abs = join(real, rel);
|
|
220
|
-
const refuse = refusing(rel);
|
|
221
|
-
// Checked before the walk makes any directory, so none is made through a link.
|
|
222
|
-
const { canonical } = await confinement.locate(abs, rel, "write", false).catch(refuse);
|
|
223
|
-
if (canonical !== abs)
|
|
224
|
-
throw new WorkRefused(rel, "link");
|
|
225
|
-
// Whether the walk is to make a directory (the file's own is missing).
|
|
226
|
-
const making = parents && !(await lstat(dirname(abs)).catch(() => null));
|
|
227
|
-
const pin = await confinement.pinEntry(abs, rel, { access: "write", follow: false, parents }).catch(refuse);
|
|
228
|
-
if (pin.canonical !== abs) {
|
|
229
|
-
await pin.close();
|
|
230
|
-
throw new WorkRefused(rel, "link");
|
|
231
|
-
}
|
|
232
|
-
return { pin, refuse, real, making };
|
|
233
|
-
}
|
|
234
|
-
/** What is at the pinned entry, by lstat: nothing (undefined), else a regular file, or refused. */
|
|
235
|
-
async function entryOf(pin, refuse, rel) {
|
|
236
|
-
const stats = await lstat(pin.entry).catch((error) => (error?.code === "ENOENT" ? undefined : refuse(error)));
|
|
237
|
-
if (stats && !stats.isFile())
|
|
238
|
-
throw new WorkRefused(rel, stats.isSymbolicLink() ? "link" : "not_regular");
|
|
239
|
-
return stats;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Writes `bytes` to `rel` under `work` whole and durably (files.ts writeDurable), as a file of `mode`: through a temporary
|
|
243
|
-
* file in the same directory, a dot-name of the server's own, renamed over the file. The directories on the way are made
|
|
244
|
-
* when missing, and each is synced into its parent before this resolves. A link on the way or at the file, or a directory
|
|
245
|
-
* there, is refused: never followed and never replaced. Answers the stats of the file this call wrote. `asTool`, a run's
|
|
246
|
-
* file tool writing a bound box's work/ (bound-files.ts): a file with another hard link is refused, a file already there
|
|
247
|
-
* keeps its mode, and a new one gets `mode` as given, whatever this process's umask.
|
|
248
|
-
*/
|
|
249
|
-
export async function writeWorkFile(work, rel, bytes, mode = 0o600, asTool = false) {
|
|
250
|
-
const { pin, refuse, real, making } = await pinForWrite(work, rel, true);
|
|
251
|
-
try {
|
|
252
|
-
const before = await entryOf(pin, refuse, rel);
|
|
253
|
-
if (asTool && before && before.nlink !== 1)
|
|
254
|
-
throw new WorkRefused(rel, "hard_link");
|
|
255
|
-
const kept = asTool && before ? before.mode & 0o777 : mode;
|
|
256
|
-
// A link swapped in after that check is replaced by the rename, never written through.
|
|
257
|
-
const stats = await writeDurable(pin.entry, bytes, kept, `${pin.dir}/.agentrun-${process.pid}-${randomBytes(6).toString("hex")}.tmp`, asTool).catch(refuse);
|
|
258
|
-
// writeDurable synced the file's own directory; a directory made above it survives a crash once its parent is synced.
|
|
259
|
-
if (making) {
|
|
260
|
-
let at = real;
|
|
261
|
-
for (const name of dirname(rel).split("/")) {
|
|
262
|
-
await syncDir(at);
|
|
263
|
-
at = join(at, name);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
return stats;
|
|
267
|
-
}
|
|
268
|
-
finally {
|
|
269
|
-
await pin.close();
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
/** Removes the regular file `rel` under `work`, reached through no link: refused when it is missing, a link, or not a
|
|
273
|
-
* regular file. A directory it leaves empty stays. */
|
|
274
|
-
export async function removeWorkFile(work, rel) {
|
|
275
|
-
const { pin, refuse } = await pinForWrite(work, rel, false);
|
|
276
|
-
try {
|
|
277
|
-
if (!(await entryOf(pin, refuse, rel)))
|
|
278
|
-
throw new WorkRefused(rel, "missing");
|
|
279
|
-
// unlink never follows the name it removes: a link swapped in after the check is removed, not its target.
|
|
280
|
-
await unlink(pin.entry).catch(refuse);
|
|
281
|
-
}
|
|
282
|
-
finally {
|
|
283
|
-
await pin.close();
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
/** Throws unless the kernel refuses a hard link to a file the linker cannot write (fs.protected_hardlinks = 1): with a
|
|
287
|
-
* run's commands under a uid of their own, it keeps them from linking this server's files into their workspace. */
|
|
288
|
-
export function assertHardlinkProtection(read = () => readFileSync("/proc/sys/fs/protected_hardlinks", "utf8")) {
|
|
289
|
-
let value;
|
|
290
|
-
try {
|
|
291
|
-
value = read().trim();
|
|
292
|
-
}
|
|
293
|
-
catch (error) {
|
|
294
|
-
throw new Error(`agentrun-serve: fs.protected_hardlinks cannot be read (${error.message}); a run's workspace could hold a link to this server's files`);
|
|
295
|
-
}
|
|
296
|
-
if (value !== "1")
|
|
297
|
-
throw new Error(`agentrun-serve: fs.protected_hardlinks is ${value}, not 1; a run's workspace could hold a link to this server's files`);
|
|
298
|
-
}
|