@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
|
@@ -46,15 +46,14 @@ import { PAUSED_WORDS } from "./workflow-loop.js";
|
|
|
46
46
|
import { heldRedactor, holdClaimed } from "./redact.js";
|
|
47
47
|
import { holdStored } from "./store-secrets.js";
|
|
48
48
|
import { workflowHost } from "./workflow-host.js";
|
|
49
|
+
import { SUBMIT_TOOL } from "../workflow/host-tools.js";
|
|
49
50
|
import { bookedSpend } from "./metrics.js";
|
|
50
|
-
/** A model node's submit tool, by name: pi's SUBMIT_TOOL (packages/pi/src/host-tools.ts). Named here, not imported from
|
|
51
|
-
* @parcha/agentrun-pi, whose root loads its runner and with it pi-coding-agent, an optional peer an installed server
|
|
52
|
-
* does not have: importing it here stopped the runner from starting. workflow-submit-name.test.mjs holds the two equal. */
|
|
53
|
-
export const SUBMIT_TOOL = "submit";
|
|
54
51
|
/** The one session key the workflow's model requests book under (the run's one booking sums it, runBooking). */
|
|
55
52
|
const SESSION = WORKFLOW_SESSION;
|
|
56
|
-
/** A call node's tool failure, as
|
|
53
|
+
/** A call node's tool failure and a cap-held effect, as the runner's effect completed them (the loop's `failing` reads the
|
|
54
|
+
* first; holdAtEffects reads the second). */
|
|
57
55
|
const TOOL_FAILED = "agentrun_serve_tool_failed";
|
|
56
|
+
const CAP_HELD = "agentrun_serve_cap_held";
|
|
58
57
|
/** A tier's provider from the runner's model route (model-route.ts routeOf), the one way the runner resolves a model
|
|
59
58
|
* (the pi adapter's path): the route's provider, model and price for the proxy's booking, and the catalog's cost and
|
|
60
59
|
* output ceiling as the cap prices the hold. So a workflow model node and a pi turn book the same model the same way. */
|
|
@@ -170,6 +169,14 @@ export function workflowSpecOf(deps) {
|
|
|
170
169
|
const hooks = deferredHooks();
|
|
171
170
|
// The call nodes' effects in flight: a model request inside one is not where a pause lands (pauseAtEffects).
|
|
172
171
|
const flight = { count: 0 };
|
|
172
|
+
// The workflow's steps under way, by label: a model request the cap holds names its node when one step alone is open.
|
|
173
|
+
const steps = openSteps();
|
|
174
|
+
// A park for the cap names the one step under way, as a model request's does (parkOnRefusal): a decision, a paid call
|
|
175
|
+
// or a hold the cap refuses waits for a raise at its node, so the pause reads "waiting at <node>".
|
|
176
|
+
const parkAt = (refusal) => {
|
|
177
|
+
const node = refusal.node ?? steps.only();
|
|
178
|
+
hooks.park(node === undefined ? refusal : { ...refusal, node });
|
|
179
|
+
};
|
|
173
180
|
// What a model node offers its model: its `submit` and the tools its node names. The session proxy's policy drops every
|
|
174
181
|
// tool definition it is not given, so it admits this whole set by name (as pi's admits its session's tools); main's
|
|
175
182
|
// nodes send their requests straight to the provider (app.ts:117), unfiltered.
|
|
@@ -236,7 +243,7 @@ export function workflowSpecOf(deps) {
|
|
|
236
243
|
// extension of its own; the binding's raw extension (installed through `installed`) is never put in the registry.
|
|
237
244
|
const nodeTools = new Map();
|
|
238
245
|
for (const [name, binding] of nodeBindings) {
|
|
239
|
-
const booked = bookedNodeTools(binding, () => paidTools,
|
|
246
|
+
const booked = bookedNodeTools(binding, () => paidTools, parkAt);
|
|
240
247
|
nodeTools.set(name, { tools: booked.tools, extensions: [defineExtension({ name: `node-tool-${name}`, tools: booked.tools })] });
|
|
241
248
|
}
|
|
242
249
|
const nodePolicy = callPolicyOf(deps.store, claim.runId, claimed);
|
|
@@ -260,6 +267,13 @@ export function workflowSpecOf(deps) {
|
|
|
260
267
|
hooks.setPark(loopHooks);
|
|
261
268
|
const hostDeps = {
|
|
262
269
|
modelOf,
|
|
270
|
+
// Each model node's execution, kept on the node log (KINDS.nodeModel) before it runs: its path, the tier it asked
|
|
271
|
+
// for and the model id that tier's route sends it to, so the run's graph says what each execution ran on, and a
|
|
272
|
+
// later claim with another model of the tier never rewrites an earlier one's.
|
|
273
|
+
onModelNode: async ({ executionPath, tier }) => {
|
|
274
|
+
await nodeLog?.append([{ kind: KINDS.nodeModel, data: { path: executionPath, ...(tier ? { tier } : {}), model: modelOf(tier).modelId } }]);
|
|
275
|
+
},
|
|
276
|
+
steps,
|
|
263
277
|
// The nodes' tools as the registry holds them (their booked registrations, never their bindings' own raw ones, which
|
|
264
278
|
// would book beside the run's ledger), and the run's gate over them by name (main's registry.install).
|
|
265
279
|
sharedExtensions: [nodeToolGate(nodeNames, nodePolicy), ...[...nodeTools.values()].flatMap((binding) => binding.extensions)],
|
|
@@ -274,12 +288,13 @@ export function workflowSpecOf(deps) {
|
|
|
274
288
|
// A person's pause holds a call node before its effect starts (before the engine admits it), as main's gate did;
|
|
275
289
|
// a call node's tool failure the driver recorded as its effect's outcome is thrown past the driver
|
|
276
290
|
// (failingEffects, main's `failing`), on the first run and on a resume that answers it from its receipt alike.
|
|
277
|
-
//
|
|
278
|
-
// refuses for room parks the run
|
|
279
|
-
cap: pauseAtEffects(holdAtEffects(failingEffects(decisions ? decisionWorkflowCap(() => decisionCap, decisions, hooks) : identityWorkflowCap()), {
|
|
291
|
+
// Once the engine has admitted it, each call's most cost is held on the run's one ledger (holdAtEffects): a hold
|
|
292
|
+
// the cap refuses for room ends the effect held, nothing sent, and parks the run once that end is durable.
|
|
293
|
+
cap: pauseAtEffects(holdAtEffects(failingEffects(decisions ? decisionWorkflowCap(() => decisionCap, decisions, { paused: () => hooks.paused(), pause: () => hooks.pause(), park: parkAt }) : identityWorkflowCap()), {
|
|
280
294
|
paid: () => paidTools,
|
|
281
295
|
holdOf: (tool, input) => callHoldOf(tool, input, callEnv, tierModel),
|
|
282
|
-
park:
|
|
296
|
+
park: parkAt,
|
|
297
|
+
flush: () => deps.store.flush(),
|
|
283
298
|
}), hooks, flight),
|
|
284
299
|
};
|
|
285
300
|
return workflowHost(hostDeps);
|
|
@@ -299,7 +314,7 @@ export function workflowSpecOf(deps) {
|
|
|
299
314
|
key: SESSION,
|
|
300
315
|
label: SESSION,
|
|
301
316
|
// The model booking is the run's rule itself (no second booking); a refusal parks the run through the loop's hook.
|
|
302
|
-
beforeRequest: parkOnRefusal(run.before, hooks, flight),
|
|
317
|
+
beforeRequest: parkOnRefusal(run.before, hooks, flight, steps),
|
|
303
318
|
onEvent: async (event) => { if (event.type === "request_start")
|
|
304
319
|
await deps.store.flush(); },
|
|
305
320
|
});
|
|
@@ -331,7 +346,7 @@ export function workflowSpecOf(deps) {
|
|
|
331
346
|
/** The run's rule with a park on a refusal: `before` (runCap's one rule for the model session) is asked, and on a refusal
|
|
332
347
|
* the run parks through the loop's hook (parkOf decides room vs for good from the refusal), the same as the pi adapter's
|
|
333
348
|
* parkAtCap. It still returns the refusal, so the proxy refuses the request and the node's turn ends. */
|
|
334
|
-
export function parkOnRefusal(before, hooks, flight = { count: 0 }) {
|
|
349
|
+
export function parkOnRefusal(before, hooks, flight = { count: 0 }, steps) {
|
|
335
350
|
const park = hooks.park;
|
|
336
351
|
return async (request) => {
|
|
337
352
|
// A person's pause in force parks the run here, before the request is sent, as a refusal does: the request is
|
|
@@ -349,11 +364,29 @@ export function parkOnRefusal(before, hooks, flight = { count: 0 }) {
|
|
|
349
364
|
// words instead (the net under the call's hold, holdAtEffects).
|
|
350
365
|
if (verdict && "refuse" in verdict && flight.count === 0) {
|
|
351
366
|
const refusal = verdict;
|
|
352
|
-
|
|
367
|
+
// Its node: the one workflow step under way (every model request goes through the run's one port, which names no
|
|
368
|
+
// node); none when several run at once, as a map's items do.
|
|
369
|
+
const node = steps?.only();
|
|
370
|
+
park({ message: refusal.refuse, forGood: refusal.forGood ?? true, ...(refusal.figures ? { figures: refusal.figures } : {}), ...(node !== undefined ? { node } : {}) });
|
|
353
371
|
}
|
|
354
372
|
return verdict;
|
|
355
373
|
};
|
|
356
374
|
}
|
|
375
|
+
export function openSteps() {
|
|
376
|
+
const open = new Map();
|
|
377
|
+
return {
|
|
378
|
+
start: (label) => void open.set(label, (open.get(label) ?? 0) + 1),
|
|
379
|
+
end: (label) => {
|
|
380
|
+
const left = (open.get(label) ?? 0) - 1;
|
|
381
|
+
if (left > 0)
|
|
382
|
+
open.set(label, left);
|
|
383
|
+
else
|
|
384
|
+
open.delete(label);
|
|
385
|
+
},
|
|
386
|
+
// One label open, however many items of it run at once: a map's items run the same node, so the node is named.
|
|
387
|
+
only: () => (open.size === 1 ? [...open.keys()][0] : undefined),
|
|
388
|
+
};
|
|
389
|
+
}
|
|
357
390
|
/** `cap` with a person's pause before each call node's effect starts: applied outside the cap's own effect wrapper, which
|
|
358
391
|
* is outside the engine's recovery wrapper (the one that admits the effect, dsl recovery/driver.ts wrapEffect), so a
|
|
359
392
|
* paused call node is never admitted. A pause in force parks the run there (hooks.pause, which aborts the node's
|
|
@@ -362,8 +395,8 @@ export function parkOnRefusal(before, hooks, flight = { count: 0 }) {
|
|
|
362
395
|
export function pauseAtEffects(cap, hooks, flight) {
|
|
363
396
|
return {
|
|
364
397
|
...cap,
|
|
365
|
-
effect: (fn) => {
|
|
366
|
-
const inner = cap.effect(fn);
|
|
398
|
+
effect: (fn, driver) => {
|
|
399
|
+
const inner = cap.effect(fn, driver);
|
|
367
400
|
return (async (params) => {
|
|
368
401
|
if (hooks.paused()) {
|
|
369
402
|
hooks.pause();
|
|
@@ -413,6 +446,7 @@ function deferredHooks() {
|
|
|
413
446
|
},
|
|
414
447
|
responded: (ids, ticket) => (port ?? missing()).responded?.(ids, ticket) ?? Promise.resolve(),
|
|
415
448
|
note: (model, request) => (port ?? missing()).note?.(model, request),
|
|
449
|
+
noteReturned: (note) => (port ?? missing()).noteReturned?.(note),
|
|
416
450
|
},
|
|
417
451
|
setPort: (p) => { port = p; },
|
|
418
452
|
/** Waits, at most CLOSE_MS, until every request admitted is booked, and says how many are still not. Past the bound
|
|
@@ -450,7 +484,7 @@ export function callHoldOf(tool, input, env, modelOfTier) {
|
|
|
450
484
|
return NO_HOLD(tool);
|
|
451
485
|
const fee = tool === "web_search" ? parallelSearchFee(searchArgs(input).n) : parallelExtractFee(1);
|
|
452
486
|
// Who charges for it (main's charge row's charged_by), as paidOn names it: the hold is the record its request books under.
|
|
453
|
-
return { usd: fee.usd, name: fee.name,
|
|
487
|
+
return { usd: fee.usd, name: fee.name, basis: fee.basis, chargedBy: fee.by };
|
|
454
488
|
}
|
|
455
489
|
if (tool === "llm") {
|
|
456
490
|
const model = modelOfTier(typeof input.tier === "string" ? input.tier : undefined);
|
|
@@ -500,38 +534,94 @@ function reservedBooking(held) {
|
|
|
500
534
|
settle: async (_id, usd) => settleReservation(held, usd),
|
|
501
535
|
};
|
|
502
536
|
}
|
|
503
|
-
/** `cap` with each call node's most cost held on the run's one ledger
|
|
504
|
-
*
|
|
505
|
-
*
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
*
|
|
537
|
+
/** `cap` with each call node's most cost held on the run's one ledger, in two halves around the DSL driver's admission of
|
|
538
|
+
* its effect (dsl recovery/driver.ts wrapEffect: the effect is committed admitted before it is dispatched, and one
|
|
539
|
+
* admitted and never completed is never dispatched again):
|
|
540
|
+
* - `admittedEffect`, the effect the driver runs once it has admitted it: the call is priced (`holdOf`) and its hold
|
|
541
|
+
* taken (its record made durable before anything is sent), so a hold is never kept for an effect the driver did not
|
|
542
|
+
* admit: a process that dies before the admission leaves nothing for the next claim to count beside running the call
|
|
543
|
+
* again, and one that dies after it leaves the effect admitted, which the next claim never runs again, under the one
|
|
544
|
+
* hold it counts. Held, the effect runs with the hold as its reservation; what is not taken is given back at its end.
|
|
545
|
+
* A hold the cap refuses ends the effect completed with nothing sent: refused for room, as held (CAP_HELD); refused
|
|
546
|
+
* for good, as the call's failure in the cap's words (TOOL_FAILED). So does the net: a call whose answer cost more
|
|
547
|
+
* than its hold (an `llm` answer priced at its usage).
|
|
548
|
+
* - `effect`, outside the driver: an effect this process ended held parks the run (`park`, as a model request's refusal
|
|
549
|
+
* does) once that end is durable (`flush`), and waits on the node's signal. One an earlier claim ended held (its
|
|
550
|
+
* receipt, replayed) is the park that claim made: the call goes again, a new effect judged at this claim's cap. */
|
|
509
551
|
export function holdAtEffects(cap, deps) {
|
|
510
552
|
let seq = 0;
|
|
553
|
+
/** Effects between the driver's admission and its end, and the held ends waiting for none (see `effect`). */
|
|
554
|
+
let running = 0;
|
|
555
|
+
const quiet = [];
|
|
556
|
+
/** The held ends this process made, by the outcome the driver completed each effect with, and the cap's refusal. */
|
|
557
|
+
const heldHere = new WeakMap();
|
|
558
|
+
// A returned failure (`ok: false`): a continuation never answers a call from it.
|
|
559
|
+
const failed = (label, words) => ({ ok: false, [TOOL_FAILED]: `call node "${label}": ${words}` });
|
|
511
560
|
return {
|
|
512
561
|
...cap,
|
|
513
|
-
effect: (fn) => {
|
|
514
|
-
const inner = cap.effect(fn);
|
|
562
|
+
effect: (fn, driver) => {
|
|
563
|
+
const inner = cap.effect(fn, driver);
|
|
564
|
+
return (async (params) => {
|
|
565
|
+
for (;;) {
|
|
566
|
+
running += 1;
|
|
567
|
+
let value;
|
|
568
|
+
try {
|
|
569
|
+
value = await inner(params);
|
|
570
|
+
}
|
|
571
|
+
finally {
|
|
572
|
+
running -= 1;
|
|
573
|
+
if (running === 0)
|
|
574
|
+
for (const wake of quiet.splice(0))
|
|
575
|
+
wake();
|
|
576
|
+
}
|
|
577
|
+
if (!value || typeof value !== "object" || !Object.hasOwn(value, CAP_HELD))
|
|
578
|
+
return value;
|
|
579
|
+
const refused = heldHere.get(value);
|
|
580
|
+
// An earlier claim's park at this call (its receipt): the raise this claim took sends the call again, its poll window
|
|
581
|
+
// (when it is a poll) moved back by the time the run was held for the raise, which no deadline is for.
|
|
582
|
+
if (!refused) {
|
|
583
|
+
const at = value.held_at;
|
|
584
|
+
if (typeof at === "number" && params.executionPath !== undefined)
|
|
585
|
+
driver?.holdPoll?.(params.executionPath, Date.now() - at, String(at));
|
|
586
|
+
continue;
|
|
587
|
+
}
|
|
588
|
+
heldHere.delete(value);
|
|
589
|
+
// The effect's held end lands before the run parks, so the next claim replays it and goes again.
|
|
590
|
+
await deps.flush();
|
|
591
|
+
// The park aborts every node's signal, and an effect the driver has admitted and not completed is unknown at the
|
|
592
|
+
// next claim: so it parks once no sibling effect (a map's other branch) is between its admission and its end.
|
|
593
|
+
if (running > 0)
|
|
594
|
+
await new Promise((resolve) => quiet.push(resolve));
|
|
595
|
+
deps.park({ message: refused.message, forGood: false, ...(refused.figures ? { figures: refused.figures } : {}) });
|
|
596
|
+
const signal = params.signal;
|
|
597
|
+
if (signal && !signal.aborted)
|
|
598
|
+
await new Promise((resolve) => signal.addEventListener("abort", () => resolve(), { once: true }));
|
|
599
|
+
throw signal?.reason ?? refused;
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
},
|
|
603
|
+
admittedEffect: (fn) => {
|
|
604
|
+
const inner = (cap.admittedEffect ? cap.admittedEffect(fn) : fn);
|
|
515
605
|
return (async (params) => {
|
|
516
606
|
const tool = params.node.tool;
|
|
517
|
-
const hold = tool ? deps.holdOf(tool, params.input ?? {}) : undefined;
|
|
518
607
|
const paid = deps.paid();
|
|
608
|
+
const hold = tool && paid ? deps.holdOf(tool, params.input ?? {}) : undefined;
|
|
519
609
|
if (!hold || hold.usd <= 0 || !paid)
|
|
520
610
|
return inner(params);
|
|
521
611
|
const call = `${params.node.label}@${params.executionPath ?? ""}`;
|
|
522
|
-
|
|
612
|
+
// Keyed by the effect the driver admitted, so a later claim never writes a second hold under the same id.
|
|
613
|
+
const id = `${call}#${params.effect?.id ?? `hold${(seq += 1)}`}`;
|
|
523
614
|
try {
|
|
524
|
-
await paid.admit({ id, name: hold.name,
|
|
615
|
+
await paid.admit({ id, name: hold.name, holdUsd: hold.usd, basis: hold.basis, call, ...(hold.chargedBy ? { chargedBy: hold.chargedBy } : {}) });
|
|
525
616
|
}
|
|
526
617
|
catch (error) {
|
|
527
618
|
if (error instanceof CapRefused && !error.forGood) {
|
|
528
|
-
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
throw signal?.reason ?? error;
|
|
619
|
+
// Held, nothing sent: an outcome a continuation never answers a call from (`ok: false`, a returned failure).
|
|
620
|
+
const outcome = { ok: false, [CAP_HELD]: error.message, held_at: Date.now() };
|
|
621
|
+
heldHere.set(outcome, error);
|
|
622
|
+
return outcome;
|
|
533
623
|
}
|
|
534
|
-
|
|
624
|
+
return failed(params.node.label, error?.message ?? String(error));
|
|
535
625
|
}
|
|
536
626
|
const held = { id, call, hold, paid, taken: false, settled: false };
|
|
537
627
|
try {
|
|
@@ -541,7 +631,7 @@ export function holdAtEffects(cap, deps) {
|
|
|
541
631
|
if (usage && hold.llm?.price) {
|
|
542
632
|
const charged = pricingOf(hold.llm.price)({ cached: 0, fresh: usage.input_tokens ?? 0 }, usage.output_tokens ?? 0);
|
|
543
633
|
if (charged > hold.usd + 1e-12)
|
|
544
|
-
|
|
634
|
+
return failed(params.node.label, `its answer cost ${money(charged)}, above the ${money(hold.usd)} it held before it ran.`);
|
|
545
635
|
}
|
|
546
636
|
return value;
|
|
547
637
|
}
|
|
@@ -591,8 +681,8 @@ function callEnvOf(env, claimed) {
|
|
|
591
681
|
export function failingEffects(cap) {
|
|
592
682
|
return {
|
|
593
683
|
...cap,
|
|
594
|
-
effect: (fn) => {
|
|
595
|
-
const inner = cap.effect(fn);
|
|
684
|
+
effect: (fn, driver) => {
|
|
685
|
+
const inner = cap.effect(fn, driver);
|
|
596
686
|
return (async (params) => {
|
|
597
687
|
const value = await inner(params);
|
|
598
688
|
const failed = value !== null && typeof value === "object" ? value[TOOL_FAILED] : undefined;
|
|
@@ -642,7 +732,7 @@ function runEffectOf(claimed, complete, env, policy, paidTools, log) {
|
|
|
642
732
|
await logged({ t: "effect.end", ...at, status: "failed", error: message.slice(0, 65_536), ...(message.length > 65_536 ? { error_truncated: true } : {}), at: new Date().toISOString() });
|
|
643
733
|
if (signal.aborted || error?.name === "AbortError")
|
|
644
734
|
throw error;
|
|
645
|
-
return { [TOOL_FAILED]: `call node "${node.label}": ${node.tool} failed: ${message.slice(0, 500)}` };
|
|
735
|
+
return { ok: false, [TOOL_FAILED]: `call node "${node.label}": ${node.tool} failed: ${message.slice(0, 500)}` };
|
|
646
736
|
}
|
|
647
737
|
});
|
|
648
738
|
}
|
|
@@ -670,7 +760,8 @@ async function endPatchOf(booking, decisionCap, paidTools, journalOf) {
|
|
|
670
760
|
// (decisionCap.spentUsd, which stays the cap's own figure). With no journal to read, any decision is unknown.
|
|
671
761
|
const decision = !decisionCap ? 0 : journalOf ? await decisionsBooked(journalOf()) : null;
|
|
672
762
|
const paid = paidTools ? paidTools.spentUsd() : 0;
|
|
673
|
-
|
|
763
|
+
// Unknown is written as null, never left out (an end that says nothing leaves the $0 the run read before a response).
|
|
764
|
+
return { costUsd: model === null || decision === null || paid === null ? null : model + decision + paid };
|
|
674
765
|
}
|
|
675
766
|
/** The run's one cap as a WorkflowCap: model nodes and call nodes pass through (their money is on the proxy), and a
|
|
676
767
|
* decision node is priced before the DSL driver admits its request (`judge`) and held, sent and settled through the run's
|
|
@@ -774,6 +865,16 @@ function decisionJudging(deps) {
|
|
|
774
865
|
},
|
|
775
866
|
};
|
|
776
867
|
}
|
|
868
|
+
/** A decision under the run's cap with no DSL driver around it (no request committed, none asked again): both halves of
|
|
869
|
+
* decisionJudging in one, `before` over `admitted`. It prices the request as main does (holdOf), admits it through the
|
|
870
|
+
* kernel cap, asks the judge and settles the hold at what the answer charged; a refusal for room parks the run through
|
|
871
|
+
* the hook, one for no price fails it, and a price the catalog could not read fails the decision node unsent.
|
|
872
|
+
* learned-workflow.ts wraps a learned workflow's decisions in it (LS-07), over the agent run's ledger.decisions: a
|
|
873
|
+
* learned_workflow call is never run again. */
|
|
874
|
+
export function decisionJudge(inner, deps) {
|
|
875
|
+
const judging = decisionJudging(deps);
|
|
876
|
+
return judging.before(judging.admitted(inner));
|
|
877
|
+
}
|
|
777
878
|
/** A decision's request for the kernel cap, priced as main holds it (serve decision-cap.ts holdOf): Parallel's list price
|
|
778
879
|
* for one request; Jev's published per-input-token price; an OpenRouter Decisions model at its catalog price (per request,
|
|
779
880
|
* per image, per token), "unreadable" when the catalog could not be read, a null-priced `price: null` (refused as no
|
|
@@ -784,8 +885,10 @@ async function decisionRequestOf(provider, params) {
|
|
|
784
885
|
const questions = Object.keys(params.questions).length;
|
|
785
886
|
const images = Object.keys(params.images ?? {}).length;
|
|
786
887
|
const base = { kind: "decision", id, inputTokens, questions, images };
|
|
888
|
+
// Parallel charges by the request, nothing by the token: priced at $0 a token and its request price, never as a model
|
|
889
|
+
// with no price (which the cap refuses, failing every capped workflow's Parallel decision).
|
|
787
890
|
if (provider.id === "parallel")
|
|
788
|
-
return { ...base, model: openrouterModel("parallel",
|
|
891
|
+
return { ...base, model: openrouterModel("parallel", { input: 0, output: 0 }, null), requestUsd: PARALLEL_DECISION_USD };
|
|
789
892
|
if (provider.id === "jev")
|
|
790
893
|
return { ...base, model: { id: "jev", api: "openrouter", price: { input: JEV_INPUT_USD * 1e6, output: 0 }, outputCeiling: null } };
|
|
791
894
|
const priced = provider;
|
|
@@ -891,7 +994,7 @@ function bookedNodeTools(binding, paid, park) {
|
|
|
891
994
|
})),
|
|
892
995
|
};
|
|
893
996
|
}
|
|
894
|
-
/** The tool names a workflow's model node offers its model: the node's `submit` (
|
|
997
|
+
/** The tool names a workflow's model node offers its model: the node's `submit` (SUBMIT_TOOL) and every tool the
|
|
895
998
|
* workflow's model nodes name. */
|
|
896
999
|
export function nodeOffer(workflow) {
|
|
897
1000
|
return [...new Set([SUBMIT_TOOL, ...workflowTools(workflowNodes(workflow, inspectWorkflow(workflow))).nodes])];
|
|
@@ -4,7 +4,8 @@ import { type AgentEntry, type ExternalRef } from "./agents-store.js";
|
|
|
4
4
|
import { ApiError, type InputIssue } from "./errors.js";
|
|
5
5
|
import { type LearningMode, type Seed, type Shown } from "./learning.js";
|
|
6
6
|
import { type Place } from "./place.js";
|
|
7
|
-
import { type
|
|
7
|
+
import { type RepoBinding } from "./run-repo.js";
|
|
8
|
+
import { type LaunchDisk, type RunLaunch } from "./run-launch.js";
|
|
8
9
|
import { type ApprovalDecision, type RunMoment } from "./run-view.js";
|
|
9
10
|
import { type NewRevision, type RunOrigin, type RunRow, type Store } from "./store/index.js";
|
|
10
11
|
import { type ToolSettingsMap } from "./tool-plane.js";
|
|
@@ -51,13 +52,15 @@ export type MessageMode = "steer" | "answer" | "follow_up";
|
|
|
51
52
|
* and never a deny of an approval. The mode is the label the v2 answer reports, from the run's moment. `queue`: the steer's
|
|
52
53
|
* write when it is not this run's own (a trigger's: its firing marked with it, within its bound, store.triggers.message),
|
|
53
54
|
* which may skip it, in words. */
|
|
54
|
-
export declare function message(store: RunsStore, moment: RunMoment, content: string, { requestId, answers, origin, queue }?: {
|
|
55
|
+
export declare function message(store: RunsStore, moment: RunMoment, content: string, { requestId, answers, origin, queue, launchSealed, beforeSubmit }?: {
|
|
55
56
|
requestId?: string;
|
|
56
57
|
answers?: boolean;
|
|
57
58
|
origin?: unknown;
|
|
58
59
|
queue?: (command: SteerCommand) => Promise<{
|
|
59
60
|
skipped: string;
|
|
60
61
|
} | void>;
|
|
62
|
+
launchSealed?: Uint8Array;
|
|
63
|
+
beforeSubmit?: (runId: string, content: string) => Promise<void> | void;
|
|
61
64
|
}): Promise<{
|
|
62
65
|
mode: MessageMode;
|
|
63
66
|
messageId: string;
|
|
@@ -119,6 +122,10 @@ export interface StartDeps {
|
|
|
119
122
|
};
|
|
120
123
|
/** Where a revision naming these tools and no place runs here (server.ts fallbackPlace). */
|
|
121
124
|
fallbackPlace(kind: "agentic" | "workflow", tools: readonly unknown[]): Place;
|
|
125
|
+
/** The Archil disk the run's launch record keeps (server.ts launchDiskOf): the one its body's `archil_disk` names, else
|
|
126
|
+
* its agent's when it has one now; undefined for neither, or in Mode 1. A disk named in Mode 1 is refused. Absent, no
|
|
127
|
+
* disk is kept. */
|
|
128
|
+
launchDiskOf?(agentId: string, named: string | undefined): Promise<LaunchDisk | undefined>;
|
|
122
129
|
/** A run's title from its input (server.ts workflowTitle), for a workflow run's title. */
|
|
123
130
|
workflowTitle(name: string, input: Record<string, unknown>): string;
|
|
124
131
|
/** Every secret this server never shows, for the title's redaction (server.ts serverSecrets). */
|
|
@@ -158,6 +165,9 @@ export interface StartDeps {
|
|
|
158
165
|
/** The model the server names to grade what a run proposes (learning.ts gradeModelOf), put on each learning start; none,
|
|
159
166
|
* the agent's own grades it. */
|
|
160
167
|
readonly gradeModel?: string;
|
|
168
|
+
/** What the agent's GitHub triggers bind it to (run-repo.ts bindingOf), read when a person's start names or defaults a
|
|
169
|
+
* repository. Absent: the agent is bound to none. */
|
|
170
|
+
boundRepos?(agentId: string): Promise<RepoBinding>;
|
|
161
171
|
/** The host's secrets as they are shown now (learning-run.ts shown), for cutting the notes a run is given. */
|
|
162
172
|
shown?(): Shown;
|
|
163
173
|
}
|
|
@@ -165,6 +175,8 @@ export interface StartDeps {
|
|
|
165
175
|
* it must have a cap (a trigger's), and who its first message is from when the person did not write it. */
|
|
166
176
|
export interface StartOptions {
|
|
167
177
|
readonly trigger?: RunTrigger;
|
|
178
|
+
/** The run's launch secrets, sealed for its id once it has one (the create body's mcp_auth, server.ts). */
|
|
179
|
+
readonly sealed?: (runId: string) => Uint8Array;
|
|
168
180
|
/** The run's title when its starter names one (a trigger's: "<Source> <name>"), else it is made from its input. */
|
|
169
181
|
readonly title?: string;
|
|
170
182
|
readonly origin?: RunOrigin;
|
|
@@ -176,7 +188,7 @@ export interface StartOptions {
|
|
|
176
188
|
* (store.runs.create), which a runner reads at its claim. No process, no door, no setup file: where the run runs is the
|
|
177
189
|
* runner's. Under `origin`, a key that already started a run gets that run (the store's one-run-per-key), so a retry never
|
|
178
190
|
* starts a second. */
|
|
179
|
-
export declare function startRun(store: Pick<Store, "runs" | "runOfOrigin">, deps: StartDeps, entry: AgentEntry, body: Json, { trigger, origin, capped, from, title }?: StartOptions): Promise<RunRow>;
|
|
191
|
+
export declare function startRun(store: Pick<Store, "runs" | "runOfOrigin">, deps: StartDeps, entry: AgentEntry, body: Json, { trigger, origin, capped, from, title, sealed }?: StartOptions): Promise<RunRow>;
|
|
180
192
|
/** An agent given inline (POST /runs): its reference in its source with the version, its name and description, and the
|
|
181
193
|
* revision its checked definition makes (agents-store makeRevision), not yet stored. */
|
|
182
194
|
export interface InlineAgent {
|
|
@@ -195,9 +207,7 @@ export interface InlineAgent {
|
|
|
195
207
|
* agent already mapped to the reference is the run's (its id, its learning), so a run of a later version learns from the
|
|
196
208
|
* earlier ones. A different definition under a version already run is 409 external_body_conflict, nothing written; under
|
|
197
209
|
* `origin`, a key that already started a run gets that run, as startRun's. */
|
|
198
|
-
export declare function startInline(store: Pick<Store, "runs" | "runOfOrigin" | "agents">, deps: StartDeps, inline: InlineAgent, body: Json, { origin }?:
|
|
199
|
-
origin?: RunOrigin;
|
|
200
|
-
}): Promise<RunRow>;
|
|
210
|
+
export declare function startInline(store: Pick<Store, "runs" | "runOfOrigin" | "agents">, deps: StartDeps, inline: InlineAgent, body: Json, { origin, sealed }?: Pick<StartOptions, "origin" | "sealed">): Promise<RunRow>;
|
|
201
211
|
/** A run's launch from its create body, with every check the old start made before a run started, in the same order and
|
|
202
212
|
* words: the body's fields, the revision it pins, the input against its schema, the cap rules, the plane this host
|
|
203
213
|
* resolves, whether the revision can run here; then its title, plane, model and learning start. Nothing is written: the
|