@remnic/core 1.1.12 → 1.1.13
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/dist/access-cli.d.ts +2 -1
- package/dist/access-cli.js +263 -82
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +26 -60
- package/dist/access-http.js +43 -29
- package/dist/access-mcp.d.ts +24 -6
- package/dist/access-mcp.js +35 -28
- package/dist/access-schema.d.ts +9 -6
- package/dist/access-schema.js +7 -5
- package/dist/access-service-DcCDmNYC.d.ts +1542 -0
- package/dist/access-service.d.ts +25 -7
- package/dist/access-service.js +33 -26
- package/dist/active-memory-bridge.js +2 -2
- package/dist/active-recall.js +11 -3
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/claude-code.d.ts +24 -0
- package/dist/adapters/claude-code.js +9 -0
- package/dist/adapters/codex.d.ts +25 -0
- package/dist/adapters/codex.js +9 -0
- package/dist/adapters/hermes.d.ts +35 -0
- package/dist/adapters/hermes.js +9 -0
- package/dist/adapters/index.d.ts +6 -0
- package/dist/adapters/index.js +26 -0
- package/dist/adapters/registry.d.ts +20 -0
- package/dist/adapters/registry.js +13 -0
- package/dist/adapters/replit.d.ts +28 -0
- package/dist/adapters/replit.js +9 -0
- package/dist/adapters/types.d.ts +43 -0
- package/dist/adapters/types.js +8 -0
- package/dist/bootstrap.d.ts +20 -5
- package/dist/boxes.d.ts +7 -0
- package/dist/boxes.js +1 -1
- package/dist/briefing.d.ts +5 -3
- package/dist/briefing.js +9 -6
- package/dist/buffer-surprise-report.js +1 -1
- package/dist/buffer.d.ts +18 -4
- package/dist/buffer.js +1 -1
- package/dist/calibration.js +4 -4
- package/dist/capsule-cli.d.ts +4 -4
- package/dist/capsule-cli.js +1 -1
- package/dist/capsule-crypto-5CYAGVC5.js +18 -0
- package/dist/capsule-merge-4MGKE7C5.js +189 -0
- package/dist/causal-behavior.d.ts +8 -28
- package/dist/causal-behavior.js +6 -3
- package/dist/causal-behavior.js.map +1 -1
- package/dist/causal-chain.js +3 -2
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +24 -13
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +3 -3
- package/dist/causal-trajectory.js +1 -1
- package/dist/chunk-25MQ7IHJ.js +427 -0
- package/dist/chunk-25MQ7IHJ.js.map +1 -0
- package/dist/chunk-2F2W355T.js +256 -0
- package/dist/chunk-2F2W355T.js.map +1 -0
- package/dist/chunk-2KI4QFHU.js +228 -0
- package/dist/chunk-2KI4QFHU.js.map +1 -0
- package/dist/chunk-2PRQG7PV.js +86 -0
- package/dist/chunk-2PRQG7PV.js.map +1 -0
- package/dist/chunk-2QR3XXIC.js +2272 -0
- package/dist/chunk-2QR3XXIC.js.map +1 -0
- package/dist/chunk-2WWLHTZY.js +121 -0
- package/dist/chunk-326G7DJK.js +2185 -0
- package/dist/chunk-326G7DJK.js.map +1 -0
- package/dist/chunk-34DQE4KF.js +174 -0
- package/dist/chunk-34DQE4KF.js.map +1 -0
- package/dist/chunk-3APJ5EVB.js +601 -0
- package/dist/chunk-3APJ5EVB.js.map +1 -0
- package/dist/chunk-3HPAPHUK.js +51 -0
- package/dist/chunk-3HPAPHUK.js.map +1 -0
- package/dist/chunk-3JXBXXM2.js +69 -0
- package/dist/chunk-3JXBXXM2.js.map +1 -0
- package/dist/chunk-3KW65B36.js +681 -0
- package/dist/chunk-3KW65B36.js.map +1 -0
- package/dist/chunk-3UXOZBHV.js +20 -0
- package/dist/chunk-3UXOZBHV.js.map +1 -0
- package/dist/chunk-3VAL7ZL2.js +266 -0
- package/dist/chunk-3VAL7ZL2.js.map +1 -0
- package/dist/chunk-3Y4P7RXM.js +31 -0
- package/dist/chunk-3Y4P7RXM.js.map +1 -0
- package/dist/chunk-47VWKCAF.js +273 -0
- package/dist/chunk-47VWKCAF.js.map +1 -0
- package/dist/chunk-4CRG46BG.js +271 -0
- package/dist/chunk-5375UYTQ.js +914 -0
- package/dist/chunk-5375UYTQ.js.map +1 -0
- package/dist/chunk-56K5QLHX.js +506 -0
- package/dist/chunk-56K5QLHX.js.map +1 -0
- package/dist/chunk-5RGLBDQF.js +596 -0
- package/dist/chunk-5RGLBDQF.js.map +1 -0
- package/dist/chunk-5UZXUTVO.js +9 -0
- package/dist/chunk-5UZXUTVO.js.map +1 -0
- package/dist/chunk-65PG43EQ.js +105 -0
- package/dist/chunk-65PG43EQ.js.map +1 -0
- package/dist/chunk-66DHUKLO.js +57 -0
- package/dist/chunk-66DHUKLO.js.map +1 -0
- package/dist/chunk-6FC5EGNV.js +46 -0
- package/dist/chunk-6FC5EGNV.js.map +1 -0
- package/dist/chunk-6H2TESSP.js +62 -0
- package/dist/chunk-6H2TESSP.js.map +1 -0
- package/dist/chunk-6LVVDPJ4.js +32 -0
- package/dist/chunk-6LVVDPJ4.js.map +1 -0
- package/dist/chunk-6RVI47ZR.js +159 -0
- package/dist/chunk-6RVI47ZR.js.map +1 -0
- package/dist/chunk-7AAT6G4Q.js +5117 -0
- package/dist/chunk-7AAT6G4Q.js.map +1 -0
- package/dist/chunk-7DTASS5T.js +29 -0
- package/dist/chunk-7DTASS5T.js.map +1 -0
- package/dist/chunk-7IASACLB.js +596 -0
- package/dist/chunk-7MNMYOFP.js +32 -0
- package/dist/chunk-7MNMYOFP.js.map +1 -0
- package/dist/chunk-7N4KAIGN.js +133 -0
- package/dist/chunk-7N4KAIGN.js.map +1 -0
- package/dist/chunk-7OZ53EXP.js +101 -0
- package/dist/chunk-7OZ53EXP.js.map +1 -0
- package/dist/chunk-7XYTQGCC.js +134 -0
- package/dist/chunk-7XYTQGCC.js.map +1 -0
- package/dist/chunk-A2XUIMJ3.js +341 -0
- package/dist/chunk-A2XUIMJ3.js.map +1 -0
- package/dist/chunk-AGZQD76C.js +201 -0
- package/dist/chunk-AGZQD76C.js.map +1 -0
- package/dist/chunk-APO3DCMU.js +361 -0
- package/dist/chunk-APO3DCMU.js.map +1 -0
- package/dist/chunk-BFBF3XEF.js +283 -0
- package/dist/chunk-BFBF3XEF.js.map +1 -0
- package/dist/chunk-BJ3KMYTB.js +1974 -0
- package/dist/chunk-BJ3KMYTB.js.map +1 -0
- package/dist/chunk-CHEL3SKB.js +6758 -0
- package/dist/chunk-CHEL3SKB.js.map +1 -0
- package/dist/chunk-CQZRLNMV.js +1491 -0
- package/dist/chunk-CQZRLNMV.js.map +1 -0
- package/dist/chunk-D46YSIYX.js +892 -0
- package/dist/chunk-D46YSIYX.js.map +1 -0
- package/dist/chunk-DINWEURR.js +648 -0
- package/dist/chunk-DINWEURR.js.map +1 -0
- package/dist/chunk-DK5LDEQM.js +530 -0
- package/dist/chunk-DK5LDEQM.js.map +1 -0
- package/dist/chunk-DOM4GKSW.js +34 -0
- package/dist/chunk-DOM4GKSW.js.map +1 -0
- package/dist/chunk-EDTHC6UD.js +1075 -0
- package/dist/chunk-EFJ3MQ4V.js +721 -0
- package/dist/chunk-EHRTFRWW.js +89 -0
- package/dist/chunk-EHRTFRWW.js.map +1 -0
- package/dist/chunk-FAJ7FZYM.js +11 -0
- package/dist/chunk-FAJ7FZYM.js.map +1 -0
- package/dist/chunk-FBYESMQ2.js +570 -0
- package/dist/chunk-FDU6HUUL.js +147 -0
- package/dist/chunk-FF4KLI5W.js +99 -0
- package/dist/chunk-FF4KLI5W.js.map +1 -0
- package/dist/chunk-FIT6DMX6.js +310 -0
- package/dist/chunk-FIT6DMX6.js.map +1 -0
- package/dist/chunk-FJ43PRLT.js +272 -0
- package/dist/chunk-FJ43PRLT.js.map +1 -0
- package/dist/chunk-FKFMOY3N.js +32 -0
- package/dist/chunk-FKFMOY3N.js.map +1 -0
- package/dist/chunk-FLTNHQK6.js +262 -0
- package/dist/chunk-FLTNHQK6.js.map +1 -0
- package/dist/chunk-GA454ALV.js +12436 -0
- package/dist/chunk-GA454ALV.js.map +1 -0
- package/dist/chunk-GGKRUQOO.js +228 -0
- package/dist/chunk-GIF42EW3.js +63 -0
- package/dist/chunk-GIF42EW3.js.map +1 -0
- package/dist/chunk-GL6I6MEQ.js +647 -0
- package/dist/chunk-H3ME6L6D.js +709 -0
- package/dist/chunk-H3ME6L6D.js.map +1 -0
- package/dist/chunk-HHLLAQGZ.js +1 -0
- package/dist/chunk-HXXBL2KD.js +2040 -0
- package/dist/chunk-I5V2VDIW.js +219 -0
- package/dist/chunk-I5V2VDIW.js.map +1 -0
- package/dist/chunk-I6K5FBRQ.js +35 -0
- package/dist/chunk-I6K5FBRQ.js.map +1 -0
- package/dist/chunk-ICRIXAP2.js +121 -0
- package/dist/chunk-ICRIXAP2.js.map +1 -0
- package/dist/chunk-J4EB7DNW.js +11 -0
- package/dist/chunk-J4EB7DNW.js.map +1 -0
- package/dist/chunk-JLFA7DQG.js +62 -0
- package/dist/chunk-JLFA7DQG.js.map +1 -0
- package/dist/chunk-KJTKLXTH.js +9 -0
- package/dist/chunk-KJTKLXTH.js.map +1 -0
- package/dist/chunk-KLAO5DGL.js +917 -0
- package/dist/chunk-KLAO5DGL.js.map +1 -0
- package/dist/chunk-KNKUID7G.js +183 -0
- package/dist/chunk-KOSORCJG.js +624 -0
- package/dist/chunk-KOSORCJG.js.map +1 -0
- package/dist/chunk-KUJVMMZQ.js +1262 -0
- package/dist/chunk-KUJVMMZQ.js.map +1 -0
- package/dist/chunk-LCR46JY5.js +123 -0
- package/dist/chunk-LCR46JY5.js.map +1 -0
- package/dist/chunk-LLQ2LLWF.js +148 -0
- package/dist/chunk-LLQ2LLWF.js.map +1 -0
- package/dist/chunk-LPMVBPA3.js +236 -0
- package/dist/chunk-LT3NLYSI.js +50 -0
- package/dist/chunk-LT3NLYSI.js.map +1 -0
- package/dist/chunk-LUDTDZLK.js +287 -0
- package/dist/chunk-LUDTDZLK.js.map +1 -0
- package/dist/chunk-M23FSH32.js +3963 -0
- package/dist/chunk-M23FSH32.js.map +1 -0
- package/dist/chunk-MC26UJIM.js +118 -0
- package/dist/chunk-ME6ESPZU.js +119 -0
- package/dist/chunk-ME6ESPZU.js.map +1 -0
- package/dist/chunk-MGKYQQYF.js +272 -0
- package/dist/chunk-MJFNCJXV.js +66 -0
- package/dist/chunk-MJFNCJXV.js.map +1 -0
- package/dist/chunk-MSWG7JI6.js +237 -0
- package/dist/chunk-MSWG7JI6.js.map +1 -0
- package/dist/chunk-MT25YHYH.js +141 -0
- package/dist/chunk-MT25YHYH.js.map +1 -0
- package/dist/chunk-MT4HVDUZ.js +53 -0
- package/dist/chunk-MY6TPVXW.js +219 -0
- package/dist/chunk-N2D6GXBM.js +267 -0
- package/dist/chunk-N2D6GXBM.js.map +1 -0
- package/dist/chunk-NJ3MJQZX.js +46 -0
- package/dist/chunk-NJ3MJQZX.js.map +1 -0
- package/dist/chunk-NMZY542O.js +335 -0
- package/dist/chunk-NMZY542O.js.map +1 -0
- package/dist/chunk-NNVTUXEB.js +23 -0
- package/dist/chunk-NZL6GGQE.js +375 -0
- package/dist/chunk-NZL6GGQE.js.map +1 -0
- package/dist/chunk-P4NEIHUT.js +108 -0
- package/dist/chunk-P7FMDTKL.js +103 -0
- package/dist/chunk-P7FMDTKL.js.map +1 -0
- package/dist/chunk-PHK3HARR.js +32 -0
- package/dist/chunk-PHK3HARR.js.map +1 -0
- package/dist/chunk-PIRJPV5T.js +98 -0
- package/dist/chunk-PIRJPV5T.js.map +1 -0
- package/dist/chunk-PK7H5L6Y.js +159 -0
- package/dist/chunk-PK7H5L6Y.js.map +1 -0
- package/dist/chunk-PR5FBTFU.js +233 -0
- package/dist/chunk-PR5FBTFU.js.map +1 -0
- package/dist/chunk-PU63GXWS.js +174 -0
- package/dist/chunk-PU63GXWS.js.map +1 -0
- package/dist/chunk-PZIAX57I.js +124 -0
- package/dist/chunk-PZIAX57I.js.map +1 -0
- package/dist/chunk-Q7P4WJDP.js +26 -0
- package/dist/chunk-Q7P4WJDP.js.map +1 -0
- package/dist/chunk-QQUAB63I.js +63 -0
- package/dist/chunk-QQUAB63I.js.map +1 -0
- package/dist/chunk-QRNI5JBH.js +18 -0
- package/dist/chunk-RHY3HH7P.js +601 -0
- package/dist/chunk-RHY3HH7P.js.map +1 -0
- package/dist/chunk-RRF5UOBJ.js +91 -0
- package/dist/chunk-RXDLTSWT.js +124 -0
- package/dist/chunk-RXDLTSWT.js.map +1 -0
- package/dist/chunk-RYED3SPJ.js +42 -0
- package/dist/chunk-RYED3SPJ.js.map +1 -0
- package/dist/chunk-S7KDBTWT.js +106 -0
- package/dist/chunk-S7KDBTWT.js.map +1 -0
- package/dist/chunk-SEDEKFYQ.js +1 -0
- package/dist/chunk-TECVW3JP.js +36 -0
- package/dist/chunk-TECVW3JP.js.map +1 -0
- package/dist/chunk-TFO23QT4.js +88 -0
- package/dist/chunk-TFO23QT4.js.map +1 -0
- package/dist/chunk-TK4UEOSK.js +76 -0
- package/dist/chunk-TK4UEOSK.js.map +1 -0
- package/dist/chunk-TKWGAOLV.js +122 -0
- package/dist/chunk-TKWGAOLV.js.map +1 -0
- package/dist/chunk-TMM4S4IJ.js +597 -0
- package/dist/chunk-TMM4S4IJ.js.map +1 -0
- package/dist/chunk-TMQLARTH.js +188 -0
- package/dist/chunk-TMQLARTH.js.map +1 -0
- package/dist/chunk-TPDBFYEG.js +130 -0
- package/dist/chunk-TPDBFYEG.js.map +1 -0
- package/dist/chunk-TPMQ3G6Z.js +145 -0
- package/dist/chunk-TPMQ3G6Z.js.map +1 -0
- package/dist/chunk-TZOLIGIG.js +61 -0
- package/dist/chunk-TZOLIGIG.js.map +1 -0
- package/dist/chunk-U3PN77QT.js +113 -0
- package/dist/chunk-U3WSW6PZ.js +277 -0
- package/dist/chunk-U4SCL7B7.js +640 -0
- package/dist/chunk-U4SCL7B7.js.map +1 -0
- package/dist/chunk-UWK5OXUJ.js +156 -0
- package/dist/chunk-UWK5OXUJ.js.map +1 -0
- package/dist/chunk-UWVJF25J.js +74 -0
- package/dist/chunk-UXHQAFNA.js +1317 -0
- package/dist/chunk-UXHQAFNA.js.map +1 -0
- package/dist/chunk-V5OCT34X.js +1 -0
- package/dist/chunk-VLXA6PI2.js +304 -0
- package/dist/chunk-VLXA6PI2.js.map +1 -0
- package/dist/chunk-VNO6ZJ35.js +500 -0
- package/dist/chunk-VNO6ZJ35.js.map +1 -0
- package/dist/chunk-VW676BEI.js +827 -0
- package/dist/chunk-VW676BEI.js.map +1 -0
- package/dist/chunk-W3LR522O.js +2296 -0
- package/dist/chunk-W4L6CZKA.js +96 -0
- package/dist/chunk-W4L6CZKA.js.map +1 -0
- package/dist/chunk-W4RVMTHR.js +372 -0
- package/dist/chunk-W4RVMTHR.js.map +1 -0
- package/dist/chunk-WEHSQBFR.js +188 -0
- package/dist/chunk-WEHSQBFR.js.map +1 -0
- package/dist/chunk-WELDCG6C.js +380 -0
- package/dist/chunk-WELDCG6C.js.map +1 -0
- package/dist/chunk-WZYKANL3.js +2800 -0
- package/dist/chunk-WZYKANL3.js.map +1 -0
- package/dist/chunk-XIG5PDM7.js +48 -0
- package/dist/chunk-XJNBEDFE.js +193 -0
- package/dist/chunk-XJNBEDFE.js.map +1 -0
- package/dist/chunk-XVVIG67A.js +291 -0
- package/dist/chunk-XVVIG67A.js.map +1 -0
- package/dist/chunk-XVZ7B3HG.js +135 -0
- package/dist/chunk-YBPYIAA5.js +73 -0
- package/dist/chunk-YBPYIAA5.js.map +1 -0
- package/dist/chunk-Z734BLO3.js +21 -0
- package/dist/chunk-Z734BLO3.js.map +1 -0
- package/dist/chunk-ZKSK55RC.js +269 -0
- package/dist/chunk-ZKSK55RC.js.map +1 -0
- package/dist/chunk-ZTFCYYEZ.js +69 -0
- package/dist/chunk-ZTFCYYEZ.js.map +1 -0
- package/dist/chunk-ZY2MNJR6.js +329 -0
- package/dist/chunk-ZY2MNJR6.js.map +1 -0
- package/dist/cli-D3VpkVwB.d.ts +1136 -0
- package/dist/cli.d.ts +39 -10
- package/dist/cli.js +108 -49
- package/dist/commitment-ledger.js +1 -1
- package/dist/compat/checks.d.ts +5 -0
- package/dist/compat/checks.js +11 -0
- package/dist/compat/checks.js.map +1 -0
- package/dist/compat/types.d.ts +30 -0
- package/dist/compat/types.js +1 -0
- package/dist/compat/types.js.map +1 -0
- package/dist/compounding/engine.d.ts +221 -0
- package/dist/compounding/engine.js +32 -0
- package/dist/compounding/engine.js.map +1 -0
- package/dist/compounding/preference-consolidator.d.ts +92 -0
- package/dist/compounding/preference-consolidator.js +553 -0
- package/dist/compounding/preference-consolidator.js.map +1 -0
- package/dist/config.d.ts +4 -2
- package/dist/config.js +9 -4
- package/dist/conflict-policy-DyJ2wd-h.d.ts +4 -0
- package/dist/connectors/codex-materialize-runner.d.ts +64 -0
- package/dist/connectors/codex-materialize-runner.js +33 -0
- package/dist/connectors/codex-materialize-runner.js.map +1 -0
- package/dist/connectors/codex-materialize.d.ts +195 -0
- package/dist/connectors/codex-materialize.js +38 -0
- package/dist/connectors/codex-materialize.js.map +1 -0
- package/dist/connectors/index.d.ts +444 -0
- package/dist/connectors/index.js +115 -0
- package/dist/connectors/index.js.map +1 -0
- package/dist/connectors-cli-CwbyjGR7.d.ts +257 -0
- package/dist/connectors-cli.d.ts +1 -1
- package/dist/consolidation-provenance-check.d.ts +3 -1
- package/dist/consolidation-undo.d.ts +3 -1
- package/dist/contradiction/index.d.ts +258 -0
- package/dist/contradiction/index.js +43 -0
- package/dist/contradiction/index.js.map +1 -0
- package/dist/contradiction-review-ATP4S6IC.js +30 -0
- package/dist/contradiction-review-ATP4S6IC.js.map +1 -0
- package/dist/contradiction-scan-5A4IDZV5.js +13 -0
- package/dist/contradiction-scan-5A4IDZV5.js.map +1 -0
- package/dist/conversation-index/backend.d.ts +97 -0
- package/dist/conversation-index/backend.js +13 -0
- package/dist/conversation-index/backend.js.map +1 -0
- package/dist/conversation-index/chunker.d.ts +16 -0
- package/dist/conversation-index/chunker.js +8 -0
- package/dist/conversation-index/chunker.js.map +1 -0
- package/dist/conversation-index/cleanup.d.ts +11 -0
- package/dist/conversation-index/cleanup.js +9 -0
- package/dist/conversation-index/cleanup.js.map +1 -0
- package/dist/conversation-index/faiss-adapter.d.ts +6 -0
- package/dist/conversation-index/faiss-adapter.js +16 -0
- package/dist/conversation-index/faiss-adapter.js.map +1 -0
- package/dist/conversation-index/indexer.d.ts +23 -0
- package/dist/conversation-index/indexer.js +15 -0
- package/dist/conversation-index/indexer.js.map +1 -0
- package/dist/conversation-index/search.d.ts +6 -0
- package/dist/conversation-index/search.js +11 -0
- package/dist/conversation-index/search.js.map +1 -0
- package/dist/embedding-fallback.js +2 -2
- package/dist/enrichment/index.d.ts +163 -0
- package/dist/enrichment/index.js +18 -0
- package/dist/enrichment/index.js.map +1 -0
- package/dist/entity-retrieval.d.ts +4 -2
- package/dist/entity-retrieval.js +8 -5
- package/dist/evals.js +1 -1
- package/dist/explicit-capture.d.ts +20 -5
- package/dist/explicit-capture.js +2 -2
- package/dist/extraction-judge-training.js +1 -1
- package/dist/extraction.js +8 -8
- package/dist/faiss-adapter-CzPghc4C.d.ts +70 -0
- package/dist/fallback-llm.d.ts +2 -0
- package/dist/fallback-llm.js +4 -4
- package/dist/graph-edge-decay-5DI5GUNL.js +207 -0
- package/dist/index.d.ts +66 -711
- package/dist/index.js +556 -2680
- package/dist/index.js.map +1 -1
- package/dist/lcm/archive.d.ts +89 -0
- package/dist/lcm/archive.js +12 -0
- package/dist/lcm/archive.js.map +1 -0
- package/dist/lcm/dag.d.ts +48 -0
- package/dist/lcm/dag.js +8 -0
- package/dist/lcm/dag.js.map +1 -0
- package/dist/lcm/engine.d.ts +116 -0
- package/dist/lcm/engine.js +20 -0
- package/dist/lcm/engine.js.map +1 -0
- package/dist/lcm/index.d.ts +12 -0
- package/dist/lcm/index.js +44 -0
- package/dist/lcm/index.js.map +1 -0
- package/dist/lcm/queue.d.ts +62 -0
- package/dist/lcm/queue.js +8 -0
- package/dist/lcm/queue.js.map +1 -0
- package/dist/lcm/recall.d.ts +20 -0
- package/dist/lcm/recall.js +8 -0
- package/dist/lcm/recall.js.map +1 -0
- package/dist/lcm/schema.d.ts +16 -0
- package/dist/lcm/schema.js +14 -0
- package/dist/lcm/schema.js.map +1 -0
- package/dist/lcm/summarizer.d.ts +38 -0
- package/dist/lcm/summarizer.js +12 -0
- package/dist/lcm/summarizer.js.map +1 -0
- package/dist/lcm/tools.d.ts +29 -0
- package/dist/lcm/tools.js +8 -0
- package/dist/lcm/tools.js.map +1 -0
- package/dist/live-connectors-runner.js +5 -5
- package/dist/local-llm.js +3 -3
- package/dist/maintenance/archive-observations.d.ts +18 -0
- package/dist/maintenance/archive-observations.js +8 -0
- package/dist/maintenance/archive-observations.js.map +1 -0
- package/dist/maintenance/backup-stamp.d.ts +3 -0
- package/dist/maintenance/backup-stamp.js +8 -0
- package/dist/maintenance/backup-stamp.js.map +1 -0
- package/dist/maintenance/memory-governance-cron.d.ts +85 -0
- package/dist/maintenance/memory-governance-cron.js +22 -0
- package/dist/maintenance/memory-governance-cron.js.map +1 -0
- package/dist/maintenance/memory-governance.d.ts +137 -0
- package/dist/maintenance/memory-governance.js +40 -0
- package/dist/maintenance/memory-governance.js.map +1 -0
- package/dist/maintenance/migrate-observations.d.ts +18 -0
- package/dist/maintenance/migrate-observations.js +9 -0
- package/dist/maintenance/migrate-observations.js.map +1 -0
- package/dist/maintenance/observation-ledger-utils.d.ts +10 -0
- package/dist/maintenance/observation-ledger-utils.js +10 -0
- package/dist/maintenance/observation-ledger-utils.js.map +1 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +15 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +28 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js.map +1 -0
- package/dist/maintenance/rebuild-memory-projection.d.ts +77 -0
- package/dist/maintenance/rebuild-memory-projection.js +35 -0
- package/dist/maintenance/rebuild-memory-projection.js.map +1 -0
- package/dist/maintenance/rebuild-observations.d.ts +17 -0
- package/dist/maintenance/rebuild-observations.js +9 -0
- package/dist/maintenance/rebuild-observations.js.map +1 -0
- package/dist/mcp-memory-inspector-app.d.ts +24 -6
- package/dist/memory-projection-store.d.ts +108 -3
- package/dist/memory-projection-store.js +2 -1
- package/dist/memory-worth-outcomes.d.ts +4 -2
- package/dist/migrate/from-engram.d.ts +24 -0
- package/dist/migrate/from-engram.js +12 -0
- package/dist/migrate/from-engram.js.map +1 -0
- package/dist/namespaces/migrate.d.ts +50 -0
- package/dist/namespaces/migrate.js +50 -0
- package/dist/namespaces/migrate.js.map +1 -0
- package/dist/namespaces/principal.d.ts +17 -0
- package/dist/namespaces/principal.js +16 -0
- package/dist/namespaces/principal.js.map +1 -0
- package/dist/namespaces/search.d.ts +46 -0
- package/dist/namespaces/search.js +28 -0
- package/dist/namespaces/search.js.map +1 -0
- package/dist/namespaces/storage.d.ts +32 -0
- package/dist/namespaces/storage.js +28 -0
- package/dist/namespaces/storage.js.map +1 -0
- package/dist/network/tailscale.d.ts +41 -0
- package/dist/network/tailscale.js +9 -0
- package/dist/network/tailscale.js.map +1 -0
- package/dist/network/webdav.d.ts +39 -0
- package/dist/network/webdav.js +10 -0
- package/dist/network/webdav.js.map +1 -0
- package/dist/objective-state-writers.js +2 -2
- package/dist/operator-toolkit.d.ts +4 -2
- package/dist/operator-toolkit.js +32 -14
- package/dist/opik-exporter.js +2 -2
- package/dist/opik-exporter.js.map +1 -1
- package/dist/orchestrator-DuWl9Hwx.d.ts +1244 -0
- package/dist/orchestrator.d.ts +22 -7
- package/dist/orchestrator.js +79 -44
- package/dist/path-MR5JPYOP.js +9 -0
- package/dist/path-MR5JPYOP.js.map +1 -0
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +102 -3
- package/dist/qmd.js +23 -5
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.js +2 -2
- package/dist/replay/normalizers/chatgpt.d.ts +6 -0
- package/dist/replay/normalizers/chatgpt.js +11 -0
- package/dist/replay/normalizers/chatgpt.js.map +1 -0
- package/dist/replay/normalizers/claude.d.ts +6 -0
- package/dist/replay/normalizers/claude.js +11 -0
- package/dist/replay/normalizers/claude.js.map +1 -0
- package/dist/replay/normalizers/openclaw.d.ts +6 -0
- package/dist/replay/normalizers/openclaw.js +11 -0
- package/dist/replay/normalizers/openclaw.js.map +1 -0
- package/dist/replay/normalizers/shared.d.ts +16 -0
- package/dist/replay/normalizers/shared.js +14 -0
- package/dist/replay/normalizers/shared.js.map +1 -0
- package/dist/replay/runner.d.ts +35 -0
- package/dist/replay/runner.js +16 -0
- package/dist/replay/runner.js.map +1 -0
- package/dist/replay/types.d.ts +57 -0
- package/dist/replay/types.js +19 -0
- package/dist/replay/types.js.map +1 -0
- package/dist/resolution-B7FNQSSP.js +12 -0
- package/dist/resolution-B7FNQSSP.js.map +1 -0
- package/dist/resolve-provider-secret.js +2 -2
- package/dist/resume-bundles.js +8 -6
- package/dist/retrieval-agents.d.ts +1 -1
- package/dist/routing/engine.d.ts +35 -0
- package/dist/routing/engine.js +16 -0
- package/dist/routing/engine.js.map +1 -0
- package/dist/routing/store.d.ts +27 -0
- package/dist/routing/store.js +10 -0
- package/dist/routing/store.js.map +1 -0
- package/dist/runtime/better-sqlite.d.ts +8 -0
- package/dist/runtime/better-sqlite.js +10 -0
- package/dist/runtime/better-sqlite.js.map +1 -0
- package/dist/runtime/child-process.d.ts +32 -0
- package/dist/runtime/child-process.js +10 -0
- package/dist/runtime/child-process.js.map +1 -0
- package/dist/runtime/env.d.ts +5 -0
- package/dist/runtime/env.js +12 -0
- package/dist/runtime/env.js.map +1 -0
- package/dist/schemas.d.ts +22 -22
- package/dist/sdk-compat.js +1 -1
- package/dist/search/document-scanner.d.ts +22 -0
- package/dist/search/document-scanner.js +8 -0
- package/dist/search/document-scanner.js.map +1 -0
- package/dist/search/embed-helper.d.ts +35 -0
- package/dist/search/embed-helper.js +9 -0
- package/dist/search/embed-helper.js.map +1 -0
- package/dist/search/factory.d.ts +32 -0
- package/dist/search/factory.js +29 -0
- package/dist/search/factory.js.map +1 -0
- package/dist/search/index.d.ts +15 -0
- package/dist/search/index.js +50 -0
- package/dist/search/index.js.map +1 -0
- package/dist/search/lancedb-backend.d.ts +51 -0
- package/dist/search/lancedb-backend.js +10 -0
- package/dist/search/lancedb-backend.js.map +1 -0
- package/dist/search/meilisearch-backend.d.ts +48 -0
- package/dist/search/meilisearch-backend.js +10 -0
- package/dist/search/meilisearch-backend.js.map +1 -0
- package/dist/search/noop-backend.d.ts +26 -0
- package/dist/search/noop-backend.js +8 -0
- package/dist/search/noop-backend.js.map +1 -0
- package/dist/search/orama-backend.d.ts +53 -0
- package/dist/search/orama-backend.js +10 -0
- package/dist/search/orama-backend.js.map +1 -0
- package/dist/search/port.d.ts +61 -0
- package/dist/search/port.js +1 -0
- package/dist/search/port.js.map +1 -0
- package/dist/search/remote-backend.d.ts +39 -0
- package/dist/search/remote-backend.js +9 -0
- package/dist/search/remote-backend.js.map +1 -0
- package/dist/secure-store/index.d.ts +890 -0
- package/dist/secure-store/index.js +156 -0
- package/dist/secure-store/index.js.map +1 -0
- package/dist/semantic-VwGI14Ok.d.ts +69 -0
- package/dist/semantic-consolidation-4HkHWgeI.d.ts +180 -0
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +13 -6
- package/dist/semantic-rule-promotion.js +8 -5
- package/dist/semantic-rule-verifier.js +8 -5
- package/dist/shared-context/manager.d.ts +131 -0
- package/dist/shared-context/manager.js +15 -0
- package/dist/shared-context/manager.js.map +1 -0
- package/dist/skills-registry.js +13 -1
- package/dist/skills-registry.js.map +1 -1
- package/dist/state-store-VZU2IA53.js +16 -0
- package/dist/state-store-VZU2IA53.js.map +1 -0
- package/dist/storage-paths.d.ts +9 -0
- package/dist/storage-paths.js +20 -0
- package/dist/storage-paths.js.map +1 -0
- package/dist/storage.d.ts +3 -1
- package/dist/storage.js +7 -4
- package/dist/summarizer.d.ts +5 -0
- package/dist/summarizer.js +9 -8
- package/dist/summary-snapshot.js +2 -1
- package/dist/surfaces/dreams.d.ts +16 -0
- package/dist/surfaces/dreams.js +282 -0
- package/dist/surfaces/dreams.js.map +1 -0
- package/dist/surfaces/heartbeat.d.ts +17 -0
- package/dist/surfaces/heartbeat.js +265 -0
- package/dist/surfaces/heartbeat.js.map +1 -0
- package/dist/temporal-supersession.d.ts +3 -1
- package/dist/threading.d.ts +5 -0
- package/dist/threading.js +2 -1
- package/dist/tier-migration.d.ts +4 -2
- package/dist/tokens.js +2 -2
- package/dist/transcript.d.ts +15 -1
- package/dist/transcript.js +2 -1
- package/dist/transfer/autodetect.d.ts +4 -0
- package/dist/transfer/autodetect.js +15 -0
- package/dist/transfer/autodetect.js.map +1 -0
- package/dist/transfer/backup.d.ts +21 -0
- package/dist/transfer/backup.js +17 -0
- package/dist/transfer/backup.js.map +1 -0
- package/dist/transfer/capsule-export.d.ts +113 -0
- package/dist/transfer/capsule-export.js +19 -0
- package/dist/transfer/capsule-export.js.map +1 -0
- package/dist/transfer/capsule-import.d.ts +124 -0
- package/dist/transfer/capsule-import.js +16 -0
- package/dist/transfer/capsule-import.js.map +1 -0
- package/dist/transfer/constants.d.ts +13 -0
- package/dist/transfer/constants.js +12 -0
- package/dist/transfer/constants.js.map +1 -0
- package/dist/transfer/export-json.d.ts +11 -0
- package/dist/transfer/export-json.js +11 -0
- package/dist/transfer/export-json.js.map +1 -0
- package/dist/transfer/export-md.d.ts +10 -0
- package/dist/transfer/export-md.js +13 -0
- package/dist/transfer/export-md.js.map +1 -0
- package/dist/transfer/export-sqlite.d.ts +9 -0
- package/dist/transfer/export-sqlite.js +12 -0
- package/dist/transfer/export-sqlite.js.map +1 -0
- package/dist/transfer/fs-utils.d.ts +61 -0
- package/dist/transfer/fs-utils.js +40 -0
- package/dist/transfer/fs-utils.js.map +1 -0
- package/dist/transfer/import-json.d.ts +16 -0
- package/dist/transfer/import-json.js +13 -0
- package/dist/transfer/import-json.js.map +1 -0
- package/dist/transfer/import-md.d.ts +14 -0
- package/dist/transfer/import-md.js +11 -0
- package/dist/transfer/import-md.js.map +1 -0
- package/dist/transfer/import-sqlite.d.ts +14 -0
- package/dist/transfer/import-sqlite.js +12 -0
- package/dist/transfer/import-sqlite.js.map +1 -0
- package/dist/transfer/sqlite-schema.d.ts +4 -0
- package/dist/transfer/sqlite-schema.js +10 -0
- package/dist/transfer/sqlite-schema.js.map +1 -0
- package/dist/transfer/types.d.ts +916 -0
- package/dist/transfer/types.js +30 -0
- package/dist/transfer/types.js.map +1 -0
- package/dist/types.d.ts +28 -1
- package/dist/types.js +1 -1
- package/dist/verified-recall.js +9 -6
- package/dist/work/board.d.ts +43 -0
- package/dist/work/board.js +14 -0
- package/dist/work/board.js.map +1 -0
- package/dist/work/boundary.d.ts +8 -0
- package/dist/work/boundary.js +14 -0
- package/dist/work/boundary.js.map +1 -0
- package/dist/work/storage.d.ts +39 -0
- package/dist/work/storage.js +11 -0
- package/dist/work/storage.js.map +1 -0
- package/dist/work/types.d.ts +75 -0
- package/dist/work/types.js +1 -0
- package/dist/work/types.js.map +1 -0
- package/package.json +2767 -6
- package/scripts/faiss_index.py +816 -0
- package/scripts/faiss_requirements.txt +3 -0
- package/skills/remnic-entities/SKILL.md +51 -0
- package/skills/remnic-memory-workflow/SKILL.md +61 -0
- package/skills/remnic-recall/SKILL.md +51 -0
- package/skills/remnic-remember/SKILL.md +56 -0
- package/skills/remnic-search/SKILL.md +51 -0
- package/skills/remnic-status/SKILL.md +51 -0
- package/src/abort-error.test.ts +49 -0
- package/src/abort-error.ts +46 -0
- package/src/abstraction-nodes.ts +162 -0
- package/src/access-audit.test.ts +178 -0
- package/src/access-audit.ts +125 -0
- package/src/access-cli.test.ts +439 -0
- package/src/access-cli.ts +438 -0
- package/src/access-http.test.ts +225 -0
- package/src/access-http.ts +1899 -0
- package/src/access-idempotency.ts +232 -0
- package/src/access-mcp.test.ts +568 -0
- package/src/access-mcp.ts +3056 -0
- package/src/access-schema-pi.test.ts +60 -0
- package/src/access-schema.ts +522 -0
- package/src/access-service-namespace.test.ts +123 -0
- package/src/access-service.ts +5629 -0
- package/src/action-confidence.test.ts +206 -0
- package/src/action-confidence.ts +466 -0
- package/src/active-memory-bridge.test.ts +285 -0
- package/src/active-memory-bridge.ts +217 -0
- package/src/active-recall.test.ts +484 -0
- package/src/active-recall.ts +459 -0
- package/src/adapters/claude-code.ts +56 -0
- package/src/adapters/codex.ts +57 -0
- package/src/adapters/hermes.ts +64 -0
- package/src/adapters/index.ts +6 -0
- package/src/adapters/registry.ts +41 -0
- package/src/adapters/replit.ts +55 -0
- package/src/adapters/types.ts +51 -0
- package/src/behavior-learner.ts +144 -0
- package/src/behavior-signals.ts +73 -0
- package/src/binary-lifecycle/backend.ts +117 -0
- package/src/binary-lifecycle/index.ts +35 -0
- package/src/binary-lifecycle/manifest.ts +79 -0
- package/src/binary-lifecycle/pipeline.ts +352 -0
- package/src/binary-lifecycle/scanner.ts +89 -0
- package/src/binary-lifecycle/types.ts +89 -0
- package/src/bootstrap.ts +178 -0
- package/src/boxes.ts +521 -0
- package/src/briefing.test.ts +1535 -0
- package/src/briefing.ts +1382 -0
- package/src/buffer-session.test.ts +443 -0
- package/src/buffer-surprise-report.ts +176 -0
- package/src/buffer-surprise-telemetry.test.ts +606 -0
- package/src/buffer-surprise-trigger.test.ts +766 -0
- package/src/buffer-surprise.test.ts +339 -0
- package/src/buffer-surprise.ts +203 -0
- package/src/buffer.ts +900 -0
- package/src/bulk-import/cli-command.test.ts +204 -0
- package/src/bulk-import/index.ts +34 -0
- package/src/bulk-import/pipeline.test.ts +445 -0
- package/src/bulk-import/pipeline.ts +178 -0
- package/src/bulk-import/registry.test.ts +151 -0
- package/src/bulk-import/registry.ts +72 -0
- package/src/bulk-import/types.test.ts +272 -0
- package/src/bulk-import/types.ts +145 -0
- package/src/calibration.ts +394 -0
- package/src/capsule-cli.test.ts +398 -0
- package/src/capsule-cli.ts +565 -0
- package/src/causal-behavior.ts +308 -0
- package/src/causal-chain.ts +419 -0
- package/src/causal-consolidation.ts +370 -0
- package/src/causal-retrieval.ts +286 -0
- package/src/causal-trajectory-graph.ts +60 -0
- package/src/causal-trajectory.ts +303 -0
- package/src/chunking.ts +220 -0
- package/src/citations.ts +232 -0
- package/src/cli.ts +9403 -0
- package/src/codex-cli-fallback.ts +162 -0
- package/src/codex-thread-key.ts +1 -0
- package/src/coding/access-coding-context.test.ts +197 -0
- package/src/coding/coding-branch-scope.test.ts +281 -0
- package/src/coding/coding-namespace.test.ts +360 -0
- package/src/coding/coding-namespace.ts +412 -0
- package/src/coding/coding-orchestrator.test.ts +249 -0
- package/src/coding/git-context.test.ts +507 -0
- package/src/coding/git-context.ts +336 -0
- package/src/coding/mcp-set-coding-context.test.ts +174 -0
- package/src/coding/review-context.test.ts +316 -0
- package/src/coding/review-context.ts +349 -0
- package/src/coding/wire-coding-context.test.ts +468 -0
- package/src/commitment-ledger.test.ts +78 -0
- package/src/commitment-ledger.ts +337 -0
- package/src/compat/checks.test.ts +206 -0
- package/src/compat/checks.ts +716 -0
- package/src/compat/types.ts +33 -0
- package/src/compounding/engine.ts +1686 -0
- package/src/compounding/preference-consolidator.ts +778 -0
- package/src/compression-optimizer.ts +312 -0
- package/src/config.test.ts +930 -0
- package/src/config.ts +3807 -0
- package/src/connectors/codex/instructions.md +160 -0
- package/src/connectors/codex/resources/namespace-cheatsheet.md +48 -0
- package/src/connectors/codex-marketplace.ts +500 -0
- package/src/connectors/codex-materialize-runner.ts +212 -0
- package/src/connectors/codex-materialize.ts +983 -0
- package/src/connectors/coerce.ts +62 -0
- package/src/connectors/index.test.ts +1570 -0
- package/src/connectors/index.ts +3222 -0
- package/src/connectors/live/framework.ts +164 -0
- package/src/connectors/live/github.test.ts +1218 -0
- package/src/connectors/live/github.ts +1068 -0
- package/src/connectors/live/gmail.test.ts +1706 -0
- package/src/connectors/live/gmail.ts +1293 -0
- package/src/connectors/live/google-drive.test.ts +696 -0
- package/src/connectors/live/google-drive.ts +724 -0
- package/src/connectors/live/index.ts +101 -0
- package/src/connectors/live/live-connectors.test.ts +689 -0
- package/src/connectors/live/notion.test.ts +1109 -0
- package/src/connectors/live/notion.ts +978 -0
- package/src/connectors/live/registry.ts +103 -0
- package/src/connectors/live/state-store.ts +399 -0
- package/src/connectors/live/transient-errors.ts +150 -0
- package/src/connectors/weclone-installer.test.ts +850 -0
- package/src/connectors-cli.ts +513 -0
- package/src/console/state.test.ts +224 -0
- package/src/console/state.ts +514 -0
- package/src/console/trace.test.ts +813 -0
- package/src/console/trace.ts +603 -0
- package/src/console/tui.test.ts +582 -0
- package/src/console/tui.ts +508 -0
- package/src/consolidation-operator.ts +182 -0
- package/src/consolidation-provenance-check.ts +551 -0
- package/src/consolidation-undo.ts +718 -0
- package/src/contradiction/contradiction-judge.test.ts +189 -0
- package/src/contradiction/contradiction-judge.ts +333 -0
- package/src/contradiction/contradiction-review.ts +574 -0
- package/src/contradiction/contradiction-scan.ts +504 -0
- package/src/contradiction/contradiction.test.ts +2230 -0
- package/src/contradiction/index.ts +37 -0
- package/src/contradiction/resolution.ts +383 -0
- package/src/conversation-index/backend.ts +323 -0
- package/src/conversation-index/chunker.ts +47 -0
- package/src/conversation-index/cleanup.ts +53 -0
- package/src/conversation-index/faiss-adapter.ts +384 -0
- package/src/conversation-index/indexer.test.ts +164 -0
- package/src/conversation-index/indexer.ts +192 -0
- package/src/conversation-index/search.ts +37 -0
- package/src/cross-namespace-budget.test.ts +275 -0
- package/src/cross-namespace-budget.ts +365 -0
- package/src/cue-anchors.ts +163 -0
- package/src/curation/index.ts +544 -0
- package/src/dashboard-runtime.ts +337 -0
- package/src/day-summary.ts +122 -0
- package/src/dedup/index.ts +330 -0
- package/src/dedup/semantic.test.ts +1577 -0
- package/src/dedup/semantic.ts +148 -0
- package/src/delinearize.ts +193 -0
- package/src/direct-answer-wiring.test.ts +473 -0
- package/src/direct-answer-wiring.ts +180 -0
- package/src/direct-answer.test.ts +484 -0
- package/src/direct-answer.ts +273 -0
- package/src/embedding-fallback.ts +565 -0
- package/src/enrichment/audit.ts +89 -0
- package/src/enrichment/index.ts +27 -0
- package/src/enrichment/pipeline.ts +197 -0
- package/src/enrichment/provider-registry.ts +85 -0
- package/src/enrichment/types.ts +100 -0
- package/src/enrichment/web-search-provider.ts +63 -0
- package/src/entity-retrieval.ts +774 -0
- package/src/entity-schema.ts +239 -0
- package/src/evals.ts +1312 -0
- package/src/event-order-recall.test.ts +4164 -0
- package/src/event-order-recall.ts +2802 -0
- package/src/evidence-pack.test.ts +89 -0
- package/src/evidence-pack.ts +388 -0
- package/src/explicit-capture.ts +530 -0
- package/src/explicit-cue-recall.test.ts +3019 -0
- package/src/explicit-cue-recall.ts +5545 -0
- package/src/extraction-judge-telemetry.ts +234 -0
- package/src/extraction-judge-training.ts +221 -0
- package/src/extraction-judge.ts +846 -0
- package/src/extraction-timeout.test.ts +265 -0
- package/src/extraction.ts +2719 -0
- package/src/fallback-llm.test.ts +1060 -0
- package/src/fallback-llm.ts +918 -0
- package/src/focused-list-recall.test.ts +734 -0
- package/src/focused-list-recall.ts +1160 -0
- package/src/graph-dashboard-diff.ts +35 -0
- package/src/graph-dashboard-key.ts +5 -0
- package/src/graph-dashboard-parser.ts +104 -0
- package/src/graph-edge-reinforcement.ts +192 -0
- package/src/graph-events.ts +151 -0
- package/src/graph-recall.test.ts +164 -0
- package/src/graph-recall.ts +189 -0
- package/src/graph-retrieval.test.ts +809 -0
- package/src/graph-retrieval.ts +823 -0
- package/src/graph-snapshot.ts +329 -0
- package/src/graph.ts +813 -0
- package/src/harmonic-retrieval.ts +223 -0
- package/src/himem.ts +154 -0
- package/src/hygiene.ts +87 -0
- package/src/identity-continuity.ts +333 -0
- package/src/importance.ts +328 -0
- package/src/importers/base.test.ts +294 -0
- package/src/importers/base.ts +436 -0
- package/src/importers/index.ts +21 -0
- package/src/index.ts +1204 -0
- package/src/intent.ts +154 -0
- package/src/json-extract.ts +85 -0
- package/src/json-store.ts +42 -0
- package/src/lcm/archive.ts +617 -0
- package/src/lcm/dag.ts +199 -0
- package/src/lcm/engine.ts +645 -0
- package/src/lcm/index.ts +7 -0
- package/src/lcm/queue.test.ts +178 -0
- package/src/lcm/queue.ts +200 -0
- package/src/lcm/recall.ts +117 -0
- package/src/lcm/schema.ts +154 -0
- package/src/lcm/summarizer.ts +235 -0
- package/src/lcm/tools.ts +191 -0
- package/src/lcm-engine.test.ts +660 -0
- package/src/legacy-hook-compat.test.ts +20 -0
- package/src/legacy-hook-compat.ts +45 -0
- package/src/lifecycle.ts +289 -0
- package/src/live-connectors-runner.ts +385 -0
- package/src/local-llm-qos.test.ts +303 -0
- package/src/local-llm-thinking.test.ts +292 -0
- package/src/local-llm.ts +1464 -0
- package/src/logger.ts +49 -0
- package/src/maintenance/archive-observations.ts +147 -0
- package/src/maintenance/backup-stamp.ts +3 -0
- package/src/maintenance/dreams-ledger.ts +516 -0
- package/src/maintenance/first-start-migration.ts +362 -0
- package/src/maintenance/forget.test.ts +206 -0
- package/src/maintenance/forget.ts +126 -0
- package/src/maintenance/graph-edge-decay.test.ts +409 -0
- package/src/maintenance/graph-edge-decay.ts +394 -0
- package/src/maintenance/memory-governance-cron.ts +447 -0
- package/src/maintenance/memory-governance.ts +1039 -0
- package/src/maintenance/migrate-observations.ts +216 -0
- package/src/maintenance/observation-ledger-utils.ts +54 -0
- package/src/maintenance/pattern-reinforcement.test.ts +875 -0
- package/src/maintenance/pattern-reinforcement.ts +369 -0
- package/src/maintenance/purge.ts +334 -0
- package/src/maintenance/rebuild-memory-lifecycle-ledger.ts +78 -0
- package/src/maintenance/rebuild-memory-projection.ts +1234 -0
- package/src/maintenance/rebuild-observations.ts +178 -0
- package/src/maintenance/tier-stats.test.ts +378 -0
- package/src/maintenance/tier-stats.ts +222 -0
- package/src/mcp-memory-inspector-app.ts +421 -0
- package/src/memory-action-policy.ts +80 -0
- package/src/memory-cache.ts +208 -0
- package/src/memory-extension/claude-code-publisher.ts +51 -0
- package/src/memory-extension/codex-publisher.ts +149 -0
- package/src/memory-extension/hermes-publisher.ts +51 -0
- package/src/memory-extension/index.ts +100 -0
- package/src/memory-extension/shared-instructions.ts +133 -0
- package/src/memory-extension/types.ts +86 -0
- package/src/memory-extension-host/host-discovery.ts +276 -0
- package/src/memory-extension-host/index.ts +14 -0
- package/src/memory-extension-host/render-extensions-block.ts +73 -0
- package/src/memory-extension-host/types.ts +21 -0
- package/src/memory-lifecycle-ledger-utils.ts +116 -0
- package/src/memory-projection-format.ts +11 -0
- package/src/memory-projection-store.ts +951 -0
- package/src/memory-provenance.test.ts +196 -0
- package/src/memory-provenance.ts +484 -0
- package/src/memory-worth-bench.test.ts +71 -0
- package/src/memory-worth-bench.ts +265 -0
- package/src/memory-worth-filter.test.ts +209 -0
- package/src/memory-worth-filter.ts +204 -0
- package/src/memory-worth-frontmatter.test.ts +311 -0
- package/src/memory-worth-outcomes.test.ts +316 -0
- package/src/memory-worth-outcomes.ts +286 -0
- package/src/memory-worth.test.ts +317 -0
- package/src/memory-worth.ts +215 -0
- package/src/message-parts/index.ts +806 -0
- package/src/message-parts/message-parts.test.ts +421 -0
- package/src/migrate/from-engram.ts +789 -0
- package/src/model-registry.ts +313 -0
- package/src/models-json.ts +76 -0
- package/src/namespaces/migrate.ts +187 -0
- package/src/namespaces/path.ts +25 -0
- package/src/namespaces/principal.test.ts +195 -0
- package/src/namespaces/principal.ts +86 -0
- package/src/namespaces/search.test.ts +105 -0
- package/src/namespaces/search.ts +233 -0
- package/src/namespaces/storage.ts +74 -0
- package/src/native-knowledge.ts +1823 -0
- package/src/negative.ts +72 -0
- package/src/network/tailscale.ts +179 -0
- package/src/network/webdav.ts +385 -0
- package/src/objective-state-writers.ts +951 -0
- package/src/objective-state.ts +320 -0
- package/src/onboarding/index.ts +529 -0
- package/src/openai-chat-compat.ts +56 -0
- package/src/operator-toolkit.ts +2132 -0
- package/src/opik-exporter.test.ts +72 -0
- package/src/opik-exporter.ts +587 -0
- package/src/orchestrator-extraction-queue.test.ts +197 -0
- package/src/orchestrator-flush.test.ts +1171 -0
- package/src/orchestrator-pattern-reinforcement.test.ts +128 -0
- package/src/orchestrator-source-attribution.test.ts +701 -0
- package/src/orchestrator.ts +16368 -0
- package/src/page-versioning.ts +450 -0
- package/src/patterns-cli.ts +574 -0
- package/src/peers/index.ts +54 -0
- package/src/peers/migrate-from-identity-anchor.test.ts +291 -0
- package/src/peers/migrate-from-identity-anchor.ts +350 -0
- package/src/peers/peers.test.ts +419 -0
- package/src/peers/profile-reasoner.ts +694 -0
- package/src/peers/storage.ts +1350 -0
- package/src/peers/types.ts +138 -0
- package/src/plugin-id.ts +84 -0
- package/src/policy-runtime.ts +209 -0
- package/src/procedural/procedure-miner.ts +150 -0
- package/src/procedural/procedure-recall.ts +93 -0
- package/src/procedural/procedure-stats.ts +213 -0
- package/src/procedural/procedure-types.ts +132 -0
- package/src/procedural/reinforcement-core.test.ts +132 -0
- package/src/procedural/reinforcement-core.ts +73 -0
- package/src/profiling.test.ts +263 -0
- package/src/profiling.ts +435 -0
- package/src/projection/index.ts +398 -0
- package/src/qmd-recall-cache.test.ts +138 -0
- package/src/qmd-recall-cache.ts +111 -0
- package/src/qmd.test.ts +257 -0
- package/src/qmd.ts +2614 -0
- package/src/reasoning-trace-recall.ts +201 -0
- package/src/reasoning-trace-types.ts +235 -0
- package/src/recall-audit-anomaly.test.ts +246 -0
- package/src/recall-audit-anomaly.ts +297 -0
- package/src/recall-audit.test.ts +51 -0
- package/src/recall-audit.ts +72 -0
- package/src/recall-budget-config.test.ts +87 -0
- package/src/recall-disclosure-escalation.test.ts +196 -0
- package/src/recall-disclosure-escalation.ts +158 -0
- package/src/recall-disclosure-shaping.test.ts +146 -0
- package/src/recall-disclosure.test.ts +214 -0
- package/src/recall-explain-renderer.test.ts +140 -0
- package/src/recall-explain-renderer.ts +356 -0
- package/src/recall-mmr.test.ts +808 -0
- package/src/recall-mmr.ts +607 -0
- package/src/recall-qos.test.ts +85 -0
- package/src/recall-qos.ts +82 -0
- package/src/recall-query-policy.ts +221 -0
- package/src/recall-state.test.ts +233 -0
- package/src/recall-state.ts +456 -0
- package/src/recall-tag-filter.ts +143 -0
- package/src/recall-tokenization.ts +35 -0
- package/src/recall-xray-cli.test.ts +118 -0
- package/src/recall-xray-cli.ts +100 -0
- package/src/recall-xray-disclosure-telemetry.test.ts +183 -0
- package/src/recall-xray-renderer.test.ts +539 -0
- package/src/recall-xray-renderer.ts +487 -0
- package/src/recall-xray.test.ts +503 -0
- package/src/recall-xray.ts +621 -0
- package/src/reconstruct.ts +41 -0
- package/src/release-changelog.ts +35 -0
- package/src/relevance.ts +67 -0
- package/src/replay/normalizers/chatgpt.ts +133 -0
- package/src/replay/normalizers/claude.ts +102 -0
- package/src/replay/normalizers/openclaw.ts +119 -0
- package/src/replay/normalizers/shared.ts +69 -0
- package/src/replay/runner.ts +197 -0
- package/src/replay/types.ts +143 -0
- package/src/rerank.test.ts +48 -0
- package/src/rerank.ts +176 -0
- package/src/resolve-auth-token.test.ts +226 -0
- package/src/resolve-auth-token.ts +151 -0
- package/src/resolve-provider-secret.test.ts +187 -0
- package/src/resolve-provider-secret.ts +410 -0
- package/src/response-guidance-recall.test.ts +3952 -0
- package/src/response-guidance-recall.ts +4431 -0
- package/src/resume-bundles.ts +415 -0
- package/src/retrieval-agents.ts +623 -0
- package/src/retrieval-tiers.ts +25 -0
- package/src/retrieval.ts +104 -0
- package/src/review/index.test.ts +201 -0
- package/src/review/index.ts +536 -0
- package/src/routing/engine.ts +162 -0
- package/src/routing/store.ts +321 -0
- package/src/runtime/better-sqlite.test.ts +32 -0
- package/src/runtime/better-sqlite.ts +76 -0
- package/src/runtime/child-process.ts +67 -0
- package/src/runtime/env.ts +48 -0
- package/src/sanitize.ts +58 -0
- package/src/schemas.ts +449 -0
- package/src/sdk-compat.ts +87 -0
- package/src/search/document-scanner.ts +96 -0
- package/src/search/embed-helper.ts +142 -0
- package/src/search/factory.ts +189 -0
- package/src/search/index.ts +10 -0
- package/src/search/lancedb-backend.ts +342 -0
- package/src/search/meilisearch-backend.ts +232 -0
- package/src/search/noop-backend.ts +57 -0
- package/src/search/orama-backend.ts +358 -0
- package/src/search/port.ts +86 -0
- package/src/search/remote-backend.ts +124 -0
- package/src/secure-store/cipher.ts +271 -0
- package/src/secure-store/cli-handlers.ts +355 -0
- package/src/secure-store/cli-renderer.ts +131 -0
- package/src/secure-store/header.ts +373 -0
- package/src/secure-store/index.ts +137 -0
- package/src/secure-store/kdf.ts +263 -0
- package/src/secure-store/keyring.ts +106 -0
- package/src/secure-store/metadata.ts +394 -0
- package/src/secure-store/passphrase-reader.ts +252 -0
- package/src/secure-store/secure-fs.ts +571 -0
- package/src/secure-store/secure-store.test.ts +755 -0
- package/src/semantic-chunking.ts +545 -0
- package/src/semantic-consolidation.test.ts +182 -0
- package/src/semantic-consolidation.ts +432 -0
- package/src/semantic-rule-promotion.ts +183 -0
- package/src/semantic-rule-verifier.ts +160 -0
- package/src/session-integrity.ts +569 -0
- package/src/session-observer-bands.ts +11 -0
- package/src/session-observer-state.ts +346 -0
- package/src/session-toggles.test.ts +96 -0
- package/src/session-toggles.ts +159 -0
- package/src/shared-context/manager.ts +810 -0
- package/src/signal.ts +84 -0
- package/src/skills-registry.test.ts +277 -0
- package/src/skills-registry.ts +120 -0
- package/src/source-attribution-roundtrip.test.ts +215 -0
- package/src/source-attribution.test.ts +1425 -0
- package/src/source-attribution.ts +639 -0
- package/src/spaces/index.ts +627 -0
- package/src/storage-paths.ts +117 -0
- package/src/storage.ts +6657 -0
- package/src/store-contract.ts +55 -0
- package/src/summarizer.ts +844 -0
- package/src/summary-snapshot.test.ts +681 -0
- package/src/summary-snapshot.ts +238 -0
- package/src/surfaces/dreams.test.ts +394 -0
- package/src/surfaces/dreams.ts +346 -0
- package/src/surfaces/heartbeat.test.ts +415 -0
- package/src/surfaces/heartbeat.ts +325 -0
- package/src/sync/index.ts +308 -0
- package/src/targeted-fact-recall.test.ts +1694 -0
- package/src/targeted-fact-recall.ts +2905 -0
- package/src/taxonomy/default-taxonomy.ts +87 -0
- package/src/taxonomy/index.ts +26 -0
- package/src/taxonomy/resolver-doc-generator.ts +57 -0
- package/src/taxonomy/resolver.ts +184 -0
- package/src/taxonomy/taxonomy-loader.ts +186 -0
- package/src/taxonomy/types.ts +48 -0
- package/src/telemetry-transcript.ts +70 -0
- package/src/temporal-index.ts +890 -0
- package/src/temporal-supersession.test.ts +2703 -0
- package/src/temporal-supersession.ts +493 -0
- package/src/temporal-validity.test.ts +448 -0
- package/src/temporal-validity.ts +123 -0
- package/src/threading.ts +395 -0
- package/src/tier-migration.ts +124 -0
- package/src/tier-routing.ts +102 -0
- package/src/tmt.ts +462 -0
- package/src/tokens.test.ts +178 -0
- package/src/tokens.ts +279 -0
- package/src/topics.ts +147 -0
- package/src/training-export/cli-date-validation.test.ts +258 -0
- package/src/training-export/converter.test.ts +452 -0
- package/src/training-export/converter.ts +319 -0
- package/src/training-export/date-parse.ts +117 -0
- package/src/training-export/index.ts +26 -0
- package/src/training-export/registry.test.ts +85 -0
- package/src/training-export/registry.ts +57 -0
- package/src/training-export/types.ts +31 -0
- package/src/transcript.ts +1179 -0
- package/src/transfer/autodetect.ts +30 -0
- package/src/transfer/backup.ts +138 -0
- package/src/transfer/capsule-crypto.ts +485 -0
- package/src/transfer/capsule-encrypt.test.ts +690 -0
- package/src/transfer/capsule-export.ts +543 -0
- package/src/transfer/capsule-fork.ts +375 -0
- package/src/transfer/capsule-import.ts +564 -0
- package/src/transfer/capsule-merge.ts +433 -0
- package/src/transfer/conflict-policy.ts +16 -0
- package/src/transfer/constants.ts +13 -0
- package/src/transfer/exclusions.ts +37 -0
- package/src/transfer/export-json.ts +65 -0
- package/src/transfer/export-md.ts +59 -0
- package/src/transfer/export-sqlite.ts +52 -0
- package/src/transfer/fs-utils.ts +269 -0
- package/src/transfer/import-json.ts +108 -0
- package/src/transfer/import-md.ts +84 -0
- package/src/transfer/import-sqlite.ts +100 -0
- package/src/transfer/integrity.ts +71 -0
- package/src/transfer/sqlite-schema.ts +16 -0
- package/src/transfer/types.ts +297 -0
- package/src/trust-zones.ts +1186 -0
- package/src/types.ts +3074 -0
- package/src/user-model.test.ts +124 -0
- package/src/user-model.ts +162 -0
- package/src/utility-learner.ts +353 -0
- package/src/utility-runtime.ts +88 -0
- package/src/utility-telemetry.ts +215 -0
- package/src/utils/category-dir.ts +44 -0
- package/src/utils/errno.ts +6 -0
- package/src/utils/iso-timestamp.test.ts +37 -0
- package/src/utils/iso-timestamp.ts +164 -0
- package/src/utils/path.ts +26 -0
- package/src/verified-recall.ts +138 -0
- package/src/version-utils.test.ts +10 -0
- package/src/version-utils.ts +9 -0
- package/src/whitespace.ts +10 -0
- package/src/work/board.ts +359 -0
- package/src/work/boundary.ts +107 -0
- package/src/work/storage.ts +436 -0
- package/src/work/types.ts +82 -0
- package/src/work-product-ledger.ts +265 -0
- package/dist/access-service-DDjzFALq.d.ts +0 -2088
- package/dist/capsule-crypto-SJS5VVAP.js +0 -18
- package/dist/capsule-export-7QNCBZOQ.js +0 -17
- package/dist/capsule-import-EPBHD2EN.js +0 -16
- package/dist/capsule-merge-DI7PNQ2H.js +0 -189
- package/dist/chunk-23ZZK64Y.js +0 -26
- package/dist/chunk-23ZZK64Y.js.map +0 -1
- package/dist/chunk-242S3I2A.js +0 -647
- package/dist/chunk-2LGMW3DJ.js +0 -111
- package/dist/chunk-3B6KIRBH.js +0 -5213
- package/dist/chunk-3B6KIRBH.js.map +0 -1
- package/dist/chunk-457A4P3L.js +0 -119
- package/dist/chunk-457A4P3L.js.map +0 -1
- package/dist/chunk-4IS4SXIQ.js +0 -2040
- package/dist/chunk-4YM32CRU.js +0 -721
- package/dist/chunk-6TBWYBJ3.js +0 -236
- package/dist/chunk-74EMIVE4.js +0 -329
- package/dist/chunk-74EMIVE4.js.map +0 -1
- package/dist/chunk-767ODGE6.js +0 -183
- package/dist/chunk-7V22HTMD.js +0 -623
- package/dist/chunk-7V22HTMD.js.map +0 -1
- package/dist/chunk-7ZM3BFKK.js +0 -9705
- package/dist/chunk-7ZM3BFKK.js.map +0 -1
- package/dist/chunk-AQJNPMOA.js +0 -643
- package/dist/chunk-AQJNPMOA.js.map +0 -1
- package/dist/chunk-ASAITVLA.js +0 -64
- package/dist/chunk-ASAITVLA.js.map +0 -1
- package/dist/chunk-BBE34QBJ.js +0 -275
- package/dist/chunk-BBE34QBJ.js.map +0 -1
- package/dist/chunk-BZSQEPRW.js +0 -14710
- package/dist/chunk-BZSQEPRW.js.map +0 -1
- package/dist/chunk-CPKTBRS2.js +0 -891
- package/dist/chunk-CPKTBRS2.js.map +0 -1
- package/dist/chunk-D4GAOFF6.js +0 -562
- package/dist/chunk-D4GAOFF6.js.map +0 -1
- package/dist/chunk-D54LZC5L.js +0 -147
- package/dist/chunk-DF3RVK3X.js +0 -119
- package/dist/chunk-DF3RVK3X.js.map +0 -1
- package/dist/chunk-DZZPC36E.js +0 -1451
- package/dist/chunk-DZZPC36E.js.map +0 -1
- package/dist/chunk-E2UCDP5S.js +0 -570
- package/dist/chunk-E6K4NIEU.js +0 -747
- package/dist/chunk-E6K4NIEU.js.map +0 -1
- package/dist/chunk-EEQLFRUM.js +0 -89
- package/dist/chunk-ETOW6ACV.js +0 -158
- package/dist/chunk-ETOW6ACV.js.map +0 -1
- package/dist/chunk-FMEBPEAO.js +0 -347
- package/dist/chunk-FMEBPEAO.js.map +0 -1
- package/dist/chunk-FQDPCE3I.js +0 -1837
- package/dist/chunk-FQDPCE3I.js.map +0 -1
- package/dist/chunk-FYIYMQ5N.js +0 -221
- package/dist/chunk-FYIYMQ5N.js.map +0 -1
- package/dist/chunk-G2WADRQ3.js +0 -219
- package/dist/chunk-G4SK7DSQ.js +0 -121
- package/dist/chunk-GVPWB7EY.js +0 -390
- package/dist/chunk-GVPWB7EY.js.map +0 -1
- package/dist/chunk-HELQZFZO.js +0 -1075
- package/dist/chunk-HL5LRPNA.js +0 -1914
- package/dist/chunk-HL5LRPNA.js.map +0 -1
- package/dist/chunk-HQZVVSVB.js +0 -147
- package/dist/chunk-HQZVVSVB.js.map +0 -1
- package/dist/chunk-HY3L4WKC.js +0 -2195
- package/dist/chunk-HY3L4WKC.js.map +0 -1
- package/dist/chunk-IB3BFHGN.js +0 -228
- package/dist/chunk-IXEJRKCZ.js +0 -18
- package/dist/chunk-JBMSGZEQ.js +0 -441
- package/dist/chunk-JBMSGZEQ.js.map +0 -1
- package/dist/chunk-JESOB2HO.js +0 -108
- package/dist/chunk-JKDVIE52.js +0 -272
- package/dist/chunk-JRNQ3RNA.js +0 -284
- package/dist/chunk-JRNQ3RNA.js.map +0 -1
- package/dist/chunk-K6WK37A6.js +0 -865
- package/dist/chunk-K6WK37A6.js.map +0 -1
- package/dist/chunk-MARWOCVP.js +0 -48
- package/dist/chunk-MNU6ZBWT.js +0 -4454
- package/dist/chunk-MNU6ZBWT.js.map +0 -1
- package/dist/chunk-N5AKDXAI.js +0 -74
- package/dist/chunk-OA3L7BFR.js +0 -183
- package/dist/chunk-OA3L7BFR.js.map +0 -1
- package/dist/chunk-OR64ZGRZ.js +0 -23
- package/dist/chunk-P77UEOU2.js +0 -1521
- package/dist/chunk-P77UEOU2.js.map +0 -1
- package/dist/chunk-PH4C2U43.js +0 -239
- package/dist/chunk-PH4C2U43.js.map +0 -1
- package/dist/chunk-RVPLBATS.js +0 -1586
- package/dist/chunk-RVPLBATS.js.map +0 -1
- package/dist/chunk-U5JMRGKX.js +0 -340
- package/dist/chunk-U5JMRGKX.js.map +0 -1
- package/dist/chunk-URB2WSKZ.js +0 -350
- package/dist/chunk-URB2WSKZ.js.map +0 -1
- package/dist/chunk-UVMUAWVT.js +0 -596
- package/dist/chunk-WEJG4TB5.js +0 -118
- package/dist/chunk-X7HPGUVG.js +0 -271
- package/dist/chunk-XAMBKFQS.js +0 -2777
- package/dist/chunk-XAMBKFQS.js.map +0 -1
- package/dist/chunk-XJKFSSDW.js +0 -726
- package/dist/chunk-XJKFSSDW.js.map +0 -1
- package/dist/chunk-XMHBH5H6.js +0 -283
- package/dist/chunk-XMHBH5H6.js.map +0 -1
- package/dist/chunk-XMVFHBHT.js +0 -277
- package/dist/chunk-Y3VMVTYX.js +0 -53
- package/dist/chunk-YNB73F22.js +0 -137
- package/dist/chunk-YNB73F22.js.map +0 -1
- package/dist/chunk-Z2E7VW55.js +0 -335
- package/dist/chunk-Z2E7VW55.js.map +0 -1
- package/dist/chunk-ZG7PTKBK.js +0 -2296
- package/dist/chunk-ZNQN6ZTA.js +0 -135
- package/dist/chunk-ZVTKDVVM.js +0 -827
- package/dist/chunk-ZVTKDVVM.js.map +0 -1
- package/dist/cli-BR8KpIU0.d.ts +0 -1259
- package/dist/codex-materialize-CQlLTzke.d.ts +0 -139
- package/dist/connectors-cli-DFGtY2DB.d.ts +0 -257
- package/dist/contradiction-review-5LTTVDQV.js +0 -22
- package/dist/contradiction-scan-QTXAMBUA.js +0 -414
- package/dist/contradiction-scan-QTXAMBUA.js.map +0 -1
- package/dist/engine-35M5BKQ7.js +0 -28
- package/dist/fs-utils-IRVUFB6G.js +0 -30
- package/dist/graph-edge-decay-PWB63GRE.js +0 -207
- package/dist/memory-governance-IMPQZXFC.js +0 -37
- package/dist/memory-projection-store-CY8TU40w.d.ts +0 -222
- package/dist/orchestrator-DDMPqU6R.d.ts +0 -1792
- package/dist/path-RMTY5Y5A.js +0 -9
- package/dist/port-B6VEDIkC.d.ts +0 -53
- package/dist/resolution-YGIBORXI.js +0 -101
- package/dist/resolution-YGIBORXI.js.map +0 -1
- package/dist/secure-store-4R2GSO7S.js +0 -156
- package/dist/semantic-consolidation-ByBXb-sf.d.ts +0 -180
- package/dist/state-store-3EH7HYIN.js +0 -16
- package/dist/types-V3FJ26TF.js +0 -30
- /package/dist/{capsule-crypto-SJS5VVAP.js.map → adapters/claude-code.js.map} +0 -0
- /package/dist/{capsule-export-7QNCBZOQ.js.map → adapters/codex.js.map} +0 -0
- /package/dist/{capsule-import-EPBHD2EN.js.map → adapters/hermes.js.map} +0 -0
- /package/dist/{contradiction-review-5LTTVDQV.js.map → adapters/index.js.map} +0 -0
- /package/dist/{engine-35M5BKQ7.js.map → adapters/registry.js.map} +0 -0
- /package/dist/{fs-utils-IRVUFB6G.js.map → adapters/replit.js.map} +0 -0
- /package/dist/{memory-governance-IMPQZXFC.js.map → adapters/types.js.map} +0 -0
- /package/dist/{path-RMTY5Y5A.js.map → capsule-crypto-5CYAGVC5.js.map} +0 -0
- /package/dist/{capsule-merge-DI7PNQ2H.js.map → capsule-merge-4MGKE7C5.js.map} +0 -0
- /package/dist/{chunk-G4SK7DSQ.js.map → chunk-2WWLHTZY.js.map} +0 -0
- /package/dist/{chunk-X7HPGUVG.js.map → chunk-4CRG46BG.js.map} +0 -0
- /package/dist/{chunk-UVMUAWVT.js.map → chunk-7IASACLB.js.map} +0 -0
- /package/dist/{chunk-HELQZFZO.js.map → chunk-EDTHC6UD.js.map} +0 -0
- /package/dist/{chunk-4YM32CRU.js.map → chunk-EFJ3MQ4V.js.map} +0 -0
- /package/dist/{chunk-E2UCDP5S.js.map → chunk-FBYESMQ2.js.map} +0 -0
- /package/dist/{chunk-D54LZC5L.js.map → chunk-FDU6HUUL.js.map} +0 -0
- /package/dist/{chunk-IB3BFHGN.js.map → chunk-GGKRUQOO.js.map} +0 -0
- /package/dist/{chunk-242S3I2A.js.map → chunk-GL6I6MEQ.js.map} +0 -0
- /package/dist/{secure-store-4R2GSO7S.js.map → chunk-HHLLAQGZ.js.map} +0 -0
- /package/dist/{chunk-4IS4SXIQ.js.map → chunk-HXXBL2KD.js.map} +0 -0
- /package/dist/{chunk-767ODGE6.js.map → chunk-KNKUID7G.js.map} +0 -0
- /package/dist/{chunk-6TBWYBJ3.js.map → chunk-LPMVBPA3.js.map} +0 -0
- /package/dist/{chunk-WEJG4TB5.js.map → chunk-MC26UJIM.js.map} +0 -0
- /package/dist/{chunk-JKDVIE52.js.map → chunk-MGKYQQYF.js.map} +0 -0
- /package/dist/{chunk-Y3VMVTYX.js.map → chunk-MT4HVDUZ.js.map} +0 -0
- /package/dist/{chunk-G2WADRQ3.js.map → chunk-MY6TPVXW.js.map} +0 -0
- /package/dist/{chunk-OR64ZGRZ.js.map → chunk-NNVTUXEB.js.map} +0 -0
- /package/dist/{chunk-JESOB2HO.js.map → chunk-P4NEIHUT.js.map} +0 -0
- /package/dist/{chunk-IXEJRKCZ.js.map → chunk-QRNI5JBH.js.map} +0 -0
- /package/dist/{chunk-EEQLFRUM.js.map → chunk-RRF5UOBJ.js.map} +0 -0
- /package/dist/{state-store-3EH7HYIN.js.map → chunk-SEDEKFYQ.js.map} +0 -0
- /package/dist/{chunk-2LGMW3DJ.js.map → chunk-U3PN77QT.js.map} +0 -0
- /package/dist/{chunk-XMVFHBHT.js.map → chunk-U3WSW6PZ.js.map} +0 -0
- /package/dist/{chunk-N5AKDXAI.js.map → chunk-UWVJF25J.js.map} +0 -0
- /package/dist/{types-V3FJ26TF.js.map → chunk-V5OCT34X.js.map} +0 -0
- /package/dist/{chunk-ZG7PTKBK.js.map → chunk-W3LR522O.js.map} +0 -0
- /package/dist/{chunk-MARWOCVP.js.map → chunk-XIG5PDM7.js.map} +0 -0
- /package/dist/{chunk-ZNQN6ZTA.js.map → chunk-XVZ7B3HG.js.map} +0 -0
- /package/dist/{graph-edge-decay-PWB63GRE.js.map → graph-edge-decay-5DI5GUNL.js.map} +0 -0
package/dist/chunk-DZZPC36E.js
DELETED
|
@@ -1,1451 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
runConsolidationProvenanceCheck
|
|
3
|
-
} from "./chunk-5HRY2WRF.js";
|
|
4
|
-
import {
|
|
5
|
-
reportBufferSurpriseDistribution
|
|
6
|
-
} from "./chunk-ASAITVLA.js";
|
|
7
|
-
import {
|
|
8
|
-
NamespaceStorageRouter,
|
|
9
|
-
namespaceCollectionName
|
|
10
|
-
} from "./chunk-HL5LRPNA.js";
|
|
11
|
-
import {
|
|
12
|
-
analyzeSessionIntegrity,
|
|
13
|
-
applySessionRepair,
|
|
14
|
-
planSessionRepair
|
|
15
|
-
} from "./chunk-YRMVARQP.js";
|
|
16
|
-
import {
|
|
17
|
-
resolveRemnicPluginEntry
|
|
18
|
-
} from "./chunk-U66YHYC7.js";
|
|
19
|
-
import {
|
|
20
|
-
resolveCuratedIncludeFilesStatePath,
|
|
21
|
-
resolveNativeKnowledgeStatePath,
|
|
22
|
-
resolveOpenClawWorkspaceStatePath
|
|
23
|
-
} from "./chunk-7SEAZFFB.js";
|
|
24
|
-
import {
|
|
25
|
-
createEvalBaselineSnapshot,
|
|
26
|
-
getEvalHarnessStatus,
|
|
27
|
-
runEvalBaselineDeltaReport,
|
|
28
|
-
runEvalBenchmarkCiGate,
|
|
29
|
-
validateEvalBenchmarkPack
|
|
30
|
-
} from "./chunk-K6WK37A6.js";
|
|
31
|
-
import {
|
|
32
|
-
readJudgeVerdictStats
|
|
33
|
-
} from "./chunk-AJU4PJGY.js";
|
|
34
|
-
import {
|
|
35
|
-
parseConfig
|
|
36
|
-
} from "./chunk-HY3L4WKC.js";
|
|
37
|
-
import {
|
|
38
|
-
listMemoryGovernanceRuns,
|
|
39
|
-
readMemoryGovernanceRunArtifact
|
|
40
|
-
} from "./chunk-4YM32CRU.js";
|
|
41
|
-
import {
|
|
42
|
-
isSafeRouteNamespace
|
|
43
|
-
} from "./chunk-2LGMW3DJ.js";
|
|
44
|
-
import {
|
|
45
|
-
analyzeGraphHealth
|
|
46
|
-
} from "./chunk-RK2Y4XOM.js";
|
|
47
|
-
import {
|
|
48
|
-
StorageManager
|
|
49
|
-
} from "./chunk-3B6KIRBH.js";
|
|
50
|
-
import {
|
|
51
|
-
lintWorkspaceFiles
|
|
52
|
-
} from "./chunk-DM2T26WE.js";
|
|
53
|
-
import {
|
|
54
|
-
readEnvVar,
|
|
55
|
-
resolveHomeDir
|
|
56
|
-
} from "./chunk-MARWOCVP.js";
|
|
57
|
-
|
|
58
|
-
// src/operator-toolkit.ts
|
|
59
|
-
import path2 from "path";
|
|
60
|
-
import { constants as fsConstants } from "fs";
|
|
61
|
-
import { access as access2, mkdir as mkdir2, readFile, readdir as readdir2, stat, unlink, writeFile } from "fs/promises";
|
|
62
|
-
|
|
63
|
-
// src/namespaces/migrate.ts
|
|
64
|
-
import path from "path";
|
|
65
|
-
import { access, mkdir, readdir, rename } from "fs/promises";
|
|
66
|
-
var LEGACY_NAMESPACE_CHILDREN = [
|
|
67
|
-
"facts",
|
|
68
|
-
"corrections",
|
|
69
|
-
"entities",
|
|
70
|
-
"questions",
|
|
71
|
-
"artifacts",
|
|
72
|
-
"identity",
|
|
73
|
-
"state",
|
|
74
|
-
"config",
|
|
75
|
-
"summaries",
|
|
76
|
-
"procedures",
|
|
77
|
-
// Issue #564 PR 3: reasoning_trace memories live in their own subtree.
|
|
78
|
-
// Must be included here so namespace migration moves existing traces
|
|
79
|
-
// into the target namespace root alongside other memory data.
|
|
80
|
-
"reasoning-traces",
|
|
81
|
-
"profile.md"
|
|
82
|
-
];
|
|
83
|
-
async function exists(p) {
|
|
84
|
-
try {
|
|
85
|
-
await access(p);
|
|
86
|
-
return true;
|
|
87
|
-
} catch {
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
async function hasAnyLegacyData(rootDir) {
|
|
92
|
-
for (const child of LEGACY_NAMESPACE_CHILDREN) {
|
|
93
|
-
if (await exists(path.join(rootDir, child))) return true;
|
|
94
|
-
}
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
async function discoverConfiguredNamespaces(config) {
|
|
98
|
-
const discovered = /* @__PURE__ */ new Set([
|
|
99
|
-
config.defaultNamespace,
|
|
100
|
-
config.sharedNamespace,
|
|
101
|
-
...config.namespacePolicies.map((policy) => policy.name)
|
|
102
|
-
]);
|
|
103
|
-
const namespacesDir = path.join(config.memoryDir, "namespaces");
|
|
104
|
-
try {
|
|
105
|
-
const entries = await readdir(namespacesDir, { withFileTypes: true });
|
|
106
|
-
for (const entry of entries) {
|
|
107
|
-
if (entry.isDirectory() && isSafeRouteNamespace(entry.name)) {
|
|
108
|
-
discovered.add(entry.name);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
} catch {
|
|
112
|
-
}
|
|
113
|
-
return [...discovered];
|
|
114
|
-
}
|
|
115
|
-
async function listNamespaces(options) {
|
|
116
|
-
const storageRouter = options.storageRouter ?? new NamespaceStorageRouter(options.config);
|
|
117
|
-
const namespaces = await discoverConfiguredNamespaces(options.config);
|
|
118
|
-
const items = await Promise.all(
|
|
119
|
-
namespaces.map(async (namespace) => {
|
|
120
|
-
const storage = await storageRouter.storageFor(namespace);
|
|
121
|
-
const usesLegacyRoot = namespace === options.config.defaultNamespace && storage.dir === options.config.memoryDir;
|
|
122
|
-
return {
|
|
123
|
-
namespace,
|
|
124
|
-
rootDir: storage.dir,
|
|
125
|
-
exists: await exists(storage.dir),
|
|
126
|
-
usesLegacyRoot,
|
|
127
|
-
hasMemoryData: await hasAnyLegacyData(storage.dir),
|
|
128
|
-
collection: namespaceCollectionName(options.config.qmdCollection, namespace, {
|
|
129
|
-
defaultNamespace: options.config.defaultNamespace,
|
|
130
|
-
useLegacyDefaultCollection: usesLegacyRoot
|
|
131
|
-
})
|
|
132
|
-
};
|
|
133
|
-
})
|
|
134
|
-
);
|
|
135
|
-
return items.sort((a, b) => a.namespace.localeCompare(b.namespace));
|
|
136
|
-
}
|
|
137
|
-
async function verifyNamespaces(options) {
|
|
138
|
-
const namespaces = await listNamespaces(options);
|
|
139
|
-
const problems = [];
|
|
140
|
-
for (const entry of namespaces) {
|
|
141
|
-
if (entry.exists && !entry.hasMemoryData) {
|
|
142
|
-
problems.push(`${entry.namespace}: root exists but contains no Engram data`);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return {
|
|
146
|
-
ok: problems.length === 0,
|
|
147
|
-
problems,
|
|
148
|
-
namespaces
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
async function runNamespaceMigration(options) {
|
|
152
|
-
if (!options.config.namespacesEnabled) {
|
|
153
|
-
throw new Error("Namespaces are disabled.");
|
|
154
|
-
}
|
|
155
|
-
const targetNamespace = options.to.trim();
|
|
156
|
-
if (!isSafeRouteNamespace(targetNamespace)) {
|
|
157
|
-
throw new Error(`Invalid namespace: ${options.to}`);
|
|
158
|
-
}
|
|
159
|
-
const targetRoot = path.join(options.config.memoryDir, "namespaces", targetNamespace);
|
|
160
|
-
const moved = [];
|
|
161
|
-
for (const child of LEGACY_NAMESPACE_CHILDREN) {
|
|
162
|
-
const from = path.join(options.config.memoryDir, child);
|
|
163
|
-
if (!await exists(from)) continue;
|
|
164
|
-
const to = path.join(targetRoot, child);
|
|
165
|
-
if (await exists(to)) {
|
|
166
|
-
throw new Error(`Target already contains ${child}: ${to}`);
|
|
167
|
-
}
|
|
168
|
-
moved.push({ from, to });
|
|
169
|
-
}
|
|
170
|
-
if (!options.dryRun && moved.length > 0) {
|
|
171
|
-
await mkdir(targetRoot, { recursive: true });
|
|
172
|
-
for (const move of moved) {
|
|
173
|
-
await rename(move.from, move.to);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return {
|
|
177
|
-
dryRun: options.dryRun === true,
|
|
178
|
-
fromRoot: options.config.memoryDir,
|
|
179
|
-
targetRoot,
|
|
180
|
-
moved,
|
|
181
|
-
collection: namespaceCollectionName(options.config.qmdCollection, targetNamespace, {
|
|
182
|
-
defaultNamespace: options.config.defaultNamespace,
|
|
183
|
-
useLegacyDefaultCollection: false
|
|
184
|
-
})
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// src/operator-toolkit.ts
|
|
189
|
-
function isMissingPathError(error) {
|
|
190
|
-
return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
|
|
191
|
-
}
|
|
192
|
-
function formatUnknownError(error) {
|
|
193
|
-
return error instanceof Error ? error.message : String(error);
|
|
194
|
-
}
|
|
195
|
-
function resolveConfigPath(explicitPath) {
|
|
196
|
-
if (explicitPath && explicitPath.trim().length > 0) return explicitPath.trim();
|
|
197
|
-
const configured = readEnvVar("OPENCLAW_ENGRAM_CONFIG_PATH") || readEnvVar("OPENCLAW_CONFIG_PATH");
|
|
198
|
-
if (configured && configured.trim().length > 0) return configured.trim();
|
|
199
|
-
return path2.join(resolveHomeDir(), ".openclaw", "openclaw.json");
|
|
200
|
-
}
|
|
201
|
-
async function loadCliPluginConfig(configPath) {
|
|
202
|
-
const resolvedPath = resolveConfigPath(configPath);
|
|
203
|
-
try {
|
|
204
|
-
const raw = JSON.parse(await readFile(resolvedPath, "utf-8"));
|
|
205
|
-
const entry = resolveRemnicPluginEntry(raw);
|
|
206
|
-
const parsedConfig = parseConfig(
|
|
207
|
-
entry && typeof entry === "object" ? entry["config"] ?? {} : {}
|
|
208
|
-
);
|
|
209
|
-
return {
|
|
210
|
-
found: true,
|
|
211
|
-
path: resolvedPath,
|
|
212
|
-
parsed: true,
|
|
213
|
-
memoryDir: parsedConfig.memoryDir,
|
|
214
|
-
workspaceDir: parsedConfig.workspaceDir
|
|
215
|
-
};
|
|
216
|
-
} catch (error) {
|
|
217
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
218
|
-
return {
|
|
219
|
-
found: !/ENOENT/i.test(message),
|
|
220
|
-
path: resolvedPath,
|
|
221
|
-
parsed: false,
|
|
222
|
-
error: message
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
async function isWritable(targetPath) {
|
|
227
|
-
try {
|
|
228
|
-
await access2(targetPath, fsConstants.W_OK);
|
|
229
|
-
return true;
|
|
230
|
-
} catch {
|
|
231
|
-
return false;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
async function pathExists(targetPath) {
|
|
235
|
-
try {
|
|
236
|
-
await access2(targetPath, fsConstants.F_OK);
|
|
237
|
-
return true;
|
|
238
|
-
} catch {
|
|
239
|
-
return false;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
function formatConfigValue(value) {
|
|
243
|
-
if (value === void 0 || value === null) return "(unset)";
|
|
244
|
-
if (typeof value === "string") return value.length > 0 ? value : "(unset)";
|
|
245
|
-
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
246
|
-
return JSON.stringify(value);
|
|
247
|
-
}
|
|
248
|
-
async function gatherDirectoryStatus(paths) {
|
|
249
|
-
return Promise.all(paths.map(async (targetPath) => {
|
|
250
|
-
try {
|
|
251
|
-
await access2(targetPath, fsConstants.F_OK);
|
|
252
|
-
return {
|
|
253
|
-
path: targetPath,
|
|
254
|
-
exists: true,
|
|
255
|
-
writable: await isWritable(targetPath)
|
|
256
|
-
};
|
|
257
|
-
} catch {
|
|
258
|
-
return {
|
|
259
|
-
path: targetPath,
|
|
260
|
-
exists: false,
|
|
261
|
-
writable: false
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
}));
|
|
265
|
-
}
|
|
266
|
-
function getSetupPaths(config) {
|
|
267
|
-
return [
|
|
268
|
-
config.memoryDir,
|
|
269
|
-
config.workspaceDir,
|
|
270
|
-
path2.join(config.memoryDir, "facts"),
|
|
271
|
-
path2.join(config.memoryDir, "entities"),
|
|
272
|
-
path2.join(config.memoryDir, "state"),
|
|
273
|
-
path2.join(config.memoryDir, "questions"),
|
|
274
|
-
path2.join(config.memoryDir, "artifacts"),
|
|
275
|
-
path2.join(config.memoryDir, "config")
|
|
276
|
-
];
|
|
277
|
-
}
|
|
278
|
-
async function readJsonIfExists(filePath) {
|
|
279
|
-
try {
|
|
280
|
-
return JSON.parse(await readFile(filePath, "utf-8"));
|
|
281
|
-
} catch {
|
|
282
|
-
return null;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
async function summarizeNativeKnowledgeStatus(config) {
|
|
286
|
-
const nativeKnowledge = config.nativeKnowledge;
|
|
287
|
-
const nativeKnowledgeStateDir = nativeKnowledge?.stateDir ?? "state/native-knowledge";
|
|
288
|
-
const curatedStatePath = nativeKnowledge ? resolveCuratedIncludeFilesStatePath(config.memoryDir, nativeKnowledge) : path2.join(config.memoryDir, nativeKnowledgeStateDir, "curated-include-sync.json");
|
|
289
|
-
const obsidianStatePath = nativeKnowledge ? resolveNativeKnowledgeStatePath(config.memoryDir, nativeKnowledge) : path2.join(config.memoryDir, nativeKnowledgeStateDir, "obsidian-sync.json");
|
|
290
|
-
const openclawStatePath = nativeKnowledge ? resolveOpenClawWorkspaceStatePath(config.memoryDir, nativeKnowledge) : path2.join(config.memoryDir, nativeKnowledgeStateDir, "openclaw-workspace-sync.json");
|
|
291
|
-
const [curatedRaw, obsidianRaw, openclawRaw] = await Promise.all([
|
|
292
|
-
readJsonIfExists(curatedStatePath),
|
|
293
|
-
readJsonIfExists(obsidianStatePath),
|
|
294
|
-
readJsonIfExists(openclawStatePath)
|
|
295
|
-
]);
|
|
296
|
-
const curatedFiles = curatedRaw && typeof curatedRaw === "object" && curatedRaw !== null && "files" in curatedRaw && typeof curatedRaw.files === "object" && curatedRaw.files !== null ? curatedRaw : null;
|
|
297
|
-
let curatedActiveChunkCount = 0;
|
|
298
|
-
let curatedDeletedFileCount = 0;
|
|
299
|
-
for (const file of Object.values(curatedFiles?.files ?? {})) {
|
|
300
|
-
if (file.deleted) {
|
|
301
|
-
curatedDeletedFileCount += 1;
|
|
302
|
-
continue;
|
|
303
|
-
}
|
|
304
|
-
curatedActiveChunkCount += Array.isArray(file.chunks) ? file.chunks.length : 0;
|
|
305
|
-
}
|
|
306
|
-
const obsidianVaults = obsidianRaw && typeof obsidianRaw === "object" && obsidianRaw !== null && "vaults" in obsidianRaw && typeof obsidianRaw.vaults === "object" && obsidianRaw.vaults !== null ? obsidianRaw : null;
|
|
307
|
-
let obsidianActiveChunkCount = 0;
|
|
308
|
-
let obsidianDeletedNoteCount = 0;
|
|
309
|
-
for (const vault of Object.values(obsidianVaults?.vaults ?? {})) {
|
|
310
|
-
for (const note of Object.values(vault.notes ?? {})) {
|
|
311
|
-
if (note.deleted) {
|
|
312
|
-
obsidianDeletedNoteCount += 1;
|
|
313
|
-
continue;
|
|
314
|
-
}
|
|
315
|
-
obsidianActiveChunkCount += Array.isArray(note.chunks) ? note.chunks.length : 0;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
const openclawFiles = openclawRaw && typeof openclawRaw === "object" && openclawRaw !== null && "files" in openclawRaw && typeof openclawRaw.files === "object" && openclawRaw.files !== null ? openclawRaw : null;
|
|
319
|
-
let openclawActiveChunkCount = 0;
|
|
320
|
-
let openclawDeletedFileCount = 0;
|
|
321
|
-
for (const file of Object.values(openclawFiles?.files ?? {})) {
|
|
322
|
-
if (file.deleted) {
|
|
323
|
-
openclawDeletedFileCount += 1;
|
|
324
|
-
continue;
|
|
325
|
-
}
|
|
326
|
-
openclawActiveChunkCount += Array.isArray(file.chunks) ? file.chunks.length : 0;
|
|
327
|
-
}
|
|
328
|
-
return {
|
|
329
|
-
enabled: nativeKnowledge?.enabled === true,
|
|
330
|
-
includeFiles: nativeKnowledge?.includeFiles ?? [],
|
|
331
|
-
curatedIncludeSync: {
|
|
332
|
-
statePath: curatedStatePath,
|
|
333
|
-
exists: curatedFiles !== null,
|
|
334
|
-
updatedAt: typeof curatedFiles?.updatedAt === "string" ? curatedFiles.updatedAt : null,
|
|
335
|
-
fileCount: Object.keys(curatedFiles?.files ?? {}).length,
|
|
336
|
-
activeChunkCount: curatedActiveChunkCount,
|
|
337
|
-
deletedFileCount: curatedDeletedFileCount
|
|
338
|
-
},
|
|
339
|
-
openclawWorkspaceAdapterEnabled: nativeKnowledge?.openclawWorkspace?.enabled === true,
|
|
340
|
-
obsidianVaultAdapterEnabled: (nativeKnowledge?.obsidianVaults?.length ?? 0) > 0,
|
|
341
|
-
obsidianSync: {
|
|
342
|
-
statePath: obsidianStatePath,
|
|
343
|
-
exists: obsidianVaults !== null,
|
|
344
|
-
updatedAt: typeof obsidianVaults?.updatedAt === "string" ? obsidianVaults.updatedAt : null,
|
|
345
|
-
vaultCount: Object.keys(obsidianVaults?.vaults ?? {}).length,
|
|
346
|
-
activeChunkCount: obsidianActiveChunkCount,
|
|
347
|
-
deletedNoteCount: obsidianDeletedNoteCount
|
|
348
|
-
},
|
|
349
|
-
openclawWorkspaceSync: {
|
|
350
|
-
statePath: openclawStatePath,
|
|
351
|
-
exists: openclawFiles !== null,
|
|
352
|
-
updatedAt: typeof openclawFiles?.updatedAt === "string" ? openclawFiles.updatedAt : null,
|
|
353
|
-
fileCount: Object.keys(openclawFiles?.files ?? {}).length,
|
|
354
|
-
activeChunkCount: openclawActiveChunkCount,
|
|
355
|
-
deletedFileCount: openclawDeletedFileCount
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
var CAPTURE_INSTRUCTIONS_START = "<!-- BEGIN ENGRAM EXPLICIT CAPTURE INSTRUCTIONS -->";
|
|
360
|
-
var CAPTURE_INSTRUCTIONS_END = "<!-- END ENGRAM EXPLICIT CAPTURE INSTRUCTIONS -->";
|
|
361
|
-
function buildCaptureInstructions() {
|
|
362
|
-
return [
|
|
363
|
-
CAPTURE_INSTRUCTIONS_START,
|
|
364
|
-
"# Memory",
|
|
365
|
-
"",
|
|
366
|
-
"Use this file for explicit memory capture notes when Engram runs in explicit or hybrid mode.",
|
|
367
|
-
"",
|
|
368
|
-
"## Suggested format",
|
|
369
|
-
"",
|
|
370
|
-
"- Write durable facts, decisions, commitments, or corrections.",
|
|
371
|
-
"- Keep entries concise and specific.",
|
|
372
|
-
"- Avoid secrets, tokens, and private credentials.",
|
|
373
|
-
"",
|
|
374
|
-
"## Example",
|
|
375
|
-
"",
|
|
376
|
-
"- Decision: recall benchmark packs live under `state/evals/benchmarks/`.",
|
|
377
|
-
"- Commitment: rerun `openclaw engram doctor --json` after changing retrieval settings.",
|
|
378
|
-
"",
|
|
379
|
-
CAPTURE_INSTRUCTIONS_END
|
|
380
|
-
].join("\n");
|
|
381
|
-
}
|
|
382
|
-
function upsertManagedCaptureInstructions(existing, snippet) {
|
|
383
|
-
if (!existing || existing.trim().length === 0) {
|
|
384
|
-
return { content: `${snippet}
|
|
385
|
-
`, updated: false, installed: true };
|
|
386
|
-
}
|
|
387
|
-
if (existing.includes(CAPTURE_INSTRUCTIONS_START) && existing.includes(CAPTURE_INSTRUCTIONS_END)) {
|
|
388
|
-
const next = existing.replace(
|
|
389
|
-
new RegExp(`${CAPTURE_INSTRUCTIONS_START}[\\s\\S]*?${CAPTURE_INSTRUCTIONS_END}`),
|
|
390
|
-
snippet
|
|
391
|
-
);
|
|
392
|
-
return { content: next.endsWith("\n") ? next : `${next}
|
|
393
|
-
`, updated: next !== existing, installed: false };
|
|
394
|
-
}
|
|
395
|
-
const trimmed = existing.trimEnd();
|
|
396
|
-
return {
|
|
397
|
-
content: `${trimmed}
|
|
398
|
-
|
|
399
|
-
${snippet}
|
|
400
|
-
`,
|
|
401
|
-
updated: false,
|
|
402
|
-
installed: true
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
function removeManagedCaptureInstructions(existing) {
|
|
406
|
-
if (!existing.includes(CAPTURE_INSTRUCTIONS_START) || !existing.includes(CAPTURE_INSTRUCTIONS_END)) {
|
|
407
|
-
return { content: existing, removed: false };
|
|
408
|
-
}
|
|
409
|
-
const stripped = existing.replace(new RegExp(`\\n*${CAPTURE_INSTRUCTIONS_START}[\\s\\S]*?${CAPTURE_INSTRUCTIONS_END}\\n*`), "\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
410
|
-
return {
|
|
411
|
-
content: stripped.length > 0 ? `${stripped}
|
|
412
|
-
` : "",
|
|
413
|
-
removed: true
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
async function runOperatorSetup(options) {
|
|
417
|
-
const now = options.now ?? /* @__PURE__ */ new Date();
|
|
418
|
-
const configStatus = await loadCliPluginConfig(options.configPath);
|
|
419
|
-
const storage = options.orchestrator.storage;
|
|
420
|
-
await storage.ensureDirectories();
|
|
421
|
-
await mkdir2(options.orchestrator.config.workspaceDir, { recursive: true });
|
|
422
|
-
const qmdAvailable = await options.orchestrator.qmd.probe();
|
|
423
|
-
const collectionState = options.orchestrator.config.qmdEnabled ? await options.orchestrator.qmd.ensureCollection(options.orchestrator.config.memoryDir) : "skipped";
|
|
424
|
-
const nativeKnowledgeStatus = await summarizeNativeKnowledgeStatus(options.orchestrator.config);
|
|
425
|
-
const memoryDocPath = path2.join(options.orchestrator.config.workspaceDir, "MEMORY.md");
|
|
426
|
-
const captureInstructionsMode = options.captureInstructionsMode ?? (options.installCaptureInstructions ? "install" : void 0);
|
|
427
|
-
let memoryDocExists = false;
|
|
428
|
-
try {
|
|
429
|
-
await access2(memoryDocPath, fsConstants.F_OK);
|
|
430
|
-
memoryDocExists = true;
|
|
431
|
-
} catch {
|
|
432
|
-
memoryDocExists = false;
|
|
433
|
-
}
|
|
434
|
-
let memoryDocInstalled = false;
|
|
435
|
-
let memoryDocUpdated = false;
|
|
436
|
-
let memoryDocRemoved = false;
|
|
437
|
-
const explicitCaptureEnabled = options.orchestrator.config.captureMode === "explicit" || options.orchestrator.config.captureMode === "hybrid";
|
|
438
|
-
const captureInstructionsPreview = captureInstructionsMode ? buildCaptureInstructions() : null;
|
|
439
|
-
if (captureInstructionsMode) {
|
|
440
|
-
if (captureInstructionsMode === "preview") {
|
|
441
|
-
} else if (captureInstructionsMode === "install") {
|
|
442
|
-
const existing = memoryDocExists ? await readFile(memoryDocPath, "utf-8") : null;
|
|
443
|
-
const next = upsertManagedCaptureInstructions(existing, captureInstructionsPreview ?? "");
|
|
444
|
-
if (!existing || next.content !== existing) {
|
|
445
|
-
await writeFile(memoryDocPath, next.content, "utf-8");
|
|
446
|
-
}
|
|
447
|
-
memoryDocExists = true;
|
|
448
|
-
memoryDocInstalled = next.installed;
|
|
449
|
-
memoryDocUpdated = next.updated;
|
|
450
|
-
} else if (captureInstructionsMode === "remove" && memoryDocExists) {
|
|
451
|
-
const existing = await readFile(memoryDocPath, "utf-8");
|
|
452
|
-
const next = removeManagedCaptureInstructions(existing);
|
|
453
|
-
if (next.removed) {
|
|
454
|
-
if (next.content.length === 0) {
|
|
455
|
-
await unlink(memoryDocPath);
|
|
456
|
-
memoryDocExists = false;
|
|
457
|
-
} else {
|
|
458
|
-
await writeFile(memoryDocPath, next.content, "utf-8");
|
|
459
|
-
memoryDocExists = true;
|
|
460
|
-
}
|
|
461
|
-
memoryDocRemoved = true;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
const directories = await gatherDirectoryStatus(getSetupPaths(options.orchestrator.config));
|
|
466
|
-
const nextSteps = [
|
|
467
|
-
`Run \`openclaw engram doctor${options.installCaptureInstructions ? "" : " --json"}\` to verify runtime health.`,
|
|
468
|
-
"Run `openclaw engram inventory --json` to capture a baseline footprint.",
|
|
469
|
-
"If QMD is enabled and the collection is missing, add the collection to `~/.config/qmd/index.yml` and run `qmd update && qmd embed`."
|
|
470
|
-
];
|
|
471
|
-
if (explicitCaptureEnabled && !memoryDocExists) {
|
|
472
|
-
nextSteps.push("Run `openclaw engram setup --preview-capture-instructions` to review the managed explicit-capture snippet, then `--install-capture-instructions` to write it.");
|
|
473
|
-
}
|
|
474
|
-
return {
|
|
475
|
-
schemaVersion: 1,
|
|
476
|
-
generatedAt: now.toISOString(),
|
|
477
|
-
config: configStatus,
|
|
478
|
-
memoryDir: options.orchestrator.config.memoryDir,
|
|
479
|
-
workspaceDir: options.orchestrator.config.workspaceDir,
|
|
480
|
-
directories,
|
|
481
|
-
qmd: {
|
|
482
|
-
enabled: options.orchestrator.config.qmdEnabled,
|
|
483
|
-
available: qmdAvailable,
|
|
484
|
-
collectionState,
|
|
485
|
-
debugStatus: options.orchestrator.qmd.debugStatus()
|
|
486
|
-
},
|
|
487
|
-
nativeKnowledge: nativeKnowledgeStatus,
|
|
488
|
-
explicitCapture: {
|
|
489
|
-
captureMode: options.orchestrator.config.captureMode,
|
|
490
|
-
enabled: explicitCaptureEnabled,
|
|
491
|
-
memoryDocPath,
|
|
492
|
-
memoryDocExists,
|
|
493
|
-
memoryDocInstalled,
|
|
494
|
-
memoryDocUpdated,
|
|
495
|
-
memoryDocRemoved,
|
|
496
|
-
preview: captureInstructionsMode === "preview" ? captureInstructionsPreview : null
|
|
497
|
-
},
|
|
498
|
-
nextSteps,
|
|
499
|
-
verificationCommands: [
|
|
500
|
-
"openclaw engram doctor --json",
|
|
501
|
-
"openclaw engram inventory --json",
|
|
502
|
-
"openclaw engram benchmark recall --json"
|
|
503
|
-
]
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
function summarizeHygieneWarnings(warnings, hygiene) {
|
|
507
|
-
if (!hygiene?.enabled || hygiene.lintEnabled !== true) {
|
|
508
|
-
return {
|
|
509
|
-
key: "file_hygiene",
|
|
510
|
-
status: "warn",
|
|
511
|
-
summary: "File hygiene linting is disabled; bootstrap file truncation warnings are not active.",
|
|
512
|
-
remediation: "Enable `fileHygiene.enabled` and `fileHygiene.lintEnabled` if large workspace bootstrap files are common.",
|
|
513
|
-
details: {
|
|
514
|
-
enabled: hygiene?.enabled === true,
|
|
515
|
-
lintEnabled: hygiene?.lintEnabled === true
|
|
516
|
-
}
|
|
517
|
-
};
|
|
518
|
-
}
|
|
519
|
-
if (warnings.length > 0) {
|
|
520
|
-
return {
|
|
521
|
-
key: "file_hygiene",
|
|
522
|
-
status: "warn",
|
|
523
|
-
summary: `${warnings.length} bootstrap file(s) are near or above the configured budget.`,
|
|
524
|
-
remediation: "Archive/split the listed files or adjust `fileHygiene` budgets.",
|
|
525
|
-
details: { warnings }
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
return {
|
|
529
|
-
key: "file_hygiene",
|
|
530
|
-
status: "ok",
|
|
531
|
-
summary: "Bootstrap file hygiene is within budget.",
|
|
532
|
-
details: {
|
|
533
|
-
enabled: true,
|
|
534
|
-
lintPaths: hygiene.lintPaths,
|
|
535
|
-
budgetBytes: hygiene.lintBudgetBytes
|
|
536
|
-
}
|
|
537
|
-
};
|
|
538
|
-
}
|
|
539
|
-
function buildConfigReviewFinding(input) {
|
|
540
|
-
return {
|
|
541
|
-
key: input.key,
|
|
542
|
-
status: input.status,
|
|
543
|
-
setting: input.setting,
|
|
544
|
-
currentValue: formatConfigValue(input.currentValue),
|
|
545
|
-
defaultValue: formatConfigValue(input.defaultValue),
|
|
546
|
-
recommendedValue: formatConfigValue(input.recommendedValue),
|
|
547
|
-
summary: input.summary,
|
|
548
|
-
rationale: input.rationale
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
async function runOperatorConfigReview(options) {
|
|
552
|
-
const now = options.now ?? /* @__PURE__ */ new Date();
|
|
553
|
-
const configStatus = await loadCliPluginConfig(options.configPath);
|
|
554
|
-
return buildOperatorConfigReviewReport({
|
|
555
|
-
now,
|
|
556
|
-
configStatus,
|
|
557
|
-
config: options.orchestrator.config
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
async function buildOperatorConfigReviewReport(input) {
|
|
561
|
-
const { now, configStatus, config } = input;
|
|
562
|
-
const findings = [];
|
|
563
|
-
const searchBackend = config.searchBackend ?? "qmd";
|
|
564
|
-
const workspaceBootstrapFiles = [
|
|
565
|
-
path2.join(config.workspaceDir, "IDENTITY.md"),
|
|
566
|
-
path2.join(config.workspaceDir, "MEMORY.md"),
|
|
567
|
-
path2.join(config.workspaceDir, "USER.md")
|
|
568
|
-
];
|
|
569
|
-
const workspaceBootstrapExists = (await Promise.all(workspaceBootstrapFiles.map(pathExists))).some(Boolean);
|
|
570
|
-
if (config.memoryOsPreset !== "conservative" && config.memoryOsPreset !== "balanced" && config.memoryOsPreset !== "research-max" && config.memoryOsPreset !== "local-llm-heavy" && config.queryAwareIndexingEnabled === false && config.verbatimArtifactsEnabled === false && config.rerankEnabled === false) {
|
|
571
|
-
findings.push(buildConfigReviewFinding({
|
|
572
|
-
key: "balanced_preset",
|
|
573
|
-
status: "recommend",
|
|
574
|
-
setting: "memoryOsPreset",
|
|
575
|
-
currentValue: config.memoryOsPreset,
|
|
576
|
-
defaultValue: "(unset)",
|
|
577
|
-
recommendedValue: "balanced",
|
|
578
|
-
summary: "Adopt the balanced preset as the baseline configuration profile.",
|
|
579
|
-
rationale: "The balanced preset enables the recommended indexing, reranking, and artifact defaults without turning on the higher-churn graph and learning loops."
|
|
580
|
-
}));
|
|
581
|
-
}
|
|
582
|
-
if (config.qmdEnabled && config.qmdDaemonEnabled === false) {
|
|
583
|
-
findings.push(buildConfigReviewFinding({
|
|
584
|
-
key: "qmd_daemon",
|
|
585
|
-
status: "recommend",
|
|
586
|
-
setting: "qmdDaemonEnabled",
|
|
587
|
-
currentValue: config.qmdDaemonEnabled,
|
|
588
|
-
defaultValue: true,
|
|
589
|
-
recommendedValue: true,
|
|
590
|
-
summary: "Enable the QMD daemon path when QMD powers recall.",
|
|
591
|
-
rationale: "The daemon path reduces recall/search contention by preferring the MCP transport instead of repeated subprocess calls when QMD is available."
|
|
592
|
-
}));
|
|
593
|
-
}
|
|
594
|
-
if (workspaceBootstrapExists && config.nativeKnowledge?.enabled !== true) {
|
|
595
|
-
findings.push(buildConfigReviewFinding({
|
|
596
|
-
key: "native_knowledge_enabled",
|
|
597
|
-
status: "recommend",
|
|
598
|
-
setting: "nativeKnowledge.enabled",
|
|
599
|
-
currentValue: config.nativeKnowledge?.enabled,
|
|
600
|
-
defaultValue: false,
|
|
601
|
-
recommendedValue: true,
|
|
602
|
-
summary: "Enable native knowledge recall for workspace bootstrap documents.",
|
|
603
|
-
rationale: "When files like IDENTITY.md or MEMORY.md already exist, native knowledge recall can chunk and inject them directly instead of relying only on extracted memories."
|
|
604
|
-
}));
|
|
605
|
-
}
|
|
606
|
-
if (workspaceBootstrapExists && config.fileHygiene?.enabled !== true) {
|
|
607
|
-
findings.push(buildConfigReviewFinding({
|
|
608
|
-
key: "file_hygiene_enabled",
|
|
609
|
-
status: "recommend",
|
|
610
|
-
setting: "fileHygiene.enabled",
|
|
611
|
-
currentValue: config.fileHygiene?.enabled,
|
|
612
|
-
defaultValue: false,
|
|
613
|
-
recommendedValue: true,
|
|
614
|
-
summary: "Enable file hygiene to avoid silent workspace-file truncation.",
|
|
615
|
-
rationale: "OpenClaw bootstrap files can grow quietly; file hygiene warns before oversized files are truncated during prompt bootstrap."
|
|
616
|
-
}));
|
|
617
|
-
}
|
|
618
|
-
if (searchBackend === "qmd" && config.qmdEnabled === false) {
|
|
619
|
-
findings.push(buildConfigReviewFinding({
|
|
620
|
-
key: "qmd_search_backend_disabled",
|
|
621
|
-
status: "problem",
|
|
622
|
-
setting: "qmdEnabled",
|
|
623
|
-
currentValue: config.qmdEnabled,
|
|
624
|
-
defaultValue: true,
|
|
625
|
-
recommendedValue: true,
|
|
626
|
-
summary: "QMD search is selected but QMD is disabled.",
|
|
627
|
-
rationale: "When searchBackend resolves to qmd while qmdEnabled is false, Engram falls back to the noop backend and disables the primary search path."
|
|
628
|
-
}));
|
|
629
|
-
}
|
|
630
|
-
if (config.qmdColdTierEnabled === true && config.qmdEnabled === false) {
|
|
631
|
-
findings.push(buildConfigReviewFinding({
|
|
632
|
-
key: "qmd_cold_tier_requires_qmd",
|
|
633
|
-
status: "problem",
|
|
634
|
-
setting: "qmdEnabled",
|
|
635
|
-
currentValue: config.qmdEnabled,
|
|
636
|
-
defaultValue: true,
|
|
637
|
-
recommendedValue: true,
|
|
638
|
-
summary: "Cold-tier QMD recall is enabled while QMD itself is disabled.",
|
|
639
|
-
rationale: "The cold tier depends on the same QMD runtime as the hot tier, so turning QMD off leaves the extra tiering path unusable."
|
|
640
|
-
}));
|
|
641
|
-
}
|
|
642
|
-
if (config.qmdTierMigrationEnabled && config.qmdColdTierEnabled !== true) {
|
|
643
|
-
findings.push(buildConfigReviewFinding({
|
|
644
|
-
key: "qmd_tier_migration_requires_cold_tier",
|
|
645
|
-
status: "problem",
|
|
646
|
-
setting: "qmdColdTierEnabled",
|
|
647
|
-
currentValue: config.qmdColdTierEnabled,
|
|
648
|
-
defaultValue: false,
|
|
649
|
-
recommendedValue: true,
|
|
650
|
-
summary: "Hot/cold tier migration is enabled without the cold tier itself.",
|
|
651
|
-
rationale: "Tier migration depends on the cold-tier collection and recall path, so enabling migration while the cold tier is off leaves the feature in a contradictory state."
|
|
652
|
-
}));
|
|
653
|
-
}
|
|
654
|
-
if (config.conversationIndexEnabled && config.conversationIndexBackend === "qmd" && config.qmdEnabled === false) {
|
|
655
|
-
findings.push(buildConfigReviewFinding({
|
|
656
|
-
key: "conversation_index_qmd_requires_qmd",
|
|
657
|
-
status: "problem",
|
|
658
|
-
setting: "qmdEnabled",
|
|
659
|
-
currentValue: config.qmdEnabled,
|
|
660
|
-
defaultValue: true,
|
|
661
|
-
recommendedValue: true,
|
|
662
|
-
summary: "The conversation index is configured for QMD while QMD is disabled.",
|
|
663
|
-
rationale: "A QMD-backed conversation index cannot rebuild or serve queries when the underlying QMD runtime is disabled."
|
|
664
|
-
}));
|
|
665
|
-
}
|
|
666
|
-
const summary = findings.reduce(
|
|
667
|
-
(acc, finding) => {
|
|
668
|
-
acc[finding.status] += 1;
|
|
669
|
-
return acc;
|
|
670
|
-
},
|
|
671
|
-
{ recommend: 0, problem: 0 }
|
|
672
|
-
);
|
|
673
|
-
return {
|
|
674
|
-
schemaVersion: 1,
|
|
675
|
-
generatedAt: now.toISOString(),
|
|
676
|
-
ok: configStatus.parsed && summary.problem === 0,
|
|
677
|
-
config: configStatus,
|
|
678
|
-
profile: {
|
|
679
|
-
memoryOsPreset: config.memoryOsPreset,
|
|
680
|
-
searchBackend,
|
|
681
|
-
qmdEnabled: config.qmdEnabled,
|
|
682
|
-
qmdDaemonEnabled: config.qmdDaemonEnabled,
|
|
683
|
-
nativeKnowledgeEnabled: config.nativeKnowledge?.enabled === true,
|
|
684
|
-
fileHygieneEnabled: config.fileHygiene?.enabled === true,
|
|
685
|
-
conversationIndexEnabled: config.conversationIndexEnabled
|
|
686
|
-
},
|
|
687
|
-
summary,
|
|
688
|
-
findings
|
|
689
|
-
};
|
|
690
|
-
}
|
|
691
|
-
async function runOperatorDoctor(options) {
|
|
692
|
-
const now = options.now ?? /* @__PURE__ */ new Date();
|
|
693
|
-
const configStatus = await loadCliPluginConfig(options.configPath);
|
|
694
|
-
const checks = [];
|
|
695
|
-
const config = options.orchestrator.config;
|
|
696
|
-
const storage = options.orchestrator.storage;
|
|
697
|
-
const configReview = await buildOperatorConfigReviewReport({
|
|
698
|
-
now,
|
|
699
|
-
configStatus,
|
|
700
|
-
config
|
|
701
|
-
});
|
|
702
|
-
const nativeKnowledgeStatus = await summarizeNativeKnowledgeStatus(config);
|
|
703
|
-
const setupPaths = await gatherDirectoryStatus(getSetupPaths(config));
|
|
704
|
-
const missingPaths = setupPaths.filter((entry) => !entry.exists).map((entry) => entry.path);
|
|
705
|
-
checks.push({
|
|
706
|
-
key: "config",
|
|
707
|
-
status: configStatus.parsed ? "ok" : options.configPath ? "error" : "warn",
|
|
708
|
-
summary: configStatus.parsed ? "OpenClaw config loaded and Engram config parsed successfully." : "Config file could not be parsed.",
|
|
709
|
-
remediation: configStatus.parsed ? void 0 : "Fix the config file or set OPENCLAW_ENGRAM_CONFIG_PATH/OPENCLAW_CONFIG_PATH.",
|
|
710
|
-
details: configStatus
|
|
711
|
-
});
|
|
712
|
-
checks.push({
|
|
713
|
-
key: "memory_dir",
|
|
714
|
-
status: missingPaths.length === 0 ? "ok" : "warn",
|
|
715
|
-
summary: missingPaths.length === 0 ? "Expected Engram directories exist." : `${missingPaths.length} expected directory path(s) are missing.`,
|
|
716
|
-
remediation: missingPaths.length === 0 ? void 0 : "Run `openclaw engram setup` to create missing directories.",
|
|
717
|
-
details: { directories: setupPaths }
|
|
718
|
-
});
|
|
719
|
-
checks.push({
|
|
720
|
-
key: "config_review",
|
|
721
|
-
status: configReview.summary.problem > 0 ? "error" : configReview.summary.recommend > 0 ? "warn" : "ok",
|
|
722
|
-
summary: configReview.summary.problem > 0 ? `${configReview.summary.problem} configuration problem(s) detected.` : configReview.summary.recommend > 0 ? `No configuration problems detected; ${configReview.summary.recommend} optional recommendation(s) are available.` : "No configuration problems detected.",
|
|
723
|
-
remediation: configReview.summary.problem > 0 || configReview.summary.recommend > 0 ? "Run `openclaw engram config-review` to inspect and fix the flagged configuration combinations." : void 0,
|
|
724
|
-
details: configReview
|
|
725
|
-
});
|
|
726
|
-
const qmdAvailable = await options.orchestrator.qmd.probe();
|
|
727
|
-
const collectionState = config.qmdEnabled ? await options.orchestrator.qmd.ensureCollection(config.memoryDir) : "skipped";
|
|
728
|
-
checks.push({
|
|
729
|
-
key: "qmd",
|
|
730
|
-
status: !config.qmdEnabled ? "warn" : !qmdAvailable ? "error" : collectionState === "present" ? "ok" : collectionState === "missing" ? "error" : "warn",
|
|
731
|
-
summary: !config.qmdEnabled ? "QMD is disabled in config." : qmdAvailable ? `QMD is reachable (${collectionState}).` : "QMD is not currently reachable.",
|
|
732
|
-
remediation: !config.qmdEnabled ? "Enable `qmdEnabled` if you expect hybrid search." : !qmdAvailable ? "Ensure the `qmd` binary is installed and on PATH, or set `qmdPath`." : collectionState === "missing" ? "Add the configured collection to `~/.config/qmd/index.yml`." : collectionState === "present" ? void 0 : "Re-run `openclaw engram setup` after restoring QMD access.",
|
|
733
|
-
details: {
|
|
734
|
-
available: qmdAvailable,
|
|
735
|
-
collectionState,
|
|
736
|
-
debugStatus: options.orchestrator.qmd.debugStatus()
|
|
737
|
-
}
|
|
738
|
-
});
|
|
739
|
-
const conversationIndex = await options.orchestrator.getConversationIndexHealth();
|
|
740
|
-
checks.push({
|
|
741
|
-
key: "conversation_index",
|
|
742
|
-
status: conversationIndex.status === "ok" ? "ok" : conversationIndex.enabled ? "error" : "warn",
|
|
743
|
-
summary: conversationIndex.enabled ? `Conversation index backend is ${conversationIndex.status}.` : "Conversation index is disabled.",
|
|
744
|
-
remediation: conversationIndex.enabled && conversationIndex.status !== "ok" ? "Run `openclaw engram rebuild-index` to refresh the conversation index artifacts." : void 0,
|
|
745
|
-
details: conversationIndex
|
|
746
|
-
});
|
|
747
|
-
const meta = await storage.loadMeta();
|
|
748
|
-
checks.push({
|
|
749
|
-
key: "maintenance",
|
|
750
|
-
status: meta.lastExtractionAt || meta.lastConsolidationAt ? "ok" : "warn",
|
|
751
|
-
summary: meta.lastExtractionAt || meta.lastConsolidationAt ? "Extraction/consolidation metadata is present." : "No extraction or consolidation metadata found yet.",
|
|
752
|
-
remediation: meta.lastExtractionAt || meta.lastConsolidationAt ? void 0 : "Run a normal agent turn or `openclaw engram consolidate` after seeding memory.",
|
|
753
|
-
details: meta
|
|
754
|
-
});
|
|
755
|
-
const syncedChunkCount = nativeKnowledgeStatus.curatedIncludeSync.activeChunkCount + nativeKnowledgeStatus.obsidianSync.activeChunkCount + nativeKnowledgeStatus.openclawWorkspaceSync.activeChunkCount;
|
|
756
|
-
const hasSyncState = nativeKnowledgeStatus.curatedIncludeSync.exists || nativeKnowledgeStatus.obsidianSync.exists || nativeKnowledgeStatus.openclawWorkspaceSync.exists;
|
|
757
|
-
checks.push({
|
|
758
|
-
key: "native_knowledge",
|
|
759
|
-
status: !nativeKnowledgeStatus.enabled ? "warn" : hasSyncState ? "ok" : "warn",
|
|
760
|
-
summary: !nativeKnowledgeStatus.enabled ? "Native knowledge sync is disabled." : hasSyncState ? `Native knowledge sync state is present (${syncedChunkCount} active chunks).` : "Native knowledge sync is enabled but no sync state has been written yet.",
|
|
761
|
-
remediation: !nativeKnowledgeStatus.enabled ? "Enable `nativeKnowledge.enabled` if curated workspace recall should participate in retrieval." : hasSyncState ? void 0 : "Run a recall, sync, or setup flow that touches native knowledge sources, then rerun `openclaw engram doctor --json`.",
|
|
762
|
-
details: nativeKnowledgeStatus
|
|
763
|
-
});
|
|
764
|
-
const agentAccessEnabled = config.agentAccessHttp?.enabled === true;
|
|
765
|
-
const rawAuthToken = config.agentAccessHttp?.authToken;
|
|
766
|
-
const authTokenConfigured = typeof rawAuthToken === "string" && rawAuthToken.length > 0 || rawAuthToken !== null && typeof rawAuthToken === "object" && typeof rawAuthToken.source === "string";
|
|
767
|
-
checks.push({
|
|
768
|
-
key: "access_http_auth",
|
|
769
|
-
status: !agentAccessEnabled ? "warn" : authTokenConfigured ? "ok" : "error",
|
|
770
|
-
summary: !agentAccessEnabled ? "Agent access HTTP bridge is disabled." : authTokenConfigured ? "Agent access HTTP bridge has an auth token configured." : "Agent access HTTP bridge is enabled without an auth token.",
|
|
771
|
-
remediation: !agentAccessEnabled ? "Ignore unless you plan to enable the HTTP bridge." : authTokenConfigured ? void 0 : "Set `agentAccessHttp.authToken` before exposing the bridge."
|
|
772
|
-
});
|
|
773
|
-
const warnings = config.fileHygiene?.lintEnabled ? await lintWorkspaceFiles({
|
|
774
|
-
workspaceDir: config.workspaceDir,
|
|
775
|
-
paths: config.fileHygiene.lintPaths,
|
|
776
|
-
budgetBytes: config.fileHygiene.lintBudgetBytes,
|
|
777
|
-
warnRatio: config.fileHygiene.lintWarnRatio
|
|
778
|
-
}) : [];
|
|
779
|
-
checks.push(summarizeHygieneWarnings(warnings, config.fileHygiene));
|
|
780
|
-
checks.push(await summarizeMemoryWorthLegacyCounters(storage));
|
|
781
|
-
checks.push(
|
|
782
|
-
await summarizeBufferSurpriseDistribution(storage, config)
|
|
783
|
-
);
|
|
784
|
-
checks.push(await summarizeConsolidationProvenance(storage, config));
|
|
785
|
-
checks.push(await summarizeGraphEdgeDecayStatus(config));
|
|
786
|
-
checks.push(await summarizeTierDistribution(options.orchestrator.storage));
|
|
787
|
-
checks.push(await summarizeDreamsPhases(config, storage));
|
|
788
|
-
checks.push(summarizeSecurityMitigations(config));
|
|
789
|
-
checks.push(await summarizeObservationThroughput(config.memoryDir));
|
|
790
|
-
const summary = checks.reduce(
|
|
791
|
-
(acc, check) => {
|
|
792
|
-
acc[check.status] += 1;
|
|
793
|
-
return acc;
|
|
794
|
-
},
|
|
795
|
-
{ ok: 0, warn: 0, error: 0 }
|
|
796
|
-
);
|
|
797
|
-
return {
|
|
798
|
-
schemaVersion: 1,
|
|
799
|
-
generatedAt: now.toISOString(),
|
|
800
|
-
ok: summary.error === 0,
|
|
801
|
-
summary,
|
|
802
|
-
config: configStatus,
|
|
803
|
-
checks
|
|
804
|
-
};
|
|
805
|
-
}
|
|
806
|
-
var MEMORY_WORTH_ELIGIBLE_CATEGORIES = /* @__PURE__ */ new Set(["fact"]);
|
|
807
|
-
async function summarizeMemoryWorthLegacyCounters(storage) {
|
|
808
|
-
let legacy = 0;
|
|
809
|
-
let instrumented = 0;
|
|
810
|
-
let ineligible = 0;
|
|
811
|
-
try {
|
|
812
|
-
const memories = await storage.readAllMemories();
|
|
813
|
-
for (const memory of memories) {
|
|
814
|
-
if (!MEMORY_WORTH_ELIGIBLE_CATEGORIES.has(memory.frontmatter.category)) {
|
|
815
|
-
ineligible += 1;
|
|
816
|
-
continue;
|
|
817
|
-
}
|
|
818
|
-
const { mw_success, mw_fail } = memory.frontmatter;
|
|
819
|
-
if (mw_success === void 0 && mw_fail === void 0) {
|
|
820
|
-
legacy += 1;
|
|
821
|
-
} else {
|
|
822
|
-
instrumented += 1;
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
} catch (err) {
|
|
826
|
-
return {
|
|
827
|
-
key: "memory_worth_legacy",
|
|
828
|
-
status: "warn",
|
|
829
|
-
summary: "Could not enumerate memories to count Memory Worth instrumentation.",
|
|
830
|
-
remediation: "Retry `remnic doctor` after ensuring the memory directory is readable.",
|
|
831
|
-
details: { error: String(err) }
|
|
832
|
-
};
|
|
833
|
-
}
|
|
834
|
-
const total = legacy + instrumented;
|
|
835
|
-
return {
|
|
836
|
-
key: "memory_worth_legacy",
|
|
837
|
-
status: "ok",
|
|
838
|
-
summary: total === 0 ? "No Memory Worth\u2013eligible memories on disk yet \u2014 counters will populate as facts are extracted." : `${legacy} of ${total} eligible memories have no Memory Worth counters yet (${instrumented} instrumented).`,
|
|
839
|
-
details: { legacy, instrumented, total, ineligible }
|
|
840
|
-
};
|
|
841
|
-
}
|
|
842
|
-
async function summarizeBufferSurpriseDistribution(storage, config) {
|
|
843
|
-
const storageWithLedger = storage;
|
|
844
|
-
if (typeof storageWithLedger.readBufferSurpriseEvents !== "function") {
|
|
845
|
-
return {
|
|
846
|
-
key: "buffer_surprise_distribution",
|
|
847
|
-
status: "ok",
|
|
848
|
-
summary: "Buffer-surprise telemetry reader unavailable in this build.",
|
|
849
|
-
details: { available: false }
|
|
850
|
-
};
|
|
851
|
-
}
|
|
852
|
-
try {
|
|
853
|
-
const dist = await reportBufferSurpriseDistribution(
|
|
854
|
-
async (opts) => storageWithLedger.readBufferSurpriseEvents({ limit: opts.limit }),
|
|
855
|
-
{ limit: 200 }
|
|
856
|
-
);
|
|
857
|
-
if (dist.count === 0) {
|
|
858
|
-
return {
|
|
859
|
-
key: "buffer_surprise_distribution",
|
|
860
|
-
status: "ok",
|
|
861
|
-
summary: config.bufferSurpriseTriggerEnabled ? "Surprise trigger is enabled but no telemetry has been recorded yet." : "Surprise trigger is disabled; no telemetry expected.",
|
|
862
|
-
details: {
|
|
863
|
-
enabled: config.bufferSurpriseTriggerEnabled,
|
|
864
|
-
distribution: dist
|
|
865
|
-
}
|
|
866
|
-
};
|
|
867
|
-
}
|
|
868
|
-
const pct = (value) => (value * 100).toFixed(1);
|
|
869
|
-
return {
|
|
870
|
-
key: "buffer_surprise_distribution",
|
|
871
|
-
status: "ok",
|
|
872
|
-
summary: `Recent surprise: mean=${dist.mean.toFixed(3)}, median=${dist.median.toFixed(3)}, p90=${dist.p90.toFixed(3)}, triggered=${pct(dist.triggeredRate)}% over ${dist.count} turns (threshold=${dist.currentThreshold ?? config.bufferSurpriseThreshold}).`,
|
|
873
|
-
details: {
|
|
874
|
-
enabled: config.bufferSurpriseTriggerEnabled,
|
|
875
|
-
distribution: dist
|
|
876
|
-
}
|
|
877
|
-
};
|
|
878
|
-
} catch (err) {
|
|
879
|
-
return {
|
|
880
|
-
key: "buffer_surprise_distribution",
|
|
881
|
-
status: "warn",
|
|
882
|
-
summary: "Could not read buffer-surprise telemetry ledger.",
|
|
883
|
-
remediation: "Retry `remnic doctor` after ensuring the memory state directory is readable.",
|
|
884
|
-
details: { error: String(err) }
|
|
885
|
-
};
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
async function summarizeGraphEdgeDecayStatus(config) {
|
|
889
|
-
const { readGraphEdgeDecayStatus } = await import("./graph-edge-decay-PWB63GRE.js");
|
|
890
|
-
const enabled = config.graphEdgeDecayEnabled === true;
|
|
891
|
-
if (!enabled) {
|
|
892
|
-
return {
|
|
893
|
-
key: "graph_edge_decay",
|
|
894
|
-
status: "ok",
|
|
895
|
-
summary: "Graph-edge decay maintenance is disabled (graphEdgeDecayEnabled = false).",
|
|
896
|
-
remediation: "Set graphEdgeDecayEnabled = true to opt into the periodic decay job (issue #681).",
|
|
897
|
-
details: { enabled: false }
|
|
898
|
-
};
|
|
899
|
-
}
|
|
900
|
-
const status = await readGraphEdgeDecayStatus(config.memoryDir);
|
|
901
|
-
if (!status) {
|
|
902
|
-
return {
|
|
903
|
-
key: "graph_edge_decay",
|
|
904
|
-
status: "warn",
|
|
905
|
-
summary: "Graph-edge decay is enabled but has not run yet (no status file present).",
|
|
906
|
-
remediation: "Trigger the cron, run `engram.graph_edge_decay_run` via MCP, or wait for the scheduled cadence to fire.",
|
|
907
|
-
details: { enabled: true, lastRun: null, cadenceMs: config.graphEdgeDecayCadenceMs }
|
|
908
|
-
};
|
|
909
|
-
}
|
|
910
|
-
return {
|
|
911
|
-
key: "graph_edge_decay",
|
|
912
|
-
status: "ok",
|
|
913
|
-
summary: `Graph-edge decay last ran at ${status.ranAt} (${status.edgesDecayed}/${status.edgesTotal} edges decayed, ${status.edgesBelowVisibilityThreshold} below visibility threshold).`,
|
|
914
|
-
details: {
|
|
915
|
-
enabled: true,
|
|
916
|
-
lastRun: status.ranAt,
|
|
917
|
-
durationMs: status.durationMs,
|
|
918
|
-
edgesTotal: status.edgesTotal,
|
|
919
|
-
edgesDecayed: status.edgesDecayed,
|
|
920
|
-
edgesBelowVisibilityThreshold: status.edgesBelowVisibilityThreshold,
|
|
921
|
-
topDecayedEntities: status.topDecayedEntities,
|
|
922
|
-
cadenceMs: config.graphEdgeDecayCadenceMs
|
|
923
|
-
}
|
|
924
|
-
};
|
|
925
|
-
}
|
|
926
|
-
async function summarizeTierDistribution(storage) {
|
|
927
|
-
try {
|
|
928
|
-
const { summarizeTiers } = await import("./tier-stats-62ZVDFKS.js");
|
|
929
|
-
const summary = await summarizeTiers(storage);
|
|
930
|
-
const storageDir = storage.dir ?? "";
|
|
931
|
-
const journalPath = storageDir.length > 0 ? path2.join(storageDir, "state", "tier-migration-journal.jsonl") : null;
|
|
932
|
-
let recentMigrations = 0;
|
|
933
|
-
const demotionReasons = {};
|
|
934
|
-
const sevenDaysAgoMs = Date.now() - 7 * 864e5;
|
|
935
|
-
if (journalPath) {
|
|
936
|
-
try {
|
|
937
|
-
const { readFile: readFile2 } = await import("fs/promises");
|
|
938
|
-
const raw = await readFile2(journalPath, "utf-8");
|
|
939
|
-
for (const line of raw.split("\n")) {
|
|
940
|
-
const trimmed = line.trim();
|
|
941
|
-
if (trimmed.length === 0) continue;
|
|
942
|
-
try {
|
|
943
|
-
const entry = JSON.parse(trimmed);
|
|
944
|
-
const tsMs = entry.ts ? Date.parse(entry.ts) : NaN;
|
|
945
|
-
if (Number.isFinite(tsMs) && tsMs >= sevenDaysAgoMs && entry.changed === true) {
|
|
946
|
-
recentMigrations += 1;
|
|
947
|
-
if (entry.fromTier === "hot" && entry.toTier === "cold" && typeof entry.reason === "string") {
|
|
948
|
-
const reason = entry.reason;
|
|
949
|
-
demotionReasons[reason] = (demotionReasons[reason] ?? 0) + 1;
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
} catch {
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
} catch {
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
const topDemotionReasons = Object.entries(demotionReasons).sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).slice(0, 5).map(([reason, count]) => ({ reason, count }));
|
|
959
|
-
const statusParts = Object.entries(summary.byStatus).sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).slice(0, 6).map(([s, n]) => `${s}: ${n}`).join(", ");
|
|
960
|
-
return {
|
|
961
|
-
key: "tier_distribution",
|
|
962
|
-
status: "ok",
|
|
963
|
-
summary: `Tier distribution: hot=${summary.byTier.hot}, cold=${summary.byTier.cold}` + (summary.forgottenCount > 0 ? `, forgotten=${summary.forgottenCount}` : "") + `. Total: ${summary.total}.` + (recentMigrations > 0 ? ` Recent migrations (7d): ${recentMigrations}.` : ""),
|
|
964
|
-
details: {
|
|
965
|
-
total: summary.total,
|
|
966
|
-
byTier: summary.byTier,
|
|
967
|
-
byStatus: summary.byStatus,
|
|
968
|
-
forgottenCount: summary.forgottenCount,
|
|
969
|
-
statusSummary: statusParts,
|
|
970
|
-
recentMigrations,
|
|
971
|
-
topDemotionReasons
|
|
972
|
-
}
|
|
973
|
-
};
|
|
974
|
-
} catch (err) {
|
|
975
|
-
return {
|
|
976
|
-
key: "tier_distribution",
|
|
977
|
-
status: "ok",
|
|
978
|
-
summary: "Tier distribution unavailable \u2014 could not enumerate memories.",
|
|
979
|
-
details: { error: String(err) }
|
|
980
|
-
};
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
async function summarizeDreamsPhases(config, storage = new StorageManager(config.memoryDir)) {
|
|
984
|
-
const phases = config.dreamsPhases;
|
|
985
|
-
const meta = await storage.loadMeta();
|
|
986
|
-
let deepSleepLastRun = null;
|
|
987
|
-
let deepSleepLastRunWarning = null;
|
|
988
|
-
try {
|
|
989
|
-
const runsDir = path2.join(config.memoryDir, "state", "memory-governance", "runs");
|
|
990
|
-
const runIds = (await readdir2(runsDir)).sort().reverse();
|
|
991
|
-
if (runIds.length > 0) {
|
|
992
|
-
const latestRunId = runIds[0];
|
|
993
|
-
const manifestPath = path2.join(
|
|
994
|
-
runsDir,
|
|
995
|
-
latestRunId,
|
|
996
|
-
"manifest.json"
|
|
997
|
-
);
|
|
998
|
-
const raw = await readFile(manifestPath, "utf-8");
|
|
999
|
-
const parsed = JSON.parse(raw);
|
|
1000
|
-
if (typeof parsed.createdAt === "string" && parsed.createdAt.length > 0) {
|
|
1001
|
-
deepSleepLastRun = parsed.createdAt;
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
} catch (error) {
|
|
1005
|
-
if (!isMissingPathError(error)) {
|
|
1006
|
-
deepSleepLastRunWarning = `Could not read latest governance run manifest: ${formatUnknownError(error)}`;
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
const phaseLines = [
|
|
1010
|
-
`lightSleep: enabled=${phases.lightSleep.enabled}, cadenceMs=${phases.lightSleep.cadenceMs}, promoteHeat=${phases.lightSleep.promoteHeatThreshold}, staleDecay=${phases.lightSleep.staleDecayThreshold}, archiveDecay=${phases.lightSleep.archiveDecayThreshold}, filterStale=${phases.lightSleep.filterStaleEnabled}, lastRun=${meta.lastExtractionAt ?? "never"}`,
|
|
1011
|
-
`rem: enabled=${phases.rem.enabled}, cadenceMs=${phases.rem.cadenceMs}, similarity=${phases.rem.similarityThreshold}, minCluster=${phases.rem.minClusterSize}, maxPerRun=${phases.rem.maxPerRun}, minIntervalMs=${phases.rem.minIntervalMs}, lastRun=${meta.lastConsolidationAt ?? "never"}`,
|
|
1012
|
-
`deepSleep: enabled=${phases.deepSleep.enabled}, cadenceMs=${phases.deepSleep.cadenceMs}, versioning=${phases.deepSleep.versioningEnabled}, versioningMaxPerPage=${phases.deepSleep.versioningMaxPerPage}, lastRun=${deepSleepLastRun ?? "never"}`
|
|
1013
|
-
];
|
|
1014
|
-
return {
|
|
1015
|
-
key: "dreams_phases",
|
|
1016
|
-
status: deepSleepLastRunWarning ? "warn" : "ok",
|
|
1017
|
-
summary: `Dreams pipeline phases: ${phaseLines.join("; ")}${deepSleepLastRunWarning ? `; ${deepSleepLastRunWarning}` : ""}`,
|
|
1018
|
-
remediation: deepSleepLastRunWarning ? "Inspect state/memory-governance/runs and repair or remove unreadable governance run artifacts." : void 0,
|
|
1019
|
-
details: {
|
|
1020
|
-
lightSleep: {
|
|
1021
|
-
enabled: phases.lightSleep.enabled,
|
|
1022
|
-
cadenceMs: phases.lightSleep.cadenceMs,
|
|
1023
|
-
promoteHeatThreshold: phases.lightSleep.promoteHeatThreshold,
|
|
1024
|
-
staleDecayThreshold: phases.lightSleep.staleDecayThreshold,
|
|
1025
|
-
archiveDecayThreshold: phases.lightSleep.archiveDecayThreshold,
|
|
1026
|
-
filterStaleEnabled: phases.lightSleep.filterStaleEnabled,
|
|
1027
|
-
lastRun: meta.lastExtractionAt ?? null
|
|
1028
|
-
},
|
|
1029
|
-
rem: {
|
|
1030
|
-
enabled: phases.rem.enabled,
|
|
1031
|
-
cadenceMs: phases.rem.cadenceMs,
|
|
1032
|
-
similarityThreshold: phases.rem.similarityThreshold,
|
|
1033
|
-
minClusterSize: phases.rem.minClusterSize,
|
|
1034
|
-
maxPerRun: phases.rem.maxPerRun,
|
|
1035
|
-
minIntervalMs: phases.rem.minIntervalMs,
|
|
1036
|
-
lastRun: meta.lastConsolidationAt ?? null
|
|
1037
|
-
},
|
|
1038
|
-
deepSleep: {
|
|
1039
|
-
enabled: phases.deepSleep.enabled,
|
|
1040
|
-
cadenceMs: phases.deepSleep.cadenceMs,
|
|
1041
|
-
versioningEnabled: phases.deepSleep.versioningEnabled,
|
|
1042
|
-
versioningMaxPerPage: phases.deepSleep.versioningMaxPerPage,
|
|
1043
|
-
lastRun: deepSleepLastRun,
|
|
1044
|
-
warning: deepSleepLastRunWarning
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
};
|
|
1048
|
-
}
|
|
1049
|
-
function summarizeSecurityMitigations(config) {
|
|
1050
|
-
const budgetEnabled = config.recallCrossNamespaceBudgetEnabled === true;
|
|
1051
|
-
const anomalyEnabled = config.recallAuditAnomalyDetectionEnabled === true;
|
|
1052
|
-
if (!budgetEnabled && !anomalyEnabled) {
|
|
1053
|
-
return {
|
|
1054
|
-
key: "security_mitigations",
|
|
1055
|
-
status: "warn",
|
|
1056
|
-
summary: "Memory-extraction mitigations are disabled (cross-namespace budget and anomaly detection off).",
|
|
1057
|
-
remediation: "Enable recallCrossNamespaceBudgetEnabled and/or recallAuditAnomalyDetectionEnabled for production deployments. See docs/security/memory-extraction-threat-model.md.",
|
|
1058
|
-
details: {
|
|
1059
|
-
budgetEnabled: false,
|
|
1060
|
-
anomalyDetectionEnabled: false
|
|
1061
|
-
}
|
|
1062
|
-
};
|
|
1063
|
-
}
|
|
1064
|
-
const details = {
|
|
1065
|
-
budgetEnabled,
|
|
1066
|
-
anomalyDetectionEnabled: anomalyEnabled
|
|
1067
|
-
};
|
|
1068
|
-
if (budgetEnabled) {
|
|
1069
|
-
details.budgetConfig = {
|
|
1070
|
-
windowMs: config.recallCrossNamespaceBudgetWindowMs,
|
|
1071
|
-
softLimit: config.recallCrossNamespaceBudgetSoftLimit,
|
|
1072
|
-
hardLimit: config.recallCrossNamespaceBudgetHardLimit
|
|
1073
|
-
};
|
|
1074
|
-
}
|
|
1075
|
-
if (anomalyEnabled) {
|
|
1076
|
-
details.anomalyConfig = {
|
|
1077
|
-
windowMs: config.recallAuditAnomalyWindowMs,
|
|
1078
|
-
repeatQueryLimit: config.recallAuditAnomalyRepeatQueryLimit,
|
|
1079
|
-
namespaceWalkLimit: config.recallAuditAnomalyNamespaceWalkLimit,
|
|
1080
|
-
highCardinalityLimit: config.recallAuditAnomalyHighCardinalityLimit,
|
|
1081
|
-
rapidFireLimit: config.recallAuditAnomalyRapidFireLimit
|
|
1082
|
-
};
|
|
1083
|
-
}
|
|
1084
|
-
return {
|
|
1085
|
-
key: "security_mitigations",
|
|
1086
|
-
status: "ok",
|
|
1087
|
-
summary: `Memory-extraction mitigation config enabled: ${budgetEnabled ? "budget" : ""}${budgetEnabled && anomalyEnabled ? ", " : ""}${anomalyEnabled ? "anomaly detection" : ""}.`,
|
|
1088
|
-
details: { ...details, configOnly: true }
|
|
1089
|
-
};
|
|
1090
|
-
}
|
|
1091
|
-
async function summarizeObservationThroughput(memoryDir) {
|
|
1092
|
-
try {
|
|
1093
|
-
const stats = await readJudgeVerdictStats(memoryDir);
|
|
1094
|
-
if (stats.total === 0) {
|
|
1095
|
-
return {
|
|
1096
|
-
key: "observations",
|
|
1097
|
-
status: "ok",
|
|
1098
|
-
summary: "No observations recorded yet (extraction-judge telemetry ledger is empty or missing).",
|
|
1099
|
-
details: { total: 0, accept: 0, reject: 0, defer: 0, lastObservedAt: null }
|
|
1100
|
-
};
|
|
1101
|
-
}
|
|
1102
|
-
const acceptPct = (stats.accept / stats.total * 100).toFixed(1);
|
|
1103
|
-
const rejectPct = (stats.reject / stats.total * 100).toFixed(1);
|
|
1104
|
-
const deferPct = (stats.defer / stats.total * 100).toFixed(1);
|
|
1105
|
-
return {
|
|
1106
|
-
key: "observations",
|
|
1107
|
-
status: "ok",
|
|
1108
|
-
summary: `${stats.total} observations recorded: accept=${acceptPct}%, reject=${rejectPct}%, defer=${deferPct}%. Last observed: ${stats.lastTs ?? "unknown"}.`,
|
|
1109
|
-
details: {
|
|
1110
|
-
total: stats.total,
|
|
1111
|
-
accept: stats.accept,
|
|
1112
|
-
reject: stats.reject,
|
|
1113
|
-
defer: stats.defer,
|
|
1114
|
-
deferCapTriggered: stats.deferCapTriggered,
|
|
1115
|
-
deferRate: stats.deferRate,
|
|
1116
|
-
meanElapsedMs: stats.meanElapsedMs,
|
|
1117
|
-
firstObservedAt: stats.firstTs ?? null,
|
|
1118
|
-
lastObservedAt: stats.lastTs ?? null
|
|
1119
|
-
}
|
|
1120
|
-
};
|
|
1121
|
-
} catch (err) {
|
|
1122
|
-
return {
|
|
1123
|
-
key: "observations",
|
|
1124
|
-
status: "warn",
|
|
1125
|
-
summary: "Could not read observation telemetry ledger.",
|
|
1126
|
-
remediation: "Retry `remnic doctor` after ensuring the memory state directory is readable.",
|
|
1127
|
-
details: { error: String(err) }
|
|
1128
|
-
};
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
async function summarizeConsolidationProvenance(storage, config) {
|
|
1132
|
-
let report;
|
|
1133
|
-
try {
|
|
1134
|
-
report = await runConsolidationProvenanceCheck({
|
|
1135
|
-
storage,
|
|
1136
|
-
memoryDir: config.memoryDir,
|
|
1137
|
-
// Honor the configured sidecar directory (PR #634 review): when an
|
|
1138
|
-
// operator overrides `versioningSidecarDir`, the default `.versions`
|
|
1139
|
-
// would point at the wrong location and every entry would report as
|
|
1140
|
-
// missing. Undefined falls back to the helper's default.
|
|
1141
|
-
sidecarDir: config.versioningSidecarDir
|
|
1142
|
-
});
|
|
1143
|
-
} catch (err) {
|
|
1144
|
-
return {
|
|
1145
|
-
key: "consolidation_provenance",
|
|
1146
|
-
status: "warn",
|
|
1147
|
-
summary: "Could not run consolidation-provenance integrity check.",
|
|
1148
|
-
remediation: "Ensure the memory directory is readable and rerun `remnic doctor`.",
|
|
1149
|
-
details: { error: String(err) }
|
|
1150
|
-
};
|
|
1151
|
-
}
|
|
1152
|
-
if (report.issues.length === 0) {
|
|
1153
|
-
return {
|
|
1154
|
-
key: "consolidation_provenance",
|
|
1155
|
-
status: "ok",
|
|
1156
|
-
summary: report.withProvenance === 0 ? "No consolidation-provenance memories on disk yet." : `${report.withProvenance} consolidation-provenance memories verified (no broken references).`,
|
|
1157
|
-
details: report
|
|
1158
|
-
};
|
|
1159
|
-
}
|
|
1160
|
-
return {
|
|
1161
|
-
key: "consolidation_provenance",
|
|
1162
|
-
status: "warn",
|
|
1163
|
-
summary: `${report.issues.length} consolidation-provenance integrity issue(s) detected across ${report.withProvenance} memories with provenance frontmatter.`,
|
|
1164
|
-
remediation: "Broken pointers are informational. Inspect flagged memories, and if they should resolve, re-snapshot via a consolidation pass or accept pruning.",
|
|
1165
|
-
details: report
|
|
1166
|
-
};
|
|
1167
|
-
}
|
|
1168
|
-
function getMemoryAgeBand(memory, now) {
|
|
1169
|
-
const created = Date.parse(memory.frontmatter.created ?? "");
|
|
1170
|
-
if (!Number.isFinite(created)) return "unknown";
|
|
1171
|
-
const ageDays = Math.max(0, Math.floor((now.getTime() - created) / 864e5));
|
|
1172
|
-
if (ageDays < 7) return "0_6d";
|
|
1173
|
-
if (ageDays < 30) return "7_29d";
|
|
1174
|
-
if (ageDays < 90) return "30_89d";
|
|
1175
|
-
return "90d_plus";
|
|
1176
|
-
}
|
|
1177
|
-
async function dirSize(targetPath) {
|
|
1178
|
-
try {
|
|
1179
|
-
const info = await stat(targetPath);
|
|
1180
|
-
if (info.isFile()) return info.size;
|
|
1181
|
-
if (!info.isDirectory()) return 0;
|
|
1182
|
-
} catch {
|
|
1183
|
-
return 0;
|
|
1184
|
-
}
|
|
1185
|
-
let total = 0;
|
|
1186
|
-
let entries;
|
|
1187
|
-
try {
|
|
1188
|
-
entries = await readdir2(targetPath, { withFileTypes: true });
|
|
1189
|
-
} catch {
|
|
1190
|
-
return 0;
|
|
1191
|
-
}
|
|
1192
|
-
for (const entry of entries) {
|
|
1193
|
-
total += await dirSize(path2.join(targetPath, entry.name));
|
|
1194
|
-
}
|
|
1195
|
-
return total;
|
|
1196
|
-
}
|
|
1197
|
-
async function summarizeStorageFootprint(memoryDir) {
|
|
1198
|
-
const topLevel = [
|
|
1199
|
-
"facts",
|
|
1200
|
-
"entities",
|
|
1201
|
-
"questions",
|
|
1202
|
-
"corrections",
|
|
1203
|
-
"artifacts",
|
|
1204
|
-
"state",
|
|
1205
|
-
"identity",
|
|
1206
|
-
"namespaces",
|
|
1207
|
-
"summaries",
|
|
1208
|
-
"profile.md"
|
|
1209
|
-
];
|
|
1210
|
-
const byTopLevel = {};
|
|
1211
|
-
let bytes = 0;
|
|
1212
|
-
for (const name of topLevel) {
|
|
1213
|
-
const size = await dirSize(path2.join(memoryDir, name));
|
|
1214
|
-
if (size > 0) {
|
|
1215
|
-
byTopLevel[name] = size;
|
|
1216
|
-
bytes += size;
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
return { bytes, byTopLevel };
|
|
1220
|
-
}
|
|
1221
|
-
async function runOperatorInventory(options) {
|
|
1222
|
-
const now = options.now ?? /* @__PURE__ */ new Date();
|
|
1223
|
-
const config = options.orchestrator.config;
|
|
1224
|
-
const namespaceEntries = await listNamespaces({ config });
|
|
1225
|
-
const uniqueRootEntries = /* @__PURE__ */ new Map();
|
|
1226
|
-
for (const entry of namespaceEntries) {
|
|
1227
|
-
if (!uniqueRootEntries.has(entry.rootDir)) {
|
|
1228
|
-
uniqueRootEntries.set(entry.rootDir, { namespace: entry.namespace, rootDir: entry.rootDir });
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
const categories = {};
|
|
1232
|
-
const statuses = {};
|
|
1233
|
-
const ageBands = {
|
|
1234
|
-
"0_6d": 0,
|
|
1235
|
-
"7_29d": 0,
|
|
1236
|
-
"30_89d": 0,
|
|
1237
|
-
"90d_plus": 0,
|
|
1238
|
-
unknown: 0
|
|
1239
|
-
};
|
|
1240
|
-
const namespaces = [];
|
|
1241
|
-
let totalMemories = 0;
|
|
1242
|
-
let totalEntities = 0;
|
|
1243
|
-
let archived = 0;
|
|
1244
|
-
let pendingReview = 0;
|
|
1245
|
-
let quarantined = 0;
|
|
1246
|
-
let rejected = 0;
|
|
1247
|
-
for (const entry of uniqueRootEntries.values()) {
|
|
1248
|
-
const storage = new StorageManager(entry.rootDir);
|
|
1249
|
-
const memories = await storage.readAllMemories();
|
|
1250
|
-
const entities = await storage.readAllEntityFiles();
|
|
1251
|
-
namespaces.push({
|
|
1252
|
-
namespace: entry.namespace,
|
|
1253
|
-
memoryCount: memories.length,
|
|
1254
|
-
entityCount: entities.length
|
|
1255
|
-
});
|
|
1256
|
-
totalMemories += memories.length;
|
|
1257
|
-
totalEntities += entities.length;
|
|
1258
|
-
for (const memory of memories) {
|
|
1259
|
-
const category = memory.frontmatter.category;
|
|
1260
|
-
categories[category] = (categories[category] ?? 0) + 1;
|
|
1261
|
-
const status = memory.frontmatter.status ?? "active";
|
|
1262
|
-
statuses[status] = (statuses[status] ?? 0) + 1;
|
|
1263
|
-
ageBands[getMemoryAgeBand(memory, now)] += 1;
|
|
1264
|
-
if (status === "archived") archived += 1;
|
|
1265
|
-
if (status === "pending_review") pendingReview += 1;
|
|
1266
|
-
if (status === "quarantined") quarantined += 1;
|
|
1267
|
-
if (status === "rejected") rejected += 1;
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
const defaultStorage = new StorageManager(config.memoryDir);
|
|
1271
|
-
const profile = await defaultStorage.readProfile();
|
|
1272
|
-
const footprint = await summarizeStorageFootprint(config.memoryDir);
|
|
1273
|
-
const reviewRunId = (await listMemoryGovernanceRuns(config.memoryDir))[0];
|
|
1274
|
-
let reviewQueue = 0;
|
|
1275
|
-
if (reviewRunId) {
|
|
1276
|
-
try {
|
|
1277
|
-
reviewQueue = (await readMemoryGovernanceRunArtifact(config.memoryDir, reviewRunId)).reviewQueue.length;
|
|
1278
|
-
} catch {
|
|
1279
|
-
reviewQueue = 0;
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1282
|
-
const conversationIndex = await options.orchestrator.getConversationIndexHealth();
|
|
1283
|
-
const nativeKnowledgeStatus = await summarizeNativeKnowledgeStatus(config);
|
|
1284
|
-
return {
|
|
1285
|
-
schemaVersion: 1,
|
|
1286
|
-
generatedAt: now.toISOString(),
|
|
1287
|
-
memoryDir: config.memoryDir,
|
|
1288
|
-
totals: {
|
|
1289
|
-
memories: totalMemories,
|
|
1290
|
-
entities: totalEntities,
|
|
1291
|
-
namespaces: namespaceEntries.length,
|
|
1292
|
-
reviewQueue,
|
|
1293
|
-
storageBytes: footprint.bytes
|
|
1294
|
-
},
|
|
1295
|
-
categories,
|
|
1296
|
-
statuses,
|
|
1297
|
-
namespaces,
|
|
1298
|
-
ageBands,
|
|
1299
|
-
profile: {
|
|
1300
|
-
exists: profile.length > 0,
|
|
1301
|
-
chars: profile.length,
|
|
1302
|
-
lines: profile.length > 0 ? profile.split("\n").length : 0
|
|
1303
|
-
},
|
|
1304
|
-
storageFootprint: footprint,
|
|
1305
|
-
archivePressure: {
|
|
1306
|
-
archived,
|
|
1307
|
-
pendingReview,
|
|
1308
|
-
quarantined,
|
|
1309
|
-
rejected
|
|
1310
|
-
},
|
|
1311
|
-
conversationIndex: {
|
|
1312
|
-
enabled: conversationIndex.enabled,
|
|
1313
|
-
backend: conversationIndex.backend,
|
|
1314
|
-
status: conversationIndex.status,
|
|
1315
|
-
chunkDocCount: conversationIndex.chunkDocCount,
|
|
1316
|
-
lastUpdateAt: conversationIndex.lastUpdateAt
|
|
1317
|
-
},
|
|
1318
|
-
nativeKnowledge: {
|
|
1319
|
-
enabled: nativeKnowledgeStatus.enabled,
|
|
1320
|
-
curatedIncludeSync: nativeKnowledgeStatus.curatedIncludeSync,
|
|
1321
|
-
obsidianSync: nativeKnowledgeStatus.obsidianSync,
|
|
1322
|
-
openclawWorkspaceSync: nativeKnowledgeStatus.openclawWorkspaceSync
|
|
1323
|
-
}
|
|
1324
|
-
};
|
|
1325
|
-
}
|
|
1326
|
-
async function runBenchmarkRecall(options) {
|
|
1327
|
-
const now = options.now ?? /* @__PURE__ */ new Date();
|
|
1328
|
-
const status = await getEvalHarnessStatus({
|
|
1329
|
-
memoryDir: options.config.memoryDir,
|
|
1330
|
-
evalStoreDir: options.config.evalStoreDir,
|
|
1331
|
-
enabled: options.config.evalHarnessEnabled,
|
|
1332
|
-
shadowModeEnabled: options.config.evalShadowModeEnabled,
|
|
1333
|
-
baselineSnapshotsEnabled: options.config.benchmarkBaselineSnapshotsEnabled,
|
|
1334
|
-
memoryRedTeamBenchEnabled: options.config.memoryRedTeamBenchEnabled
|
|
1335
|
-
});
|
|
1336
|
-
if (options.createSnapshot && options.snapshotId) {
|
|
1337
|
-
const snapshot = await createEvalBaselineSnapshot({
|
|
1338
|
-
memoryDir: options.config.memoryDir,
|
|
1339
|
-
evalStoreDir: options.config.evalStoreDir,
|
|
1340
|
-
baselineSnapshotsEnabled: options.config.benchmarkBaselineSnapshotsEnabled,
|
|
1341
|
-
snapshotId: options.snapshotId,
|
|
1342
|
-
notes: options.snapshotNotes,
|
|
1343
|
-
gitRef: options.gitRef,
|
|
1344
|
-
createdAt: options.createdAt
|
|
1345
|
-
});
|
|
1346
|
-
return {
|
|
1347
|
-
schemaVersion: 1,
|
|
1348
|
-
generatedAt: now.toISOString(),
|
|
1349
|
-
mode: "snapshot",
|
|
1350
|
-
status,
|
|
1351
|
-
snapshot: {
|
|
1352
|
-
targetPath: snapshot.targetPath,
|
|
1353
|
-
snapshotId: snapshot.snapshot.snapshotId
|
|
1354
|
-
}
|
|
1355
|
-
};
|
|
1356
|
-
}
|
|
1357
|
-
if (options.baseEvalStoreDir && options.candidateEvalStoreDir) {
|
|
1358
|
-
const ciGate = await runEvalBenchmarkCiGate({
|
|
1359
|
-
baseEvalStoreDir: options.baseEvalStoreDir,
|
|
1360
|
-
candidateEvalStoreDir: options.candidateEvalStoreDir
|
|
1361
|
-
});
|
|
1362
|
-
return {
|
|
1363
|
-
schemaVersion: 1,
|
|
1364
|
-
generatedAt: now.toISOString(),
|
|
1365
|
-
mode: "ci-gate",
|
|
1366
|
-
status,
|
|
1367
|
-
ciGate
|
|
1368
|
-
};
|
|
1369
|
-
}
|
|
1370
|
-
if (options.snapshotId) {
|
|
1371
|
-
const baselineReport = await runEvalBaselineDeltaReport({
|
|
1372
|
-
memoryDir: options.config.memoryDir,
|
|
1373
|
-
evalStoreDir: options.config.evalStoreDir,
|
|
1374
|
-
benchmarkDeltaReporterEnabled: options.config.benchmarkDeltaReporterEnabled,
|
|
1375
|
-
snapshotId: options.snapshotId
|
|
1376
|
-
});
|
|
1377
|
-
return {
|
|
1378
|
-
schemaVersion: 1,
|
|
1379
|
-
generatedAt: now.toISOString(),
|
|
1380
|
-
mode: "baseline-report",
|
|
1381
|
-
status,
|
|
1382
|
-
baselineReport
|
|
1383
|
-
};
|
|
1384
|
-
}
|
|
1385
|
-
if (options.validatePath) {
|
|
1386
|
-
const validate = await validateEvalBenchmarkPack(options.validatePath, {
|
|
1387
|
-
memoryRedTeamBenchEnabled: options.config.memoryRedTeamBenchEnabled
|
|
1388
|
-
});
|
|
1389
|
-
return {
|
|
1390
|
-
schemaVersion: 1,
|
|
1391
|
-
generatedAt: now.toISOString(),
|
|
1392
|
-
mode: "validate",
|
|
1393
|
-
status,
|
|
1394
|
-
validate
|
|
1395
|
-
};
|
|
1396
|
-
}
|
|
1397
|
-
return {
|
|
1398
|
-
schemaVersion: 1,
|
|
1399
|
-
generatedAt: now.toISOString(),
|
|
1400
|
-
mode: "status",
|
|
1401
|
-
status
|
|
1402
|
-
};
|
|
1403
|
-
}
|
|
1404
|
-
async function runOperatorRepair(options) {
|
|
1405
|
-
const now = options.now ?? /* @__PURE__ */ new Date();
|
|
1406
|
-
const dryRun = options.dryRun === true || options.apply !== true;
|
|
1407
|
-
const sessionCheck = await analyzeSessionIntegrity({ memoryDir: options.config.memoryDir });
|
|
1408
|
-
const sessionRepairPlan = planSessionRepair({
|
|
1409
|
-
report: sessionCheck,
|
|
1410
|
-
dryRun,
|
|
1411
|
-
allowSessionFileRepair: options.allowSessionFileRepair,
|
|
1412
|
-
sessionFilesDir: options.sessionFilesDir
|
|
1413
|
-
});
|
|
1414
|
-
const sessionRepairApply = await applySessionRepair({
|
|
1415
|
-
plan: sessionRepairPlan
|
|
1416
|
-
});
|
|
1417
|
-
const graphHealth = await analyzeGraphHealth(options.config.memoryDir, {
|
|
1418
|
-
entityGraphEnabled: options.config.entityGraphEnabled,
|
|
1419
|
-
timeGraphEnabled: options.config.timeGraphEnabled,
|
|
1420
|
-
causalGraphEnabled: options.config.causalGraphEnabled,
|
|
1421
|
-
includeRepairGuidance: true
|
|
1422
|
-
});
|
|
1423
|
-
return {
|
|
1424
|
-
schemaVersion: 1,
|
|
1425
|
-
generatedAt: now.toISOString(),
|
|
1426
|
-
dryRun,
|
|
1427
|
-
sessionCheck,
|
|
1428
|
-
sessionRepairPlan,
|
|
1429
|
-
sessionRepairApply,
|
|
1430
|
-
graphHealth
|
|
1431
|
-
};
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
export {
|
|
1435
|
-
listNamespaces,
|
|
1436
|
-
verifyNamespaces,
|
|
1437
|
-
runNamespaceMigration,
|
|
1438
|
-
runOperatorSetup,
|
|
1439
|
-
runOperatorConfigReview,
|
|
1440
|
-
runOperatorDoctor,
|
|
1441
|
-
summarizeMemoryWorthLegacyCounters,
|
|
1442
|
-
summarizeBufferSurpriseDistribution,
|
|
1443
|
-
summarizeTierDistribution,
|
|
1444
|
-
summarizeDreamsPhases,
|
|
1445
|
-
summarizeObservationThroughput,
|
|
1446
|
-
summarizeConsolidationProvenance,
|
|
1447
|
-
runOperatorInventory,
|
|
1448
|
-
runBenchmarkRecall,
|
|
1449
|
-
runOperatorRepair
|
|
1450
|
-
};
|
|
1451
|
-
//# sourceMappingURL=chunk-DZZPC36E.js.map
|