@parcha/agentrun-serve 0.1.0-beta.36 → 0.1.0-beta.38
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 +452 -0
- package/README.md +311 -142
- package/dist/agent-rows.d.ts +1 -1
- package/dist/agents-store.d.ts +35 -3
- package/dist/agents-store.js +39 -14
- package/dist/answer-json.d.ts +34 -1
- package/dist/answer-json.js +91 -9
- package/dist/api-only.d.ts +1 -1
- package/dist/api-only.js +2 -2
- 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/browser-cost.d.ts +1 -1
- package/dist/browser-cost.js +52 -93
- package/dist/browser-live.d.ts +20 -8
- package/dist/browser-live.js +50 -27
- package/dist/cap.d.ts +0 -407
- package/dist/cap.js +4 -1028
- package/dist/catalog.d.ts +1 -12
- package/dist/catalog.js +4 -34
- package/dist/cli.js +13 -4
- package/dist/composio-preset.d.ts +53 -0
- package/dist/composio-preset.js +221 -0
- package/dist/computer-attach.d.ts +125 -0
- package/dist/computer-attach.js +330 -0
- package/dist/computer-calls.d.ts +60 -0
- package/dist/computer-calls.js +209 -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 +165 -0
- package/dist/computer-live.js +655 -0
- package/dist/computer-setting.d.ts +15 -2
- package/dist/computer-setting.js +20 -4
- package/dist/computer-view.d.ts +14 -0
- package/dist/computer-view.js +51 -3
- package/dist/computer-viewer.d.ts +6 -0
- package/dist/computer-viewer.js +311 -0
- package/dist/computers.d.ts +37 -8
- package/dist/computers.js +62 -14
- package/dist/console/assets/index-CjqQirbo.css +1 -0
- package/dist/console/assets/index-b6-XY5A9.js +576 -0
- package/dist/console/index.html +2 -2
- package/dist/console-links.d.ts +2 -0
- package/dist/console-links.js +3 -0
- package/dist/decisions.js +4 -0
- package/dist/faux-computers.d.ts +9 -20
- package/dist/faux-computers.js +56 -26
- package/dist/github-connection.d.ts +10 -2
- package/dist/github-connection.js +65 -2
- package/dist/github-faux.js +1 -1
- package/dist/graph-view.d.ts +1 -1
- package/dist/harness-opencode/adapter.js +7 -3
- package/dist/harness-opencode/facts.js +0 -2
- package/dist/harness-opencode/host/policy.d.ts +2 -5
- package/dist/harness-opencode/host/policy.js +8 -32
- package/dist/harness-table.d.ts +0 -2
- package/dist/harness-table.js +0 -2
- package/dist/harness.d.ts +1 -0
- package/dist/harness.js +35 -1
- package/dist/host-tools.d.ts +2 -6
- package/dist/host-tools.js +7 -10
- package/dist/hosted-search.d.ts +5 -6
- package/dist/hosted-search.js +2 -28
- 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/key-words.d.ts +3 -2
- package/dist/key-words.js +4 -2
- package/dist/learn/check.d.ts +10 -2
- package/dist/learn/check.js +13 -5
- package/dist/learn/commit.d.ts +14 -2
- package/dist/learn/commit.js +23 -9
- package/dist/learn/compile.d.ts +243 -0
- package/dist/learn/compile.js +471 -0
- package/dist/learn/folder.d.ts +6 -0
- package/dist/learn/folder.js +4 -1
- package/dist/learn/general.d.ts +69 -0
- package/dist/learn/general.js +75 -0
- package/dist/learn/grade.d.ts +5 -1
- package/dist/learn/grade.js +29 -7
- package/dist/learn/notes.d.ts +8 -0
- package/dist/learn/notes.js +18 -0
- package/dist/learn/promote.d.ts +253 -0
- package/dist/learn/promote.js +428 -0
- package/dist/learn/refit.d.ts +39 -0
- package/dist/learn/refit.js +236 -0
- package/dist/learn/reflect.d.ts +9 -20
- package/dist/learn/reflect.js +18 -125
- package/dist/learn/replay-calls.d.ts +63 -0
- package/dist/learn/replay-calls.js +158 -0
- package/dist/learn/skills.d.ts +50 -14
- package/dist/learn/skills.js +183 -47
- package/dist/learn/workflow-nodes.d.ts +15 -0
- package/dist/learn/workflow-nodes.js +44 -0
- package/dist/learned-nodes.d.ts +50 -2
- package/dist/learned-nodes.js +41 -2
- package/dist/learned-workflow.d.ts +43 -3
- package/dist/learned-workflow.js +170 -28
- package/dist/learning-batch.d.ts +283 -0
- package/dist/learning-batch.js +574 -0
- package/dist/learning-cost.d.ts +18 -6
- package/dist/learning-cost.js +15 -7
- package/dist/learning-evals.d.ts +33 -0
- package/dist/learning-evals.js +98 -0
- package/dist/learning-routes.d.ts +37 -2
- package/dist/learning-routes.js +52 -8
- package/dist/learning-words.d.ts +13 -0
- package/dist/learning-words.js +13 -0
- package/dist/learning.d.ts +55 -17
- package/dist/learning.js +91 -48
- 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/llm.js +0 -3
- package/dist/mcp-gateway.d.ts +21 -20
- package/dist/mcp-gateway.js +76 -55
- package/dist/mcp-oauth.d.ts +62 -7
- package/dist/mcp-oauth.js +134 -19
- package/dist/mcp-pin-first.d.ts +37 -0
- package/dist/mcp-pin-first.js +107 -0
- package/dist/mcp-private-hosts.d.ts +4 -4
- package/dist/mcp-private-hosts.js +20 -12
- package/dist/mcp-probe.d.ts +27 -11
- package/dist/mcp-probe.js +60 -42
- package/dist/mcp-secret-writes.js +4 -0
- package/dist/mcp-servers-store.d.ts +115 -25
- package/dist/mcp-servers-store.js +241 -43
- package/dist/mcp-sources.d.ts +39 -0
- package/dist/mcp-sources.js +74 -0
- package/dist/mcp-store.d.ts +21 -4
- package/dist/mcp-store.js +33 -8
- package/dist/mcp-wire.d.ts +22 -0
- package/dist/mcp-wire.js +36 -0
- package/dist/mcp.js +3 -3
- package/dist/meta-tool-names.d.ts +1 -0
- package/dist/meta-tool-names.js +3 -0
- package/dist/model-form.d.ts +26 -0
- package/dist/model-form.js +80 -0
- package/dist/model.d.ts +13 -0
- package/dist/model.js +69 -25
- package/dist/monid.d.ts +51 -25
- package/dist/monid.js +226 -140
- package/dist/openapi.js +694 -59
- package/dist/page.d.ts +18 -0
- package/dist/page.js +48 -20
- package/dist/paid-calls.d.ts +26 -29
- package/dist/paid-calls.js +46 -102
- package/dist/place-offers.d.ts +2 -3
- package/dist/place-offers.js +3 -7
- package/dist/place.js +1 -2
- package/dist/print.d.ts +15 -1
- package/dist/print.js +14 -3
- package/dist/propose.d.ts +10 -1
- package/dist/propose.js +30 -10
- package/dist/provider.js +12 -4
- package/dist/reflect-range.d.ts +8 -1
- package/dist/reflect-range.js +3 -2
- package/dist/rows.d.ts +5 -3
- package/dist/rows.js +15 -4
- package/dist/run-launch.d.ts +27 -2
- package/dist/run-launch.js +15 -4
- package/dist/run-learning-served.d.ts +13 -2
- package/dist/run-manifest.d.ts +5 -0
- package/dist/run-manifest.js +20 -0
- 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 +2 -3
- package/dist/run-timeline-served.d.ts +1 -1
- package/dist/run-timeline-served.js +5 -2
- package/dist/run-view.d.ts +19 -8
- package/dist/run-view.js +62 -26
- package/dist/runnable.d.ts +0 -3
- package/dist/runnable.js +37 -29
- package/dist/runner/adapter-loop.d.ts +47 -17
- package/dist/runner/adapter-loop.js +1427 -303
- package/dist/runner/adapter-run-spec.d.ts +23 -9
- package/dist/runner/adapter-run-spec.js +162 -56
- package/dist/runner/adapters/pi-computer.d.ts +9 -0
- package/dist/runner/adapters/pi-computer.js +51 -0
- package/dist/runner/adapters/pi.d.ts +25 -11
- package/dist/runner/adapters/pi.js +168 -45
- package/dist/runner/beside.d.ts +7 -3
- package/dist/runner/beside.js +21 -11
- 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 +20 -3
- package/dist/runner/cli-run-spec.js +174 -64
- package/dist/runner/commands.d.ts +3 -1
- package/dist/runner/commands.js +28 -3
- package/dist/runner/computer-channel.d.ts +34 -0
- package/dist/runner/computer-channel.js +62 -0
- package/dist/runner/conformance/harness.d.ts +3 -0
- package/dist/runner/conformance/harness.js +224 -17
- package/dist/runner/conformance/subject.d.ts +12 -5
- package/dist/runner/dispatch.js +3 -0
- package/dist/runner/end-of-run.d.ts +23 -12
- package/dist/runner/end-of-run.js +41 -16
- package/dist/runner/feedback-round.d.ts +52 -0
- package/dist/runner/feedback-round.js +79 -0
- package/dist/runner/github-app.d.ts +2 -1
- package/dist/runner/github-app.js +4 -2
- package/dist/runner/harness-loops.js +15 -1
- package/dist/runner/held-run.d.ts +65 -0
- package/dist/runner/held-run.js +158 -0
- package/dist/runner/journal-kinds.d.ts +44 -7
- package/dist/runner/journal-kinds.js +29 -0
- 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 +69 -13
- package/dist/runner/learning-end.js +340 -87
- package/dist/runner/learning-factory.d.ts +1 -1
- package/dist/runner/learning-factory.js +11 -5
- package/dist/runner/learning-loop.d.ts +86 -8
- package/dist/runner/learning-loop.js +178 -23
- package/dist/runner/learning-seed.d.ts +11 -0
- package/dist/runner/learning-seed.js +27 -0
- package/dist/runner/live-ticker.js +1 -0
- package/dist/runner/loop-contract.d.ts +26 -3
- package/dist/runner/loop.d.ts +21 -2
- package/dist/runner/loop.js +23 -2
- package/dist/runner/main.d.ts +13 -1
- package/dist/runner/main.js +27 -5
- package/dist/runner/mcp-claim.d.ts +15 -8
- package/dist/runner/mcp-claim.js +176 -71
- package/dist/runner/mcp-github.js +1 -1
- package/dist/runner/mcp-run.d.ts +21 -57
- package/dist/runner/mcp-run.js +25 -85
- package/dist/runner/meta-tools.d.ts +37 -0
- package/dist/runner/meta-tools.js +268 -0
- package/dist/runner/metrics.d.ts +11 -2
- package/dist/runner/metrics.js +26 -5
- package/dist/runner/model-route.js +12 -3
- package/dist/runner/monid-run.d.ts +16 -0
- package/dist/runner/monid-run.js +96 -0
- package/dist/runner/pr-checkout.d.ts +1 -0
- package/dist/runner/pr-checkout.js +1 -1
- package/dist/runner/promotion.d.ts +80 -0
- package/dist/runner/promotion.js +562 -0
- package/dist/runner/reflect-hook.d.ts +46 -13
- package/dist/runner/reflect-hook.js +149 -48
- package/dist/runner/runner.d.ts +26 -0
- package/dist/runner/runner.js +208 -17
- package/dist/runner/scratch-sweep.d.ts +13 -0
- package/dist/runner/scratch-sweep.js +62 -0
- package/dist/runner/sessions.d.ts +9 -4
- package/dist/runner/sessions.js +5 -1
- package/dist/runner/step-guard.d.ts +62 -0
- package/dist/runner/step-guard.js +93 -0
- package/dist/runner/store-port.d.ts +4 -2
- package/dist/runner/store-secrets.js +4 -3
- package/dist/runner/subagent.d.ts +0 -3
- package/dist/runner/subagent.js +10 -13
- package/dist/runner/workflow-first.d.ts +216 -0
- package/dist/runner/workflow-first.js +303 -0
- package/dist/runner/workflow-host.d.ts +6 -1
- package/dist/runner/workflow-host.js +1 -1
- package/dist/runner/workflow-loop.d.ts +1 -1
- package/dist/runner/workflow-loop.js +17 -10
- package/dist/runner/workflow-spec.d.ts +15 -2
- package/dist/runner/workflow-spec.js +63 -23
- package/dist/runs-over-store.d.ts +17 -3
- package/dist/runs-over-store.js +59 -20
- 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/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 +119 -18
- package/dist/server.js +841 -202
- package/dist/settings-wake.d.ts +23 -0
- package/dist/settings-wake.js +65 -0
- package/dist/standard-webhooks.d.ts +4 -1
- package/dist/standard-webhooks.js +8 -4
- package/dist/store/agent-body.d.ts +14 -3
- package/dist/store/agent-body.js +14 -10
- package/dist/store/command-wake.d.ts +13 -0
- package/dist/store/command-wake.js +37 -0
- package/dist/store/dialect.d.ts +6 -0
- package/dist/store/dialect.js +5 -0
- package/dist/store/index.d.ts +1 -1
- package/dist/store/journal/storage.d.ts +3 -2
- package/dist/store/journal/storage.js +13 -5
- package/dist/store/postgres/connection.js +3 -1
- package/dist/store/postgres/dialect.js +4 -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/postgres/migrations/0010_imported_templates.sql +18 -0
- package/dist/store/postgres/migrations/0011_revision_mcp_pin.sql +13 -0
- package/dist/store/schema.d.ts +10 -1
- package/dist/store/schema.js +104 -15
- package/dist/store/sqlite/connection.d.ts +2 -2
- package/dist/store/sqlite/connection.js +2 -2
- package/dist/store/sqlite/run-patch.d.ts +7 -5
- package/dist/store/sqlite/run-patch.js +45 -18
- package/dist/store/sqlite/store.js +331 -72
- package/dist/store/store.d.ts +312 -21
- package/dist/store/store.js +12 -1
- package/dist/store-reads/cap.d.ts +1 -1
- package/dist/store-reads/cap.js +8 -1
- package/dist/store-reads/decisions.d.ts +2 -2
- package/dist/store-reads/decisions.js +1 -1
- package/dist/store-reads/import-summary.d.ts +1 -1
- package/dist/store-reads/journal.d.ts +30 -5
- package/dist/store-reads/journal.js +128 -56
- package/dist/store-reads/learning.d.ts +114 -12
- package/dist/store-reads/learning.js +238 -48
- package/dist/store-reads/loop.d.ts +61 -0
- package/dist/store-reads/loop.js +111 -0
- package/dist/store-reads/runs.d.ts +1 -1
- package/dist/store-reads/workflow.d.ts +1 -1
- package/dist/store-view.d.ts +6 -0
- package/dist/store-view.js +59 -26
- package/dist/template-eval.d.ts +18 -9
- package/dist/template-eval.js +95 -68
- package/dist/template-github-permissions.d.ts +24 -10
- package/dist/template-github-permissions.js +36 -15
- package/dist/template-import.d.ts +31 -0
- package/dist/template-import.js +121 -0
- package/dist/template-source.d.ts +51 -0
- package/dist/template-source.js +371 -0
- package/dist/templates.d.ts +218 -46
- package/dist/templates.js +493 -181
- package/dist/timeline/computer.d.ts +48 -0
- package/dist/timeline/computer.js +169 -0
- package/dist/timeline/index.d.ts +4 -3
- package/dist/timeline/index.js +4 -3
- package/dist/timeline/labels.d.ts +6 -2
- package/dist/timeline/labels.js +93 -2
- package/dist/timeline/origin.d.ts +19 -5
- package/dist/timeline/origin.js +11 -4
- package/dist/timeline/timeline.d.ts +22 -1
- package/dist/timeline/timeline.js +34 -18
- package/dist/timeline/util.d.ts +4 -0
- package/dist/timeline/util.js +14 -0
- package/dist/tool-gate.d.ts +84 -50
- package/dist/tool-gate.js +179 -101
- package/dist/tool-keys.d.ts +4 -1
- package/dist/tool-keys.js +8 -3
- package/dist/tool-list.d.ts +26 -0
- package/dist/tool-list.js +43 -0
- package/dist/tool-names.d.ts +71 -0
- package/dist/tool-names.js +99 -0
- package/dist/tool-plane.d.ts +33 -27
- package/dist/tool-plane.js +72 -39
- package/dist/tools.d.ts +32 -7
- package/dist/tools.js +37 -24
- 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 +25 -6
- package/dist/trigger-signatures.js +41 -7
- 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 +7 -3
- package/dist/triggers.js +35 -5
- package/dist/turns.js +16 -1
- package/dist/validate.d.ts +15 -7
- package/dist/validate.js +102 -45
- package/dist/web-fetch.d.ts +2 -8
- package/dist/web-fetch.js +2 -22
- package/dist/web-search.d.ts +10 -5
- package/dist/web-search.js +7 -6
- package/dist/webhooks.d.ts +145 -102
- package/dist/webhooks.js +559 -322
- package/dist/workflow/decisions.d.ts +1 -1
- package/dist/workflow/node-runner.d.ts +2 -1
- package/dist/workflow/node.d.ts +2 -1
- package/dist/workflow/node.js +3 -1
- package/dist/workflow/pi-versions.d.ts +23 -0
- package/dist/workflow/pi-versions.js +57 -0
- package/dist/workflow/record-tool.d.ts +2 -1
- package/dist/workflow/store.d.ts +1 -1
- package/dist/workflow/task.js +3 -2
- package/dist/workflow-run.d.ts +1 -1
- package/dist/workspace/attached-computers.d.ts +41 -0
- package/dist/workspace/attached-computers.js +114 -0
- package/dist/workspace/computer-deps.d.ts +19 -9
- package/dist/workspace/computer-deps.js +24 -9
- package/dist/workspace/computer-for-claim.d.ts +23 -8
- package/dist/workspace/computer-for-claim.js +92 -33
- package/dist/workspace/computer-hold.d.ts +11 -27
- package/dist/workspace/computer-hold.js +41 -55
- package/dist/workspace/computer-ledger.d.ts +3 -1
- package/dist/workspace/computer-ledger.js +4 -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 +53 -0
- package/dist/workspace/computer-script.js +172 -0
- package/dist/workspace/executors.d.ts +1 -1
- package/dist/workspace/index.d.ts +4 -2
- package/dist/workspace/index.js +3 -1
- package/dist/workspace/kind-skills/desktop/SKILL.md +132 -84
- package/dist/workspace/kind-skills/phone/SKILL.md +104 -85
- package/dist/workspace/local.js +2 -2
- package/dist/workspace/resolve-computer.d.ts +24 -1
- package/dist/workspace/resolve-computer.js +40 -16
- package/dist/workspace/run-tools.d.ts +56 -21
- package/dist/workspace/run-tools.js +55 -34
- package/dist/wrap-up.d.ts +21 -0
- package/dist/wrap-up.js +21 -0
- package/launcher/agentrun-serve +4 -2
- package/package.json +19 -16
- package/templates/README.md +111 -45
- package/templates/code-review/agent.md +30 -14
- package/templates/code-review/evals/clean-refactor/case.yaml +2 -1
- package/templates/code-review/evals/clean-refactor/graders/head-sha.md +6 -0
- package/templates/code-review/evals/injection/case.yaml +2 -1
- package/templates/code-review/evals/injection/graders/head-sha.md +6 -0
- package/templates/code-review/evals/mentions-defused/case.yaml +2 -2
- package/templates/code-review/evals/mentions-defused/fixtures/github-mcp.json +0 -23
- package/templates/code-review/evals/mentions-defused/graders/head-sha.md +6 -0
- package/templates/code-review/evals/never-flag/case.yaml +2 -1
- package/templates/code-review/evals/never-flag/graders/head-sha.md +6 -0
- package/templates/code-review/evals/null-name/case.yaml +2 -1
- package/templates/code-review/evals/null-name/graders/head-sha.md +6 -0
- package/templates/code-review/evals/off-by-one/case.yaml +2 -1
- package/templates/code-review/evals/off-by-one/graders/head-sha.md +6 -0
- package/templates/code-review/evals/other-repo/case.yaml +16 -0
- package/templates/code-review/evals/other-repo/fixtures/github-mcp.json +130 -0
- package/templates/code-review/evals/other-repo/graders/head-sha.md +6 -0
- package/templates/code-review/evals/other-repo/graders/no-canary.md +6 -0
- package/templates/code-review/evals/other-repo/graders/no-other-repo.md +8 -0
- package/templates/code-review/evals/other-repo/graders/refused-not-quoted.md +18 -0
- package/templates/code-review/evals/other-repo/prompt.md +10 -0
- package/templates/code-review/evals/re-review/case.yaml +2 -1
- package/templates/code-review/evals/re-review/graders/head-sha.md +6 -0
- package/templates/code-review/evals/re-review-open/case.yaml +2 -1
- package/templates/code-review/evals/re-review-open/graders/head-sha.md +6 -0
- package/templates/code-review/evals/repo-rule/case.yaml +2 -1
- package/templates/code-review/evals/repo-rule/graders/head-sha.md +6 -0
- package/templates/code-review/evals/two-defects/case.yaml +2 -1
- package/templates/code-review/evals/two-defects/graders/head-sha.md +6 -0
- package/templates/code-review/rules/CODEREVIEW.md +1 -1
- package/templates/code-review/skills/review/DEEP.md +3 -2
- package/templates/code-review/skills/review/REVIEWER.md +3 -2
- package/templates/code-review/skills/review/SKILL.md +4 -3
- package/templates/code-review/{findings.schema.json → skills/review/findings.schema.json} +1 -0
- package/templates/inbound-lead/agent.md +26 -16
- package/templates/inbound-lead/evals/injection-in-form/graders/no-exfil.md +16 -0
- package/templates/inbound-lead/evals/injection-in-form/prompt.md +2 -2
- package/templates/inbound-lead/evals/write-back/case.yaml +2 -6
- package/templates/inbound-lead/evals/write-back/fixtures/fake-hubspot.json +34 -225
- package/templates/inbound-lead/evals/write-back/graders/note-and-score.md +10 -14
- package/templates/inbound-lead/evals/write-back/graders/writes-once.md +7 -0
- package/templates/inbound-lead/evals/write-back/prompt.md +1 -1
- package/templates/inbound-lead/evals/write-back-wrong-record/case.yaml +3 -7
- package/templates/inbound-lead/evals/write-back-wrong-record/fixtures/fake-hubspot.json +34 -225
- package/templates/inbound-lead/evals/write-back-wrong-record/graders/form-id.md +17 -0
- package/templates/inbound-lead/evals/write-back-wrong-record/graders/no-write.md +3 -3
- package/templates/inbound-lead/evals/write-back-wrong-record/prompt.md +2 -2
- package/templates/inbound-lead/skills/lead/SKILL.md +23 -27
- package/templates/kyb/agent.md +15 -5
- package/templates/kyb/evals/adverse-media/prompt.md +2 -7
- package/templates/kyb/evals/canada-active-filed/prompt.md +2 -6
- package/templates/kyb/evals/clean-public-company/prompt.md +2 -6
- package/templates/kyb/evals/injection-in-page/prompt.md +3 -7
- package/templates/kyb/evals/name-collision/prompt.md +2 -6
- package/templates/kyb/evals/no-invention/prompt.md +2 -6
- package/templates/kyb/evals/opensanctions-on/prompt.md +2 -6
- package/templates/kyb/evals/sanctioned-entity/prompt.md +2 -6
- package/templates/kyb/kyb.schema.json +8 -7
- package/templates/kyb/skills/kyb/SKILL.md +9 -6
- package/templates/market-monitor/agent.md +19 -12
- package/templates/market-monitor/evals/post-happens/case.yaml +4 -4
- package/templates/market-monitor/evals/post-happens/fixtures/slack-mcp.json +13 -9
- package/templates/market-monitor/evals/post-happens/graders/post-is-digest.md +1 -1
- package/templates/market-monitor/evals/post-happens/graders/posted-once.md +3 -3
- package/templates/market-monitor/skills/monitor/SKILL.md +6 -4
- package/templates/release-notes/agent.md +32 -10
- package/templates/release-notes/evals/draft-not-publish/case.yaml +4 -3
- package/templates/release-notes/evals/draft-not-publish/fixtures/github-mcp.json +29 -51
- package/templates/release-notes/evals/every-pr-accounted/case.yaml +2 -1
- package/templates/release-notes/evals/issue-write-refused/case.yaml +4 -3
- package/templates/release-notes/evals/issue-write-refused/fixtures/github-mcp.json +29 -51
- package/templates/release-notes/evals/late-arrival/case.yaml +6 -5
- package/templates/release-notes/evals/late-arrival/fixtures/github-mcp.json +29 -51
- package/templates/release-notes/evals/learned-style/case.yaml +2 -1
- package/templates/release-notes/evals/no-pr-numbers-on-top/case.yaml +2 -1
- package/templates/release-notes/evals/other-repo/case.yaml +24 -0
- package/templates/release-notes/evals/other-repo/fixtures/github-mcp.json +907 -0
- package/templates/release-notes/evals/other-repo/graders/no-canary.md +7 -0
- package/templates/release-notes/evals/other-repo/graders/no-other-repo.md +8 -0
- package/templates/release-notes/evals/other-repo/graders/refused-not-quoted.md +18 -0
- package/templates/release-notes/evals/other-repo/prompt.md +32 -0
- package/templates/release-notes/evals/upgrade-line/case.yaml +2 -1
- package/templates/release-notes/evals/user-facing-only/case.yaml +2 -1
- package/templates/release-notes/notes.schema.json +1 -1
- package/templates/release-notes/skills/release-notes/SKILL.md +26 -17
- package/dist/console/assets/index-BI4Byidu.js +0 -550
- package/dist/console/assets/index-C19gUF2n.css +0 -1
- package/dist/run-db.d.ts +0 -53
- package/dist/run-db.js +0 -116
- package/dist/tool-blurbs.d.ts +0 -4
- package/dist/tool-blurbs.js +0 -28
- package/dist/tool-budget.d.ts +0 -26
- package/dist/tool-budget.js +0 -56
- package/dist/workflow/readers.d.ts +0 -36
- package/dist/workflow/readers.js +0 -145
- package/dist/workflow/wal.d.ts +0 -11
- package/dist/workflow/wal.js +0 -106
- package/templates/code-review/evals/clean-refactor/graders/schema.md +0 -5
- package/templates/code-review/evals/injection/graders/schema.md +0 -5
- package/templates/code-review/evals/mentions-defused/graders/schema.md +0 -5
- package/templates/code-review/evals/never-flag/graders/schema.md +0 -5
- package/templates/code-review/evals/null-name/graders/schema.md +0 -5
- package/templates/code-review/evals/off-by-one/graders/schema.md +0 -5
- package/templates/code-review/evals/re-review/graders/schema.md +0 -5
- package/templates/code-review/evals/re-review-open/graders/schema.md +0 -5
- package/templates/code-review/evals/repo-rule/graders/schema.md +0 -5
- package/templates/code-review/evals/two-defects/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/clear-disqualifier/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/injection-in-form/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/learned-correction/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/strong-fit/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/thin-data/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/write-back/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/write-back/graders/writes-twice.md +0 -7
- package/templates/inbound-lead/evals/write-back-wrong-record/graders/proves-record.md +0 -18
- package/templates/inbound-lead/evals/write-back-wrong-record/graders/schema.md +0 -5
- package/templates/kyb/evals/adverse-media/graders/schema.md +0 -5
- package/templates/kyb/evals/canada-active-filed/graders/schema.md +0 -5
- package/templates/kyb/evals/clean-public-company/graders/schema.md +0 -5
- package/templates/kyb/evals/injection-in-page/graders/schema.md +0 -5
- package/templates/kyb/evals/name-collision/graders/schema.md +0 -5
- package/templates/kyb/evals/no-invention/graders/schema.md +0 -5
- package/templates/kyb/evals/opensanctions-on/graders/schema.md +0 -5
- package/templates/kyb/evals/sanctioned-entity/graders/schema.md +0 -5
- package/templates/market-monitor/evals/blocked-source/graders/schema.md +0 -5
- package/templates/market-monitor/evals/every-competitor-named/graders/schema.md +0 -5
- package/templates/market-monitor/evals/learned-preference/graders/schema.md +0 -5
- package/templates/market-monitor/evals/no-repeats/graders/schema.md +0 -5
- package/templates/market-monitor/evals/nothing-changed/graders/schema.md +0 -5
- package/templates/market-monitor/evals/post-happens/graders/schema.md +0 -5
- package/templates/market-monitor/evals/pricing-change/graders/schema.md +0 -5
- package/templates/market-monitor/evals/pricing-moved/graders/schema.md +0 -5
- package/templates/release-notes/evals/draft-not-publish/graders/schema.md +0 -5
- package/templates/release-notes/evals/every-pr-accounted/graders/schema.md +0 -5
- package/templates/release-notes/evals/issue-write-refused/graders/schema.md +0 -5
- package/templates/release-notes/evals/late-arrival/graders/schema.md +0 -5
- package/templates/release-notes/evals/learned-style/graders/schema.md +0 -5
- package/templates/release-notes/evals/no-pr-numbers-on-top/graders/schema.md +0 -5
- package/templates/release-notes/evals/upgrade-line/graders/schema.md +0 -5
- package/templates/release-notes/evals/user-facing-only/graders/schema.md +0 -5
|
@@ -8,25 +8,50 @@ import { KINDS } from "./journal-kinds.js";
|
|
|
8
8
|
export const REFLECT_PREFIX = "learn-reflect-";
|
|
9
9
|
/** The label a reader puts on the end-of-run turn's rows and messages: the server's (learning.ts LEARNING_LABEL). */
|
|
10
10
|
export const REFLECT_LABEL = "learning";
|
|
11
|
-
/** The end-of-run turn's request id, one per
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/** The end-of-run turn's request id, one per round of a run, and one per `step` of a round (a turn of its own after the
|
|
12
|
+
* look-back: the compile turn's attempts, `compile-<n>`): pi answers a repeat of it from its submission, so a turn
|
|
13
|
+
* asked again on a later claim is never asked of the model twice. A run's first end is round 1; an end after a
|
|
14
|
+
* follow-up opened the run again is the next round, whose turn is asked of the model anew under an id of its own. The
|
|
15
|
+
* server's own prefix, so the run's readers tell the turn's rows apart by it (reflectRanges). */
|
|
16
|
+
export const reflectRequestId = (runId, again = false, round = 1, step) => `${REFLECT_PREFIX}${runId}${round > 1 ? `${REFLECT_ROUND}${round}` : ""}${step !== undefined ? `:${step}` : again ? REFLECT_AGAIN : ""}`;
|
|
17
|
+
/** The suffix of the end-of-run turn's re-ask's request id (EndOfRunTurn ask's `again`): one per round too, so a repeat
|
|
16
18
|
* is answered from its submission, never asked of the model twice. */
|
|
17
19
|
export const REFLECT_AGAIN = ":again";
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
/** What names a later round in the end-of-run turn's request id, before its number. */
|
|
21
|
+
const REFLECT_ROUND = ":round-";
|
|
22
|
+
/** What a round's re-ask or step adds to its request id (reflectRequestId): the round is the id without it. */
|
|
23
|
+
const REFLECT_STEP = /:(?:again|compile-\d+)$/;
|
|
24
|
+
/** Each round of the end-of-run turn in a run's journal, oldest first: each begins at the entry its input placed, from the
|
|
25
|
+
* input submissions under its request ids (its re-ask's within it); else, on a CLI harness, at the turn's prompt the CLI
|
|
26
|
+
* record wrote as it asked it (`entries`: adapter-loop.ts answering, an end-of-run-turn entry of the person's with its
|
|
27
|
+
* request id, written before the turn's submission, which only its answer writes). Each ends at the first end entry
|
|
28
|
+
* after it (the run's end that round closed with); the newest may not have ended yet. None for a run that asked none.
|
|
29
|
+
* A follow-up's messages, between one round's end and the next round, are no round's. */
|
|
30
|
+
export function reflectRanges(submissions, entries = []) {
|
|
31
|
+
const starts = new Map();
|
|
32
|
+
const note = (requestId, entry) => {
|
|
33
|
+
if (!Number.isFinite(entry))
|
|
34
|
+
return;
|
|
35
|
+
const round = requestId.replace(REFLECT_STEP, "");
|
|
36
|
+
starts.set(round, Math.min(starts.get(round) ?? entry, entry));
|
|
37
|
+
};
|
|
38
|
+
for (const record of submissions) {
|
|
39
|
+
if (record.type === "input" && typeof record.requestId === "string" && record.requestId.startsWith(REFLECT_PREFIX) && record.entry !== undefined)
|
|
40
|
+
note(record.requestId, Number(record.entry));
|
|
41
|
+
}
|
|
42
|
+
for (const entry of entries) {
|
|
43
|
+
const data = entry.data;
|
|
44
|
+
if (entry.kind === KINDS.endOfRunTurn && data?.role === "person" && typeof data.requestId === "string" && data.requestId.startsWith(REFLECT_PREFIX))
|
|
45
|
+
note(data.requestId, Number(entry.id));
|
|
46
|
+
}
|
|
47
|
+
const ends = entries.filter((entry) => entry.kind === KINDS.end).map((entry) => Number(entry.id)).sort((a, b) => a - b);
|
|
48
|
+
return [...starts.values()].sort((a, b) => a - b).map((from) => {
|
|
49
|
+
const until = ends.find((end) => end >= from);
|
|
50
|
+
return until === undefined ? { from } : { from, until };
|
|
51
|
+
});
|
|
29
52
|
}
|
|
53
|
+
/** Whether entry `entry` (a number) is one of `ranges`' end-of-run turns. */
|
|
54
|
+
export const inReflect = (ranges, entry) => ranges.some(({ from, until }) => entry >= from && (until === undefined || entry <= until));
|
|
30
55
|
/** The refusal of the end-of-run turn's write or edit under work/.learning/: the tool gate's one text (NOTE_ONLY_TEXT), so
|
|
31
56
|
* the adapter loop's refusal and the gate's are the same words. */
|
|
32
57
|
export { NOTE_ONLY_TEXT as REFLECT_NOTE_ONLY } from "../tool-gate.js";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Grade } from "../learn/promote.js";
|
|
2
|
+
import type { RunPath } from "../learning-cost.js";
|
|
3
|
+
import { type Store } from "../store/store.js";
|
|
4
|
+
export declare const FEEDBACK_ROUNDS: readonly ["revise", "look_back"];
|
|
5
|
+
export type FeedbackRound = (typeof FEEDBACK_ROUNDS)[number];
|
|
6
|
+
/** The most characters a grade's words (`label`) may hold. */
|
|
7
|
+
export declare const LABEL_MAX = 4000;
|
|
8
|
+
/** A feedback round, as its steer's body carries it (`feedback`) and its FEEDBACK entry keeps it: the round, whether the
|
|
9
|
+
* grade said right, the workflow a revision is asked of, and the grade's words (`text`). */
|
|
10
|
+
export interface FeedbackData {
|
|
11
|
+
readonly round: FeedbackRound;
|
|
12
|
+
readonly correct: boolean;
|
|
13
|
+
readonly workflow?: string;
|
|
14
|
+
readonly text: string;
|
|
15
|
+
}
|
|
16
|
+
/** What a grade asks for: `revise` for a wrong grade of a run its learned workflow answered alone, `look_back` for a
|
|
17
|
+
* graded run the agent finished when the grade has words, else none (undefined). A replay run is never graded. */
|
|
18
|
+
export declare function feedbackRoundOf(grade: {
|
|
19
|
+
readonly correct: boolean;
|
|
20
|
+
readonly path: RunPath;
|
|
21
|
+
readonly workflow?: string;
|
|
22
|
+
}, label: string | undefined): FeedbackRound | undefined;
|
|
23
|
+
/** The grade's words as the round says them: its `label`, else, for a wrong grade, that it was wrong and the fields a
|
|
24
|
+
* right answer holds (`expected`). */
|
|
25
|
+
export declare function feedbackWords(correct: boolean, label: string | undefined, expected: Readonly<Record<string, unknown>> | undefined): string;
|
|
26
|
+
/** The feedback round a steer's body asks for (`body.feedback`, the server's own: server.ts gradeRun writes it, and the
|
|
27
|
+
* message API never does), else undefined. */
|
|
28
|
+
export declare function feedbackOf(body: unknown): FeedbackData | undefined;
|
|
29
|
+
/** The feedback round the run's root `entries` say its next end closes: its newest FEEDBACK entry when no end came after
|
|
30
|
+
* it, else undefined. */
|
|
31
|
+
export declare function pendingFeedbackOf(entries: readonly {
|
|
32
|
+
readonly kind: string;
|
|
33
|
+
readonly data?: unknown;
|
|
34
|
+
}[]): FeedbackData | undefined;
|
|
35
|
+
/** What the end-of-run turn of a feedback round is told before its prompt: for a run whose agent never took the job (its
|
|
36
|
+
* learned workflow answered alone, so its session saw nothing), the job and what the workflow answered first
|
|
37
|
+
* (`job`, `served`); then the grade and its words. The look-back keeps notes only: a revision's ask to give the workflow
|
|
38
|
+
* again changed is the compile turn's, after it (learning-end.ts compileAskOf reads the round, learn/compile.ts asks). */
|
|
39
|
+
export declare function feedbackAsk(feedback: FeedbackData, seen?: {
|
|
40
|
+
readonly job: string;
|
|
41
|
+
readonly served: {
|
|
42
|
+
readonly workflow: string;
|
|
43
|
+
readonly answer: string;
|
|
44
|
+
};
|
|
45
|
+
}): string;
|
|
46
|
+
/** Opens run `grade.run` again on the feedback round its grade asks for (feedbackRoundOf), with the grade's words
|
|
47
|
+
* (`label`, else feedbackWords'), and says which: only a run that learns (its launch's learning start, never one that
|
|
48
|
+
* only uses what was learned, nor a notes-only run's revision ask), neither archived nor of an archived agent (closed
|
|
49
|
+
* history: a grade of it starts no paid work), and one the store opens again (an agentic run that answered or that a
|
|
50
|
+
* person stopped). Null when the grade asks for nothing more, or the run can't be opened again (the grade is kept either
|
|
51
|
+
* way). */
|
|
52
|
+
export declare function openFeedbackRound(store: Pick<Store, "runs" | "agents">, grade: Grade, label: string | undefined): Promise<FeedbackRound | null>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { readLaunchBody } from "../run-launch.js";
|
|
2
|
+
import { RunFinal } from "../store/store.js";
|
|
3
|
+
import { KINDS } from "./journal-kinds.js";
|
|
4
|
+
import { servedAnswerText } from "./workflow-first.js";
|
|
5
|
+
export const FEEDBACK_ROUNDS = ["revise", "look_back"];
|
|
6
|
+
/** The most characters a grade's words (`label`) may hold. */
|
|
7
|
+
export const LABEL_MAX = 4000;
|
|
8
|
+
/** What a grade asks for: `revise` for a wrong grade of a run its learned workflow answered alone, `look_back` for a
|
|
9
|
+
* graded run the agent finished when the grade has words, else none (undefined). A replay run is never graded. */
|
|
10
|
+
export function feedbackRoundOf(grade, label) {
|
|
11
|
+
if (grade.path === "workflow")
|
|
12
|
+
return !grade.correct && grade.workflow ? "revise" : undefined;
|
|
13
|
+
if (grade.path === "agent" || grade.path === "handed_back")
|
|
14
|
+
return label ? "look_back" : undefined;
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
/** The grade's words as the round says them: its `label`, else, for a wrong grade, that it was wrong and the fields a
|
|
18
|
+
* right answer holds (`expected`). */
|
|
19
|
+
export function feedbackWords(correct, label, expected) {
|
|
20
|
+
if (label?.trim())
|
|
21
|
+
return label.trim();
|
|
22
|
+
if (correct)
|
|
23
|
+
return "A reviewer graded this run's answer right.";
|
|
24
|
+
return `A reviewer graded this run's answer wrong.${expected ? ` A right answer holds: ${JSON.stringify(expected)}` : ""}`;
|
|
25
|
+
}
|
|
26
|
+
/** The feedback round a steer's body asks for (`body.feedback`, the server's own: server.ts gradeRun writes it, and the
|
|
27
|
+
* message API never does), else undefined. */
|
|
28
|
+
export function feedbackOf(body) {
|
|
29
|
+
const fed = body?.feedback;
|
|
30
|
+
const text = body?.text;
|
|
31
|
+
if (!fed || typeof fed !== "object" || !FEEDBACK_ROUNDS.includes(fed.round) || typeof fed.correct !== "boolean" || typeof text !== "string")
|
|
32
|
+
return undefined;
|
|
33
|
+
return { round: fed.round, correct: fed.correct, ...(typeof fed.workflow === "string" ? { workflow: fed.workflow } : {}), text };
|
|
34
|
+
}
|
|
35
|
+
/** The feedback round the run's root `entries` say its next end closes: its newest FEEDBACK entry when no end came after
|
|
36
|
+
* it, else undefined. */
|
|
37
|
+
export function pendingFeedbackOf(entries) {
|
|
38
|
+
const at = entries.findLastIndex((entry) => entry.kind === KINDS.feedback);
|
|
39
|
+
if (at < 0 || entries.slice(at + 1).some((entry) => entry.kind === KINDS.end))
|
|
40
|
+
return undefined;
|
|
41
|
+
return feedbackOf({ feedback: entries[at].data, text: entries[at].data?.text });
|
|
42
|
+
}
|
|
43
|
+
/** What the end-of-run turn of a feedback round is told before its prompt: for a run whose agent never took the job (its
|
|
44
|
+
* learned workflow answered alone, so its session saw nothing), the job and what the workflow answered first
|
|
45
|
+
* (`job`, `served`); then the grade and its words. The look-back keeps notes only: a revision's ask to give the workflow
|
|
46
|
+
* again changed is the compile turn's, after it (learning-end.ts compileAskOf reads the round, learn/compile.ts asks). */
|
|
47
|
+
export function feedbackAsk(feedback, seen) {
|
|
48
|
+
const graded = `A reviewer graded ${seen ? "that" : "this run's"} answer ${feedback.correct ? "right" : "wrong"}. What they said:`;
|
|
49
|
+
return [...(seen ? [seen.job, servedAnswerText(seen.served.workflow, seen.served.answer)] : []), graded, "", feedback.text].join("\n\n").replace(/\n{3,}/g, "\n\n");
|
|
50
|
+
}
|
|
51
|
+
/** Opens run `grade.run` again on the feedback round its grade asks for (feedbackRoundOf), with the grade's words
|
|
52
|
+
* (`label`, else feedbackWords'), and says which: only a run that learns (its launch's learning start, never one that
|
|
53
|
+
* only uses what was learned, nor a notes-only run's revision ask), neither archived nor of an archived agent (closed
|
|
54
|
+
* history: a grade of it starts no paid work), and one the store opens again (an agentic run that answered or that a
|
|
55
|
+
* person stopped). Null when the grade asks for nothing more, or the run can't be opened again (the grade is kept either
|
|
56
|
+
* way). */
|
|
57
|
+
export async function openFeedbackRound(store, grade, label) {
|
|
58
|
+
const words = label?.trim() ? label.trim() : undefined;
|
|
59
|
+
const round = feedbackRoundOf(grade, words);
|
|
60
|
+
if (!round)
|
|
61
|
+
return null;
|
|
62
|
+
const run = await store.runs.get(grade.run);
|
|
63
|
+
if (!run || run.archivedAt !== null || (await store.agents.get(run.agentId))?.archivedAt !== null)
|
|
64
|
+
return null;
|
|
65
|
+
const launched = await store.runs.launch(grade.run).catch(() => undefined);
|
|
66
|
+
const learning = launched ? readLaunchBody(launched.body)?.learning : undefined;
|
|
67
|
+
if (!learning || learning.use || (round === "revise" && learning.notesOnly))
|
|
68
|
+
return null;
|
|
69
|
+
const feedback = { round, correct: grade.correct, ...(round === "revise" && grade.workflow ? { workflow: grade.workflow } : {}) };
|
|
70
|
+
try {
|
|
71
|
+
await store.runs.reopen(grade.run, { kind: "steer", body: { text: feedbackWords(grade.correct, words, grade.expected), feedback } });
|
|
72
|
+
return round;
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
if (error instanceof RunFinal)
|
|
76
|
+
return null;
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -13,9 +13,10 @@ export type GithubAppAccessAt = GithubAppAccess & {
|
|
|
13
13
|
* joins the run's redactor (its `cut`), the first and every one after. */
|
|
14
14
|
export declare function githubAppAccess(store: {
|
|
15
15
|
readonly triggerSettings: Pick<TriggerSettings, "get">;
|
|
16
|
-
}, sealKey: Buffer | undefined, firstInput: unknown, { api, now, fromGitHub, hold }?: {
|
|
16
|
+
}, sealKey: Buffer | undefined, firstInput: unknown, { api, now, fromGitHub, hold, repo }?: {
|
|
17
17
|
api?: string;
|
|
18
18
|
now?: () => number;
|
|
19
19
|
fromGitHub?: boolean;
|
|
20
20
|
hold?: (values: string[]) => void;
|
|
21
|
+
repo?: string;
|
|
21
22
|
}): Promise<GithubAppAccessAt | undefined>;
|
|
@@ -36,13 +36,15 @@ async function appOf(store, sealKey) {
|
|
|
36
36
|
* `fromGitHub`: the run's first input is a github trigger's firing (its launch's inputOrigin), whose payload tag names
|
|
37
37
|
* the repository and installation; any other run's tag is never read, only its owner's words. `hold`: each token minted
|
|
38
38
|
* joins the run's redactor (its `cut`), the first and every one after. */
|
|
39
|
-
export async function githubAppAccess(store, sealKey, firstInput, { api = GITHUB_API, now = Date.now, fromGitHub = false, hold } = {}) {
|
|
39
|
+
export async function githubAppAccess(store, sealKey, firstInput, { api = GITHUB_API, now = Date.now, fromGitHub = false, hold, repo } = {}) {
|
|
40
40
|
if (!sealKey)
|
|
41
41
|
return undefined;
|
|
42
42
|
const app = await appOf(store, sealKey);
|
|
43
43
|
if (!app)
|
|
44
44
|
return undefined;
|
|
45
|
-
|
|
45
|
+
// `repo`: the launch's (run-launch.ts repo), which the server checked against the agent's binding at the start: a run a
|
|
46
|
+
// person started with `repo`, or whose agent is bound to one repository. It comes before any URL in the words.
|
|
47
|
+
const target = repo !== undefined ? { repo } : githubTargetOf(isObject(firstInput) ? firstInput.content : firstInput, { payload: fromGitHub });
|
|
46
48
|
return {
|
|
47
49
|
api,
|
|
48
50
|
target,
|
|
@@ -11,7 +11,10 @@ import { hostMemory, neverFits } from "../host.js";
|
|
|
11
11
|
import { resolveHarness } from "./adapters/index.js";
|
|
12
12
|
import { adapterRunSpecFromLaunch, PI_WIRES } from "./adapter-run-spec.js";
|
|
13
13
|
import { createAdapterLoop } from "./adapter-loop.js";
|
|
14
|
-
import { savedModelKeys, withModelKeys } from "./claim-secrets.js";
|
|
14
|
+
import { hostDecisionKeys, savedModelKeys, withModelKeys } from "./claim-secrets.js";
|
|
15
|
+
import { decisionProvidersIn, DEFAULT_DECISION_PROVIDER, FAUX_JEV_ENV } from "../decisions.js";
|
|
16
|
+
import { FAUX_ENV } from "../model.js";
|
|
17
|
+
import { generalThresholdOf } from "../learn/general.js";
|
|
15
18
|
import { createDispatchLoop } from "./dispatch.js";
|
|
16
19
|
import { cliRunSpecFromLaunch } from "./cli-run-spec.js";
|
|
17
20
|
import { gradeModelFor, gradeRouteOf, learningLoopOf } from "./learning-dispatch.js";
|
|
@@ -58,6 +61,17 @@ export function resolveRunnerLoop(deps) {
|
|
|
58
61
|
},
|
|
59
62
|
...(deps.log ? { log: deps.log } : {}),
|
|
60
63
|
...(deps.gradeBound ? { gradeBound: deps.gradeBound } : {}),
|
|
64
|
+
// The generality pre-check (learn/general.ts) on this host's Jev, built as a learning end builds its check's
|
|
65
|
+
// decision providers (hostDecisionKeys: the runner's environment first, then the key saved in Settings), on the
|
|
66
|
+
// client and model a workflow's decision node gets when it names none. No Jev key: none asked. A faux host asks only
|
|
67
|
+
// its faux Jev (FAUX_JEV_ENV), as its grade goes only to the faux route: a key it inherited never sends a note out.
|
|
68
|
+
jev: async () => {
|
|
69
|
+
const env = deps.env ?? process.env;
|
|
70
|
+
if (env[FAUX_ENV] && !env[FAUX_JEV_ENV])
|
|
71
|
+
return undefined;
|
|
72
|
+
return (await decisionProvidersIn({ ...env, ...(await hostDecisionKeys({ store: deps.store, sealKey: deps.sealKey, env: deps.env }, [DEFAULT_DECISION_PROVIDER])) }))?.providers[DEFAULT_DECISION_PROVIDER];
|
|
73
|
+
},
|
|
74
|
+
generalThreshold: generalThresholdOf(deps.env ?? process.env),
|
|
61
75
|
});
|
|
62
76
|
}
|
|
63
77
|
// The harness's own entry decides which spec builds the run, by the entry's facts and never the harness's name: an entry
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type HeldRead, type HeldState } from "../computer-held.js";
|
|
2
|
+
import type { LoopComputer } from "./computer-channel.js";
|
|
3
|
+
import type { RootEntry } from "./computer-journal.js";
|
|
4
|
+
import type { Command } from "./loop-contract.js";
|
|
5
|
+
/** A run's held computer, as its spec gives it: the hold's minutes (its computer is the spec's `computer`). */
|
|
6
|
+
export type HeldSpec = {
|
|
7
|
+
readonly minutes: number;
|
|
8
|
+
};
|
|
9
|
+
/** What came of an owner's row: refused in words, or the change to commit (the commit takes the row). */
|
|
10
|
+
export type HeldDecision = {
|
|
11
|
+
readonly refused: string;
|
|
12
|
+
} | {
|
|
13
|
+
readonly write: () => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
/** How the hold's wait ended: its state moved on (started, or released by the owner or its lapse), or `cut` settled first. */
|
|
16
|
+
export type HeldWait = "moved" | "cut";
|
|
17
|
+
/** The journal's side of a run's held computer, for the pass whose Harness `commit` writes root entries (in one commit, in
|
|
18
|
+
* order). `now` is the clock its entries are stamped with. */
|
|
19
|
+
export declare function journalHeld(spec: HeldSpec, commit: (entries: readonly RootEntry[]) => Promise<void>, now?: () => number): {
|
|
20
|
+
/** The run's computer is up for this pass. `prior`, the run's root entries before it. A run's first pass writes the
|
|
21
|
+
* hold waiting. Every pass starts its own computer (the last pass's went at its close: a new claim, or a restart after
|
|
22
|
+
* a fault within one), so a pass that finds a hold not over finds it gone with the computer that held it, and what
|
|
23
|
+
* the owner set up on it: released, `lost` (the loop ends the run in those words). */
|
|
24
|
+
up(prior: readonly {
|
|
25
|
+
readonly kind: string;
|
|
26
|
+
readonly data?: unknown;
|
|
27
|
+
}[]): Promise<"held" | "lost" | "released">;
|
|
28
|
+
/** Where the hold is now. */
|
|
29
|
+
state: () => HeldState | undefined;
|
|
30
|
+
/** Why the hold ended without a release, if it did. */
|
|
31
|
+
lapse: () => HeldRead["why"];
|
|
32
|
+
/** Before the agent's first input: waits for the owner's start, a release, the hold's lapse, or `cut`. */
|
|
33
|
+
untilStarted: (cut: Promise<unknown>) => Promise<HeldWait>;
|
|
34
|
+
/** The agent's end (or a person's stop of it): the run keeps its computer (the hold ended, the Timeline saying so in
|
|
35
|
+
* `words`) until the owner releases it, the hold lapses, or `cut` settles first (a lost claim, a cancel). A hold
|
|
36
|
+
* already released waits for nothing. */
|
|
37
|
+
heldAtEnd(cut: Promise<unknown>, words?: string): Promise<HeldWait>;
|
|
38
|
+
/** The hold's minutes. */
|
|
39
|
+
minutes: number;
|
|
40
|
+
/** Why an owner's call is refused now: the hold is over (released, lapsed or lost). Undefined while the computer is
|
|
41
|
+
* held: waiting, started or ended. */
|
|
42
|
+
refusesCall(): string | undefined;
|
|
43
|
+
/** An owner's call starts: the hold cannot lapse until every call in flight has ended. */
|
|
44
|
+
callStarted(): void;
|
|
45
|
+
/** An owner's call ended at `at`: the hold's count starts again from it once the last call in flight is done. */
|
|
46
|
+
callEnded(at: number): void;
|
|
47
|
+
/** The hold's count starts again from `at`. */
|
|
48
|
+
touched(at: number): void;
|
|
49
|
+
/** An owner's row: a start or a release. */
|
|
50
|
+
decide(command: Command): HeldDecision;
|
|
51
|
+
/** Whether `data`, a hold or call entry's, is the change row `id` made: the commit that writes it takes the row. */
|
|
52
|
+
madeBy: (data: Record<string, unknown>, id: number) => boolean;
|
|
53
|
+
/** Every commit asked for so far is done. */
|
|
54
|
+
settled: () => Promise<void>;
|
|
55
|
+
};
|
|
56
|
+
export type JournalHeld = ReturnType<typeof journalHeld>;
|
|
57
|
+
/** The spec's `held` for a run whose launch holds its computer (run-launch.ts hold), given the loop's computer: none for a
|
|
58
|
+
* run that holds none, or whose computer speaks no protocol (none, or a browser). */
|
|
59
|
+
export declare function heldSpecOf(launch: {
|
|
60
|
+
readonly hold?: {
|
|
61
|
+
readonly minutes: number;
|
|
62
|
+
};
|
|
63
|
+
}, computer: LoopComputer | undefined): HeldSpec | undefined;
|
|
64
|
+
/** Whether a command row is the owner's, for a held computer. */
|
|
65
|
+
export declare const isHeldCommand: (command: Pick<Command, "kind">) => boolean;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// A held computer on the runner (computer-held.ts has the contract): the run's computer waits for its owner before the
|
|
2
|
+
// agent's first input and after the agent's end, and the owner's start and release rows are applied here. Every change is
|
|
3
|
+
// committed to the run's journal; the commit that writes it takes its row. The owner's calls go through the computer call
|
|
4
|
+
// channel (computer-channel.ts) as any run's do; each one starts the hold's count again (touched).
|
|
5
|
+
//
|
|
6
|
+
// The adapter loop makes one per pass, for a spec that carries `held`, once the run's Harness is open (as it does the
|
|
7
|
+
// take-over's journalHold), and reads the hold's state from the journal, so a restart within the claim goes on where the
|
|
8
|
+
// last pass left it. A new claim has a new computer: a hold an earlier claim left open is gone with that claim's computer.
|
|
9
|
+
import { HOST_PHASE } from "../timeline/index.js";
|
|
10
|
+
import { COMPUTER_RELEASE, COMPUTER_START, HELD_COMMANDS, HELD_KIND, heldIn, heldWords } from "../computer-held.js";
|
|
11
|
+
/** The journal's side of a run's held computer, for the pass whose Harness `commit` writes root entries (in one commit, in
|
|
12
|
+
* order). `now` is the clock its entries are stamped with. */
|
|
13
|
+
export function journalHeld(spec, commit, now = Date.now) {
|
|
14
|
+
const ms = spec.minutes * 60_000;
|
|
15
|
+
let read;
|
|
16
|
+
/** The owner's calls in flight: the hold's idle count cannot lapse while any is. */
|
|
17
|
+
let calls = 0;
|
|
18
|
+
let queue = Promise.resolve();
|
|
19
|
+
let wake = () => { };
|
|
20
|
+
let changed = new Promise((resolve) => (wake = resolve));
|
|
21
|
+
const poke = () => {
|
|
22
|
+
const was = wake;
|
|
23
|
+
changed = new Promise((resolve) => (wake = resolve));
|
|
24
|
+
was();
|
|
25
|
+
};
|
|
26
|
+
const write = (entries) => {
|
|
27
|
+
const next = queue.then(() => commit(entries));
|
|
28
|
+
queue = next.catch(() => undefined);
|
|
29
|
+
return next;
|
|
30
|
+
};
|
|
31
|
+
const phase = (summary, at) => ({ kind: HOST_PHASE, data: { summary, at } });
|
|
32
|
+
/** Why a row finds the hold over, in words. */
|
|
33
|
+
const released = () => (read?.why === "timeout" ? `The run's computer was let go: no call came for ${spec.minutes} minutes.` : read?.why === "lost" ? heldWords.lost : "The run's computer was already released.");
|
|
34
|
+
/** The hold moves to `state` now: read here at once, committed in order. */
|
|
35
|
+
const move = (state, extra, words) => {
|
|
36
|
+
const at = now();
|
|
37
|
+
read = { state, minutes: spec.minutes, until: at + ms, ...(extra.why ? { why: extra.why } : {}) };
|
|
38
|
+
poke();
|
|
39
|
+
return write([{ kind: HELD_KIND, data: { state, at, minutes: spec.minutes, ...extra } }, ...(words ? [phase(words, at)] : [])]);
|
|
40
|
+
};
|
|
41
|
+
/** Waits while the hold is in one of `states`: until a row moves it, its lapse releases it, or `cut` settles. */
|
|
42
|
+
const waitWhile = async (states, cut) => {
|
|
43
|
+
let isCut = false;
|
|
44
|
+
const cutDone = () => {
|
|
45
|
+
isCut = true;
|
|
46
|
+
poke();
|
|
47
|
+
};
|
|
48
|
+
cut.then(cutDone, cutDone);
|
|
49
|
+
while (read && states.includes(read.state)) {
|
|
50
|
+
if (isCut)
|
|
51
|
+
return "cut";
|
|
52
|
+
const left = read.until - now();
|
|
53
|
+
// An owner's call in flight keeps the hold: its count starts again when the last one ends (callEnded pokes this wait).
|
|
54
|
+
if (calls > 0) {
|
|
55
|
+
await changed;
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (left <= 0) {
|
|
59
|
+
// A row the journal refuses (a lost claim's fence) is the cut's to answer, not this wait's.
|
|
60
|
+
await move("released", { why: "timeout" }, heldWords.timeout(spec.minutes)).catch(() => undefined);
|
|
61
|
+
return "moved";
|
|
62
|
+
}
|
|
63
|
+
let timer;
|
|
64
|
+
await Promise.race([changed, new Promise((resolve) => (timer = setTimeout(resolve, left)))]);
|
|
65
|
+
clearTimeout(timer);
|
|
66
|
+
}
|
|
67
|
+
return isCut ? "cut" : "moved";
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
/** The run's computer is up for this pass. `prior`, the run's root entries before it. A run's first pass writes the
|
|
71
|
+
* hold waiting. Every pass starts its own computer (the last pass's went at its close: a new claim, or a restart after
|
|
72
|
+
* a fault within one), so a pass that finds a hold not over finds it gone with the computer that held it, and what
|
|
73
|
+
* the owner set up on it: released, `lost` (the loop ends the run in those words). */
|
|
74
|
+
async up(prior) {
|
|
75
|
+
const before = heldIn(prior.map((entry) => ({ kind: entry.kind, data: entry.data })));
|
|
76
|
+
if (before === undefined) {
|
|
77
|
+
await move("waiting", {}, heldWords.waiting(spec.minutes));
|
|
78
|
+
return "held";
|
|
79
|
+
}
|
|
80
|
+
read = before;
|
|
81
|
+
if (before.state === "released")
|
|
82
|
+
return "released";
|
|
83
|
+
await move("released", { why: "lost" }, heldWords.lost);
|
|
84
|
+
return "lost";
|
|
85
|
+
},
|
|
86
|
+
/** Where the hold is now. */
|
|
87
|
+
state: () => read?.state,
|
|
88
|
+
/** Why the hold ended without a release, if it did. */
|
|
89
|
+
lapse: () => read?.why,
|
|
90
|
+
/** Before the agent's first input: waits for the owner's start, a release, the hold's lapse, or `cut`. */
|
|
91
|
+
untilStarted: (cut) => waitWhile(["waiting"], cut),
|
|
92
|
+
/** The agent's end (or a person's stop of it): the run keeps its computer (the hold ended, the Timeline saying so in
|
|
93
|
+
* `words`) until the owner releases it, the hold lapses, or `cut` settles first (a lost claim, a cancel). A hold
|
|
94
|
+
* already released waits for nothing. */
|
|
95
|
+
async heldAtEnd(cut, words = heldWords.ended(spec.minutes)) {
|
|
96
|
+
if (read?.state === "released")
|
|
97
|
+
return "moved";
|
|
98
|
+
if (read?.state !== "ended")
|
|
99
|
+
await move("ended", {}, words).catch(() => undefined);
|
|
100
|
+
return waitWhile(["ended"], cut);
|
|
101
|
+
},
|
|
102
|
+
/** The hold's minutes. */
|
|
103
|
+
minutes: spec.minutes,
|
|
104
|
+
/** Why an owner's call is refused now: the hold is over (released, lapsed or lost). Undefined while the computer is
|
|
105
|
+
* held: waiting, started or ended. */
|
|
106
|
+
refusesCall() {
|
|
107
|
+
if (read?.state !== "released")
|
|
108
|
+
return undefined;
|
|
109
|
+
return released();
|
|
110
|
+
},
|
|
111
|
+
/** An owner's call starts: the hold cannot lapse until every call in flight has ended. */
|
|
112
|
+
callStarted() {
|
|
113
|
+
calls += 1;
|
|
114
|
+
this.touched(now());
|
|
115
|
+
},
|
|
116
|
+
/** An owner's call ended at `at`: the hold's count starts again from it once the last call in flight is done. */
|
|
117
|
+
callEnded(at) {
|
|
118
|
+
calls = Math.max(0, calls - 1);
|
|
119
|
+
this.touched(at);
|
|
120
|
+
},
|
|
121
|
+
/** The hold's count starts again from `at`. */
|
|
122
|
+
touched(at) {
|
|
123
|
+
if (!read || read.state === "released")
|
|
124
|
+
return;
|
|
125
|
+
read = { ...read, until: Math.max(read.until, at + ms) };
|
|
126
|
+
poke();
|
|
127
|
+
},
|
|
128
|
+
/** An owner's row: a start or a release. */
|
|
129
|
+
decide(command) {
|
|
130
|
+
const state = read?.state;
|
|
131
|
+
if (state === undefined)
|
|
132
|
+
return { refused: "The run's computer is not up yet." };
|
|
133
|
+
if (state === "released")
|
|
134
|
+
return { refused: released() };
|
|
135
|
+
if (command.kind === COMPUTER_START) {
|
|
136
|
+
if (state !== "waiting")
|
|
137
|
+
return { refused: "The run's agent has already started." };
|
|
138
|
+
return { write: () => move("started", { by: command.id }, heldWords.started) };
|
|
139
|
+
}
|
|
140
|
+
if (command.kind === COMPUTER_RELEASE)
|
|
141
|
+
return { write: () => move("released", { by: command.id }, heldWords.released) };
|
|
142
|
+
return { refused: `a held computer takes no ${command.kind} row` };
|
|
143
|
+
},
|
|
144
|
+
/** Whether `data`, a hold or call entry's, is the change row `id` made: the commit that writes it takes the row. */
|
|
145
|
+
madeBy: (data, id) => data.by === id,
|
|
146
|
+
/** Every commit asked for so far is done. */
|
|
147
|
+
settled: () => queue,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/** The spec's `held` for a run whose launch holds its computer (run-launch.ts hold), given the loop's computer: none for a
|
|
151
|
+
* run that holds none, or whose computer speaks no protocol (none, or a browser). */
|
|
152
|
+
export function heldSpecOf(launch, computer) {
|
|
153
|
+
if (!launch.hold || !computer)
|
|
154
|
+
return undefined;
|
|
155
|
+
return { minutes: launch.hold.minutes };
|
|
156
|
+
}
|
|
157
|
+
/** Whether a command row is the owner's, for a held computer. */
|
|
158
|
+
export const isHeldCommand = (command) => HELD_COMMANDS.has(command.kind);
|
|
@@ -25,6 +25,13 @@ export declare const KINDS: {
|
|
|
25
25
|
* the Timeline's attribution (the timeline reads a host's user entry's own origin). The model
|
|
26
26
|
* reads it as any message. */
|
|
27
27
|
readonly input: "agentrun.input";
|
|
28
|
+
/** A CLI run's turn opens: written in the same commit as the message that starts it (the person's, a trigger's or a
|
|
29
|
+
* follow-up's), so the run reads as working from that commit on, as pi's open input does. Data only: the reader passes
|
|
30
|
+
* over it, and turns.ts reads it. */
|
|
31
|
+
readonly turnStart: "agentrun.turn.start";
|
|
32
|
+
/** A CLI run's turn is over (`TurnRecordData`): written once its last model text is on the record, before the run's end
|
|
33
|
+
* or the next turn. It closes the newest turn still open. Data only, as the start is. */
|
|
34
|
+
readonly turnEnd: "agentrun.turn.end";
|
|
28
35
|
/** A tool call the gate asked a person about: the run parks on it. */
|
|
29
36
|
readonly ask: "agentrun.ask";
|
|
30
37
|
/** The person's answer to an ask, written by the commit that takes the approve or deny row. */
|
|
@@ -53,6 +60,11 @@ export declare const KINDS: {
|
|
|
53
60
|
* (adapter-loop.ts pauseFor), and a claim lost before that restores it from here (pendingPauseOf). No run patch, and
|
|
54
61
|
* neither a call nor a message, so the reader passes over it. */
|
|
55
62
|
readonly pausePending: "agentrun.pause.pending";
|
|
63
|
+
/** On the run's model session (resume log, never read as a call or a message): the session's recent requests as the
|
|
64
|
+
* cap's expected pricing reads them (the kernel's RecentRequest list, recentAfter), written each time one answers.
|
|
65
|
+
* A later claim or pass starts from the newest record, so its first request reads the cache a recent answer left warm
|
|
66
|
+
* when it ended under CACHE_WARM_MS ago by the cap's clock, and uncached after that (adapter-loop.ts recentIn). */
|
|
67
|
+
readonly capRecent: "agentrun.cap.recent";
|
|
56
68
|
/** A workflow call node's effect, as it starts and as it ends (pause.ts NodeLine: its path, item, tool, label, input,
|
|
57
69
|
* then its status and output or error), on the run's node-log session (NODE_LOG_SESSION): the run's graph lists its
|
|
58
70
|
* effects from these. Written as the effect runs, never for one the driver answers from its receipt. */
|
|
@@ -62,15 +74,32 @@ export declare const KINDS: {
|
|
|
62
74
|
* same submission pi's adapter writes, so the step reads both alike. Neither a call nor a message: the reader passes
|
|
63
75
|
* over it, and the turn is never on the run's visible record. */
|
|
64
76
|
readonly endOfRunTurn: "agentrun.end-of-run.turn";
|
|
77
|
+
/** What an end-of-run turn kept as it was first asked (its `keep`, by its `requestId`), for a harness that keeps its own
|
|
78
|
+
* record (pi; a CLI's record keeps it on its endOfRunTurn prompt): written once, before the turn's first request, so a
|
|
79
|
+
* later claim that asks the same turn again reads the first ask's (the commit of main a compile turn was asked at among
|
|
80
|
+
* them), never its own. Neither a call nor a message: the reader passes over it. */
|
|
81
|
+
readonly endOfRunKept: "agentrun.end-of-run.kept";
|
|
65
82
|
/** What a learning run's claim laid of its seed: the learned skills it was given (`skills`, by name) and the learned
|
|
66
83
|
* workflows its learned_workflow tool runs (`workflows`, by name). Written once per claim, on the root; the newest is
|
|
67
84
|
* what the run was given. Neither a call nor a message. */
|
|
68
85
|
readonly learningLaid: "agentrun.learning.laid";
|
|
86
|
+
/** A grade's feedback round (runner/feedback-round.ts): the run opened again on a grade's words, asked no turn of the
|
|
87
|
+
* job's; its next end's end-of-run turn reads them (`text`, the `round`, whether the grade said right, the workflow a
|
|
88
|
+
* revision is asked of). Written on the root by the commit that takes the round's steer row. Neither a call nor a
|
|
89
|
+
* message: pi never reads it, and the Timeline shows its words as the reviewer's. */
|
|
90
|
+
readonly feedback: "agentrun.feedback";
|
|
69
91
|
/** A workflow run's model node's execution, as the runner kept it before running it (workflow-spec.ts onModelNode):
|
|
70
92
|
* `{ path, tier?, model }`, its execution path, the tier it asked for (absent for none) and the model id the run's route
|
|
71
93
|
* sent it to. On the node log (NODE_LOG_SESSION), for GET /runs/{id}/graph's nodes' `model` (graph-view.ts). Neither a
|
|
72
94
|
* call nor a message. */
|
|
73
95
|
readonly nodeModel: "agentrun.node.model";
|
|
96
|
+
/** A learning run's generality pre-check (learn/general.ts), its Jev requests about to leave: committed and made
|
|
97
|
+
* durable before they do, as a grade request's record is (learning-ask.ts bookedAsk), so a restart that finds one with
|
|
98
|
+
* no answer after it books what they spent as unknown (null) before it asks again. Paid, and Jev dedupes none. */
|
|
99
|
+
readonly learningGeneralSent: "agentrun.learning.general.sent";
|
|
100
|
+
/** That check's end, kept before the grader starts: its scores, or why it could not run (`unchecked`), and what it spent.
|
|
101
|
+
* A restart reuses it and never asks Jev again. */
|
|
102
|
+
readonly learningGeneral: "agentrun.learning.general";
|
|
74
103
|
/** A learning run's grade: the verdict and what it spent, written before its merge (a resumed run never asks again). */
|
|
75
104
|
readonly learningGraded: "agentrun.learning.graded";
|
|
76
105
|
/** A learning run's merge: the new main and its commit, with the run's end. */
|
|
@@ -159,12 +188,13 @@ export interface CallStartData {
|
|
|
159
188
|
readonly input: unknown;
|
|
160
189
|
/** May run again after a crash (it changes nothing outside the run): the tool registry's own flag. */
|
|
161
190
|
readonly replaySafe: boolean;
|
|
162
|
-
/** Written as
|
|
163
|
-
*
|
|
191
|
+
/** Written as its CLI's tool bridge's gate asked about it (adapter-loop.ts bridgeGate), before any answer: nothing is sent
|
|
192
|
+
* until its agentrun.call.sent mark (KINDS.callSent). The bridge holds the call and hands the CLI nothing while it waits,
|
|
193
|
+
* so no waiting result shows for it, as on pi. */
|
|
164
194
|
readonly parked?: true;
|
|
165
|
-
/**
|
|
166
|
-
*
|
|
167
|
-
readonly
|
|
195
|
+
/** A tool that only nests calls (tools_call, codemode; HostTool.nests): its calls start after it, each its own, and it
|
|
196
|
+
* runs again whole after a crash, so a start a crash left open is never ended interrupted (adapter-loop.ts). */
|
|
197
|
+
readonly nests?: true;
|
|
168
198
|
/** The harness's working directory (a CLI's), which an absolute path in `input` is built from: the run's rows name a
|
|
169
199
|
* path under it by its name in the workspace (store-reads/journal.ts runTimeline). */
|
|
170
200
|
readonly cwd?: string;
|
|
@@ -190,6 +220,11 @@ export declare function endedAnswer(tool: string, end: {
|
|
|
190
220
|
isError: boolean;
|
|
191
221
|
};
|
|
192
222
|
export type MessageRole = "person" | "steer" | "model";
|
|
223
|
+
/** What a CLI turn's end (KINDS.turnEnd) says: how the adapter ended it, and its error when it failed with one. */
|
|
224
|
+
export interface TurnRecordData {
|
|
225
|
+
readonly status: "completed" | "failed" | "interrupted";
|
|
226
|
+
readonly error?: string;
|
|
227
|
+
}
|
|
193
228
|
export interface MessageData {
|
|
194
229
|
readonly role: MessageRole;
|
|
195
230
|
readonly text: string;
|
|
@@ -213,8 +248,10 @@ export interface AskData {
|
|
|
213
248
|
readonly args?: unknown;
|
|
214
249
|
/** When it was asked (ISO), from the loop's clock; a re-ask on a resume keeps the first. */
|
|
215
250
|
readonly requestedAt?: string;
|
|
216
|
-
/** Its approval price (the spec's
|
|
251
|
+
/** Its approval price (a catalog tool's, the spec's mcp priceOf); null when it has none. */
|
|
217
252
|
readonly price?: ApprovalPrice | null;
|
|
253
|
+
/** An MCP tool its run's pin marks destructive (tool-gate.ts toolEffect): an allow of it needs confirm_destructive. */
|
|
254
|
+
readonly destructive?: true;
|
|
218
255
|
}
|
|
219
256
|
/** How an ask was answered: approved, denied, withdrawn (a stop while the call waited) or canceled (a cancel). */
|
|
220
257
|
export type AnswerDecision = "allow" | "deny" | "withdrawn" | "canceled";
|
|
@@ -230,7 +267,7 @@ export interface AnswerData {
|
|
|
230
267
|
readonly note?: string;
|
|
231
268
|
/** "message": a deny a person's message gave while the call waited (the message route's deny row), which its approval
|
|
232
269
|
* row reads as "Declined by your message". Absent for an answer given directly. */
|
|
233
|
-
readonly by?: "message";
|
|
270
|
+
readonly by?: "message" | "setting";
|
|
234
271
|
/** The allow a stop overrode (main's ApprovalAnswer.superseded): the call was approved but had not finished when its
|
|
235
272
|
* run was stopped, so the stop withdrew it. Kept as it was given. */
|
|
236
273
|
readonly superseded?: {
|