@parcha/agentrun-serve 0.1.0-beta.33 → 0.1.0-beta.35
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 +368 -0
- package/README.md +341 -208
- package/dist/adapters.d.ts +3 -4
- package/dist/adapters.js +18 -15
- package/dist/agent-rows.d.ts +99 -0
- package/dist/agent-rows.js +1 -0
- package/dist/agents-store.d.ts +6 -2
- package/dist/agents-store.js +75 -25
- package/dist/agents.d.ts +9 -125
- package/dist/agents.js +15 -305
- package/dist/answer-json.d.ts +23 -0
- package/dist/answer-json.js +58 -0
- package/dist/api-only.d.ts +1 -1
- package/dist/api-only.js +2 -2
- package/dist/archil-settings.d.ts +11 -1
- package/dist/archil-settings.js +10 -0
- package/dist/bash-read-only.d.ts +35 -0
- package/dist/bash-read-only.js +778 -0
- package/dist/box-settings.d.ts +3 -23
- package/dist/box-settings.js +7 -51
- package/dist/boxes.d.ts +17 -0
- package/dist/boxes.js +27 -20
- package/dist/browser-commands.d.ts +5 -2
- package/dist/browser-commands.js +4 -4
- package/dist/browser-computer.d.ts +5 -0
- package/dist/browser-computer.js +21 -0
- package/dist/browser-cost.d.ts +9 -6
- package/dist/browser-cost.js +95 -51
- package/dist/browser-live.d.ts +7 -20
- package/dist/browser-live.js +15 -93
- package/dist/browser-person.d.ts +18 -51
- package/dist/browser-person.js +94 -277
- package/dist/budget.d.ts +0 -5
- package/dist/budget.js +0 -5
- package/dist/cap.d.ts +14 -8
- package/dist/cap.js +19 -9
- package/dist/cli.js +71 -18
- package/dist/closed-pipes.d.ts +2 -0
- package/dist/closed-pipes.js +13 -0
- package/dist/computer-commands.d.ts +2 -0
- package/dist/computer-commands.js +2 -0
- package/dist/computer-keys.d.ts +20 -10
- package/dist/computer-keys.js +36 -54
- package/dist/computer-setting.d.ts +20 -3
- package/dist/computer-setting.js +58 -10
- package/dist/computers.d.ts +35 -2
- package/dist/computers.js +72 -11
- package/dist/confine.d.ts +120 -0
- package/dist/confine.js +436 -0
- package/dist/console/assets/index-B7NKTU8E.css +1 -0
- package/dist/console/assets/index-CXZMgJE7.js +550 -0
- package/dist/console/index.html +2 -2
- package/dist/content-filter.d.ts +7 -0
- package/dist/content-filter.js +23 -0
- package/dist/decision-cap.d.ts +7 -29
- package/dist/decision-cap.js +3 -94
- package/dist/decision-rows.d.ts +1 -1
- package/dist/decision-rows.js +1 -1
- package/dist/docker-daemon.d.ts +31 -0
- package/dist/docker-daemon.js +56 -0
- package/dist/effort-guidance.js +4 -3
- package/dist/environment.d.ts +0 -3
- package/dist/environment.js +3 -5
- package/dist/errors.d.ts +1 -2
- package/dist/errors.js +9 -9
- package/dist/explain.js +3 -1
- package/dist/filed-answer.d.ts +32 -0
- package/dist/filed-answer.js +160 -0
- package/dist/files.d.ts +1 -3
- package/dist/files.js +2 -4
- package/dist/github-connection.d.ts +1 -1
- package/dist/github-connection.js +25 -7
- package/dist/github-faux.d.ts +26 -0
- package/dist/github-faux.js +76 -0
- package/dist/github.d.ts +6 -2
- package/dist/github.js +5 -3
- package/dist/graph-served.d.ts +5 -3
- package/dist/graph-served.js +14 -6
- package/dist/graph-view.d.ts +3 -5
- package/dist/graph-view.js +9 -16
- package/dist/handed-values.d.ts +9 -0
- package/dist/handed-values.js +26 -0
- package/dist/harness-install.d.ts +1 -7
- package/dist/harness-install.js +1 -18
- package/dist/harness-opencode/adapter.d.ts +7 -0
- package/dist/harness-opencode/adapter.js +23 -6
- package/dist/harness-opencode/harness.js +0 -1
- package/dist/harness-opencode/host/policy.js +2 -2
- package/dist/harness-opencode/index.d.ts +1 -1
- package/dist/harness-opencode/index.js +1 -1
- package/dist/harness-opencode/verify.d.ts +17 -0
- package/dist/harness-opencode/verify.js +30 -10
- package/dist/harness-table.js +6 -1
- package/dist/heard.js +1 -1
- package/dist/held-fd.d.ts +5 -0
- package/dist/held-fd.js +14 -0
- package/dist/host-calls.d.ts +20 -0
- package/dist/host-calls.js +12 -0
- package/dist/host-tools.d.ts +4 -21
- package/dist/host-tools.js +4 -61
- package/dist/host.d.ts +2 -4
- package/dist/host.js +2 -7
- package/dist/import-summary.d.ts +1 -5
- package/dist/import-summary.js +0 -21
- package/dist/import.d.ts +6 -6
- package/dist/import.js +14 -15
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/key-refusal.d.ts +5 -1
- package/dist/key-refusal.js +19 -4
- package/dist/learn/check.d.ts +8 -2
- package/dist/learn/check.js +85 -31
- package/dist/learn/folder.d.ts +11 -4
- package/dist/learn/folder.js +17 -19
- package/dist/learn/grade.d.ts +18 -1
- package/dist/learn/grade.js +108 -14
- package/dist/learn/index.d.ts +5 -5
- package/dist/learn/index.js +5 -5
- package/dist/learn/learning.sh +1 -14
- package/dist/learn/notes.d.ts +14 -3
- package/dist/learn/notes.js +16 -6
- package/dist/learn/reflect.d.ts +31 -2
- package/dist/learn/reflect.js +83 -6
- package/dist/learn/relevance.d.ts +24 -0
- package/dist/learn/relevance.js +91 -0
- package/dist/learn/secrets.d.ts +7 -1
- package/dist/learn/secrets.js +86 -19
- package/dist/learn/skills.d.ts +159 -18
- package/dist/learn/skills.js +644 -64
- package/dist/learned-nodes.d.ts +14 -0
- package/dist/learned-nodes.js +8 -0
- package/dist/learned-workflow.d.ts +41 -6
- package/dist/learned-workflow.js +153 -18
- package/dist/learning-routes.d.ts +49 -4
- package/dist/learning-routes.js +113 -31
- package/dist/learning-run.d.ts +16 -31
- package/dist/learning-run.js +31 -38
- package/dist/learning-words.d.ts +12 -5
- package/dist/learning-words.js +18 -9
- package/dist/learning.d.ts +91 -97
- package/dist/learning.js +176 -320
- package/dist/live/stream.js +1 -1
- package/dist/live/translate.js +12 -2
- package/dist/llm.d.ts +4 -1
- package/dist/llm.js +4 -2
- package/dist/local-models.d.ts +11 -5
- package/dist/local-models.js +13 -8
- package/dist/mcp-gateway.d.ts +17 -49
- package/dist/mcp-gateway.js +55 -136
- package/dist/mcp-oauth.d.ts +10 -14
- package/dist/mcp-oauth.js +14 -32
- package/dist/mcp-probe.d.ts +0 -7
- package/dist/mcp-probe.js +4 -10
- package/dist/mcp-servers-store.d.ts +18 -18
- package/dist/mcp-servers-store.js +12 -14
- package/dist/mcp-store.js +3 -4
- package/dist/mcp.js +4 -3
- package/dist/model.d.ts +9 -7
- package/dist/model.js +51 -27
- package/dist/monid.d.ts +0 -2
- package/dist/monid.js +3 -6
- package/dist/openapi.d.ts +8 -1
- package/dist/openapi.js +156 -58
- package/dist/page.d.ts +1 -3
- package/dist/page.js +6 -18
- package/dist/paid-calls.d.ts +21 -27
- package/dist/paid-calls.js +26 -61
- package/dist/pause.d.ts +2 -19
- package/dist/pause.js +5 -74
- package/dist/port-models.d.ts +10 -3
- package/dist/port-models.js +26 -6
- package/dist/propose.d.ts +2 -0
- package/dist/propose.js +80 -45
- package/dist/push-handler.d.ts +1 -1
- package/dist/reflect-range.d.ts +25 -0
- package/dist/reflect-range.js +30 -0
- package/dist/refusal-words.d.ts +5 -1
- package/dist/refusal-words.js +5 -1
- package/dist/rows.d.ts +1 -1
- package/dist/run-cut.d.ts +0 -6
- package/dist/run-cut.js +0 -6
- package/dist/run-db.d.ts +2 -11
- package/dist/run-db.js +2 -37
- package/dist/run-launch.d.ts +21 -2
- package/dist/run-launch.js +14 -5
- package/dist/run-learning-served.d.ts +21 -4
- package/dist/run-learning-served.js +23 -13
- package/dist/run-reads-over-store.d.ts +5 -3
- package/dist/run-reads-over-store.js +25 -14
- package/dist/run-secrets.d.ts +1 -1
- package/dist/run-timeline-served.d.ts +5 -1
- package/dist/run-timeline-served.js +27 -6
- package/dist/run-view.d.ts +37 -22
- package/dist/run-view.js +85 -38
- package/dist/runnable.d.ts +21 -10
- package/dist/runnable.js +35 -12
- package/dist/runner/adapter-loop.d.ts +36 -5
- package/dist/runner/adapter-loop.js +663 -69
- package/dist/runner/adapter-run-spec.d.ts +42 -8
- package/dist/runner/adapter-run-spec.js +186 -52
- package/dist/runner/adapters/index.js +11 -1
- package/dist/runner/adapters/pi.d.ts +40 -2
- package/dist/runner/adapters/pi.js +110 -27
- package/dist/runner/beside.d.ts +38 -3
- package/dist/runner/beside.js +54 -5
- package/dist/runner/claim-secrets.d.ts +16 -1
- package/dist/runner/claim-secrets.js +62 -14
- package/dist/runner/cli-run-spec.d.ts +5 -0
- package/dist/runner/cli-run-spec.js +159 -41
- package/dist/runner/commands.js +1 -1
- package/dist/runner/computer-journal.d.ts +15 -2
- package/dist/runner/computer-journal.js +41 -5
- package/dist/runner/conformance/harness.d.ts +1 -0
- package/dist/runner/conformance/harness.js +123 -13
- package/dist/runner/conformance/subject.d.ts +4 -1
- package/dist/runner/dispatch.d.ts +8 -1
- package/dist/runner/dispatch.js +81 -7
- package/dist/runner/end-of-run.d.ts +8 -2
- package/dist/runner/end-of-run.js +10 -4
- package/dist/runner/github-app.d.ts +7 -2
- package/dist/runner/github-app.js +47 -16
- package/dist/runner/harness-loops.d.ts +15 -2
- package/dist/runner/harness-loops.js +38 -2
- package/dist/runner/journal-kinds.d.ts +60 -6
- package/dist/runner/journal-kinds.js +43 -5
- package/dist/runner/journal-reader.d.ts +1 -1
- package/dist/runner/journal-reader.js +2 -2
- package/dist/runner/learning-ask.d.ts +4 -0
- package/dist/runner/learning-ask.js +15 -1
- package/dist/runner/learning-end.d.ts +18 -3
- package/dist/runner/learning-end.js +194 -20
- package/dist/runner/learning-loop.d.ts +7 -0
- package/dist/runner/learning-loop.js +36 -8
- package/dist/runner/learning-seed.d.ts +6 -0
- package/dist/runner/learning-seed.js +6 -0
- package/dist/runner/loop-contract.d.ts +4 -0
- package/dist/runner/main.d.ts +61 -9
- package/dist/runner/main.js +144 -20
- package/dist/runner/mcp-claim.d.ts +3 -0
- package/dist/runner/mcp-claim.js +7 -3
- package/dist/runner/mcp-github.d.ts +11 -2
- package/dist/runner/mcp-github.js +55 -4
- package/dist/runner/mcp-run.d.ts +2 -0
- package/dist/runner/mcp-run.js +16 -5
- package/dist/runner/memory-claim.d.ts +9 -0
- package/dist/runner/memory-claim.js +25 -0
- package/dist/runner/metrics.d.ts +46 -1
- package/dist/runner/metrics.js +156 -1
- package/dist/runner/model-route.d.ts +16 -0
- package/dist/runner/model-route.js +134 -10
- package/dist/runner/reflect-hook.d.ts +12 -1
- package/dist/runner/reflect-hook.js +33 -3
- package/dist/runner/runner.d.ts +20 -0
- package/dist/runner/runner.js +146 -18
- package/dist/runner/spec-holds.d.ts +7 -2
- package/dist/runner/spec-holds.js +4 -3
- package/dist/runner/store-port.d.ts +1 -1
- package/dist/runner/store-secrets.d.ts +3 -3
- package/dist/runner/store-secrets.js +8 -12
- package/dist/runner/text-tools.d.ts +44 -0
- package/dist/runner/text-tools.js +237 -0
- package/dist/runner/workflow-host.d.ts +7 -2
- package/dist/runner/workflow-host.js +3 -1
- package/dist/runner/workflow-loop.d.ts +10 -1
- package/dist/runner/workflow-loop.js +14 -6
- package/dist/runner/workflow-spec.d.ts +21 -0
- package/dist/runner/workflow-spec.js +217 -93
- package/dist/runs-over-store.d.ts +14 -3
- package/dist/runs-over-store.js +100 -23
- package/dist/seal-key.d.ts +0 -2
- package/dist/seal-key.js +5 -45
- package/dist/sealed-settings-store.d.ts +19 -4
- package/dist/sealed-settings-store.js +9 -9
- package/dist/sealing.d.ts +4 -0
- package/dist/sealing.js +20 -0
- package/dist/secret-cut.d.ts +1 -1
- package/dist/secret-cut.js +1 -1
- package/dist/secret-name.d.ts +9 -0
- package/dist/secret-name.js +15 -0
- package/dist/secret-writes.d.ts +0 -1
- package/dist/secret-writes.js +0 -1
- package/dist/server-fs.d.ts +4 -0
- package/dist/server-fs.js +8 -2
- package/dist/server-lock.d.ts +0 -24
- package/dist/server-lock.js +5 -85
- package/dist/server-secrets-store.d.ts +4 -4
- package/dist/server-secrets-store.js +9 -31
- package/dist/server-secrets.d.ts +4 -9
- package/dist/server-secrets.js +12 -36
- package/dist/server.d.ts +37 -56
- package/dist/server.js +322 -134
- package/dist/sign-ins-store.d.ts +34 -36
- package/dist/sign-ins-store.js +27 -38
- package/dist/sign-ins.d.ts +2 -119
- package/dist/sign-ins.js +5 -311
- package/dist/standard-webhooks.d.ts +1 -1
- package/dist/standard-webhooks.js +1 -1
- package/dist/stats.d.ts +3 -2
- package/dist/stats.js +1 -1
- package/dist/stop-signals.d.ts +4 -2
- package/dist/stop-signals.js +5 -3
- package/dist/store/agent-body.d.ts +12 -2
- package/dist/store/agent-body.js +22 -4
- package/dist/store/deadline.d.ts +18 -0
- package/dist/store/deadline.js +45 -0
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +2 -2
- package/dist/store/open.d.ts +6 -3
- package/dist/store/open.js +2 -2
- package/dist/store/postgres/connection.d.ts +22 -2
- package/dist/store/postgres/connection.js +211 -41
- package/dist/store/postgres/migrate.d.ts +4 -0
- package/dist/store/postgres/migrate.js +9 -2
- package/dist/store/postgres/migrations/0003_commands_one_answer.check.sql +19 -0
- package/dist/store/postgres/migrations/0003_commands_one_answer.sql +13 -0
- package/dist/store/postgres/store.d.ts +9 -2
- package/dist/store/postgres/store.js +9 -0
- package/dist/store/schema.js +1 -1
- package/dist/store/seal.js +2 -2
- package/dist/store/sqlite/connection.js +14 -5
- package/dist/store/sqlite/run-patch.d.ts +3 -0
- package/dist/store/sqlite/run-patch.js +3 -0
- package/dist/store/sqlite/store.js +41 -12
- package/dist/store/store.d.ts +35 -6
- package/dist/store/store.js +12 -2
- package/dist/store-reads/cap.d.ts +1 -1
- package/dist/store-reads/cap.js +22 -4
- package/dist/store-reads/journal.d.ts +9 -6
- package/dist/store-reads/journal.js +129 -18
- package/dist/store-reads/learning.d.ts +82 -8
- package/dist/store-reads/learning.js +184 -11
- package/dist/store-reads/workflow.d.ts +1 -1
- package/dist/store-reads/workflow.js +1 -1
- package/dist/store-view.d.ts +19 -1
- package/dist/store-view.js +95 -27
- package/dist/template-eval.d.ts +60 -4
- package/dist/template-eval.js +120 -54
- package/dist/templates.d.ts +33 -14
- package/dist/templates.js +82 -46
- package/dist/timeline/group.d.ts +33 -0
- package/dist/timeline/group.js +77 -0
- package/dist/timeline/index.d.ts +7 -0
- package/dist/timeline/index.js +7 -0
- package/dist/timeline/labels.d.ts +79 -0
- package/dist/timeline/labels.js +150 -0
- package/dist/timeline/origin.d.ts +56 -0
- package/dist/timeline/origin.js +92 -0
- package/dist/timeline/render-text.d.ts +11 -0
- package/dist/timeline/render-text.js +62 -0
- package/dist/timeline/timeline.d.ts +282 -0
- package/dist/timeline/timeline.js +1308 -0
- package/dist/timeline/util.d.ts +17 -0
- package/dist/timeline/util.js +49 -0
- package/dist/tool-budget.d.ts +18 -0
- package/dist/tool-budget.js +50 -0
- package/dist/tool-gate.d.ts +47 -218
- package/dist/tool-gate.js +87 -545
- package/dist/tool-keys-store.d.ts +11 -12
- package/dist/tool-keys-store.js +24 -31
- package/dist/tool-keys.d.ts +5 -101
- package/dist/tool-keys.js +8 -267
- package/dist/tool-plane.d.ts +23 -52
- package/dist/tool-plane.js +23 -81
- package/dist/tool-settings-store.d.ts +1 -2
- package/dist/tool-settings-store.js +5 -8
- package/dist/tools.d.ts +67 -25
- package/dist/tools.js +170 -119
- package/dist/trigger-adapter.d.ts +2 -2
- package/dist/trigger-targets.d.ts +13 -1
- package/dist/trigger-targets.js +31 -1
- package/dist/triggers.d.ts +2 -2
- package/dist/triggers.js +3 -3
- package/dist/turn-end.d.ts +1 -1
- package/dist/turn-end.js +1 -1
- package/dist/turns.d.ts +0 -6
- package/dist/turns.js +0 -19
- package/dist/uploads.d.ts +28 -5
- package/dist/uploads.js +83 -10
- package/dist/usage.d.ts +1 -49
- package/dist/usage.js +3 -84
- package/dist/validate.d.ts +4 -0
- package/dist/validate.js +33 -14
- package/dist/webhooks.d.ts +102 -76
- package/dist/webhooks.js +266 -233
- package/dist/workflow-run.d.ts +114 -0
- package/dist/workflow-run.js +144 -0
- package/dist/workspace/archil-claim.d.ts +2 -2
- package/dist/workspace/archil-claim.js +4 -3
- package/dist/workspace/archil-disk.d.ts +10 -1
- package/dist/workspace/archil-disk.js +4 -0
- package/dist/workspace/archil-exec.d.ts +12 -2
- package/dist/workspace/archil-exec.js +16 -0
- package/dist/workspace/archil.d.ts +2 -2
- package/dist/workspace/archil.js +25 -5
- package/dist/workspace/attach.js +2 -0
- package/dist/workspace/beneath.d.ts +19 -0
- package/dist/workspace/beneath.js +106 -0
- package/dist/workspace/computer-deps.d.ts +26 -9
- package/dist/workspace/computer-deps.js +144 -43
- package/dist/workspace/computer-for-claim.d.ts +17 -14
- package/dist/workspace/computer-for-claim.js +99 -26
- package/dist/workspace/computer-hold.d.ts +6 -1
- package/dist/workspace/computer-hold.js +6 -1
- package/dist/workspace/computer-janitor.d.ts +47 -0
- package/dist/workspace/computer-janitor.js +182 -0
- package/dist/workspace/computer-ledger.d.ts +1 -8
- package/dist/workspace/computer-ledger.js +0 -3
- package/dist/workspace/computer-providers.d.ts +5 -3
- package/dist/workspace/computer-providers.js +11 -9
- package/dist/workspace/grep-worker.d.ts +5 -0
- package/dist/workspace/grep-worker.js +9 -6
- package/dist/workspace/hands.d.ts +5 -2
- package/dist/workspace/hands.js +4 -3
- package/dist/workspace/index.d.ts +6 -5
- package/dist/workspace/index.js +4 -4
- package/dist/workspace/local.d.ts +14 -2
- package/dist/workspace/local.js +170 -43
- package/dist/workspace/paths.js +3 -2
- package/dist/workspace/pi-env.d.ts +4 -0
- package/dist/workspace/pi-env.js +3 -2
- package/dist/workspace/resolve-computer.d.ts +55 -10
- package/dist/workspace/resolve-computer.js +66 -14
- package/dist/workspace/run-tools.d.ts +15 -31
- package/dist/workspace/run-tools.js +19 -30
- package/dist/workspace/workspace.d.ts +5 -0
- package/dist/workspace-paths.d.ts +0 -17
- package/dist/workspace-paths.js +1 -41
- package/dist/workspace.d.ts +0 -17
- package/dist/workspace.js +4 -110
- package/package.json +14 -14
- package/skills/agentrun-serve/SKILL.md +1 -1
- package/templates/README.md +11 -5
- package/templates/code-review/evals/mentions-defused/case.yaml +15 -0
- package/templates/code-review/evals/mentions-defused/fixtures/github-mcp.json +254 -0
- package/templates/code-review/evals/mentions-defused/graders/no-pings.md +16 -0
- package/templates/code-review/evals/mentions-defused/graders/posted-a-review.md +5 -0
- package/templates/code-review/evals/mentions-defused/graders/schema.md +5 -0
- package/templates/code-review/evals/mentions-defused/prompt.md +10 -0
- package/templates/kyb/evals/clean-public-company/graders/no-opensanctions.md +5 -0
- package/templates/kyb/evals/opensanctions-on/case.yaml +5 -0
- package/templates/kyb/evals/opensanctions-on/graders/licence-and-evidence.md +18 -0
- package/templates/kyb/evals/opensanctions-on/graders/schema.md +5 -0
- package/templates/kyb/evals/opensanctions-on/prompt.md +11 -0
- package/templates/market-monitor/agent.md +2 -2
- package/templates/market-monitor/skills/monitor/SKILL.md +6 -4
- package/templates/release-notes/agent.md +11 -0
- package/dist/bound-files.d.ts +0 -4
- package/dist/bound-files.js +0 -164
- package/dist/coding-tools.d.ts +0 -47
- package/dist/coding-tools.js +0 -189
- package/dist/computer-adb.d.ts +0 -12
- package/dist/computer-adb.js +0 -14
- package/dist/console/assets/index-Dn0ngwG9.js +0 -535
- package/dist/console/assets/index-DvW6Aled.css +0 -1
- package/dist/grade.d.ts +0 -63
- package/dist/grade.js +0 -150
- package/dist/mcp-servers.d.ts +0 -269
- package/dist/mcp-servers.js +0 -456
- package/dist/packs.d.ts +0 -71
- package/dist/packs.js +0 -180
- package/dist/sealed-settings.d.ts +0 -60
- package/dist/sealed-settings.js +0 -171
- package/dist/sessions.d.ts +0 -6
- package/dist/sessions.js +0 -109
- package/dist/workspace/computer-serves.d.ts +0 -12
- package/dist/workspace/computer-serves.js +0 -15
package/dist/console/index.html
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<meta name="color-scheme" content="light dark" />
|
|
7
7
|
<title>AgentRun</title>
|
|
8
8
|
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23ff8000'/%3E%3Cpath d='M12 9l11 7-11 7z' fill='%23000'/%3E%3C/svg%3E" />
|
|
9
|
-
<script type="module" crossorigin src="./assets/index-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
9
|
+
<script type="module" crossorigin src="./assets/index-CXZMgJE7.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="./assets/index-B7NKTU8E.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
<div id="root"></div>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The run error code (agentrun-v2's RunErrorCode). */
|
|
2
|
+
export declare const MODERATED = "moderated";
|
|
3
|
+
/** The run's error for it: what stopped the answer and what a person can do. */
|
|
4
|
+
export declare const CONTENT_FILTER_WORDS = "The model provider stopped this answer (its content filter). Rephrase the request, or try another model.";
|
|
5
|
+
/** Whether a run's end says the provider's content filter stopped its answer. A CLI harness's names its harness first
|
|
6
|
+
* (`<harness>: <the turn's error>`). */
|
|
7
|
+
export declare function contentFiltered(message: string): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// A provider's content filter stopping a run's answer, read the same way on every harness from the words the run ended
|
|
2
|
+
// with (its row's summary): on pi, the words pi-ai gives that stop on each API (its stop reason is only "error", so its
|
|
3
|
+
// fixed words are what is read); on claude-agent, codex and opencode, the adapters' CONTENT_FILTERED, which the harness
|
|
4
|
+
// halts the turn with once its model proxy reads the provider's stop (a refusal, an answer incomplete for
|
|
5
|
+
// content_filter), named after its harness. A run so ended fails `moderated` (the contract's own run error code) in words
|
|
6
|
+
// a person can act on; the Timeline's error row keeps the harness's words for the stop. A refusal whose provider gave
|
|
7
|
+
// its own explanation (pi on the Messages API) has no fixed words and stays run_failed.
|
|
8
|
+
import { CONTENT_FILTERED } from "@parcha/agentrun-kernel";
|
|
9
|
+
/** The run error code (agentrun-v2's RunErrorCode). */
|
|
10
|
+
export const MODERATED = "moderated";
|
|
11
|
+
/** The run's error for it: what stopped the answer and what a person can do. */
|
|
12
|
+
export const CONTENT_FILTER_WORDS = "The model provider stopped this answer (its content filter). Rephrase the request, or try another model.";
|
|
13
|
+
/** pi-ai's words for a provider's content-filter stop: the Responses API's answer incomplete for content_filter, Chat
|
|
14
|
+
* Completions' finish_reason, and the Messages API's refusal when the provider gave no explanation. */
|
|
15
|
+
const PI_AI_FILTERED = new Set(["Response incomplete: content_filter", "Provider finish_reason: content_filter", "The model refused to complete the request"]);
|
|
16
|
+
/** Whether a run's end says the provider's content filter stopped its answer. A CLI harness's names its harness first
|
|
17
|
+
* (`<harness>: <the turn's error>`). */
|
|
18
|
+
export function contentFiltered(message) {
|
|
19
|
+
if (PI_AI_FILTERED.has(message) || message === CONTENT_FILTERED)
|
|
20
|
+
return true;
|
|
21
|
+
const named = /^[a-z][a-z0-9-]*: ([\s\S]*)$/.exec(message);
|
|
22
|
+
return named !== null && named[1] === CONTENT_FILTERED;
|
|
23
|
+
}
|
package/dist/decision-cap.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DecisionProvider, WorkflowDeps } from "@parcha/agentrun-dsl";
|
|
2
|
+
import type { DecisionModelPrice } from "@parcha/agentrun-decisions";
|
|
2
3
|
import { type CapMode } from "./cap.js";
|
|
3
|
-
import type { BudgetWaits } from "./budget.js";
|
|
4
4
|
type RunJudge = NonNullable<WorkflowDeps["runJudge"]>;
|
|
5
5
|
type JudgeParams = Parameters<RunJudge>[0];
|
|
6
6
|
/** An image's input allowance, in tokens: what a 1568 px square (Jev's longest side) reads as at 750 pixels a token. */
|
|
@@ -14,6 +14,12 @@ export declare const PARALLEL_DECISION_USD = 0.001;
|
|
|
14
14
|
/** How many times a decision's price is read from OpenRouter's catalog before its request fails unsent, and the waits
|
|
15
15
|
* between the reads, in ms. */
|
|
16
16
|
export declare const CATALOG_TRIES = 3;
|
|
17
|
+
/** `model`'s price from `priced`'s catalog, read up to CATALOG_TRIES times: a catalog still down then fails the request
|
|
18
|
+
* unsent, as a connection error (DecisionProviderError "connection"), and the decision node fails (decision nodes have
|
|
19
|
+
* no attempts loop), as on any provider's outage: never a CapStop. */
|
|
20
|
+
export declare function catalogPrice(priced: {
|
|
21
|
+
priceOf(model: string): Promise<DecisionModelPrice | null>;
|
|
22
|
+
}, model: string, signal: AbortSignal | undefined): Promise<DecisionModelPrice | null>;
|
|
17
23
|
/** Whether the durable driver answers `params`'s request from what it holds, sending nothing, so the request holds and
|
|
18
24
|
* waits for nothing: a route it decided, or a request an earlier process admitted that did not fail (asked and never
|
|
19
25
|
* answered: the driver escalates it unsent, dsl with-recovery). */
|
|
@@ -32,32 +38,4 @@ export type DecisionHold = {
|
|
|
32
38
|
};
|
|
33
39
|
/** The hold of `params`'s request to `provider`, under a cap of mode `mode`. */
|
|
34
40
|
export declare function holdOf(provider: DecisionProvider, params: JudgeParams, mode: CapMode): Promise<DecisionHold>;
|
|
35
|
-
/** The two halves of a workflow's capped decisions, over `providers` (the run's, decisions.ts), the run's `waits`
|
|
36
|
-
* (budget.ts) and `book`, which writes a DECISION_COST entry to the run's store. */
|
|
37
|
-
export declare function cappedDecisions({ providers, waits, mode, book, keep }: {
|
|
38
|
-
providers: {
|
|
39
|
-
providers: Readonly<Record<string, DecisionProvider>>;
|
|
40
|
-
default: string;
|
|
41
|
-
};
|
|
42
|
-
waits: BudgetWaits;
|
|
43
|
-
mode: CapMode;
|
|
44
|
-
book: (data: {
|
|
45
|
-
call: string;
|
|
46
|
-
decision: string | null;
|
|
47
|
-
usd: number;
|
|
48
|
-
}) => Promise<void>;
|
|
49
|
-
/** Keeps a request's hold in the run's store (a DECISION_HOLD entry), committed when it resolves; throws when it
|
|
50
|
-
* cannot be kept. */
|
|
51
|
-
keep: (data: {
|
|
52
|
-
call: string;
|
|
53
|
-
decision: string | null;
|
|
54
|
-
usd: number;
|
|
55
|
-
}) => Promise<void>;
|
|
56
|
-
}): {
|
|
57
|
-
/** Before the admission: the hold taken, or a wait for a raise, or the run stopped. `replayed` says whether the
|
|
58
|
-
* driver answers this request from what it decided before (a route's), which sends nothing and holds nothing. */
|
|
59
|
-
before(next: RunJudge, replayed: (params: JudgeParams) => boolean): RunJudge;
|
|
60
|
-
/** The judge itself: asks, and settles the request's hold at what it charged. */
|
|
61
|
-
settling(judge: RunJudge): RunJudge;
|
|
62
|
-
};
|
|
63
41
|
export {};
|
package/dist/decision-cap.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DecisionProviderError } from "@parcha/agentrun-dsl";
|
|
2
|
+
import { money } from "./cap.js";
|
|
3
3
|
/** An image's input allowance, in tokens: what a 1568 px square (Jev's longest side) reads as at 750 pixels a token. */
|
|
4
4
|
export const DECISION_IMAGE_TOKENS = 3_300;
|
|
5
5
|
/** The output an answer is expected to take, per question, where a Decisions model prices its output (expected mode). */
|
|
@@ -8,11 +8,6 @@ export const DECISION_OUTPUT_TOKENS = 256;
|
|
|
8
8
|
export const JEV_INPUT_USD = 0.042 / 1e6;
|
|
9
9
|
/** Parallel's list price for one decision request (USD; PARALLEL_LIST_PRICE_USD). */
|
|
10
10
|
export const PARALLEL_DECISION_USD = 0.001;
|
|
11
|
-
/** A provider's failures that say the request was never billed: refused before it was sent, or by the provider unbilled. */
|
|
12
|
-
const UNBILLED = new Set(["configuration", "auth", "invalid_request", "rate_limited", "connection"]);
|
|
13
|
-
const unbilled = (error) => error instanceof DecisionProviderError && (error.unsent === true || UNBILLED.has(error.code));
|
|
14
|
-
/** How a provider is named in a refusal's words. */
|
|
15
|
-
const providerName = (provider, model) => provider.id === "openrouter" ? (model ?? "OpenRouter") : provider.id === "jev" ? "Jev" : provider.id === "parallel" ? "Parallel" : provider.id;
|
|
16
11
|
/** How many times a decision's price is read from OpenRouter's catalog before its request fails unsent, and the waits
|
|
17
12
|
* between the reads, in ms. */
|
|
18
13
|
export const CATALOG_TRIES = 3;
|
|
@@ -20,7 +15,7 @@ const CATALOG_RETRY_MS = [500, 1_500];
|
|
|
20
15
|
/** `model`'s price from `priced`'s catalog, read up to CATALOG_TRIES times: a catalog still down then fails the request
|
|
21
16
|
* unsent, as a connection error (DecisionProviderError "connection"), and the decision node fails (decision nodes have
|
|
22
17
|
* no attempts loop), as on any provider's outage: never a CapStop. */
|
|
23
|
-
async function catalogPrice(priced, model, signal) {
|
|
18
|
+
export async function catalogPrice(priced, model, signal) {
|
|
24
19
|
for (let tries = 1;; tries += 1) {
|
|
25
20
|
try {
|
|
26
21
|
return await priced.priceOf(model);
|
|
@@ -75,89 +70,3 @@ export async function holdOf(provider, params, mode) {
|
|
|
75
70
|
const usd = price.requestUsd + price.imageUsd * images + price.promptUsd * tokens + price.completionUsd * (output ?? 0);
|
|
76
71
|
return { usd, basis: `${model}'s price in OpenRouter's catalog, for ${tokens} input tokens${price.completionUsd > 0 ? ` and ${output} output tokens` : ""} at most` };
|
|
77
72
|
}
|
|
78
|
-
/** The two halves of a workflow's capped decisions, over `providers` (the run's, decisions.ts), the run's `waits`
|
|
79
|
-
* (budget.ts) and `book`, which writes a DECISION_COST entry to the run's store. */
|
|
80
|
-
export function cappedDecisions({ providers, waits, mode, book, keep }) {
|
|
81
|
-
/** Each request's hold, taken by `before` and settled by `settling`, by the params object both are handed. */
|
|
82
|
-
const tickets = new WeakMap();
|
|
83
|
-
const stepOf = (params) => ({ label: params.label, path: params.executionPath ?? null });
|
|
84
|
-
return {
|
|
85
|
-
/** Before the admission: the hold taken, or a wait for a raise, or the run stopped. `replayed` says whether the
|
|
86
|
-
* driver answers this request from what it decided before (a route's), which sends nothing and holds nothing. */
|
|
87
|
-
before(next, replayed) {
|
|
88
|
-
return async (params) => {
|
|
89
|
-
const cap = runCap();
|
|
90
|
-
if (cap === undefined || replayed(params))
|
|
91
|
-
return next(params);
|
|
92
|
-
const id = params.provider ?? providers.default;
|
|
93
|
-
const provider = Object.hasOwn(providers.providers, id) ? providers.providers[id] : undefined;
|
|
94
|
-
// A provider the host lacks is refused by the judge as configuration, before anything is sent.
|
|
95
|
-
if (!provider)
|
|
96
|
-
return next(params);
|
|
97
|
-
const name = `${params.label}'s decision on ${providerName(provider, params.model)}`;
|
|
98
|
-
const hold = await holdOf(provider, params, mode);
|
|
99
|
-
if ("unpriced" in hold) {
|
|
100
|
-
const refusal = { words: `Not sent: ${name}: ${hold.unpriced}, so the run's cap of ${money(cap)} cannot be kept: the run is out of budget.`, room: false, capUsd: cap };
|
|
101
|
-
return waits.stop(refusal, stepOf(params));
|
|
102
|
-
}
|
|
103
|
-
const held = await holdPaid(name, hold, params.signal);
|
|
104
|
-
if ("refused" in held) {
|
|
105
|
-
if (held.refused.room)
|
|
106
|
-
throw params.signal?.reason ?? new Error(`${name} was not sent: its wait for a raise ended`);
|
|
107
|
-
return waits.stop(held.refused, stepOf(params));
|
|
108
|
-
}
|
|
109
|
-
const call = `${params.label}@${params.executionPath ?? ""}${params.item ? `#${params.item.index}` : ""}`;
|
|
110
|
-
tickets.set(params, { ticket: held.ticket, usd: hold.usd, call, decision: params.decisionId ?? null, name, settled: false });
|
|
111
|
-
try {
|
|
112
|
-
return await next(params);
|
|
113
|
-
}
|
|
114
|
-
finally {
|
|
115
|
-
// A request the driver answered without asking (one asked by an earlier process escalates) sent nothing.
|
|
116
|
-
held.ticket.drop();
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
},
|
|
120
|
-
/** The judge itself: asks, and settles the request's hold at what it charged. */
|
|
121
|
-
settling(judge) {
|
|
122
|
-
return async (params) => {
|
|
123
|
-
const held = tickets.get(params);
|
|
124
|
-
if (!held)
|
|
125
|
-
return judge(params);
|
|
126
|
-
// Here the driver has admitted the request (dsl with-recovery: committed and flushed before this judge is asked),
|
|
127
|
-
// and nothing is sent yet: its hold is kept in the run's store, one awaited commit right before the send. A process
|
|
128
|
-
// that dies from here, the request maybe out, leaves it counted at its hold by the next one (decisionSpentIn); one
|
|
129
|
-
// that died before the admission kept none. A hold that cannot be kept sends nothing, and the driver marks the
|
|
130
|
-
// request failed, so the next process asks it again.
|
|
131
|
-
try {
|
|
132
|
-
await keep({ call: held.call, decision: held.decision, usd: held.usd });
|
|
133
|
-
}
|
|
134
|
-
catch (cause) {
|
|
135
|
-
throw new DecisionProviderError("connection", `${held.name} was not sent: its hold under the run's cap could not be kept in the run's store (${cause?.message ?? cause}).`, { unsent: true, cause });
|
|
136
|
-
}
|
|
137
|
-
const settle = async (usd) => {
|
|
138
|
-
held.settled = true;
|
|
139
|
-
held.ticket.settle(usd);
|
|
140
|
-
await book({ call: held.call, decision: held.decision, usd: usd ?? held.usd }).catch(() => undefined);
|
|
141
|
-
};
|
|
142
|
-
try {
|
|
143
|
-
const result = await judge(params);
|
|
144
|
-
await settle(typeof result.cost_usd === "number" && Number.isFinite(result.cost_usd) ? result.cost_usd : null);
|
|
145
|
-
return result;
|
|
146
|
-
}
|
|
147
|
-
catch (error) {
|
|
148
|
-
// Sent and maybe billed (its outcome lost, its answer refused, cut in flight): at what it was charged, else at its
|
|
149
|
-
// hold. One that failed before it was sent, or that its provider refused unbilled, charged nothing.
|
|
150
|
-
const charged = chargedCost(error);
|
|
151
|
-
if (charged !== undefined)
|
|
152
|
-
await settle(charged);
|
|
153
|
-
else if (!unbilled(error))
|
|
154
|
-
await settle(null);
|
|
155
|
-
// Unbilled, it charged nothing: booked at $0, so no later process counts its hold.
|
|
156
|
-
else
|
|
157
|
-
await book({ call: held.call, decision: held.decision, usd: 0 }).catch(() => undefined);
|
|
158
|
-
throw error;
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
},
|
|
162
|
-
};
|
|
163
|
-
}
|
package/dist/decision-rows.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TimelineEvent } from "
|
|
1
|
+
import { type TimelineEvent } from "./timeline/index.js";
|
|
2
2
|
type Receipt = Record<string, unknown>;
|
|
3
3
|
/** How a host shows a row's text: its held values taken out (`redact`, the run's redactor, applied to a text whole
|
|
4
4
|
* before any cut), and `hold`, the characters a held value takes in its widest form, held back from the end of a text
|
package/dist/decision-rows.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// A workflow run's decisions as timeline rows: one row per receipt its judge, pick, sift, route, ask and verify nodes
|
|
2
2
|
// committed to the run's store (`agentrun.decisions`), so a run shows its verdicts beside its model nodes' rows. The
|
|
3
3
|
// rows are read from the released store, as the rest of a workflow run's rows are.
|
|
4
|
-
import { CAPS, costLabel, cut, endedUsage, scrubUrls } from "
|
|
4
|
+
import { CAPS, costLabel, cut, endedUsage, scrubUrls } from "./timeline/index.js";
|
|
5
5
|
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6
6
|
const two = (value) => (typeof value === "number" && Number.isFinite(value) ? value.toFixed(2) : "?");
|
|
7
7
|
/** A row's string as the timeline makes every row's: its URLs keep their origin, path and query keys, then it is cut. */
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type DockerDaemon } from "./boxes.js";
|
|
2
|
+
export type { DockerDaemon };
|
|
3
|
+
/** How long one ask of the daemon may take: a daemon that does not answer within it is taken as none. */
|
|
4
|
+
export declare const DAEMON_ASK_MS = 3000;
|
|
5
|
+
/** How long an answer is kept before the next read asks again. */
|
|
6
|
+
export declare const DAEMON_TTL_MS = 30000;
|
|
7
|
+
/** One ask of the daemon, bounded by its signal: boxes.ts askDockerDaemon, or a test's stand-in. */
|
|
8
|
+
export type DaemonAsk = (signal: AbortSignal) => Promise<DockerDaemon>;
|
|
9
|
+
/** The daemon's answer as reads take it: asked at the first read, within `timeoutMs` (no answer in time is none), kept
|
|
10
|
+
* for `ttlMs`, then asked again at the next read. Reads that come while an ask is out share it. Never rejects. */
|
|
11
|
+
export declare function dockerDaemonCheck({ env, ask, timeoutMs, ttlMs, now }?: {
|
|
12
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
13
|
+
readonly ask?: DaemonAsk;
|
|
14
|
+
readonly timeoutMs?: number;
|
|
15
|
+
readonly ttlMs?: number;
|
|
16
|
+
readonly now?: () => number;
|
|
17
|
+
}): () => Promise<DockerDaemon>;
|
|
18
|
+
/** A daemon that answers: what a server whose Docker is a stand-in (--faux, tests) says. */
|
|
19
|
+
export declare const daemonUp: () => Promise<DockerDaemon>;
|
|
20
|
+
/** A provider as the words read it: its name, the kinds it serves, and the mounts it takes. */
|
|
21
|
+
type Named = {
|
|
22
|
+
readonly label: string;
|
|
23
|
+
readonly kinds: readonly string[];
|
|
24
|
+
readonly mounts: readonly string[];
|
|
25
|
+
};
|
|
26
|
+
/** What a person is told when no Docker daemon answers here and a computer of `kind` is on Docker, in folder `mode` (1:
|
|
27
|
+
* run folders on this server's disk; 2: on Archil): Settings → Computers' why, a run's start refusal and the claim's
|
|
28
|
+
* launch refusal, all alike. It names only what works in the mode, of `providers` (this server's), none needing a local
|
|
29
|
+
* daemon: a sandbox holds the run's folder, so it is one that mounts Archil, and in Mode 1 those need Archil turned on
|
|
30
|
+
* first; a desktop, phone or browser holds none, so any that takes no folder of this machine (no bind) does. */
|
|
31
|
+
export declare function noDockerWords(kind: string, providers: readonly Named[], mode: 1 | 2): string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Whether a Docker computer can be had on this server: its daemon asked (boxes.ts askDockerDaemon, `docker version`)
|
|
2
|
+
// within a short bound, the answer kept for a while and asked again after it, so a daemon that comes up after the start
|
|
3
|
+
// is seen. Settings → Computers' view, a run's start check and the claim's launch read it, and say one thing when no
|
|
4
|
+
// daemon answers (noDockerWords): a hosted server (Render and the like) runs none, so a vendor's computer is the way.
|
|
5
|
+
import { askDockerDaemon } from "./boxes.js";
|
|
6
|
+
/** How long one ask of the daemon may take: a daemon that does not answer within it is taken as none. */
|
|
7
|
+
export const DAEMON_ASK_MS = 3_000;
|
|
8
|
+
/** How long an answer is kept before the next read asks again. */
|
|
9
|
+
export const DAEMON_TTL_MS = 30_000;
|
|
10
|
+
const UP = { up: true };
|
|
11
|
+
/** The daemon's answer as reads take it: asked at the first read, within `timeoutMs` (no answer in time is none), kept
|
|
12
|
+
* for `ttlMs`, then asked again at the next read. Reads that come while an ask is out share it. Never rejects. */
|
|
13
|
+
export function dockerDaemonCheck({ env = process.env, ask, timeoutMs = DAEMON_ASK_MS, ttlMs = DAEMON_TTL_MS, now = Date.now } = {}) {
|
|
14
|
+
const asking = ask ?? ((signal) => askDockerDaemon(env, signal));
|
|
15
|
+
let kept;
|
|
16
|
+
const once = async () => {
|
|
17
|
+
const controller = new AbortController();
|
|
18
|
+
let timer;
|
|
19
|
+
const late = new Promise((resolve) => {
|
|
20
|
+
timer = setTimeout(() => {
|
|
21
|
+
controller.abort();
|
|
22
|
+
resolve({ up: false, absent: true, reason: `Docker did not answer within ${timeoutMs} ms` });
|
|
23
|
+
}, timeoutMs);
|
|
24
|
+
});
|
|
25
|
+
try {
|
|
26
|
+
return await Promise.race([asking(controller.signal).catch(() => ({ up: false, absent: true, reason: "Docker's version could not be read" })), late]);
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
clearTimeout(timer);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
return () => {
|
|
33
|
+
const at = now();
|
|
34
|
+
if (!kept || at - kept.at >= ttlMs)
|
|
35
|
+
kept = { at, answer: once() };
|
|
36
|
+
return kept.answer;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** A daemon that answers: what a server whose Docker is a stand-in (--faux, tests) says. */
|
|
40
|
+
export const daemonUp = async () => UP;
|
|
41
|
+
/** "A", "A or B", "A, B or C". */
|
|
42
|
+
const either = (names) => (names.length < 2 ? names.join("") : `${names.slice(0, -1).join(", ")} or ${names.at(-1)}`);
|
|
43
|
+
/** What a person is told when no Docker daemon answers here and a computer of `kind` is on Docker, in folder `mode` (1:
|
|
44
|
+
* run folders on this server's disk; 2: on Archil): Settings → Computers' why, a run's start refusal and the claim's
|
|
45
|
+
* launch refusal, all alike. It names only what works in the mode, of `providers` (this server's), none needing a local
|
|
46
|
+
* daemon: a sandbox holds the run's folder, so it is one that mounts Archil, and in Mode 1 those need Archil turned on
|
|
47
|
+
* first; a desktop, phone or browser holds none, so any that takes no folder of this machine (no bind) does. */
|
|
48
|
+
export function noDockerWords(kind, providers, mode) {
|
|
49
|
+
const NO_DOCKER = "No Docker on this server: Render and most hosted services run none.";
|
|
50
|
+
const vendors = providers.filter((one) => one.kinds.includes(kind) && (kind === "sandbox" ? one.mounts.includes("archil") : !one.mounts.includes("bind"))).map((one) => one.label);
|
|
51
|
+
if (vendors.length === 0)
|
|
52
|
+
return `${NO_DOCKER} Pick another kind of computer, or none.`;
|
|
53
|
+
if (kind === "sandbox" && mode === 1)
|
|
54
|
+
return `${NO_DOCKER} A vendor sandbox (${either(vendors)}) needs Archil turned on in Settings → Workspace.`;
|
|
55
|
+
return `${NO_DOCKER} Use a vendor computer, e.g. ${either(vendors)} for a ${kind}.`;
|
|
56
|
+
}
|
package/dist/effort-guidance.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
// A run's effort is its model's thinking level
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// A run's effort is its model's thinking level and a short note on how to work, added right after the agent's
|
|
2
|
+
// instructions on every harness: one table, one note for each effort. The effort is the run's own, else its revision's
|
|
3
|
+
// thinking, else the host's AGENT_THINKING (runs-over-store.ts prepareLaunch). A run with none, or one above high, gets no
|
|
4
|
+
// note.
|
|
4
5
|
import { EFFORTS } from "./model.js";
|
|
5
6
|
/** The note each effort adds after the agent's instructions. */
|
|
6
7
|
export const EFFORT_GUIDANCE = {
|
package/dist/environment.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import { type Extension } from "@earendil-works/pi-durable";
|
|
2
1
|
/** The environment line on `now`'s day, in UTC. */
|
|
3
2
|
export declare function environmentLine(now?: Date): string;
|
|
4
|
-
/** pi's section of the line, untagged: installed before any other extension, it is the system prompt's first text. */
|
|
5
|
-
export declare const EnvironmentLine: Extension;
|
package/dist/environment.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
// The line every harness's system prompt starts with: today's date, in UTC, and where the run works. A model knows only
|
|
2
2
|
// the date its training ended, so a question about "the latest" release is answered from then unless the run says what
|
|
3
|
-
// day it is. One line for every harness, made as each
|
|
4
|
-
//
|
|
5
|
-
|
|
3
|
+
// day it is. One line for every harness, made as each claim opens. pi re-makes its system prompt at each open; Codex adds
|
|
4
|
+
// its own current date to each turn's context; claude-agent's CLI resends the prompt recorded at the session's first
|
|
5
|
+
// request, so its harness tells a later day in that day's first turn (run-adapters-claude-agent harness.ts dateLine).
|
|
6
6
|
/** The environment line on `now`'s day, in UTC. */
|
|
7
7
|
export function environmentLine(now = new Date()) {
|
|
8
8
|
return `Today is ${now.toISOString().slice(0, 10)} (UTC). You are running on AgentRun; your workspace is your working directory, and file paths are relative to it.`;
|
|
9
9
|
}
|
|
10
|
-
/** pi's section of the line, untagged: installed before any other extension, it is the system prompt's first text. */
|
|
11
|
-
export const EnvironmentLine = defineExtension({ name: "agentrun-environment", sections: [section("environment", () => environmentLine(), { tag: false })] });
|
package/dist/errors.d.ts
CHANGED
|
@@ -31,13 +31,11 @@ export declare const ERROR_STATUS: {
|
|
|
31
31
|
readonly unavailable: 503;
|
|
32
32
|
readonly key_set_by_server: 409;
|
|
33
33
|
readonly budget_reached: 409;
|
|
34
|
-
readonly no_sealing_key: 409;
|
|
35
34
|
readonly webhook_off: 409;
|
|
36
35
|
readonly precondition_required: 428;
|
|
37
36
|
readonly auth_required: 422;
|
|
38
37
|
readonly not_mcp: 422;
|
|
39
38
|
readonly upstream_failed: 424;
|
|
40
|
-
readonly store_unreadable: 409;
|
|
41
39
|
readonly wrong_origin: 409;
|
|
42
40
|
readonly sign_in_held: 409;
|
|
43
41
|
readonly handoff_answered: 409;
|
|
@@ -49,6 +47,7 @@ export declare const ERROR_STATUS: {
|
|
|
49
47
|
readonly github_wrong_origin: 409;
|
|
50
48
|
readonly github_failed: 502;
|
|
51
49
|
readonly external_body_conflict: 409;
|
|
50
|
+
readonly learned_not_active: 409;
|
|
52
51
|
};
|
|
53
52
|
export type ErrorCode = keyof typeof ERROR_STATUS;
|
|
54
53
|
/** A field that is missing or wrong. `example`: a value the field accepts, read from the request body's schema (explain.ts). */
|
package/dist/errors.js
CHANGED
|
@@ -32,28 +32,25 @@ export const ERROR_STATUS = {
|
|
|
32
32
|
internal: 500,
|
|
33
33
|
unsupported_here: 501,
|
|
34
34
|
unavailable: 503,
|
|
35
|
-
// This server's own, beside the contract's list (openapi.ts marks them): a tool key its launcher sets, a
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
// answer to a browser hand-over that already has a different one (browser-person.ts).
|
|
35
|
+
// This server's own, beside the contract's list (openapi.ts marks them): a tool key its launcher sets, a send to a
|
|
36
|
+
// webhook a 410 turned off, a write to a learning note that names no version it read, a remote MCP server that asks
|
|
37
|
+
// for a credential, does not speak MCP, or fails, a message to a run paused at its cap, which takes one once its cap is
|
|
38
|
+
// raised, a saved sign-in forgotten while a run holds its save lease (sign-ins-store.ts), and an answer to a browser
|
|
39
|
+
// hand-over that already has a different one (browser-person.ts).
|
|
41
40
|
key_set_by_server: 409,
|
|
42
41
|
budget_reached: 409,
|
|
43
|
-
no_sealing_key: 409,
|
|
44
42
|
webhook_off: 409,
|
|
45
43
|
precondition_required: 428,
|
|
46
44
|
auth_required: 422,
|
|
47
45
|
not_mcp: 422,
|
|
48
46
|
upstream_failed: 424,
|
|
49
|
-
store_unreadable: 409,
|
|
50
47
|
wrong_origin: 409,
|
|
51
48
|
sign_in_held: 409,
|
|
52
49
|
handoff_answered: 409,
|
|
53
50
|
computer_not_live: 409,
|
|
54
51
|
scope_taken: 409,
|
|
55
52
|
// Connect GitHub (github-connection.ts): a github trigger on a server with no GitHub App, a second App, a Connect that
|
|
56
|
-
// GitHub could not call back (no public address),
|
|
53
|
+
// GitHub could not call back (no public address), and GitHub that
|
|
57
54
|
// did not answer (a 429, a 5xx, or nothing) while a github_app MCP server's listing token was minted: tried again.
|
|
58
55
|
github_not_connected: 409,
|
|
59
56
|
github_already_connected: 409,
|
|
@@ -63,6 +60,9 @@ export const ERROR_STATUS = {
|
|
|
63
60
|
// A run of an agent given inline (POST /runs) under a version of its source already run here with another definition: a
|
|
64
61
|
// version's definition never changes here, so the source publishes a new version.
|
|
65
62
|
external_body_conflict: 409,
|
|
63
|
+
// A learned workflow made into an agent of its own while it waits for its owner's OK or is retired: only an active one
|
|
64
|
+
// is (learning-routes.ts promotable).
|
|
65
|
+
learned_not_active: 409,
|
|
66
66
|
};
|
|
67
67
|
const RETRYABLE = new Set(["home_busy", "idempotency_in_progress", "rate_limited", "internal", "unavailable", "github_failed"]);
|
|
68
68
|
export class ApiError extends Error {
|
package/dist/explain.js
CHANGED
|
@@ -177,7 +177,9 @@ export function explain(issues, root, schema, told = {}) {
|
|
|
177
177
|
return issues.map((issue) => {
|
|
178
178
|
if (issue.example !== undefined || typeof issue.field !== "string" || !schema)
|
|
179
179
|
return issue;
|
|
180
|
-
|
|
180
|
+
// A field named with the schema path its problem is at (a workflow's input: `input at #/properties/question`, the
|
|
181
|
+
// DSL's schema path, never the data's) is told from the field it names: a whole value it takes.
|
|
182
|
+
const path = (/^(\S+) at #\//.exec(issue.field)?.[1] ?? issue.field).split(".");
|
|
181
183
|
const key = path.at(-1);
|
|
182
184
|
const parent = schemaAt(root, schema, path.slice(0, -1));
|
|
183
185
|
if (issue.reason === "not_allowed") {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type Workspace } from "./workspace/index.js";
|
|
2
|
+
/** The longest line a filed answer keeps: at three bytes of UTF-8 a character at most, well within the 50 KB pi's read
|
|
3
|
+
* shows of one line. */
|
|
4
|
+
export declare const FILED_LINE_MAX = 10000;
|
|
5
|
+
/** The deepest indent a laid-out answer gets, in levels: a value nested deeper starts its own line at this indent. */
|
|
6
|
+
export declare const LAYOUT_DEPTH_MAX = 32;
|
|
7
|
+
/** The most a laid-out answer may grow to, in characters, for `text`: twice its length and 64 Ki more. Past it, the
|
|
8
|
+
* answer is filed as written (its lines broken at FILED_LINE_MAX), so no answer's layout costs more memory than that. */
|
|
9
|
+
export declare const layoutBound: (text: string) => number;
|
|
10
|
+
/** `text` as it is filed: JSON (an object or an array) laid out a value a line when that stays within layoutBound
|
|
11
|
+
* (`laid`), and each line past FILED_LINE_MAX characters broken into pieces of that length (never inside a surrogate
|
|
12
|
+
* pair); `broken`, how many lines were. */
|
|
13
|
+
export declare function fileable(text: string): {
|
|
14
|
+
text: string;
|
|
15
|
+
json: boolean;
|
|
16
|
+
laid: boolean;
|
|
17
|
+
broken: number;
|
|
18
|
+
};
|
|
19
|
+
/** Valid JSON `text` laid out a value a line, two spaces an indent, as JSON.stringify(value, null, 2) lays it out, but
|
|
20
|
+
* from the text's own tokens: a number is copied as written, never parsed, so an integer past 2^53 or a long decimal
|
|
21
|
+
* is filed exactly as the server sent it. The indent stops growing at LAYOUT_DEPTH_MAX levels, and undefined is the
|
|
22
|
+
* answer when the layout would pass layoutBound(text): deep or dense nesting is never padded without end. */
|
|
23
|
+
export declare function laidOut(text: string): string | undefined;
|
|
24
|
+
/** The model's text for `text`, longer than `clip` characters: the filed text's first lines, whole, within `clip`, then
|
|
25
|
+
* a note naming the file (`<folder>/<stem>.txt`, or `.json` for JSON) and the read offset that goes on. A file that
|
|
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>;
|
|
29
|
+
/** For a unified diff (`diff --git a/... b/...` lines), where each file not wholly shown starts in the filed text and
|
|
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
|
+
* paging through all of it: "; files past the cut, from the line each starts at (its lines): a.ts 908 (120), ...". */
|
|
32
|
+
export declare function diffIndex(lines: readonly string[], shown: number): string;
|