@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
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
getVersionInfo
|
|
4
|
+
} from "./chunk-XPLRXC72.js";
|
|
2
5
|
import {
|
|
3
6
|
require_dist
|
|
4
7
|
} from "./chunk-APJ265NV.js";
|
|
@@ -18,6 +21,220 @@ init_esm_shims();
|
|
|
18
21
|
var import_yaml = __toESM(require_dist(), 1);
|
|
19
22
|
import { existsSync, lstatSync, readdirSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
20
23
|
import path from "node:path";
|
|
24
|
+
|
|
25
|
+
// src/domains/extensions/compatibility.ts
|
|
26
|
+
init_esm_shims();
|
|
27
|
+
var MAX_RANGE_CHARS = 256;
|
|
28
|
+
var NUMERIC = "(?:0|[1-9]\\d*)";
|
|
29
|
+
var IDENTIFIER = "[0-9A-Za-z-]+";
|
|
30
|
+
var VERSION_RE = new RegExp(
|
|
31
|
+
`^v?(${NUMERIC})\\.(${NUMERIC})\\.(${NUMERIC})(?:-(${IDENTIFIER}(?:\\.${IDENTIFIER})*))?(?:\\+${IDENTIFIER}(?:\\.${IDENTIFIER})*)?$`
|
|
32
|
+
);
|
|
33
|
+
var PARTIAL_RE = new RegExp(
|
|
34
|
+
`^v?(${NUMERIC}|[xX*])(?:\\.(${NUMERIC}|[xX*]))?(?:\\.(${NUMERIC}|[xX*]))?(?:-(${IDENTIFIER}(?:\\.${IDENTIFIER})*))?(?:\\+${IDENTIFIER}(?:\\.${IDENTIFIER})*)?$`
|
|
35
|
+
);
|
|
36
|
+
function prerelease(value) {
|
|
37
|
+
if (value === void 0) return [];
|
|
38
|
+
const out = [];
|
|
39
|
+
for (const identifier of value.split(".")) {
|
|
40
|
+
if (identifier.length === 0) return null;
|
|
41
|
+
if (/^\d+$/u.test(identifier)) {
|
|
42
|
+
if (identifier.length > 1 && identifier.startsWith("0")) return null;
|
|
43
|
+
const parsed = Number(identifier);
|
|
44
|
+
if (!Number.isSafeInteger(parsed)) return null;
|
|
45
|
+
out.push(parsed);
|
|
46
|
+
} else {
|
|
47
|
+
out.push(identifier);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
function parseSemVer(value) {
|
|
53
|
+
const match = VERSION_RE.exec(value);
|
|
54
|
+
if (match === null) return null;
|
|
55
|
+
const parsedPrerelease = prerelease(match[4]);
|
|
56
|
+
if (parsedPrerelease === null) return null;
|
|
57
|
+
const major = Number(match[1]);
|
|
58
|
+
const minor = Number(match[2]);
|
|
59
|
+
const patch = Number(match[3]);
|
|
60
|
+
if (![major, minor, patch].every(Number.isSafeInteger)) return null;
|
|
61
|
+
return { major, minor, patch, prerelease: parsedPrerelease };
|
|
62
|
+
}
|
|
63
|
+
function parsePart(value) {
|
|
64
|
+
if (value === void 0 || value === "x" || value === "X" || value === "*") return null;
|
|
65
|
+
const parsed = Number(value);
|
|
66
|
+
return Number.isSafeInteger(parsed) ? parsed : null;
|
|
67
|
+
}
|
|
68
|
+
function parsePartial(value) {
|
|
69
|
+
const match = PARTIAL_RE.exec(value);
|
|
70
|
+
if (match === null) return null;
|
|
71
|
+
for (const part of match.slice(1, 4)) {
|
|
72
|
+
if (part === void 0 || part === "x" || part === "X" || part === "*") continue;
|
|
73
|
+
if (!Number.isSafeInteger(Number(part))) return null;
|
|
74
|
+
}
|
|
75
|
+
const major = parsePart(match[1]);
|
|
76
|
+
const minor = parsePart(match[2]);
|
|
77
|
+
const patch = parsePart(match[3]);
|
|
78
|
+
if (major === null && (match[2] !== void 0 || match[3] !== void 0) || minor === null && match[3] !== void 0) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const parsedPrerelease = prerelease(match[4]);
|
|
82
|
+
if (parsedPrerelease === null) return null;
|
|
83
|
+
if (parsedPrerelease.length > 0 && (major === null || minor === null || patch === null)) return null;
|
|
84
|
+
return { major, minor, patch, prerelease: parsedPrerelease };
|
|
85
|
+
}
|
|
86
|
+
function compareIdentifiers(left, right) {
|
|
87
|
+
if (left === right) return 0;
|
|
88
|
+
if (typeof left === "number" && typeof right === "number") return left < right ? -1 : 1;
|
|
89
|
+
if (typeof left === "number") return -1;
|
|
90
|
+
if (typeof right === "number") return 1;
|
|
91
|
+
return left < right ? -1 : 1;
|
|
92
|
+
}
|
|
93
|
+
function compare(left, right) {
|
|
94
|
+
for (const key of ["major", "minor", "patch"]) {
|
|
95
|
+
if (left[key] !== right[key]) return left[key] < right[key] ? -1 : 1;
|
|
96
|
+
}
|
|
97
|
+
if (left.prerelease.length === 0 || right.prerelease.length === 0) {
|
|
98
|
+
if (left.prerelease.length === right.prerelease.length) return 0;
|
|
99
|
+
return left.prerelease.length === 0 ? 1 : -1;
|
|
100
|
+
}
|
|
101
|
+
const length = Math.max(left.prerelease.length, right.prerelease.length);
|
|
102
|
+
for (let index = 0; index < length; index += 1) {
|
|
103
|
+
const leftPart = left.prerelease[index];
|
|
104
|
+
const rightPart = right.prerelease[index];
|
|
105
|
+
if (leftPart === void 0 || rightPart === void 0) {
|
|
106
|
+
if (leftPart === rightPart) return 0;
|
|
107
|
+
return leftPart === void 0 ? -1 : 1;
|
|
108
|
+
}
|
|
109
|
+
const order = compareIdentifiers(leftPart, rightPart);
|
|
110
|
+
if (order !== 0) return order;
|
|
111
|
+
}
|
|
112
|
+
return 0;
|
|
113
|
+
}
|
|
114
|
+
function floor(partial) {
|
|
115
|
+
return {
|
|
116
|
+
major: partial.major ?? 0,
|
|
117
|
+
minor: partial.minor ?? 0,
|
|
118
|
+
patch: partial.patch ?? 0,
|
|
119
|
+
prerelease: partial.prerelease
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function nextWildcard(partial) {
|
|
123
|
+
if (partial.major === null) return null;
|
|
124
|
+
if (partial.minor === null) return { major: partial.major + 1, minor: 0, patch: 0, prerelease: [] };
|
|
125
|
+
if (partial.patch === null) return { major: partial.major, minor: partial.minor + 1, patch: 0, prerelease: [] };
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
function lowerBound(version, inclusive) {
|
|
129
|
+
return (candidate) => inclusive ? compare(candidate, version) >= 0 : compare(candidate, version) > 0;
|
|
130
|
+
}
|
|
131
|
+
function upperBound(version, inclusive) {
|
|
132
|
+
return (candidate) => inclusive ? compare(candidate, version) <= 0 : compare(candidate, version) < 0;
|
|
133
|
+
}
|
|
134
|
+
function core(version) {
|
|
135
|
+
return `${version.major}.${version.minor}.${version.patch}`;
|
|
136
|
+
}
|
|
137
|
+
function predicatesForToken(token) {
|
|
138
|
+
const match = /^(<=|>=|<|>|=|~|\^)?(.+)$/u.exec(token);
|
|
139
|
+
if (match === null) return null;
|
|
140
|
+
const operator = match[1] ?? "";
|
|
141
|
+
const partial = parsePartial(match[2] ?? "");
|
|
142
|
+
if (partial === null) return null;
|
|
143
|
+
const base = floor(partial);
|
|
144
|
+
const wildcardUpper = nextWildcard(partial);
|
|
145
|
+
const prereleaseCore = partial.prerelease.length > 0 ? core(base) : null;
|
|
146
|
+
if (operator === "" || operator === "=") {
|
|
147
|
+
if (partial.major === null) return { predicates: [], prereleaseCore };
|
|
148
|
+
if (wildcardUpper !== null) {
|
|
149
|
+
return { predicates: [lowerBound(base, true), upperBound(wildcardUpper, false)], prereleaseCore };
|
|
150
|
+
}
|
|
151
|
+
return { predicates: [(candidate) => compare(candidate, base) === 0], prereleaseCore };
|
|
152
|
+
}
|
|
153
|
+
if (operator === ">=") return { predicates: [lowerBound(base, true)], prereleaseCore };
|
|
154
|
+
if (operator === "<") return { predicates: [upperBound(base, false)], prereleaseCore };
|
|
155
|
+
if (operator === ">") {
|
|
156
|
+
return {
|
|
157
|
+
predicates: [wildcardUpper === null ? lowerBound(base, false) : lowerBound(wildcardUpper, true)],
|
|
158
|
+
prereleaseCore
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
if (operator === "<=") {
|
|
162
|
+
return {
|
|
163
|
+
predicates: [wildcardUpper === null ? upperBound(base, true) : upperBound(wildcardUpper, false)],
|
|
164
|
+
prereleaseCore
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
if (partial.major === null) return { predicates: [], prereleaseCore };
|
|
168
|
+
if (operator === "~") {
|
|
169
|
+
const upper2 = partial.minor === null ? { major: partial.major + 1, minor: 0, patch: 0, prerelease: [] } : { major: partial.major, minor: partial.minor + 1, patch: 0, prerelease: [] };
|
|
170
|
+
return { predicates: [lowerBound(base, true), upperBound(upper2, false)], prereleaseCore };
|
|
171
|
+
}
|
|
172
|
+
const upper = partial.major > 0 ? { major: partial.major + 1, minor: 0, patch: 0, prerelease: [] } : partial.minor === null ? { major: 1, minor: 0, patch: 0, prerelease: [] } : (partial.minor ?? 0) > 0 ? { major: 0, minor: (partial.minor ?? 0) + 1, patch: 0, prerelease: [] } : partial.patch === null ? { major: 0, minor: 1, patch: 0, prerelease: [] } : { major: 0, minor: 0, patch: (partial.patch ?? 0) + 1, prerelease: [] };
|
|
173
|
+
return { predicates: [lowerBound(base, true), upperBound(upper, false)], prereleaseCore };
|
|
174
|
+
}
|
|
175
|
+
function predicatesForSet(raw) {
|
|
176
|
+
const hyphen = /^(\S+)\s+-\s+(\S+)$/u.exec(raw);
|
|
177
|
+
if (hyphen !== null) {
|
|
178
|
+
const left = parsePartial(hyphen[1] ?? "");
|
|
179
|
+
const right = parsePartial(hyphen[2] ?? "");
|
|
180
|
+
if (left === null || right === null || left.major === null || right.major === null) return null;
|
|
181
|
+
const rightUpper = nextWildcard(right);
|
|
182
|
+
return {
|
|
183
|
+
predicates: [
|
|
184
|
+
lowerBound(floor(left), true),
|
|
185
|
+
rightUpper === null ? upperBound(floor(right), true) : upperBound(rightUpper, false)
|
|
186
|
+
],
|
|
187
|
+
prereleaseCores: new Set(
|
|
188
|
+
[
|
|
189
|
+
left.prerelease.length > 0 ? core(floor(left)) : null,
|
|
190
|
+
right.prerelease.length > 0 ? core(floor(right)) : null
|
|
191
|
+
].filter((entry) => entry !== null)
|
|
192
|
+
)
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
const normalized = raw.replace(/(<=|>=|<|>|=|~|\^)\s+/gu, "$1");
|
|
196
|
+
const tokens = normalized.split(/\s+/u).filter((entry) => entry.length > 0);
|
|
197
|
+
if (tokens.length === 0) return null;
|
|
198
|
+
const predicates = [];
|
|
199
|
+
const prereleaseCores = /* @__PURE__ */ new Set();
|
|
200
|
+
for (const token of tokens) {
|
|
201
|
+
const parsed = predicatesForToken(token);
|
|
202
|
+
if (parsed === null) return null;
|
|
203
|
+
predicates.push(...parsed.predicates);
|
|
204
|
+
if (parsed.prereleaseCore !== null) prereleaseCores.add(parsed.prereleaseCore);
|
|
205
|
+
}
|
|
206
|
+
return { predicates, prereleaseCores };
|
|
207
|
+
}
|
|
208
|
+
function parseRange(range) {
|
|
209
|
+
const trimmed = range.trim();
|
|
210
|
+
if (trimmed.length === 0 || trimmed.length > MAX_RANGE_CHARS) return null;
|
|
211
|
+
const sets = trimmed.split("||");
|
|
212
|
+
if (sets.some((set) => set.trim().length === 0)) return null;
|
|
213
|
+
const parsed = sets.map((set) => predicatesForSet(set.trim()));
|
|
214
|
+
return parsed.every((set) => set !== null) ? parsed : null;
|
|
215
|
+
}
|
|
216
|
+
function isValidSemVerRange(range) {
|
|
217
|
+
return parseRange(range) !== null;
|
|
218
|
+
}
|
|
219
|
+
function satisfiesSemVerRange(version, range) {
|
|
220
|
+
const candidate = parseSemVer(version);
|
|
221
|
+
const sets = parseRange(range);
|
|
222
|
+
if (candidate === null || sets === null) return false;
|
|
223
|
+
return sets.some((set) => {
|
|
224
|
+
if (candidate.prerelease.length > 0 && !set.prereleaseCores.has(core(candidate))) return false;
|
|
225
|
+
return set.predicates.every((predicate) => predicate(candidate));
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
function evaluateClioCompatibility(range, runningVersion = getVersionInfo().clio) {
|
|
229
|
+
const rangeValid = isValidSemVerRange(range);
|
|
230
|
+
return {
|
|
231
|
+
rangeValid,
|
|
232
|
+
satisfied: rangeValid && satisfiesSemVerRange(runningVersion, range),
|
|
233
|
+
runningVersion
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// src/domains/extensions/discovery.ts
|
|
21
238
|
var MANIFEST_NAMES = ["clio-coder-extension.yaml", "clio-coder-extension.yml", "clio-coder-extension.json"];
|
|
22
239
|
function isRecord(value) {
|
|
23
240
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -150,7 +367,32 @@ function parseExtensionManifest(value, manifestPath) {
|
|
|
150
367
|
const resources = normalizeResources(value.resources);
|
|
151
368
|
const tools = stringArray(value.tools);
|
|
152
369
|
const settings = stringArray(value.settings);
|
|
153
|
-
|
|
370
|
+
let compatibility;
|
|
371
|
+
if (value.compatibility !== void 0) {
|
|
372
|
+
if (!isRecord(value.compatibility)) {
|
|
373
|
+
diagnostics.push({ type: "error", message: "compatibility must be an object", path: manifestPath });
|
|
374
|
+
} else if ("clio" in value.compatibility) {
|
|
375
|
+
const range = trimString(value.compatibility.clio);
|
|
376
|
+
if (range === void 0) {
|
|
377
|
+
diagnostics.push({
|
|
378
|
+
type: "error",
|
|
379
|
+
message: "compatibility.clio must be a non-empty semver range",
|
|
380
|
+
path: manifestPath
|
|
381
|
+
});
|
|
382
|
+
} else {
|
|
383
|
+
const evaluation = evaluateClioCompatibility(range);
|
|
384
|
+
if (!evaluation.rangeValid) {
|
|
385
|
+
diagnostics.push({
|
|
386
|
+
type: "error",
|
|
387
|
+
message: `extension ${id ?? "<unknown>"} declares malformed compatibility.clio range '${range}'`,
|
|
388
|
+
path: manifestPath
|
|
389
|
+
});
|
|
390
|
+
} else {
|
|
391
|
+
compatibility = { clio: range };
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
154
396
|
if (!id || !name || !version || !description || diagnostics.some((diag) => diag.type === "error")) {
|
|
155
397
|
return { diagnostics };
|
|
156
398
|
}
|
|
@@ -165,6 +407,17 @@ function parseExtensionManifest(value, manifestPath) {
|
|
|
165
407
|
if (tools) manifest.tools = tools;
|
|
166
408
|
if (settings) manifest.settings = settings;
|
|
167
409
|
if (compatibility && Object.keys(compatibility).length > 0) manifest.compatibility = compatibility;
|
|
410
|
+
const clioRange = manifest.compatibility?.clio;
|
|
411
|
+
if (clioRange !== void 0) {
|
|
412
|
+
const evaluation = evaluateClioCompatibility(clioRange);
|
|
413
|
+
if (!evaluation.satisfied) {
|
|
414
|
+
diagnostics.push({
|
|
415
|
+
type: "error",
|
|
416
|
+
message: `extension ${manifest.id} requires Clio '${clioRange}', but running Clio version is '${evaluation.runningVersion}'`,
|
|
417
|
+
path: manifestPath
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
}
|
|
168
421
|
return { manifest, diagnostics };
|
|
169
422
|
}
|
|
170
423
|
function findExtensionManifestPath(root) {
|
|
@@ -296,6 +549,8 @@ function installedFromRoot(root, scope, state) {
|
|
|
296
549
|
const candidate = loadManifestFromRoot(root);
|
|
297
550
|
const manifest = candidate.manifest;
|
|
298
551
|
if (!manifest || !candidate.manifestPath) return null;
|
|
552
|
+
const clioRange = manifest.compatibility?.clio;
|
|
553
|
+
const compatible = clioRange === void 0 || evaluateClioCompatibility(clioRange).satisfied;
|
|
299
554
|
return {
|
|
300
555
|
id: manifest.id,
|
|
301
556
|
name: manifest.name,
|
|
@@ -305,6 +560,7 @@ function installedFromRoot(root, scope, state) {
|
|
|
305
560
|
rootPath: root,
|
|
306
561
|
manifestPath: candidate.manifestPath,
|
|
307
562
|
enabled: !state.disabled.includes(manifest.id),
|
|
563
|
+
compatible,
|
|
308
564
|
effective: false,
|
|
309
565
|
resources: manifest.resources,
|
|
310
566
|
diagnostics: candidate.diagnostics
|
|
@@ -333,13 +589,13 @@ function listInstalledExtensions(cwd = process.cwd(), options = {}) {
|
|
|
333
589
|
byId.set(entry.id, list);
|
|
334
590
|
}
|
|
335
591
|
for (const group of byId.values()) {
|
|
336
|
-
const winner =
|
|
592
|
+
const winner = group.filter((entry) => entry.compatible).sort((a, b) => scopeRank(a.scope) - scopeRank(b.scope)).at(-1);
|
|
337
593
|
for (const entry of group) {
|
|
338
594
|
entry.effective = entry === winner;
|
|
339
|
-
if (!entry.effective && winner) entry.overriddenBy = winner.scope;
|
|
595
|
+
if (entry.compatible && !entry.effective && winner) entry.overriddenBy = winner.scope;
|
|
340
596
|
}
|
|
341
597
|
}
|
|
342
|
-
const all = options.all === true ? entries : entries.filter((entry) => entry.effective);
|
|
598
|
+
const all = options.all === true ? entries : entries.filter((entry) => entry.effective || !entry.compatible);
|
|
343
599
|
return all.sort((a, b) => {
|
|
344
600
|
const id = a.id.localeCompare(b.id);
|
|
345
601
|
if (id !== 0) return id;
|
|
@@ -481,7 +737,7 @@ function extensionResourcePath(rootPath, resourcePath) {
|
|
|
481
737
|
function enabledExtensionResourceRoots(kind, cwd = process.cwd()) {
|
|
482
738
|
const roots = [];
|
|
483
739
|
for (const entry of listInstalledExtensions(cwd)) {
|
|
484
|
-
if (!entry.enabled || !entry.effective) continue;
|
|
740
|
+
if (!entry.enabled || !entry.compatible || !entry.effective) continue;
|
|
485
741
|
const rel = entry.resources[kind];
|
|
486
742
|
if (!rel) continue;
|
|
487
743
|
const full = extensionResourcePath(entry.rootPath, rel);
|
|
@@ -560,4 +816,4 @@ export {
|
|
|
560
816
|
enabledExtensionResourceRoots,
|
|
561
817
|
ExtensionsDomainModule
|
|
562
818
|
};
|
|
563
|
-
//# sourceMappingURL=chunk-
|
|
819
|
+
//# sourceMappingURL=chunk-5QKCQQ3E.js.map
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
inspectEvidence
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TEO2TLVN.js";
|
|
5
5
|
import {
|
|
6
6
|
TASK_MEMORY_CONTENT_MAX_CHARS,
|
|
7
7
|
TASK_MEMORY_DEFAULT_KNOWLEDGE_CAP,
|
|
8
|
-
TASK_MEMORY_DEFAULT_PROCEDURAL_CAP
|
|
9
|
-
|
|
8
|
+
TASK_MEMORY_DEFAULT_PROCEDURAL_CAP,
|
|
9
|
+
TASK_MEMORY_TELEMETRY_FILE,
|
|
10
|
+
parseTaskMemoryTelemetryRecord
|
|
11
|
+
} from "./chunk-O6I4CIEU.js";
|
|
10
12
|
import {
|
|
11
13
|
createRedactionTally,
|
|
12
14
|
redactSecretsText
|
|
@@ -16,7 +18,10 @@ import {
|
|
|
16
18
|
} from "./chunk-ECH6PKUQ.js";
|
|
17
19
|
import {
|
|
18
20
|
ceilChars
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-AEYBF3TB.js";
|
|
22
|
+
import {
|
|
23
|
+
clioStateDir
|
|
24
|
+
} from "./chunk-BNAZZHFG.js";
|
|
20
25
|
import {
|
|
21
26
|
safeResourceWrite
|
|
22
27
|
} from "./chunk-WEPFGWHJ.js";
|
|
@@ -1116,6 +1121,30 @@ function compareStrings3(a, b) {
|
|
|
1116
1121
|
return a.localeCompare(b);
|
|
1117
1122
|
}
|
|
1118
1123
|
|
|
1124
|
+
// src/domains/memory/task-bank-promotion.ts
|
|
1125
|
+
init_esm_shims();
|
|
1126
|
+
async function proposeInjectedTaskMemory(dataDir, input) {
|
|
1127
|
+
const result = { records: [], errors: [] };
|
|
1128
|
+
const sessionId = input.sessionId;
|
|
1129
|
+
const repository = canonicalMemoryRepositoryIdentity(input.cwd);
|
|
1130
|
+
if (sessionId === null || sessionId.length === 0 || repository === null) return result;
|
|
1131
|
+
for (const entry of input.entries) {
|
|
1132
|
+
if (entry.kind === "status") continue;
|
|
1133
|
+
try {
|
|
1134
|
+
const proposal = await proposeMemoryPromotion(
|
|
1135
|
+
dataDir,
|
|
1136
|
+
{ kind: "task-bank-entry", sessionId, evidenceRefs: [`session:${sessionId}`], entry },
|
|
1137
|
+
{ scope: "repo", repository },
|
|
1138
|
+
input.now ?? /* @__PURE__ */ new Date()
|
|
1139
|
+
);
|
|
1140
|
+
result.records.push(proposal.record);
|
|
1141
|
+
} catch (error) {
|
|
1142
|
+
result.errors.push(`${entry.id}: ${error instanceof Error ? error.message : String(error)}`);
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
return result;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1119
1148
|
// src/domains/memory/task-memory-handoff.ts
|
|
1120
1149
|
init_esm_shims();
|
|
1121
1150
|
import { existsSync, readdirSync, readFileSync as readFileSync2, statSync } from "node:fs";
|
|
@@ -1367,6 +1396,80 @@ function compareStrings4(left, right) {
|
|
|
1367
1396
|
return left < right ? -1 : left > right ? 1 : 0;
|
|
1368
1397
|
}
|
|
1369
1398
|
|
|
1399
|
+
// src/domains/memory/task-memory-spend.ts
|
|
1400
|
+
init_esm_shims();
|
|
1401
|
+
import { readFileSync as readFileSync3, statSync as statSync2 } from "node:fs";
|
|
1402
|
+
import { join as join3 } from "node:path";
|
|
1403
|
+
function taskMemoryStepsPath(stateDir = clioStateDir()) {
|
|
1404
|
+
return join3(stateDir, "memory", TASK_MEMORY_TELEMETRY_FILE);
|
|
1405
|
+
}
|
|
1406
|
+
function emptyTaskMemorySpendSummary() {
|
|
1407
|
+
return {
|
|
1408
|
+
llmSteps: 0,
|
|
1409
|
+
injections: 0,
|
|
1410
|
+
hitRate: 0,
|
|
1411
|
+
inputTokens: 0,
|
|
1412
|
+
outputTokens: 0,
|
|
1413
|
+
totalTokens: 0,
|
|
1414
|
+
modelMs: 0,
|
|
1415
|
+
slowestStepMs: 0,
|
|
1416
|
+
timeouts: 0,
|
|
1417
|
+
endpointBusySkips: 0,
|
|
1418
|
+
firstAt: null,
|
|
1419
|
+
lastAt: null
|
|
1420
|
+
};
|
|
1421
|
+
}
|
|
1422
|
+
function foldTaskMemorySpend(lines) {
|
|
1423
|
+
const summary = emptyTaskMemorySpendSummary();
|
|
1424
|
+
for (const line of lines) {
|
|
1425
|
+
if (line.trim().length === 0) continue;
|
|
1426
|
+
let parsed;
|
|
1427
|
+
try {
|
|
1428
|
+
parsed = JSON.parse(line);
|
|
1429
|
+
} catch {
|
|
1430
|
+
continue;
|
|
1431
|
+
}
|
|
1432
|
+
const record = parseTaskMemoryTelemetryRecord(parsed);
|
|
1433
|
+
if (record === null) continue;
|
|
1434
|
+
if (summary.firstAt === null || record.at < summary.firstAt) summary.firstAt = record.at;
|
|
1435
|
+
if (summary.lastAt === null || record.at > summary.lastAt) summary.lastAt = record.at;
|
|
1436
|
+
if (record.reason === "endpoint_busy") summary.endpointBusySkips += 1;
|
|
1437
|
+
if (record.tier !== "llm") continue;
|
|
1438
|
+
summary.llmSteps += 1;
|
|
1439
|
+
if (record.decision === "injected") summary.injections += 1;
|
|
1440
|
+
if (record.decision === "timeout") summary.timeouts += 1;
|
|
1441
|
+
summary.inputTokens += record.tokenCost.input;
|
|
1442
|
+
summary.outputTokens += record.tokenCost.output;
|
|
1443
|
+
summary.totalTokens += record.tokenCost.total;
|
|
1444
|
+
summary.modelMs += record.latencyMs;
|
|
1445
|
+
summary.slowestStepMs = Math.max(summary.slowestStepMs, record.latencyMs);
|
|
1446
|
+
}
|
|
1447
|
+
summary.hitRate = summary.llmSteps === 0 ? 0 : summary.injections / summary.llmSteps;
|
|
1448
|
+
return summary;
|
|
1449
|
+
}
|
|
1450
|
+
var spendCache = /* @__PURE__ */ new Map();
|
|
1451
|
+
function readTaskMemorySpendSummary(stateDir = clioStateDir()) {
|
|
1452
|
+
const path = taskMemoryStepsPath(stateDir);
|
|
1453
|
+
try {
|
|
1454
|
+
const info = statSync2(path);
|
|
1455
|
+
const cached = spendCache.get(path);
|
|
1456
|
+
if (cached !== void 0 && cached.mtimeMs === info.mtimeMs && cached.size === info.size) return cached.summary;
|
|
1457
|
+
const summary = foldTaskMemorySpend(readFileSync3(path, "utf8").split("\n"));
|
|
1458
|
+
spendCache.set(path, { mtimeMs: info.mtimeMs, size: info.size, summary });
|
|
1459
|
+
return summary;
|
|
1460
|
+
} catch {
|
|
1461
|
+
return emptyTaskMemorySpendSummary();
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
function formatTaskMemorySpend(summary) {
|
|
1465
|
+
if (summary.llmSteps === 0) return "";
|
|
1466
|
+
const tokens = summary.totalTokens >= 1e3 ? `${(summary.totalTokens / 1e3).toFixed(1)}k tok` : `${summary.totalTokens} tok`;
|
|
1467
|
+
const seconds = summary.modelMs / 1e3;
|
|
1468
|
+
const time = seconds >= 60 ? `${(seconds / 60).toFixed(1)}m` : `${seconds.toFixed(1)}s`;
|
|
1469
|
+
const rate = `${Math.round(summary.hitRate * 100)}%`;
|
|
1470
|
+
return `spend ${summary.llmSteps} steps \xB7 ${tokens} \xB7 ${time} \xB7 hit ${summary.injections}/${summary.llmSteps} (${rate})`;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1370
1473
|
// src/domains/memory/task-memory-status.ts
|
|
1371
1474
|
init_esm_shims();
|
|
1372
1475
|
function describeTaskMemoryActivity(event) {
|
|
@@ -1441,13 +1544,16 @@ export {
|
|
|
1441
1544
|
proposeMemoryPromotion,
|
|
1442
1545
|
buildMemoryPromptSection,
|
|
1443
1546
|
proposeMemoryFromEvidence,
|
|
1547
|
+
proposeInjectedTaskMemory,
|
|
1444
1548
|
renderTaskMemoryHandoffSource,
|
|
1445
1549
|
parseTaskMemoryHandoffSnapshot,
|
|
1446
1550
|
taskMemoryHandoffSeedOffer,
|
|
1447
1551
|
seedTaskMemoryFromNewestHandoff,
|
|
1552
|
+
readTaskMemorySpendSummary,
|
|
1553
|
+
formatTaskMemorySpend,
|
|
1448
1554
|
describeTaskMemoryActivity,
|
|
1449
1555
|
taskMemoryBankSize,
|
|
1450
1556
|
taskMemoryTracePath,
|
|
1451
1557
|
createTaskMemoryTrace
|
|
1452
1558
|
};
|
|
1453
|
-
//# sourceMappingURL=chunk-
|
|
1559
|
+
//# sourceMappingURL=chunk-5T7RBWN2.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
catalogProviderForRuntime,
|
|
11
11
|
listCatalogModelsForRuntime
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VO2LKSTM.js";
|
|
13
13
|
import {
|
|
14
14
|
init_esm_shims
|
|
15
15
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -169,4 +169,4 @@ export {
|
|
|
169
169
|
configuredTargetsForRuntime,
|
|
170
170
|
resolveProviderReference
|
|
171
171
|
};
|
|
172
|
-
//# sourceMappingURL=chunk-
|
|
172
|
+
//# sourceMappingURL=chunk-774ILSRL.js.map
|