@iowarp/clio-coder 0.4.3 → 0.4.4
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 +63 -0
- package/README.md +1 -1
- package/dist/{acp-H2NGRPWO.js → acp-WNAYYF4F.js} +4 -5
- package/dist/{agents-TL5LLUQP.js → agents-3OKXHLOI.js} +33 -31
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-E5SW4HMS.js → auth-VKNNMGPU.js} +10 -11
- package/dist/{builtins-IA7V7FUC.js → builtins-WGALA46I.js} +4 -4
- package/dist/{chunk-F5JHEYZM.js → chunk-23L32XTI.js} +10 -7
- package/dist/{chunk-DWUOQKRU.js → chunk-25QBEXRS.js} +2 -2
- package/dist/{chunk-LLDJM5XK.js → chunk-26QSH3EJ.js} +2 -2
- package/dist/{chunk-N2Z7HLVY.js → chunk-2ASED4PZ.js} +10 -10
- package/dist/{chunk-MCEPRMZW.js → chunk-2CU2H6KE.js} +2 -2
- package/dist/chunk-2DSOYNFC.js +108 -0
- package/dist/{chunk-LDJG7DW3.js → chunk-2ZSONWVL.js} +4 -4
- package/dist/{chunk-GI7YYQ3F.js → chunk-36CT5VVL.js} +324 -41
- package/dist/{chunk-4UVU7BJ5.js → chunk-3GY4F45V.js} +2 -2
- package/dist/{chunk-PUVDKJ2Y.js → chunk-3ODX73FK.js} +3 -5
- package/dist/{chunk-IUE3Y34X.js → chunk-3UNOLWNZ.js} +2 -2
- package/dist/{chunk-6PTFB5VS.js → chunk-3UUXNFEX.js} +8 -4
- package/dist/{chunk-2APPQIER.js → chunk-4M6Z5QVF.js} +4 -4
- package/dist/{chunk-K6BSR66V.js → chunk-4NSRCOYP.js} +4 -1
- package/dist/{chunk-JGRC33J2.js → chunk-54X7T7DK.js} +12 -3
- package/dist/{chunk-YQWYVTMC.js → chunk-5636DCO5.js} +4 -4
- package/dist/{chunk-7E7I3WLS.js → chunk-57XXR6DR.js} +23 -22
- package/dist/{chunk-7ZYNNDKC.js → chunk-5TUB6SLS.js} +2 -2
- package/dist/{chunk-VW6DOEDG.js → chunk-6OSVSQL5.js} +11 -2
- package/dist/{chunk-L47TF46W.js → chunk-6PAZTBPA.js} +14 -2
- package/dist/{chunk-XIVNBFZS.js → chunk-6Q3CYFD3.js} +34 -16
- package/dist/{chunk-RSJ25QSL.js → chunk-6QOTUPRG.js} +155 -36
- package/dist/{chunk-JKKCYP3C.js → chunk-6UINWWS6.js} +10 -4
- package/dist/{chunk-WBKFA554.js → chunk-72YIHOZQ.js} +2 -2
- package/dist/{chunk-PAJQJ7BS.js → chunk-75W7L2E2.js} +246 -697
- package/dist/{chunk-RRNP2ANY.js → chunk-7UGL4MB5.js} +4 -4
- package/dist/{chunk-EKCHAPYA.js → chunk-AUPNRN7C.js} +2 -2
- package/dist/{chunk-ZDN3Y73Y.js → chunk-BJVFZO5U.js} +6 -48
- package/dist/{chunk-IWT4SF4R.js → chunk-CUSRQKPU.js} +64 -2
- package/dist/{chunk-SKHCAU7K.js → chunk-DQOVN6KV.js} +3 -2
- package/dist/{chunk-ZWPRK62N.js → chunk-DT3LWJOB.js} +4 -4
- package/dist/chunk-DXKJURES.js +671 -0
- package/dist/{chunk-BEPZRGGU.js → chunk-EL24TAU4.js} +2 -2
- package/dist/{chunk-OML5D5V5.js → chunk-ELWDPP3Y.js} +5 -5
- package/dist/{chunk-NDINPTJ4.js → chunk-ELZVTCGV.js} +5 -4
- package/dist/chunk-EXLD33WO.js +381 -0
- package/dist/{chunk-IJNZMHLA.js → chunk-FEAXX7B6.js} +2 -2
- package/dist/{chunk-TM6LQDI3.js → chunk-FFUPXJC4.js} +74 -323
- package/dist/chunk-GX5WYQO4.js +59 -0
- package/dist/chunk-I2DWJ4GM.js +390 -0
- package/dist/{chunk-TXOTCRLG.js → chunk-I5FWO7L5.js} +5 -5
- package/dist/chunk-IRXAATOX.js +539 -0
- package/dist/chunk-IXIY2H4R.js +44 -0
- package/dist/{chunk-KK4JZPBQ.js → chunk-IZXGRF7P.js} +76 -10
- package/dist/{chunk-5TSRNF4G.js → chunk-JCI2ROMZ.js} +164 -6
- package/dist/{chunk-INY6HTFL.js → chunk-JEIYHLOR.js} +2 -2
- package/dist/{chunk-MUW2BDDH.js → chunk-JQLNNIKT.js} +2 -2
- package/dist/{chunk-XPWWI35G.js → chunk-JSD46VO2.js} +19 -8
- package/dist/{chunk-VA5FNYMT.js → chunk-JT2RFCC5.js} +39 -2
- package/dist/{chunk-V2ANDPVT.js → chunk-K6T2ZAMZ.js} +168 -6
- package/dist/{chunk-B4OAX3SI.js → chunk-KFV5L5SK.js} +13 -6
- package/dist/{chunk-JEQ3XTHC.js → chunk-LLXSDWXS.js} +2 -2
- package/dist/{chunk-E3TPLWFX.js → chunk-LTIKRKFL.js} +3 -3
- package/dist/{chunk-NIQJ66N4.js → chunk-N56KALIC.js} +17 -17
- package/dist/{chunk-JDAY6FIL.js → chunk-NAI6ZFCY.js} +13 -9
- package/dist/{chunk-AF4YM7Z4.js → chunk-NRO2BJRH.js} +2490 -2182
- package/dist/{chunk-WRBAGUNF.js → chunk-NXIMQY5W.js} +2 -2
- package/dist/{chunk-I7ZPNEJM.js → chunk-NXYCB2VD.js} +5 -5
- package/dist/chunk-ODGTEFFI.js +50 -0
- package/dist/{chunk-2VIKGWFZ.js → chunk-OEJSLEPW.js} +2 -2
- package/dist/{chunk-KKOJXO6R.js → chunk-OMQNJVKW.js} +4 -2
- package/dist/{chunk-54CBCGIR.js → chunk-Q4WO54TA.js} +132 -77
- package/dist/{chunk-B4VEBZKF.js → chunk-QUFRYSWI.js} +12 -6
- package/dist/{chunk-42FMPA75.js → chunk-QZWQA4DE.js} +2 -2
- package/dist/{chunk-HEQY7ZFI.js → chunk-RAY4OVGZ.js} +2 -2
- package/dist/{chunk-G76U63X4.js → chunk-RQCKCSRL.js} +7 -7
- package/dist/{chunk-64I3JVYM.js → chunk-RXTN6AKH.js} +2 -2
- package/dist/{chunk-UPZU6GE4.js → chunk-RZDWV63N.js} +3 -3
- package/dist/{chunk-2UH2KFUP.js → chunk-S6PYF2XF.js} +2 -2
- package/dist/{chunk-JSC3U7TI.js → chunk-TOIVGRUX.js} +2 -2
- package/dist/{chunk-7DRAWPTZ.js → chunk-TQAHXW6Y.js} +1 -1
- package/dist/{chunk-JIEGK6UF.js → chunk-U6TMQNSI.js} +48 -4
- package/dist/{chunk-AX2THNSA.js → chunk-UEPWCCTY.js} +4 -4
- package/dist/{chunk-QWGDJJYJ.js → chunk-USR47QNF.js} +4 -4
- package/dist/{chunk-Y3CBHOR6.js → chunk-V6HJFQZE.js} +2 -2
- package/dist/chunk-V76WTFTW.js +318 -0
- package/dist/{chunk-NMJXSHBJ.js → chunk-W54I7H25.js} +2 -2
- package/dist/{chunk-2UG5F4C5.js → chunk-XULDXHTN.js} +24 -12
- package/dist/chunk-XXYSBZIQ.js +283 -0
- package/dist/{chunk-MWUZBSAQ.js → chunk-Y55JBDO5.js} +331 -51
- package/dist/{chunk-W6RRQCPQ.js → chunk-YD5GIKET.js} +4 -4
- package/dist/{chunk-CE5AX47J.js → chunk-YECAMM3D.js} +2 -2
- package/dist/{chunk-WCXUNS7U.js → chunk-YNFKXPEC.js} +6 -6
- package/dist/cli/index.js +36 -35
- package/dist/{clio-CMMK4KRR.js → clio-QLICPCF5.js} +2 -2
- package/dist/{code-nav-MDZNQS33.js → code-nav-IJR2DBPR.js} +6 -6
- package/dist/{components-UCUQ4QXW.js → components-2TGAI2RC.js} +3 -4
- package/dist/{config-SVM5P5YI.js → config-IUA6OYNS.js} +52 -47
- package/dist/{configure-LE3IK2TJ.js → configure-VEPX4NMX.js} +14 -15
- package/dist/{context-VNCR7KAG.js → context-2DKHWH2T.js} +23 -23
- package/dist/{context-2OHRKS42.js → context-4MPR7WKB.js} +48 -42
- package/dist/{context-E3VC7RX5.js → context-BOYF5EJM.js} +11 -11
- package/dist/{context-clear-BW4O37TG.js → context-clear-S4ZJCQUX.js} +48 -42
- package/dist/{context-working-set-VDS25HXZ.js → context-working-set-3I3FYX6Y.js} +8 -8
- package/dist/detail-A7JAVSIG.js +98 -0
- package/dist/{dispatch-runner-5AHT53RF.js → dispatch-runner-RJ5I2F2O.js} +71 -58
- package/dist/{docs-PD3EXDKU.js → docs-SPOV3BAN.js} +3 -5
- package/dist/{doctor-WNNVO6FY.js → doctor-DKICC2SN.js} +54 -31
- package/dist/{eval-7G7SGAYO.js → eval-OQOQUDHK.js} +47 -56
- package/dist/{evidence-VD6736FQ.js → evidence-4DQ25GUQ.js} +53 -150
- package/dist/evidence-4F5USFKH.js +208 -0
- package/dist/{evolve-AL3NGVRL.js → evolve-GSS52E5J.js} +44 -41
- package/dist/{extensions-MOVJ32NM.js → extensions-G7MFLYHT.js} +4 -5
- package/dist/{fleet-QZHUMAGI.js → fleet-Q37YHHAQ.js} +74 -68
- package/dist/{fleet-commands-BAYT5FJZ.js → fleet-commands-G7E4N7SM.js} +14 -11
- package/dist/{fleet-decisions-IREVMRU4.js → fleet-decisions-O7M6QBA2.js} +6 -6
- package/dist/{fleet-graph-YCTT3HTI.js → fleet-graph-TOUBW6OW.js} +13 -13
- package/dist/{fleet-inspect-QVJTDAVB.js → fleet-inspect-SW33JJNI.js} +43 -39
- package/dist/{fleet-preflight-25QAFPK4.js → fleet-preflight-CV2655TW.js} +2 -3
- package/dist/{fleet-validate-5O57AAJ7.js → fleet-validate-KESZX2YH.js} +16 -16
- package/dist/{fleet-verify-CPH2W2T6.js → fleet-verify-UQPMTVE3.js} +42 -38
- package/dist/{fleet-view-SWBR3VGQ.js → fleet-view-MN2VG4MR.js} +43 -39
- package/dist/{init-J477LKZH.js → init-PXEXQSBF.js} +60 -54
- package/dist/{interop-3FCM6XLG.js → interop-ZG5T62U3.js} +6 -7
- package/dist/inventory-C26CFDRR.js +101 -0
- package/dist/{library-QUQEIUG6.js → library-B2W4N74O.js} +16 -17
- package/dist/{memory-SGGSEP65.js → memory-YCANYS5A.js} +45 -42
- package/dist/{models-HEKUAXXK.js → models-GERTU3YI.js} +20 -22
- package/dist/{monitor-HKU57TYQ.js → monitor-CPNIUULB.js} +50 -44
- package/dist/{orchestrator-VDFAEFAI.js → orchestrator-J4BSH4WQ.js} +491 -1182
- package/dist/{panes-DN2SSFOH.js → panes-BOHAEGYC.js} +3 -3
- package/dist/{panes-TALGNPZT.js → panes-NXSLDQZ2.js} +5 -6
- package/dist/{paths-NBMFAIEZ.js → paths-VSUWNC22.js} +3 -4
- package/dist/{reset-EAJFFJVB.js → reset-TNWTB5LU.js} +5 -6
- package/dist/{resources-OVKSEFVE.js → resources-4PXNMD5G.js} +14 -14
- package/dist/{run-7DP7ZF2J.js → run-D6XJ34CN.js} +79 -83
- package/dist/{share-WML67FT3.js → share-2NWMJJEE.js} +14 -15
- package/dist/{skills-SG662R2K.js → skills-KR7WON5G.js} +18 -19
- package/dist/{skills-eval-VVZEUU46.js → skills-eval-O2ZNOLDS.js} +49 -46
- package/dist/{skills-inventory-I2E23GET.js → skills-inventory-ZZOUBK7O.js} +14 -14
- package/dist/{slash-commands-S7MBJDQK.js → slash-commands-ZXPJD64J.js} +32 -23
- package/dist/{steer-2LQOMCPB.js → steer-XA25PSCS.js} +3 -3
- package/dist/{support-CC2UJBJ6.js → support-7EMVWYG2.js} +2 -2
- package/dist/{targets-4QC3HIEW.js → targets-OMH2XCSN.js} +25 -27
- package/dist/tasks-IPAGMEIX.js +36 -0
- package/dist/{terminal-lease-TUHIJ6Y2.js → terminal-lease-C2J3JYRE.js} +4 -4
- package/dist/{tools-TFGJICCU.js → tools-EFFEAIDP.js} +5 -6
- package/dist/{uninstall-5PEVOE5B.js → uninstall-HALS6BLF.js} +7 -8
- package/dist/{upgrade-M4WXY6KN.js → upgrade-MS72RJEP.js} +14 -11
- package/dist/{usage-N7ZNVLEM.js → usage-NHG6MCJM.js} +60 -51
- package/dist/{verifiers-DJTP4XX6.js → verifiers-7AUNVXDY.js} +150 -17
- package/dist/{verify-RWE4PPEK.js → verify-FWYGPKMR.js} +12 -10
- package/dist/{web-fetch-MPARV2K7.js → web-fetch-V4FKSDAV.js} +4 -4
- package/dist/{wiki-generate-C7IQOXSP.js → wiki-generate-743CIGJW.js} +63 -56
- package/dist/{with-panes-4GCGSL7J.js → with-panes-BDQEWBRT.js} +2 -2
- package/dist/worker/entry.js +36 -33
- package/docs/README.md +3 -2
- package/docs/architecture/acp.md +17 -0
- package/docs/architecture/artifact-versions.md +1 -1
- package/docs/architecture/dispatch-typed-intent.md +1 -1
- package/docs/architecture/evidence-and-memory.md +1 -1
- package/docs/architecture/observability.md +7 -1
- package/docs/architecture/prompt-envelope-and-tools.md +15 -5
- package/docs/architecture/safety-model.md +10 -17
- package/docs/architecture/tui-design.md +1 -1
- package/docs/guide/built-in-agents.md +8 -8
- package/docs/guide/commands-and-modes.md +17 -2
- package/docs/guide/configuration-and-targets.md +3 -1
- package/docs/guide/configuration-reference.md +10 -5
- package/docs/guide/environment-variables.md +2 -2
- package/docs/guide/tool-usage.md +78 -3
- package/docs/history/config-knobs-audit.md +2 -2
- package/docs/process/development-pipeline.md +6 -1
- package/docs/process/git-commit-provenance.md +15 -0
- package/docs/process/release-cut-checklist.md +207 -0
- package/docs/process/scientific-validation.md +18 -17
- package/evals/behavioral-machinery-support.ts +1 -0
- package/evals/behavioral-machinery.yaml +1 -1
- package/package.json +1 -1
- package/skills/coding/coding-standards/SKILL.md +14 -4
- package/skills/context/context-handoff/SKILL.md +3 -3
- package/skills/context/context-prime/SKILL.md +3 -3
- package/skills/planning/architecture/SKILL.md +5 -5
- package/skills/planning/backlog/SKILL.md +4 -4
- package/skills/planning/prd/SKILL.md +4 -3
- package/skills/planning/product-intent/SKILL.md +8 -8
- package/skills/planning/tech-spec/SKILL.md +4 -4
- package/skills/registry.yaml +32 -32
- package/skills/research/arxiv-literature/SKILL.md +3 -3
- package/skills/research/experiment-protocol/SKILL.md +3 -3
- package/skills/research/scientific-debugging/SKILL.md +3 -2
- package/skills/research/scientific-modernization/SKILL.md +3 -3
- package/skills/skill-marketplace.json +16 -16
- package/skills/workflow/cut-it/SKILL.md +3 -4
- package/skills/workflow/design-council/SKILL.md +5 -10
- package/skills/workflow/grill-me/SKILL.md +14 -15
- package/skills/workflow/workflow-distiller/SKILL.md +4 -4
- package/src/cli/args.ts +0 -8
- package/src/cli/configure.ts +2 -1
- package/src/cli/doctor-state-size.ts +1 -12
- package/src/cli/doctor-validation-contract.ts +28 -0
- package/src/cli/doctor.ts +5 -0
- package/src/cli/evidence-detail.ts +1 -75
- package/src/cli/evidence-inventory.ts +1 -167
- package/src/cli/index.ts +2 -0
- package/src/cli/run.ts +0 -2
- package/src/cli/targets.ts +1 -1
- package/src/cli/tasks.ts +84 -0
- package/src/cli/upgrade.ts +10 -5
- package/src/cli/usage.ts +6 -0
- package/src/cli/verifiers.ts +147 -1
- package/src/cli/wiki-generate.ts +1 -0
- package/src/core/commit-attribution.ts +41 -1
- package/src/core/git-commit-attribution.ts +46 -3
- package/src/core/run-overrides.ts +0 -5
- package/src/core/skill-activation.ts +3 -0
- package/src/core/tool-names.ts +5 -2
- package/src/domains/agents/builtins/architect.md +1 -1
- package/src/domains/agents/builtins/coder.md +1 -1
- package/src/domains/agents/builtins/documenter.md +1 -1
- package/src/domains/agents/builtins/git-master.md +1 -1
- package/src/domains/agents/builtins/provenance.md +7 -7
- package/src/domains/agents/builtins/tester.md +1 -1
- package/src/domains/agents/builtins/verifier.md +2 -2
- package/src/domains/agents/builtins/wiki-writer.md +4 -3
- package/src/domains/context/extension.ts +31 -7
- package/src/domains/context/refresh.ts +3 -0
- package/src/domains/context/wiki/frontmatter.ts +5 -2
- package/src/domains/context/wiki/generate.ts +6 -0
- package/src/domains/context/wiki/prompts.ts +43 -0
- package/src/domains/dispatch/active-route-planner.ts +4 -0
- package/src/domains/dispatch/code-step.ts +11 -4
- package/src/domains/dispatch/contract.ts +31 -7
- package/src/domains/dispatch/execution-scheduler.ts +2 -0
- package/src/domains/dispatch/extension.ts +50 -27
- package/src/domains/dispatch/fleet-commit-attribution.ts +5 -0
- package/src/domains/dispatch/fleet-run.ts +1 -0
- package/src/domains/dispatch/host-verification.ts +114 -13
- package/src/domains/dispatch/intent.ts +28 -18
- package/src/domains/dispatch/orphan-recovery.ts +2 -0
- package/src/domains/dispatch/receipt-integrity.ts +4 -0
- package/src/domains/dispatch/reservation-store.ts +5 -3
- package/src/domains/dispatch/state.ts +15 -2
- package/src/domains/dispatch/types.ts +17 -2
- package/src/domains/eval/runners/clio-run.ts +12 -9
- package/src/domains/eval/runners/context-index.ts +2 -7
- package/src/domains/eval/runners/context-init.ts +3 -6
- package/src/domains/eval/runners/external-command.ts +29 -11
- package/src/domains/evidence/build.ts +102 -15
- package/src/domains/evidence/detail.ts +69 -0
- package/src/domains/evidence/eval.ts +13 -1
- package/src/domains/evidence/finish-contract-map.ts +5 -1
- package/src/domains/evidence/inventory.ts +167 -0
- package/src/domains/evidence/store.ts +16 -0
- package/src/domains/evidence/types.ts +12 -0
- package/src/domains/extensions/resources.ts +7 -0
- package/src/domains/middleware/marketplace-offer.ts +20 -1
- package/src/domains/middleware/runtime.ts +7 -3
- package/src/domains/mux/detect.ts +3 -6
- package/src/domains/observability/accountability.ts +15 -1
- package/src/domains/observability/contract.ts +52 -7
- package/src/domains/observability/evidence-index.ts +10 -0
- package/src/domains/observability/extension.ts +9 -5
- package/src/domains/observability/projection.ts +394 -45
- package/src/{interactive → domains/observability}/worker-progress.ts +3 -3
- package/src/domains/prompts/fragments/operating/contract.md +2 -0
- package/src/domains/prompts/fragments/wiki/page.md +8 -0
- package/src/domains/providers/model-discovery.ts +1 -4
- package/src/domains/providers/models/local-models/clio-coder-local-coding-targets.yaml +16 -14
- package/src/domains/providers/runtimes/claude/claude-code.ts +9 -0
- package/src/domains/providers/support.ts +1 -1
- package/src/domains/providers/types/runtime-descriptor.ts +1 -1
- package/src/domains/safety/action-classifier.ts +7 -0
- package/src/domains/safety/default-path-policy.ts +2 -0
- package/src/domains/safety/finish-contract-registration.ts +29 -14
- package/src/domains/safety/finish-contract.ts +252 -40
- package/src/domains/safety/index.ts +20 -1
- package/src/domains/safety/policy-engine.ts +26 -6
- package/src/domains/safety/rigor.ts +53 -39
- package/src/domains/safety/validation-contract.ts +388 -0
- package/src/domains/session/archive-readers.ts +10 -1
- package/src/domains/session/decision-board.ts +101 -2
- package/src/domains/session/entries.ts +44 -7
- package/src/domains/session/extension.ts +4 -4
- package/src/domains/session/handoff.ts +2 -1
- package/src/domains/session/manager.ts +2 -3
- package/src/domains/session/task-board.ts +14 -1
- package/src/domains/session/tree/fork.ts +1 -2
- package/src/domains/session/tree/navigator.ts +1 -1
- package/src/domains/user-tasks/acceptance.ts +56 -0
- package/src/domains/user-tasks/active-acceptance.ts +40 -0
- package/src/domains/user-tasks/store.ts +34 -3
- package/src/engine/acp/adapter.ts +24 -6
- package/src/engine/acp/server.ts +21 -4
- package/src/engine/acp/transport.ts +53 -8
- package/src/engine/acp/types.ts +4 -0
- package/src/engine/apis/ollama-native.ts +15 -0
- package/src/engine/claude/subprocess-runtime.ts +107 -60
- package/src/engine/external-subprocess.ts +12 -4
- package/src/entry/orchestrator.ts +11 -2
- package/src/interactive/dispatch-board.ts +46 -717
- package/src/interactive/fleet-run-preview.ts +2 -1
- package/src/interactive/interactive-application.ts +3 -2
- package/src/interactive/interactive-presentation.ts +55 -12
- package/src/interactive/interactive-slash-runtime.ts +2 -1
- package/src/interactive/oracle.ts +5 -2
- package/src/interactive/overlays/fleet-run-approval.ts +3 -2
- package/src/interactive/overlays/message-picker.ts +2 -2
- package/src/interactive/overlays/settings.ts +2 -2
- package/src/interactive/overlays/tree-selector.ts +2 -2
- package/src/interactive/renderers/branch-summary.ts +1 -1
- package/src/interactive/slash-autocomplete.ts +4 -6
- package/src/interactive/slash-commands.ts +25 -39
- package/src/interactive/slash-spec.ts +28 -0
- package/src/interactive/view/artifacts.ts +2 -0
- package/src/interactive/worker-stream.ts +7 -3
- package/src/tools/bootstrap.ts +4 -0
- package/src/tools/builtin-tool-catalog.ts +31 -0
- package/src/tools/compete-worktrees.ts +7 -1
- package/src/tools/core-bootstrap.ts +16 -0
- package/src/tools/decide.ts +136 -0
- package/src/tools/dispatch-admission.ts +21 -0
- package/src/tools/dispatch-plan.ts +5 -2
- package/src/tools/dispatch-runner.ts +15 -1
- package/src/tools/dispatch-types.ts +6 -0
- package/src/tools/evidence.ts +96 -0
- package/src/tools/limitation.ts +76 -0
- package/src/tools/policy.ts +9 -0
- package/src/tools/presentation.ts +3 -0
- package/src/tools/registry.ts +1 -1
- package/src/tools/result-shaping.ts +17 -5
- package/src/tools/task-worktree.ts +13 -3
- package/src/tools/tasks.ts +10 -1
- package/src/tools/verify/authoring.ts +170 -83
- package/src/tools/verify/catalog.ts +122 -5
- package/src/tools/verify/index.ts +2 -1
- package/src/tools/verify/numeric.ts +298 -0
- package/src/tools/verify/perf.ts +143 -0
- package/src/tools/verify/scripts.ts +229 -2
- package/dist/chunk-7DICMOS6.js +0 -313
- package/dist/chunk-RVG5JXAL.js +0 -41
- package/dist/chunk-T56WDKA5.js +0 -183
- package/dist/chunk-VPKWYKEY.js +0 -169
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
decisionRef
|
|
4
|
+
} from "./chunk-54X7T7DK.js";
|
|
5
|
+
import {
|
|
6
|
+
truncateUtf8
|
|
7
|
+
} from "./chunk-6XLNIQDB.js";
|
|
8
|
+
import {
|
|
9
|
+
init_esm_shims
|
|
10
|
+
} from "./chunk-3R73A4XB.js";
|
|
11
|
+
|
|
12
|
+
// src/domains/dispatch/event-pump.ts
|
|
13
|
+
init_esm_shims();
|
|
14
|
+
var EVENT_TEE_LIMIT = 1024;
|
|
15
|
+
function startDispatchEventPump(source, fold, options = {}) {
|
|
16
|
+
const limit = options.limit ?? EVENT_TEE_LIMIT;
|
|
17
|
+
const pending = [...options.prelude ?? []];
|
|
18
|
+
const waiters = [];
|
|
19
|
+
let finished = false;
|
|
20
|
+
let abandoned = false;
|
|
21
|
+
let dropped = 0;
|
|
22
|
+
const push = (value) => {
|
|
23
|
+
if (abandoned) return;
|
|
24
|
+
const waiter = waiters.shift();
|
|
25
|
+
if (waiter) {
|
|
26
|
+
waiter({ value, done: false });
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
pending.push(value);
|
|
30
|
+
while (pending.length > limit) {
|
|
31
|
+
pending.shift();
|
|
32
|
+
dropped += 1;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const end = () => {
|
|
36
|
+
finished = true;
|
|
37
|
+
while (waiters.length > 0) {
|
|
38
|
+
waiters.shift()?.({ value: void 0, done: true });
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const notify = (event) => {
|
|
42
|
+
try {
|
|
43
|
+
options.onEvent?.(event);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
options.onError?.(error);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const done = (async () => {
|
|
49
|
+
try {
|
|
50
|
+
for (const event of options.prelude ?? []) notify(event);
|
|
51
|
+
for await (const event of source) {
|
|
52
|
+
try {
|
|
53
|
+
fold(event);
|
|
54
|
+
} catch (error) {
|
|
55
|
+
options.onError?.(error);
|
|
56
|
+
}
|
|
57
|
+
notify(event);
|
|
58
|
+
push(event);
|
|
59
|
+
}
|
|
60
|
+
} catch (error) {
|
|
61
|
+
options.onError?.(error);
|
|
62
|
+
} finally {
|
|
63
|
+
end();
|
|
64
|
+
}
|
|
65
|
+
})();
|
|
66
|
+
const events = {
|
|
67
|
+
next() {
|
|
68
|
+
if (pending.length > 0) {
|
|
69
|
+
return Promise.resolve({ value: pending.shift(), done: false });
|
|
70
|
+
}
|
|
71
|
+
if (finished || abandoned) return Promise.resolve({ value: void 0, done: true });
|
|
72
|
+
return new Promise((resolve) => {
|
|
73
|
+
waiters.push(resolve);
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
return() {
|
|
77
|
+
abandoned = true;
|
|
78
|
+
pending.length = 0;
|
|
79
|
+
while (waiters.length > 0) {
|
|
80
|
+
waiters.shift()?.({ value: void 0, done: true });
|
|
81
|
+
}
|
|
82
|
+
return Promise.resolve({ value: void 0, done: true });
|
|
83
|
+
},
|
|
84
|
+
[Symbol.asyncIterator]() {
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
return { events, done, droppedEvents: () => dropped };
|
|
89
|
+
}
|
|
90
|
+
var WORKER_OUTPUT_MAX_BYTES = 8192;
|
|
91
|
+
var WORKER_OUTPUT_TRUNCATION_MARKER = "\n[worker output truncated]";
|
|
92
|
+
function isRecord(value) {
|
|
93
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
94
|
+
}
|
|
95
|
+
function assistantTextFromContent(content) {
|
|
96
|
+
if (typeof content === "string") return content;
|
|
97
|
+
if (!Array.isArray(content)) return "";
|
|
98
|
+
return content.map((block) => {
|
|
99
|
+
if (typeof block === "string") return block;
|
|
100
|
+
if (!isRecord(block)) return "";
|
|
101
|
+
return typeof block.text === "string" ? block.text : "";
|
|
102
|
+
}).join("");
|
|
103
|
+
}
|
|
104
|
+
function isDurableAssistantMessage(message) {
|
|
105
|
+
const stopReason = message.stopReason;
|
|
106
|
+
if (stopReason === "toolUse" || stopReason === "error" || stopReason === "aborted" || stopReason === "cancelled") {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
if (!Array.isArray(message.content)) return true;
|
|
110
|
+
return !message.content.some((block) => isRecord(block) && block.type === "toolCall");
|
|
111
|
+
}
|
|
112
|
+
function durableAssistantTextFromEvent(event) {
|
|
113
|
+
if (!isRecord(event) || event.type !== "message_end" || !isRecord(event.message)) return "";
|
|
114
|
+
if (event.message.role !== "assistant" || !isDurableAssistantMessage(event.message)) return "";
|
|
115
|
+
return assistantTextFromContent(event.message.content);
|
|
116
|
+
}
|
|
117
|
+
function boundedOutput(state, text) {
|
|
118
|
+
const bytes = Buffer.byteLength(text, "utf8");
|
|
119
|
+
const bounded = truncateUtf8(text, WORKER_OUTPUT_MAX_BYTES, WORKER_OUTPUT_TRUNCATION_MARKER);
|
|
120
|
+
return { state, text: bounded, bytes, truncated: bounded !== text };
|
|
121
|
+
}
|
|
122
|
+
function createWorkerOutputCapture() {
|
|
123
|
+
let finalText = null;
|
|
124
|
+
let partialText = "";
|
|
125
|
+
let partialBytes = 0;
|
|
126
|
+
let partialStored = 0;
|
|
127
|
+
return {
|
|
128
|
+
observe(event) {
|
|
129
|
+
if (!isRecord(event)) return;
|
|
130
|
+
if (event.type === "message_end") {
|
|
131
|
+
const message = isRecord(event.message) ? event.message : null;
|
|
132
|
+
partialText = "";
|
|
133
|
+
partialBytes = 0;
|
|
134
|
+
partialStored = 0;
|
|
135
|
+
if (message === null || message.role !== "assistant") return;
|
|
136
|
+
if (!isDurableAssistantMessage(message)) return;
|
|
137
|
+
const text = assistantTextFromContent(message.content).trim();
|
|
138
|
+
if (text.length > 0) finalText = text;
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (event.type !== "message_update") return;
|
|
142
|
+
const assistantEvent = isRecord(event.assistantMessageEvent) ? event.assistantMessageEvent : null;
|
|
143
|
+
if (assistantEvent === null || assistantEvent.type !== "text_delta") return;
|
|
144
|
+
const delta = assistantEvent.delta;
|
|
145
|
+
if (typeof delta !== "string" || delta.length === 0) return;
|
|
146
|
+
partialBytes += Buffer.byteLength(delta, "utf8");
|
|
147
|
+
if (partialStored < WORKER_OUTPUT_MAX_BYTES) {
|
|
148
|
+
partialText += delta;
|
|
149
|
+
partialStored += Buffer.byteLength(delta, "utf8");
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
snapshot() {
|
|
153
|
+
if (partialBytes > 0 && partialText.trim().length > 0) {
|
|
154
|
+
const bounded = truncateUtf8(partialText.trim(), WORKER_OUTPUT_MAX_BYTES, WORKER_OUTPUT_TRUNCATION_MARKER);
|
|
155
|
+
return {
|
|
156
|
+
state: "partial",
|
|
157
|
+
text: bounded,
|
|
158
|
+
bytes: partialBytes,
|
|
159
|
+
truncated: bounded !== partialText.trim() || partialBytes > partialStored
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
if (finalText !== null) return boundedOutput("final", finalText);
|
|
163
|
+
return void 0;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// src/domains/dispatch/admission-error.ts
|
|
169
|
+
init_esm_shims();
|
|
170
|
+
var AdmissionCanceledError = class extends Error {
|
|
171
|
+
code = "admission_canceled";
|
|
172
|
+
constructor(message = "dispatch: admission canceled before a capacity slot opened") {
|
|
173
|
+
super(message);
|
|
174
|
+
this.name = "AdmissionCanceledError";
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// src/domains/session/decision-board.ts
|
|
179
|
+
init_esm_shims();
|
|
180
|
+
import { randomUUID } from "node:crypto";
|
|
181
|
+
function answeredAtForDecision(policy, sourceQuestion) {
|
|
182
|
+
for (let index = policy.rounds.length - 1; index >= 0; index -= 1) {
|
|
183
|
+
const round = policy.rounds[index];
|
|
184
|
+
if (!round?.answeredAt) continue;
|
|
185
|
+
if (round.answers.some((answer) => answer.question === sourceQuestion)) return round.answeredAt;
|
|
186
|
+
if (round.questions.some((question) => question.question === sourceQuestion)) return round.answeredAt;
|
|
187
|
+
}
|
|
188
|
+
return void 0;
|
|
189
|
+
}
|
|
190
|
+
function finalizedInterviewEntryFields(policy) {
|
|
191
|
+
if (policy.rounds.length === 0 && policy.decisions.length === 0) return null;
|
|
192
|
+
if (!policy.turnId) throw new Error(`decision board: interview ${policy.id} has no originating user turn`);
|
|
193
|
+
if (policy.status !== "complete" && policy.status !== "cancelled") {
|
|
194
|
+
throw new Error(`decision board: interview ${policy.id} finalized with status ${policy.status}`);
|
|
195
|
+
}
|
|
196
|
+
const endedAt = policy.endedAt ?? policy.updatedAt;
|
|
197
|
+
const decisionsByKey = /* @__PURE__ */ new Map();
|
|
198
|
+
for (const decision of policy.decisions) {
|
|
199
|
+
const decidedAt = decision.source_question ? answeredAtForDecision(policy, decision.source_question) ?? endedAt : endedAt;
|
|
200
|
+
decisionsByKey.set(decision.key, {
|
|
201
|
+
key: decision.key,
|
|
202
|
+
value: decision.value,
|
|
203
|
+
...decision.label ? { label: decision.label } : {},
|
|
204
|
+
...decision.source_question ? { source_question: decision.source_question } : {},
|
|
205
|
+
status: "active",
|
|
206
|
+
decidedAt
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
return {
|
|
210
|
+
kind: "decisionLedger",
|
|
211
|
+
parentTurnId: policy.turnId,
|
|
212
|
+
interviewId: policy.id,
|
|
213
|
+
interviewStatus: policy.status,
|
|
214
|
+
startedAt: policy.startedAt,
|
|
215
|
+
endedAt,
|
|
216
|
+
roundCount: policy.rounds.length,
|
|
217
|
+
...policy.summary ? { summary: policy.summary } : {},
|
|
218
|
+
...policy.transcriptPath ? { transcriptPath: policy.transcriptPath } : {},
|
|
219
|
+
exposure: policy.exposure ?? "local",
|
|
220
|
+
decisions: [...decisionsByKey.values()]
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
var DECISION_REFS_CAP = 32;
|
|
224
|
+
function activeDecisionRefs(board) {
|
|
225
|
+
const refs = /* @__PURE__ */ new Set();
|
|
226
|
+
for (const entry of board) {
|
|
227
|
+
for (const decision of entry.decisions) {
|
|
228
|
+
if (decision.status === "active") refs.add(decisionRef(entry.interviewId, decision.key));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return [...refs].sort().slice(0, DECISION_REFS_CAP);
|
|
232
|
+
}
|
|
233
|
+
function isDecisionLedgerEntry(value) {
|
|
234
|
+
return !!value && typeof value === "object" && value.kind === "decisionLedger";
|
|
235
|
+
}
|
|
236
|
+
function foldDecisionBoard(entries) {
|
|
237
|
+
const lastByInterview = /* @__PURE__ */ new Map();
|
|
238
|
+
for (let index = 0; index < entries.length; index += 1) {
|
|
239
|
+
const raw = entries[index];
|
|
240
|
+
if (!isDecisionLedgerEntry(raw)) continue;
|
|
241
|
+
lastByInterview.set(raw.interviewId, { entry: raw, index });
|
|
242
|
+
}
|
|
243
|
+
return [...lastByInterview.values()].sort((left, right) => {
|
|
244
|
+
const byEndedAt = right.entry.endedAt.localeCompare(left.entry.endedAt);
|
|
245
|
+
return byEndedAt !== 0 ? byEndedAt : right.index - left.index;
|
|
246
|
+
}).map(({ entry }) => entry);
|
|
247
|
+
}
|
|
248
|
+
function activeLeafFromEntries(entries) {
|
|
249
|
+
for (let index = entries.length - 1; index >= 0; index -= 1) {
|
|
250
|
+
const entry = entries[index];
|
|
251
|
+
if (entry && typeof entry === "object" && entry.kind === "message") {
|
|
252
|
+
const turnId = entry.turnId;
|
|
253
|
+
if (typeof turnId === "string" && turnId.length > 0) return turnId;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
function createDecisionBoardStore(deps = {}) {
|
|
259
|
+
let cachedSessionId;
|
|
260
|
+
let dirty = true;
|
|
261
|
+
let interviews = [];
|
|
262
|
+
const syncToSession = () => {
|
|
263
|
+
const sessionId = deps.getSessionId?.() ?? null;
|
|
264
|
+
if (!dirty && sessionId === cachedSessionId) return;
|
|
265
|
+
const entries = deps.readEntries?.() ?? [];
|
|
266
|
+
interviews = foldDecisionBoard(entries);
|
|
267
|
+
cachedSessionId = sessionId;
|
|
268
|
+
dirty = false;
|
|
269
|
+
};
|
|
270
|
+
const append = (entry) => {
|
|
271
|
+
if (!deps.appendEntry) throw new Error("decision board: no session ledger is available");
|
|
272
|
+
deps.appendEntry(entry);
|
|
273
|
+
dirty = true;
|
|
274
|
+
};
|
|
275
|
+
const store = {
|
|
276
|
+
snapshot() {
|
|
277
|
+
syncToSession();
|
|
278
|
+
return interviews;
|
|
279
|
+
},
|
|
280
|
+
recordFinalizedInterview(policy) {
|
|
281
|
+
const entry = finalizedInterviewEntryFields(policy);
|
|
282
|
+
if (entry === null) return false;
|
|
283
|
+
append(entry);
|
|
284
|
+
return true;
|
|
285
|
+
},
|
|
286
|
+
recordAgentDecision(input) {
|
|
287
|
+
syncToSession();
|
|
288
|
+
let superseded = null;
|
|
289
|
+
for (const interview of interviews) {
|
|
290
|
+
const prior = interview.decisions.find((decision) => decision.key === input.key && decision.status === "active");
|
|
291
|
+
if (prior === void 0) continue;
|
|
292
|
+
if (interview.origin !== "agent" || prior.source !== "agent") {
|
|
293
|
+
throw new Error(
|
|
294
|
+
`decision board: '${input.key}' is an operator decision (${interview.interviewId}); it can only be revised through ask_user`
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
superseded = { interviewId: interview.interviewId, key: prior.key };
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
if (superseded !== null) store.supersede(superseded.interviewId, superseded.key, input.rationale);
|
|
301
|
+
const now = (deps.now?.() ?? /* @__PURE__ */ new Date()).toISOString();
|
|
302
|
+
const entries = deps.readEntries?.() ?? [];
|
|
303
|
+
const parentTurnId = deps.getActiveLeafTurnId?.() ?? activeLeafFromEntries(entries);
|
|
304
|
+
if (!parentTurnId) throw new Error("decision board: no active branch leaf is available for the decision");
|
|
305
|
+
const entry = {
|
|
306
|
+
kind: "decisionLedger",
|
|
307
|
+
parentTurnId,
|
|
308
|
+
origin: "agent",
|
|
309
|
+
interviewId: `agent:${randomUUID()}`,
|
|
310
|
+
interviewStatus: "complete",
|
|
311
|
+
startedAt: now,
|
|
312
|
+
endedAt: now,
|
|
313
|
+
roundCount: 0,
|
|
314
|
+
exposure: "local",
|
|
315
|
+
decisions: [
|
|
316
|
+
{
|
|
317
|
+
key: input.key,
|
|
318
|
+
value: input.value,
|
|
319
|
+
...input.label ? { label: input.label } : {},
|
|
320
|
+
status: "active",
|
|
321
|
+
decidedAt: now,
|
|
322
|
+
source: "agent",
|
|
323
|
+
alternatives: [...input.alternatives],
|
|
324
|
+
rationale: input.rationale
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
};
|
|
328
|
+
append(entry);
|
|
329
|
+
return { entry, superseded };
|
|
330
|
+
},
|
|
331
|
+
supersede(interviewId, key, correction) {
|
|
332
|
+
syncToSession();
|
|
333
|
+
const interview = interviews.find((candidate) => candidate.interviewId === interviewId);
|
|
334
|
+
if (!interview) throw new Error(`decision board: interview ${interviewId} was not found on the active branch`);
|
|
335
|
+
const selected = interview.decisions.find((decision) => decision.key === key);
|
|
336
|
+
if (!selected) throw new Error(`decision board: decision ${key} was not found in interview ${interviewId}`);
|
|
337
|
+
const revisedAt = (deps.now?.() ?? /* @__PURE__ */ new Date()).toISOString();
|
|
338
|
+
const normalizedCorrection = correction?.trim();
|
|
339
|
+
const entries = deps.readEntries?.() ?? [];
|
|
340
|
+
const parentTurnId = deps.getActiveLeafTurnId?.() ?? activeLeafFromEntries(entries);
|
|
341
|
+
if (!parentTurnId) throw new Error("decision board: no active branch leaf is available for the revision");
|
|
342
|
+
const revision = {
|
|
343
|
+
kind: "decisionLedger",
|
|
344
|
+
parentTurnId,
|
|
345
|
+
interviewId: interview.interviewId,
|
|
346
|
+
interviewStatus: interview.interviewStatus,
|
|
347
|
+
startedAt: interview.startedAt,
|
|
348
|
+
endedAt: interview.endedAt,
|
|
349
|
+
roundCount: interview.roundCount,
|
|
350
|
+
...interview.summary ? { summary: interview.summary } : {},
|
|
351
|
+
...interview.transcriptPath ? { transcriptPath: interview.transcriptPath } : {},
|
|
352
|
+
...interview.exposure ? { exposure: interview.exposure } : {},
|
|
353
|
+
decisions: interview.decisions.map((decision) => {
|
|
354
|
+
if (decision.key !== selected.key) return { ...decision };
|
|
355
|
+
const next = { ...decision, status: "superseded", revisedAt };
|
|
356
|
+
if (normalizedCorrection) next.correction = normalizedCorrection;
|
|
357
|
+
else delete next.correction;
|
|
358
|
+
return next;
|
|
359
|
+
})
|
|
360
|
+
};
|
|
361
|
+
append(revision);
|
|
362
|
+
return revision;
|
|
363
|
+
},
|
|
364
|
+
invalidate() {
|
|
365
|
+
dirty = true;
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
return store;
|
|
369
|
+
}
|
|
370
|
+
function decisionRationale(decision) {
|
|
371
|
+
const parts = [];
|
|
372
|
+
if (decision.alternatives?.length) parts.push(`Alternatives: ${decision.alternatives.join("; ")}`);
|
|
373
|
+
if (decision.rationale) parts.push(`Rationale: ${decision.rationale}`);
|
|
374
|
+
if (parts.length > 0) return parts.join(". ");
|
|
375
|
+
return decision.source_question ?? decision.correction;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export {
|
|
379
|
+
EVENT_TEE_LIMIT,
|
|
380
|
+
startDispatchEventPump,
|
|
381
|
+
WORKER_OUTPUT_MAX_BYTES,
|
|
382
|
+
durableAssistantTextFromEvent,
|
|
383
|
+
createWorkerOutputCapture,
|
|
384
|
+
AdmissionCanceledError,
|
|
385
|
+
activeDecisionRefs,
|
|
386
|
+
foldDecisionBoard,
|
|
387
|
+
createDecisionBoardStore,
|
|
388
|
+
decisionRationale
|
|
389
|
+
};
|
|
390
|
+
//# sourceMappingURL=chunk-I2DWJ4GM.js.map
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
init_esm_shims
|
|
4
4
|
} from "./chunk-3R73A4XB.js";
|
|
5
5
|
|
|
6
|
-
// src/
|
|
6
|
+
// src/domains/evidence/ordering.ts
|
|
7
7
|
init_esm_shims();
|
|
8
|
-
function
|
|
9
|
-
return
|
|
8
|
+
function compareCodepoints(left, right) {
|
|
9
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
compareCodepoints
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-I5FWO7L5.js.map
|