@parcha/agentrun-serve 0.1.0-beta.34 → 0.1.0-beta.36
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 +263 -0
- package/README.md +339 -179
- package/dist/adapters.d.ts +15 -2
- package/dist/adapters.js +34 -2
- package/dist/agent-rows.d.ts +3 -1
- package/dist/agents-store.d.ts +2 -0
- package/dist/agents-store.js +25 -5
- package/dist/api-only.d.ts +2 -1
- package/dist/api-only.js +3 -1
- package/dist/archil-routes.d.ts +40 -7
- package/dist/archil-routes.js +167 -54
- package/dist/archil-settings.d.ts +90 -8
- package/dist/archil-settings.js +150 -14
- package/dist/attach-images.d.ts +15 -0
- package/dist/attach-images.js +59 -0
- package/dist/background.d.ts +0 -6
- package/dist/background.js +0 -28
- package/dist/bash-read-only.d.ts +13 -0
- package/dist/bash-read-only.js +77 -0
- package/dist/box-image.d.ts +1 -97
- package/dist/box-image.js +4 -284
- package/dist/box-paths.d.ts +2 -7
- package/dist/box-paths.js +7 -13
- package/dist/box-settings.d.ts +0 -11
- package/dist/box-settings.js +4 -29
- package/dist/browser-commands.js +1 -1
- package/dist/browser-computer.d.ts +47 -3
- package/dist/browser-computer.js +286 -18
- package/dist/browser-cost.d.ts +2 -2
- package/dist/browser-cost.js +6 -4
- package/dist/browser-person.d.ts +19 -2
- package/dist/browser-person.js +55 -6
- package/dist/browser-wait-ended.d.ts +23 -0
- package/dist/browser-wait-ended.js +42 -0
- package/dist/cap.d.ts +19 -44
- package/dist/cap.js +31 -77
- package/dist/cli.js +36 -27
- package/dist/computer-keys.d.ts +20 -10
- package/dist/computer-keys.js +36 -57
- package/dist/computer-routes.d.ts +1 -4
- package/dist/computer-routes.js +3 -5
- package/dist/computer-setting.d.ts +8 -5
- package/dist/computer-setting.js +91 -26
- package/dist/computer-view.d.ts +11 -2
- package/dist/computer-view.js +2 -1
- package/dist/computers.d.ts +54 -8
- package/dist/computers.js +101 -22
- package/dist/console/assets/index-BI4Byidu.js +550 -0
- package/dist/console/assets/index-C19gUF2n.css +1 -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/docker-daemon.d.ts +2 -2
- package/dist/docker-daemon.js +2 -2
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +8 -5
- package/dist/explain.js +3 -1
- package/dist/faux-computers.js +4 -0
- package/dist/files.d.ts +1 -9
- package/dist/files.js +1 -9
- 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 +28 -4
- package/dist/github.js +46 -10
- package/dist/gpu-words.d.ts +14 -0
- package/dist/gpu-words.js +21 -0
- package/dist/graph-served.d.ts +5 -3
- package/dist/graph-served.js +14 -6
- package/dist/graph-view.d.ts +2 -0
- package/dist/graph-view.js +29 -2
- package/dist/handed-values.d.ts +1 -1
- package/dist/handed-values.js +1 -1
- package/dist/harness-install.d.ts +60 -3
- package/dist/harness-install.js +322 -34
- package/dist/harness-opencode/harness.js +0 -1
- package/dist/harness-opencode/host/policy.js +2 -2
- package/dist/harness.js +1 -1
- package/dist/host-tools.d.ts +8 -9
- package/dist/host-tools.js +7 -7
- package/dist/index.d.ts +2 -3
- package/dist/index.js +2 -2
- package/dist/key-refusal.d.ts +1 -1
- package/dist/key-refusal.js +2 -2
- package/dist/learn/check.d.ts +10 -2
- package/dist/learn/check.js +126 -8
- package/dist/learn/commit.d.ts +40 -6
- package/dist/learn/commit.js +164 -20
- package/dist/learn/folder.d.ts +11 -3
- package/dist/learn/folder.js +40 -16
- package/dist/learn/grade.d.ts +22 -2
- package/dist/learn/grade.js +127 -19
- package/dist/learn/index.d.ts +2 -2
- package/dist/learn/index.js +2 -2
- package/dist/learn/learning.sh +11 -13
- package/dist/learn/notes.d.ts +17 -3
- package/dist/learn/notes.js +19 -6
- package/dist/learn/reflect.d.ts +5 -2
- package/dist/learn/reflect.js +48 -32
- package/dist/learn/skills.d.ts +52 -5
- package/dist/learn/skills.js +104 -21
- package/dist/learned-nodes.d.ts +18 -0
- package/dist/learned-nodes.js +8 -0
- package/dist/learned-workflow.d.ts +27 -13
- package/dist/learned-workflow.js +110 -38
- package/dist/learning-cost.d.ts +79 -0
- package/dist/learning-cost.js +69 -0
- package/dist/learning-routes.d.ts +48 -2
- package/dist/learning-routes.js +99 -28
- package/dist/learning-run.d.ts +7 -5
- package/dist/learning-run.js +9 -6
- package/dist/learning-words.d.ts +3 -0
- package/dist/learning-words.js +6 -2
- package/dist/learning.d.ts +13 -28
- package/dist/learning.js +4 -18
- package/dist/llm.d.ts +4 -1
- package/dist/llm.js +4 -2
- package/dist/mcp-gateway.d.ts +6 -0
- package/dist/mcp-gateway.js +11 -1
- package/dist/mcp-probe.d.ts +8 -1
- package/dist/mcp-probe.js +62 -20
- package/dist/mcp-secret-writes.js +4 -0
- package/dist/mcp-servers-store.d.ts +12 -12
- package/dist/mcp-servers-store.js +8 -3
- package/dist/model.d.ts +8 -5
- package/dist/model.js +14 -6
- package/dist/openapi.d.ts +2 -0
- package/dist/openapi.js +236 -55
- package/dist/owner.d.ts +0 -1
- package/dist/owner.js +0 -2
- package/dist/pause.d.ts +2 -19
- package/dist/pause.js +5 -74
- package/dist/place-offers.d.ts +97 -0
- package/dist/place-offers.js +206 -0
- package/dist/place.d.ts +9 -13
- package/dist/place.js +22 -32
- package/dist/port-models.d.ts +12 -4
- package/dist/port-models.js +31 -9
- package/dist/print.d.ts +1 -8
- package/dist/print.js +1 -14
- package/dist/propose.d.ts +3 -0
- package/dist/propose.js +25 -19
- package/dist/run-cut.d.ts +5 -0
- package/dist/run-cut.js +19 -0
- package/dist/run-db.js +3 -3
- package/dist/run-launch.d.ts +18 -3
- package/dist/run-launch.js +11 -5
- package/dist/run-learning-served.d.ts +12 -1
- package/dist/run-manifest.d.ts +2 -2
- package/dist/run-manifest.js +2 -2
- package/dist/run-reads-over-store.d.ts +4 -2
- package/dist/run-reads-over-store.js +10 -8
- package/dist/run-secrets.js +3 -3
- package/dist/run-timeline-served.js +60 -38
- package/dist/run-view.d.ts +35 -16
- package/dist/run-view.js +64 -35
- package/dist/runnable.d.ts +6 -3
- package/dist/runnable.js +20 -4
- package/dist/runner/adapter-loop.d.ts +46 -5
- package/dist/runner/adapter-loop.js +381 -56
- package/dist/runner/adapter-run-spec.d.ts +46 -4
- package/dist/runner/adapter-run-spec.js +200 -45
- package/dist/runner/adapters/pi.d.ts +39 -3
- package/dist/runner/adapters/pi.js +124 -29
- package/dist/runner/beside.d.ts +8 -0
- package/dist/runner/beside.js +24 -2
- package/dist/runner/claim-secrets.d.ts +6 -0
- package/dist/runner/claim-secrets.js +15 -1
- package/dist/runner/cli-run-spec.d.ts +10 -0
- package/dist/runner/cli-run-spec.js +207 -64
- package/dist/runner/commands.d.ts +5 -1
- package/dist/runner/commands.js +3 -3
- package/dist/runner/conformance/harness.d.ts +1 -1
- package/dist/runner/conformance/harness.js +13 -10
- package/dist/runner/github-app.d.ts +7 -2
- package/dist/runner/github-app.js +46 -15
- package/dist/runner/harness-loops.d.ts +6 -1
- package/dist/runner/harness-loops.js +24 -1
- package/dist/runner/journal-kinds.d.ts +53 -7
- package/dist/runner/journal-kinds.js +29 -1
- package/dist/runner/learning-end.d.ts +15 -0
- package/dist/runner/learning-end.js +113 -20
- package/dist/runner/learning-factory.js +6 -2
- package/dist/runner/learning-loop.d.ts +75 -1
- package/dist/runner/learning-loop.js +215 -22
- package/dist/runner/learning-seed.d.ts +8 -0
- package/dist/runner/learning-seed.js +7 -1
- package/dist/runner/loop-contract.d.ts +12 -0
- package/dist/runner/loop-contract.js +6 -0
- package/dist/runner/loop.d.ts +5 -1
- package/dist/runner/loop.js +20 -0
- package/dist/runner/main.d.ts +9 -4
- package/dist/runner/main.js +38 -13
- package/dist/runner/mcp-claim.d.ts +7 -0
- package/dist/runner/mcp-claim.js +35 -2
- package/dist/runner/mcp-github.d.ts +15 -4
- package/dist/runner/mcp-github.js +55 -11
- package/dist/runner/mcp-run.d.ts +2 -0
- package/dist/runner/mcp-run.js +2 -0
- package/dist/runner/metrics.d.ts +18 -1
- package/dist/runner/metrics.js +81 -1
- package/dist/runner/model-route.d.ts +6 -0
- package/dist/runner/model-route.js +5 -2
- package/dist/runner/pr-checkout.d.ts +59 -0
- package/dist/runner/pr-checkout.js +176 -0
- package/dist/runner/reflect-hook.d.ts +1 -0
- package/dist/runner/reflect-hook.js +3 -3
- package/dist/runner/runner.js +136 -19
- package/dist/runner/spec-holds.d.ts +13 -3
- package/dist/runner/spec-holds.js +13 -10
- package/dist/runner/store-port.d.ts +4 -1
- package/dist/runner/store-secrets.js +17 -1
- package/dist/runner/subagent.d.ts +44 -0
- package/dist/runner/subagent.js +188 -0
- package/dist/runner/workflow-host.d.ts +25 -4
- package/dist/runner/workflow-host.js +26 -4
- package/dist/runner/workflow-loop.d.ts +9 -3
- package/dist/runner/workflow-loop.js +17 -10
- package/dist/runner/workflow-spec.d.ts +28 -13
- package/dist/runner/workflow-spec.js +247 -102
- package/dist/runs-over-store.d.ts +18 -7
- package/dist/runs-over-store.js +149 -31
- package/dist/seal-key.d.ts +0 -2
- package/dist/seal-key.js +0 -2
- package/dist/sealing.js +1 -2
- package/dist/secret-cut.d.ts +1 -1
- package/dist/secret-cut.js +1 -1
- package/dist/server-lock.js +4 -5
- package/dist/server.d.ts +49 -63
- package/dist/server.js +429 -230
- package/dist/stop-signals.d.ts +4 -2
- package/dist/stop-signals.js +5 -3
- package/dist/store/agent-body.d.ts +14 -3
- package/dist/store/agent-body.js +22 -8
- package/dist/store/deadline.d.ts +18 -0
- package/dist/store/deadline.js +49 -0
- package/dist/store/index.d.ts +3 -3
- package/dist/store/index.js +2 -2
- package/dist/store/journal/storage.js +2 -1
- package/dist/store/postgres/connection.d.ts +4 -0
- package/dist/store/postgres/connection.js +64 -13
- package/dist/store/postgres/migrations/0004_runs_outcome_stop_or_cancel.sql +11 -0
- package/dist/store/schema.d.ts +2 -1
- package/dist/store/schema.js +11 -8
- package/dist/store/seal.d.ts +13 -0
- package/dist/store/seal.js +19 -0
- package/dist/store/sqlite/connection.d.ts +5 -0
- package/dist/store/sqlite/connection.js +88 -82
- package/dist/store/sqlite/run-patch.d.ts +18 -2
- package/dist/store/sqlite/run-patch.js +31 -2
- package/dist/store/sqlite/store.js +65 -11
- package/dist/store/store.d.ts +62 -12
- package/dist/store/store.js +22 -1
- package/dist/store-reads/analytics.js +3 -2
- package/dist/store-reads/cap.d.ts +1 -3
- package/dist/store-reads/cap.js +8 -6
- package/dist/store-reads/decisions.d.ts +2 -2
- package/dist/store-reads/decisions.js +3 -6
- package/dist/store-reads/journal.js +83 -15
- package/dist/store-reads/learning.d.ts +73 -3
- package/dist/store-reads/learning.js +232 -9
- package/dist/store-reads/runs.d.ts +6 -4
- package/dist/store-reads/runs.js +17 -10
- package/dist/store-reads/stats.js +5 -1
- package/dist/store-view.d.ts +15 -1
- package/dist/store-view.js +88 -29
- package/dist/template-eval.js +2 -1
- package/dist/templates.d.ts +73 -4
- package/dist/templates.js +113 -23
- package/dist/timeline/timeline.d.ts +11 -1
- package/dist/timeline/timeline.js +19 -4
- package/dist/tool-blurbs.js +1 -0
- package/dist/tool-budget.d.ts +26 -0
- package/dist/tool-budget.js +56 -0
- package/dist/tool-gate.d.ts +13 -3
- package/dist/tool-gate.js +15 -7
- package/dist/tool-plane.d.ts +42 -29
- package/dist/tool-plane.js +64 -27
- package/dist/tools.d.ts +53 -39
- package/dist/tools.js +174 -79
- package/dist/trigger-signatures.d.ts +1 -0
- package/dist/trigger-signatures.js +3 -1
- package/dist/triggers.d.ts +3 -3
- package/dist/triggers.js +2 -2
- package/dist/turn-end.d.ts +0 -3
- package/dist/turn-end.js +0 -3
- package/dist/uploads.d.ts +28 -5
- package/dist/uploads.js +82 -9
- package/dist/usage-lines.d.ts +1 -1
- package/dist/usage.d.ts +1 -47
- package/dist/usage.js +3 -82
- package/dist/validate.d.ts +8 -0
- package/dist/validate.js +40 -3
- package/dist/webhooks.d.ts +2 -1
- package/dist/webhooks.js +5 -2
- package/dist/workflow/decision-recovery.d.ts +23 -0
- package/dist/workflow/decision-recovery.js +80 -0
- package/dist/workflow/decisions.d.ts +134 -0
- package/dist/workflow/decisions.js +46 -0
- package/dist/workflow/host-session.d.ts +5 -0
- package/dist/workflow/host-session.js +85 -0
- package/dist/workflow/host-tools.d.ts +3 -0
- package/dist/workflow/host-tools.js +3 -0
- package/dist/workflow/node-runner.d.ts +112 -0
- package/dist/workflow/node-runner.js +270 -0
- package/dist/workflow/node.d.ts +88 -0
- package/dist/workflow/node.js +99 -0
- package/dist/workflow/operator-error.d.ts +4 -0
- package/dist/workflow/operator-error.js +4 -0
- package/dist/workflow/pi-versions.d.ts +9 -0
- package/dist/workflow/pi-versions.js +8 -0
- package/dist/workflow/readers.d.ts +36 -0
- package/dist/workflow/readers.js +145 -0
- package/dist/workflow/record-file.d.ts +10 -0
- package/dist/workflow/record-file.js +56 -0
- package/dist/workflow/record-tool.d.ts +76 -0
- package/dist/workflow/record-tool.js +126 -0
- package/dist/workflow/record.d.ts +151 -0
- package/dist/workflow/record.js +401 -0
- package/dist/workflow/run-error.d.ts +16 -0
- package/dist/workflow/run-error.js +26 -0
- package/dist/workflow/runner.d.ts +6 -0
- package/dist/workflow/runner.js +240 -0
- package/dist/workflow/store.d.ts +23 -0
- package/dist/workflow/store.js +242 -0
- package/dist/workflow/task.d.ts +133 -0
- package/dist/workflow/task.js +411 -0
- package/dist/workflow/thinking.d.ts +3 -0
- package/dist/workflow/thinking.js +7 -0
- package/dist/workflow/tool-context.d.ts +21 -0
- package/dist/workflow/tool-context.js +13 -0
- package/dist/workflow/types.d.ts +126 -0
- package/dist/workflow/types.js +1 -0
- package/dist/workflow/wal.d.ts +11 -0
- package/dist/workflow/wal.js +106 -0
- package/dist/workflow-run.d.ts +1 -1
- package/dist/workspace/agent-computer.d.ts +137 -0
- package/dist/workspace/agent-computer.js +292 -0
- package/dist/workspace/archil-claim.d.ts +13 -2
- package/dist/workspace/archil-claim.js +22 -13
- package/dist/workspace/archil-disk.d.ts +10 -1
- package/dist/workspace/archil-disk.js +4 -0
- package/dist/workspace/archil-disks.d.ts +49 -0
- package/dist/workspace/archil-disks.js +185 -0
- package/dist/workspace/archil-exec.d.ts +12 -2
- package/dist/workspace/archil-exec.js +18 -3
- package/dist/workspace/archil-mount-credential.d.ts +20 -4
- package/dist/workspace/archil-mount-credential.js +13 -4
- 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/computer-deps.d.ts +18 -11
- package/dist/workspace/computer-deps.js +64 -40
- package/dist/workspace/computer-for-claim.d.ts +47 -9
- package/dist/workspace/computer-for-claim.js +236 -24
- package/dist/workspace/computer-janitor.d.ts +3 -2
- package/dist/workspace/computer-janitor.js +43 -9
- package/dist/workspace/computer-ledger.d.ts +3 -8
- package/dist/workspace/computer-ledger.js +7 -3
- package/dist/workspace/computer-providers.d.ts +5 -3
- package/dist/workspace/computer-providers.js +11 -9
- package/dist/workspace/hands.d.ts +5 -2
- package/dist/workspace/hands.js +4 -3
- package/dist/workspace/index.d.ts +5 -4
- package/dist/workspace/index.js +2 -1
- package/dist/workspace/local.d.ts +3 -0
- package/dist/workspace/local.js +9 -0
- 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 +48 -12
- package/dist/workspace/resolve-computer.js +88 -19
- package/dist/workspace/run-disk.d.ts +34 -0
- package/dist/workspace/run-disk.js +91 -0
- package/dist/workspace/run-tools.d.ts +6 -4
- package/dist/workspace/run-tools.js +17 -9
- package/dist/workspace/server-run-workspace.d.ts +3 -2
- package/dist/workspace/server-run-workspace.js +17 -4
- package/dist/workspace/workspace.d.ts +5 -0
- package/dist/workspace.d.ts +0 -3
- package/dist/workspace.js +2 -15
- package/package.json +11 -16
- package/skills/agentrun-serve/SKILL.md +1 -1
- package/templates/README.md +11 -8
- package/templates/code-review/agent.md +27 -11
- package/templates/code-review/evals/clean-refactor/graders/coverage.md +4 -0
- package/templates/code-review/evals/clean-refactor/graders/risk.md +5 -0
- package/templates/code-review/evals/injection/graders/ignores.md +1 -1
- 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/code-review/evals/never-flag/case.yaml +3 -0
- package/templates/code-review/evals/never-flag/graders/only-p0.md +4 -0
- package/templates/code-review/evals/never-flag/graders/schema.md +5 -0
- package/templates/code-review/evals/never-flag/prompt.md +30 -0
- package/templates/code-review/evals/null-name/graders/finds.md +1 -1
- package/templates/code-review/evals/off-by-one/graders/finds.md +1 -1
- package/templates/code-review/evals/off-by-one/graders/no-repo-reads.md +6 -5
- package/templates/code-review/evals/re-review/graders/resolves.md +1 -1
- package/templates/code-review/evals/re-review/prompt.md +1 -1
- package/templates/code-review/evals/re-review-open/case.yaml +3 -0
- package/templates/code-review/evals/re-review-open/graders/schema.md +5 -0
- package/templates/code-review/evals/re-review-open/graders/stays-open.md +4 -0
- package/templates/code-review/evals/re-review-open/prompt.md +27 -0
- package/templates/code-review/evals/repo-rule/graders/cites.md +1 -1
- package/templates/code-review/evals/two-defects/case.yaml +3 -0
- package/templates/code-review/evals/two-defects/graders/both.md +4 -0
- package/templates/code-review/evals/two-defects/graders/schema.md +5 -0
- package/templates/code-review/evals/two-defects/prompt.md +25 -0
- package/templates/code-review/findings.schema.json +131 -27
- package/templates/code-review/rules/CODEREVIEW.md +76 -0
- package/templates/code-review/skills/review/DEEP.md +130 -0
- package/templates/code-review/skills/review/REVIEWER.md +116 -0
- package/templates/code-review/skills/review/SKILL.md +104 -154
- 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/release-notes/agent.md +11 -0
- package/dist/box/record.d.ts +0 -6
- package/dist/box/record.js +0 -41
- package/dist/box/sweep.d.ts +0 -53
- package/dist/box/sweep.js +0 -193
- package/dist/box-egress-vm.d.ts +0 -118
- package/dist/box-egress-vm.js +0 -354
- package/dist/box-egress.d.ts +0 -105
- package/dist/box-egress.js +0 -256
- package/dist/box-relay-vm.d.ts +0 -84
- package/dist/box-relay-vm.js +0 -437
- package/dist/box-relay.d.ts +0 -36
- package/dist/box-relay.js +0 -207
- package/dist/boxes.d.ts +0 -109
- package/dist/boxes.js +0 -249
- package/dist/budget.d.ts +0 -76
- package/dist/budget.js +0 -204
- package/dist/console/assets/index-RPHGlXmM.js +0 -540
- package/dist/console/assets/index-opTN5Naq.css +0 -1
- package/dist/daytona-api.d.ts +0 -10
- package/dist/daytona-api.js +0 -20
- package/dist/egress-proxy.d.ts +0 -45
- package/dist/egress-proxy.js +0 -416
- package/dist/egress-table.d.ts +0 -24
- package/dist/egress-table.js +0 -165
- package/templates/code-review/rules/REVIEW.md +0 -41
package/dist/place.js
CHANGED
|
@@ -3,22 +3,23 @@
|
|
|
3
3
|
// explicit runner included, since the default is this host's; one that names none keeps none, so a revision written
|
|
4
4
|
// before this field keeps its id. Which boxes this server has is said in capabilities, and a revision whose box it does
|
|
5
5
|
// not have saves with a warning and is refused at run time. A run runs in its revision's place, else this host's
|
|
6
|
-
// default, and keeps the place it resolved to: a run request names none.
|
|
7
|
-
//
|
|
8
|
-
// sandbox, never a third
|
|
6
|
+
// default, and keeps the place it resolved to: a run request names none. A sandbox place on a box is a sandbox computer
|
|
7
|
+
// of that provider (computer-setting.ts computerOfPlace), which the run's claim starts: Docker, Daytona or Modal; bwrap
|
|
8
|
+
// says it does not run yet. A harness's own tools in the box, when they come, are an option of sandbox, never a third
|
|
9
|
+
// mode.
|
|
9
10
|
//
|
|
10
11
|
// The box is a new agent's default machine: an agentic definition that names no place is saved, at its create, with the
|
|
11
|
-
// Docker box as its place wherever this server has docker
|
|
12
|
+
// Docker box as its place wherever this server has docker, and with bash when it names no tools
|
|
12
13
|
// (newAgentPlace). A revision that names no place resolves the same way at each run (defaultPlaceOf): this server's
|
|
13
14
|
// default_place, so where docker is there now it runs in the Docker box, and the runner where it is not. A workflow, and a
|
|
14
15
|
// revision with a tool the box refuses, run on the runner.
|
|
15
|
-
import { BOX_IDS, BOXES_ENV
|
|
16
|
+
import { BOX_IDS, BOXES_ENV } from "./place-offers.js";
|
|
16
17
|
import { sentence } from "./errors.js";
|
|
17
18
|
export const PLACE_MODES = ["runner", "sandbox"];
|
|
18
|
-
/** The boxes runs execute in
|
|
19
|
-
export const RUN_BOXES = ["docker", "daytona",
|
|
20
|
-
/** The boxes this server gives runs, from what
|
|
21
|
-
*
|
|
19
|
+
/** The boxes runs execute in: the sandbox computers of Docker, Daytona and Modal. */
|
|
20
|
+
export const RUN_BOXES = ["docker", "daytona", "modal"];
|
|
21
|
+
/** The boxes this server gives runs, from what it found at its start (place-offers.ts): a box runs execute in that it
|
|
22
|
+
* has, and no other. */
|
|
22
23
|
export function boxAvailability(registry) {
|
|
23
24
|
return BOX_IDS.map((id) => {
|
|
24
25
|
const offer = registry.find((o) => o.id === id);
|
|
@@ -29,14 +30,14 @@ export function boxAvailability(registry) {
|
|
|
29
30
|
return { id, available: false, reason: `runs in the ${id} box are not available yet: use the ${RUN_BOXES.join(" or ")} box` };
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
|
-
/** The place a new agentic definition that names none is saved with: the Docker box where this server has it,
|
|
33
|
-
* preparing (its first run waits for the image); else none, so the agent runs on the runner as it did before, with
|
|
33
|
+
/** The place a new agentic definition that names none is saved with: the Docker box where this server has it; else none, so the agent runs on the runner as it did before, with
|
|
34
34
|
* `reason` saying why, in docker's own words. A workflow is never given one. */
|
|
35
35
|
export function newAgentPlace(registry) {
|
|
36
36
|
const docker = boxAvailability(registry).find((box) => box.id === "docker");
|
|
37
37
|
if (docker?.available)
|
|
38
38
|
return { place: { mode: "sandbox", box: "docker" } };
|
|
39
|
-
|
|
39
|
+
const why = docker?.reason ?? "it is not set up";
|
|
40
|
+
return { reason: `new agents run on the runner, because the docker box is unavailable here: ${why}`, why };
|
|
40
41
|
}
|
|
41
42
|
/** The place a revision that names none resolves to, at its create and at each run alike: this server's default place
|
|
42
43
|
* (newAgentPlace) for an agentic revision; the runner for a workflow, which is never given a box, and for one that names
|
|
@@ -60,19 +61,13 @@ export function noBoxReason(registry) {
|
|
|
60
61
|
return undefined;
|
|
61
62
|
return `no box is set up on this server: ${boxes.map((box) => `${box.id} is unavailable (${box.reason ?? "no reason given"})`).join("; ")}`;
|
|
62
63
|
}
|
|
63
|
-
/** The start banner's words on the boxes: which are ready for a sandbox agent's tools,
|
|
64
|
-
*
|
|
65
|
-
* AGENTRUN_BOXES lists (`listed`), or, when none is ready or preparing, each box runs execute in, with what to do.
|
|
64
|
+
/** The start banner's words on the boxes: which are ready for a sandbox agent's tools, then why each box is not that
|
|
65
|
+
* AGENTRUN_BOXES lists (`listed`), or, when none is ready, each box runs execute in, with what to do.
|
|
66
66
|
* `byDefault`, with AGENTRUN_BOXES not set at all: short, docker alone, said to be on by default, or why it is not. */
|
|
67
67
|
export function boxesLine(registry, listed, allow = "none", byDefault = false) {
|
|
68
68
|
const boxes = boxAvailability(registry);
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
const coming = boxes.filter((box) => box.available && preparing(box));
|
|
72
|
-
const said = [
|
|
73
|
-
...(ready.length ? [`${new Intl.ListFormat("en", { type: "conjunction" }).format(ready)} ${ready.length === 1 ? "is" : "are"} ready, so sandbox agents run their tools there.`] : []),
|
|
74
|
-
...coming.map((box) => sentence(`${box.id} is preparing${box.reason ? ` (${box.reason})` : ""}`)),
|
|
75
|
-
];
|
|
69
|
+
const ready = boxes.filter((box) => box.available).map((box) => box.id);
|
|
70
|
+
const said = ready.length ? [`${new Intl.ListFormat("en", { type: "conjunction" }).format(ready)} ${ready.length === 1 ? "is" : "are"} ready, so sandbox agents run their tools there.`] : [];
|
|
76
71
|
const none = !said.length;
|
|
77
72
|
const why = boxes.filter((box) => !box.available && (listed.has(box.id) || (none && RUN_BOXES.includes(box.id))));
|
|
78
73
|
// What an available box's programs reach, as capabilities say (`network`, `network_reason`, `places.allow`).
|
|
@@ -82,24 +77,22 @@ export function boxesLine(registry, listed, allow = "none", byDefault = false) {
|
|
|
82
77
|
const docker = boxes.find((box) => box.id === "docker");
|
|
83
78
|
if (!docker?.available)
|
|
84
79
|
return `Boxes: none, so new agents run on the runner. ${sentence(docker?.reason ?? "Docker is not set up")}`;
|
|
85
|
-
|
|
86
|
-
return [`Boxes: docker (on by default; set ${BOXES_ENV} to change).${coming}`, ...reach].join(" ");
|
|
80
|
+
return [`Boxes: docker (on by default; set ${BOXES_ENV} to change).`, ...reach].join(" ");
|
|
87
81
|
}
|
|
88
82
|
return ["Boxes:", ...(none ? ["none is ready, so sandbox agents do not run here."] : said), ...reach, ...why.map((box) => sentence(`${box.id}: ${box.reason ?? "not available"}`))].join(" ");
|
|
89
83
|
}
|
|
90
84
|
/** `places` in capabilities: the modes a revision may name, the place a new agent is saved with and a revision that
|
|
91
85
|
* names none runs in (`default_place`, with `default_reason` when it is the runner), each box, and the hosts a box whose
|
|
92
|
-
* `network` is `allowlist` reaches (`allow`,
|
|
86
|
+
* `network` is `allowlist` reaches (`allow`, box-settings.ts boxAllowOf; empty for `none`). */
|
|
93
87
|
export const placesOf = (registry, allow = "none") => {
|
|
94
88
|
const fresh = newAgentPlace(registry);
|
|
95
89
|
return { modes: [...PLACE_MODES], ...("place" in fresh ? { default_place: fresh.place } : { default_place: { mode: "runner" }, default_reason: fresh.reason }), boxes: boxAvailability(registry).map(stated), allow: allow === "none" ? [] : [...allow] };
|
|
96
90
|
};
|
|
97
|
-
/** A box with its state
|
|
98
|
-
* is available and `unavailable` when not; and, on an available box, its network as the server set it, with
|
|
91
|
+
/** A box with its state, `ready` when it is available and `unavailable` when not; and, on an available box, its network as the server set it, with
|
|
99
92
|
* `network_reason` when it is none for a cause of its own. */
|
|
100
|
-
const stated = ({ state, network, network_reason, ...offer }) => ({
|
|
93
|
+
const stated = ({ state: _state, network, network_reason, ...offer }) => ({
|
|
101
94
|
...offer,
|
|
102
|
-
state: offer.available ?
|
|
95
|
+
state: offer.available ? "ready" : "unavailable",
|
|
103
96
|
...(offer.available && network ? { network } : {}),
|
|
104
97
|
...(offer.available && network === "none" && network_reason ? { network_reason } : {}),
|
|
105
98
|
});
|
|
@@ -107,9 +100,6 @@ const stated = ({ state, network, network_reason, ...offer }) => ({
|
|
|
107
100
|
export const resolvePlace = (revision, fallback) => revision ?? fallback;
|
|
108
101
|
/** Where a box has the run's work/ (bound, or seeded), and where its tools start: the same in every box. */
|
|
109
102
|
export const BOX_WORK = "/workspace";
|
|
110
|
-
/** The boxes that cannot bind a run's work/, being on another machine: its work/ is seeded at the box's making and
|
|
111
|
-
* pulled back (run-box.ts). */
|
|
112
|
-
export const REMOTE_BOXES = ["daytona", VM_PROVIDER.id];
|
|
113
103
|
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
114
104
|
const listed = (options, value) => typeof value === "string" && options.includes(value);
|
|
115
105
|
/** `place` as a definition writes it, to copy: `"place": {"mode": "sandbox", "box": "docker"}`. */
|
package/dist/port-models.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { createProvider } from "@earendil-works/pi-ai/models";
|
|
|
3
3
|
import type { SessionPort } from "@parcha/agentrun-kernel";
|
|
4
4
|
/** The provider id the port's one model is listed under. */
|
|
5
5
|
export declare const PORT_PROVIDER = "agentrun-session";
|
|
6
|
+
/** The provider id a tier's port model is listed under (tieredModels): the run's model of that tier, on a proxy of its
|
|
7
|
+
* own beside the session's (AdapterSession.port's `tier`). */
|
|
8
|
+
export declare const tierProvider: (tier: string) => string;
|
|
6
9
|
/** Where pi-ai's client of `api` is pointed to reach a session's proxy at `url`: Anthropic's SDK adds /v1/messages to its
|
|
7
10
|
* base; OpenAI's adds /responses to a base that holds /v1. The one rule for the port's models and pi's own (runner
|
|
8
11
|
* adapters/pi.ts). */
|
|
@@ -30,7 +33,8 @@ export declare function sessionModel(api: SessionPort["api"], url: string, model
|
|
|
30
33
|
* credential (named `keyName`). The proxy knows a request by `authorization: Bearer <key>`: on Messages that header is set
|
|
31
34
|
* on the model, since pi-ai's Anthropic client sends its key as x-api-key, which the proxy does not forward; on Responses
|
|
32
35
|
* pi-ai sends the key as that bearer token itself. The one client every runner caller of a session proxy builds: pi's
|
|
33
|
-
* sessions, the learning grader, a workflow's model nodes.
|
|
36
|
+
* sessions, the learning grader, a workflow's model nodes. Each request's images are checked as they are attached
|
|
37
|
+
* (attach-images.ts): one a provider would refuse goes as a text saying why. */
|
|
34
38
|
export declare function sessionProvider(api: SessionPort["api"], proxy: {
|
|
35
39
|
readonly url: string;
|
|
36
40
|
readonly key: string;
|
|
@@ -48,6 +52,10 @@ export type PortModels = {
|
|
|
48
52
|
completeSimple(model: Model<Api>, context: Context, options?: SimpleStreamOptions): Promise<AssistantMessage>;
|
|
49
53
|
};
|
|
50
54
|
/** Models over `port` (the session's, read at each request: undefined until a drive has attached a proxy, and anew for
|
|
51
|
-
* each drive), one model named by any provider and id: the session's own
|
|
52
|
-
* run is priced by, whose reasoning, limits and price the port's model takes. */
|
|
53
|
-
export declare function portModels(port: () => SessionPort | undefined, like?: Partial<Model<Api
|
|
55
|
+
* each drive), one model named by any provider and id: the session's own, listed under `provider`. `like`: the
|
|
56
|
+
* catalog's entry for the model the run is priced by, whose reasoning, limits and price the port's model takes. */
|
|
57
|
+
export declare function portModels(port: () => SessionPort | undefined, like?: Partial<Model<Api>>, provider?: string): Promise<PortModels>;
|
|
58
|
+
/** Port models of several ports as one registry (learned-workflow.ts takes one): each listed under its own provider id
|
|
59
|
+
* (PORT_PROVIDER for the session's, tierProvider(tier) for a tier's), a model's request sent through the port it came
|
|
60
|
+
* from. */
|
|
61
|
+
export declare function tieredModels(byProvider: ReadonlyMap<string, PortModels>): PortModels;
|
package/dist/port-models.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { anthropicMessagesApi } from "@earendil-works/pi-ai/api/anthropic-messages.lazy";
|
|
2
2
|
import { openAIResponsesApi } from "@earendil-works/pi-ai/api/openai-responses.lazy";
|
|
3
3
|
import { createProvider } from "@earendil-works/pi-ai/models";
|
|
4
|
+
import { attachingImages } from "./attach-images.js";
|
|
4
5
|
/** The provider id the port's one model is listed under. */
|
|
5
6
|
export const PORT_PROVIDER = "agentrun-session";
|
|
7
|
+
/** The provider id a tier's port model is listed under (tieredModels): the run's model of that tier, on a proxy of its
|
|
8
|
+
* own beside the session's (AdapterSession.port's `tier`). */
|
|
9
|
+
export const tierProvider = (tier) => `${PORT_PROVIDER}-${tier}`;
|
|
6
10
|
/** Where pi-ai's client of `api` is pointed to reach a session's proxy at `url`: Anthropic's SDK adds /v1/messages to its
|
|
7
11
|
* base; OpenAI's adds /responses to a base that holds /v1. The one rule for the port's models and pi's own (runner
|
|
8
12
|
* adapters/pi.ts). */
|
|
@@ -32,20 +36,21 @@ export function sessionModel(api, url, model, options) {
|
|
|
32
36
|
* credential (named `keyName`). The proxy knows a request by `authorization: Bearer <key>`: on Messages that header is set
|
|
33
37
|
* on the model, since pi-ai's Anthropic client sends its key as x-api-key, which the proxy does not forward; on Responses
|
|
34
38
|
* pi-ai sends the key as that bearer token itself. The one client every runner caller of a session proxy builds: pi's
|
|
35
|
-
* sessions, the learning grader, a workflow's model nodes.
|
|
39
|
+
* sessions, the learning grader, a workflow's model nodes. Each request's images are checked as they are attached
|
|
40
|
+
* (attach-images.ts): one a provider would refuse goes as a text saying why. */
|
|
36
41
|
export function sessionProvider(api, proxy, model, options) {
|
|
37
42
|
return createProvider({
|
|
38
43
|
id: options.provider,
|
|
39
44
|
baseUrl: sessionBaseUrl(api, proxy.url),
|
|
40
45
|
auth: { apiKey: { name: options.keyName, resolve: async () => ({ auth: { apiKey: proxy.key }, source: "session" }) } },
|
|
41
46
|
models: [sessionModel(api, proxy.url, model, { provider: options.provider, ...(api === "anthropic-messages" ? { headers: { authorization: `Bearer ${proxy.key}` } } : {}), ...(options.like ? { like: options.like } : {}), reasoning: options.reasoning })],
|
|
42
|
-
api: api === "anthropic-messages" ? anthropicMessagesApi() : openAIResponsesApi(),
|
|
47
|
+
api: attachingImages(api === "anthropic-messages" ? anthropicMessagesApi() : openAIResponsesApi()),
|
|
43
48
|
});
|
|
44
49
|
}
|
|
45
50
|
/** Models over `port` (the session's, read at each request: undefined until a drive has attached a proxy, and anew for
|
|
46
|
-
* each drive), one model named by any provider and id: the session's own
|
|
47
|
-
* run is priced by, whose reasoning, limits and price the port's model takes. */
|
|
48
|
-
export async function portModels(port, like) {
|
|
51
|
+
* each drive), one model named by any provider and id: the session's own, listed under `provider`. `like`: the
|
|
52
|
+
* catalog's entry for the model the run is priced by, whose reasoning, limits and price the port's model takes. */
|
|
53
|
+
export async function portModels(port, like, provider = PORT_PROVIDER) {
|
|
49
54
|
const [{ createModels, createProvider }, { anthropicMessagesApi }, { openAIResponsesApi }] = await Promise.all([
|
|
50
55
|
import("@earendil-works/pi-ai/models"),
|
|
51
56
|
import("@earendil-works/pi-ai/api/anthropic-messages.lazy"),
|
|
@@ -64,15 +69,15 @@ export async function portModels(port, like) {
|
|
|
64
69
|
// The side key as the proxy reads a key (a bearer token), and no beta header pi-ai would add of its own: the session's
|
|
65
70
|
// policy admits the betas its harness sends, and these requests need none.
|
|
66
71
|
const headers = { authorization: `Bearer ${now.key}`, ...(now.api === "anthropic-messages" ? { "anthropic-beta": null } : {}) };
|
|
67
|
-
const model = sessionModel(now.api, now.url, now.model, { provider
|
|
72
|
+
const model = sessionModel(now.api, now.url, now.model, { provider, headers, ...(like ? { like } : {}), reasoning: true });
|
|
68
73
|
const models = createModels({});
|
|
69
74
|
models.setProvider(createProvider({
|
|
70
|
-
id:
|
|
75
|
+
id: provider, baseUrl,
|
|
71
76
|
auth: { apiKey: { name: "the session's side key", resolve: async () => ({ auth: { apiKey: now.key }, source: "session" }) } },
|
|
72
77
|
models: [model],
|
|
73
|
-
api: now.api === "anthropic-messages" ? anthropicMessagesApi() : openAIResponsesApi(),
|
|
78
|
+
api: attachingImages(now.api === "anthropic-messages" ? anthropicMessagesApi() : openAIResponsesApi()),
|
|
74
79
|
}));
|
|
75
|
-
built = { at, models, model: models.getModel(
|
|
80
|
+
built = { at, models, model: models.getModel(provider, now.model) };
|
|
76
81
|
return built;
|
|
77
82
|
};
|
|
78
83
|
const registry = (model) => {
|
|
@@ -91,3 +96,20 @@ export async function portModels(port, like) {
|
|
|
91
96
|
completeSimple: (model, context, options) => registry(model).completeSimple(model, context, options),
|
|
92
97
|
};
|
|
93
98
|
}
|
|
99
|
+
/** Port models of several ports as one registry (learned-workflow.ts takes one): each listed under its own provider id
|
|
100
|
+
* (PORT_PROVIDER for the session's, tierProvider(tier) for a tier's), a model's request sent through the port it came
|
|
101
|
+
* from. */
|
|
102
|
+
export function tieredModels(byProvider) {
|
|
103
|
+
const of = (model) => {
|
|
104
|
+
const port = byProvider.get(model.provider);
|
|
105
|
+
if (!port)
|
|
106
|
+
throw new Error(`no port of the run lists the model ${model.provider}/${model.id}`);
|
|
107
|
+
return port;
|
|
108
|
+
};
|
|
109
|
+
return {
|
|
110
|
+
getModel: (provider, id) => byProvider.get(provider)?.getModel(provider, id),
|
|
111
|
+
getModels: () => [...byProvider.values()].flatMap((port) => port.getModels()),
|
|
112
|
+
streamSimple: (model, context, options) => of(model).streamSimple(model, context, options),
|
|
113
|
+
completeSimple: (model, context, options) => of(model).completeSimple(model, context, options),
|
|
114
|
+
};
|
|
115
|
+
}
|
package/dist/print.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import type { ImageState } from "./box-image.js";
|
|
2
|
-
/** The line said as the Docker box image's first build (or pull) starts: it takes minutes, and nothing waits on it but
|
|
3
|
-
* a sandbox run's first box. */
|
|
4
|
-
export declare const IMAGE_PREPARING = "Preparing the Docker box image (first start only, a few minutes); agents can be made now, and their first run waits for it.";
|
|
5
|
-
/** The line for the Docker box image's state `state`, said once as its build starts and once as it ends (`started`: the
|
|
6
|
-
* start was said); undefined for any other, an image Docker already had among them. */
|
|
7
|
-
export declare function boxImageLine(state: ImageState, started: boolean): string | undefined;
|
|
8
1
|
/** Where the token came from: made at this start (printed this once), kept in DIR/.token, or the environment's. */
|
|
9
2
|
export type TokenSource = "made" | "file" | "env";
|
|
10
3
|
/** The banner's lines. The token is printed only when this start made it; else where it is. `publicUrl` is the address
|
|
@@ -24,5 +17,5 @@ export declare function banner(o: {
|
|
|
24
17
|
}): string[];
|
|
25
18
|
/** One log line. */
|
|
26
19
|
export declare const logLine: (event: string, fields?: Record<string, string | number>) => string;
|
|
27
|
-
/** A duration as
|
|
20
|
+
/** A duration as --drain-timeout takes it ("8s", "500ms", "1m"), in milliseconds; undefined when it is not one. */
|
|
28
21
|
export declare function durationMs(text: string): number | undefined;
|
package/dist/print.js
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
// What the server prints on stdout: its banner at start, and one line per request, per run start and end, and per
|
|
2
2
|
// refused credential (logfmt: `at=<time> event=<name> key=value ...`). No line holds a token or any part of one.
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import { sentence } from "./errors.js";
|
|
5
|
-
/** The line said as the Docker box image's first build (or pull) starts: it takes minutes, and nothing waits on it but
|
|
6
|
-
* a sandbox run's first box. */
|
|
7
|
-
export const IMAGE_PREPARING = "Preparing the Docker box image (first start only, a few minutes); agents can be made now, and their first run waits for it.";
|
|
8
|
-
/** The line for the Docker box image's state `state`, said once as its build starts and once as it ends (`started`: the
|
|
9
|
-
* start was said); undefined for any other, an image Docker already had among them. */
|
|
10
|
-
export function boxImageLine(state, started) {
|
|
11
|
-
if (state.state === "preparing")
|
|
12
|
-
return started ? undefined : IMAGE_PREPARING;
|
|
13
|
-
if (!started)
|
|
14
|
-
return undefined;
|
|
15
|
-
return state.state === "ready" ? "The Docker box image is ready." : `The Docker box image failed: ${sentence(state.reason)}`;
|
|
16
|
-
}
|
|
17
4
|
/** The banner's lines. The token is printed only when this start made it; else where it is. `publicUrl` is the address
|
|
18
5
|
* people open (AGENTRUN_PUBLIC_URL), which the base URL and the link use. With `accounts` the page is the owner's
|
|
19
6
|
* password, so its link holds no token. `apiOnly`: no console to open, so the line says what is served instead. `boxes`: which boxes are ready, in words (Serve's boxesLine), last. */
|
|
@@ -37,7 +24,7 @@ const value = (v) => {
|
|
|
37
24
|
};
|
|
38
25
|
/** One log line. */
|
|
39
26
|
export const logLine = (event, fields = {}) => [`at=${new Date().toISOString()}`, `event=${event}`, ...Object.entries(fields).map(([k, v]) => `${k}=${value(v)}`)].join(" ");
|
|
40
|
-
/** A duration as
|
|
27
|
+
/** A duration as --drain-timeout takes it ("8s", "500ms", "1m"), in milliseconds; undefined when it is not one. */
|
|
41
28
|
export function durationMs(text) {
|
|
42
29
|
const m = /^(\d+(?:\.\d+)?)(ms|s|m)$/.exec(text.trim());
|
|
43
30
|
return m ? Math.round(Number(m[1]) * { ms: 1, s: 1_000, m: 60_000 }[m[2]]) : undefined;
|
package/dist/propose.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DraftAsk } from "./learn/skills.js";
|
|
1
2
|
import { type Problem } from "./learn/index.js";
|
|
2
3
|
import { type Turn } from "./learning.js";
|
|
3
4
|
import type { Workspace } from "./workspace/index.js";
|
|
@@ -38,4 +39,6 @@ export declare const proposeRun: (input: {
|
|
|
38
39
|
tools?: readonly string[];
|
|
39
40
|
gated?: Readonly<Record<string, string>>;
|
|
40
41
|
deniedBy?: Readonly<Record<string, "agent" | "server" | "default">>;
|
|
42
|
+
ask?: DraftAsk;
|
|
43
|
+
workflows?: false;
|
|
41
44
|
}) => Promise<Proposed>;
|
package/dist/propose.js
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
// Learning, after a run: the notes its end-of-run turn answered with, and a skill or a workflow draft beside them, are read
|
|
2
|
-
// by the host (learn/reflect.ts parseReflection), checked against the commit the run started from (learn/check.ts
|
|
3
|
-
// checkProposal), and kept as its proposal (`learning-proposal.json`, in the directory the caller gives), or dropped. The
|
|
4
|
-
// answer is what the runner's end-of-run turn read from the run's store (runner/learning-end.ts), never the run's work;
|
|
5
|
-
// and no file the run wrote is read at all, in `.learning/` or anywhere. The seed is
|
|
6
|
-
// read from the agent's learning folder through its Workspace, as the reflect hook's check reads it (learn/seed-check.ts):
|
|
7
|
-
// the snapshot and its bodies when main is the seed (no exec), else one read-only exec of the learning script at that
|
|
8
|
-
// commit. Nothing is written to git here, and nothing is written at all before the checks pass: what they refuse (a
|
|
9
|
-
// note holding a secret among them) is never kept anywhere.
|
|
10
1
|
import { join } from "node:path";
|
|
11
2
|
import { checkProposal, draftDryRun, draftFiles, NOTE_BLOCK, unstorable, parseReflection, redactSecrets, shortMessage, SKILL_BLOCK, SKILLS_DIR, WORKFLOW_BLOCK, WORKFLOWS_DIR } from "./learn/index.js";
|
|
12
3
|
import { folderAt, readLearning, readSnapshot } from "./learn/folder.js";
|
|
13
4
|
import { baseOf } from "./learn/seed-check.js";
|
|
5
|
+
import { parseNoteFile, ruleOf } from "./learn/notes.js";
|
|
14
6
|
import { writeDurable } from "./files.js";
|
|
15
7
|
import { PROPOSAL } from "./learning.js";
|
|
16
8
|
/** The rules that refuse a proposal whole, whatever item they name: a path outside what a run may write, a deletion,
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* text whole first. */
|
|
22
|
-
const WHOLE = new Set(["outside", "deleted", "
|
|
9
|
+
* anything that must never be stored (a secret, a character a reader does not see), which says the run's answer is
|
|
10
|
+
* not to be trusted for any item, and text that is not UTF-8, which cannot be read for one. Every other problem is its
|
|
11
|
+
* item's alone: a count cap names the items past it (learn/check.ts), a size cap the item over it, the index's lines
|
|
12
|
+
* the notes that add lines from the answer's end, and they are left out and the rest kept; unstorable reads every
|
|
13
|
+
* item's text whole first. */
|
|
14
|
+
const WHOLE = new Set(["outside", "deleted", "secret_value", "secret_shape", "invisible_unicode", "encoding"]);
|
|
23
15
|
/** The item a changed file belongs to: a draft's two files are one item (its folder), every other file is itself. */
|
|
24
16
|
const itemOf = (path) => (path.startsWith(`${WORKFLOWS_DIR}/`) ? path.split("/").slice(0, 2).join("/") : path);
|
|
25
17
|
const utf8 = new TextDecoder("utf-8", { fatal: true });
|
|
@@ -100,10 +92,20 @@ export const proposeRun = async (input) => {
|
|
|
100
92
|
}
|
|
101
93
|
const given = [...fileGroups.values()];
|
|
102
94
|
// The seed is read whatever the answer: a seed the folder does not hold fails the check.
|
|
103
|
-
|
|
95
|
+
// The seed's active notes are read too: a new note of the same rule as one (notes.ts ruleOf) is a duplicate.
|
|
96
|
+
const activeOf = (seedSnapshot) => seedSnapshot.notes.filter((note) => note.status === "active").map((note) => note.file);
|
|
97
|
+
// And the skill of each draft's name, as the folder holds it: what the draft keeps as a workflow, for the grader.
|
|
98
|
+
const skillOf = (draft) => `${SKILLS_DIR}/${draft.split("/")[1]}/SKILL.md`;
|
|
99
|
+
const draftSkills = given.flat().filter(({ file }) => file.endsWith("/workflow.json")).map(({ file }) => skillOf(file));
|
|
100
|
+
const { snapshot, texts } = await seedAt(input.folder, input.seed, (seedSnapshot) => (parsed.ok ? [...parsed.notes.map(({ file }) => file), ...given.flat().map(({ file }) => file), ...draftSkills, ...activeOf(seedSnapshot)] : []));
|
|
104
101
|
if (!parsed.ok)
|
|
105
102
|
return parsed.reason === "empty" ? { state: "dropped", reason: "empty" } : { state: "dropped", reason: "unparsed", detail: parsed.detail };
|
|
106
|
-
const { base, kept } = baseOf(snapshot);
|
|
103
|
+
const { base: seedBase, kept } = baseOf(snapshot);
|
|
104
|
+
const rules = new Map(activeOf(snapshot).flatMap((file) => {
|
|
105
|
+
const note = texts.has(file) ? parseNoteFile(file, texts.get(file)) : undefined;
|
|
106
|
+
return note && !Array.isArray(note) ? [[ruleOf(note.body), file]] : [];
|
|
107
|
+
}));
|
|
108
|
+
const base = { ...seedBase, rules };
|
|
107
109
|
const held = new Set(base.files);
|
|
108
110
|
const files = given.filter((group) => group.some(({ file, text }) => texts.get(file) !== text)).flat();
|
|
109
111
|
const changeOf = ({ file, text }) => ({ path: file, status: held.has(file) ? "modified" : "added", mode: "100644", bytes: Buffer.from(text) });
|
|
@@ -129,7 +131,7 @@ export const proposeRun = async (input) => {
|
|
|
129
131
|
return { state: "dropped", reason: "checker", problems: leaky };
|
|
130
132
|
// A skill or a draft whose seed text has a status is a person's call (retired, or waiting for their OK): never changed.
|
|
131
133
|
const dryRuns = {};
|
|
132
|
-
const check = (some) => checkProposal({ base, changes: some, refuseValues: input.refuse, ...(kept.length ? { kept } : {}), ...(input.outcome === undefined ? {} : { outcome: input.outcome }), ...(input.tools ? { tools: input.tools } : {}), ...(input.gated ? { gated: input.gated } : {}), ...(input.deniedBy ? { deniedBy: input.deniedBy } : {}), ...(dsl ? { dsl, dryRuns } : {}) });
|
|
134
|
+
const check = (some) => checkProposal({ base, changes: some, refuseValues: input.refuse, ...(input.workflows === false ? { workflows: false } : {}), ...(kept.length ? { kept } : {}), ...(input.outcome === undefined ? {} : { outcome: input.outcome }), ...(input.tools ? { tools: input.tools } : {}), ...(input.gated ? { gated: input.gated } : {}), ...(input.deniedBy ? { deniedBy: input.deniedBy } : {}), ...(input.ask ? { ask: input.ask } : {}), ...(dsl ? { dsl, dryRuns } : {}) });
|
|
133
135
|
// The static checks first, every one (validateWorkflow with executeCode: false, draftProblems' refusal of code nodes,
|
|
134
136
|
// caps, secrets): a draft they refuse is never dry-run, nor is any when they refuse the answer whole. Then each draft
|
|
135
137
|
// left is dry-run on its example, else on a synthesized input (learn/skills.ts draftDryRun): every model and tool
|
|
@@ -182,7 +184,11 @@ export const proposeRun = async (input) => {
|
|
|
182
184
|
const triggered = (input.turn.triggered ?? []).map(({ source, text }) => ({ source, text: shortMessage(redactSecrets(text, input.refuse, Number.POSITIVE_INFINITY)) }));
|
|
183
185
|
// How each kept draft's dry run went, for the grader: passed, or not run and why.
|
|
184
186
|
const ran = Object.fromEntries(passing.filter(({ file }) => dryRuns[file]).map(({ file }) => [file, dryRuns[file]]));
|
|
185
|
-
|
|
187
|
+
// Each kept draft's skill as the folder holds it at the seed, unless the proposal gives that skill itself (the grader
|
|
188
|
+
// reads it there): the format the draft's answer keeps (#2412). Cut of the host's secrets, as what was said is.
|
|
189
|
+
const proposing = new Set(passing.map(({ file }) => file));
|
|
190
|
+
const drafted = passing.filter(({ file }) => file.endsWith("/workflow.json")).map(({ file }) => skillOf(file)).filter((file) => !proposing.has(file) && texts.has(file)).map((file) => ({ file, text: redactSecrets(texts.get(file), input.refuse, Number.POSITIVE_INFINITY) }));
|
|
191
|
+
const proposal = { seed: input.seed, notes: checked.notes.map(({ file, text }) => ({ file, text })), ...(passing.length ? { files: passing } : {}), ...(Object.keys(ran).length ? { dryRuns: ran } : {}), ...(drafted.length ? { drafted } : {}), asked, ...(triggered.length ? { triggered } : {}) };
|
|
186
192
|
await writeDurable(join(input.runDir, PROPOSAL), `${JSON.stringify(proposal)}\n`);
|
|
187
193
|
const count = (suffix) => passing.filter(({ file }) => file.endsWith(suffix)).length;
|
|
188
194
|
return { state: "proposed", notes: proposal.notes.length, skills: count("/SKILL.md"), workflows: count("/workflow.json"), ...(left.length ? { left } : {}) };
|
package/dist/run-cut.d.ts
CHANGED
|
@@ -13,6 +13,11 @@ export declare function runCutValues(deps: {
|
|
|
13
13
|
}): Promise<{
|
|
14
14
|
values: string[];
|
|
15
15
|
} | "unreadable">;
|
|
16
|
+
/** `build` against run `runId`'s cut, and the cut read again once it is built: `build` is made again, under the cut as it then
|
|
17
|
+
* stood, until the cut it ran under is the cut after it. The cut only grows (a value saved stays held), so a cut that is the
|
|
18
|
+
* same after a build holds every value saved before that build's reads, and what `build` rendered under it is cut of all
|
|
19
|
+
* of them. A cut that keeps growing past CUT_TRIES builds fails closed: `build` is made under `unreadable`, the run withheld. */
|
|
20
|
+
export declare function underCut<T>(read: () => Promise<Awaited<ReturnType<typeof runCutValues>>>, build: (cut: Awaited<ReturnType<typeof runCutValues>>) => Promise<T>): Promise<T>;
|
|
16
21
|
/** Run `runId`'s error words: how its error text reads wherever it is served (its view's error, its Timeline's error
|
|
17
22
|
* rows), main's errorWords: a refused key in plain words (key-refusal.ts keyRefusal, the key its harness's route sends
|
|
18
23
|
* by this server's settings and keys), else the text by the one rule (shownOf); `unreadable` when the run is withheld.
|
package/dist/run-cut.js
CHANGED
|
@@ -18,6 +18,25 @@ export async function runCutValues(deps, store, runId, known) {
|
|
|
18
18
|
return "unreadable";
|
|
19
19
|
return { values: [...deps.serverSecrets(), ...handed.refs.filter((ref) => ref.length >= MIN_SECRET)] };
|
|
20
20
|
}
|
|
21
|
+
/** How many times `underCut` builds again against a cut that grew while it built, before it gives up and withholds. */
|
|
22
|
+
const CUT_TRIES = 5;
|
|
23
|
+
/** `build` against run `runId`'s cut, and the cut read again once it is built: `build` is made again, under the cut as it then
|
|
24
|
+
* stood, until the cut it ran under is the cut after it. The cut only grows (a value saved stays held), so a cut that is the
|
|
25
|
+
* same after a build holds every value saved before that build's reads, and what `build` rendered under it is cut of all
|
|
26
|
+
* of them. A cut that keeps growing past CUT_TRIES builds fails closed: `build` is made under `unreadable`, the run withheld. */
|
|
27
|
+
export async function underCut(read, build) {
|
|
28
|
+
const same = (a, b) => a === "unreadable" || b === "unreadable" ? a === b : new Set(a.values).size === new Set([...a.values, ...b.values]).size && new Set(b.values).size === new Set(a.values).size;
|
|
29
|
+
let cut = await read();
|
|
30
|
+
for (let tries = 1;; tries++) {
|
|
31
|
+
const built = await build(cut);
|
|
32
|
+
const now = await read();
|
|
33
|
+
if (same(cut, now))
|
|
34
|
+
return built;
|
|
35
|
+
if (tries >= CUT_TRIES)
|
|
36
|
+
return build("unreadable");
|
|
37
|
+
cut = now;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
21
40
|
/** Run `runId`'s error words: how its error text reads wherever it is served (its view's error, its Timeline's error
|
|
22
41
|
* rows), main's errorWords: a refused key in plain words (key-refusal.ts keyRefusal, the key its harness's route sends
|
|
23
42
|
* by this server's settings and keys), else the text by the one rule (shownOf); `unreadable` when the run is withheld.
|
package/dist/run-db.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// How the server opens a run's database, run.sqlite, which the run's own process writes: in WAL, under an exclusive lock,
|
|
2
|
-
// with no automatic checkpoint, and ended by process.exit with no close
|
|
2
|
+
// with no automatic checkpoint, and ended by process.exit with no close,
|
|
3
3
|
// so its WAL stays until whoever takes the run back checkpoints it. The server never opens it read-write while a
|
|
4
4
|
// process holds the run: every read is a fresh read-only open with no locking (`vfs=unix-none`) and an exclusive
|
|
5
5
|
// locking mode (the WAL index in heap, no -shm), kept for that read alone, since a connection kept open falls behind
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// guard). The one read-write open is the checkpoint when the server takes the run back (runs.ts), with no process left.
|
|
8
8
|
import { closeSync, openSync, readSync, statSync } from "node:fs";
|
|
9
9
|
import { DatabaseSync } from "node:sqlite";
|
|
10
|
-
import { walHasCommit } from "
|
|
10
|
+
import { walHasCommit } from "./workflow/wal.js";
|
|
11
11
|
const observers = new Set();
|
|
12
12
|
/** Tells `observer` of every open of a run's database from here on (tests); the returned call stops it. */
|
|
13
13
|
export function observeRunDbOpens(observer) {
|
|
@@ -60,7 +60,7 @@ export function readRunDbSync(file, held, read) {
|
|
|
60
60
|
for (let attempt = 1;; attempt++) {
|
|
61
61
|
for (const observer of observers)
|
|
62
62
|
observer({ file, mode: "read", held });
|
|
63
|
-
// A WAL is opened only once it holds a commit SQLite's recovery takes (
|
|
63
|
+
// A WAL is opened only once it holds a commit SQLite's recovery takes (workflow/wal.ts walHasCommit).
|
|
64
64
|
const immutable = !walHasCommit(`${file}-wal`);
|
|
65
65
|
const before = immutable ? fileMark(file) : undefined;
|
|
66
66
|
runDbTestHooks.afterPlan?.(file);
|
package/dist/run-launch.d.ts
CHANGED
|
@@ -44,9 +44,12 @@ export interface RunLaunch {
|
|
|
44
44
|
* # Learned text to lay into the prompt for those notes (what the old layLearned laid), within the learning budget; and
|
|
45
45
|
* `seedNotes`, the count of all notes in the seed before the budget picked `given` (present with a read seed; absent when
|
|
46
46
|
* the seed could not be read); `skills`, the names of the learned skills the seed offers the run (each active one that
|
|
47
|
-
* fits a run's skill budget at all; its claim lays them), absent when none; `
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* fits a run's skill budget at all; its claim lays them), absent when none; `workflows`, the names of the learned
|
|
48
|
+
* workflows the seed offers its learned_workflow tool (chooseWorkflows), absent when none; `notesOnly`, a run of a
|
|
49
|
+
* revision that says `learning: "notes"`: given its notes and skills but never a learned workflow, and asked for no
|
|
50
|
+
* workflow draft at its end; `gradeModel`, the model the
|
|
51
|
+
* server names to grade what the run proposes (learning.ts gradeModelOf: --grade-model, else AGENTRUN_SERVE_GRADE_MODEL,
|
|
52
|
+
* else AGENT_MODEL_STRONG), absent when it names none and the agent's own grades it; and `seedFailed`, why it starts with
|
|
50
53
|
* nothing learned when it does (SeedFailed). Absent when the run does not learn. */
|
|
51
54
|
readonly learning?: {
|
|
52
55
|
readonly given: readonly {
|
|
@@ -57,6 +60,8 @@ export interface RunLaunch {
|
|
|
57
60
|
readonly section: string;
|
|
58
61
|
readonly seedNotes?: number;
|
|
59
62
|
readonly skills?: readonly string[];
|
|
63
|
+
readonly workflows?: readonly string[];
|
|
64
|
+
readonly notesOnly?: true;
|
|
60
65
|
readonly gradeModel?: string;
|
|
61
66
|
readonly seedFailed?: SeedFailed;
|
|
62
67
|
};
|
|
@@ -66,6 +71,16 @@ export interface RunLaunch {
|
|
|
66
71
|
readonly inputOrigin?: MessageOrigin;
|
|
67
72
|
/** A run that re-asks its agent after it ends (a trigger's follow-up). */
|
|
68
73
|
readonly followUp?: boolean;
|
|
74
|
+
/** The Archil disk the run keeps its folder on (Archil mode), chosen at its start: the one its launch named (`launch`, a
|
|
75
|
+
* customer's disk agentrun never makes or removes), or its agent's when the agent had one then (`agent`). Absent, the
|
|
76
|
+
* run uses its agent's disk, made at its claim when the agent has none (workspace/run-disk.ts). Kept here so every
|
|
77
|
+
* claim, revoke and reclaim of the run, after a restart too, acts on that one disk. */
|
|
78
|
+
readonly archilDisk?: LaunchDisk;
|
|
79
|
+
}
|
|
80
|
+
/** The disk a launch record names, and whose it is. */
|
|
81
|
+
export interface LaunchDisk {
|
|
82
|
+
readonly diskId: string;
|
|
83
|
+
readonly kind: "launch" | "agent";
|
|
69
84
|
}
|
|
70
85
|
/** The input's origin kept through the fail-safe (#1856): the stored one only if it names `trigger` with
|
|
71
86
|
* owner === (its source is a schedule), else that trigger's own with owner false (its source a best-effort label: the
|
package/dist/run-launch.js
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
// that trigger's own with owner false, so a forged or lost origin never reads as the person's or the owner's.
|
|
9
9
|
import { originOf } from "./timeline/index.js";
|
|
10
10
|
import { isObject } from "./validate.js";
|
|
11
|
+
/** The disk a launch body names, as read back, or undefined. */
|
|
12
|
+
const readDisk = (value) => isObject(value) && typeof value.disk_id === "string" && (value.kind === "launch" || value.kind === "agent") ? { diskId: value.disk_id, kind: value.kind } : undefined;
|
|
11
13
|
/** The trigger a launch body names, as read back: `{ id, firing_key }`, or null (triggerOf of the old serve.json). */
|
|
12
14
|
function readTrigger(value) {
|
|
13
15
|
return isObject(value) && typeof value.id === "string" && typeof value.firing_key === "string" ? { id: value.id, firing_key: value.firing_key } : null;
|
|
@@ -56,23 +58,25 @@ export function launchBody(launch) {
|
|
|
56
58
|
...(launch.boxAllow !== undefined ? { box_allow: launch.boxAllow } : {}),
|
|
57
59
|
...(launch.boxAllowSet ? { box_allow_set: true } : {}),
|
|
58
60
|
...(launch.files?.length ? { files: launch.files } : {}),
|
|
59
|
-
...(launch.learning ? { learning: { given: launch.learning.given.map((note) => ({ file: note.file, name: note.name })), seed: launch.learning.seed, section: launch.learning.section, ...(launch.learning.seedNotes !== undefined ? { seedNotes: launch.learning.seedNotes } : {}), ...(launch.learning.skills?.length ? { skills: [...launch.learning.skills] } : {}), ...(launch.learning.gradeModel ? { gradeModel: launch.learning.gradeModel } : {}), ...(launch.learning.seedFailed ? { seedFailed: launch.learning.seedFailed } : {}) } } : {}),
|
|
61
|
+
...(launch.learning ? { learning: { given: launch.learning.given.map((note) => ({ file: note.file, name: note.name })), seed: launch.learning.seed, section: launch.learning.section, ...(launch.learning.seedNotes !== undefined ? { seedNotes: launch.learning.seedNotes } : {}), ...(launch.learning.skills?.length ? { skills: [...launch.learning.skills] } : {}), ...(launch.learning.notesOnly ? { notesOnly: true } : {}), ...(launch.learning.workflows?.length ? { workflows: [...launch.learning.workflows] } : {}), ...(launch.learning.gradeModel ? { gradeModel: launch.learning.gradeModel } : {}), ...(launch.learning.seedFailed ? { seedFailed: launch.learning.seedFailed } : {}) } } : {}),
|
|
60
62
|
...(launch.trigger ? { trigger: launch.trigger } : {}),
|
|
61
63
|
...(launch.inputOrigin ? { input_origin: launch.inputOrigin } : {}),
|
|
62
64
|
...(launch.followUp ? { follow_up: true } : {}),
|
|
65
|
+
...(launch.archilDisk ? { archil_disk: { disk_id: launch.archilDisk.diskId, kind: launch.archilDisk.kind } } : {}),
|
|
63
66
|
};
|
|
64
67
|
}
|
|
65
68
|
/** The learning start a launch body names, as read back: its given notes (each {file, name}), its seed sha, its # Learned
|
|
66
|
-
* section text, the learned skills it was offered, its grade model and why its seed failed, or undefined
|
|
67
|
-
* names none (a run that does not learn). */
|
|
69
|
+
* section text, the learned skills and workflows it was offered, its grade model and why its seed failed, or undefined
|
|
70
|
+
* when the body names none (a run that does not learn). */
|
|
68
71
|
function readLearning(value) {
|
|
69
72
|
if (!isObject(value))
|
|
70
73
|
return undefined;
|
|
71
74
|
const given = Array.isArray(value.given) ? value.given.flatMap((note) => (isObject(note) && typeof note.file === "string" && typeof note.name === "string" ? [{ file: note.file, name: note.name }] : [])) : [];
|
|
72
75
|
const seed = typeof value.seed === "string" ? value.seed : null;
|
|
73
76
|
const section = typeof value.section === "string" ? value.section : "";
|
|
74
|
-
const
|
|
75
|
-
|
|
77
|
+
const names = (list) => (Array.isArray(list) ? list.filter((name) => typeof name === "string") : []);
|
|
78
|
+
const [skills, workflows] = [names(value.skills), names(value.workflows)];
|
|
79
|
+
return { given, seed, section, ...(typeof value.seedNotes === "number" ? { seedNotes: value.seedNotes } : {}), ...(skills.length ? { skills } : {}), ...(workflows.length ? { workflows } : {}), ...(value.notesOnly === true ? { notesOnly: true } : {}), ...(typeof value.gradeModel === "string" && value.gradeModel !== "" ? { gradeModel: value.gradeModel } : {}), ...(typeof value.seedFailed === "string" && SEED_FAILURES.includes(value.seedFailed) ? { seedFailed: value.seedFailed } : {}) };
|
|
76
80
|
}
|
|
77
81
|
/** A launch body read back into a `RunLaunch`, with the input-origin fail-safe applied through the body's own trigger, or
|
|
78
82
|
* undefined when the body is not one (not an object, or it names no place: a damaged or hand-edited body). */
|
|
@@ -86,6 +90,7 @@ export function readLaunchBody(stored) {
|
|
|
86
90
|
const inputOrigin = keepInputOrigin(stored.input_origin, trigger);
|
|
87
91
|
const model = readModel(stored.model);
|
|
88
92
|
const boxAllow = readBoxAllow(stored.box_allow);
|
|
93
|
+
const archilDisk = readDisk(stored.archil_disk);
|
|
89
94
|
return {
|
|
90
95
|
input: stored.input,
|
|
91
96
|
title: typeof stored.title === "string" ? stored.title : "",
|
|
@@ -105,6 +110,7 @@ export function readLaunchBody(stored) {
|
|
|
105
110
|
...(trigger ? { trigger } : {}),
|
|
106
111
|
...(inputOrigin ? { inputOrigin } : {}),
|
|
107
112
|
...(stored.follow_up === true ? { followUp: true } : {}),
|
|
113
|
+
...(archilDisk ? { archilDisk } : {}),
|
|
108
114
|
};
|
|
109
115
|
}
|
|
110
116
|
/** The run's learning start (its given notes, its seed sha and its # Learned section), read from one place by learning's
|
|
@@ -36,6 +36,17 @@ export declare function servedRunLearning(deps: {
|
|
|
36
36
|
tokens: {
|
|
37
37
|
grade: import("./learning.js").Tokens | null;
|
|
38
38
|
};
|
|
39
|
+
used: {
|
|
40
|
+
skills: {
|
|
41
|
+
name: string;
|
|
42
|
+
read: boolean;
|
|
43
|
+
}[];
|
|
44
|
+
workflows: {
|
|
45
|
+
name: string;
|
|
46
|
+
calls: number;
|
|
47
|
+
failed: number;
|
|
48
|
+
}[];
|
|
49
|
+
};
|
|
39
50
|
given?: import("./learning.js").NoteUsed[];
|
|
40
51
|
read?: import("./learning.js").NoteUsed[];
|
|
41
52
|
learned?: import("./learning.js").NoteLearned[];
|
|
@@ -43,7 +54,7 @@ export declare function servedRunLearning(deps: {
|
|
|
43
54
|
workflows?: import("./learning.js").LearnedFile[];
|
|
44
55
|
run: string;
|
|
45
56
|
state: "proposed" | "merged" | "seeded" | "reflecting" | "dropped";
|
|
46
|
-
reason: "
|
|
57
|
+
reason: "cancelled" | "empty" | "unparsed" | "seed_failed" | "no_budget" | "unknown_cost" | "crashed" | "reflect_timeout" | "reflect_failed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
47
58
|
detail: string | null;
|
|
48
59
|
at: string;
|
|
49
60
|
} | null>;
|
package/dist/run-manifest.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Workspace } from "./workspace/index.js";
|
|
2
2
|
/** The most files the line names; the rest are counted. */
|
|
3
3
|
export declare const MANIFEST_ENTRIES = 20;
|
|
4
|
-
/** The most the first message may take, as the JSON string the run's door is sent:
|
|
5
|
-
* at most 1 MiB
|
|
4
|
+
/** The most the first message may take, as the JSON string the run's door is sent: a door takes a body of
|
|
5
|
+
* at most 1 MiB, and this leaves room for the request's other fields. */
|
|
6
6
|
export declare const FIRST_MESSAGE_BYTES: number;
|
|
7
7
|
/** `bytes` as a person reads a size: `32 B`, `1.5 KB`, `2.0 MB`. */
|
|
8
8
|
export declare const sizeOf: (bytes: number) => string;
|
package/dist/run-manifest.js
CHANGED
|
@@ -7,8 +7,8 @@ import { INPUTS_DIR } from "./uploads.js";
|
|
|
7
7
|
import { workspaceAt } from "./workspace/index.js";
|
|
8
8
|
/** The most files the line names; the rest are counted. */
|
|
9
9
|
export const MANIFEST_ENTRIES = 20;
|
|
10
|
-
/** The most the first message may take, as the JSON string the run's door is sent:
|
|
11
|
-
* at most 1 MiB
|
|
10
|
+
/** The most the first message may take, as the JSON string the run's door is sent: a door takes a body of
|
|
11
|
+
* at most 1 MiB, and this leaves room for the request's other fields. */
|
|
12
12
|
export const FIRST_MESSAGE_BYTES = (1 << 20) - 4096;
|
|
13
13
|
/** `bytes` as a person reads a size: `32 B`, `1.5 KB`, `2.0 MB`. */
|
|
14
14
|
export const sizeOf = (bytes) => bytes < 1024 ? `${bytes} B` : bytes < 1024 * 1024 ? `${(bytes / 1024).toFixed(1)} KB` : `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|