@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
package/dist/runnable.d.ts
CHANGED
|
@@ -4,8 +4,20 @@ import { type ModelRef } from "./model.js";
|
|
|
4
4
|
import type { BoxOffer } from "./boxes.js";
|
|
5
5
|
import { type ToolSettingsMap } from "./tool-plane.js";
|
|
6
6
|
import type { McpTool } from "@parcha/agentrun-kernel";
|
|
7
|
+
import type { ShellPlace } from "@parcha/agentrun-kernel/kernel";
|
|
7
8
|
/** The harnesses an agent's MCP tools run on here. */
|
|
8
9
|
export declare const MCP_HARNESSES: readonly string[];
|
|
10
|
+
/** A revision's computer setting: a kind, its provider, the image it starts from, and a sandbox's GPUs
|
|
11
|
+
* (computer-setting.ts). */
|
|
12
|
+
export type RevisionComputer = {
|
|
13
|
+
kind: string;
|
|
14
|
+
provider?: string;
|
|
15
|
+
image?: string;
|
|
16
|
+
gpu?: {
|
|
17
|
+
type: string;
|
|
18
|
+
count: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
9
21
|
/** A revision's body as it is saved or stored. `unnamed`: its `place` is the one a revision that names none resolves to
|
|
10
22
|
* (place.ts defaultPlaceOf), not one it names. `computer`: its computer setting (computer-setting.ts), when it has one. */
|
|
11
23
|
export type RevisionShape = {
|
|
@@ -18,13 +30,11 @@ export type RevisionShape = {
|
|
|
18
30
|
mode: string;
|
|
19
31
|
box?: string;
|
|
20
32
|
};
|
|
21
|
-
computer?:
|
|
22
|
-
kind: string;
|
|
23
|
-
provider?: string;
|
|
24
|
-
};
|
|
33
|
+
computer?: RevisionComputer;
|
|
25
34
|
unnamed?: true;
|
|
26
35
|
toolSettings?: ToolSettingsMap;
|
|
27
36
|
approvals?: "never";
|
|
37
|
+
maxToolCalls?: number;
|
|
28
38
|
} | {
|
|
29
39
|
kind: "workflow";
|
|
30
40
|
workflow: unknown;
|
|
@@ -91,8 +101,11 @@ export declare const CODE_NODES_ENV = "AGENTRUN_SERVE_CODE_NODES";
|
|
|
91
101
|
/** What keeps `revision` from running in `env` under the server's tool `settings` (tool-plane.ts). `boxes`: what this
|
|
92
102
|
* server's box registry set up at its start (boxes.ts); none, every box is unavailable. `offers`: the harnesses' offers
|
|
93
103
|
* the server already holds (its reading); none given, they are probed here. `computerReady`: whether an agent's computer
|
|
94
|
-
* setting can be had here now, or its refusal (resolve-computer.ts computerReadiness); none given, the box check.
|
|
95
|
-
|
|
104
|
+
* setting can be had here now, or its refusal (resolve-computer.ts computerReadiness); none given, the box check.
|
|
105
|
+
* `shellOf`: where a run of an agent with that computer setting has its shell here now (resolve-computer.ts
|
|
106
|
+
* runShellOf, in the server's mode): a sandbox-only tool on the runner is let by it (Mode 2's Archil exec runs bash);
|
|
107
|
+
* none given, the runner has no shell. */
|
|
108
|
+
export declare function blockersOf(env: NodeJS.ProcessEnv, revision: RevisionShape, settings?: ToolSettingsMap, { capped, boxes, offers, mcp, decisionPrice, computerReady, shellOf }?: {
|
|
96
109
|
capped?: boolean;
|
|
97
110
|
boxes?: readonly BoxOffer[];
|
|
98
111
|
offers?: readonly HarnessCapability[];
|
|
@@ -101,15 +114,13 @@ export declare function blockersOf(env: NodeJS.ProcessEnv, revision: RevisionSha
|
|
|
101
114
|
reason?: string;
|
|
102
115
|
})[] | undefined;
|
|
103
116
|
decisionPrice?: (model: string) => Promise<unknown>;
|
|
104
|
-
computerReady?: (setting: {
|
|
105
|
-
kind: string;
|
|
106
|
-
provider?: string;
|
|
107
|
-
}) => Promise<{
|
|
117
|
+
computerReady?: (setting: RevisionComputer) => Promise<{
|
|
108
118
|
readonly ok: true;
|
|
109
119
|
} | {
|
|
110
120
|
readonly refused: string;
|
|
111
121
|
readonly box?: string;
|
|
112
122
|
}>;
|
|
123
|
+
shellOf?: (setting: RevisionComputer) => Promise<ShellPlace>;
|
|
113
124
|
}): Promise<Blocker[]>;
|
|
114
125
|
/** A blocker as a field issue, for a 422 or a warning. */
|
|
115
126
|
export declare const issueOf: ({ field, reason, message, fix }: Blocker) => InputIssue;
|
package/dist/runnable.js
CHANGED
|
@@ -11,7 +11,7 @@ import { builtinHarness, harnessOf, onAdapter } from "./harness-table.js";
|
|
|
11
11
|
import { chooseModel } from "./model.js";
|
|
12
12
|
import { llmTiers, MODEL_NODES, nodeTiers, unpricedModels, workflowNodes } from "./model.js";
|
|
13
13
|
import { boxAvailability, newAgentPlace, placeFix, RUN_BOXES } from "./place.js";
|
|
14
|
-
import { allows, BOUND_TOOLS, CALL_TOOLS, grantedTools, missingEnv, NODE_TOOLS, toolOf, workflowTools } from "./tools.js";
|
|
14
|
+
import { allows, BOUND_TOOLS, CALL_TOOLS, grantedTools, missingEnv, NODE_TOOLS, shellTools, toolOf, workflowTools } from "./tools.js";
|
|
15
15
|
import { DENIED, isUnavailable, NO_PARALLEL_KEY, planeFor, whyUnavailable } from "./tool-plane.js";
|
|
16
16
|
import { denyPlace, permissionFrom, permissionOf } from "./tool-gate.js";
|
|
17
17
|
import { approvalsOf } from "./approvals.js";
|
|
@@ -56,8 +56,11 @@ export const CODE_NODES_ENV = "AGENTRUN_SERVE_CODE_NODES";
|
|
|
56
56
|
/** What keeps `revision` from running in `env` under the server's tool `settings` (tool-plane.ts). `boxes`: what this
|
|
57
57
|
* server's box registry set up at its start (boxes.ts); none, every box is unavailable. `offers`: the harnesses' offers
|
|
58
58
|
* the server already holds (its reading); none given, they are probed here. `computerReady`: whether an agent's computer
|
|
59
|
-
* setting can be had here now, or its refusal (resolve-computer.ts computerReadiness); none given, the box check.
|
|
60
|
-
|
|
59
|
+
* setting can be had here now, or its refusal (resolve-computer.ts computerReadiness); none given, the box check.
|
|
60
|
+
* `shellOf`: where a run of an agent with that computer setting has its shell here now (resolve-computer.ts
|
|
61
|
+
* runShellOf, in the server's mode): a sandbox-only tool on the runner is let by it (Mode 2's Archil exec runs bash);
|
|
62
|
+
* none given, the runner has no shell. */
|
|
63
|
+
export async function blockersOf(env, revision, settings = {}, { capped = false, boxes = [], offers, mcp, decisionPrice, computerReady, shellOf } = {}) {
|
|
61
64
|
const out = [];
|
|
62
65
|
/** A web tool its run would resolve unavailable (tool-plane.ts): a warning at save, a 409 at a run, never another
|
|
63
66
|
* provider in its place. One set to deny is not: its run starts, and the gate refuses each call. */
|
|
@@ -78,7 +81,7 @@ export async function blockersOf(env, revision, settings = {}, { capped = false,
|
|
|
78
81
|
out.push({ field: "definition.harness", reason: NOT_SET_UP, message: offer?.reason ?? `This server does not run ${harness}.`, host: true, harness });
|
|
79
82
|
const { place } = revision;
|
|
80
83
|
// A workflow's model and call nodes run on the runner here; in a box they do not run yet. Its fix names the runner: an
|
|
81
|
-
// edit that leaves the place out keeps the agent's (agents.ts), so removing the field would change nothing.
|
|
84
|
+
// edit that leaves the place out keeps the agent's (agents-store.ts), so removing the field would change nothing.
|
|
82
85
|
if (revision.kind === "workflow" && place && place.mode !== "runner")
|
|
83
86
|
out.push({ field: "definition.place", reason: "not_an_option", message: `A workflow runs on the runner here: its place is runner (or none), not ${place.mode} on ${place.box ?? "no box"}.`, fix: placeFix({ mode: "runner" }), host: false });
|
|
84
87
|
// An agent with a computer setting is checked by the claim's own answers (resolve-computer.ts computerReadiness: the
|
|
@@ -94,16 +97,24 @@ export async function blockersOf(env, revision, settings = {}, { capped = false,
|
|
|
94
97
|
if (!box?.available)
|
|
95
98
|
out.push({ field: "definition.place", reason: NOT_SET_UP, message: sentence(`This agent's place is ${place.mode} on ${place.box ?? "no box"}, and this server cannot run it there: ${box?.reason ?? "that is not a box this server has"}`), host: true, ...(place.box ? { box: place.box } : {}) });
|
|
96
99
|
}
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
// The sandbox-only tools a run on the runner has a shell for here, where its computer setting ({kind: none} for a place
|
|
101
|
+
// alone) has its shell now (shellOf): bash on Archil's serverless exec in Mode 2 ("local"); none in Mode 1, which has no
|
|
102
|
+
// shell. A computer that mounts the folder from a runner place (a desktop) is not let here: its shell would share this
|
|
103
|
+
// server's folder with the runner-only tools, which the runnerOnly check below holds to a sandbox place alone.
|
|
104
|
+
const onRunner = revision.kind === "agentic" && shellOf && (place?.mode ?? "runner") === "runner";
|
|
105
|
+
const runnerShell = onRunner && (await shellOf(revision.computer ?? { kind: "none" })) === "local" ? shellTools("local") : new Set();
|
|
106
|
+
/** A shell tool the runner does not run: a box this server runs in is the fix; with none, why it has none
|
|
107
|
+
* (capabilities' default_reason) and both ways out, fixing that or keeping the agent on the runner without the tool.
|
|
108
|
+
* Where the runner has a shell that runs others (Mode 2's Archil exec runs bash), it says which. */
|
|
99
109
|
const shellOnRunner = (tool, field, named) => {
|
|
100
110
|
const where = named ? "this agent's place is the runner" : "this agent names no place, so it runs on the runner";
|
|
111
|
+
const has = runnerShell.size ? `whose shell here runs ${[...runnerShell].join(", ")} alone` : "which has no shell";
|
|
101
112
|
const box = boxAvailability(boxes).find((b) => RUN_BOXES.includes(b.id) && b.available);
|
|
102
113
|
if (box)
|
|
103
|
-
return { field, reason: "not_an_option", message: `${tool} runs only in a box, and ${where},
|
|
114
|
+
return { field, reason: "not_an_option", message: `${tool} runs only in a box, and ${where}, ${has}: give it a sandbox computer (a sandbox place).`, fix: placeFix({ mode: "sandbox", box: box.id }), host: false, tool };
|
|
104
115
|
const fresh = newAgentPlace(boxes);
|
|
105
116
|
const why = "reason" in fresh ? fresh.reason : "no box runs execute in is available here";
|
|
106
|
-
return { field, reason: "not_an_option", message: `${tool} runs only in a box, and ${where},
|
|
117
|
+
return { field, reason: "not_an_option", message: `${tool} runs only in a box, and ${where}, ${has} (${runnerShell.size ? tool : "a shell"} needs a sandbox computer), and ${why}. Do that, or keep this agent on the runner: name "place": {"mode": "runner"} and remove "${tool}" from definition.tools.`, fix: `Remove "${tool}" from definition.tools.`, host: false, tool };
|
|
107
118
|
};
|
|
108
119
|
// A harness's own MCP client may drop or retype a shape of a tool's schema (its facts' schemaProblems, measured on its
|
|
109
120
|
// pinned build): that would offer the model another tool than the one granted, so its grant is refused here, at the
|
|
@@ -160,8 +171,8 @@ export async function blockersOf(env, revision, settings = {}, { capped = false,
|
|
|
160
171
|
}
|
|
161
172
|
if (!allows(BOUND_TOOLS, tool))
|
|
162
173
|
out.push({ field: `definition.tools[${index}]`, reason: "not_an_option", message: `agentrun-serve binds the tools ${BOUND_TOOLS.join(", ")}; ${tool} is not one of them.`, host: false, tool });
|
|
163
|
-
// A shell runs
|
|
164
|
-
else if (toolOf(tool).sandboxOnly && (place?.mode ?? "runner") === "runner")
|
|
174
|
+
// A shell runs in a box; on the runner (no place names one) only what its shell here runs (runnerShell).
|
|
175
|
+
else if (toolOf(tool).sandboxOnly && (place?.mode ?? "runner") === "runner" && !runnerShell.has(tool))
|
|
165
176
|
out.push(shellOnRunner(tool, `definition.tools[${index}]`, !!place && !revision.unnamed));
|
|
166
177
|
// Its writes into work/ go by path from this machine, and a box's command could swap a link in on their way.
|
|
167
178
|
else if (toolOf(tool).runnerOnly && place?.mode === "sandbox")
|
|
@@ -176,6 +187,10 @@ export async function blockersOf(env, revision, settings = {}, { capped = false,
|
|
|
176
187
|
unavailable(`definition.tools[${index}]`, revision.tools ?? [], tool);
|
|
177
188
|
}
|
|
178
189
|
});
|
|
190
|
+
// The tool-call budget is counted from pi's own journal (tool-budget.ts): on another harness it would hold nothing, so
|
|
191
|
+
// the definition is refused, never saved to run without it.
|
|
192
|
+
if (revision.maxToolCalls !== undefined && onAdapter(env, harness))
|
|
193
|
+
out.push({ field: "definition.max_tool_calls", reason: NOT_SET_UP, message: `A tool-call budget is held on pi here; on ${harness} it is not counted yet.`, fix: "Run the agent on pi, or set max_tool_calls to 0.", host: false, harness });
|
|
179
194
|
const resolved = await harnessModel(env, harness, revision.model, offer?.available === true);
|
|
180
195
|
if (!resolved)
|
|
181
196
|
return out;
|
|
@@ -190,6 +205,16 @@ export async function blockersOf(env, revision, settings = {}, { capped = false,
|
|
|
190
205
|
out.push({ field: "definition.model", reason: NOT_SET_UP, message: `The model ${id} has no price here, so a run's spend cap cannot be kept on it.`, fix: PRICE_FIX, host: true, unpriced: true });
|
|
191
206
|
return out;
|
|
192
207
|
}
|
|
208
|
+
const { inspectWorkflow } = await import("@parcha/agentrun-dsl");
|
|
209
|
+
// A workflow the DSL cannot read is the definition's fault (422 on the field), never the server's (500).
|
|
210
|
+
let inspection;
|
|
211
|
+
try {
|
|
212
|
+
inspection = inspectWorkflow(revision.workflow);
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
out.push({ field: "definition.workflow", reason: "not_an_option", message: `The workflow is not one this server can read: ${String(error?.message ?? error).slice(0, 500)}`, host: false });
|
|
216
|
+
return out;
|
|
217
|
+
}
|
|
193
218
|
// Every MCP tool a workflow grants, at its top level or on a node, is held to the one check (mcpGrant): refused at the
|
|
194
219
|
// save, never a workflow whose run goes without it or cannot launch.
|
|
195
220
|
const granted = await grantedTools(revision);
|
|
@@ -202,8 +227,6 @@ export async function blockersOf(env, revision, settings = {}, { capped = false,
|
|
|
202
227
|
// A workflow's model nodes run on pi here; on another harness they are not bound yet, and never run on pi instead.
|
|
203
228
|
if (onAdapter(env, harness))
|
|
204
229
|
out.push({ field: "definition.workflow", reason: NOT_SET_UP, message: `A workflow runs on pi here; on ${harness} its model nodes are not bound yet.`, host: true, harness });
|
|
205
|
-
const { inspectWorkflow } = await import("@parcha/agentrun-dsl");
|
|
206
|
-
const inspection = inspectWorkflow(revision.workflow);
|
|
207
230
|
const { requires } = inspection;
|
|
208
231
|
const nodes = workflowNodes(revision.workflow, inspection);
|
|
209
232
|
const runs = "agentrun-serve runs a workflow's model nodes (agent, decide, extract, report)";
|
|
@@ -2,7 +2,7 @@ import { type ConversationId, Harness, type Tx } from "@earendil-works/pi-durabl
|
|
|
2
2
|
import { type AgentAdapter, type Refusal, type SessionRecord, type SessionSpec } from "@parcha/agentrun-kernel";
|
|
3
3
|
import type { KernelHooks, ToolCall } from "./conformance/subject.js";
|
|
4
4
|
import { type ApprovalPrice, type BudgetData, type EndData } from "./journal-kinds.js";
|
|
5
|
-
import { type MessageOrigin } from "
|
|
5
|
+
import { type MessageOrigin } from "../timeline/index.js";
|
|
6
6
|
import { type Claim, type EndOfRunTurn, type LoopFactory } from "./loop-contract.js";
|
|
7
7
|
import { Parked } from "./loop.js";
|
|
8
8
|
import type { PiRun } from "./adapters/pi.js";
|
|
@@ -47,9 +47,17 @@ export type GateAnswer = "allow" | "ask" | "deny" | {
|
|
|
47
47
|
readonly deny: string;
|
|
48
48
|
};
|
|
49
49
|
/** The gate before a call's intent; `askedAs`, when it has one, names a call as a person is asked about it (its settings
|
|
50
|
-
* key, as main's pending approval names it), else the call is asked about by its own name.
|
|
51
|
-
|
|
50
|
+
* key, as main's pending approval names it), else the call is asked about by its own name. `replayed`: asked again for a
|
|
51
|
+
* call run again after an earlier attempt that may have been sent, so a refusal's words never say nothing was sent. */
|
|
52
|
+
export type SpecGate = ((call: ToolCall, options?: {
|
|
53
|
+
readonly replayed?: boolean;
|
|
54
|
+
}) => GateAnswer | Promise<GateAnswer>) & {
|
|
52
55
|
readonly askedAs?: (tool: string) => string;
|
|
56
|
+
/** What an asked call's card shows beside its input (a learned workflow's MCP calls it would make), if anything. */
|
|
57
|
+
readonly askedFor?: (tool: string, args: unknown) => Promise<Record<string, unknown> | undefined>;
|
|
58
|
+
/** The revision's tool-call budget (definition.max_tool_calls, tool-budget.ts): the calls each conversation may make. A
|
|
59
|
+
* call past it is refused before anything else is asked; one the adapter counts no calls for (a CLI's) is not held. */
|
|
60
|
+
readonly toolCalls?: number;
|
|
53
61
|
};
|
|
54
62
|
/** What one claimed run's adapter loop runs. */
|
|
55
63
|
export interface AdapterRunSpec {
|
|
@@ -111,9 +119,20 @@ export interface AdapterRunSpec {
|
|
|
111
119
|
* them): it wins over LoopDeps.endOfRun and is asked where that one is, in the end turn while the claim is held, before
|
|
112
120
|
* a tool host's beforeRelease and the run's release, its rows in the end's commit. */
|
|
113
121
|
readonly endOfRun?: EndOfRunTurn;
|
|
122
|
+
/** What the claim laid of the run's learning seed (runner/learning-seed.ts): the learned skills and workflows it was
|
|
123
|
+
* given, by name. The loop writes it on the root (KINDS.learningLaid) as this claim opens. Absent for a run that does
|
|
124
|
+
* not learn. */
|
|
125
|
+
readonly learningLaid?: {
|
|
126
|
+
readonly skills: readonly string[];
|
|
127
|
+
readonly workflows: readonly string[];
|
|
128
|
+
};
|
|
114
129
|
/** The run's work folder, as its file tools resolve a path: what the end-of-run turn's refusal under work/.learning/
|
|
115
130
|
* reads an absolute path against. Absent: a relative path, or the box's, still counts. */
|
|
116
131
|
readonly workRoot?: string;
|
|
132
|
+
/** The harness's working directory (a CLI's, SessionIO.cwd), which the absolute paths its calls name are built from:
|
|
133
|
+
* kept on each call's start in the record (CallStartData.cwd), so the run's rows name such a path by its name in the
|
|
134
|
+
* workspace (store-reads/journal.ts runTimeline). */
|
|
135
|
+
readonly cwd?: string;
|
|
117
136
|
/** The end's patch beside its state: the run's outcome, cost and metrics, read when the end is written and carried in
|
|
118
137
|
* its commit. Bounded (CUT_STEP_MS): a reader that stalls gives no patch, and the end is still written. */
|
|
119
138
|
readonly endPatch?: (end: EndData) => Promise<Pick<EndData, "outcome" | "costUsd" | "metrics">>;
|
|
@@ -209,12 +228,16 @@ export interface RunLedger {
|
|
|
209
228
|
readonly paid: RunTools;
|
|
210
229
|
/** The session's proxied models for a request the host sends beside the harness's own, under `label` (portModels on
|
|
211
230
|
* the session's port), read at each request: a spec may take them at its build, before the session opens; a request
|
|
212
|
-
* made while no port is up (no session, or a harness with none) finds no model.
|
|
213
|
-
|
|
231
|
+
* made while no port is up (no session, or a harness with none) finds no model. `tier`: the run's model of that tier
|
|
232
|
+
* (AdapterSession.port's `tier`), listed under tierProvider(tier). */
|
|
233
|
+
models(label: string, tier?: string): Promise<PortModels>;
|
|
214
234
|
/** A paid call the run's cap refused that pauses the run (an agent's ask for a person's browser time: main's paidCall
|
|
215
235
|
* pause): its pause is journaled at once, as a refused request's is (pauseAtCap), and the run's next request is refused
|
|
216
236
|
* in its words, so the run parks there with the cap's figures. A take-over's refusal pauses nothing: it is not called. */
|
|
217
237
|
pause(refusal: Refusal): Promise<void>;
|
|
238
|
+
/** The store's flush (what the runner's flush before a side effect runs): a record a tool writes during its call that
|
|
239
|
+
* must be on disk before the call's next step leaves the box (a browser session's open, before its vendor is asked). */
|
|
240
|
+
flush(): Promise<void>;
|
|
218
241
|
}
|
|
219
242
|
export interface AdapterLoopOptions {
|
|
220
243
|
/** How many times pi restarts a call's task cut off without progress before it ends it (restart_limit); finite.
|
|
@@ -226,6 +249,14 @@ export interface AdapterLoopOptions {
|
|
|
226
249
|
/** For tests: awaited as a wait in the claim on the person's answer starts, before it takes their messages. */
|
|
227
250
|
readonly beforePersonWait?: () => Promise<void>;
|
|
228
251
|
}
|
|
252
|
+
/** A paid call's refusal an earlier claim kept (KINDS.pausePending) whose pause never landed: the newest one with no
|
|
253
|
+
* pause (KINDS.budget), no end and no park on a person's question (KINDS.personAsked: the turn ended on the ask with no
|
|
254
|
+
* next request, so the refusal is spent, and the person's answer is no retry of the call) after it. Undefined when there
|
|
255
|
+
* is none. */
|
|
256
|
+
export declare function pendingPauseOf(entries: readonly {
|
|
257
|
+
readonly kind?: string;
|
|
258
|
+
readonly data?: unknown;
|
|
259
|
+
}[]): Refusal | undefined;
|
|
229
260
|
/** The turns a session's records booked (its runner.turn records), in order. */
|
|
230
261
|
export declare function turnsOf(records: readonly SessionRecord[]): number[];
|
|
231
262
|
/** What the request that just answered cost, from the session's records, and the bookings that answer gives (`turns`):
|