@parcha/agentrun-serve 0.1.0-beta.58 → 0.1.0-beta.60
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 +402 -1
- package/README.md +516 -190
- package/dist/acp-package.d.ts +5 -1
- package/dist/acp-package.js +19 -2
- package/dist/adapters.d.ts +23 -2
- package/dist/adapters.js +106 -33
- package/dist/agent-delete.d.ts +6 -9
- package/dist/agent-delete.js +5 -3
- package/dist/agent-package.js +11 -1
- package/dist/agents-store.js +1 -1
- package/dist/answer-text.d.ts +3 -0
- package/dist/answer-text.js +22 -0
- package/dist/api-only.d.ts +2 -2
- package/dist/api-only.js +3 -3
- package/dist/archil-routes.d.ts +4 -1
- package/dist/archil-routes.js +15 -12
- package/dist/archil-settings.d.ts +18 -8
- package/dist/archil-settings.js +35 -17
- package/dist/attach-conformance.js +5 -4
- package/dist/box-paths.d.ts +3 -2
- package/dist/box-paths.js +5 -4
- package/dist/browser-computer.d.ts +3 -8
- package/dist/browser-computer.js +12 -35
- package/dist/browser-cost.js +94 -20
- package/dist/capacity.d.ts +1 -1
- package/dist/capacity.js +3 -3
- package/dist/chatgpt-plan.d.ts +7 -0
- package/dist/chatgpt-plan.js +35 -11
- package/dist/claude-login-token.d.ts +20 -11
- package/dist/claude-login-token.js +175 -107
- package/dist/claude-login.d.ts +124 -33
- package/dist/claude-login.js +562 -85
- package/dist/claude-sign-in.d.ts +3 -0
- package/dist/claude-sign-in.js +10 -1
- package/dist/cli-learning/connections.js +1 -1
- package/dist/cli.js +323 -292
- package/dist/composio-made.d.ts +1 -6
- package/dist/composio-made.js +1 -6
- package/dist/composio-owners.d.ts +26 -0
- package/dist/composio-owners.js +36 -0
- package/dist/composio-preset.d.ts +56 -23
- package/dist/composio-preset.js +173 -77
- package/dist/composio-triggers.d.ts +4 -4
- package/dist/composio-triggers.js +6 -7
- package/dist/compute-cost.js +11 -2
- package/dist/computer-attach.d.ts +6 -3
- package/dist/computer-attach.js +41 -29
- package/dist/computer-held-routes.d.ts +1 -1
- package/dist/computer-held-routes.js +9 -4
- package/dist/computer-keys.d.ts +11 -1
- package/dist/computer-keys.js +26 -1
- package/dist/computer-record.js +3 -1
- package/dist/computer-view.d.ts +5 -3
- package/dist/computer-view.js +10 -6
- package/dist/computer-viewer.js +36 -7
- package/dist/computers.d.ts +2 -1
- package/dist/computers.js +6 -3
- package/dist/console/THIRD-PARTY-NOTICES.txt +50 -0
- package/dist/console/assets/backend-QnwGVBeU.js +166 -0
- package/dist/console/assets/index-DZi-muIj.js +629 -0
- package/dist/console/assets/share-pz61zIn9.js +6 -0
- package/dist/console/assets/styles-CcceGcu2.js +291 -0
- package/dist/console/assets/styles-fjQBFfMv.css +1 -0
- package/dist/console/index.html +4 -3
- package/dist/console/share.html +17 -0
- package/dist/decisions.d.ts +17 -7
- package/dist/decisions.js +41 -15
- package/dist/dial-relay.js +10 -4
- package/dist/docker-daemon.js +4 -5
- package/dist/docker-host-addresses.js +29 -11
- package/dist/email/account.d.ts +6 -0
- package/dist/email/account.js +6 -0
- package/dist/email/authentication.d.ts +21 -0
- package/dist/email/authentication.js +106 -0
- package/dist/email/email-faux.d.ts +11 -2
- package/dist/email/email-faux.js +21 -5
- package/dist/email/mail.d.ts +25 -0
- package/dist/email/mail.js +58 -2
- package/dist/email/names.js +2 -2
- package/dist/email/tools.d.ts +9 -4
- package/dist/email/tools.js +95 -13
- package/dist/env-switch.d.ts +12 -2
- package/dist/env-switch.js +23 -3
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +2 -0
- package/dist/factory-activity.d.ts +68 -0
- package/dist/factory-activity.js +153 -0
- package/dist/factory-runs.d.ts +11 -0
- package/dist/factory-runs.js +52 -0
- package/dist/fal-price.d.ts +11 -1
- package/dist/fal-price.js +33 -0
- package/dist/faux-computers.js +1 -1
- package/dist/filed-answer.d.ts +2 -2
- package/dist/filed-answer.js +2 -2
- package/dist/filed-tool.d.ts +32 -0
- package/dist/filed-tool.js +122 -0
- package/dist/graph-served.d.ts +10 -5
- package/dist/graph-served.js +40 -10
- package/dist/handed-values.js +1 -2
- package/dist/harness-check.d.ts +2 -1
- package/dist/harness-check.js +45 -12
- package/dist/harness-keys.d.ts +1 -2
- package/dist/harness-keys.js +10 -8
- package/dist/harness-opencode/facts.js +2 -0
- package/dist/harness-recipe-entry.d.ts +9 -3
- package/dist/harness-recipe-entry.js +18 -9
- package/dist/harness-recipe.d.ts +21 -0
- package/dist/harness-recipe.js +25 -3
- package/dist/harness-table.d.ts +12 -0
- package/dist/harness-table.js +21 -6
- package/dist/harness.js +6 -2
- package/dist/helper-env.d.ts +4 -1
- package/dist/helper-env.js +4 -1
- package/dist/host-check.d.ts +2 -3
- package/dist/host-check.js +13 -7
- package/dist/hosted-search.js +1 -1
- package/dist/import-worker.js +2 -2
- package/dist/import.d.ts +20 -8
- package/dist/import.js +448 -187
- package/dist/key-refusal.d.ts +14 -2
- package/dist/key-refusal.js +97 -33
- package/dist/learn/audit.d.ts +28 -27
- package/dist/learn/audit.js +87 -62
- package/dist/learn/check.js +1 -1
- package/dist/learn/commit.d.ts +35 -43
- package/dist/learn/commit.js +62 -270
- package/dist/learn/compile.d.ts +9 -6
- package/dist/learn/compile.js +51 -28
- package/dist/learn/corrections.js +1 -1
- package/dist/learn/delete.d.ts +5 -12
- package/dist/learn/delete.js +17 -30
- package/dist/learn/field-check.d.ts +111 -0
- package/dist/learn/field-check.js +174 -0
- package/dist/learn/forget-run.d.ts +16 -0
- package/dist/learn/forget-run.js +53 -0
- package/dist/learn/index.js +1 -1
- package/dist/learn/learning-of.d.ts +0 -4
- package/dist/learn/learning-of.js +0 -5
- package/dist/learn/ledger.d.ts +32 -29
- package/dist/learn/ledger.js +26 -19
- package/dist/learn/{folder.d.ts → legacy/folder.d.ts} +2 -1
- package/dist/learn/{folder.js → legacy/folder.js} +4 -7
- package/dist/learn/legacy/place.d.ts +16 -0
- package/dist/{workspace/learning-workspace.js → learn/legacy/place.js} +12 -42
- package/dist/learn/legacy/scrub.d.ts +28 -0
- package/dist/learn/legacy/scrub.js +258 -0
- package/dist/learn/promote.d.ts +119 -102
- package/dist/learn/promote.js +119 -262
- package/dist/learn/reset-ledger.d.ts +18 -0
- package/dist/learn/reset-ledger.js +14 -0
- package/dist/learn/rows.d.ts +186 -0
- package/dist/learn/rows.js +376 -0
- package/dist/learn/secrets.d.ts +4 -0
- package/dist/learn/secrets.js +12 -0
- package/dist/learn/workflow-draft.d.ts +4 -1
- package/dist/learn/workflow-draft.js +12 -2
- package/dist/learned-nodes.d.ts +8 -5
- package/dist/learned-nodes.js +8 -5
- package/dist/learned-workflow.d.ts +2 -1
- package/dist/learned-workflow.js +13 -10
- package/dist/learning-cost.d.ts +25 -8
- package/dist/learning-cost.js +23 -8
- package/dist/learning-reset.d.ts +1 -1
- package/dist/learning-reset.js +9 -11
- package/dist/learning-routes.d.ts +60 -81
- package/dist/learning-routes.js +187 -360
- package/dist/learning-setting.d.ts +6 -0
- package/dist/learning-setting.js +11 -1
- package/dist/learning-words.d.ts +2 -0
- package/dist/learning-words.js +2 -0
- package/dist/learning.d.ts +18 -24
- package/dist/learning.js +35 -66
- package/dist/listen-first.d.ts +5 -4
- package/dist/listen-first.js +4 -5
- package/dist/live-reach.d.ts +7 -0
- package/dist/live-reach.js +7 -0
- package/dist/mcp-api-only-origins.d.ts +15 -0
- package/dist/mcp-api-only-origins.js +40 -0
- package/dist/mcp-gateway.d.ts +22 -2
- package/dist/mcp-gateway.js +85 -11
- package/dist/mcp-oauth.d.ts +1 -1
- package/dist/mcp-oauth.js +3 -2
- package/dist/mcp-probe.d.ts +3 -0
- package/dist/mcp-probe.js +3 -0
- package/dist/mcp-resources.d.ts +1 -1
- package/dist/mcp-secret-writes.d.ts +24 -2
- package/dist/mcp-secret-writes.js +30 -2
- package/dist/mcp-servers-store.d.ts +52 -14
- package/dist/mcp-servers-store.js +165 -61
- package/dist/mcp-sources.d.ts +1 -2
- package/dist/mcp-sources.js +1 -2
- package/dist/mcp-store.d.ts +5 -5
- package/dist/mcp-store.js +3 -3
- package/dist/mcp.js +1 -1
- package/dist/model-gateway.d.ts +1 -1
- package/dist/model-gateway.js +20 -36
- package/dist/native/discovery.d.ts +6 -0
- package/dist/native/discovery.js +14 -1
- package/dist/native/remote.d.ts +5 -0
- package/dist/native/remote.js +16 -0
- package/dist/native/runtime.js +3 -2
- package/dist/observation/observer.d.ts +6 -6
- package/dist/ollama-provider.d.ts +23 -9
- package/dist/ollama-provider.js +49 -20
- package/dist/openapi.js +290 -79
- package/dist/otel/genai.d.ts +83 -7
- package/dist/otel/genai.js +69 -9
- package/dist/otel/tracer.d.ts +42 -13
- package/dist/otel/tracer.js +241 -56
- package/dist/page.d.ts +7 -1
- package/dist/page.js +76 -22
- package/dist/paid-calls.d.ts +6 -4
- package/dist/paid-calls.js +15 -7
- package/dist/place-offers.d.ts +58 -34
- package/dist/place-offers.js +96 -54
- package/dist/place.d.ts +41 -20
- package/dist/place.js +97 -47
- package/dist/print.js +1 -1
- package/dist/provider.d.ts +3 -2
- package/dist/provider.js +17 -8
- package/dist/purged-workflow.d.ts +0 -33
- package/dist/purged-workflow.js +3 -71
- package/dist/redact/match.d.ts +42 -9
- package/dist/redact/match.js +356 -54
- package/dist/run-census.d.ts +1 -1
- package/dist/run-census.js +4 -5
- package/dist/run-cut.js +4 -5
- package/dist/run-export-store.d.ts +15 -0
- package/dist/run-export-store.js +30 -0
- package/dist/run-export.d.ts +139 -0
- package/dist/run-export.js +379 -0
- package/dist/run-file-cut.d.ts +5 -0
- package/dist/run-file-cut.js +13 -0
- package/dist/run-launch.d.ts +3 -3
- package/dist/run-launch.js +16 -3
- package/dist/run-learning-served.d.ts +3 -3
- package/dist/run-learning-served.js +1 -1
- package/dist/run-listing.d.ts +1 -1
- package/dist/run-model-key.d.ts +15 -6
- package/dist/run-model-key.js +30 -31
- package/dist/run-reads-over-store.js +4 -4
- package/dist/run-secrets.js +3 -5
- package/dist/run-timeline-served.d.ts +1 -1
- package/dist/run-timeline-served.js +8 -5
- package/dist/runnable.js +26 -9
- package/dist/runner/adapter-loop.d.ts +35 -18
- package/dist/runner/adapter-loop.js +94 -47
- package/dist/runner/adapter-run-spec.d.ts +14 -1
- package/dist/runner/adapter-run-spec.js +73 -46
- package/dist/runner/adapters/pi.js +4 -2
- package/dist/runner/audit.d.ts +10 -9
- package/dist/runner/audit.js +64 -67
- package/dist/runner/beside.js +5 -6
- package/dist/runner/claim-secrets.d.ts +10 -3
- package/dist/runner/claim-secrets.js +29 -13
- package/dist/runner/cli-run-spec.d.ts +18 -0
- package/dist/runner/cli-run-spec.js +87 -58
- package/dist/runner/compare-end.d.ts +2 -3
- package/dist/runner/compare-end.js +30 -11
- package/dist/runner/conformance/harness.js +2 -3
- package/dist/runner/conformance/subject.d.ts +4 -1
- package/dist/runner/disk-free.d.ts +15 -4
- package/dist/runner/disk-free.js +25 -7
- package/dist/runner/feedback-round.d.ts +1 -1
- package/dist/runner/feedback-round.js +2 -2
- package/dist/runner/harness-loops.js +3 -4
- package/dist/runner/held.d.ts +5 -12
- package/dist/runner/held.js +0 -25
- package/dist/runner/journal-kinds.d.ts +8 -2
- package/dist/runner/journal-kinds.js +23 -5
- package/dist/runner/learned-first.d.ts +0 -2
- package/dist/runner/learned-first.js +23 -7
- package/dist/runner/learning-end.d.ts +14 -24
- package/dist/runner/learning-end.js +52 -94
- package/dist/runner/learning-seed.d.ts +13 -16
- package/dist/runner/learning-seed.js +13 -23
- package/dist/runner/live-ticker.js +7 -5
- package/dist/runner/loop-contract.d.ts +0 -2
- package/dist/runner/loop.d.ts +7 -0
- package/dist/runner/loop.js +1 -0
- package/dist/runner/main.js +13 -12
- package/dist/runner/mcp-claim.js +21 -5
- package/dist/runner/mcp-run.d.ts +4 -0
- package/dist/runner/mcp-run.js +2 -0
- package/dist/runner/meta-tools.js +3 -2
- package/dist/runner/metrics.d.ts +7 -0
- package/dist/runner/metrics.js +19 -0
- package/dist/runner/model-route.d.ts +10 -7
- package/dist/runner/model-route.js +79 -15
- package/dist/runner/native-loop.js +12 -11
- package/dist/runner/presence.d.ts +1 -4
- package/dist/runner/presence.js +6 -8
- package/dist/runner/promotion.d.ts +39 -36
- package/dist/runner/promotion.js +168 -112
- package/dist/runner/redact.d.ts +3 -1
- package/dist/runner/redact.js +5 -3
- package/dist/runner/reflect-hook.d.ts +2 -2
- package/dist/runner/reflect-hook.js +4 -1
- package/dist/runner/responses-fetch.d.ts +36 -0
- package/dist/runner/responses-fetch.js +511 -0
- package/dist/runner/run-child-host.d.ts +21 -14
- package/dist/runner/run-child-host.js +187 -141
- package/dist/runner/run-child.js +11 -4
- package/dist/runner/runner-check.js +5 -1
- package/dist/runner/runner.d.ts +3 -4
- package/dist/runner/runner.js +13 -9
- package/dist/runner/sdk-loop.js +10 -12
- package/dist/runner/spec-holds.d.ts +8 -1
- package/dist/runner/spec-holds.js +9 -4
- package/dist/runner/workflow-calls.d.ts +9 -0
- package/dist/runner/workflow-calls.js +150 -0
- package/dist/runner/workflow-first.d.ts +120 -32
- package/dist/runner/workflow-first.js +218 -94
- package/dist/runner/workflow-spec.js +1 -1
- package/dist/runs-over-store.js +8 -7
- package/dist/save-once.d.ts +14 -0
- package/dist/save-once.js +31 -0
- package/dist/scrub-command.d.ts +34 -31
- package/dist/scrub-command.js +116 -147
- package/dist/sdk/check.d.ts +1 -4
- package/dist/sdk/check.js +2 -3
- package/dist/sdk/runs.d.ts +26 -7
- package/dist/sdk/runs.js +194 -78
- package/dist/seal-key.js +4 -4
- package/dist/secret-cut.d.ts +3 -0
- package/dist/secret-cut.js +7 -1
- package/dist/secret-rules.d.ts +8 -1
- package/dist/secret-rules.js +482 -53
- package/dist/secrets.d.ts +55 -9
- package/dist/secrets.js +345 -21
- package/dist/server-fs.d.ts +1 -1
- package/dist/server-fs.js +1 -1
- package/dist/server-keys.d.ts +10 -3
- package/dist/server-keys.js +16 -3
- package/dist/server-secrets-store.js +2 -4
- package/dist/server.d.ts +30 -18
- package/dist/server.js +520 -238
- package/dist/share-context.d.ts +22 -0
- package/dist/share-context.js +76 -0
- package/dist/shell-lex.d.ts +105 -0
- package/dist/shell-lex.js +646 -0
- package/dist/sign-ins-store.d.ts +5 -7
- package/dist/sign-ins-store.js +12 -16
- package/dist/sign-ins.d.ts +7 -11
- package/dist/sign-ins.js +40 -41
- package/dist/skills/agentrun-serve/SKILL.md +5 -2
- package/dist/source-sync/auxiliary.js +2 -2
- package/dist/start-switches.d.ts +6 -5
- package/dist/start-switches.js +8 -4
- package/dist/stats.d.ts +5 -1
- package/dist/stats.js +1 -1
- package/dist/store/agent-body.js +2 -2
- package/dist/store/dialect.d.ts +4 -0
- package/dist/store/dialect.js +1 -0
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +1 -1
- package/dist/store/mcp-record-keys.d.ts +10 -0
- package/dist/store/mcp-record-keys.js +13 -0
- package/dist/store/postgres/dialect.js +2 -0
- package/dist/store/postgres/migrations/0029_run_launch_census_settle.sql +28 -0
- package/dist/store/postgres/migrations/0030_learning_ledger_epoch.sql +40 -0
- package/dist/store/postgres/migrations/0031_learning_ledger_calls.sql +12 -0
- package/dist/store/postgres/migrations/0032_learning_rows.sql +65 -0
- package/dist/store/postgres/store.js +4 -0
- package/dist/store/schema.d.ts +60 -11
- package/dist/store/schema.js +147 -17
- package/dist/store/seal.d.ts +4 -1
- package/dist/store/sqlite/learning-rows.d.ts +23 -0
- package/dist/store/sqlite/learning-rows.js +559 -0
- package/dist/store/sqlite/run-launch.d.ts +3 -10
- package/dist/store/sqlite/run-launch.js +12 -23
- package/dist/store/sqlite/run-patch.d.ts +17 -10
- package/dist/store/sqlite/run-patch.js +50 -13
- package/dist/store/sqlite/store.d.ts +9 -0
- package/dist/store/sqlite/store.js +194 -46
- package/dist/store/store-schema.js +3 -4
- package/dist/store/store.d.ts +286 -38
- package/dist/store/store.js +27 -11
- package/dist/store-reads/analytics.d.ts +2 -1
- package/dist/store-reads/analytics.js +7 -5
- package/dist/store-reads/journal.d.ts +33 -3
- package/dist/store-reads/journal.js +99 -4
- package/dist/store-reads/learning.d.ts +50 -45
- package/dist/store-reads/learning.js +153 -116
- package/dist/store-reads/loop.js +1 -1
- package/dist/store-reads/stats.d.ts +2 -2
- package/dist/store-reads/stats.js +13 -7
- package/dist/store-view.d.ts +24 -2
- package/dist/store-view.js +49 -17
- package/dist/suggestions.d.ts +1 -1
- package/dist/suggestions.js +29 -13
- package/dist/template-eval.d.ts +72 -9
- package/dist/template-eval.js +358 -64
- package/dist/templates.d.ts +10 -2
- package/dist/templates.js +31 -4
- package/dist/timeline/labels.d.ts +1 -1
- package/dist/timeline/labels.js +4 -3
- package/dist/timeline/timeline.d.ts +23 -11
- package/dist/timeline/timeline.js +115 -31
- package/dist/timeline/web-calls.d.ts +8 -6
- package/dist/timeline/web-calls.js +10 -6
- package/dist/tool-gate.d.ts +13 -1
- package/dist/tool-gate.js +43 -3
- package/dist/tool-keys-store.js +2 -4
- package/dist/tool-keys.d.ts +11 -0
- package/dist/tool-keys.js +16 -0
- package/dist/tool-plane.d.ts +54 -13
- package/dist/tool-plane.js +103 -32
- package/dist/tools.d.ts +5 -1
- package/dist/tools.js +7 -7
- package/dist/trigger-email.js +12 -6
- package/dist/triggers.d.ts +15 -34
- package/dist/triggers.js +119 -126
- package/dist/validate.d.ts +8 -1
- package/dist/validate.js +163 -23
- package/dist/web-fake.d.ts +2 -1
- package/dist/web-fake.js +8 -6
- package/dist/web-fetch.d.ts +8 -6
- package/dist/web-fetch.js +13 -11
- package/dist/web-holds.d.ts +34 -0
- package/dist/web-holds.js +89 -0
- package/dist/web-run.d.ts +32 -5
- package/dist/web-run.js +76 -28
- package/dist/web-save.js +23 -12
- package/dist/web-search.js +14 -25
- package/dist/wires.d.ts +4 -3
- package/dist/wires.js +5 -4
- package/dist/workspace/archil-claim.d.ts +12 -5
- package/dist/workspace/archil-claim.js +45 -5
- package/dist/workspace/archil-exec.js +1 -1
- package/dist/workspace/archil.d.ts +1 -1
- package/dist/workspace/archil.js +1 -1
- package/dist/workspace/attach.js +52 -19
- package/dist/workspace/attached-computers.d.ts +6 -2
- package/dist/workspace/attached-computers.js +5 -4
- package/dist/workspace/computer-deps.d.ts +23 -6
- package/dist/workspace/computer-deps.js +38 -18
- package/dist/workspace/computer-for-claim.d.ts +21 -4
- package/dist/workspace/computer-for-claim.js +160 -54
- package/dist/workspace/computer-intervals.d.ts +2 -0
- package/dist/workspace/computer-intervals.js +1 -1
- package/dist/workspace/computer-janitor.d.ts +48 -14
- package/dist/workspace/computer-janitor.js +153 -44
- package/dist/workspace/computer-kept.d.ts +158 -32
- package/dist/workspace/computer-kept.js +288 -63
- package/dist/workspace/computer-providers.d.ts +19 -4
- package/dist/workspace/computer-providers.js +40 -6
- package/dist/workspace/index.d.ts +2 -3
- package/dist/workspace/index.js +2 -3
- package/dist/workspace/local.js +41 -1
- package/dist/workspace/mount-revoke-left.d.ts +31 -0
- package/dist/workspace/mount-revoke-left.js +72 -0
- package/dist/workspace/paired-route.js +4 -5
- package/dist/workspace/paths.d.ts +0 -4
- package/dist/workspace/paths.js +0 -6
- package/dist/workspace/resolve-computer.d.ts +5 -2
- package/dist/workspace/resolve-computer.js +9 -3
- package/dist/workspace/run-end-computers.d.ts +11 -5
- package/dist/workspace/run-end-computers.js +153 -28
- package/dist/workspace/run-tools.d.ts +22 -3
- package/dist/workspace/run-tools.js +17 -5
- package/dist/workspace/run-workspace.d.ts +14 -1
- package/dist/workspace/run-workspace.js +34 -1
- package/dist/workspace/workspace.d.ts +7 -1
- package/dist/workspace/workspace.js +1 -1
- package/package.json +13 -14
- package/skills/agentrun-serve/SKILL.md +5 -2
- package/templates/README.md +22 -6
- package/templates/TOOLS.md +46 -0
- package/dist/console/assets/backend-CSAWUqtZ.js +0 -166
- package/dist/console/assets/index-Bwn1oTem.css +0 -1
- package/dist/console/assets/index-DPh29cyz.js +0 -747
- package/dist/workspace/learning-workspace.d.ts +0 -24
- /package/dist/learn/{learning.sh → legacy/learning.sh} +0 -0
package/dist/fal-price.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PublicFetchOptions } from "@parcha/pi-browser";
|
|
2
|
-
import type { McpKeys, McpMeter } from "./mcp-gateway.js";
|
|
2
|
+
import type { McpKeys, McpMeter, McpResults } from "./mcp-gateway.js";
|
|
3
3
|
import { type SaveSlots } from "./web-save.js";
|
|
4
4
|
/** The host of fal's hosted MCP server (its key endpoint /mcp and its sign-in endpoint /mcp-relay). */
|
|
5
5
|
export declare const FAL_MCP_HOST = "mcp.fal.ai";
|
|
@@ -94,6 +94,16 @@ export declare const publicMedia: (guard: () => Promise<Omit<PublicFetchOptions,
|
|
|
94
94
|
* (over KEY_ROOM) is refused unsent, in words. `back` reads each scoped key in a reply as the agent's by taking the
|
|
95
95
|
* suffix off. */
|
|
96
96
|
export declare function falKeys(run: string): McpKeys;
|
|
97
|
+
/** Where a fal job's result is filed in the run's files: evidence/fal/<request_id>.json. */
|
|
98
|
+
export declare const FAL_RESULTS_DIR = "evidence/fal";
|
|
99
|
+
/** fal's request ids: UUIDs. Only one names a file: anything else (a path, a dot name, a name past a filename's
|
|
100
|
+
* limit, a plain name fal never gives) is never filed. */
|
|
101
|
+
export declare const FAL_REQUEST_ID: RegExp;
|
|
102
|
+
/** The completed jobs of fal's answer to `tool`, each by its request_id with its `result` as fal answered it: the answer
|
|
103
|
+
* itself (run_model), and each entry of a list in it (submit_jobs', wait_for_jobs' `jobs`). A job is completed when
|
|
104
|
+
* fal says so (`status` "completed") and it carries a `result`. One whose request_id is not a UUID is left out, and a
|
|
105
|
+
* request_id twice in one answer is filed from its first entry. */
|
|
106
|
+
export declare const falResults: McpResults;
|
|
97
107
|
/** A fal server's meter: fal's unit prices read through the gateway's `ask`, kept per endpoint for PRICE_TTL_MS.
|
|
98
108
|
* `media` reads an input media file (none: such a job is unpriceable); `now`, the clock. */
|
|
99
109
|
export declare function falMeter({ media, now }?: {
|
package/dist/fal-price.js
CHANGED
|
@@ -510,6 +510,38 @@ export function falKeys(run) {
|
|
|
510
510
|
back: (text) => (text.includes(mark) ? text.replace(suffix, "") : text),
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
+
/** Where a fal job's result is filed in the run's files: evidence/fal/<request_id>.json. */
|
|
514
|
+
export const FAL_RESULTS_DIR = "evidence/fal";
|
|
515
|
+
/** fal's request ids: UUIDs. Only one names a file: anything else (a path, a dot name, a name past a filename's
|
|
516
|
+
* limit, a plain name fal never gives) is never filed. */
|
|
517
|
+
export const FAL_REQUEST_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
518
|
+
/** fal's tools whose answers carry completed jobs: run_model's one, submit_jobs' and wait_for_jobs' each. */
|
|
519
|
+
const WITH_RESULTS = new Set(["run_model", "submit_jobs", "wait_for_jobs"]);
|
|
520
|
+
/** The completed jobs of fal's answer to `tool`, each by its request_id with its `result` as fal answered it: the answer
|
|
521
|
+
* itself (run_model), and each entry of a list in it (submit_jobs', wait_for_jobs' `jobs`). A job is completed when
|
|
522
|
+
* fal says so (`status` "completed") and it carries a `result`. One whose request_id is not a UUID is left out, and a
|
|
523
|
+
* request_id twice in one answer is filed from its first entry. */
|
|
524
|
+
export const falResults = {
|
|
525
|
+
dir: FAL_RESULTS_DIR,
|
|
526
|
+
of(tool, reply) {
|
|
527
|
+
if (!WITH_RESULTS.has(tool))
|
|
528
|
+
return [];
|
|
529
|
+
const body = bodyOf(reply);
|
|
530
|
+
if (!isObject(body))
|
|
531
|
+
return [];
|
|
532
|
+
const entries = [body, ...Object.values(body).flatMap((value) => (Array.isArray(value) ? value : []))];
|
|
533
|
+
const seen = new Set();
|
|
534
|
+
return entries.flatMap((entry) => {
|
|
535
|
+
if (!isObject(entry) || entry.status !== "completed" || !Object.hasOwn(entry, "result"))
|
|
536
|
+
return [];
|
|
537
|
+
const id = entry.request_id;
|
|
538
|
+
if (typeof id !== "string" || !FAL_REQUEST_ID.test(id) || seen.has(id))
|
|
539
|
+
return [];
|
|
540
|
+
seen.add(id);
|
|
541
|
+
return [{ name: id, value: entry.result }];
|
|
542
|
+
});
|
|
543
|
+
},
|
|
544
|
+
};
|
|
513
545
|
/** A fal server's meter: fal's unit prices read through the gateway's `ask`, kept per endpoint for PRICE_TTL_MS.
|
|
514
546
|
* `media` reads an input media file (none: such a job is unpriceable); `now`, the clock. */
|
|
515
547
|
export function falMeter({ media, now = Date.now } = {}) {
|
|
@@ -624,6 +656,7 @@ export function falMeter({ media, now = Date.now } = {}) {
|
|
|
624
656
|
};
|
|
625
657
|
return {
|
|
626
658
|
bills: falBills,
|
|
659
|
+
results: falResults,
|
|
627
660
|
async quote(tool, args, ask, signal) {
|
|
628
661
|
const quotes = [];
|
|
629
662
|
// One at a time: each endpoint's price is read once, the next job's from what the last one kept.
|
package/dist/faux-computers.js
CHANGED
|
@@ -143,7 +143,7 @@ export function fauxComputers() {
|
|
|
143
143
|
async function fauxDial(dial, run) {
|
|
144
144
|
// The computer package's words for a dial provider with no dial (hosted/provider.ts #dialed).
|
|
145
145
|
if (dial === undefined)
|
|
146
|
-
throw new Error("Faux dial machines dial in to this server, and this runner runs in a process of its own
|
|
146
|
+
throw new Error("Faux dial machines dial in to this server, and this runner runs in a process of its own and relays no machine's socket: give the runner AGENTRUN_PUBLIC_URL (this server's public address), or start the image with the server options alone, without server-and-runner (outside the image: agentrun-serve without --no-runner)");
|
|
147
147
|
if (!dial.url)
|
|
148
148
|
throw new Error("Faux dial machines dial in to this server, which has no public address: set AGENTRUN_PUBLIC_URL");
|
|
149
149
|
const name = `faux-dial-${randomBytes(6).toString("hex")}`;
|
package/dist/filed-answer.d.ts
CHANGED
|
@@ -24,8 +24,8 @@ export declare function laidOut(text: string): string | undefined;
|
|
|
24
24
|
/** The model's text for `text`, longer than `clip` characters: the filed text's first lines, whole, within `clip`, then
|
|
25
25
|
* a note naming the file (`<folder>/<stem>.txt`, or `.json` for JSON) and the read offset that goes on. A file that
|
|
26
26
|
* cannot be written still answers its start, saying why in the Workspace's words (never an error's message, which
|
|
27
|
-
* names paths). `clip` is at least FILED_LINE_MAX, so the start holds at least one line. */
|
|
28
|
-
export declare function filedAnswer(work: Workspace | (() => Workspace), folder: string, stem: string, text: string, clip: number): Promise<string>;
|
|
27
|
+
* names paths), a Workspace that cannot be opened (`work` a thunk that rejects) too. `clip` is at least FILED_LINE_MAX, so the start holds at least one line. */
|
|
28
|
+
export declare function filedAnswer(work: Workspace | (() => Workspace | Promise<Workspace>), folder: string, stem: string, text: string, clip: number): Promise<string>;
|
|
29
29
|
/** For a unified diff (`diff --git a/... b/...` lines), where each file not wholly shown starts in the filed text and
|
|
30
30
|
* how many lines it runs, so a reader takes the files it needs by range (and passes a generated one by) rather than
|
|
31
31
|
* paging through all of it: "; files past the cut, from the line each starts at (its lines): a.ts 908 (120), ...". */
|
package/dist/filed-answer.js
CHANGED
|
@@ -100,7 +100,7 @@ export function laidOut(text) {
|
|
|
100
100
|
/** The model's text for `text`, longer than `clip` characters: the filed text's first lines, whole, within `clip`, then
|
|
101
101
|
* a note naming the file (`<folder>/<stem>.txt`, or `.json` for JSON) and the read offset that goes on. A file that
|
|
102
102
|
* cannot be written still answers its start, saying why in the Workspace's words (never an error's message, which
|
|
103
|
-
* names paths). `clip` is at least FILED_LINE_MAX, so the start holds at least one line. */
|
|
103
|
+
* names paths), a Workspace that cannot be opened (`work` a thunk that rejects) too. `clip` is at least FILED_LINE_MAX, so the start holds at least one line. */
|
|
104
104
|
export async function filedAnswer(work, folder, stem, text, clip) {
|
|
105
105
|
const filed = fileable(text);
|
|
106
106
|
const lines = filed.text.split("\n");
|
|
@@ -120,7 +120,7 @@ export async function filedAnswer(work, folder, stem, text, clip) {
|
|
|
120
120
|
const cut = `\n[cut at line ${shown} of ${total} (${head.length} of ${filed.text.length} characters${how.length ? `; ${how.join("; ")}` : ""}); `;
|
|
121
121
|
const path = `${folder}/${stem}.${filed.json ? "json" : "txt"}`;
|
|
122
122
|
try {
|
|
123
|
-
await (typeof work === "function" ? work() : work).write(path, filed.text);
|
|
123
|
+
await (await (typeof work === "function" ? work() : work)).write(path, filed.text);
|
|
124
124
|
}
|
|
125
125
|
catch (error) {
|
|
126
126
|
return `${head}${cut}the whole answer could not be saved (${workspaceErrorWords(error) ?? error?.code ?? "write failed"})]`;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { InputIssue } from "./errors.js";
|
|
2
|
+
/** A tool's file setting: the folder of the run's files its answers are filed in, and the paths of each answer the
|
|
3
|
+
* tool's result shows. */
|
|
4
|
+
export type FileSetting = {
|
|
5
|
+
folder: string;
|
|
6
|
+
show: string[];
|
|
7
|
+
};
|
|
8
|
+
/** The most show paths, and the most segments of one. */
|
|
9
|
+
export declare const MAX_SHOW_PATHS = 8;
|
|
10
|
+
export declare const MAX_SHOW_SEGMENTS = 6;
|
|
11
|
+
/** The longest shown string, in characters. */
|
|
12
|
+
export declare const SHOWN_CHARS = 200;
|
|
13
|
+
/** The issues of `given` as a file setting, its fields under `at`: none when it is one. */
|
|
14
|
+
export declare function fileIssues(given: unknown, at: string): InputIssue[];
|
|
15
|
+
/** A stored file setting that does not read (a rule tightened since it was written, a runner older than the server that
|
|
16
|
+
* wrote it): every call of its tool is refused, never answered unfiled (mcp-gateway.ts unsendable). */
|
|
17
|
+
export declare const UNREADABLE = "unreadable";
|
|
18
|
+
/** The file setting of `server`'s `tool` in an agent's tool settings as its revision keeps them (body.toolSettings):
|
|
19
|
+
* undefined when it has none (the tool answers the model as it always has), UNREADABLE when it has one that does not
|
|
20
|
+
* read. */
|
|
21
|
+
export declare function filedBy(toolSettings: unknown): (server: string, tool: string) => FileSetting | typeof UNREADABLE | undefined;
|
|
22
|
+
/** The value at `path` in `value`, as the model reads it: a scalar (a string cut at SHOWN_CHARS, … marking the cut),
|
|
23
|
+
* else null (absent, or an object or array). */
|
|
24
|
+
export declare function shownAt(value: unknown, path: string): string | number | boolean | null;
|
|
25
|
+
/** `value`'s shape: types, each array's length and what it holds, an object's keys that are short names while `depth`
|
|
26
|
+
* is under 2 (the rest counted); never a value. */
|
|
27
|
+
export declare function shapeOf(value: unknown, depth?: number): string;
|
|
28
|
+
/** The tool's result for an answer filed at `path` (in the run's files): its bytes, where it is, the values `show`
|
|
29
|
+
* names, and its shape. */
|
|
30
|
+
export declare function filedSummary(tool: string, text: string, path: string, show: readonly string[]): string;
|
|
31
|
+
/** The model's text when an answer could not be filed: none of it, the Workspace's words why. */
|
|
32
|
+
export declare const unfiledSummary: (tool: string, text: string, folder: string, why: string) => string;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/** The most show paths, and the most segments of one. */
|
|
2
|
+
export const MAX_SHOW_PATHS = 8;
|
|
3
|
+
export const MAX_SHOW_SEGMENTS = 6;
|
|
4
|
+
/** The longest shown string, in characters. */
|
|
5
|
+
export const SHOWN_CHARS = 200;
|
|
6
|
+
/** A folder segment: no dot first (no `..`, no hidden folder), nothing that names another place. */
|
|
7
|
+
const FOLDER_SEGMENT = /^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$/;
|
|
8
|
+
/** A show path's segment: a key's name, an array's index, or -1 (its last item). */
|
|
9
|
+
const SHOW_SEGMENT = /^(?:[A-Za-z_$][A-Za-z0-9_$-]{0,63}|0|[1-9][0-9]{0,8}|-1)$/;
|
|
10
|
+
const FOLDER_WORDS = "1 to 3 segments joined by /, each letters, digits, _, - or . and never starting with a dot (no .., no hidden folder)";
|
|
11
|
+
const PATH_WORDS = `a path of 1 to ${MAX_SHOW_SEGMENTS} segments joined by ., each a key (a letter, _ or $ first), an index (0, 1, ...) or -1 (the last item)`;
|
|
12
|
+
const isPlain = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13
|
+
/** The issues of `given` as a file setting, its fields under `at`: none when it is one. */
|
|
14
|
+
export function fileIssues(given, at) {
|
|
15
|
+
if (!isPlain(given) || Object.keys(given).some((key) => key !== "folder" && key !== "show") || given.folder === undefined || given.show === undefined) {
|
|
16
|
+
return [{ field: at, reason: "wrong_type", message: `${at} is {folder, show}: the folder of the run's files each answer of the tool is filed in, whole, and the paths of it the tool's result shows (at most ${MAX_SHOW_PATHS}); the result shows no other value of it` }];
|
|
17
|
+
}
|
|
18
|
+
const issues = [];
|
|
19
|
+
const folder = given.folder;
|
|
20
|
+
const segments = typeof folder === "string" ? folder.split("/") : [];
|
|
21
|
+
if (!(segments.length >= 1 && segments.length <= 3 && segments.every((segment) => FOLDER_SEGMENT.test(segment))))
|
|
22
|
+
issues.push({ field: `${at}.folder`, reason: "not_an_option", message: `${at}.folder is a folder in the run's files: ${FOLDER_WORDS}` });
|
|
23
|
+
const show = given.show;
|
|
24
|
+
if (!Array.isArray(show) || show.length > MAX_SHOW_PATHS) {
|
|
25
|
+
issues.push({ field: `${at}.show`, reason: "not_an_option", message: `${at}.show is a list of at most ${MAX_SHOW_PATHS} paths, each ${PATH_WORDS}` });
|
|
26
|
+
return issues;
|
|
27
|
+
}
|
|
28
|
+
show.forEach((path, i) => {
|
|
29
|
+
const parts = typeof path === "string" ? path.split(".") : [];
|
|
30
|
+
if (!(parts.length >= 1 && parts.length <= MAX_SHOW_SEGMENTS && parts.every((part) => SHOW_SEGMENT.test(part))))
|
|
31
|
+
issues.push({ field: `${at}.show[${i}]`, reason: "not_an_option", message: `${at}.show[${i}] ${JSON.stringify(path)} is ${PATH_WORDS}` });
|
|
32
|
+
});
|
|
33
|
+
const twice = show.find((path, i) => show.indexOf(path) !== i);
|
|
34
|
+
if (twice !== undefined)
|
|
35
|
+
issues.push({ field: `${at}.show`, reason: "not_an_option", message: `${at}.show names ${String(twice)} twice` });
|
|
36
|
+
return issues;
|
|
37
|
+
}
|
|
38
|
+
/** A stored file setting that does not read (a rule tightened since it was written, a runner older than the server that
|
|
39
|
+
* wrote it): every call of its tool is refused, never answered unfiled (mcp-gateway.ts unsendable). */
|
|
40
|
+
export const UNREADABLE = "unreadable";
|
|
41
|
+
/** The file setting of `server`'s `tool` in an agent's tool settings as its revision keeps them (body.toolSettings):
|
|
42
|
+
* undefined when it has none (the tool answers the model as it always has), UNREADABLE when it has one that does not
|
|
43
|
+
* read. */
|
|
44
|
+
export function filedBy(toolSettings) {
|
|
45
|
+
return (server, tool) => {
|
|
46
|
+
const key = `mcp:${server}/${tool}`;
|
|
47
|
+
const setting = isPlain(toolSettings) && Object.hasOwn(toolSettings, key) ? toolSettings[key] : undefined;
|
|
48
|
+
const file = isPlain(setting) ? setting.file : undefined;
|
|
49
|
+
if (file === undefined)
|
|
50
|
+
return undefined;
|
|
51
|
+
if (fileIssues(file, "file").length)
|
|
52
|
+
return UNREADABLE;
|
|
53
|
+
const { folder, show } = file;
|
|
54
|
+
return { folder, show: [...show] };
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** The value at `path` in `value`, as the model reads it: a scalar (a string cut at SHOWN_CHARS, … marking the cut),
|
|
58
|
+
* else null (absent, or an object or array). */
|
|
59
|
+
export function shownAt(value, path) {
|
|
60
|
+
let at = value;
|
|
61
|
+
for (const part of path.split(".")) {
|
|
62
|
+
if (Array.isArray(at))
|
|
63
|
+
at = part === "-1" ? at[at.length - 1] : /^\d+$/.test(part) ? at[Number(part)] : undefined;
|
|
64
|
+
else if (isPlain(at))
|
|
65
|
+
at = Object.hasOwn(at, part) ? at[part] : undefined;
|
|
66
|
+
else
|
|
67
|
+
at = undefined;
|
|
68
|
+
}
|
|
69
|
+
if (typeof at === "string") {
|
|
70
|
+
const chars = Array.from(at);
|
|
71
|
+
return chars.length > SHOWN_CHARS ? `${chars.slice(0, SHOWN_CHARS).join("")}…` : at;
|
|
72
|
+
}
|
|
73
|
+
return typeof at === "number" || typeof at === "boolean" ? at : null;
|
|
74
|
+
}
|
|
75
|
+
/** The most keys of one object the shape names, and the longest shape. */
|
|
76
|
+
const SHAPE_KEYS = 40;
|
|
77
|
+
const SHAPE_CHARS = 2_000;
|
|
78
|
+
/** A key the shape names: a short name. Any other key (an email, a person's name, an id) can be data, so it is counted,
|
|
79
|
+
* never named. */
|
|
80
|
+
const SHAPE_KEY = /^[A-Za-z_][A-Za-z0-9_]{0,31}$/;
|
|
81
|
+
/** `value`'s shape: types, each array's length and what it holds, an object's keys that are short names while `depth`
|
|
82
|
+
* is under 2 (the rest counted); never a value. */
|
|
83
|
+
export function shapeOf(value, depth = 0) {
|
|
84
|
+
if (value === null)
|
|
85
|
+
return "null";
|
|
86
|
+
if (Array.isArray(value)) {
|
|
87
|
+
const kinds = new Set(value.map((item) => (item === null ? "null" : Array.isArray(item) ? "array" : typeof item)));
|
|
88
|
+
const kind = kinds.size === 1 ? [...kinds][0] : "item";
|
|
89
|
+
return `[${value.length} ${kind}${value.length === 1 ? "" : "s"}]`;
|
|
90
|
+
}
|
|
91
|
+
if (isPlain(value)) {
|
|
92
|
+
if (depth >= 2)
|
|
93
|
+
return "object";
|
|
94
|
+
const keys = Object.keys(value);
|
|
95
|
+
const named = keys.filter((key) => SHAPE_KEY.test(key)).slice(0, SHAPE_KEYS).map((key) => `${JSON.stringify(key)}: ${shapeOf(value[key], depth + 1)}`);
|
|
96
|
+
const rest = keys.length - named.length;
|
|
97
|
+
const counted = rest ? `… ${rest} ${named.length ? "more " : ""}key${rest === 1 ? "" : "s"}` : "";
|
|
98
|
+
return `{${[...named, ...(counted ? [counted] : [])].join(", ")}}`;
|
|
99
|
+
}
|
|
100
|
+
return typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? typeof value : "unknown";
|
|
101
|
+
}
|
|
102
|
+
/** The tool's result for an answer filed at `path` (in the run's files): its bytes, where it is, the values `show`
|
|
103
|
+
* names, and its shape. */
|
|
104
|
+
export function filedSummary(tool, text, path, show) {
|
|
105
|
+
let value;
|
|
106
|
+
let json = true;
|
|
107
|
+
try {
|
|
108
|
+
value = JSON.parse(text);
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
json = false;
|
|
112
|
+
}
|
|
113
|
+
const shown = `{${show.map((one) => `${JSON.stringify(one)}: ${JSON.stringify(json ? shownAt(value, one) : null)}`).join(", ")}}`;
|
|
114
|
+
const shape = json ? shapeOf(value) : "text, not JSON";
|
|
115
|
+
return [
|
|
116
|
+
`${tool} answered ${Buffer.byteLength(text, "utf8").toLocaleString("en-US")} bytes, filed whole at ${path} for the skill's code; its values are not shown here (the agent's setting files this tool's answers); only these are:`,
|
|
117
|
+
shown,
|
|
118
|
+
`Shape: ${shape.length > SHAPE_CHARS ? `${shape.slice(0, SHAPE_CHARS)}…` : shape}`,
|
|
119
|
+
].join("\n");
|
|
120
|
+
}
|
|
121
|
+
/** The model's text when an answer could not be filed: none of it, the Workspace's words why. */
|
|
122
|
+
export const unfiledSummary = (tool, text, folder, why) => `${tool} answered ${Buffer.byteLength(text, "utf8").toLocaleString("en-US")} bytes, which could not be filed in ${folder}/ (${why}). The agent's setting files this tool's answers, so none of it is shown here.`;
|
package/dist/graph-served.d.ts
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
export declare const LABEL_SHOWN = 200;
|
|
3
3
|
export declare const ERROR_SHOWN = 2000;
|
|
4
4
|
export type PartKind = "nodes" | "decision" | "effect";
|
|
5
|
-
/** `value`, a part of a graph view of `kind`, as the graph serves it with `values` held:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
/** `value`, a part of a graph view of `kind`, as the graph serves it with `values` held: read whole first, so a held
|
|
6
|
+
* value split across two of its fields withholds the part as "[redacted]", then each string and number by
|
|
7
|
+
* redactedOutput (redactedOutputWhole); then a map item's label cut at LABEL_SHOWN and an error at ERROR_SHOWN. A text
|
|
8
|
+
* stored cut (a decision's state past 64 KB, an error marked cut, or one of exactly ERROR_CUT_BEFORE characters from
|
|
9
|
+
* before) has its last 6 times the longest held value plus 16 characters held back, where a value the stored cut split
|
|
10
|
+
* would sit. */
|
|
9
11
|
export declare function servedPart(kind: PartKind, value: unknown, values: readonly string[]): unknown;
|
|
10
12
|
/** How many walks servedGraphView made, by what it walked: a part (servedPart over the nodes, a decision or a call) or a
|
|
11
13
|
* field of the rest (redactedOutput over one top-level field). Counted for the tests, which read that a read again walks
|
|
@@ -18,7 +20,10 @@ export declare const graphWalks: {
|
|
|
18
20
|
* over the same values), the parts by the file path's rule on top:
|
|
19
21
|
* - its nodes, each decision and each call through servedPart (a map item's label and an error cut short after);
|
|
20
22
|
* - every other top-level field (its run, its workflow, its structure `graph`, which echoes the workflow's nodes and their
|
|
21
|
-
* words, its totals, and any field added later) through
|
|
23
|
+
* words, its totals, and any field added later) through redactedOutputWhole, each by itself, its keys included: a
|
|
24
|
+
* field whose JSON holds a held value split across two of its strings is "[redacted]", but for `graph` and `run`,
|
|
25
|
+
* each served in its own shape (IN_SHAPE), so every reader that draws the run still reads a graph's nodes and edges
|
|
26
|
+
* and the run's status;
|
|
22
27
|
* - `read_at`, which moves with every read: the server's clock as toISOString writes it, served as it is, never kept;
|
|
23
28
|
* anything else under the name is cut each read.
|
|
24
29
|
* Each part and each field, its name and its value, scalar or not, is cut once per content and held set and kept in
|
package/dist/graph-served.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
// What GET /runs/{id}/graph serves of each part of a run's graph (servedGraphView, below): redacted by a run's answer's rule
|
|
2
|
-
// (key-refusal.ts
|
|
3
|
-
// makes the view whole, so a key saved after it was made, or kept for a busy store's read, is still found.
|
|
2
|
+
// (key-refusal.ts redactedOutputWhole, over the values the server holds and handed the run), and only then cut.
|
|
3
|
+
// graph-view.ts makes the view whole, so a key saved after it was made, or kept for a busy store's read, is still found.
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
|
-
import { redactedOutput } from "./key-refusal.js";
|
|
5
|
+
import { redactedOutput, redactedOutputWhole } from "./key-refusal.js";
|
|
6
6
|
/** The most of a map item's label and of an error (a call's, a decision's) the graph shows. */
|
|
7
7
|
export const LABEL_SHOWN = 200;
|
|
8
8
|
export const ERROR_SHOWN = 2000;
|
|
9
9
|
/** Where an error was cut when it was stored, before errors were stored whole: one this long may have been cut there. */
|
|
10
10
|
const ERROR_CUT_BEFORE = 2000;
|
|
11
11
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12
|
-
/** `value`, a part of a graph view of `kind`, as the graph serves it with `values` held:
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
/** `value`, a part of a graph view of `kind`, as the graph serves it with `values` held: read whole first, so a held
|
|
13
|
+
* value split across two of its fields withholds the part as "[redacted]", then each string and number by
|
|
14
|
+
* redactedOutput (redactedOutputWhole); then a map item's label cut at LABEL_SHOWN and an error at ERROR_SHOWN. A text
|
|
15
|
+
* stored cut (a decision's state past 64 KB, an error marked cut, or one of exactly ERROR_CUT_BEFORE characters from
|
|
16
|
+
* before) has its last 6 times the longest held value plus 16 characters held back, where a value the stored cut split
|
|
17
|
+
* would sit. */
|
|
16
18
|
export function servedPart(kind, value, values) {
|
|
17
|
-
const shown =
|
|
19
|
+
const shown = redactedOutputWhole(value, values);
|
|
18
20
|
if (!isRecord(shown))
|
|
19
21
|
return shown;
|
|
20
22
|
const hold = 6 * values.reduce((most, held) => Math.max(most, held.length), 0) + 16;
|
|
@@ -38,13 +40,35 @@ export function servedPart(kind, value, values) {
|
|
|
38
40
|
* nothing, with no clock. */
|
|
39
41
|
export const graphWalks = { part: 0, rest: 0 };
|
|
40
42
|
const isRecordOrArray = (value) => typeof value === "object" && value !== null;
|
|
43
|
+
/** The graph's structure (`graph`) when its JSON holds a held value split across two of its strings (a question's
|
|
44
|
+
* instructions ending with the value's head and its first option starting with the rest): the shape the contract gives
|
|
45
|
+
* the field, no nodes and no edges, and `withheld`, so a reader draws nothing and can say why. */
|
|
46
|
+
const WITHHELD_GRAPH = { nodes: [], edges: [], withheld: true };
|
|
47
|
+
/** The run's facts (`run`) when their JSON holds a held value split across two of them (its agent and its revision): the
|
|
48
|
+
* facts the server makes itself, which carry no one's words (its id, status, pause and times), each still cut as any
|
|
49
|
+
* string is, the agent and the revision "[redacted]", and `withheld`. */
|
|
50
|
+
const withheldRun = (run, values) => ({
|
|
51
|
+
...Object.fromEntries(["id", "status", "paused", "startedAt", "endedAt"].filter((key) => key in run).map((key) => [key, redactedOutput(run[key], values)])),
|
|
52
|
+
agent: "[redacted]",
|
|
53
|
+
revision: "[redacted]",
|
|
54
|
+
withheld: true,
|
|
55
|
+
});
|
|
56
|
+
/** The top-level fields served in their own shape when withheld whole, by name: what a reader of the graph reads at once
|
|
57
|
+
* (the console draws the graph's nodes and reads the run's status). Any other field withheld whole is "[redacted]". */
|
|
58
|
+
const IN_SHAPE = {
|
|
59
|
+
graph: () => ({ ...WITHHELD_GRAPH }),
|
|
60
|
+
run: withheldRun,
|
|
61
|
+
};
|
|
41
62
|
/** A time as Date's toISOString writes it, and nothing else: digits, its fixed separators and Z. */
|
|
42
63
|
const ISO_TIME = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
43
64
|
/** A graph view as GET /runs/{id}/graph serves it with `values` held, every field of it cut by the one rule (redactedOutput
|
|
44
65
|
* over the same values), the parts by the file path's rule on top:
|
|
45
66
|
* - its nodes, each decision and each call through servedPart (a map item's label and an error cut short after);
|
|
46
67
|
* - every other top-level field (its run, its workflow, its structure `graph`, which echoes the workflow's nodes and their
|
|
47
|
-
* words, its totals, and any field added later) through
|
|
68
|
+
* words, its totals, and any field added later) through redactedOutputWhole, each by itself, its keys included: a
|
|
69
|
+
* field whose JSON holds a held value split across two of its strings is "[redacted]", but for `graph` and `run`,
|
|
70
|
+
* each served in its own shape (IN_SHAPE), so every reader that draws the run still reads a graph's nodes and edges
|
|
71
|
+
* and the run's status;
|
|
48
72
|
* - `read_at`, which moves with every read: the server's clock as toISOString writes it, served as it is, never kept;
|
|
49
73
|
* anything else under the name is cut each read.
|
|
50
74
|
* Each part and each field, its name and its value, scalar or not, is cut once per content and held set and kept in
|
|
@@ -69,7 +93,13 @@ export function servedGraphView(view, values, cache) {
|
|
|
69
93
|
// A field's name and its value, scalar or not, each cut once per content and held set: a poll walks none again.
|
|
70
94
|
// (graphWalks.rest counts the walks of a field that holds more than one value, as before.)
|
|
71
95
|
const cutName = kept(`name:${keys}:${digest(name)}`, () => redactedOutput(name, values));
|
|
72
|
-
fields[cutName] = kept(`field:${keys}:${digest(name)}:${digest(value)}`, () =>
|
|
96
|
+
fields[cutName] = kept(`field:${keys}:${digest(name)}:${digest(value)}`, () => {
|
|
97
|
+
if (isRecordOrArray(value))
|
|
98
|
+
graphWalks.rest++;
|
|
99
|
+
const cut = redactedOutputWhole(value, values);
|
|
100
|
+
const shape = Object.hasOwn(IN_SHAPE, name) ? IN_SHAPE[name] : undefined;
|
|
101
|
+
return shape && isRecord(value) && cut === "[redacted]" ? shape(value, values) : cut;
|
|
102
|
+
});
|
|
73
103
|
}
|
|
74
104
|
return {
|
|
75
105
|
// The read's own time, the server's clock as toISOString writes it, holds nothing of the run: served as it is. Any other
|
package/dist/handed-values.js
CHANGED
|
@@ -12,6 +12,7 @@ import { ServerSecrets } from "./server-secrets.js";
|
|
|
12
12
|
import { sealedAt, unsealColumn } from "./store/seal.js";
|
|
13
13
|
import { handedMark, handedPointers } from "./run-view.js";
|
|
14
14
|
import { readLaunchBody } from "./run-launch.js";
|
|
15
|
+
import { SIGN_IN_VENDORS } from "./sign-ins-store.js";
|
|
15
16
|
import { StoreLaunchMissing } from "./store/store.js";
|
|
16
17
|
import { keptVendor } from "./tool-plane.js";
|
|
17
18
|
/** The run's launch body read back, or undefined when it has none (an old run, or one not started with one). */
|
|
@@ -148,8 +149,6 @@ export function cutHanded(value, values) {
|
|
|
148
149
|
};
|
|
149
150
|
return walk(value);
|
|
150
151
|
}
|
|
151
|
-
/** The browser vendors that keep a sign-in (sign-ins-store.ts vendorOf). */
|
|
152
|
-
const SIGN_IN_VENDORS = ["browserbase", "kernel"];
|
|
153
152
|
/** Why what an agent learned is withheld (403): a pointer of its sign-in can't be read here, so the cut would be shorter
|
|
154
153
|
* than what a note may hold. */
|
|
155
154
|
export const WITHHELD_LEARNING = "This server can't read the agent's browser sign-in (its seal key changed or is missing, or the sign-in is damaged), so what it learned is not shown.";
|
package/dist/harness-check.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ export interface HarnessCheckOptions {
|
|
|
12
12
|
/** The most the check may spend, USD. */
|
|
13
13
|
capUsd?: number;
|
|
14
14
|
platform?: string;
|
|
15
|
-
/** For tests: the
|
|
15
|
+
/** For tests: the network the model proxy forwards to, under the check's recorder. A model the route translates goes
|
|
16
|
+
* through the route's own fetch instead, as on a server. */
|
|
16
17
|
fetch?: typeof fetch;
|
|
17
18
|
/** Each step as it happens, a line of words. */
|
|
18
19
|
say?: (line: string) => void;
|
package/dist/harness-check.js
CHANGED
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
// provider sees only the turns' Messages requests; anything it reaches for beyond loopback goes to the check's own
|
|
9
9
|
// proxy, which refuses and lists it).
|
|
10
10
|
// Stage 3, live: the agent is killed (SIGKILL) after a turn and the next turn resumes it (its own session/load, or a
|
|
11
|
-
// fresh session told the conversation), a denied call never runs, one of our tools runs over MCP
|
|
12
|
-
//
|
|
11
|
+
// fresh session told the conversation), a denied call never runs, one of our tools runs over MCP without the agent
|
|
12
|
+
// asking permission for it (unless its recipe declares the title tie), and another runner with its own directory
|
|
13
|
+
// picks the session up from the records.
|
|
13
14
|
// It prints the three facts a harness row carries: resume (load | restart), tool_gate (permission | config: whether the
|
|
14
15
|
// agent asks before a tool call) and billing (proxy | plan).
|
|
15
16
|
// The check spends: four short turns on the run's model, under a cap (default $0.25).
|
|
@@ -179,25 +180,44 @@ async function checkRun(options, held) {
|
|
|
179
180
|
return refuse("HARNESS_CHECK_USAGE", `${recipe.label} is billed through the proxy: name the run's model with --model provider/model-id (openrouter/anthropic/claude-haiku-4.5, anthropic/claude-haiku-4-5)`);
|
|
180
181
|
needs = { model: ref, models: await providerModels(env) };
|
|
181
182
|
}
|
|
182
|
-
// The session: the check's tools, its gate, its egress proxy,
|
|
183
|
+
// The session: the check's tools, its gate, its egress proxy, its recorder.
|
|
183
184
|
const nonce = randomBytes(6).toString("hex");
|
|
184
185
|
const echoed = [];
|
|
185
186
|
const deniedRan = [];
|
|
186
187
|
const tools = [
|
|
187
|
-
|
|
188
|
+
// A path beside the text: Goose 1.59.2 titles a call whose arguments hold one with a summary of it (` · proof.txt`), so
|
|
189
|
+
// each release's title form for such a call runs here, and the adapter ties nothing to it.
|
|
190
|
+
{ name: "check_echo", description: "Echo the text back, prefixed with ECHO.", inputSchema: { type: "object", properties: { text: { type: "string" }, path: { type: "string", description: "A file name to echo beside it." } }, required: ["text"] }, replay: "never", call: async (args) => (echoed.push(args), { text: `ECHO:${args?.text ?? ""}` }) },
|
|
188
191
|
{ name: "check_denied", description: "A tool this run refuses: calling it shows the refusal.", inputSchema: { type: "object", properties: { text: { type: "string" } }, required: ["text"] }, replay: "never", call: async (args) => (deniedRan.push(args), { text: "this call should never have run" }) },
|
|
189
192
|
];
|
|
190
193
|
// The gate allows check_echo alone. Everything else is denied, the agent's own calls (`acp_<kind>`) included, as a
|
|
191
|
-
// server's gate answers them: a call of ours
|
|
194
|
+
// server's gate answers them: a permission request for a call of ours, on a recipe with no title tie or one whose title
|
|
195
|
+
// the adapter can't tie, is one of those: refused, so mcp_tool fails (on calls 0, or on ourAsks where the agent runs it
|
|
196
|
+
// anyway), and the row counts it in ourAsks either way.
|
|
192
197
|
const gateAsked = [];
|
|
198
|
+
// The ids of check_echo's MCP calls, as the gate got them: the agent's announced toolCallId where the adapter matched
|
|
199
|
+
// the call to one. A permission request under one of these ids was for our tool.
|
|
200
|
+
const echoIds = new Set();
|
|
201
|
+
// The agent's toolCallIds (the gate call's args carry each) of the permission requests (`acp_<kind>`) whose input's
|
|
202
|
+
// `text` is the nonce, as check_echo's text argument is: requests for our tool by its arguments, as the adapter
|
|
203
|
+
// matches a call to its MCP call (CallIds), never by a title. The nonce is new for each check. Its `text` field and not
|
|
204
|
+
// anywhere in the input: an agent may write the nonce into proof.txt with an editor of its own (Goose's
|
|
205
|
+
// developer__text_editor, `file_text`), and Goose asks with kind "other" for every call, so the kind can't tell the
|
|
206
|
+
// two apart. This catches a request the gate refused and the agent never ran, which no check_echo id ever names.
|
|
207
|
+
const nonceToolCallIds = new Set();
|
|
193
208
|
const gate = async (call) => {
|
|
194
209
|
const answer = call.tool === "check_echo" ? "allow" : "deny";
|
|
210
|
+
if (call.tool === "check_echo")
|
|
211
|
+
echoIds.add(call.callId);
|
|
212
|
+
else if (call.tool.startsWith("acp_") && call.args?.input?.text === nonce && typeof call.args?.toolCallId === "string")
|
|
213
|
+
nonceToolCallIds.add(call.args.toolCallId);
|
|
195
214
|
gateAsked.push({ tool: call.tool, answer });
|
|
196
215
|
return answer === "allow" ? "allow" : { deny: "harness-check refuses this call on purpose" };
|
|
197
216
|
};
|
|
198
217
|
const forwarded = [];
|
|
199
|
-
|
|
200
|
-
|
|
218
|
+
// The recorder wraps the hop the proxy forwards with: the route's own fetch for a model it translates (an Ollama
|
|
219
|
+
// model), else the network (options.fetch in tests). So a check on such a model runs the route a server's run takes.
|
|
220
|
+
const record = (next) => async (input, init) => {
|
|
201
221
|
const url = new URL(typeof input === "string" ? input : input instanceof URL ? input.href : input.url);
|
|
202
222
|
const text = bodyText(init?.body);
|
|
203
223
|
let toolNames = [];
|
|
@@ -209,7 +229,7 @@ async function checkRun(options, held) {
|
|
|
209
229
|
// Not JSON: no tools.
|
|
210
230
|
}
|
|
211
231
|
forwarded.push({ method: init?.method ?? "GET", path: url.pathname, tools: toolNames, text });
|
|
212
|
-
return
|
|
232
|
+
return (next ?? options.fetch ?? fetch)(input, init);
|
|
213
233
|
};
|
|
214
234
|
const logs = [];
|
|
215
235
|
const log = (message, fields) => void logs.push({ message, ...(fields ?? {}) });
|
|
@@ -239,8 +259,8 @@ async function checkRun(options, held) {
|
|
|
239
259
|
starts += 1;
|
|
240
260
|
};
|
|
241
261
|
// The recipe's entry as a server builds it (harness-recipe-entry.ts), on this check's route, log, variables (its egress
|
|
242
|
-
// proxy) and
|
|
243
|
-
const entry = recipeEntryOf({ recipe, binary, release, route: () => route, beforeStart, vars: () => childVars,
|
|
262
|
+
// proxy) and recorder.
|
|
263
|
+
const entry = recipeEntryOf({ recipe, binary, release, route: () => route, beforeStart, vars: () => childVars, record, log });
|
|
244
264
|
const planNeeds = { model: { provider: recipe.id, modelId: planModel ?? "default" }, models: { getModel: () => undefined } };
|
|
245
265
|
const adapterFor = async () => entry.adapter(hostEnv, needs ?? planNeeds);
|
|
246
266
|
// The first runner's adapter is made before any turn, so a model this server can't run is refused before the agent
|
|
@@ -304,12 +324,25 @@ async function checkRun(options, held) {
|
|
|
304
324
|
// Turn 1: one of our tools over MCP.
|
|
305
325
|
say(`${recipe.label}: turn 1, a call of our check_echo tool over MCP`);
|
|
306
326
|
const first = await sessionOn(join(work, "runner-a"));
|
|
307
|
-
const t1 = await first.turn(`Use the check_echo tool once, with the text argument set to ${nonce}. Then reply with exactly what it returned and nothing else.`);
|
|
327
|
+
const t1 = await first.turn(`Use the check_echo tool once, with the text argument set to ${nonce} and the path argument set to proof.txt. Then reply with exactly what it returned and nothing else.`);
|
|
328
|
+
// The permissions the agent asked for in turn 1 (permissionAsks), and of those the ones for our tool (ourAsks), each
|
|
329
|
+
// counted once: a request whose toolCallId is the id a check_echo MCP call reached the gate under, or one whose gate
|
|
330
|
+
// question's input carried check_echo's nonce as its text (nonceToolCallIds, by the toolCallId its args carry).
|
|
331
|
+
// Matched by id and arguments, never by title. The adapter answers a request for our tool only where
|
|
332
|
+
// the recipe declares the title tie (quirks.permissionTie, Cursor's); any other agent must ask nothing for our tools
|
|
333
|
+
// (an allowFile, Goose's), since the server's gate asks at the MCP call. Any other request is the agent's own call:
|
|
334
|
+
// the gate denied it and lists it (gate.permissionsAsked), and it fails no stage.
|
|
335
|
+
const turnAsks = asked();
|
|
336
|
+
const permissionAsks = turnAsks.length;
|
|
337
|
+
const ourIds = new Set([...echoIds, ...nonceToolCallIds]);
|
|
338
|
+
const ourAsks = turnAsks.filter((l) => typeof l.toolCallId === "string" && ourIds.has(l.toolCallId)).length;
|
|
339
|
+
const tied = recipe.quirks.permissionTie === "title";
|
|
340
|
+
const askedProblem = ourAsks > 0 && !tied ? `the agent asked permission for our tool ${ourAsks} time(s) (a request under the id of a check_echo call, or with check_echo's arguments): its recipe needs an allowFile in the form the agent reads, so it runs our tools unasked, or the title tie (quirks.permissionTie) when the agent asks for every MCP call whatever its config says` : undefined;
|
|
308
341
|
const firstOpen = opened()[0];
|
|
309
342
|
// The environment while the agent runs.
|
|
310
343
|
const environ = firstOpen?.pid ? environOf(firstOpen.pid) : undefined;
|
|
311
344
|
const echoReached = messages().some((r) => r.text.includes(`ECHO:${nonce}`));
|
|
312
|
-
stage3.mcp_tool = { ok: t1.status === "completed" && echoed.length >= 1 && (recipe.model.billing !== "proxy" || echoReached), turn: t1.status, ...(t1.error ? { error: t1.error } : {}), calls: echoed.length, resultReachedModel: recipe.model.billing === "proxy" ? echoReached : null };
|
|
345
|
+
stage3.mcp_tool = { ok: t1.status === "completed" && echoed.length >= 1 && (recipe.model.billing !== "proxy" || echoReached) && !askedProblem, turn: t1.status, ...(t1.error ? { error: t1.error } : {}), calls: echoed.length, resultReachedModel: recipe.model.billing === "proxy" ? echoReached : null, permissionAsks, ourAsks, ...(askedProblem ? { problem: askedProblem } : {}) };
|
|
313
346
|
// Stage 2: the tools the agent offered its model on its first request. The proxy refuses a request that offers a tool
|
|
314
347
|
// its policy does not allow, so one that reached the provider at all passed that rule: the stage is whether one did.
|
|
315
348
|
// Its refusals are listed beside it, never counted: a port watcher's GET / is refused too.
|
package/dist/harness-keys.d.ts
CHANGED
|
@@ -114,8 +114,7 @@ export declare class HarnessKeysOverStore {
|
|
|
114
114
|
private kept;
|
|
115
115
|
/** GET: `recipe`'s keys, each by name, whether saved for it and when it changed, and those to enter again: never a value. */
|
|
116
116
|
view(recipe: PlanRecipe): HarnessKeysView;
|
|
117
|
-
/** Each id with keys saved whose recipe this server does not name, sorted:
|
|
118
|
-
* console offers the page that removes them. */
|
|
117
|
+
/** Each id with keys saved whose recipe this server does not name, sorted: the page lists them (list), to remove. */
|
|
119
118
|
unnamed(): string[];
|
|
120
119
|
/** GET /settings/harness-keys: every plan-billed recipe this server is started with, its keys by name; then each id
|
|
121
120
|
* with keys saved whose recipe it no longer names (unnamed), its keys kept. */
|
package/dist/harness-keys.js
CHANGED
|
@@ -248,13 +248,12 @@ export class HarnessKeysOverStore {
|
|
|
248
248
|
const entry = this.current.get(row);
|
|
249
249
|
if (!entry || this.bound(recipe, name))
|
|
250
250
|
return [];
|
|
251
|
-
const why = "unreadable" in entry.opened ? entry.opened.unreadable : "recipe_changed";
|
|
251
|
+
const why = "unreadable" in entry.opened ? entry.opened.unreadable : entry.recipe === undefined ? "not_bound" : "recipe_changed";
|
|
252
252
|
return [{ name: row, why }];
|
|
253
253
|
});
|
|
254
254
|
return { id: recipe.id, label: recipe.label, named: true, keys, kept: this.kept(recipe.id, recipe.keys), ready: this.saved(recipe), reenter };
|
|
255
255
|
}
|
|
256
|
-
/** Each id with keys saved whose recipe this server does not name, sorted:
|
|
257
|
-
* console offers the page that removes them. */
|
|
256
|
+
/** Each id with keys saved whose recipe this server does not name, sorted: the page lists them (list), to remove. */
|
|
258
257
|
unnamed() {
|
|
259
258
|
const named = new Set(this.recipes.map((recipe) => recipe.id));
|
|
260
259
|
return [...new Set([...this.current.keys()].flatMap((row) => rowParts(row)?.harness ?? []))].filter((id) => !named.has(id)).sort();
|
|
@@ -313,7 +312,7 @@ export class HarnessKeysOverStore {
|
|
|
313
312
|
/** DELETE: `key`'s value for `held`'s harness gone from its runs, kept as a retired row for the cut. A row that does not
|
|
314
313
|
* open under this server's seal key is removed too, so no claim counts it saved. */
|
|
315
314
|
async remove(held, key) {
|
|
316
|
-
known(held, key);
|
|
315
|
+
known(held, key, true);
|
|
317
316
|
const row = harnessKeyRow(held.id, key);
|
|
318
317
|
await this.serial(async () => {
|
|
319
318
|
const was = this.current.get(row);
|
|
@@ -344,10 +343,13 @@ export class HarnessKeysOverStore {
|
|
|
344
343
|
this.retired.set(of, list);
|
|
345
344
|
}
|
|
346
345
|
}
|
|
347
|
-
/** 422 unless `key` is one `recipe` runs on (or, for a DELETE, one
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
346
|
+
/** 422 unless `key` is one `recipe` runs on (or, for a DELETE, one it holds): a key no recipe names is never saved. A
|
|
347
|
+
* DELETE's refusal names the keys held, which for an id no recipe names are kept keys, never ones it runs on. */
|
|
348
|
+
function known(recipe, key, remove = false) {
|
|
349
|
+
if (recipe.keys.includes(key))
|
|
350
|
+
return;
|
|
351
|
+
const keys = recipe.keys.join(", ");
|
|
352
|
+
throw invalid([{ field: "key", reason: "not_an_option", message: remove ? `${recipe.label}'s keys are ${keys}.` : `${recipe.label} runs on ${keys}.` }]);
|
|
351
353
|
}
|
|
352
354
|
/** What a PUT may save: `body.value`, text of 8 to 1024 bytes with no whitespace or control character, for a key the
|
|
353
355
|
* recipe names. No message holds the value. */
|
|
@@ -17,6 +17,8 @@ export const facts = Object.freeze({
|
|
|
17
17
|
thinking: Object.freeze(["low", "medium", "high", "xhigh"]),
|
|
18
18
|
// OpenCode's model requests carry no provider-hosted tool: no search of its own.
|
|
19
19
|
ownModel: false,
|
|
20
|
+
// Its proxy forwards with the fetch it is handed: a model the route translates onto its wire runs on it.
|
|
21
|
+
forwardsRoute: true,
|
|
20
22
|
normalizeModel: (model) => model,
|
|
21
23
|
// The server is named first, as the other lines name a package beside it: OpenCode's CLI is an optional peer of the
|
|
22
24
|
// server's own.
|