@iowarp/clio-coder 0.3.4 → 0.3.7
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 +65 -2
- package/CONTRIBUTING.md +6 -6
- package/README.md +16 -5
- package/dist/{acp-S5R4RR5B.js → acp-SK4MD6MM.js} +11 -11
- package/dist/{agents-P6DMMVZY.js → agents-2FN2K6ME.js} +33 -26
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-2XCZLPKS.js → auth-QIYZWM5I.js} +15 -15
- package/dist/{chunk-EKMEHE4H.js → chunk-33YXPOE3.js} +2 -3
- package/dist/{chunk-VAWWTKDP.js → chunk-3HAPLH5M.js} +11 -11
- package/dist/{chunk-YCWGATWI.js → chunk-465YSENW.js} +3 -3
- package/dist/{chunk-4OC57DA6.js → chunk-4DGYLA73.js} +53 -2
- package/dist/{chunk-UZHIZC5S.js → chunk-4DWFMQDR.js} +61 -76
- package/dist/{chunk-ZWMF7253.js → chunk-5C3AQNDW.js} +328 -9
- package/dist/{chunk-22NAGB7X.js → chunk-5C77SEEY.js} +5 -94
- package/dist/{chunk-WPQLXFOZ.js → chunk-5FR74PWO.js} +3 -2
- package/dist/{chunk-35MKKU5R.js → chunk-5UJ6ECTS.js} +18 -10
- package/dist/{chunk-BRXQQJFP.js → chunk-6M7VS3J3.js} +571 -50
- package/dist/{chunk-QQK64KLB.js → chunk-6TUKSZVF.js} +141 -23
- package/dist/{chunk-N4CZJQRK.js → chunk-AB4XIIVB.js} +8 -6
- package/dist/{chunk-KRPY7NTG.js → chunk-BMWK7ZIZ.js} +14 -20
- package/dist/{chunk-4BPJXDWC.js → chunk-C4JBQ5SR.js} +30 -14
- package/dist/{chunk-ZYKPLLNQ.js → chunk-CEYBNUGC.js} +821 -83
- package/dist/{chunk-VEZEGCGW.js → chunk-D4MDIG46.js} +20 -18
- package/dist/chunk-DJNLUABN.js +843 -0
- package/dist/{chunk-BP4OYD6A.js → chunk-DMD2AGVS.js} +21 -2
- package/dist/{chunk-KOHPCX4K.js → chunk-DOOEX22V.js} +2 -2
- package/dist/chunk-DQA7QLMD.js +123 -0
- package/dist/chunk-DR52UMZW.js +21 -0
- package/dist/{chunk-3HZ5RWN2.js → chunk-EBEFWSGL.js} +9 -7
- package/dist/{chunk-EDRHSCIE.js → chunk-EELBMBT6.js} +128 -13
- package/dist/{chunk-HV5X7OR2.js → chunk-EOOQZZDE.js} +16 -14
- package/dist/{chunk-WR67VIZY.js → chunk-FOT2FX5J.js} +63 -5
- package/dist/{chunk-BPGS2WCQ.js → chunk-GEYXPTRF.js} +2 -1
- package/dist/{chunk-FYYLNIL5.js → chunk-GH5622CP.js} +2 -2
- package/dist/{chunk-BEY543CS.js → chunk-GOXNB3AO.js} +5 -2
- package/dist/chunk-GWS3VEIW.js +195 -0
- package/dist/{chunk-G4BMMOKF.js → chunk-HVDIIIQW.js} +2 -2
- package/dist/chunk-HWUFFB6L.js +83 -0
- package/dist/{chunk-X6COSD2O.js → chunk-J7PIKKWC.js} +8 -436
- package/dist/{chunk-NILBFAPG.js → chunk-JNXPYBB4.js} +2 -2
- package/dist/{chunk-4VP4KH3K.js → chunk-JRIO5UD2.js} +4 -4
- package/dist/{chunk-K6WL7QZT.js → chunk-JTSEDYVQ.js} +7 -7
- package/dist/{chunk-QKMUKYO7.js → chunk-KCMKRQX4.js} +236 -84
- package/dist/chunk-KZ2H5X4G.js +1026 -0
- package/dist/{chunk-A2GZF7DC.js → chunk-LADCF22A.js} +13 -13
- package/dist/chunk-LCGCVYZ4.js +57 -0
- package/dist/chunk-M4AKACEO.js +382 -0
- package/dist/{chunk-POHLU5DW.js → chunk-M6L6IDJG.js} +3 -3
- package/dist/{chunk-4JUF2NNX.js → chunk-MXI6J5JF.js} +7 -7
- package/dist/{chunk-X4RCMKVQ.js → chunk-NDINPTJ4.js} +2 -2
- package/dist/{chunk-TTNYS3EA.js → chunk-OB5HIGJY.js} +1 -1
- package/dist/{chunk-7RXG6QRZ.js → chunk-OBMAI2DP.js} +61 -840
- package/dist/{chunk-5M54SPOL.js → chunk-ODFEOB4F.js} +161 -5
- package/dist/chunk-PD3MESLB.js +242 -0
- package/dist/{chunk-ED4KHGC3.js → chunk-PPAMZ32Z.js} +9 -2
- package/dist/{chunk-VMNQ6OZA.js → chunk-QCTRSGHQ.js} +963 -786
- package/dist/chunk-RVG5JXAL.js +41 -0
- package/dist/{chunk-RD5U66HV.js → chunk-SROCI7ZU.js} +7 -7
- package/dist/{chunk-MFFY33HR.js → chunk-THKY7CD7.js} +466 -205
- package/dist/{chunk-34475P3I.js → chunk-TSHXZTOQ.js} +5 -4
- package/dist/{chunk-PCZJO5TI.js → chunk-UFQ3F4FW.js} +13 -178
- package/dist/{chunk-AD2SYQYC.js → chunk-UHXRNZ2J.js} +121 -3
- package/dist/chunk-UND3GU2L.js +103 -0
- package/dist/{chunk-QQL5RT5M.js → chunk-UUANF5CR.js} +2323 -2114
- package/dist/{chunk-VJWL6YS5.js → chunk-UUVG37B4.js} +2 -2
- package/dist/chunk-UVDSQ6LW.js +472 -0
- package/dist/{chunk-QWU7ZBO7.js → chunk-VQNODYQ4.js} +215 -56
- package/dist/chunk-VREKEFLL.js +37 -0
- package/dist/{chunk-2TZWSW76.js → chunk-WHGPSPT5.js} +2 -2
- package/dist/{chunk-TW3WDMVS.js → chunk-WHJYKASB.js} +2 -2
- package/dist/{chunk-MEQ45TQ4.js → chunk-WJHBC77E.js} +21 -7
- package/dist/{chunk-HXG4IURW.js → chunk-X2KV5FXT.js} +2 -2
- package/dist/{chunk-YHZX5GEU.js → chunk-XAKHZX5N.js} +2 -2
- package/dist/{chunk-2LZI5CAG.js → chunk-XEGB6BCN.js} +228 -36
- package/dist/{chunk-E25LMLRW.js → chunk-YD734TPH.js} +2 -2
- package/dist/{verifiers-4UUM6TEE.js → chunk-YTYFXUI3.js} +121 -372
- package/dist/{chunk-3JLKSKD7.js → chunk-ZGH7FGS5.js} +17 -7
- package/dist/{chunk-VSNATDE6.js → chunk-ZZMN5OM4.js} +2 -2
- package/dist/cli/index.js +34 -32
- package/dist/{clio-J5JIOIDS.js → clio-WBVQEBKO.js} +7 -7
- package/dist/{code-nav-AXCXSBHX.js → code-nav-FGGFIE7L.js} +7 -7
- package/dist/codewiki/build-worker.js +4 -4
- package/dist/{components-KELWS457.js → components-F7OEATSO.js} +5 -5
- package/dist/{config-OEBMIN2U.js → config-TRBL3RCF.js} +48 -41
- package/dist/{configure-PUQOSIXQ.js → configure-OLCVPHNM.js} +17 -17
- package/dist/{context-URSXPBCK.js → context-MJIJ6GOX.js} +12 -12
- package/dist/{context-EKDCKUUZ.js → context-WFPKQSM6.js} +26 -9
- package/dist/{context-MGSE4Z2T.js → context-XEWE3MOJ.js} +44 -37
- package/dist/{context-clear-KDAJRNUK.js → context-clear-KNOS2JPB.js} +44 -37
- package/dist/{context-index-BZ4UYMTC.js → context-index-SSR5ECNE.js} +3 -3
- package/dist/{context-working-set-SBKMPPI2.js → context-working-set-EUXAZI6N.js} +14 -13
- package/dist/{dispatch-runner-MSWN72NK.js → dispatch-runner-B7MTOVKL.js} +321 -60
- package/dist/{docs-2C2LTVT2.js → docs-FLJTIDSE.js} +5 -5
- package/dist/{doctor-7BSE27PJ.js → doctor-RN4YKO2X.js} +15 -15
- package/dist/{eval-IZGDOO4H.js → eval-RUBJVSNQ.js} +52 -236
- package/dist/{evidence-SR7WXB5B.js → evidence-JZNBUOQZ.js} +39 -33
- package/dist/{evolve-K7VE2CBX.js → evolve-FJVC4KKI.js} +39 -33
- package/dist/{extensions-QVDOHDGJ.js → extensions-IQL36S7K.js} +5 -5
- package/dist/{fleet-7XMJNQNF.js → fleet-BDKYJFCP.js} +243 -370
- package/dist/fleet-commands-ZFIWZSB3.js +70 -0
- package/dist/fleet-graph-Y6HPXIVF.js +125 -0
- package/dist/fleet-new-RDVJLHHH.js +48 -0
- package/dist/{fleet-preflight-AQNAH644.js → fleet-preflight-BHSNPBMH.js} +2 -2
- package/dist/fleet-validate-BIYREGIK.js +79 -0
- package/dist/{init-JGNPAYXT.js → init-LQUB5COQ.js} +57 -48
- package/dist/library-NJAHIGG4.js +217 -0
- package/dist/memory-OG6HOYKM.js +472 -0
- package/dist/{models-ZMMLFJNN.js → models-5ZG5XY7J.js} +23 -22
- package/dist/{monitor-2F3T5KHP.js → monitor-TJ7AMTGB.js} +69 -35
- package/dist/{orchestrator-ORHT43JB.js → orchestrator-WZYB54DM.js} +4868 -1189
- package/dist/{paths-UXLN5YYZ.js → paths-XUC7GS6E.js} +5 -5
- package/dist/{reset-NXGTYNUO.js → reset-PXQT45IY.js} +8 -8
- package/dist/{run-RF4WJGMT.js → run-FQ74YF62.js} +82 -62
- package/dist/{share-UT3W6E4M.js → share-FW7SVCL3.js} +34 -10
- package/dist/{skills-PSACKC5Q.js → skills-7E7IRB3R.js} +25 -9
- package/dist/{skills-eval-WJSI55RZ.js → skills-eval-LI75W6OK.js} +43 -35
- package/dist/{targets-PIIRAOYS.js → targets-4CIFKCTW.js} +27 -24
- package/dist/{terminal-lease-ULWXWNVY.js → terminal-lease-WUZY7ZV5.js} +5 -4
- package/dist/{uninstall-FZCQCDKC.js → uninstall-7FV7IP4E.js} +5 -5
- package/dist/{upgrade-346TZ6AV.js → upgrade-K2HVIVMQ.js} +21 -20
- package/dist/{usage-6KKXR32N.js → usage-GTZELZQX.js} +159 -59
- package/dist/verifiers-RLAHT27O.js +336 -0
- package/dist/{verify-X5HDROLA.js → verify-BX3BRKH5.js} +7 -6
- package/dist/{wiki-generate-7STOCIFZ.js → wiki-generate-ASIFASCN.js} +58 -48
- package/dist/worker/entry.js +98 -84
- package/dist/{workspace-G4ZWUIPR.js → workspace-ZJ6BFM3Q.js} +4 -4
- package/docs/README.md +4 -3
- package/docs/acp.md +1 -1
- package/docs/alcf-provider.md +1 -1
- package/docs/architecture.md +2 -2
- package/docs/artifact-placement.md +1 -2
- package/docs/artifact-versions.md +10 -6
- package/docs/built-in-agents.md +26 -2
- package/docs/capacity-and-scheduling.md +1 -1
- package/docs/commands-and-modes.md +90 -8
- package/docs/configuration-and-targets.md +90 -2
- package/docs/context-engine.md +4 -2
- package/docs/context-working-set.md +4 -4
- package/docs/development-pipeline.md +1 -1
- package/docs/dispatch-architecture-rationale.md +1 -1
- package/docs/documentation-coverage.md +4 -4
- package/docs/documentation-guide.md +4 -4
- package/docs/eval-runner.md +1 -1
- package/docs/evals-internal.md +4 -45
- package/docs/evidence-and-memory.md +70 -10
- package/docs/evolution.md +1 -1
- package/docs/exit-codes-and-output.md +4 -1
- package/docs/extensions-and-sharing.md +6 -2
- package/docs/fleet-demo-runbook.md +2 -2
- package/docs/fleet-dispatch.md +224 -11
- package/docs/git-commit-provenance.md +2 -2
- package/docs/glossary.md +1 -1
- package/docs/installation-and-lifecycle.md +2 -2
- package/docs/middleware-and-components.md +20 -2
- package/docs/model-catalog.md +1 -1
- package/docs/observability.md +55 -8
- package/docs/proactive-memory.md +26 -16
- package/docs/prompt-envelope-and-tools.md +4 -2
- package/docs/provider-adapter-cookbook.md +1 -1
- package/docs/release-cut-checklist.md +83 -65
- package/docs/resource-library.md +59 -0
- package/docs/safety-model.md +29 -7
- package/docs/scientific-validation.md +3 -3
- package/docs/session-lifecycle.md +37 -1
- package/docs/skills-marketplace.md +16 -3
- package/docs/tool-usage.md +14 -7
- package/docs/trace-store.md +1 -1
- package/docs/troubleshooting.md +1 -1
- package/docs/tui-design.md +38 -4
- package/docs/worker-dispatch-mechanics.md +3 -3
- package/package.json +7 -4
- package/src/cli/agents.ts +2 -3
- package/src/cli/argv.ts +14 -1
- package/src/cli/fleet-commands.ts +37 -0
- package/src/cli/fleet-graph.ts +102 -0
- package/src/cli/fleet-new.ts +36 -0
- package/src/cli/fleet-preflight.ts +121 -0
- package/src/cli/fleet-validate.ts +30 -0
- package/src/cli/fleet.ts +188 -335
- package/src/cli/index.ts +4 -2
- package/src/cli/library.ts +190 -0
- package/src/cli/memory.ts +272 -10
- package/src/cli/modes/json-stream.ts +2 -2
- package/src/cli/modes/print.ts +12 -1
- package/src/cli/run.ts +22 -2
- package/src/cli/share.ts +13 -1
- package/src/cli/targets.ts +12 -3
- package/src/cli/usage.ts +160 -20
- package/src/core/bus-events.ts +7 -0
- package/src/core/commit-attribution.ts +4 -4
- package/src/core/config.ts +130 -0
- package/src/core/defaults.ts +81 -0
- package/src/core/response-model-id.ts +134 -0
- package/src/core/toml.ts +62 -0
- package/src/core/workspace-files.ts +0 -1
- package/src/domains/agents/builtins/architect.md +2 -1
- package/src/domains/agents/builtins/oracle.md +33 -0
- package/src/domains/agents/catalog.ts +18 -5
- package/src/domains/agents/fleet-contract.ts +278 -16
- package/src/domains/agents/index.ts +14 -0
- package/src/domains/agents/recipe.ts +54 -14
- package/src/domains/agents/result-contract.ts +242 -5
- package/src/domains/config/classify.ts +4 -0
- package/src/domains/context/bootstrap.ts +36 -27
- package/src/domains/context/project-metadata.ts +19 -63
- package/src/domains/context/prompt-context.ts +8 -0
- package/src/domains/context/working-set/policies/index.ts +3 -4
- package/src/domains/dispatch/active-route-planner.ts +14 -0
- package/src/domains/dispatch/backoff.ts +2 -1
- package/src/domains/dispatch/budget-envelope.ts +396 -0
- package/src/domains/dispatch/capability-match.ts +1 -0
- package/src/domains/dispatch/checkout-writer-lease.ts +175 -0
- package/src/domains/dispatch/contract.ts +36 -0
- package/src/domains/dispatch/delegation-plan.ts +167 -0
- package/src/domains/dispatch/execution-plan.ts +76 -5
- package/src/domains/dispatch/execution-role.ts +3 -1
- package/src/domains/dispatch/execution-scheduler.ts +183 -67
- package/src/domains/dispatch/extension.ts +339 -36
- package/src/domains/dispatch/fleet-gate.ts +14 -0
- package/src/domains/dispatch/fleet-plan.ts +63 -3
- package/src/domains/dispatch/fleet-run.ts +737 -0
- package/src/domains/dispatch/gate-role-prompts.ts +9 -0
- package/src/domains/dispatch/host-verification.ts +178 -0
- package/src/domains/dispatch/index.ts +38 -0
- package/src/domains/dispatch/intent.ts +159 -0
- package/src/domains/dispatch/orphan-recovery.ts +1 -0
- package/src/domains/dispatch/receipt-integrity.ts +12 -4
- package/src/domains/dispatch/state.ts +37 -3
- package/src/domains/dispatch/types.ts +61 -9
- package/src/domains/dispatch/validation.ts +80 -6
- package/src/domains/dispatch/worker-spawn.ts +14 -3
- package/src/domains/eval/metrics/evidence.ts +0 -116
- package/src/domains/eval/metrics/invariants.ts +1 -1
- package/src/domains/eval/runners/clio-run.ts +1 -10
- package/src/domains/eval/runners/external-command.ts +2 -29
- package/src/domains/eval/schema/suite.ts +0 -7
- package/src/domains/eval/suites/run.ts +1 -7
- package/src/domains/evidence/trust-status.ts +10 -1
- package/src/domains/memory/index.ts +22 -0
- package/src/domains/memory/operations.ts +58 -1
- package/src/domains/memory/promotion.ts +281 -0
- package/src/domains/memory/prompt-section.ts +25 -5
- package/src/domains/memory/proposal.ts +51 -7
- package/src/domains/memory/task-bank.ts +3 -2
- package/src/domains/memory/task-memory-handoff.ts +181 -24
- package/src/domains/memory/task-memory-policy.ts +3 -1
- package/src/domains/memory/types.ts +37 -0
- package/src/domains/memory/validate.ts +178 -0
- package/src/domains/middleware/index.ts +15 -0
- package/src/domains/middleware/memory-intervention.ts +35 -25
- package/src/domains/middleware/runtime.ts +6 -0
- package/src/domains/middleware/skills-reminder.ts +19 -4
- package/src/domains/middleware/stalled-turn.ts +43 -1
- package/src/domains/middleware/types.ts +10 -0
- package/src/domains/middleware/watchdog.ts +281 -0
- package/src/domains/observability/contract.ts +9 -2
- package/src/domains/observability/cost.ts +31 -4
- package/src/domains/observability/extension.ts +2 -2
- package/src/domains/observability/index.ts +10 -0
- package/src/domains/observability/out-of-turn-usage.ts +223 -0
- package/src/domains/providers/index.ts +3 -0
- package/src/domains/providers/model-discovery.ts +9 -0
- package/src/domains/providers/runtime-resolution.ts +38 -1
- package/src/domains/providers/runtimes/common/probe-helpers.ts +97 -16
- package/src/domains/providers/types/context-window-slots.ts +18 -0
- package/src/domains/providers/types/runtime-descriptor.ts +3 -1
- package/src/domains/resources/index.ts +20 -0
- package/src/domains/resources/library.ts +326 -0
- package/src/domains/resources/skills/marketplace.ts +37 -12
- package/src/domains/safety/call-target.ts +211 -14
- package/src/domains/safety/decision-presentation.ts +268 -0
- package/src/domains/safety/redaction.ts +73 -0
- package/src/domains/session/context-ledger.ts +10 -1
- package/src/domains/session/decision-board.ts +4 -0
- package/src/domains/session/entries.ts +3 -0
- package/src/domains/session/handoff.ts +629 -0
- package/src/domains/session/history.ts +68 -19
- package/src/domains/session/usage.ts +24 -7
- package/src/domains/share/archive.ts +67 -2
- package/src/engine/acp/event-mapper.ts +7 -0
- package/src/engine/acp/server.ts +29 -2
- package/src/engine/apis/lmstudio.ts +25 -4
- package/src/engine/apis/openai-completions.ts +147 -22
- package/src/engine/claude/sdk-runtime.ts +8 -2
- package/src/engine/claude/tool-safety.ts +13 -0
- package/src/engine/loop-guard.ts +27 -3
- package/src/engine/worker-events.ts +4 -3
- package/src/engine/worker-runtime.ts +59 -54
- package/src/entry/orchestrator.ts +55 -1
- package/src/interactive/bus-notices.ts +26 -0
- package/src/interactive/chat-loop-messages.ts +22 -0
- package/src/interactive/chat-loop.ts +248 -1
- package/src/interactive/chat-renderer.ts +41 -3
- package/src/interactive/clio-editor.ts +44 -7
- package/src/interactive/context-overlay.ts +43 -5
- package/src/interactive/cost-overlay.ts +70 -11
- package/src/interactive/council-dispatch.ts +30 -0
- package/src/interactive/council-grid.ts +213 -0
- package/src/interactive/council.ts +99 -0
- package/src/interactive/dispatch-board.ts +471 -50
- package/src/interactive/fleet-run-preview.ts +307 -0
- package/src/interactive/footer/notifications.ts +219 -0
- package/src/interactive/footer/widgets.ts +13 -0
- package/src/interactive/handoff-round.ts +56 -0
- package/src/interactive/interactive-application.ts +49 -2
- package/src/interactive/interactive-event-projection.ts +9 -1
- package/src/interactive/interactive-input-runtime.ts +11 -1
- package/src/interactive/interactive-presentation.ts +11 -1
- package/src/interactive/interactive-slash-runtime.ts +52 -2
- package/src/interactive/interactive-subscriptions.ts +14 -2
- package/src/interactive/memory-overlay.ts +89 -4
- package/src/interactive/oracle.ts +179 -0
- package/src/interactive/overlay-ask-user-lifecycle.ts +7 -1
- package/src/interactive/overlay-frame.ts +5 -2
- package/src/interactive/overlay-general-openers.ts +230 -2
- package/src/interactive/overlay-key-routing.ts +58 -2
- package/src/interactive/overlay-lifecycle.ts +52 -5
- package/src/interactive/overlay-permission-lifecycle.ts +33 -8
- package/src/interactive/overlay-resource-openers.ts +11 -3
- package/src/interactive/overlay-session-lifecycle.ts +234 -2
- package/src/interactive/overlay-transitions.ts +11 -0
- package/src/interactive/overlays/ask-user.ts +74 -30
- package/src/interactive/overlays/decisions.ts +3 -1
- package/src/interactive/overlays/fleet-run-approval.ts +208 -0
- package/src/interactive/overlays/handoff-review.ts +185 -0
- package/src/interactive/overlays/library-install-confirm.ts +151 -0
- package/src/interactive/overlays/list-overlay.ts +168 -2
- package/src/interactive/overlays/settings.ts +101 -4
- package/src/interactive/overlays/side-question.ts +139 -0
- package/src/interactive/overlays/skills-hub.ts +401 -15
- package/src/interactive/permission-hint.ts +35 -0
- package/src/interactive/permission-overlay.ts +95 -45
- package/src/interactive/renderers/tool-execution.ts +19 -49
- package/src/interactive/session-last-turn.ts +8 -1
- package/src/interactive/session-usage-reseed.ts +36 -10
- package/src/interactive/side-question.ts +171 -0
- package/src/interactive/slash-commands.ts +434 -7
- package/src/interactive/slash-spec.ts +19 -6
- package/src/interactive/status/summary.ts +5 -0
- package/src/interactive/status/types.ts +5 -0
- package/src/interactive/terminal-lease.ts +1 -0
- package/src/interactive/theme/tokens.ts +30 -0
- package/src/interactive/turn-context.ts +96 -23
- package/src/interactive/turn-middleware.ts +16 -1
- package/src/interactive/turn-runtime.ts +37 -8
- package/src/interactive/turn-state.ts +3 -0
- package/src/interactive/watchdog-run.ts +75 -0
- package/src/interactive/worker-progress.ts +440 -0
- package/src/interactive/worker-share.ts +56 -1
- package/src/interactive/worker-stream.ts +58 -110
- package/src/tools/agent-tools.ts +28 -3
- package/src/tools/ask-user.ts +21 -1
- package/src/tools/bootstrap.ts +3 -0
- package/src/tools/compete-worktrees.ts +13 -79
- package/src/tools/context/index.ts +2 -2
- package/src/tools/dispatch-admission.ts +242 -8
- package/src/tools/dispatch-arguments.ts +65 -1
- package/src/tools/dispatch-event-text.ts +19 -0
- package/src/tools/dispatch-plan.ts +136 -6
- package/src/tools/dispatch-runner.ts +319 -13
- package/src/tools/dispatch-types.ts +20 -1
- package/src/tools/dispatch.ts +96 -3
- package/src/tools/monitor.ts +31 -0
- package/src/tools/profiles.ts +18 -4
- package/src/tools/registry.ts +15 -5
- package/src/tools/result-disposition.ts +156 -0
- package/src/tools/result-shaping.ts +59 -1
- package/src/tools/task-worktree.ts +238 -0
- package/src/tools/verify/authoring.ts +116 -55
- package/src/tools/verify/scripts.ts +62 -0
- package/src/tools/worker-evidence.ts +21 -1
- package/src/worker/spec-contract.ts +44 -3
- package/dist/chunk-EFADSJET.js +0 -18
- package/dist/chunk-HC4CLZ2Y.js +0 -68
- package/dist/memory-4ALKDJ4Q.js +0 -246
- package/src/domains/eval/metrics/chaos-stream.ts +0 -93
|
@@ -4,114 +4,125 @@ import {
|
|
|
4
4
|
receiptEvidenceLabels,
|
|
5
5
|
workerTextLabel,
|
|
6
6
|
workerTextNonEvidenceNotices
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DMD2AGVS.js";
|
|
8
8
|
import {
|
|
9
9
|
createDispatchRunEventRegistry
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-AB4XIIVB.js";
|
|
11
|
+
import "./chunk-VREKEFLL.js";
|
|
12
12
|
import {
|
|
13
13
|
UNVERIFIABLE_RECEIPT_VERIFICATION,
|
|
14
14
|
adaptRunReceiptTrustStatus,
|
|
15
|
-
candidateDiffStat,
|
|
16
|
-
claimCompeteGroup,
|
|
17
|
-
cleanupCompeteGroup,
|
|
18
15
|
closeAgentLedger,
|
|
19
|
-
commitCandidateWork,
|
|
20
|
-
compileExecutionPlan,
|
|
21
|
-
createCandidateWorktree,
|
|
22
16
|
decideReviewGate,
|
|
23
17
|
durableAssistantTextFromEvent,
|
|
24
18
|
executePlan,
|
|
25
19
|
extractRunProvenance,
|
|
26
20
|
finalizePendingGateDecision,
|
|
27
|
-
isGitRepository,
|
|
28
|
-
loadCompeteGroup,
|
|
29
|
-
markCompeteGroupCleanupReady,
|
|
30
|
-
markCompeteGroupWinnerPreserved,
|
|
31
21
|
materializePendingGateDecision,
|
|
32
|
-
mergeWinnerBranch,
|
|
33
22
|
openAgentLedger,
|
|
34
23
|
parseCompeteGateResult,
|
|
35
24
|
preflightPendingGateDecisionMaterialization,
|
|
36
25
|
preparePendingGateDecisionRecovery,
|
|
37
|
-
protectedPathsChangedByCompeteBranch,
|
|
38
26
|
provenanceCompactSuffix,
|
|
39
27
|
readGateDecisionArtifacts,
|
|
40
|
-
recoverCleanupReadyCompeteGroups,
|
|
41
|
-
registerCompeteGroupRun,
|
|
42
|
-
removeCandidateWorktree,
|
|
43
28
|
renderAgentLedgerBoard,
|
|
44
|
-
requireAgentSteps,
|
|
45
29
|
resolvePendingGateDecision,
|
|
46
|
-
settleCompeteGroupRun,
|
|
47
|
-
settleRecoveredCompeteDecision,
|
|
48
30
|
stagePendingGateDecision,
|
|
49
31
|
stagePendingGateOutput
|
|
50
|
-
} from "./chunk-
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import
|
|
32
|
+
} from "./chunk-UUANF5CR.js";
|
|
33
|
+
import "./chunk-6TUKSZVF.js";
|
|
34
|
+
import {
|
|
35
|
+
candidateDiffStat,
|
|
36
|
+
claimCompeteGroup,
|
|
37
|
+
cleanupCompeteGroup,
|
|
38
|
+
commitCandidateWork,
|
|
39
|
+
createCandidateWorktree,
|
|
40
|
+
isGitRepository,
|
|
41
|
+
loadCompeteGroup,
|
|
42
|
+
markCompeteGroupCleanupReady,
|
|
43
|
+
markCompeteGroupWinnerPreserved,
|
|
44
|
+
mergeWinnerBranch,
|
|
45
|
+
protectedPathsChangedByCompeteBranch,
|
|
46
|
+
recoverCleanupReadyCompeteGroups,
|
|
47
|
+
registerCompeteGroupRun,
|
|
48
|
+
removeCandidateWorktree,
|
|
49
|
+
settleCompeteGroupRun,
|
|
50
|
+
settleRecoveredCompeteDecision
|
|
51
|
+
} from "./chunk-KZ2H5X4G.js";
|
|
52
|
+
import {
|
|
53
|
+
compileExecutionPlan,
|
|
54
|
+
requireAgentSteps
|
|
55
|
+
} from "./chunk-M4AKACEO.js";
|
|
56
|
+
import "./chunk-RVG5JXAL.js";
|
|
53
57
|
import {
|
|
54
58
|
verifyReceiptIntegrity
|
|
55
|
-
} from "./chunk-
|
|
56
|
-
import "./chunk-
|
|
59
|
+
} from "./chunk-ZGH7FGS5.js";
|
|
60
|
+
import "./chunk-TSHXZTOQ.js";
|
|
57
61
|
import "./chunk-TXOTCRLG.js";
|
|
58
|
-
import "./chunk-
|
|
62
|
+
import "./chunk-HVDIIIQW.js";
|
|
59
63
|
import "./chunk-W6GROXXM.js";
|
|
64
|
+
import "./chunk-KCMKRQX4.js";
|
|
60
65
|
import {
|
|
61
66
|
RESOLVED_DISPATCH_PLAN_ARGUMENT,
|
|
62
67
|
describeDispatchPlan,
|
|
63
68
|
withResolvedPlanTaskPin
|
|
64
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-EELBMBT6.js";
|
|
65
70
|
import {
|
|
66
71
|
COMPETE_STANCES,
|
|
72
|
+
COUNCIL_JUDGE_PROMPT,
|
|
67
73
|
JUDGE_GATE_PROMPT,
|
|
68
74
|
REVIEWER_GATE_PROMPT
|
|
69
|
-
} from "./chunk-
|
|
70
|
-
import "./chunk-
|
|
75
|
+
} from "./chunk-CEYBNUGC.js";
|
|
76
|
+
import "./chunk-5FR74PWO.js";
|
|
77
|
+
import "./chunk-OBMAI2DP.js";
|
|
71
78
|
import {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
} from "./chunk-7RXG6QRZ.js";
|
|
79
|
+
explainRouteDecision
|
|
80
|
+
} from "./chunk-5C77SEEY.js";
|
|
75
81
|
import {
|
|
76
|
-
explainRouteDecision,
|
|
77
82
|
gateDeciderAgentId,
|
|
78
83
|
gateRouteCorrelation
|
|
79
|
-
} from "./chunk-
|
|
80
|
-
import "./chunk-AOCYTWAV.js";
|
|
81
|
-
import "./chunk-MV3K5QF2.js";
|
|
84
|
+
} from "./chunk-UND3GU2L.js";
|
|
82
85
|
import "./chunk-CMZWFGD2.js";
|
|
83
86
|
import "./chunk-I4HZDVNP.js";
|
|
84
|
-
import "./chunk-
|
|
85
|
-
import "./chunk-UL3WSD3F.js";
|
|
87
|
+
import "./chunk-GH5622CP.js";
|
|
86
88
|
import "./chunk-OQE5J4C6.js";
|
|
87
|
-
import "./chunk-
|
|
88
|
-
import "./chunk-
|
|
89
|
-
import
|
|
89
|
+
import "./chunk-GOXNB3AO.js";
|
|
90
|
+
import "./chunk-HWUFFB6L.js";
|
|
91
|
+
import {
|
|
92
|
+
parseJsonObjectPayload,
|
|
93
|
+
parseScoutResult,
|
|
94
|
+
resultContractSourceId
|
|
95
|
+
} from "./chunk-DJNLUABN.js";
|
|
96
|
+
import "./chunk-AOCYTWAV.js";
|
|
97
|
+
import "./chunk-MV3K5QF2.js";
|
|
98
|
+
import "./chunk-UL3WSD3F.js";
|
|
99
|
+
import "./chunk-ODFEOB4F.js";
|
|
90
100
|
import "./chunk-OZNBF4L3.js";
|
|
91
101
|
import "./chunk-4BJ5BYCE.js";
|
|
102
|
+
import "./chunk-ECH6PKUQ.js";
|
|
92
103
|
import {
|
|
93
104
|
truncateUtf8
|
|
94
105
|
} from "./chunk-6XLNIQDB.js";
|
|
95
106
|
import "./chunk-5B2AEOW5.js";
|
|
96
107
|
import "./chunk-CGKSTWHD.js";
|
|
97
|
-
import "./chunk-
|
|
98
|
-
import "./chunk-
|
|
99
|
-
import "./chunk-
|
|
108
|
+
import "./chunk-XAKHZX5N.js";
|
|
109
|
+
import "./chunk-33YXPOE3.js";
|
|
110
|
+
import "./chunk-VQNODYQ4.js";
|
|
100
111
|
import "./chunk-CFGTUFWB.js";
|
|
101
|
-
import "./chunk-
|
|
102
|
-
import "./chunk-4OC57DA6.js";
|
|
103
|
-
import "./chunk-LL4KHSZI.js";
|
|
104
|
-
import "./chunk-4VP4KH3K.js";
|
|
105
|
-
import "./chunk-VEZEGCGW.js";
|
|
106
|
-
import "./chunk-FQ4SKYE4.js";
|
|
107
|
-
import "./chunk-IKCO5N3L.js";
|
|
108
|
-
import "./chunk-3I7MS7N2.js";
|
|
112
|
+
import "./chunk-JRIO5UD2.js";
|
|
109
113
|
import "./chunk-IHXBNWMM.js";
|
|
110
|
-
import "./chunk-
|
|
114
|
+
import "./chunk-GEYXPTRF.js";
|
|
115
|
+
import "./chunk-UHXRNZ2J.js";
|
|
116
|
+
import "./chunk-4DGYLA73.js";
|
|
117
|
+
import "./chunk-LL4KHSZI.js";
|
|
111
118
|
import "./chunk-SST6Z5JA.js";
|
|
112
119
|
import "./chunk-FO5ZOVUY.js";
|
|
113
120
|
import "./chunk-R346GLFC.js";
|
|
121
|
+
import "./chunk-D4MDIG46.js";
|
|
122
|
+
import "./chunk-FQ4SKYE4.js";
|
|
114
123
|
import "./chunk-4ZG3XFUR.js";
|
|
124
|
+
import "./chunk-IKCO5N3L.js";
|
|
125
|
+
import "./chunk-3I7MS7N2.js";
|
|
115
126
|
import "./chunk-FCSXB6T2.js";
|
|
116
127
|
import "./chunk-APJ265NV.js";
|
|
117
128
|
import "./chunk-YXLYO42X.js";
|
|
@@ -123,7 +134,7 @@ import "./chunk-WEPFGWHJ.js";
|
|
|
123
134
|
import "./chunk-ZGVHUX3M.js";
|
|
124
135
|
import {
|
|
125
136
|
BusChannels
|
|
126
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-OB5HIGJY.js";
|
|
127
138
|
import "./chunk-7CR24IG7.js";
|
|
128
139
|
import "./chunk-IWHMRKLL.js";
|
|
129
140
|
import {
|
|
@@ -505,7 +516,10 @@ function formatDispatchOutput(mode, runs, maxOutputBytes, board = null) {
|
|
|
505
516
|
const stepLabel = mode === "pipeline" ? `step ${index + 1}/${runs.length} ` : "";
|
|
506
517
|
const provenance = provenanceCompactSuffix(extractRunProvenance(receipt));
|
|
507
518
|
const verification = run.integrity.ok ? receipt.verification : UNVERIFIABLE_RECEIPT_VERIFICATION;
|
|
508
|
-
const trustStatus = adaptRunReceiptTrustStatus(
|
|
519
|
+
const trustStatus = adaptRunReceiptTrustStatus(
|
|
520
|
+
{ ...receipt, verification },
|
|
521
|
+
{ integrity: run.integrity }
|
|
522
|
+
);
|
|
509
523
|
const evidenceSuffix = ` ${receiptEvidenceLabels(receipt, verification, run.integrity).join(" ")}`;
|
|
510
524
|
const routingSuffix = run.integrity.ok && receipt.routeDecision !== void 0 && receipt.routingIntent !== void 0 ? ` route_decision=${receipt.routeDecision.decisionHash} route_mode=${receipt.routeDecision.mode}` : "";
|
|
511
525
|
const answerText = run.integrity.ok && (receipt.output?.state === "final" || receipt.outcome !== void 0 && receipt.outcome !== "succeeded") ? receipt.output?.text ?? "" : "";
|
|
@@ -558,6 +572,7 @@ function dispatchDetails(deps, mode, runs, board = null) {
|
|
|
558
572
|
// sealed receipt read-only, plus the integrity check so a tampered
|
|
559
573
|
// receipt is machine-visible here too.
|
|
560
574
|
verification: integrity.ok ? receipt.verification : UNVERIFIABLE_RECEIPT_VERIFICATION,
|
|
575
|
+
hostVerification: integrity.ok ? receipt.hostVerification ?? null : null,
|
|
561
576
|
receiptIntegrity: integrity,
|
|
562
577
|
trustStatus,
|
|
563
578
|
...receipt.outcome !== void 0 && receipt.outcome !== "succeeded" ? { outcome: receipt.outcome, outcomeDetail: receipt.outcomeDetail ?? null } : {},
|
|
@@ -1545,6 +1560,196 @@ ${body}`,
|
|
|
1545
1560
|
details
|
|
1546
1561
|
};
|
|
1547
1562
|
}
|
|
1563
|
+
var COUNCIL_BRIEFING_MAX_BYTES = 8 * 1024;
|
|
1564
|
+
var COUNCIL_BRIEFING_TRUNCATION = "\n[council peer briefing truncated]";
|
|
1565
|
+
function councilVerdict(text) {
|
|
1566
|
+
const parsed = parseJsonObjectPayload(text);
|
|
1567
|
+
return parsed.ok && typeof parsed.value.verdict === "string" && parsed.value.verdict.trim().length > 0 ? parsed.value.verdict.trim() : void 0;
|
|
1568
|
+
}
|
|
1569
|
+
function councilJudgeText(text) {
|
|
1570
|
+
const parsed = parseJsonObjectPayload(text);
|
|
1571
|
+
return parsed.ok && typeof parsed.value.text === "string" && parsed.value.text.trim().length > 0 ? parsed.value.text.trim() : text;
|
|
1572
|
+
}
|
|
1573
|
+
function boundedCouncilBriefing(parts) {
|
|
1574
|
+
return truncateUtf8(parts.join("\n\n"), COUNCIL_BRIEFING_MAX_BYTES, COUNCIL_BRIEFING_TRUNCATION);
|
|
1575
|
+
}
|
|
1576
|
+
async function runCouncil(deps, base, council, timeoutMs, signal) {
|
|
1577
|
+
const group = newGateGroupId("council");
|
|
1578
|
+
const runs = [];
|
|
1579
|
+
let prior = /* @__PURE__ */ new Map();
|
|
1580
|
+
const runMember = async (request) => {
|
|
1581
|
+
if (signal?.aborted) throw new Error("council dispatch aborted");
|
|
1582
|
+
const handle = await deps.dispatch.dispatch(request);
|
|
1583
|
+
let timer;
|
|
1584
|
+
if (timeoutMs !== void 0) {
|
|
1585
|
+
timer = setTimeout(
|
|
1586
|
+
() => deps.dispatch.abort(handle.runId, { cause: "timeout", detail: `timed out after ${timeoutMs}ms` }),
|
|
1587
|
+
timeoutMs
|
|
1588
|
+
);
|
|
1589
|
+
}
|
|
1590
|
+
const abort = () => deps.dispatch.abort(handle.runId);
|
|
1591
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
1592
|
+
try {
|
|
1593
|
+
const [summary, receipt] = await Promise.all([
|
|
1594
|
+
consumeGateSensitiveDispatchEvents(deps, handle.runId, request.agentId, handle.events),
|
|
1595
|
+
handle.finalPromise
|
|
1596
|
+
]);
|
|
1597
|
+
return completeRun(deps, receipt, summary);
|
|
1598
|
+
} finally {
|
|
1599
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
1600
|
+
signal?.removeEventListener("abort", abort);
|
|
1601
|
+
}
|
|
1602
|
+
};
|
|
1603
|
+
for (let round = 1; round <= council.rounds; round += 1) {
|
|
1604
|
+
const settled = await Promise.all(
|
|
1605
|
+
council.members.map(async (member, index) => {
|
|
1606
|
+
const peerParts = base.briefing === void 0 ? [] : [`[original briefing] ${base.briefing}`];
|
|
1607
|
+
if (round > 1) {
|
|
1608
|
+
for (const peer of council.members) {
|
|
1609
|
+
if (peer.label === member.label) continue;
|
|
1610
|
+
const previous = prior.get(peer.label);
|
|
1611
|
+
if (previous === void 0 || isPipelineStepFailure(previous.receipt)) {
|
|
1612
|
+
peerParts.push(`[${peer.label}] failed in prior round; no answer contributed.`);
|
|
1613
|
+
} else {
|
|
1614
|
+
peerParts.push(`[${peer.label}] ${normalizedAssistantText(previous.summary)}`);
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
const position = (round - 1) * council.members.length + index + 1;
|
|
1619
|
+
const pinned = council.resolvedTasks?.find((task) => task.role === "member" && task.position === position);
|
|
1620
|
+
const request = {
|
|
1621
|
+
...base,
|
|
1622
|
+
executionRole: "researcher",
|
|
1623
|
+
autonomy: "read-only",
|
|
1624
|
+
toolProfile: "council-read-only",
|
|
1625
|
+
target: member.target,
|
|
1626
|
+
...member.model ? { model: member.model } : {},
|
|
1627
|
+
...member.thinking ? { thinkingLevel: member.thinking } : {},
|
|
1628
|
+
gate: {
|
|
1629
|
+
role: "member",
|
|
1630
|
+
group,
|
|
1631
|
+
cycle: round,
|
|
1632
|
+
...round > 1 ? {
|
|
1633
|
+
subjects: [...prior.entries()].filter(([label]) => label !== member.label).map(([, run]) => subjectRef(run.receipt))
|
|
1634
|
+
} : {}
|
|
1635
|
+
},
|
|
1636
|
+
council: { group, label: member.label, ...member.color ? { color: member.color } : {}, round },
|
|
1637
|
+
...round > 1 ? { briefing: boundedCouncilBriefing(peerParts) } : base.briefing !== void 0 ? { briefing: base.briefing } : {}
|
|
1638
|
+
};
|
|
1639
|
+
return [
|
|
1640
|
+
member.label,
|
|
1641
|
+
await runMember(withResolvedPlanTaskPin(request, pinned, { pinTask: false, pinBriefing: false }))
|
|
1642
|
+
];
|
|
1643
|
+
})
|
|
1644
|
+
);
|
|
1645
|
+
prior = new Map(settled);
|
|
1646
|
+
runs.push(...settled.map(([, run]) => run));
|
|
1647
|
+
}
|
|
1648
|
+
const members = runs.map((run) => {
|
|
1649
|
+
const text = normalizedAssistantText(run.summary);
|
|
1650
|
+
const failed = isPipelineStepFailure(run.receipt);
|
|
1651
|
+
const verdict = councilVerdict(text);
|
|
1652
|
+
return {
|
|
1653
|
+
label: run.receipt.council?.label ?? "member",
|
|
1654
|
+
runId: run.receipt.runId,
|
|
1655
|
+
round: run.receipt.council?.round ?? 1,
|
|
1656
|
+
answer: text,
|
|
1657
|
+
...verdict !== void 0 ? { verdict } : {},
|
|
1658
|
+
...failed ? { failed: { reason: pipelineFailureReason(run.receipt) } } : {}
|
|
1659
|
+
};
|
|
1660
|
+
});
|
|
1661
|
+
const finalMembers = members.filter((member) => member.round === council.rounds && member.failed === void 0);
|
|
1662
|
+
const finalReports = members.filter((member) => member.round === council.rounds);
|
|
1663
|
+
let synthesis = { kind: council.synthesis };
|
|
1664
|
+
if (council.synthesis === "vote") {
|
|
1665
|
+
const tally = {};
|
|
1666
|
+
for (const member of finalMembers)
|
|
1667
|
+
if (member.verdict !== void 0) tally[member.verdict] = (tally[member.verdict] ?? 0) + 1;
|
|
1668
|
+
const ranked = Object.entries(tally).sort((left, right) => right[1] - left[1] || left[0].localeCompare(right[0]));
|
|
1669
|
+
const winner = ranked[0];
|
|
1670
|
+
const verdict = winner === void 0 ? "no_verdict_field" : winner[1] > finalMembers.length / 2 ? winner[0] : "no_majority";
|
|
1671
|
+
synthesis = { kind: "vote", verdict, tally };
|
|
1672
|
+
} else if (council.synthesis === "judge") {
|
|
1673
|
+
const finalRuns = [...prior.values()];
|
|
1674
|
+
const judgeRequest = {
|
|
1675
|
+
agentId: council.judge?.agent ?? base.agentId,
|
|
1676
|
+
executionRole: "judge",
|
|
1677
|
+
task: `Synthesize the council answers for this task:
|
|
1678
|
+
|
|
1679
|
+
${base.task}`,
|
|
1680
|
+
briefing: boundedCouncilBriefing(
|
|
1681
|
+
finalReports.map(
|
|
1682
|
+
(member) => member.failed === void 0 ? `[${member.label}] ${member.answer}` : `[${member.label}] failed; no final answer contributed. Reason: ${member.failed.reason}`
|
|
1683
|
+
)
|
|
1684
|
+
),
|
|
1685
|
+
systemPrompt: COUNCIL_JUDGE_PROMPT,
|
|
1686
|
+
autonomy: "read-only",
|
|
1687
|
+
toolProfile: "council-read-only",
|
|
1688
|
+
gate: { role: "synthesis", group, cycle: council.rounds, subjects: finalRuns.map((run) => subjectRef(run.receipt)) },
|
|
1689
|
+
council: { group, label: "synthesis", round: council.rounds },
|
|
1690
|
+
...council.judge?.target ? { target: council.judge.target } : {},
|
|
1691
|
+
...council.judge?.model ? { model: council.judge.model } : {},
|
|
1692
|
+
...council.judge?.node ? { node: council.judge.node } : {},
|
|
1693
|
+
...base.plan ? { plan: base.plan } : {},
|
|
1694
|
+
...base.parentToolCallId ? { parentToolCallId: base.parentToolCallId } : {}
|
|
1695
|
+
};
|
|
1696
|
+
const pinned = council.resolvedTasks?.find((task) => task.role === "synthesis");
|
|
1697
|
+
const judgeRun = await runMember(
|
|
1698
|
+
withResolvedPlanTaskPin(judgeRequest, pinned, { pinTask: false, pinBriefing: false })
|
|
1699
|
+
);
|
|
1700
|
+
runs.push(judgeRun);
|
|
1701
|
+
const rawText = normalizedAssistantText(judgeRun.summary);
|
|
1702
|
+
const text = councilJudgeText(rawText);
|
|
1703
|
+
const verdict = councilVerdict(rawText);
|
|
1704
|
+
synthesis = {
|
|
1705
|
+
kind: "judge",
|
|
1706
|
+
text,
|
|
1707
|
+
...verdict !== void 0 ? { verdict } : {},
|
|
1708
|
+
judgeRunId: judgeRun.receipt.runId
|
|
1709
|
+
};
|
|
1710
|
+
}
|
|
1711
|
+
if (council.synthesis !== "judge" && prior.size > 0 && deps.dispatch.sealCouncilSynthesis !== void 0) {
|
|
1712
|
+
const finalRuns = [...prior.values()];
|
|
1713
|
+
const template = finalRuns[0];
|
|
1714
|
+
if (template === void 0) throw new Error("council synthesis has no final member receipt");
|
|
1715
|
+
const text = JSON.stringify({ members, synthesis });
|
|
1716
|
+
const receipt = await deps.dispatch.sealCouncilSynthesis({
|
|
1717
|
+
group,
|
|
1718
|
+
round: council.rounds,
|
|
1719
|
+
kind: council.synthesis,
|
|
1720
|
+
text,
|
|
1721
|
+
subjects: finalRuns.map((run) => subjectRef(run.receipt)),
|
|
1722
|
+
template: template.receipt
|
|
1723
|
+
});
|
|
1724
|
+
runs.push(
|
|
1725
|
+
completeRun(deps, receipt, {
|
|
1726
|
+
count: 0,
|
|
1727
|
+
types: [],
|
|
1728
|
+
lastAssistantText: text,
|
|
1729
|
+
terminalAttemptRunId: receipt.runId
|
|
1730
|
+
})
|
|
1731
|
+
);
|
|
1732
|
+
}
|
|
1733
|
+
return { report: { members, synthesis }, runs, group };
|
|
1734
|
+
}
|
|
1735
|
+
function councilResult(deps, outcome) {
|
|
1736
|
+
const sections = outcome.report.members.filter((member) => member.round === Math.max(...outcome.report.members.map((entry) => entry.round))).map((member) => {
|
|
1737
|
+
const run = outcome.runs.find((entry) => entry.receipt.runId === member.runId);
|
|
1738
|
+
return `[${member.label}] ${run?.receipt.targetId ?? "unknown"}/${run?.receipt.wireModelId ?? "unknown"}
|
|
1739
|
+
${member.answer}`;
|
|
1740
|
+
});
|
|
1741
|
+
sections.push(
|
|
1742
|
+
`[synthesis] ${outcome.report.synthesis.kind}
|
|
1743
|
+
${outcome.report.synthesis.text ?? outcome.report.synthesis.verdict ?? "none"}`
|
|
1744
|
+
);
|
|
1745
|
+
const details = {
|
|
1746
|
+
...dispatchDetails(deps, "council", outcome.runs),
|
|
1747
|
+
council: { group: outcome.group, ...outcome.report }
|
|
1748
|
+
};
|
|
1749
|
+
const finalRound = Math.max(...outcome.report.members.map((member) => member.round));
|
|
1750
|
+
const failed = outcome.report.members.some((member) => member.round === finalRound && member.failed !== void 0) || outcome.runs.some((run) => run.receipt.gate?.role === "synthesis" && isPipelineStepFailure(run.receipt));
|
|
1751
|
+
return failed ? { kind: "error", message: sections.join("\n\n"), details } : { kind: "ok", output: sections.join("\n\n"), details };
|
|
1752
|
+
}
|
|
1548
1753
|
async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
1549
1754
|
const deps = {
|
|
1550
1755
|
...inputDeps,
|
|
@@ -1606,6 +1811,7 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1606
1811
|
const maxOutputBytes = snapshot.maxOutputBytes;
|
|
1607
1812
|
const timeoutMs = snapshot.timeoutMs;
|
|
1608
1813
|
let review = snapshot.review === void 0 ? void 0 : structuredClone(snapshot.review);
|
|
1814
|
+
let council = snapshot.council === void 0 ? void 0 : structuredClone(snapshot.council);
|
|
1609
1815
|
const autonomy = deps.getAutonomy?.() ?? "auto-edit";
|
|
1610
1816
|
const authenticatedApproval = options?.approval?.actionClass === "dispatch" ? options.approval : void 0;
|
|
1611
1817
|
const trustedResolvedPlan = admissionState.trustedResolvedPlans.get(args) ?? null;
|
|
@@ -1624,7 +1830,7 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1624
1830
|
};
|
|
1625
1831
|
}
|
|
1626
1832
|
if (resolvedPlan !== null) {
|
|
1627
|
-
const primaryRole = review !== void 0 ? "builder" : mode === "compete" ? "candidate" : "task";
|
|
1833
|
+
const primaryRole = review !== void 0 ? "builder" : mode === "compete" ? "candidate" : mode === "council" ? "member" : "task";
|
|
1628
1834
|
const primaryTasks = resolvedPlan.tasks.filter((task) => task.role === primaryRole);
|
|
1629
1835
|
const executionTasks = primaryRole === "task" ? primaryTasks : primaryTasks.slice(0, 1);
|
|
1630
1836
|
if (executionTasks.length !== requests.length) {
|
|
@@ -1658,6 +1864,7 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1658
1864
|
resolvedTasks: resolvedPlan.tasks
|
|
1659
1865
|
};
|
|
1660
1866
|
}
|
|
1867
|
+
if (council !== void 0) council = { ...council, resolvedTasks: resolvedPlan.tasks };
|
|
1661
1868
|
}
|
|
1662
1869
|
if (planView.planScale) {
|
|
1663
1870
|
const plan = {
|
|
@@ -1679,7 +1886,7 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1679
1886
|
};
|
|
1680
1887
|
requests = requests.map((request) => ({ ...request, plan }));
|
|
1681
1888
|
}
|
|
1682
|
-
const backgroundRefusal = resolvedPlan?.topology === "fleet" ? "a Scout dependency plan drives its stages from this turn" : mode === "compete" ? "compete holds its judge gate in this turn" : review !== void 0 ? "a review gate holds its cycle state in this turn" : mode === "pipeline" && requests.length > 1 ? "a pipeline threads each step's output through this turn" : timeoutMs !== void 0 ? `this call set timeout_ms=${timeoutMs} and nobody would be left to enforce the deadline` : deps.dispatch.detached === void 0 ? "detached batch records are unavailable in this context" : null;
|
|
1889
|
+
const backgroundRefusal = resolvedPlan?.topology === "fleet" ? "a Scout dependency plan drives its stages from this turn" : mode === "compete" ? "compete holds its judge gate in this turn" : mode === "council" ? "council holds its rounds and synthesis in this turn" : review !== void 0 ? "a review gate holds its cycle state in this turn" : mode === "pipeline" && requests.length > 1 ? "a pipeline threads each step's output through this turn" : timeoutMs !== void 0 ? `this call set timeout_ms=${timeoutMs} and nobody would be left to enforce the deadline` : deps.dispatch.detached === void 0 ? "detached batch records are unavailable in this context" : null;
|
|
1683
1890
|
const background = createBackgroundSwitch();
|
|
1684
1891
|
const backgroundLabel = resolvedPlan?.topology === "fleet" ? "fleet" : review !== void 0 ? "review" : mode;
|
|
1685
1892
|
const releaseBackground = registerBackgroundControl(deps, options?.toolCallId, {
|
|
@@ -1703,6 +1910,7 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1703
1910
|
topology: executionPlan.topology,
|
|
1704
1911
|
rootTask: executionPlan.rootTask,
|
|
1705
1912
|
maxWorkers: executionPlan.maxWorkers,
|
|
1913
|
+
...executionPlan.writers === 1 ? { writers: 1 } : {},
|
|
1706
1914
|
onFailure: executionPlan.onFailure,
|
|
1707
1915
|
steps: requireAgentSteps(executionPlan.steps).map((step) => ({
|
|
1708
1916
|
...step,
|
|
@@ -1789,6 +1997,16 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1789
1997
|
return { kind: "error", message: dispatchErrorMessage(err) };
|
|
1790
1998
|
}
|
|
1791
1999
|
}
|
|
2000
|
+
if (mode === "council") {
|
|
2001
|
+
if (requests.length !== 1 || requests[0] === void 0 || council === void 0) {
|
|
2002
|
+
return { kind: "error", message: "dispatch: trusted council settings are unavailable" };
|
|
2003
|
+
}
|
|
2004
|
+
try {
|
|
2005
|
+
return councilResult(deps, await runCouncil(deps, requests[0], council, timeoutMs, options?.signal));
|
|
2006
|
+
} catch (err) {
|
|
2007
|
+
return { kind: "error", message: dispatchErrorMessage(err) };
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
1792
2010
|
if (review !== void 0) {
|
|
1793
2011
|
if (requests.length !== 1 || requests[0] === void 0) {
|
|
1794
2012
|
return { kind: "error", message: REVIEW_SINGLE_TASK_MESSAGE };
|
|
@@ -1811,7 +2029,7 @@ async function runDispatchTool(inputDeps, admissionState, args, options) {
|
|
|
1811
2029
|
} else if (mode === "sequential" || mode === "pipeline" || requests.length === 1) {
|
|
1812
2030
|
runs = await runSequential(deps, requests, mode, timeoutMs, options?.signal, background);
|
|
1813
2031
|
} else {
|
|
1814
|
-
const batch = await runBatch(deps, requests, timeoutMs, options?.signal, background);
|
|
2032
|
+
const batch = snapshot.writers === 1 ? await runWriterLimitedBatch(deps, requests, timeoutMs, options?.signal) : await runBatch(deps, requests, timeoutMs, options?.signal, background);
|
|
1815
2033
|
runs = batch.runs;
|
|
1816
2034
|
board = batch.board;
|
|
1817
2035
|
}
|
|
@@ -2005,7 +2223,50 @@ async function runBatch(deps, requests, timeoutMs, signal, background) {
|
|
|
2005
2223
|
if (!backgrounded) await closeAgentLedger(ledgerId);
|
|
2006
2224
|
}
|
|
2007
2225
|
}
|
|
2226
|
+
async function runWriterLimitedBatch(deps, requests, timeoutMs, signal) {
|
|
2227
|
+
const specs = new Map(deps.getAgentSpecs().map((spec) => [spec.id, spec]));
|
|
2228
|
+
const readers = requests.filter((request) => specs.get(request.agentId)?.capabilityClass === "read-only");
|
|
2229
|
+
const writers = requests.filter((request) => specs.get(request.agentId)?.capabilityClass !== "read-only");
|
|
2230
|
+
const ledgerId = newGateGroupId("ledger");
|
|
2231
|
+
await openAgentLedger(ledgerId);
|
|
2232
|
+
const activeIds = /* @__PURE__ */ new Set();
|
|
2233
|
+
const completed = /* @__PURE__ */ new Map();
|
|
2234
|
+
const start = async (request) => {
|
|
2235
|
+
const ledgered = { ...request, ledger: { id: ledgerId, sequence: 0 } };
|
|
2236
|
+
const handle = await deps.dispatch.dispatch(ledgered);
|
|
2237
|
+
activeIds.add(handle.runId);
|
|
2238
|
+
const registered = deps.runEvents.registerSingle(handle, request.agentId, fallbackProgressBus(deps));
|
|
2239
|
+
const value = await registered.completion;
|
|
2240
|
+
activeIds.delete(handle.runId);
|
|
2241
|
+
const run = completeRun(deps, value.receipt, value.summary);
|
|
2242
|
+
completed.set(request, run);
|
|
2243
|
+
return run;
|
|
2244
|
+
};
|
|
2245
|
+
const abort = (bySignal) => {
|
|
2246
|
+
const reason = bySignal ? void 0 : { cause: "timeout", detail: `timed out after ${timeoutMs}ms` };
|
|
2247
|
+
for (const runId of activeIds) deps.dispatch.abort(runId, reason);
|
|
2248
|
+
};
|
|
2249
|
+
const onSignalAbort = () => abort(true);
|
|
2250
|
+
const timer = timeoutMs === void 0 ? null : setTimeout(() => abort(false), timeoutMs);
|
|
2251
|
+
signal?.addEventListener("abort", onSignalAbort, { once: true });
|
|
2252
|
+
try {
|
|
2253
|
+
const readerPromises = readers.map((request) => start(request));
|
|
2254
|
+
for (const writer of writers) await start(writer);
|
|
2255
|
+
await Promise.all(readerPromises);
|
|
2256
|
+
return {
|
|
2257
|
+
runs: requests.flatMap((request) => {
|
|
2258
|
+
const run = completed.get(request);
|
|
2259
|
+
return run === void 0 ? [] : [run];
|
|
2260
|
+
}),
|
|
2261
|
+
board: renderAgentLedgerBoard(ledgerId)
|
|
2262
|
+
};
|
|
2263
|
+
} finally {
|
|
2264
|
+
if (timer !== null) clearTimeout(timer);
|
|
2265
|
+
signal?.removeEventListener("abort", onSignalAbort);
|
|
2266
|
+
await closeAgentLedger(ledgerId);
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2008
2269
|
export {
|
|
2009
2270
|
runDispatchTool
|
|
2010
2271
|
};
|
|
2011
|
-
//# sourceMappingURL=dispatch-runner-
|
|
2272
|
+
//# sourceMappingURL=dispatch-runner-B7MTOVKL.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-465YSENW.js";
|
|
3
3
|
import {
|
|
4
4
|
printError,
|
|
5
5
|
printHeader
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PPAMZ32Z.js";
|
|
7
7
|
import {
|
|
8
8
|
source_default
|
|
9
9
|
} from "./chunk-5TSRNF4G.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-JRIO5UD2.js";
|
|
11
|
+
import "./chunk-SST6Z5JA.js";
|
|
11
12
|
import "./chunk-IKCO5N3L.js";
|
|
12
13
|
import "./chunk-3I7MS7N2.js";
|
|
13
|
-
import "./chunk-SST6Z5JA.js";
|
|
14
14
|
import "./chunk-APJ265NV.js";
|
|
15
15
|
import "./chunk-YXLYO42X.js";
|
|
16
16
|
import "./chunk-BNAZZHFG.js";
|
|
@@ -296,4 +296,4 @@ export {
|
|
|
296
296
|
synthesizeMenu,
|
|
297
297
|
topicToFile
|
|
298
298
|
};
|
|
299
|
-
//# sourceMappingURL=docs-
|
|
299
|
+
//# sourceMappingURL=docs-FLJTIDSE.js.map
|
|
@@ -6,32 +6,32 @@ import {
|
|
|
6
6
|
runDoctorFleetChecks,
|
|
7
7
|
runDoctorInteropChecks,
|
|
8
8
|
runDoctorRuntimeChecks
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-3HAPLH5M.js";
|
|
10
|
+
import "./chunk-C4JBQ5SR.js";
|
|
11
11
|
import "./chunk-2SFS6XQE.js";
|
|
12
12
|
import "./chunk-ZWLZP4ZT.js";
|
|
13
13
|
import "./chunk-CGKSTWHD.js";
|
|
14
14
|
import "./chunk-XPLRXC72.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-SROCI7ZU.js";
|
|
16
|
+
import "./chunk-DOOEX22V.js";
|
|
17
|
+
import "./chunk-465YSENW.js";
|
|
18
18
|
import {
|
|
19
19
|
printError
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-PPAMZ32Z.js";
|
|
21
21
|
import "./chunk-5TSRNF4G.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-4OC57DA6.js";
|
|
24
|
-
import "./chunk-LL4KHSZI.js";
|
|
25
|
-
import "./chunk-4VP4KH3K.js";
|
|
26
|
-
import "./chunk-VEZEGCGW.js";
|
|
27
|
-
import "./chunk-FQ4SKYE4.js";
|
|
28
|
-
import "./chunk-IKCO5N3L.js";
|
|
29
|
-
import "./chunk-3I7MS7N2.js";
|
|
22
|
+
import "./chunk-JRIO5UD2.js";
|
|
30
23
|
import "./chunk-IHXBNWMM.js";
|
|
24
|
+
import "./chunk-UHXRNZ2J.js";
|
|
25
|
+
import "./chunk-4DGYLA73.js";
|
|
26
|
+
import "./chunk-LL4KHSZI.js";
|
|
31
27
|
import "./chunk-SST6Z5JA.js";
|
|
32
28
|
import "./chunk-FO5ZOVUY.js";
|
|
33
29
|
import "./chunk-R346GLFC.js";
|
|
30
|
+
import "./chunk-D4MDIG46.js";
|
|
31
|
+
import "./chunk-FQ4SKYE4.js";
|
|
34
32
|
import "./chunk-4ZG3XFUR.js";
|
|
33
|
+
import "./chunk-IKCO5N3L.js";
|
|
34
|
+
import "./chunk-3I7MS7N2.js";
|
|
35
35
|
import "./chunk-APJ265NV.js";
|
|
36
36
|
import "./chunk-YXLYO42X.js";
|
|
37
37
|
import "./chunk-BNAZZHFG.js";
|
|
@@ -84,4 +84,4 @@ async function runDoctorCommand(args = []) {
|
|
|
84
84
|
export {
|
|
85
85
|
runDoctorCommand
|
|
86
86
|
};
|
|
87
|
-
//# sourceMappingURL=doctor-
|
|
87
|
+
//# sourceMappingURL=doctor-RN4YKO2X.js.map
|