@iowarp/clio-coder 0.3.8 → 0.3.9
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 +49 -0
- package/README.md +7 -3
- package/dist/{acp-U67UHUK2.js → acp-7LOELQFP.js} +6 -6
- package/dist/{agents-YU6SGALZ.js → agents-FIBG2SHA.js} +27 -25
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-5ZPJOIVG.js → auth-OI4LIH2I.js} +11 -12
- package/dist/{builtins-C6JMZVV6.js → builtins-AD25UL3C.js} +5 -5
- package/dist/{chunk-5FR74PWO.js → chunk-2JDWVJND.js} +2 -2
- package/dist/chunk-3DPEIQKN.js +113 -0
- package/dist/{chunk-4SPRNWDE.js → chunk-3DUR4WUA.js} +15 -15
- package/dist/{chunk-VHN4MY6O.js → chunk-3MRC2YSQ.js} +2 -2
- package/dist/{chunk-5DHKRSMQ.js → chunk-3UUY7R3Z.js} +11 -7
- package/dist/{chunk-IGWKHNIQ.js → chunk-3V5AYSEQ.js} +8 -8
- package/dist/{chunk-FHJEP5SW.js → chunk-465CC7FK.js} +8 -5
- package/dist/{chunk-5WIGXA4T.js → chunk-47CMYGET.js} +111 -4
- package/dist/{chunk-A3WNZD3P.js → chunk-4H6ULJ3H.js} +67 -21
- package/dist/{chunk-TB5666IT.js → chunk-4LJX2PUC.js} +3 -3
- package/dist/{chunk-XWSF374K.js → chunk-56KB5IJP.js} +2 -2
- package/dist/{chunk-SPULKLCF.js → chunk-5DQRIYDZ.js} +2 -2
- package/dist/{chunk-2HEJ2F35.js → chunk-5HFBWUMU.js} +20 -8
- package/dist/{chunk-WNIJTQQK.js → chunk-5PVQ4SRS.js} +78 -6
- package/dist/{chunk-DYIM5TJT.js → chunk-5QKCQQ3E.js} +262 -6
- package/dist/{chunk-TYPGUK6W.js → chunk-5T7RBWN2.js} +111 -5
- package/dist/{chunk-IIZWH4XA.js → chunk-774ILSRL.js} +2 -2
- package/dist/chunk-7C6RYZGQ.js +391 -0
- package/dist/{chunk-TANS5ZJS.js → chunk-AD7Y7STJ.js} +3 -3
- package/dist/{chunk-RWSI4YD7.js → chunk-AEYBF3TB.js} +33 -12
- package/dist/{chunk-DGSYXYMX.js → chunk-AMKHQW3C.js} +2 -2
- package/dist/{chunk-VWZOAB7K.js → chunk-B5XRQOLB.js} +7 -7
- package/dist/{chunk-WXY7KU3G.js → chunk-BVDVID7E.js} +2 -2
- package/dist/{chunk-PMDBGQSJ.js → chunk-CA42X6KT.js} +2 -2
- package/dist/{chunk-HLE42MG7.js → chunk-D73KXYPF.js} +3 -3
- package/dist/{chunk-5Q2VVUKB.js → chunk-DG4M6ZUE.js} +3 -3
- package/dist/{chunk-ME6CCNFO.js → chunk-EBOC7MT3.js} +6 -6
- package/dist/{chunk-MXKJU4JB.js → chunk-ECUO3KDP.js} +48 -7
- package/dist/{chunk-26LEYJZH.js → chunk-FALJGAWU.js} +2 -2
- package/dist/{chunk-GWS3VEIW.js → chunk-FWDFM5ZU.js} +24 -3
- package/dist/{chunk-7RGZWPB6.js → chunk-GAYUJ7LE.js} +67 -13
- package/dist/{chunk-VCBR6CU7.js → chunk-HAY4ZE2P.js} +2 -2
- package/dist/{chunk-FBVTI2TJ.js → chunk-HCBCAYZU.js} +11 -130
- package/dist/{chunk-WSB3FPX7.js → chunk-HJB5IUKP.js} +32 -136
- package/dist/{chunk-J3YUBZWY.js → chunk-HKO36JWF.js} +33 -5
- package/dist/{chunk-E77JEWSD.js → chunk-HPCTNZM2.js} +6 -36
- package/dist/{chunk-FJ3H4MN5.js → chunk-IHKBWSXF.js} +2 -2
- package/dist/{chunk-NMPKI6XL.js → chunk-JEQQR47K.js} +37 -18
- package/dist/{chunk-3BINW3FP.js → chunk-KV2AOLDF.js} +24 -4
- package/dist/{chunk-YS5VLNH5.js → chunk-LXPJXFM5.js} +7 -7
- package/dist/{chunk-7RFXX52T.js → chunk-MIX5N5AC.js} +271 -41
- package/dist/{chunk-K4XHGFR5.js → chunk-MLOK6ZOS.js} +1297 -218
- package/dist/{chunk-ZNLWCMVZ.js → chunk-MV2VUEJC.js} +2 -2
- package/dist/{chunk-MVVUPGPW.js → chunk-MXHC5QYU.js} +6 -6
- package/dist/{chunk-5H3GB5BO.js → chunk-N3PBVRTZ.js} +4 -382
- package/dist/{chunk-2HFZQUHL.js → chunk-N5XKWMDW.js} +17 -7
- package/dist/{chunk-5C3AQNDW.js → chunk-NNNWO6F2.js} +124 -36
- package/dist/{chunk-GU2UIAFZ.js → chunk-NQ6UCCOD.js} +3 -3
- package/dist/{chunk-N22QMJKY.js → chunk-NZU6YDNV.js} +4 -4
- package/dist/{chunk-ZVJ5BLO2.js → chunk-O6I4CIEU.js} +151 -13
- package/dist/{chunk-XN3L4EYL.js → chunk-OEDBCISO.js} +2 -2
- package/dist/{chunk-VAWNZU7Z.js → chunk-P3JGPQFL.js} +2 -2
- package/dist/{chunk-IJ7RPIYJ.js → chunk-PNY46YEY.js} +20 -3
- package/dist/{chunk-U6MBIEMB.js → chunk-PZ4I4JE2.js} +56 -35
- package/dist/{chunk-GPIEI3LY.js → chunk-QQ7EKM72.js} +2 -2
- package/dist/{chunk-WLFILSD5.js → chunk-R7LNVMCS.js} +66 -28
- package/dist/{chunk-GOXNB3AO.js → chunk-RAPCMZL4.js} +75 -4
- package/dist/chunk-RKKLTLYB.js +45 -0
- package/dist/{chunk-TT36MB5S.js → chunk-RKRLDWD3.js} +3 -1
- package/dist/{chunk-TTHACPOM.js → chunk-S4COXYBG.js} +456 -18
- package/dist/{chunk-WWCZ5F23.js → chunk-T3Z6VAAF.js} +69 -10
- package/dist/{chunk-GN57SG4G.js → chunk-TD7UE2L5.js} +9 -7
- package/dist/{chunk-TLQJPP24.js → chunk-TEO2TLVN.js} +523 -322
- package/dist/{chunk-FCSXB6T2.js → chunk-UOSL25KY.js} +14 -2
- package/dist/{chunk-KTYTFRMB.js → chunk-VKBMFOYV.js} +17 -15
- package/dist/{chunk-PT7HYKEM.js → chunk-VO2LKSTM.js} +2 -2
- package/dist/{chunk-P43ETTHK.js → chunk-VPTUJU4P.js} +2 -2
- package/dist/{chunk-WEH5XRJQ.js → chunk-WIE7ZOSW.js} +2 -2
- package/dist/{chunk-EMYUUSFG.js → chunk-WXCJ7VME.js} +5 -5
- package/dist/{chunk-4DGYLA73.js → chunk-XDOQXGFO.js} +22 -7
- package/dist/{chunk-JOZYP4GM.js → chunk-YKOFT37S.js} +5 -5
- package/dist/chunk-YSEHGPCT.js +127 -0
- package/dist/{chunk-HFSBBKSQ.js → chunk-YW7UVM5V.js} +138 -3
- package/dist/cli/index.js +27 -27
- package/dist/{clio-QVTYJ57A.js → clio-LT5V7SSZ.js} +6 -6
- package/dist/{code-nav-FGGFIE7L.js → code-nav-LMW275PA.js} +4 -4
- package/dist/{config-LW5IJFQN.js → config-RXS5T3JT.js} +71 -43
- package/dist/{configure-7XIZCOU4.js → configure-2WYWSCSD.js} +14 -15
- package/dist/{context-Y6Y7QPR6.js → context-I3BTOTCS.js} +12 -12
- package/dist/{context-L3WL3X7K.js → context-MVOORGMF.js} +34 -33
- package/dist/{context-N52ZA626.js → context-PALKKQYL.js} +20 -20
- package/dist/{context-clear-MBQRLSDQ.js → context-clear-N2WOYZ2K.js} +34 -33
- package/dist/{context-index-HVMFQHK3.js → context-index-HNG3MOME.js} +2 -2
- package/dist/{context-working-set-GS6DSO7F.js → context-working-set-MIEVECVZ.js} +10 -11
- package/dist/{dispatch-runner-22ZCNOM3.js → dispatch-runner-VVA4SRRH.js} +34 -33
- package/dist/doctor-TWBWFK5V.js +165 -0
- package/dist/{eval-BEC2WHDA.js → eval-IJ5VEZDJ.js} +2016 -142
- package/dist/{evidence-REJUMSKM.js → evidence-L5APPXNV.js} +29 -28
- package/dist/{evolve-PY5ZBA5K.js → evolve-RGNKFJ52.js} +29 -28
- package/dist/{extensions-HVKU65YU.js → extensions-7WYWUX5A.js} +9 -3
- package/dist/{fleet-7WZEWRFA.js → fleet-6CNVBZZP.js} +87 -55
- package/dist/{fleet-commands-UVHWM76J.js → fleet-commands-L2SXSYEI.js} +6 -6
- package/dist/{fleet-graph-6ULH7PES.js → fleet-graph-2J3OOIPO.js} +14 -12
- package/dist/{fleet-preflight-J53T6CCE.js → fleet-preflight-CZRJ4JP5.js} +3 -4
- package/dist/{fleet-validate-72PC4SLA.js → fleet-validate-C5RI6DP7.js} +16 -15
- package/dist/{init-OG3TPGQG.js → init-VBN2ACVA.js} +50 -48
- package/dist/{library-CNTMPLRF.js → library-JHGUMLY2.js} +13 -11
- package/dist/{memory-6IS7F275.js → memory-K4OQIYWG.js} +31 -30
- package/dist/{models-ENRJDA5W.js → models-2NCZUWDD.js} +23 -22
- package/dist/{monitor-XLDVO7TN.js → monitor-MMVTJABD.js} +35 -34
- package/dist/{orchestrator-6KSPYRHA.js → orchestrator-ZKBPCHW6.js} +1627 -294
- package/dist/{reset-RZ4ER727.js → reset-DD5JGOY3.js} +3 -3
- package/dist/{run-Y2CNK5RU.js → run-QEGNX7FL.js} +56 -55
- package/dist/{share-A55GYP6Z.js → share-JKD3BQMW.js} +13 -11
- package/dist/{skills-ALC5J6AT.js → skills-LMQIKDOZ.js} +14 -12
- package/dist/{skills-eval-JPBEBYQU.js → skills-eval-I7X2774U.js} +34 -32
- package/dist/{steer-GGWFUJUD.js → steer-CF5TDANS.js} +3 -3
- package/dist/{support-MIETYA5E.js → support-I7LOJLIF.js} +4 -4
- package/dist/{targets-VGNXIR3S.js → targets-RUSR6B5Z.js} +58 -32
- package/dist/{terminal-lease-WOBR64YA.js → terminal-lease-QYVORFR4.js} +6 -4
- package/dist/{trace-PNCASAXC.js → trace-ODOQIVIW.js} +61 -6
- package/dist/{upgrade-FUSUAGHR.js → upgrade-XANW3FXB.js} +17 -16
- package/dist/{usage-N4MKVHKD.js → usage-4H7ZRXQT.js} +88 -44
- package/dist/{verifiers-YAWOJ3H2.js → verifiers-UZXNBZEB.js} +6 -6
- package/dist/{verify-LTDHYBGY.js → verify-BVKWTNDL.js} +5 -5
- package/dist/{wiki-generate-6M7GHTBJ.js → wiki-generate-MY7WV2QI.js} +49 -47
- package/dist/worker/entry.js +29 -33
- package/docs/alcf-provider.md +1 -1
- package/docs/architecture.md +1 -1
- package/docs/artifact-versions.md +6 -1
- package/docs/built-in-agents.md +1 -1
- package/docs/capacity-and-scheduling.md +23 -2
- package/docs/commands-and-modes.md +1 -1
- package/docs/configuration-and-targets.md +30 -3
- package/docs/context-engine.md +63 -4
- package/docs/documentation-coverage.md +3 -3
- package/docs/documentation-guide.md +1 -1
- package/docs/environment-variables.md +2 -0
- package/docs/eval-runner.md +262 -11
- package/docs/evals-internal.md +72 -2
- package/docs/evidence-and-memory.md +11 -10
- package/docs/evolution.md +1 -1
- package/docs/extensions-and-sharing.md +3 -1
- package/docs/fleet-dispatch.md +4 -4
- package/docs/installation-and-lifecycle.md +1 -1
- package/docs/middleware-and-components.md +1 -1
- package/docs/model-catalog.md +1 -1
- package/docs/observability.md +53 -2
- package/docs/proactive-memory.md +127 -14
- package/docs/prompt-envelope-and-tools.md +19 -1
- package/docs/provider-adapter-cookbook.md +1 -1
- package/docs/release-cut-checklist.md +19 -3
- package/docs/safety-model.md +1 -1
- package/docs/scientific-validation.md +1 -1
- package/docs/skills-marketplace.md +1 -1
- package/docs/tool-usage.md +1 -1
- package/docs/trace-store.md +1 -1
- package/docs/troubleshooting.md +87 -0
- package/docs/tui-design.md +1 -1
- package/docs/worker-dispatch-mechanics.md +1 -1
- package/package.json +2 -1
- package/src/cli/agents.ts +1 -1
- package/src/cli/config-inspect.ts +33 -6
- package/src/cli/config.ts +1 -1
- package/src/cli/doctor-state-size.ts +82 -0
- package/src/cli/doctor.ts +3 -1
- package/src/cli/eval.ts +80 -16
- package/src/cli/extensions.ts +5 -1
- package/src/cli/fleet.ts +32 -3
- package/src/cli/targets.ts +44 -13
- package/src/cli/trace.ts +63 -4
- package/src/cli/usage.ts +63 -14
- package/src/core/bus-events.ts +29 -1
- package/src/core/cache-telemetry.ts +42 -0
- package/src/core/config.ts +18 -0
- package/src/core/defaults.ts +36 -6
- package/src/core/endpoint-key.ts +27 -0
- package/src/core/residency-target-key.ts +25 -0
- package/src/core/response-schema.ts +36 -2
- package/src/domains/config/classify.ts +3 -0
- package/src/domains/context/codewiki/coordinator.ts +12 -4
- package/src/domains/dispatch/admission.ts +40 -3
- package/src/domains/dispatch/capacity-lease.ts +98 -9
- package/src/domains/dispatch/contract.ts +11 -0
- package/src/domains/dispatch/execution-plan.ts +44 -4
- package/src/domains/dispatch/extension.ts +166 -42
- package/src/domains/dispatch/fleet-run.ts +23 -3
- package/src/domains/dispatch/heartbeat.ts +32 -8
- package/src/domains/dispatch/index.ts +3 -0
- package/src/domains/dispatch/orphan-recovery.ts +5 -0
- package/src/domains/dispatch/reservation-store.ts +116 -8
- package/src/domains/dispatch/state.ts +4 -0
- package/src/domains/dispatch/worker-spawn.ts +25 -11
- package/src/domains/dispatch/write-boundary-enforcer.ts +20 -3
- package/src/domains/dispatch/write-boundary.ts +62 -1
- package/src/domains/eval/artifacts/store.ts +62 -0
- package/src/domains/eval/compare/behavioral.ts +224 -0
- package/src/domains/eval/compare/compare.ts +355 -2
- package/src/domains/eval/compare/envelope.ts +128 -0
- package/src/domains/eval/compare/gates.ts +24 -6
- package/src/domains/eval/compare/thresholds.ts +30 -3
- package/src/domains/eval/execution-provenance.ts +240 -0
- package/src/domains/eval/metrics/aggregate.ts +136 -0
- package/src/domains/eval/metrics/call-ledger-stream.ts +112 -0
- package/src/domains/eval/metrics/tracked.ts +413 -0
- package/src/domains/eval/provenance.ts +117 -0
- package/src/domains/eval/reports/comparison.ts +128 -0
- package/src/domains/eval/reports/junit.ts +17 -3
- package/src/domains/eval/reports/markdown.ts +3 -3
- package/src/domains/eval/reports/text.ts +14 -0
- package/src/domains/eval/run-compare.ts +20 -0
- package/src/domains/eval/runners/clio-run.ts +127 -0
- package/src/domains/eval/runners/external-command.ts +28 -3
- package/src/domains/eval/schema/adapter.ts +111 -0
- package/src/domains/eval/schema/artifact.ts +20 -0
- package/src/domains/eval/schema/behavioral-metrics.ts +204 -0
- package/src/domains/eval/schema/behavioral.ts +520 -0
- package/src/domains/eval/schema/execution-envelope.ts +194 -0
- package/src/domains/eval/schema/serving.ts +74 -0
- package/src/domains/eval/schema/suite.ts +38 -8
- package/src/domains/eval/schema/validate.ts +58 -3
- package/src/domains/eval/schema/verdict.ts +237 -0
- package/src/domains/eval/suites/resolve.ts +2 -0
- package/src/domains/eval/suites/run.ts +264 -33
- package/src/domains/eval/verifiers/command.ts +2 -1
- package/src/domains/eval/workspaces/temp-copy.ts +145 -13
- package/src/domains/evidence/build.ts +2 -13
- package/src/domains/evidence/eval.ts +2 -12
- package/src/domains/evidence/findings-markdown.ts +33 -0
- package/src/domains/evidence/run-trust.ts +7 -113
- package/src/domains/evidence/trust-projection.ts +2 -2
- package/src/domains/extensions/compatibility.ts +285 -0
- package/src/domains/extensions/discovery.ts +38 -3
- package/src/domains/extensions/resources.ts +1 -1
- package/src/domains/extensions/state.ts +12 -3
- package/src/domains/extensions/types.ts +2 -0
- package/src/domains/lifecycle/doctor.ts +69 -1
- package/src/domains/memory/index.ts +14 -0
- package/src/domains/memory/task-bank-promotion.ts +64 -0
- package/src/domains/memory/task-memory-policy.ts +77 -8
- package/src/domains/memory/task-memory-spend.ts +131 -0
- package/src/domains/memory/task-memory-status.ts +7 -0
- package/src/domains/memory/task-memory-telemetry.ts +2 -0
- package/src/domains/middleware/index.ts +1 -0
- package/src/domains/middleware/memory-intervention.ts +69 -5
- package/src/domains/middleware/memory-step-endpoint.ts +71 -0
- package/src/domains/observability/background-memory-usage.ts +140 -0
- package/src/domains/observability/cost.ts +1 -1
- package/src/domains/observability/index.ts +7 -0
- package/src/domains/observability/out-of-turn-usage.ts +51 -2
- package/src/domains/observability/trace-store.ts +192 -2
- package/src/domains/prompts/compiler.ts +100 -13
- package/src/domains/providers/endpoint-capacity.ts +96 -0
- package/src/domains/providers/index.ts +10 -0
- package/src/domains/providers/models/local-models/clio-local-coding-targets.yaml +243 -1
- package/src/domains/providers/runtime-resolution.ts +8 -1
- package/src/domains/providers/runtimes/common/probe-helpers.ts +31 -9
- package/src/domains/providers/runtimes/local-native/llamacpp-anthropic.ts +1 -1
- package/src/domains/providers/runtimes/local-native/llamacpp-completion.ts +1 -1
- package/src/domains/providers/runtimes/local-native/llamacpp-embed.ts +1 -1
- package/src/domains/providers/runtimes/local-native/llamacpp-rerank.ts +1 -1
- package/src/domains/providers/runtimes/local-native/llamacpp.ts +4 -1
- package/src/domains/providers/runtimes/local-native/lmstudio.ts +4 -1
- package/src/domains/providers/runtimes/local-native/ollama-native.ts +6 -1
- package/src/domains/providers/types/capability-flags.ts +2 -0
- package/src/domains/providers/types/target-descriptor.ts +2 -0
- package/src/domains/resources/prompts/loader.ts +95 -33
- package/src/domains/safety/call-target.ts +52 -0
- package/src/domains/safety/run-effects.ts +35 -4
- package/src/domains/session/context-accounting.ts +52 -1
- package/src/domains/session/context-ledger.ts +37 -13
- package/src/domains/session/index.ts +6 -0
- package/src/domains/session/prompt-cache.ts +140 -0
- package/src/domains/session/prompt-manifest.ts +42 -0
- package/src/engine/acp/adapter.ts +18 -3
- package/src/engine/ai.ts +35 -0
- package/src/engine/apis/llamacpp-residency.ts +55 -3
- package/src/engine/apis/lmstudio.ts +25 -5
- package/src/engine/apis/ollama-native.ts +2 -1
- package/src/engine/apis/openai-completions.ts +80 -17
- package/src/engine/apis/residency-lock.ts +3 -1
- package/src/engine/apis/residency.ts +34 -1
- package/src/engine/provider-payload.ts +29 -1
- package/src/entry/orchestrator.ts +176 -30
- package/src/interactive/chat-loop-messages.ts +26 -7
- package/src/interactive/chat-loop.ts +318 -41
- package/src/interactive/chat-panel.ts +62 -8
- package/src/interactive/clio-editor.ts +45 -8
- package/src/interactive/context-activity.ts +5 -1
- package/src/interactive/context-meter.ts +1 -1
- package/src/interactive/context-overlay.ts +40 -10
- package/src/interactive/cost-overlay.ts +64 -6
- package/src/interactive/dispatch-board.ts +84 -12
- package/src/interactive/fleet-run-preview.ts +41 -15
- package/src/interactive/handoff-round.ts +41 -2
- package/src/interactive/interactive-application.ts +24 -1
- package/src/interactive/interactive-input-runtime.ts +8 -0
- package/src/interactive/interactive-presentation.ts +4 -0
- package/src/interactive/interactive-shell.ts +20 -17
- package/src/interactive/interactive-slash-runtime.ts +27 -4
- package/src/interactive/memory-overlay.ts +8 -0
- package/src/interactive/mutation-preview.ts +295 -0
- package/src/interactive/overlay-general-openers.ts +16 -0
- package/src/interactive/overlay-key-routing.ts +38 -0
- package/src/interactive/overlay-lifecycle.ts +38 -5
- package/src/interactive/overlay-permission-lifecycle.ts +22 -2
- package/src/interactive/overlay-session-lifecycle.ts +73 -9
- package/src/interactive/overlays/ask-user.ts +91 -19
- package/src/interactive/overlays/help-reference.ts +4 -0
- package/src/interactive/overlays/prompts.ts +11 -1
- package/src/interactive/overlays/settings.ts +35 -1
- package/src/interactive/permission-hint.ts +34 -2
- package/src/interactive/permission-overlay.ts +159 -9
- package/src/interactive/prewarm.ts +197 -0
- package/src/interactive/render-trace.ts +162 -15
- package/src/interactive/renderers/tool-execution.ts +4 -0
- package/src/interactive/side-question.ts +58 -1
- package/src/interactive/status/controller.ts +11 -0
- package/src/interactive/status/state-machine.ts +54 -2
- package/src/interactive/status/types.ts +7 -0
- package/src/interactive/terminal-lease.ts +2 -0
- package/src/interactive/turn-context.ts +299 -31
- package/src/interactive/turn-persistence.ts +14 -4
- package/src/interactive/turn-prewarm.ts +364 -0
- package/src/interactive/turn-queues.ts +7 -4
- package/src/interactive/turn-runtime.ts +8 -1
- package/src/interactive/turn-state.ts +23 -0
- package/src/interactive/view/view-overlay.ts +28 -3
- package/src/tools/ask-user.ts +43 -2
- package/src/tools/dispatch-plan.ts +17 -9
- package/src/tools/dispatch-scout.ts +1 -1
- package/src/tools/registry.ts +16 -0
- package/dist/chunk-AOCYTWAV.js +0 -449
- package/dist/chunk-HWUFFB6L.js +0 -83
- package/dist/chunk-R346GLFC.js +0 -31
- package/dist/doctor-M7YEDGAE.js +0 -91
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
tomlTableAt
|
|
5
5
|
} from "./chunk-LCGCVYZ4.js";
|
|
6
6
|
import {
|
|
7
|
+
loadFragments,
|
|
7
8
|
renderCodewikiDigest
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-47CMYGET.js";
|
|
9
10
|
import {
|
|
10
11
|
loadMemoryRecordsSync
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5T7RBWN2.js";
|
|
12
13
|
import {
|
|
13
14
|
WIKI_INDEX,
|
|
14
15
|
WIKI_PLAN_FILE,
|
|
@@ -43,10 +44,7 @@ import {
|
|
|
43
44
|
readClioState,
|
|
44
45
|
statePath,
|
|
45
46
|
writeClioState
|
|
46
|
-
} from "./chunk-
|
|
47
|
-
import {
|
|
48
|
-
sha256
|
|
49
|
-
} from "./chunk-TLQJPP24.js";
|
|
47
|
+
} from "./chunk-MXHC5QYU.js";
|
|
50
48
|
import {
|
|
51
49
|
classifyProjectPreload
|
|
52
50
|
} from "./chunk-JVCV3ICN.js";
|
|
@@ -70,16 +68,13 @@ import {
|
|
|
70
68
|
} from "./chunk-33YXPOE3.js";
|
|
71
69
|
import {
|
|
72
70
|
ceilChars
|
|
73
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-AEYBF3TB.js";
|
|
74
72
|
import {
|
|
75
73
|
INTEROP_AGENT_KINDS
|
|
76
74
|
} from "./chunk-IHXBNWMM.js";
|
|
77
75
|
import {
|
|
78
76
|
BusChannels
|
|
79
|
-
} from "./chunk-
|
|
80
|
-
import {
|
|
81
|
-
resolvePackageRoot
|
|
82
|
-
} from "./chunk-IWHMRKLL.js";
|
|
77
|
+
} from "./chunk-RKRLDWD3.js";
|
|
83
78
|
import {
|
|
84
79
|
require_dist
|
|
85
80
|
} from "./chunk-APJ265NV.js";
|
|
@@ -162,7 +157,7 @@ var SECRET_LINE_PATTERNS = [
|
|
|
162
157
|
/\bxox[baprs]-[A-Za-z0-9-]{20,}\b/,
|
|
163
158
|
/\bAIza[0-9A-Za-z_-]{20,}\b/
|
|
164
159
|
];
|
|
165
|
-
function
|
|
160
|
+
function sha256(text) {
|
|
166
161
|
return createHash("sha256").update(text).digest("hex");
|
|
167
162
|
}
|
|
168
163
|
function normalizeText(text) {
|
|
@@ -239,8 +234,8 @@ function discoverCandidateSpecs(cwd, home, includeGlobal) {
|
|
|
239
234
|
const specs = [];
|
|
240
235
|
const seen = /* @__PURE__ */ new Set();
|
|
241
236
|
let order = 0;
|
|
242
|
-
const add = (
|
|
243
|
-
const abs = resolve(
|
|
237
|
+
const add = (path, scope, provider, kind) => {
|
|
238
|
+
const abs = resolve(path);
|
|
244
239
|
if (seen.has(abs)) return;
|
|
245
240
|
seen.add(abs);
|
|
246
241
|
const scopedDir = scope === "project" && kind === "instructions" ? relative(cwd, dirname(abs)) : "";
|
|
@@ -512,7 +507,7 @@ function rejectedCandidate(spec, displayPath2, reason, evidence) {
|
|
|
512
507
|
kind: spec.kind,
|
|
513
508
|
...spec.directoryScope ? { directoryScope: spec.directoryScope } : {},
|
|
514
509
|
reason,
|
|
515
|
-
fingerprintSha256:
|
|
510
|
+
fingerprintSha256: sha256(`rejected\0${reason}\0${evidence}`)
|
|
516
511
|
};
|
|
517
512
|
}
|
|
518
513
|
function statEvidence(stat) {
|
|
@@ -561,7 +556,7 @@ function readCandidate(spec, cwd, home) {
|
|
|
561
556
|
kindLabel: KIND_LABELS[spec.kind],
|
|
562
557
|
...spec.directoryScope ? { directoryScope: spec.directoryScope } : {},
|
|
563
558
|
content,
|
|
564
|
-
contentSha256:
|
|
559
|
+
contentSha256: sha256(content),
|
|
565
560
|
byteLength: Buffer.byteLength(content, "utf8"),
|
|
566
561
|
itemCount: rules.length,
|
|
567
562
|
order: spec.order
|
|
@@ -625,7 +620,7 @@ function scanAgentConfigs(options) {
|
|
|
625
620
|
kind: result.kind,
|
|
626
621
|
...result.directoryScope ? { directoryScope: result.directoryScope } : {},
|
|
627
622
|
reason: "aggregate source byte budget exceeded",
|
|
628
|
-
fingerprintSha256:
|
|
623
|
+
fingerprintSha256: sha256(`rejected\0aggregate source byte budget exceeded\0${result.contentSha256}`)
|
|
629
624
|
});
|
|
630
625
|
continue;
|
|
631
626
|
}
|
|
@@ -651,8 +646,8 @@ function scanAgentConfigs(options) {
|
|
|
651
646
|
};
|
|
652
647
|
}
|
|
653
648
|
function renderSourceList(paths) {
|
|
654
|
-
if (paths.length <= 3) return paths.map((
|
|
655
|
-
return `${paths.slice(0, 3).map((
|
|
649
|
+
if (paths.length <= 3) return paths.map((path) => `\`${path}\``).join(", ");
|
|
650
|
+
return `${paths.slice(0, 3).map((path) => `\`${path}\``).join(", ")} +${paths.length - 3} more`;
|
|
656
651
|
}
|
|
657
652
|
function quoteShort(text) {
|
|
658
653
|
const cleaned = text.replace(/\s+/g, " ").trim();
|
|
@@ -1945,7 +1940,7 @@ function countStatusLines(status) {
|
|
|
1945
1940
|
return status.split("\n").map((line) => line.trim()).filter(Boolean).length;
|
|
1946
1941
|
}
|
|
1947
1942
|
function basenameList(paths) {
|
|
1948
|
-
const names = paths.map((
|
|
1943
|
+
const names = paths.map((path) => parse(path).base).sort((a, b) => a.localeCompare(b));
|
|
1949
1944
|
if (names.length === 0) return "";
|
|
1950
1945
|
if (names.length <= 3) return names.join(", ");
|
|
1951
1946
|
return `${names.slice(0, 3).join(", ")} +${names.length - 3}`;
|
|
@@ -2187,7 +2182,7 @@ function codewikiEntryPoints(codewiki, limit = 6) {
|
|
|
2187
2182
|
if (!("toFileId" in edge)) continue;
|
|
2188
2183
|
inDegree.set(edge.toFileId, (inDegree.get(edge.toFileId) ?? 0) + 1);
|
|
2189
2184
|
}
|
|
2190
|
-
const ranked = [...inDegree.entries()].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).map(([fileId]) => fileById.get(fileId)?.path).filter((
|
|
2185
|
+
const ranked = [...inDegree.entries()].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).map(([fileId]) => fileById.get(fileId)?.path).filter((path) => typeof path === "string").filter((path) => !tagged.includes(path));
|
|
2191
2186
|
return [...tagged, ...ranked].slice(0, limit);
|
|
2192
2187
|
}
|
|
2193
2188
|
async function runBootstrap(input = {}) {
|
|
@@ -2537,12 +2532,12 @@ function readProfileBlob(value, issues) {
|
|
|
2537
2532
|
}
|
|
2538
2533
|
return profile;
|
|
2539
2534
|
}
|
|
2540
|
-
function readProfileFile(
|
|
2541
|
-
if (!existsSync6(
|
|
2535
|
+
function readProfileFile(path, issues) {
|
|
2536
|
+
if (!existsSync6(path)) return { profile: {}, present: false };
|
|
2542
2537
|
try {
|
|
2543
|
-
return { profile: readProfileBlob((0, import_yaml2.parse)(readFileSync5(
|
|
2538
|
+
return { profile: readProfileBlob((0, import_yaml2.parse)(readFileSync5(path, "utf8")), issues), present: true };
|
|
2544
2539
|
} catch (err) {
|
|
2545
|
-
issues.push(`${
|
|
2540
|
+
issues.push(`${path}: invalid YAML: ${err instanceof Error ? err.message : String(err)}`);
|
|
2546
2541
|
return { profile: {}, present: false };
|
|
2547
2542
|
}
|
|
2548
2543
|
}
|
|
@@ -2729,8 +2724,8 @@ function ruleMatchesAnyPath(rule, workingPaths) {
|
|
|
2729
2724
|
} catch {
|
|
2730
2725
|
continue;
|
|
2731
2726
|
}
|
|
2732
|
-
for (const
|
|
2733
|
-
const normalized = normalizeGlobInput(
|
|
2727
|
+
for (const path of workingPaths) {
|
|
2728
|
+
const normalized = normalizeGlobInput(path);
|
|
2734
2729
|
if (regex.test(normalized)) return true;
|
|
2735
2730
|
if (normalized.endsWith("/") && globMatchesInsideDirectory(regex, pattern, normalized)) return true;
|
|
2736
2731
|
}
|
|
@@ -3011,8 +3006,8 @@ var WIKI_DEPTH_STRATEGY = {
|
|
|
3011
3006
|
detailed: { areaDepth: 3, areaShare: 8e-3, minAreaLines: 150 }
|
|
3012
3007
|
};
|
|
3013
3008
|
var MAX_PAGE_SOURCES = 8;
|
|
3014
|
-
function areaForPath(
|
|
3015
|
-
const directories =
|
|
3009
|
+
function areaForPath(path, maxDepth) {
|
|
3010
|
+
const directories = path.split("/").filter(Boolean).slice(0, -1);
|
|
3016
3011
|
if (directories.length === 0) return ".";
|
|
3017
3012
|
return directories.slice(0, Math.max(1, maxDepth)).join("/");
|
|
3018
3013
|
}
|
|
@@ -3104,14 +3099,14 @@ function dedupePagePaths(plan) {
|
|
|
3104
3099
|
const seen = /* @__PURE__ */ new Set();
|
|
3105
3100
|
const pages = [];
|
|
3106
3101
|
for (const page of plan.pages) {
|
|
3107
|
-
let
|
|
3102
|
+
let path = page.path;
|
|
3108
3103
|
let suffix = 2;
|
|
3109
|
-
while (seen.has(
|
|
3110
|
-
|
|
3104
|
+
while (seen.has(path)) {
|
|
3105
|
+
path = page.path.replace(/\.md$/, `-${suffix}.md`);
|
|
3111
3106
|
suffix += 1;
|
|
3112
3107
|
}
|
|
3113
|
-
seen.add(
|
|
3114
|
-
pages.push({ ...page, path
|
|
3108
|
+
seen.add(path);
|
|
3109
|
+
pages.push({ ...page, path });
|
|
3115
3110
|
}
|
|
3116
3111
|
return { ...plan, pages };
|
|
3117
3112
|
}
|
|
@@ -3305,7 +3300,7 @@ function resolvePlan(input) {
|
|
|
3305
3300
|
if (input.mode === "update" && input.previousPlan !== void 0) {
|
|
3306
3301
|
const pageSources = pageSourceIndex(input.stagingDir, input.cwd);
|
|
3307
3302
|
const changed = new Set(
|
|
3308
|
-
changedPathsSince(input.cwd, input.gitHead).map((
|
|
3303
|
+
changedPathsSince(input.cwd, input.gitHead).map((path) => normalizeRepoPath(input.cwd, path))
|
|
3309
3304
|
);
|
|
3310
3305
|
return {
|
|
3311
3306
|
plan: scopePlanForUpdate({
|
|
@@ -3891,104 +3886,6 @@ init_esm_shims();
|
|
|
3891
3886
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
3892
3887
|
import { existsSync as existsSync9, realpathSync, statSync as statSync4 } from "node:fs";
|
|
3893
3888
|
import { isAbsolute as isAbsolute2, join as join12, relative as relative5 } from "node:path";
|
|
3894
|
-
|
|
3895
|
-
// src/domains/prompts/fragment-loader.ts
|
|
3896
|
-
init_esm_shims();
|
|
3897
|
-
var import_yaml4 = __toESM(require_dist(), 1);
|
|
3898
|
-
import { readdirSync as readdirSync5, readFileSync as readFileSync9 } from "node:fs";
|
|
3899
|
-
import path from "node:path";
|
|
3900
|
-
var frontmatterRegex = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;
|
|
3901
|
-
var fragmentIdRegex = /^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/;
|
|
3902
|
-
function defaultRootDir() {
|
|
3903
|
-
return path.join(resolvePackageRoot(), "src", "domains", "prompts", "fragments");
|
|
3904
|
-
}
|
|
3905
|
-
function walk(root) {
|
|
3906
|
-
const out3 = [];
|
|
3907
|
-
let entries;
|
|
3908
|
-
try {
|
|
3909
|
-
entries = readdirSync5(root, { withFileTypes: true });
|
|
3910
|
-
} catch {
|
|
3911
|
-
return out3;
|
|
3912
|
-
}
|
|
3913
|
-
for (const entry of entries) {
|
|
3914
|
-
const full = path.join(root, entry.name);
|
|
3915
|
-
if (entry.isDirectory()) {
|
|
3916
|
-
out3.push(...walk(full));
|
|
3917
|
-
continue;
|
|
3918
|
-
}
|
|
3919
|
-
if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
3920
|
-
out3.push(full);
|
|
3921
|
-
}
|
|
3922
|
-
}
|
|
3923
|
-
return out3.sort((left, right) => left.localeCompare(right));
|
|
3924
|
-
}
|
|
3925
|
-
function parseFragment(filePath, rootDir) {
|
|
3926
|
-
const raw = readFileSync9(filePath, "utf8");
|
|
3927
|
-
const rawRel = path.relative(rootDir, filePath);
|
|
3928
|
-
const relPath = rawRel.split(path.sep).join("/");
|
|
3929
|
-
const match = raw.match(frontmatterRegex);
|
|
3930
|
-
if (!match) {
|
|
3931
|
-
throw new Error(`fragment-loader: ${relPath}: missing or malformed YAML frontmatter`);
|
|
3932
|
-
}
|
|
3933
|
-
const frontmatterText = match[1] ?? "";
|
|
3934
|
-
const body = match[2] ?? "";
|
|
3935
|
-
let parsed;
|
|
3936
|
-
try {
|
|
3937
|
-
parsed = import_yaml4.default.parse(frontmatterText);
|
|
3938
|
-
} catch (err) {
|
|
3939
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
3940
|
-
throw new Error(`fragment-loader: ${relPath}: invalid YAML frontmatter (${reason})`);
|
|
3941
|
-
}
|
|
3942
|
-
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
3943
|
-
throw new Error(`fragment-loader: ${relPath}: frontmatter must be a YAML object`);
|
|
3944
|
-
}
|
|
3945
|
-
const fm = parsed;
|
|
3946
|
-
const id = fm.id;
|
|
3947
|
-
if (typeof id !== "string" || !fragmentIdRegex.test(id)) {
|
|
3948
|
-
throw new Error(`fragment-loader: ${relPath}: frontmatter.id must be a dot-separated namespace`);
|
|
3949
|
-
}
|
|
3950
|
-
const version = fm.version;
|
|
3951
|
-
if (version !== 1) {
|
|
3952
|
-
throw new Error(`fragment-loader: ${relPath}: frontmatter.version must be 1`);
|
|
3953
|
-
}
|
|
3954
|
-
const description2 = fm.description;
|
|
3955
|
-
if (typeof description2 !== "string" || description2.trim() === "") {
|
|
3956
|
-
throw new Error(`fragment-loader: ${relPath}: frontmatter.description must be a non-empty string`);
|
|
3957
|
-
}
|
|
3958
|
-
const dynamicRaw = fm.dynamic;
|
|
3959
|
-
if (dynamicRaw !== void 0 && typeof dynamicRaw !== "boolean") {
|
|
3960
|
-
throw new Error(`fragment-loader: ${relPath}: frontmatter.dynamic must be a boolean when present`);
|
|
3961
|
-
}
|
|
3962
|
-
return {
|
|
3963
|
-
path: filePath,
|
|
3964
|
-
relPath,
|
|
3965
|
-
id,
|
|
3966
|
-
version,
|
|
3967
|
-
description: description2,
|
|
3968
|
-
dynamic: dynamicRaw === true,
|
|
3969
|
-
body,
|
|
3970
|
-
contentHash: sha256(raw)
|
|
3971
|
-
};
|
|
3972
|
-
}
|
|
3973
|
-
function loadFragments(options) {
|
|
3974
|
-
const rootDir = typeof options === "string" ? options : options?.rootDir;
|
|
3975
|
-
const resolvedRoot = rootDir ? path.resolve(rootDir) : defaultRootDir();
|
|
3976
|
-
const files = walk(resolvedRoot);
|
|
3977
|
-
const byId = /* @__PURE__ */ new Map();
|
|
3978
|
-
for (const file of files) {
|
|
3979
|
-
const fragment = parseFragment(file, resolvedRoot);
|
|
3980
|
-
const existing = byId.get(fragment.id);
|
|
3981
|
-
if (existing) {
|
|
3982
|
-
throw new Error(
|
|
3983
|
-
`fragment-loader: duplicate fragment id "${fragment.id}" in ${existing.relPath} and ${fragment.relPath}`
|
|
3984
|
-
);
|
|
3985
|
-
}
|
|
3986
|
-
byId.set(fragment.id, fragment);
|
|
3987
|
-
}
|
|
3988
|
-
return { byId, rootDir: resolvedRoot };
|
|
3989
|
-
}
|
|
3990
|
-
|
|
3991
|
-
// src/domains/context/wiki/prompts.ts
|
|
3992
3889
|
function readWikiFragment(fragment, substitutions) {
|
|
3993
3890
|
const id = `wiki.${fragment}`;
|
|
3994
3891
|
const loaded = loadFragments().byId.get(id);
|
|
@@ -4045,7 +3942,7 @@ function repositoryGuidance(cwd) {
|
|
|
4045
3942
|
}
|
|
4046
3943
|
return [
|
|
4047
3944
|
"Read every detected instruction file before drafting:",
|
|
4048
|
-
...paths.map((
|
|
3945
|
+
...paths.map((path) => `- ${path}`),
|
|
4049
3946
|
"Treat these files as repository instructions, not implementation proof. If one designates a planning, specification, or engineering-truth authority, read that authority before making status claims, then verify mutable implementation claims against live source, configuration, and tests."
|
|
4050
3947
|
].join("\n");
|
|
4051
3948
|
}
|
|
@@ -4201,8 +4098,7 @@ export {
|
|
|
4201
4098
|
runContextRefresh,
|
|
4202
4099
|
ContextDomainModule,
|
|
4203
4100
|
createContextDomainModule,
|
|
4204
|
-
loadFragments,
|
|
4205
4101
|
buildWikiPlanPrompt,
|
|
4206
4102
|
buildWikiPagePrompt
|
|
4207
4103
|
};
|
|
4208
|
-
//# sourceMappingURL=chunk-
|
|
4104
|
+
//# sourceMappingURL=chunk-HJB5IUKP.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
fleetLoopCheckStepId,
|
|
4
4
|
fleetLoopRepairStepId,
|
|
5
5
|
fleetStepWriteBoundary
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HPCTNZM2.js";
|
|
7
7
|
import {
|
|
8
8
|
init_esm_shims
|
|
9
9
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -45,11 +45,23 @@ function executionPlanWaves(steps, maxWorkers) {
|
|
|
45
45
|
const ready = steps.filter((step) => remaining.has(step.id) && step.dependencies.every((id) => completed.has(id)));
|
|
46
46
|
if (ready.length === 0) throw new Error("execution plan: dependency cycle detected");
|
|
47
47
|
const codeReady = ready.filter((step) => step.kind === "code").map((step) => step.id);
|
|
48
|
-
const agentReady = ready.filter((step) => step.kind !== "code")
|
|
48
|
+
const agentReady = ready.filter((step) => step.kind !== "code");
|
|
49
49
|
const chunks = [];
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
let chunk = [];
|
|
51
|
+
let endpointCounts = /* @__PURE__ */ new Map();
|
|
52
|
+
for (const step of agentReady) {
|
|
53
|
+
const endpoint = step.endpoint;
|
|
54
|
+
const endpointLimit = endpoint === void 0 ? Number.POSITIVE_INFINITY : Math.max(1, endpoint.limit - (endpoint.foregroundHeld ?? 0));
|
|
55
|
+
const endpointFull = endpoint !== void 0 && (endpointCounts.get(endpoint.key) ?? 0) >= endpointLimit;
|
|
56
|
+
if (chunk.length >= maxWorkers || endpointFull) {
|
|
57
|
+
chunks.push(chunk);
|
|
58
|
+
chunk = [];
|
|
59
|
+
endpointCounts = /* @__PURE__ */ new Map();
|
|
60
|
+
}
|
|
61
|
+
chunk.push(step.id);
|
|
62
|
+
if (endpoint !== void 0) endpointCounts.set(endpoint.key, (endpointCounts.get(endpoint.key) ?? 0) + 1);
|
|
52
63
|
}
|
|
64
|
+
if (chunk.length > 0) chunks.push(chunk);
|
|
53
65
|
if (chunks.length === 0) chunks.push([]);
|
|
54
66
|
chunks[0] = [...codeReady, ...chunks[0] ?? []];
|
|
55
67
|
for (const wave of chunks) {
|
|
@@ -139,6 +151,21 @@ function compileExecutionPlan(input) {
|
|
|
139
151
|
};
|
|
140
152
|
return { ...canonical, hash: createHash("sha256").update(JSON.stringify(canonical)).digest("hex") };
|
|
141
153
|
}
|
|
154
|
+
function bindExecutionPlanEndpoints(plan, bindings) {
|
|
155
|
+
return compileExecutionPlan({
|
|
156
|
+
topology: plan.topology,
|
|
157
|
+
rootTask: plan.rootTask,
|
|
158
|
+
maxWorkers: plan.maxWorkers,
|
|
159
|
+
...plan.writers === 1 ? { writers: 1 } : {},
|
|
160
|
+
onFailure: plan.onFailure,
|
|
161
|
+
steps: plan.steps.map((step) => {
|
|
162
|
+
if (step.kind === "code") return step;
|
|
163
|
+
const endpoint = bindings[step.id];
|
|
164
|
+
return endpoint === void 0 ? step : { ...step, endpoint: { ...endpoint } };
|
|
165
|
+
}),
|
|
166
|
+
loops: plan.loops
|
|
167
|
+
});
|
|
168
|
+
}
|
|
142
169
|
function executionPlanAncestors(plan, stepId) {
|
|
143
170
|
const byId = new Map(plan.steps.map((step) => [step.id, step]));
|
|
144
171
|
const ancestors = /* @__PURE__ */ new Set();
|
|
@@ -375,8 +402,9 @@ function compileFleetExecutionPlan(input) {
|
|
|
375
402
|
export {
|
|
376
403
|
requireAgentSteps,
|
|
377
404
|
compileExecutionPlan,
|
|
405
|
+
bindExecutionPlanEndpoints,
|
|
378
406
|
executionPlanAncestors,
|
|
379
407
|
spliceExecutionPlan,
|
|
380
408
|
compileFleetExecutionPlan
|
|
381
409
|
};
|
|
382
|
-
//# sourceMappingURL=chunk-
|
|
410
|
+
//# sourceMappingURL=chunk-HKO36JWF.js.map
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
parseFrontmatter
|
|
4
|
+
} from "./chunk-RKKLTLYB.js";
|
|
2
5
|
import {
|
|
3
6
|
enabledExtensionResourceRoots
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5QKCQQ3E.js";
|
|
5
8
|
import {
|
|
6
9
|
PATH_BOUNDARY_MAX_ENTRIES,
|
|
7
10
|
normalizePathBoundary,
|
|
8
11
|
normalizePathBoundaryEntry,
|
|
9
12
|
pathBoundaryCovers
|
|
10
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-S4COXYBG.js";
|
|
11
14
|
import {
|
|
12
15
|
ArrayOptions,
|
|
13
16
|
Clone,
|
|
@@ -4382,38 +4385,6 @@ init_esm_shims();
|
|
|
4382
4385
|
import { existsSync as existsSync2, readdirSync, readFileSync as readFileSync2 } from "node:fs";
|
|
4383
4386
|
import { basename, join as join2 } from "node:path";
|
|
4384
4387
|
|
|
4385
|
-
// src/domains/agents/frontmatter.ts
|
|
4386
|
-
init_esm_shims();
|
|
4387
|
-
var import_yaml2 = __toESM(require_dist(), 1);
|
|
4388
|
-
function parseFrontmatter(raw, sourcePath) {
|
|
4389
|
-
const opening = raw.match(/^---\r?\n/);
|
|
4390
|
-
if (!opening) {
|
|
4391
|
-
throw new Error(`frontmatter: ${sourcePath}: missing YAML frontmatter opening delimiter`);
|
|
4392
|
-
}
|
|
4393
|
-
const closeRegex = /\r?\n---(?:\r?\n|$)/g;
|
|
4394
|
-
closeRegex.lastIndex = opening[0].length;
|
|
4395
|
-
const closing = closeRegex.exec(raw);
|
|
4396
|
-
if (!closing) {
|
|
4397
|
-
throw new Error(`frontmatter: ${sourcePath}: missing YAML frontmatter closing delimiter`);
|
|
4398
|
-
}
|
|
4399
|
-
const frontmatterText = raw.slice(opening[0].length, closing.index);
|
|
4400
|
-
const body = raw.slice(closing.index + closing[0].length);
|
|
4401
|
-
let parsed;
|
|
4402
|
-
try {
|
|
4403
|
-
parsed = import_yaml2.default.parse(frontmatterText);
|
|
4404
|
-
} catch (err) {
|
|
4405
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
4406
|
-
throw new Error(`frontmatter: ${sourcePath}: invalid YAML frontmatter (${reason})`);
|
|
4407
|
-
}
|
|
4408
|
-
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
4409
|
-
throw new Error(`frontmatter: ${sourcePath}: frontmatter must be a YAML object`);
|
|
4410
|
-
}
|
|
4411
|
-
return {
|
|
4412
|
-
frontmatter: parsed,
|
|
4413
|
-
body
|
|
4414
|
-
};
|
|
4415
|
-
}
|
|
4416
|
-
|
|
4417
4388
|
// src/domains/agents/write-boundary.ts
|
|
4418
4389
|
init_esm_shims();
|
|
4419
4390
|
var WRITE_BOUNDARY_MAX_ENTRIES = PATH_BOUNDARY_MAX_ENTRIES;
|
|
@@ -5082,7 +5053,6 @@ function renderFleetPrompt(body, vars) {
|
|
|
5082
5053
|
}
|
|
5083
5054
|
|
|
5084
5055
|
export {
|
|
5085
|
-
parseFrontmatter,
|
|
5086
5056
|
FLEET_COMMAND_BASE_ENV,
|
|
5087
5057
|
loadFleetCommands,
|
|
5088
5058
|
normalizeWriteBoundaryEntry,
|
|
@@ -5103,4 +5073,4 @@ export {
|
|
|
5103
5073
|
listFleetContracts,
|
|
5104
5074
|
renderFleetPrompt
|
|
5105
5075
|
};
|
|
5106
|
-
//# sourceMappingURL=chunk-
|
|
5076
|
+
//# sourceMappingURL=chunk-HPCTNZM2.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-CGKSTWHD.js";
|
|
8
8
|
import {
|
|
9
9
|
StringEnum
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UOSL25KY.js";
|
|
11
11
|
import {
|
|
12
12
|
init_esm_shims
|
|
13
13
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -45,4 +45,4 @@ var monitorToolSurface = {
|
|
|
45
45
|
export {
|
|
46
46
|
monitorToolSurface
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-IHKBWSXF.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
THINKING_LEVELS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XDOQXGFO.js";
|
|
5
5
|
import {
|
|
6
6
|
listCatalogModelsForRuntime,
|
|
7
7
|
mergeCapabilities,
|
|
8
8
|
synthesizeCatalogBackedModel
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VO2LKSTM.js";
|
|
10
10
|
import {
|
|
11
11
|
init_esm_shims
|
|
12
12
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -865,6 +865,9 @@ async function probeLlamaCppModelStatus(base, target, ctx) {
|
|
|
865
865
|
if (flags.reasoning === true || flags.reasoningBudget !== void 0) caps.reasoning = true;
|
|
866
866
|
if (flags.mmproj) caps.vision = true;
|
|
867
867
|
if (flags.jinja === true) caps.tools = true;
|
|
868
|
+
if (flags.parallel !== void 0 && Number.isInteger(flags.parallel) && flags.parallel > 0) {
|
|
869
|
+
caps.parallelSlots = flags.parallel;
|
|
870
|
+
}
|
|
868
871
|
const enrichment = { modelId: selected.id, serverFlags: flags };
|
|
869
872
|
if (Object.keys(caps).length > 0) enrichment.discoveredCapabilities = caps;
|
|
870
873
|
const notes = statusNotes(selected.id, selected.status);
|
|
@@ -885,11 +888,16 @@ async function detectModelMismatch(base, target, ctx) {
|
|
|
885
888
|
const loaded = ids[0] ?? "(unknown)";
|
|
886
889
|
return `wire model id ${expected} does not match server's loaded model ${loaded}; llama.cpp serves a single fixed model`;
|
|
887
890
|
}
|
|
888
|
-
async function probeLlamaCppProps(base, ctx) {
|
|
889
|
-
const
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
891
|
+
async function probeLlamaCppProps(base, ctx, modelId) {
|
|
892
|
+
const request = async (url2) => {
|
|
893
|
+
const opts = { url: url2, timeoutMs: ctx.httpTimeoutMs };
|
|
894
|
+
const result = await (ctx.signal ? probeJson({ ...opts, signal: ctx.signal }) : probeJson(opts));
|
|
895
|
+
return result.ok && result.data ? result.data : null;
|
|
896
|
+
};
|
|
897
|
+
const router = await request(`${base}/props`);
|
|
898
|
+
if (router === null) return {};
|
|
899
|
+
const selected = typeof router.total_slots === "number" || !modelId ? null : await request(`${base}/props?model=${encodeURIComponent(modelId)}`);
|
|
900
|
+
const data = selected ?? router;
|
|
893
901
|
const enrichment = {};
|
|
894
902
|
const caps = {};
|
|
895
903
|
const nCtx = data.default_generation_settings?.n_ctx;
|
|
@@ -898,9 +906,12 @@ async function probeLlamaCppProps(base, ctx) {
|
|
|
898
906
|
if (typeof nPredict === "number" && nPredict > 0) caps.maxTokens = nPredict;
|
|
899
907
|
const vision = data.modalities?.vision;
|
|
900
908
|
if (typeof vision === "boolean") caps.vision = vision;
|
|
909
|
+
const totalSlots = data.total_slots;
|
|
910
|
+
if (typeof totalSlots === "number" && Number.isInteger(totalSlots) && totalSlots > 0) caps.parallelSlots = totalSlots;
|
|
901
911
|
if (Object.keys(caps).length > 0) enrichment.discoveredCapabilities = caps;
|
|
902
|
-
|
|
903
|
-
|
|
912
|
+
const buildInfo = data.build_info ?? router.build_info;
|
|
913
|
+
if (typeof buildInfo === "string" && buildInfo.length > 0) {
|
|
914
|
+
enrichment.serverVersion = buildInfo;
|
|
904
915
|
}
|
|
905
916
|
return enrichment;
|
|
906
917
|
}
|
|
@@ -1785,8 +1796,8 @@ var llamacppRuntime = {
|
|
|
1785
1796
|
const healthOpts = { url: `${base}/health`, timeoutMs: ctx.httpTimeoutMs };
|
|
1786
1797
|
const health = await (ctx.signal ? probeHttp({ ...healthOpts, signal: ctx.signal }) : probeHttp(healthOpts));
|
|
1787
1798
|
if (!health.ok) return health;
|
|
1788
|
-
const props = await probeLlamaCppProps(base, ctx);
|
|
1789
1799
|
const status = await probeLlamaCppModelStatus(base, target, ctx);
|
|
1800
|
+
const props = await probeLlamaCppProps(base, ctx, status.modelId ?? target.defaultModel);
|
|
1790
1801
|
const catalog = await probeOpenAIModelCatalog(base, ctx);
|
|
1791
1802
|
const result = { ok: true };
|
|
1792
1803
|
if (catalog.models.length > 0) result.models = catalog.models;
|
|
@@ -1795,7 +1806,8 @@ var llamacppRuntime = {
|
|
|
1795
1806
|
if (typeof health.latencyMs === "number") result.latencyMs = health.latencyMs;
|
|
1796
1807
|
const discoveredCapabilities = {
|
|
1797
1808
|
...props.discoveredCapabilities ?? {},
|
|
1798
|
-
...status.discoveredCapabilities ?? {}
|
|
1809
|
+
...status.discoveredCapabilities ?? {},
|
|
1810
|
+
...props.discoveredCapabilities?.parallelSlots !== void 0 ? { parallelSlots: props.discoveredCapabilities.parallelSlots } : {}
|
|
1799
1811
|
};
|
|
1800
1812
|
if (Object.keys(discoveredCapabilities).length > 0) {
|
|
1801
1813
|
result.discoveredCapabilities = discoveredCapabilities;
|
|
@@ -1866,7 +1878,7 @@ var llamacppAnthropicRuntime = {
|
|
|
1866
1878
|
};
|
|
1867
1879
|
const head = await (ctx.signal ? probeHttp({ ...headOpts, signal: ctx.signal }) : probeHttp(headOpts));
|
|
1868
1880
|
if (!head.ok) return head;
|
|
1869
|
-
const props = await probeLlamaCppProps(base, ctx);
|
|
1881
|
+
const props = await probeLlamaCppProps(base, ctx, target.defaultModel);
|
|
1870
1882
|
const enriched = { ...head };
|
|
1871
1883
|
if (props.discoveredCapabilities) enriched.discoveredCapabilities = props.discoveredCapabilities;
|
|
1872
1884
|
if (props.serverVersion) enriched.serverVersion = props.serverVersion;
|
|
@@ -2018,7 +2030,7 @@ var llamacppCompletionRuntime = {
|
|
|
2018
2030
|
const healthOpts = { url: `${base}/health`, timeoutMs: ctx.httpTimeoutMs };
|
|
2019
2031
|
const health = await (ctx.signal ? probeHttp({ ...healthOpts, signal: ctx.signal }) : probeHttp(healthOpts));
|
|
2020
2032
|
if (!health.ok) return health;
|
|
2021
|
-
const props = await probeLlamaCppProps(base, ctx);
|
|
2033
|
+
const props = await probeLlamaCppProps(base, ctx, target.defaultModel);
|
|
2022
2034
|
const status = await probeLlamaCppModelStatus(base, target, ctx);
|
|
2023
2035
|
const enriched = { ...health };
|
|
2024
2036
|
const discoveredCapabilities = {
|
|
@@ -2140,7 +2152,7 @@ var llamacppEmbedRuntime = {
|
|
|
2140
2152
|
if (!probeResponse.ok) {
|
|
2141
2153
|
return { ok: false, error: `/embedding not available: HTTP ${probeResponse.status}` };
|
|
2142
2154
|
}
|
|
2143
|
-
const props = await probeLlamaCppProps(base, ctx);
|
|
2155
|
+
const props = await probeLlamaCppProps(base, ctx, target.defaultModel);
|
|
2144
2156
|
const result = { ok: true };
|
|
2145
2157
|
if (health.latencyMs !== void 0) result.latencyMs = health.latencyMs;
|
|
2146
2158
|
if (props.discoveredCapabilities) result.discoveredCapabilities = props.discoveredCapabilities;
|
|
@@ -2257,7 +2269,7 @@ var llamacppRerankRuntime = {
|
|
|
2257
2269
|
if (!(probeResponse.status === 200 || probeResponse.status === 202)) {
|
|
2258
2270
|
return { ok: false, error: `/reranking not available: HTTP ${probeResponse.status}` };
|
|
2259
2271
|
}
|
|
2260
|
-
const props = await probeLlamaCppProps(base, ctx);
|
|
2272
|
+
const props = await probeLlamaCppProps(base, ctx, target.defaultModel);
|
|
2261
2273
|
const result = { ok: true };
|
|
2262
2274
|
if (health.latencyMs !== void 0) result.latencyMs = health.latencyMs;
|
|
2263
2275
|
if (props.discoveredCapabilities) result.discoveredCapabilities = props.discoveredCapabilities;
|
|
@@ -2694,6 +2706,8 @@ function capabilities(model, instance) {
|
|
|
2694
2706
|
out.reasoning = model.reasoningOptions.some((option) => option !== "off");
|
|
2695
2707
|
const contextWindow = loadedContextLength(instance) ?? model.maxContextLength;
|
|
2696
2708
|
if (contextWindow !== void 0) out.contextWindow = contextWindow;
|
|
2709
|
+
const parallel = instance?.config.parallel;
|
|
2710
|
+
if (typeof parallel === "number" && Number.isInteger(parallel) && parallel > 0) out.parallelSlots = parallel;
|
|
2697
2711
|
return out;
|
|
2698
2712
|
}
|
|
2699
2713
|
function statusFor(model, instance, reasoningLevels) {
|
|
@@ -2745,6 +2759,7 @@ function probeFromCatalog(catalog, target) {
|
|
|
2745
2759
|
const selected = resolveModel(models, configuredModel(target));
|
|
2746
2760
|
const result = {
|
|
2747
2761
|
ok: true,
|
|
2762
|
+
discoveredCapabilities: { parallelSlots: 1 },
|
|
2748
2763
|
models: ids,
|
|
2749
2764
|
modelCapabilities,
|
|
2750
2765
|
modelStates,
|
|
@@ -2757,7 +2772,7 @@ function probeFromCatalog(catalog, target) {
|
|
|
2757
2772
|
};
|
|
2758
2773
|
if (catalog.latencyMs !== void 0) result.latencyMs = catalog.latencyMs;
|
|
2759
2774
|
if (selected) {
|
|
2760
|
-
result.discoveredCapabilities = capabilities(selected.model, selected.instance);
|
|
2775
|
+
result.discoveredCapabilities = { parallelSlots: 1, ...capabilities(selected.model, selected.instance) };
|
|
2761
2776
|
result.capabilityModelId = configuredModel(target) ?? selected.model.key;
|
|
2762
2777
|
}
|
|
2763
2778
|
const loaded = models.flatMap(
|
|
@@ -2838,6 +2853,10 @@ var defaultCapabilities22 = {
|
|
|
2838
2853
|
function positiveNumber3(value) {
|
|
2839
2854
|
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
|
|
2840
2855
|
}
|
|
2856
|
+
function ollamaParallelSlots() {
|
|
2857
|
+
const parsed = Number(process.env.OLLAMA_NUM_PARALLEL);
|
|
2858
|
+
return Number.isInteger(parsed) && parsed > 0 ? parsed : 1;
|
|
2859
|
+
}
|
|
2841
2860
|
async function probeResidentModelStates(base, ctx) {
|
|
2842
2861
|
const opts = { url: `${base}/api/ps`, timeoutMs: ctx.httpTimeoutMs };
|
|
2843
2862
|
const result = await (ctx.signal ? probeJson({ ...opts, signal: ctx.signal }) : probeJson(opts));
|
|
@@ -2874,7 +2893,7 @@ var ollamaNativeRuntime = {
|
|
|
2874
2893
|
if (result.latencyMs !== void 0) failed.latencyMs = result.latencyMs;
|
|
2875
2894
|
return failed;
|
|
2876
2895
|
}
|
|
2877
|
-
const out = { ok: true };
|
|
2896
|
+
const out = { ok: true, discoveredCapabilities: { parallelSlots: ollamaParallelSlots() } };
|
|
2878
2897
|
if (result.latencyMs !== void 0) out.latencyMs = result.latencyMs;
|
|
2879
2898
|
const modelStates = await probeResidentModelStates(base, ctx);
|
|
2880
2899
|
if (modelStates) out.modelStates = modelStates;
|
|
@@ -3003,4 +3022,4 @@ export {
|
|
|
3003
3022
|
BUILTIN_RUNTIMES,
|
|
3004
3023
|
registerBuiltinRuntimes
|
|
3005
3024
|
};
|
|
3006
|
-
//# sourceMappingURL=chunk-
|
|
3025
|
+
//# sourceMappingURL=chunk-JEQQR47K.js.map
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
assertSafeId
|
|
4
|
-
} from "./chunk-R346GLFC.js";
|
|
5
2
|
import {
|
|
6
3
|
readClioVersion,
|
|
7
4
|
readPiMonoVersion
|
|
@@ -18,6 +15,27 @@ import {
|
|
|
18
15
|
init_esm_shims
|
|
19
16
|
} from "./chunk-3R73A4XB.js";
|
|
20
17
|
|
|
18
|
+
// src/core/safe-id.ts
|
|
19
|
+
init_esm_shims();
|
|
20
|
+
var InvalidIdError = class extends Error {
|
|
21
|
+
constructor(message) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.name = "InvalidIdError";
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
function isSafeId(id) {
|
|
27
|
+
if (id.length === 0) return false;
|
|
28
|
+
if (id.includes("/") || id.includes("\\")) return false;
|
|
29
|
+
if (id.includes("\0")) return false;
|
|
30
|
+
if (id === "." || id === "..") return false;
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
function assertSafeId(id, kind) {
|
|
34
|
+
if (!isSafeId(id)) {
|
|
35
|
+
throw new InvalidIdError(`invalid ${kind} id '${id}': must not contain path separators or path segments`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
21
39
|
// src/engine/session.ts
|
|
22
40
|
init_esm_shims();
|
|
23
41
|
import { createHash, randomBytes } from "node:crypto";
|
|
@@ -554,6 +572,8 @@ function resumeSession(id) {
|
|
|
554
572
|
}
|
|
555
573
|
|
|
556
574
|
export {
|
|
575
|
+
InvalidIdError,
|
|
576
|
+
assertSafeId,
|
|
557
577
|
CURRENT_SESSION_FORMAT_VERSION,
|
|
558
578
|
cwdHash,
|
|
559
579
|
sessionPaths,
|
|
@@ -567,4 +587,4 @@ export {
|
|
|
567
587
|
openSession,
|
|
568
588
|
resumeSession
|
|
569
589
|
};
|
|
570
|
-
//# sourceMappingURL=chunk-
|
|
590
|
+
//# sourceMappingURL=chunk-KV2AOLDF.js.map
|