@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/store-view.d.ts
CHANGED
|
@@ -10,10 +10,14 @@ import type { PendingAsk } from "./browser-person.js";
|
|
|
10
10
|
import { type Approvals } from "./approvals.js";
|
|
11
11
|
import { type KeptListing, type RunListing, type RunRow, type Store } from "./store/store.js";
|
|
12
12
|
import type { RecordingView } from "./run-recordings.js";
|
|
13
|
+
import { type FactoryActivity, type FactoryObserved } from "./factory-activity.js";
|
|
13
14
|
/** What the store-backed view needs beside the store: where its console lives, every secret it never shows (read now, so
|
|
14
15
|
* one rotated is cut at once), and the agents' saved sign-ins (for the handed-pointer cut). The server passes the same it
|
|
15
16
|
* passes the file path. */
|
|
16
17
|
export interface ViewDeps {
|
|
18
|
+
/** Scoped factory lists ask for source/provenance metadata. Ordinary run reads keep their existing shape and cost.
|
|
19
|
+
* "kept": all of it but who observes the run now, for a listing (KeptFactory): that is read when it is listed. */
|
|
20
|
+
readonly factory?: boolean | "kept";
|
|
17
21
|
readonly origin: string;
|
|
18
22
|
readonly serverSecrets: () => string[];
|
|
19
23
|
readonly signIns?: SignInReader;
|
|
@@ -27,7 +31,7 @@ export interface ViewDeps {
|
|
|
27
31
|
* run's error names a refused key in plain words, as its Timeline's error row does. Default: this process's
|
|
28
32
|
* environment (the server passes it with the keys a person saved). */
|
|
29
33
|
readonly keyEnv?: () => NodeJS.ProcessEnv;
|
|
30
|
-
/** Each learned item's status
|
|
34
|
+
/** Each learned item's status at agent `agentId`'s newest learning save (learning-routes.ts statusesOf): what a run held
|
|
31
35
|
* for its owner's OK reads as it stands there. None: as the merge wrote it. */
|
|
32
36
|
readonly statuses?: (agentId: string) => Promise<ReadonlyMap<string, ItemStatus> | undefined>;
|
|
33
37
|
/** Run `runId`'s screen recordings (run-recordings.ts recordingsOf), the run ended at `endedAt` (null: it has not). Only
|
|
@@ -55,6 +59,9 @@ export declare const answerOf: (timeline: readonly TimelineEvent[]) => string |
|
|
|
55
59
|
/** The run read from the store: the row, its launch, its timeline, its agent's revision count for the version, its
|
|
56
60
|
* learning end, and the sign-in cut it serves through. Undefined for an unknown run. */
|
|
57
61
|
interface StoreRun {
|
|
62
|
+
readonly factory?: Omit<FactoryActivity, "controls" | "observation"> & {
|
|
63
|
+
readonly observation?: FactoryActivity["observation"];
|
|
64
|
+
};
|
|
58
65
|
readonly native?: Record<string, unknown>;
|
|
59
66
|
readonly sdk?: Record<string, unknown>;
|
|
60
67
|
readonly cli_learning?: Record<string, unknown>;
|
|
@@ -134,6 +141,10 @@ interface StoreRun {
|
|
|
134
141
|
* look-back's own end is in (poll_after_ms 1000, the timeline not final). */
|
|
135
142
|
readonly lookingBack?: true;
|
|
136
143
|
}
|
|
144
|
+
/** A runner holds the run's claim now: it is not in a final state, a runner is named on its row, and its lease has not run
|
|
145
|
+
* out (claimed_until >= now, the predicate the claimable query's `claimed_until < ?` is the negation of). `now` is the
|
|
146
|
+
* server's clock, so a test on a moved clock reads a fresh claim as live. */
|
|
147
|
+
export declare function liveOf(runRow: RunRow, now: number): boolean;
|
|
137
148
|
/** Whether the run's turn stands on a person: a tool call asked for their approval with no answer in its journal (the
|
|
138
149
|
* view's `approvals`, asksOf), or a browser or desktop hand-over neither answered in its journal nor by a hand-back row.
|
|
139
150
|
* By the journal alone, never by the clock: a hand-over past its expiry still holds the turn until its expiry is written
|
|
@@ -164,7 +175,7 @@ export declare function lookingBackEnd(store: Store, stored: RunRow): Promise<Ke
|
|
|
164
175
|
* and for an unknown run. */
|
|
165
176
|
export declare function toolsUsdOverStore(store: Store, runId: string): Promise<number | null>;
|
|
166
177
|
/** The start sweep's heal of run `runId` (cost-heal.ts): the same rule as its run read's (bookedCostOf, healOf), from its
|
|
167
|
-
* row, its launch and its journal alone, so a sweep over many runs reads no timeline and no learning
|
|
178
|
+
* row, its launch and its journal alone, so a sweep over many runs reads no timeline and no learning. True when
|
|
168
179
|
* it wrote the booking's figure; a failed read or write throws, for the sweep to count. */
|
|
169
180
|
export declare function healedOverStore(store: Store, runId: string): Promise<boolean>;
|
|
170
181
|
/** GET /runs/{id}'s answer from the store, byte-identical to runs.ts's view for the same run. Undefined for an unknown run. */
|
|
@@ -182,6 +193,17 @@ export declare function summaryOfView(view: Record<string, unknown>): Record<str
|
|
|
182
193
|
* sign-in it was handed could not be read: that read may fail only for now, and the run reads whole once it recovers);
|
|
183
194
|
* and what outside the run it read (LISTING_HELD, LISTING_KEYED). Undefined for an unknown run. */
|
|
184
195
|
export declare function listingOverStore(store: Store, runId: string, deps: ViewDeps): Promise<RunListing | undefined>;
|
|
196
|
+
/** What a listing keeps for the Agent Factory (RunListing.factory): the run's factory projection as the build's view gave
|
|
197
|
+
* it (`activity`: its watermark of that build's snapshot, its source, controls, last activity, GitHub work and children,
|
|
198
|
+
* all of which move only with a write that moves the run's mark), and who the run is observed through (`observed`), which
|
|
199
|
+
* a scoped list reads at each request (factory-activity.ts observationOf): a lease renewed writes nothing to the run. */
|
|
200
|
+
export type KeptFactory = {
|
|
201
|
+
readonly activity: Omit<FactoryActivity, "observation">;
|
|
202
|
+
readonly observed: FactoryObserved;
|
|
203
|
+
};
|
|
204
|
+
/** What `listing` keeps for the Agent Factory, cut again of the server's secrets as `listedItem` cuts its item when they
|
|
205
|
+
* moved since its build; undefined for a listing built before one was kept, which a scoped list builds again, once. */
|
|
206
|
+
export declare function keptFactory(listing: KeptListing, serverSecrets: readonly string[]): KeptFactory | undefined;
|
|
185
207
|
/** Whether `listing` is cut of the server's secrets as they are now. A list builds any other again before it shows it
|
|
186
208
|
* (server.ts runsPage): the run's view cuts a value whole where it holds a secret (a note's name reads [redacted]), which
|
|
187
209
|
* cutting the built item again could not do. */
|
package/dist/store-view.js
CHANGED
|
@@ -8,7 +8,7 @@ import { isDeepStrictEqual } from "node:util";
|
|
|
8
8
|
import { BACKGROUND_CONTEXT } from "@earendil-works/chord/context";
|
|
9
9
|
import { CAPS, isMessageRow } from "./timeline/index.js";
|
|
10
10
|
import { runLink } from "./console-links.js";
|
|
11
|
-
import { redacted, redactedAnswer, redactedOutput,
|
|
11
|
+
import { redacted, redactedAnswer, redactedOutput, redactedOutputWhole, withoutLoopback } from "./key-refusal.js";
|
|
12
12
|
import { structuredAnswer } from "./answer-json.js";
|
|
13
13
|
import { isObject } from "./validate.js";
|
|
14
14
|
import { currentLearning, holdsForOk, learningView, LEARNING_LABEL, secretsShown, shortOf } from "./learning.js";
|
|
@@ -28,7 +28,7 @@ import { capNowOf, KINDS } from "./runner/journal-kinds.js";
|
|
|
28
28
|
import { laidOf, pathViewOf, roundsOf, runLearningEnd, usedOnly } from "./store-reads/learning.js";
|
|
29
29
|
import { inReflect, reflectRanges } from "./runner/end-of-run.js";
|
|
30
30
|
import { correctionCount } from "./learn/corrections.js";
|
|
31
|
-
import { forgetServedAnswers, isCliRecord, servedSince, runReflect, runTimeline, wholeAnswerFor, wholeAnswers, withoutFeedbackRounds } from "./store-reads/journal.js";
|
|
31
|
+
import { forgetServedAnswers, isCliRecord, rowCutsOnce, servedSince, runReflect, runTimeline, wholeAnswerFor, wholeAnswers, withoutFeedbackRounds } from "./store-reads/journal.js";
|
|
32
32
|
import { costOfRun, readRun, runReadState } from "./store-reads/runs.js";
|
|
33
33
|
import { feedbackOf, keptEndOf } from "./runner/feedback-round.js";
|
|
34
34
|
import { runCutValues, runErrorWordsOf, underCut } from "./run-cut.js";
|
|
@@ -41,6 +41,7 @@ import { approvalsOf } from "./approvals.js";
|
|
|
41
41
|
import { FINAL_STATES, stoppedByPerson } from "./store/store.js";
|
|
42
42
|
import { LISTING_HELD, LISTING_KEYED } from "./store/schema.js";
|
|
43
43
|
import { createHash } from "node:crypto";
|
|
44
|
+
import { factoryChildren, factoryGithub, factoryLastActivity, factoryObservation, factoryObserved, factorySource } from "./factory-activity.js";
|
|
44
45
|
/** A run that has ended reads one of these (the old RunRow state → the v2 status: an escalation is a completion with a
|
|
45
46
|
* review; a stopped run is a cancellation), as runs.ts's STATUS_OF mapped them. A running run reads its status from the
|
|
46
47
|
* journal, and so does an agentic run a person stopped, which reads running (runReadState). */
|
|
@@ -94,9 +95,10 @@ export function forgetServed(store, runId) {
|
|
|
94
95
|
}
|
|
95
96
|
/** A run's answer as served: redactedAnswer's, once per answer and held value set. */
|
|
96
97
|
const servedOnce = (store, runId, input, values, since) => keptOnce(store, `answer ${runId}`, input, values, since, () => redactedAnswer(input, values));
|
|
97
|
-
/** Whether a run's input is served (store-view's `input`): only when the cut a run's words get
|
|
98
|
-
*
|
|
99
|
-
|
|
98
|
+
/** Whether a run's input is served (store-view's `input`): only when the cut a run's words get, read whole first
|
|
99
|
+
* (redactedOutputWhole: a held value split across two of its fields withholds it), leaves it exactly as given, so "Run
|
|
100
|
+
* again" never sends an altered task. Read once per input and held value set. */
|
|
101
|
+
const inputWhole = (store, runId, input, values, since) => keptOnce(store, `input ${runId}`, JSON.stringify(input), values, since, () => isDeepStrictEqual(redactedOutputWhole(input, values), input));
|
|
100
102
|
/** A run's whole answer as answerOfRun read it from the rows: its newest final-answer row, never the learning turn's, and
|
|
101
103
|
* never an earlier turn's: a final answer row before the person's last message belongs to the turn that message
|
|
102
104
|
* followed, so a follow-up whose own stop said nothing (no text block: a thinking-only stop) has no answer, null, not
|
|
@@ -152,7 +154,7 @@ function pausedOf(runRow, entries) {
|
|
|
152
154
|
/** A runner holds the run's claim now: it is not in a final state, a runner is named on its row, and its lease has not run
|
|
153
155
|
* out (claimed_until >= now, the predicate the claimable query's `claimed_until < ?` is the negation of). `now` is the
|
|
154
156
|
* server's clock, so a test on a moved clock reads a fresh claim as live. */
|
|
155
|
-
function liveOf(runRow, now) {
|
|
157
|
+
export function liveOf(runRow, now) {
|
|
156
158
|
return !FINAL_STATES.includes(runRow.state) && runRow.runner !== null && runRow.claimedUntil !== null && runRow.claimedUntil >= now;
|
|
157
159
|
}
|
|
158
160
|
/** Whether the run's turn stands on a person: a tool call asked for their approval with no answer in its journal (the
|
|
@@ -192,7 +194,7 @@ async function storeRunOf(store, runId, deps) {
|
|
|
192
194
|
await healStoredCost(store, runId, run.heal);
|
|
193
195
|
if (!run?.shownEnd || !holdsForOk(run.shownEnd) || !deps.statuses)
|
|
194
196
|
return run && { ...run, learningEnd: run.shownEnd, since };
|
|
195
|
-
// What the learning end held for its owner's OK reads as it stands now
|
|
197
|
+
// What the learning end held for its owner's OK reads as it stands now at its agent's newest save (learning.ts
|
|
196
198
|
// currentLearning); its record stays as the merge wrote it.
|
|
197
199
|
return { ...run, learningEnd: currentLearning(run.shownEnd, await deps.statuses(run.row.agent)), since };
|
|
198
200
|
}
|
|
@@ -266,7 +268,9 @@ async function storeRunIn(store, runId, deps, cut, since) {
|
|
|
266
268
|
// Its final answer whole (store-reads/journal.ts wholeAnswers), as main served a run's answer: a row's cut is no answer's.
|
|
267
269
|
// A run that ended reads settled, and its usage row says its cost ("Cost: …"), never what it has cost so far. One
|
|
268
270
|
// looking back is still going: its look-back's rows come yet.
|
|
269
|
-
|
|
271
|
+
// A call's arguments, or a web call's output, split across two strings are withheld whole (TimelineOptions.holds).
|
|
272
|
+
// Each text cut once per held value set (rowCutsOnce): a polled view cuts only what an earlier read had not.
|
|
273
|
+
const timelineOptions = { settled: terminal && !lookingBack, ended: terminal && !lookingBack, ...rowCutsOnce(store, runId, cut, since) };
|
|
270
274
|
// Rendered from the records read above, so its usage row and the cost's `plan` (bookedSpend over the same entries) are
|
|
271
275
|
// of one read.
|
|
272
276
|
const timeline = withAsks(await wholeAnswers(store, runId, context, await runTimeline(store, runId, context, timelineOptions, records), timelineOptions, wholeAnswerFor(values), since));
|
|
@@ -422,7 +426,15 @@ async function storeRunIn(store, runId, deps, cut, since) {
|
|
|
422
426
|
const endSaidCost = endCost && !lookingBack ? endSaid !== undefined : false;
|
|
423
427
|
const endUnread = !lookingBack && bookedCost !== undefined && !endCost && endSaid === null;
|
|
424
428
|
const heal = lookingBack ? undefined : healOf(endCost, runRow);
|
|
425
|
-
|
|
429
|
+
const factory = deps.factory ? {
|
|
430
|
+
lifecycle_version: await store.runs.changesHead(),
|
|
431
|
+
...factorySource(launch, harness),
|
|
432
|
+
...(deps.factory === "kept" ? {} : { observation: await factoryObservation(store, launch, live, liveRow?.updatedAt, deps.now ?? Date.now) }),
|
|
433
|
+
last_activity_at: factoryLastActivity(records),
|
|
434
|
+
github: unshown ? null : factoryGithub(launch, (text) => withoutLoopback(redacted(text, values))),
|
|
435
|
+
children: terminal || FINAL_STATES.includes(runRow.state) || unshown ? [] : await factoryChildren(store, runId, records, (text) => withoutLoopback(redacted(text, values))),
|
|
436
|
+
} : undefined;
|
|
437
|
+
return { ...(factory ? { factory } : {}), ...(cli_learning ? { cli_learning } : {}), ...(sdk ? { sdk } : {}), ...(native ? { native } : {}), row, runRow, launch, rows, version, harness, learningEnd: shownEnd, shownEnd, view, unshown, values, live, updatedAtMs, lastProgressAt, budget, paused, browserAsk, computerAsk, approvalsMode, output, ...(review ? { review } : {}), structured, decisions, model, windDown, ...(endCost ? { endCost, endSaidCost } : {}), ...(endUnread ? { endUnread } : {}), ...(heal ? { heal } : {}), ...(lookingBack ? { lookingBack: true } : {}) };
|
|
426
438
|
}
|
|
427
439
|
/** Run read `read` (a run still going, as the store holds it) as the end `ended` keeps (its state, summary and end time:
|
|
428
440
|
* the end a run looking back keeps), its cost as read. */
|
|
@@ -565,7 +577,7 @@ function healOf(endCost, runRow) {
|
|
|
565
577
|
return { epoch: runRow.epoch, endedAt: runRow.endedAt, costUsd: endCost.usd, costUpperBound };
|
|
566
578
|
}
|
|
567
579
|
/** The start sweep's heal of run `runId` (cost-heal.ts): the same rule as its run read's (bookedCostOf, healOf), from its
|
|
568
|
-
* row, its launch and its journal alone, so a sweep over many runs reads no timeline and no learning
|
|
580
|
+
* row, its launch and its journal alone, so a sweep over many runs reads no timeline and no learning. True when
|
|
569
581
|
* it wrote the booking's figure; a failed read or write throws, for the sweep to count. */
|
|
570
582
|
export async function healedOverStore(store, runId) {
|
|
571
583
|
const heal = await store.snapshot(async (snapshot) => {
|
|
@@ -602,10 +614,11 @@ async function viewOfRun(store, runId, deps, run, read) {
|
|
|
602
614
|
const finalAnswer = row.kind === "workflow" || unshown ? null : answerOf(run.rows) ?? row.summary ?? null;
|
|
603
615
|
// A workflow run's output, as its end kept it; an agentic run's, its final answer's structured part when its agent has
|
|
604
616
|
// an output schema and the answer's json block (answer-json.ts jsonBlockOf) meets it (storeRunOf's `structured`), else none. Served as
|
|
605
|
-
// runs.ts serves it (servedOutput):
|
|
606
|
-
//
|
|
617
|
+
// runs.ts serves it (servedOutput): read whole first, so a held value split across two of its fields withholds it as
|
|
618
|
+
// "[redacted]" (redactedOutputWhole), else each string in it cut of the values the run holds, its shape kept; none
|
|
619
|
+
// while the run's sign-in can't be read back.
|
|
607
620
|
const ownOutput = row.kind === "workflow" ? output : status === "completed" && structured && "value" in structured ? structured.value : null;
|
|
608
|
-
const servedOutput = !unshown && ownOutput !== null && ownOutput !== undefined ?
|
|
621
|
+
const servedOutput = !unshown && ownOutput !== null && ownOutput !== undefined ? redactedOutputWhole(ownOutput, values) : null;
|
|
609
622
|
// A run its cap ended once its cost passed it (spend_cap_reached) keeps the answer it paid for, as main kept it: the
|
|
610
623
|
// response that crossed the cap was answered and billed, so its text is the run's answer, cut as it came.
|
|
611
624
|
// Its answer is the newest answer row, else (a response cut at its length) the newest text it said; never the row's
|
|
@@ -646,6 +659,11 @@ async function viewOfRun(store, runId, deps, run, read) {
|
|
|
646
659
|
const settled = terminal && ended && !run.lookingBack;
|
|
647
660
|
return {
|
|
648
661
|
...(run.cli_learning && !unshown ? { cli_learning: redactedOutput(run.cli_learning, values) } : {}),
|
|
662
|
+
...(run.factory ? { factory: { ...run.factory, controls: {
|
|
663
|
+
stop: run.factory.control === "managed" && row.kind === "agentic" && status === "working" && state === "working",
|
|
664
|
+
cancel: run.factory.control === "managed" && !terminal && !FINAL_STATES.includes(runRow.state),
|
|
665
|
+
approve: run.factory.control === "managed" && !FINAL_STATES.includes(runRow.state) && pending?.kind === "approval",
|
|
666
|
+
} } } : {}),
|
|
649
667
|
...(run.sdk && !unshown ? { sdk: redactedOutput(run.sdk, values) } : {}),
|
|
650
668
|
...(run.native && !unshown ? { native: redactedOutput(run.native, values) } : {}),
|
|
651
669
|
run_id: row.id,
|
|
@@ -719,6 +737,7 @@ export function summaryOfView(view) {
|
|
|
719
737
|
return {
|
|
720
738
|
run_id, agent_id, agent_version, console_url, revision, kind, sha, status, state, title,
|
|
721
739
|
...(view.cli_learning ? { cli_learning: view.cli_learning } : {}),
|
|
740
|
+
...(view.factory ? { factory: view.factory, ...(view.computer ? { computer: view.computer } : {}) } : {}),
|
|
722
741
|
...(view.sdk ? { sdk: view.sdk } : {}),
|
|
723
742
|
...(view.native ? { native: view.native } : {}),
|
|
724
743
|
...(effort ? { effort } : {}),
|
|
@@ -738,11 +757,12 @@ export function summaryOfView(view) {
|
|
|
738
757
|
* and what outside the run it read (LISTING_HELD, LISTING_KEYED). Undefined for an unknown run. */
|
|
739
758
|
export async function listingOverStore(store, runId, deps) {
|
|
740
759
|
const cut = secretsDigest(deps.serverSecrets());
|
|
741
|
-
|
|
760
|
+
// The same read gives what a scoped list shows beside the item (KeptFactory), so that list reads rows alone too.
|
|
761
|
+
const run = await storeRunOf(store, runId, { ...deps, factory: "kept" });
|
|
742
762
|
if (!run)
|
|
743
763
|
return undefined;
|
|
744
764
|
const read = { withheld: false };
|
|
745
|
-
const summary = summaryOfView(await viewOfRun(store, runId, deps, run, read));
|
|
765
|
+
const { factory: activity, computer: _computer, ...summary } = summaryOfView(await viewOfRun(store, runId, deps, run, read));
|
|
746
766
|
const status = String(summary.status);
|
|
747
767
|
const terminal = TERMINAL.has(status);
|
|
748
768
|
const asks = terminal ? [] : [run.browserAsk?.expires_at, run.computerAsk?.expires_at].map((at) => (typeof at === "string" ? Date.parse(at) : Number.NaN)).filter((at) => Number.isFinite(at));
|
|
@@ -755,8 +775,18 @@ export async function listingOverStore(store, runId, deps) {
|
|
|
755
775
|
live: run.live,
|
|
756
776
|
until: expiries.length ? Math.min(...expiries) : null,
|
|
757
777
|
flags,
|
|
778
|
+
factory: { activity, observed: factoryObserved(run.launch) },
|
|
758
779
|
};
|
|
759
780
|
}
|
|
781
|
+
/** What `listing` keeps for the Agent Factory, cut again of the server's secrets as `listedItem` cuts its item when they
|
|
782
|
+
* moved since its build; undefined for a listing built before one was kept, which a scoped list builds again, once. */
|
|
783
|
+
export function keptFactory(listing, serverSecrets) {
|
|
784
|
+
const kept = listing.factory;
|
|
785
|
+
if (!isObject(kept) || !isObject(kept.activity) || !isObject(kept.observed))
|
|
786
|
+
return undefined;
|
|
787
|
+
const { activity, observed } = kept;
|
|
788
|
+
return listing.cut === secretsDigest(serverSecrets) ? { activity, observed } : { activity: redactedOutput(activity, [...serverSecrets]), observed };
|
|
789
|
+
}
|
|
760
790
|
/** Whether `listing` is cut of the server's secrets as they are now. A list builds any other again before it shows it
|
|
761
791
|
* (server.ts runsPage): the run's view cuts a value whole where it holds a secret (a note's name reads [redacted]), which
|
|
762
792
|
* cutting the built item again could not do. */
|
|
@@ -773,8 +803,10 @@ export function listedItem(listing, origin, archivedAt, serverSecrets) {
|
|
|
773
803
|
const item = { ...listing.item, console_url: runLink(origin, String(listing.item.run_id)), archived_at: archivedAt === null ? null : iso(archivedAt) };
|
|
774
804
|
return listing.cut === secretsDigest(serverSecrets) ? item : redactedOutput(item, [...serverSecrets]);
|
|
775
805
|
}
|
|
776
|
-
/** A set of secrets' digest, the same for the same set in any order: what a listing was cut of.
|
|
777
|
-
|
|
806
|
+
/** A set of secrets' digest, the same for the same set in any order: what a listing was cut of. Of the sorted values'
|
|
807
|
+
* JSON, which escapes a lone surrogate and a NUL as written, so no two sets share it: as UTF-8 every lone surrogate is
|
|
808
|
+
* the one replacement character, and values joined by a NUL read as one value that holds it. */
|
|
809
|
+
const secretsDigest = (values) => createHash("sha256").update(JSON.stringify([...new Set(values)].sort())).digest("hex");
|
|
778
810
|
/** A run's facts as its view states them, and none of its words: its kind, revision, agent, status and times, and whether
|
|
779
811
|
* its output is withheld (`unshown`). What a read that serves its own parts (the graph) needs of the run: read off the
|
|
780
812
|
* run as viewOverStore reads it, with nothing of it served, so nothing is redacted here. Undefined for an unknown run. */
|
package/dist/suggestions.d.ts
CHANGED
|
@@ -182,7 +182,7 @@ export type SuggestionsDeps = {
|
|
|
182
182
|
}>;
|
|
183
183
|
/** The agent made here from the imported template `id` at commit `sha`, not archived; undefined when there is none. */
|
|
184
184
|
agentFrom(id: string, sha: string): Promise<string | undefined>;
|
|
185
|
-
/** This server's public URL
|
|
185
|
+
/** This server's public URL: the pull request gives it, with /v2, as AGENTRUN_BASE_URL (the banner's line, print.ts). */
|
|
186
186
|
readonly publicUrl?: string;
|
|
187
187
|
/** Told each time a scan starts, a suggestion is discarded and a suggested agent's pull request opens: the anonymous
|
|
188
188
|
* counts' `used` (telemetry.ts), which hears the event's name and nothing else. It never fails the request. */
|
package/dist/suggestions.js
CHANGED
|
@@ -272,7 +272,7 @@ function header(s, repo, commit, mark) {
|
|
|
272
272
|
`wire it in at ${oneLine(s.integration.call_site.path)}:${s.integration.call_site.line}. ${oneLine(s.integration.call_site.note)}`,
|
|
273
273
|
"",
|
|
274
274
|
"Configure in the app's environment (never commit the key):",
|
|
275
|
-
...[["
|
|
275
|
+
...[["AGENTRUN_BASE_URL", "the AgentRun server's API, like https://agentrun.example.com/v2 (the /v2 may be left out)"], ["AGENTRUN_API_KEY", "an API key of that server (make one in its console: Settings > AgentRun API keys)"], [agentVariable(s.key), "the agent's id there (the pull request that added this file names it)"]].map(([name, what], _, all) => ` ${name.padEnd(Math.max(...all.map(([n]) => n.length)) + 2)}${what}`),
|
|
276
276
|
];
|
|
277
277
|
return lines.map((line) => (line ? `${mark} ${line}` : mark)).join("\n");
|
|
278
278
|
}
|
|
@@ -306,19 +306,23 @@ const ENDED = ["completed", "failed", "cancelled", "input_required", "paused"];
|
|
|
306
306
|
${ts ? "" : `\n/**\n * @param {${input}} input\n * @param {{ signal?: AbortSignal, timeoutMs?: number }} [options]\n * @returns {Promise<${answer}>}\n */`}
|
|
307
307
|
${cjs ? "async function" : "export async function"} ${fn}(input${t(`: ${input}`)}, options${t(": { signal?: AbortSignal; timeoutMs?: number }")} = {})${t(`: Promise<${answer}>`)} {
|
|
308
308
|
const env = (globalThis${t(" as { process?: { env: Record<string, string | undefined> } }")}).process?.env ?? {};
|
|
309
|
-
const
|
|
309
|
+
const address = (env.AGENTRUN_BASE_URL ?? "").replace(/\\/+$/, "");
|
|
310
310
|
const key = env.AGENTRUN_API_KEY;
|
|
311
311
|
const agent = env.${env};
|
|
312
|
-
if (!
|
|
312
|
+
if (!address || !key || !agent) throw new Error("Set AGENTRUN_BASE_URL, AGENTRUN_API_KEY and ${env} to run the ${s.key} agent.");
|
|
313
|
+
// The address with or without /v2, as AgentRun's own clients and CLI take AGENTRUN_BASE_URL.
|
|
314
|
+
const url = (() => { try { return new URL(address); } catch { return undefined; } })();
|
|
315
|
+
if (!url || !/^https?:$/.test(url.protocol)) throw new Error("AGENTRUN_BASE_URL must be an http or https URL, like https://agentrun.example.com/v2.");
|
|
316
|
+
const base = url.pathname.split("/").includes("v2") ? address : \`\${address}/v2\`;
|
|
313
317
|
const headers = { authorization: \`Bearer \${key}\`, "content-type": "application/json" };
|
|
314
|
-
const started = await fetch(\`\${base}/
|
|
318
|
+
const started = await fetch(\`\${base}/agents/\${encodeURIComponent(agent)}/runs\`, { method: "POST", headers, body: JSON.stringify({ input }), signal: options.signal });
|
|
315
319
|
if (!started.ok) throw new Error(\`AgentRun did not start the ${s.key} agent (HTTP \${started.status}): \${await started.text()}\`);
|
|
316
320
|
let run = (await started.json())${t(" as Run")};
|
|
317
321
|
const until = Date.now() + (options.timeoutMs ?? 300_000);
|
|
318
322
|
while (!ENDED.includes(run.status)) {
|
|
319
323
|
if (Date.now() > until) throw new Error(\`The ${s.key} agent's run \${run.run_id} did not end in time.\`);
|
|
320
324
|
await new Promise((resolve) => setTimeout(resolve, 1_500));
|
|
321
|
-
const read = await fetch(\`\${base}/
|
|
325
|
+
const read = await fetch(\`\${base}/runs/\${encodeURIComponent(run.run_id)}\`, { headers, signal: options.signal });
|
|
322
326
|
if (!read.ok) throw new Error(\`AgentRun did not read the run \${run.run_id} (HTTP \${read.status}).\`);
|
|
323
327
|
run = (await read.json())${t(" as Run")};
|
|
324
328
|
}
|
|
@@ -349,6 +353,7 @@ ${s.agent.output.map((f) => `# ${f.name}: ${oneLine(f.description)}`).join("\n
|
|
|
349
353
|
import json
|
|
350
354
|
import os
|
|
351
355
|
import time
|
|
356
|
+
import urllib.parse
|
|
352
357
|
import urllib.request
|
|
353
358
|
from typing import Any, Dict, Optional, TypedDict
|
|
354
359
|
|
|
@@ -370,18 +375,26 @@ def run_${py}(inputs: ${input}, timeout_s: float = 300.0) -> Dict[str, Any]:
|
|
|
370
375
|
missing = [name for name in _REQUIRED if name not in fields]
|
|
371
376
|
if missing:
|
|
372
377
|
raise ValueError(f"run_${py} needs {', '.join(missing)}.")
|
|
373
|
-
|
|
378
|
+
address = os.environ.get("AGENTRUN_BASE_URL", "").rstrip("/")
|
|
374
379
|
key = os.environ.get("AGENTRUN_API_KEY")
|
|
375
380
|
agent = os.environ.get("${env}")
|
|
376
|
-
if not
|
|
377
|
-
raise RuntimeError("Set
|
|
378
|
-
|
|
381
|
+
if not address or not key or not agent:
|
|
382
|
+
raise RuntimeError("Set AGENTRUN_BASE_URL, AGENTRUN_API_KEY and ${env} to run the ${s.key} agent.")
|
|
383
|
+
# The address with or without /v2, as AgentRun's own clients and CLI take AGENTRUN_BASE_URL.
|
|
384
|
+
try:
|
|
385
|
+
url = urllib.parse.urlsplit(address)
|
|
386
|
+
except ValueError:
|
|
387
|
+
url = None
|
|
388
|
+
if url is None or url.scheme not in ("http", "https") or not url.netloc:
|
|
389
|
+
raise RuntimeError("AGENTRUN_BASE_URL must be an http or https URL, like https://agentrun.example.com/v2.")
|
|
390
|
+
base = address if "v2" in url.path.split("/") else f"{address}/v2"
|
|
391
|
+
run = _call("POST", f"{base}/agents/{agent}/runs", key, {"input": fields})
|
|
379
392
|
until = time.monotonic() + timeout_s
|
|
380
393
|
while run.get("status") not in _ENDED:
|
|
381
394
|
if time.monotonic() > until:
|
|
382
395
|
raise TimeoutError(f"The ${s.key} agent's run {run.get('run_id')} did not end in time.")
|
|
383
396
|
time.sleep(1.5)
|
|
384
|
-
run = _call("GET", f"{base}/
|
|
397
|
+
run = _call("GET", f"{base}/runs/{run['run_id']}", key)
|
|
385
398
|
output = (run.get("result") or {}).get("output")
|
|
386
399
|
if run.get("status") != "completed" or not output:
|
|
387
400
|
raise RuntimeError(f"The ${s.key} agent's run {run.get('run_id')} ended {run.get('status')}.")
|
|
@@ -400,11 +413,14 @@ Added by AgentRun's agent scout from a scan of ${repo}${commit ? ` at ${commit.s
|
|
|
400
413
|
|
|
401
414
|
Start a run, then read it until its \`status\` is \`completed\`; the answer is its \`result.output\`.
|
|
402
415
|
|
|
416
|
+
\`AGENTRUN_BASE_URL\` is the AgentRun server's API, ending in \`/v2\`, like \`https://agentrun.example.com/v2\`: the value
|
|
417
|
+
the pull request that added this file gives, and the one the server prints when it starts.
|
|
418
|
+
|
|
403
419
|
\`\`\`sh
|
|
404
|
-
curl -sS -X POST "$
|
|
420
|
+
curl -sS -X POST "$AGENTRUN_BASE_URL/agents/$${env}/runs" \\
|
|
405
421
|
-H "authorization: Bearer $AGENTRUN_API_KEY" -H "content-type: application/json" \\
|
|
406
422
|
-d '${JSON.stringify({ input: example }).replace(/'/g, "'\\''")}'
|
|
407
|
-
curl -sS "$
|
|
423
|
+
curl -sS "$AGENTRUN_BASE_URL/runs/<run_id>" -H "authorization: Bearer $AGENTRUN_API_KEY"
|
|
408
424
|
\`\`\`
|
|
409
425
|
|
|
410
426
|
| Answer field | Type | What it holds |
|
|
@@ -443,7 +459,7 @@ The app's own code is not changed: nothing calls the agent until you wire it in.
|
|
|
443
459
|
|
|
444
460
|
| Variable | Value |
|
|
445
461
|
| --- | --- |
|
|
446
|
-
| \`
|
|
462
|
+
| \`AGENTRUN_BASE_URL\` | ${at.publicUrl ? `\`${at.publicUrl.replace(/\/+$/, "")}/v2\`` : "your AgentRun server's address, ending in `/v2`"} |
|
|
447
463
|
| \`AGENTRUN_API_KEY\` | an API key of that server, made in its console under ${at.publicUrl ? `[Settings → AgentRun API keys](${at.publicUrl.replace(/\/+$/, "")}${API_KEYS_PAGE})` : "Settings → AgentRun API keys"} and shown once: keep it in your secrets, never in the repository |
|
|
448
464
|
| \`${agentVariable(s.key)}\` | \`${at.agentId}\` |
|
|
449
465
|
|
package/dist/template-eval.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ import { type FeedFixture } from "./eval-feed.js";
|
|
|
3
3
|
import { type PreviousFixture } from "./eval-previous.js";
|
|
4
4
|
import type { PreviousHandover } from "./trigger-targets.js";
|
|
5
5
|
import type { MonidFake } from "./runner/monid-run.js";
|
|
6
|
+
import { CALLS_PAGE_ROWS } from "./timeline/index.js";
|
|
7
|
+
/** The rows a calls=whole timeline page holds at most, the page size this eval reads with: learn-bench reads its steps'
|
|
8
|
+
* timelines the same way. */
|
|
9
|
+
export { CALLS_PAGE_ROWS };
|
|
6
10
|
import { type WebFake } from "./web-fake.js";
|
|
7
11
|
import { type Package } from "./templates.js";
|
|
8
12
|
import { type Json } from "./validate.js";
|
|
@@ -11,8 +15,10 @@ export declare const GRADER_INSTRUCTIONS = "You grade one run of an AI agent aga
|
|
|
11
15
|
/** Each grader run's cap, in dollars. */
|
|
12
16
|
export declare const GRADER_CAP_USD = 0.5;
|
|
13
17
|
/** The most characters an llm grader's prompt takes (about 30k tokens, under GRADER_CAP_USD at $15 per million input
|
|
14
|
-
* tokens): past it,
|
|
15
|
-
*
|
|
18
|
+
* tokens): past it, the final files take room first, never so much that the calls' arguments get less than half of it,
|
|
19
|
+
* the tool state's texts left out before a file of the run's own is cut (fitFiles); its calls and a fake MCP server's
|
|
20
|
+
* calls share what is left, each list cut in proportion to its size and the fake's given at least half, the middle of
|
|
21
|
+
* the longest results (or arguments) first, then the middle calls (fitCalls), and a <cuts> note counts it all. The rubric, the task
|
|
16
22
|
* and the answer are never cut: they are what the grader judges, so a prompt can pass the cap by what they hold alone,
|
|
17
23
|
* and then the calls are cut to a note that says so. */
|
|
18
24
|
export declare const GRADER_PROMPT_MAX = 120000;
|
|
@@ -47,7 +53,9 @@ export type Grader = ({
|
|
|
47
53
|
expect: "called" | "not_called";
|
|
48
54
|
count?: number;
|
|
49
55
|
atLeast?: number;
|
|
56
|
+
atMost?: number;
|
|
50
57
|
args?: Json;
|
|
58
|
+
argsFile?: string;
|
|
51
59
|
} | {
|
|
52
60
|
file: string;
|
|
53
61
|
type: "file_exists";
|
|
@@ -159,7 +167,8 @@ export declare function readCases(dir: string, names?: readonly string[]): {
|
|
|
159
167
|
cases: EvalCase[];
|
|
160
168
|
};
|
|
161
169
|
/** A call a run made: from its timeline (`tool`, its gate name, a preview of its input, its `arguments` through the run's
|
|
162
|
-
* redaction,
|
|
170
|
+
* redaction, the head of its `result`, and `refused` when the run refused it before it ran) or, in RunRecord.fakeLog
|
|
171
|
+
* alone, from a fake MCP server's own log (`arguments` whole). */
|
|
163
172
|
export type ToolCall = {
|
|
164
173
|
tool: string;
|
|
165
174
|
name?: string;
|
|
@@ -167,6 +176,7 @@ export type ToolCall = {
|
|
|
167
176
|
status?: string | null;
|
|
168
177
|
result?: string | null;
|
|
169
178
|
arguments?: Json;
|
|
179
|
+
refused?: true;
|
|
170
180
|
};
|
|
171
181
|
/** A file a run left in its work folder, as a grader is told of it: its name (its path under the run's cut, the listing's
|
|
172
182
|
* `name`; absent from a server that doesn't cut its listing's names, when the file is shown by no name, never its path),
|
|
@@ -180,15 +190,28 @@ export type FinalFile = {
|
|
|
180
190
|
export type RunRecord = {
|
|
181
191
|
/** The run's final answer, or "" when it has none. */
|
|
182
192
|
answer: string;
|
|
183
|
-
/** Its tool calls as its timeline shows them, in order. */
|
|
193
|
+
/** Its tool calls as its timeline shows them, in order (callRecordOf). */
|
|
184
194
|
calls: ToolCall[];
|
|
185
|
-
/** The calls
|
|
195
|
+
/** The calls on the fake MCP servers' tools that ran, as its timeline shows them (the faked servers' calls of `calls`
|
|
196
|
+
* not refused and with a result, mcpCallsOf, each argument through the run's redaction), in order: what an llm grader
|
|
197
|
+
* and the report are shown. */
|
|
186
198
|
mcpCalls: ToolCall[];
|
|
199
|
+
/** Each fake MCP server's own log of the calls that reached it, their arguments whole: read only to match a tool_used
|
|
200
|
+
* grader's `args` on a faked tool, never shown to a grader nor put in the report (a value the run's cut holds, handed
|
|
201
|
+
* to a fake tool, is whole here). */
|
|
202
|
+
fakeLog: ToolCall[];
|
|
187
203
|
/** The paths of its files, from its work folder. */
|
|
188
204
|
files: string[];
|
|
189
205
|
/** Its work folder's files as it left them, for its llm graders (finalFilesOf): each text file with its whole `text`,
|
|
190
206
|
* any other (media, a binary, one past what was read) with its size alone. */
|
|
191
207
|
finalFiles?: FinalFile[];
|
|
208
|
+
/** Each file a tool_used grader's args_file names, by its path: its whole text under the run's cut, or why it has none
|
|
209
|
+
* (argsFilesOf). */
|
|
210
|
+
argsFiles?: Record<string, {
|
|
211
|
+
text: string;
|
|
212
|
+
} | {
|
|
213
|
+
why: string;
|
|
214
|
+
}>;
|
|
192
215
|
/** The clock it ran on, its case's `now`; absent, the real one. */
|
|
193
216
|
now?: string;
|
|
194
217
|
/** Its fake mailbox after it, for a case with `email` (eval-mailbox.ts). */
|
|
@@ -210,6 +233,15 @@ export declare function searched(search: FakeSearch, query: string): string;
|
|
|
210
233
|
export declare function gradeDeterministic(grader: Exclude<Grader, {
|
|
211
234
|
type: "llm";
|
|
212
235
|
}>, run: RunRecord, faked: readonly string[]): Verdict;
|
|
236
|
+
/** A tool_used grader's verdict on its args_file: each listed argument object carried (carries) by its own call of
|
|
237
|
+
* `calls` (the grader's tools, its `args` kept), no call standing for two entries, and as many calls as the list has
|
|
238
|
+
* entries (or `count`). The entries are given calls by a maximum matching, so one call that carries two entries counts
|
|
239
|
+
* for one of them, whatever order they are listed in. */
|
|
240
|
+
export declare function argsFileVerdict(path: string, file: {
|
|
241
|
+
text: string;
|
|
242
|
+
} | {
|
|
243
|
+
why: string;
|
|
244
|
+
} | undefined, calls: readonly ToolCall[], said: string, count?: number): Verdict;
|
|
213
245
|
/** The output check of a completed run of a package that declares `output`, beside its case's graders: the server's own
|
|
214
246
|
* verdict (`result.output_error`, why the answer still missed the schema after the runner's one retry), so no case
|
|
215
247
|
* carries a grader for it. Undefined for a package with no output schema. */
|
|
@@ -220,6 +252,12 @@ export declare function outputVerdict(pkg: Package, result: unknown): GraderResu
|
|
|
220
252
|
export declare function graderInput(grader: Extract<Grader, {
|
|
221
253
|
type: "llm";
|
|
222
254
|
}>, input: string, run: RunRecord, max?: number): string;
|
|
255
|
+
/** Each call's arguments (their JSON, none for a call with none) in at most `room` characters in all: undefined when they
|
|
256
|
+
* fit whole; else each past a length L keeps its first two thirds and last third of L with its middle cut and marked
|
|
257
|
+
* (middle), L the longest that fits, so the longest are cut first. A list no longer than L and a marker (40 characters)
|
|
258
|
+
* stays whole, so a cut never takes a short list's text for a marker as long; when even L = 0 passes the room, the
|
|
259
|
+
* short lists stay whole, the long ones show their marker alone, and fitCalls drops calls as it does. */
|
|
260
|
+
export declare function fitArgs(args: readonly (string | undefined)[], room: number): (string | undefined)[] | undefined;
|
|
223
261
|
/** A grader's calls, one line each (`head`, then `: <result>`), in at most `room` characters: whole when they fit; else
|
|
224
262
|
* each result past a length L keeps its first two thirds and last third of L with its middle cut and marked, L the
|
|
225
263
|
* longest that fits, a web call's (`tool`, web-calls.ts) every url whole and each of its snippets or its page's text cut
|
|
@@ -238,6 +276,9 @@ export declare function fitCalls(lines: readonly {
|
|
|
238
276
|
* its size on a last line, cut to the room when even that passes it. Each file is named by its cut name alone: one with
|
|
239
277
|
* none is in a block with no path, or counted. */
|
|
240
278
|
export declare function fitFiles(files: readonly FinalFile[], room: number): string;
|
|
279
|
+
/** Whether a final file is a tool's state, not the run's work: under a folder whose name starts with "." (the package's
|
|
280
|
+
* own skills copied under `.agents/skills`, a tool's cache such as `film/.hyperframes`). A file with no name is not. */
|
|
281
|
+
export declare function toolState(name: string | undefined): boolean;
|
|
241
282
|
/** A grader run's answer read as its verdict: its json block's (jsonBlockOf), else the last flat JSON object's, {pass, reason}. */
|
|
242
283
|
export declare function verdictOf(answer: string): {
|
|
243
284
|
pass: boolean;
|
|
@@ -250,7 +291,8 @@ export type Fake = {
|
|
|
250
291
|
close: () => Promise<void>;
|
|
251
292
|
};
|
|
252
293
|
/** A fake MCP server for `fixture` on loopback, Streamable HTTP through the official SDK, one stateless server per
|
|
253
|
-
* request; every tool call is recorded (its gate name and arguments) and answered from the fixture
|
|
294
|
+
* request; every tool call is recorded (its gate name and arguments) and answered from the fixture as it is written, so
|
|
295
|
+
* the agent and a script it runs read the answer a real server of that shape gives (a JSON text parses as JSON). */
|
|
254
296
|
export declare function startFake(name: string, fixture: McpFixture): Promise<Fake>;
|
|
255
297
|
type Answered = {
|
|
256
298
|
status: number;
|
|
@@ -290,11 +332,23 @@ export declare function waitRun(api: Api, runId: string, deadline: number, signa
|
|
|
290
332
|
waiting?: string;
|
|
291
333
|
why?: string;
|
|
292
334
|
}>;
|
|
335
|
+
/** The calls on the faked MCP servers `faked` that ran, as the run's timeline shows them (`calls`, from callsOf: each
|
|
336
|
+
* argument through the run's redaction): each call on a faked server's tool the run did not refuse before it ran and
|
|
337
|
+
* whose result row the timeline holds. A call refused (a deny, a cap, an approval never given) never reached the fake,
|
|
338
|
+
* and one with no result (cut off) has no outcome to show. One that failed on its way to the fake shows, with its
|
|
339
|
+
* error as its result, never as a success; a tool_used grader counts only what the fake logged (fakeLog). What an llm
|
|
340
|
+
* grader's <mcp-calls> and the report's `mcp_calls` show, never the fake's own log. */
|
|
341
|
+
export declare function mcpCallsOf(calls: readonly ToolCall[], faked: readonly string[]): ToolCall[];
|
|
342
|
+
/** A run's calls for its graders and its report, from its timeline's (callsOf) and the fakes it ran against: its calls,
|
|
343
|
+
* its fake MCP calls (mcpCallsOf) and the fakes' own log whole. The template eval's runs and learn-bench's steps both
|
|
344
|
+
* read them here. */
|
|
345
|
+
export declare function callRecordOf(calls: readonly ToolCall[], faked: readonly string[], fakes: readonly Pick<Fake, "calls">[]): Pick<RunRecord, "calls" | "mcpCalls" | "fakeLog">;
|
|
293
346
|
/** A run's tool calls, each named as a grader names it: the gate's own rule (RunGate.enter), its settings key, but a
|
|
294
347
|
* shell tool held to bash's setting (bash_background, bash_output, ...) keeps its own name, so its grader sees it. A
|
|
295
348
|
* call on a saved server `toolkits` names ({<saved server>: <the package's toolkit>}, a need an owner's server filled
|
|
296
349
|
* under another name) is named on the package's toolkit, as the package's graders name it. Each with its arguments and
|
|
297
|
-
* its output as the rows of a calls=whole read carry them (tool_input, tool_result_text), else its previews
|
|
350
|
+
* its output as the rows of a calls=whole read carry them (tool_input, tool_result_text), else its previews, and
|
|
351
|
+
* `refused` when its result row says the run refused it before it ran (a deny, a pin, an approval never given). */
|
|
298
352
|
export declare function callsOf(rows: readonly Json[], harness: string, toolkits?: Readonly<Record<string, string>>): ToolCall[];
|
|
299
353
|
/** A file of a run's work folder as its listing names it: its path (for this eval's own reads, never a grader's prompt),
|
|
300
354
|
* its name under the run's cut (the listing's `name`, absent from a server that doesn't cut it), its size, its type
|
|
@@ -313,13 +367,23 @@ export declare const FILE_READ_TIMEOUT_MS = 10000;
|
|
|
313
367
|
export declare const FILE_READS_TIMEOUT_MS = 30000;
|
|
314
368
|
/** A run's final files for its llm graders: each text file's whole text, read smallest first while the texts read stay
|
|
315
369
|
* within GRADER_PROMPT_MAX UTF-8 bytes in all (one grader input holds that many characters, and a character is at least
|
|
316
|
-
* a byte), every other file by its size alone. Each is read under the run's own cut, on the server that holds its
|
|
370
|
+
* a byte), the run's own files before any of tool state (toolState), every other file by its size alone. Each is read under the run's own cut, on the server that holds its
|
|
317
371
|
* secrets (`?cut=run`, run-reads-over-store.ts cutRunFile): every value its timeline's calls are cut of, and every secret
|
|
318
372
|
* shape, is "[redacted]" in the text a grader sees. An answer without the cut's mark (`x-agentrun-cut: run`: a server
|
|
319
373
|
* that doesn't know the cut and would serve the raw bytes) leaves the text out. A read that fails, is refused (403, 413,
|
|
320
374
|
* 415), takes longer than `readTimeoutMs`, or would pass the budget leaves that file's text out, never the grade, and
|
|
321
375
|
* the files after it are still read; past FILE_READS_TIMEOUT_MS in all, the rest are left out. In the listing's order. */
|
|
322
376
|
export declare function finalFilesOf(api: Api, runId: string, listed: readonly Listed[], signal?: AbortSignal, readTimeoutMs?: number): Promise<FinalFile[]>;
|
|
377
|
+
/** The most bytes of an args_file a tool_used grader reads: the most a cut read answers (run-files.ts). */
|
|
378
|
+
export declare const ARGS_FILE_MAX: number;
|
|
379
|
+
/** Each file a tool_used grader's args_file names, read whole under the run's cut (as finalFilesOf reads a file: an
|
|
380
|
+
* answer without the cut's mark is refused), by its path: its text, or why there is none (absent, refused, past
|
|
381
|
+
* ARGS_FILE_MAX bytes, a read that failed or took past `readTimeoutMs`). */
|
|
382
|
+
export declare function argsFilesOf(api: Api, runId: string, paths: readonly string[], signal?: AbortSignal, readTimeoutMs?: number): Promise<Record<string, {
|
|
383
|
+
text: string;
|
|
384
|
+
} | {
|
|
385
|
+
why: string;
|
|
386
|
+
}>>;
|
|
323
387
|
/** How long a run's metrics read may take before the run is reported without them. */
|
|
324
388
|
export declare const METRICS_TIMEOUT_MS = 10000;
|
|
325
389
|
/** The metrics of the one run `agentId` made (RunMetrics), from GET /stats?agent=; null when the server kept none (the run
|
|
@@ -460,4 +524,3 @@ export declare const CANCEL_WAIT_MS = 30000;
|
|
|
460
524
|
* any case failed, however many passed beside it. (2: nothing ran, and 130: stopped, are the CLI's own.) */
|
|
461
525
|
export declare const exitCodeOf: (report: Pick<Report, "cases">) => 0 | 1;
|
|
462
526
|
export declare function markdownReport(report: Report): string;
|
|
463
|
-
export {};
|