@iowarp/clio-coder 0.3.3 → 0.3.6
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 +74 -0
- package/CONTRIBUTING.md +7 -7
- package/README.md +3 -3
- package/dist/{acp-P2AQILE2.js → acp-2BEHC4DL.js} +9 -8
- package/dist/{agents-72W3BI7I.js → agents-LNNFTM53.js} +29 -24
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-5TWEIYDN.js → auth-KXXFI2VS.js} +14 -10
- package/dist/{chunk-GGXXDWE4.js → chunk-22NAGB7X.js} +2 -2
- package/dist/{chunk-YCWGATWI.js → chunk-24I7BN55.js} +2 -2
- package/dist/{chunk-EKMEHE4H.js → chunk-33YXPOE3.js} +2 -3
- package/dist/chunk-3BPUFZDL.js +37 -0
- package/dist/chunk-43AOLP7E.js +375 -0
- package/dist/{chunk-ZDOOVTXZ.js → chunk-4OC57DA6.js} +27 -4
- package/dist/{chunk-6SGHMWE3.js → chunk-5JGRAMKL.js} +5 -5
- package/dist/{chunk-V6RTAOC2.js → chunk-6US73PDB.js} +572 -51
- package/dist/{chunk-5UFT4SUX.js → chunk-6XXKFVSN.js} +3 -3
- package/dist/{chunk-A3CYT5EX.js → chunk-AD2SYQYC.js} +55 -2
- package/dist/chunk-AOCYTWAV.js +449 -0
- package/dist/chunk-CFGTUFWB.js +67 -0
- package/dist/chunk-CJUB2JJ2.js +1478 -0
- package/dist/{chunk-FNTMWMX5.js → chunk-CKXWIANG.js} +14 -12
- package/dist/{chunk-PIWWS5BL.js → chunk-CYQKWTG3.js} +63 -78
- package/dist/{chunk-LZSJBIVT.js → chunk-DJVECN66.js} +271 -762
- package/dist/{chunk-CBCAPZAA.js → chunk-E25LMLRW.js} +2 -2
- package/dist/{chunk-ZWMF7253.js → chunk-E2ER4LJF.js} +304 -9
- package/dist/{chunk-STBPMHSX.js → chunk-EKY57CSP.js} +51 -84
- package/dist/{chunk-DUYJ5IO6.js → chunk-EYPA3EGJ.js} +12 -4
- package/dist/{chunk-M6SHUN7Q.js → chunk-FO5ZOVUY.js} +2 -2
- package/dist/chunk-FYYLNIL5.js +313 -0
- package/dist/{chunk-OQ33BKR3.js → chunk-G7MUEIGA.js} +3 -60
- package/dist/chunk-GEYXPTRF.js +613 -0
- package/dist/chunk-GOXNB3AO.js +261 -0
- package/dist/{chunk-G4BMMOKF.js → chunk-HVDIIIQW.js} +2 -2
- package/dist/chunk-HWUFFB6L.js +83 -0
- package/dist/{chunk-4XUGQOHA.js → chunk-K7T3E2SR.js} +15 -8
- package/dist/chunk-K7VKOLQQ.js +15 -0
- package/dist/{chunk-UFIIWP2H.js → chunk-KHSFENX2.js} +8 -8
- package/dist/{chunk-BMEMKKIT.js → chunk-KOHPCX4K.js} +2 -2
- package/dist/chunk-LCGCVYZ4.js +57 -0
- package/dist/chunk-LL4KHSZI.js +22 -0
- package/dist/{chunk-PAJK6MAQ.js → chunk-LYF7OHWH.js} +42 -15
- package/dist/{chunk-POHLU5DW.js → chunk-M6L6IDJG.js} +3 -3
- package/dist/{chunk-5UUP6MWO.js → chunk-MV3K5QF2.js} +5 -436
- package/dist/{chunk-X4RCMKVQ.js → chunk-NDINPTJ4.js} +2 -2
- package/dist/{chunk-TZK7PACC.js → chunk-NILBFAPG.js} +14 -8
- package/dist/chunk-ODFEOB4F.js +1082 -0
- package/dist/{chunk-AGYYIBLL.js → chunk-OH3TOQTB.js} +6 -2
- package/dist/chunk-OZNBF4L3.js +23 -0
- package/dist/{chunk-DSELYM6W.js → chunk-PBTHKCPN.js} +30 -10
- package/dist/{verify-375KUB3Y.js → chunk-PCZJO5TI.js} +127 -42
- package/dist/{chunk-ED4KHGC3.js → chunk-PPAMZ32Z.js} +9 -2
- package/dist/{chunk-SRDMMSEP.js → chunk-QM3F2GKX.js} +1063 -1645
- package/dist/{chunk-X6IAEBZR.js → chunk-QNQHSOLF.js} +7 -7
- package/dist/{chunk-OC7FIQPC.js → chunk-R46L2BIR.js} +10 -7
- package/dist/{chunk-2TLUCQVG.js → chunk-RD5U66HV.js} +3 -3
- package/dist/{chunk-6N5PTWMY.js → chunk-RY3LY4J5.js} +50 -13
- package/dist/{chunk-OKGUZO2U.js → chunk-SPULKLCF.js} +4 -3
- package/dist/{chunk-OOJYHWRB.js → chunk-TSHXZTOQ.js} +6 -5
- package/dist/chunk-TZSKNMZG.js +434 -0
- package/dist/{chunk-7MNJORFF.js → chunk-UL3WSD3F.js} +6 -1
- package/dist/{chunk-VJWL6YS5.js → chunk-UUVG37B4.js} +2 -2
- package/dist/{chunk-COU2UHX6.js → chunk-VEZEGCGW.js} +170 -2
- package/dist/chunk-W6GROXXM.js +69 -0
- package/dist/{chunk-OAO4GE4M.js → chunk-WHGPSPT5.js} +2 -2
- package/dist/chunk-WHJYKASB.js +677 -0
- package/dist/{chunk-ORBHGJC5.js → chunk-WR67VIZY.js} +3 -3
- package/dist/{chunk-YHZX5GEU.js → chunk-XAKHZX5N.js} +2 -2
- package/dist/{chunk-TZTZS7QK.js → chunk-XE2VEJHX.js} +5 -3
- package/dist/{chunk-LM5TQCJZ.js → chunk-XF5N4U5A.js} +8 -7
- package/dist/{chunk-LWLEKMDQ.js → chunk-XXQNGV4M.js} +1073 -552
- package/dist/{chunk-KZWTDYJF.js → chunk-XYDYPRZI.js} +7 -7
- package/dist/chunk-ZGVHUX3M.js +66 -0
- package/dist/{chunk-LW6DSM3M.js → chunk-ZRGEBJ4T.js} +1192 -1119
- package/dist/{chunk-2DJ2KNFG.js → chunk-ZXF4XRKW.js} +202 -40
- package/dist/chunk-ZZMN5OM4.js +122 -0
- package/dist/cli/index.js +34 -30
- package/dist/{clio-JOU4FXVA.js → clio-M2KGYUFZ.js} +7 -6
- package/dist/{code-nav-7AX6FYE6.js → code-nav-GQNL7XA6.js} +8 -6
- package/dist/codewiki/build-worker.js +4 -4
- package/dist/{components-KELWS457.js → components-5TTYYX6G.js} +3 -3
- package/dist/{config-XCDVKR23.js → config-XUUYQIWO.js} +47 -35
- package/dist/{configure-4GAP54ZW.js → configure-IHJ7YOMV.js} +18 -15
- package/dist/{context-77FM5DV5.js → context-74JLXAWD.js} +18 -10
- package/dist/{context-4UOGGLQ5.js → context-75MIWW3U.js} +41 -29
- package/dist/{context-5VKGUVJJ.js → context-ZQ7SIFJV.js} +85 -9
- package/dist/{context-clear-XXJRLCJJ.js → context-clear-GYKWNUML.js} +41 -29
- package/dist/{context-index-BZ4UYMTC.js → context-index-SSR5ECNE.js} +3 -3
- package/dist/context-working-set-UX5KEP4J.js +1553 -0
- package/dist/{dispatch-runner-QPRDDBDX.js → dispatch-runner-GIJBHNFL.js} +47 -32
- package/dist/{docs-2C2LTVT2.js → docs-6FZSCG5B.js} +3 -3
- package/dist/{doctor-HR46URBJ.js → doctor-SVJ5BZCW.js} +12 -12
- package/dist/{eval-XSSNATB4.js → eval-CG6LLBLD.js} +54 -238
- package/dist/{evidence-6HG2PY2B.js → evidence-ZYFIEN42.js} +57 -28
- package/dist/{evolve-K7YU3NCY.js → evolve-QGEXEMDW.js} +36 -25
- package/dist/{extensions-QVDOHDGJ.js → extensions-ADGNCJJD.js} +3 -3
- package/dist/{fleet-VY3HHKN6.js → fleet-S5R4ZOQY.js} +73 -44
- package/dist/{fleet-preflight-DDN536IT.js → fleet-preflight-BHSNPBMH.js} +3 -3
- package/dist/{init-JYGXI3FK.js → init-5DRU55YR.js} +49 -37
- package/dist/memory-7YKKR6UC.js +467 -0
- package/dist/{models-I5QWSEOM.js → models-ZPOLRU2C.js} +24 -21
- package/dist/{monitor-GE4ID3IA.js → monitor-US5F5YGZ.js} +73 -46
- package/dist/{orchestrator-EM5MC3HM.js → orchestrator-E2AL4T5N.js} +1624 -1007
- package/dist/{paths-UXLN5YYZ.js → paths-E7KYAQWE.js} +3 -3
- package/dist/{reset-L2FQEE3E.js → reset-KZ652EK6.js} +6 -5
- package/dist/{run-ZU3QMZPZ.js → run-SRNBKDWD.js} +76 -54
- package/dist/{share-S5BZQC5I.js → share-CGZE33UP.js} +7 -6
- package/dist/{skills-X5VXCRNQ.js → skills-S2X4DLY5.js} +4 -4
- package/dist/{skills-eval-WKIHWTHR.js → skills-eval-W2GGIC4R.js} +40 -29
- package/dist/{targets-SNCPI2NR.js → targets-54SWINWB.js} +28 -23
- package/dist/{terminal-lease-BNAHVHBS.js → terminal-lease-SAIF2OGY.js} +6 -4
- package/dist/{uninstall-FZCQCDKC.js → uninstall-BVLWXKBT.js} +3 -3
- package/dist/{upgrade-JQHHPQ4K.js → upgrade-JKAR27XC.js} +20 -19
- package/dist/{usage-OR4O5SMZ.js → usage-MSAWCLX4.js} +79 -36
- package/dist/verifiers-NCBTHHN2.js +1220 -0
- package/dist/verify-X5HDROLA.js +25 -0
- package/dist/{wiki-generate-UEXP2ARI.js → wiki-generate-GUSOQ6ZP.js} +50 -37
- package/dist/worker/entry.js +90 -70
- package/dist/{workspace-G4ZWUIPR.js → workspace-ZJ6BFM3Q.js} +4 -4
- package/docs/README.md +8 -7
- package/docs/acp.md +1 -1
- package/docs/alcf-provider.md +1 -1
- package/docs/architecture.md +2 -2
- package/docs/artifact-placement.md +1 -2
- package/docs/artifact-versions.md +1 -1
- package/docs/built-in-agents.md +1 -1
- package/docs/capacity-and-scheduling.md +1 -1
- package/docs/commands-and-modes.md +60 -26
- package/docs/config-knobs-audit.md +1 -2
- package/docs/configuration-and-targets.md +26 -1
- package/docs/context-engine.md +67 -13
- package/docs/context-working-set.md +194 -0
- package/docs/development-pipeline.md +1 -1
- package/docs/documentation-coverage.md +6 -6
- package/docs/documentation-guide.md +7 -6
- package/docs/environment-variables.md +2 -1
- package/docs/eval-runner.md +1 -1
- package/docs/evals-internal.md +4 -32
- package/docs/evidence-and-memory.md +139 -7
- package/docs/evolution.md +1 -1
- package/docs/exit-codes-and-output.md +1 -1
- package/docs/extensions-and-sharing.md +2 -2
- package/docs/fleet-dispatch.md +49 -8
- package/docs/glossary.md +21 -1
- package/docs/installation-and-lifecycle.md +2 -2
- package/docs/middleware-and-components.md +19 -2
- package/docs/model-catalog.md +7 -9
- package/docs/observability.md +4 -4
- package/docs/proactive-memory.md +26 -16
- package/docs/prompt-envelope-and-tools.md +7 -5
- package/docs/provider-adapter-cookbook.md +1 -1
- package/docs/release-cut-checklist.md +43 -40
- package/docs/safety-model.md +49 -8
- package/docs/scientific-validation.md +21 -3
- package/docs/session-lifecycle.md +3 -3
- package/docs/skills-marketplace.md +1 -1
- package/docs/tool-usage.md +79 -12
- package/docs/trace-store.md +1 -1
- package/docs/troubleshooting.md +1 -1
- package/docs/tui-design.md +38 -4
- package/docs/worker-dispatch-mechanics.md +11 -1
- package/package.json +13 -13
- package/skills/meta/clio-test/SKILL.md +20 -17
- package/skills/meta/clio-test/evals.md +3 -3
- package/skills/meta/clio-test/references/harness.md +35 -6
- package/skills/meta/clio-test/references/test-map.md +20 -10
- package/skills/registry.yaml +2 -2
- package/skills/skill-marketplace.json +1 -1
- package/src/cli/agents.ts +2 -3
- package/src/cli/argv.ts +14 -1
- package/src/cli/context-working-set.ts +513 -0
- package/src/cli/context.ts +8 -0
- package/src/cli/evidence.ts +20 -2
- package/src/cli/fleet.ts +15 -0
- package/src/cli/index.ts +5 -1
- package/src/cli/memory.ts +272 -10
- package/src/cli/modes/json-stream.ts +2 -2
- package/src/cli/modes/print.ts +12 -1
- package/src/cli/run.ts +22 -2
- package/src/cli/targets.ts +12 -3
- package/src/cli/usage.ts +55 -7
- package/src/cli/verifiers.ts +325 -0
- package/src/core/bash-exec.ts +39 -14
- package/src/core/bus-events.ts +22 -4
- package/src/core/config.ts +54 -0
- package/src/core/defaults.ts +50 -3
- package/src/core/response-model-id.ts +134 -0
- package/src/core/toml.ts +62 -0
- package/src/core/verification-scripts.ts +6 -0
- package/src/core/workspace-files.ts +0 -1
- package/src/domains/agents/builtins/architect.md +1 -1
- package/src/domains/agents/builtins/verifier.md +3 -0
- package/src/domains/agents/catalog.ts +5 -4
- package/src/domains/agents/recipe.ts +54 -14
- package/src/domains/agents/result-contract.ts +7 -4
- package/src/domains/config/classify.ts +1 -0
- package/src/domains/context/bootstrap.ts +36 -27
- package/src/domains/context/project-metadata.ts +19 -63
- package/src/domains/context/prompt-context.ts +8 -0
- package/src/domains/context/working-set/contract.ts +161 -0
- package/src/domains/context/working-set/defaults.ts +28 -0
- package/src/domains/context/working-set/engine.ts +203 -0
- package/src/domains/context/working-set/fold.ts +62 -0
- package/src/domains/context/working-set/horizon.ts +38 -0
- package/src/domains/context/working-set/marker.ts +103 -0
- package/src/domains/context/working-set/path-index.ts +436 -0
- package/src/domains/context/working-set/payload.ts +152 -0
- package/src/domains/context/working-set/policies/age-horizon.ts +55 -0
- package/src/domains/context/working-set/policies/index.ts +20 -0
- package/src/domains/context/working-set/policies/structural.ts +160 -0
- package/src/domains/context/working-set/project.ts +132 -0
- package/src/domains/context/working-set/protect.ts +109 -0
- package/src/domains/context/working-set/recall.ts +177 -0
- package/src/domains/context/working-set/replay/controls.ts +112 -0
- package/src/domains/context/working-set/replay/load-clio.ts +199 -0
- package/src/domains/context/working-set/replay/metrics.ts +185 -0
- package/src/domains/context/working-set/replay/reference-graph.ts +79 -0
- package/src/domains/context/working-set/replay/report.ts +139 -0
- package/src/domains/context/working-set/replay/runner.ts +325 -0
- package/src/domains/context/working-set/replay/synthetic.ts +422 -0
- package/src/domains/context/working-set/replay/trace.ts +21 -0
- package/src/domains/context/working-set/visible.ts +54 -0
- package/src/domains/dispatch/budget-envelope.ts +396 -0
- package/src/domains/dispatch/contract.ts +2 -0
- package/src/domains/dispatch/extension.ts +81 -27
- package/src/domains/dispatch/orphan-recovery.ts +1 -0
- package/src/domains/dispatch/receipt-integrity.ts +4 -0
- package/src/domains/dispatch/state.ts +1 -0
- package/src/domains/dispatch/types.ts +10 -3
- package/src/domains/dispatch/validation.ts +14 -0
- package/src/domains/dispatch/worker-spawn.ts +14 -3
- package/src/domains/eval/metrics/evidence.ts +0 -116
- package/src/domains/eval/metrics/invariants.ts +1 -1
- package/src/domains/eval/runners/clio-run.ts +1 -10
- package/src/domains/eval/runners/external-command.ts +2 -29
- package/src/domains/eval/schema/suite.ts +0 -7
- package/src/domains/eval/suites/run.ts +1 -7
- package/src/domains/evidence/build.ts +112 -45
- package/src/domains/evidence/eval.ts +24 -7
- package/src/domains/evidence/index.ts +53 -0
- package/src/domains/evidence/ordering.ts +12 -0
- package/src/domains/evidence/run-trust.ts +221 -0
- package/src/domains/evidence/store.ts +46 -6
- package/src/domains/evidence/trust-status.ts +854 -0
- package/src/domains/evidence/types.ts +26 -0
- package/src/domains/memory/index.ts +22 -0
- package/src/domains/memory/operations.ts +58 -1
- package/src/domains/memory/promotion.ts +281 -0
- package/src/domains/memory/prompt-section.ts +25 -5
- package/src/domains/memory/proposal.ts +51 -7
- package/src/domains/memory/task-bank.ts +3 -2
- package/src/domains/memory/task-memory-handoff.ts +181 -24
- package/src/domains/memory/task-memory-policy.ts +3 -1
- package/src/domains/memory/types.ts +37 -0
- package/src/domains/memory/validate.ts +178 -0
- package/src/domains/middleware/memory-intervention.ts +38 -25
- package/src/domains/middleware/runtime.ts +6 -0
- package/src/domains/middleware/skills-reminder.ts +19 -4
- package/src/domains/middleware/stalled-turn.ts +208 -5
- package/src/domains/middleware/types.ts +10 -0
- package/src/domains/observability/contract.ts +6 -1
- package/src/domains/observability/cost.ts +20 -4
- package/src/domains/observability/extension.ts +2 -2
- package/src/domains/providers/index.ts +3 -0
- package/src/domains/providers/model-discovery.ts +9 -0
- package/src/domains/providers/runtime-resolution.ts +38 -1
- package/src/domains/providers/runtimes/common/probe-helpers.ts +97 -16
- package/src/domains/providers/types/context-window-slots.ts +18 -0
- package/src/domains/providers/types/runtime-descriptor.ts +3 -1
- package/src/domains/safety/autonomy.ts +1 -1
- package/src/domains/safety/call-target.ts +211 -14
- package/src/domains/safety/decision-presentation.ts +268 -0
- package/src/domains/safety/default-path-policy.ts +8 -0
- package/src/domains/safety/finish-contract.ts +4 -3
- package/src/domains/safety/policy-engine.ts +48 -6
- package/src/domains/safety/redaction.ts +73 -0
- package/src/domains/session/compaction/compact.ts +23 -1
- package/src/domains/session/compaction/cut-point.ts +2 -0
- package/src/domains/session/compaction/tokens.ts +16 -1
- package/src/domains/session/context-ledger.ts +12 -1
- package/src/domains/session/decision-board.ts +4 -0
- package/src/domains/session/entries.ts +110 -1
- package/src/domains/session/history.ts +68 -19
- package/src/domains/session/manager.ts +9 -2
- package/src/domains/session/migrations/index.ts +22 -3
- package/src/domains/session/usage.ts +24 -7
- package/src/engine/acp/event-mapper.ts +7 -0
- package/src/engine/acp/server.ts +32 -2
- package/src/engine/agent.ts +18 -1
- package/src/engine/apis/lmstudio.ts +25 -4
- package/src/engine/apis/openai-completions.ts +147 -22
- package/src/engine/claude/sdk-runtime.ts +8 -2
- package/src/engine/claude/tool-safety.ts +13 -0
- package/src/engine/loop-guard.ts +27 -3
- package/src/engine/session.ts +9 -3
- package/src/engine/worker-events.ts +4 -3
- package/src/engine/worker-runtime.ts +59 -54
- package/src/entry/orchestrator.ts +34 -5
- package/src/interactive/chat-loop-messages.ts +40 -6
- package/src/interactive/chat-loop.ts +13 -0
- package/src/interactive/chat-panel.ts +17 -1
- package/src/interactive/chat-renderer.ts +49 -24
- package/src/interactive/clio-editor.ts +44 -7
- package/src/interactive/context-meter.ts +10 -0
- package/src/interactive/context-overlay.ts +120 -7
- package/src/interactive/context-recall-command.ts +110 -0
- package/src/interactive/cost-overlay.ts +39 -8
- package/src/interactive/dispatch-board.ts +212 -35
- package/src/interactive/footer/widgets.ts +13 -0
- package/src/interactive/interactive-application.ts +6 -1
- package/src/interactive/interactive-input-runtime.ts +11 -1
- package/src/interactive/interactive-presentation.ts +11 -1
- package/src/interactive/interactive-slash-runtime.ts +37 -1
- package/src/interactive/memory-overlay.ts +89 -4
- package/src/interactive/model-session-replay.ts +21 -0
- package/src/interactive/overlay-ask-user-lifecycle.ts +1 -1
- package/src/interactive/overlay-frame.ts +5 -2
- package/src/interactive/overlay-general-openers.ts +46 -1
- package/src/interactive/overlay-key-routing.ts +41 -1
- package/src/interactive/overlay-lifecycle.ts +11 -4
- package/src/interactive/overlay-permission-lifecycle.ts +23 -8
- package/src/interactive/overlay-session-lifecycle.ts +8 -4
- package/src/interactive/overlay-transitions.ts +11 -0
- package/src/interactive/overlays/ask-user.ts +74 -30
- package/src/interactive/overlays/decisions.ts +3 -1
- package/src/interactive/permission-hint.ts +35 -0
- package/src/interactive/permission-overlay.ts +95 -45
- package/src/interactive/renderers/tool-execution.ts +37 -51
- package/src/interactive/session-last-turn.ts +8 -1
- package/src/interactive/session-transcript.ts +2 -2
- package/src/interactive/session-usage-reseed.ts +36 -10
- package/src/interactive/slash-commands.ts +31 -4
- package/src/interactive/status/summary.ts +5 -0
- package/src/interactive/status/types.ts +5 -0
- package/src/interactive/terminal-lease.ts +1 -0
- package/src/interactive/turn-context.ts +333 -110
- package/src/interactive/turn-middleware.ts +7 -6
- package/src/interactive/turn-runtime.ts +37 -8
- package/src/interactive/turn-state.ts +3 -0
- package/src/interactive/worker-progress.ts +440 -0
- package/src/interactive/worker-stream.ts +51 -110
- package/src/tools/agent-tools.ts +39 -7
- package/src/tools/ask-user.ts +21 -1
- package/src/tools/bash.ts +144 -82
- package/src/tools/builtin-tool-catalog.ts +11 -5
- package/src/tools/context/index.ts +107 -5
- package/src/tools/context/surface.ts +3 -2
- package/src/tools/core-bootstrap.ts +21 -0
- package/src/tools/dispatch-arguments.ts +8 -0
- package/src/tools/dispatch-event-text.ts +19 -0
- package/src/tools/dispatch-runner.ts +9 -7
- package/src/tools/dispatch.ts +24 -1
- package/src/tools/monitor.ts +43 -20
- package/src/tools/registry.ts +72 -10
- package/src/tools/result-disposition.ts +706 -0
- package/src/tools/result-shaping.ts +321 -20
- package/src/tools/safe-exec.ts +2 -0
- package/src/tools/verify/authoring.ts +1120 -0
- package/src/tools/verify/catalog.ts +346 -0
- package/src/tools/verify/index.ts +13 -3
- package/src/tools/verify/scripts.ts +135 -37
- package/src/tools/verify/surface.ts +9 -5
- package/src/tools/worker-evidence.ts +54 -12
- package/src/worker/spec-contract.ts +43 -3
- package/dist/chunk-J7CWMCQD.js +0 -255
- package/dist/chunk-T6YILFSB.js +0 -80
- package/dist/chunk-VAKQQHWR.js +0 -434
- package/dist/chunk-VPAYEGVX.js +0 -184
- package/dist/chunk-XBXAASKX.js +0 -18
- package/dist/memory-WFZMGYHX.js +0 -236
- package/src/domains/eval/metrics/chaos-stream.ts +0 -93
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
approveMemoryRecord,
|
|
4
|
+
canonicalMemoryRepositoryIdentity,
|
|
5
|
+
loadMemoryRecords,
|
|
6
|
+
memoryAgentIdentity,
|
|
7
|
+
memoryRuntimeIdentity,
|
|
8
|
+
memoryStatus,
|
|
9
|
+
parseTaskMemoryHandoffSnapshot,
|
|
10
|
+
proposeMemoryFromEvidence,
|
|
11
|
+
proposeMemoryPromotion,
|
|
12
|
+
pruneStaleMemory,
|
|
13
|
+
rejectMemoryRecord
|
|
14
|
+
} from "./chunk-6US73PDB.js";
|
|
15
|
+
import "./chunk-QM3F2GKX.js";
|
|
16
|
+
import "./chunk-CJUB2JJ2.js";
|
|
17
|
+
import "./chunk-QKMUKYO7.js";
|
|
18
|
+
import "./chunk-OH3TOQTB.js";
|
|
19
|
+
import "./chunk-TSHXZTOQ.js";
|
|
20
|
+
import "./chunk-TXOTCRLG.js";
|
|
21
|
+
import "./chunk-HVDIIIQW.js";
|
|
22
|
+
import "./chunk-W6GROXXM.js";
|
|
23
|
+
import "./chunk-WHGPSPT5.js";
|
|
24
|
+
import "./chunk-XXQNGV4M.js";
|
|
25
|
+
import "./chunk-43AOLP7E.js";
|
|
26
|
+
import "./chunk-EKY57CSP.js";
|
|
27
|
+
import "./chunk-22NAGB7X.js";
|
|
28
|
+
import "./chunk-AOCYTWAV.js";
|
|
29
|
+
import "./chunk-MV3K5QF2.js";
|
|
30
|
+
import "./chunk-CMZWFGD2.js";
|
|
31
|
+
import "./chunk-I4HZDVNP.js";
|
|
32
|
+
import "./chunk-FYYLNIL5.js";
|
|
33
|
+
import "./chunk-UL3WSD3F.js";
|
|
34
|
+
import "./chunk-OQE5J4C6.js";
|
|
35
|
+
import "./chunk-ECH6PKUQ.js";
|
|
36
|
+
import "./chunk-GOXNB3AO.js";
|
|
37
|
+
import "./chunk-HWUFFB6L.js";
|
|
38
|
+
import "./chunk-ODFEOB4F.js";
|
|
39
|
+
import "./chunk-OZNBF4L3.js";
|
|
40
|
+
import "./chunk-4BJ5BYCE.js";
|
|
41
|
+
import "./chunk-6XLNIQDB.js";
|
|
42
|
+
import "./chunk-5B2AEOW5.js";
|
|
43
|
+
import "./chunk-CGKSTWHD.js";
|
|
44
|
+
import "./chunk-XAKHZX5N.js";
|
|
45
|
+
import "./chunk-33YXPOE3.js";
|
|
46
|
+
import "./chunk-24I7BN55.js";
|
|
47
|
+
import {
|
|
48
|
+
printError,
|
|
49
|
+
printOk
|
|
50
|
+
} from "./chunk-PPAMZ32Z.js";
|
|
51
|
+
import "./chunk-5TSRNF4G.js";
|
|
52
|
+
import "./chunk-DJVECN66.js";
|
|
53
|
+
import "./chunk-CFGTUFWB.js";
|
|
54
|
+
import "./chunk-AD2SYQYC.js";
|
|
55
|
+
import "./chunk-4OC57DA6.js";
|
|
56
|
+
import "./chunk-LL4KHSZI.js";
|
|
57
|
+
import "./chunk-4VP4KH3K.js";
|
|
58
|
+
import "./chunk-VEZEGCGW.js";
|
|
59
|
+
import "./chunk-FQ4SKYE4.js";
|
|
60
|
+
import "./chunk-IKCO5N3L.js";
|
|
61
|
+
import "./chunk-3I7MS7N2.js";
|
|
62
|
+
import "./chunk-IHXBNWMM.js";
|
|
63
|
+
import "./chunk-GEYXPTRF.js";
|
|
64
|
+
import "./chunk-SST6Z5JA.js";
|
|
65
|
+
import "./chunk-FO5ZOVUY.js";
|
|
66
|
+
import "./chunk-R346GLFC.js";
|
|
67
|
+
import "./chunk-4ZG3XFUR.js";
|
|
68
|
+
import "./chunk-FCSXB6T2.js";
|
|
69
|
+
import "./chunk-APJ265NV.js";
|
|
70
|
+
import "./chunk-YXLYO42X.js";
|
|
71
|
+
import {
|
|
72
|
+
clioDataDir
|
|
73
|
+
} from "./chunk-BNAZZHFG.js";
|
|
74
|
+
import "./chunk-6EJMN2Y3.js";
|
|
75
|
+
import "./chunk-WEPFGWHJ.js";
|
|
76
|
+
import "./chunk-ZGVHUX3M.js";
|
|
77
|
+
import "./chunk-G7MUEIGA.js";
|
|
78
|
+
import "./chunk-7CR24IG7.js";
|
|
79
|
+
import "./chunk-IWHMRKLL.js";
|
|
80
|
+
import {
|
|
81
|
+
init_esm_shims
|
|
82
|
+
} from "./chunk-3R73A4XB.js";
|
|
83
|
+
|
|
84
|
+
// src/cli/memory.ts
|
|
85
|
+
init_esm_shims();
|
|
86
|
+
import { readFile, stat } from "node:fs/promises";
|
|
87
|
+
var HELP = `clio-coder memory list
|
|
88
|
+
clio-coder memory propose --from-evidence <evidenceId> [scope options]
|
|
89
|
+
clio-coder memory promote --from-handoff <path> [--entry <id>...] --scope <scope> [scope options]
|
|
90
|
+
clio-coder memory approve <memoryId>
|
|
91
|
+
clio-coder memory reject <memoryId>
|
|
92
|
+
clio-coder memory prune --stale
|
|
93
|
+
|
|
94
|
+
Manage scoped, approved, evidence-linked local memory records.
|
|
95
|
+
|
|
96
|
+
Scope options:
|
|
97
|
+
--scope repo --repository <canonical-absolute-path>
|
|
98
|
+
--scope global --acknowledge-global
|
|
99
|
+
--scope runtime --runtime <source-runtime-id>
|
|
100
|
+
--scope agent --agent <source-agent-id>
|
|
101
|
+
|
|
102
|
+
Omit scope options from propose to preserve evidence-inferred scope. Promotion
|
|
103
|
+
always requires an explicit scope and creates unapproved records for review.
|
|
104
|
+
`;
|
|
105
|
+
function parseMemoryArgs(args) {
|
|
106
|
+
const parsed = { entryIds: [], acknowledgeGlobal: false, stale: false, help: false };
|
|
107
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
108
|
+
const arg = args[index];
|
|
109
|
+
if (arg === void 0) continue;
|
|
110
|
+
if (arg === "--help" || arg === "-h") {
|
|
111
|
+
parsed.help = true;
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (parsed.command === void 0) {
|
|
115
|
+
if (arg === "list" || arg === "propose" || arg === "promote" || arg === "approve" || arg === "reject" || arg === "prune") {
|
|
116
|
+
parsed.command = arg;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
throw new Error(`unknown memory command: ${arg}`);
|
|
120
|
+
}
|
|
121
|
+
if (parsed.command === "propose" || parsed.command === "promote") {
|
|
122
|
+
if (arg === "--from-evidence") {
|
|
123
|
+
if (parsed.command !== "propose") throw new Error("--from-evidence is valid only for memory propose");
|
|
124
|
+
const value = args[index + 1];
|
|
125
|
+
if (value === void 0 || value.startsWith("-")) throw new Error("--from-evidence requires an evidence id");
|
|
126
|
+
parsed.evidenceId = value;
|
|
127
|
+
index += 1;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (arg === "--from-handoff") {
|
|
131
|
+
if (parsed.command !== "promote") throw new Error("--from-handoff is valid only for memory promote");
|
|
132
|
+
const value = requireOptionValue(args, index, "--from-handoff", "a path");
|
|
133
|
+
parsed.handoffPath = value;
|
|
134
|
+
index += 1;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (arg === "--entry") {
|
|
138
|
+
if (parsed.command !== "promote") throw new Error("--entry is valid only for memory promote");
|
|
139
|
+
parsed.entryIds.push(requireOptionValue(args, index, "--entry", "an entry id"));
|
|
140
|
+
index += 1;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (arg === "--scope") {
|
|
144
|
+
const value = requireOptionValue(args, index, "--scope", "repo, global, runtime, or agent");
|
|
145
|
+
if (value !== "repo" && value !== "global" && value !== "runtime" && value !== "agent") {
|
|
146
|
+
throw new Error("--scope requires repo, global, runtime, or agent");
|
|
147
|
+
}
|
|
148
|
+
parsed.scope = value;
|
|
149
|
+
index += 1;
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if (arg === "--repository") {
|
|
153
|
+
parsed.repositoryPath = requireOptionValue(args, index, "--repository", "a canonical absolute path");
|
|
154
|
+
index += 1;
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (arg === "--acknowledge-global") {
|
|
158
|
+
parsed.acknowledgeGlobal = true;
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
if (arg === "--runtime") {
|
|
162
|
+
parsed.runtimeId = requireOptionValue(args, index, "--runtime", "a runtime id");
|
|
163
|
+
index += 1;
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if (arg === "--agent") {
|
|
167
|
+
parsed.agentId = requireOptionValue(args, index, "--agent", "an agent id");
|
|
168
|
+
index += 1;
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
throw new Error(`unknown memory ${parsed.command} argument: ${arg}`);
|
|
172
|
+
}
|
|
173
|
+
if (parsed.command === "approve" || parsed.command === "reject") {
|
|
174
|
+
if (parsed.memoryId === void 0 && !arg.startsWith("-")) {
|
|
175
|
+
parsed.memoryId = arg;
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
throw new Error(`unexpected memory ${parsed.command} argument: ${arg}`);
|
|
179
|
+
}
|
|
180
|
+
if (parsed.command === "prune") {
|
|
181
|
+
if (arg === "--stale") {
|
|
182
|
+
parsed.stale = true;
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
throw new Error(`unknown memory prune argument: ${arg}`);
|
|
186
|
+
}
|
|
187
|
+
throw new Error(`unexpected memory argument: ${arg}`);
|
|
188
|
+
}
|
|
189
|
+
if (parsed.help) return parsed;
|
|
190
|
+
if (parsed.command === void 0) throw new Error("memory requires list, propose, promote, approve, reject, or prune");
|
|
191
|
+
if (parsed.command === "propose" && parsed.evidenceId === void 0) {
|
|
192
|
+
throw new Error("propose requires --from-evidence <evidenceId>");
|
|
193
|
+
}
|
|
194
|
+
if (parsed.command === "promote" && parsed.handoffPath === void 0) {
|
|
195
|
+
throw new Error("promote requires --from-handoff <path>");
|
|
196
|
+
}
|
|
197
|
+
if ((parsed.command === "approve" || parsed.command === "reject") && parsed.memoryId === void 0) {
|
|
198
|
+
throw new Error(`${parsed.command} requires a memory id`);
|
|
199
|
+
}
|
|
200
|
+
if (parsed.command === "prune" && !parsed.stale) throw new Error("prune requires --stale");
|
|
201
|
+
if (parsed.command === "promote" && parsed.scope === void 0) {
|
|
202
|
+
throw new Error("promote requires --scope <repo|global|runtime|agent>");
|
|
203
|
+
}
|
|
204
|
+
validateScopeArguments(parsed);
|
|
205
|
+
if (parsed.command === "list" && (parsed.evidenceId !== void 0 || parsed.handoffPath !== void 0 || parsed.entryIds.length > 0 || parsed.memoryId !== void 0 || parsed.stale || parsed.scope !== void 0)) {
|
|
206
|
+
throw new Error("list does not accept extra arguments");
|
|
207
|
+
}
|
|
208
|
+
return parsed;
|
|
209
|
+
}
|
|
210
|
+
function requireOptionValue(args, index, option, expected) {
|
|
211
|
+
const value = args[index + 1];
|
|
212
|
+
if (value === void 0 || value.startsWith("-")) throw new Error(`${option} requires ${expected}`);
|
|
213
|
+
return value;
|
|
214
|
+
}
|
|
215
|
+
function validateScopeArguments(parsed) {
|
|
216
|
+
const hasIdentityOption = parsed.repositoryPath !== void 0 || parsed.acknowledgeGlobal || parsed.runtimeId !== void 0 || parsed.agentId !== void 0;
|
|
217
|
+
if (parsed.scope === void 0) {
|
|
218
|
+
if (hasIdentityOption) throw new Error("scope identity options require --scope");
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
if (parsed.scope === "repo") {
|
|
222
|
+
if (parsed.repositoryPath === void 0)
|
|
223
|
+
throw new Error("repo scope requires --repository <canonical-absolute-path>");
|
|
224
|
+
if (parsed.acknowledgeGlobal || parsed.runtimeId !== void 0 || parsed.agentId !== void 0) {
|
|
225
|
+
throw new Error("repo scope accepts only --repository");
|
|
226
|
+
}
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
if (parsed.scope === "global") {
|
|
230
|
+
if (!parsed.acknowledgeGlobal) throw new Error("global scope requires --acknowledge-global");
|
|
231
|
+
if (parsed.repositoryPath !== void 0 || parsed.runtimeId !== void 0 || parsed.agentId !== void 0) {
|
|
232
|
+
throw new Error("global scope accepts only --acknowledge-global");
|
|
233
|
+
}
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
if (parsed.scope === "runtime") {
|
|
237
|
+
if (parsed.runtimeId === void 0) throw new Error("runtime scope requires --runtime <source-runtime-id>");
|
|
238
|
+
if (parsed.repositoryPath !== void 0 || parsed.acknowledgeGlobal || parsed.agentId !== void 0) {
|
|
239
|
+
throw new Error("runtime scope accepts only --runtime");
|
|
240
|
+
}
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
if (parsed.agentId === void 0) throw new Error("agent scope requires --agent <source-agent-id>");
|
|
244
|
+
if (parsed.repositoryPath !== void 0 || parsed.acknowledgeGlobal || parsed.runtimeId !== void 0) {
|
|
245
|
+
throw new Error("agent scope accepts only --agent");
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
async function runMemoryCommand(args) {
|
|
249
|
+
let parsed;
|
|
250
|
+
try {
|
|
251
|
+
parsed = parseMemoryArgs(args);
|
|
252
|
+
} catch (error) {
|
|
253
|
+
printError(error instanceof Error ? error.message : String(error));
|
|
254
|
+
process.stderr.write(HELP);
|
|
255
|
+
return 2;
|
|
256
|
+
}
|
|
257
|
+
if (parsed.help) {
|
|
258
|
+
process.stdout.write(HELP);
|
|
259
|
+
return 0;
|
|
260
|
+
}
|
|
261
|
+
const dataDir = clioDataDir();
|
|
262
|
+
try {
|
|
263
|
+
if (parsed.command === "list") {
|
|
264
|
+
renderMemoryList(await loadMemoryRecords(dataDir));
|
|
265
|
+
return 0;
|
|
266
|
+
}
|
|
267
|
+
if (parsed.command === "propose") {
|
|
268
|
+
const evidenceId = parsed.evidenceId;
|
|
269
|
+
if (evidenceId === void 0) {
|
|
270
|
+
printError("propose requires --from-evidence <evidenceId>");
|
|
271
|
+
return 2;
|
|
272
|
+
}
|
|
273
|
+
const result = await proposeMemoryFromEvidence(dataDir, evidenceId, scopeSelection(parsed));
|
|
274
|
+
renderProposal(result.record, result.created);
|
|
275
|
+
return 0;
|
|
276
|
+
}
|
|
277
|
+
if (parsed.command === "promote") {
|
|
278
|
+
const handoffPath = parsed.handoffPath;
|
|
279
|
+
const selection = scopeSelection(parsed);
|
|
280
|
+
if (handoffPath === void 0 || selection === void 0) {
|
|
281
|
+
printError("promote requires a handoff and explicit scope");
|
|
282
|
+
return 2;
|
|
283
|
+
}
|
|
284
|
+
const snapshot = await readReviewedHandoff(handoffPath);
|
|
285
|
+
const entries = selectHandoffEntries(snapshot, parsed.entryIds);
|
|
286
|
+
for (const entry of entries) {
|
|
287
|
+
const result = await proposeMemoryPromotion(
|
|
288
|
+
dataDir,
|
|
289
|
+
{
|
|
290
|
+
kind: "handoff-snapshot",
|
|
291
|
+
sessionId: snapshot.source.sessionId,
|
|
292
|
+
evidenceRefs: snapshot.source.evidenceRefs,
|
|
293
|
+
runtimeIds: snapshot.source.runtimeIds,
|
|
294
|
+
agentIds: snapshot.source.agentIds,
|
|
295
|
+
entry: handoffTaskEntry(entry),
|
|
296
|
+
redaction: {
|
|
297
|
+
replacementCount: snapshot.redaction.replacementCount,
|
|
298
|
+
sourceFields: snapshot.redaction.sourceFields
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
selection
|
|
302
|
+
);
|
|
303
|
+
renderProposal(result.record, result.created);
|
|
304
|
+
}
|
|
305
|
+
return 0;
|
|
306
|
+
}
|
|
307
|
+
if (parsed.command === "approve") {
|
|
308
|
+
const memoryId = parsed.memoryId;
|
|
309
|
+
if (memoryId === void 0) {
|
|
310
|
+
printError("approve requires a memory id");
|
|
311
|
+
return 2;
|
|
312
|
+
}
|
|
313
|
+
const record = await approveMemoryRecord(dataDir, memoryId);
|
|
314
|
+
printOk(`approved ${record.id}`);
|
|
315
|
+
return 0;
|
|
316
|
+
}
|
|
317
|
+
if (parsed.command === "reject") {
|
|
318
|
+
const memoryId = parsed.memoryId;
|
|
319
|
+
if (memoryId === void 0) {
|
|
320
|
+
printError("reject requires a memory id");
|
|
321
|
+
return 2;
|
|
322
|
+
}
|
|
323
|
+
const record = await rejectMemoryRecord(dataDir, memoryId);
|
|
324
|
+
printOk(`rejected ${record.id}`);
|
|
325
|
+
return 0;
|
|
326
|
+
}
|
|
327
|
+
if (parsed.command === "prune") {
|
|
328
|
+
const pruned = await pruneStaleMemory(dataDir);
|
|
329
|
+
printOk(`pruned ${pruned.length} stale memory record${pruned.length === 1 ? "" : "s"}`);
|
|
330
|
+
return 0;
|
|
331
|
+
}
|
|
332
|
+
printError("memory requires list, propose, promote, approve, reject, or prune");
|
|
333
|
+
return 2;
|
|
334
|
+
} catch (error) {
|
|
335
|
+
printError(error instanceof Error ? error.message : String(error));
|
|
336
|
+
return 1;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
function scopeSelection(parsed) {
|
|
340
|
+
if (parsed.scope === void 0) return void 0;
|
|
341
|
+
if (parsed.scope === "repo") {
|
|
342
|
+
const repositoryPath = parsed.repositoryPath;
|
|
343
|
+
if (repositoryPath === void 0) throw new Error("repo scope requires --repository");
|
|
344
|
+
const repository = canonicalMemoryRepositoryIdentity(repositoryPath);
|
|
345
|
+
if (repository === null || repository.key !== repositoryPath) {
|
|
346
|
+
throw new Error("--repository must be an existing canonical absolute repository path");
|
|
347
|
+
}
|
|
348
|
+
return { scope: "repo", repository };
|
|
349
|
+
}
|
|
350
|
+
if (parsed.scope === "global") {
|
|
351
|
+
if (!parsed.acknowledgeGlobal) throw new Error("global scope requires --acknowledge-global");
|
|
352
|
+
return { scope: "global", acknowledgeGlobal: true };
|
|
353
|
+
}
|
|
354
|
+
if (parsed.scope === "runtime") {
|
|
355
|
+
if (parsed.runtimeId === void 0) throw new Error("runtime scope requires --runtime");
|
|
356
|
+
return { scope: "runtime", runtime: memoryRuntimeIdentity(parsed.runtimeId) };
|
|
357
|
+
}
|
|
358
|
+
if (parsed.agentId === void 0) throw new Error("agent scope requires --agent");
|
|
359
|
+
return { scope: "agent", agent: memoryAgentIdentity(parsed.agentId) };
|
|
360
|
+
}
|
|
361
|
+
async function readReviewedHandoff(path) {
|
|
362
|
+
const info = await stat(path);
|
|
363
|
+
if (!info.isFile()) throw new Error(`task-memory handoff is not a file: ${path}`);
|
|
364
|
+
if (info.size > 1e6) throw new Error(`task-memory handoff exceeds 1000000 bytes: ${path}`);
|
|
365
|
+
const snapshot = parseTaskMemoryHandoffSnapshot(await readFile(path, "utf8"));
|
|
366
|
+
if (snapshot === null) throw new Error(`task-memory handoff is invalid: ${path}`);
|
|
367
|
+
if (snapshot.version !== 2) {
|
|
368
|
+
throw new Error("task-memory handoff lacks source session and evidence provenance; create a new redacted handoff");
|
|
369
|
+
}
|
|
370
|
+
return snapshot;
|
|
371
|
+
}
|
|
372
|
+
function selectHandoffEntries(snapshot, entryIds) {
|
|
373
|
+
const entries = [
|
|
374
|
+
...snapshot.knowledge.map((entry) => ({ kind: "knowledge", entry })),
|
|
375
|
+
...snapshot.procedural.map((entry) => ({ kind: "procedural", entry }))
|
|
376
|
+
];
|
|
377
|
+
if (entries.length === 0) throw new Error("task-memory handoff contains no promotable entries");
|
|
378
|
+
if (entryIds.length === 0) return entries;
|
|
379
|
+
const requested = new Set(entryIds);
|
|
380
|
+
const selected = entries.filter(({ entry }) => requested.has(entry.id));
|
|
381
|
+
const missing = [...requested].filter((id) => !selected.some(({ entry }) => entry.id === id));
|
|
382
|
+
if (missing.length > 0) throw new Error(`task-memory handoff entry not found: ${missing.join(", ")}`);
|
|
383
|
+
return selected;
|
|
384
|
+
}
|
|
385
|
+
function handoffTaskEntry(selected) {
|
|
386
|
+
const createdAt = selected.entry.createdAt;
|
|
387
|
+
const lastTouchedAt = selected.entry.lastTouchedAt;
|
|
388
|
+
if (createdAt === void 0 || lastTouchedAt === void 0) {
|
|
389
|
+
throw new Error(`task-memory handoff entry lacks timestamps: ${selected.entry.id}`);
|
|
390
|
+
}
|
|
391
|
+
return {
|
|
392
|
+
id: selected.entry.id,
|
|
393
|
+
kind: selected.kind,
|
|
394
|
+
content: selected.entry.content,
|
|
395
|
+
createdAt,
|
|
396
|
+
lastTouchedAt,
|
|
397
|
+
injectionCount: selected.entry.injectionCount
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
function renderProposal(record, created) {
|
|
401
|
+
process.stdout.write(`memory: ${record.id}
|
|
402
|
+
`);
|
|
403
|
+
process.stdout.write(`status: ${created ? "proposed" : memoryStatus(record)}
|
|
404
|
+
`);
|
|
405
|
+
process.stdout.write(`scope: ${record.scope}
|
|
406
|
+
`);
|
|
407
|
+
if (record.repository !== void 0) process.stdout.write(`repository: ${record.repository.key}
|
|
408
|
+
`);
|
|
409
|
+
if (record.runtime !== void 0) process.stdout.write(`runtime: ${record.runtime.key}
|
|
410
|
+
`);
|
|
411
|
+
if (record.agent !== void 0) process.stdout.write(`agent: ${record.agent.key}
|
|
412
|
+
`);
|
|
413
|
+
process.stdout.write(`key: ${record.key}
|
|
414
|
+
`);
|
|
415
|
+
process.stdout.write(`evidence: ${record.evidenceRefs.join(", ")}
|
|
416
|
+
`);
|
|
417
|
+
process.stdout.write(`confidence: ${record.confidence.toFixed(2)}
|
|
418
|
+
`);
|
|
419
|
+
process.stdout.write(`lesson: ${record.lesson}
|
|
420
|
+
`);
|
|
421
|
+
if (record.provenance !== void 0) {
|
|
422
|
+
process.stdout.write(`source: ${record.provenance.sourceKind}
|
|
423
|
+
`);
|
|
424
|
+
if (record.provenance.sourceSessionId !== void 0) {
|
|
425
|
+
process.stdout.write(`source-session: ${record.provenance.sourceSessionId}
|
|
426
|
+
`);
|
|
427
|
+
}
|
|
428
|
+
if (record.provenance.sourceEntryId !== void 0) {
|
|
429
|
+
process.stdout.write(`source-entry: ${record.provenance.sourceEntryId}
|
|
430
|
+
`);
|
|
431
|
+
}
|
|
432
|
+
if (record.provenance.redaction !== void 0) {
|
|
433
|
+
process.stdout.write(
|
|
434
|
+
`redaction: ${record.provenance.redaction.replacementCount} replacement${record.provenance.redaction.replacementCount === 1 ? "" : "s"}; fields=${record.provenance.redaction.sourceFields.join(",") || "none"}
|
|
435
|
+
`
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
process.stdout.write(`review: clio-coder memory approve ${record.id}
|
|
440
|
+
`);
|
|
441
|
+
}
|
|
442
|
+
function renderMemoryList(records) {
|
|
443
|
+
process.stdout.write(`${records.length} memory record${records.length === 1 ? "" : "s"}
|
|
444
|
+
`);
|
|
445
|
+
if (records.length === 0) return;
|
|
446
|
+
process.stdout.write("\n");
|
|
447
|
+
for (const record of records) {
|
|
448
|
+
process.stdout.write(
|
|
449
|
+
[
|
|
450
|
+
record.id.padEnd(21),
|
|
451
|
+
memoryStatus(record).padEnd(10),
|
|
452
|
+
record.scope.padEnd(13),
|
|
453
|
+
`confidence=${record.confidence.toFixed(2)}`.padEnd(16),
|
|
454
|
+
`evidence=${record.evidenceRefs.join(",")}`
|
|
455
|
+
].join("")
|
|
456
|
+
);
|
|
457
|
+
process.stdout.write("\n");
|
|
458
|
+
process.stdout.write(` key: ${record.key}
|
|
459
|
+
`);
|
|
460
|
+
process.stdout.write(` lesson: ${record.lesson}
|
|
461
|
+
`);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
export {
|
|
465
|
+
runMemoryCommand
|
|
466
|
+
};
|
|
467
|
+
//# sourceMappingURL=memory-7YKKR6UC.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-6XXKFVSN.js";
|
|
3
|
+
import {
|
|
4
|
+
ensureClioState
|
|
5
|
+
} from "./chunk-KHSFENX2.js";
|
|
3
6
|
import {
|
|
4
7
|
ConfigDomainModule,
|
|
5
8
|
loadDomains
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import
|
|
8
|
-
ensureClioState
|
|
9
|
-
} from "./chunk-UFIIWP2H.js";
|
|
10
|
-
import "./chunk-CBCAPZAA.js";
|
|
9
|
+
} from "./chunk-R46L2BIR.js";
|
|
10
|
+
import "./chunk-E25LMLRW.js";
|
|
11
11
|
import "./chunk-4BPJXDWC.js";
|
|
12
12
|
import "./chunk-2SFS6XQE.js";
|
|
13
13
|
import "./chunk-ZWLZP4ZT.js";
|
|
14
14
|
import "./chunk-CGKSTWHD.js";
|
|
15
15
|
import "./chunk-XPLRXC72.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-RD5U66HV.js";
|
|
17
|
+
import "./chunk-KOHPCX4K.js";
|
|
18
|
+
import "./chunk-24I7BN55.js";
|
|
19
19
|
import {
|
|
20
20
|
printError
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-PPAMZ32Z.js";
|
|
22
22
|
import {
|
|
23
23
|
source_default
|
|
24
24
|
} from "./chunk-5TSRNF4G.js";
|
|
@@ -26,28 +26,31 @@ import {
|
|
|
26
26
|
ProvidersDomainModule,
|
|
27
27
|
modelCandidatesForStatus,
|
|
28
28
|
resolveModelCapabilities
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
29
|
+
} from "./chunk-DJVECN66.js";
|
|
30
|
+
import "./chunk-CFGTUFWB.js";
|
|
31
|
+
import "./chunk-AD2SYQYC.js";
|
|
32
|
+
import "./chunk-4OC57DA6.js";
|
|
33
|
+
import "./chunk-LL4KHSZI.js";
|
|
32
34
|
import "./chunk-4VP4KH3K.js";
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-R346GLFC.js";
|
|
35
|
-
import "./chunk-VPAYEGVX.js";
|
|
36
|
-
import "./chunk-COU2UHX6.js";
|
|
35
|
+
import "./chunk-VEZEGCGW.js";
|
|
37
36
|
import "./chunk-FQ4SKYE4.js";
|
|
38
37
|
import "./chunk-IKCO5N3L.js";
|
|
39
38
|
import "./chunk-3I7MS7N2.js";
|
|
40
39
|
import "./chunk-IHXBNWMM.js";
|
|
40
|
+
import "./chunk-GEYXPTRF.js";
|
|
41
41
|
import "./chunk-SST6Z5JA.js";
|
|
42
|
+
import "./chunk-FO5ZOVUY.js";
|
|
43
|
+
import "./chunk-R346GLFC.js";
|
|
42
44
|
import "./chunk-4ZG3XFUR.js";
|
|
43
|
-
import "./chunk-APJ265NV.js";
|
|
44
45
|
import "./chunk-FCSXB6T2.js";
|
|
46
|
+
import "./chunk-APJ265NV.js";
|
|
45
47
|
import "./chunk-YXLYO42X.js";
|
|
46
48
|
import "./chunk-BNAZZHFG.js";
|
|
47
49
|
import "./chunk-6EJMN2Y3.js";
|
|
48
50
|
import "./chunk-WEPFGWHJ.js";
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-XE2VEJHX.js";
|
|
52
|
+
import "./chunk-ZGVHUX3M.js";
|
|
53
|
+
import "./chunk-G7MUEIGA.js";
|
|
51
54
|
import "./chunk-IWHMRKLL.js";
|
|
52
55
|
import {
|
|
53
56
|
init_esm_shims
|
|
@@ -259,4 +262,4 @@ export {
|
|
|
259
262
|
modelTableLines,
|
|
260
263
|
runModelsCommand
|
|
261
264
|
};
|
|
262
|
-
//# sourceMappingURL=models-
|
|
265
|
+
//# sourceMappingURL=models-ZPOLRU2C.js.map
|