@parcha/agentrun-serve 0.1.0-beta.31 → 0.1.0-beta.33
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 +459 -0
- package/NOTICE +18 -0
- package/README.md +941 -263
- package/dist/adapter-facts.d.ts +3 -0
- package/dist/adapter-facts.js +5 -0
- package/dist/adapters.d.ts +64 -143
- package/dist/adapters.js +153 -384
- package/dist/agents-store.d.ts +146 -0
- package/dist/agents-store.js +359 -0
- package/dist/agents.d.ts +4 -2
- package/dist/agents.js +37 -17
- package/dist/api-only.d.ts +14 -0
- package/dist/api-only.js +33 -0
- 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.js +28 -9
- package/dist/box-egress-vm.d.ts +2 -9
- package/dist/box-egress-vm.js +20 -16
- package/dist/box-egress.d.ts +15 -9
- package/dist/box-egress.js +26 -29
- package/dist/box-paths.d.ts +82 -0
- package/dist/box-paths.js +160 -0
- package/dist/box-relay-vm.js +28 -1
- package/dist/box-relay.d.ts +1 -10
- package/dist/box-relay.js +1 -21
- package/dist/box-settings.d.ts +46 -0
- package/dist/box-settings.js +107 -0
- package/dist/boxes.d.ts +17 -2
- package/dist/boxes.js +37 -3
- 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 +277 -21
- package/dist/browser-live.d.ts +124 -0
- package/dist/browser-live.js +324 -0
- package/dist/browser-person.d.ts +166 -0
- package/dist/browser-person.js +767 -0
- package/dist/budget.d.ts +76 -0
- package/dist/budget.js +204 -0
- package/dist/cap.d.ts +267 -64
- package/dist/cap.js +587 -199
- package/dist/cli.js +220 -21
- 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-Dn0ngwG9.js +535 -0
- package/dist/console/assets/index-DvW6Aled.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/daytona-api.d.ts +0 -11
- package/dist/daytona-api.js +1 -82
- 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 +28 -1
- package/dist/decisions.js +63 -6
- package/dist/docker-host-addresses.d.ts +37 -0
- package/dist/docker-host-addresses.js +110 -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 -43
- package/dist/files.js +8 -136
- 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 +9 -42
- package/dist/grade.js +42 -228
- 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-install.d.ts +143 -0
- package/dist/harness-install.js +454 -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 +11 -31
- package/dist/harness.js +30 -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 +4 -3
- package/dist/host-check.js +5 -4
- 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 +249 -224
- 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/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 +22 -9
- package/dist/learn/grade.js +95 -49
- 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 +70 -41
- package/dist/learn/secrets.d.ts +16 -7
- package/dist/learn/secrets.js +80 -17
- package/dist/learn/seed-check.d.ts +74 -0
- package/dist/learn/seed-check.js +103 -0
- package/dist/learn/skills.d.ts +5 -1
- package/dist/learn/skills.js +5 -4
- package/dist/learned-workflow.d.ts +15 -4
- package/dist/learned-workflow.js +13 -6
- package/dist/learning-routes.d.ts +56 -46
- package/dist/learning-routes.js +350 -553
- package/dist/learning-run.d.ts +8 -228
- package/dist/learning-run.js +26 -713
- package/dist/learning-words.d.ts +3 -5
- package/dist/learning-words.js +3 -5
- package/dist/learning.d.ts +177 -112
- package/dist/learning.js +289 -380
- 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 +45 -15
- package/dist/mcp-gateway.js +140 -53
- package/dist/mcp-meta.d.ts +3 -0
- package/dist/mcp-meta.js +14 -2
- 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 +180 -50
- package/dist/mcp-servers.js +284 -321
- 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 +921 -110
- package/dist/owner.d.ts +46 -10
- package/dist/owner.js +123 -43
- package/dist/page.d.ts +10 -0
- package/dist/page.js +29 -4
- package/dist/paid-calls.d.ts +71 -2
- package/dist/paid-calls.js +127 -6
- package/dist/pause.d.ts +0 -2
- package/dist/pause.js +1 -8
- package/dist/pdf-pages.d.ts +16 -14
- package/dist/pdf-pages.js +88 -58
- package/dist/place.d.ts +15 -18
- package/dist/place.js +25 -25
- package/dist/port-models.d.ts +53 -0
- package/dist/port-models.js +93 -0
- package/dist/print.d.ts +2 -1
- package/dist/print.js +4 -2
- 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/result.d.ts +13 -2
- package/dist/result.js +4 -5
- 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 +62 -0
- package/dist/run-db.js +151 -0
- package/dist/run-files.d.ts +31 -0
- package/dist/run-files.js +125 -0
- package/dist/run-launch.d.ts +72 -0
- package/dist/run-launch.js +108 -0
- package/dist/run-learning-served.d.ts +81 -0
- package/dist/run-learning-served.js +25 -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-secrets.d.ts +33 -0
- package/dist/run-secrets.js +53 -0
- package/dist/run-timeline-served.d.ts +13 -0
- package/dist/run-timeline-served.js +72 -0
- package/dist/run-view.d.ts +432 -0
- package/dist/run-view.js +602 -0
- package/dist/runnable.d.ts +30 -5
- package/dist/runnable.js +149 -72
- package/dist/runner/adapter-loop.d.ts +243 -0
- package/dist/runner/adapter-loop.js +1657 -0
- package/dist/runner/adapter-run-spec.d.ts +224 -0
- package/dist/runner/adapter-run-spec.js +538 -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 +103 -0
- package/dist/runner/adapters/pi.js +263 -0
- package/dist/runner/beside.d.ts +12 -0
- package/dist/runner/beside.js +41 -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 +385 -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 +217 -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 +112 -0
- package/dist/runner/loop-contract.d.ts +154 -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 +96 -0
- package/dist/runner/main.js +311 -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 +202 -0
- package/dist/runner/pi-stop.d.ts +6 -0
- package/dist/runner/pi-stop.js +8 -0
- package/dist/runner/redact.d.ts +32 -0
- package/dist/runner/redact.js +60 -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 +797 -0
- package/dist/runs-over-store.d.ts +203 -0
- package/dist/runs-over-store.js +407 -0
- package/dist/seal-key.d.ts +69 -0
- package/dist/seal-key.js +329 -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 +171 -0
- package/dist/secret-writes.d.ts +147 -0
- package/dist/secret-writes.js +144 -0
- package/dist/secrets.d.ts +7 -8
- package/dist/secrets.js +24 -5
- 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 +76 -0
- package/dist/server.d.ts +148 -75
- package/dist/server.js +1740 -605
- 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 +44 -0
- package/dist/store/open.js +50 -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 +123 -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 +1352 -0
- package/dist/store/sqlite/worker.d.ts +78 -0
- package/dist/store/sqlite/worker.js +242 -0
- package/dist/store/store.d.ts +1256 -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 +46 -0
- package/dist/store-reads/journal.js +196 -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 +338 -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 +166 -35
- package/dist/tool-gate.js +411 -91
- package/dist/tool-keys-store.d.ts +110 -0
- package/dist/tool-keys-store.js +291 -0
- package/dist/tool-keys.d.ts +29 -15
- package/dist/tool-keys.js +27 -6
- package/dist/tool-plane.d.ts +113 -27
- package/dist/tool-plane.js +229 -76
- 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 +341 -62
- 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 +116 -0
- package/dist/trigger-secrets-shown.d.ts +66 -0
- package/dist/trigger-secrets-shown.js +81 -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 +53 -18
- 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 +87 -0
- package/dist/workspace/computer-deps.js +160 -0
- package/dist/workspace/computer-for-claim.d.ts +119 -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 +16 -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 +0 -17
- package/dist/workspace.js +3 -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 +10 -27
- package/package.json +37 -22
- 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/app.d.ts +0 -7
- package/dist/app.js +0 -399
- package/dist/console/assets/index-CnJBf7Lc.js +0 -486
- package/dist/console/assets/index-DUHbWcIP.css +0 -1
- package/dist/content-filter.d.ts +0 -7
- package/dist/content-filter.js +0 -23
- package/dist/harness-app.d.ts +0 -40
- package/dist/harness-app.js +0 -717
- package/dist/request-start.d.ts +0 -22
- package/dist/request-start.js +0 -350
- package/dist/run-box.d.ts +0 -186
- package/dist/run-box.js +0 -600
- package/dist/runs.d.ts +0 -1069
- package/dist/runs.js +0 -3073
- package/dist/trigger-secrets.d.ts +0 -32
- package/dist/trigger-secrets.js +0 -143
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import { type TimelineEvent } from "@parcha/pi-durable-agent/timeline";
|
|
2
|
+
import type { RevisionKind } from "@parcha/pi-durable-agent";
|
|
3
|
+
import { type RefusalFigures } from "./cap.js";
|
|
4
|
+
import type { Turns } from "./turns.js";
|
|
5
|
+
import type { PendingAsk } from "./browser-person.js";
|
|
6
|
+
import { type PendingApproval } from "./tool-gate.js";
|
|
7
|
+
import { type SignIns } from "./sign-ins.js";
|
|
8
|
+
/** The sign-in read surface a run's served view needs: a run's handed-pointer cut reads only `peek` (the agent's saved
|
|
9
|
+
* pointer) and `forgotten` (its tombstoned ones). Both the old `new SignIns(...)` and the store-backed bridge
|
|
10
|
+
* (sign-ins-store.ts signInsOverStore) satisfy it, so a view reads either path with no knowledge of which. */
|
|
11
|
+
export type SignInReader = Pick<SignIns, "peek" | "forgotten">;
|
|
12
|
+
/** The run's cost from its usage row: null when a response's cost is unknown, 0 before any request. */
|
|
13
|
+
export declare const costOf: (rows: readonly TimelineEvent[]) => number | null;
|
|
14
|
+
/** What a run's paid tools charged (`tool`'s alone, when given; every other tool's with `others`), from the same rows its
|
|
15
|
+
* cost is read from: each charge's line carries it (`usage` on a `phase` row), and a browser call's row what its charges
|
|
16
|
+
* came to; null when one is unknown. A call still marked, in flight or cut, is no charge here. */
|
|
17
|
+
export declare const toolCostOf: (rows: readonly TimelineEvent[], tool?: string, others?: boolean) => number | null;
|
|
18
|
+
/** What a run's paid tools are known to have charged (`tool`'s alone, when given; every other tool's with `others`): each
|
|
19
|
+
* charge's line that names its cost, a charge of unknown cost adding nothing (a browser call's row, what is known of it). */
|
|
20
|
+
export declare const knownToolCostOf: (rows: readonly TimelineEvent[], tool?: string, others?: boolean) => number;
|
|
21
|
+
/** 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
|
|
22
|
+
* request). A usage row that says unknown, or says nothing, stays unknown: what the store kept dates from before a
|
|
23
|
+
* follow-up. */
|
|
24
|
+
export declare function costView(rows: readonly TimelineEvent[], stored: number | null | undefined, decisions?: number | null): number | null;
|
|
25
|
+
/** 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
|
|
26
|
+
* have none, from its usage row, plus a workflow's decisions (`decisions`: their known sum and how many are not known;
|
|
27
|
+
* null when they could not be read, which says nothing). Undefined while the cost is known, when the row says neither
|
|
28
|
+
* (an older run's), or when a workflow's decisions are unreadable. No ceiling is claimed. */
|
|
29
|
+
export type SoFar = {
|
|
30
|
+
so_far_usd: number;
|
|
31
|
+
unpriced: number;
|
|
32
|
+
};
|
|
33
|
+
export declare function soFarOf(rows: readonly TimelineEvent[], decisions?: {
|
|
34
|
+
known: number;
|
|
35
|
+
unpriced: number;
|
|
36
|
+
} | null): SoFar | undefined;
|
|
37
|
+
/** An amount in an over-cap row's or failure's words, to the cent ($0.38020940000000003 is $0.38; $1 is $1), as money
|
|
38
|
+
* says it; `centsUp` to the cent above, for what a run went over by and a bound, so neither reads $0 or under. */
|
|
39
|
+
export declare const cents: (usd: number) => string;
|
|
40
|
+
export declare const centsUp: (usd: number) => string;
|
|
41
|
+
/** Whether a run that spent `usd` passed its `cap` by no more than `bound`, the bounds of the requests that ended since
|
|
42
|
+
* its cost last fit (bounds.ts): a cache miss an expected-cost cap (cap.ts) admits the risk of, never a cap the run's own
|
|
43
|
+
* rule broke. */
|
|
44
|
+
export declare const overByMiss: (usd: number, cap: number, bound: number) => boolean;
|
|
45
|
+
/** 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
|
|
46
|
+
* booked once it answers, never clipped, and under an expected-cost cap (cap.ts) a request that missed the cache can cost
|
|
47
|
+
* up to its bound beyond what it was admitted at; one carrying a native web search is held at an allowance, not a bound,
|
|
48
|
+
* so a run can pass its cap by its last request. The next request is then refused. `bound`: the requests' that ended since the cost last fit,
|
|
49
|
+
* bound; when the run passed its cap by no more than it, the row says a cache miss did it, and the most it could have. */
|
|
50
|
+
export declare function withOverCap(rows: TimelineEvent[], cap: number | undefined, bound?: number): TimelineEvent[];
|
|
51
|
+
/** The waiting row of a run paused at its cap, after the refusal's row: "Waiting for you to raise the cap", and no
|
|
52
|
+
* more: the refusal's words are the pause's (pending.said), which a client shows once, as its banner. */
|
|
53
|
+
export declare const BUDGET_WAITING = "Waiting for you to raise the cap";
|
|
54
|
+
/** The waiting row after each answered `ask_person` call, which the timeline module does not know. The question comes from
|
|
55
|
+
* the call's row, whose label this module registers. The server fed its rows through this; the store-backed view feeds the
|
|
56
|
+
* same rows through it, so a run waiting on a question reads the same pending. */
|
|
57
|
+
export declare function withAsks(rows: readonly TimelineEvent[]): TimelineEvent[];
|
|
58
|
+
export type Status = "queued" | "working" | "paused" | "input_required" | "completed" | "failed" | "cancelled";
|
|
59
|
+
export type State = "working" | "waiting" | "idle";
|
|
60
|
+
/** A tool call that waited for a person's approval, as the run's store has it (tool-gate.ts): `resolved` once the run's
|
|
61
|
+
* process acted on the answer. */
|
|
62
|
+
export type Approval = {
|
|
63
|
+
id: string;
|
|
64
|
+
tool: string;
|
|
65
|
+
call_id: string;
|
|
66
|
+
args_json: string;
|
|
67
|
+
requested_at: string;
|
|
68
|
+
price?: number | "not metered";
|
|
69
|
+
resolved?: true;
|
|
70
|
+
};
|
|
71
|
+
/** `args_shown`: the call's arguments as the server shows them (shownArgs), which the gate's resume message names. */
|
|
72
|
+
/** `by`: "message", a deny a person's message gave while the call waited (Runs.message). */
|
|
73
|
+
/** `superseded`: the answer a stop or a cancel overrode before the run's process acted on it, kept as it was given. */
|
|
74
|
+
/** `ended`: a withdrawal by a run that ended (completed or failed) with the call waiting, which nobody stopped. */
|
|
75
|
+
export type ApprovalAnswer = {
|
|
76
|
+
decision: "allow" | "deny" | "canceled" | "withdrawn";
|
|
77
|
+
note?: string;
|
|
78
|
+
answered_at: string;
|
|
79
|
+
args_shown?: string;
|
|
80
|
+
by?: "message";
|
|
81
|
+
superseded?: {
|
|
82
|
+
decision: string;
|
|
83
|
+
answered_at: string;
|
|
84
|
+
note?: string;
|
|
85
|
+
by?: "message";
|
|
86
|
+
};
|
|
87
|
+
ended?: true;
|
|
88
|
+
};
|
|
89
|
+
/** A call withdrawn with its run (a cancel, or a stop while it waited): never run, and an answer after is 409. */
|
|
90
|
+
export declare const withdrawn: (answer: ApprovalAnswer | undefined) => boolean;
|
|
91
|
+
/** The least a journal entry a reader here reads is: its kind and its data. */
|
|
92
|
+
type JournalEntry = {
|
|
93
|
+
kind?: string;
|
|
94
|
+
data?: unknown;
|
|
95
|
+
};
|
|
96
|
+
/** The tool calls a run waits (or waited) for a person's approval on, from its journal's `agentrun.ask` entries, by the
|
|
97
|
+
* call's id: a re-ask of the same call keeps the first request, as the gate's park did; one with an answer is resolved,
|
|
98
|
+
* so the run waits on it no more (the file path's `resolved` once its process acted). The card's id and call id are both
|
|
99
|
+
* the call's id, and its arguments are kept as JSON (shown cut and redacted by the view), as the file path kept them. */
|
|
100
|
+
export declare function asksOf(entries: readonly JournalEntry[]): Map<string, Approval>;
|
|
101
|
+
/** The answers a run got to its asks, from its journal's `agentrun.answer` entries, by the call's id (the key the moment
|
|
102
|
+
* and the pending views read as run.meta.approvals): a person's allow or deny with any note, or a withdrawal taken when
|
|
103
|
+
* the run was stopped or cancelled while the call waited. The first answer for a call stands, but for a stop's
|
|
104
|
+
* withdrawal over an allow the call had not finished on (its `superseded`, as main's stop superseded it): that is the
|
|
105
|
+
* call's answer, keeping the one it overrode. A call asked about with no answer that the run's journal ENDED after (an
|
|
106
|
+
* agentrun.end follows its ask) reads withdrawn, whatever the run's state is now: a run that ended never waits on that
|
|
107
|
+
* call (its end wrote no withdrawal only when its journal would not take it), a reopen of it included; in the words of
|
|
108
|
+
* the first end after it (a stop's end: stopped; a completed or failed one: `ended`). So does every unanswered call of
|
|
109
|
+
* a run `final` as stopped or failed (states no reopen leaves), whose end its journal may not hold (written on the run's
|
|
110
|
+
* row alone). A call asked in the turn going now (no end after it, the run not final) waits. */
|
|
111
|
+
export declare function answersOf(entries: readonly JournalEntry[], { final }?: {
|
|
112
|
+
final?: "stopped" | "failed";
|
|
113
|
+
}): Record<string, ApprovalAnswer>;
|
|
114
|
+
/** Whether the run stands parked at its cap now (an active agentrun.budget park, no raise since): the store-backed fact the
|
|
115
|
+
* status table reads (RunFacts.budgetWaiting), as the file-backed view read a workflow's pause file and an agentic run's
|
|
116
|
+
* turn refusal. */
|
|
117
|
+
export declare const budgetWaitingOf: (entries: readonly JournalEntry[]) => boolean;
|
|
118
|
+
/** The budget card a run parked at its cap shows (pending, kind budget), from its agentrun.budget entry, the same way the
|
|
119
|
+
* file-backed view built it from the run's pause mark (runs.ts workflowBudgetPending): its cap (the run's launch cap, else
|
|
120
|
+
* the park's), what the cap counted as taken and the least the refused step needs, the raise offered (recomputed from
|
|
121
|
+
* those by the view's one formula), and the cap's words at the run's last meaningful row. The overshoot bound reads 0: the
|
|
122
|
+
* kernel cap's parkOf keeps no cache-miss bound. Undefined when no park is active. */
|
|
123
|
+
export declare function budgetOf(entries: readonly JournalEntry[], run: Pick<RunView, "meta" | "rows" | "updatedAt">): Pending | undefined;
|
|
124
|
+
/** The run's meta the status and pending views read: a structural subset of RunMeta, so the server passes its live
|
|
125
|
+
* run.meta and the store-backed view a value built from the run's row. */
|
|
126
|
+
export type RunViewMeta = {
|
|
127
|
+
max_cost_usd?: number;
|
|
128
|
+
cap_raised?: {
|
|
129
|
+
from: number;
|
|
130
|
+
to: number;
|
|
131
|
+
at: string;
|
|
132
|
+
pause?: string;
|
|
133
|
+
}[];
|
|
134
|
+
cap_continue?: {
|
|
135
|
+
pause: string;
|
|
136
|
+
message_id: string;
|
|
137
|
+
sent: boolean;
|
|
138
|
+
tries: number;
|
|
139
|
+
error?: string;
|
|
140
|
+
paused?: string;
|
|
141
|
+
};
|
|
142
|
+
approvals?: Record<string, ApprovalAnswer>;
|
|
143
|
+
stopped_at?: string;
|
|
144
|
+
stopped_after?: number;
|
|
145
|
+
};
|
|
146
|
+
/** The run fields the status, pending and moment views read (statusOf, the predicates, momentOf): a structural subset of
|
|
147
|
+
* Run, so the server passes its live Run and the store-backed view a value built from a row and the journal. */
|
|
148
|
+
export interface RunView {
|
|
149
|
+
id: string;
|
|
150
|
+
agentId: string;
|
|
151
|
+
/** The harness its revision names, for whether a message steers it mid-turn (momentOf). */
|
|
152
|
+
harness: string;
|
|
153
|
+
/** Imported history (`agentrun-serve import`): the source it ran in; absent for a run started here. */
|
|
154
|
+
imported?: {
|
|
155
|
+
source: string;
|
|
156
|
+
session: string;
|
|
157
|
+
};
|
|
158
|
+
kind: RevisionKind;
|
|
159
|
+
outcome?: Status;
|
|
160
|
+
finishing?: Status;
|
|
161
|
+
/** A raised workflow run waiting for a place to open again (only its truthiness is read). */
|
|
162
|
+
placeWait?: unknown;
|
|
163
|
+
cancel: boolean;
|
|
164
|
+
working: boolean;
|
|
165
|
+
submitted: number;
|
|
166
|
+
updatedAt: string;
|
|
167
|
+
rows: readonly TimelineEvent[];
|
|
168
|
+
turns: Pick<Turns, "end" | "open">;
|
|
169
|
+
approvals?: ReadonlyMap<string, Approval>;
|
|
170
|
+
capMark?: number;
|
|
171
|
+
capRefusal?: RefusalFigures;
|
|
172
|
+
/** The words of the cap pause the run stands at, when the view knows them apart from a turn's refusal (the store-backed
|
|
173
|
+
* view, from the cap park entry): the moment reads them when `pausedAt` finds no turn refusal, so a run parked at its cap
|
|
174
|
+
* reads paused either way. The file-backed view leaves this unset and the moment reads `pausedAt`. */
|
|
175
|
+
pausedWords?: string;
|
|
176
|
+
meta: RunViewMeta;
|
|
177
|
+
}
|
|
178
|
+
/** The facts statusOf reads from a run's files (its directory): a workflow paused at its cap, a workflow paused in its
|
|
179
|
+
* process, and the browser ask it waits on. The server computes them from the run's files as before; the store-backed
|
|
180
|
+
* view builds them from the run's row and journal. They are thunks so each is read only where statusOf reaches it, so
|
|
181
|
+
* the hot path (an ended or stopped run) touches no file, exactly as it did when the reads lived inside statusOf. */
|
|
182
|
+
export interface RunFacts {
|
|
183
|
+
/** A workflow run paused at its cap, as its process wrote it (budgetWaiting). */
|
|
184
|
+
budgetWaiting(): boolean;
|
|
185
|
+
/** A workflow run paused in its process (pausedIn(run.dir)). */
|
|
186
|
+
paused(): boolean;
|
|
187
|
+
/** The ask its agent made for the person in its browser the run waits on (askShown(run.dir, run.rows)). */
|
|
188
|
+
browserAsk(): PendingAsk | undefined;
|
|
189
|
+
/** The ask its agent made for the person on its desktop or phone the run waits on (computer-commands.ts computerAsk). */
|
|
190
|
+
computerAsk?(): ComputerAsk | undefined;
|
|
191
|
+
}
|
|
192
|
+
/** The agent's open ask on its desktop or phone, as the run read shows it. */
|
|
193
|
+
export type ComputerAsk = {
|
|
194
|
+
readonly computer?: "desktop" | "phone";
|
|
195
|
+
readonly instruction: string;
|
|
196
|
+
readonly completion_condition: string;
|
|
197
|
+
readonly asked_at: string;
|
|
198
|
+
readonly expires_at: string;
|
|
199
|
+
};
|
|
200
|
+
export declare const meaningful: (rows: readonly TimelineEvent[]) => TimelineEvent | undefined;
|
|
201
|
+
export declare const usersOf: (rows: readonly TimelineEvent[]) => number;
|
|
202
|
+
/** Whether the turn a stop ended is still where the run stands: no message shown is newer than the stop's. By order,
|
|
203
|
+
* never by a count or by the stopped message itself, which a compaction can take off the rows. */
|
|
204
|
+
export declare const stoppedAt: (meta: {
|
|
205
|
+
stopped_at?: string;
|
|
206
|
+
stopped_after?: number;
|
|
207
|
+
}, rows: readonly TimelineEvent[]) => boolean;
|
|
208
|
+
export declare const stopped: (run: Pick<RunView, "meta" | "rows">) => boolean;
|
|
209
|
+
/** The tool call that waits for a person's answer: requested in the run's store, not resolved there, not answered. */
|
|
210
|
+
export declare const waitingApproval: (run: Pick<RunView, "approvals" | "meta">) => Approval | undefined;
|
|
211
|
+
/** One answered (allow or deny) whose answer the run's process has not acted on yet. */
|
|
212
|
+
export declare const actingOn: (run: Pick<RunView, "approvals" | "meta">) => boolean;
|
|
213
|
+
/** What is shown of a call's arguments: the whole of them redacted with the run's redactor, then cut (previewOf), so
|
|
214
|
+
* no cut leaves the head of a held key. */
|
|
215
|
+
export declare const shownArgs: (approval: Pick<Approval, "args_json">, redact: (text: string) => string) => string;
|
|
216
|
+
/** A dollar figure to a millionth, as the timeline's cost.usd is. */
|
|
217
|
+
export declare const micro: (usd: number) => number;
|
|
218
|
+
/** A bound to a millionth, rounded up, so "at most" holds. No bound is 0, never -0: the ceiling of a hair under 0 is -0,
|
|
219
|
+
* which the budget card would print as "-0". */
|
|
220
|
+
export declare const microUp: (usd: number) => number;
|
|
221
|
+
/** How many of the refused request's least a run paused at its cap is offered on top of what was taken (suggestedCap). */
|
|
222
|
+
export declare const SUGGESTED_RAISE_FACTOR = 10;
|
|
223
|
+
/** The raise a run paused at its cap is offered: what the cap counted as taken plus SUGGESTED_RAISE_FACTOR times the
|
|
224
|
+
* refused request's least, rounded up to a whole dollar, and always above the cap (the next dollar above it, if not),
|
|
225
|
+
* so a PATCH with it is a raise. */
|
|
226
|
+
export declare const suggestedCap: (cap: number, spentUsd: number, needsUsd: number) => number;
|
|
227
|
+
/** The pause a run stands at, by its refusal's own start mark (its entry), so no row shown after it moves it; a store
|
|
228
|
+
* with no such mark keys it to the refusal's row. Undefined when it stands at no refusal for room. */
|
|
229
|
+
export declare const pauseOf: (run: RunView, read?: {
|
|
230
|
+
inFlight?: boolean;
|
|
231
|
+
}) => string | undefined;
|
|
232
|
+
/** The follow-up a raise of the pause it stands at asked for and that has not gone yet: one per pause. */
|
|
233
|
+
export declare const continuationOf: (run: RunView) => NonNullable<RunViewMeta["cap_continue"]> | undefined;
|
|
234
|
+
export declare const pausedAt: (run: RunView, read?: {
|
|
235
|
+
inFlight?: boolean;
|
|
236
|
+
}) => string | undefined;
|
|
237
|
+
/** Raised at the pause it stands at, and that raise's follow-up still to go (continuationOf): the run goes on without a
|
|
238
|
+
* person, once the follow-up opens its next process (resumeRaised). */
|
|
239
|
+
export declare const raisedToGo: (run: RunView) => boolean;
|
|
240
|
+
/** What a run waits on, as `pending` says it (one field for every kind; a tool call waiting on approval is another):
|
|
241
|
+
* the question a waiting run asked, read from its last meaningful row (withAsks' waiting row), the same row its
|
|
242
|
+
* status reads, never from a scan of its timeline. */
|
|
243
|
+
export type Pending = {
|
|
244
|
+
kind: "question";
|
|
245
|
+
question: string;
|
|
246
|
+
asked_at: string;
|
|
247
|
+
} | PendingApproval | {
|
|
248
|
+
kind: "budget";
|
|
249
|
+
cap_usd: number;
|
|
250
|
+
spent_usd?: number;
|
|
251
|
+
needs_usd?: number;
|
|
252
|
+
least_cap_usd?: number;
|
|
253
|
+
suggested_cap_usd?: number;
|
|
254
|
+
overshoot_bound_usd?: number;
|
|
255
|
+
said: string;
|
|
256
|
+
at: string;
|
|
257
|
+
node?: string | null;
|
|
258
|
+
} | {
|
|
259
|
+
kind: "browser";
|
|
260
|
+
instruction: string;
|
|
261
|
+
completion_condition: string;
|
|
262
|
+
asked_at: string;
|
|
263
|
+
expires_at: string;
|
|
264
|
+
} | {
|
|
265
|
+
kind: "computer";
|
|
266
|
+
computer: "desktop" | "phone";
|
|
267
|
+
instruction: string;
|
|
268
|
+
completion_condition: string;
|
|
269
|
+
asked_at: string;
|
|
270
|
+
expires_at: string;
|
|
271
|
+
} | null;
|
|
272
|
+
export declare const pendingOf: (rows: readonly TimelineEvent[]) => Pending;
|
|
273
|
+
/** The run's pending approval (`pending`, kind approval): the call that waits; else undefined. */
|
|
274
|
+
export declare const approvalOf: (run: Pick<RunView, "approvals" | "meta">, redact: (text: string) => string) => PendingApproval | undefined;
|
|
275
|
+
/** A run paused at its cap waits on a raise: its cap, what the cap counted as taken and the least the refused request
|
|
276
|
+
* needs (its refusal's mark; none from a store written before it kept them), the raise it is offered (suggestedCap),
|
|
277
|
+
* the refusal's words, and when it came (its error row's time). The figures are as the cap counts them, never rounded.
|
|
278
|
+
* What was taken is the store's spend once its process is gone (`spentNow`), when that is lower: the refusal counted
|
|
279
|
+
* requests still answering at what it held for them, and they have settled. */
|
|
280
|
+
export declare const budgetPending: (run: RunView, spentNow?: number) => Pending | undefined;
|
|
281
|
+
/** A run whose agent asked for the person in its browser waits on their hand-back: what it asked them to do, when it is
|
|
282
|
+
* done, and when the ask expires. Never the session's tag or the live view's link. The two texts are the model's, so
|
|
283
|
+
* redacted with the run's redactor (`redact`), as a tool call's arguments are: a held value it echoes never shows. */
|
|
284
|
+
export declare const browserPending: (ask: PendingAsk | undefined, redact: (text: string) => string) => Pending | undefined;
|
|
285
|
+
/** A run whose agent asked for the person on its desktop or phone waits on their hand-back, the same way: the two texts
|
|
286
|
+
* are the model's, so redacted. */
|
|
287
|
+
export declare const computerPending: (ask: ComputerAsk | undefined, redact: (text: string) => string) => Pending | undefined;
|
|
288
|
+
/** A run's status and state, by the contract's table. `facts` carries the run's file-backed reads (a workflow's pause,
|
|
289
|
+
* the browser ask); every other read is over the run's rows, its turns and its store entries. */
|
|
290
|
+
export declare function statusOf(run: RunView, facts: RunFacts): {
|
|
291
|
+
status: Status;
|
|
292
|
+
state: State;
|
|
293
|
+
};
|
|
294
|
+
/** How a tool call's approval was answered, as the run view folds the journal and the command rows: a person's allow or
|
|
295
|
+
* deny, a withdrawal when the run was stopped, or a cancel with the run. */
|
|
296
|
+
export type ApprovalDecision = "allow" | "deny" | "withdrawn" | "canceled";
|
|
297
|
+
/** A run's live moment, as the run view computes it (statusOf and the predicates above), for the one acceptance decision
|
|
298
|
+
* each act a run takes (message, stop, raise, approve) makes. The write half (runs-over-store.ts) reads nothing else of
|
|
299
|
+
* the run's live state; the coarse facts a row holds (its state, its launch cap) it reads from the store itself. The
|
|
300
|
+
* server builds this from its live Run; the store-backed view builds it from the run's row and journal (momentOverStore),
|
|
301
|
+
* so the acceptance and words an act answers with stay the same. */
|
|
302
|
+
export interface RunMoment {
|
|
303
|
+
readonly id: string;
|
|
304
|
+
readonly agentId: string;
|
|
305
|
+
readonly kind: "agentic" | "workflow";
|
|
306
|
+
/** Where an imported run came from (run.imported?.source); absent for a run started here. An imported run takes no act. */
|
|
307
|
+
readonly importedSource?: string;
|
|
308
|
+
/** A cancel is in flight (run.cancel), whether or not its end is written yet. */
|
|
309
|
+
readonly cancelled: boolean;
|
|
310
|
+
/** The run has reached a last state (statusOf: completed, failed or cancelled). */
|
|
311
|
+
readonly terminal: boolean;
|
|
312
|
+
/** Which last state, for the refusal's words (completed, failed or cancelled). */
|
|
313
|
+
readonly terminalKind?: "completed" | "failed" | "cancelled";
|
|
314
|
+
/** The message "working" predicate: the run's turn is in flight (queued, working-working, or its agent waits on the
|
|
315
|
+
* person in its browser), so a message steers it or follows it, never answers. */
|
|
316
|
+
readonly working: boolean;
|
|
317
|
+
/** The run waits on a person's answer to a question it asked (input_required and waiting on ask_person): a message
|
|
318
|
+
* answers it. */
|
|
319
|
+
readonly awaitingAnswer: boolean;
|
|
320
|
+
/** The run's harness takes a message mid-turn (pi and every workflow run): else a message to a working run follows the
|
|
321
|
+
* turn as a new one (follow_up), never a steer it cannot do. */
|
|
322
|
+
readonly steers: boolean;
|
|
323
|
+
/** The run's cap as it stands now (its launch cap folded with any raise rows), or undefined when it is uncapped. */
|
|
324
|
+
readonly maxCostUsd?: number;
|
|
325
|
+
/** The run is paused at its cap: a message is refused for the same room (raise the cap first). The pause's words, which
|
|
326
|
+
* the refusal carries, or undefined when it is not paused. */
|
|
327
|
+
readonly pausedWords?: string;
|
|
328
|
+
/** The run is paused at its cap (pausedAt): raising the cap resumes it. */
|
|
329
|
+
readonly paused: boolean;
|
|
330
|
+
/** The run has a live process now (a runner holds its claim): a raise's cap holds from its next step, not the one under
|
|
331
|
+
* way. */
|
|
332
|
+
readonly live: boolean;
|
|
333
|
+
/** A message that may not answer a person (a trigger's) is refused while the run waits on one, before anything else. */
|
|
334
|
+
readonly waitsOnPerson: boolean;
|
|
335
|
+
/** The tool call that waits for approval now, if any (waitingApproval): a person's message declines it. */
|
|
336
|
+
readonly waitingApprovalId?: string;
|
|
337
|
+
/** The tool calls this run has or had waiting for approval, by id (for the not-found refusal). */
|
|
338
|
+
readonly approvalIds?: ReadonlySet<string>;
|
|
339
|
+
/** The approvals already answered, by call id, as the run view folds them (for the first-wins refusal and its words). */
|
|
340
|
+
readonly answeredApprovals?: Readonly<Record<string, {
|
|
341
|
+
readonly decision: ApprovalDecision;
|
|
342
|
+
readonly ended?: true;
|
|
343
|
+
}>>;
|
|
344
|
+
}
|
|
345
|
+
/** A run's live moment (RunMoment), computed from the same status table and predicates a person's view reads, plus whether
|
|
346
|
+
* a runner holds its claim now (`live`). The server passes its live Run with `live = this.live(run)`; the store-backed
|
|
347
|
+
* view passes a value built from the run's row and journal, so an act's acceptance is decided the same way either path. */
|
|
348
|
+
export declare function momentOf(run: RunView, facts: RunFacts, live: boolean): RunMoment;
|
|
349
|
+
/** An ended run's words, withheld while this server can't read the sign-in it was handed (load). */
|
|
350
|
+
export declare const WITHHELD_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), so nothing the run said is shown.";
|
|
351
|
+
/** Why a run is refused at its claim: the browser sign-in it was handed can't be read here (the seal key changed or is
|
|
352
|
+
* missing, or the sign-in is damaged). */
|
|
353
|
+
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.";
|
|
354
|
+
/** A withheld run's title: a short line that fits the title's length and holds nothing the run said, so a title that
|
|
355
|
+
* repeats the handed sign-in is never served when this server can't cut it. The full sentence stays in the run's error
|
|
356
|
+
* and review. */
|
|
357
|
+
export declare const WITHHELD_TITLE = "Withheld: a sign-in this run used can't be read";
|
|
358
|
+
/** What a `sign_in_handed` the server did not write (anything but a non-empty array of SHA-256 hashes: a `true` or one
|
|
359
|
+
* hash an older build wrote, or a damaged value) reads as: some pointer was handed, which one is not known, so the run is
|
|
360
|
+
* hidden or withheld, never served uncut, and forget waits for it while it goes. */
|
|
361
|
+
export declare const MALFORMED = "malformed";
|
|
362
|
+
export type Handed = string[] | typeof MALFORMED;
|
|
363
|
+
/** A run's `sign_in_handed` as read from its serve.json: undefined when absent (never handed one); the hashes it names;
|
|
364
|
+
* MALFORMED for any other value. */
|
|
365
|
+
export declare function handedMark(value: unknown): Handed | undefined;
|
|
366
|
+
/** A run's redactor (decision-rows.ts, tool previews): redacted over its refused values. */
|
|
367
|
+
export declare const redactorOf: (values: string[]) => (text: string) => string;
|
|
368
|
+
/** What serve shows of a run's error text, for every run kind: no held secret (redacted, key-refusal.ts' one rule) and
|
|
369
|
+
* no loopback address. */
|
|
370
|
+
export declare const shownOf: (values: string[]) => (text: string) => string;
|
|
371
|
+
/** A run's error as its view and the run lists serve it: its message, and its detail strings, in `shown`'s terms. */
|
|
372
|
+
export declare const servedRunErrorWith: <E extends {
|
|
373
|
+
message: string;
|
|
374
|
+
details?: unknown;
|
|
375
|
+
}>(shown: (text: string) => string, error: E) => E;
|
|
376
|
+
/** A run's review as its view serves it: its reason (an escalation's own words) in `shown`'s terms, or withheld as its
|
|
377
|
+
* other words are while the run is hidden (`unshown`), as a list row read from disk withholds it. */
|
|
378
|
+
export declare const servedReviewWith: <R extends {
|
|
379
|
+
reason: string;
|
|
380
|
+
}>(shown: (text: string) => string, unshown: boolean | undefined, review: R | null) => R | null;
|
|
381
|
+
/** The pointers a run was handed, read back to cut them (sign-ins.ts peek and forgotten), by its `sign_in_handed`: none
|
|
382
|
+
* for a run with no mark (it was never handed one); else, for each hash it names, the live or forgotten pointer whose
|
|
383
|
+
* SHA-256 it is. `unreadable` when what it was handed can't be read back here: a MALFORMED mark, no vendor browser kept
|
|
384
|
+
* beside the mark, the sign-ins file can't be read, or any of its hashes matches no pointer that opens (one under another
|
|
385
|
+
* seal key or none, one forgotten and dropped past MAX_FORGOTTEN, the sign-ins file gone). Fails closed: a marked run is
|
|
386
|
+
* cut of every pointer it was handed, or withheld, never served uncut. Read anew at each call: nothing caches this
|
|
387
|
+
* verdict, so a run withheld while its key was missing is shown once it opens. */
|
|
388
|
+
export declare function handedPointers(signIns: SignInReader | undefined, agentId: string, browser: string | undefined, handed: Handed | undefined): Promise<{
|
|
389
|
+
refs: string[];
|
|
390
|
+
} | "unreadable">;
|
|
391
|
+
/** shown() for a run this server holds no Run for (an ended one a list reads from its row and serve.json alone): cut of
|
|
392
|
+
* every secret this server never shows (serverSecrets) and of what the run was handed of its agent's sign-in
|
|
393
|
+
* (handedPointers); `withheld` when that can't be read back here, as a load would hide the run. `browser` and `handed`
|
|
394
|
+
* come from the run's record (its plane's vendor browser and its `sign_in_handed` mark); `damaged` when the record was
|
|
395
|
+
* there but unreadable, so what it was handed went with it. This is the summary choke point. */
|
|
396
|
+
export declare function rowShown(deps: {
|
|
397
|
+
serverSecrets: () => string[];
|
|
398
|
+
signIns: SignInReader | undefined;
|
|
399
|
+
}, agentId: string, browser: string | undefined, handed: Handed | undefined, damaged?: boolean): Promise<((text: string) => string) | "withheld">;
|
|
400
|
+
/** A call that waited for approval, once its outcome shows below its approval: its own rows (the call's, its result's) say
|
|
401
|
+
* only that it was held. A client folds them into the call's step, at the call's place above the approval row. */
|
|
402
|
+
export declare const HELD = "Held for your approval";
|
|
403
|
+
/** At most this many code points of a person's note on a row's summary; the record keeps it whole. */
|
|
404
|
+
export declare const NOTE_CHARS = 200;
|
|
405
|
+
/** `text` cut to `max` code points, an ellipsis last when cut: a pair of surrogates is never halved. */
|
|
406
|
+
export declare const clipPoints: (text: string, max: number) => string;
|
|
407
|
+
/** A person's note as a row's summary shows it: redacted whole with the run's redactor (`redact`), its links' query values
|
|
408
|
+
* elided (scrubUrls), its first non-empty line, cut to NOTE_CHARS code points. None for an empty note. */
|
|
409
|
+
export declare function noteShown(note: string | undefined, redact: (text: string) => string): string | undefined;
|
|
410
|
+
/** What came of an approval, as its outcome row's summary says it. A deny: "You declined <tool>: <note>" (one colon), or
|
|
411
|
+
* "You declined <tool>." with none; a declining message adds nothing (it shows as the person's own row). An allow: that it
|
|
412
|
+
* ran and where its result went, or that it failed; a note sent with an allow is shown nowhere, as on main. */
|
|
413
|
+
export declare function outcomeSays(tool: string, answer: {
|
|
414
|
+
decision: string;
|
|
415
|
+
by?: string;
|
|
416
|
+
note?: string;
|
|
417
|
+
}, failed: boolean, redact: (text: string) => string): string;
|
|
418
|
+
/** What a person reads when they open the outcome row: the outcome, then the call's result (`rest`), or the refusal's words.
|
|
419
|
+
* An empty result says so: "Its result: (no output)", never "Its result:" and nothing. */
|
|
420
|
+
export declare function outcomeShows(tool: string, answer: {
|
|
421
|
+
decision: string;
|
|
422
|
+
by?: string;
|
|
423
|
+
}, rest: string, failed: boolean): string;
|
|
424
|
+
/** The rows of a run whose calls waited for approval, as the runner writes it (store-view.ts): the gate's ask
|
|
425
|
+
* (agentrun.ask, `asks`) and the person's answer (agentrun.answer, `answers`) are journal entries, and an allowed call runs
|
|
426
|
+
* in place, so its result row is its real result; a denied one's is the refusal. Each such call reads in order: its own
|
|
427
|
+
* rows, then the approval row, then, once there is one, the outcome row; its own rows say only that it was held once the
|
|
428
|
+
* outcome shows below, and before that what came of the approval so far. Arguments and notes go through `redact`, the
|
|
429
|
+
* run's redactor, before any cut. The rows this function makes are dropped first, so a pass over its own output gives the
|
|
430
|
+
* same rows. */
|
|
431
|
+
export declare function withApprovalRows(rows: readonly TimelineEvent[], asks: ReadonlyMap<string, Approval>, answers: Readonly<Record<string, ApprovalAnswer>>, redact: (text: string) => string): TimelineEvent[];
|
|
432
|
+
export {};
|