@cleocode/cleo 2026.10.2 → 2026.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cleo.js +11 -1
- package/dist/cli/adapter-LVXHFBC4.js +158 -0
- package/dist/cli/add-WUAV7LDT.js +443 -0
- package/dist/cli/add-batch-U2DLKAQC.js +163 -0
- package/dist/cli/admin-I7BQYVZD.js +340 -0
- package/dist/cli/adr-K2THMQBS.js +171 -0
- package/dist/cli/agent-WQ6XY2DW.js +2366 -0
- package/dist/cli/agent-outputs-BJIYLVTU.js +84 -0
- package/dist/cli/analyze-PGQZWGOC.js +48 -0
- package/dist/cli/archive-5LZPF7C3.js +64 -0
- package/dist/cli/archive-stats-U6CYC6JM.js +100 -0
- package/dist/cli/attention-SOURWCNI.js +167 -0
- package/dist/cli/audit-FO2Y4LH2.js +122 -0
- package/dist/cli/auth-ED7TAIXI.js +491 -0
- package/dist/cli/backfill-32TRAYRD.js +156 -0
- package/dist/cli/backup-LEJMZJKL.js +587 -0
- package/dist/cli/backup-inspect-6HPLUEI2.js +26 -0
- package/dist/cli/backup-recover-2BTYBZU2.js +29 -0
- package/dist/cli/blockers-5JULUJTV.js +54 -0
- package/dist/cli/brain-273N3FW4.js +400 -0
- package/dist/cli/briefing-7H6OLECX.js +212 -0
- package/dist/cli/caamp-MFQVN6VU.js +181 -0
- package/dist/cli/cancel-SCMJTXZB.js +84 -0
- package/dist/cli/canon-NPF5RODM.js +142 -0
- package/dist/cli/canon-docs-2GTOLF7Y.js +26 -0
- package/dist/cli/cant-46XCUP4P.js +239 -0
- package/dist/cli/changeset-32NMBGG2.js +248 -0
- package/dist/cli/check-RWJLBCI2.js +907 -0
- package/dist/cli/checkpoint-37HMMKD7.js +128 -0
- package/dist/cli/chunk-2JIJD2I7.js +108 -0
- package/dist/cli/chunk-37NU2XDP.js +171 -0
- package/dist/cli/chunk-3IOQVUO7.js +17308 -0
- package/dist/cli/chunk-3PGH67MT.js +175 -0
- package/dist/cli/chunk-3ZO3M37V.js +1002 -0
- package/dist/cli/chunk-47JYZAMS.js +30 -0
- package/dist/cli/chunk-5J2VH3BC.js +66 -0
- package/dist/cli/chunk-5ZFFUFH7.js +92 -0
- package/dist/cli/chunk-6JSJNYH2.js +114 -0
- package/dist/cli/chunk-7INMKEAD.js +85 -0
- package/dist/cli/chunk-A2IUEIM5.js +278 -0
- package/dist/cli/chunk-AWCQH2W5.js +35 -0
- package/dist/cli/chunk-AYA6F4ZT.js +56 -0
- package/dist/cli/chunk-BCEXRFA2.js +76 -0
- package/dist/cli/chunk-BPEVD37G.js +124 -0
- package/dist/cli/chunk-C3B7C43W.js +16 -0
- package/dist/cli/chunk-DVTPIZJM.js +72 -0
- package/dist/cli/chunk-DYABOIHB.js +96 -0
- package/dist/cli/chunk-EBRZ76HS.js +51 -0
- package/dist/cli/chunk-EGOTK2HA.js +57 -0
- package/dist/cli/chunk-EOPQFCSR.js +148 -0
- package/dist/cli/chunk-FORFDPP5.js +288 -0
- package/dist/cli/chunk-GFGLLDXX.js +110 -0
- package/dist/cli/chunk-GH37QXW5.js +280 -0
- package/dist/cli/chunk-GZFVDR44.js +320 -0
- package/dist/cli/chunk-I3CRQQAD.js +225 -0
- package/dist/cli/chunk-J3ZFM3UQ.js +754 -0
- package/dist/cli/chunk-JNZJPIPJ.js +90 -0
- package/dist/cli/chunk-KHB52JNB.js +209 -0
- package/dist/cli/chunk-KJDWWQFY.js +46 -0
- package/dist/cli/chunk-LKNUA3SB.js +83 -0
- package/dist/cli/chunk-LVGIFMCV.js +163 -0
- package/dist/cli/chunk-LWQBJQSE.js +67 -0
- package/dist/cli/chunk-MNJRLSEQ.js +107 -0
- package/dist/cli/chunk-NRKWJLMS.js +91 -0
- package/dist/cli/chunk-NSHV2JNM.js +48 -0
- package/dist/cli/chunk-NWTATTEQ.js +210 -0
- package/dist/cli/chunk-OAPN46TC.js +89 -0
- package/dist/cli/chunk-OGV57L4J.js +59 -0
- package/dist/cli/chunk-OILHT47L.js +252 -0
- package/dist/cli/chunk-OPTEQKBB.js +258 -0
- package/dist/cli/chunk-PKKZPOOP.js +352 -0
- package/dist/cli/chunk-QA6T2LQ5.js +71 -0
- package/dist/cli/chunk-QFFQSKRC.js +4497 -0
- package/dist/cli/chunk-QPUY2HQZ.js +74 -0
- package/dist/cli/chunk-REUTEW3O.js +258 -0
- package/dist/cli/chunk-S24YI723.js +88 -0
- package/dist/cli/chunk-SXXOC6KZ.js +209 -0
- package/dist/cli/chunk-ULN4OKQQ.js +259 -0
- package/dist/cli/chunk-V5GBGOGM.js +46 -0
- package/dist/cli/chunk-VLEYOOPH.js +31 -0
- package/dist/cli/chunk-W33Q3FBH.js +66 -0
- package/dist/cli/chunk-W3JLYKKY.js +140 -0
- package/dist/cli/chunk-XRAX6XFP.js +48 -0
- package/dist/cli/chunk-YGKEECTI.js +78 -0
- package/dist/cli/chunk-YUZJI67I.js +108 -0
- package/dist/cli/chunk-YY66LFZF.js +29 -0
- package/dist/cli/chunk-ZBISIPCK.js +78 -0
- package/dist/cli/chunk-ZZTHTMQP.js +77 -0
- package/dist/cli/claim-KPENYHIQ.js +96 -0
- package/dist/cli/classify-DRVMCFQU.js +117 -0
- package/dist/cli/cli-T3CR7J57.js +48 -0
- package/dist/cli/cloud-PPQ4O5TX.js +565 -0
- package/dist/cli/cockpit-RZKLGYPN.js +790 -0
- package/dist/cli/code-Z5CTMVTD.js +178 -0
- package/dist/cli/complete-UBOCOBRB.js +34 -0
- package/dist/cli/complexity-BV2AGQRZ.js +56 -0
- package/dist/cli/compliance-32PD5Y47.js +276 -0
- package/dist/cli/conduit-VDKCH33F.js +307 -0
- package/dist/cli/config-I72JAXK4.js +516 -0
- package/dist/cli/consensus-LFILLSTK.js +121 -0
- package/dist/cli/context-XUUVFVTP.js +141 -0
- package/dist/cli/contribution-37NQ4N5R.js +111 -0
- package/dist/cli/curator-TFDXU2EX.js +139 -0
- package/dist/cli/current-C4SN5BWV.js +42 -0
- package/dist/cli/daemon-DV25JQ62.js +451 -0
- package/dist/cli/dash-TFU4RLQW.js +70 -0
- package/dist/cli/decide-5VPMNTSI.js +419 -0
- package/dist/cli/decompose-KOYEZNJL.js +77 -0
- package/dist/cli/decomposition-7OHUFIQN.js +121 -0
- package/dist/cli/delete-Q7YCAFY5.js +68 -0
- package/dist/cli/deps-6UZKLDGJ.js +463 -0
- package/dist/cli/detect-FERY35UL.js +45 -0
- package/dist/cli/detect-drift-UL2JTPUK.js +408 -0
- package/dist/cli/diagnostics-TI5QAZXR.js +132 -0
- package/dist/cli/docs-QI2PRN3T.js +3095 -0
- package/dist/cli/doctor-AX5TICQO.js +1253 -0
- package/dist/cli/doctor-ac-bindings-YPMYHU2G.js +26 -0
- package/dist/cli/doctor-acceptance-drift-PYNFGMKB.js +26 -0
- package/dist/cli/doctor-credentials-UZRIADKM.js +26 -0
- package/dist/cli/doctor-db-substrate-Q2TOYM2S.js +27 -0
- package/dist/cli/doctor-dep-cycles-GCVYZY6F.js +26 -0
- package/dist/cli/doctor-exodus-RO5SUTC2.js +26 -0
- package/dist/cli/doctor-exodus-residue-EM2AWQXP.js +26 -0
- package/dist/cli/doctor-fk-check-Q3FOLECE.js +26 -0
- package/dist/cli/doctor-global-delivery-TNOAQ3NP.js +26 -0
- package/dist/cli/doctor-heavy-command-hook-IO3QAQLG.js +26 -0
- package/dist/cli/doctor-legacy-backups-O2YH5VLS.js +26 -0
- package/dist/cli/doctor-legacy-reaper-VSEJEIFA.js +26 -0
- package/dist/cli/doctor-malformed-ids-LQ766V5K.js +26 -0
- package/dist/cli/doctor-manifest-rows-6FQDNHLH.js +26 -0
- package/dist/cli/doctor-memory-guard-J4PSEKB5.js +26 -0
- package/dist/cli/doctor-migrations-ONOH56YM.js +26 -0
- package/dist/cli/doctor-nexus-residency-FUQAX7PV.js +26 -0
- package/dist/cli/doctor-project-identity-GUDK3HYX.js +26 -0
- package/dist/cli/doctor-projects-7L3BNL4O.js +30 -0
- package/dist/cli/doctor-projects-registry-TEAVHFQU.js +26 -0
- package/dist/cli/doctor-release-readiness-IEGHX6SL.js +26 -0
- package/dist/cli/doctor-repair-NBONOSZU.js +26 -0
- package/dist/cli/doctor-skill-fixtures-7Y6L34A3.js +26 -0
- package/dist/cli/doctor-split-brain-TUKIGVHF.js +26 -0
- package/dist/cli/doctor-superseded-store-BHZY2B2L.js +26 -0
- package/dist/cli/doctor-tool-locks-REQMIVYK.js +26 -0
- package/dist/cli/doctor-twin-collapse-222GOSPE.js +26 -0
- package/dist/cli/doctor-worktree-stores-J7TCRVJ3.js +26 -0
- package/dist/cli/done-V3AOO65B.js +195 -0
- package/dist/cli/dynamic-RR4HB7BB.js +29 -0
- package/dist/cli/event-EGNPGE5A.js +372 -0
- package/dist/cli/exists-H4SDCBPL.js +65 -0
- package/dist/cli/exodus-KALO3B3X.js +401 -0
- package/dist/cli/export-ROFOCG4M.js +92 -0
- package/dist/cli/export-tasks-US3WBIEQ.js +96 -0
- package/dist/cli/federation-SUIB5QWT.js +145 -0
- package/dist/cli/find-YICG4BG6.js +177 -0
- package/dist/cli/focus-TKCZPKOM.js +55 -0
- package/dist/cli/gateway-H4HFDC3E.js +77 -0
- package/dist/cli/gateway-auto-start-EDK7XI6E.js +36 -0
- package/dist/cli/gc-5R2TUY5T.js +291 -0
- package/dist/cli/go-PRQFK5YG.js +206 -0
- package/dist/cli/goal-7CZRMLHC.js +212 -0
- package/dist/cli/grade-PY2YRPUS.js +56 -0
- package/dist/cli/graph-XIXMCFKG.js +878 -0
- package/dist/cli/history-EIXADPAD.js +137 -0
- package/dist/cli/hook-UF7J7R6D.js +57 -0
- package/dist/cli/hook-entry.js +244 -19
- package/dist/cli/hygiene-3QZ2NI7P.js +55 -0
- package/dist/cli/import-R73SO444.js +88 -0
- package/dist/cli/import-tasks-O22FZJ4U.js +108 -0
- package/dist/cli/index.js +419 -94607
- package/dist/cli/init-IHEJDQWU.js +40 -0
- package/dist/cli/inject-LSRVWNCP.js +82 -0
- package/dist/cli/install-global-4AZUCH6U.js +95 -0
- package/dist/cli/intelligence-2OSFOGD2.js +181 -0
- package/dist/cli/issue-IIWEDNFC.js +158 -0
- package/dist/cli/janitor-GPMC7VOR.js +111 -0
- package/dist/cli/labels-5NPOIQXN.js +87 -0
- package/dist/cli/lifecycle-4FFS2K2T.js +272 -0
- package/dist/cli/list-47KEUGPQ.js +108 -0
- package/dist/cli/llm-G5B3I6GD.js +703 -0
- package/dist/cli/llm-cost-S7RS6BVA.js +25 -0
- package/dist/cli/llm-stream-24A45NTS.js +27 -0
- package/dist/cli/log-XF6H2XSD.js +75 -0
- package/dist/cli/login-LBPLGHYG.js +43 -0
- package/dist/cli/logout-SX4JSJIV.js +74 -0
- package/dist/cli/manifest-NMCW4PIW.js +353 -0
- package/dist/cli/map-BU72KMGF.js +52 -0
- package/dist/cli/memory-UHYIVGVM.js +1956 -0
- package/dist/cli/migrate-agents-v2-OO7OILZK.js +33 -0
- package/dist/cli/migrate-claude-mem-EDNYUY3K.js +201 -0
- package/dist/cli/next-RZFRG5X7.js +56 -0
- package/dist/cli/nexus-4S4Z5EVU.js +2923 -0
- package/dist/cli/ops-KR7AWCG3.js +51 -0
- package/dist/cli/orchestrate-HOYZY3VX.js +948 -0
- package/dist/cli/otel-U7IIRBCT.js +188 -0
- package/dist/cli/phase-NYZFHUE5.js +220 -0
- package/dist/cli/pivot-FF2CVUZL.js +87 -0
- package/dist/cli/plan-3SL2NTRV.js +48 -0
- package/dist/cli/playbook-2FCBV7N3.js +229 -0
- package/dist/cli/project-WDX2TGMC.js +330 -0
- package/dist/cli/promote-YINYFBZY.js +52 -0
- package/dist/cli/provenance-C7AYD7WG.js +128 -0
- package/dist/cli/provider-QLJEDQBR.js +212 -0
- package/dist/cli/reason-JF5BHBM5.js +137 -0
- package/dist/cli/reconcile-NMISHDGX.js +127 -0
- package/dist/cli/refresh-memory-EY5YNICV.js +45 -0
- package/dist/cli/relates-R3ZPICAY.js +259 -0
- package/dist/cli/release-4ZJTMUUT.js +524 -0
- package/dist/cli/remote-QSONJDIK.js +279 -0
- package/dist/cli/renderers-64OR3IWX.js +37 -0
- package/dist/cli/reorder-J3DOE7ST.js +86 -0
- package/dist/cli/reparent-2OUMKEZX.js +58 -0
- package/dist/cli/req-TZB7OFKO.js +129 -0
- package/dist/cli/research-MTD7EX45.js +365 -0
- package/dist/cli/restore-VEUOX7NF.js +423 -0
- package/dist/cli/revert-3YF2IL5G.js +240 -0
- package/dist/cli/roadmap-7OOQLXKG.js +61 -0
- package/dist/cli/run-2U5NZV5Z.js +211 -0
- package/dist/cli/safestop-VR4VK56D.js +88 -0
- package/dist/cli/saga-SEWPIOX2.js +285 -0
- package/dist/cli/schema-C52WZ35V.js +195 -0
- package/dist/cli/self-update-GQIGUDPS.js +504 -0
- package/dist/cli/selfimprove-3Y5L4ECT.js +88 -0
- package/dist/cli/sentient-M4YMAVGV.js +1088 -0
- package/dist/cli/sequence-6UBMA4IF.js +93 -0
- package/dist/cli/service-5R7SILZ7.js +155 -0
- package/dist/cli/session-3C6AAC4Y.js +707 -0
- package/dist/cli/setup-BTUBW5PU.js +323 -0
- package/dist/cli/show-MXT2V7TF.js +122 -0
- package/dist/cli/skill-GFUZOU2C.js +84 -0
- package/dist/cli/skills-EDWLKAF3.js +928 -0
- package/dist/cli/smoke-provider-SKUFMZXU.js +218 -0
- package/dist/cli/snapshot-GUWMURCM.js +119 -0
- package/dist/cli/src-66GAKPXR.js +80 -0
- package/dist/cli/start-QFG56RGN.js +67 -0
- package/dist/cli/stats-GW55P7RR.js +95 -0
- package/dist/cli/status-46HTKNRR.js +157 -0
- package/dist/cli/sticky-2DUZOUGI.js +338 -0
- package/dist/cli/stop-J2QEUKHX.js +42 -0
- package/dist/cli/sync-GJP2QYT5.js +154 -0
- package/dist/cli/tasks-BNXTM7PB.js +174 -0
- package/dist/cli/telemetry-55Z2XJWL.js +120 -0
- package/dist/cli/templates-7O77TKPV.js +611 -0
- package/dist/cli/testing-37YTBNKP.js +146 -0
- package/dist/cli/token-UAVJMNUI.js +220 -0
- package/dist/cli/transcript-LORQTV5Z.js +440 -0
- package/dist/cli/tui-BPUFHYKK.js +51 -0
- package/dist/cli/update-NVCYV2FT.js +476 -0
- package/dist/cli/upgrade-OXJXOGEF.js +243 -0
- package/dist/cli/verify-LYLDHPT2.js +190 -0
- package/dist/cli/web-QP2RP266.js +275 -0
- package/dist/cli/workgraph-FXBSZDQE.js +232 -0
- package/dist/cli/worktree-6RXAJIST.js +370 -0
- package/package.json +13 -13
- package/studio-dist/client/_app/immutable/chunks/{Buaay_Q8.js → Btgeq_wq.js} +1 -1
- package/studio-dist/client/_app/immutable/chunks/{BJp57kf2.js → CgBjxmu6.js} +1 -1
- package/studio-dist/client/_app/immutable/chunks/{CLP4JZvZ.js → DgEKqO6r.js} +1 -1
- package/studio-dist/client/_app/immutable/chunks/t81h7afa.js +1 -0
- package/studio-dist/client/_app/immutable/entry/{app.CczVILch.js → app.a02HWaRB.js} +2 -2
- package/studio-dist/client/_app/immutable/entry/start.BreMSngo.js +1 -0
- package/studio-dist/client/_app/immutable/nodes/{0.Zy2IsLEl.js → 0.nTXyRfc-.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{1.DJN1QI3l.js → 1.4zrWeHtl.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{15.B4rwqbHV.js → 15.D9mk4JyY.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{16.jn-5BG_L.js → 16._-wt-sQf.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{17.DnWGC4t9.js → 17.CUu6LQDj.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{18.0zddLZOY.js → 18.Dz4QRTkX.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{20.DEKHq9Tc.js → 20.CJ2_EB0U.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{24.CQB9KP-p.js → 24.Igj2FS7k.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{25.BaqToZD-.js → 25.BnATjVGN.js} +2 -2
- package/studio-dist/client/_app/immutable/nodes/{26.BiE1i4iE.js → 26.6iPyjT44.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{3.BObAOu_-.js → 3.AA5GwNgP.js} +1 -1
- package/studio-dist/client/_app/version.json +1 -1
- package/studio-dist/server/chunks/{0-BmUoS2yd.js → 0-DGmsoBYm.js} +3 -3
- package/studio-dist/server/chunks/1-8PfxPvlK.js +9 -0
- package/studio-dist/server/chunks/{15-Dt4kqUxW.js → 15-Bg6YTndh.js} +3 -3
- package/studio-dist/server/chunks/{16-kgTLJvbO.js → 16-BObLwgyD.js} +3 -3
- package/studio-dist/server/chunks/{17-mRYB5141.js → 17-BNXGyAHX.js} +3 -3
- package/studio-dist/server/chunks/{18-BjZ325q5.js → 18-UqQFRIID.js} +3 -3
- package/studio-dist/server/chunks/{20-DQ2Vrujq.js → 20-CMn8a_yP.js} +3 -3
- package/studio-dist/server/chunks/{24-DAeuAfXN.js → 24-BuOTDzib.js} +3 -3
- package/studio-dist/server/chunks/{25-DGCNmzAS.js → 25-CIMSmjVx.js} +4 -4
- package/studio-dist/server/chunks/{26-CiN6bbmR.js → 26-DWGObn2T.js} +3 -3
- package/studio-dist/server/chunks/{3-BS2FXYjP.js → 3-CyiffdJZ.js} +3 -3
- package/studio-dist/server/chunks/{_layout.svelte-DJ_UWmGp.js → _layout.svelte-DYtClaIk.js} +4 -4
- package/studio-dist/server/chunks/{_page.svelte-WR6jUiQE.js → _page.svelte-1h9E6s_f.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-BUq8_eQH.js → _page.svelte-BNNF62Nm.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-CRnYa4cW.js → _page.svelte-BT1EUadj.js} +5 -5
- package/studio-dist/server/chunks/{_page.svelte-Dk0znswQ.js → _page.svelte-Bip079LT.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-CcP_KW3Y.js → _page.svelte-CEATWp_5.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-Ca7x-ZvH.js → _page.svelte-CV3xiD1y.js} +4 -4
- package/studio-dist/server/chunks/{_page.svelte-Cfv9tDBA.js → _page.svelte-Cv_KVJDV.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-J4HjPhfO.js → _page.svelte-DSSy6LuK.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-D8dLEr7O.js → _page.svelte-TF795TAS.js} +3 -3
- package/studio-dist/server/chunks/{_server.ts-Bih2-_5O.js → _server.ts-BlhRFLY3.js} +2 -2
- package/studio-dist/server/chunks/{_server.ts-Cr57EKWf.js → _server.ts-C4w6UdU0.js} +3 -3
- package/studio-dist/server/chunks/{_server.ts-P4wVVksg.js → _server.ts-CzrwbhkQ.js} +3 -3
- package/studio-dist/server/chunks/{_server.ts-2BazvYRP.js → _server.ts-DWt8Dziu.js} +3 -3
- package/studio-dist/server/chunks/{_server.ts-C0evMKCk.js → _server.ts-Db6mEile.js} +3 -3
- package/studio-dist/server/chunks/{client-Cl295FWH.js → client-D8f2k-H_.js} +2 -2
- package/studio-dist/server/chunks/{dist-CdoCt9zT.js → dist-B8xbIrdB.js} +3 -1
- package/studio-dist/server/chunks/{error.svelte-ajn1HNOb.js → error.svelte-DbbOwIme.js} +3 -3
- package/studio-dist/server/chunks/{http-BiQjEmVU.js → http-1ftNGTs5.js} +2 -2
- package/studio-dist/server/chunks/{internal-D9MtKHIF.js → internal-CTULuLPB.js} +2 -2
- package/studio-dist/server/chunks/{stores-BlknvZ80.js → stores-CS5XOReX.js} +2 -2
- package/studio-dist/server/index.js +1 -1
- package/studio-dist/server/manifest.js +17 -17
- package/studio-dist/client/_app/immutable/chunks/C3l-lTkq.js +0 -1
- package/studio-dist/client/_app/immutable/entry/start.D7gHmBNS.js +0 -1
- package/studio-dist/server/chunks/1-CTjj2MYz.js +0 -9
|
@@ -0,0 +1,1956 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
const _installed = Symbol.for('cleocode.cli.sqliteWarningFilter');
|
|
3
|
+
if (globalThis[_installed]) return;
|
|
4
|
+
globalThis[_installed] = true;
|
|
5
|
+
const _origEmitWarning = process.emitWarning;
|
|
6
|
+
process.emitWarning = function(warning, type, code, ctor) {
|
|
7
|
+
if (typeof warning === 'object' && warning.name === 'ExperimentalWarning' && typeof warning.message === 'string' && /SQLite is an experimental feature/i.test(warning.message)) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (typeof warning === 'string' && /SQLite is an experimental feature/i.test(warning)) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
return _origEmitWarning.call(process, warning, type, code, ctor);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import {
|
|
17
|
+
defineCommand,
|
|
18
|
+
showUsage
|
|
19
|
+
} from "./chunk-PKKZPOOP.js";
|
|
20
|
+
import {
|
|
21
|
+
dispatchFromCli,
|
|
22
|
+
dispatchRaw,
|
|
23
|
+
handleRawError
|
|
24
|
+
} from "./chunk-3IOQVUO7.js";
|
|
25
|
+
import "./chunk-AWCQH2W5.js";
|
|
26
|
+
import {
|
|
27
|
+
CLEO_DIR_NAME,
|
|
28
|
+
MIGRATE_MEMORY_HASHES_JSON
|
|
29
|
+
} from "./chunk-OGV57L4J.js";
|
|
30
|
+
import "./chunk-ZBISIPCK.js";
|
|
31
|
+
import {
|
|
32
|
+
cliError,
|
|
33
|
+
cliOutput
|
|
34
|
+
} from "./chunk-3ZO3M37V.js";
|
|
35
|
+
import "./chunk-6JSJNYH2.js";
|
|
36
|
+
import "./chunk-QFFQSKRC.js";
|
|
37
|
+
|
|
38
|
+
// packages/cleo/src/cli/commands/memory.ts
|
|
39
|
+
import { getProjectRoot } from "@cleocode/core";
|
|
40
|
+
import {
|
|
41
|
+
getBrainDb,
|
|
42
|
+
getDreamStatus,
|
|
43
|
+
getTierStats,
|
|
44
|
+
runConsolidation,
|
|
45
|
+
scanDuplicateEntries,
|
|
46
|
+
setEntryTier,
|
|
47
|
+
triggerManualDream
|
|
48
|
+
} from "@cleocode/core/memory";
|
|
49
|
+
import { importMemoryFiles } from "@cleocode/core/memory/import-from-provider.js";
|
|
50
|
+
import { streamMemoryWatchEvents } from "@cleocode/core/memory/watch-stream.js";
|
|
51
|
+
var storeCommand = defineCommand({
|
|
52
|
+
meta: { name: "store", description: "Store a pattern or learning to BRAIN memory" },
|
|
53
|
+
args: {
|
|
54
|
+
type: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "Memory type: pattern or learning",
|
|
57
|
+
required: true
|
|
58
|
+
},
|
|
59
|
+
content: {
|
|
60
|
+
type: "string",
|
|
61
|
+
description: "Content of the memory entry",
|
|
62
|
+
required: true
|
|
63
|
+
},
|
|
64
|
+
context: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "Context in which the pattern/learning was observed"
|
|
67
|
+
},
|
|
68
|
+
source: {
|
|
69
|
+
type: "string",
|
|
70
|
+
description: "Source of the learning"
|
|
71
|
+
},
|
|
72
|
+
"pattern-type": {
|
|
73
|
+
type: "string",
|
|
74
|
+
description: "Pattern type: workflow, blocker, success, failure, optimization"
|
|
75
|
+
},
|
|
76
|
+
impact: {
|
|
77
|
+
type: "string",
|
|
78
|
+
description: "Impact level: low, medium, high"
|
|
79
|
+
},
|
|
80
|
+
confidence: {
|
|
81
|
+
type: "string",
|
|
82
|
+
description: "Confidence score 0.0-1.0 (for learnings)"
|
|
83
|
+
},
|
|
84
|
+
actionable: {
|
|
85
|
+
type: "boolean",
|
|
86
|
+
description: "Mark learning as actionable"
|
|
87
|
+
},
|
|
88
|
+
"linked-task": {
|
|
89
|
+
type: "string",
|
|
90
|
+
description: "Task ID to link this memory to"
|
|
91
|
+
},
|
|
92
|
+
json: {
|
|
93
|
+
type: "boolean",
|
|
94
|
+
description: "Output as JSON"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
async run({ args }) {
|
|
98
|
+
const memType = args.type;
|
|
99
|
+
if (memType === "pattern") {
|
|
100
|
+
await dispatchFromCli(
|
|
101
|
+
"mutate",
|
|
102
|
+
"memory",
|
|
103
|
+
"pattern.store",
|
|
104
|
+
{
|
|
105
|
+
type: args["pattern-type"] || "workflow",
|
|
106
|
+
pattern: args.content,
|
|
107
|
+
context: args.context || "Unspecified context",
|
|
108
|
+
impact: args.impact,
|
|
109
|
+
examples: args["linked-task"] ? [args["linked-task"]] : []
|
|
110
|
+
},
|
|
111
|
+
{ command: "memory", operation: "memory.pattern.store" }
|
|
112
|
+
);
|
|
113
|
+
} else if (memType === "learning") {
|
|
114
|
+
await dispatchFromCli(
|
|
115
|
+
"mutate",
|
|
116
|
+
"memory",
|
|
117
|
+
"learning.store",
|
|
118
|
+
{
|
|
119
|
+
insight: args.content,
|
|
120
|
+
source: args.source || "manual",
|
|
121
|
+
confidence: args.confidence !== void 0 ? parseFloat(args.confidence) : 0.5,
|
|
122
|
+
actionable: !!args.actionable,
|
|
123
|
+
applicableTypes: args["linked-task"] ? [args["linked-task"]] : []
|
|
124
|
+
},
|
|
125
|
+
{ command: "memory", operation: "memory.learning.store" }
|
|
126
|
+
);
|
|
127
|
+
} else {
|
|
128
|
+
cliError(`Unknown memory type: ${memType}. Use 'pattern' or 'learning'.`, "E_VALIDATION", {
|
|
129
|
+
name: "E_VALIDATION"
|
|
130
|
+
});
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
var findCommand = defineCommand({
|
|
136
|
+
meta: {
|
|
137
|
+
name: "find",
|
|
138
|
+
description: "Search BRAIN memory (all tables, or filter by --type decision|pattern|learning|observation)"
|
|
139
|
+
},
|
|
140
|
+
args: {
|
|
141
|
+
query: {
|
|
142
|
+
type: "positional",
|
|
143
|
+
description: "Search query",
|
|
144
|
+
required: true
|
|
145
|
+
},
|
|
146
|
+
type: {
|
|
147
|
+
type: "string",
|
|
148
|
+
description: "Filter by memory type: decision, pattern, learning, or observation (default: all)"
|
|
149
|
+
},
|
|
150
|
+
history: {
|
|
151
|
+
type: "boolean",
|
|
152
|
+
description: "Include superseded and invalidated memory as historical evidence"
|
|
153
|
+
},
|
|
154
|
+
"pattern-type": {
|
|
155
|
+
type: "string",
|
|
156
|
+
description: "Filter patterns by type: workflow, blocker, success, failure, optimization"
|
|
157
|
+
},
|
|
158
|
+
"min-confidence": {
|
|
159
|
+
type: "string",
|
|
160
|
+
description: "Minimum confidence for learnings"
|
|
161
|
+
},
|
|
162
|
+
actionable: {
|
|
163
|
+
type: "boolean",
|
|
164
|
+
description: "Only show actionable learnings"
|
|
165
|
+
},
|
|
166
|
+
limit: {
|
|
167
|
+
type: "string",
|
|
168
|
+
description: "Maximum results"
|
|
169
|
+
},
|
|
170
|
+
// T418: agent filter for per-agent mental model retrieval
|
|
171
|
+
agent: {
|
|
172
|
+
type: "string",
|
|
173
|
+
description: "Filter observations by agent provenance name (Wave 8 mental models)"
|
|
174
|
+
},
|
|
175
|
+
json: {
|
|
176
|
+
type: "boolean",
|
|
177
|
+
description: "Output as JSON"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
async run({ args }) {
|
|
181
|
+
const query = args.query;
|
|
182
|
+
const memType = args.type;
|
|
183
|
+
if (memType !== void 0 && !["decision", "pattern", "learning", "observation"].includes(memType)) {
|
|
184
|
+
cliError(
|
|
185
|
+
`Unknown memory type: ${memType}. Use decision, pattern, learning, or observation.`,
|
|
186
|
+
"E_VALIDATION",
|
|
187
|
+
{ name: "E_VALIDATION" }
|
|
188
|
+
);
|
|
189
|
+
process.exitCode = 1;
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (args.agent !== void 0 && memType !== void 0 && memType !== "observation") {
|
|
193
|
+
cliError("--agent can only be combined with --type observation.", "E_VALIDATION", {
|
|
194
|
+
name: "E_VALIDATION"
|
|
195
|
+
});
|
|
196
|
+
process.exitCode = 1;
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (memType === "pattern" && !args.history) {
|
|
200
|
+
await dispatchFromCli(
|
|
201
|
+
"query",
|
|
202
|
+
"memory",
|
|
203
|
+
"pattern.find",
|
|
204
|
+
{
|
|
205
|
+
query,
|
|
206
|
+
type: args["pattern-type"],
|
|
207
|
+
limit: args.limit !== void 0 ? parseInt(args.limit, 10) : void 0
|
|
208
|
+
},
|
|
209
|
+
{ command: "memory", operation: "memory.find" }
|
|
210
|
+
);
|
|
211
|
+
} else if (memType === "learning" && !args.history) {
|
|
212
|
+
await dispatchFromCli(
|
|
213
|
+
"query",
|
|
214
|
+
"memory",
|
|
215
|
+
"learning.find",
|
|
216
|
+
{
|
|
217
|
+
query,
|
|
218
|
+
minConfidence: args["min-confidence"] !== void 0 ? parseFloat(args["min-confidence"]) : void 0,
|
|
219
|
+
actionableOnly: !!args.actionable,
|
|
220
|
+
limit: args.limit !== void 0 ? parseInt(args.limit, 10) : void 0
|
|
221
|
+
},
|
|
222
|
+
{ command: "memory", operation: "memory.find" }
|
|
223
|
+
);
|
|
224
|
+
} else {
|
|
225
|
+
await dispatchFromCli(
|
|
226
|
+
"query",
|
|
227
|
+
"memory",
|
|
228
|
+
"find",
|
|
229
|
+
{
|
|
230
|
+
query,
|
|
231
|
+
limit: args.limit !== void 0 ? parseInt(args.limit, 10) : void 0,
|
|
232
|
+
includeHistory: args.history,
|
|
233
|
+
...memType === "pattern" && { tables: ["patterns"] },
|
|
234
|
+
...memType === "learning" && { tables: ["learnings"] },
|
|
235
|
+
...memType === "decision" && { tables: ["decisions"] },
|
|
236
|
+
...memType === "observation" && { tables: ["observations"] },
|
|
237
|
+
// T418: forward agent filter when provided
|
|
238
|
+
...args.agent !== void 0 && { agent: args.agent }
|
|
239
|
+
},
|
|
240
|
+
{ command: "memory", operation: "memory.find" }
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
var statsCommand = defineCommand({
|
|
246
|
+
meta: { name: "stats", description: "Show BRAIN memory statistics" },
|
|
247
|
+
async run() {
|
|
248
|
+
const pResponse = await dispatchRaw("query", "memory", "pattern.find", {
|
|
249
|
+
query: "",
|
|
250
|
+
limit: 0
|
|
251
|
+
});
|
|
252
|
+
const lResponse = await dispatchRaw("query", "memory", "learning.find", {
|
|
253
|
+
query: "",
|
|
254
|
+
limit: 0
|
|
255
|
+
});
|
|
256
|
+
const result = {};
|
|
257
|
+
if (pResponse.success) result["patterns"] = pResponse.data;
|
|
258
|
+
if (lResponse.success) result["learnings"] = lResponse.data;
|
|
259
|
+
if (!pResponse.success && !lResponse.success) {
|
|
260
|
+
handleRawError(pResponse, { command: "memory-stats", operation: "memory.stats" });
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
cliOutput(result, { command: "memory-stats", operation: "memory.stats" });
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
var observeCommand = defineCommand({
|
|
267
|
+
meta: {
|
|
268
|
+
name: "observe",
|
|
269
|
+
description: "Save an observation to brain.db \u2014 captures facts, decisions, and discoveries for cross-session memory"
|
|
270
|
+
},
|
|
271
|
+
args: {
|
|
272
|
+
text: {
|
|
273
|
+
type: "positional",
|
|
274
|
+
description: "Observation text",
|
|
275
|
+
required: true
|
|
276
|
+
},
|
|
277
|
+
title: {
|
|
278
|
+
type: "string",
|
|
279
|
+
description: "Short title for the observation (defaults to first 120 chars of text)"
|
|
280
|
+
},
|
|
281
|
+
type: {
|
|
282
|
+
type: "string",
|
|
283
|
+
description: "Category: discovery (found something new), decision (choice made), bugfix (bug found/fixed), refactor (code restructured), feature (feature added), change (general change), diary (journal entry), session-summary (end-of-session recap auto-created by cleo session end)"
|
|
284
|
+
},
|
|
285
|
+
agent: {
|
|
286
|
+
type: "string",
|
|
287
|
+
description: "Name of the agent producing this observation (enables per-agent memory retrieval)"
|
|
288
|
+
},
|
|
289
|
+
"source-type": {
|
|
290
|
+
type: "string",
|
|
291
|
+
description: "How this observation was captured: manual (typed by human/agent), auto (lifecycle hook), transcript (extracted from session)"
|
|
292
|
+
},
|
|
293
|
+
attach: {
|
|
294
|
+
type: "string",
|
|
295
|
+
description: "SHA-256 of an attachment to link to this observation (comma-separated for multiple)"
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
async run({ args }) {
|
|
299
|
+
await dispatchFromCli(
|
|
300
|
+
"mutate",
|
|
301
|
+
"memory",
|
|
302
|
+
"observe",
|
|
303
|
+
{
|
|
304
|
+
text: args.text,
|
|
305
|
+
title: args.title,
|
|
306
|
+
...args.agent !== void 0 && { agent: args.agent },
|
|
307
|
+
...args.type !== void 0 && { type: args.type },
|
|
308
|
+
sourceType: args["source-type"] ?? "manual",
|
|
309
|
+
// T799: pass attachment refs
|
|
310
|
+
...args.attach !== void 0 && { attach: args.attach }
|
|
311
|
+
},
|
|
312
|
+
{ command: "memory", operation: "memory.observe" }
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
var timelineCommand = defineCommand({
|
|
317
|
+
meta: {
|
|
318
|
+
name: "timeline",
|
|
319
|
+
description: "Show chronological context around an anchor observation ID"
|
|
320
|
+
},
|
|
321
|
+
args: {
|
|
322
|
+
// Output format is controlled by the global --json/--human flags (format-context).
|
|
323
|
+
anchor: {
|
|
324
|
+
type: "positional",
|
|
325
|
+
description: "Anchor observation ID",
|
|
326
|
+
required: true
|
|
327
|
+
},
|
|
328
|
+
before: {
|
|
329
|
+
type: "string",
|
|
330
|
+
description: "Number of entries before anchor"
|
|
331
|
+
},
|
|
332
|
+
after: {
|
|
333
|
+
type: "string",
|
|
334
|
+
description: "Number of entries after anchor"
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
async run({ args }) {
|
|
338
|
+
await dispatchFromCli(
|
|
339
|
+
"query",
|
|
340
|
+
"memory",
|
|
341
|
+
"timeline",
|
|
342
|
+
{
|
|
343
|
+
anchor: args.anchor,
|
|
344
|
+
depthBefore: args.before !== void 0 ? parseInt(args.before, 10) : void 0,
|
|
345
|
+
depthAfter: args.after !== void 0 ? parseInt(args.after, 10) : void 0
|
|
346
|
+
},
|
|
347
|
+
{ command: "memory-timeline", operation: "memory.timeline" }
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
var fetchCommand = defineCommand({
|
|
352
|
+
meta: { name: "fetch", description: "Fetch full details for specific observation IDs" },
|
|
353
|
+
args: {
|
|
354
|
+
// Note: citty doesn't support variadic positional args, so we accept a single
|
|
355
|
+
// positional and split on commas/spaces to support: `cleo memory fetch ID1,ID2`
|
|
356
|
+
// Output format is controlled by the global --json/--human flags (format-context).
|
|
357
|
+
ids: {
|
|
358
|
+
type: "positional",
|
|
359
|
+
description: "Comma- or space-separated observation IDs",
|
|
360
|
+
required: true
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
async run({ args }) {
|
|
364
|
+
const ids = args.ids.split(/[,\s]+/).map((s) => s.trim()).filter(Boolean);
|
|
365
|
+
await dispatchFromCli(
|
|
366
|
+
"query",
|
|
367
|
+
"memory",
|
|
368
|
+
"fetch",
|
|
369
|
+
{ ids },
|
|
370
|
+
{ command: "memory-fetch", operation: "memory.fetch" }
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
var decisionFindCommand = defineCommand({
|
|
375
|
+
meta: {
|
|
376
|
+
name: "decision-find",
|
|
377
|
+
description: "Search architectural decisions (use BEFORE grep or ledger files)"
|
|
378
|
+
},
|
|
379
|
+
args: {
|
|
380
|
+
query: {
|
|
381
|
+
type: "positional",
|
|
382
|
+
description: "Search query",
|
|
383
|
+
required: false
|
|
384
|
+
},
|
|
385
|
+
limit: {
|
|
386
|
+
type: "string",
|
|
387
|
+
description: "Maximum results"
|
|
388
|
+
},
|
|
389
|
+
"include-agent-dispatch": {
|
|
390
|
+
type: "boolean",
|
|
391
|
+
description: "Include AGT-* agent dispatch rows (excluded by default \u2014 use to surface execution history)"
|
|
392
|
+
},
|
|
393
|
+
json: {
|
|
394
|
+
type: "boolean",
|
|
395
|
+
description: "Output as JSON"
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
async run({ args }) {
|
|
399
|
+
await dispatchFromCli(
|
|
400
|
+
"query",
|
|
401
|
+
"memory",
|
|
402
|
+
"decision.find",
|
|
403
|
+
{
|
|
404
|
+
query: args.query ?? "",
|
|
405
|
+
limit: args.limit !== void 0 ? parseInt(args.limit, 10) : void 0,
|
|
406
|
+
// T1830: pass flag so the engine can filter by decision_category
|
|
407
|
+
includeAgentDispatch: args["include-agent-dispatch"] === true
|
|
408
|
+
},
|
|
409
|
+
{ command: "memory", operation: "memory.decision.find" }
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
var decisionStoreCommand = defineCommand({
|
|
414
|
+
meta: {
|
|
415
|
+
name: "decision-store",
|
|
416
|
+
description: "Store an architectural decision \u2014 supports --linked-task, --confirmation-state, --supersedes, --superseded-by, --decided-by"
|
|
417
|
+
},
|
|
418
|
+
args: {
|
|
419
|
+
decision: {
|
|
420
|
+
type: "string",
|
|
421
|
+
description: "The decision that was made",
|
|
422
|
+
required: true
|
|
423
|
+
},
|
|
424
|
+
rationale: {
|
|
425
|
+
type: "string",
|
|
426
|
+
description: "Rationale behind the decision",
|
|
427
|
+
required: true
|
|
428
|
+
},
|
|
429
|
+
alternatives: {
|
|
430
|
+
type: "string",
|
|
431
|
+
description: "Alternatives that were considered"
|
|
432
|
+
},
|
|
433
|
+
"linked-task": {
|
|
434
|
+
type: "string",
|
|
435
|
+
description: "Task ID to associate with this decision"
|
|
436
|
+
},
|
|
437
|
+
"adr-path": {
|
|
438
|
+
type: "string",
|
|
439
|
+
description: "Path to the ADR document on disk (e.g. docs/adr/ADR-027.md)"
|
|
440
|
+
},
|
|
441
|
+
supersedes: {
|
|
442
|
+
type: "string",
|
|
443
|
+
description: "Decision ID that this decision supersedes (e.g. D001)"
|
|
444
|
+
},
|
|
445
|
+
"superseded-by": {
|
|
446
|
+
type: "string",
|
|
447
|
+
description: "Decision ID that has superseded this decision (e.g. D002)"
|
|
448
|
+
},
|
|
449
|
+
"confirmation-state": {
|
|
450
|
+
type: "string",
|
|
451
|
+
description: "Lifecycle state: proposed | accepted | superseded (default: proposed)"
|
|
452
|
+
},
|
|
453
|
+
"decided-by": {
|
|
454
|
+
type: "string",
|
|
455
|
+
description: "Who originated this decision: owner | council | agent (default: agent)"
|
|
456
|
+
},
|
|
457
|
+
json: {
|
|
458
|
+
type: "boolean",
|
|
459
|
+
description: "Output as JSON"
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
async run({ args }) {
|
|
463
|
+
await dispatchFromCli(
|
|
464
|
+
"mutate",
|
|
465
|
+
"memory",
|
|
466
|
+
"decision.store",
|
|
467
|
+
{
|
|
468
|
+
decision: args.decision,
|
|
469
|
+
rationale: args.rationale,
|
|
470
|
+
...args.alternatives !== void 0 && { alternatives: args.alternatives },
|
|
471
|
+
...args["linked-task"] !== void 0 && { taskId: args["linked-task"] },
|
|
472
|
+
...args["adr-path"] !== void 0 && { adrPath: args["adr-path"] },
|
|
473
|
+
...args.supersedes !== void 0 && { supersedes: args.supersedes },
|
|
474
|
+
...args["superseded-by"] !== void 0 && { supersededBy: args["superseded-by"] },
|
|
475
|
+
...args["confirmation-state"] !== void 0 && {
|
|
476
|
+
confirmationState: args["confirmation-state"]
|
|
477
|
+
},
|
|
478
|
+
...args["decided-by"] !== void 0 && { decidedBy: args["decided-by"] }
|
|
479
|
+
},
|
|
480
|
+
{ command: "memory", operation: "memory.decision.store" }
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
var linkCommand = defineCommand({
|
|
485
|
+
meta: {
|
|
486
|
+
name: "link",
|
|
487
|
+
description: "Connect a BRAIN decision/observation to a task (example: cleo memory link T10520 D012)"
|
|
488
|
+
},
|
|
489
|
+
args: {
|
|
490
|
+
taskId: {
|
|
491
|
+
type: "positional",
|
|
492
|
+
description: "Task ID",
|
|
493
|
+
required: true
|
|
494
|
+
},
|
|
495
|
+
entryId: {
|
|
496
|
+
type: "positional",
|
|
497
|
+
description: "Brain entry ID",
|
|
498
|
+
required: true
|
|
499
|
+
},
|
|
500
|
+
json: {
|
|
501
|
+
type: "boolean",
|
|
502
|
+
description: "Output as JSON"
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
async run({ args }) {
|
|
506
|
+
await dispatchFromCli(
|
|
507
|
+
"mutate",
|
|
508
|
+
"memory",
|
|
509
|
+
"link",
|
|
510
|
+
{ taskId: args.taskId, entryId: args.entryId },
|
|
511
|
+
{ command: "memory", operation: "memory.link" }
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
var traceCommand = defineCommand({
|
|
516
|
+
meta: {
|
|
517
|
+
name: "trace",
|
|
518
|
+
description: "BFS traversal of the brain knowledge graph from a seed node"
|
|
519
|
+
},
|
|
520
|
+
args: {
|
|
521
|
+
nodeId: {
|
|
522
|
+
type: "positional",
|
|
523
|
+
description: "Seed node ID",
|
|
524
|
+
required: true
|
|
525
|
+
},
|
|
526
|
+
depth: {
|
|
527
|
+
type: "string",
|
|
528
|
+
description: "Maximum traversal depth (default: 3)"
|
|
529
|
+
},
|
|
530
|
+
json: {
|
|
531
|
+
type: "boolean",
|
|
532
|
+
description: "Output as JSON"
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
async run({ args }) {
|
|
536
|
+
await dispatchFromCli(
|
|
537
|
+
"query",
|
|
538
|
+
"memory",
|
|
539
|
+
"graph.trace",
|
|
540
|
+
{
|
|
541
|
+
nodeId: args.nodeId,
|
|
542
|
+
...args.depth !== void 0 && { maxDepth: parseInt(args.depth, 10) }
|
|
543
|
+
},
|
|
544
|
+
{ command: "memory-trace", operation: "memory.graph.trace" }
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
var relatedCommand = defineCommand({
|
|
549
|
+
meta: {
|
|
550
|
+
name: "related",
|
|
551
|
+
description: "Return immediate (1-hop) neighbours of a brain graph node"
|
|
552
|
+
},
|
|
553
|
+
args: {
|
|
554
|
+
nodeId: {
|
|
555
|
+
type: "positional",
|
|
556
|
+
description: "Node ID",
|
|
557
|
+
required: true
|
|
558
|
+
},
|
|
559
|
+
type: {
|
|
560
|
+
type: "string",
|
|
561
|
+
description: "Filter by edge type (e.g. applies_to, supports, derived_from)"
|
|
562
|
+
},
|
|
563
|
+
json: {
|
|
564
|
+
type: "boolean",
|
|
565
|
+
description: "Output as JSON"
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
async run({ args }) {
|
|
569
|
+
await dispatchFromCli(
|
|
570
|
+
"query",
|
|
571
|
+
"memory",
|
|
572
|
+
"graph.related",
|
|
573
|
+
{
|
|
574
|
+
nodeId: args.nodeId,
|
|
575
|
+
...args.type !== void 0 && { edgeType: args.type }
|
|
576
|
+
},
|
|
577
|
+
{ command: "memory-related", operation: "memory.graph.related" }
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
var contextCommand = defineCommand({
|
|
582
|
+
meta: {
|
|
583
|
+
name: "context",
|
|
584
|
+
description: "360-degree context view of a brain graph node: node + all edges + neighbours"
|
|
585
|
+
},
|
|
586
|
+
args: {
|
|
587
|
+
nodeId: {
|
|
588
|
+
type: "positional",
|
|
589
|
+
description: "Node ID",
|
|
590
|
+
required: true
|
|
591
|
+
},
|
|
592
|
+
json: {
|
|
593
|
+
type: "boolean",
|
|
594
|
+
description: "Output as JSON"
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
|
+
async run({ args }) {
|
|
598
|
+
await dispatchFromCli(
|
|
599
|
+
"query",
|
|
600
|
+
"memory",
|
|
601
|
+
"graph.context",
|
|
602
|
+
{ nodeId: args.nodeId },
|
|
603
|
+
{ command: "memory-context", operation: "memory.graph.context" }
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
var graphStatsCommand = defineCommand({
|
|
608
|
+
meta: {
|
|
609
|
+
name: "graph-stats",
|
|
610
|
+
description: "Show brain knowledge graph statistics: node and edge counts by type"
|
|
611
|
+
},
|
|
612
|
+
args: {
|
|
613
|
+
json: {
|
|
614
|
+
type: "boolean",
|
|
615
|
+
description: "Output as JSON"
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
async run() {
|
|
619
|
+
await dispatchFromCli(
|
|
620
|
+
"query",
|
|
621
|
+
"memory",
|
|
622
|
+
"graph.stats",
|
|
623
|
+
{},
|
|
624
|
+
{ command: "memory-graph-stats", operation: "memory.graph.stats" }
|
|
625
|
+
);
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
var graphShowCommand = defineCommand({
|
|
629
|
+
meta: { name: "graph-show", description: "Get a PageIndex graph node and its edges" },
|
|
630
|
+
args: {
|
|
631
|
+
nodeId: {
|
|
632
|
+
type: "positional",
|
|
633
|
+
description: "Node ID",
|
|
634
|
+
required: true
|
|
635
|
+
},
|
|
636
|
+
json: {
|
|
637
|
+
type: "boolean",
|
|
638
|
+
description: "Output as JSON"
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
async run({ args }) {
|
|
642
|
+
await dispatchFromCli(
|
|
643
|
+
"query",
|
|
644
|
+
"memory",
|
|
645
|
+
"graph.show",
|
|
646
|
+
{ nodeId: args.nodeId },
|
|
647
|
+
{ command: "memory", operation: "memory.graph.show" }
|
|
648
|
+
);
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
var graphNeighborsCommand = defineCommand({
|
|
652
|
+
meta: {
|
|
653
|
+
name: "graph-neighbors",
|
|
654
|
+
description: "Get neighbor nodes from the PageIndex graph"
|
|
655
|
+
},
|
|
656
|
+
args: {
|
|
657
|
+
nodeId: {
|
|
658
|
+
type: "positional",
|
|
659
|
+
description: "Node ID",
|
|
660
|
+
required: true
|
|
661
|
+
},
|
|
662
|
+
depth: {
|
|
663
|
+
type: "string",
|
|
664
|
+
description: "Traversal depth"
|
|
665
|
+
},
|
|
666
|
+
limit: {
|
|
667
|
+
type: "string",
|
|
668
|
+
description: "Maximum neighbors"
|
|
669
|
+
},
|
|
670
|
+
json: {
|
|
671
|
+
type: "boolean",
|
|
672
|
+
description: "Output as JSON"
|
|
673
|
+
}
|
|
674
|
+
},
|
|
675
|
+
async run({ args }) {
|
|
676
|
+
await dispatchFromCli(
|
|
677
|
+
"query",
|
|
678
|
+
"memory",
|
|
679
|
+
"graph.neighbors",
|
|
680
|
+
{
|
|
681
|
+
nodeId: args.nodeId,
|
|
682
|
+
...args.depth !== void 0 && { depth: parseInt(args.depth, 10) },
|
|
683
|
+
...args.limit !== void 0 && { limit: parseInt(args.limit, 10) }
|
|
684
|
+
},
|
|
685
|
+
{ command: "memory", operation: "memory.graph.neighbors" }
|
|
686
|
+
);
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
var graphAddCommand = defineCommand({
|
|
690
|
+
meta: { name: "graph-add", description: "Add a node or edge to the PageIndex graph" },
|
|
691
|
+
args: {
|
|
692
|
+
"node-id": {
|
|
693
|
+
type: "string",
|
|
694
|
+
description: "Node ID to add"
|
|
695
|
+
},
|
|
696
|
+
"node-type": {
|
|
697
|
+
type: "string",
|
|
698
|
+
description: "Node type (e.g. concept, task, file)"
|
|
699
|
+
},
|
|
700
|
+
label: {
|
|
701
|
+
type: "string",
|
|
702
|
+
description: "Label for the node"
|
|
703
|
+
},
|
|
704
|
+
from: {
|
|
705
|
+
type: "string",
|
|
706
|
+
description: "Source node ID for an edge"
|
|
707
|
+
},
|
|
708
|
+
to: {
|
|
709
|
+
type: "string",
|
|
710
|
+
description: "Target node ID for an edge"
|
|
711
|
+
},
|
|
712
|
+
"edge-type": {
|
|
713
|
+
type: "string",
|
|
714
|
+
description: "Edge relationship type"
|
|
715
|
+
},
|
|
716
|
+
json: {
|
|
717
|
+
type: "boolean",
|
|
718
|
+
description: "Output as JSON"
|
|
719
|
+
}
|
|
720
|
+
},
|
|
721
|
+
async run({ args }) {
|
|
722
|
+
await dispatchFromCli(
|
|
723
|
+
"mutate",
|
|
724
|
+
"memory",
|
|
725
|
+
"graph.add",
|
|
726
|
+
{
|
|
727
|
+
...args["node-id"] !== void 0 && { nodeId: args["node-id"] },
|
|
728
|
+
...args["node-type"] !== void 0 && { nodeType: args["node-type"] },
|
|
729
|
+
...args.label !== void 0 && { label: args.label },
|
|
730
|
+
...args.from !== void 0 && { fromId: args.from },
|
|
731
|
+
...args.to !== void 0 && { toId: args.to },
|
|
732
|
+
...args["edge-type"] !== void 0 && { edgeType: args["edge-type"] }
|
|
733
|
+
},
|
|
734
|
+
{ command: "memory", operation: "memory.graph.add" }
|
|
735
|
+
);
|
|
736
|
+
}
|
|
737
|
+
});
|
|
738
|
+
var graphRemoveCommand = defineCommand({
|
|
739
|
+
meta: { name: "graph-remove", description: "Remove a node or edge from the PageIndex graph" },
|
|
740
|
+
args: {
|
|
741
|
+
"node-id": {
|
|
742
|
+
type: "string",
|
|
743
|
+
description: "Node ID to remove"
|
|
744
|
+
},
|
|
745
|
+
from: {
|
|
746
|
+
type: "string",
|
|
747
|
+
description: "Source node ID of the edge to remove"
|
|
748
|
+
},
|
|
749
|
+
to: {
|
|
750
|
+
type: "string",
|
|
751
|
+
description: "Target node ID of the edge to remove"
|
|
752
|
+
},
|
|
753
|
+
json: {
|
|
754
|
+
type: "boolean",
|
|
755
|
+
description: "Output as JSON"
|
|
756
|
+
}
|
|
757
|
+
},
|
|
758
|
+
async run({ args }) {
|
|
759
|
+
await dispatchFromCli(
|
|
760
|
+
"mutate",
|
|
761
|
+
"memory",
|
|
762
|
+
"graph.remove",
|
|
763
|
+
{
|
|
764
|
+
...args["node-id"] !== void 0 && { nodeId: args["node-id"] },
|
|
765
|
+
...args.from !== void 0 && { fromId: args.from },
|
|
766
|
+
...args.to !== void 0 && { toId: args.to }
|
|
767
|
+
},
|
|
768
|
+
{ command: "memory", operation: "memory.graph.remove" }
|
|
769
|
+
);
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
var reasonWhyCommand = defineCommand({
|
|
773
|
+
meta: { name: "reason-why", description: "Causal trace through task dependency chains" },
|
|
774
|
+
args: {
|
|
775
|
+
taskId: {
|
|
776
|
+
type: "positional",
|
|
777
|
+
description: "Task ID",
|
|
778
|
+
required: true
|
|
779
|
+
},
|
|
780
|
+
depth: {
|
|
781
|
+
type: "string",
|
|
782
|
+
description: "Maximum trace depth"
|
|
783
|
+
},
|
|
784
|
+
json: {
|
|
785
|
+
type: "boolean",
|
|
786
|
+
description: "Output as JSON"
|
|
787
|
+
}
|
|
788
|
+
},
|
|
789
|
+
async run({ args }) {
|
|
790
|
+
await dispatchFromCli(
|
|
791
|
+
"query",
|
|
792
|
+
"memory",
|
|
793
|
+
"reason.why",
|
|
794
|
+
{
|
|
795
|
+
taskId: args.taskId,
|
|
796
|
+
...args.depth !== void 0 && { depth: parseInt(args.depth, 10) }
|
|
797
|
+
},
|
|
798
|
+
{ command: "memory", operation: "memory.reason.why" }
|
|
799
|
+
);
|
|
800
|
+
}
|
|
801
|
+
});
|
|
802
|
+
var reasonSimilarCommand = defineCommand({
|
|
803
|
+
meta: { name: "reason-similar", description: "Find semantically similar brain entries" },
|
|
804
|
+
args: {
|
|
805
|
+
entryId: {
|
|
806
|
+
type: "positional",
|
|
807
|
+
description: "Entry ID",
|
|
808
|
+
required: true
|
|
809
|
+
},
|
|
810
|
+
limit: {
|
|
811
|
+
type: "string",
|
|
812
|
+
description: "Maximum results"
|
|
813
|
+
},
|
|
814
|
+
json: {
|
|
815
|
+
type: "boolean",
|
|
816
|
+
description: "Output as JSON"
|
|
817
|
+
}
|
|
818
|
+
},
|
|
819
|
+
async run({ args }) {
|
|
820
|
+
await dispatchFromCli(
|
|
821
|
+
"query",
|
|
822
|
+
"memory",
|
|
823
|
+
"reason.similar",
|
|
824
|
+
{
|
|
825
|
+
entryId: args.entryId,
|
|
826
|
+
...args.limit !== void 0 && { limit: parseInt(args.limit, 10) }
|
|
827
|
+
},
|
|
828
|
+
{ command: "memory", operation: "memory.reason.similar" }
|
|
829
|
+
);
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
var searchHybridCommand = defineCommand({
|
|
833
|
+
meta: {
|
|
834
|
+
name: "search-hybrid",
|
|
835
|
+
description: "Hybrid search across FTS5, vector, and graph indexes"
|
|
836
|
+
},
|
|
837
|
+
args: {
|
|
838
|
+
query: {
|
|
839
|
+
type: "positional",
|
|
840
|
+
description: "Search query",
|
|
841
|
+
required: true
|
|
842
|
+
},
|
|
843
|
+
limit: {
|
|
844
|
+
type: "string",
|
|
845
|
+
description: "Maximum results"
|
|
846
|
+
},
|
|
847
|
+
json: {
|
|
848
|
+
type: "boolean",
|
|
849
|
+
description: "Output as JSON"
|
|
850
|
+
}
|
|
851
|
+
},
|
|
852
|
+
async run({ args }) {
|
|
853
|
+
await dispatchFromCli(
|
|
854
|
+
"query",
|
|
855
|
+
"memory",
|
|
856
|
+
"search.hybrid",
|
|
857
|
+
{
|
|
858
|
+
query: args.query,
|
|
859
|
+
...args.limit !== void 0 && { limit: parseInt(args.limit, 10) }
|
|
860
|
+
},
|
|
861
|
+
{ command: "memory", operation: "memory.search.hybrid" }
|
|
862
|
+
);
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
var codeLinksCommand = defineCommand({
|
|
866
|
+
meta: {
|
|
867
|
+
name: "code-links",
|
|
868
|
+
description: "Show code \u2194 memory connections (code_reference edges between brain and nexus)"
|
|
869
|
+
},
|
|
870
|
+
args: {
|
|
871
|
+
limit: {
|
|
872
|
+
type: "string",
|
|
873
|
+
description: "Maximum entries to return (default 100)"
|
|
874
|
+
},
|
|
875
|
+
json: {
|
|
876
|
+
type: "boolean",
|
|
877
|
+
description: "Output as JSON"
|
|
878
|
+
}
|
|
879
|
+
},
|
|
880
|
+
async run({ args }) {
|
|
881
|
+
await dispatchFromCli(
|
|
882
|
+
"query",
|
|
883
|
+
"memory",
|
|
884
|
+
"code.links",
|
|
885
|
+
{
|
|
886
|
+
...args.limit !== void 0 && { limit: parseInt(args.limit, 10) }
|
|
887
|
+
},
|
|
888
|
+
{ command: "memory", operation: "memory.code.links" }
|
|
889
|
+
);
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
var codeAutoLinkCommand = defineCommand({
|
|
893
|
+
meta: {
|
|
894
|
+
name: "code-auto-link",
|
|
895
|
+
description: "Scan brain memory nodes for entity references and auto-link to nexus code nodes"
|
|
896
|
+
},
|
|
897
|
+
args: {
|
|
898
|
+
json: {
|
|
899
|
+
type: "boolean",
|
|
900
|
+
description: "Output as JSON"
|
|
901
|
+
}
|
|
902
|
+
},
|
|
903
|
+
async run() {
|
|
904
|
+
await dispatchFromCli(
|
|
905
|
+
"mutate",
|
|
906
|
+
"memory",
|
|
907
|
+
"code.auto-link",
|
|
908
|
+
{},
|
|
909
|
+
{ command: "memory", operation: "memory.code.auto-link" }
|
|
910
|
+
);
|
|
911
|
+
}
|
|
912
|
+
});
|
|
913
|
+
var codeMemoriesForCodeCommand = defineCommand({
|
|
914
|
+
meta: {
|
|
915
|
+
name: "code-memories-for-code",
|
|
916
|
+
description: "Find brain memory nodes that reference a given nexus code symbol"
|
|
917
|
+
},
|
|
918
|
+
args: {
|
|
919
|
+
symbol: {
|
|
920
|
+
type: "positional",
|
|
921
|
+
description: "Code symbol name",
|
|
922
|
+
required: true
|
|
923
|
+
},
|
|
924
|
+
json: {
|
|
925
|
+
type: "boolean",
|
|
926
|
+
description: "Output as JSON"
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
async run({ args }) {
|
|
930
|
+
await dispatchFromCli(
|
|
931
|
+
"query",
|
|
932
|
+
"memory",
|
|
933
|
+
"code.memories-for-code",
|
|
934
|
+
{ symbol: args.symbol },
|
|
935
|
+
{ command: "memory", operation: "memory.code.memories-for-code" }
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
});
|
|
939
|
+
var codeForMemoryCommand = defineCommand({
|
|
940
|
+
meta: {
|
|
941
|
+
name: "code-for-memory",
|
|
942
|
+
description: "Find nexus code nodes referenced by a given brain memory entry"
|
|
943
|
+
},
|
|
944
|
+
args: {
|
|
945
|
+
memoryId: {
|
|
946
|
+
type: "positional",
|
|
947
|
+
description: "Memory entry ID",
|
|
948
|
+
required: true
|
|
949
|
+
},
|
|
950
|
+
json: {
|
|
951
|
+
type: "boolean",
|
|
952
|
+
description: "Output as JSON"
|
|
953
|
+
}
|
|
954
|
+
},
|
|
955
|
+
async run({ args }) {
|
|
956
|
+
await dispatchFromCli(
|
|
957
|
+
"query",
|
|
958
|
+
"memory",
|
|
959
|
+
"code.for-memory",
|
|
960
|
+
{ memoryId: args.memoryId },
|
|
961
|
+
{ command: "memory", operation: "memory.code.for-memory" }
|
|
962
|
+
);
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
var consolidateCommand = defineCommand({
|
|
966
|
+
meta: {
|
|
967
|
+
name: "consolidate",
|
|
968
|
+
description: "Run the full brain consolidation pipeline: dedup, quality recompute, tier promotion, contradiction detection, soft eviction, graph strengthening, summary generation. Equivalent to the session-end sleep-time consolidation but triggered on demand."
|
|
969
|
+
},
|
|
970
|
+
args: {},
|
|
971
|
+
async run() {
|
|
972
|
+
const root = getProjectRoot();
|
|
973
|
+
try {
|
|
974
|
+
const result = await runConsolidation(root);
|
|
975
|
+
cliOutput(result, { command: "memory-consolidate", operation: "memory.consolidate" });
|
|
976
|
+
} catch (err) {
|
|
977
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
978
|
+
cliError(`Memory consolidation failed: ${message}`, "E_INTERNAL", { name: "E_INTERNAL" });
|
|
979
|
+
process.exit(1);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
var dreamCommand = defineCommand({
|
|
984
|
+
meta: {
|
|
985
|
+
name: "dream",
|
|
986
|
+
description: "Manually trigger the full auto-dream cycle: consolidation pipeline including R-STDP reward backfill (Step 9a), STDP plasticity (Step 9b), and homeostatic decay (Step 9c). Equivalent to autonomous nightly consolidation but triggered on demand. Idempotent \u2014 safe to run multiple times. Use --status to check engine liveness without triggering consolidation."
|
|
987
|
+
},
|
|
988
|
+
args: {
|
|
989
|
+
status: {
|
|
990
|
+
type: "boolean",
|
|
991
|
+
description: "Return engine liveness status as JSON instead of triggering a dream cycle. Fields: lastConsolidatedAt, observationsSinceLastConsolidation, idleMinutesSinceLastRetrieval, tickLoopAlive, lastTickAt, dreamInFlight, lastError, isOverdue. Exits with code 1 when isOverdue=true.",
|
|
992
|
+
default: false
|
|
993
|
+
}
|
|
994
|
+
},
|
|
995
|
+
async run({ args }) {
|
|
996
|
+
const root = getProjectRoot();
|
|
997
|
+
if (args.status) {
|
|
998
|
+
try {
|
|
999
|
+
const status = await getDreamStatus(root);
|
|
1000
|
+
cliOutput(status, { command: "memory-dream-status", operation: "memory.dream.status" });
|
|
1001
|
+
if (status.isOverdue) {
|
|
1002
|
+
process.exit(1);
|
|
1003
|
+
}
|
|
1004
|
+
} catch (err) {
|
|
1005
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1006
|
+
cliError(`Dream status check failed: ${message}`, "E_INTERNAL", { name: "E_INTERNAL" });
|
|
1007
|
+
process.exit(1);
|
|
1008
|
+
}
|
|
1009
|
+
return;
|
|
1010
|
+
}
|
|
1011
|
+
try {
|
|
1012
|
+
const result = await triggerManualDream(root);
|
|
1013
|
+
cliOutput(result, { command: "memory-dream", operation: "memory.dream" });
|
|
1014
|
+
} catch (err) {
|
|
1015
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1016
|
+
cliError(`Dream cycle failed: ${message}`, "E_INTERNAL", { name: "E_INTERNAL" });
|
|
1017
|
+
process.exit(1);
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
});
|
|
1021
|
+
var reflectCommand = defineCommand({
|
|
1022
|
+
meta: {
|
|
1023
|
+
name: "reflect",
|
|
1024
|
+
description: "Manually trigger the LLM Observer + Reflector pipeline for the most recent session. Observer compresses session observations; Reflector synthesizes patterns and learnings. Requires ANTHROPIC_API_KEY to be set."
|
|
1025
|
+
},
|
|
1026
|
+
args: {
|
|
1027
|
+
session: {
|
|
1028
|
+
type: "string",
|
|
1029
|
+
description: "Run against a specific session ID (default: most recent session)"
|
|
1030
|
+
}
|
|
1031
|
+
},
|
|
1032
|
+
async run({ args }) {
|
|
1033
|
+
const root = getProjectRoot();
|
|
1034
|
+
try {
|
|
1035
|
+
const { runObserver, runReflector } = await import("@cleocode/core/memory");
|
|
1036
|
+
const observerResult = await runObserver(root, args.session, {
|
|
1037
|
+
thresholdOverride: 1
|
|
1038
|
+
});
|
|
1039
|
+
const reflectorResult = await runReflector(root, args.session);
|
|
1040
|
+
const data = {
|
|
1041
|
+
observer: {
|
|
1042
|
+
ran: observerResult.ran,
|
|
1043
|
+
stored: observerResult.stored,
|
|
1044
|
+
compressedIds: observerResult.compressedIds
|
|
1045
|
+
},
|
|
1046
|
+
reflector: {
|
|
1047
|
+
ran: reflectorResult.ran,
|
|
1048
|
+
patternsStored: reflectorResult.patternsStored,
|
|
1049
|
+
learningsStored: reflectorResult.learningsStored,
|
|
1050
|
+
supersededIds: reflectorResult.supersededIds
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
cliOutput(data, { command: "memory-reflect", operation: "memory.reflect" });
|
|
1054
|
+
} catch (err) {
|
|
1055
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1056
|
+
cliError(`Reflect failed: ${message}`, "E_INTERNAL", { name: "E_INTERNAL" });
|
|
1057
|
+
process.exit(1);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
});
|
|
1061
|
+
var pruneStubsCommand = defineCommand({
|
|
1062
|
+
meta: {
|
|
1063
|
+
name: "prune-stubs",
|
|
1064
|
+
description: 'Report (and with --apply, quarantine) content-free BRAIN observation stubs \u2014 auto-hook task-start/complete records and the "status: undefined" artefact of T12071. These are short enough that BM25 length-normalisation ranks them ABOVE substantive memories, so they actively degrade recall. Dry-run by default.'
|
|
1065
|
+
},
|
|
1066
|
+
args: {
|
|
1067
|
+
apply: {
|
|
1068
|
+
type: "boolean",
|
|
1069
|
+
description: "Quarantine matched rows and return a recovery receipt (default: report only)"
|
|
1070
|
+
}
|
|
1071
|
+
},
|
|
1072
|
+
async run({ args }) {
|
|
1073
|
+
const root = getProjectRoot();
|
|
1074
|
+
await getBrainDb(root);
|
|
1075
|
+
const { getBrainNativeDb } = await import("@cleocode/core/internal");
|
|
1076
|
+
const nativeDb = getBrainNativeDb();
|
|
1077
|
+
if (!nativeDb) {
|
|
1078
|
+
cliError("BRAIN database is not open");
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
const { pruneObservationStubs } = await import("@cleocode/core/internal");
|
|
1082
|
+
const result = pruneObservationStubs(nativeDb, Boolean(args.apply));
|
|
1083
|
+
cliOutput(result, { command: "memory prune-stubs", operation: "memory.prune-stubs" });
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
var pruneTraitsCommand = defineCommand({
|
|
1087
|
+
meta: {
|
|
1088
|
+
name: "prune-traits",
|
|
1089
|
+
description: `Report (and with --apply, remove) user-profile traits that are operation receipts or status lines ("Operation succeeded in domain 'check'", "gate set to true for T123"). --envelope-derived also matches every legacy dialectic trait with no project stamp: those were minted from operation envelopes. Apply backs rows up first; --restore <backup> reverses it. Dry-run by default.`
|
|
1090
|
+
},
|
|
1091
|
+
args: {
|
|
1092
|
+
apply: {
|
|
1093
|
+
type: "boolean",
|
|
1094
|
+
description: "Back up, then delete matched rows and return a receipt (default: report only)"
|
|
1095
|
+
},
|
|
1096
|
+
"envelope-derived": {
|
|
1097
|
+
type: "boolean",
|
|
1098
|
+
description: "Also match legacy dialectic:* traits with no project stamp"
|
|
1099
|
+
},
|
|
1100
|
+
restore: {
|
|
1101
|
+
type: "string",
|
|
1102
|
+
description: "Re-insert the rows from a prune-traits backup file (never overwrites)"
|
|
1103
|
+
},
|
|
1104
|
+
sha256: {
|
|
1105
|
+
type: "string",
|
|
1106
|
+
description: "With --restore: the receipt backupSha256; a mismatching backup is refused"
|
|
1107
|
+
}
|
|
1108
|
+
},
|
|
1109
|
+
async run({ args }) {
|
|
1110
|
+
const core = await import("@cleocode/core/internal");
|
|
1111
|
+
const nexusDb = await core.getNexusDb(getProjectRoot());
|
|
1112
|
+
const result = args.restore ? await core.restorePrunedTraits(
|
|
1113
|
+
nexusDb,
|
|
1114
|
+
String(args.restore),
|
|
1115
|
+
args.sha256 ? String(args.sha256) : void 0
|
|
1116
|
+
) : await core.pruneReceiptTraits(nexusDb, {
|
|
1117
|
+
apply: Boolean(args.apply),
|
|
1118
|
+
includeEnvelopeDerived: Boolean(args["envelope-derived"])
|
|
1119
|
+
});
|
|
1120
|
+
cliOutput(result, { command: "memory prune-traits", operation: "memory.prune-traits" });
|
|
1121
|
+
}
|
|
1122
|
+
});
|
|
1123
|
+
var setTraitScopeCommand = defineCommand({
|
|
1124
|
+
meta: {
|
|
1125
|
+
name: "set-trait-scope",
|
|
1126
|
+
description: `Set a user-profile trait scope: "user" = user-global, injected into every project's agent prompts; "project" = only the project it was derived in.`
|
|
1127
|
+
},
|
|
1128
|
+
args: {
|
|
1129
|
+
key: { type: "positional", description: "Trait key", required: true },
|
|
1130
|
+
scope: { type: "positional", description: "project | user", required: true }
|
|
1131
|
+
},
|
|
1132
|
+
async run({ args }) {
|
|
1133
|
+
const scope = String(args.scope);
|
|
1134
|
+
if (scope !== "project" && scope !== "user") {
|
|
1135
|
+
cliError(`scope must be "project" or "user", got "${scope}"`, "E_VALIDATION", {
|
|
1136
|
+
name: "E_VALIDATION"
|
|
1137
|
+
});
|
|
1138
|
+
return;
|
|
1139
|
+
}
|
|
1140
|
+
const core = await import("@cleocode/core/internal");
|
|
1141
|
+
const nexusDb = await core.getNexusDb(getProjectRoot());
|
|
1142
|
+
const previous = await core.setUserProfileTraitScope(nexusDb, String(args.key), scope);
|
|
1143
|
+
if (previous === null) {
|
|
1144
|
+
cliError(`No user-profile trait "${args.key}"`, "E_NOT_FOUND", { name: "E_NOT_FOUND" });
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
1147
|
+
cliOutput(
|
|
1148
|
+
{ traitKey: args.key, previousScope: previous, scope },
|
|
1149
|
+
{ command: "memory set-trait-scope", operation: "memory.set-trait-scope" }
|
|
1150
|
+
);
|
|
1151
|
+
}
|
|
1152
|
+
});
|
|
1153
|
+
var dedupScanCommand = defineCommand({
|
|
1154
|
+
meta: {
|
|
1155
|
+
name: "dedup-scan",
|
|
1156
|
+
description: "Scan brain.db for potential duplicate entries by content-hash and keyword similarity. Reports duplicates per table without modifying any data. Use --apply to merge confirmed duplicates via the consolidation pipeline."
|
|
1157
|
+
},
|
|
1158
|
+
args: {
|
|
1159
|
+
apply: {
|
|
1160
|
+
type: "boolean",
|
|
1161
|
+
description: "Run full consolidation to merge duplicates (calls cleo memory consolidate internally)"
|
|
1162
|
+
}
|
|
1163
|
+
},
|
|
1164
|
+
async run({ args }) {
|
|
1165
|
+
const root = getProjectRoot();
|
|
1166
|
+
try {
|
|
1167
|
+
await getBrainDb(root);
|
|
1168
|
+
const { totalDuplicateRows, groups } = await scanDuplicateEntries();
|
|
1169
|
+
if (args.apply) {
|
|
1170
|
+
const result = await runConsolidation(root);
|
|
1171
|
+
cliOutput(
|
|
1172
|
+
{
|
|
1173
|
+
totalDuplicateRows,
|
|
1174
|
+
groups,
|
|
1175
|
+
applied: true,
|
|
1176
|
+
consolidation: { deduplicated: result.deduplicated }
|
|
1177
|
+
},
|
|
1178
|
+
{ command: "memory-dedup-scan", operation: "memory.dedup-scan" }
|
|
1179
|
+
);
|
|
1180
|
+
} else {
|
|
1181
|
+
cliOutput(
|
|
1182
|
+
{ totalDuplicateRows, groups, applied: false },
|
|
1183
|
+
{ command: "memory-dedup-scan", operation: "memory.dedup-scan" }
|
|
1184
|
+
);
|
|
1185
|
+
}
|
|
1186
|
+
} catch (err) {
|
|
1187
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1188
|
+
cliError(`Dedup scan failed: ${message}`, "E_INTERNAL", { name: "E_INTERNAL" });
|
|
1189
|
+
process.exit(1);
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
});
|
|
1193
|
+
var importCommand = defineCommand({
|
|
1194
|
+
meta: {
|
|
1195
|
+
name: "import",
|
|
1196
|
+
description: "Import memory files from a provider-specific directory (e.g. ~/.claude/projects/*/memory/) into brain.db. Enables provider-agnostic memory via CLEO CLI instead of Claude Code MEMORY.md."
|
|
1197
|
+
},
|
|
1198
|
+
args: {
|
|
1199
|
+
from: {
|
|
1200
|
+
type: "string",
|
|
1201
|
+
description: "Source directory containing *.md memory files (default: ~/.claude/projects/-mnt-projects-cleocode/memory)"
|
|
1202
|
+
},
|
|
1203
|
+
"dry-run": {
|
|
1204
|
+
type: "boolean",
|
|
1205
|
+
description: "Print what would be imported without writing to brain.db"
|
|
1206
|
+
}
|
|
1207
|
+
},
|
|
1208
|
+
async run({ args }) {
|
|
1209
|
+
const sourceDir = args.from;
|
|
1210
|
+
const isDryRun = !!args["dry-run"];
|
|
1211
|
+
const projectRoot = getProjectRoot();
|
|
1212
|
+
try {
|
|
1213
|
+
const result = await importMemoryFiles({
|
|
1214
|
+
sourceDir,
|
|
1215
|
+
dryRun: isDryRun,
|
|
1216
|
+
projectRoot,
|
|
1217
|
+
cleoDirName: CLEO_DIR_NAME,
|
|
1218
|
+
hasheFileName: MIGRATE_MEMORY_HASHES_JSON,
|
|
1219
|
+
dispatch: dispatchFromCli
|
|
1220
|
+
});
|
|
1221
|
+
cliOutput(
|
|
1222
|
+
{
|
|
1223
|
+
total: result.total,
|
|
1224
|
+
imported: result.imported,
|
|
1225
|
+
skipped: result.skipped,
|
|
1226
|
+
errors: result.errors,
|
|
1227
|
+
dryRun: isDryRun,
|
|
1228
|
+
importedEntries: result.importedEntries,
|
|
1229
|
+
skippedEntries: result.skippedEntries,
|
|
1230
|
+
errorEntries: result.errorEntries
|
|
1231
|
+
},
|
|
1232
|
+
{ command: "memory-import", operation: "memory.import" }
|
|
1233
|
+
);
|
|
1234
|
+
if (result.errors > 0) process.exit(1);
|
|
1235
|
+
} catch (err) {
|
|
1236
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1237
|
+
cliError(message, "E_NOT_FOUND", { name: "E_NOT_FOUND" });
|
|
1238
|
+
process.exit(1);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
});
|
|
1242
|
+
var doctorCommand = defineCommand({
|
|
1243
|
+
meta: {
|
|
1244
|
+
name: "doctor",
|
|
1245
|
+
description: "Read-only brain noise scan: detects duplicate-content, missing-type, missing-provenance, orphan-edge, low-confidence, and stale-unverified patterns. Use --assert-clean as the M7 entry gate before enabling Sentient v1 (`cleo sentient propose enable`)."
|
|
1246
|
+
},
|
|
1247
|
+
args: {
|
|
1248
|
+
"assert-clean": {
|
|
1249
|
+
type: "boolean",
|
|
1250
|
+
description: "Exit non-zero when any noise patterns are detected (M7 gate for Sentient v1)"
|
|
1251
|
+
},
|
|
1252
|
+
json: {
|
|
1253
|
+
type: "boolean",
|
|
1254
|
+
description: "Output as JSON"
|
|
1255
|
+
}
|
|
1256
|
+
},
|
|
1257
|
+
async run({ args }) {
|
|
1258
|
+
await dispatchFromCli(
|
|
1259
|
+
"query",
|
|
1260
|
+
"memory",
|
|
1261
|
+
"doctor",
|
|
1262
|
+
{ "assert-clean": args["assert-clean"] },
|
|
1263
|
+
{ command: "memory-doctor", operation: "memory.doctor" }
|
|
1264
|
+
);
|
|
1265
|
+
}
|
|
1266
|
+
});
|
|
1267
|
+
var llmStatusCommand = defineCommand({
|
|
1268
|
+
meta: {
|
|
1269
|
+
name: "llm-status",
|
|
1270
|
+
description: "Report LLM backend resolution status and extraction readiness. Shows which source resolved the Anthropic API key (env/config/oauth/none), whether LLM extraction is enabled, and when extraction last ran."
|
|
1271
|
+
},
|
|
1272
|
+
args: {
|
|
1273
|
+
json: {
|
|
1274
|
+
type: "boolean",
|
|
1275
|
+
description: "Output as JSON"
|
|
1276
|
+
}
|
|
1277
|
+
},
|
|
1278
|
+
async run() {
|
|
1279
|
+
await dispatchFromCli(
|
|
1280
|
+
"query",
|
|
1281
|
+
"memory",
|
|
1282
|
+
"llm-status",
|
|
1283
|
+
{},
|
|
1284
|
+
{ command: "memory-llm-status", operation: "memory.llm-status" }
|
|
1285
|
+
);
|
|
1286
|
+
}
|
|
1287
|
+
});
|
|
1288
|
+
var verifyCommand = defineCommand({
|
|
1289
|
+
meta: {
|
|
1290
|
+
name: "verify",
|
|
1291
|
+
description: "Promote a brain memory entry to verified=true. Requires caller identity of cleo-prime or owner. Flips the verified flag in brain_observations (or typed table), enabling long-tier promotion and ground-truth retrieval weighting."
|
|
1292
|
+
},
|
|
1293
|
+
args: {
|
|
1294
|
+
id: {
|
|
1295
|
+
type: "positional",
|
|
1296
|
+
description: "Brain entry ID to verify",
|
|
1297
|
+
required: true
|
|
1298
|
+
},
|
|
1299
|
+
agent: {
|
|
1300
|
+
type: "string",
|
|
1301
|
+
description: "Caller identity ('cleo-prime' or 'owner'). Omit when calling from the owner terminal (no identity required)."
|
|
1302
|
+
},
|
|
1303
|
+
json: {
|
|
1304
|
+
type: "boolean",
|
|
1305
|
+
description: "Output as JSON"
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
async run({ args }) {
|
|
1309
|
+
await dispatchFromCli(
|
|
1310
|
+
"mutate",
|
|
1311
|
+
"memory",
|
|
1312
|
+
"verify",
|
|
1313
|
+
{
|
|
1314
|
+
id: args.id,
|
|
1315
|
+
...args.agent !== void 0 && { agent: args.agent }
|
|
1316
|
+
},
|
|
1317
|
+
{ command: "memory-verify", operation: "memory.verify" }
|
|
1318
|
+
);
|
|
1319
|
+
}
|
|
1320
|
+
});
|
|
1321
|
+
var pendingVerifyCommand = defineCommand({
|
|
1322
|
+
meta: {
|
|
1323
|
+
name: "pending-verify",
|
|
1324
|
+
description: "List brain memory entries that are unverified (verified=false) but highly cited (citation_count >= threshold). These are strong candidates for manual verification via 'cleo memory verify <id>'."
|
|
1325
|
+
},
|
|
1326
|
+
args: {
|
|
1327
|
+
"min-citations": {
|
|
1328
|
+
type: "string",
|
|
1329
|
+
description: "Minimum citation count threshold (default: 5)"
|
|
1330
|
+
},
|
|
1331
|
+
limit: {
|
|
1332
|
+
type: "string",
|
|
1333
|
+
description: "Maximum entries to return (default: 50)"
|
|
1334
|
+
},
|
|
1335
|
+
json: {
|
|
1336
|
+
type: "boolean",
|
|
1337
|
+
description: "Output as JSON"
|
|
1338
|
+
}
|
|
1339
|
+
},
|
|
1340
|
+
async run({ args }) {
|
|
1341
|
+
await dispatchFromCli(
|
|
1342
|
+
"query",
|
|
1343
|
+
"memory",
|
|
1344
|
+
"pending-verify",
|
|
1345
|
+
{
|
|
1346
|
+
...args["min-citations"] !== void 0 && {
|
|
1347
|
+
minCitations: parseInt(args["min-citations"], 10)
|
|
1348
|
+
},
|
|
1349
|
+
...args.limit !== void 0 && { limit: parseInt(args.limit, 10) }
|
|
1350
|
+
},
|
|
1351
|
+
{ command: "memory-pending-verify", operation: "memory.pending-verify" }
|
|
1352
|
+
);
|
|
1353
|
+
}
|
|
1354
|
+
});
|
|
1355
|
+
var tierStatsCommand = defineCommand({
|
|
1356
|
+
meta: {
|
|
1357
|
+
name: "stats",
|
|
1358
|
+
description: "Show tier distribution across all brain tables + countdown to next long-tier promotions (top-10)"
|
|
1359
|
+
},
|
|
1360
|
+
args: {},
|
|
1361
|
+
async run() {
|
|
1362
|
+
const root = getProjectRoot();
|
|
1363
|
+
try {
|
|
1364
|
+
await getBrainDb(root);
|
|
1365
|
+
const result = await getTierStats(root);
|
|
1366
|
+
const distribution = {};
|
|
1367
|
+
for (const t of result.tables) {
|
|
1368
|
+
distribution[t.table] = { short: t.short, medium: t.medium, long: t.long };
|
|
1369
|
+
}
|
|
1370
|
+
const top10 = result.upcomingLongPromotions.slice(0, 10);
|
|
1371
|
+
cliOutput(
|
|
1372
|
+
{ distribution, upcomingLongPromotions: top10 },
|
|
1373
|
+
{ command: "memory-tier-stats", operation: "memory.tier.stats" }
|
|
1374
|
+
);
|
|
1375
|
+
} catch (err) {
|
|
1376
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1377
|
+
cliError(`Tier stats failed: ${message}`, "E_INTERNAL", { name: "E_INTERNAL" });
|
|
1378
|
+
process.exit(1);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
});
|
|
1382
|
+
var tierPromoteCommand = defineCommand({
|
|
1383
|
+
meta: {
|
|
1384
|
+
name: "promote",
|
|
1385
|
+
description: "Manually promote a memory entry to a higher tier (bypasses age gate)"
|
|
1386
|
+
},
|
|
1387
|
+
args: {
|
|
1388
|
+
id: {
|
|
1389
|
+
type: "positional",
|
|
1390
|
+
description: "Brain entry ID",
|
|
1391
|
+
required: true
|
|
1392
|
+
},
|
|
1393
|
+
to: {
|
|
1394
|
+
type: "string",
|
|
1395
|
+
description: "Target tier: medium or long",
|
|
1396
|
+
required: true
|
|
1397
|
+
},
|
|
1398
|
+
reason: {
|
|
1399
|
+
type: "string",
|
|
1400
|
+
description: "Reason for manual promotion (required)",
|
|
1401
|
+
required: true
|
|
1402
|
+
}
|
|
1403
|
+
},
|
|
1404
|
+
async run({ args }) {
|
|
1405
|
+
const root = getProjectRoot();
|
|
1406
|
+
const targetTier = args.to;
|
|
1407
|
+
const reason = args.reason;
|
|
1408
|
+
const validTiers = ["medium", "long"];
|
|
1409
|
+
if (!validTiers.includes(targetTier)) {
|
|
1410
|
+
cliError(
|
|
1411
|
+
`Invalid target tier: ${targetTier}. Must be one of: ${validTiers.join(", ")}`,
|
|
1412
|
+
"E_VALIDATION",
|
|
1413
|
+
{ name: "E_VALIDATION" }
|
|
1414
|
+
);
|
|
1415
|
+
process.exit(1);
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1418
|
+
try {
|
|
1419
|
+
await getBrainDb(root);
|
|
1420
|
+
const result = await setEntryTier(args.id, targetTier, "promote");
|
|
1421
|
+
cliOutput(
|
|
1422
|
+
{
|
|
1423
|
+
id: result.id,
|
|
1424
|
+
table: result.table,
|
|
1425
|
+
fromTier: result.fromTier,
|
|
1426
|
+
toTier: result.toTier,
|
|
1427
|
+
reason,
|
|
1428
|
+
promotedAt: result.updatedAt
|
|
1429
|
+
},
|
|
1430
|
+
{ command: "memory-tier-promote", operation: "memory.tier.promote" }
|
|
1431
|
+
);
|
|
1432
|
+
} catch (err) {
|
|
1433
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1434
|
+
const isValidation = message.includes("already at tier") || message.includes("Cannot promote") || message.includes("not found");
|
|
1435
|
+
if (isValidation) {
|
|
1436
|
+
cliError(message, "E_VALIDATION", { name: "E_VALIDATION" });
|
|
1437
|
+
} else {
|
|
1438
|
+
cliError(`Tier promote failed: ${message}`, "E_INTERNAL", { name: "E_INTERNAL" });
|
|
1439
|
+
}
|
|
1440
|
+
process.exit(1);
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
});
|
|
1444
|
+
var tierDemoteCommand = defineCommand({
|
|
1445
|
+
meta: {
|
|
1446
|
+
name: "demote",
|
|
1447
|
+
description: "Manually demote a memory entry to a lower tier"
|
|
1448
|
+
},
|
|
1449
|
+
args: {
|
|
1450
|
+
id: {
|
|
1451
|
+
type: "positional",
|
|
1452
|
+
description: "Brain entry ID",
|
|
1453
|
+
required: true
|
|
1454
|
+
},
|
|
1455
|
+
to: {
|
|
1456
|
+
type: "string",
|
|
1457
|
+
description: "Target tier: short or medium",
|
|
1458
|
+
required: true
|
|
1459
|
+
},
|
|
1460
|
+
reason: {
|
|
1461
|
+
type: "string",
|
|
1462
|
+
description: "Reason for manual demotion (required)",
|
|
1463
|
+
required: true
|
|
1464
|
+
},
|
|
1465
|
+
force: {
|
|
1466
|
+
type: "boolean",
|
|
1467
|
+
description: "Required when demoting from long tier"
|
|
1468
|
+
}
|
|
1469
|
+
},
|
|
1470
|
+
async run({ args }) {
|
|
1471
|
+
const root = getProjectRoot();
|
|
1472
|
+
const targetTier = args.to;
|
|
1473
|
+
const reason = args.reason;
|
|
1474
|
+
const validTiers = ["short", "medium"];
|
|
1475
|
+
if (!validTiers.includes(targetTier)) {
|
|
1476
|
+
cliError(
|
|
1477
|
+
`Invalid target tier for demotion: ${targetTier}. Must be one of: ${validTiers.join(", ")}`,
|
|
1478
|
+
"E_VALIDATION",
|
|
1479
|
+
{ name: "E_VALIDATION" }
|
|
1480
|
+
);
|
|
1481
|
+
process.exit(1);
|
|
1482
|
+
return;
|
|
1483
|
+
}
|
|
1484
|
+
try {
|
|
1485
|
+
await getBrainDb(root);
|
|
1486
|
+
const result = await setEntryTier(args.id, targetTier, "demote", { force: !!args.force });
|
|
1487
|
+
cliOutput(
|
|
1488
|
+
{
|
|
1489
|
+
id: result.id,
|
|
1490
|
+
table: result.table,
|
|
1491
|
+
fromTier: result.fromTier,
|
|
1492
|
+
toTier: result.toTier,
|
|
1493
|
+
reason,
|
|
1494
|
+
demotedAt: result.updatedAt
|
|
1495
|
+
},
|
|
1496
|
+
{ command: "memory-tier-demote", operation: "memory.tier.demote" }
|
|
1497
|
+
);
|
|
1498
|
+
} catch (err) {
|
|
1499
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1500
|
+
const isValidation = message.includes("already at tier") || message.includes("Cannot demote") || message.includes("not found") || message.includes("long tier") || message.includes("Long-tier");
|
|
1501
|
+
if (isValidation) {
|
|
1502
|
+
cliError(message, "E_VALIDATION", { name: "E_VALIDATION" });
|
|
1503
|
+
} else {
|
|
1504
|
+
cliError(`Tier demote failed: ${message}`, "E_INTERNAL", { name: "E_INTERNAL" });
|
|
1505
|
+
}
|
|
1506
|
+
process.exit(1);
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
function makeMemorySubcommand(opts) {
|
|
1511
|
+
const mergedArgs = {
|
|
1512
|
+
...opts.args,
|
|
1513
|
+
json: {
|
|
1514
|
+
type: "boolean",
|
|
1515
|
+
description: "Output as JSON"
|
|
1516
|
+
}
|
|
1517
|
+
};
|
|
1518
|
+
return defineCommand({
|
|
1519
|
+
meta: { name: opts.name, description: opts.description },
|
|
1520
|
+
args: mergedArgs,
|
|
1521
|
+
async run({ args }) {
|
|
1522
|
+
const params = opts.paramBuilder(args);
|
|
1523
|
+
await dispatchFromCli(opts.gateway, "memory", opts.operation, params, opts.output);
|
|
1524
|
+
}
|
|
1525
|
+
});
|
|
1526
|
+
}
|
|
1527
|
+
var precompactFlushCommand = makeMemorySubcommand({
|
|
1528
|
+
name: "precompact-flush",
|
|
1529
|
+
description: "Flush in-flight observations to brain.db and checkpoint the SQLite WAL before context compaction (T1004).",
|
|
1530
|
+
args: {},
|
|
1531
|
+
gateway: "mutate",
|
|
1532
|
+
operation: "precompact-flush",
|
|
1533
|
+
output: { command: "memory-precompact-flush", operation: "memory.precompact-flush" },
|
|
1534
|
+
paramBuilder: () => ({})
|
|
1535
|
+
});
|
|
1536
|
+
var backfillRunCommand = makeMemorySubcommand({
|
|
1537
|
+
name: "run",
|
|
1538
|
+
description: "Stage a brain-graph backfill run (pending approval). Pass --source to tag the run with a human-readable descriptor.",
|
|
1539
|
+
args: {
|
|
1540
|
+
source: {
|
|
1541
|
+
type: "string",
|
|
1542
|
+
description: "Human-readable descriptor for the backfill source (file path, session ID, etc)."
|
|
1543
|
+
},
|
|
1544
|
+
kind: {
|
|
1545
|
+
type: "string",
|
|
1546
|
+
description: "Backfill kind (default: 'graph-backfill')."
|
|
1547
|
+
},
|
|
1548
|
+
"node-ids": {
|
|
1549
|
+
type: "string",
|
|
1550
|
+
description: "Comma-separated exact qualified graph node IDs to stage; every ID must be eligible and missing."
|
|
1551
|
+
},
|
|
1552
|
+
"target-table": {
|
|
1553
|
+
type: "string",
|
|
1554
|
+
description: "Target table (default: 'brain_page_nodes')."
|
|
1555
|
+
}
|
|
1556
|
+
},
|
|
1557
|
+
gateway: "mutate",
|
|
1558
|
+
operation: "backfill.run",
|
|
1559
|
+
output: { command: "memory-backfill-run", operation: "memory.backfill.run" },
|
|
1560
|
+
paramBuilder: (args) => ({
|
|
1561
|
+
...args["node-ids"] !== void 0 && {
|
|
1562
|
+
nodeIds: String(args["node-ids"]).split(",").map((id) => id.trim())
|
|
1563
|
+
},
|
|
1564
|
+
...args["source"] !== void 0 && { source: args["source"] },
|
|
1565
|
+
...args["kind"] !== void 0 && { kind: args["kind"] },
|
|
1566
|
+
...args["target-table"] !== void 0 && { targetTable: args["target-table"] }
|
|
1567
|
+
})
|
|
1568
|
+
});
|
|
1569
|
+
var backfillApproveCommand = makeMemorySubcommand({
|
|
1570
|
+
name: "approve",
|
|
1571
|
+
description: "Approve a staged backfill run (commits rows to brain_page_nodes). Idempotent \u2014 re-approval returns alreadySettled=true.",
|
|
1572
|
+
args: {
|
|
1573
|
+
runId: {
|
|
1574
|
+
type: "positional",
|
|
1575
|
+
description: "Backfill run ID to approve",
|
|
1576
|
+
required: true
|
|
1577
|
+
},
|
|
1578
|
+
"approved-by": {
|
|
1579
|
+
type: "string",
|
|
1580
|
+
description: "Identity of the approver (default: 'cli')."
|
|
1581
|
+
}
|
|
1582
|
+
},
|
|
1583
|
+
gateway: "mutate",
|
|
1584
|
+
operation: "backfill.approve",
|
|
1585
|
+
output: { command: "memory-backfill-approve", operation: "memory.backfill.approve" },
|
|
1586
|
+
paramBuilder: (args) => ({
|
|
1587
|
+
runId: args["runId"],
|
|
1588
|
+
...args["approved-by"] !== void 0 && { approvedBy: args["approved-by"] }
|
|
1589
|
+
})
|
|
1590
|
+
});
|
|
1591
|
+
var backfillRollbackCommand = makeMemorySubcommand({
|
|
1592
|
+
name: "rollback",
|
|
1593
|
+
description: "Rollback a staged or committed backfill run. Removes any rows written to brain_page_nodes.",
|
|
1594
|
+
args: {
|
|
1595
|
+
runId: {
|
|
1596
|
+
type: "positional",
|
|
1597
|
+
description: "Backfill run ID to rollback",
|
|
1598
|
+
required: true
|
|
1599
|
+
}
|
|
1600
|
+
},
|
|
1601
|
+
gateway: "mutate",
|
|
1602
|
+
operation: "backfill.rollback",
|
|
1603
|
+
output: { command: "memory-backfill-rollback", operation: "memory.backfill.rollback" },
|
|
1604
|
+
paramBuilder: (args) => ({
|
|
1605
|
+
runId: args["runId"]
|
|
1606
|
+
})
|
|
1607
|
+
});
|
|
1608
|
+
var backfillCommand = defineCommand({
|
|
1609
|
+
meta: {
|
|
1610
|
+
name: "backfill",
|
|
1611
|
+
description: "Staged brain-graph backfill operations: run, approve, rollback (T1003)."
|
|
1612
|
+
},
|
|
1613
|
+
subCommands: {
|
|
1614
|
+
run: backfillRunCommand,
|
|
1615
|
+
approve: backfillApproveCommand,
|
|
1616
|
+
rollback: backfillRollbackCommand
|
|
1617
|
+
},
|
|
1618
|
+
async run({ cmd, rawArgs }) {
|
|
1619
|
+
const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
|
|
1620
|
+
if (firstArg && cmd.subCommands && firstArg in cmd.subCommands) return;
|
|
1621
|
+
await showUsage(cmd);
|
|
1622
|
+
}
|
|
1623
|
+
});
|
|
1624
|
+
var digestCommand = defineCommand({
|
|
1625
|
+
meta: {
|
|
1626
|
+
name: "digest",
|
|
1627
|
+
description: "Summarized top-N brain observations for session briefing (T1006). Pass --hygiene to show latest hygiene scan results from the sentient background loop (T1636)."
|
|
1628
|
+
},
|
|
1629
|
+
args: {
|
|
1630
|
+
limit: {
|
|
1631
|
+
type: "string",
|
|
1632
|
+
description: "Maximum number of observations to include (default: 10)."
|
|
1633
|
+
},
|
|
1634
|
+
hygiene: {
|
|
1635
|
+
type: "boolean",
|
|
1636
|
+
description: "Show only hygiene observations (hygiene:orphan, hygiene:top-level-orphan, hygiene:content-defect, hygiene:premature-close-leak) from the sentient background loop (T1636)."
|
|
1637
|
+
},
|
|
1638
|
+
json: {
|
|
1639
|
+
type: "boolean",
|
|
1640
|
+
description: "Output as JSON"
|
|
1641
|
+
}
|
|
1642
|
+
},
|
|
1643
|
+
async run({ args }) {
|
|
1644
|
+
if (args.hygiene) {
|
|
1645
|
+
await dispatchFromCli(
|
|
1646
|
+
"query",
|
|
1647
|
+
"memory",
|
|
1648
|
+
"find",
|
|
1649
|
+
{
|
|
1650
|
+
query: "hygiene:",
|
|
1651
|
+
limit: args.limit !== void 0 ? parseInt(args.limit, 10) : 20
|
|
1652
|
+
},
|
|
1653
|
+
{ command: "memory-hygiene-digest", operation: "memory.find" }
|
|
1654
|
+
);
|
|
1655
|
+
} else {
|
|
1656
|
+
await dispatchFromCli(
|
|
1657
|
+
"query",
|
|
1658
|
+
"memory",
|
|
1659
|
+
"digest",
|
|
1660
|
+
{
|
|
1661
|
+
...args["limit"] !== void 0 && { limit: parseInt(args["limit"], 10) }
|
|
1662
|
+
},
|
|
1663
|
+
{ command: "memory-digest", operation: "memory.digest" }
|
|
1664
|
+
);
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
});
|
|
1668
|
+
var recentCommand = makeMemorySubcommand({
|
|
1669
|
+
name: "recent",
|
|
1670
|
+
description: "Tail recent brain observations with optional filters (T1006). --since accepts 30m / 24h / 7d or an ISO timestamp.",
|
|
1671
|
+
args: {
|
|
1672
|
+
limit: {
|
|
1673
|
+
type: "string",
|
|
1674
|
+
description: "Maximum number of observations to return (default: 20)."
|
|
1675
|
+
},
|
|
1676
|
+
type: {
|
|
1677
|
+
type: "string",
|
|
1678
|
+
description: "Filter by observation type (discovery, decision, bugfix, refactor, feature, change, diary, session-summary)."
|
|
1679
|
+
},
|
|
1680
|
+
since: {
|
|
1681
|
+
type: "string",
|
|
1682
|
+
description: "Duration (e.g. 24h, 7d, 30m) or ISO timestamp lower bound."
|
|
1683
|
+
},
|
|
1684
|
+
session: {
|
|
1685
|
+
type: "string",
|
|
1686
|
+
description: "Filter by source session ID."
|
|
1687
|
+
},
|
|
1688
|
+
tier: {
|
|
1689
|
+
type: "string",
|
|
1690
|
+
description: "Filter by memory tier ('short', 'medium', 'long')."
|
|
1691
|
+
}
|
|
1692
|
+
},
|
|
1693
|
+
gateway: "query",
|
|
1694
|
+
operation: "recent",
|
|
1695
|
+
output: { command: "memory-recent", operation: "memory.recent" },
|
|
1696
|
+
paramBuilder: (args) => ({
|
|
1697
|
+
...args["limit"] !== void 0 && { limit: parseInt(args["limit"], 10) },
|
|
1698
|
+
...args["type"] !== void 0 && { type: args["type"] },
|
|
1699
|
+
...args["since"] !== void 0 && { since: args["since"] },
|
|
1700
|
+
...args["session"] !== void 0 && { session: args["session"] },
|
|
1701
|
+
...args["tier"] !== void 0 && { tier: args["tier"] }
|
|
1702
|
+
})
|
|
1703
|
+
});
|
|
1704
|
+
var diaryReadCommand = makeMemorySubcommand({
|
|
1705
|
+
name: "read",
|
|
1706
|
+
description: "Read recent diary-typed observations (T1006).",
|
|
1707
|
+
args: {
|
|
1708
|
+
limit: {
|
|
1709
|
+
type: "string",
|
|
1710
|
+
description: "Maximum number of diary entries to return (default: 20)."
|
|
1711
|
+
}
|
|
1712
|
+
},
|
|
1713
|
+
gateway: "query",
|
|
1714
|
+
operation: "diary",
|
|
1715
|
+
output: { command: "memory-diary-read", operation: "memory.diary" },
|
|
1716
|
+
paramBuilder: (args) => ({
|
|
1717
|
+
...args["limit"] !== void 0 && { limit: parseInt(args["limit"], 10) }
|
|
1718
|
+
})
|
|
1719
|
+
});
|
|
1720
|
+
var diaryWriteCommand = makeMemorySubcommand({
|
|
1721
|
+
name: "write",
|
|
1722
|
+
description: "Write a diary-typed observation to brain.db (T1006).",
|
|
1723
|
+
args: {
|
|
1724
|
+
text: {
|
|
1725
|
+
type: "positional",
|
|
1726
|
+
description: "Diary entry text",
|
|
1727
|
+
required: true
|
|
1728
|
+
},
|
|
1729
|
+
title: {
|
|
1730
|
+
type: "string",
|
|
1731
|
+
description: "Optional diary entry title (defaults to first 120 chars of text)."
|
|
1732
|
+
},
|
|
1733
|
+
agent: {
|
|
1734
|
+
type: "string",
|
|
1735
|
+
description: "Optional agent provenance (e.g. cleo-prime, historian)."
|
|
1736
|
+
}
|
|
1737
|
+
},
|
|
1738
|
+
gateway: "mutate",
|
|
1739
|
+
operation: "diary.write",
|
|
1740
|
+
output: { command: "memory-diary-write", operation: "memory.diary.write" },
|
|
1741
|
+
paramBuilder: (args) => ({
|
|
1742
|
+
text: args["text"],
|
|
1743
|
+
...args["title"] !== void 0 && { title: args["title"] },
|
|
1744
|
+
...args["agent"] !== void 0 && { agent: args["agent"] }
|
|
1745
|
+
})
|
|
1746
|
+
});
|
|
1747
|
+
var diaryCommand = defineCommand({
|
|
1748
|
+
meta: {
|
|
1749
|
+
name: "diary",
|
|
1750
|
+
description: "Read or write diary-typed brain observations (T1006)."
|
|
1751
|
+
},
|
|
1752
|
+
subCommands: {
|
|
1753
|
+
read: diaryReadCommand,
|
|
1754
|
+
write: diaryWriteCommand
|
|
1755
|
+
},
|
|
1756
|
+
async run({ cmd, rawArgs }) {
|
|
1757
|
+
const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
|
|
1758
|
+
if (firstArg && cmd.subCommands && firstArg in cmd.subCommands) return;
|
|
1759
|
+
await showUsage(cmd);
|
|
1760
|
+
}
|
|
1761
|
+
});
|
|
1762
|
+
var watchCommand = defineCommand({
|
|
1763
|
+
meta: {
|
|
1764
|
+
name: "watch",
|
|
1765
|
+
description: "Long-poll stream of recent brain writes. Use --follow to stream continuously as SSE-style events."
|
|
1766
|
+
},
|
|
1767
|
+
args: {
|
|
1768
|
+
cursor: {
|
|
1769
|
+
type: "string",
|
|
1770
|
+
description: "Resume cursor (created_at lower bound) from a previous watch call."
|
|
1771
|
+
},
|
|
1772
|
+
limit: {
|
|
1773
|
+
type: "string",
|
|
1774
|
+
description: "Maximum events per poll (default: 10)."
|
|
1775
|
+
},
|
|
1776
|
+
follow: {
|
|
1777
|
+
type: "boolean",
|
|
1778
|
+
description: "Stream continuously; polls every --interval ms until interrupted."
|
|
1779
|
+
},
|
|
1780
|
+
interval: {
|
|
1781
|
+
type: "string",
|
|
1782
|
+
description: "Poll interval in milliseconds when --follow is set (default: 1000)."
|
|
1783
|
+
},
|
|
1784
|
+
json: {
|
|
1785
|
+
type: "boolean",
|
|
1786
|
+
description: "Output as JSON (non-follow mode only)."
|
|
1787
|
+
}
|
|
1788
|
+
},
|
|
1789
|
+
async run({ args }) {
|
|
1790
|
+
const buildParams = (cursor) => ({
|
|
1791
|
+
...cursor !== void 0 && { cursor },
|
|
1792
|
+
...args.limit !== void 0 && { limit: parseInt(args.limit, 10) }
|
|
1793
|
+
});
|
|
1794
|
+
if (!args.follow) {
|
|
1795
|
+
await dispatchFromCli(
|
|
1796
|
+
"query",
|
|
1797
|
+
"memory",
|
|
1798
|
+
"watch",
|
|
1799
|
+
buildParams(args.cursor),
|
|
1800
|
+
{ command: "memory-watch", operation: "memory.watch" }
|
|
1801
|
+
);
|
|
1802
|
+
return;
|
|
1803
|
+
}
|
|
1804
|
+
const abortController = new AbortController();
|
|
1805
|
+
const onSignal = () => abortController.abort();
|
|
1806
|
+
process.once("SIGINT", onSignal);
|
|
1807
|
+
process.once("SIGTERM", onSignal);
|
|
1808
|
+
const stream = streamMemoryWatchEvents({
|
|
1809
|
+
cursor: args.cursor,
|
|
1810
|
+
limit: args.limit !== void 0 ? parseInt(args.limit, 10) : void 0,
|
|
1811
|
+
intervalMs: args.interval !== void 0 ? parseInt(args.interval, 10) : 1e3,
|
|
1812
|
+
dispatchRaw,
|
|
1813
|
+
signal: abortController.signal
|
|
1814
|
+
});
|
|
1815
|
+
for await (const item of stream) {
|
|
1816
|
+
if (item.kind === "ping") {
|
|
1817
|
+
process.stdout.write(`event: ping
|
|
1818
|
+
data: ${JSON.stringify({ ts: item.ts })}
|
|
1819
|
+
|
|
1820
|
+
`);
|
|
1821
|
+
} else if (item.kind === "events") {
|
|
1822
|
+
for (const event of item.events) {
|
|
1823
|
+
process.stdout.write(`event: observation
|
|
1824
|
+
data: ${JSON.stringify(event)}
|
|
1825
|
+
|
|
1826
|
+
`);
|
|
1827
|
+
}
|
|
1828
|
+
} else if (item.kind === "error") {
|
|
1829
|
+
cliError(item.message, 1, { name: item.code }, { operation: "memory.watch" });
|
|
1830
|
+
process.exit(1);
|
|
1831
|
+
return;
|
|
1832
|
+
} else if (item.kind === "close") {
|
|
1833
|
+
process.stdout.write(`event: close
|
|
1834
|
+
data: ${JSON.stringify({ ts: item.ts })}
|
|
1835
|
+
|
|
1836
|
+
`);
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
});
|
|
1841
|
+
var tierCommand = defineCommand({
|
|
1842
|
+
meta: { name: "tier", description: "Memory tier management: stats, promote, demote" },
|
|
1843
|
+
subCommands: {
|
|
1844
|
+
stats: tierStatsCommand,
|
|
1845
|
+
promote: tierPromoteCommand,
|
|
1846
|
+
demote: tierDemoteCommand
|
|
1847
|
+
}
|
|
1848
|
+
});
|
|
1849
|
+
var sweepCommand = defineCommand({
|
|
1850
|
+
meta: {
|
|
1851
|
+
name: "sweep",
|
|
1852
|
+
description: "T1147 W7 BRAIN noise sweep. --dry-run: detect noise candidates. --approve <runId>: apply to live tables. --status: list runs. --rollback <runId>: discard staged run."
|
|
1853
|
+
},
|
|
1854
|
+
args: {
|
|
1855
|
+
"dry-run": {
|
|
1856
|
+
type: "boolean",
|
|
1857
|
+
description: "Detect noise candidates without staging DB writes."
|
|
1858
|
+
},
|
|
1859
|
+
approve: {
|
|
1860
|
+
type: "string",
|
|
1861
|
+
description: "Run ID to approve and apply to live tables."
|
|
1862
|
+
},
|
|
1863
|
+
status: {
|
|
1864
|
+
type: "boolean",
|
|
1865
|
+
description: "List recent noise-sweep-2440 runs."
|
|
1866
|
+
},
|
|
1867
|
+
rollback: {
|
|
1868
|
+
type: "string",
|
|
1869
|
+
description: "Run ID to roll back without applying changes."
|
|
1870
|
+
},
|
|
1871
|
+
json: {
|
|
1872
|
+
type: "boolean",
|
|
1873
|
+
description: "Output as JSON"
|
|
1874
|
+
}
|
|
1875
|
+
},
|
|
1876
|
+
async run({
|
|
1877
|
+
args
|
|
1878
|
+
}) {
|
|
1879
|
+
const gateway = args.approve || args.rollback ? "mutate" : "query";
|
|
1880
|
+
await dispatchFromCli(
|
|
1881
|
+
gateway,
|
|
1882
|
+
"memory",
|
|
1883
|
+
"sweep",
|
|
1884
|
+
{
|
|
1885
|
+
"dry-run": args["dry-run"],
|
|
1886
|
+
approve: args.approve,
|
|
1887
|
+
status: args.status,
|
|
1888
|
+
rollback: args.rollback
|
|
1889
|
+
},
|
|
1890
|
+
{ command: "memory-sweep", operation: "memory.sweep" }
|
|
1891
|
+
);
|
|
1892
|
+
}
|
|
1893
|
+
});
|
|
1894
|
+
var memoryCommand = defineCommand({
|
|
1895
|
+
meta: {
|
|
1896
|
+
name: "memory",
|
|
1897
|
+
description: "BRAIN memory operations (patterns, learnings, decisions \u2014 use decision-store/-find for architectural decisions)"
|
|
1898
|
+
},
|
|
1899
|
+
subCommands: {
|
|
1900
|
+
store: storeCommand,
|
|
1901
|
+
find: findCommand,
|
|
1902
|
+
stats: statsCommand,
|
|
1903
|
+
observe: observeCommand,
|
|
1904
|
+
timeline: timelineCommand,
|
|
1905
|
+
fetch: fetchCommand,
|
|
1906
|
+
"decision-find": decisionFindCommand,
|
|
1907
|
+
"decision-store": decisionStoreCommand,
|
|
1908
|
+
link: linkCommand,
|
|
1909
|
+
trace: traceCommand,
|
|
1910
|
+
related: relatedCommand,
|
|
1911
|
+
context: contextCommand,
|
|
1912
|
+
"graph-stats": graphStatsCommand,
|
|
1913
|
+
"graph-show": graphShowCommand,
|
|
1914
|
+
"graph-neighbors": graphNeighborsCommand,
|
|
1915
|
+
"graph-add": graphAddCommand,
|
|
1916
|
+
"graph-remove": graphRemoveCommand,
|
|
1917
|
+
"reason-why": reasonWhyCommand,
|
|
1918
|
+
"reason-similar": reasonSimilarCommand,
|
|
1919
|
+
"search-hybrid": searchHybridCommand,
|
|
1920
|
+
"code-links": codeLinksCommand,
|
|
1921
|
+
"code-auto-link": codeAutoLinkCommand,
|
|
1922
|
+
"code-memories-for-code": codeMemoriesForCodeCommand,
|
|
1923
|
+
"code-for-memory": codeForMemoryCommand,
|
|
1924
|
+
consolidate: consolidateCommand,
|
|
1925
|
+
dream: dreamCommand,
|
|
1926
|
+
reflect: reflectCommand,
|
|
1927
|
+
"dedup-scan": dedupScanCommand,
|
|
1928
|
+
"prune-stubs": pruneStubsCommand,
|
|
1929
|
+
"prune-traits": pruneTraitsCommand,
|
|
1930
|
+
"set-trait-scope": setTraitScopeCommand,
|
|
1931
|
+
import: importCommand,
|
|
1932
|
+
doctor: doctorCommand,
|
|
1933
|
+
"llm-status": llmStatusCommand,
|
|
1934
|
+
verify: verifyCommand,
|
|
1935
|
+
"pending-verify": pendingVerifyCommand,
|
|
1936
|
+
tier: tierCommand,
|
|
1937
|
+
// T1013 — new memory subcommands
|
|
1938
|
+
"precompact-flush": precompactFlushCommand,
|
|
1939
|
+
backfill: backfillCommand,
|
|
1940
|
+
digest: digestCommand,
|
|
1941
|
+
recent: recentCommand,
|
|
1942
|
+
diary: diaryCommand,
|
|
1943
|
+
watch: watchCommand,
|
|
1944
|
+
// T1147 W7 — BRAIN noise sweep
|
|
1945
|
+
sweep: sweepCommand
|
|
1946
|
+
},
|
|
1947
|
+
async run({ cmd, rawArgs }) {
|
|
1948
|
+
const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
|
|
1949
|
+
if (firstArg && cmd.subCommands && firstArg in cmd.subCommands) return;
|
|
1950
|
+
await showUsage(cmd);
|
|
1951
|
+
}
|
|
1952
|
+
});
|
|
1953
|
+
export {
|
|
1954
|
+
memoryCommand
|
|
1955
|
+
};
|
|
1956
|
+
//# sourceMappingURL=memory-UHYIVGVM.js.map
|