@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
|
@@ -21,30 +21,29 @@ import {
|
|
|
21
21
|
import "./chunk-5TSRNF4G.js";
|
|
22
22
|
import {
|
|
23
23
|
EMPTY_CAPABILITIES
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-MIX5N5AC.js";
|
|
25
25
|
import "./chunk-CFGTUFWB.js";
|
|
26
26
|
import "./chunk-LU7P4LHA.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-AEYBF3TB.js";
|
|
28
28
|
import {
|
|
29
29
|
readSettings
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-PNY46YEY.js";
|
|
31
31
|
import "./chunk-FQ4SKYE4.js";
|
|
32
32
|
import "./chunk-ZGVHUX3M.js";
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-R346GLFC.js";
|
|
33
|
+
import "./chunk-RKRLDWD3.js";
|
|
34
|
+
import "./chunk-KV2AOLDF.js";
|
|
36
35
|
import "./chunk-IWHMRKLL.js";
|
|
37
36
|
import {
|
|
38
37
|
registerBuiltinRuntimes
|
|
39
|
-
} from "./chunk-
|
|
40
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-JEQQR47K.js";
|
|
39
|
+
import "./chunk-XDOQXGFO.js";
|
|
41
40
|
import "./chunk-LL4KHSZI.js";
|
|
42
41
|
import "./chunk-4ZG3XFUR.js";
|
|
43
42
|
import {
|
|
44
43
|
listProviderSupportEntries,
|
|
45
44
|
resolveProviderReference,
|
|
46
45
|
supportGroupLabel
|
|
47
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-774ILSRL.js";
|
|
48
47
|
import {
|
|
49
48
|
authNotRequiredStatus,
|
|
50
49
|
openAuthStorage,
|
|
@@ -61,8 +60,8 @@ import "./chunk-WEPFGWHJ.js";
|
|
|
61
60
|
import {
|
|
62
61
|
getRuntimeRegistry
|
|
63
62
|
} from "./chunk-NUGM5KR6.js";
|
|
64
|
-
import "./chunk-
|
|
65
|
-
import "./chunk-
|
|
63
|
+
import "./chunk-VO2LKSTM.js";
|
|
64
|
+
import "./chunk-UOSL25KY.js";
|
|
66
65
|
import "./chunk-YXLYO42X.js";
|
|
67
66
|
import {
|
|
68
67
|
init_esm_shims
|
|
@@ -545,4 +544,4 @@ async function runAuthCommand(args) {
|
|
|
545
544
|
export {
|
|
546
545
|
runAuthCommand
|
|
547
546
|
};
|
|
548
|
-
//# sourceMappingURL=auth-
|
|
547
|
+
//# sourceMappingURL=auth-OI4LIH2I.js.map
|
|
@@ -2,16 +2,16 @@ import { createRequire as __clioCreateRequire } from "node:module"; const requir
|
|
|
2
2
|
import {
|
|
3
3
|
BUILTIN_RUNTIMES,
|
|
4
4
|
registerBuiltinRuntimes
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-JEQQR47K.js";
|
|
6
|
+
import "./chunk-XDOQXGFO.js";
|
|
7
7
|
import "./chunk-LL4KHSZI.js";
|
|
8
8
|
import "./chunk-4ZG3XFUR.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-VO2LKSTM.js";
|
|
10
|
+
import "./chunk-UOSL25KY.js";
|
|
11
11
|
import "./chunk-YXLYO42X.js";
|
|
12
12
|
import "./chunk-3R73A4XB.js";
|
|
13
13
|
export {
|
|
14
14
|
BUILTIN_RUNTIMES,
|
|
15
15
|
registerBuiltinRuntimes
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=builtins-
|
|
17
|
+
//# sourceMappingURL=builtins-AD25UL3C.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
isSessionEntry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RAPCMZL4.js";
|
|
5
5
|
import {
|
|
6
6
|
init_esm_shims
|
|
7
7
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -373,4 +373,4 @@ export {
|
|
|
373
373
|
foldSessionTaskHistory,
|
|
374
374
|
createTaskBoardStore
|
|
375
375
|
};
|
|
376
|
-
//# sourceMappingURL=chunk-
|
|
376
|
+
//# sourceMappingURL=chunk-2JDWVJND.js.map
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
init_esm_shims
|
|
4
|
+
} from "./chunk-3R73A4XB.js";
|
|
5
|
+
|
|
6
|
+
// src/domains/session/prompt-cache.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
|
|
9
|
+
// src/core/cache-telemetry.ts
|
|
10
|
+
init_esm_shims();
|
|
11
|
+
function emptyCacheVerdictCounts() {
|
|
12
|
+
return { hot: 0, partial: 0, cold: 0, small: 0 };
|
|
13
|
+
}
|
|
14
|
+
function uncachedPrefillTokens(backend) {
|
|
15
|
+
if (backend === null || backend === void 0 || backend.cachedTokens === null) return null;
|
|
16
|
+
if (!Number.isFinite(backend.promptTokens) || backend.promptTokens < 0 || !Number.isFinite(backend.cachedTokens) || backend.cachedTokens < 0 || backend.cachedTokens > backend.promptTokens) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return backend.promptTokens - backend.cachedTokens;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// src/domains/session/prompt-cache.ts
|
|
23
|
+
function isRecord(value) {
|
|
24
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
25
|
+
}
|
|
26
|
+
function finiteNonNegative(value) {
|
|
27
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
28
|
+
}
|
|
29
|
+
function backendTimings(value) {
|
|
30
|
+
if (!isRecord(value)) return null;
|
|
31
|
+
if (!finiteNonNegative(value.promptTokens) || !finiteNonNegative(value.predictedTokens) || !finiteNonNegative(value.promptMs) || !finiteNonNegative(value.predictedMs) || value.source !== "llamacpp-timings" && value.source !== "lmstudio-timings") {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const cachedTokens = value.cachedTokens;
|
|
35
|
+
if (cachedTokens !== null && !finiteNonNegative(cachedTokens)) return null;
|
|
36
|
+
if (typeof cachedTokens === "number" && cachedTokens > value.promptTokens) return null;
|
|
37
|
+
return {
|
|
38
|
+
promptTokens: value.promptTokens,
|
|
39
|
+
cachedTokens,
|
|
40
|
+
predictedTokens: value.predictedTokens,
|
|
41
|
+
promptMs: value.promptMs,
|
|
42
|
+
predictedMs: value.predictedMs,
|
|
43
|
+
source: value.source
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function cacheVerdict(value) {
|
|
47
|
+
switch (value) {
|
|
48
|
+
case "hot":
|
|
49
|
+
case "partial":
|
|
50
|
+
case "cold":
|
|
51
|
+
case "small":
|
|
52
|
+
return value;
|
|
53
|
+
default:
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function hasPromptCacheTelemetry(telemetry) {
|
|
58
|
+
return telemetry.verdictCalls > 0 || telemetry.uncachedPrefillCalls > 0 || Object.keys(telemetry.expectedColdReasonCounts).length > 0;
|
|
59
|
+
}
|
|
60
|
+
function topExpectedColdReason(telemetry) {
|
|
61
|
+
const ranked = Object.entries(telemetry.expectedColdReasonCounts).sort(
|
|
62
|
+
([leftReason, leftCount], [rightReason, rightCount]) => rightCount - leftCount || leftReason.localeCompare(rightReason)
|
|
63
|
+
);
|
|
64
|
+
const first = ranked[0];
|
|
65
|
+
return first === void 0 ? null : { reason: first[0], count: first[1] };
|
|
66
|
+
}
|
|
67
|
+
function foldPromptCacheTelemetry(entries) {
|
|
68
|
+
const verdictCounts = emptyCacheVerdictCounts();
|
|
69
|
+
const expectedColdReasonCounts = {};
|
|
70
|
+
let verdictCalls = 0;
|
|
71
|
+
let uncachedTotal = 0;
|
|
72
|
+
let uncachedPrefillCalls = 0;
|
|
73
|
+
for (const entry of entries) {
|
|
74
|
+
if (entry.kind !== "message" || entry.role !== "assistant" || !isRecord(entry.payload)) continue;
|
|
75
|
+
const promptCache = entry.payload.promptCache;
|
|
76
|
+
if (!isRecord(promptCache)) continue;
|
|
77
|
+
const verdict = cacheVerdict(promptCache.backendVerdict);
|
|
78
|
+
if (verdict !== null) {
|
|
79
|
+
verdictCounts[verdict] += 1;
|
|
80
|
+
verdictCalls += 1;
|
|
81
|
+
}
|
|
82
|
+
const backend = backendTimings(promptCache.backend);
|
|
83
|
+
const uncached = uncachedPrefillTokens(backend);
|
|
84
|
+
if (uncached !== null) {
|
|
85
|
+
uncachedTotal += uncached;
|
|
86
|
+
uncachedPrefillCalls += 1;
|
|
87
|
+
}
|
|
88
|
+
if (!Array.isArray(promptCache.expectedColdReasons)) continue;
|
|
89
|
+
const reasons = new Set(
|
|
90
|
+
promptCache.expectedColdReasons.filter(
|
|
91
|
+
(reason) => typeof reason === "string" && reason.trim().length > 0
|
|
92
|
+
)
|
|
93
|
+
);
|
|
94
|
+
for (const reason of reasons) {
|
|
95
|
+
expectedColdReasonCounts[reason] = (expectedColdReasonCounts[reason] ?? 0) + 1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
uncachedPrefillTokens: uncachedPrefillCalls > 0 ? uncachedTotal : null,
|
|
100
|
+
uncachedPrefillCalls,
|
|
101
|
+
verdictCounts,
|
|
102
|
+
verdictCalls,
|
|
103
|
+
expectedColdReasonCounts
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export {
|
|
108
|
+
uncachedPrefillTokens,
|
|
109
|
+
hasPromptCacheTelemetry,
|
|
110
|
+
topExpectedColdReason,
|
|
111
|
+
foldPromptCacheTelemetry
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=chunk-3DPEIQKN.js.map
|
|
@@ -5,48 +5,48 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
SchedulingDomainModule,
|
|
7
7
|
createPromptsDomainModule
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3UUY7R3Z.js";
|
|
9
9
|
import {
|
|
10
10
|
SafetyDomainModule
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WXCJ7VME.js";
|
|
12
12
|
import {
|
|
13
13
|
ConfigDomainModule,
|
|
14
14
|
loadDomains
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-465CC7FK.js";
|
|
16
16
|
import {
|
|
17
17
|
ResourcesDomainModule
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-PZ4I4JE2.js";
|
|
19
19
|
import {
|
|
20
20
|
AgentsDomainModule
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-YSEHGPCT.js";
|
|
22
22
|
import {
|
|
23
23
|
createObservabilityDomainModule
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-5PVQ4SRS.js";
|
|
25
25
|
import {
|
|
26
26
|
fallbackBootstrapOutput
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-HJB5IUKP.js";
|
|
28
28
|
import {
|
|
29
29
|
renderCodewikiDigest
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-47CMYGET.js";
|
|
31
31
|
import {
|
|
32
32
|
DispatchDomainModule
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-TEO2TLVN.js";
|
|
34
34
|
import {
|
|
35
35
|
SessionDomainModule
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-LXPJXFM5.js";
|
|
37
37
|
import {
|
|
38
38
|
MiddlewareDomainModule
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-GAYUJ7LE.js";
|
|
40
40
|
import {
|
|
41
41
|
UnsupportedResponseSchemaError,
|
|
42
42
|
isResponseSchemaRejection
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-4H6ULJ3H.js";
|
|
44
44
|
import {
|
|
45
45
|
parseJsonObjectPayload
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-S4COXYBG.js";
|
|
47
47
|
import {
|
|
48
48
|
ProvidersDomainModule
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-MIX5N5AC.js";
|
|
50
50
|
import {
|
|
51
51
|
init_esm_shims
|
|
52
52
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -675,4 +675,4 @@ export {
|
|
|
675
675
|
validateInitOptions,
|
|
676
676
|
bootstrapInputFromInitOptions
|
|
677
677
|
};
|
|
678
|
-
//# sourceMappingURL=chunk-
|
|
678
|
+
//# sourceMappingURL=chunk-3DUR4WUA.js.map
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
ceilChars,
|
|
26
26
|
contentChars,
|
|
27
27
|
estimateAgentMessageTokens
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-AEYBF3TB.js";
|
|
29
29
|
import {
|
|
30
30
|
init_esm_shims
|
|
31
31
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -674,4 +674,4 @@ export {
|
|
|
674
674
|
compactionCut,
|
|
675
675
|
selectVisibleEntries
|
|
676
676
|
};
|
|
677
|
-
//# sourceMappingURL=chunk-
|
|
677
|
+
//# sourceMappingURL=chunk-3MRC2YSQ.js.map
|
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
loadFragments,
|
|
4
3
|
loadOperatorProfile,
|
|
5
4
|
loadProjectRules,
|
|
6
5
|
renderOperatorProfile,
|
|
7
6
|
selectActiveRules
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HJB5IUKP.js";
|
|
8
|
+
import {
|
|
9
|
+
loadFragments
|
|
10
|
+
} from "./chunk-47CMYGET.js";
|
|
9
11
|
import {
|
|
10
12
|
compile,
|
|
11
|
-
compileWorker
|
|
13
|
+
compileWorker
|
|
14
|
+
} from "./chunk-TEO2TLVN.js";
|
|
15
|
+
import {
|
|
12
16
|
sha256
|
|
13
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-MLOK6ZOS.js";
|
|
14
18
|
import {
|
|
15
19
|
classifyProjectPreload
|
|
16
20
|
} from "./chunk-JVCV3ICN.js";
|
|
17
21
|
import {
|
|
18
22
|
isUserVisibleAgent
|
|
19
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-S4COXYBG.js";
|
|
20
24
|
import {
|
|
21
25
|
BusChannels
|
|
22
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RKRLDWD3.js";
|
|
23
27
|
import {
|
|
24
28
|
init_esm_shims
|
|
25
29
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -655,4 +659,4 @@ export {
|
|
|
655
659
|
createPromptsDomainModule,
|
|
656
660
|
SchedulingDomainModule
|
|
657
661
|
};
|
|
658
|
-
//# sourceMappingURL=chunk-
|
|
662
|
+
//# sourceMappingURL=chunk-3UUY7R3Z.js.map
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
fingerprintNativeRuntime,
|
|
23
23
|
interopProposals,
|
|
24
24
|
renderProposalEntry
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-QQ7EKM72.js";
|
|
26
26
|
import {
|
|
27
27
|
initializeClioHome
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-56KB5IJP.js";
|
|
29
29
|
import {
|
|
30
30
|
printError,
|
|
31
31
|
printOk
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
import {
|
|
34
34
|
isOrchestratorEligibleRuntime,
|
|
35
35
|
probeCapabilitiesForModel
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-MIX5N5AC.js";
|
|
37
37
|
import {
|
|
38
38
|
credentialsPresent
|
|
39
39
|
} from "./chunk-LU7P4LHA.js";
|
|
@@ -42,11 +42,11 @@ import {
|
|
|
42
42
|
removeTargetFromSettings,
|
|
43
43
|
settingsPath,
|
|
44
44
|
updateSettings
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-PNY46YEY.js";
|
|
46
46
|
import {
|
|
47
47
|
greetLmStudio,
|
|
48
48
|
registerBuiltinRuntimes
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-JEQQR47K.js";
|
|
50
50
|
import {
|
|
51
51
|
buildProviderSupportEntry,
|
|
52
52
|
configuredTargetsForRuntime,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
listKnownModelsForRuntime,
|
|
55
55
|
listProviderSupportEntries,
|
|
56
56
|
supportGroupLabel
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-774ILSRL.js";
|
|
58
58
|
import {
|
|
59
59
|
openAuthStorage,
|
|
60
60
|
registerClioOAuthProviders,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
} from "./chunk-NUGM5KR6.js";
|
|
68
68
|
import {
|
|
69
69
|
getCatalogModelForRuntime
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-VO2LKSTM.js";
|
|
71
71
|
import {
|
|
72
72
|
init_esm_shims
|
|
73
73
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -1548,4 +1548,4 @@ export {
|
|
|
1548
1548
|
runTargetRename,
|
|
1549
1549
|
runConfigureCommand
|
|
1550
1550
|
};
|
|
1551
|
-
//# sourceMappingURL=chunk-
|
|
1551
|
+
//# sourceMappingURL=chunk-3V5AYSEQ.js.map
|
|
@@ -5,25 +5,25 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
readStrictLayeredSettings,
|
|
7
7
|
updateLayeredSettings
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FALJGAWU.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveShutdownHookBudgetMs,
|
|
11
11
|
runWithBudget,
|
|
12
12
|
writeShutdownNotice
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BVDVID7E.js";
|
|
14
14
|
import {
|
|
15
15
|
setGitCommitAttributionEnabled
|
|
16
16
|
} from "./chunk-B5CSFE7B.js";
|
|
17
17
|
import {
|
|
18
18
|
formatSettingsFailure,
|
|
19
19
|
settingsPath
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-PNY46YEY.js";
|
|
21
21
|
import {
|
|
22
22
|
getSharedBus
|
|
23
23
|
} from "./chunk-ZGVHUX3M.js";
|
|
24
24
|
import {
|
|
25
25
|
BusChannels
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RKRLDWD3.js";
|
|
27
27
|
import {
|
|
28
28
|
init_esm_shims
|
|
29
29
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -182,6 +182,9 @@ var NEXT_TURN_FIELDS = /* @__PURE__ */ new Set([
|
|
|
182
182
|
"delegation",
|
|
183
183
|
"compaction",
|
|
184
184
|
"context",
|
|
185
|
+
// The pre-warm reads its setting when a trigger fires, and every trigger sits
|
|
186
|
+
// on a turn boundary, so a change takes effect before the next turn runs.
|
|
187
|
+
"prewarm",
|
|
185
188
|
"retry"
|
|
186
189
|
]);
|
|
187
190
|
var RESTART_REQUIRED_FIELDS = /* @__PURE__ */ new Set([
|
|
@@ -378,4 +381,4 @@ export {
|
|
|
378
381
|
ConfigDomainModule,
|
|
379
382
|
createConfigDomainModule
|
|
380
383
|
};
|
|
381
|
-
//# sourceMappingURL=chunk-
|
|
384
|
+
//# sourceMappingURL=chunk-465CC7FK.js.map
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
+
sha256
|
|
4
|
+
} from "./chunk-MLOK6ZOS.js";
|
|
5
|
+
import {
|
|
6
|
+
resolvePackageRoot
|
|
7
|
+
} from "./chunk-IWHMRKLL.js";
|
|
8
|
+
import {
|
|
9
|
+
require_dist
|
|
10
|
+
} from "./chunk-APJ265NV.js";
|
|
11
|
+
import {
|
|
12
|
+
__toESM,
|
|
3
13
|
init_esm_shims
|
|
4
14
|
} from "./chunk-3R73A4XB.js";
|
|
5
15
|
|
|
@@ -8,8 +18,8 @@ init_esm_shims();
|
|
|
8
18
|
function compareStrings(a, b) {
|
|
9
19
|
return a.localeCompare(b);
|
|
10
20
|
}
|
|
11
|
-
function topTwoSegments(
|
|
12
|
-
const parts =
|
|
21
|
+
function topTwoSegments(path2) {
|
|
22
|
+
const parts = path2.split("/").slice(0, -1);
|
|
13
23
|
if (parts.length === 0) return ".";
|
|
14
24
|
return parts.slice(0, 2).join("/");
|
|
15
25
|
}
|
|
@@ -115,7 +125,104 @@ function renderCodewikiDigest(codewiki, tokenBudget = 1200) {
|
|
|
115
125
|
return fitLines(lines, tokenBudget);
|
|
116
126
|
}
|
|
117
127
|
|
|
128
|
+
// src/domains/prompts/fragment-loader.ts
|
|
129
|
+
init_esm_shims();
|
|
130
|
+
var import_yaml = __toESM(require_dist(), 1);
|
|
131
|
+
import { readdirSync, readFileSync } from "node:fs";
|
|
132
|
+
import path from "node:path";
|
|
133
|
+
var frontmatterRegex = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;
|
|
134
|
+
var fragmentIdRegex = /^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/;
|
|
135
|
+
function defaultRootDir() {
|
|
136
|
+
return path.join(resolvePackageRoot(), "src", "domains", "prompts", "fragments");
|
|
137
|
+
}
|
|
138
|
+
function walk(root) {
|
|
139
|
+
const out = [];
|
|
140
|
+
let entries;
|
|
141
|
+
try {
|
|
142
|
+
entries = readdirSync(root, { withFileTypes: true });
|
|
143
|
+
} catch {
|
|
144
|
+
return out;
|
|
145
|
+
}
|
|
146
|
+
for (const entry of entries) {
|
|
147
|
+
const full = path.join(root, entry.name);
|
|
148
|
+
if (entry.isDirectory()) {
|
|
149
|
+
out.push(...walk(full));
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
153
|
+
out.push(full);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return out.sort((left, right) => left.localeCompare(right));
|
|
157
|
+
}
|
|
158
|
+
function parseFragment(filePath, rootDir) {
|
|
159
|
+
const raw = readFileSync(filePath, "utf8");
|
|
160
|
+
const rawRel = path.relative(rootDir, filePath);
|
|
161
|
+
const relPath = rawRel.split(path.sep).join("/");
|
|
162
|
+
const match = raw.match(frontmatterRegex);
|
|
163
|
+
if (!match) {
|
|
164
|
+
throw new Error(`fragment-loader: ${relPath}: missing or malformed YAML frontmatter`);
|
|
165
|
+
}
|
|
166
|
+
const frontmatterText = match[1] ?? "";
|
|
167
|
+
const body = match[2] ?? "";
|
|
168
|
+
let parsed;
|
|
169
|
+
try {
|
|
170
|
+
parsed = import_yaml.default.parse(frontmatterText);
|
|
171
|
+
} catch (err) {
|
|
172
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
173
|
+
throw new Error(`fragment-loader: ${relPath}: invalid YAML frontmatter (${reason})`);
|
|
174
|
+
}
|
|
175
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
176
|
+
throw new Error(`fragment-loader: ${relPath}: frontmatter must be a YAML object`);
|
|
177
|
+
}
|
|
178
|
+
const fm = parsed;
|
|
179
|
+
const id = fm.id;
|
|
180
|
+
if (typeof id !== "string" || !fragmentIdRegex.test(id)) {
|
|
181
|
+
throw new Error(`fragment-loader: ${relPath}: frontmatter.id must be a dot-separated namespace`);
|
|
182
|
+
}
|
|
183
|
+
const version = fm.version;
|
|
184
|
+
if (version !== 1) {
|
|
185
|
+
throw new Error(`fragment-loader: ${relPath}: frontmatter.version must be 1`);
|
|
186
|
+
}
|
|
187
|
+
const description = fm.description;
|
|
188
|
+
if (typeof description !== "string" || description.trim() === "") {
|
|
189
|
+
throw new Error(`fragment-loader: ${relPath}: frontmatter.description must be a non-empty string`);
|
|
190
|
+
}
|
|
191
|
+
const dynamicRaw = fm.dynamic;
|
|
192
|
+
if (dynamicRaw !== void 0 && typeof dynamicRaw !== "boolean") {
|
|
193
|
+
throw new Error(`fragment-loader: ${relPath}: frontmatter.dynamic must be a boolean when present`);
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
path: filePath,
|
|
197
|
+
relPath,
|
|
198
|
+
id,
|
|
199
|
+
version,
|
|
200
|
+
description,
|
|
201
|
+
dynamic: dynamicRaw === true,
|
|
202
|
+
body,
|
|
203
|
+
contentHash: sha256(raw)
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
function loadFragments(options) {
|
|
207
|
+
const rootDir = typeof options === "string" ? options : options?.rootDir;
|
|
208
|
+
const resolvedRoot = rootDir ? path.resolve(rootDir) : defaultRootDir();
|
|
209
|
+
const files = walk(resolvedRoot);
|
|
210
|
+
const byId = /* @__PURE__ */ new Map();
|
|
211
|
+
for (const file of files) {
|
|
212
|
+
const fragment = parseFragment(file, resolvedRoot);
|
|
213
|
+
const existing = byId.get(fragment.id);
|
|
214
|
+
if (existing) {
|
|
215
|
+
throw new Error(
|
|
216
|
+
`fragment-loader: duplicate fragment id "${fragment.id}" in ${existing.relPath} and ${fragment.relPath}`
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
byId.set(fragment.id, fragment);
|
|
220
|
+
}
|
|
221
|
+
return { byId, rootDir: resolvedRoot };
|
|
222
|
+
}
|
|
223
|
+
|
|
118
224
|
export {
|
|
119
|
-
renderCodewikiDigest
|
|
225
|
+
renderCodewikiDigest,
|
|
226
|
+
loadFragments
|
|
120
227
|
};
|
|
121
|
-
//# sourceMappingURL=chunk-
|
|
228
|
+
//# sourceMappingURL=chunk-47CMYGET.js.map
|