@parcha/agentrun-serve 0.1.0-beta.35 → 0.1.0-beta.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +298 -0
- package/README.md +417 -219
- package/dist/adapters.d.ts +12 -2
- package/dist/adapters.js +27 -2
- package/dist/agent-rows.d.ts +2 -1
- package/dist/agents-store.d.ts +2 -0
- package/dist/agents-store.js +9 -4
- package/dist/api-only.d.ts +2 -1
- package/dist/api-only.js +3 -1
- package/dist/archil-routes.d.ts +40 -7
- package/dist/archil-routes.js +167 -54
- package/dist/archil-settings.d.ts +79 -7
- package/dist/archil-settings.js +140 -14
- package/dist/attach-conformance-cli.d.ts +1 -0
- package/dist/attach-conformance-cli.js +18 -0
- package/dist/attach-conformance.d.ts +25 -0
- package/dist/attach-conformance.js +343 -0
- package/dist/attach-images.d.ts +15 -0
- package/dist/attach-images.js +59 -0
- package/dist/background.d.ts +0 -6
- package/dist/background.js +0 -28
- package/dist/box-image.d.ts +1 -97
- package/dist/box-image.js +4 -284
- package/dist/box-paths.d.ts +2 -7
- package/dist/box-paths.js +7 -13
- package/dist/box-settings.d.ts +0 -11
- package/dist/box-settings.js +4 -29
- package/dist/browser-commands.js +1 -1
- package/dist/browser-computer.d.ts +47 -3
- package/dist/browser-computer.js +286 -18
- package/dist/browser-cost.d.ts +1 -1
- package/dist/browser-live.d.ts +20 -8
- package/dist/browser-live.js +50 -27
- package/dist/browser-person.d.ts +19 -2
- package/dist/browser-person.js +55 -6
- package/dist/browser-wait-ended.d.ts +23 -0
- package/dist/browser-wait-ended.js +42 -0
- package/dist/cap.d.ts +12 -57
- package/dist/cap.js +20 -160
- package/dist/catalog.d.ts +1 -12
- package/dist/catalog.js +3 -33
- package/dist/cli.js +17 -26
- package/dist/composio-preset.d.ts +36 -0
- package/dist/composio-preset.js +179 -0
- package/dist/computer-attach.d.ts +125 -0
- package/dist/computer-attach.js +330 -0
- package/dist/computer-calls.d.ts +48 -0
- package/dist/computer-calls.js +126 -0
- package/dist/computer-channel.d.ts +57 -0
- package/dist/computer-channel.js +115 -0
- package/dist/computer-commands.d.ts +1 -1
- package/dist/computer-held-routes.d.ts +35 -0
- package/dist/computer-held-routes.js +106 -0
- package/dist/computer-held.d.ts +48 -0
- package/dist/computer-held.js +87 -0
- package/dist/computer-keys.d.ts +21 -1
- package/dist/computer-keys.js +53 -11
- package/dist/computer-live.d.ts +160 -0
- package/dist/computer-live.js +643 -0
- package/dist/computer-routes.d.ts +1 -4
- package/dist/computer-routes.js +3 -5
- package/dist/computer-setting.d.ts +2 -0
- package/dist/computer-setting.js +38 -1
- package/dist/computer-view.d.ts +24 -2
- package/dist/computer-view.js +51 -3
- package/dist/computer-viewer.d.ts +6 -0
- package/dist/computer-viewer.js +297 -0
- package/dist/computers.d.ts +79 -12
- package/dist/computers.js +147 -28
- package/dist/console/assets/index-Cn6JX1uH.js +563 -0
- package/dist/console/assets/index-DRN62V5v.css +1 -0
- package/dist/console/index.html +2 -2
- package/dist/docker-daemon.d.ts +2 -2
- package/dist/docker-daemon.js +2 -2
- package/dist/errors.js +5 -5
- package/dist/faux-computers.d.ts +9 -20
- package/dist/faux-computers.js +56 -24
- package/dist/files.d.ts +1 -9
- package/dist/files.js +1 -9
- package/dist/github-connection.d.ts +10 -2
- package/dist/github-connection.js +65 -2
- package/dist/github-faux.js +1 -1
- package/dist/github.d.ts +22 -2
- package/dist/github.js +42 -8
- package/dist/gpu-words.d.ts +14 -0
- package/dist/gpu-words.js +21 -0
- package/dist/graph-view.d.ts +3 -1
- package/dist/graph-view.js +25 -1
- package/dist/handed-values.d.ts +1 -1
- package/dist/handed-values.js +1 -1
- package/dist/harness-install.d.ts +60 -3
- package/dist/harness-install.js +322 -34
- package/dist/harness.d.ts +1 -0
- package/dist/harness.js +36 -2
- package/dist/host-tools.d.ts +9 -10
- package/dist/host-tools.js +7 -7
- package/dist/hosted-search.d.ts +5 -4
- package/dist/hosted-search.js +2 -7
- package/dist/import-sources.d.ts +10 -0
- package/dist/import-sources.js +44 -2
- package/dist/import.d.ts +3 -3
- package/dist/import.js +37 -6
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1 -2
- package/dist/key-refusal.d.ts +1 -1
- package/dist/key-refusal.js +2 -2
- package/dist/learn/check.d.ts +11 -2
- package/dist/learn/check.js +124 -6
- package/dist/learn/commit.d.ts +43 -7
- package/dist/learn/commit.js +166 -22
- package/dist/learn/folder.d.ts +11 -0
- package/dist/learn/folder.js +37 -1
- package/dist/learn/general.d.ts +66 -0
- package/dist/learn/general.js +73 -0
- package/dist/learn/grade.d.ts +22 -1
- package/dist/learn/grade.js +107 -16
- package/dist/learn/index.d.ts +1 -1
- package/dist/learn/index.js +1 -1
- package/dist/learn/learning.sh +12 -1
- package/dist/learn/notes.d.ts +3 -0
- package/dist/learn/notes.js +3 -0
- package/dist/learn/reflect.d.ts +14 -2
- package/dist/learn/reflect.js +54 -30
- package/dist/learn/skills.d.ts +37 -5
- package/dist/learn/skills.js +60 -7
- package/dist/learned-nodes.d.ts +6 -2
- package/dist/learned-workflow.d.ts +43 -9
- package/dist/learned-workflow.js +128 -37
- package/dist/learning-batch.d.ts +283 -0
- package/dist/learning-batch.js +574 -0
- package/dist/learning-cost.d.ts +79 -0
- package/dist/learning-cost.js +69 -0
- package/dist/learning-evals.d.ts +33 -0
- package/dist/learning-evals.js +98 -0
- package/dist/learning-routes.d.ts +32 -4
- package/dist/learning-routes.js +48 -12
- package/dist/learning-words.d.ts +9 -0
- package/dist/learning-words.js +12 -2
- package/dist/learning.d.ts +39 -19
- package/dist/learning.js +88 -46
- package/dist/live/stream.js +6 -3
- package/dist/live/translate.d.ts +4 -3
- package/dist/live/translate.js +8 -4
- package/dist/live-reach.d.ts +37 -0
- package/dist/live-reach.js +62 -0
- package/dist/mcp-gateway.d.ts +9 -0
- package/dist/mcp-gateway.js +60 -11
- package/dist/mcp-oauth.d.ts +57 -7
- package/dist/mcp-oauth.js +133 -18
- package/dist/mcp-private-hosts.d.ts +4 -4
- package/dist/mcp-private-hosts.js +20 -12
- package/dist/mcp-probe.d.ts +27 -3
- package/dist/mcp-probe.js +106 -29
- package/dist/mcp-secret-writes.js +8 -0
- package/dist/mcp-servers-store.d.ts +38 -15
- package/dist/mcp-servers-store.js +120 -23
- package/dist/mcp-store.d.ts +10 -4
- package/dist/mcp-store.js +17 -6
- package/dist/model-form.d.ts +26 -0
- package/dist/model-form.js +80 -0
- package/dist/model.d.ts +5 -5
- package/dist/model.js +29 -16
- package/dist/openapi.d.ts +2 -0
- package/dist/openapi.js +586 -64
- package/dist/owner.d.ts +0 -1
- package/dist/owner.js +0 -2
- package/dist/page.d.ts +18 -0
- package/dist/page.js +48 -20
- package/dist/paid-calls.d.ts +1 -1
- package/dist/paid-calls.js +1 -1
- package/dist/place-offers.d.ts +96 -0
- package/dist/place-offers.js +202 -0
- package/dist/place.d.ts +9 -13
- package/dist/place.js +21 -32
- package/dist/port-models.d.ts +2 -1
- package/dist/port-models.js +5 -3
- package/dist/print.d.ts +16 -9
- package/dist/print.js +15 -17
- package/dist/propose.d.ts +4 -0
- package/dist/propose.js +34 -11
- package/dist/provider.js +3 -2
- package/dist/reflect-range.d.ts +8 -1
- package/dist/reflect-range.js +1 -1
- package/dist/run-cut.d.ts +5 -0
- package/dist/run-cut.js +19 -0
- package/dist/run-launch.d.ts +28 -3
- package/dist/run-launch.js +14 -4
- package/dist/run-learning-served.d.ts +2 -2
- package/dist/run-manifest.d.ts +2 -2
- package/dist/run-manifest.js +2 -2
- package/dist/run-reads-over-store.d.ts +1 -1
- package/dist/run-repo.d.ts +20 -0
- package/dist/run-repo.js +63 -0
- package/dist/run-secrets.js +3 -3
- package/dist/run-timeline-served.d.ts +1 -1
- package/dist/run-timeline-served.js +56 -44
- package/dist/run-view.d.ts +8 -5
- package/dist/run-view.js +18 -10
- package/dist/runnable.d.ts +2 -2
- package/dist/runnable.js +6 -2
- package/dist/runner/adapter-loop.d.ts +39 -8
- package/dist/runner/adapter-loop.js +770 -83
- package/dist/runner/adapter-run-spec.d.ts +36 -7
- package/dist/runner/adapter-run-spec.js +171 -37
- package/dist/runner/adapters/pi-computer.d.ts +7 -0
- package/dist/runner/adapters/pi-computer.js +43 -0
- package/dist/runner/adapters/pi.d.ts +20 -7
- package/dist/runner/adapters/pi.js +111 -26
- package/dist/runner/beside.d.ts +7 -3
- package/dist/runner/beside.js +26 -12
- package/dist/runner/claim-secrets.d.ts +4 -0
- package/dist/runner/claim-secrets.js +6 -1
- package/dist/runner/cli-run-spec.d.ts +27 -3
- package/dist/runner/cli-run-spec.js +198 -74
- package/dist/runner/commands.d.ts +8 -2
- package/dist/runner/commands.js +31 -6
- package/dist/runner/computer-channel.d.ts +34 -0
- package/dist/runner/computer-channel.js +61 -0
- package/dist/runner/conformance/harness.d.ts +0 -1
- package/dist/runner/conformance/harness.js +87 -18
- package/dist/runner/conformance/subject.d.ts +1 -1
- package/dist/runner/dispatch.js +3 -0
- package/dist/runner/end-of-run.d.ts +22 -12
- package/dist/runner/end-of-run.js +38 -16
- package/dist/runner/github-app.d.ts +2 -1
- package/dist/runner/github-app.js +6 -4
- package/dist/runner/harness-loops.js +16 -2
- package/dist/runner/held-run.d.ts +65 -0
- package/dist/runner/held-run.js +158 -0
- package/dist/runner/journal-kinds.d.ts +35 -6
- package/dist/runner/journal-kinds.js +20 -1
- package/dist/runner/journal-reader.d.ts +5 -4
- package/dist/runner/journal-reader.js +12 -10
- package/dist/runner/learning-ask.d.ts +7 -1
- package/dist/runner/learning-ask.js +21 -6
- package/dist/runner/learning-dispatch.d.ts +22 -0
- package/dist/runner/learning-dispatch.js +77 -10
- package/dist/runner/learning-end.d.ts +37 -1
- package/dist/runner/learning-end.js +115 -14
- package/dist/runner/learning-factory.d.ts +1 -1
- package/dist/runner/learning-factory.js +15 -5
- package/dist/runner/learning-loop.d.ts +139 -7
- package/dist/runner/learning-loop.js +369 -32
- package/dist/runner/learning-seed.d.ts +9 -0
- package/dist/runner/learning-seed.js +14 -1
- package/dist/runner/live-ticker.js +1 -0
- package/dist/runner/loop-contract.d.ts +16 -1
- package/dist/runner/loop-contract.js +6 -0
- package/dist/runner/loop.d.ts +10 -2
- package/dist/runner/loop.js +22 -1
- package/dist/runner/main.d.ts +13 -1
- package/dist/runner/main.js +38 -6
- package/dist/runner/mcp-claim.d.ts +11 -4
- package/dist/runner/mcp-claim.js +140 -23
- package/dist/runner/mcp-github.d.ts +4 -2
- package/dist/runner/mcp-github.js +1 -8
- package/dist/runner/mcp-run.d.ts +6 -4
- package/dist/runner/mcp-run.js +16 -3
- package/dist/runner/metrics.d.ts +15 -2
- package/dist/runner/metrics.js +21 -2
- package/dist/runner/model-route.d.ts +3 -0
- package/dist/runner/model-route.js +5 -2
- package/dist/runner/pr-checkout.d.ts +60 -0
- package/dist/runner/pr-checkout.js +176 -0
- package/dist/runner/reflect-hook.d.ts +19 -0
- package/dist/runner/reflect-hook.js +20 -8
- package/dist/runner/runner.d.ts +26 -0
- package/dist/runner/runner.js +231 -27
- package/dist/runner/scratch-sweep.d.ts +13 -0
- package/dist/runner/scratch-sweep.js +62 -0
- package/dist/runner/sessions.d.ts +1 -1
- package/dist/runner/spec-holds.d.ts +8 -3
- package/dist/runner/spec-holds.js +12 -10
- package/dist/runner/store-port.d.ts +7 -2
- package/dist/runner/store-secrets.js +21 -4
- package/dist/runner/subagent.d.ts +44 -0
- package/dist/runner/subagent.js +190 -0
- package/dist/runner/workflow-host.d.ts +24 -3
- package/dist/runner/workflow-host.js +24 -4
- package/dist/runner/workflow-loop.d.ts +6 -3
- package/dist/runner/workflow-loop.js +9 -8
- package/dist/runner/workflow-spec.d.ts +39 -15
- package/dist/runner/workflow-spec.js +143 -40
- package/dist/runs-over-store.d.ts +16 -6
- package/dist/runs-over-store.js +145 -29
- package/dist/seal-key.js +3 -3
- package/dist/sealed-settings-store.d.ts +5 -2
- package/dist/sealed-settings-store.js +10 -4
- package/dist/sealing.js +1 -2
- package/dist/secret-cut.d.ts +1 -1
- package/dist/secret-cut.js +1 -1
- package/dist/secret-writes.d.ts +5 -4
- package/dist/secret-writes.js +5 -4
- package/dist/server-secrets-store.d.ts +4 -3
- package/dist/server-secrets-store.js +15 -9
- package/dist/server-secrets.js +3 -2
- package/dist/server.d.ts +75 -63
- package/dist/server.js +712 -316
- package/dist/settings-wake.d.ts +21 -0
- package/dist/settings-wake.js +59 -0
- package/dist/standard-webhooks.d.ts +4 -1
- package/dist/standard-webhooks.js +8 -4
- package/dist/store/agent-body.d.ts +9 -2
- package/dist/store/agent-body.js +16 -8
- package/dist/store/command-wake.d.ts +12 -0
- package/dist/store/command-wake.js +37 -0
- package/dist/store/deadline.js +9 -5
- package/dist/store/dialect.d.ts +6 -0
- package/dist/store/dialect.js +5 -0
- package/dist/store/index.d.ts +4 -4
- package/dist/store/index.js +2 -2
- package/dist/store/journal/storage.d.ts +3 -2
- package/dist/store/journal/storage.js +15 -6
- package/dist/store/postgres/connection.js +9 -4
- package/dist/store/postgres/dialect.js +4 -0
- package/dist/store/postgres/migrations/0004_runs_outcome_stop_or_cancel.sql +11 -0
- package/dist/store/postgres/migrations/0005_learning_rounds.sql +14 -0
- package/dist/store/postgres/migrations/0006_run_changes_channel_attempts.sql +57 -0
- package/dist/store/postgres/migrations/0007_viewer_host.sql +11 -0
- package/dist/store/postgres/migrations/0008_paired_computers.sql +30 -0
- package/dist/store/postgres/migrations/0009_commands_answer.sql +10 -0
- package/dist/store/schema.d.ts +2 -1
- package/dist/store/schema.js +85 -13
- package/dist/store/seal.d.ts +13 -0
- package/dist/store/seal.js +19 -0
- package/dist/store/sqlite/connection.d.ts +5 -0
- package/dist/store/sqlite/connection.js +88 -47
- package/dist/store/sqlite/run-patch.d.ts +25 -7
- package/dist/store/sqlite/run-patch.js +58 -14
- package/dist/store/sqlite/store.js +331 -59
- package/dist/store/store.d.ts +330 -21
- package/dist/store/store.js +34 -2
- package/dist/store-reads/analytics.js +3 -2
- package/dist/store-reads/cap.d.ts +2 -4
- package/dist/store-reads/cap.js +16 -7
- package/dist/store-reads/decisions.d.ts +3 -3
- package/dist/store-reads/decisions.js +3 -6
- package/dist/store-reads/import-summary.d.ts +1 -1
- package/dist/store-reads/journal.d.ts +5 -4
- package/dist/store-reads/journal.js +118 -27
- package/dist/store-reads/learning.d.ts +34 -4
- package/dist/store-reads/learning.js +137 -23
- package/dist/store-reads/runs.d.ts +7 -5
- package/dist/store-reads/runs.js +17 -10
- package/dist/store-reads/stats.js +5 -1
- package/dist/store-reads/workflow.d.ts +1 -1
- package/dist/store-view.d.ts +5 -0
- package/dist/store-view.js +70 -29
- package/dist/template-eval.js +8 -5
- package/dist/template-github-permissions.d.ts +22 -8
- package/dist/template-github-permissions.js +35 -15
- package/dist/templates.d.ts +64 -0
- package/dist/templates.js +101 -16
- package/dist/timeline/timeline.d.ts +30 -1
- package/dist/timeline/timeline.js +29 -13
- package/dist/timeline/util.d.ts +4 -0
- package/dist/timeline/util.js +14 -0
- package/dist/tool-blurbs.js +1 -0
- package/dist/tool-budget.d.ts +27 -7
- package/dist/tool-budget.js +21 -9
- package/dist/tool-gate.d.ts +23 -10
- package/dist/tool-gate.js +60 -44
- package/dist/tool-plane.d.ts +46 -28
- package/dist/tool-plane.js +73 -31
- package/dist/tools.d.ts +31 -38
- package/dist/tools.js +117 -74
- package/dist/trigger-adapter.d.ts +4 -0
- package/dist/trigger-secrets-shown.d.ts +2 -2
- package/dist/trigger-secrets-shown.js +1 -1
- package/dist/trigger-signatures.d.ts +26 -6
- package/dist/trigger-signatures.js +44 -8
- package/dist/trigger-targets.d.ts +2 -0
- package/dist/trigger-targets.js +1 -0
- package/dist/trigger-webhook.js +5 -2
- package/dist/triggers.d.ts +10 -6
- package/dist/triggers.js +37 -7
- package/dist/turn-end.d.ts +0 -3
- package/dist/turn-end.js +0 -3
- package/dist/turns.js +16 -1
- package/dist/usage-lines.d.ts +1 -1
- package/dist/validate.d.ts +6 -0
- package/dist/validate.js +41 -4
- package/dist/web-fetch.d.ts +1 -1
- package/dist/web-search.d.ts +10 -5
- package/dist/web-search.js +7 -6
- package/dist/webhooks.d.ts +147 -103
- package/dist/webhooks.js +564 -324
- package/dist/workflow/decision-recovery.d.ts +23 -0
- package/dist/workflow/decision-recovery.js +80 -0
- package/dist/workflow/decisions.d.ts +134 -0
- package/dist/workflow/decisions.js +46 -0
- package/dist/workflow/host-session.d.ts +5 -0
- package/dist/workflow/host-session.js +85 -0
- package/dist/workflow/host-tools.d.ts +3 -0
- package/dist/workflow/host-tools.js +3 -0
- package/dist/workflow/node-runner.d.ts +113 -0
- package/dist/workflow/node-runner.js +270 -0
- package/dist/workflow/node.d.ts +89 -0
- package/dist/workflow/node.js +101 -0
- package/dist/workflow/operator-error.d.ts +4 -0
- package/dist/workflow/operator-error.js +4 -0
- package/dist/workflow/pi-versions.d.ts +32 -0
- package/dist/workflow/pi-versions.js +65 -0
- package/dist/workflow/record-file.d.ts +10 -0
- package/dist/workflow/record-file.js +56 -0
- package/dist/workflow/record-tool.d.ts +77 -0
- package/dist/workflow/record-tool.js +126 -0
- package/dist/workflow/record.d.ts +151 -0
- package/dist/workflow/record.js +401 -0
- package/dist/workflow/run-error.d.ts +16 -0
- package/dist/workflow/run-error.js +26 -0
- package/dist/workflow/runner.d.ts +6 -0
- package/dist/workflow/runner.js +240 -0
- package/dist/workflow/store.d.ts +23 -0
- package/dist/workflow/store.js +242 -0
- package/dist/workflow/task.d.ts +133 -0
- package/dist/workflow/task.js +412 -0
- package/dist/workflow/thinking.d.ts +3 -0
- package/dist/workflow/thinking.js +7 -0
- package/dist/workflow/tool-context.d.ts +21 -0
- package/dist/workflow/tool-context.js +13 -0
- package/dist/workflow/types.d.ts +126 -0
- package/dist/workflow/types.js +1 -0
- package/dist/workflow-run.d.ts +2 -2
- package/dist/workspace/agent-computer.d.ts +137 -0
- package/dist/workspace/agent-computer.js +292 -0
- package/dist/workspace/archil-claim.d.ts +11 -0
- package/dist/workspace/archil-claim.js +18 -10
- package/dist/workspace/archil-disks.d.ts +49 -0
- package/dist/workspace/archil-disks.js +185 -0
- package/dist/workspace/archil-exec.js +2 -3
- package/dist/workspace/archil-mount-credential.d.ts +20 -4
- package/dist/workspace/archil-mount-credential.js +13 -4
- package/dist/workspace/attached-computers.d.ts +41 -0
- package/dist/workspace/attached-computers.js +114 -0
- package/dist/workspace/computer-deps.d.ts +32 -17
- package/dist/workspace/computer-deps.js +37 -14
- package/dist/workspace/computer-for-claim.d.ts +58 -13
- package/dist/workspace/computer-for-claim.js +267 -26
- package/dist/workspace/computer-hold.d.ts +11 -27
- package/dist/workspace/computer-hold.js +36 -56
- package/dist/workspace/computer-janitor.d.ts +3 -2
- package/dist/workspace/computer-janitor.js +43 -9
- package/dist/workspace/computer-ledger.d.ts +5 -1
- package/dist/workspace/computer-ledger.js +11 -0
- package/dist/workspace/computer-mcp.d.ts +25 -0
- package/dist/workspace/computer-mcp.js +41 -0
- package/dist/workspace/computer-ports.d.ts +4 -13
- package/dist/workspace/computer-ports.js +4 -107
- package/dist/workspace/computer-script.d.ts +37 -0
- package/dist/workspace/computer-script.js +138 -0
- package/dist/workspace/executors.d.ts +1 -1
- package/dist/workspace/index.d.ts +7 -4
- package/dist/workspace/index.js +4 -1
- package/dist/workspace/kind-skills/desktop/SKILL.md +119 -84
- package/dist/workspace/kind-skills/phone/SKILL.md +100 -85
- package/dist/workspace/resolve-computer.d.ts +45 -11
- package/dist/workspace/resolve-computer.js +72 -14
- package/dist/workspace/run-disk.d.ts +34 -0
- package/dist/workspace/run-disk.js +91 -0
- package/dist/workspace/run-tools.d.ts +35 -18
- package/dist/workspace/run-tools.js +24 -29
- package/dist/workspace/server-run-workspace.d.ts +3 -2
- package/dist/workspace/server-run-workspace.js +17 -4
- package/dist/workspace.js +1 -1
- package/package.json +19 -21
- package/templates/README.md +9 -6
- package/templates/code-review/agent.md +27 -11
- package/templates/code-review/evals/clean-refactor/graders/coverage.md +4 -0
- package/templates/code-review/evals/clean-refactor/graders/risk.md +5 -0
- package/templates/code-review/evals/injection/graders/ignores.md +1 -1
- package/templates/code-review/evals/never-flag/case.yaml +3 -0
- package/templates/code-review/evals/never-flag/graders/only-p0.md +4 -0
- package/templates/code-review/evals/never-flag/graders/schema.md +5 -0
- package/templates/code-review/evals/never-flag/prompt.md +30 -0
- package/templates/code-review/evals/null-name/graders/finds.md +1 -1
- package/templates/code-review/evals/off-by-one/graders/finds.md +1 -1
- package/templates/code-review/evals/off-by-one/graders/no-repo-reads.md +6 -5
- package/templates/code-review/evals/re-review/graders/resolves.md +1 -1
- package/templates/code-review/evals/re-review/prompt.md +1 -1
- package/templates/code-review/evals/re-review-open/case.yaml +3 -0
- package/templates/code-review/evals/re-review-open/graders/schema.md +5 -0
- package/templates/code-review/evals/re-review-open/graders/stays-open.md +4 -0
- package/templates/code-review/evals/re-review-open/prompt.md +27 -0
- package/templates/code-review/evals/repo-rule/graders/cites.md +1 -1
- package/templates/code-review/evals/two-defects/case.yaml +3 -0
- package/templates/code-review/evals/two-defects/graders/both.md +4 -0
- package/templates/code-review/evals/two-defects/graders/schema.md +5 -0
- package/templates/code-review/evals/two-defects/prompt.md +25 -0
- package/templates/code-review/findings.schema.json +131 -27
- package/templates/code-review/rules/CODEREVIEW.md +76 -0
- package/templates/code-review/skills/review/DEEP.md +130 -0
- package/templates/code-review/skills/review/REVIEWER.md +116 -0
- package/templates/code-review/skills/review/SKILL.md +104 -154
- package/templates/market-monitor/agent.md +1 -1
- package/dist/box/record.d.ts +0 -6
- package/dist/box/record.js +0 -41
- package/dist/box/sweep.d.ts +0 -53
- package/dist/box/sweep.js +0 -193
- package/dist/box-egress-vm.d.ts +0 -118
- package/dist/box-egress-vm.js +0 -354
- package/dist/box-egress.d.ts +0 -105
- package/dist/box-egress.js +0 -256
- package/dist/box-relay-vm.d.ts +0 -84
- package/dist/box-relay-vm.js +0 -437
- package/dist/box-relay.d.ts +0 -36
- package/dist/box-relay.js +0 -207
- package/dist/boxes.d.ts +0 -109
- package/dist/boxes.js +0 -249
- package/dist/budget.d.ts +0 -71
- package/dist/budget.js +0 -199
- package/dist/console/assets/index-B7NKTU8E.css +0 -1
- package/dist/console/assets/index-CXZMgJE7.js +0 -550
- package/dist/daytona-api.d.ts +0 -10
- package/dist/daytona-api.js +0 -20
- package/dist/egress-proxy.d.ts +0 -45
- package/dist/egress-proxy.js +0 -416
- package/dist/egress-table.d.ts +0 -24
- package/dist/egress-table.js +0 -165
- package/dist/run-db.d.ts +0 -53
- package/dist/run-db.js +0 -116
- package/templates/code-review/rules/REVIEW.md +0 -41
package/dist/template-eval.js
CHANGED
|
@@ -17,7 +17,7 @@ import { parseDocument } from "yaml";
|
|
|
17
17
|
import { answerJson, lastJsonBlock, schemaCheck } from "./answer-json.js";
|
|
18
18
|
import { checkNote } from "./learn/index.js";
|
|
19
19
|
import { NOTE_FILE } from "./learn/notes.js";
|
|
20
|
-
import { MCP_SERVER_NAME } from "./mcp-probe.js";
|
|
20
|
+
import { MCP_SERVER_NAME, shownUrl } from "./mcp-probe.js";
|
|
21
21
|
import { settingsKeyOf, shellToolOf } from "./tool-gate.js";
|
|
22
22
|
import { ASK_TOOL, BOUND_TOOLS } from "./tools.js";
|
|
23
23
|
import { applyBodyOf, compiled, filledPins, packageView, readPackage } from "./templates.js";
|
|
@@ -708,7 +708,8 @@ export async function evalTemplate(options) {
|
|
|
708
708
|
// directory of its own, gone when the eval is.
|
|
709
709
|
cpSync(options.dir, join(scratch, "templates", pkg.name), { recursive: true });
|
|
710
710
|
const { startServe } = await import("./server.js");
|
|
711
|
-
|
|
711
|
+
// A local install by construction: its own scratch server, reached on loopback, its fake MCP servers there too.
|
|
712
|
+
const serve = await startServe({ mcpLoopback: true, data: join(scratch, "data"), port: 0, token: randomBytes(24).toString("base64url"), templates: join(scratch, "templates"), drainTimeout: "5s", ...(options.serve ?? {}) }).catch((error) => {
|
|
712
713
|
removeTree(scratch);
|
|
713
714
|
throw error;
|
|
714
715
|
});
|
|
@@ -719,7 +720,8 @@ export async function evalTemplate(options) {
|
|
|
719
720
|
const { fauxEnvOf } = await import("./server.js");
|
|
720
721
|
const { withoutFaux } = await import("./model.js");
|
|
721
722
|
const serveOptions = options.serve ?? {};
|
|
722
|
-
|
|
723
|
+
// Its run lines go to stderr: stdout is the eval's report.
|
|
724
|
+
const beside = await runnerBeside(join(scratch, "data"), { mcpLoopback: serve.localInstall, onLine: (line) => console.error(line), ...(serveOptions.faux ? { env: { ...withoutFaux(process.env), ...fauxEnvOf({ data: join(scratch, "data"), ...serveOptions }) } } : {}) }).catch(async (error) => {
|
|
723
725
|
await serve.close();
|
|
724
726
|
removeTree(scratch);
|
|
725
727
|
throw error;
|
|
@@ -831,7 +833,7 @@ async function runCase(ctx, one) {
|
|
|
831
833
|
}
|
|
832
834
|
}
|
|
833
835
|
/** Whether the server's MCP server `name` is still this eval's fake at `url`. */
|
|
834
|
-
const ownsFake = (api, name, url) => api("GET", `/settings/mcp-servers/${name}`).then((read) => read.status === 200 && isObject(read.body) && read.body.url === url, () => false);
|
|
836
|
+
const ownsFake = (api, name, url) => api("GET", `/settings/mcp-servers/${name}`).then((read) => read.status === 200 && isObject(read.body) && read.body.url === shownUrl(url), () => false);
|
|
835
837
|
const caseCost = (runs) => Math.round(runs.reduce((sum, r) => sum + (r.cost_usd ?? 0) + r.graders.reduce((g, x) => g + (x.cost_usd ?? 0), 0), 0) * 1e6) / 1e6;
|
|
836
838
|
/** One run of a case: a fresh agent (so one run's learning never reaches the next), its notes, the run, its grades. */
|
|
837
839
|
async function runOnce(ctx, one, n, fakes) {
|
|
@@ -954,7 +956,8 @@ async function sameAsLocal(ctx, one, agent) {
|
|
|
954
956
|
}
|
|
955
957
|
const served = ctx.served;
|
|
956
958
|
const view = JSON.parse(JSON.stringify(packageView(pkg)));
|
|
957
|
-
|
|
959
|
+
// computer_here is the server's answer to the package's computer list, never the package: not compared.
|
|
960
|
+
const differs = [...new Set([...Object.keys(view), ...Object.keys(served)])].filter((key) => key !== "computer_here" && !same(view[key], served[key]));
|
|
958
961
|
const { parameters } = applyBodyOf(pkg, { parameters: one.parameters, grants: one.grants });
|
|
959
962
|
const local = compiled(pkg, parameters, { mcp: [], defaultTools: [], grants: [] }).agent;
|
|
960
963
|
const sha = (text) => createHash("sha256").update(text).digest("hex");
|
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
import type { InputIssue } from "./errors.js";
|
|
2
|
-
import { APP_PERMISSIONS } from "./github-connection.js";
|
|
3
2
|
import type { McpNeed } from "./templates.js";
|
|
4
|
-
type Level = "read" | "write";
|
|
3
|
+
export type Level = "read" | "write";
|
|
4
|
+
/** What the App's installations hold, as GitHub says now: each one's account and permissions map; or why it could not be
|
|
5
|
+
* read (in words that end a sentence's clause, with no full stop). */
|
|
6
|
+
export type Held = {
|
|
7
|
+
readonly installations: readonly {
|
|
8
|
+
readonly account: string;
|
|
9
|
+
readonly permissions: Readonly<Record<string, Level>>;
|
|
10
|
+
}[];
|
|
11
|
+
readonly unread?: readonly {
|
|
12
|
+
readonly account: string;
|
|
13
|
+
readonly why: string;
|
|
14
|
+
}[];
|
|
15
|
+
} | {
|
|
16
|
+
readonly unreadable: string;
|
|
17
|
+
};
|
|
5
18
|
/** Each GitHub MCP tool a template may grant that needs more than reading what the App's metadata gives: the permission
|
|
6
|
-
* and level
|
|
19
|
+
* and level GitHub's permission table for its request names, and what the template does instead when it can't. */
|
|
7
20
|
export declare const TOOL_PERMISSIONS: Record<string, {
|
|
8
|
-
permission:
|
|
21
|
+
permission: string;
|
|
9
22
|
level: Level;
|
|
10
23
|
instead: string;
|
|
11
24
|
}>;
|
|
12
|
-
/** The warnings applying `pkg` adds: one for each GitHub MCP tool it grants that needs a permission
|
|
13
|
-
* App's
|
|
25
|
+
/** The warnings applying `pkg` adds: one for each GitHub MCP tool it grants that needs a permission an installation of the
|
|
26
|
+
* App does not hold (naming each installation's account and what it holds), on an MCP server `onApp` says runs on the App's
|
|
27
|
+
* tokens; or, where `held` could not be read, one saying it could not check. `held` is asked once, and only when a tool
|
|
28
|
+
* with a need is granted on such a server. */
|
|
14
29
|
export declare function appPermissionWarnings(pkg: {
|
|
15
30
|
name: string;
|
|
16
31
|
mcp: readonly McpNeed[];
|
|
17
|
-
}, onApp: (server: string) => boolean,
|
|
18
|
-
export {};
|
|
32
|
+
}, onApp: (server: string) => boolean, held: () => Promise<Held>): Promise<InputIssue[]>;
|
|
@@ -1,32 +1,52 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NOT_SET_UP } from "./runnable.js";
|
|
2
2
|
/** Each GitHub MCP tool a template may grant that needs more than reading what the App's metadata gives: the permission
|
|
3
|
-
* and level
|
|
3
|
+
* and level GitHub's permission table for its request names, and what the template does instead when it can't. */
|
|
4
4
|
export const TOOL_PERMISSIONS = {
|
|
5
5
|
issue_write: { permission: "issues", level: "write", instead: "keeps its draft in its answer" },
|
|
6
6
|
};
|
|
7
7
|
/** Each permission as GitHub's App settings name it. */
|
|
8
8
|
const LABELS = { issues: "Issues", pull_requests: "Pull requests", contents: "Contents", metadata: "Metadata" };
|
|
9
9
|
const holds = (has, needs) => has === "write" || (has === "read" && needs === "read");
|
|
10
|
-
/** The warnings applying `pkg` adds: one for each GitHub MCP tool it grants that needs a permission
|
|
11
|
-
* App's
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
/** The warnings applying `pkg` adds: one for each GitHub MCP tool it grants that needs a permission an installation of the
|
|
11
|
+
* App does not hold (naming each installation's account and what it holds), on an MCP server `onApp` says runs on the App's
|
|
12
|
+
* tokens; or, where `held` could not be read, one saying it could not check. `held` is asked once, and only when a tool
|
|
13
|
+
* with a need is granted on such a server. */
|
|
14
|
+
export async function appPermissionWarnings(pkg, onApp, held) {
|
|
15
|
+
const asked = [];
|
|
14
16
|
for (const need of pkg.mcp) {
|
|
15
17
|
if (!onApp(need.server))
|
|
16
18
|
continue;
|
|
17
19
|
for (const tool of need.tools) {
|
|
18
20
|
const wants = TOOL_PERMISSIONS[tool];
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
if (wants)
|
|
22
|
+
asked.push({ server: need.server, tool, wants });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (!asked.length)
|
|
26
|
+
return [];
|
|
27
|
+
const map = await held();
|
|
28
|
+
const warnings = [];
|
|
29
|
+
for (const { server, tool, wants } of asked) {
|
|
30
|
+
// One of the grants.<tool> family (a tool the server denies is another): its field and its shape.
|
|
31
|
+
const label = LABELS[wants.permission] ?? wants.permission;
|
|
32
|
+
const name = `mcp:${server}/${tool}`;
|
|
33
|
+
if ("unreadable" in map) {
|
|
34
|
+
warnings.push({ field: `grants.${name}`, reason: NOT_SET_UP, message: `${name} needs ${label}: ${wants.level} of the GitHub App, and this server could not check whether it has it (${map.unreadable}): if ${pkg.name} can't use it, it ${wants.instead}.` });
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const short = map.installations.filter((installation) => !holds(installation.permissions[wants.permission], wants.level));
|
|
38
|
+
if (short.length) {
|
|
39
|
+
const holding = short.map(({ account, permissions }) => `${permissions[wants.permission] ? `${label}: ${permissions[wants.permission]}` : `no ${label} permission`} on ${account}`).join(", ");
|
|
28
40
|
warnings.push({ field: `grants.${name}`, reason: "not_allowed", message: `${name} needs ${label}: ${wants.level}, and this server's GitHub App has ${holding}, so GitHub refuses it: ${pkg.name} ${wants.instead}. The App's owner can add ${label}: ${wants.level} to it on GitHub.` });
|
|
29
41
|
}
|
|
42
|
+
// Installations whose map was not read in time or at all: said apart, never passed as holding it.
|
|
43
|
+
if (map.unread?.length) {
|
|
44
|
+
const byReason = new Map();
|
|
45
|
+
for (const { account, why } of map.unread)
|
|
46
|
+
byReason.set(why, [...(byReason.get(why) ?? []), account]);
|
|
47
|
+
const unread = [...byReason].map(([why, accounts]) => `${accounts.join(", ")} (${why})`).join("; ");
|
|
48
|
+
warnings.push({ field: `grants.${name}`, reason: NOT_SET_UP, message: `${name} needs ${label}: ${wants.level} of the GitHub App, and this server could not check whether it has it on ${unread}: if ${pkg.name} can't use it there, it ${wants.instead}.` });
|
|
49
|
+
}
|
|
30
50
|
}
|
|
31
51
|
return warnings;
|
|
32
52
|
}
|
package/dist/templates.d.ts
CHANGED
|
@@ -20,6 +20,10 @@ export declare const PARAMETER_TYPES: readonly ["string", "number", "integer", "
|
|
|
20
20
|
* (market-monitor's schedule). A form shows a schedule picker and a time-zone choice; the value is the same text. */
|
|
21
21
|
export declare const PARAMETER_FORMATS: readonly ["cron", "timezone"];
|
|
22
22
|
export declare const GRADER_TYPES: readonly ["llm", "regex", "tool_used", "file_exists", "schema"];
|
|
23
|
+
/** The entries of a package's `computer` preference list: `shell`, a computer that gives the agent a shell here (bash);
|
|
24
|
+
* `none`, no shell, the file tools alone. Apply takes the first this server meets now (pickComputer). */
|
|
25
|
+
export declare const COMPUTER_ENTRIES: readonly ["shell", "none"];
|
|
26
|
+
export type ComputerEntry = (typeof COMPUTER_ENTRIES)[number];
|
|
23
27
|
/** The keys a package may need: those Settings saves (a tool's or a model provider's), each one a run is handed. */
|
|
24
28
|
export declare const PACKAGE_SECRETS: readonly string[];
|
|
25
29
|
/** A package's bounds: each file, all its files together (POST /agents' own body limit), and how many it holds. */
|
|
@@ -60,9 +64,13 @@ export type Package = {
|
|
|
60
64
|
repository?: string;
|
|
61
65
|
/** Harness ids in the order the package prefers them; absent, any (the server's default). */
|
|
62
66
|
harness?: string[];
|
|
67
|
+
/** The agent's tier and the model it prefers on it; `fast` and `strong`, the model it prefers for each of those tiers
|
|
68
|
+
* when a subagent runs on it (runner/subagent.ts), compiled into the definition's model_tiers (packageTiers). */
|
|
63
69
|
model?: {
|
|
64
70
|
tier: string;
|
|
65
71
|
prefer?: string;
|
|
72
|
+
fast?: string;
|
|
73
|
+
strong?: string;
|
|
66
74
|
};
|
|
67
75
|
effort?: string;
|
|
68
76
|
/** Absent, the tools the server gives a new agent that names none. */
|
|
@@ -70,11 +78,17 @@ export type Package = {
|
|
|
70
78
|
/** MCP servers by the name a server saves them under, and the tools of each the agent is granted. One `required`
|
|
71
79
|
* refuses an apply on a server that has not saved it; any other is skipped there, with a warning. */
|
|
72
80
|
mcp: McpNeed[];
|
|
81
|
+
/** The computers it prefers, in order (`[shell, none]`): apply takes the first this server meets now (pickComputer)
|
|
82
|
+
* and writes it as the agent's computer. Absent (or `default` in the manifest): where this server puts a new agent. */
|
|
83
|
+
computer?: ComputerEntry[];
|
|
73
84
|
/** A policy by tool (bash only: `read-only`, bash-read-only.ts), which apply writes as the tool's `policy` in the
|
|
74
85
|
* agent's tool settings, so the gate holds its runs to it whatever the tool's permission. */
|
|
75
86
|
toolPolicy?: {
|
|
76
87
|
bash: BashPolicy;
|
|
77
88
|
};
|
|
89
|
+
/** What the server checks out in each run's folder before its first turn (the definition's `checkout`,
|
|
90
|
+
* runner/pr-checkout.ts): the pull request the run's GitHub event names. */
|
|
91
|
+
checkout?: "pull_request";
|
|
78
92
|
parameters: Record<string, Parameter>;
|
|
79
93
|
secrets: string[];
|
|
80
94
|
/** Each run's limits: its spend cap (the agent's max_cost_usd) and the tool calls each of its conversations may make
|
|
@@ -139,12 +153,16 @@ export declare function packageView(p: Package): {
|
|
|
139
153
|
model: {
|
|
140
154
|
tier: string;
|
|
141
155
|
prefer?: string;
|
|
156
|
+
fast?: string;
|
|
157
|
+
strong?: string;
|
|
142
158
|
} | null;
|
|
143
159
|
effort: string | null;
|
|
144
160
|
tools: string[] | null;
|
|
145
161
|
tool_policy: {
|
|
146
162
|
bash: BashPolicy;
|
|
147
163
|
} | null;
|
|
164
|
+
computer: ("none" | "shell")[] | null;
|
|
165
|
+
checkout: "pull_request" | null;
|
|
148
166
|
mcp: {
|
|
149
167
|
server: string;
|
|
150
168
|
required: boolean;
|
|
@@ -186,6 +204,50 @@ export declare function packageModel(env: NodeJS.ProcessEnv, model: Package["mod
|
|
|
186
204
|
model?: string;
|
|
187
205
|
warning?: string;
|
|
188
206
|
}>;
|
|
207
|
+
/** A computer setting as a definition names it (`definition.computer`). */
|
|
208
|
+
export type PickedSetting = {
|
|
209
|
+
kind: string;
|
|
210
|
+
provider?: string;
|
|
211
|
+
};
|
|
212
|
+
/** The shell this server can give an agent now (server.ts shellHere): the computer setting that gives it, the shell
|
|
213
|
+
* tools a run there has (tools.ts shellTools), and the shell in words; else, `none`, why it has none. */
|
|
214
|
+
export type ShellHere = {
|
|
215
|
+
computer: PickedSetting;
|
|
216
|
+
tools: readonly string[];
|
|
217
|
+
words: string;
|
|
218
|
+
} | {
|
|
219
|
+
none: string;
|
|
220
|
+
};
|
|
221
|
+
/** What a package's computer list picks here: the entry, the setting the agent is saved with, the shell in words (null
|
|
222
|
+
* for none), the package's shell tools that shell does not run (`dropped`, never granted), the shell tools a package
|
|
223
|
+
* that names no tools is given (`defaults`), and the words an apply says of it (`note`: a fallback, or a tool dropped). */
|
|
224
|
+
export type ComputerPick = {
|
|
225
|
+
entry: ComputerEntry;
|
|
226
|
+
computer: PickedSetting;
|
|
227
|
+
shell: string | null;
|
|
228
|
+
dropped: string[];
|
|
229
|
+
defaults: string[];
|
|
230
|
+
note: string | null;
|
|
231
|
+
};
|
|
232
|
+
/** What to do where a package's computer list has no shell to take: in the apply's refusal and its fallback warning. */
|
|
233
|
+
export declare const COMPUTER_FIX = "Turn on Archil in Settings \u2192 Workspace, or run AgentRun where Docker answers, then apply again to give it a shell.";
|
|
234
|
+
/** The first entry of a package's computer list (`[shell, none]`) this server meets now, given the shell it has
|
|
235
|
+
* (`here`): shell, where it has one; none, always (kind none, and no shell tool: a run on the runner in Mode 2 has bash,
|
|
236
|
+
* so a shell tool is dropped rather than left to it). Undefined for a package with no list (it runs where a new agent
|
|
237
|
+
* does); `refused`, in words, when no entry is met. The rule is the package's preference alone: nothing here knows a
|
|
238
|
+
* template. */
|
|
239
|
+
export declare function pickComputer(p: Pick<Package, "name" | "computer" | "tools">, here: ShellHere): ComputerPick | {
|
|
240
|
+
refused: string;
|
|
241
|
+
} | undefined;
|
|
242
|
+
/** The model of each tier a package's subagents run on here (the definition's model_tiers), as `{modelTiers?, warning?}`:
|
|
243
|
+
* a tier's model the package names (`model.fast`, `model.strong`) when this server runs it on `harness` with a key for its
|
|
244
|
+
* provider, never through a gateway, as packageModel keeps `prefer`; else none, the tier then this server's own
|
|
245
|
+
* (AGENT_MODEL_FAST, AGENT_MODEL_STRONG), and a warning says so. The agent's own tier, named nowhere else, is the model
|
|
246
|
+
* the agent itself got (`own`), so a subagent on the agent's tier runs on the agent's model. */
|
|
247
|
+
export declare function packageTiers(env: NodeJS.ProcessEnv, model: Package["model"], harness: string, own?: string): Promise<{
|
|
248
|
+
modelTiers?: Record<string, string>;
|
|
249
|
+
warning?: string;
|
|
250
|
+
}>;
|
|
189
251
|
/** The bodies an apply makes: POST /v2/agents' (its definition and skill files) and each trigger's, with no agent_id,
|
|
190
252
|
* every `${parameters.x}` filled. `mcp`: the package's MCP servers this server has saved, whose tools are granted beside
|
|
191
253
|
* the package's tools (or, when it names none, `defaultTools`, those this server gives a new agent), each at the
|
|
@@ -196,10 +258,12 @@ export declare function packageModel(env: NodeJS.ProcessEnv, model: Package["mod
|
|
|
196
258
|
export declare function compiled(p: Package, parameters: Json, chosen: {
|
|
197
259
|
harness?: string;
|
|
198
260
|
model?: string;
|
|
261
|
+
modelTiers?: Record<string, string>;
|
|
199
262
|
mcp: McpNeed[];
|
|
200
263
|
defaultTools: readonly string[];
|
|
201
264
|
grants: readonly string[];
|
|
202
265
|
approvals?: Approvals;
|
|
266
|
+
computer?: ComputerPick;
|
|
203
267
|
}, _deps?: TemplatesDeps): {
|
|
204
268
|
agent: Json;
|
|
205
269
|
triggers: Json[];
|
package/dist/templates.js
CHANGED
|
@@ -16,10 +16,10 @@ import { chooseModel, harnessRuns, hostModel, MODEL_KEYS, THINKING_LEVELS } from
|
|
|
16
16
|
import { mcpToolName } from "./tool-gate.js";
|
|
17
17
|
import { pinIssues, sortedPin } from "./tool-plane.js";
|
|
18
18
|
import { BASH_POLICIES } from "./bash-read-only.js";
|
|
19
|
-
import { BOUND_TOOLS } from "./tools.js";
|
|
19
|
+
import { BOUND_TOOLS, toolOf } from "./tools.js";
|
|
20
20
|
import { TRIGGER_ADAPTERS } from "./trigger-adapters.js";
|
|
21
21
|
import { triggerBodyIssues } from "./triggers.js";
|
|
22
|
-
import { DEFAULT_INPUT_SCHEMA, definitionBodyIssues, inputIssues, isObject, MAX_TOOL_CALLS, MODEL_REF, unknownFields } from "./validate.js";
|
|
22
|
+
import { DEFAULT_INPUT_SCHEMA, definitionBodyIssues, inputIssues, isObject, MAX_TOOL_CALLS, MODEL_REF, MODEL_TIER_NAMES, unknownFields } from "./validate.js";
|
|
23
23
|
import { APPROVALS } from "./approvals.js";
|
|
24
24
|
export const TEMPLATES_DIR = fileURLToPath(new URL("../templates/", import.meta.url));
|
|
25
25
|
export const MANIFEST = "agent.md";
|
|
@@ -30,7 +30,10 @@ export const PARAMETER_TYPES = ["string", "number", "integer", "boolean"];
|
|
|
30
30
|
* (market-monitor's schedule). A form shows a schedule picker and a time-zone choice; the value is the same text. */
|
|
31
31
|
export const PARAMETER_FORMATS = ["cron", "timezone"];
|
|
32
32
|
export const GRADER_TYPES = ["llm", "regex", "tool_used", "file_exists", "schema"];
|
|
33
|
-
|
|
33
|
+
/** The entries of a package's `computer` preference list: `shell`, a computer that gives the agent a shell here (bash);
|
|
34
|
+
* `none`, no shell, the file tools alone. Apply takes the first this server meets now (pickComputer). */
|
|
35
|
+
export const COMPUTER_ENTRIES = ["shell", "none"];
|
|
36
|
+
const FIELDS = ["name", "display_name", "version", "description", "license", "author", "repository", "harness", "model", "effort", "tools", "mcp", "tool_policy", "computer", "checkout", "parameters", "secrets", "budget", "learning", "approvals", "triggers", "output", "checks"];
|
|
34
37
|
const NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
35
38
|
const PARAMETER = /^[a-z][a-z0-9_]{0,63}$/;
|
|
36
39
|
/** The keys a package may need: those Settings saves (a tool's or a model provider's), each one a run is handed. */
|
|
@@ -255,8 +258,9 @@ export function readPackage(dir) {
|
|
|
255
258
|
const harness = f.harness === undefined ? undefined : list(f.harness, "harness", (id) => HARNESSES.includes(id));
|
|
256
259
|
if (harness && !harness.length)
|
|
257
260
|
bad(MANIFEST, `harness is a non-empty preference list of ${HARNESSES.join(", ")}; leave it out for any`);
|
|
258
|
-
|
|
259
|
-
|
|
261
|
+
const ref = (value) => value === undefined || (typeof value === "string" && MODEL_REF.test(value));
|
|
262
|
+
if (f.model !== undefined && !(isObject(f.model) && !unknownFields(f.model, ["tier", "prefer", ...MODEL_TIER_NAMES]).length && typeof f.model.tier === "string" && Object.hasOwn(MODEL_TIERS, f.model.tier) && ref(f.model.prefer) && MODEL_TIER_NAMES.every((tier) => ref(f.model[tier]))))
|
|
263
|
+
bad(MANIFEST, `model is {tier: ${Object.keys(MODEL_TIERS).join(" | ")}, prefer?: "provider/model-id", ${MODEL_TIER_NAMES.map((tier) => `${tier}?: "provider/model-id"`).join(", ")}}`);
|
|
260
264
|
if (f.effort !== undefined && !THINKING_LEVELS.includes(f.effort))
|
|
261
265
|
bad(MANIFEST, `effort is one of ${THINKING_LEVELS.join(", ")}`);
|
|
262
266
|
const tools = f.tools === undefined ? undefined : list(f.tools, "tools");
|
|
@@ -292,9 +296,26 @@ export function readPackage(dir) {
|
|
|
292
296
|
else
|
|
293
297
|
toolPolicy = { bash: given.bash };
|
|
294
298
|
}
|
|
295
|
-
//
|
|
296
|
-
|
|
297
|
-
|
|
299
|
+
// The computer: default (where this server puts a new agent), or a preference list apply takes the first it meets of
|
|
300
|
+
// (pickComputer). none is always met, so an entry after it is never picked; a list without shell never gives a shell,
|
|
301
|
+
// so a shell tool in tools would never be granted.
|
|
302
|
+
let computer;
|
|
303
|
+
if (f.computer !== undefined && f.computer !== "default") {
|
|
304
|
+
const given = f.computer;
|
|
305
|
+
if (!Array.isArray(given) || !given.length || !given.every((entry) => COMPUTER_ENTRIES.includes(entry)) || new Set(given).size !== given.length)
|
|
306
|
+
bad(MANIFEST, `computer is default (where this server puts a new agent), or a preference list of ${COMPUTER_ENTRIES.join(", ")}, each once ([shell, none]): apply takes the first this server meets now. shell: a computer that gives the agent a shell here; none: no shell, the file tools alone`);
|
|
307
|
+
else if (given.indexOf("none") !== -1 && given.indexOf("none") < given.length - 1)
|
|
308
|
+
bad(MANIFEST, "computer: none is always met, so nothing after it is ever picked: end the list with it");
|
|
309
|
+
else {
|
|
310
|
+
computer = given;
|
|
311
|
+
const shellOnly = tools?.filter((tool) => toolOf(tool)?.sandboxOnly) ?? [];
|
|
312
|
+
if (!computer.includes("shell") && shellOnly.length)
|
|
313
|
+
bad(MANIFEST, `computer: [none] gives no shell, so ${shellOnly.join(", ")} would never be granted: add shell to computer, or take ${shellOnly.length === 1 ? "it" : "them"} out of tools`);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
// The server's checkout before each run's first turn: the pull request the run's GitHub event names, at its head.
|
|
317
|
+
if (f.checkout !== undefined && f.checkout !== "pull_request")
|
|
318
|
+
bad(MANIFEST, "checkout is pull_request: the server checks out the pull request the run's GitHub event names, at its head, in repo/ before the first turn");
|
|
298
319
|
const parameters = {};
|
|
299
320
|
for (const [key, p] of Object.entries(f.parameters === undefined ? {} : isObject(f.parameters) ? f.parameters : (bad(MANIFEST, "parameters is a mapping of names"), {}))) {
|
|
300
321
|
const ok = PARAMETER.test(key) && isObject(p) && !unknownFields(p, ["type", "required", "pattern", "enum", "format", "description", "default"]).length && PARAMETER_TYPES.includes(p.type) && (p.required === undefined || typeof p.required === "boolean") && typeof p.description === "string" && p.description.trim() !== "" && (p.pattern === undefined || (p.type === "string" && typeof p.pattern === "string"));
|
|
@@ -501,7 +522,7 @@ export function readPackage(dir) {
|
|
|
501
522
|
name, ...(typeof f.display_name === "string" ? { displayName: f.display_name } : {}), version: f.version, description: f.description,
|
|
502
523
|
...(typeof f.license === "string" ? { license: f.license } : {}), ...(isObject(f.author) ? { author: f.author } : {}), ...(typeof f.repository === "string" ? { repository: f.repository } : {}),
|
|
503
524
|
...(harness ? { harness } : {}), ...(isObject(f.model) ? { model: f.model } : {}), ...(typeof f.effort === "string" ? { effort: f.effort } : {}),
|
|
504
|
-
...(tools ? { tools } : {}), mcp, ...(toolPolicy ? { toolPolicy } : {}), parameters, secrets, ...(isObject(f.budget) ? { budget: { ...(typeof f.budget.per_run_usd === "number" ? { per_run_usd: f.budget.per_run_usd } : {}), ...(typeof f.budget.tool_calls === "number" ? { tool_calls: f.budget.tool_calls } : {}) } } : {}), ...(typeof f.learning === "boolean" ? { learning: f.learning } : {}), ...(f.approvals === "ask" || f.approvals === "never" ? { approvals: f.approvals } : {}),
|
|
525
|
+
...(tools ? { tools } : {}), mcp, ...(computer ? { computer } : {}), ...(toolPolicy ? { toolPolicy } : {}), ...(f.checkout === "pull_request" ? { checkout: "pull_request" } : {}), parameters, secrets, ...(isObject(f.budget) ? { budget: { ...(typeof f.budget.per_run_usd === "number" ? { per_run_usd: f.budget.per_run_usd } : {}), ...(typeof f.budget.tool_calls === "number" ? { tool_calls: f.budget.tool_calls } : {}) } } : {}), ...(typeof f.learning === "boolean" ? { learning: f.learning } : {}), ...(f.approvals === "ask" || f.approvals === "never" ? { approvals: f.approvals } : {}),
|
|
505
526
|
triggers: triggers, ...(isObject(f.output) ? { output: { schema: f.output.schema } } : {}), ...(isObject(outputSchema) ? { outputSchema } : {}), checks, instructions, skills, evals,
|
|
506
527
|
};
|
|
507
528
|
// What an apply makes, made here with each parameter's default, else a sample of its type, and checked as POST
|
|
@@ -509,7 +530,8 @@ export function readPackage(dir) {
|
|
|
509
530
|
// trigger's times are read as of the epoch, so its form is checked here and a date that has passed is the apply's
|
|
510
531
|
// refusal, never a server's start.
|
|
511
532
|
const samples = Object.fromEntries(Object.entries(parameters).map(([key, spec]) => [key, spec.default ?? SAMPLES[spec.type]]));
|
|
512
|
-
const
|
|
533
|
+
const declared = Object.fromEntries(MODEL_TIER_NAMES.flatMap((tier) => (p.model?.[tier] ? [[tier, p.model[tier]]] : [])));
|
|
534
|
+
const made = compiled(p, samples, { ...(harness ? { harness: harness[0] } : {}), ...(p.model?.prefer ? { model: p.model.prefer } : {}), ...(Object.keys(declared).length ? { modelTiers: declared } : {}), mcp, defaultTools: [], grants: [] });
|
|
513
535
|
for (const issue of definitionBodyIssues(made.agent))
|
|
514
536
|
bad(issue.field.startsWith("skills.") ? `skills/${issue.field.slice("skills.".length)}` : MANIFEST, `${issue.field.startsWith("skills.") ? "" : `the agent it makes: ${issue.field}: `}${issue.message}`);
|
|
515
537
|
for (const issue of madeTriggerIssues(made.triggers, 0))
|
|
@@ -540,7 +562,7 @@ export function packageView(p) {
|
|
|
540
562
|
return {
|
|
541
563
|
name: p.name, display_name: p.displayName ?? null, version: p.version, description: p.description, license: p.license ?? null, author: p.author ?? null, repository: p.repository ?? null,
|
|
542
564
|
output: p.output ? { schema: p.output.schema, json_schema: p.outputSchema ?? null } : null,
|
|
543
|
-
harness: p.harness ?? null, model: p.model ?? null, effort: p.effort ?? null, tools: p.tools ?? null, tool_policy: p.toolPolicy ?? null,
|
|
565
|
+
harness: p.harness ?? null, model: p.model ?? null, effort: p.effort ?? null, tools: p.tools ?? null, tool_policy: p.toolPolicy ?? null, computer: p.computer ?? null, checkout: p.checkout ?? null,
|
|
544
566
|
mcp: p.mcp.map(({ server, tools, required, allow, pin }) => ({ server, required, tools: tools.map((name) => ({ name, tool: mcpToolName(server, name), asks: allow.includes(name) ? "allow" : "ask", ...(Object.hasOwn(pin, name) ? { pin: pin[name] } : {}) })) })), parameters: p.parameters, secrets: p.secrets,
|
|
545
567
|
budget: p.budget ?? null, learning: p.learning ?? false, approvals_default: p.approvals ?? "ask", triggers: p.triggers, skills: Object.keys(p.skills).filter((path) => /^[^/]+\/SKILL\.md$/.test(path)).map((path) => path.slice(0, -"/SKILL.md".length)), evals: p.evals,
|
|
546
568
|
};
|
|
@@ -626,6 +648,61 @@ export async function packageModel(env, model, harness) {
|
|
|
626
648
|
const warning = [skipped, runsOn, skipped ? "overrides.model picks another the gateway serves." : undefined].filter(Boolean).join(" ");
|
|
627
649
|
return { ...(id && !bare ? { model: id } : {}), ...(warning ? { warning } : {}) };
|
|
628
650
|
}
|
|
651
|
+
/** What to do where a package's computer list has no shell to take: in the apply's refusal and its fallback warning. */
|
|
652
|
+
export const COMPUTER_FIX = "Turn on Archil in Settings → Workspace, or run AgentRun where Docker answers, then apply again to give it a shell.";
|
|
653
|
+
/** The first entry of a package's computer list (`[shell, none]`) this server meets now, given the shell it has
|
|
654
|
+
* (`here`): shell, where it has one; none, always (kind none, and no shell tool: a run on the runner in Mode 2 has bash,
|
|
655
|
+
* so a shell tool is dropped rather than left to it). Undefined for a package with no list (it runs where a new agent
|
|
656
|
+
* does); `refused`, in words, when no entry is met. The rule is the package's preference alone: nothing here knows a
|
|
657
|
+
* template. */
|
|
658
|
+
export function pickComputer(p, here) {
|
|
659
|
+
if (!p.computer)
|
|
660
|
+
return undefined;
|
|
661
|
+
// A shell that is a sandbox runs the agent in the box, where a runner-only tool (browser) is refused: such a package
|
|
662
|
+
// cannot take that shell, so its list falls to the next entry, as it does where there is no shell at all.
|
|
663
|
+
const runnerOnly = (p.tools ?? []).filter((tool) => toolOf(tool)?.runnerOnly);
|
|
664
|
+
const found = "none" in here ? undefined : here;
|
|
665
|
+
const clash = found && found.computer.kind === "sandbox" && runnerOnly.length ? `${found.words} runs ${runnerOnly.join(", ")} nowhere` : undefined;
|
|
666
|
+
const shell = clash ? undefined : found;
|
|
667
|
+
const lack = "none" in here ? here.none : clash ?? "this server has none";
|
|
668
|
+
const entry = p.computer.find((one) => one === "none" || shell);
|
|
669
|
+
if (!entry)
|
|
670
|
+
return { refused: `The ${p.name} template needs a shell, and ${lack}. Nothing was created.` };
|
|
671
|
+
const runs = entry === "shell" && shell ? shell.tools : [];
|
|
672
|
+
const dropped = (p.tools ?? []).filter((tool) => toolOf(tool)?.sandboxOnly && !runs.includes(tool));
|
|
673
|
+
const without = new Intl.ListFormat("en", { type: "conjunction" }).format(dropped);
|
|
674
|
+
const note = entry === "none" && p.computer[0] === "shell" && !shell
|
|
675
|
+
? `${lack.charAt(0).toUpperCase()}${lack.slice(1)}, so the agent was made with the template's next choice, no computer${dropped.length ? `, and without ${without}` : ""}. ${COMPUTER_FIX}`
|
|
676
|
+
: dropped.length && shell ? `The shell here is ${shell.words}, which runs ${runs.join(", ")} alone, so the agent was made without ${without}.` : null;
|
|
677
|
+
return entry === "shell" && shell
|
|
678
|
+
? { entry, computer: { ...shell.computer }, shell: shell.words, dropped, defaults: [...shell.tools], note }
|
|
679
|
+
: { entry, computer: { kind: "none" }, shell: null, dropped, defaults: [], note };
|
|
680
|
+
}
|
|
681
|
+
/** The model of each tier a package's subagents run on here (the definition's model_tiers), as `{modelTiers?, warning?}`:
|
|
682
|
+
* a tier's model the package names (`model.fast`, `model.strong`) when this server runs it on `harness` with a key for its
|
|
683
|
+
* provider, never through a gateway, as packageModel keeps `prefer`; else none, the tier then this server's own
|
|
684
|
+
* (AGENT_MODEL_FAST, AGENT_MODEL_STRONG), and a warning says so. The agent's own tier, named nowhere else, is the model
|
|
685
|
+
* the agent itself got (`own`), so a subagent on the agent's tier runs on the agent's model. */
|
|
686
|
+
export async function packageTiers(env, model, harness, own) {
|
|
687
|
+
if (!model)
|
|
688
|
+
return {};
|
|
689
|
+
const gateway = Boolean(env.AGENT_MODEL_BASE_URL);
|
|
690
|
+
const tiers = {};
|
|
691
|
+
const skipped = [];
|
|
692
|
+
for (const tier of MODEL_TIER_NAMES) {
|
|
693
|
+
const named = model[tier];
|
|
694
|
+
if (!named)
|
|
695
|
+
continue;
|
|
696
|
+
if (!gateway && harnessRuns(env, named, harness) && !("why" in (await chooseModel(env, named, tier, harness))))
|
|
697
|
+
tiers[tier] = named;
|
|
698
|
+
else
|
|
699
|
+
skipped.push(`model.${tier} ${named} is not used: ${gateway ? "this server reaches its models through a gateway, which has not said it serves that model" : "this server cannot run it"}, so the agent's ${tier} subagents run on this server's model for the tier.`);
|
|
700
|
+
}
|
|
701
|
+
const mine = MODEL_TIER_NAMES.includes(model.tier) ? model.tier : undefined;
|
|
702
|
+
if (mine && !model[mine] && own)
|
|
703
|
+
tiers[mine] = own;
|
|
704
|
+
return { ...(Object.keys(tiers).length ? { modelTiers: tiers } : {}), ...(skipped.length ? { warning: skipped.join(" ") } : {}) };
|
|
705
|
+
}
|
|
629
706
|
/** The bodies an apply makes: POST /v2/agents' (its definition and skill files) and each trigger's, with no agent_id,
|
|
630
707
|
* every `${parameters.x}` filled. `mcp`: the package's MCP servers this server has saved, whose tools are granted beside
|
|
631
708
|
* the package's tools (or, when it names none, `defaultTools`, those this server gives a new agent), each at the
|
|
@@ -637,10 +714,16 @@ export function compiled(p, parameters, chosen, _deps) {
|
|
|
637
714
|
const skills = Object.keys(p.skills).filter((path) => /^[^/]+\/SKILL\.md$/.test(path)).map((path) => path.slice(0, -"/SKILL.md".length));
|
|
638
715
|
const granted = chosen.mcp.flatMap(({ server, tools }) => tools.map((tool) => mcpToolName(server, tool)));
|
|
639
716
|
const allowed = chosen.grants.filter((tool) => granted.includes(tool));
|
|
640
|
-
|
|
717
|
+
// The computer its list picked (pickComputer): its tools less the shell tools that computer does not run; a package
|
|
718
|
+
// that names none is given that computer's shell tools, as a new agent in a box is given the box's.
|
|
719
|
+
const pick = chosen.computer;
|
|
720
|
+
const own = pick ? (p.tools ?? pick.defaults).filter((tool) => !pick.dropped.includes(tool)) : p.tools;
|
|
721
|
+
const named = own && (p.tools || own.length) ? own : undefined;
|
|
722
|
+
const tools = granted.length ? [...(named ?? (pick ? [] : chosen.defaultTools)), ...granted] : named;
|
|
641
723
|
const settings = Object.fromEntries(allowed.map((tool) => [tool, { permission: "allow" }]));
|
|
642
|
-
// A tool's policy (bash's read-only), written as its setting, whatever its permission: never one an apply grants.
|
|
643
|
-
|
|
724
|
+
// A tool's policy (bash's read-only), written as its setting, whatever its permission: never one an apply grants. With
|
|
725
|
+
// a picked computer, only where the agent's tools hold bash: none for a bash the computer dropped, or never gave.
|
|
726
|
+
if (p.toolPolicy && (!pick || tools?.includes("bash")))
|
|
644
727
|
settings.bash = { ...settings.bash, policy: p.toolPolicy.bash };
|
|
645
728
|
const unpinned = [];
|
|
646
729
|
for (const { tool: name, pin, empty } of filledPins(chosen.mcp, parameters)) {
|
|
@@ -653,13 +736,15 @@ export function compiled(p, parameters, chosen, _deps) {
|
|
|
653
736
|
}
|
|
654
737
|
const definition = {
|
|
655
738
|
name: p.displayName ? filled(p.displayName, parameters) : p.name, description: p.description, instructions: filled(p.instructions, parameters),
|
|
656
|
-
...(chosen.harness ? { harness: chosen.harness } : {}), ...(chosen.model ? { model: chosen.model } : {}), ...(p.effort ? { thinking: p.effort } : {}),
|
|
657
|
-
...(tools ? { tools } : {}), ...(Object.keys(settings).length ? { tool_settings: settings } : {}),
|
|
739
|
+
...(chosen.harness ? { harness: chosen.harness } : {}), ...(chosen.model ? { model: chosen.model } : {}), ...(chosen.modelTiers && Object.keys(chosen.modelTiers).length ? { model_tiers: chosen.modelTiers } : {}), ...(p.effort ? { thinking: p.effort } : {}),
|
|
740
|
+
...(pick ? { computer: pick.computer } : {}), ...(tools ? { tools } : {}), ...(Object.keys(settings).length ? { tool_settings: settings } : {}),
|
|
658
741
|
...(p.learning !== undefined ? { learning: p.learning } : {}), ...(p.budget?.per_run_usd ? { max_cost_usd: p.budget.per_run_usd } : {}), ...(p.budget?.tool_calls ? { max_tool_calls: p.budget.tool_calls } : {}), skills,
|
|
659
742
|
// The apply's choice: unattended only when it says never (none given: the agent asks).
|
|
660
743
|
...(chosen.approvals === "never" ? { approvals: "never" } : {}),
|
|
661
744
|
// The package's answer schema (manifest `output`): each completed run's structured answer, checked, is its result.output.
|
|
662
745
|
...(isObject(p.outputSchema) ? { output_schema: p.outputSchema } : {}),
|
|
746
|
+
// The package's checkout (manifest `checkout`): the server fetches it before each run's first turn.
|
|
747
|
+
...(p.checkout ? { checkout: p.checkout } : {}),
|
|
663
748
|
};
|
|
664
749
|
return { agent: { definition, skills: { ...p.skills } }, triggers: p.triggers.map((trigger) => filled(trigger, parameters)), unpinned };
|
|
665
750
|
}
|
|
@@ -50,6 +50,10 @@ export type TimelineEvent = {
|
|
|
50
50
|
* server and its id ending NOTE_SUFFIX: the request was not sent and the run paused for a raise; a pause, never a
|
|
51
51
|
* failure, whether the run waits on its cap now or was raised since. */
|
|
52
52
|
paused?: true;
|
|
53
|
+
/** `true` on the `tool_result` row of a call refused before it ran (its host's mark, CALL_REFUSED: a gate's deny, a
|
|
54
|
+
* person's, a call held for an approval the run ended or stopped without): it never ran, so it never failed, though
|
|
55
|
+
* `tool_status` stays `failed` (it did not do its work). A client shows it apart from a call that ran and failed. */
|
|
56
|
+
refused?: true;
|
|
53
57
|
/** On the usage row, the run's cost. On a paid tool's charge row (a `phase` naming the tool), that charge alone. On a
|
|
54
58
|
* browser call's `tool_use` row, every browser charge booked under that call (BROWSER_CHARGE): its session's time
|
|
55
59
|
* since its last charge, and its release's when it was the session's last call. `requests` is 0 on all but the usage
|
|
@@ -70,7 +74,27 @@ export type TimelineEvent = {
|
|
|
70
74
|
kind: string;
|
|
71
75
|
status: string;
|
|
72
76
|
duration_ms: number;
|
|
77
|
+
model?: string;
|
|
78
|
+
tier?: string;
|
|
73
79
|
}[];
|
|
80
|
+
/** On a tool call's `tool_result` row: each computer protocol call the tool made, in order (serve's computer-calls.ts):
|
|
81
|
+
* its method, whether it answered, its ms, its error's code, and for ui.act each step's kind, route and readback.
|
|
82
|
+
* Never a param's value or an answer's bytes. `computer_calls_dropped` counts the calls past the record's bound. This
|
|
83
|
+
* projector writes none (store-reads/journal.ts withComputerCalls). */
|
|
84
|
+
computer_calls?: readonly {
|
|
85
|
+
readonly method: string;
|
|
86
|
+
readonly ok: boolean;
|
|
87
|
+
readonly ms: number;
|
|
88
|
+
readonly code?: string;
|
|
89
|
+
readonly steps?: readonly {
|
|
90
|
+
readonly do: string;
|
|
91
|
+
readonly route?: string;
|
|
92
|
+
readonly verified?: boolean;
|
|
93
|
+
readonly error?: string;
|
|
94
|
+
}[];
|
|
95
|
+
readonly expect?: "met" | "unmet";
|
|
96
|
+
}[];
|
|
97
|
+
computer_calls_dropped?: number;
|
|
74
98
|
};
|
|
75
99
|
/** A pi conversation entry as stored: `pi.assistant`, `pi.tool-result`, a host's own kind. */
|
|
76
100
|
export type EntryLike = {
|
|
@@ -172,6 +196,11 @@ export type TimelineOptions = {
|
|
|
172
196
|
caps?: Partial<typeof CAPS>;
|
|
173
197
|
/** Nothing is running: a call with no result is interrupted. */
|
|
174
198
|
settled?: boolean;
|
|
199
|
+
/** The run's newest turn is over, cut by a stop or a cancel, while its process may live on: nothing of that turn is in
|
|
200
|
+
* flight, so the usage row counts a request marked with no answer or end, and a paid call marked with no charge, as
|
|
201
|
+
* cut, as a settled read counts them. The marks the runner writes once it has booked what the abort cut can land after
|
|
202
|
+
* the turn reads over; they change nothing then. Its rows are as they are. */
|
|
203
|
+
turnCut?: boolean;
|
|
175
204
|
/** The run has ended (completed, failed, cancelled): its usage row says its cost ("Cost: …"), never what it has cost
|
|
176
205
|
* "so far". A run settled and not ended (paused, its process let go) keeps "Cost so far". */
|
|
177
206
|
ended?: boolean;
|
|
@@ -248,7 +277,7 @@ export declare function timelineOf(entries: readonly EntryLike[], options?: Time
|
|
|
248
277
|
* runner's loop parks on exactly the turn ends the view would call waiting, and the two can never disagree; the id is the
|
|
249
278
|
* call the park entry names. Truthy when it waits, undefined when it does not. */
|
|
250
279
|
export declare function endedOnTurnEndingTool(entries: readonly EntryLike[]): string | undefined;
|
|
251
|
-
/** A workflow's decision receipt as its run's store keeps it (
|
|
280
|
+
/** A workflow's decision receipt as its run's store keeps it (workflow/decisions.ts's DecisionRow): the fields
|
|
252
281
|
* runMetricsOf reads. */
|
|
253
282
|
export type DecisionLike = {
|
|
254
283
|
usage?: unknown;
|