@parcha/agentrun-serve 0.1.0-beta.30 → 0.1.0-beta.32
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 +472 -0
- package/NOTICE +18 -0
- package/README.md +1042 -240
- package/dist/adapter-facts.d.ts +3 -0
- package/dist/adapter-facts.js +5 -0
- package/dist/adapters.d.ts +64 -140
- package/dist/adapters.js +153 -377
- package/dist/agents-store.d.ts +146 -0
- package/dist/agents-store.js +359 -0
- package/dist/agents.d.ts +12 -5
- package/dist/agents.js +40 -17
- package/dist/app.d.ts +2 -4
- package/dist/app.js +227 -97
- package/dist/approvals.d.ts +4 -0
- package/dist/approvals.js +7 -0
- package/dist/archil-routes.d.ts +45 -0
- package/dist/archil-routes.js +150 -0
- package/dist/archil-settings.d.ts +30 -0
- package/dist/archil-settings.js +34 -0
- package/dist/background.d.ts +2 -1
- package/dist/background.js +69 -29
- package/dist/bounds.d.ts +26 -0
- package/dist/bounds.js +137 -0
- package/dist/box-egress-vm.d.ts +126 -0
- package/dist/box-egress-vm.js +364 -0
- package/dist/box-egress.d.ts +19 -8
- package/dist/box-egress.js +27 -15
- package/dist/box-paths.d.ts +59 -0
- package/dist/box-paths.js +92 -0
- package/dist/box-relay-vm.d.ts +4 -0
- package/dist/box-relay-vm.js +103 -55
- package/dist/box-relay.d.ts +2 -0
- package/dist/box-relay.js +2 -2
- package/dist/boxes.d.ts +20 -3
- package/dist/boxes.js +67 -14
- package/dist/browser-commands.d.ts +43 -0
- package/dist/browser-commands.js +154 -0
- package/dist/browser-cost.d.ts +30 -3
- package/dist/browser-cost.js +276 -21
- package/dist/browser-live.d.ts +124 -0
- package/dist/browser-live.js +324 -0
- package/dist/browser-person.d.ts +168 -0
- package/dist/browser-person.js +769 -0
- package/dist/budget.d.ts +80 -0
- package/dist/budget.js +211 -0
- package/dist/cap.d.ts +274 -63
- package/dist/cap.js +599 -188
- package/dist/cli.js +226 -16
- package/dist/coding-tools.d.ts +13 -1
- package/dist/coding-tools.js +107 -5
- package/dist/computer-adb.d.ts +12 -0
- package/dist/computer-adb.js +14 -0
- package/dist/computer-commands.d.ts +103 -0
- package/dist/computer-commands.js +256 -0
- package/dist/computer-keys.d.ts +68 -0
- package/dist/computer-keys.js +148 -0
- package/dist/computer-routes.d.ts +38 -0
- package/dist/computer-routes.js +56 -0
- package/dist/computer-setting.d.ts +37 -0
- package/dist/computer-setting.js +47 -0
- package/dist/computer-view.d.ts +38 -0
- package/dist/computer-view.js +14 -0
- package/dist/computers.d.ts +137 -0
- package/dist/computers.js +197 -0
- package/dist/console/THIRD-PARTY-NOTICES.txt +25 -0
- package/dist/console/assets/index-35-7aeIZ.js +519 -0
- package/dist/console/assets/index-Cejbov-Y.css +1 -0
- package/dist/console/index.html +2 -2
- package/dist/console-links.d.ts +2 -0
- package/dist/console-links.js +6 -0
- package/dist/decision-cap.d.ts +63 -0
- package/dist/decision-cap.js +163 -0
- package/dist/decision-rows.d.ts +5 -2
- package/dist/decision-rows.js +8 -6
- package/dist/decisions.d.ts +31 -4
- package/dist/decisions.js +66 -8
- package/dist/disk.d.ts +33 -0
- package/dist/disk.js +85 -0
- package/dist/door-line.d.ts +23 -0
- package/dist/door-line.js +83 -0
- package/dist/egress-proxy.d.ts +45 -0
- package/dist/egress-proxy.js +416 -0
- package/dist/egress-table.d.ts +24 -0
- package/dist/egress-table.js +165 -0
- package/dist/errors.d.ts +15 -0
- package/dist/errors.js +22 -2
- package/dist/exa-keyless.js +1 -1
- package/dist/explain.d.ts +22 -0
- package/dist/explain.js +207 -0
- package/dist/faux-computers.d.ts +35 -0
- package/dist/faux-computers.js +126 -0
- package/dist/file-types.d.ts +4 -0
- package/dist/file-types.js +11 -0
- package/dist/files.d.ts +3 -32
- package/dist/files.js +9 -117
- package/dist/github-connection.d.ts +207 -0
- package/dist/github-connection.js +595 -0
- package/dist/github.d.ts +64 -0
- package/dist/github.js +119 -0
- package/dist/grade.d.ts +14 -44
- package/dist/grade.js +55 -233
- package/dist/graph-served.d.ts +23 -2
- package/dist/graph-served.js +44 -3
- package/dist/graph-view.d.ts +7 -3
- package/dist/graph-view.js +26 -15
- package/dist/handed-values.d.ts +23 -0
- package/dist/handed-values.js +36 -0
- package/dist/harness-app.d.ts +33 -4
- package/dist/harness-app.js +539 -85
- package/dist/harness-install.d.ts +120 -0
- package/dist/harness-install.js +359 -0
- package/dist/harness-opencode/adapter.js +42 -8
- package/dist/harness-opencode/facts.d.ts +2 -0
- package/dist/harness-opencode/facts.js +28 -0
- package/dist/harness-opencode/harness.d.ts +4 -0
- package/dist/harness-opencode/harness.js +38 -5
- package/dist/harness-opencode/host/policy.js +11 -3
- package/dist/harness-opencode/transcript.d.ts +25 -0
- package/dist/harness-opencode/transcript.js +81 -0
- package/dist/harness-table.d.ts +75 -0
- package/dist/harness-table.js +145 -0
- package/dist/harness.d.ts +7 -28
- package/dist/harness.js +15 -41
- package/dist/heard.d.ts +12 -0
- package/dist/heard.js +45 -0
- package/dist/helper-env.d.ts +4 -0
- package/dist/helper-env.js +14 -0
- package/dist/home-path.d.ts +0 -4
- package/dist/home-path.js +3 -17
- package/dist/host-check.d.ts +13 -0
- package/dist/host-check.js +35 -0
- package/dist/host-tools.d.ts +51 -8
- package/dist/host-tools.js +108 -117
- package/dist/host.d.ts +12 -6
- package/dist/host.js +30 -24
- package/dist/hosted-search.d.ts +3 -0
- package/dist/hosted-search.js +5 -3
- package/dist/import-proxy.d.ts +42 -0
- package/dist/import-proxy.js +105 -0
- package/dist/import-summary.js +4 -8
- package/dist/import-worker.d.ts +2 -3
- package/dist/import-worker.js +18 -16
- package/dist/import.d.ts +37 -17
- package/dist/import.js +208 -222
- package/dist/key-meta.d.ts +26 -0
- package/dist/key-meta.js +30 -0
- package/dist/key-refusal.d.ts +4 -1
- package/dist/key-refusal.js +20 -7
- package/dist/key-words.d.ts +37 -0
- package/dist/key-words.js +40 -0
- package/dist/learn/check.d.ts +3 -1
- package/dist/learn/check.js +2 -2
- package/dist/learn/commit.d.ts +86 -0
- package/dist/learn/commit.js +182 -0
- package/dist/learn/folder.d.ts +296 -0
- package/dist/learn/folder.js +796 -0
- package/dist/learn/grade.d.ts +25 -9
- package/dist/learn/grade.js +98 -50
- package/dist/learn/index.d.ts +2 -2
- package/dist/learn/index.js +2 -2
- package/dist/learn/learning.sh +366 -0
- package/dist/learn/reflect.d.ts +12 -5
- package/dist/learn/reflect.js +72 -41
- package/dist/learn/secrets.d.ts +15 -7
- package/dist/learn/secrets.js +66 -16
- package/dist/learn/seed-check.d.ts +74 -0
- package/dist/learn/seed-check.js +103 -0
- package/dist/learn/skills.d.ts +7 -1
- package/dist/learn/skills.js +21 -4
- package/dist/learned-workflow.d.ts +12 -2
- package/dist/learned-workflow.js +9 -5
- package/dist/learning-routes.d.ts +107 -31
- package/dist/learning-routes.js +358 -403
- package/dist/learning-run.d.ts +61 -54
- package/dist/learning-run.js +183 -205
- package/dist/learning-words.d.ts +10 -8
- package/dist/learning-words.js +29 -13
- package/dist/learning.d.ts +186 -113
- package/dist/learning.js +345 -381
- package/dist/live/stream.d.ts +30 -0
- package/dist/live/stream.js +175 -0
- package/dist/live/translate.d.ts +52 -0
- package/dist/live/translate.js +276 -0
- package/dist/llm.js +3 -0
- package/dist/llms.txt +1 -0
- package/dist/local-models.d.ts +23 -0
- package/dist/local-models.js +35 -0
- package/dist/mcp-gateway.d.ts +129 -0
- package/dist/mcp-gateway.js +508 -0
- package/dist/mcp-meta.d.ts +20 -0
- package/dist/mcp-meta.js +50 -0
- package/dist/mcp-oauth.d.ts +172 -0
- package/dist/mcp-oauth.js +403 -0
- package/dist/mcp-private-hosts.d.ts +48 -0
- package/dist/mcp-private-hosts.js +141 -0
- package/dist/mcp-probe.d.ts +101 -0
- package/dist/mcp-probe.js +359 -0
- package/dist/mcp-secret-writes.d.ts +23 -0
- package/dist/mcp-secret-writes.js +60 -0
- package/dist/mcp-servers-store.d.ts +251 -0
- package/dist/mcp-servers-store.js +447 -0
- package/dist/mcp-servers.d.ts +185 -34
- package/dist/mcp-servers.js +304 -298
- package/dist/mcp-store.d.ts +103 -0
- package/dist/mcp-store.js +123 -0
- package/dist/mcp.js +22 -21
- package/dist/model.d.ts +77 -59
- package/dist/model.js +237 -98
- package/dist/monid.d.ts +8 -6
- package/dist/monid.js +39 -25
- package/dist/openapi.d.ts +22 -1
- package/dist/openapi.js +965 -111
- package/dist/owner.d.ts +46 -10
- package/dist/owner.js +123 -43
- package/dist/page.d.ts +12 -0
- package/dist/page.js +28 -2
- package/dist/paid-calls.d.ts +71 -2
- package/dist/paid-calls.js +125 -5
- package/dist/pdf-pages.d.ts +16 -14
- package/dist/pdf-pages.js +88 -58
- package/dist/place.d.ts +18 -15
- package/dist/place.js +36 -18
- package/dist/port-models.d.ts +53 -0
- package/dist/port-models.js +93 -0
- package/dist/print.d.ts +7 -0
- package/dist/print.js +13 -0
- package/dist/propose.d.ts +9 -8
- package/dist/propose.js +82 -49
- package/dist/provider.d.ts +85 -0
- package/dist/provider.js +178 -0
- package/dist/push-handler.d.ts +52 -0
- package/dist/push-handler.js +165 -0
- package/dist/refusal-words.d.ts +23 -0
- package/dist/refusal-words.js +25 -0
- package/dist/request-start.d.ts +6 -1
- package/dist/request-start.js +41 -10
- package/dist/result.d.ts +13 -2
- package/dist/result.js +4 -5
- package/dist/run-box.d.ts +22 -3
- package/dist/run-box.js +91 -20
- package/dist/run-computer.d.ts +24 -0
- package/dist/run-computer.js +15 -0
- package/dist/run-cut.d.ts +33 -0
- package/dist/run-cut.js +42 -0
- package/dist/run-db.d.ts +64 -0
- package/dist/run-db.js +155 -0
- package/dist/run-files.d.ts +31 -0
- package/dist/run-files.js +125 -0
- package/dist/run-holder.d.ts +52 -0
- package/dist/run-holder.js +139 -0
- package/dist/run-launch.d.ts +72 -0
- package/dist/run-launch.js +108 -0
- package/dist/run-learning-served.d.ts +43 -0
- package/dist/run-learning-served.js +16 -0
- package/dist/run-manifest.d.ts +7 -6
- package/dist/run-manifest.js +20 -10
- package/dist/run-reads-over-store.d.ts +102 -0
- package/dist/run-reads-over-store.js +151 -0
- package/dist/run-timeline-served.d.ts +13 -0
- package/dist/run-timeline-served.js +69 -0
- package/dist/run-view.d.ts +436 -0
- package/dist/run-view.js +620 -0
- package/dist/runnable.d.ts +36 -4
- package/dist/runnable.js +157 -31
- package/dist/runner/adapter-loop.d.ts +237 -0
- package/dist/runner/adapter-loop.js +1625 -0
- package/dist/runner/adapter-run-spec.d.ts +216 -0
- package/dist/runner/adapter-run-spec.js +537 -0
- package/dist/runner/adapters/index.d.ts +37 -0
- package/dist/runner/adapters/index.js +66 -0
- package/dist/runner/adapters/pi.d.ts +99 -0
- package/dist/runner/adapters/pi.js +260 -0
- package/dist/runner/beside.d.ts +12 -0
- package/dist/runner/beside.js +30 -0
- package/dist/runner/claim-secrets.d.ts +30 -0
- package/dist/runner/claim-secrets.js +90 -0
- package/dist/runner/cli-run-spec.d.ts +17 -0
- package/dist/runner/cli-run-spec.js +371 -0
- package/dist/runner/commands.d.ts +23 -0
- package/dist/runner/commands.js +67 -0
- package/dist/runner/computer-journal.d.ts +38 -0
- package/dist/runner/computer-journal.js +120 -0
- package/dist/runner/conformance/child.d.ts +1 -0
- package/dist/runner/conformance/child.js +78 -0
- package/dist/runner/conformance/harness.d.ts +89 -0
- package/dist/runner/conformance/harness.js +928 -0
- package/dist/runner/conformance/subject.d.ts +83 -0
- package/dist/runner/conformance/subject.js +1 -0
- package/dist/runner/dispatch.d.ts +30 -0
- package/dist/runner/dispatch.js +99 -0
- package/dist/runner/end-of-run.d.ts +32 -0
- package/dist/runner/end-of-run.js +56 -0
- package/dist/runner/github-app.d.ts +16 -0
- package/dist/runner/github-app.js +37 -0
- package/dist/runner/hand-back.d.ts +43 -0
- package/dist/runner/hand-back.js +69 -0
- package/dist/runner/harness-loops.d.ts +10 -0
- package/dist/runner/harness-loops.js +70 -0
- package/dist/runner/journal-kinds.d.ts +211 -0
- package/dist/runner/journal-kinds.js +116 -0
- package/dist/runner/journal-reader.d.ts +44 -0
- package/dist/runner/journal-reader.js +127 -0
- package/dist/runner/learning-ask.d.ts +37 -0
- package/dist/runner/learning-ask.js +99 -0
- package/dist/runner/learning-dispatch.d.ts +38 -0
- package/dist/runner/learning-dispatch.js +75 -0
- package/dist/runner/learning-end.d.ts +31 -0
- package/dist/runner/learning-end.js +136 -0
- package/dist/runner/learning-factory.d.ts +13 -0
- package/dist/runner/learning-factory.js +37 -0
- package/dist/runner/learning-loop.d.ts +150 -0
- package/dist/runner/learning-loop.js +246 -0
- package/dist/runner/learning-seed.d.ts +30 -0
- package/dist/runner/learning-seed.js +41 -0
- package/dist/runner/live-ticker.d.ts +18 -0
- package/dist/runner/live-ticker.js +88 -0
- package/dist/runner/loop-contract.d.ts +153 -0
- package/dist/runner/loop-contract.js +26 -0
- package/dist/runner/loop.d.ts +79 -0
- package/dist/runner/loop.js +185 -0
- package/dist/runner/main.d.ts +89 -0
- package/dist/runner/main.js +282 -0
- package/dist/runner/mcp-claim.d.ts +67 -0
- package/dist/runner/mcp-claim.js +403 -0
- package/dist/runner/mcp-github.d.ts +53 -0
- package/dist/runner/mcp-github.js +91 -0
- package/dist/runner/mcp-run.d.ts +116 -0
- package/dist/runner/mcp-run.js +152 -0
- package/dist/runner/metrics.d.ts +18 -0
- package/dist/runner/metrics.js +24 -0
- package/dist/runner/model-route.d.ts +111 -0
- package/dist/runner/model-route.js +183 -0
- package/dist/runner/pi-stop.d.ts +6 -0
- package/dist/runner/pi-stop.js +8 -0
- package/dist/runner/redact.d.ts +26 -0
- package/dist/runner/redact.js +51 -0
- package/dist/runner/reflect-hook.d.ts +81 -0
- package/dist/runner/reflect-hook.js +111 -0
- package/dist/runner/runner.d.ts +114 -0
- package/dist/runner/runner.js +672 -0
- package/dist/runner/sessions.d.ts +9 -0
- package/dist/runner/sessions.js +145 -0
- package/dist/runner/side-effects.d.ts +19 -0
- package/dist/runner/side-effects.js +20 -0
- package/dist/runner/spec-holds.d.ts +41 -0
- package/dist/runner/spec-holds.js +58 -0
- package/dist/runner/store-port.d.ts +9 -0
- package/dist/runner/store-port.js +7 -0
- package/dist/runner/store-secrets.d.ts +11 -0
- package/dist/runner/store-secrets.js +105 -0
- package/dist/runner/workflow-adapters.d.ts +1 -0
- package/dist/runner/workflow-adapters.js +4 -0
- package/dist/runner/workflow-host.d.ts +88 -0
- package/dist/runner/workflow-host.js +66 -0
- package/dist/runner/workflow-loop.d.ts +126 -0
- package/dist/runner/workflow-loop.js +372 -0
- package/dist/runner/workflow-spec.d.ts +157 -0
- package/dist/runner/workflow-spec.js +801 -0
- package/dist/runs-over-store.d.ts +203 -0
- package/dist/runs-over-store.js +396 -0
- package/dist/runs.d.ts +360 -222
- package/dist/runs.js +1619 -536
- package/dist/seal-key.d.ts +30 -0
- package/dist/seal-key.js +141 -0
- package/dist/sealed-settings-store.d.ts +71 -0
- package/dist/sealed-settings-store.js +205 -0
- package/dist/sealed-settings.d.ts +60 -0
- package/dist/sealed-settings.js +178 -0
- package/dist/secret-writes.d.ts +147 -0
- package/dist/secret-writes.js +144 -0
- package/dist/secrets.d.ts +22 -0
- package/dist/secrets.js +37 -4
- package/dist/served-only.d.ts +5 -0
- package/dist/served-only.js +12 -0
- package/dist/server-approvers.d.ts +8 -0
- package/dist/server-approvers.js +12 -0
- package/dist/server-fs.d.ts +40 -0
- package/dist/server-fs.js +138 -0
- package/dist/server-keys.d.ts +18 -0
- package/dist/server-keys.js +31 -0
- package/dist/server-lock.js +1 -1
- package/dist/server-secrets-store.d.ts +18 -0
- package/dist/server-secrets-store.js +54 -0
- package/dist/server-secrets.d.ts +23 -0
- package/dist/server-secrets.js +73 -0
- package/dist/server.d.ts +152 -74
- package/dist/server.js +1757 -588
- package/dist/sessions.d.ts +3 -1
- package/dist/sessions.js +8 -4
- package/dist/sign-ins-secrets.d.ts +35 -0
- package/dist/sign-ins-secrets.js +109 -0
- package/dist/sign-ins-store.d.ts +200 -0
- package/dist/sign-ins-store.js +373 -0
- package/dist/sign-ins.d.ts +43 -7
- package/dist/sign-ins.js +94 -18
- package/dist/skills.d.ts +6 -5
- package/dist/skills.js +18 -14
- package/dist/standard-webhooks.d.ts +30 -0
- package/dist/standard-webhooks.js +72 -0
- package/dist/stats.d.ts +5 -7
- package/dist/stats.js +8 -24
- package/dist/stop-signals.d.ts +22 -0
- package/dist/stop-signals.js +38 -0
- package/dist/store/agent-body.d.ts +103 -0
- package/dist/store/agent-body.js +126 -0
- package/dist/store/dialect.d.ts +59 -0
- package/dist/store/dialect.js +32 -0
- package/dist/store/fence.d.ts +22 -0
- package/dist/store/fence.js +15 -0
- package/dist/store/index.d.ts +17 -0
- package/dist/store/index.js +17 -0
- package/dist/store/journal/storage.d.ts +137 -0
- package/dist/store/journal/storage.js +1021 -0
- package/dist/store/open.d.ts +34 -0
- package/dist/store/open.js +30 -0
- package/dist/store/postgres/connection.d.ts +74 -0
- package/dist/store/postgres/connection.js +532 -0
- package/dist/store/postgres/dialect.d.ts +9 -0
- package/dist/store/postgres/dialect.js +39 -0
- package/dist/store/postgres/migrate.d.ts +21 -0
- package/dist/store/postgres/migrate.js +106 -0
- package/dist/store/postgres/migrations/0001_initial.sql +418 -0
- package/dist/store/postgres/migrations/0002_external_agents.sql +14 -0
- package/dist/store/postgres/store.d.ts +37 -0
- package/dist/store/postgres/store.js +48 -0
- package/dist/store/prompts.d.ts +11 -0
- package/dist/store/prompts.js +112 -0
- package/dist/store/schema.d.ts +26 -0
- package/dist/store/schema.js +522 -0
- package/dist/store/seal.d.ts +48 -0
- package/dist/store/seal.js +69 -0
- package/dist/store/sqlite/connection.d.ts +105 -0
- package/dist/store/sqlite/connection.js +309 -0
- package/dist/store/sqlite/memory.d.ts +2 -0
- package/dist/store/sqlite/memory.js +4 -0
- package/dist/store/sqlite/run-launch.d.ts +8 -0
- package/dist/store/sqlite/run-launch.js +20 -0
- package/dist/store/sqlite/run-patch.d.ts +54 -0
- package/dist/store/sqlite/run-patch.js +114 -0
- package/dist/store/sqlite/store.d.ts +33 -0
- package/dist/store/sqlite/store.js +1337 -0
- package/dist/store/sqlite/worker.d.ts +78 -0
- package/dist/store/sqlite/worker.js +242 -0
- package/dist/store/store.d.ts +1253 -0
- package/dist/store/store.js +190 -0
- package/dist/store-reads/analytics.d.ts +55 -0
- package/dist/store-reads/analytics.js +135 -0
- package/dist/store-reads/cap.d.ts +17 -0
- package/dist/store-reads/cap.js +17 -0
- package/dist/store-reads/decisions.d.ts +5 -0
- package/dist/store-reads/decisions.js +31 -0
- package/dist/store-reads/import-summary.d.ts +6 -0
- package/dist/store-reads/import-summary.js +14 -0
- package/dist/store-reads/journal.d.ts +30 -0
- package/dist/store-reads/journal.js +120 -0
- package/dist/store-reads/learning.d.ts +93 -0
- package/dist/store-reads/learning.js +202 -0
- package/dist/store-reads/runs.d.ts +42 -0
- package/dist/store-reads/runs.js +84 -0
- package/dist/store-reads/stats.d.ts +30 -0
- package/dist/store-reads/stats.js +59 -0
- package/dist/store-reads/workflow.d.ts +7 -0
- package/dist/store-reads/workflow.js +14 -0
- package/dist/store-view.d.ts +37 -0
- package/dist/store-view.js +305 -0
- package/dist/template-eval.d.ts +239 -0
- package/dist/template-eval.js +1020 -0
- package/dist/template-github-permissions.d.ts +18 -0
- package/dist/template-github-permissions.js +32 -0
- package/dist/templates.d.ts +199 -0
- package/dist/templates.js +637 -0
- package/dist/tool-blurbs.d.ts +4 -0
- package/dist/tool-blurbs.js +27 -0
- package/dist/tool-gate.d.ts +183 -37
- package/dist/tool-gate.js +450 -99
- package/dist/tool-keys-store.d.ts +110 -0
- package/dist/tool-keys-store.js +291 -0
- package/dist/tool-keys.d.ts +27 -13
- package/dist/tool-keys.js +24 -10
- package/dist/tool-plane.d.ts +115 -25
- package/dist/tool-plane.js +251 -74
- package/dist/tool-settings-store.d.ts +30 -0
- package/dist/tool-settings-store.js +53 -0
- package/dist/tools.d.ts +95 -24
- package/dist/tools.js +344 -65
- package/dist/trigger-accept.d.ts +36 -0
- package/dist/trigger-accept.js +152 -0
- package/dist/trigger-adapter.d.ts +143 -0
- package/dist/trigger-adapter.js +31 -0
- package/dist/trigger-adapters.d.ts +2 -0
- package/dist/trigger-adapters.js +4 -0
- package/dist/trigger-github.d.ts +2 -0
- package/dist/trigger-github.js +85 -0
- package/dist/trigger-schedule.d.ts +6 -0
- package/dist/trigger-schedule.js +115 -0
- package/dist/trigger-secrets-shown.d.ts +66 -0
- package/dist/trigger-secrets-shown.js +77 -0
- package/dist/trigger-signatures.d.ts +58 -0
- package/dist/trigger-signatures.js +79 -0
- package/dist/trigger-targets.d.ts +46 -0
- package/dist/trigger-targets.js +95 -0
- package/dist/trigger-webhook.d.ts +2 -0
- package/dist/trigger-webhook.js +92 -0
- package/dist/triggers.d.ts +282 -237
- package/dist/triggers.js +720 -608
- package/dist/turn-end.d.ts +3 -0
- package/dist/turn-end.js +3 -0
- package/dist/uploads.d.ts +10 -8
- package/dist/uploads.js +45 -45
- package/dist/usage.d.ts +33 -3
- package/dist/usage.js +38 -4
- package/dist/validate.d.ts +6 -0
- package/dist/validate.js +42 -12
- package/dist/{fetch-page.d.ts → web-fetch-direct.d.ts} +2 -4
- package/dist/{fetch-page.js → web-fetch-direct.js} +2 -4
- package/dist/web-fetch.d.ts +17 -9
- package/dist/web-fetch.js +56 -21
- package/dist/web-search.d.ts +1 -1
- package/dist/web-search.js +1 -1
- package/dist/webhooks.d.ts +33 -23
- package/dist/webhooks.js +69 -56
- package/dist/wires.d.ts +11 -0
- package/dist/wires.js +7 -0
- package/dist/workspace/archil-claim.d.ts +57 -0
- package/dist/workspace/archil-claim.js +154 -0
- package/dist/workspace/archil-disk.d.ts +104 -0
- package/dist/workspace/archil-disk.js +254 -0
- package/dist/workspace/archil-exec.d.ts +59 -0
- package/dist/workspace/archil-exec.js +218 -0
- package/dist/workspace/archil-key.d.ts +17 -0
- package/dist/workspace/archil-key.js +30 -0
- package/dist/workspace/archil-mount-credential.d.ts +58 -0
- package/dist/workspace/archil-mount-credential.js +165 -0
- package/dist/workspace/archil.d.ts +59 -0
- package/dist/workspace/archil.js +676 -0
- package/dist/workspace/attach.d.ts +48 -0
- package/dist/workspace/attach.js +439 -0
- package/dist/workspace/computer-deps.d.ts +58 -0
- package/dist/workspace/computer-deps.js +113 -0
- package/dist/workspace/computer-for-claim.d.ts +115 -0
- package/dist/workspace/computer-for-claim.js +198 -0
- package/dist/workspace/computer-hold.d.ts +145 -0
- package/dist/workspace/computer-hold.js +258 -0
- package/dist/workspace/computer-ledger.d.ts +22 -0
- package/dist/workspace/computer-ledger.js +19 -0
- package/dist/workspace/computer-ports.d.ts +13 -0
- package/dist/workspace/computer-ports.js +108 -0
- package/dist/workspace/computer-providers.d.ts +12 -0
- package/dist/workspace/computer-providers.js +17 -0
- package/dist/workspace/computer-serves.d.ts +12 -0
- package/dist/workspace/computer-serves.js +15 -0
- package/dist/workspace/executors.d.ts +38 -0
- package/dist/workspace/executors.js +150 -0
- package/dist/workspace/glob.d.ts +2 -0
- package/dist/workspace/glob.js +25 -0
- package/dist/workspace/grep-worker.d.ts +11 -0
- package/dist/workspace/grep-worker.js +91 -0
- package/dist/workspace/hands.d.ts +25 -0
- package/dist/workspace/hands.js +121 -0
- package/dist/workspace/index.d.ts +23 -0
- package/dist/workspace/index.js +25 -0
- package/dist/workspace/kind-skills/desktop/SKILL.md +106 -0
- package/dist/workspace/kind-skills/phone/SKILL.md +116 -0
- package/dist/workspace/kind-skills.d.ts +11 -0
- package/dist/workspace/kind-skills.js +16 -0
- package/dist/workspace/learning-workspace.d.ts +24 -0
- package/dist/workspace/learning-workspace.js +107 -0
- package/dist/workspace/local.d.ts +6 -0
- package/dist/workspace/local.js +632 -0
- package/dist/workspace/paths.d.ts +48 -0
- package/dist/workspace/paths.js +134 -0
- package/dist/workspace/pi-env.d.ts +39 -0
- package/dist/workspace/pi-env.js +397 -0
- package/dist/workspace/place.d.ts +7 -0
- package/dist/workspace/place.js +3 -0
- package/dist/workspace/resolve-computer.d.ts +106 -0
- package/dist/workspace/resolve-computer.js +188 -0
- package/dist/workspace/revision-skills.d.ts +15 -0
- package/dist/workspace/revision-skills.js +42 -0
- package/dist/workspace/run-tools.d.ts +173 -0
- package/dist/workspace/run-tools.js +172 -0
- package/dist/workspace/run-workspace.d.ts +25 -0
- package/dist/workspace/run-workspace.js +56 -0
- package/dist/workspace/server-run-workspace.d.ts +24 -0
- package/dist/workspace/server-run-workspace.js +84 -0
- package/dist/workspace/workspace.d.ts +169 -0
- package/dist/workspace/workspace.js +54 -0
- package/dist/workspace-paths.d.ts +1 -10
- package/dist/workspace-paths.js +3 -37
- package/dist/workspace.d.ts +3 -17
- package/dist/workspace.js +6 -74
- package/harnesses/claude-agent/package-lock.json +1533 -0
- package/harnesses/claude-agent/package.json +7 -0
- package/harnesses/codex/package-lock.json +135 -0
- package/harnesses/codex/package.json +7 -0
- package/launcher/agentrun-serve +13 -3
- package/package.json +36 -25
- package/skills/agentrun-serve/SKILL.md +2 -0
- package/templates/README.md +211 -0
- package/templates/code-review/agent.md +50 -0
- package/templates/code-review/evals/clean-refactor/case.yaml +3 -0
- package/templates/code-review/evals/clean-refactor/graders/empty.md +5 -0
- package/templates/code-review/evals/clean-refactor/graders/schema.md +5 -0
- package/templates/code-review/evals/clean-refactor/prompt.md +31 -0
- package/templates/code-review/evals/injection/case.yaml +3 -0
- package/templates/code-review/evals/injection/graders/ignores.md +4 -0
- package/templates/code-review/evals/injection/graders/schema.md +5 -0
- package/templates/code-review/evals/injection/prompt.md +23 -0
- package/templates/code-review/evals/null-name/case.yaml +3 -0
- package/templates/code-review/evals/null-name/graders/finds.md +4 -0
- package/templates/code-review/evals/null-name/graders/schema.md +5 -0
- package/templates/code-review/evals/null-name/prompt.md +17 -0
- package/templates/code-review/evals/off-by-one/case.yaml +3 -0
- package/templates/code-review/evals/off-by-one/graders/finds.md +4 -0
- package/templates/code-review/evals/off-by-one/graders/no-repo-reads.md +11 -0
- package/templates/code-review/evals/off-by-one/graders/schema.md +5 -0
- package/templates/code-review/evals/off-by-one/prompt.md +20 -0
- package/templates/code-review/evals/re-review/case.yaml +3 -0
- package/templates/code-review/evals/re-review/graders/resolves.md +4 -0
- package/templates/code-review/evals/re-review/graders/schema.md +5 -0
- package/templates/code-review/evals/re-review/prompt.md +23 -0
- package/templates/code-review/evals/repo-rule/case.yaml +3 -0
- package/templates/code-review/evals/repo-rule/graders/cites.md +4 -0
- package/templates/code-review/evals/repo-rule/graders/schema.md +5 -0
- package/templates/code-review/evals/repo-rule/prompt.md +31 -0
- package/templates/code-review/findings.schema.json +125 -0
- package/templates/code-review/rules/REVIEW.md +41 -0
- package/templates/code-review/skills/review/SKILL.md +162 -0
- package/templates/inbound-lead/agent.md +76 -0
- package/templates/inbound-lead/evals/clear-disqualifier/case.yaml +5 -0
- package/templates/inbound-lead/evals/clear-disqualifier/graders/action.md +5 -0
- package/templates/inbound-lead/evals/clear-disqualifier/graders/disqualifier.md +18 -0
- package/templates/inbound-lead/evals/clear-disqualifier/graders/schema.md +5 -0
- package/templates/inbound-lead/evals/clear-disqualifier/graders/score-formula.md +26 -0
- package/templates/inbound-lead/evals/clear-disqualifier/prompt.md +12 -0
- package/templates/inbound-lead/evals/injection-in-form/case.yaml +5 -0
- package/templates/inbound-lead/evals/injection-in-form/graders/flagged.md +5 -0
- package/templates/inbound-lead/evals/injection-in-form/graders/ignores-it.md +19 -0
- package/templates/inbound-lead/evals/injection-in-form/graders/schema.md +5 -0
- package/templates/inbound-lead/evals/injection-in-form/prompt.md +12 -0
- package/templates/inbound-lead/evals/learned-correction/case.yaml +8 -0
- package/templates/inbound-lead/evals/learned-correction/fixtures/learning/MEMORY.md +1 -0
- package/templates/inbound-lead/evals/learned-correction/fixtures/learning/no-agencies.md +14 -0
- package/templates/inbound-lead/evals/learned-correction/graders/applies-note.md +21 -0
- package/templates/inbound-lead/evals/learned-correction/graders/learned-origin.md +5 -0
- package/templates/inbound-lead/evals/learned-correction/graders/schema.md +5 -0
- package/templates/inbound-lead/evals/learned-correction/prompt.md +12 -0
- package/templates/inbound-lead/evals/strong-fit/case.yaml +5 -0
- package/templates/inbound-lead/evals/strong-fit/graders/book-call.md +5 -0
- package/templates/inbound-lead/evals/strong-fit/graders/fit.md +21 -0
- package/templates/inbound-lead/evals/strong-fit/graders/schema.md +5 -0
- package/templates/inbound-lead/evals/strong-fit/graders/score-formula.md +26 -0
- package/templates/inbound-lead/evals/strong-fit/prompt.md +12 -0
- package/templates/inbound-lead/evals/thin-data/case.yaml +5 -0
- package/templates/inbound-lead/evals/thin-data/graders/personal-email.md +5 -0
- package/templates/inbound-lead/evals/thin-data/graders/schema.md +5 -0
- package/templates/inbound-lead/evals/thin-data/graders/unknowns.md +17 -0
- package/templates/inbound-lead/evals/thin-data/prompt.md +12 -0
- package/templates/inbound-lead/evals/write-back/case.yaml +16 -0
- package/templates/inbound-lead/evals/write-back/fixtures/fake-hubspot.json +266 -0
- package/templates/inbound-lead/evals/write-back/graders/note-and-score.md +22 -0
- package/templates/inbound-lead/evals/write-back/graders/schema.md +5 -0
- package/templates/inbound-lead/evals/write-back/graders/writes-twice.md +7 -0
- package/templates/inbound-lead/evals/write-back/prompt.md +12 -0
- package/templates/inbound-lead/evals/write-back-wrong-record/case.yaml +18 -0
- package/templates/inbound-lead/evals/write-back-wrong-record/fixtures/fake-hubspot.json +266 -0
- package/templates/inbound-lead/evals/write-back-wrong-record/graders/no-write.md +7 -0
- package/templates/inbound-lead/evals/write-back-wrong-record/graders/proves-record.md +18 -0
- package/templates/inbound-lead/evals/write-back-wrong-record/graders/schema.md +5 -0
- package/templates/inbound-lead/evals/write-back-wrong-record/prompt.md +12 -0
- package/templates/inbound-lead/lead.schema.json +587 -0
- package/templates/inbound-lead/rules/FLAGS.md +43 -0
- package/templates/inbound-lead/rules/RUBRIC.md +73 -0
- package/templates/inbound-lead/skills/lead/SKILL.md +130 -0
- package/templates/kyb/agent.md +44 -0
- package/templates/kyb/evals/adverse-media/case.yaml +4 -0
- package/templates/kyb/evals/adverse-media/graders/dated-and-graded.md +25 -0
- package/templates/kyb/evals/adverse-media/graders/schema.md +5 -0
- package/templates/kyb/evals/adverse-media/prompt.md +12 -0
- package/templates/kyb/evals/canada-active-filed/case.yaml +4 -0
- package/templates/kyb/evals/canada-active-filed/graders/no-boilerplate-flags.md +22 -0
- package/templates/kyb/evals/canada-active-filed/graders/schema.md +5 -0
- package/templates/kyb/evals/canada-active-filed/prompt.md +43 -0
- package/templates/kyb/evals/clean-public-company/case.yaml +4 -0
- package/templates/kyb/evals/clean-public-company/graders/cited-and-proceed.md +23 -0
- package/templates/kyb/evals/clean-public-company/graders/schema.md +5 -0
- package/templates/kyb/evals/clean-public-company/prompt.md +11 -0
- package/templates/kyb/evals/injection-in-page/case.yaml +4 -0
- package/templates/kyb/evals/injection-in-page/fixtures/compliance-page.html +29 -0
- package/templates/kyb/evals/injection-in-page/graders/ignores-it.md +35 -0
- package/templates/kyb/evals/injection-in-page/graders/schema.md +5 -0
- package/templates/kyb/evals/injection-in-page/prompt.md +47 -0
- package/templates/kyb/evals/name-collision/case.yaml +4 -0
- package/templates/kyb/evals/name-collision/graders/never-merges.md +24 -0
- package/templates/kyb/evals/name-collision/graders/schema.md +5 -0
- package/templates/kyb/evals/name-collision/prompt.md +11 -0
- package/templates/kyb/evals/no-invention/case.yaml +4 -0
- package/templates/kyb/evals/no-invention/graders/invents-nothing.md +22 -0
- package/templates/kyb/evals/no-invention/graders/schema.md +5 -0
- package/templates/kyb/evals/no-invention/prompt.md +11 -0
- package/templates/kyb/evals/sanctioned-entity/case.yaml +6 -0
- package/templates/kyb/evals/sanctioned-entity/fixtures/ofac-sdn-extract/ADD.CSV.txt +13 -0
- package/templates/kyb/evals/sanctioned-entity/fixtures/ofac-sdn-extract/ALT.CSV.txt +12 -0
- package/templates/kyb/evals/sanctioned-entity/fixtures/ofac-sdn-extract/SDN.CSV.txt +9 -0
- package/templates/kyb/evals/sanctioned-entity/graders/cites-the-entry.md +6 -0
- package/templates/kyb/evals/sanctioned-entity/graders/finds-the-hit.md +27 -0
- package/templates/kyb/evals/sanctioned-entity/graders/schema.md +5 -0
- package/templates/kyb/evals/sanctioned-entity/prompt.md +65 -0
- package/templates/kyb/kyb.schema.json +274 -0
- package/templates/kyb/rules/ADVERSE-MEDIA.md +84 -0
- package/templates/kyb/rules/RED-FLAGS.md +68 -0
- package/templates/kyb/rules/SANCTIONS.md +140 -0
- package/templates/kyb/rules/SOURCES.md +92 -0
- package/templates/kyb/skills/kyb/SKILL.md +285 -0
- package/templates/market-monitor/agent.md +58 -0
- package/templates/market-monitor/digest.schema.json +194 -0
- package/templates/market-monitor/evals/blocked-source/case.yaml +4 -0
- package/templates/market-monitor/evals/blocked-source/graders/blocked-said.md +17 -0
- package/templates/market-monitor/evals/blocked-source/graders/schema.md +5 -0
- package/templates/market-monitor/evals/blocked-source/prompt.md +37 -0
- package/templates/market-monitor/evals/every-competitor-named/case.yaml +4 -0
- package/templates/market-monitor/evals/every-competitor-named/graders/every-company-named.md +16 -0
- package/templates/market-monitor/evals/every-competitor-named/graders/schema.md +5 -0
- package/templates/market-monitor/evals/every-competitor-named/prompt.md +44 -0
- package/templates/market-monitor/evals/learned-preference/case.yaml +7 -0
- package/templates/market-monitor/evals/learned-preference/fixtures/learning/MEMORY.md +1 -0
- package/templates/market-monitor/evals/learned-preference/fixtures/learning/skip-junior-job-posts.md +8 -0
- package/templates/market-monitor/evals/learned-preference/graders/omits-junior-post.md +17 -0
- package/templates/market-monitor/evals/learned-preference/graders/schema.md +5 -0
- package/templates/market-monitor/evals/learned-preference/prompt.md +25 -0
- package/templates/market-monitor/evals/no-repeats/case.yaml +4 -0
- package/templates/market-monitor/evals/no-repeats/graders/no-pulse-repeat.md +20 -0
- package/templates/market-monitor/evals/no-repeats/graders/schema.md +5 -0
- package/templates/market-monitor/evals/no-repeats/prompt.md +30 -0
- package/templates/market-monitor/evals/nothing-changed/case.yaml +4 -0
- package/templates/market-monitor/evals/nothing-changed/graders/quiet-no-inventions.md +20 -0
- package/templates/market-monitor/evals/nothing-changed/graders/schema.md +5 -0
- package/templates/market-monitor/evals/nothing-changed/prompt.md +44 -0
- package/templates/market-monitor/evals/post-happens/case.yaml +11 -0
- package/templates/market-monitor/evals/post-happens/fixtures/slack-mcp.json +31 -0
- package/templates/market-monitor/evals/post-happens/graders/post-is-digest.md +18 -0
- package/templates/market-monitor/evals/post-happens/graders/posted-once.md +10 -0
- package/templates/market-monitor/evals/post-happens/graders/schema.md +5 -0
- package/templates/market-monitor/evals/post-happens/prompt.md +20 -0
- package/templates/market-monitor/evals/pricing-change/case.yaml +4 -0
- package/templates/market-monitor/evals/pricing-change/graders/both-prices.md +5 -0
- package/templates/market-monitor/evals/pricing-change/graders/fetch-plan.md +16 -0
- package/templates/market-monitor/evals/pricing-change/graders/price-change-linked.md +20 -0
- package/templates/market-monitor/evals/pricing-change/graders/schema.md +5 -0
- package/templates/market-monitor/evals/pricing-change/prompt.md +31 -0
- package/templates/market-monitor/evals/pricing-moved/case.yaml +4 -0
- package/templates/market-monitor/evals/pricing-moved/graders/found-the-plans-page.md +16 -0
- package/templates/market-monitor/evals/pricing-moved/graders/schema.md +5 -0
- package/templates/market-monitor/evals/pricing-moved/prompt.md +29 -0
- package/templates/market-monitor/rules/MONITOR.md +33 -0
- package/templates/market-monitor/skills/monitor/SKILL.md +190 -0
- package/templates/release-notes/agent.md +47 -0
- package/templates/release-notes/evals/draft-not-publish/case.yaml +22 -0
- package/templates/release-notes/evals/draft-not-publish/fixtures/github-mcp.json +915 -0
- package/templates/release-notes/evals/draft-not-publish/graders/draft-issue-written.md +9 -0
- package/templates/release-notes/evals/draft-not-publish/graders/issue-body.md +15 -0
- package/templates/release-notes/evals/draft-not-publish/graders/never-overwrite.md +8 -0
- package/templates/release-notes/evals/draft-not-publish/graders/schema.md +5 -0
- package/templates/release-notes/evals/draft-not-publish/prompt.md +32 -0
- package/templates/release-notes/evals/every-pr-accounted/case.yaml +3 -0
- package/templates/release-notes/evals/every-pr-accounted/graders/each-pr-once-in-table.md +8 -0
- package/templates/release-notes/evals/every-pr-accounted/graders/revert-and-unclear.md +14 -0
- package/templates/release-notes/evals/every-pr-accounted/graders/schema.md +5 -0
- package/templates/release-notes/evals/every-pr-accounted/prompt.md +107 -0
- package/templates/release-notes/evals/issue-write-refused/case.yaml +22 -0
- package/templates/release-notes/evals/issue-write-refused/fixtures/github-mcp.json +902 -0
- package/templates/release-notes/evals/issue-write-refused/graders/refusal-said-plainly.md +19 -0
- package/templates/release-notes/evals/issue-write-refused/graders/schema.md +5 -0
- package/templates/release-notes/evals/issue-write-refused/graders/wrote-issue.md +6 -0
- package/templates/release-notes/evals/issue-write-refused/prompt.md +32 -0
- package/templates/release-notes/evals/late-arrival/case.yaml +21 -0
- package/templates/release-notes/evals/late-arrival/fixtures/github-mcp.json +866 -0
- package/templates/release-notes/evals/late-arrival/graders/late-pr-in-notes.md +14 -0
- package/templates/release-notes/evals/late-arrival/graders/late-pr-row.md +7 -0
- package/templates/release-notes/evals/late-arrival/graders/no-previous-release-pr.md +7 -0
- package/templates/release-notes/evals/late-arrival/graders/schema.md +5 -0
- package/templates/release-notes/evals/late-arrival/graders/walks-previous-end.md +8 -0
- package/templates/release-notes/evals/late-arrival/prompt.md +6 -0
- package/templates/release-notes/evals/learned-style/case.yaml +8 -0
- package/templates/release-notes/evals/learned-style/fixtures/learning/MEMORY.md +1 -0
- package/templates/release-notes/evals/learned-style/fixtures/learning/say-agent-not-bot.md +13 -0
- package/templates/release-notes/evals/learned-style/graders/no-bot.md +8 -0
- package/templates/release-notes/evals/learned-style/graders/same-changes.md +10 -0
- package/templates/release-notes/evals/learned-style/graders/schema.md +5 -0
- package/templates/release-notes/evals/learned-style/prompt.md +71 -0
- package/templates/release-notes/evals/no-pr-numbers-on-top/case.yaml +3 -0
- package/templates/release-notes/evals/no-pr-numbers-on-top/graders/no-hash-number-on-top.md +8 -0
- package/templates/release-notes/evals/no-pr-numbers-on-top/graders/no-pr-link-on-top.md +7 -0
- package/templates/release-notes/evals/no-pr-numbers-on-top/graders/schema.md +5 -0
- package/templates/release-notes/evals/no-pr-numbers-on-top/graders/table-heading.md +7 -0
- package/templates/release-notes/evals/no-pr-numbers-on-top/prompt.md +62 -0
- package/templates/release-notes/evals/upgrade-line/case.yaml +5 -0
- package/templates/release-notes/evals/upgrade-line/graders/chore-bump-upgrading.md +16 -0
- package/templates/release-notes/evals/upgrade-line/graders/duplicate-keys-in-upgrading.md +8 -0
- package/templates/release-notes/evals/upgrade-line/graders/old-flag-in-upgrading.md +7 -0
- package/templates/release-notes/evals/upgrade-line/graders/schema.md +5 -0
- package/templates/release-notes/evals/upgrade-line/graders/upgrading-says-what-to-do.md +14 -0
- package/templates/release-notes/evals/upgrade-line/prompt.md +78 -0
- package/templates/release-notes/evals/user-facing-only/case.yaml +4 -0
- package/templates/release-notes/evals/user-facing-only/graders/ci-out-of-top.md +14 -0
- package/templates/release-notes/evals/user-facing-only/graders/no-windows.md +8 -0
- package/templates/release-notes/evals/user-facing-only/graders/nothing-invented.md +13 -0
- package/templates/release-notes/evals/user-facing-only/graders/schema.md +5 -0
- package/templates/release-notes/evals/user-facing-only/prompt.md +113 -0
- package/templates/release-notes/notes.schema.json +145 -0
- package/templates/release-notes/rules/STYLE.md +47 -0
- package/templates/release-notes/skills/release-notes/SKILL.md +311 -0
- package/dist/console/assets/index-34jfpIbQ.js +0 -481
- package/dist/console/assets/index-DUHbWcIP.css +0 -1
- package/dist/trigger-secrets.d.ts +0 -32
- package/dist/trigger-secrets.js +0 -143
package/dist/runs.d.ts
CHANGED
|
@@ -1,29 +1,41 @@
|
|
|
1
1
|
import { type ChildProcess } from "node:child_process";
|
|
2
2
|
import { type Revision, type RevisionKind, type RunOrigin, type RunRow } from "@parcha/pi-durable-agent";
|
|
3
|
-
import { type MessageOrigin, type RunMetrics, type TimelineEvent } from "@parcha/pi-durable-agent/timeline";
|
|
3
|
+
import { type MessageOrigin, type RunMetrics, type TimelineEvent, timelineReducer } from "@parcha/pi-durable-agent/timeline";
|
|
4
4
|
import type { RUN_EVENTS, RunNotice } from "./webhooks.js";
|
|
5
5
|
import type { RunTrigger } from "./triggers.js";
|
|
6
6
|
import { type AgentEntry, type Agents } from "./agents.js";
|
|
7
|
+
import { type McpServerSource } from "./mcp-gateway.js";
|
|
7
8
|
import { type DaytonaApi } from "./daytona-api.js";
|
|
8
9
|
import { type Learning, type LearningMode, type LearningReason, type LearningState } from "./learning.js";
|
|
10
|
+
import { Hearing } from "./heard.js";
|
|
9
11
|
import { LearningRuns, type Reflect } from "./learning-run.js";
|
|
10
12
|
import { type BoxHost, type Quarantine } from "./box/sweep.js";
|
|
11
|
-
import { type RefusalFigures } from "./cap.js";
|
|
13
|
+
import { type CapMode, type RefusalFigures } from "./cap.js";
|
|
12
14
|
import { type Tier } from "./model.js";
|
|
13
15
|
import { type Plane, type Tooling, type ToolSettingsMap } from "./tool-plane.js";
|
|
14
|
-
import { type PendingApproval } from "./tool-gate.js";
|
|
15
16
|
import { type Page, RowLog } from "./rows.js";
|
|
16
17
|
import { type Json } from "./validate.js";
|
|
18
|
+
import { RequestBounds } from "./bounds.js";
|
|
17
19
|
import { Turns } from "./turns.js";
|
|
18
20
|
import { type StoredKeys } from "./secrets.js";
|
|
19
|
-
import type
|
|
21
|
+
import { type HandedSignIn, type SignIns } from "./sign-ins.js";
|
|
20
22
|
import { type Place } from "./place.js";
|
|
23
|
+
import { RUN_EPOCH_ENV, type RunHolder } from "./run-holder.js";
|
|
24
|
+
import { type Approval, type ApprovalAnswer, costOf, costView, type Handed, knownToolCostOf, type Pending, type SoFar, soFarOf, type State, type Status, stoppedAt, SUGGESTED_RAISE_FACTOR, suggestedCap, toolCostOf, WITHHELD_SIGN_IN, withOverCap, withPaused } from "./run-view.js";
|
|
25
|
+
export { costOf, costView, knownToolCostOf, soFarOf, type SoFar, toolCostOf, withOverCap, withPaused, stoppedAt, suggestedCap, SUGGESTED_RAISE_FACTOR, type State, type Status, WITHHELD_SIGN_IN };
|
|
26
|
+
import { type BoxPaths } from "./box-paths.js";
|
|
21
27
|
import type { BoxProvider } from "@parcha/pi-transport";
|
|
22
28
|
import type { RemoteLimits } from "./run-box.js";
|
|
23
29
|
import type { Emitted } from "./webhooks.js";
|
|
24
|
-
export type Status = "queued" | "working" | "paused" | "input_required" | "completed" | "failed" | "cancelled";
|
|
25
|
-
export type State = "working" | "waiting" | "idle";
|
|
26
30
|
export declare const STATUSES: readonly Status[];
|
|
31
|
+
/** Why a run going when its server started was stopped: the browser sign-in it was handed can't be read here (the seal
|
|
32
|
+
* key changed or is missing, or the sign-ins file is damaged or can't be read). */
|
|
33
|
+
export declare const UNREADABLE_SIGN_IN = "This server can't read the run's browser sign-in (its seal key changed or is missing, or the sign-in is damaged): the run was stopped, so nothing it says can show it.";
|
|
34
|
+
/** Why a run going when its server started was stopped: its serve.json is there but can't be read or parsed, and with it
|
|
35
|
+
* went which browser it ran on and whether it was handed its agent's sign-in, so its text can't be cut of the pointer. */
|
|
36
|
+
export declare const UNREADABLE_RUN_META = "This server can't read the run's record (its serve.json is damaged or can't be read), so it can't tell whether the run was handed its agent's browser sign-in: the run was stopped, so nothing it says can show it.";
|
|
37
|
+
/** The epoch of the claim a run's process holds, which the server gave it at its launch (run-holder.ts). */
|
|
38
|
+
export { RUN_EPOCH_ENV };
|
|
27
39
|
type RunMeta = {
|
|
28
40
|
title: string;
|
|
29
41
|
created_at: string;
|
|
@@ -31,6 +43,8 @@ type RunMeta = {
|
|
|
31
43
|
input?: Json;
|
|
32
44
|
effort?: string;
|
|
33
45
|
max_cost_usd?: number;
|
|
46
|
+
/** How its cap prices a request (cap.ts CapMode); absent, expected. */
|
|
47
|
+
cap_mode?: CapMode;
|
|
34
48
|
/** Each raise of its cap (PATCH /runs/{id}): from what, to what, when, and the pause it answers (pauseOf), if any. */
|
|
35
49
|
cap_raised?: {
|
|
36
50
|
from: number;
|
|
@@ -73,6 +87,14 @@ type RunMeta = {
|
|
|
73
87
|
};
|
|
74
88
|
/** Its tools' providers, resolved at its first launch and kept for its life (tool-plane.ts). */
|
|
75
89
|
tool_plane?: Plane;
|
|
90
|
+
/** Set when a server found the run going with a browser sign-in it could not read (its seal key changed): the run was
|
|
91
|
+
* stopped, and its store is never read for rows, which could repeat the pointer uncut. */
|
|
92
|
+
unshown?: true;
|
|
93
|
+
/** Set once a launch handed the run its agent's browser sign-in: the SHA-256 of each pointer it was handed (never a
|
|
94
|
+
* pointer), one per pointer, in the order handed. Only such a run's text could repeat one, so only such a run is
|
|
95
|
+
* stopped and hidden, or withheld, while any of them can't be read back; and a hidden one is shown again once every one
|
|
96
|
+
* of them can, live or forgotten. MALFORMED for a value this server did not write (handedMark). */
|
|
97
|
+
sign_in_handed?: Handed;
|
|
76
98
|
/** Where it runs, as its start resolved it (place.ts): its process reads it. Absent for a run an older server started,
|
|
77
99
|
* which ran on the runner. */
|
|
78
100
|
place?: Place;
|
|
@@ -91,33 +113,9 @@ type RunMeta = {
|
|
|
91
113
|
cancel_waits_for?: string[];
|
|
92
114
|
/** The trigger that started it, and its firing's key (triggers.ts); absent for a run a caller started. */
|
|
93
115
|
trigger?: RunTrigger;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
type Approval = {
|
|
98
|
-
id: string;
|
|
99
|
-
tool: string;
|
|
100
|
-
call_id: string;
|
|
101
|
-
args_json: string;
|
|
102
|
-
requested_at: string;
|
|
103
|
-
price?: number | "not metered";
|
|
104
|
-
resolved?: true;
|
|
105
|
-
};
|
|
106
|
-
/** `args_shown`: the call's arguments as the server shows them (shownArgs), which the gate's resume message names. */
|
|
107
|
-
/** `by`: "message", a deny a person's message gave while the call waited (Runs.message). */
|
|
108
|
-
/** `superseded`: the answer a stop or a cancel overrode before the run's process acted on it, kept as it was given. */
|
|
109
|
-
type ApprovalAnswer = {
|
|
110
|
-
decision: "allow" | "deny" | "canceled" | "withdrawn";
|
|
111
|
-
note?: string;
|
|
112
|
-
answered_at: string;
|
|
113
|
-
args_shown?: string;
|
|
114
|
-
by?: "message";
|
|
115
|
-
superseded?: {
|
|
116
|
-
decision: string;
|
|
117
|
-
answered_at: string;
|
|
118
|
-
note?: string;
|
|
119
|
-
by?: "message";
|
|
120
|
-
};
|
|
116
|
+
/** Who its first message is from when its person did not write it (a trigger's firing, pi-durable-agent's
|
|
117
|
+
* MessageOrigin): sent with that message, and with it again by a relaunch. Absent: the person's. */
|
|
118
|
+
input_origin?: MessageOrigin;
|
|
121
119
|
};
|
|
122
120
|
type RunError = {
|
|
123
121
|
code: string;
|
|
@@ -145,6 +143,9 @@ type Served = {
|
|
|
145
143
|
out: unknown;
|
|
146
144
|
};
|
|
147
145
|
export type Run = {
|
|
146
|
+
/** Set at load when its serve.json was there but could not be read or parsed (readMeta): what it was handed is not
|
|
147
|
+
* known, as forget reads of it from disk. */
|
|
148
|
+
damaged?: true;
|
|
148
149
|
id: string;
|
|
149
150
|
/** The values of the secrets each launch handed its process: what its errors never show, a key rotated since included. */
|
|
150
151
|
handed?: Set<string>;
|
|
@@ -162,6 +163,8 @@ export type Run = {
|
|
|
162
163
|
lastEntry?: number;
|
|
163
164
|
/** What the live path's rows keep served (keepCommitted), for a learning row shown between its snapshots. */
|
|
164
165
|
keep?: (id: string) => boolean;
|
|
166
|
+
/** The ids of the rows only the served view made for it (servedOnly), which the live path's keep never holds. */
|
|
167
|
+
madeHere?: Set<string>;
|
|
165
168
|
/** What its pinned revision's tools resolve from (tool-plane.ts), resolved again at each launch. */
|
|
166
169
|
tooling?: Tooling;
|
|
167
170
|
/** Imported history (`agentrun-serve import`): the source it was run in, and its id there. It takes no message, and a
|
|
@@ -177,16 +180,33 @@ export type Run = {
|
|
|
177
180
|
log: RowLog;
|
|
178
181
|
/** The run's rows as they come in (before the log names them), with each `ask_person` answer's waiting row. */
|
|
179
182
|
rows: TimelineEvent[];
|
|
183
|
+
/** The reducer of its door's events that makes those rows (follow): the newest connection's once its snapshot is in,
|
|
184
|
+
* the one before it until then. */
|
|
185
|
+
timeline?: ReturnType<typeof timelineReducer>;
|
|
180
186
|
/** The person's messages the run took, and how each one's turn ended (turns.ts): its end is read from them. */
|
|
181
187
|
turns: Turns;
|
|
182
188
|
/** Its tool calls that waited for a person's approval, read from its store's entries, by id. */
|
|
183
189
|
approvals?: Map<string, Approval>;
|
|
190
|
+
/** Each resume row's approval, by the row's id (stable: rows upsert by id), noted the first time the row comes in with
|
|
191
|
+
* the gate's head (withApprovals). A row already rewritten no longer starts with that head, so an answer's restate
|
|
192
|
+
* reads the link from here, never from the row's text. Rebuilt from the store's rows, which keep the head, when a
|
|
193
|
+
* run is opened. */
|
|
194
|
+
resumeRows?: Map<string, string>;
|
|
184
195
|
/** The whole text of each assistant message of its end-of-run turn, by store entry: what the turn answered, whose
|
|
185
196
|
* notes learning reads (learning-run.ts). */
|
|
186
197
|
turnText?: Map<number, string>;
|
|
198
|
+
/** What was said to it, whole, by store entry, as its learning's grader reads it (heard.ts): the person's words, and a
|
|
199
|
+
* trigger's input apart by its source. */
|
|
200
|
+
hearing?: Hearing;
|
|
187
201
|
child?: ChildProcess;
|
|
188
|
-
/** The pid of a run process an earlier server started that still serves the run: supervised by its
|
|
202
|
+
/** The pid of a run process an earlier server started that still serves the run: supervised by the holder its row names. */
|
|
189
203
|
orphan?: number;
|
|
204
|
+
/** That process as its row names it (its pid, its start, this boot): what a signal to it is checked against. */
|
|
205
|
+
orphanHolder?: RunHolder;
|
|
206
|
+
/** A stop of that process kept pending while its identity cannot be checked (terminate): tried again every second. */
|
|
207
|
+
stopPending?: NodeJS.Timeout;
|
|
208
|
+
/** That pending stop has been said in the log: once for as long as it waits. */
|
|
209
|
+
stopWaits?: boolean;
|
|
190
210
|
/** Adopted with a saved stop: its first snapshot is checked once, and a turn still working is aborted. */
|
|
191
211
|
finishStop?: boolean;
|
|
192
212
|
/** A completed run opening again for a follow-up: every follow-up meanwhile waits for this one, never a second. */
|
|
@@ -246,6 +266,39 @@ export type Run = {
|
|
|
246
266
|
/** Its files being copied into its work/ before its first launch, until they are: nothing launches it meanwhile (a
|
|
247
267
|
* request that would waits for it), and nothing but a cancel settles it. */
|
|
248
268
|
preparing?: Promise<void>;
|
|
269
|
+
/** Its harness being installed before its first launch (claude-agent's Claude Code or codex's Codex, on first use:
|
|
270
|
+
* harness-install.ts): true
|
|
271
|
+
* once it is, false when the install failed and the run ended so. Nothing launches it meanwhile, and a request that
|
|
272
|
+
* would waits for it. */
|
|
273
|
+
installing?: Promise<boolean>;
|
|
274
|
+
/** It shows the install's row (its words, since `at`) while it waits for an install that runs. */
|
|
275
|
+
installRow?: {
|
|
276
|
+
at: string;
|
|
277
|
+
words: string;
|
|
278
|
+
};
|
|
279
|
+
/** A raised workflow run whose process the pause let go, waiting for a place under the server's limits before it opens
|
|
280
|
+
* again (finishRaise): its words, since `at`, shown as a row; queued meanwhile. Its pause's mark stays until it opens,
|
|
281
|
+
* so a restart finishes the raise the same way. */
|
|
282
|
+
placeWait?: {
|
|
283
|
+
at: string;
|
|
284
|
+
words: string;
|
|
285
|
+
};
|
|
286
|
+
/** The tries in a row whose launch failed after its place was taken (finishRaise): back of the queue after each, and
|
|
287
|
+
* off it after RAISE_TRIES, its mark kept, so a run whose launch keeps failing never holds a place reserved. */
|
|
288
|
+
raiseTries?: number;
|
|
289
|
+
/** A raise whose launch failed RAISE_TRIES times: why, since `at`, shown as a row while the run stays paused at its
|
|
290
|
+
* cap, so the owner reads that the raise was taken and the run could not start, not a call for another raise. */
|
|
291
|
+
raiseFailedRow?: {
|
|
292
|
+
at: string;
|
|
293
|
+
words: string;
|
|
294
|
+
};
|
|
295
|
+
/** The pause at its cap the watch last read (connect: its notice key), so a new one, or one written again, is told. */
|
|
296
|
+
pauseSeen?: string;
|
|
297
|
+
/** budget.json's time and size at the watch's last read, so an unchanged file is not read again. */
|
|
298
|
+
pauseStamp?: string;
|
|
299
|
+
/** It waits for its harness's install before a launch (harnessReady): takePlace counts it as holding a place until
|
|
300
|
+
* that launch, so nothing takes its place meanwhile. A cancel or an end lets the place go. */
|
|
301
|
+
waitsInstall?: boolean;
|
|
249
302
|
settled: boolean;
|
|
250
303
|
settling?: Promise<void>;
|
|
251
304
|
/** The newest write of its serve.json: one at a time, in order. */
|
|
@@ -260,9 +313,30 @@ export type Run = {
|
|
|
260
313
|
boxing?: Promise<{
|
|
261
314
|
id: string;
|
|
262
315
|
made: boolean;
|
|
316
|
+
replaced?: boolean;
|
|
263
317
|
}>;
|
|
264
318
|
/** Its remote box's newest pull: a read of its files waits for it. */
|
|
265
319
|
pulling?: Promise<void>;
|
|
320
|
+
/** Its launch waits on its claim, tried again later (launch): it keeps its place in the server's limits (takePlace). */
|
|
321
|
+
claimWait?: boolean;
|
|
322
|
+
/** Why that claim waits, in words, for a request's 503 (notUp). */
|
|
323
|
+
claimWaitWhy?: string;
|
|
324
|
+
/** Why its newest process was stopped unopened (the ready time passed, its door's last answer): the reason its run
|
|
325
|
+
* fails with when that was its last launch, since the process's own log does not say it. */
|
|
326
|
+
notOpened?: string;
|
|
327
|
+
/** The door the process this server started said it serves (its stdout line): this server's own record of it, so a
|
|
328
|
+
* row the agent store cannot take yet never keeps the door from it. */
|
|
329
|
+
door?: string;
|
|
330
|
+
/** The holder its row is still to name (nameHolder), while a store another writer holds keeps the write waiting. */
|
|
331
|
+
naming?: {
|
|
332
|
+
epoch: number;
|
|
333
|
+
holder: RunHolder;
|
|
334
|
+
tries: number;
|
|
335
|
+
};
|
|
336
|
+
/** How many launches in a row its claim was refused: the next try comes sooner while it is few. */
|
|
337
|
+
claimTries?: number;
|
|
338
|
+
/** The last of its database's reads and take-back checkpoint (runs.ts runDb): the next waits for it. */
|
|
339
|
+
dbQueue?: Promise<void>;
|
|
266
340
|
/** It stood waiting for the person when last marked: a turn's end is the change into that. */
|
|
267
341
|
waited?: boolean;
|
|
268
342
|
/** The pause at its cap (its mark) whose process was let go: once per pause. */
|
|
@@ -271,7 +345,8 @@ export type Run = {
|
|
|
271
345
|
raising?: Promise<unknown>;
|
|
272
346
|
/** Its raise's follow-up is being sent (resumeRaised), or waits to be tried again (its time): never two at once. */
|
|
273
347
|
resuming?: "sending" | number;
|
|
274
|
-
/** Its newest refusal for room's figures, from that refusal's own start mark (cap.ts RefusalFigures)
|
|
348
|
+
/** Its newest refusal for room's figures, from that refusal's own start mark (cap.ts RefusalFigures): all three, or
|
|
349
|
+
* none. */
|
|
275
350
|
capRefusal?: RefusalFigures;
|
|
276
351
|
/** That refusal's own start mark (its entry): the pause a raise answers is keyed to it (pauseOf). */
|
|
277
352
|
capMark?: number;
|
|
@@ -281,75 +356,40 @@ export type Run = {
|
|
|
281
356
|
usd: number | null;
|
|
282
357
|
at?: number;
|
|
283
358
|
};
|
|
359
|
+
/** Its model requests' bounds (cap.ts BOUND_FIELD: the most a cache miss can make one cost beyond its hold), as its
|
|
360
|
+
* entries say them (bounds.ts). */
|
|
361
|
+
bounds?: RequestBounds;
|
|
284
362
|
};
|
|
285
|
-
/** The
|
|
286
|
-
|
|
287
|
-
export declare
|
|
288
|
-
/** The row that says a run's booked spend passed its cap, and by how much, after its usage row: a request's cost is
|
|
289
|
-
* booked once it answers, and one carrying a native web search is held at an allowance, not a bound (cap.ts), so a run
|
|
290
|
-
* can pass its cap by its last request. The next request is then refused, and the run ends spend_cap_reached. */
|
|
291
|
-
export declare function withOverCap(rows: TimelineEvent[], cap: number | undefined): TimelineEvent[];
|
|
292
|
-
/** What a run waits on, as `pending` says it (one field for every kind; a tool call waiting on approval is another):
|
|
293
|
-
* the question a waiting run asked, read from its last meaningful row (withAsks' waiting row), the same row its
|
|
294
|
-
* status reads, never from a scan of its timeline. */
|
|
295
|
-
type Pending = {
|
|
296
|
-
kind: "question";
|
|
297
|
-
question: string;
|
|
298
|
-
asked_at: string;
|
|
299
|
-
} | PendingApproval | {
|
|
300
|
-
kind: "budget";
|
|
301
|
-
cap_usd: number;
|
|
302
|
-
spent_usd?: number;
|
|
303
|
-
needs_usd?: number;
|
|
304
|
-
suggested_cap_usd?: number;
|
|
305
|
-
said: string;
|
|
363
|
+
/** The row a run shows while its harness installs for it (harness-install.ts), since `at`. */
|
|
364
|
+
/** The row a raised workflow run shows once its launch failed RAISE_TRIES times (finishRaise), since `at`. */
|
|
365
|
+
export declare const raiseFailedRow: ({ at, words }: {
|
|
306
366
|
at: string;
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
* charge here. */
|
|
319
|
-
export declare const toolCostOf: (rows: readonly TimelineEvent[], tool?: string) => number | null;
|
|
320
|
-
/** What a run's paid tools are known to have charged (`tool`'s alone, when given; every other tool's with `others`): each
|
|
321
|
-
* charge's line that names its cost, a charge of unknown cost adding nothing. */
|
|
322
|
-
export declare const knownToolCostOf: (rows: readonly TimelineEvent[], tool?: string, others?: boolean) => number;
|
|
323
|
-
/** A run's cost for its views: its usage row's, else what the store kept when it carried the run back (0 before any
|
|
324
|
-
* request). A usage row that says unknown, or says nothing, stays unknown: what the store kept dates from before a
|
|
325
|
-
* follow-up. */
|
|
326
|
-
export declare function costView(rows: readonly TimelineEvent[], stored: number | null | undefined, decisions?: number | null): number | null;
|
|
327
|
-
/** What a run whose cost is unknown has cost so far (costsofar/1): the sum of its charges whose cost is known, and how many
|
|
328
|
-
* have none, from its usage row, plus a workflow's decisions (`decisions`: their known sum and how many are not known;
|
|
329
|
-
* null when they could not be read, which says nothing). Undefined while the cost is known, when the row says neither
|
|
330
|
-
* (an older run's), or when a workflow's decisions are unreadable. No ceiling is claimed. */
|
|
331
|
-
export type SoFar = {
|
|
332
|
-
so_far_usd: number;
|
|
333
|
-
unpriced: number;
|
|
334
|
-
};
|
|
335
|
-
export declare function soFarOf(rows: readonly TimelineEvent[], decisions?: {
|
|
336
|
-
known: number;
|
|
337
|
-
unpriced: number;
|
|
338
|
-
} | null): SoFar | undefined;
|
|
339
|
-
/** Whether the turn a stop ended is still where the run stands: no message shown is newer than the stop's. By order,
|
|
340
|
-
* never by a count or by the stopped message itself, which a compaction can take off the rows. */
|
|
341
|
-
export declare const stoppedAt: (meta: {
|
|
342
|
-
stopped_at?: string;
|
|
343
|
-
stopped_after?: number;
|
|
344
|
-
}, rows: readonly TimelineEvent[]) => boolean;
|
|
367
|
+
words: string;
|
|
368
|
+
}) => TimelineEvent;
|
|
369
|
+
/** The row a raised workflow run shows while it waits for a place to open again in (finishRaise), since `at`. */
|
|
370
|
+
export declare const placeRow: ({ at, words }: {
|
|
371
|
+
at: string;
|
|
372
|
+
words: string;
|
|
373
|
+
}) => TimelineEvent;
|
|
374
|
+
export declare const installRow: ({ at, words }: {
|
|
375
|
+
at: string;
|
|
376
|
+
words: string;
|
|
377
|
+
}) => TimelineEvent;
|
|
345
378
|
/** What a stop keeps of where the run stands: the person's last message, by its id, or the place before any. */
|
|
346
379
|
export declare const stopMark: (rows: readonly TimelineEvent[]) => {
|
|
347
380
|
stopped_at: string;
|
|
348
381
|
};
|
|
349
382
|
/** The rows a snapshot that no longer holds them leaves served: those committed entries made. A row any connection
|
|
350
383
|
* showed live is not one (`live` holds them for the run), so a live row that ended while the door was away goes. */
|
|
351
|
-
|
|
352
|
-
|
|
384
|
+
/** The live path's keep: a row a committed entry made stays served though a later snapshot no longer holds it (the
|
|
385
|
+
* timeline only grows); a row the reducer showed live does not, nor one only the served view makes (`madeHere`, the ids
|
|
386
|
+
* show() tagged servedOnly, read as it grows), which goes once show() stops making it. */
|
|
387
|
+
export declare function keepCommitted(live: Set<string>, rows: readonly TimelineEvent[], isLive: (id: string) => boolean, madeHere?: ReadonlySet<string>): (id: string) => boolean;
|
|
388
|
+
/** A run's status and state, by the contract's table (run-view.ts statusOf). The table is read over the run's rows, its
|
|
389
|
+
* turns and its store entries; the file-backed facts (a workflow paused at its cap or in its process, the browser ask)
|
|
390
|
+
* this server reads from the run's directory and passes in. The store-backed view builds the same facts from the run's
|
|
391
|
+
* row and journal, so the status a person or a model sees is the same. The facts are thunks, read only where the table
|
|
392
|
+
* reaches them, so the hot path (an ended or stopped run) touches no file, as it did when the reads lived here. */
|
|
353
393
|
export declare function statusOf(run: Run): {
|
|
354
394
|
status: Status;
|
|
355
395
|
state: State;
|
|
@@ -368,19 +408,31 @@ export type StartOptions = {
|
|
|
368
408
|
place: Place;
|
|
369
409
|
effort?: string;
|
|
370
410
|
maxCostUsd?: number;
|
|
411
|
+
capMode?: CapMode;
|
|
371
412
|
trigger?: RunTrigger;
|
|
372
413
|
inputs?: (work: string) => Promise<unknown>;
|
|
373
|
-
origin?: RunOrigin;
|
|
414
|
+
origin?: RunOrigin; /** Who the first message is from, when not the person (RunMeta.input_origin). */
|
|
415
|
+
from?: MessageOrigin;
|
|
374
416
|
};
|
|
375
417
|
/** `token` is the server's own: no run's process sees it. */
|
|
376
418
|
/** `maxRuns`: the most runs with a live process at once; `settleRetryMs`: how often a carry back the store refused is
|
|
377
419
|
* tried again; `readyTimeoutMs`: how long a request to a run waits for its door (a run's first message, sent by its
|
|
378
|
-
* start, always waits READY_TIMEOUT_MS); `
|
|
420
|
+
* start, always waits READY_TIMEOUT_MS); `openTimeoutMs`: how long a launched process has to open its run (READY_TIMEOUT_MS,
|
|
421
|
+
* the first message's wait, by default; never the request's wait); `log` takes a run's start and end (print.ts). */
|
|
379
422
|
export type RunsOptions = {
|
|
380
|
-
|
|
423
|
+
installs?: Readonly<Record<string, {
|
|
424
|
+
readonly installed: boolean;
|
|
425
|
+
readonly installingWords: string;
|
|
426
|
+
needed(): Promise<boolean>;
|
|
427
|
+
ensure(): Promise<void>;
|
|
428
|
+
}>>; /** What a run's Docker box reaches, as the server resolved it (run-box.ts boxNetworkOf): the list, or none. Absent, none. */
|
|
429
|
+
dockerAllow?: readonly string[] | "none"; /** On a Mac, the server's proxy container's volume a run's Docker box mounts (box-egress-vm.ts). */
|
|
430
|
+
dockerVolume?: string; /** A server in a container: where its Docker has the data directory (box-paths.ts), which a run's Docker box mounts from. Absent on a host. */
|
|
431
|
+
dockerPaths?: BoxPaths;
|
|
381
432
|
agents: Agents;
|
|
382
433
|
token: string; /** The server's saved tool keys, read by name for its runs alone (secrets.ts). */
|
|
383
|
-
storedKeys?: StoredKeys;
|
|
434
|
+
storedKeys?: StoredKeys; /** The server's saved MCP servers (mcp-servers.ts): a run's pin and its credentials come from them at each launch. */
|
|
435
|
+
mcpServers?: McpServerSource;
|
|
384
436
|
documents?: string;
|
|
385
437
|
doorTokenFile: string;
|
|
386
438
|
doorToken: string; /** The test switches a run's process gets (server.ts fauxEnvOf): empty outside tests. */
|
|
@@ -406,15 +458,16 @@ export type RunsOptions = {
|
|
|
406
458
|
};
|
|
407
459
|
settleRetryMs?: number;
|
|
408
460
|
readyTimeoutMs?: number;
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
461
|
+
openTimeoutMs?: number; /** Under --faux only (server.ts): the nonce handed to each run's process in place of its launch's. */
|
|
462
|
+
fauxHandedNonce?: string;
|
|
463
|
+
reflectTimeoutMs?: number; /** How much of what a run learned its instructions hold, in bytes (`--learning-budget`, learning.ts learnedOf). */
|
|
412
464
|
learningBudget?: number;
|
|
413
465
|
log?: (event: string, fields: Record<string, string | number>) => void;
|
|
414
466
|
notify?: RunNotify;
|
|
415
467
|
learning?: LearningMode; /** Each agent's saved sign-ins (sign-ins.ts): absent, no run gets one. */
|
|
416
|
-
signIns?: SignIns; /**
|
|
417
|
-
|
|
468
|
+
signIns?: SignIns; /** Every secret this server never shows (server.ts serverSecrets), read at each call, so one made or rotated is cut at once: the host's and the keys saved on it, read through `stored` when given (learning's view keeps the saved keys it read), its tokens, and each it holds (server-secrets.ts). What a run shows, its title among it, and what its learning keeps are cut of it. */
|
|
469
|
+
serverSecrets: (stored?: StoredKeys) => string[]; /** The current name of a trigger by its id, from the store (server.ts triggerNameOf): resolved once when a run is loaded (a run restored after a restart still names its trigger), and a firing's start and a rename push it in (triggerChanged), so servedTriggerRow reads it with no store read. */
|
|
470
|
+
triggerName?: (id: string) => Promise<string | undefined>;
|
|
418
471
|
};
|
|
419
472
|
/** Told of a run's moment each time it is seen (webhooks.ts' emit, which queues each one once): a wait it reached, and an
|
|
420
473
|
* end once the agent store has it. `marker` names the moment (the person's turn it waits at, the end's time), the same
|
|
@@ -450,8 +503,8 @@ export declare function needsOf(revision: Revision): Promise<RunNeeds>;
|
|
|
450
503
|
/** The secrets a run of `needs` is handed over its pipe, by the keys `env` holds now: RUN_SECRETS but each field of a
|
|
451
504
|
* `tool` row of `rows` (TOOL_KEYS) that unlocks none of the tools the run binds; and but each model key its model does
|
|
452
505
|
* not need, from the host's model settings and the keys in `env`: a pi run's, its models' providers' keys or the
|
|
453
|
-
* gateway's (model.ts' modelKeys: its own model, or the host's of each tier it runs);
|
|
454
|
-
* one key
|
|
506
|
+
* gateway's (model.ts' modelKeys: its own model, or the host's of each tier it runs); a run on an adapter's, the
|
|
507
|
+
* one key its wire's route sends for the revision's model (adapters.ts' harnessModelKeys). Read at each launch, so a key
|
|
455
508
|
* saved with no restart counts at the next. */
|
|
456
509
|
export declare function keysFor(needs: RunNeeds, env: NodeJS.ProcessEnv, rows?: readonly KeyRow[]): string[];
|
|
457
510
|
/** The secrets a run of `revision` is handed with the keys `env` holds (needsOf, then keysFor). */
|
|
@@ -468,28 +521,42 @@ export declare const childEnv: (env: NodeJS.ProcessEnv, token: string) => NodeJS
|
|
|
468
521
|
export declare function failureLine(log: string): string;
|
|
469
522
|
/** The last line of the run process's log, in words, for a failure's message. */
|
|
470
523
|
export declare function lastLogLine(run: Pick<Run, "dir">): Promise<string>;
|
|
471
|
-
/** Seams for tests, each unset in a server: `personsTurn` holds a person's turn just after its origin went
|
|
524
|
+
/** Seams for tests, each unset in a server: `personsTurn` holds a person's turn just after its origin went;
|
|
525
|
+
* `beforeRestartCheck` holds a settle that found the run's process gone just before it decides whether to open it again. */
|
|
472
526
|
export declare const runsTestHooks: {
|
|
473
527
|
personsTurn?: (runDir: string) => Promise<void> | void;
|
|
528
|
+
beforeRestartCheck?: (runDir: string) => Promise<void> | void;
|
|
474
529
|
};
|
|
475
530
|
export declare class Runs {
|
|
531
|
+
#private;
|
|
476
532
|
private readonly options;
|
|
477
533
|
private readonly runs;
|
|
478
|
-
/**
|
|
479
|
-
|
|
534
|
+
/** The current name of each trigger a held run names, by its id (servedTriggerRow): pushed in at a firing's start (the
|
|
535
|
+
* run's trigger), on a rename or delete (server.ts triggerChanged), and resolved once when a run is loaded, so a
|
|
536
|
+
* served row names its trigger with no store read. `undefined` for a trigger that is gone. */
|
|
537
|
+
private readonly triggerNames;
|
|
538
|
+
/** The last entry each run's database reads have seen (run-db.ts): a read behind it is never shown. */
|
|
539
|
+
private readonly reads;
|
|
540
|
+
/** The disk the runs' folders are on (disk.ts): on this machine, the data directory's own. */
|
|
541
|
+
private get disk();
|
|
480
542
|
/** What decides the secrets each revision's runs are handed (needsOf), by revision id: read once, from the revision the
|
|
481
543
|
* run is pinned to, never from a request. The keys themselves are read at each launch (keysFor). */
|
|
482
544
|
private readonly needs;
|
|
483
|
-
/** Every run's graph as served, part by part (servedGraph), and each workflow run's last graph read whole, which a
|
|
484
|
-
* poll that met a busy store answers, marked stale: one LRU by bytes across runs (graph-served.ts PartCache). */
|
|
485
|
-
private readonly graphCache;
|
|
486
545
|
private readonly adopting;
|
|
546
|
+
/** The runs this process is starting, from the store's row until the run is held (start): its serve.json and its seed
|
|
547
|
+
* copy are written in between. A read of one waits for its start and never loads it from disk, where it would look
|
|
548
|
+
* like a run a stopped server left mid-copy. Null once a start failed. */
|
|
549
|
+
private readonly startingRuns;
|
|
487
550
|
/** The hosts this server's next remote box asks for: the setting's, until the provider cannot keep a list here, then none. */
|
|
488
551
|
private remoteAllow;
|
|
489
552
|
private readonly clock;
|
|
490
553
|
private readonly cli;
|
|
491
554
|
private readonly app;
|
|
492
555
|
private closing;
|
|
556
|
+
/** Raised workflow runs waiting for a place to open again in (finishRaise), tried again every PLACE_RETRY_MS. */
|
|
557
|
+
private placeWaiters;
|
|
558
|
+
private placeRetry;
|
|
559
|
+
private placeRetrying;
|
|
493
560
|
/** Set once `close` is done: the store is closed, so nothing settles after it. */
|
|
494
561
|
private closed;
|
|
495
562
|
/** Runs past the cap's check whose process is not started yet. */
|
|
@@ -497,7 +564,8 @@ export declare class Runs {
|
|
|
497
564
|
/** The memory the starts counted in `starting` reserve, in MiB. */
|
|
498
565
|
private startingMib;
|
|
499
566
|
/** This host's memory, out of which each live run reserves what its harness takes (host.ts), beside `maxRuns`. */
|
|
500
|
-
|
|
567
|
+
/** This host's memory for runs (host.ts); a test's seam sets it (startServe's `hostMemory`). */
|
|
568
|
+
memory: number;
|
|
501
569
|
/** The start sweep of the boxes runs left: once, before any run opens a box (sweepOnce). */
|
|
502
570
|
private swept?;
|
|
503
571
|
/** The runs' learning (learning-run.ts): a step this file calls as a run starts, ends, settles, opens again and is
|
|
@@ -512,6 +580,11 @@ export declare class Runs {
|
|
|
512
580
|
/** A test's seam (startServe's `beforeReopenLaunch`): awaited by a reopen after the run reads open again and before its
|
|
513
581
|
* launch, so a test can hold a reopen there. */
|
|
514
582
|
beforeReopenLaunch?: (runId: string) => Promise<void> | void;
|
|
583
|
+
/** A test's seam (startServe's `beforeRaiseLaunch`): awaited where a raise that opens a let-go workflow pins what its
|
|
584
|
+
* launch needs (finishRaise), after its place is taken; one that throws stands for a pin that fails there. */
|
|
585
|
+
beforeRaiseLaunch?: (runId: string) => Promise<void> | void;
|
|
586
|
+
/** A test's seam (startServe's `onPauseCheck`): told each stat and each read of a workflow run's pause by its watch. */
|
|
587
|
+
onPauseCheck?: (runId: string, what: "stat" | "read") => void;
|
|
515
588
|
/** A test's seam (startServe's `onRunLoad`): told each run read in from its store, its timeline with it. */
|
|
516
589
|
onRunLoad?: (runId: string) => void;
|
|
517
590
|
/** A test's seam (startServe's `beforeSubmit`): awaited by a message before it goes to the run's door. */
|
|
@@ -535,14 +608,30 @@ export declare class Runs {
|
|
|
535
608
|
/** Writes the run's serve.json, after any write already under way: `meta`, a copy its caller publishes to run.meta
|
|
536
609
|
* only once this resolves (a raise, takeRaise), else run.meta, each as it stands when the write starts. */
|
|
537
610
|
private saveMeta;
|
|
538
|
-
|
|
539
|
-
|
|
611
|
+
/** The process that holds the run, as its row's claim names it (run-holder.ts); undefined for none, or the server. */
|
|
612
|
+
private holder;
|
|
613
|
+
/** Who holds the run, as its row says and the processes show: `unknown` when the row or the process listing cannot be
|
|
614
|
+
* read, which a caller never takes for a holder that is gone. */
|
|
615
|
+
private holderView;
|
|
616
|
+
/** The door a live run serves, from its row's holder: a process that lives (its pid, of the same start, on this boot)
|
|
617
|
+
* and a loopback address it named. */
|
|
540
618
|
private doorOf;
|
|
619
|
+
/** The record the run's process keeps in its own store (pi-durable-disk RUN_STATUS_TABLE: its status, `detail` and
|
|
620
|
+
* `wakeAt`), read lock-free; null when it has none or it cannot be read. */
|
|
621
|
+
private runRecord;
|
|
541
622
|
private storeFile;
|
|
542
623
|
/** The run's rows from its store, opened read-only; only once its claim is released. An agentic run's rows are its
|
|
543
624
|
* root conversation's; a workflow run's are its model nodes'. `atEnd`: a settle's read, which reads every
|
|
544
625
|
* conversation (a workflow's nodes, a harness's session) once and counts the run's metrics from all of them. */
|
|
545
626
|
private readStore;
|
|
627
|
+
/** `act` on run `run`'s database, after every earlier one on it: its reads and its take-back's checkpoint never meet. */
|
|
628
|
+
private runDb;
|
|
629
|
+
/** The server takes run `run` back once no process holds it: its claim's epoch is bumped, with the server as its
|
|
630
|
+
* holder (the disk's revoke, disk.ts), and only then its database checkpointed (run-db.ts), its WAL emptied into the
|
|
631
|
+
* database file. A run whose process still lives is not taken. A take-back that fails (the agent store held by another
|
|
632
|
+
* writer, or not writable) only warns: the run settles all the same, its database read with its WAL, and the next
|
|
633
|
+
* settle or start takes it back. */
|
|
634
|
+
private takeBack;
|
|
546
635
|
/** New rows in: into the log, then the run's status, then whatever the status asks for. */
|
|
547
636
|
/** `keep`: rows that stay served though `rows` no longer holds them (the live path's committed rows). */
|
|
548
637
|
private take;
|
|
@@ -552,8 +641,22 @@ export declare class Runs {
|
|
|
552
641
|
/** The run's rows into its log, as served: a workflow run's decisions and the run's learning row are the served view's
|
|
553
642
|
* only, never the run's own rows, which its cost and its answer are read from. */
|
|
554
643
|
private show;
|
|
644
|
+
/** A trigger's row as served: "<label> <its name>: <its first line>" for a trigger that has a name now; as the timeline
|
|
645
|
+
* wrote it, "<label> <its id>: …", for one that is gone. The name is put in after the run's rows were redacted, so it
|
|
646
|
+
* is redacted here with the run's redactor: a key pasted into a trigger's name never shows on its runs' rows. */
|
|
647
|
+
private servedTriggerRow;
|
|
648
|
+
/** Trigger `id` renamed or deleted, with its name now (`name`, undefined when it is gone): the name is pushed to the
|
|
649
|
+
* one the runs read (triggerNames), and each held run whose Timeline names it is shown again, its row naming the
|
|
650
|
+
* trigger as it is now. With no `id` (the triggers just read at a start): every run so named is shown again. */
|
|
651
|
+
triggerChanged(id?: string, name?: string | undefined): void;
|
|
555
652
|
/** A live process: the child this server started, or one an earlier server started that still serves the run. */
|
|
556
653
|
private live;
|
|
654
|
+
/** Run `id`'s status read again now: the owner answered its browser ask (browser-person.ts), so it is working again
|
|
655
|
+
* before its process has read the answer. */
|
|
656
|
+
remark(id: string): void;
|
|
657
|
+
/** Whether run `id` has a process serving it now: the child this server started, or an adopted one that is alive. A
|
|
658
|
+
* run's live browser view is that process's alone (browser-live.ts). */
|
|
659
|
+
hasProcess(id: string): boolean;
|
|
557
660
|
/** How an agentic run ends: over its cap, or as the turn of the person's newest message ended (turns.ts), once every
|
|
558
661
|
* message the run took has had its turn. Undefined while one is open, or when the run stopped, waits, or its turn
|
|
559
662
|
* ended interrupted (the run then waits for the person), or while its records name no message (a live process of an
|
|
@@ -563,12 +666,29 @@ export declare class Runs {
|
|
|
563
666
|
/** A run's error as a person reads it, in its error box and on its Timeline row alike: a refused key in plain words
|
|
564
667
|
* (plainKey), else the harness's text with no loopback address (withoutLoopback: Codex names serve's own proxy). */
|
|
565
668
|
private errorWords;
|
|
566
|
-
/** An error row as served: its summary and text in errorWords' terms
|
|
567
|
-
* what the harness said. */
|
|
669
|
+
/** An error row as served: its summary and text in errorWords' terms, or the pause's phase row of a refusal for room the
|
|
670
|
+
* run paused at. The run's own rows, which its status reads, keep what the harness said. */
|
|
568
671
|
private servedError;
|
|
569
|
-
/** What serve shows of a run's error text, for every run kind: no held secret
|
|
570
|
-
* no loopback address. */
|
|
672
|
+
/** What serve shows of a run's error text, for every run kind (run-view.ts shownOf): no held secret and no loopback. */
|
|
571
673
|
private shown;
|
|
674
|
+
/** A run's error as its view and the run lists serve it (run-view.ts servedRunErrorWith): its message in shown()'s terms. */
|
|
675
|
+
private servedRunError;
|
|
676
|
+
/** A run's review as its view serves it (run-view.ts servedReviewWith): its reason in shown()'s terms, or withheld while
|
|
677
|
+
* the run is hidden (meta.unshown). */
|
|
678
|
+
private servedReview;
|
|
679
|
+
/** The pointers a run was handed, read back to cut them (sign-ins.ts peek and forgotten), by its serve.json's
|
|
680
|
+
* `sign_in_handed`: none for a run with no mark (it was never handed one); else, for each hash it names, the live or
|
|
681
|
+
* forgotten pointer whose SHA-256 it is. `unreadable` when what it was handed can't be read back here: a MALFORMED
|
|
682
|
+
* mark, no vendor browser kept beside the mark, the sign-ins file can't be read, or any of its hashes matches no
|
|
683
|
+
* pointer that opens (one under another seal key or none, one forgotten and dropped past MAX_FORGOTTEN, the sign-ins
|
|
684
|
+
* file gone). Fails closed: a marked run is cut of every pointer it was handed, or withheld, never served uncut. Read
|
|
685
|
+
* anew at each load: nothing caches this verdict, so a run withheld while its key was missing is shown once it opens. */
|
|
686
|
+
private handedPointers;
|
|
687
|
+
/** shown() for a run this server holds no Run for (an ended one a list reads from its row and serve.json alone, the
|
|
688
|
+
* summary choke point: run-view.ts rowShown): cut of every secret this server never shows (serverSecrets) and of what
|
|
689
|
+
* the run was handed of its agent's sign-in (handedPointers); `withheld` when that can't be read back here, as a load
|
|
690
|
+
* would hide the run. */
|
|
691
|
+
private rowShown;
|
|
572
692
|
/** A run's answer as serve serves it: no held secret, never cut (redactedAnswer). Loopback addresses stay: an answer is
|
|
573
693
|
* the model's own words, and a local address there can be what the person asked about. */
|
|
574
694
|
private servedAnswer;
|
|
@@ -578,13 +698,6 @@ export declare class Runs {
|
|
|
578
698
|
* view, and an answer a run was made to write can be large. The run keeps the one it served last, of each slot; a key
|
|
579
699
|
* saved or deleted changes the values' digest, and the next view redacts again. */
|
|
580
700
|
private servedOnce;
|
|
581
|
-
/** A workflow run's graph as serve serves it: its nodes, each decision and each call (its input, output and error) with
|
|
582
|
-
* no held secret, by its answer's rule (redactedOutput), and only then cut: a map item's label at 200 characters, a
|
|
583
|
-
* call's error at 2000, and a text stored cut (a decision's state past 64 KB, an error logged cut) less its last 6
|
|
584
|
-
* times the longest held value plus 16 characters, where a value the stored cut split would sit. The view a busy
|
|
585
|
-
* store's read keeps is the one graph-view.ts made, whole, so a key saved after it is still found. Each part is
|
|
586
|
-
* served once per content and held value set: a console polls the graph while the run goes. */
|
|
587
|
-
private servedGraph;
|
|
588
701
|
/** The timeline's redaction of `run`'s error rows and of what a tool's result shows (its summary and preview), applied
|
|
589
702
|
* before a row is cut (timelineOf's `redact`), so a cut never leaves the head of a key. Every such cut is within
|
|
590
703
|
* redacted()'s SHOWN, so its window holds. */
|
|
@@ -595,9 +708,8 @@ export declare class Runs {
|
|
|
595
708
|
/** The last line of the run process's log (lastLogLine) for a failure's message, with every value its errors never
|
|
596
709
|
* show cut out: its process may have written a secret or its sign-in's pointer there. */
|
|
597
710
|
private lastLine;
|
|
598
|
-
/** Every secret value `run`'s errors never show, as learning's checker holds them (learning-run.ts refused):
|
|
599
|
-
* server
|
|
600
|
-
* server's own tokens. */
|
|
711
|
+
/** Every secret value `run`'s errors never show, as learning's checker holds them (learning-run.ts refused): every one
|
|
712
|
+
* this server never shows (serverSecrets, read now, so one rotated is cut at once) and what each launch handed the run. */
|
|
601
713
|
private refusedValues;
|
|
602
714
|
/** A run's model error in a person's words when its provider refused the run's key (key-refusal.ts): the key its
|
|
603
715
|
* harness's route sends, by this server's settings and keys, and no secret's value. */
|
|
@@ -616,8 +728,10 @@ export declare class Runs {
|
|
|
616
728
|
private finish;
|
|
617
729
|
/** SIGTERM to the run's process: it drains, releases the run and exits. */
|
|
618
730
|
private terminate;
|
|
619
|
-
/** Supervise a run process an earlier server started: follow its door, and settle the run once
|
|
620
|
-
*
|
|
731
|
+
/** Supervise a run process an earlier server started, its row's holder: follow its door, and settle the run once the
|
|
732
|
+
* process is gone, or once the record it keeps in its store has said for EXIT_AFTER_RELEASE_MS that it let go while
|
|
733
|
+
* the process lives on. `follow`: its rows are followed live from its door (never for a run whose rows are not
|
|
734
|
+
* shown, meta.unshown). */
|
|
621
735
|
private adoptProcess;
|
|
622
736
|
/** At start: every run the store says is running is read, supervised when its process lives, carried back when it
|
|
623
737
|
* already ended, and opened again when its process went before it ended. */
|
|
@@ -650,6 +764,7 @@ export declare class Runs {
|
|
|
650
764
|
ensureBox(id: string): Promise<{
|
|
651
765
|
id: string;
|
|
652
766
|
made: boolean;
|
|
767
|
+
replaced?: boolean;
|
|
653
768
|
}>;
|
|
654
769
|
/** The run's box let go (archive, or its process gone after an archive): reaped by the box's own count. */
|
|
655
770
|
private teardown;
|
|
@@ -670,9 +785,21 @@ export declare class Runs {
|
|
|
670
785
|
/** Follow the door's events into an agentic run's rows, again after each drop while the process lives. A workflow
|
|
671
786
|
* run is only watched: the door's events are a root conversation's, and a workflow run has none. */
|
|
672
787
|
private connect;
|
|
788
|
+
/** One round of a live workflow run's watch of its pause at its cap: a stat of budget.json, and a read only when it
|
|
789
|
+
* changed (its time or size); a new pause, or one written again, refreshes the run (its status, its notice). */
|
|
790
|
+
private watchPause;
|
|
673
791
|
private follow;
|
|
792
|
+
/** The install `run`'s harness waits for before it launches (claude-agent's Claude Code, codex's Codex: harness-install.ts), or undefined
|
|
793
|
+
* when it waits for none. One per run at a time, every run's on the server's one install: while that runs the run
|
|
794
|
+
* shows it (installRow). A failed install ends the run failed, with the install's words, which name the command that
|
|
795
|
+
* installs it by hand. */
|
|
796
|
+
private harnessReady;
|
|
674
797
|
/** The door of a run that is not finished, starting or waking its process when it is not live. */
|
|
675
798
|
private ensureLive;
|
|
799
|
+
/** A request's 503 for a run that did not come up in time, naming why, as far as this server can tell: the process
|
|
800
|
+
* listing cannot be read (who holds it is unknown), the agent store is busy (its claim waits on it), or the run never
|
|
801
|
+
* opened (its process is up, its door not serving). */
|
|
802
|
+
private notUp;
|
|
676
803
|
/** The refusal of a message to an imported run: it was run elsewhere, and is kept as history. */
|
|
677
804
|
private importedRefusal;
|
|
678
805
|
private finished;
|
|
@@ -688,14 +815,41 @@ export declare class Runs {
|
|
|
688
815
|
/** Reads what decides the secrets runs of `run`'s revision are handed (needsOf), once per revision: from `given` (a
|
|
689
816
|
* start's, read from the store), else from the agent store, waiting out a busy one as a run's end does. */
|
|
690
817
|
private pinNeeds;
|
|
818
|
+
/** Just before a launch that spawns the run's process (after pinNeeds): its MCP servers' OAuth tokens near expiry are
|
|
819
|
+
* refreshed in serve (mcp-servers.ts headersForRun), so the synchronous launch hands it a fresh access token, never a
|
|
820
|
+
* refresh token. Never on a path that only reaches a live process, nor on a stop's: an authorization server that is
|
|
821
|
+
* slow to answer never holds an abort. */
|
|
822
|
+
private mcpFresh;
|
|
823
|
+
/** `run`'s pinned MCP tools: read from its directory, or at its first launch made from the granted `tools` and the
|
|
824
|
+
* servers saved now, and written before its process starts. Undefined when it grants none. */
|
|
825
|
+
private mcpPin;
|
|
691
826
|
/** The saved sign-in the run's browser starts from (sign-ins.ts), resolved before each launch: made at the vendor when
|
|
692
827
|
* its agent has none, and leased to this run to save unless another run of the agent holds the lease. One that cannot
|
|
693
828
|
* be had (the vendor not answering, a seal key changed) leaves its browser signed out, said in its log. */
|
|
694
829
|
private pinSignIn;
|
|
830
|
+
/** That `run` is handed `signIn`, kept before it is (forRun's keep, under its agent's sign-ins lock, so no forget comes
|
|
831
|
+
* between): false when that can't be saved, and the run is handed none. */
|
|
832
|
+
private keepHanded;
|
|
833
|
+
/** The run of `agentId` still going (its row running) that was handed the sign-in whose pointer hashes to `hash`, or
|
|
834
|
+
* any sign-in when `hash` is undefined (a pointer that does not open here): forget waits for it (sign-ins.ts). From the
|
|
835
|
+
* run this server holds, else its serve.json: a run still going need not be held yet (a recovery under way, or one it
|
|
836
|
+
* could not recover). One whose mark is MALFORMED, or whose serve.json is damaged (run.damaged for a held run, the same
|
|
837
|
+
* answer the disk read gives), counts: what it was handed is not known. */
|
|
838
|
+
handedTo(agentId: string, hash: string | undefined): Promise<string | undefined>;
|
|
839
|
+
/** The pointer of the sign-in a run this server loads was handed, among the values its rows, errors and answers never
|
|
840
|
+
* show: read only, with no lease taken (pinSignIn takes one at its next launch). `unreadable` when its agent keeps
|
|
841
|
+
* one that does not open under this server's seal key. */
|
|
842
|
+
private peekSignIn;
|
|
695
843
|
/** Lets go of the save lease the run holds on its agent's sign-in, if any: at once when its process let its sessions go
|
|
696
844
|
* (`clean`), else by the gone rule (sign-ins.ts). */
|
|
697
845
|
private releaseSignIn;
|
|
698
846
|
private launch;
|
|
847
|
+
/** Names `holder` on the run's row under `epoch`, the claim its launch made: a claim that moved on since (a take-back,
|
|
848
|
+
* a later launch) is left as it is, and a store that is busy is tried again shortly, a few times. */
|
|
849
|
+
private nameHolder;
|
|
850
|
+
/** Writes the run's newest holder to name (`naming`); a store another writer holds is tried again, soon at first, then
|
|
851
|
+
* every settle retry, while the process lives and the server runs. */
|
|
852
|
+
private writeHolder;
|
|
699
853
|
/** Writes the run's launch mark before its process is spawned: a spawn that takes the server down leaves it, and the
|
|
700
854
|
* next start fails the run rather than launch it again and go down with it. The file exists once the call returns,
|
|
701
855
|
* which a server's death does not undo; no fsync, which would hold the event loop on the disk at every launch. */
|
|
@@ -758,7 +912,8 @@ export declare class Runs {
|
|
|
758
912
|
/** One message to the run's door. `origin`: who wrote it when the person did not (a raised cap's follow-up, an
|
|
759
913
|
* approval's resume), carried to its user entry so the Timeline shows it as the server's (pi-durable-agent's
|
|
760
914
|
* MessageOrigin); the model reads the same text either way. `answers: false`: the run's door refuses the message
|
|
761
|
-
* (WAITING) when the run's turn ended on ask_person
|
|
915
|
+
* (WAITING) when the run's turn ended on ask_person or a tool call of it waits for its owner's approval (the gate's
|
|
916
|
+
* park, APPROVAL_ENTRY), and when the run is busy (BUSY), so it is never queued behind a
|
|
762
917
|
* turn that may end so; decided at the door's admission, past every wait here. */
|
|
763
918
|
private submit;
|
|
764
919
|
/** Whether the run's harness takes a message mid-turn. */
|
|
@@ -783,6 +938,29 @@ export declare class Runs {
|
|
|
783
938
|
note?: string;
|
|
784
939
|
}>;
|
|
785
940
|
private takeRaise;
|
|
941
|
+
/** A workflow run's raise (budget.ts): serve.json keeps it first, as an agentic run's does, then `cap.json` tells the
|
|
942
|
+
* run's process, whose step waiting at its cap is judged again under it, and a run whose process the pause let go is
|
|
943
|
+
* opened again (its pause's mark taken away first, so its settle does not hold it) under the raised cap (CAP_ENV),
|
|
944
|
+
* resuming from its journal. A raise while it works holds from its next check. The same raise again changes nothing. */
|
|
945
|
+
private raiseWorkflow;
|
|
946
|
+
/** Finishes the raise serve.json keeps (`max_cost_usd`), in its steps' order, each one done again harmlessly: `cap.json`
|
|
947
|
+
* takes it (a waiting process wakes on it), then a pause it answers (budget.json under a lower cap) is taken away and
|
|
948
|
+
* its run, with no process, opened again under it. A raise, its retry and a restart's settle all finish it here, so a
|
|
949
|
+
* crash between serve.json and the rest never leaves a raised run waiting for a raise. True when it took a pause away. */
|
|
950
|
+
private finishRaise;
|
|
951
|
+
/** A raised run that found no place: queued, saying it waits for one, and tried again every PLACE_RETRY_MS until it
|
|
952
|
+
* opens (finishRaise), ends or is cancelled. */
|
|
953
|
+
private waitForPlace;
|
|
954
|
+
/** Whether a raise that took a place has nothing to open now: the server is closing (the mark stays, for the next
|
|
955
|
+
* server), or the run ended, was cancelled, opened, or has no pause left. Off the queue then, unless closing. */
|
|
956
|
+
private raiseMoot;
|
|
957
|
+
/** `run` off the queue for a place: what it reserved is free, and it shows no wait for one. */
|
|
958
|
+
private leavePlaceQueue;
|
|
959
|
+
/** A raised run whose launch failed after its place was taken: to the back of the queue, its mark kept, and off it
|
|
960
|
+
* after RAISE_TRIES failures in a row (still paused at its cap; a raise retried, or the server's next start, finishes it
|
|
961
|
+
* then), so it never holds a place reserved for good. */
|
|
962
|
+
private raiseFailed;
|
|
963
|
+
private retryPlaces;
|
|
786
964
|
/** Sends a raised run its pause's follow-up, under its id (the door takes one id once), at the run's cap now: as a
|
|
787
965
|
* follow-up to a run whose process has gone (message()), so the process it starts resumes nothing and opens under the
|
|
788
966
|
* new cap, or to the process another launch started. Marked sent in serve.json. One that cannot be sent is tried
|
|
@@ -792,8 +970,10 @@ export declare class Runs {
|
|
|
792
970
|
private failRaised;
|
|
793
971
|
/** One message to an agentic run, its mode chosen by the run's state (the contract's table). `requestId`: the message's
|
|
794
972
|
* id in the run's store, which takes one message per id (a trigger's firing key); default a new one. */
|
|
795
|
-
message
|
|
973
|
+
/** `origin`: who the message is from when its person did not write it (a trigger's firing). */
|
|
974
|
+
message(run: Run, content: string, requestId?: string, { answers, origin }?: {
|
|
796
975
|
answers?: boolean;
|
|
976
|
+
origin?: MessageOrigin;
|
|
797
977
|
}): Promise<{
|
|
798
978
|
mode: "steer" | "answer" | "follow_up";
|
|
799
979
|
messageId: string;
|
|
@@ -843,81 +1023,6 @@ export declare class Runs {
|
|
|
843
1023
|
paused: boolean;
|
|
844
1024
|
status: Status;
|
|
845
1025
|
}>;
|
|
846
|
-
/** A workflow run's graph as it stands (graph-view.ts), live while it runs. */
|
|
847
|
-
graph(run: Run): Promise<{
|
|
848
|
-
stale: boolean;
|
|
849
|
-
read_at: string;
|
|
850
|
-
run: {
|
|
851
|
-
id: string;
|
|
852
|
-
agent: string;
|
|
853
|
-
revision: string;
|
|
854
|
-
status: string;
|
|
855
|
-
paused: boolean;
|
|
856
|
-
startedAt: string;
|
|
857
|
-
endedAt: string | null;
|
|
858
|
-
};
|
|
859
|
-
workflow: unknown;
|
|
860
|
-
graph: import("@parcha/agentrun-dsl/graph").WorkflowGraph;
|
|
861
|
-
nodes: Record<string, {
|
|
862
|
-
status: import("./graph-view.js").GraphNodeStatus;
|
|
863
|
-
startedAt?: string;
|
|
864
|
-
endedAt?: string;
|
|
865
|
-
branch?: string;
|
|
866
|
-
items?: {
|
|
867
|
-
index: number;
|
|
868
|
-
status: import("./graph-view.js").GraphNodeStatus;
|
|
869
|
-
executionPath: string;
|
|
870
|
-
label?: string;
|
|
871
|
-
branches?: Record<string, string>;
|
|
872
|
-
}[];
|
|
873
|
-
}>;
|
|
874
|
-
decisions: {
|
|
875
|
-
images: {
|
|
876
|
-
token: {} | null;
|
|
877
|
-
ref: {} | null;
|
|
878
|
-
url: string | null;
|
|
879
|
-
}[];
|
|
880
|
-
error_cut?: boolean | undefined;
|
|
881
|
-
id: {} | null;
|
|
882
|
-
node: string | null;
|
|
883
|
-
executionPath: {} | null;
|
|
884
|
-
item: {} | null;
|
|
885
|
-
kind: {} | null;
|
|
886
|
-
provider: {} | null;
|
|
887
|
-
model: {} | null;
|
|
888
|
-
status: {} | null;
|
|
889
|
-
questions: {} | null;
|
|
890
|
-
answers: {} | null;
|
|
891
|
-
evidence: {};
|
|
892
|
-
rule: {} | null;
|
|
893
|
-
action: {} | null;
|
|
894
|
-
cost_usd: number | null;
|
|
895
|
-
cost_basis: {} | null;
|
|
896
|
-
latency_ms: {} | null;
|
|
897
|
-
state: {} | null;
|
|
898
|
-
state_truncated: boolean;
|
|
899
|
-
error: string | null;
|
|
900
|
-
}[];
|
|
901
|
-
effects: {
|
|
902
|
-
node: string | null;
|
|
903
|
-
executionPath: string | null;
|
|
904
|
-
item: number | null;
|
|
905
|
-
tool: string;
|
|
906
|
-
status: string;
|
|
907
|
-
input: unknown;
|
|
908
|
-
output: unknown;
|
|
909
|
-
error: string | null;
|
|
910
|
-
error_cut?: boolean;
|
|
911
|
-
startedAt: string;
|
|
912
|
-
endedAt: string | null;
|
|
913
|
-
}[];
|
|
914
|
-
totals: {
|
|
915
|
-
cost_usd: number | null;
|
|
916
|
-
decisions: number;
|
|
917
|
-
effects: number;
|
|
918
|
-
elapsed_ms: number | null;
|
|
919
|
-
};
|
|
920
|
-
}>;
|
|
921
1026
|
/** How long a run's process gets after SIGTERM before SIGKILL: its drain and a second to exit. */
|
|
922
1027
|
private killAfterMs;
|
|
923
1028
|
/** What close() will wait on: the runs whose processes are left to finish their turn (those this server started, and
|
|
@@ -932,15 +1037,25 @@ export declare class Runs {
|
|
|
932
1037
|
cost(run: Run): {
|
|
933
1038
|
so_far_usd?: number | undefined;
|
|
934
1039
|
unpriced?: number | undefined;
|
|
1040
|
+
overshoot_bound_usd?: undefined;
|
|
1041
|
+
usd: number | null;
|
|
1042
|
+
basis: string;
|
|
1043
|
+
charge_state: null;
|
|
1044
|
+
cap_usd: number | null;
|
|
1045
|
+
} | {
|
|
1046
|
+
so_far_usd?: number | undefined;
|
|
1047
|
+
unpriced?: number | undefined;
|
|
1048
|
+
overshoot_bound_usd: number;
|
|
935
1049
|
usd: number | null;
|
|
936
1050
|
basis: string;
|
|
937
1051
|
charge_state: null;
|
|
938
1052
|
cap_usd: number | null;
|
|
939
1053
|
};
|
|
940
|
-
/** `Run`, as the contract shows it. `known`: its stored row as the
|
|
941
|
-
* just written has none worth reading (`{ stored: null }`: it is
|
|
942
|
-
* must not read the store once the run exists, since a busy store
|
|
943
|
-
|
|
1054
|
+
/** `Run`, as the contract shows it, its console page at `origin` (server.ts linkOrigin). `known`: its stored row as the
|
|
1055
|
+
* caller already has it, so nothing is read; a run just written has none worth reading (`{ stored: null }`: it is
|
|
1056
|
+
* neither archived nor ended), and its start's answer must not read the store once the run exists, since a busy store
|
|
1057
|
+
* would then refuse a run that runs. */
|
|
1058
|
+
view(run: Run, origin: string, known?: {
|
|
944
1059
|
stored: RunRow | null;
|
|
945
1060
|
}): Promise<{
|
|
946
1061
|
created_at: string;
|
|
@@ -956,11 +1071,22 @@ export declare class Runs {
|
|
|
956
1071
|
cost: {
|
|
957
1072
|
so_far_usd?: number | undefined;
|
|
958
1073
|
unpriced?: number | undefined;
|
|
1074
|
+
overshoot_bound_usd?: undefined;
|
|
1075
|
+
usd: number | null;
|
|
1076
|
+
basis: string;
|
|
1077
|
+
charge_state: null;
|
|
1078
|
+
cap_usd: number | null;
|
|
1079
|
+
} | {
|
|
1080
|
+
so_far_usd?: number | undefined;
|
|
1081
|
+
unpriced?: number | undefined;
|
|
1082
|
+
overshoot_bound_usd: number;
|
|
959
1083
|
usd: number | null;
|
|
960
1084
|
basis: string;
|
|
961
1085
|
charge_state: null;
|
|
962
1086
|
cap_usd: number | null;
|
|
963
1087
|
};
|
|
1088
|
+
cap_mode: "expected" | "strict" | null;
|
|
1089
|
+
approvals: "ask" | "never";
|
|
964
1090
|
archived_at: string | null;
|
|
965
1091
|
imported_from: {
|
|
966
1092
|
source: string;
|
|
@@ -968,13 +1094,14 @@ export declare class Runs {
|
|
|
968
1094
|
} | null;
|
|
969
1095
|
trigger: RunTrigger | null;
|
|
970
1096
|
learning: {
|
|
971
|
-
|
|
1097
|
+
given?: import("./learning.js").NoteUsed[];
|
|
1098
|
+
read?: import("./learning.js").NoteUsed[];
|
|
972
1099
|
learned?: import("./learning.js").NoteLearned[];
|
|
973
1100
|
pending?: import("./learning.js").NoteUsed[];
|
|
974
1101
|
skills?: import("./learning.js").LearnedFile[];
|
|
975
1102
|
workflows?: import("./learning.js").LearnedFile[];
|
|
976
1103
|
state: "proposed" | "merged" | "seeded" | "reflecting" | "dropped";
|
|
977
|
-
reason: "
|
|
1104
|
+
reason: "empty" | "unparsed" | "seed_failed" | "no_budget" | "unknown_cost" | "cancelled" | "crashed" | "reflect_timeout" | "reflect_failed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
978
1105
|
detail: string | null;
|
|
979
1106
|
at: string;
|
|
980
1107
|
} | null;
|
|
@@ -984,6 +1111,7 @@ export declare class Runs {
|
|
|
984
1111
|
run_id: string;
|
|
985
1112
|
agent_id: string;
|
|
986
1113
|
agent_version: number;
|
|
1114
|
+
console_url: string;
|
|
987
1115
|
revision: string;
|
|
988
1116
|
kind: RevisionKind;
|
|
989
1117
|
sha: null;
|
|
@@ -992,7 +1120,7 @@ export declare class Runs {
|
|
|
992
1120
|
title: string;
|
|
993
1121
|
place: Place;
|
|
994
1122
|
}>;
|
|
995
|
-
summary(run: Run): Promise<{
|
|
1123
|
+
summary(run: Run, origin: string): Promise<{
|
|
996
1124
|
created_at: string;
|
|
997
1125
|
ended_at: string | null;
|
|
998
1126
|
error: RunError | null;
|
|
@@ -1001,6 +1129,15 @@ export declare class Runs {
|
|
|
1001
1129
|
cost: {
|
|
1002
1130
|
so_far_usd?: number | undefined;
|
|
1003
1131
|
unpriced?: number | undefined;
|
|
1132
|
+
overshoot_bound_usd?: undefined;
|
|
1133
|
+
usd: number | null;
|
|
1134
|
+
basis: string;
|
|
1135
|
+
charge_state: null;
|
|
1136
|
+
cap_usd: number | null;
|
|
1137
|
+
} | {
|
|
1138
|
+
so_far_usd?: number | undefined;
|
|
1139
|
+
unpriced?: number | undefined;
|
|
1140
|
+
overshoot_bound_usd: number;
|
|
1004
1141
|
usd: number | null;
|
|
1005
1142
|
basis: string;
|
|
1006
1143
|
charge_state: null;
|
|
@@ -1014,23 +1151,25 @@ export declare class Runs {
|
|
|
1014
1151
|
trigger: RunTrigger | null;
|
|
1015
1152
|
learning: ({
|
|
1016
1153
|
state: "proposed" | "merged" | "seeded" | "reflecting" | "dropped";
|
|
1017
|
-
reason: "
|
|
1154
|
+
reason: "empty" | "unparsed" | "seed_failed" | "no_budget" | "unknown_cost" | "cancelled" | "crashed" | "reflect_timeout" | "reflect_failed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
1018
1155
|
detail: string | null;
|
|
1019
1156
|
} & Omit<{
|
|
1020
|
-
|
|
1157
|
+
given?: import("./learning.js").NoteUsed[];
|
|
1158
|
+
read?: import("./learning.js").NoteUsed[];
|
|
1021
1159
|
learned?: import("./learning.js").NoteLearned[];
|
|
1022
1160
|
pending?: import("./learning.js").NoteUsed[];
|
|
1023
1161
|
skills?: import("./learning.js").LearnedFile[];
|
|
1024
1162
|
workflows?: import("./learning.js").LearnedFile[];
|
|
1025
1163
|
state: "proposed" | "merged" | "seeded" | "reflecting" | "dropped";
|
|
1026
|
-
reason: "
|
|
1164
|
+
reason: "empty" | "unparsed" | "seed_failed" | "no_budget" | "unknown_cost" | "cancelled" | "crashed" | "reflect_timeout" | "reflect_failed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
1027
1165
|
detail: string | null;
|
|
1028
1166
|
at: string;
|
|
1029
|
-
}, "at" | "
|
|
1167
|
+
}, "at" | "reason" | "detail" | "state">) | null;
|
|
1030
1168
|
effort?: string | undefined;
|
|
1031
1169
|
run_id: string;
|
|
1032
1170
|
agent_id: string;
|
|
1033
1171
|
agent_version: number;
|
|
1172
|
+
console_url: string;
|
|
1034
1173
|
revision: string;
|
|
1035
1174
|
kind: RevisionKind;
|
|
1036
1175
|
sha: null;
|
|
@@ -1042,7 +1181,7 @@ export declare class Runs {
|
|
|
1042
1181
|
statusOfRow(row: RunRow): Promise<Status>;
|
|
1043
1182
|
/** A run's summary for a list. An ended run this server holds no Run for is read from its row and its serve.json alone,
|
|
1044
1183
|
* not its store; `versions` numbers its agent's revisions. */
|
|
1045
|
-
summaryOfRow(row: RunRow, versions: Map<string, number
|
|
1184
|
+
summaryOfRow(row: RunRow, versions: Map<string, number>, origin: string): Promise<Awaited<ReturnType<Runs["summary"]>>>;
|
|
1046
1185
|
/** A key was saved on this server or deleted from it: each held run's learning row and decision rows shown again, cut
|
|
1047
1186
|
* of the keys as they are now (learning-run.ts shown, decision-rows.ts), as its view and its lists already are from
|
|
1048
1187
|
* the next read on. */
|
|
@@ -1059,4 +1198,3 @@ export declare class Runs {
|
|
|
1059
1198
|
final: boolean;
|
|
1060
1199
|
}>;
|
|
1061
1200
|
}
|
|
1062
|
-
export {};
|