@parcha/agentrun-serve 0.1.0-beta.35 → 0.1.0-beta.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +298 -0
- package/README.md +417 -219
- package/dist/adapters.d.ts +12 -2
- package/dist/adapters.js +27 -2
- package/dist/agent-rows.d.ts +2 -1
- package/dist/agents-store.d.ts +2 -0
- package/dist/agents-store.js +9 -4
- 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 +79 -7
- package/dist/archil-settings.js +140 -14
- package/dist/attach-conformance-cli.d.ts +1 -0
- package/dist/attach-conformance-cli.js +18 -0
- package/dist/attach-conformance.d.ts +25 -0
- package/dist/attach-conformance.js +343 -0
- 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/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 +1 -1
- package/dist/browser-live.d.ts +20 -8
- package/dist/browser-live.js +50 -27
- 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 +12 -57
- package/dist/cap.js +20 -160
- package/dist/catalog.d.ts +1 -12
- package/dist/catalog.js +3 -33
- package/dist/cli.js +17 -26
- package/dist/composio-preset.d.ts +36 -0
- package/dist/composio-preset.js +179 -0
- package/dist/computer-attach.d.ts +125 -0
- package/dist/computer-attach.js +330 -0
- package/dist/computer-calls.d.ts +48 -0
- package/dist/computer-calls.js +126 -0
- package/dist/computer-channel.d.ts +57 -0
- package/dist/computer-channel.js +115 -0
- package/dist/computer-commands.d.ts +1 -1
- package/dist/computer-held-routes.d.ts +35 -0
- package/dist/computer-held-routes.js +106 -0
- package/dist/computer-held.d.ts +48 -0
- package/dist/computer-held.js +87 -0
- package/dist/computer-keys.d.ts +21 -1
- package/dist/computer-keys.js +53 -11
- package/dist/computer-live.d.ts +160 -0
- package/dist/computer-live.js +643 -0
- package/dist/computer-routes.d.ts +1 -4
- package/dist/computer-routes.js +3 -5
- package/dist/computer-setting.d.ts +2 -0
- package/dist/computer-setting.js +38 -1
- package/dist/computer-view.d.ts +24 -2
- package/dist/computer-view.js +51 -3
- package/dist/computer-viewer.d.ts +6 -0
- package/dist/computer-viewer.js +297 -0
- package/dist/computers.d.ts +79 -12
- package/dist/computers.js +147 -28
- package/dist/console/assets/index-Cn6JX1uH.js +563 -0
- package/dist/console/assets/index-DRN62V5v.css +1 -0
- package/dist/console/index.html +2 -2
- package/dist/docker-daemon.d.ts +2 -2
- package/dist/docker-daemon.js +2 -2
- package/dist/errors.js +5 -5
- package/dist/faux-computers.d.ts +9 -20
- package/dist/faux-computers.js +56 -24
- package/dist/files.d.ts +1 -9
- package/dist/files.js +1 -9
- package/dist/github-connection.d.ts +10 -2
- package/dist/github-connection.js +65 -2
- package/dist/github-faux.js +1 -1
- package/dist/github.d.ts +22 -2
- package/dist/github.js +42 -8
- package/dist/gpu-words.d.ts +14 -0
- package/dist/gpu-words.js +21 -0
- package/dist/graph-view.d.ts +3 -1
- package/dist/graph-view.js +25 -1
- 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.d.ts +1 -0
- package/dist/harness.js +36 -2
- package/dist/host-tools.d.ts +9 -10
- package/dist/host-tools.js +7 -7
- package/dist/hosted-search.d.ts +5 -4
- package/dist/hosted-search.js +2 -7
- package/dist/import-sources.d.ts +10 -0
- package/dist/import-sources.js +44 -2
- package/dist/import.d.ts +3 -3
- package/dist/import.js +37 -6
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1 -2
- package/dist/key-refusal.d.ts +1 -1
- package/dist/key-refusal.js +2 -2
- package/dist/learn/check.d.ts +11 -2
- package/dist/learn/check.js +124 -6
- package/dist/learn/commit.d.ts +43 -7
- package/dist/learn/commit.js +166 -22
- package/dist/learn/folder.d.ts +11 -0
- package/dist/learn/folder.js +37 -1
- package/dist/learn/general.d.ts +66 -0
- package/dist/learn/general.js +73 -0
- package/dist/learn/grade.d.ts +22 -1
- package/dist/learn/grade.js +107 -16
- package/dist/learn/index.d.ts +1 -1
- package/dist/learn/index.js +1 -1
- package/dist/learn/learning.sh +12 -1
- package/dist/learn/notes.d.ts +3 -0
- package/dist/learn/notes.js +3 -0
- package/dist/learn/reflect.d.ts +14 -2
- package/dist/learn/reflect.js +54 -30
- package/dist/learn/skills.d.ts +37 -5
- package/dist/learn/skills.js +60 -7
- package/dist/learned-nodes.d.ts +6 -2
- package/dist/learned-workflow.d.ts +43 -9
- package/dist/learned-workflow.js +128 -37
- package/dist/learning-batch.d.ts +283 -0
- package/dist/learning-batch.js +574 -0
- package/dist/learning-cost.d.ts +79 -0
- package/dist/learning-cost.js +69 -0
- package/dist/learning-evals.d.ts +33 -0
- package/dist/learning-evals.js +98 -0
- package/dist/learning-routes.d.ts +32 -4
- package/dist/learning-routes.js +48 -12
- package/dist/learning-words.d.ts +9 -0
- package/dist/learning-words.js +12 -2
- package/dist/learning.d.ts +39 -19
- package/dist/learning.js +88 -46
- package/dist/live/stream.js +6 -3
- package/dist/live/translate.d.ts +4 -3
- package/dist/live/translate.js +8 -4
- package/dist/live-reach.d.ts +37 -0
- package/dist/live-reach.js +62 -0
- package/dist/mcp-gateway.d.ts +9 -0
- package/dist/mcp-gateway.js +60 -11
- package/dist/mcp-oauth.d.ts +57 -7
- package/dist/mcp-oauth.js +133 -18
- package/dist/mcp-private-hosts.d.ts +4 -4
- package/dist/mcp-private-hosts.js +20 -12
- package/dist/mcp-probe.d.ts +27 -3
- package/dist/mcp-probe.js +106 -29
- package/dist/mcp-secret-writes.js +8 -0
- package/dist/mcp-servers-store.d.ts +38 -15
- package/dist/mcp-servers-store.js +120 -23
- package/dist/mcp-store.d.ts +10 -4
- package/dist/mcp-store.js +17 -6
- package/dist/model-form.d.ts +26 -0
- package/dist/model-form.js +80 -0
- package/dist/model.d.ts +5 -5
- package/dist/model.js +29 -16
- package/dist/openapi.d.ts +2 -0
- package/dist/openapi.js +586 -64
- package/dist/owner.d.ts +0 -1
- package/dist/owner.js +0 -2
- package/dist/page.d.ts +18 -0
- package/dist/page.js +48 -20
- package/dist/paid-calls.d.ts +1 -1
- package/dist/paid-calls.js +1 -1
- package/dist/place-offers.d.ts +96 -0
- package/dist/place-offers.js +202 -0
- package/dist/place.d.ts +9 -13
- package/dist/place.js +21 -32
- package/dist/port-models.d.ts +2 -1
- package/dist/port-models.js +5 -3
- package/dist/print.d.ts +16 -9
- package/dist/print.js +15 -17
- package/dist/propose.d.ts +4 -0
- package/dist/propose.js +34 -11
- package/dist/provider.js +3 -2
- package/dist/reflect-range.d.ts +8 -1
- package/dist/reflect-range.js +1 -1
- package/dist/run-cut.d.ts +5 -0
- package/dist/run-cut.js +19 -0
- package/dist/run-launch.d.ts +28 -3
- package/dist/run-launch.js +14 -4
- package/dist/run-learning-served.d.ts +2 -2
- package/dist/run-manifest.d.ts +2 -2
- package/dist/run-manifest.js +2 -2
- package/dist/run-reads-over-store.d.ts +1 -1
- package/dist/run-repo.d.ts +20 -0
- package/dist/run-repo.js +63 -0
- package/dist/run-secrets.js +3 -3
- package/dist/run-timeline-served.d.ts +1 -1
- package/dist/run-timeline-served.js +56 -44
- package/dist/run-view.d.ts +8 -5
- package/dist/run-view.js +18 -10
- package/dist/runnable.d.ts +2 -2
- package/dist/runnable.js +6 -2
- package/dist/runner/adapter-loop.d.ts +39 -8
- package/dist/runner/adapter-loop.js +770 -83
- package/dist/runner/adapter-run-spec.d.ts +36 -7
- package/dist/runner/adapter-run-spec.js +171 -37
- package/dist/runner/adapters/pi-computer.d.ts +7 -0
- package/dist/runner/adapters/pi-computer.js +43 -0
- package/dist/runner/adapters/pi.d.ts +20 -7
- package/dist/runner/adapters/pi.js +111 -26
- package/dist/runner/beside.d.ts +7 -3
- package/dist/runner/beside.js +26 -12
- package/dist/runner/claim-secrets.d.ts +4 -0
- package/dist/runner/claim-secrets.js +6 -1
- package/dist/runner/cli-run-spec.d.ts +27 -3
- package/dist/runner/cli-run-spec.js +198 -74
- package/dist/runner/commands.d.ts +8 -2
- package/dist/runner/commands.js +31 -6
- package/dist/runner/computer-channel.d.ts +34 -0
- package/dist/runner/computer-channel.js +61 -0
- package/dist/runner/conformance/harness.d.ts +0 -1
- package/dist/runner/conformance/harness.js +87 -18
- package/dist/runner/conformance/subject.d.ts +1 -1
- package/dist/runner/dispatch.js +3 -0
- package/dist/runner/end-of-run.d.ts +22 -12
- package/dist/runner/end-of-run.js +38 -16
- package/dist/runner/github-app.d.ts +2 -1
- package/dist/runner/github-app.js +6 -4
- package/dist/runner/harness-loops.js +16 -2
- package/dist/runner/held-run.d.ts +65 -0
- package/dist/runner/held-run.js +158 -0
- package/dist/runner/journal-kinds.d.ts +35 -6
- package/dist/runner/journal-kinds.js +20 -1
- package/dist/runner/journal-reader.d.ts +5 -4
- package/dist/runner/journal-reader.js +12 -10
- package/dist/runner/learning-ask.d.ts +7 -1
- package/dist/runner/learning-ask.js +21 -6
- package/dist/runner/learning-dispatch.d.ts +22 -0
- package/dist/runner/learning-dispatch.js +77 -10
- package/dist/runner/learning-end.d.ts +37 -1
- package/dist/runner/learning-end.js +115 -14
- package/dist/runner/learning-factory.d.ts +1 -1
- package/dist/runner/learning-factory.js +15 -5
- package/dist/runner/learning-loop.d.ts +139 -7
- package/dist/runner/learning-loop.js +369 -32
- package/dist/runner/learning-seed.d.ts +9 -0
- package/dist/runner/learning-seed.js +14 -1
- package/dist/runner/live-ticker.js +1 -0
- package/dist/runner/loop-contract.d.ts +16 -1
- package/dist/runner/loop-contract.js +6 -0
- package/dist/runner/loop.d.ts +10 -2
- package/dist/runner/loop.js +22 -1
- package/dist/runner/main.d.ts +13 -1
- package/dist/runner/main.js +38 -6
- package/dist/runner/mcp-claim.d.ts +11 -4
- package/dist/runner/mcp-claim.js +140 -23
- package/dist/runner/mcp-github.d.ts +4 -2
- package/dist/runner/mcp-github.js +1 -8
- package/dist/runner/mcp-run.d.ts +6 -4
- package/dist/runner/mcp-run.js +16 -3
- package/dist/runner/metrics.d.ts +15 -2
- package/dist/runner/metrics.js +21 -2
- package/dist/runner/model-route.d.ts +3 -0
- package/dist/runner/model-route.js +5 -2
- package/dist/runner/pr-checkout.d.ts +60 -0
- package/dist/runner/pr-checkout.js +176 -0
- package/dist/runner/reflect-hook.d.ts +19 -0
- package/dist/runner/reflect-hook.js +20 -8
- package/dist/runner/runner.d.ts +26 -0
- package/dist/runner/runner.js +231 -27
- package/dist/runner/scratch-sweep.d.ts +13 -0
- package/dist/runner/scratch-sweep.js +62 -0
- package/dist/runner/sessions.d.ts +1 -1
- package/dist/runner/spec-holds.d.ts +8 -3
- package/dist/runner/spec-holds.js +12 -10
- package/dist/runner/store-port.d.ts +7 -2
- package/dist/runner/store-secrets.js +21 -4
- package/dist/runner/subagent.d.ts +44 -0
- package/dist/runner/subagent.js +190 -0
- package/dist/runner/workflow-host.d.ts +24 -3
- package/dist/runner/workflow-host.js +24 -4
- package/dist/runner/workflow-loop.d.ts +6 -3
- package/dist/runner/workflow-loop.js +9 -8
- package/dist/runner/workflow-spec.d.ts +39 -15
- package/dist/runner/workflow-spec.js +143 -40
- package/dist/runs-over-store.d.ts +16 -6
- package/dist/runs-over-store.js +145 -29
- package/dist/seal-key.js +3 -3
- package/dist/sealed-settings-store.d.ts +5 -2
- package/dist/sealed-settings-store.js +10 -4
- package/dist/sealing.js +1 -2
- package/dist/secret-cut.d.ts +1 -1
- package/dist/secret-cut.js +1 -1
- package/dist/secret-writes.d.ts +5 -4
- package/dist/secret-writes.js +5 -4
- package/dist/server-secrets-store.d.ts +4 -3
- package/dist/server-secrets-store.js +15 -9
- package/dist/server-secrets.js +3 -2
- package/dist/server.d.ts +75 -63
- package/dist/server.js +712 -316
- package/dist/settings-wake.d.ts +21 -0
- package/dist/settings-wake.js +59 -0
- package/dist/standard-webhooks.d.ts +4 -1
- package/dist/standard-webhooks.js +8 -4
- package/dist/store/agent-body.d.ts +9 -2
- package/dist/store/agent-body.js +16 -8
- package/dist/store/command-wake.d.ts +12 -0
- package/dist/store/command-wake.js +37 -0
- package/dist/store/deadline.js +9 -5
- package/dist/store/dialect.d.ts +6 -0
- package/dist/store/dialect.js +5 -0
- package/dist/store/index.d.ts +4 -4
- package/dist/store/index.js +2 -2
- package/dist/store/journal/storage.d.ts +3 -2
- package/dist/store/journal/storage.js +15 -6
- package/dist/store/postgres/connection.js +9 -4
- package/dist/store/postgres/dialect.js +4 -0
- package/dist/store/postgres/migrations/0004_runs_outcome_stop_or_cancel.sql +11 -0
- package/dist/store/postgres/migrations/0005_learning_rounds.sql +14 -0
- package/dist/store/postgres/migrations/0006_run_changes_channel_attempts.sql +57 -0
- package/dist/store/postgres/migrations/0007_viewer_host.sql +11 -0
- package/dist/store/postgres/migrations/0008_paired_computers.sql +30 -0
- package/dist/store/postgres/migrations/0009_commands_answer.sql +10 -0
- package/dist/store/schema.d.ts +2 -1
- package/dist/store/schema.js +85 -13
- 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 -47
- package/dist/store/sqlite/run-patch.d.ts +25 -7
- package/dist/store/sqlite/run-patch.js +58 -14
- package/dist/store/sqlite/store.js +331 -59
- package/dist/store/store.d.ts +330 -21
- package/dist/store/store.js +34 -2
- package/dist/store-reads/analytics.js +3 -2
- package/dist/store-reads/cap.d.ts +2 -4
- package/dist/store-reads/cap.js +16 -7
- package/dist/store-reads/decisions.d.ts +3 -3
- package/dist/store-reads/decisions.js +3 -6
- package/dist/store-reads/import-summary.d.ts +1 -1
- package/dist/store-reads/journal.d.ts +5 -4
- package/dist/store-reads/journal.js +118 -27
- package/dist/store-reads/learning.d.ts +34 -4
- package/dist/store-reads/learning.js +137 -23
- package/dist/store-reads/runs.d.ts +7 -5
- package/dist/store-reads/runs.js +17 -10
- package/dist/store-reads/stats.js +5 -1
- package/dist/store-reads/workflow.d.ts +1 -1
- package/dist/store-view.d.ts +5 -0
- package/dist/store-view.js +70 -29
- package/dist/template-eval.js +8 -5
- package/dist/template-github-permissions.d.ts +22 -8
- package/dist/template-github-permissions.js +35 -15
- package/dist/templates.d.ts +64 -0
- package/dist/templates.js +101 -16
- package/dist/timeline/timeline.d.ts +30 -1
- package/dist/timeline/timeline.js +29 -13
- package/dist/timeline/util.d.ts +4 -0
- package/dist/timeline/util.js +14 -0
- package/dist/tool-blurbs.js +1 -0
- package/dist/tool-budget.d.ts +27 -7
- package/dist/tool-budget.js +21 -9
- package/dist/tool-gate.d.ts +23 -10
- package/dist/tool-gate.js +60 -44
- package/dist/tool-plane.d.ts +46 -28
- package/dist/tool-plane.js +73 -31
- package/dist/tools.d.ts +31 -38
- package/dist/tools.js +117 -74
- package/dist/trigger-adapter.d.ts +4 -0
- package/dist/trigger-secrets-shown.d.ts +2 -2
- package/dist/trigger-secrets-shown.js +1 -1
- package/dist/trigger-signatures.d.ts +26 -6
- package/dist/trigger-signatures.js +44 -8
- package/dist/trigger-targets.d.ts +2 -0
- package/dist/trigger-targets.js +1 -0
- package/dist/trigger-webhook.js +5 -2
- package/dist/triggers.d.ts +10 -6
- package/dist/triggers.js +37 -7
- package/dist/turn-end.d.ts +0 -3
- package/dist/turn-end.js +0 -3
- package/dist/turns.js +16 -1
- package/dist/usage-lines.d.ts +1 -1
- package/dist/validate.d.ts +6 -0
- package/dist/validate.js +41 -4
- package/dist/web-fetch.d.ts +1 -1
- package/dist/web-search.d.ts +10 -5
- package/dist/web-search.js +7 -6
- package/dist/webhooks.d.ts +147 -103
- package/dist/webhooks.js +564 -324
- 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 +113 -0
- package/dist/workflow/node-runner.js +270 -0
- package/dist/workflow/node.d.ts +89 -0
- package/dist/workflow/node.js +101 -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 +32 -0
- package/dist/workflow/pi-versions.js +65 -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 +77 -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 +412 -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-run.d.ts +2 -2
- package/dist/workspace/agent-computer.d.ts +137 -0
- package/dist/workspace/agent-computer.js +292 -0
- package/dist/workspace/archil-claim.d.ts +11 -0
- package/dist/workspace/archil-claim.js +18 -10
- package/dist/workspace/archil-disks.d.ts +49 -0
- package/dist/workspace/archil-disks.js +185 -0
- package/dist/workspace/archil-exec.js +2 -3
- package/dist/workspace/archil-mount-credential.d.ts +20 -4
- package/dist/workspace/archil-mount-credential.js +13 -4
- package/dist/workspace/attached-computers.d.ts +41 -0
- package/dist/workspace/attached-computers.js +114 -0
- package/dist/workspace/computer-deps.d.ts +32 -17
- package/dist/workspace/computer-deps.js +37 -14
- package/dist/workspace/computer-for-claim.d.ts +58 -13
- package/dist/workspace/computer-for-claim.js +267 -26
- package/dist/workspace/computer-hold.d.ts +11 -27
- package/dist/workspace/computer-hold.js +36 -56
- package/dist/workspace/computer-janitor.d.ts +3 -2
- package/dist/workspace/computer-janitor.js +43 -9
- package/dist/workspace/computer-ledger.d.ts +5 -1
- package/dist/workspace/computer-ledger.js +11 -0
- package/dist/workspace/computer-mcp.d.ts +25 -0
- package/dist/workspace/computer-mcp.js +41 -0
- package/dist/workspace/computer-ports.d.ts +4 -13
- package/dist/workspace/computer-ports.js +4 -107
- package/dist/workspace/computer-script.d.ts +37 -0
- package/dist/workspace/computer-script.js +138 -0
- package/dist/workspace/executors.d.ts +1 -1
- package/dist/workspace/index.d.ts +7 -4
- package/dist/workspace/index.js +4 -1
- package/dist/workspace/kind-skills/desktop/SKILL.md +119 -84
- package/dist/workspace/kind-skills/phone/SKILL.md +100 -85
- package/dist/workspace/resolve-computer.d.ts +45 -11
- package/dist/workspace/resolve-computer.js +72 -14
- package/dist/workspace/run-disk.d.ts +34 -0
- package/dist/workspace/run-disk.js +91 -0
- package/dist/workspace/run-tools.d.ts +35 -18
- package/dist/workspace/run-tools.js +24 -29
- package/dist/workspace/server-run-workspace.d.ts +3 -2
- package/dist/workspace/server-run-workspace.js +17 -4
- package/dist/workspace.js +1 -1
- package/package.json +19 -21
- package/templates/README.md +9 -6
- 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/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/market-monitor/agent.md +1 -1
- 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 -71
- package/dist/budget.js +0 -199
- package/dist/console/assets/index-B7NKTU8E.css +0 -1
- package/dist/console/assets/index-CXZMgJE7.js +0 -550
- 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/dist/run-db.d.ts +0 -53
- package/dist/run-db.js +0 -116
- package/templates/code-review/rules/REVIEW.md +0 -41
package/dist/tool-plane.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { InputIssue } from "./errors.js";
|
|
2
2
|
import type { Settings } from "./store/index.js";
|
|
3
3
|
import { type HarnessId } from "./harness.js";
|
|
4
|
+
import { type ShellPlace } from "@parcha/agentrun-kernel/kernel";
|
|
4
5
|
import { type Permission, type Pin } from "./tool-gate.js";
|
|
5
6
|
import { type BashPolicy } from "./bash-read-only.js";
|
|
6
7
|
/**
|
|
@@ -15,13 +16,14 @@ export declare const CAPABILITIES: readonly ["read", "write", "edit", "web_searc
|
|
|
15
16
|
* server holds its key, else keyless Exa; `native`, the harness's own tool or its model provider's hosted one, and
|
|
16
17
|
* nothing else; `exa-keyless`, Exa's public MCP endpoint, no key; `kernel`, the guarded direct fetch; `parallel`,
|
|
17
18
|
* Parallel's Search and Extract APIs on PARALLEL_API_KEY; `off`, web_search turned off: nothing is searched, and an
|
|
18
|
-
* agent naming it is refused until it is turned on again. The browser's: `auto`,
|
|
19
|
-
* keys, else Kernel
|
|
20
|
-
* server's own host, which no server sets up yet
|
|
19
|
+
* agent naming it is refused until it is turned on again. The browser's: `auto`, the computer registry's first browser
|
|
20
|
+
* provider whose keys the server holds (Browserbase, else Kernel); a browser provider's id (`browserbase`, `kernel`:
|
|
21
|
+
* BROWSER_VENDOR_IDS), that one alone; `chrome`, a Chrome on the server's own host, which no server sets up yet
|
|
22
|
+
* (browserBy). */
|
|
21
23
|
export declare const PROVIDERS: Readonly<{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
web_search: readonly ["auto", "native", "exa-keyless", "parallel", "off"];
|
|
25
|
+
web_fetch: readonly ["kernel", "parallel"];
|
|
26
|
+
browser: readonly string[];
|
|
25
27
|
}>;
|
|
26
28
|
export type Pickable = keyof typeof PROVIDERS;
|
|
27
29
|
export declare const PICKABLE: Pickable[];
|
|
@@ -37,9 +39,9 @@ export declare const permissionsOf: (name: string) => readonly Permission[];
|
|
|
37
39
|
* give it: the one in force under the server's settings (`permission`), the owner's default (`default_permission`) and
|
|
38
40
|
* those it may be set to. An agent's read gives the same, the agent's own layer over it (agentTools). */
|
|
39
41
|
export declare const serverGate: (name: string, settings: ToolSettingsMap) => {
|
|
40
|
-
permission: "deny" | "
|
|
41
|
-
default_permission: "deny" | "
|
|
42
|
-
permissions: ("deny" | "
|
|
42
|
+
permission: "deny" | "ask" | "allow";
|
|
43
|
+
default_permission: "deny" | "ask" | "allow";
|
|
44
|
+
permissions: ("deny" | "ask" | "allow")[];
|
|
43
45
|
};
|
|
44
46
|
/** The run's own tools beyond the table, each its own settings key, allowed by default like a table tool: the learned
|
|
45
47
|
* workflow a run's pin names runs as `learned_workflow` (learned-workflow.ts LEARNED_WORKFLOW_TOOL). */
|
|
@@ -48,6 +50,10 @@ export declare const SERVE_OWN_TOOLS: readonly string[];
|
|
|
48
50
|
* held to `desktop`, every phone tool to `phone` (the kernel registry's definitions name the key; tool-gate.ts
|
|
49
51
|
* settingsKeyOf reads it there). Allowed by default like a table tool; allow or deny. */
|
|
50
52
|
export declare const KIND_KEYS: readonly string[];
|
|
53
|
+
/** A decision provider's settings key, its bare id (decisions.ts' providers: Jev, Parallel, OpenRouter's Decisions
|
|
54
|
+
* models): what an agent's learned workflow's decision nodes may ask (learned-workflow.ts, LS-07), and whose keys the
|
|
55
|
+
* runner hands its claim. Allowed by default; allow or deny. A workflow agent's own decisions read no setting of it. */
|
|
56
|
+
export declare const DECISION_PROVIDER_KEYS: readonly string[];
|
|
51
57
|
/** One tool's settings: its provider (a capability that has a choice), its permission, and an MCP tool's pin (the
|
|
52
58
|
* arguments its calls must carry, tool-gate.ts pinRefusal). */
|
|
53
59
|
export type ToolSetting = {
|
|
@@ -126,16 +132,12 @@ export declare const isUnavailable: (resolution: Resolution | undefined) => reso
|
|
|
126
132
|
/** Why `resolution` is unavailable, in words. A vendor picked whose key this server does not hold (its value, kept in a
|
|
127
133
|
* run's meta and read back, names the variables) names where to save the key first, then the variable to set. */
|
|
128
134
|
export declare const whyUnavailable: (resolution: string) => string;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
readonly browserbase: readonly ["BROWSERBASE_API_KEY", "BROWSERBASE_PROJECT_ID"];
|
|
133
|
-
readonly kernel: readonly ["KERNEL_API_KEY"];
|
|
134
|
-
}>;
|
|
135
|
-
type BrowserVendor = keyof typeof BROWSER_KEYS;
|
|
135
|
+
export declare const BROWSER_VENDOR_IDS: readonly string[];
|
|
136
|
+
export declare const BROWSER_KEYS: Readonly<Record<string, readonly string[]>>;
|
|
137
|
+
type BrowserVendor = string;
|
|
136
138
|
/** The keys a browser that resolves to `resolution` runs on: its vendor's (BROWSER_KEYS), none for no vendor. */
|
|
137
139
|
export declare const browserNeeds: (resolution: string | undefined) => readonly string[];
|
|
138
|
-
/** `auto` where the server holds
|
|
140
|
+
/** `auto` where the server holds no vendor's keys. */
|
|
139
141
|
export declare const NO_BROWSER_KEY: Resolution;
|
|
140
142
|
/** `chrome` picked: a Chrome on the server's own host, refused by name until a server can set one up. */
|
|
141
143
|
export declare const NO_CHROME: Resolution;
|
|
@@ -189,9 +191,10 @@ export declare const keptFromBefore: (plane: Plane) => Plane;
|
|
|
189
191
|
* restored keys make it run. Every other saved value stays as it is: `auto` with no key at a run's first launch
|
|
190
192
|
* (NO_BROWSER_KEY) and `chrome` stay frozen. The same Plane where nothing changes. */
|
|
191
193
|
export declare function keptVendor(plane: Plane): Plane;
|
|
192
|
-
/** The key row (tool-keys.ts) of the browser's vendor on `resolution` with `picked` the provider in force:
|
|
193
|
-
*
|
|
194
|
-
|
|
194
|
+
/** The key row (tool-keys.ts) of the browser's vendor on `resolution` with `picked` the provider in force: the vendor it
|
|
195
|
+
* resolved to, else the one picked, else the registry's first (Browserbase), so a page links a missing key to the row
|
|
196
|
+
* it is saved on. */
|
|
197
|
+
export declare const browserKeyRow: (picked: string | undefined, resolution: string | undefined) => string;
|
|
195
198
|
/** The Plane a run's process is handed at a launch, under the server's `settings` now: its kept Plane (as keptVendor
|
|
196
199
|
* reads it) checked again (recheckPlane) against the one it would get today; with none kept, today's, its browser kept
|
|
197
200
|
* (keptFromBefore). At a launch after its first (a relaunch, a follow-up's, one after a restart) a capability set
|
|
@@ -262,16 +265,31 @@ export declare function keptSettings(map: ToolSettingsMap, current: ToolSettings
|
|
|
262
265
|
export declare function saveToolSettings(store: {
|
|
263
266
|
settings: Pick<Settings, "get" | "put">;
|
|
264
267
|
}, map: ToolSettingsMap): Promise<ToolSettingsMap>;
|
|
268
|
+
/** Why a tool of bash's family (SHELL_FAMILY: bash and the background tools) is not there for a run whose shell is
|
|
269
|
+
* `shell` (workspace/resolve-computer.ts runShellOf, the claim's own rule read off the agent's computer setting), in the
|
|
270
|
+
* kernel registry's words for a call of it there: with no computer that mounts the run's folder the background tools
|
|
271
|
+
* are refused (NEEDS_A_COMPUTER), and bash too where the run has no shell at all (NO_SHELL, Mode 1); in Mode 2 bash runs
|
|
272
|
+
* on Archil's exec. Undefined for any other tool, and where it is there. */
|
|
273
|
+
export declare function shellUnavailable(name: string, shell: ShellPlace): Resolution | undefined;
|
|
265
274
|
/** GET /v2/agents/{id}'s `tools`: each tool its current revision grants, in `order` (capabilities.tools'), with its
|
|
266
275
|
* permission in force and where it came from (the agent's own settings, the server's, or the default), the one that
|
|
267
276
|
* applies when the agent sets none (the server's, else the default) and those it may be set to; and for one with a
|
|
268
277
|
* provider choice the provider in force and where it came from, the one that applies when the agent sets none, and what
|
|
269
|
-
* it resolves to on the agent's harness and model.
|
|
270
|
-
|
|
271
|
-
|
|
278
|
+
* it resolves to on the agent's harness and model. `shell`: where a run of the agent has its shell (runShellOf on its
|
|
279
|
+
* computer setting); a tool of bash's family that leaves out resolves unavailable, saying why (shellUnavailable). */
|
|
280
|
+
export declare function agentTools(env: NodeJS.ProcessEnv, settings: ToolSettingsMap, agent: Tooling, order: readonly string[], shell?: ShellPlace): ({
|
|
281
|
+
resolved: Resolution;
|
|
282
|
+
permission: "deny" | "ask" | "allow";
|
|
283
|
+
permission_from: import("./refusal-words.js").SettingFrom;
|
|
284
|
+
default_permission: "deny" | "ask" | "allow";
|
|
285
|
+
permissions: ("deny" | "ask" | "allow")[];
|
|
286
|
+
blurb?: string | undefined;
|
|
287
|
+
name: string;
|
|
288
|
+
} | {
|
|
289
|
+
permission: "deny" | "ask" | "allow";
|
|
272
290
|
permission_from: import("./refusal-words.js").SettingFrom;
|
|
273
|
-
default_permission: "deny" | "
|
|
274
|
-
permissions: ("deny" | "
|
|
291
|
+
default_permission: "deny" | "ask" | "allow";
|
|
292
|
+
permissions: ("deny" | "ask" | "allow")[];
|
|
275
293
|
blurb?: string | undefined;
|
|
276
294
|
name: string;
|
|
277
295
|
} | {
|
|
@@ -279,10 +297,10 @@ export declare function agentTools(env: NodeJS.ProcessEnv, settings: ToolSetting
|
|
|
279
297
|
provider_from: string;
|
|
280
298
|
default_provider: string;
|
|
281
299
|
resolved: Resolution;
|
|
282
|
-
permission: "deny" | "
|
|
300
|
+
permission: "deny" | "ask" | "allow";
|
|
283
301
|
permission_from: import("./refusal-words.js").SettingFrom;
|
|
284
|
-
default_permission: "deny" | "
|
|
285
|
-
permissions: ("deny" | "
|
|
302
|
+
default_permission: "deny" | "ask" | "allow";
|
|
303
|
+
permissions: ("deny" | "ask" | "allow")[];
|
|
286
304
|
blurb?: string | undefined;
|
|
287
305
|
name: string;
|
|
288
306
|
})[];
|
package/dist/tool-plane.js
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
// told a deny: its Plane resolves a denied capability as under ask, and the gate, which reads the permission at each
|
|
21
21
|
// call, is the one place that refuses it, so a deny lifted mid-run is lifted at the next call.
|
|
22
22
|
import { blurbOf } from "./tool-blurbs.js";
|
|
23
|
+
import { PROVIDERS as COMPUTER_PROVIDERS } from "@parcha/agentrun-computer";
|
|
23
24
|
import { decisionKeysOf, PARALLEL_KEY_ENV } from "./decisions.js";
|
|
24
25
|
import { keyNeeded } from "./key-words.js";
|
|
25
26
|
import { DEFAULT_HARNESS, HARNESSES } from "./harness.js";
|
|
@@ -27,6 +28,7 @@ import { builtinHarness, harnessOf } from "./harness-table.js";
|
|
|
27
28
|
import { viaOpenRouter, WIRES } from "./provider.js";
|
|
28
29
|
import { savedIn } from "./secrets.js";
|
|
29
30
|
import { hostModel } from "./model.js";
|
|
31
|
+
import { NEEDS_A_COMPUTER, NO_SHELL } from "@parcha/agentrun-kernel/kernel";
|
|
30
32
|
import { canonicalPin, defaultPermission, isCatalogTool, isMcpTool, MAX_PIN_ARGS, MAX_PIN_CHOICES, PERMISSIONS, permissionFrom, permissionOf, SETTINGS_UNREAD, SHELL_FAMILY } from "./tool-gate.js";
|
|
31
33
|
import { BASH_POLICIES } from "./bash-read-only.js";
|
|
32
34
|
/**
|
|
@@ -41,13 +43,14 @@ export const CAPABILITIES = ["read", "write", "edit", "web_search", "web_fetch",
|
|
|
41
43
|
* server holds its key, else keyless Exa; `native`, the harness's own tool or its model provider's hosted one, and
|
|
42
44
|
* nothing else; `exa-keyless`, Exa's public MCP endpoint, no key; `kernel`, the guarded direct fetch; `parallel`,
|
|
43
45
|
* Parallel's Search and Extract APIs on PARALLEL_API_KEY; `off`, web_search turned off: nothing is searched, and an
|
|
44
|
-
* agent naming it is refused until it is turned on again. The browser's: `auto`,
|
|
45
|
-
* keys, else Kernel
|
|
46
|
-
* server's own host, which no server sets up yet
|
|
47
|
-
|
|
46
|
+
* agent naming it is refused until it is turned on again. The browser's: `auto`, the computer registry's first browser
|
|
47
|
+
* provider whose keys the server holds (Browserbase, else Kernel); a browser provider's id (`browserbase`, `kernel`:
|
|
48
|
+
* BROWSER_VENDOR_IDS), that one alone; `chrome`, a Chrome on the server's own host, which no server sets up yet
|
|
49
|
+
* (browserBy). */
|
|
50
|
+
export const PROVIDERS = Object.freeze({ web_search: ["auto", "native", "exa-keyless", "parallel", "off"], web_fetch: ["kernel", "parallel"], browser: Object.freeze(["auto", ...browserProviderIds(), "chrome"]) });
|
|
48
51
|
export const PICKABLE = Object.keys(PROVIDERS);
|
|
49
52
|
/** Every tool of serve's table (tools.ts), by name, so this module needs no import of it: a test holds the two as one. */
|
|
50
|
-
export const TABLE_TOOLS = ["read", "write", "edit", "bash", "ask_person", "web_fetch", "web_search", "browser", "pdf_pages", "llm"];
|
|
53
|
+
export const TABLE_TOOLS = ["read", "write", "edit", "bash", "ask_person", "web_fetch", "web_search", "browser", "subagent", "pdf_pages", "llm"];
|
|
51
54
|
/** The tools whose approved call the kernel runs itself, outside the model's turn (host-tools.ts's REPLAY): ask is
|
|
52
55
|
* offered for these and for catalog tools. Any other (browser, ask_person, the call-only ones) is allow or deny. The
|
|
53
56
|
* run's learned_workflow is one (tool-gate.ts runs an approved call of it on the run's own tools). */
|
|
@@ -65,14 +68,19 @@ export const SERVE_OWN_TOOLS = ["learned_workflow"];
|
|
|
65
68
|
* held to `desktop`, every phone tool to `phone` (the kernel registry's definitions name the key; tool-gate.ts
|
|
66
69
|
* settingsKeyOf reads it there). Allowed by default like a table tool; allow or deny. */
|
|
67
70
|
export const KIND_KEYS = ["desktop", "phone"];
|
|
71
|
+
/** A decision provider's settings key, its bare id (decisions.ts' providers: Jev, Parallel, OpenRouter's Decisions
|
|
72
|
+
* models): what an agent's learned workflow's decision nodes may ask (learned-workflow.ts, LS-07), and whose keys the
|
|
73
|
+
* runner hands its claim. Allowed by default; allow or deny. A workflow agent's own decisions read no setting of it. */
|
|
74
|
+
export const DECISION_PROVIDER_KEYS = ["jev", "parallel", "openrouter"];
|
|
68
75
|
/** A settings key: a tool of the table, one of the run's own tools (SERVE_OWN_TOOLS), a computer kind's (KIND_KEYS), a
|
|
76
|
+
* decision provider's (DECISION_PROVIDER_KEYS), a
|
|
69
77
|
* catalog tool (`monid.<tool>`, `mcp:<server>/<tool>`), or an MCP server's wildcard (`mcp:<server>/*`), which sets each
|
|
70
78
|
* of its tools. */
|
|
71
79
|
/** A tool's name in an agent's or the server's tool settings: a plain name, a catalog's tool (`monid.discover`), an MCP
|
|
72
80
|
* server's tool (`mcp:<server>/<tool>`) or its wildcard (`mcp:<server>/*`). */
|
|
73
81
|
const TOOL_KEY = /^(?:[a-z][a-z0-9_-]{0,63}(?:\.[A-Za-z0-9_-]{1,64})?|mcp:[A-Za-z0-9_.-]{1,64}\/(?:\*|[A-Za-z0-9_.-]{1,128}))$/;
|
|
74
82
|
const isToolSettingsKey = (name) => TOOL_KEY.test(name);
|
|
75
|
-
const isSettingsKey = (name) => isToolSettingsKey(name) && (TABLE_TOOLS.includes(name) || SERVE_OWN_TOOLS.includes(name) || KIND_KEYS.includes(name) || isCatalogTool(name) || /^mcp:[^/]+\/\*$/.test(name));
|
|
83
|
+
const isSettingsKey = (name) => isToolSettingsKey(name) && (TABLE_TOOLS.includes(name) || SERVE_OWN_TOOLS.includes(name) || KIND_KEYS.includes(name) || DECISION_PROVIDER_KEYS.includes(name) || isCatalogTool(name) || /^mcp:[^/]+\/\*$/.test(name));
|
|
76
84
|
/** The longest pinned string. */
|
|
77
85
|
export const MAX_PIN_TEXT = 1024;
|
|
78
86
|
/** A pinned argument's name: a top-level argument of the tool, as MCP tools name theirs. */
|
|
@@ -200,37 +208,53 @@ export const isUnavailable = (resolution) => resolution?.startsWith("unavailable
|
|
|
200
208
|
* run's meta and read back, names the variables) names where to save the key first, then the variable to set. */
|
|
201
209
|
export const whyUnavailable = (resolution) => {
|
|
202
210
|
if (resolution === NO_BROWSER_KEY)
|
|
203
|
-
return `it needs ${keyNeeded(
|
|
211
|
+
return `it needs ${BROWSER_VENDORS.map((vendor) => keyNeeded(vendor.keys)).join(", or ")}`;
|
|
204
212
|
const why = resolution.replace(/^unavailable: /, "");
|
|
205
213
|
const picked = /^(\S+) picked, no (.+)$/.exec(why);
|
|
206
214
|
return picked ? `${picked[1]} is picked, and it needs ${keyNeeded(picked[2].split(" and "))}` : why;
|
|
207
215
|
};
|
|
208
|
-
/** The
|
|
209
|
-
*
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
216
|
+
/** The browser's vendors: the computer registry's providers of a browser (kinds.ts PROVIDERS), in its order, each with
|
|
217
|
+
* the keys it needs by name (its required keys: a tool key's fields, tool-keys.ts, set or saved) and its name in words.
|
|
218
|
+
* Its plane value is the provider's id: `kernel` on browser is Kernel's hosted browser, never the guarded fetch
|
|
219
|
+
* web_fetch calls so. A hosted browser provider added to the registry is a vendor here with no edit. A browser
|
|
220
|
+
* provider that needs no key (this machine's Chrome) is no hosted vendor: `auto` would always hold its keys, so it is
|
|
221
|
+
* left out, and an agent picks it as its computer instead. */
|
|
222
|
+
const BROWSER_VENDORS = Object.freeze(hostedBrowsers().map((entry) => Object.freeze({ id: entry.id, label: entry.label, keys: Object.freeze(entry.keys.filter((key) => key.required).map((key) => key.name)) })));
|
|
223
|
+
/** The registry's browser providers that need a key, in its order. */
|
|
224
|
+
function hostedBrowsers() {
|
|
225
|
+
return COMPUTER_PROVIDERS.filter((entry) => entry.kinds.includes("browser") && entry.keys.some((key) => key.required));
|
|
226
|
+
}
|
|
227
|
+
/** The hosted browser providers' ids, in the registry's order (PROVIDERS.browser lists them between `auto` and `chrome`). */
|
|
228
|
+
function browserProviderIds() {
|
|
229
|
+
return hostedBrowsers().map((entry) => entry.id);
|
|
230
|
+
}
|
|
231
|
+
export const BROWSER_VENDOR_IDS = Object.freeze(browserProviderIds());
|
|
232
|
+
export const BROWSER_KEYS = Object.freeze(Object.fromEntries(BROWSER_VENDORS.map((vendor) => [vendor.id, vendor.keys])));
|
|
233
|
+
const LABELS = Object.freeze(Object.fromEntries(BROWSER_VENDORS.map((vendor) => [vendor.id, vendor.label])));
|
|
234
|
+
const isVendor = (name) => typeof name === "string" && Object.hasOwn(BROWSER_KEYS, name);
|
|
235
|
+
const browserKeysOf = (env) => Object.fromEntries(BROWSER_VENDORS.map((vendor) => [vendor.id, vendor.keys.every((name) => Boolean(env[name]))]));
|
|
214
236
|
/** A vendor picked whose keys the server does not hold: unavailable, never the other vendor. */
|
|
215
237
|
const noBrowserKey = (vendor) => `unavailable: ${vendor} picked, no ${BROWSER_KEYS[vendor].join(" and ")}`;
|
|
216
238
|
/** The keys a browser that resolves to `resolution` runs on: its vendor's (BROWSER_KEYS), none for no vendor. */
|
|
217
239
|
export const browserNeeds = (resolution) => (isVendor(resolution) ? BROWSER_KEYS[resolution] : []);
|
|
218
|
-
/** `auto` where the server holds
|
|
219
|
-
export const NO_BROWSER_KEY =
|
|
240
|
+
/** `auto` where the server holds no vendor's keys. */
|
|
241
|
+
export const NO_BROWSER_KEY = `unavailable: no browser key: set or save ${BROWSER_VENDORS.map((vendor) => `${vendor.label}'s (${vendor.keys.join(" and ")})`).join(" or ")}`;
|
|
220
242
|
/** `chrome` picked: a Chrome on the server's own host, refused by name until a server can set one up. */
|
|
221
243
|
export const NO_CHROME = "unavailable: a local Chrome is not set up on this server";
|
|
222
|
-
/** The browser `chosen` (picked as `picked` says) resolves to with the vendors' `keys`: `auto` is
|
|
223
|
-
* keys are held, else Kernel
|
|
224
|
-
* is unavailable by name. */
|
|
225
|
-
function browserBy(chosen, picked, keys = {
|
|
244
|
+
/** The browser `chosen` (picked as `picked` says) resolves to with the vendors' `keys`: `auto` is the registry's first
|
|
245
|
+
* vendor whose keys are held (Browserbase, else Kernel), else unavailable; a vendor picked is that vendor or
|
|
246
|
+
* unavailable; `chrome` is unavailable by name. */
|
|
247
|
+
function browserBy(chosen, picked, keys = {}) {
|
|
226
248
|
if (chosen === "chrome")
|
|
227
249
|
return { resolves: NO_CHROME, why: whyUnavailable(NO_CHROME) };
|
|
228
250
|
if (isVendor(chosen))
|
|
229
251
|
return keys[chosen] ? { resolves: chosen, why: `${LABELS[chosen]}, ${picked}` } : { resolves: noBrowserKey(chosen), why: `${LABELS[chosen]} is picked, and it needs ${keyNeeded(BROWSER_KEYS[chosen])}` };
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
252
|
+
const first = BROWSER_VENDORS.findIndex((vendor) => keys[vendor.id]);
|
|
253
|
+
if (first >= 0) {
|
|
254
|
+
const vendor = BROWSER_VENDORS[first];
|
|
255
|
+
const passed = BROWSER_VENDORS.slice(0, first).map((one) => `${one.label}'s`);
|
|
256
|
+
return { resolves: vendor.id, why: `${vendor.label}: its key is set or saved${passed.length ? `, and ${passed.join(" and ")} is not` : ""}` };
|
|
257
|
+
}
|
|
234
258
|
return { resolves: NO_BROWSER_KEY, why: whyUnavailable(NO_BROWSER_KEY) };
|
|
235
259
|
}
|
|
236
260
|
/** The server's environment's part of every resolution: its gateway and Parallel's key, and where the key is from. */
|
|
@@ -312,9 +336,10 @@ export function keptVendor(plane) {
|
|
|
312
336
|
const vendor = Object.keys(BROWSER_KEYS).find((name) => plane.browser === noBrowserKey(name));
|
|
313
337
|
return vendor ? { ...plane, browser: vendor } : plane;
|
|
314
338
|
}
|
|
315
|
-
/** The key row (tool-keys.ts) of the browser's vendor on `resolution` with `picked` the provider in force:
|
|
316
|
-
*
|
|
317
|
-
|
|
339
|
+
/** The key row (tool-keys.ts) of the browser's vendor on `resolution` with `picked` the provider in force: the vendor it
|
|
340
|
+
* resolved to, else the one picked, else the registry's first (Browserbase), so a page links a missing key to the row
|
|
341
|
+
* it is saved on. */
|
|
342
|
+
export const browserKeyRow = (picked, resolution) => (isVendor(resolution) ? resolution : isVendor(picked) ? picked : BROWSER_VENDORS[0]?.id ?? "browserbase");
|
|
318
343
|
/** The Plane a run's process is handed at a launch, under the server's `settings` now: its kept Plane (as keptVendor
|
|
319
344
|
* reads it) checked again (recheckPlane) against the one it would get today; with none kept, today's, its browser kept
|
|
320
345
|
* (keptFromBefore). At a launch after its first (a relaunch, a follow-up's, one after a restart) a capability set
|
|
@@ -349,7 +374,7 @@ export function settingsIssues(value, at = "", layer = "server") {
|
|
|
349
374
|
return Object.entries(value).flatMap(([name, setting]) => {
|
|
350
375
|
const pickable = Object.hasOwn(PROVIDERS, name);
|
|
351
376
|
if (!isSettingsKey(name))
|
|
352
|
-
return [{ field: field(name), reason: "not_allowed", message: `Tool settings are kept for this server's tools (${[...TABLE_TOOLS, ...SERVE_OWN_TOOLS, ...KIND_KEYS].join(", ")}), catalog tools (monid.<tool>, mcp:<server>/<tool>) and an MCP server's tools (mcp:<server>/*); ${name} is none of them.` }];
|
|
377
|
+
return [{ field: field(name), reason: "not_allowed", message: `Tool settings are kept for this server's tools (${[...TABLE_TOOLS, ...SERVE_OWN_TOOLS, ...KIND_KEYS, ...DECISION_PROVIDER_KEYS].join(", ")}), catalog tools (monid.<tool>, mcp:<server>/<tool>) and an MCP server's tools (mcp:<server>/*); ${name} is none of them.` }];
|
|
353
378
|
if (!isPlain(setting))
|
|
354
379
|
return [{ field: field(name), reason: "wrong_type", message: `${field(name)} is an object, {${pickable ? "provider, " : ""}permission${isMcpTool(name) ? ", pin" : ""}${layer === "agent" && name === "bash" ? ", policy" : ""}}` }];
|
|
355
380
|
return Object.entries(setting).flatMap(([key, given]) => {
|
|
@@ -370,7 +395,7 @@ export function settingsIssues(value, at = "", layer = "server") {
|
|
|
370
395
|
}
|
|
371
396
|
if (key === "permission") {
|
|
372
397
|
// A wildcard sets each tool of its server's: a catalog tool's permissions.
|
|
373
|
-
const offered = permissionsOf(
|
|
398
|
+
const offered = permissionsOf(name);
|
|
374
399
|
return offered.includes(given) ? [] : [{ field: field(name, key), reason: "not_an_option", message: `${field(name, key)} is one of ${offered.join(", ")}` }];
|
|
375
400
|
}
|
|
376
401
|
if (key !== "provider" || !pickable)
|
|
@@ -433,7 +458,7 @@ export function checkToolSettings(read, where) {
|
|
|
433
458
|
kept.pin = setting.pin;
|
|
434
459
|
}
|
|
435
460
|
if (setting.permission !== undefined) {
|
|
436
|
-
const offered = permissionsOf(
|
|
461
|
+
const offered = permissionsOf(name);
|
|
437
462
|
if (offered.includes(setting.permission))
|
|
438
463
|
kept.permission = setting.permission;
|
|
439
464
|
else {
|
|
@@ -495,12 +520,25 @@ export async function saveToolSettings(store, map) {
|
|
|
495
520
|
await store.settings.put(TOOL_SETTINGS_KEY, written);
|
|
496
521
|
return structuredClone(kept);
|
|
497
522
|
}
|
|
523
|
+
/** Why a tool of bash's family (SHELL_FAMILY: bash and the background tools) is not there for a run whose shell is
|
|
524
|
+
* `shell` (workspace/resolve-computer.ts runShellOf, the claim's own rule read off the agent's computer setting), in the
|
|
525
|
+
* kernel registry's words for a call of it there: with no computer that mounts the run's folder the background tools
|
|
526
|
+
* are refused (NEEDS_A_COMPUTER), and bash too where the run has no shell at all (NO_SHELL, Mode 1); in Mode 2 bash runs
|
|
527
|
+
* on Archil's exec. Undefined for any other tool, and where it is there. */
|
|
528
|
+
export function shellUnavailable(name, shell) {
|
|
529
|
+
if (!Object.hasOwn(SHELL_FAMILY, name) || shell === "computer")
|
|
530
|
+
return undefined;
|
|
531
|
+
if (name === SHELL_FAMILY[name])
|
|
532
|
+
return shell === "none" ? `unavailable: ${NO_SHELL}` : undefined;
|
|
533
|
+
return `unavailable: ${NEEDS_A_COMPUTER}`;
|
|
534
|
+
}
|
|
498
535
|
/** GET /v2/agents/{id}'s `tools`: each tool its current revision grants, in `order` (capabilities.tools'), with its
|
|
499
536
|
* permission in force and where it came from (the agent's own settings, the server's, or the default), the one that
|
|
500
537
|
* applies when the agent sets none (the server's, else the default) and those it may be set to; and for one with a
|
|
501
538
|
* provider choice the provider in force and where it came from, the one that applies when the agent sets none, and what
|
|
502
|
-
* it resolves to on the agent's harness and model.
|
|
503
|
-
|
|
539
|
+
* it resolves to on the agent's harness and model. `shell`: where a run of the agent has its shell (runShellOf on its
|
|
540
|
+
* computer setting); a tool of bash's family that leaves out resolves unavailable, saying why (shellUnavailable). */
|
|
541
|
+
export function agentTools(env, settings, agent, order, shell = "computer") {
|
|
504
542
|
const plane = planeFor(env, agent, settings);
|
|
505
543
|
const rank = (name) => order.indexOf(name);
|
|
506
544
|
return [...new Set(agent.tools)].sort((a, b) => rank(a) - rank(b)).map((name) => {
|
|
@@ -509,6 +547,10 @@ export function agentTools(env, settings, agent, order) {
|
|
|
509
547
|
// One short line for people (tool-blurbs.ts), as capabilities serves it.
|
|
510
548
|
const blurb = blurbOf(name);
|
|
511
549
|
const shown = { name, ...(blurb ? { blurb } : {}) };
|
|
550
|
+
// A tool of bash's family the agent's computer gives no shell for: unavailable, in the words its run's call gets.
|
|
551
|
+
const noShell = shellUnavailable(name, shell);
|
|
552
|
+
if (noShell)
|
|
553
|
+
return { ...shown, ...gate, resolved: noShell };
|
|
512
554
|
if (!Object.hasOwn(PROVIDERS, name))
|
|
513
555
|
return { ...shown, ...gate };
|
|
514
556
|
const pick = name;
|
package/dist/tools.d.ts
CHANGED
|
@@ -7,22 +7,25 @@ import { type Complete } from "./llm.js";
|
|
|
7
7
|
import { type Ledger, type PaidBooking } from "./paid-calls.js";
|
|
8
8
|
import type { Refusal } from "@parcha/agentrun-kernel";
|
|
9
9
|
import { type ShellPlace } from "@parcha/agentrun-kernel/kernel";
|
|
10
|
-
import { type
|
|
10
|
+
import { type SearchOn } from "./web-search.js";
|
|
11
|
+
import { type Plane, type Resolution, type Tooling, type ToolSettingsMap } from "./tool-plane.js";
|
|
11
12
|
import type { DenyFrom, SettingFrom } from "./tool-gate.js";
|
|
12
13
|
import type { LiveHandover, LiveViewerStore } from "./browser-live.js";
|
|
14
|
+
import { type RunnerLive } from "./live-reach.js";
|
|
13
15
|
import type { Claim, Store } from "./store/store.js";
|
|
14
16
|
import { type RunSignIn } from "./sign-ins-store.js";
|
|
15
17
|
export declare const ASK_TOOL = "ask_person";
|
|
16
|
-
/** Under `--faux` only: a module whose default export gives the browser's `{
|
|
17
|
-
* environment, the vendor its plane names
|
|
18
|
-
*
|
|
18
|
+
/** Under `--faux` only: a module whose default export gives the browser's `{ computer, driver }` for the run's
|
|
19
|
+
* environment, the vendor its plane names and the saved sign-in it was handed for that vendor (`{ provider, ref, save }`,
|
|
20
|
+
* or undefined): a browser computer provider and a driver in place of the vendor's and the raw-CDP driver (the tests'
|
|
21
|
+
* fake backend). */
|
|
19
22
|
export declare const FAUX_BROWSER_ENV = "AGENTRUN_SERVE_FAUX_BROWSER";
|
|
20
23
|
/** Under `--faux` only: a module whose default export is the fetch a run's first saved sign-in is made with on the runner,
|
|
21
24
|
* in place of the browser vendors' REST APIs (the tests' fake). Absent under --faux, none is made: no network. */
|
|
22
25
|
export declare const FAUX_VENDOR_API_ENV = "AGENTRUN_SERVE_FAUX_VENDOR_API";
|
|
23
26
|
/** What the result of `ask_person` says; the person's page shows the question as a waiting row. */
|
|
24
27
|
export declare const asked: (question: string) => string;
|
|
25
|
-
export declare const askPerson: ToolRegistration<TSchema, import("@earendil-works/chord").JsonValue>;
|
|
28
|
+
export declare const askPerson: ToolRegistration<TSchema, import("@earendil-works/chord/json").JsonValue>;
|
|
26
29
|
/** Where a run's tools are bound: the run, by its id, its folder and the folder its tools work in. */
|
|
27
30
|
export type RunWhere = {
|
|
28
31
|
readonly ref: {
|
|
@@ -68,9 +71,12 @@ export type ToolHost = {
|
|
|
68
71
|
put(handover: LiveHandover): Promise<boolean>;
|
|
69
72
|
drop(tag?: string): Promise<void>;
|
|
70
73
|
};
|
|
71
|
-
/**
|
|
72
|
-
* and the
|
|
73
|
-
|
|
74
|
+
/** On a runner on another host than its server (live-reach.ts runnerLiveOf): where its browser's viewer listens, the host
|
|
75
|
+
* its hand-over names, and the key the server's proof is checked with. Absent: loopback. */
|
|
76
|
+
liveAt?: RunnerLive;
|
|
77
|
+
/** The one store, for the live-viewer seam above, the run's saved sign-in (its runs and sign-ins, read under `claim`),
|
|
78
|
+
* the sign-in verify the runner saves, and the Screen tab's ended state (settings: browser-wait-ended.ts). */
|
|
79
|
+
store?: LiveViewerStore & Pick<Store, "runs" | "signIns" | "settings">;
|
|
74
80
|
/** The claim this run is held under: the live-viewer rows are written under it (its epoch fences them), and the run's
|
|
75
81
|
* saved sign-in is read and its hand kept under it. Present, the run is on the runner: never the process's own pipe. */
|
|
76
82
|
claim?: Claim;
|
|
@@ -95,8 +101,12 @@ export type ToolHost = {
|
|
|
95
101
|
* folder at `where.work`. */
|
|
96
102
|
workspace?: Workspace;
|
|
97
103
|
/** The agent's computer, where it is a browser (computer-for-claim.ts): the browser tool opens its sessions through the
|
|
98
|
-
* claim's provider
|
|
104
|
+
* claim's provider, whatever the tool plane picked. Absent: the plane's vendor, opened the same way (browser-computer.ts
|
|
105
|
+
* planeBrowser). */
|
|
99
106
|
browserComputer?: ClaimBrowser;
|
|
107
|
+
/** The run's own models a native web_search goes through (hosted-search.ts), asked as a search runs: on the runner, the
|
|
108
|
+
* session's port (its proxy, policy, key, price and cap), this run's alone. Absent: a native search has no model. */
|
|
109
|
+
search?: SearchOn;
|
|
100
110
|
};
|
|
101
111
|
/** What a name stands for in the run: the pi tools it offers, and the extensions a conversation selects for them. */
|
|
102
112
|
export type ToolBinding = {
|
|
@@ -111,6 +121,7 @@ export type EffectRun = {
|
|
|
111
121
|
work: string;
|
|
112
122
|
complete?: Complete;
|
|
113
123
|
ledger?: Ledger;
|
|
124
|
+
search?: SearchOn;
|
|
114
125
|
};
|
|
115
126
|
export type ToolEntry = {
|
|
116
127
|
/** One line, for capabilities. */
|
|
@@ -165,22 +176,11 @@ export declare const uploadsFrom: (work: Workspace, maxBytes: number, mime: (nam
|
|
|
165
176
|
refused: string;
|
|
166
177
|
}>;
|
|
167
178
|
};
|
|
168
|
-
/**
|
|
169
|
-
*
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
};
|
|
174
|
-
/** Kernel's provider, opening the agent's saved profile (`ref`, its name at Kernel) where a session asks for the
|
|
175
|
-
* profile `default`: the policy, the session's record and the model see only that name. */
|
|
176
|
-
export declare const keptProfile: <P extends {
|
|
177
|
-
create(spec: {
|
|
178
|
-
profile?: {
|
|
179
|
-
name: string;
|
|
180
|
-
save: boolean;
|
|
181
|
-
};
|
|
182
|
-
}, signal: AbortSignal): unknown;
|
|
183
|
-
}>(provider: P, ref: string) => P;
|
|
179
|
+
/** Every string in `value` (a tool's answer: its content, its details) passed through `cut`; anything else as it is. An
|
|
180
|
+
* image block's `data` that is an image (wholeImage) is its pixels' base64, not text, and is kept whole: the cut reads a
|
|
181
|
+
* run of more than 8,192 characters with no whitespace as "[redacted]" (key-refusal.ts redactedAnswer), which no model
|
|
182
|
+
* takes as an image. Any other `data`, on a block of any type, is cut like every other string. */
|
|
183
|
+
export declare function cutAnswer<T>(value: T, cut: (text: string) => string): T;
|
|
184
184
|
/** `provider`, its sessions' profile as this launch was handed it, whatever the policy a conversation was made with (a
|
|
185
185
|
* follow-up's was made under an earlier launch, which may have had no sign-in, or another lease): with a sign-in, every
|
|
186
186
|
* session opens on the profile `default`, saving only as `kept.save` says; without one, none asks for a profile. */
|
|
@@ -274,13 +274,6 @@ export declare const shellTools: (shell: ShellPlace) => ReadonlySet<string>;
|
|
|
274
274
|
export declare function toolingOf(revision: Revision): Promise<Tooling>;
|
|
275
275
|
/** The variables `entry` needs that `env` does not set, by name. */
|
|
276
276
|
export declare const missingEnv: (entry: ToolEntry, env: NodeJS.ProcessEnv) => string[];
|
|
277
|
-
/** What keeps `names` from being bound here: names outside the table (or, for a workflow's model nodes, that a node may
|
|
278
|
-
* not name), and the variables each tool in it needs that `env` does not set. Undefined when nothing does. */
|
|
279
|
-
export declare function toolRefusal(names: readonly string[], env: NodeJS.ProcessEnv, where?: "agent" | "nodes" | "calls"): {
|
|
280
|
-
message: string;
|
|
281
|
-
unbound: string[];
|
|
282
|
-
missing: Record<string, string[]>;
|
|
283
|
-
} | undefined;
|
|
284
277
|
/** Every tool as capabilities show it, the server's one tool catalog: available here, or the variables it is missing
|
|
285
278
|
* (names only), and the harnesses that run it (another harness than pi runs only the host tools, host-tools.ts). A tool
|
|
286
279
|
* a user picks a provider for (tool-plane.ts) gives the providers offered, the server's (`provider`, the default where it
|
|
@@ -293,14 +286,14 @@ export declare function toolRefusal(names: readonly string[], env: NodeJS.Proces
|
|
|
293
286
|
* saying that. Each tool also gives its permission under the server's settings (tool-gate.ts), the owner's default
|
|
294
287
|
* and the permissions it may be set to. */
|
|
295
288
|
export declare const toolsView: (env: NodeJS.ProcessEnv, settings?: ToolSettingsMap, noBox?: string, refused?: Readonly<Record<string, string>>, runnerShell?: ReadonlySet<string>) => {
|
|
296
|
-
providers?:
|
|
289
|
+
providers?: string[] | undefined;
|
|
297
290
|
provider?: string | undefined;
|
|
298
|
-
default_provider?:
|
|
299
|
-
resolves?: Record<"opencode" | "codex" | "pi" | "claude-agent",
|
|
291
|
+
default_provider?: string | undefined;
|
|
292
|
+
resolves?: Record<"opencode" | "codex" | "pi" | "claude-agent", Resolution> | undefined;
|
|
300
293
|
why?: Record<"opencode" | "codex" | "pi" | "claude-agent", string> | undefined;
|
|
301
|
-
permission: "deny" | "
|
|
302
|
-
default_permission: "deny" | "
|
|
303
|
-
permissions: ("deny" | "
|
|
294
|
+
permission: "deny" | "ask" | "allow";
|
|
295
|
+
default_permission: "deny" | "ask" | "allow";
|
|
296
|
+
permissions: ("deny" | "ask" | "allow")[];
|
|
304
297
|
harnesses: ("opencode" | "codex" | "pi" | "claude-agent")[];
|
|
305
298
|
missing?: string[] | undefined;
|
|
306
299
|
reason?: string | undefined;
|