@parcha/agentrun-serve 0.1.0-beta.31 → 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 +422 -0
- package/NOTICE +18 -0
- package/README.md +887 -241
- 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 +5 -3
- package/dist/agents.js +37 -17
- package/dist/app.d.ts +2 -4
- package/dist/app.js +207 -92
- 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/bounds.d.ts +26 -0
- package/dist/bounds.js +137 -0
- package/dist/box-egress-vm.d.ts +2 -1
- package/dist/box-egress-vm.js +20 -6
- package/dist/box-egress.d.ts +16 -6
- 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.js +28 -1
- package/dist/box-relay.d.ts +2 -0
- package/dist/box-relay.js +2 -2
- package/dist/boxes.d.ts +13 -1
- 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 +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 +272 -62
- package/dist/cap.js +599 -189
- package/dist/cli.js +201 -17
- 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 +28 -1
- package/dist/decisions.js +63 -6
- 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 -35
- package/dist/files.js +9 -120
- 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-app.d.ts +33 -4
- package/dist/harness-app.js +530 -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 +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 +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/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 +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 +5 -1
- package/dist/learn/skills.js +5 -4
- package/dist/learned-workflow.d.ts +12 -2
- package/dist/learned-workflow.js +9 -5
- package/dist/learning-routes.d.ts +88 -41
- package/dist/learning-routes.js +340 -539
- package/dist/learning-run.d.ts +60 -53
- package/dist/learning-run.js +181 -224
- 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 +46 -13
- package/dist/mcp-gateway.js +145 -45
- 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 +919 -108
- package/dist/owner.d.ts +46 -10
- package/dist/owner.js +123 -43
- package/dist/page.d.ts +10 -0
- package/dist/page.js +27 -4
- 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 +15 -13
- package/dist/place.js +25 -15
- package/dist/port-models.d.ts +53 -0
- package/dist/port-models.js +93 -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 +78 -17
- 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 +30 -5
- package/dist/runnable.js +149 -72
- 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 +351 -220
- package/dist/runs.js +1570 -540
- 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 +7 -0
- package/dist/secrets.js +17 -2
- 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 +142 -73
- package/dist/server.js +1683 -596
- 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 +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 +25 -12
- package/dist/tool-keys.js +20 -2
- 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 +337 -61
- 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 +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 +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 -21
- 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-CnJBf7Lc.js +0 -486
- 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/sessions.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Context } from "@earendil-works/chord";
|
|
2
2
|
import { type Harness } from "@earendil-works/pi-durable";
|
|
3
3
|
import { type SessionStore } from "@parcha/agentrun-kernel";
|
|
4
|
-
|
|
4
|
+
import { type SyncTarget } from "@parcha/pi-durable-disk";
|
|
5
|
+
/** `store`: the run's store, which the sessions' barrier syncs (a kernel effect's start, before it runs). */
|
|
6
|
+
export declare function durableSessions(harness: Harness, context: Context, store?: SyncTarget): SessionStore;
|
package/dist/sessions.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ROOT_CONVERSATION_ID } from "@earendil-works/pi-durable";
|
|
2
2
|
import { SessionFenced } from "@parcha/agentrun-kernel";
|
|
3
|
-
import { FencedError } from "@parcha/pi-durable-disk";
|
|
3
|
+
import { BARRIER, FencedError, syncNow } from "@parcha/pi-durable-disk";
|
|
4
4
|
const SESSION_KEY = "session.key";
|
|
5
5
|
const PAGE = 500;
|
|
6
|
-
|
|
6
|
+
/** `store`: the run's store, which the sessions' barrier syncs (a kernel effect's start, before it runs). */
|
|
7
|
+
export function durableSessions(harness, context, store) {
|
|
7
8
|
const holders = new Map();
|
|
8
9
|
const known = new Map();
|
|
9
10
|
// One creation per key at a time: two first opens at once share it, so a key names one conversation.
|
|
@@ -39,13 +40,13 @@ export function durableSessions(harness, context) {
|
|
|
39
40
|
await scan(id, (entry) => out.push({ kind: entry.kind, data: (entry.data ?? null) }));
|
|
40
41
|
return out;
|
|
41
42
|
};
|
|
42
|
-
/** One commit, refused as SessionFenced
|
|
43
|
+
/** One commit, refused as SessionFenced once the run is fenced. */
|
|
43
44
|
const commit = async (key, change) => {
|
|
44
45
|
try {
|
|
45
46
|
return await harness.commit(change, context);
|
|
46
47
|
}
|
|
47
48
|
catch (error) {
|
|
48
|
-
// The
|
|
49
|
+
// The fence's refusal can come as the cause of the Harness's own error.
|
|
49
50
|
for (let at = error; at; at = at.cause)
|
|
50
51
|
if (at instanceof FencedError || at instanceof SessionFenced)
|
|
51
52
|
throw new SessionFenced(key);
|
|
@@ -89,6 +90,9 @@ export function durableSessions(harness, context) {
|
|
|
89
90
|
const writer = {
|
|
90
91
|
key,
|
|
91
92
|
read: () => read(key),
|
|
93
|
+
// Every record appended so far is durable when this resolves: the kernel calls it after an effect's start record
|
|
94
|
+
// and before the effect runs (drive.ts), so a lost box never runs it twice.
|
|
95
|
+
sync: () => syncNow(store, BARRIER.kernelEffectIntent),
|
|
92
96
|
async append(records) {
|
|
93
97
|
await commit(key, async (tx) => {
|
|
94
98
|
// Checked in the commit: an open that resolved before it fences this writer, whatever its own timing.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type SecretMeta, type SecretPredicate, type SecretSource } from "./secret-writes.js";
|
|
2
|
+
export type { SecretMeta };
|
|
3
|
+
/** Where a saved sign-in's credential came from: a person signing in during a run. */
|
|
4
|
+
export declare const SIGN_IN_SOURCE: SecretSource;
|
|
5
|
+
/** A saved sign-in's secret as metadata (secret-writes.ts secretMeta): named secretName("sign-in", agent, provider), set (a
|
|
6
|
+
* row exists only with a sealed pointer, whether or not it opens here), from a sign-in, changed when its pointer was
|
|
7
|
+
* saved (the row's saved_at; a run verifying it, verified_at, keeps the same pointer and changes nothing). */
|
|
8
|
+
export declare function signInSecretMeta(row: {
|
|
9
|
+
agentId: string;
|
|
10
|
+
provider: string;
|
|
11
|
+
savedAt: number;
|
|
12
|
+
}): SecretMeta;
|
|
13
|
+
/** The browser plane's secret writes, by operationId, for secret-writes.ts's one gate: no browser route takes a
|
|
14
|
+
* credential in its body (rule 1 above), but forgetting a saved sign-in drops one, whatever its request. A browser route
|
|
15
|
+
* that takes or drops one is added here and gated with no other change. */
|
|
16
|
+
export declare const SIGN_IN_SECRET_FIELDS: Readonly<Record<string, SecretPredicate>>;
|
|
17
|
+
/** The browser plane's secret write routes, for the planted-secret harness: none. A sign-in is saved inside a run (the
|
|
18
|
+
* vendor's profile with save:true, kept by the run path in store.signIns), never through an API write, so the harness
|
|
19
|
+
* plants one straight into the store (test/sign-ins-planted.mjs plantedSignIn) instead of through a route. */
|
|
20
|
+
export declare const SIGN_IN_WRITE_ROUTES: readonly string[];
|
|
21
|
+
/** A request body field that names a browser credential: a vendor context or profile, a sign-in's pointer or ref, a
|
|
22
|
+
* sealed pointer, or a browser vendor's key. `pointer` alone is a JSON pointer (triggers' payload paths), not one. */
|
|
23
|
+
export declare const BROWSER_CREDENTIAL_FIELD: RegExp;
|
|
24
|
+
type Json = Record<string, unknown>;
|
|
25
|
+
/** The browser plane's operations in an OpenAPI document and what their bodies name: `operations` (by operationId, the
|
|
26
|
+
* tool settings' browser pick as `putToolSettings#browser`), `credentials` (a credential field in a browser operation's
|
|
27
|
+
* body, as `operationId.field.path`), `anywhere` (a browser credential field in any operation's body), and `bodies` (the
|
|
28
|
+
* browser operations' body schemas, resolved). A browser operation is one whose path holds `/sign-ins` or `/browser`,
|
|
29
|
+
* or that is tagged `sign-ins` or `browser`. */
|
|
30
|
+
export declare function browserBodyCredentials(doc: Json): {
|
|
31
|
+
operations: string[];
|
|
32
|
+
credentials: string[];
|
|
33
|
+
anywhere: string[];
|
|
34
|
+
bodies: unknown[];
|
|
35
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Browser sign-ins under the secrets plan (SECRETS-PLAN.md, tl-browser's row: rules 1, 3 and 5). A saved sign-in is a
|
|
2
|
+
// sealed pointer to the browser vendor's object (a Browserbase context, a Kernel profile) that holds the agent's cookies.
|
|
3
|
+
//
|
|
4
|
+
// Rule 1, the writes: no route takes a browser credential in its body. A sign-in is saved inside a run (pi-browser opens
|
|
5
|
+
// the vendor's profile with save:true and the run path keeps its pointer, sealed, in store.signIns), never by an API
|
|
6
|
+
// write; the one browser route that changes a sign-in, DELETE /agents/{agent_id}/sign-ins/{key} (forgetSignIn), has no
|
|
7
|
+
// body. So this plane marks no field `x-agentrun-secret` and gives the planted-secret harness no write route
|
|
8
|
+
// (browserBodyCredentials is the check that keeps it so). The forget drops a sealed pointer, though: it is registered with
|
|
9
|
+
// secret-writes.ts as a secret write whatever its request, the owner's session alone, never the API token.
|
|
10
|
+
//
|
|
11
|
+
// Rule 3, the views: each saved sign-in carries its one secret under `secret`, in the metadata shape every plane gives
|
|
12
|
+
// (signInSecretMeta), beside its own state (held | ready | unreadable). Never the pointer, a prefix, a length or a hash.
|
|
13
|
+
import { registerSecretWrite, secretMeta, secretName } from "./secret-writes.js";
|
|
14
|
+
/** Where a saved sign-in's credential came from: a person signing in during a run. */
|
|
15
|
+
export const SIGN_IN_SOURCE = "sign-in";
|
|
16
|
+
/** A saved sign-in's secret as metadata (secret-writes.ts secretMeta): named secretName("sign-in", agent, provider), set (a
|
|
17
|
+
* row exists only with a sealed pointer, whether or not it opens here), from a sign-in, changed when its pointer was
|
|
18
|
+
* saved (the row's saved_at; a run verifying it, verified_at, keeps the same pointer and changes nothing). */
|
|
19
|
+
export function signInSecretMeta(row) {
|
|
20
|
+
return secretMeta(secretName("sign-in", row.agentId, row.provider), { set: true, source: SIGN_IN_SOURCE, changedAt: new Date(row.savedAt) });
|
|
21
|
+
}
|
|
22
|
+
/** The browser plane's secret writes, by operationId, for secret-writes.ts's one gate: no browser route takes a
|
|
23
|
+
* credential in its body (rule 1 above), but forgetting a saved sign-in drops one, whatever its request. A browser route
|
|
24
|
+
* that takes or drops one is added here and gated with no other change. */
|
|
25
|
+
export const SIGN_IN_SECRET_FIELDS = {
|
|
26
|
+
// Forgetting a saved sign-in drops its sealed credential: the owner's session alone, never a token.
|
|
27
|
+
forgetSignIn: () => true,
|
|
28
|
+
};
|
|
29
|
+
for (const [operationId, predicate] of Object.entries(SIGN_IN_SECRET_FIELDS))
|
|
30
|
+
registerSecretWrite(operationId, predicate);
|
|
31
|
+
/** The browser plane's secret write routes, for the planted-secret harness: none. A sign-in is saved inside a run (the
|
|
32
|
+
* vendor's profile with save:true, kept by the run path in store.signIns), never through an API write, so the harness
|
|
33
|
+
* plants one straight into the store (test/sign-ins-planted.mjs plantedSignIn) instead of through a route. */
|
|
34
|
+
export const SIGN_IN_WRITE_ROUTES = [];
|
|
35
|
+
/** A request body field that names a browser credential: a vendor context or profile, a sign-in's pointer or ref, a
|
|
36
|
+
* sealed pointer, or a browser vendor's key. `pointer` alone is a JSON pointer (triggers' payload paths), not one. */
|
|
37
|
+
export const BROWSER_CREDENTIAL_FIELD = /^(?:ref|sign_?in_?ref|(?:browser_?)?context(?:_?id)?|profile(?:_?(?:id|name))?|(?:sealed_?pointer|pointer_?sealed)|(?:browserbase|kernel)_?api_?key)$/i;
|
|
38
|
+
/** A field of a browser operation's body that names any credential at all (a key, a token, a secret, a cookie...). */
|
|
39
|
+
const ANY_CREDENTIAL_FIELD = /(?:api_?key|token|secret|password|passwd|cookie|session|bearer|authorization|credential|sealed|context|profile|^ref$|pointer)/i;
|
|
40
|
+
/** The browser plane's operations in an OpenAPI document and what their bodies name: `operations` (by operationId, the
|
|
41
|
+
* tool settings' browser pick as `putToolSettings#browser`), `credentials` (a credential field in a browser operation's
|
|
42
|
+
* body, as `operationId.field.path`), `anywhere` (a browser credential field in any operation's body), and `bodies` (the
|
|
43
|
+
* browser operations' body schemas, resolved). A browser operation is one whose path holds `/sign-ins` or `/browser`,
|
|
44
|
+
* or that is tagged `sign-ins` or `browser`. */
|
|
45
|
+
export function browserBodyCredentials(doc) {
|
|
46
|
+
const resolve = (value) => {
|
|
47
|
+
const ref = value?.$ref;
|
|
48
|
+
if (typeof ref !== "string" || !ref.startsWith("#/"))
|
|
49
|
+
return value;
|
|
50
|
+
return resolve(ref.slice(2).split("/").reduce((at, key) => at?.[key.replaceAll("~1", "/").replaceAll("~0", "~")], doc));
|
|
51
|
+
};
|
|
52
|
+
/** Each property of `schema` (nested, through items, compositions and conditions), as `at.name`. */
|
|
53
|
+
const fields = (schema, at, seen = new Set()) => {
|
|
54
|
+
const s = resolve(schema);
|
|
55
|
+
if (!s || typeof s !== "object" || seen.has(s))
|
|
56
|
+
return [];
|
|
57
|
+
seen.add(s);
|
|
58
|
+
const out = [];
|
|
59
|
+
for (const [name, inner] of Object.entries(s.properties ?? {})) {
|
|
60
|
+
out.push({ name, path: `${at}.${name}`, schema: inner }, ...fields(inner, `${at}.${name}`, seen));
|
|
61
|
+
}
|
|
62
|
+
for (const key of ["items", "additionalProperties", "not", "if", "then", "else"])
|
|
63
|
+
if (s[key] && typeof s[key] === "object")
|
|
64
|
+
out.push(...fields(s[key], at, seen));
|
|
65
|
+
for (const key of ["oneOf", "anyOf", "allOf", "prefixItems"])
|
|
66
|
+
for (const inner of s[key] ?? [])
|
|
67
|
+
out.push(...fields(inner, at, seen));
|
|
68
|
+
for (const inner of Object.values(s.patternProperties ?? {}))
|
|
69
|
+
out.push(...fields(inner, at, seen));
|
|
70
|
+
return out;
|
|
71
|
+
};
|
|
72
|
+
const bodyOf = (op) => Object.values(resolve(op.requestBody)?.content ?? {}).map((media) => media.schema);
|
|
73
|
+
const operations = [];
|
|
74
|
+
const credentials = [];
|
|
75
|
+
const anywhere = [];
|
|
76
|
+
const bodies = [];
|
|
77
|
+
for (const [path, item] of Object.entries(doc.paths ?? {})) {
|
|
78
|
+
for (const op of Object.values(item)) {
|
|
79
|
+
if (!op || typeof op !== "object" || typeof op.operationId !== "string")
|
|
80
|
+
continue;
|
|
81
|
+
const id = op.operationId;
|
|
82
|
+
const body = bodyOf(op).flatMap((schema) => fields(schema, id));
|
|
83
|
+
for (const field of body)
|
|
84
|
+
if (BROWSER_CREDENTIAL_FIELD.test(field.name))
|
|
85
|
+
anywhere.push(field.path);
|
|
86
|
+
const tags = op.tags ?? [];
|
|
87
|
+
const browser = /\/(?:sign-ins|browser)(?:\/|$)/.test(path) || tags.includes("sign-ins") || tags.includes("browser");
|
|
88
|
+
// The tool settings' browser pick (which vendor a run's browser is on) is the browser plane's too.
|
|
89
|
+
const picks = body.filter((field) => field.name === "browser");
|
|
90
|
+
if (browser) {
|
|
91
|
+
operations.push(id);
|
|
92
|
+
bodies.push(...bodyOf(op).map(resolve));
|
|
93
|
+
for (const field of body)
|
|
94
|
+
if (ANY_CREDENTIAL_FIELD.test(field.name))
|
|
95
|
+
credentials.push(field.path);
|
|
96
|
+
}
|
|
97
|
+
else if (picks.length) {
|
|
98
|
+
operations.push(`${id}#browser`);
|
|
99
|
+
for (const pick of picks) {
|
|
100
|
+
bodies.push(resolve(pick.schema));
|
|
101
|
+
for (const field of fields(pick.schema, pick.path))
|
|
102
|
+
if (ANY_CREDENTIAL_FIELD.test(field.name))
|
|
103
|
+
credentials.push(field.path);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return { operations: [...new Set(operations)], credentials, anywhere, bodies };
|
|
109
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { type SecretMeta } from "./sign-ins-secrets.js";
|
|
2
|
+
import { type Claim, SignInHandedTo, SignInMissing, type SignInRow, type Store } from "./store/index.js";
|
|
3
|
+
/** The one saved sign-in an agent keeps per provider is named this; the owner's label, never the model's. */
|
|
4
|
+
export declare const SIGN_IN_NAME = "default";
|
|
5
|
+
/** The SHA-256 of a sign-in pointer: what a run's launch keeps (sign_in_handed), and what forget asks after. Never the
|
|
6
|
+
* pointer. */
|
|
7
|
+
export declare const pointerHash: (pointer: string) => string;
|
|
8
|
+
/** A saved sign-in as the owner sees it: its name and when it was saved, and its state. `ready`: its pointer opens under
|
|
9
|
+
* this server's seal key. `unreadable`: it does not (no seal key now, another key, or a damaged row); the owner may
|
|
10
|
+
* forget it or save again, and no run starts from it. Never the pointer. */
|
|
11
|
+
export type SavedSignIn = {
|
|
12
|
+
name: string;
|
|
13
|
+
provider: string;
|
|
14
|
+
saved_at: number;
|
|
15
|
+
state: "ready" | "unreadable";
|
|
16
|
+
};
|
|
17
|
+
/** The vendor side forget needs: delete an agent's object (its pointer) at the provider. The REST client (sign-ins.ts's
|
|
18
|
+
* vendorsOver) is one; a test's fake is another. */
|
|
19
|
+
export type SignInVendors = {
|
|
20
|
+
remove(provider: string, pointer: string): Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
/** The store slice this module needs. */
|
|
23
|
+
export type SignInsStore = Pick<Store, "signIns">;
|
|
24
|
+
/** Saves the one live sign-in for the agent and provider: its pointer sealed, its name (default SIGN_IN_NAME), inserted or
|
|
25
|
+
* replaced in place. Refused with no seal key (a pointer is never kept in the clear). */
|
|
26
|
+
/** Saves the agent's first sign-in for the provider only when it has none, in the store's one atomic step (saveIfAbsent):
|
|
27
|
+
* `saved` true with the row it inserted, or false with the live row another save left, never the one asked for. Refused
|
|
28
|
+
* with no seal key, as saveSignIn is. */
|
|
29
|
+
export declare function saveSignInIfAbsent(store: SignInsStore, sealKey: Buffer | undefined, signIn: {
|
|
30
|
+
agentId: string;
|
|
31
|
+
provider: string;
|
|
32
|
+
pointer: string;
|
|
33
|
+
name?: string;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
saved: boolean;
|
|
36
|
+
row: SignInRow;
|
|
37
|
+
}>;
|
|
38
|
+
export declare function saveSignIn(store: SignInsStore, sealKey: Buffer | undefined, signIn: {
|
|
39
|
+
agentId: string;
|
|
40
|
+
provider: string;
|
|
41
|
+
pointer: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
}): Promise<SavedSignIn>;
|
|
44
|
+
/** The agent's saved sign-ins, as the owner sees them (never a pointer): each with its name, when it was saved, and whether
|
|
45
|
+
* it opens under this server's seal key (ready) or not (unreadable). */
|
|
46
|
+
export declare function savedSignIns(store: SignInsStore, sealKey: Buffer | undefined, agentId: string): Promise<SavedSignIn[]>;
|
|
47
|
+
/** The pointer of the agent's sign-in for the provider, read only: for a run's launch to hand it (E2). `unreadable` when
|
|
48
|
+
* the agent keeps one that does not open under this server's seal key (no key now, another, or damaged); undefined when it
|
|
49
|
+
* has none. No lease is taken, nothing is written. */
|
|
50
|
+
export declare function openSavedPointer(store: SignInsStore, sealKey: Buffer | undefined, agentId: string, provider: string): Promise<{
|
|
51
|
+
pointer: string;
|
|
52
|
+
} | "unreadable" | undefined>;
|
|
53
|
+
/** A run's handed sign-in, as the browser binding takes it: the vendor, the pointer, and whether the run saves to it. */
|
|
54
|
+
export type RunSignIn = {
|
|
55
|
+
provider: Vendor;
|
|
56
|
+
ref: string;
|
|
57
|
+
save: boolean;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* The sign-in run `claim.runId`'s browser starts from on the runner, read from the store under that run's own claim: its
|
|
61
|
+
* agent's saved pointer for `resolution`'s vendor, opened under `sealKey`. The runner is one process holding many claims,
|
|
62
|
+
* so this is the only way a run gets its pointer there (never the process's environment or secrets' pipe, which the old
|
|
63
|
+
* per-run process read with handedSignIn).
|
|
64
|
+
*
|
|
65
|
+
* As the old launch did, the run keeps that it was handed the pointer (its hash added to sign_in_handed, under the claim)
|
|
66
|
+
* before it is handed it, so a forget sees the run: one it could not keep (a stale or lost claim: Fenced) is handed none.
|
|
67
|
+
* The pointer is read again after that write: a forget that landed between the two moved it to a tombstone, and the run
|
|
68
|
+
* is handed none. It saves to it as the store answers that same write (the save lease, in its transaction: never two
|
|
69
|
+
* runs of one sign-in at once, a Browserbase one held for its settle window past a run that left running). None, too, with no seal key, a pointer that does not open, a browser that keeps none, or
|
|
70
|
+
* an agent that saved none for the vendor. Never throws, and never names the pointer.
|
|
71
|
+
*/
|
|
72
|
+
export declare function runSignIn(store: Pick<Store, "runs" | "signIns">, sealKey: Buffer | undefined, claim: Claim, resolution: string, options?: RunSignInOptions): Promise<RunSignIn | undefined>;
|
|
73
|
+
/** Where a run's first sign-in is made (the vendors' REST APIs, over the run's own claim keys: sign-ins.ts vendorsOver)
|
|
74
|
+
* and where a create that fails is said (the run's log). Absent, none is made. */
|
|
75
|
+
export type RunSignInOptions = {
|
|
76
|
+
vendors?: {
|
|
77
|
+
create(vendor: Vendor): Promise<string>;
|
|
78
|
+
remove(vendor: Vendor, ref: string): Promise<void>;
|
|
79
|
+
};
|
|
80
|
+
log?: (line: string) => void;
|
|
81
|
+
};
|
|
82
|
+
/** Whether every sign-in run `run` was handed (its sign_in_handed hashes) reads back here: a live sign-in of its agent, or
|
|
83
|
+
* a kept tombstone of one, that opens under `sealKey` to a pointer of that hash. One that does not (its seal does not open
|
|
84
|
+
* here, or nothing of it is kept) means the run's text could hold a pointer nothing can cut, so the run must not go on:
|
|
85
|
+
* main's UNREADABLE_SIGN_IN (runs.ts). A run handed none reads back. */
|
|
86
|
+
export declare function handedSignInReadsBack(store: Pick<Store, "signIns">, sealKey: Buffer | undefined, run: {
|
|
87
|
+
readonly agentId: string;
|
|
88
|
+
readonly signInHanded: readonly string[] | null;
|
|
89
|
+
}): Promise<boolean>;
|
|
90
|
+
/**
|
|
91
|
+
* A run on the runner saved its sign-in at `at` (a session that saved to it ended): the sign-in's verified_at, as main's
|
|
92
|
+
* lease end fills it from the run's saved mark. Only under the run's own claim, for what it was handed to save: the
|
|
93
|
+
* agent is the run's own (never the caller's word), its saved pointer is still the one handed, its hash is in the run's
|
|
94
|
+
* sign_in_handed, and the claim still holds the run (a fenced write first: a stale or lost claim verifies nothing). The
|
|
95
|
+
* stamp is conditioned on the save read with the pointer (its number, ifSave), so a sign-in saved afresh meanwhile is never
|
|
96
|
+
* marked by this save. True when the store stamped. Never throws, and never names the pointer.
|
|
97
|
+
*/
|
|
98
|
+
export declare function verifyRunSignIn(store: Pick<Store, "runs" | "signIns">, sealKey: Buffer | undefined, claim: Claim, signIn: RunSignIn, at: number): Promise<boolean>;
|
|
99
|
+
/** The pointers of the agent's forgotten sign-ins for the provider that open under this server's seal key, and whether any
|
|
100
|
+
* does not: for cutting a handed pointer from what a run still going shows, after its sign-in was forgotten (E3/the
|
|
101
|
+
* runner). Never a live sign-in. */
|
|
102
|
+
export declare function forgottenPointers(store: SignInsStore, sealKey: Buffer | undefined, agentId: string, provider: string): Promise<{
|
|
103
|
+
pointers: string[];
|
|
104
|
+
unreadable: boolean;
|
|
105
|
+
}>;
|
|
106
|
+
/** What forget answers: the provider it forgot, and whether its object was deleted at the vendor. */
|
|
107
|
+
export type Forgotten = {
|
|
108
|
+
provider: string;
|
|
109
|
+
at_vendor: "deleted" | "not_deleted";
|
|
110
|
+
message?: string;
|
|
111
|
+
};
|
|
112
|
+
/** Forgets the agent's live sign-in for the provider. In one store transaction (the lock a launch shares): refused with
|
|
113
|
+
* SignInHandedTo while a running run holds this pointer's hash in its sign_in_handed (or, when the pointer does not open,
|
|
114
|
+
* while any running run was handed a sign-in at all — any such run may hold it); otherwise the sealed pointer moves to a
|
|
115
|
+
* tombstone (the newest kept) and the live row goes. The vendor's object is then deleted, best effort (what failed is
|
|
116
|
+
* said; this server no longer points to it either way). SignInMissing when the agent has no sign-in for the provider. */
|
|
117
|
+
export declare function forgetSignIn(store: SignInsStore, sealKey: Buffer | undefined, vendors: SignInVendors, agentId: string, provider: string): Promise<Forgotten>;
|
|
118
|
+
/** Which run still going was handed the sign-in whose pointer hashes to `hash`, if one was: the check the runner makes
|
|
119
|
+
* before it serves a run's output. Exposes store.signIns.handedHolder. */
|
|
120
|
+
export declare function handedTo(store: SignInsStore, hash: string): Promise<string | undefined>;
|
|
121
|
+
export { SignInHandedTo, SignInMissing };
|
|
122
|
+
/** Browserbase writes a saved context back after its session ends (pi-browser waits for it), so the saver's save lease must
|
|
123
|
+
* outlast its run leaving 'running' by this long, or the next run saves over a write-back in flight. Main's constant and
|
|
124
|
+
* value (sign-ins.ts); the serve layer's policy, passed to the store as signInSettleMs. Kernel and others keep none. */
|
|
125
|
+
export declare const BROWSERBASE_SETTLE_MS = 10000;
|
|
126
|
+
/** A browser the server keeps a sign-in for; a local Chrome keeps none. Ported from sign-ins.ts, kept here so this module
|
|
127
|
+
* does not depend on the file store the switch deletes. */
|
|
128
|
+
export type Vendor = "browserbase" | "kernel";
|
|
129
|
+
/** A saved sign-in as GET /agents/{id} shows it (the v2 SignIn), never its pointer: the old SignInView's fields, and its
|
|
130
|
+
* one secret's metadata under `secret` (sign-ins-secrets.ts signInSecretMeta). */
|
|
131
|
+
export type SignInView = {
|
|
132
|
+
key: string;
|
|
133
|
+
provider: Vendor;
|
|
134
|
+
state: "ready" | "held" | "unreadable";
|
|
135
|
+
held_by: string | null;
|
|
136
|
+
verified_at: string | null;
|
|
137
|
+
secret: SecretMeta;
|
|
138
|
+
};
|
|
139
|
+
/** The vendor a run's browser resolves to keeps a sign-in for: Browserbase's and Kernel's; a local Chrome is refused by
|
|
140
|
+
* name; an unavailable browser has none. Ported from sign-ins.ts. */
|
|
141
|
+
export declare function vendorOf(resolution: string): Vendor | undefined;
|
|
142
|
+
/** The agent's sign-ins as the v2 API shows them (the old SignIns.view), never a pointer. Per sign-in: `held`/`held_by`
|
|
143
|
+
* when a live run holds its pointer's hash (store.signIns.handedHolder), a Browserbase one for its settle window past the
|
|
144
|
+
* run's end too (settleFor, so the view matches the save lease); `unreadable` when its pointer does not open under this
|
|
145
|
+
* server's seal key (then held_by is null — no hash to match a run by); `verified_at` from the store; and `secret`, its
|
|
146
|
+
* secret's metadata, changed_at being its saved_at. */
|
|
147
|
+
export declare function signInViews(store: SignInsStore, sealKey: Buffer | undefined, agentId: string): Promise<SignInView[]>;
|
|
148
|
+
/** The pointer of the agent's sign-in for `resolution`'s vendor (the old SignIns.peek): `{ ref }`, `unreadable` when it
|
|
149
|
+
* does not open, or undefined when there is none or the browser keeps none. */
|
|
150
|
+
export declare function peekSignIn(store: SignInsStore, sealKey: Buffer | undefined, agentId: string, resolution: string): Promise<{
|
|
151
|
+
ref: string;
|
|
152
|
+
} | "unreadable" | undefined>;
|
|
153
|
+
/** The agent's forgotten pointers for `resolution`'s vendor that open here, and whether any does not (the old
|
|
154
|
+
* SignIns.forgotten): `{ refs, unreadable }`, or `{ refs: [], unreadable: false }` for a browser that keeps none. */
|
|
155
|
+
export declare function forgottenSignIns(store: SignInsStore, sealKey: Buffer | undefined, agentId: string, resolution: string): Promise<{
|
|
156
|
+
refs: string[];
|
|
157
|
+
unreadable: boolean;
|
|
158
|
+
}>;
|
|
159
|
+
/** Forgets the agent's sign-in named `key`, across every provider that keeps it (the old SignIns.forget): each held check
|
|
160
|
+
* runs first, so one held refuses the whole forget (409 sign_in_held) and removes none; then each is moved to a tombstone
|
|
161
|
+
* and deleted at its vendor best effort. 404 when the agent has no sign-in named `key`. */
|
|
162
|
+
export declare function forgetSignInView(store: SignInsStore, sealKey: Buffer | undefined, vendors: SignInVendors, agentId: string, key: string): Promise<{
|
|
163
|
+
key: string;
|
|
164
|
+
removed: Array<{
|
|
165
|
+
provider: Vendor;
|
|
166
|
+
at_vendor: "deleted" | "not_deleted";
|
|
167
|
+
message?: string;
|
|
168
|
+
}>;
|
|
169
|
+
}>;
|
|
170
|
+
/** The reads that find what a run was handed (handed-values.ts handedValuesOf): an agent's live pointer and its
|
|
171
|
+
* forgotten ones, opened under `sealKey`. Read-only: what the runner's learning end holds to refuse a run's pointer. */
|
|
172
|
+
export declare function signInReads(store: SignInsStore, sealKey: Buffer | undefined): {
|
|
173
|
+
peek: (agentId: string, resolution: string) => Promise<"unreadable" | {
|
|
174
|
+
ref: string;
|
|
175
|
+
} | undefined>;
|
|
176
|
+
forgotten: (agentId: string, resolution: string) => Promise<{
|
|
177
|
+
refs: string[];
|
|
178
|
+
unreadable: boolean;
|
|
179
|
+
}>;
|
|
180
|
+
};
|
|
181
|
+
/** The old SignIns interface's read and forget surface over the store (view, peek, forgotten, forget), so the switch can
|
|
182
|
+
* wire it where `new SignIns(...)` was, with the v2 answers unchanged. */
|
|
183
|
+
export declare function signInsOverStore(store: SignInsStore, sealKey: Buffer | undefined, vendors: SignInVendors): {
|
|
184
|
+
forget: (agentId: string, key: string) => Promise<{
|
|
185
|
+
key: string;
|
|
186
|
+
removed: Array<{
|
|
187
|
+
provider: Vendor;
|
|
188
|
+
at_vendor: "deleted" | "not_deleted";
|
|
189
|
+
message?: string;
|
|
190
|
+
}>;
|
|
191
|
+
}>;
|
|
192
|
+
peek: (agentId: string, resolution: string) => Promise<"unreadable" | {
|
|
193
|
+
ref: string;
|
|
194
|
+
} | undefined>;
|
|
195
|
+
forgotten: (agentId: string, resolution: string) => Promise<{
|
|
196
|
+
refs: string[];
|
|
197
|
+
unreadable: boolean;
|
|
198
|
+
}>;
|
|
199
|
+
view: (agentId: string) => Promise<SignInView[]>;
|
|
200
|
+
};
|