@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
|
@@ -1,1792 +0,0 @@
|
|
|
1
|
-
import { SmartBuffer } from './buffer.js';
|
|
2
|
-
import { S as SearchBackend, a as SearchQueryOptions, b as SearchExecutionOptions } from './port-B6VEDIkC.js';
|
|
3
|
-
import { StorageManager } from './storage.js';
|
|
4
|
-
import { TranscriptManager } from './transcript.js';
|
|
5
|
-
import { HourlySummarizer } from './summarizer.js';
|
|
6
|
-
import { LocalLlmClient } from './local-llm.js';
|
|
7
|
-
import { FallbackLlmClient } from './fallback-llm.js';
|
|
8
|
-
import { LiveConnectorsRunSummary } from './live-connectors-runner.js';
|
|
9
|
-
import { ModelRegistry } from './model-registry.js';
|
|
10
|
-
import { RelevanceStore } from './relevance.js';
|
|
11
|
-
import { NegativeExampleStore } from './negative.js';
|
|
12
|
-
import { LastRecallStore, TierMigrationStatusStore, GraphRecallExpandedEntry, TierMigrationStatusSnapshot, TierMigrationCycleSummary, LastRecallSnapshot } from './recall-state.js';
|
|
13
|
-
import { RecallXraySnapshot } from './recall-xray.js';
|
|
14
|
-
import { SessionObserverState } from './session-observer-state.js';
|
|
15
|
-
import { EmbeddingFallback } from './embedding-fallback.js';
|
|
16
|
-
import { L as LcmMessagePartInput, M as MessagePartSourceFormat } from './index-DJ9QWMw-.js';
|
|
17
|
-
import { PluginConfig, CodingContext, QmdSearchResult, BehaviorLoopPolicyState, BootstrapOptions, BootstrapResult, ConsolidationObservation, MemoryFile, DaySummaryResult, MemoryActionEvent, RecallPlanMode, MemoryIntent, EntityTimelineEntry, ExtractionResult, MemoryFrontmatter, IdentityInjectionMode } from './types.js';
|
|
18
|
-
import { S as SemanticConsolidationResult } from './semantic-consolidation-ByBXb-sf.js';
|
|
19
|
-
import { z } from 'zod';
|
|
20
|
-
import { RuntimePolicyValues } from './policy-runtime.js';
|
|
21
|
-
import { ProfilingCollector } from './profiling.js';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Pattern-reinforcement maintenance job (issue #687 PR 2/4).
|
|
25
|
-
*
|
|
26
|
-
* Reads all memories via `StorageManager.readAllMemories()`, clusters
|
|
27
|
-
* non-procedural memories by normalized content, and reinforces the
|
|
28
|
-
* most-recent member of each large-enough cluster:
|
|
29
|
-
*
|
|
30
|
-
* 1. Cluster across active AND already-superseded members. This is
|
|
31
|
-
* load-bearing: after the first reinforcement pass, older
|
|
32
|
-
* duplicates are marked `superseded`, so on the next pass the
|
|
33
|
-
* "active count" alone would be just `canonical + N-new`. By
|
|
34
|
-
* keeping superseded members in the cluster for the threshold
|
|
35
|
-
* check, an established canonical (count >= minCount) keeps
|
|
36
|
-
* growing as soon as a single new duplicate arrives.
|
|
37
|
-
* `forgotten` / `archived` / `quarantined` / `pending_review` /
|
|
38
|
-
* `rejected` stay excluded per CLAUDE.md rule 53.
|
|
39
|
-
* 2. Pick the most-recent ACTIVE member of each cluster as the
|
|
40
|
-
* canonical. Stamp it with `reinforcement_count` (total cluster
|
|
41
|
-
* size including superseded members) and `last_reinforced_at`.
|
|
42
|
-
* Record provenance: `derived_from = [...source-ids...]` and
|
|
43
|
-
* `derived_via = "pattern-reinforcement"`.
|
|
44
|
-
* 3. Mark any still-active duplicates with `status: "superseded"`
|
|
45
|
-
* and point `supersededBy` at the canonical id.
|
|
46
|
-
*
|
|
47
|
-
* The job is idempotent: re-running on the same corpus does not
|
|
48
|
-
* double-bump `reinforcement_count` (the bump-only-on-change guard
|
|
49
|
-
* compares cluster size to the canonical's previous counter), and
|
|
50
|
-
* already-superseded duplicates simply pass through.
|
|
51
|
-
*
|
|
52
|
-
* Recall integration (boost from `reinforcement_count`) and the CLI
|
|
53
|
-
* surface ship in PR 3/4 and PR 4/4 respectively — this PR only wires
|
|
54
|
-
* the maintenance job and storage plumbing.
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
|
-
interface PatternReinforcementClusterResult {
|
|
58
|
-
/** Memory id of the canonical (most-recent) member. */
|
|
59
|
-
canonicalId: string;
|
|
60
|
-
/** Cluster size at run time (mirrors `reinforcement_count`). */
|
|
61
|
-
count: number;
|
|
62
|
-
/** IDs of the source memories that contributed (canonical + duplicates). */
|
|
63
|
-
sourceIds: readonly string[];
|
|
64
|
-
/** IDs of the older duplicates that were marked superseded. */
|
|
65
|
-
supersededIds: readonly string[];
|
|
66
|
-
/**
|
|
67
|
-
* `true` when the canonical's `reinforcement_count` actually
|
|
68
|
-
* changed during this run. False when the job converged
|
|
69
|
-
* idempotently (same cluster size as the previous run).
|
|
70
|
-
*/
|
|
71
|
-
reinforcementBumped: boolean;
|
|
72
|
-
}
|
|
73
|
-
interface PatternReinforcementResult {
|
|
74
|
-
/** Number of clusters that met the `minCount` threshold. */
|
|
75
|
-
clustersFound: number;
|
|
76
|
-
/** Number of canonical memories whose reinforcement counter changed. */
|
|
77
|
-
canonicalsUpdated: number;
|
|
78
|
-
/** Total duplicate memories newly marked `status: "superseded"`. */
|
|
79
|
-
duplicatesSuperseded: number;
|
|
80
|
-
/** Per-cluster details for tests / observability. */
|
|
81
|
-
clusters: PatternReinforcementClusterResult[];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* @remnic/core — Write-time semantic dedup guard
|
|
86
|
-
*
|
|
87
|
-
* Complements the exact content-hash check in the orchestrator's write path
|
|
88
|
-
* by detecting near-duplicate candidate facts via embedding cosine similarity.
|
|
89
|
-
*
|
|
90
|
-
* The module intentionally has no dependency on the EmbeddingFallback or QMD
|
|
91
|
-
* classes directly — callers pass in a `lookup` function that returns the
|
|
92
|
-
* top-K nearest neighbors with their cosine scores. This keeps the decision
|
|
93
|
-
* logic pure and trivially testable with synthetic fixtures, and lets the
|
|
94
|
-
* orchestrator reuse whichever backend it already has wired up.
|
|
95
|
-
*
|
|
96
|
-
* Related issue: joshuaswarren/remnic#373
|
|
97
|
-
*/
|
|
98
|
-
/** A single nearest-neighbor hit from the embedding backend. */
|
|
99
|
-
interface SemanticDedupHit {
|
|
100
|
-
/** Memory id of the existing neighbor. */
|
|
101
|
-
id: string;
|
|
102
|
-
/** Cosine similarity score in [0, 1]. */
|
|
103
|
-
score: number;
|
|
104
|
-
/** Optional source path, purely informational. */
|
|
105
|
-
path?: string;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Lookup function passed by the caller. Must return an array of hits sorted
|
|
109
|
-
* descending by score. Implementations should return an empty array (never
|
|
110
|
-
* throw) when the embedding backend is unavailable — the decision function
|
|
111
|
-
* treats that as "no near duplicate" (fail-open).
|
|
112
|
-
*/
|
|
113
|
-
type SemanticDedupLookup = (content: string, limit: number) => Promise<SemanticDedupHit[]>;
|
|
114
|
-
interface SemanticDedupOptions {
|
|
115
|
-
/** Master switch. When false, `decideSemanticDedup` always returns `keep`. */
|
|
116
|
-
enabled: boolean;
|
|
117
|
-
/** Cosine similarity threshold (0-1). ≥ threshold ⇒ treat as duplicate. */
|
|
118
|
-
threshold: number;
|
|
119
|
-
/** How many nearest neighbors to compare against. */
|
|
120
|
-
candidates: number;
|
|
121
|
-
}
|
|
122
|
-
type SemanticDedupDecision = {
|
|
123
|
-
action: "keep";
|
|
124
|
-
reason: "disabled" | "backend_unavailable" | "no_candidates" | "no_near_duplicate";
|
|
125
|
-
topScore?: number;
|
|
126
|
-
topId?: string;
|
|
127
|
-
} | {
|
|
128
|
-
action: "skip";
|
|
129
|
-
reason: "near_duplicate";
|
|
130
|
-
topScore: number;
|
|
131
|
-
topId: string;
|
|
132
|
-
topPath?: string;
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Pure decision function: given a lookup callback and options, decide whether
|
|
136
|
-
* the candidate content should be written or skipped as a near-duplicate.
|
|
137
|
-
*
|
|
138
|
-
* Contract:
|
|
139
|
-
* - When `options.enabled` is false → always keep, reason="disabled".
|
|
140
|
-
* - When the lookup throws (provider down / network error) → keep,
|
|
141
|
-
* reason="backend_unavailable". Fail-open: a lookup failure must not block
|
|
142
|
-
* writes.
|
|
143
|
-
* - When the lookup succeeds but returns 0 hits (empty index or no
|
|
144
|
-
* neighbors above the score floor) → keep, reason="no_candidates".
|
|
145
|
-
* This is distinct from backend_unavailable so telemetry dashboards can
|
|
146
|
-
* correctly distinguish "provider is down" from "index is empty".
|
|
147
|
-
* - When the top hit's score ≥ threshold → skip with reason="near_duplicate".
|
|
148
|
-
* - Otherwise → keep with reason="no_near_duplicate".
|
|
149
|
-
*/
|
|
150
|
-
declare function decideSemanticDedup(content: string, lookup: SemanticDedupLookup, options: SemanticDedupOptions): Promise<SemanticDedupDecision>;
|
|
151
|
-
|
|
152
|
-
type ReplaySource = "openclaw" | "claude" | "chatgpt";
|
|
153
|
-
type ReplayRole = "user" | "assistant";
|
|
154
|
-
interface ReplayTurn {
|
|
155
|
-
source: ReplaySource;
|
|
156
|
-
sessionKey: string;
|
|
157
|
-
role: ReplayRole;
|
|
158
|
-
content: string;
|
|
159
|
-
timestamp: string;
|
|
160
|
-
sourceValidAt?: string;
|
|
161
|
-
externalId?: string;
|
|
162
|
-
metadata?: Record<string, unknown>;
|
|
163
|
-
parts?: LcmMessagePartInput[];
|
|
164
|
-
rawContent?: unknown;
|
|
165
|
-
sourceFormat?: MessagePartSourceFormat;
|
|
166
|
-
}
|
|
167
|
-
interface ReplayWarning {
|
|
168
|
-
code: string;
|
|
169
|
-
message: string;
|
|
170
|
-
index?: number;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
interface BulkImportSource {
|
|
174
|
-
turns: ImportTurn[];
|
|
175
|
-
metadata: {
|
|
176
|
-
source: string;
|
|
177
|
-
exportDate: string;
|
|
178
|
-
messageCount: number;
|
|
179
|
-
dateRange: {
|
|
180
|
-
from: string;
|
|
181
|
-
to: string;
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
interface ImportTurn {
|
|
186
|
-
role: "user" | "assistant" | "other";
|
|
187
|
-
content: string;
|
|
188
|
-
timestamp: string;
|
|
189
|
-
participantId?: string;
|
|
190
|
-
participantName?: string;
|
|
191
|
-
replyToId?: string;
|
|
192
|
-
parts?: LcmMessagePartInput[];
|
|
193
|
-
rawContent?: unknown;
|
|
194
|
-
sourceFormat?: MessagePartSourceFormat;
|
|
195
|
-
}
|
|
196
|
-
interface BulkImportOptions {
|
|
197
|
-
batchSize?: number;
|
|
198
|
-
dryRun?: boolean;
|
|
199
|
-
dedup?: boolean;
|
|
200
|
-
trustLevel?: "import";
|
|
201
|
-
namespace?: string;
|
|
202
|
-
}
|
|
203
|
-
type ImportSourceRole = ImportTurn["role"];
|
|
204
|
-
interface BulkImportResult {
|
|
205
|
-
memoriesCreated: number;
|
|
206
|
-
duplicatesSkipped: number;
|
|
207
|
-
entitiesCreated: number;
|
|
208
|
-
turnsProcessed: number;
|
|
209
|
-
batchesProcessed: number;
|
|
210
|
-
errors: BulkImportError[];
|
|
211
|
-
}
|
|
212
|
-
interface BulkImportError {
|
|
213
|
-
batchIndex: number;
|
|
214
|
-
message: string;
|
|
215
|
-
}
|
|
216
|
-
interface BulkImportSourceAdapter {
|
|
217
|
-
name: string;
|
|
218
|
-
parse(input: unknown, options?: {
|
|
219
|
-
strict?: boolean;
|
|
220
|
-
platform?: string;
|
|
221
|
-
}): Promise<BulkImportSource> | BulkImportSource;
|
|
222
|
-
}
|
|
223
|
-
interface ImportTurnValidationIssue {
|
|
224
|
-
code: string;
|
|
225
|
-
message: string;
|
|
226
|
-
index?: number;
|
|
227
|
-
}
|
|
228
|
-
declare function isImportRole(value: unknown): value is ImportSourceRole;
|
|
229
|
-
/**
|
|
230
|
-
* Parse an ISO-8601 / RFC 3339 timestamp used by bulk-import adapters.
|
|
231
|
-
*
|
|
232
|
-
* Accepts variable-precision fractional seconds and either a `Z` suffix or a
|
|
233
|
-
* `[+-]HH:MM` timezone offset, so adapters may preserve their source
|
|
234
|
-
* timestamps verbatim. Returns milliseconds since epoch, or `null` if the
|
|
235
|
-
* string is not a well-formed timestamp (including overflowed calendar dates
|
|
236
|
-
* or out-of-range offsets).
|
|
237
|
-
*
|
|
238
|
-
* Delegates to the shared parser in `utils/iso-timestamp.ts` — do not
|
|
239
|
-
* reimplement locally; extend that helper instead.
|
|
240
|
-
*/
|
|
241
|
-
declare function parseIsoTimestamp(value: string): number | null;
|
|
242
|
-
declare function validateImportTurn(turn: ImportTurn, index?: number): ImportTurnValidationIssue[];
|
|
243
|
-
|
|
244
|
-
interface LcmStructuredRecallMatch {
|
|
245
|
-
part_id: number;
|
|
246
|
-
message_id: number;
|
|
247
|
-
turn_index: number;
|
|
248
|
-
role: string;
|
|
249
|
-
content: string;
|
|
250
|
-
session_id: string;
|
|
251
|
-
kind: string;
|
|
252
|
-
tool_name: string | null;
|
|
253
|
-
file_path: string | null;
|
|
254
|
-
payload: string;
|
|
255
|
-
score: number;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
type SummarizeFn = (text: string, targetTokens: number, aggressive: boolean) => Promise<string | null>;
|
|
259
|
-
|
|
260
|
-
interface LcmObserveMessage {
|
|
261
|
-
role: string;
|
|
262
|
-
content: string;
|
|
263
|
-
parts?: LcmMessagePartInput[];
|
|
264
|
-
rawContent?: unknown;
|
|
265
|
-
sourceFormat?: MessagePartSourceFormat;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
declare class LcmEngine {
|
|
269
|
-
private readonly summarizeFn;
|
|
270
|
-
private db;
|
|
271
|
-
private archive;
|
|
272
|
-
private dag;
|
|
273
|
-
private summarizer;
|
|
274
|
-
private observeQueue;
|
|
275
|
-
private closed;
|
|
276
|
-
private readonly config;
|
|
277
|
-
private readonly memoryDir;
|
|
278
|
-
private initPromise;
|
|
279
|
-
private readonly pendingObserveInitCounts;
|
|
280
|
-
private readonly pendingObserveInitWaiters;
|
|
281
|
-
private readonly pendingObserveInitIdleWaiters;
|
|
282
|
-
constructor(pluginConfig: PluginConfig, summarizeFn: SummarizeFn);
|
|
283
|
-
get enabled(): boolean;
|
|
284
|
-
/** Lazy init — open database on first use. */
|
|
285
|
-
ensureInitialized(): Promise<void>;
|
|
286
|
-
private doInit;
|
|
287
|
-
/**
|
|
288
|
-
* Enqueue messages from agent_end hook.
|
|
289
|
-
* The queue worker performs the archive append and incremental summarization.
|
|
290
|
-
*/
|
|
291
|
-
observeMessages(sessionId: string, messages: LcmObserveMessage[]): Promise<void>;
|
|
292
|
-
/** Enqueue an observe job without waiting for worker completion. */
|
|
293
|
-
enqueueObserveMessages(sessionId: string, messages: LcmObserveMessage[]): void;
|
|
294
|
-
private processObserveMessages;
|
|
295
|
-
get observeQueueDepth(): number;
|
|
296
|
-
get observeQueueInFlightCount(): number;
|
|
297
|
-
waitForObserveQueueIdle(): Promise<void>;
|
|
298
|
-
waitForSessionObserveIdle(sessionId: string): Promise<void>;
|
|
299
|
-
private reservePendingObserveInit;
|
|
300
|
-
private releasePendingObserveInit;
|
|
301
|
-
private waitForPendingObserveInitIdle;
|
|
302
|
-
/** Build the compressed history recall section for a session. */
|
|
303
|
-
assembleRecall(sessionId: string, budgetChars: number): Promise<string>;
|
|
304
|
-
searchStructuredParts(sessionId: string, query: string, limit?: number): Promise<LcmStructuredRecallMatch[]>;
|
|
305
|
-
formatStructuredRecall(matches: LcmStructuredRecallMatch[], budgetChars: number): string;
|
|
306
|
-
/** Flush pending summaries before compaction (called from before_compaction hook). */
|
|
307
|
-
preCompactionFlush(sessionId: string): Promise<void>;
|
|
308
|
-
/** Record a compaction event with real token counts (called from after_compaction hook). */
|
|
309
|
-
recordCompaction(sessionId: string, tokensBefore: number, tokensAfter: number): Promise<void>;
|
|
310
|
-
/** Verify archive coverage after compaction. */
|
|
311
|
-
verifyPostCompaction(sessionId: string): Promise<void>;
|
|
312
|
-
/** Search across all conversation history via FTS (snippet mode). */
|
|
313
|
-
searchContext(query: string, limit: number, sessionId?: string): Promise<Array<{
|
|
314
|
-
turn_index: number;
|
|
315
|
-
role: string;
|
|
316
|
-
snippet: string;
|
|
317
|
-
session_id: string;
|
|
318
|
-
}>>;
|
|
319
|
-
/** Search via FTS returning full message content (not snippets). */
|
|
320
|
-
searchContextFull(query: string, limit: number, sessionId?: string): Promise<Array<{
|
|
321
|
-
id: number;
|
|
322
|
-
turn_index: number;
|
|
323
|
-
role: string;
|
|
324
|
-
content: string;
|
|
325
|
-
session_id: string;
|
|
326
|
-
score: number;
|
|
327
|
-
}>>;
|
|
328
|
-
/** Get a compressed summary of a turn range. */
|
|
329
|
-
describeContext(sessionId: string, fromTurn: number, toTurn: number): Promise<{
|
|
330
|
-
summary: string;
|
|
331
|
-
turn_count: number;
|
|
332
|
-
depth: number;
|
|
333
|
-
} | null>;
|
|
334
|
-
/** Retrieve raw messages for a turn range (lossless expansion). */
|
|
335
|
-
expandContext(sessionId: string, fromTurn: number, toTurn: number, maxTokens: number): Promise<Array<{
|
|
336
|
-
turn_index: number;
|
|
337
|
-
role: string;
|
|
338
|
-
content: string;
|
|
339
|
-
}>>;
|
|
340
|
-
/** Get statistics about the LCM archive. */
|
|
341
|
-
getStats(sessionId?: string): Promise<{
|
|
342
|
-
totalMessages: number;
|
|
343
|
-
totalSummaryNodes: number;
|
|
344
|
-
maxDepth: number;
|
|
345
|
-
maxTurnIndex?: number;
|
|
346
|
-
}>;
|
|
347
|
-
/** Prune old data beyond retention period. */
|
|
348
|
-
prune(): Promise<{
|
|
349
|
-
messagesPruned: number;
|
|
350
|
-
nodesPruned: number;
|
|
351
|
-
}>;
|
|
352
|
-
/** Close the database connection. */
|
|
353
|
-
close(): void;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
interface ConversationIndexBackendInspection {
|
|
357
|
-
backend: "qmd" | "faiss";
|
|
358
|
-
status: "ok" | "degraded" | "disabled";
|
|
359
|
-
available: boolean;
|
|
360
|
-
indexPath: string;
|
|
361
|
-
supportsIncrementalUpdate: boolean;
|
|
362
|
-
message?: string;
|
|
363
|
-
metadata: {
|
|
364
|
-
chunkCount: number | null;
|
|
365
|
-
qmdAvailable?: boolean;
|
|
366
|
-
debugStatus?: string;
|
|
367
|
-
hasIndex?: boolean;
|
|
368
|
-
hasMetadata?: boolean;
|
|
369
|
-
hasManifest?: boolean;
|
|
370
|
-
manifest?: {
|
|
371
|
-
version: number;
|
|
372
|
-
modelId: string;
|
|
373
|
-
normalizedModelId: string;
|
|
374
|
-
dimension: number;
|
|
375
|
-
chunkCount: number;
|
|
376
|
-
updatedAt: string;
|
|
377
|
-
lastSuccessfulRebuildAt: string;
|
|
378
|
-
};
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
declare const SharedFeedbackEntrySchema: z.ZodObject<{
|
|
383
|
-
agent: z.ZodString;
|
|
384
|
-
decision: z.ZodEnum<["approved", "approved_with_feedback", "rejected"]>;
|
|
385
|
-
reason: z.ZodString;
|
|
386
|
-
date: z.ZodString;
|
|
387
|
-
learning: z.ZodOptional<z.ZodString>;
|
|
388
|
-
outcome: z.ZodOptional<z.ZodString>;
|
|
389
|
-
severity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
390
|
-
confidence: z.ZodOptional<z.ZodNumber>;
|
|
391
|
-
workflow: z.ZodOptional<z.ZodString>;
|
|
392
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
393
|
-
evidenceWindowStart: z.ZodOptional<z.ZodString>;
|
|
394
|
-
evidenceWindowEnd: z.ZodOptional<z.ZodString>;
|
|
395
|
-
refs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
396
|
-
}, "strip", z.ZodTypeAny, {
|
|
397
|
-
decision: "rejected" | "approved" | "approved_with_feedback";
|
|
398
|
-
agent: string;
|
|
399
|
-
date: string;
|
|
400
|
-
reason: string;
|
|
401
|
-
workflow?: string | undefined;
|
|
402
|
-
tags?: string[] | undefined;
|
|
403
|
-
confidence?: number | undefined;
|
|
404
|
-
severity?: "low" | "medium" | "high" | undefined;
|
|
405
|
-
outcome?: string | undefined;
|
|
406
|
-
refs?: string[] | undefined;
|
|
407
|
-
learning?: string | undefined;
|
|
408
|
-
evidenceWindowStart?: string | undefined;
|
|
409
|
-
evidenceWindowEnd?: string | undefined;
|
|
410
|
-
}, {
|
|
411
|
-
decision: "rejected" | "approved" | "approved_with_feedback";
|
|
412
|
-
agent: string;
|
|
413
|
-
date: string;
|
|
414
|
-
reason: string;
|
|
415
|
-
workflow?: string | undefined;
|
|
416
|
-
tags?: string[] | undefined;
|
|
417
|
-
confidence?: number | undefined;
|
|
418
|
-
severity?: "low" | "medium" | "high" | undefined;
|
|
419
|
-
outcome?: string | undefined;
|
|
420
|
-
refs?: string[] | undefined;
|
|
421
|
-
learning?: string | undefined;
|
|
422
|
-
evidenceWindowStart?: string | undefined;
|
|
423
|
-
evidenceWindowEnd?: string | undefined;
|
|
424
|
-
}>;
|
|
425
|
-
type SharedFeedbackEntry = z.infer<typeof SharedFeedbackEntrySchema>;
|
|
426
|
-
interface SharedCrossSignalSource {
|
|
427
|
-
agent: string;
|
|
428
|
-
path: string;
|
|
429
|
-
title: string;
|
|
430
|
-
topics: string[];
|
|
431
|
-
}
|
|
432
|
-
interface SharedCrossSignalOverlap {
|
|
433
|
-
token: string;
|
|
434
|
-
agents: string[];
|
|
435
|
-
sourcePaths: string[];
|
|
436
|
-
agentCount: number;
|
|
437
|
-
}
|
|
438
|
-
interface SharedCrossSignalReport {
|
|
439
|
-
date: string;
|
|
440
|
-
generatedAt: string;
|
|
441
|
-
sourceCount: number;
|
|
442
|
-
feedbackCount: number;
|
|
443
|
-
feedbackByDecision: Record<"approved" | "approved_with_feedback" | "rejected", number>;
|
|
444
|
-
feedbackEntries: SharedFeedbackEntry[];
|
|
445
|
-
sources: SharedCrossSignalSource[];
|
|
446
|
-
overlaps: SharedCrossSignalOverlap[];
|
|
447
|
-
semantic: {
|
|
448
|
-
enabled: boolean;
|
|
449
|
-
applied: boolean;
|
|
450
|
-
timedOut: boolean;
|
|
451
|
-
candidateCount: number;
|
|
452
|
-
maxCandidates: number;
|
|
453
|
-
addedOverlapCount: number;
|
|
454
|
-
};
|
|
455
|
-
}
|
|
456
|
-
interface SharedCrossSignalSynthesisResult {
|
|
457
|
-
date: string;
|
|
458
|
-
crossSignalsPath: string;
|
|
459
|
-
crossSignalsMarkdownPath: string;
|
|
460
|
-
overlapCount: number;
|
|
461
|
-
report: SharedCrossSignalReport;
|
|
462
|
-
}
|
|
463
|
-
interface SharedDailyCurationResult {
|
|
464
|
-
date: string;
|
|
465
|
-
roundtablePath: string;
|
|
466
|
-
crossSignalsPath: string;
|
|
467
|
-
crossSignalsMarkdownPath: string;
|
|
468
|
-
overlapCount: number;
|
|
469
|
-
}
|
|
470
|
-
declare class SharedContextManager {
|
|
471
|
-
private readonly config;
|
|
472
|
-
readonly dir: string;
|
|
473
|
-
private readonly prioritiesPath;
|
|
474
|
-
private readonly prioritiesInboxPath;
|
|
475
|
-
private readonly outputsDir;
|
|
476
|
-
private readonly roundtableDir;
|
|
477
|
-
private readonly feedbackDir;
|
|
478
|
-
private readonly feedbackInboxPath;
|
|
479
|
-
private readonly crossSignalsDir;
|
|
480
|
-
constructor(config: PluginConfig);
|
|
481
|
-
ensureStructure(): Promise<void>;
|
|
482
|
-
private ensureFile;
|
|
483
|
-
readPriorities(): Promise<string>;
|
|
484
|
-
readLatestRoundtable(): Promise<string>;
|
|
485
|
-
readLatestCrossSignals(): Promise<string>;
|
|
486
|
-
writeAgentOutput(opts: {
|
|
487
|
-
agentId: string;
|
|
488
|
-
title: string;
|
|
489
|
-
content: string;
|
|
490
|
-
createdAt?: Date;
|
|
491
|
-
}): Promise<string>;
|
|
492
|
-
appendFeedback(entry: SharedFeedbackEntry): Promise<void>;
|
|
493
|
-
appendPrioritiesInbox(opts: {
|
|
494
|
-
agentId: string;
|
|
495
|
-
text: string;
|
|
496
|
-
}): Promise<void>;
|
|
497
|
-
synthesizeCrossSignals(opts: {
|
|
498
|
-
date?: string;
|
|
499
|
-
maxSummaryItems?: number;
|
|
500
|
-
}): Promise<SharedCrossSignalSynthesisResult>;
|
|
501
|
-
curateDaily(opts: {
|
|
502
|
-
date?: string;
|
|
503
|
-
maxChars?: number;
|
|
504
|
-
}): Promise<SharedDailyCurationResult>;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
type MistakesFile = {
|
|
508
|
-
version?: number;
|
|
509
|
-
updatedAt: string;
|
|
510
|
-
patterns: string[];
|
|
511
|
-
registry?: MistakeRegistryEntry[];
|
|
512
|
-
};
|
|
513
|
-
type ActionOutcomeCounts = {
|
|
514
|
-
applied: number;
|
|
515
|
-
skipped: number;
|
|
516
|
-
failed: number;
|
|
517
|
-
};
|
|
518
|
-
type ActionOutcomeSummary = {
|
|
519
|
-
action: string;
|
|
520
|
-
counts: ActionOutcomeCounts;
|
|
521
|
-
total: number;
|
|
522
|
-
weightedScore: number;
|
|
523
|
-
provenance: string[];
|
|
524
|
-
};
|
|
525
|
-
type PromotionCandidate = {
|
|
526
|
-
id: string;
|
|
527
|
-
sourceType: "action-outcome" | "mistake-pattern" | "rubric" | "causal-pattern";
|
|
528
|
-
subject: string;
|
|
529
|
-
category: "principle" | "rule";
|
|
530
|
-
content: string;
|
|
531
|
-
score: number;
|
|
532
|
-
rationale: string;
|
|
533
|
-
outcome: ActionOutcomeCounts | null;
|
|
534
|
-
provenance: string[];
|
|
535
|
-
agent: string | null;
|
|
536
|
-
workflow: string | null;
|
|
537
|
-
};
|
|
538
|
-
type CompoundingEntrySeverity = "low" | "medium" | "high";
|
|
539
|
-
type EvidenceWindow = {
|
|
540
|
-
start: string | null;
|
|
541
|
-
end: string | null;
|
|
542
|
-
};
|
|
543
|
-
type MistakeRegistryEntry = {
|
|
544
|
-
id: string;
|
|
545
|
-
pattern: string;
|
|
546
|
-
category: "feedback" | "action";
|
|
547
|
-
status: "active" | "retired";
|
|
548
|
-
agent: string | null;
|
|
549
|
-
workflow: string | null;
|
|
550
|
-
tags: string[];
|
|
551
|
-
severity: CompoundingEntrySeverity | null;
|
|
552
|
-
confidence: number | null;
|
|
553
|
-
outcome: string | null;
|
|
554
|
-
provenance: string[];
|
|
555
|
-
firstSeenAt: string;
|
|
556
|
-
lastSeenAt: string;
|
|
557
|
-
recurrenceCount: number;
|
|
558
|
-
lastWeekId: string;
|
|
559
|
-
evidenceWindow: EvidenceWindow;
|
|
560
|
-
mergedFromIds?: string[];
|
|
561
|
-
retiredAt?: string | null;
|
|
562
|
-
};
|
|
563
|
-
type RubricSnapshotEntry = {
|
|
564
|
-
id: string;
|
|
565
|
-
kind: "agent" | "workflow";
|
|
566
|
-
subject: string;
|
|
567
|
-
observations: string[];
|
|
568
|
-
tags: string[];
|
|
569
|
-
provenance: string[];
|
|
570
|
-
observationEntries?: Array<{
|
|
571
|
-
note: string;
|
|
572
|
-
provenance: string[];
|
|
573
|
-
}>;
|
|
574
|
-
updatedAt: string;
|
|
575
|
-
};
|
|
576
|
-
type RubricSnapshot = {
|
|
577
|
-
updatedAt: string;
|
|
578
|
-
agents: RubricSnapshotEntry[];
|
|
579
|
-
workflows: RubricSnapshotEntry[];
|
|
580
|
-
};
|
|
581
|
-
type WeeklyCompoundingArtifact = {
|
|
582
|
-
version: number;
|
|
583
|
-
generatedAt: string;
|
|
584
|
-
weekId: string;
|
|
585
|
-
feedback: {
|
|
586
|
-
count: number;
|
|
587
|
-
byDecision: Record<"approved" | "approved_with_feedback" | "rejected", number>;
|
|
588
|
-
entries: Array<{
|
|
589
|
-
agent: string;
|
|
590
|
-
workflow: string | null;
|
|
591
|
-
decision: SharedFeedbackEntry["decision"];
|
|
592
|
-
reason: string;
|
|
593
|
-
learning: string | null;
|
|
594
|
-
outcome: string | null;
|
|
595
|
-
severity: CompoundingEntrySeverity | null;
|
|
596
|
-
confidence: number | null;
|
|
597
|
-
tags: string[];
|
|
598
|
-
provenance: string;
|
|
599
|
-
evidenceWindow: EvidenceWindow;
|
|
600
|
-
}>;
|
|
601
|
-
};
|
|
602
|
-
mistakes: {
|
|
603
|
-
count: number;
|
|
604
|
-
patterns: string[];
|
|
605
|
-
registry: MistakeRegistryEntry[];
|
|
606
|
-
};
|
|
607
|
-
rubrics: RubricSnapshot;
|
|
608
|
-
outcomes: ActionOutcomeSummary[];
|
|
609
|
-
promotionCandidates: PromotionCandidate[];
|
|
610
|
-
continuity: {
|
|
611
|
-
monthId: string;
|
|
612
|
-
weeklyPath: string | null;
|
|
613
|
-
monthlyPath: string | null;
|
|
614
|
-
};
|
|
615
|
-
};
|
|
616
|
-
interface CompoundingPromotionReport {
|
|
617
|
-
enabled: boolean;
|
|
618
|
-
dryRun: boolean;
|
|
619
|
-
weekId: string;
|
|
620
|
-
promoted: Array<{
|
|
621
|
-
id: string;
|
|
622
|
-
candidateId: string;
|
|
623
|
-
category: "principle" | "rule";
|
|
624
|
-
content: string;
|
|
625
|
-
confidence: number;
|
|
626
|
-
tags: string[];
|
|
627
|
-
lineage: string[];
|
|
628
|
-
}>;
|
|
629
|
-
skipped: Array<{
|
|
630
|
-
weekId: string;
|
|
631
|
-
candidateId?: string;
|
|
632
|
-
reason: "disabled" | "weekly-artifact-missing" | "candidate-not-found" | "duplicate-guidance";
|
|
633
|
-
existingMemoryId?: string;
|
|
634
|
-
}>;
|
|
635
|
-
}
|
|
636
|
-
type TierMigrationCycleTrigger = "extraction" | "maintenance";
|
|
637
|
-
interface TierMigrationCycleBudget {
|
|
638
|
-
limit: number;
|
|
639
|
-
scanLimit: number;
|
|
640
|
-
minIntervalMs: number;
|
|
641
|
-
}
|
|
642
|
-
declare class CompoundingEngine {
|
|
643
|
-
private readonly config;
|
|
644
|
-
private readonly storage;
|
|
645
|
-
private readonly weeklyDir;
|
|
646
|
-
private readonly rubricsDir;
|
|
647
|
-
private readonly rubricsIndexPath;
|
|
648
|
-
private readonly rubricsAgentsDir;
|
|
649
|
-
private readonly rubricsWorkflowsDir;
|
|
650
|
-
private readonly rubricsPath;
|
|
651
|
-
private readonly mistakesPath;
|
|
652
|
-
private readonly feedbackInboxPath;
|
|
653
|
-
private readonly identityAuditWeeklyDir;
|
|
654
|
-
private readonly identityAuditMonthlyDir;
|
|
655
|
-
private readonly memoryActionEventsPath;
|
|
656
|
-
constructor(config: PluginConfig, storage?: StorageManager);
|
|
657
|
-
ensureDirs(): Promise<void>;
|
|
658
|
-
synthesizeWeekly(opts?: {
|
|
659
|
-
weekId?: string;
|
|
660
|
-
}): Promise<{
|
|
661
|
-
weekId: string;
|
|
662
|
-
reportPath: string;
|
|
663
|
-
reportJsonPath: string;
|
|
664
|
-
mistakesCount: number;
|
|
665
|
-
rubricsPath: string;
|
|
666
|
-
rubricsIndexPath: string;
|
|
667
|
-
promotionCandidateCount: number;
|
|
668
|
-
}>;
|
|
669
|
-
promoteCandidate(opts: {
|
|
670
|
-
weekId: string;
|
|
671
|
-
candidateId: string;
|
|
672
|
-
dryRun?: boolean;
|
|
673
|
-
storage?: StorageManager;
|
|
674
|
-
}): Promise<CompoundingPromotionReport>;
|
|
675
|
-
synthesizeContinuityAudit(opts?: {
|
|
676
|
-
period?: "weekly" | "monthly";
|
|
677
|
-
key?: string;
|
|
678
|
-
}): Promise<{
|
|
679
|
-
period: "weekly" | "monthly";
|
|
680
|
-
key: string;
|
|
681
|
-
reportPath: string;
|
|
682
|
-
}>;
|
|
683
|
-
readMistakes(): Promise<MistakesFile | null>;
|
|
684
|
-
readRubrics(): Promise<RubricSnapshot | null>;
|
|
685
|
-
readWeeklyArtifact(weekId: string): Promise<WeeklyCompoundingArtifact | null>;
|
|
686
|
-
buildRecallSection(query: string, opts?: {
|
|
687
|
-
maxPatterns?: number;
|
|
688
|
-
maxRubrics?: number;
|
|
689
|
-
}): Promise<string | null>;
|
|
690
|
-
tierMigrationCycleBudget(trigger: TierMigrationCycleTrigger): TierMigrationCycleBudget;
|
|
691
|
-
private readFeedbackEntriesForWeek;
|
|
692
|
-
private buildActionFailurePatterns;
|
|
693
|
-
private readActionEventsForWeek;
|
|
694
|
-
private buildActionOutcomeSummary;
|
|
695
|
-
private derivePromotionCandidates;
|
|
696
|
-
private buildMistakes;
|
|
697
|
-
private formatWeeklyReport;
|
|
698
|
-
private buildRubricSnapshot;
|
|
699
|
-
private formatRubrics;
|
|
700
|
-
private syncRubricArtifacts;
|
|
701
|
-
private replaceRubricDirectory;
|
|
702
|
-
private scoreRubricForQuery;
|
|
703
|
-
private normalizeRubricEntry;
|
|
704
|
-
private getRubricObservationEntries;
|
|
705
|
-
private isSyntheticOutcomeRubricObservation;
|
|
706
|
-
private addRubricObservation;
|
|
707
|
-
private readOptionalIdentityAnchorForAudit;
|
|
708
|
-
private readOptionalImprovementLoopsForAudit;
|
|
709
|
-
private readContinuityIncidentsForAudit;
|
|
710
|
-
private readOptionalIdentityAuditForReference;
|
|
711
|
-
private readContinuityAuditReferences;
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
declare function dedupeEntitySynthesisEvidenceEntries(entries: EntityTimelineEntry[]): EntityTimelineEntry[];
|
|
715
|
-
interface GraphRecallSnapshot {
|
|
716
|
-
recordedAt: string;
|
|
717
|
-
mode: RecallPlanMode | string;
|
|
718
|
-
queryHash: string;
|
|
719
|
-
queryLength: number;
|
|
720
|
-
namespaces: string[];
|
|
721
|
-
seedCount: number;
|
|
722
|
-
expandedCount: number;
|
|
723
|
-
seeds: string[];
|
|
724
|
-
expanded: GraphRecallExpandedEntry[];
|
|
725
|
-
status?: "completed" | "skipped" | "aborted";
|
|
726
|
-
reason?: string;
|
|
727
|
-
shadowMode?: boolean;
|
|
728
|
-
queryIntent?: MemoryIntent;
|
|
729
|
-
seedResults?: GraphRecallRankedResult[];
|
|
730
|
-
finalResults?: GraphRecallRankedResult[];
|
|
731
|
-
shadowComparison?: GraphRecallShadowComparison;
|
|
732
|
-
}
|
|
733
|
-
interface GraphRecallRankedResult {
|
|
734
|
-
path: string;
|
|
735
|
-
score: number;
|
|
736
|
-
docid?: string;
|
|
737
|
-
sourceLabels: string[];
|
|
738
|
-
}
|
|
739
|
-
interface GraphRecallShadowComparison {
|
|
740
|
-
baselineCount: number;
|
|
741
|
-
graphCount: number;
|
|
742
|
-
overlapCount: number;
|
|
743
|
-
overlapRatio: number;
|
|
744
|
-
averageOverlapDelta: number;
|
|
745
|
-
}
|
|
746
|
-
interface IntentDebugSnapshot {
|
|
747
|
-
recordedAt: string;
|
|
748
|
-
promptHash: string;
|
|
749
|
-
promptLength: number;
|
|
750
|
-
retrievalQueryHash: string;
|
|
751
|
-
retrievalQueryLength: number;
|
|
752
|
-
plannerEnabled: boolean;
|
|
753
|
-
plannedMode: RecallPlanMode;
|
|
754
|
-
effectiveMode: RecallPlanMode;
|
|
755
|
-
recallResultLimit: number;
|
|
756
|
-
queryIntent: MemoryIntent;
|
|
757
|
-
graphExpandedIntentDetected: boolean;
|
|
758
|
-
graphDecision: {
|
|
759
|
-
status: "not_requested" | "skipped" | "completed" | "aborted";
|
|
760
|
-
reason?: string;
|
|
761
|
-
shadowMode: boolean;
|
|
762
|
-
qmdAvailable: boolean;
|
|
763
|
-
graphRecallEnabled: boolean;
|
|
764
|
-
multiGraphMemoryEnabled: boolean;
|
|
765
|
-
};
|
|
766
|
-
}
|
|
767
|
-
interface QmdRecallSnapshot {
|
|
768
|
-
recordedAt: string;
|
|
769
|
-
queryHash: string;
|
|
770
|
-
queryLength: number;
|
|
771
|
-
collection?: string;
|
|
772
|
-
namespaces: string[];
|
|
773
|
-
fetchLimit: number;
|
|
774
|
-
primaryResultCount: number;
|
|
775
|
-
hybridResultCount: number;
|
|
776
|
-
queryAwareSeedCount: number;
|
|
777
|
-
resultCount: number;
|
|
778
|
-
intentHint?: string;
|
|
779
|
-
explainEnabled: boolean;
|
|
780
|
-
hybridTopUpUsed: boolean;
|
|
781
|
-
hybridTopUpSkippedReason?: string;
|
|
782
|
-
results: QmdSearchResult[];
|
|
783
|
-
}
|
|
784
|
-
interface RecallModeDecision {
|
|
785
|
-
plannedMode: RecallPlanMode;
|
|
786
|
-
effectiveMode: RecallPlanMode;
|
|
787
|
-
graphExpandedIntentDetected: boolean;
|
|
788
|
-
graphReason?: string;
|
|
789
|
-
}
|
|
790
|
-
interface RecallInvocationOptions {
|
|
791
|
-
namespace?: string;
|
|
792
|
-
topK?: number;
|
|
793
|
-
mode?: RecallPlanMode;
|
|
794
|
-
abortSignal?: AbortSignal;
|
|
795
|
-
/**
|
|
796
|
-
* Capture a `RecallXraySnapshot` for this recall (issue #570). When
|
|
797
|
-
* `true`, the orchestrator builds a snapshot from the data it has
|
|
798
|
-
* already gathered and stashes it in memory, accessible via
|
|
799
|
-
* `getLastXraySnapshot()`. When `false` or absent, nothing is
|
|
800
|
-
* captured and recall behavior is unchanged (schema-only slice).
|
|
801
|
-
*/
|
|
802
|
-
xrayCapture?: boolean;
|
|
803
|
-
/**
|
|
804
|
-
* Per-invocation override for `recallBudgetChars` (issue #570 PR 3/4).
|
|
805
|
-
* Flows through `getRecallBudgetChars()` for this recall only — no
|
|
806
|
-
* shared config mutation, so concurrent recalls on the same
|
|
807
|
-
* orchestrator are not affected (CLAUDE.md rule 47: no shared
|
|
808
|
-
* mutable state across async boundaries). Must be a non-negative
|
|
809
|
-
* finite integer; non-conforming values are ignored and the
|
|
810
|
-
* configured budget is used.
|
|
811
|
-
*/
|
|
812
|
-
budgetCharsOverride?: number;
|
|
813
|
-
/**
|
|
814
|
-
* Per-invocation principal override (issue #570 PR 4). When set,
|
|
815
|
-
* the orchestrator uses this principal for ACL / namespace checks
|
|
816
|
-
* instead of `resolvePrincipal(sessionKey, config)`. This is the
|
|
817
|
-
* escape hatch for access surfaces (HTTP / MCP) that have already
|
|
818
|
-
* authenticated the caller upstream — threading an unmapped
|
|
819
|
-
* principal through the session-key-based resolver would otherwise
|
|
820
|
-
* collapse it to `"default"` and produce false denials in
|
|
821
|
-
* namespace-enabled deployments (CLAUDE.md rule 42).
|
|
822
|
-
*/
|
|
823
|
-
principalOverride?: string;
|
|
824
|
-
/**
|
|
825
|
-
* Historical recall point (issue #680). When set, the orchestrator
|
|
826
|
-
* filters out memories whose `valid_at` is after this timestamp OR
|
|
827
|
-
* whose `invalid_at` is at-or-before this timestamp, so callers see
|
|
828
|
-
* the corpus as it existed at `asOf`. ISO 8601 string; comparisons
|
|
829
|
-
* use `Date.parse()` so timezone-aware values round-trip correctly
|
|
830
|
-
* (CLAUDE.md gotcha — never compare ISO strings lexicographically).
|
|
831
|
-
* Invalid values must be rejected at input boundaries (CLAUDE.md
|
|
832
|
-
* rule 51); the orchestrator does NOT silently fall back here.
|
|
833
|
-
*/
|
|
834
|
-
asOf?: string;
|
|
835
|
-
/**
|
|
836
|
-
* Issue #681 — when `true`, bypasses `graphTraversalConfidenceFloor`
|
|
837
|
-
* and includes edges below the floor in graph traversal. Useful for
|
|
838
|
-
* diagnostic recall queries that need to surface results that would
|
|
839
|
-
* normally be pruned by confidence decay. Default `false`.
|
|
840
|
-
*/
|
|
841
|
-
includeLowConfidence?: boolean;
|
|
842
|
-
/**
|
|
843
|
-
* User-aware context scopes active for this recall. Used by X-ray
|
|
844
|
-
* provenance safety checks so boundary-scoped memories are evaluated
|
|
845
|
-
* against the caller's real context.
|
|
846
|
-
*/
|
|
847
|
-
currentContextScopes?: readonly unknown[];
|
|
848
|
-
}
|
|
849
|
-
/** Default workspace directory when no per-agent or config workspace is available. */
|
|
850
|
-
declare function defaultWorkspaceDir(): string;
|
|
851
|
-
/**
|
|
852
|
-
* Produce a collision-resistant, filesystem-safe identifier from a session key.
|
|
853
|
-
*
|
|
854
|
-
* Session keys follow colon-delimited forms (e.g., `agent:gpucodebot:main`).
|
|
855
|
-
* A naive replace (`:` → `_`) is lossy: different keys like `agent:alpha` and
|
|
856
|
-
* `agent/alpha` would collide. Instead we append a short SHA-256 hash of the
|
|
857
|
-
* original key to the human-readable sanitized prefix, guaranteeing uniqueness
|
|
858
|
-
* while keeping filenames debuggable.
|
|
859
|
-
*
|
|
860
|
-
* Format: `<sanitized>-<12-char-hex-hash>`
|
|
861
|
-
* Example: `agent:gpucodebot:main` → `agent_gpucodebot_main-a1b2c3d4e5f6`
|
|
862
|
-
*/
|
|
863
|
-
declare function sanitizeSessionKeyForFilename(sessionKey: string): string;
|
|
864
|
-
declare function isArtifactMemoryPath(filePath: string): boolean;
|
|
865
|
-
declare function deriveTopicsFromExtraction(result: ExtractionResult): string[];
|
|
866
|
-
declare function buildCompressionGuidelinesMarkdown(events: MemoryActionEvent[], generatedAtIso?: string): string;
|
|
867
|
-
declare function formatCompressionGuidelinesForRecall(raw: string, maxLines?: number): string | null;
|
|
868
|
-
declare function filterRecallCandidates(candidates: QmdSearchResult[], options: {
|
|
869
|
-
namespacesEnabled: boolean;
|
|
870
|
-
recallNamespaces: string[];
|
|
871
|
-
resolveNamespace: (path: string) => string;
|
|
872
|
-
limit: number;
|
|
873
|
-
}): QmdSearchResult[];
|
|
874
|
-
declare function shouldFilterLifecycleRecallCandidate(frontmatter: MemoryFrontmatter, options: {
|
|
875
|
-
lifecyclePolicyEnabled: boolean;
|
|
876
|
-
lifecycleFilterStaleEnabled: boolean;
|
|
877
|
-
}): boolean;
|
|
878
|
-
declare function lifecycleRecallScoreAdjustment(frontmatter: MemoryFrontmatter, options: {
|
|
879
|
-
lifecyclePolicyEnabled: boolean;
|
|
880
|
-
}): number;
|
|
881
|
-
declare function computeArtifactRecallLimit(recallMode: RecallPlanMode, recallResultLimit: number, verbatimArtifactsMaxRecall: number): number;
|
|
882
|
-
declare function resolveEffectiveRecallMode(options: {
|
|
883
|
-
plannerEnabled: boolean;
|
|
884
|
-
graphRecallEnabled: boolean;
|
|
885
|
-
multiGraphMemoryEnabled: boolean;
|
|
886
|
-
graphExpandedIntentEnabled?: boolean;
|
|
887
|
-
prompt: string;
|
|
888
|
-
}): RecallPlanMode;
|
|
889
|
-
declare function resolveRecallModeDecision(options: {
|
|
890
|
-
plannerEnabled: boolean;
|
|
891
|
-
graphRecallEnabled: boolean;
|
|
892
|
-
multiGraphMemoryEnabled: boolean;
|
|
893
|
-
graphExpandedIntentEnabled?: boolean;
|
|
894
|
-
prompt: string;
|
|
895
|
-
}): RecallModeDecision;
|
|
896
|
-
declare function hasIdentityRecoveryIntent(prompt: string): boolean;
|
|
897
|
-
declare function resolveEffectiveIdentityInjectionMode(options: {
|
|
898
|
-
configuredMode: IdentityInjectionMode;
|
|
899
|
-
recallMode: RecallPlanMode;
|
|
900
|
-
prompt: string;
|
|
901
|
-
}): {
|
|
902
|
-
mode: IdentityInjectionMode;
|
|
903
|
-
shouldInject: boolean;
|
|
904
|
-
};
|
|
905
|
-
declare function computeArtifactCandidateFetchLimit(targetCount: number): number;
|
|
906
|
-
declare function computeQmdHybridFetchLimit(recallFetchLimit: number, artifactsEnabled: boolean, maxArtifactRecall: number): number;
|
|
907
|
-
declare function mergeGraphExpandedResults(primary: QmdSearchResult[], expanded: QmdSearchResult[]): QmdSearchResult[];
|
|
908
|
-
declare function graphPathRelativeToStorage(storageDir: string, candidatePath: string): string | null;
|
|
909
|
-
declare function blendGraphExpandedRecallScore(options: {
|
|
910
|
-
graphActivationScore: number;
|
|
911
|
-
seedRecallScore: number;
|
|
912
|
-
activationWeight: number;
|
|
913
|
-
blendMin: number;
|
|
914
|
-
blendMax: number;
|
|
915
|
-
}): number;
|
|
916
|
-
declare function summarizeGraphShadowComparison(baseline: QmdSearchResult[], merged: QmdSearchResult[], topN: number): {
|
|
917
|
-
baselineCount: number;
|
|
918
|
-
graphCount: number;
|
|
919
|
-
overlapCount: number;
|
|
920
|
-
overlapRatio: number;
|
|
921
|
-
averageOverlapDelta: number;
|
|
922
|
-
};
|
|
923
|
-
declare function mergeArtifactRecallCandidates(candidatesByNamespace: MemoryFile[][], limit: number): MemoryFile[];
|
|
924
|
-
declare function resolveRecentThreadMemoryPaths(options: {
|
|
925
|
-
threadEpisodeIds: string[];
|
|
926
|
-
currentMemoryId: string;
|
|
927
|
-
allMemsForGraph: MemoryFile[] | null | undefined;
|
|
928
|
-
pathById?: Map<string, string>;
|
|
929
|
-
storageDir: string;
|
|
930
|
-
maxRecent: number;
|
|
931
|
-
}): string[];
|
|
932
|
-
declare function buildMemoryPathById(allMemsForGraph: MemoryFile[] | null | undefined, storageDir: string): Map<string, string>;
|
|
933
|
-
declare function appendMemoryToGraphContext(options: {
|
|
934
|
-
allMemsForGraph: MemoryFile[] | null | undefined;
|
|
935
|
-
storageDir: string;
|
|
936
|
-
memoryRelPath: string;
|
|
937
|
-
memoryId: string;
|
|
938
|
-
category: MemoryFile["frontmatter"]["category"];
|
|
939
|
-
content: string;
|
|
940
|
-
entityRef: string | undefined;
|
|
941
|
-
}): void;
|
|
942
|
-
declare function resolvePersistedMemoryRelativePath(options: {
|
|
943
|
-
memoryId: string;
|
|
944
|
-
pathById: Map<string, string>;
|
|
945
|
-
category: string;
|
|
946
|
-
}): string;
|
|
947
|
-
declare class Orchestrator {
|
|
948
|
-
readonly storage: StorageManager;
|
|
949
|
-
private readonly storageRouter;
|
|
950
|
-
private readonly namespaceSearchRouter;
|
|
951
|
-
qmd: SearchBackend;
|
|
952
|
-
private readonly conversationQmd?;
|
|
953
|
-
private readonly conversationFaiss?;
|
|
954
|
-
private readonly conversationIndexBackend?;
|
|
955
|
-
readonly sharedContext?: SharedContextManager;
|
|
956
|
-
readonly compounding?: CompoundingEngine;
|
|
957
|
-
readonly buffer: SmartBuffer;
|
|
958
|
-
readonly transcript: TranscriptManager;
|
|
959
|
-
readonly sessionObserver: SessionObserverState;
|
|
960
|
-
readonly summarizer: HourlySummarizer;
|
|
961
|
-
readonly localLlm: LocalLlmClient;
|
|
962
|
-
readonly fastLlm: LocalLlmClient;
|
|
963
|
-
private readonly judgeVerdictCache;
|
|
964
|
-
/**
|
|
965
|
-
* Per-orchestrator defer-counter map (issue #562, PR 2). Tracks how many
|
|
966
|
-
* times the judge has returned `"defer"` for a given candidate content
|
|
967
|
-
* hash so the defer cap can be enforced.
|
|
968
|
-
*/
|
|
969
|
-
private readonly judgeDeferCounts;
|
|
970
|
-
/**
|
|
971
|
-
* Side-channel: number of facts deferred in the most recent
|
|
972
|
-
* `persistExtraction` call (issue #562, PR 2). The caller reads this after
|
|
973
|
-
* `persistExtraction` returns to decide whether to retain buffer turns for
|
|
974
|
-
* the next extraction pass. Not part of the return signature because many
|
|
975
|
-
* callers already destructure `persistedIds` by position.
|
|
976
|
-
*/
|
|
977
|
-
private lastPersistExtractionDeferredCount;
|
|
978
|
-
private readonly _fastGatewayLlm;
|
|
979
|
-
get fastGatewayLlm(): FallbackLlmClient | null;
|
|
980
|
-
readonly modelRegistry: ModelRegistry;
|
|
981
|
-
readonly relevance: RelevanceStore;
|
|
982
|
-
readonly negatives: NegativeExampleStore;
|
|
983
|
-
readonly lastRecall: LastRecallStore;
|
|
984
|
-
readonly tierMigrationStatus: TierMigrationStatusStore;
|
|
985
|
-
/**
|
|
986
|
-
* In-memory X-ray snapshot from the most recent `recall()` call that
|
|
987
|
-
* was invoked with `xrayCapture: true` (issue #570 PR 1). Scope is
|
|
988
|
-
* per-process; later slices add CLI/HTTP/MCP surfaces that consume
|
|
989
|
-
* this via the shared renderer. `null` until the first capture, and
|
|
990
|
-
* NEVER overwritten by a recall that did not request capture —
|
|
991
|
-
* requests without the flag leave prior captures intact so the
|
|
992
|
-
* capturing caller can still read their snapshot back.
|
|
993
|
-
*/
|
|
994
|
-
private lastXraySnapshot;
|
|
995
|
-
readonly embeddingFallback: EmbeddingFallback;
|
|
996
|
-
private readonly conversationIndexDir;
|
|
997
|
-
private readonly extraction;
|
|
998
|
-
readonly config: PluginConfig;
|
|
999
|
-
readonly profiler: ProfilingCollector;
|
|
1000
|
-
private readonly threading;
|
|
1001
|
-
/** v8.2: Per-namespace multi-graph memory indexes (entity/time/causal edges) */
|
|
1002
|
-
private readonly graphIndexes;
|
|
1003
|
-
/** Per-namespace BoxBuilders, keyed by the namespace root directory path. */
|
|
1004
|
-
private readonly boxBuilders;
|
|
1005
|
-
/** Temporal Memory Tree builder — builds hour/day/week/persona summary nodes. */
|
|
1006
|
-
private readonly tmtBuilder;
|
|
1007
|
-
/** Lossless Context Management engine — proactive session archive + DAG summarization. */
|
|
1008
|
-
readonly lcmEngine: LcmEngine | null;
|
|
1009
|
-
private readonly rerankCache;
|
|
1010
|
-
/**
|
|
1011
|
-
* Short-TTL cache for Memory Worth counter lookups so interactive recall
|
|
1012
|
-
* doesn't trigger a full `readAllMemories` scan per query. Keyed by
|
|
1013
|
-
* namespace; the filter unions across namespaces at query time. The TTL
|
|
1014
|
-
* is intentionally short (seconds, not minutes) because counters are
|
|
1015
|
-
* mutated by `recordMemoryOutcome` asynchronously and we'd rather serve
|
|
1016
|
-
* a 30-second-stale worth score than a stable-but-wrong one.
|
|
1017
|
-
*/
|
|
1018
|
-
private readonly memoryWorthCounterCache;
|
|
1019
|
-
private static readonly MEMORY_WORTH_CACHE_TTL_MS;
|
|
1020
|
-
/**
|
|
1021
|
-
* Per-session workspace selections keyed by sessionKey.
|
|
1022
|
-
* Set by the before_agent_start hook so recall() uses the correct
|
|
1023
|
-
* agent workspace for BOOT.md injection. Cleared after each recall.
|
|
1024
|
-
* Using a Map prevents concurrent sessions from overwriting each other.
|
|
1025
|
-
*/
|
|
1026
|
-
private _recallWorkspaceOverrides;
|
|
1027
|
-
/**
|
|
1028
|
-
* Per-session coding-agent context (issue #569). Populated by connectors at
|
|
1029
|
-
* session-start (PRs 5/6/7) via `setCodingContextForSession`. Used by both
|
|
1030
|
-
* the recall path and the write path so that memory routing respects the
|
|
1031
|
-
* project/branch scope a session is operating in (rule 42 — read + write
|
|
1032
|
-
* through the same namespace layer).
|
|
1033
|
-
*/
|
|
1034
|
-
private readonly _codingContextBySession;
|
|
1035
|
-
/**
|
|
1036
|
-
* Per-session peer ID registry (issue #679 PR 3/5).
|
|
1037
|
-
* Set by connectors / hooks via `setPeerIdForSession` so `recallInternal`
|
|
1038
|
-
* can inject the peer's profile into recall context when
|
|
1039
|
-
* `peerProfileRecallEnabled` is true. Cleared when the session ends.
|
|
1040
|
-
* Keyed by sessionKey so concurrent sessions don't clobber each other
|
|
1041
|
-
* (rule 11 — scope globals per plugin ID / session).
|
|
1042
|
-
*/
|
|
1043
|
-
private readonly _peerIdBySession;
|
|
1044
|
-
private routingRulesStore;
|
|
1045
|
-
private contentHashIndex;
|
|
1046
|
-
private readonly artifactSourceStatusCache;
|
|
1047
|
-
private static readonly ARTIFACT_STATUS_CACHE_TTL_MS;
|
|
1048
|
-
private accessTrackingBuffer;
|
|
1049
|
-
private extractionQueue;
|
|
1050
|
-
private queueProcessing;
|
|
1051
|
-
private heartbeatObserverChains;
|
|
1052
|
-
private recentExtractionFingerprints;
|
|
1053
|
-
private nonZeroExtractionsSinceConsolidation;
|
|
1054
|
-
private lastConsolidationRunAtMs;
|
|
1055
|
-
private consolidationInFlight;
|
|
1056
|
-
private readonly consolidationObservers;
|
|
1057
|
-
private qmdMaintenanceTimer;
|
|
1058
|
-
private qmdMaintenancePending;
|
|
1059
|
-
private qmdMaintenanceInFlight;
|
|
1060
|
-
private lastQmdEmbedAtMs;
|
|
1061
|
-
private lastQmdReprobeAtMs;
|
|
1062
|
-
private tierMigrationInFlight;
|
|
1063
|
-
private lastTierMigrationRunAtMs;
|
|
1064
|
-
private readonly conversationIndexLastUpdateAtMs;
|
|
1065
|
-
private lastFileHygieneRunAtMs;
|
|
1066
|
-
private lastPatternReinforcementAtByNs;
|
|
1067
|
-
private lastRecallFailureLogAtMs;
|
|
1068
|
-
private lastRecallFailureAtMs;
|
|
1069
|
-
private suppressedRecallFailures;
|
|
1070
|
-
private readonly policyRuntime;
|
|
1071
|
-
private runtimePolicyValues;
|
|
1072
|
-
private utilityRuntimeValues;
|
|
1073
|
-
private evalShadowWriteChain;
|
|
1074
|
-
private directAnswerObservationChain;
|
|
1075
|
-
private initPromise;
|
|
1076
|
-
private resolveInit;
|
|
1077
|
-
/**
|
|
1078
|
-
* Resolves when deferred initialization (QMD probe, warmup, caches, cron)
|
|
1079
|
-
* completes. CLI and http-serve callers that need `qmd.isAvailable()` to
|
|
1080
|
-
* reflect reality should `await orchestrator.deferredReady` after
|
|
1081
|
-
* `initialize()`. Gateway callers can ignore it — recall() degrades
|
|
1082
|
-
* gracefully when QMD isn't ready yet.
|
|
1083
|
-
*
|
|
1084
|
-
* Also resolves (without error) when `initialize()` throws before reaching
|
|
1085
|
-
* the deferred-init phase, so callers never hang on a permanently-pending
|
|
1086
|
-
* promise.
|
|
1087
|
-
*
|
|
1088
|
-
* Host adapters that need to tie deferred init to their stop() lifecycle
|
|
1089
|
-
* should `await orchestrator.deferredReady` before proceeding with teardown
|
|
1090
|
-
* to prevent background QMD/warmup/cron tasks from racing with shutdown.
|
|
1091
|
-
*/
|
|
1092
|
-
deferredReady: Promise<void>;
|
|
1093
|
-
private resolveDeferredReady;
|
|
1094
|
-
private deferredInitAbort;
|
|
1095
|
-
/**
|
|
1096
|
-
* Whether the deferred init's QMD startup sync completed successfully.
|
|
1097
|
-
* When false after deferredReady resolves, the server retry loop should
|
|
1098
|
-
* attempt startupSearchSync() even if `qmd.isAvailable()` is true —
|
|
1099
|
-
* availability only means probe succeeded, not that the index is current.
|
|
1100
|
-
*/
|
|
1101
|
-
deferredSyncSucceeded: boolean;
|
|
1102
|
-
/**
|
|
1103
|
-
* Abort deferred initialization so background QMD sync/warmup stops
|
|
1104
|
-
* promptly on shutdown. Safe to call multiple times or before init.
|
|
1105
|
-
*/
|
|
1106
|
-
abortDeferredInit(): void;
|
|
1107
|
-
private disposeSearchBackendIfNeeded;
|
|
1108
|
-
/** Set per-session workspace for the next recall() call (compaction reset). @internal */
|
|
1109
|
-
setRecallWorkspaceOverride(sessionKey: string, dir: string): void;
|
|
1110
|
-
/** Remove a per-session workspace selection (cleanup on error or early return). @internal */
|
|
1111
|
-
clearRecallWorkspaceOverride(sessionKey: string): void;
|
|
1112
|
-
resolvePrincipal(sessionKey?: string): string;
|
|
1113
|
-
resolveSelfNamespace(sessionKey?: string): string;
|
|
1114
|
-
/**
|
|
1115
|
-
* Attach a coding-agent context to a session (issue #569). Called by the
|
|
1116
|
-
* Claude Code / Codex / Cursor connectors at session start after
|
|
1117
|
-
* `resolveGitContext(cwd)`. The context is consulted by the recall path
|
|
1118
|
-
* and the write path so that memories route to a project- (and optionally
|
|
1119
|
-
* branch-) scoped namespace.
|
|
1120
|
-
*
|
|
1121
|
-
* Pass `null` to clear.
|
|
1122
|
-
*/
|
|
1123
|
-
setCodingContextForSession(sessionKey: string, codingContext: CodingContext | null): void;
|
|
1124
|
-
/**
|
|
1125
|
-
* Read-only accessor for the coding context attached to a session. Returns
|
|
1126
|
-
* `null` when none is set. Used by `remnic doctor` and by tests.
|
|
1127
|
-
*
|
|
1128
|
-
* Defensive `_codingContextBySession` lookup — legacy orchestrator-flush
|
|
1129
|
-
* tests use `Object.create(Orchestrator.prototype)` which does not run
|
|
1130
|
-
* class-field initializers, so the Map may be undefined on stubs.
|
|
1131
|
-
*/
|
|
1132
|
-
getCodingContextForSession(sessionKey: string | undefined): CodingContext | null;
|
|
1133
|
-
/**
|
|
1134
|
-
* Shared helper used by both the recall path and the write path (rule 42).
|
|
1135
|
-
*
|
|
1136
|
-
* Given a base namespace computed from the principal, returns the overlaid
|
|
1137
|
-
* coding namespace when the session has a coding context AND
|
|
1138
|
-
* `codingMode.projectScope` is true AND `namespacesEnabled` is true.
|
|
1139
|
-
* Otherwise returns `baseNamespace` unchanged — CLAUDE.md #30 escape hatch.
|
|
1140
|
-
*
|
|
1141
|
-
* Principal isolation (CLAUDE.md rule 42): the overlay is COMBINED with
|
|
1142
|
-
* the principal-derived `baseNamespace` rather than replacing it, so two
|
|
1143
|
-
* principals working in the same repository do not share memories through
|
|
1144
|
-
* a common `project-*` namespace.
|
|
1145
|
-
*
|
|
1146
|
-
* Namespaces-disabled gate: when `namespacesEnabled` is false, the
|
|
1147
|
-
* storage router maps every namespace to the same `memoryDir`. Returning
|
|
1148
|
-
* `project-*` in that mode would create apparent route separation with
|
|
1149
|
-
* no actual storage isolation — a false-isolation trap. In that mode we
|
|
1150
|
-
* return `baseNamespace` unchanged so coding mode degrades to the existing
|
|
1151
|
-
* unscoped behavior.
|
|
1152
|
-
*
|
|
1153
|
-
* @internal
|
|
1154
|
-
*/
|
|
1155
|
-
applyCodingNamespaceOverlay(sessionKey: string | undefined, baseNamespace: string): string;
|
|
1156
|
-
/**
|
|
1157
|
-
* Register a peer ID for a session so recall can inject the peer's
|
|
1158
|
-
* profile into context (issue #679 PR 3/5). Pass `null` to clear.
|
|
1159
|
-
*
|
|
1160
|
-
* Connectors and the `before_agent_start` hook call this when the
|
|
1161
|
-
* session's counter-party is known. The ID is validated against
|
|
1162
|
-
* `PEER_ID_PATTERN` before storing.
|
|
1163
|
-
*
|
|
1164
|
-
* Fail-closed (Codex P1 review): an invalid peerId clears any
|
|
1165
|
-
* previously registered mapping for the session rather than silently
|
|
1166
|
-
* keeping stale data. This prevents a malformed metadata update from
|
|
1167
|
-
* mixing one peer's profile context into another session.
|
|
1168
|
-
*
|
|
1169
|
-
* Defensive init (Cursor review + rule 16): `Object.create(
|
|
1170
|
-
* Orchestrator.prototype)` stubs in legacy tests skip class-field
|
|
1171
|
-
* initializers, so `_peerIdBySession` may be undefined. Mirror the
|
|
1172
|
-
* same guard used by `setCodingContextForSession`.
|
|
1173
|
-
*/
|
|
1174
|
-
setPeerIdForSession(sessionKey: string, peerId: string | null): void;
|
|
1175
|
-
/**
|
|
1176
|
-
* Return the peer ID registered for a session, or `null` when none
|
|
1177
|
-
* is set. Used by `recallInternal` to inject the peer profile section.
|
|
1178
|
-
* Defensive `_peerIdBySession` lookup — legacy orchestrator-flush tests
|
|
1179
|
-
* use `Object.create(Orchestrator.prototype)` which skips class-field
|
|
1180
|
-
* initializers, so the Map may be undefined on stubs.
|
|
1181
|
-
*/
|
|
1182
|
-
getPeerIdForSession(sessionKey: string | undefined): string | null;
|
|
1183
|
-
/**
|
|
1184
|
-
* Read-side overlay: returns the list of namespaces a session should read
|
|
1185
|
-
* from, including any read fallbacks (branch → project, global root).
|
|
1186
|
-
*
|
|
1187
|
-
* Returns `null` when:
|
|
1188
|
-
* - `namespacesEnabled` is false (overlay would create false isolation)
|
|
1189
|
-
* - no context attached to the session
|
|
1190
|
-
* - `codingMode.projectScope` is false (CLAUDE.md #30 escape hatch)
|
|
1191
|
-
*
|
|
1192
|
-
* The returned `namespace` / `readFallbacks` are RAW overlay fragments
|
|
1193
|
-
* (e.g. `project-origin-ab12`). Callers MUST combine them with the
|
|
1194
|
-
* principal-derived base through `combineNamespaces()` before passing to
|
|
1195
|
-
* storage, so principal isolation is preserved (rule 42).
|
|
1196
|
-
*
|
|
1197
|
-
* @internal
|
|
1198
|
-
*/
|
|
1199
|
-
applyCodingRecallOverlay(sessionKey: string | undefined): {
|
|
1200
|
-
namespace: string;
|
|
1201
|
-
readFallbacks: string[];
|
|
1202
|
-
} | null;
|
|
1203
|
-
getStorageForNamespace(namespace?: string): Promise<StorageManager>;
|
|
1204
|
-
private configuredNamespaces;
|
|
1205
|
-
private buildConfiguredQmdSearchOptions;
|
|
1206
|
-
searchAcrossNamespaces(options: {
|
|
1207
|
-
query: string;
|
|
1208
|
-
namespaces?: string[];
|
|
1209
|
-
maxResults?: number;
|
|
1210
|
-
mode?: "search" | "hybrid" | "bm25" | "vector";
|
|
1211
|
-
searchOptions?: SearchQueryOptions;
|
|
1212
|
-
execution?: SearchExecutionOptions;
|
|
1213
|
-
}): Promise<QmdSearchResult[]>;
|
|
1214
|
-
private isSearchAvailableForNamespaceRouting;
|
|
1215
|
-
invalidateLiveContentHashIndex(): void;
|
|
1216
|
-
constructor(config: PluginConfig);
|
|
1217
|
-
/** Get or create a BoxBuilder for the given namespace storage root (namespace-isolated). */
|
|
1218
|
-
private boxBuilderFor;
|
|
1219
|
-
private effectiveRecencyWeight;
|
|
1220
|
-
private effectiveCronRecallInstructionHeavyTokenCap;
|
|
1221
|
-
private currentPolicyVersion;
|
|
1222
|
-
private effectiveLifecycleThresholds;
|
|
1223
|
-
private routeEngineOptions;
|
|
1224
|
-
private getRoutingRulesStore;
|
|
1225
|
-
private loadRoutingRules;
|
|
1226
|
-
private resolveArtifactSourceStatuses;
|
|
1227
|
-
/**
|
|
1228
|
-
* Execute a fast-tier LLM chat completion.
|
|
1229
|
-
* When gateway model source is active and fastGatewayAgentId is configured,
|
|
1230
|
-
* routes through the gateway chain. Otherwise uses the local fast LLM.
|
|
1231
|
-
*/
|
|
1232
|
-
private fastChatCompletion;
|
|
1233
|
-
/**
|
|
1234
|
-
* Get a fast-tier LLM client compatible with the rerank interface.
|
|
1235
|
-
* When gateway model source is active, routes through the gateway fast chain.
|
|
1236
|
-
* Otherwise returns the local fast LLM directly.
|
|
1237
|
-
*/
|
|
1238
|
-
get fastLlmForRerank(): {
|
|
1239
|
-
chatCompletion: (messages: Array<{
|
|
1240
|
-
role: string;
|
|
1241
|
-
content: string;
|
|
1242
|
-
}>, options?: {
|
|
1243
|
-
maxTokens?: number;
|
|
1244
|
-
temperature?: number;
|
|
1245
|
-
timeoutMs?: number;
|
|
1246
|
-
operation?: string;
|
|
1247
|
-
priority?: "recall-critical" | "background";
|
|
1248
|
-
}) => Promise<{
|
|
1249
|
-
content: string;
|
|
1250
|
-
} | null>;
|
|
1251
|
-
};
|
|
1252
|
-
initialize(): Promise<void>;
|
|
1253
|
-
private deferredInitialize;
|
|
1254
|
-
/**
|
|
1255
|
-
* Namespace-aware startup search sync. Re-probes QMD, ensures collections
|
|
1256
|
-
* (namespace-aware when namespacesEnabled), runs update, and warms up search.
|
|
1257
|
-
* Designed for server retry paths that run after the deferred init completes
|
|
1258
|
-
* when QMD was not available during initial startup.
|
|
1259
|
-
*
|
|
1260
|
-
* Accepts an optional AbortSignal so callers can interrupt the sync during
|
|
1261
|
-
* shutdown. The signal is checked between phases and forwarded into the QMD
|
|
1262
|
-
* update and warmup search calls so a long-running `qmd update` subprocess
|
|
1263
|
-
* is killed promptly rather than left in flight after `httpServer.stop()`.
|
|
1264
|
-
*
|
|
1265
|
-
* Returns true if the sync succeeded (QMD now available), false otherwise.
|
|
1266
|
-
*/
|
|
1267
|
-
startupSearchSync(signal?: AbortSignal): Promise<boolean>;
|
|
1268
|
-
/**
|
|
1269
|
-
* Auto-register the engram-day-summary cron job in OpenClaw if it doesn't exist.
|
|
1270
|
-
* Fire-and-forget — never blocks init or crashes on failure.
|
|
1271
|
-
*/
|
|
1272
|
-
private autoRegisterDaySummaryCron;
|
|
1273
|
-
private autoRegisterNightlyGovernanceCron;
|
|
1274
|
-
private autoRegisterProceduralMiningCron;
|
|
1275
|
-
private autoRegisterContradictionScanCron;
|
|
1276
|
-
private autoRegisterPatternReinforcementCron;
|
|
1277
|
-
/**
|
|
1278
|
-
* Run the pattern-reinforcement maintenance job (issue #687 PR 2/4).
|
|
1279
|
-
*
|
|
1280
|
-
* Cadence-gated on `patternReinforcementCadenceMs` so every caller
|
|
1281
|
-
* (orchestrator cron path, MCP tool, CLI) shares a single floor —
|
|
1282
|
-
* none can call this on a hot loop and burn the corpus. When the
|
|
1283
|
-
* feature is disabled or the cadence has not elapsed, returns a
|
|
1284
|
-
* synthetic "skipped" result rather than throwing.
|
|
1285
|
-
*
|
|
1286
|
-
* Cadence tracking is per-namespace so a tenant-scoped MCP run in
|
|
1287
|
-
* one namespace does not silence a cron run in another (PR #730
|
|
1288
|
-
* review feedback, Codex P2). Pass `force: true` for ad-hoc
|
|
1289
|
-
* operator runs that must bypass the cadence floor — mirrors the
|
|
1290
|
-
* pattern used by other maintenance MCP tools.
|
|
1291
|
-
*
|
|
1292
|
-
* `force` deliberately does NOT bypass the master
|
|
1293
|
-
* `patternReinforcementEnabled` flag (PR #730 review feedback,
|
|
1294
|
-
* Cursor Medium). Operators who have explicitly disabled the
|
|
1295
|
-
* feature must not have their corpus mutated by an MCP tool call —
|
|
1296
|
-
* the only way to run the job is to enable the feature in config.
|
|
1297
|
-
*/
|
|
1298
|
-
runPatternReinforcement(options?: {
|
|
1299
|
-
force?: boolean;
|
|
1300
|
-
namespace?: string;
|
|
1301
|
-
}): Promise<{
|
|
1302
|
-
ran: boolean;
|
|
1303
|
-
skippedReason?: "disabled" | "cadence";
|
|
1304
|
-
namespace: string;
|
|
1305
|
-
result?: PatternReinforcementResult;
|
|
1306
|
-
}>;
|
|
1307
|
-
private autoRegisterGraphEdgeDecayCron;
|
|
1308
|
-
runLiveConnectors(options?: {
|
|
1309
|
-
force?: boolean;
|
|
1310
|
-
abortSignal?: AbortSignal;
|
|
1311
|
-
}): Promise<LiveConnectorsRunSummary>;
|
|
1312
|
-
applyBehaviorRuntimePolicy(state: BehaviorLoopPolicyState): Promise<{
|
|
1313
|
-
applied: boolean;
|
|
1314
|
-
rolledBack: boolean;
|
|
1315
|
-
values: RuntimePolicyValues | null;
|
|
1316
|
-
reason: string;
|
|
1317
|
-
}>;
|
|
1318
|
-
rollbackBehaviorRuntimePolicy(): Promise<boolean>;
|
|
1319
|
-
maybeRunFileHygiene(): Promise<void>;
|
|
1320
|
-
runBootstrap(options: BootstrapOptions): Promise<BootstrapResult>;
|
|
1321
|
-
runConsolidationNow(): Promise<{
|
|
1322
|
-
memoriesProcessed: number;
|
|
1323
|
-
merged: number;
|
|
1324
|
-
invalidated: number;
|
|
1325
|
-
}>;
|
|
1326
|
-
reindexMemoryById(id: string, options?: {
|
|
1327
|
-
storage?: StorageManager;
|
|
1328
|
-
}): Promise<void>;
|
|
1329
|
-
registerConsolidationObserver(observer: (observation: ConsolidationObservation) => Promise<void> | void): () => void;
|
|
1330
|
-
runSemanticConsolidationNow(options?: {
|
|
1331
|
-
dryRun?: boolean;
|
|
1332
|
-
thresholdOverride?: number;
|
|
1333
|
-
storage?: StorageManager;
|
|
1334
|
-
}): Promise<SemanticConsolidationResult>;
|
|
1335
|
-
runDeepSleepGovernanceNow(options?: {
|
|
1336
|
-
dryRun?: boolean;
|
|
1337
|
-
storage?: StorageManager;
|
|
1338
|
-
}): Promise<{
|
|
1339
|
-
scannedMemories: number;
|
|
1340
|
-
appliedActionCount: number;
|
|
1341
|
-
notes?: string;
|
|
1342
|
-
}>;
|
|
1343
|
-
private runSemanticConsolidation;
|
|
1344
|
-
waitForExtractionIdle(timeoutMs?: number): Promise<boolean>;
|
|
1345
|
-
waitForConsolidationIdle(timeoutMs?: number): Promise<boolean>;
|
|
1346
|
-
getStorage(namespace?: string): Promise<StorageManager>;
|
|
1347
|
-
processEntitySynthesisQueue(namespace?: string, maxEntities?: number): Promise<number>;
|
|
1348
|
-
generateDaySummary(memories: string | MemoryFile[]): Promise<DaySummaryResult | null>;
|
|
1349
|
-
/**
|
|
1350
|
-
* Auto-gather today's facts and hourly summaries from storage, then generate a day summary.
|
|
1351
|
-
* Returns null if no facts are found for today.
|
|
1352
|
-
*/
|
|
1353
|
-
generateDaySummaryAuto(namespace?: string): Promise<DaySummaryResult | null>;
|
|
1354
|
-
/**
|
|
1355
|
-
* Read today's facts and hourly summaries from storage, returning them
|
|
1356
|
-
* as a formatted string suitable for generateDaySummary().
|
|
1357
|
-
*/
|
|
1358
|
-
gatherTodayFacts(namespace?: string): Promise<string>;
|
|
1359
|
-
previewMemoryActionEvent(event: Omit<MemoryActionEvent, "timestamp"> & {
|
|
1360
|
-
timestamp?: string;
|
|
1361
|
-
}): MemoryActionEvent;
|
|
1362
|
-
appendMemoryActionEvent(event: Omit<MemoryActionEvent, "timestamp"> & {
|
|
1363
|
-
timestamp?: string;
|
|
1364
|
-
}): Promise<boolean>;
|
|
1365
|
-
getLastGraphRecallSnapshot(namespace?: string): Promise<GraphRecallSnapshot | null>;
|
|
1366
|
-
getLastIntentSnapshot(namespace?: string): Promise<IntentDebugSnapshot | null>;
|
|
1367
|
-
getLastQmdRecallSnapshot(namespace?: string): Promise<QmdRecallSnapshot | null>;
|
|
1368
|
-
explainLastGraphRecall(options?: {
|
|
1369
|
-
namespace?: string;
|
|
1370
|
-
maxExpanded?: number;
|
|
1371
|
-
}): Promise<string>;
|
|
1372
|
-
explainLastIntent(options?: {
|
|
1373
|
-
namespace?: string;
|
|
1374
|
-
}): Promise<string>;
|
|
1375
|
-
explainLastQmdRecall(options?: {
|
|
1376
|
-
namespace?: string;
|
|
1377
|
-
maxResults?: number;
|
|
1378
|
-
}): Promise<string>;
|
|
1379
|
-
private searchConversationRecallResults;
|
|
1380
|
-
private formatConversationRecallSection;
|
|
1381
|
-
private countConversationChunkDocs;
|
|
1382
|
-
private buildConversationIndexChunks;
|
|
1383
|
-
getConversationIndexHealth(): Promise<{
|
|
1384
|
-
enabled: boolean;
|
|
1385
|
-
backend: "qmd" | "faiss";
|
|
1386
|
-
status: "ok" | "degraded" | "disabled";
|
|
1387
|
-
chunkDocCount: number;
|
|
1388
|
-
lastUpdateAt: string | null;
|
|
1389
|
-
qmdAvailable?: boolean;
|
|
1390
|
-
faiss?: {
|
|
1391
|
-
ok: boolean;
|
|
1392
|
-
status: "ok" | "degraded" | "error";
|
|
1393
|
-
indexPath: string;
|
|
1394
|
-
message?: string;
|
|
1395
|
-
manifest?: {
|
|
1396
|
-
version: number;
|
|
1397
|
-
modelId: string;
|
|
1398
|
-
normalizedModelId: string;
|
|
1399
|
-
dimension: number;
|
|
1400
|
-
chunkCount: number;
|
|
1401
|
-
updatedAt: string;
|
|
1402
|
-
lastSuccessfulRebuildAt: string;
|
|
1403
|
-
};
|
|
1404
|
-
};
|
|
1405
|
-
}>;
|
|
1406
|
-
inspectConversationIndex(): Promise<ConversationIndexBackendInspection & {
|
|
1407
|
-
enabled: boolean;
|
|
1408
|
-
chunkDocCount: number;
|
|
1409
|
-
lastUpdateAt: string | null;
|
|
1410
|
-
}>;
|
|
1411
|
-
getRecoverySummary(sessionKey?: string): Promise<{
|
|
1412
|
-
generatedAt: string;
|
|
1413
|
-
sessionKey?: string;
|
|
1414
|
-
healthy: boolean;
|
|
1415
|
-
issueCount: number;
|
|
1416
|
-
incompleteTurns: number;
|
|
1417
|
-
brokenChains: number;
|
|
1418
|
-
checkpointHealthy: boolean;
|
|
1419
|
-
}>;
|
|
1420
|
-
updateConversationIndex(sessionKey: string, hours?: number, opts?: {
|
|
1421
|
-
embed?: boolean;
|
|
1422
|
-
enforceMinInterval?: boolean;
|
|
1423
|
-
}): Promise<{
|
|
1424
|
-
chunks: number;
|
|
1425
|
-
skipped: boolean;
|
|
1426
|
-
reason?: string;
|
|
1427
|
-
retryAfterMs?: number;
|
|
1428
|
-
embedded?: boolean;
|
|
1429
|
-
}>;
|
|
1430
|
-
rebuildConversationIndex(sessionKey?: string, hours?: number, opts?: {
|
|
1431
|
-
embed?: boolean;
|
|
1432
|
-
}): Promise<{
|
|
1433
|
-
chunks: number;
|
|
1434
|
-
skipped: boolean;
|
|
1435
|
-
reason?: string;
|
|
1436
|
-
embedded?: boolean;
|
|
1437
|
-
rebuilt?: boolean;
|
|
1438
|
-
}>;
|
|
1439
|
-
/**
|
|
1440
|
-
* Validate local LLM model availability and context window compatibility.
|
|
1441
|
-
* Warns the user if there's a mismatch.
|
|
1442
|
-
*/
|
|
1443
|
-
private validateLocalLlmModel;
|
|
1444
|
-
recall(prompt: string, sessionKey?: string, options?: RecallInvocationOptions): Promise<string>;
|
|
1445
|
-
/**
|
|
1446
|
-
* Return the most recent X-ray snapshot captured during a
|
|
1447
|
-
* `recall()` call that passed `xrayCapture: true` (issue #570 PR 1).
|
|
1448
|
-
* Returns `null` when no such capture has occurred on this
|
|
1449
|
-
* orchestrator instance. Returned snapshot is a deep copy so
|
|
1450
|
-
* caller mutation cannot tear the stored value.
|
|
1451
|
-
*/
|
|
1452
|
-
getLastXraySnapshot(): RecallXraySnapshot | null;
|
|
1453
|
-
/** Clear the captured X-ray snapshot. Exposed for tests / explicit reset. */
|
|
1454
|
-
clearLastXraySnapshot(): void;
|
|
1455
|
-
/**
|
|
1456
|
-
* Await the in-flight observation-mode direct-answer annotation chain.
|
|
1457
|
-
* Resolves to true when settled, false on timeout.
|
|
1458
|
-
*/
|
|
1459
|
-
waitForDirectAnswerObservationIdle(timeoutMs?: number): Promise<boolean>;
|
|
1460
|
-
private enqueueDirectAnswerObservation;
|
|
1461
|
-
private annotateDirectAnswerTier;
|
|
1462
|
-
private logRecallFailure;
|
|
1463
|
-
private artifactTypeForCategory;
|
|
1464
|
-
private truncateArtifactForRecall;
|
|
1465
|
-
private fetchActiveArtifactsForNamespace;
|
|
1466
|
-
private recallArtifactsAcrossNamespaces;
|
|
1467
|
-
private scopeQueryAwarePaths;
|
|
1468
|
-
private buildQueryAwarePrefilter;
|
|
1469
|
-
private searchScopedMemoryCandidates;
|
|
1470
|
-
private fetchQmdMemoryResultsWithArtifactTopUp;
|
|
1471
|
-
private expandResultsViaGraph;
|
|
1472
|
-
private recordLastGraphRecallSnapshot;
|
|
1473
|
-
private recordLastIntentSnapshot;
|
|
1474
|
-
private recordLastQmdRecallSnapshot;
|
|
1475
|
-
private recordLastIntentSnapshotForNamespace;
|
|
1476
|
-
private resolveStateDirForNamespace;
|
|
1477
|
-
private buildGraphRecallRankedResults;
|
|
1478
|
-
private getRecallSectionEntry;
|
|
1479
|
-
private isRecallSectionEnabled;
|
|
1480
|
-
private isSpecializedRecallSectionEnabled;
|
|
1481
|
-
private getRecallSectionMaxChars;
|
|
1482
|
-
private getRecallSectionNumber;
|
|
1483
|
-
private appendRecallSection;
|
|
1484
|
-
private truncateRecallSectionToBudget;
|
|
1485
|
-
private protectedRecallSectionIds;
|
|
1486
|
-
private protectedRecallReservationChars;
|
|
1487
|
-
private estimateReservedRecallBudget;
|
|
1488
|
-
private getRecallBudgetChars;
|
|
1489
|
-
private assembleRecallSections;
|
|
1490
|
-
private recallInternal;
|
|
1491
|
-
processTurn(role: "user" | "assistant", content: string, sessionKey?: string, options?: {
|
|
1492
|
-
bufferKey?: string;
|
|
1493
|
-
logicalSessionKey?: string;
|
|
1494
|
-
providerThreadId?: string | null;
|
|
1495
|
-
turnFingerprint?: string;
|
|
1496
|
-
persistProcessedFingerprint?: boolean;
|
|
1497
|
-
}): Promise<void>;
|
|
1498
|
-
flushSession(sessionKey: string, options: {
|
|
1499
|
-
reason: string;
|
|
1500
|
-
abortSignal?: AbortSignal;
|
|
1501
|
-
bufferKey?: string;
|
|
1502
|
-
}): Promise<void>;
|
|
1503
|
-
ingestReplayBatch(turns: ReplayTurn[], options?: {
|
|
1504
|
-
deadlineMs?: number;
|
|
1505
|
-
archiveLcm?: boolean;
|
|
1506
|
-
}): Promise<void>;
|
|
1507
|
-
/**
|
|
1508
|
-
* Return the namespace that `ingestBulkImportBatch` writes into (#460).
|
|
1509
|
-
*
|
|
1510
|
-
* Exposed so host CLIs can snapshot the same storage root that extraction
|
|
1511
|
-
* actually writes to, avoiding the "CLI counts files at namespace A while
|
|
1512
|
-
* writes land in namespace B" footgun that a naïve
|
|
1513
|
-
* `config.defaultNamespace` snapshot could hit when a namespace policy
|
|
1514
|
-
* named `"default"` also exists.
|
|
1515
|
-
*
|
|
1516
|
-
* Today bulk-import is pinned to `config.defaultNamespace`; future
|
|
1517
|
-
* per-invocation namespace routing would thread an explicit target here
|
|
1518
|
-
* and through `ingestBulkImportBatch`.
|
|
1519
|
-
*/
|
|
1520
|
-
bulkImportWriteNamespace(): string;
|
|
1521
|
-
/**
|
|
1522
|
-
* Ingest a batch of bulk-import turns (#460). Like ingestReplayBatch, this
|
|
1523
|
-
* normalizes user/assistant turns into the extraction buffer and awaits
|
|
1524
|
-
* settlement, but it intentionally bypasses the captureMode="explicit"
|
|
1525
|
-
* gate because bulk-import is itself an explicit user action — the user
|
|
1526
|
-
* ran `bulk-import --source <name> --file ...` and would be surprised to
|
|
1527
|
-
* see the command silently no-op when capture is otherwise restricted.
|
|
1528
|
-
*
|
|
1529
|
-
* Turns with role="other" are skipped (not supported by the extraction
|
|
1530
|
-
* pipeline).
|
|
1531
|
-
*
|
|
1532
|
-
* Two design decisions worth calling out:
|
|
1533
|
-
*
|
|
1534
|
-
* - **sessionKey is truthy and per-batch-unique.**
|
|
1535
|
-
* `ThreadingManager.shouldStartNewThread` only applies the session-key
|
|
1536
|
-
* boundary check when `turn.sessionKey` is truthy (threading.ts:82);
|
|
1537
|
-
* with an empty string, imported turns could attach to the current
|
|
1538
|
-
* live thread or merge across unrelated import batches. A unique
|
|
1539
|
-
* `bulk-import:batch:<timestamp>-<rand>` key forces a fresh thread per
|
|
1540
|
-
* batch without matching common prefix/map rules in
|
|
1541
|
-
* `principalFromSessionKeyRules`. (Catch-all regex rules could still
|
|
1542
|
-
* remap the principal, but that only affects metadata provenance —
|
|
1543
|
-
* see the next point for why write routing is unaffected.)
|
|
1544
|
-
*
|
|
1545
|
-
* - **writeNamespaceOverride pins the storage target.**
|
|
1546
|
-
* We pass `writeNamespaceOverride: this.bulkImportWriteNamespace()` to
|
|
1547
|
-
* `queueBufferedExtraction`, which tells `runExtraction` to skip
|
|
1548
|
-
* `defaultNamespaceForPrincipal` and write directly into the
|
|
1549
|
-
* orchestrator's declared bulk-import write namespace. This keeps
|
|
1550
|
-
* writes deterministic even when namespace policies named `"default"`
|
|
1551
|
-
* exist alongside a different `config.defaultNamespace`, and also
|
|
1552
|
-
* guards against regex-catch-all principal rules steering bulk-import
|
|
1553
|
-
* into an unexpected tenant.
|
|
1554
|
-
*
|
|
1555
|
-
* Per-invocation namespace routing (letting callers target a namespace
|
|
1556
|
-
* other than `bulkImportWriteNamespace()`) is a separate feature tracked
|
|
1557
|
-
* as a follow-up — the hook is the `writeNamespaceOverride` option, but
|
|
1558
|
-
* the CLI surface does not yet expose a `--namespace` flag.
|
|
1559
|
-
*/
|
|
1560
|
-
ingestBulkImportBatch(turns: ImportTurn[], options?: {
|
|
1561
|
-
deadlineMs?: number;
|
|
1562
|
-
}): Promise<void>;
|
|
1563
|
-
observeSessionHeartbeat(sessionKey: string, options?: {
|
|
1564
|
-
bufferKey?: string;
|
|
1565
|
-
}): Promise<void>;
|
|
1566
|
-
private queueBufferedExtraction;
|
|
1567
|
-
private normalizeExtractionFingerprintTurns;
|
|
1568
|
-
private buildExtractionFingerprint;
|
|
1569
|
-
private shouldQueueExtraction;
|
|
1570
|
-
/**
|
|
1571
|
-
* Background serial queue processor.
|
|
1572
|
-
* Processes extractions one at a time to avoid race conditions.
|
|
1573
|
-
* Called automatically when items are queued.
|
|
1574
|
-
*/
|
|
1575
|
-
private processQueue;
|
|
1576
|
-
/**
|
|
1577
|
-
* Classify + log a failure from either the per-task catch inside
|
|
1578
|
-
* `processQueue()` or the outer `processQueue().catch(...)` in
|
|
1579
|
-
* `queueBufferedExtraction()`. Issue #549: `throwIfRecallAborted`
|
|
1580
|
-
* (used throughout `runExtraction`) raises an Error whose `name` is
|
|
1581
|
-
* `"AbortError"`. That path fires when `before_reset` aborts a
|
|
1582
|
-
* queued task to avoid duplicate extraction — it is intentional
|
|
1583
|
-
* cancellation, not a failure. Downgrading the log to debug
|
|
1584
|
-
* prevents spurious `error`-level lines that routinely appear
|
|
1585
|
-
* right next to a successful `persisted: N facts, M entities` log
|
|
1586
|
-
* and that confuse operators into thinking extraction is broken.
|
|
1587
|
-
* Genuine extraction failures (network, parse, I/O) still log at
|
|
1588
|
-
* `error`.
|
|
1589
|
-
*
|
|
1590
|
-
* Source differentiates the two call sites so the log message
|
|
1591
|
-
* names the right layer (`task` vs `processor`).
|
|
1592
|
-
*/
|
|
1593
|
-
private logExtractionQueueFailure;
|
|
1594
|
-
private runExtraction;
|
|
1595
|
-
private recordProcessedExtractionFingerprint;
|
|
1596
|
-
private runTierMigrationCycle;
|
|
1597
|
-
getTierMigrationStatus(): Promise<TierMigrationStatusSnapshot>;
|
|
1598
|
-
runTierMigrationNow(options?: {
|
|
1599
|
-
dryRun?: boolean;
|
|
1600
|
-
limit?: number;
|
|
1601
|
-
}): Promise<TierMigrationCycleSummary>;
|
|
1602
|
-
private maybeScheduleConsolidation;
|
|
1603
|
-
private requestQmdMaintenance;
|
|
1604
|
-
/**
|
|
1605
|
-
* Public entrypoint for tool-driven QMD maintenance requests.
|
|
1606
|
-
* Routes through existing debounced/singleflight maintenance controls.
|
|
1607
|
-
*/
|
|
1608
|
-
requestQmdMaintenanceForTool(reason: string): void;
|
|
1609
|
-
private runQmdMaintenance;
|
|
1610
|
-
private persistExtraction;
|
|
1611
|
-
private indexPersistedMemory;
|
|
1612
|
-
/**
|
|
1613
|
-
* Build a graph edge for a persisted memory (v8.2).
|
|
1614
|
-
* Shared helper used by both the chunked and non-chunked write paths to avoid duplication.
|
|
1615
|
-
* Fail-open: caller wraps in try/catch.
|
|
1616
|
-
*/
|
|
1617
|
-
private buildGraphEdge;
|
|
1618
|
-
private graphIndexFor;
|
|
1619
|
-
/**
|
|
1620
|
-
* Batch-update temporal and tag indexes after extraction (v8.1).
|
|
1621
|
-
* Reads each persisted memory's path + frontmatter and adds them to
|
|
1622
|
-
* state/index_time.json and state/index_tags.json.
|
|
1623
|
-
* Fail-open: any error is logged but does not abort extraction.
|
|
1624
|
-
*/
|
|
1625
|
-
private updateTemporalTagIndexes;
|
|
1626
|
-
/** IDs of facts persisted in the last extraction */
|
|
1627
|
-
private lastPersistedIds;
|
|
1628
|
-
private runConsolidation;
|
|
1629
|
-
optimizeCompressionGuidelines(options?: {
|
|
1630
|
-
dryRun?: boolean;
|
|
1631
|
-
eventLimit?: number;
|
|
1632
|
-
}): Promise<{
|
|
1633
|
-
enabled: boolean;
|
|
1634
|
-
dryRun: boolean;
|
|
1635
|
-
eventCount: number;
|
|
1636
|
-
previousGuidelineVersion: number | null;
|
|
1637
|
-
nextGuidelineVersion: number;
|
|
1638
|
-
changedRules: number;
|
|
1639
|
-
semanticRefinementApplied: boolean;
|
|
1640
|
-
persisted: boolean;
|
|
1641
|
-
draftContentHash: string | null;
|
|
1642
|
-
}>;
|
|
1643
|
-
activateCompressionGuidelineDraft(options?: {
|
|
1644
|
-
expectedContentHash?: string;
|
|
1645
|
-
expectedGuidelineVersion?: number;
|
|
1646
|
-
}): Promise<{
|
|
1647
|
-
enabled: boolean;
|
|
1648
|
-
activated: boolean;
|
|
1649
|
-
guidelineVersion: number | null;
|
|
1650
|
-
reason?: "disabled" | "missing_draft" | "expected_revision_required" | "content_hash_mismatch" | "guideline_version_mismatch" | "draft_changed";
|
|
1651
|
-
}>;
|
|
1652
|
-
private runCompressionGuidelineLearningPass;
|
|
1653
|
-
private buildCompressionGuidelineRecallSection;
|
|
1654
|
-
private parseCompressionSemanticRefinement;
|
|
1655
|
-
private actionOutcomePriorDelta;
|
|
1656
|
-
private buildLifecycleActionPriors;
|
|
1657
|
-
private recordScheduledDreamsPhaseRun;
|
|
1658
|
-
runLifecyclePolicyNow(storage?: StorageManager): Promise<{
|
|
1659
|
-
memoriesAssessed: number;
|
|
1660
|
-
}>;
|
|
1661
|
-
private runLifecyclePolicyPass;
|
|
1662
|
-
/**
|
|
1663
|
-
* Archive old, low-importance, rarely-accessed facts (v6.0).
|
|
1664
|
-
* Moves eligible facts from facts/ to archive/YYYY-MM-DD/.
|
|
1665
|
-
* Returns the number of archived facts.
|
|
1666
|
-
*/
|
|
1667
|
-
private runFactArchival;
|
|
1668
|
-
/**
|
|
1669
|
-
* Run memory summarization if memory count exceeds threshold (Phase 4A).
|
|
1670
|
-
*/
|
|
1671
|
-
private runSummarization;
|
|
1672
|
-
/**
|
|
1673
|
-
* Run topic extraction on all memories (Phase 4B).
|
|
1674
|
-
*/
|
|
1675
|
-
private runTopicExtraction;
|
|
1676
|
-
/** Threshold (bytes) at which IDENTITY.md reflections get auto-consolidated */
|
|
1677
|
-
private static readonly IDENTITY_CONSOLIDATE_THRESHOLD;
|
|
1678
|
-
private autoConsolidateIdentity;
|
|
1679
|
-
private formatQmdResults;
|
|
1680
|
-
private formatObjectiveStateResults;
|
|
1681
|
-
private formatCausalTrajectoryResults;
|
|
1682
|
-
private formatTrustZoneResults;
|
|
1683
|
-
private formatHarmonicRetrievalResults;
|
|
1684
|
-
private formatWorkProductResults;
|
|
1685
|
-
private formatVerifiedEpisodeResults;
|
|
1686
|
-
private formatVerifiedSemanticRuleResults;
|
|
1687
|
-
private summarizeIdentityText;
|
|
1688
|
-
private formatOpenIncidentLine;
|
|
1689
|
-
private trimIdentitySection;
|
|
1690
|
-
private buildIdentityContinuitySection;
|
|
1691
|
-
private emitTrace;
|
|
1692
|
-
private queueEvalShadowRecall;
|
|
1693
|
-
private publishRecallResults;
|
|
1694
|
-
/**
|
|
1695
|
-
* Apply MMR over the pre-truncation recall candidate pool and then slice
|
|
1696
|
-
* the result to `limit`. This is the single place in the pipeline where
|
|
1697
|
-
* MMR runs, and it must be called *before* callers throw away candidates
|
|
1698
|
-
* that would otherwise sit below the final cutoff. Running MMR post-slice
|
|
1699
|
-
* is a no-op in the cases we care about — diverse candidates just below
|
|
1700
|
-
* the cutoff are already gone and can never be promoted.
|
|
1701
|
-
*
|
|
1702
|
-
* Callers must pass the full candidate pool (post-rerank, pre-slice).
|
|
1703
|
-
*/
|
|
1704
|
-
private applyMemoryWorthRerank;
|
|
1705
|
-
private diversifyAndLimitRecallResults;
|
|
1706
|
-
/**
|
|
1707
|
-
* Apply Maximal Marginal Relevance to a section's ordered candidate list.
|
|
1708
|
-
*
|
|
1709
|
-
* Operates per-section so one redundant cluster cannot dominate a section,
|
|
1710
|
-
* and so one section's MMR pass cannot starve other sections. Returns the
|
|
1711
|
-
* input unchanged when disabled, when there are fewer than 2 candidates, or
|
|
1712
|
-
* when no budget information is available.
|
|
1713
|
-
*/
|
|
1714
|
-
private applyMmrToQmdResults;
|
|
1715
|
-
private buildLastRecallBudgetSummary;
|
|
1716
|
-
private collectLastRecallSources;
|
|
1717
|
-
/**
|
|
1718
|
-
* Issue #373 — nearest-neighbor lookup for the write-time semantic dedup
|
|
1719
|
-
* guard. Returns the top-K embedding hits against the currently indexed
|
|
1720
|
-
* memories, or an empty array when the embedding backend is unavailable.
|
|
1721
|
-
* Intentionally does NOT throw; `decideSemanticDedup` treats both "empty"
|
|
1722
|
-
* and "error" outcomes as fail-open (keep the candidate).
|
|
1723
|
-
*
|
|
1724
|
-
* PR #399 P1 fix: when namespaces are enabled the lookup must be scoped
|
|
1725
|
-
* to the SAME namespace as the fact being written. Otherwise a
|
|
1726
|
-
* high-similarity memory from another namespace can suppress a write in
|
|
1727
|
-
* the target namespace — cross-tenant data loss. Callers pass the target
|
|
1728
|
-
* storage so we can translate its root directory into the correct index
|
|
1729
|
-
* path prefix (and, for the legacy default-namespace layout at
|
|
1730
|
-
* `memoryDir` root, an exclusion list for `namespaces/*`).
|
|
1731
|
-
*/
|
|
1732
|
-
semanticDedupLookup(content: string, limit: number, targetStorage: StorageManager): Promise<SemanticDedupHit[]>;
|
|
1733
|
-
/**
|
|
1734
|
-
* Resolve the namespace-scoped filter to pass into
|
|
1735
|
-
* `EmbeddingFallback.search()` for semantic dedup. Returns an empty
|
|
1736
|
-
* object (no filter) when namespaces are disabled, preserving the
|
|
1737
|
-
* pre-PR #399 behavior for single-tenant installs.
|
|
1738
|
-
*
|
|
1739
|
-
* Index entries are stored as paths relative to `config.memoryDir`, so:
|
|
1740
|
-
* - A non-default namespace `ns` lives under `namespaces/<ns>/…` and
|
|
1741
|
-
* we include exactly that prefix.
|
|
1742
|
-
* - The default namespace may live at `memoryDir` root (legacy) or at
|
|
1743
|
-
* `memoryDir/namespaces/<default>/…` (migrated). When it lives at
|
|
1744
|
-
* root we include everything but EXCLUDE all `namespaces/…` entries
|
|
1745
|
-
* so facts from non-default namespaces can't cross-match.
|
|
1746
|
-
*/
|
|
1747
|
-
private semanticDedupScopeFor;
|
|
1748
|
-
private searchEmbeddingFallback;
|
|
1749
|
-
/**
|
|
1750
|
-
* Long-term fallback retrieval.
|
|
1751
|
-
* Searches archived memories only, and is invoked only when hot recall returns zero hits.
|
|
1752
|
-
*/
|
|
1753
|
-
private searchLongTermArchiveFallback;
|
|
1754
|
-
private applyColdFallbackPipeline;
|
|
1755
|
-
/**
|
|
1756
|
-
* Record that memories were accessed (retrieved).
|
|
1757
|
-
* Updates are batched in memory and flushed during consolidation.
|
|
1758
|
-
*/
|
|
1759
|
-
trackMemoryAccess(memoryIds: string[]): void;
|
|
1760
|
-
/**
|
|
1761
|
-
* Flush access tracking buffer to disk.
|
|
1762
|
-
* Called during consolidation or when buffer is full.
|
|
1763
|
-
*/
|
|
1764
|
-
flushAccessTracking(): Promise<void>;
|
|
1765
|
-
/**
|
|
1766
|
-
* Apply recency, access count, and importance boosting to QMD search results.
|
|
1767
|
-
* Returns re-ranked results.
|
|
1768
|
-
*/
|
|
1769
|
-
private boostSearchResults;
|
|
1770
|
-
/**
|
|
1771
|
-
* Extract memory IDs from QMD search results for access tracking.
|
|
1772
|
-
*/
|
|
1773
|
-
private extractMemoryIdsFromResults;
|
|
1774
|
-
recordMemoryFeedback(memoryId: string, vote: "up" | "down", note?: string): Promise<void>;
|
|
1775
|
-
recordNotUsefulMemories(memoryIds: string[], note?: string): Promise<void>;
|
|
1776
|
-
getLastRecall(sessionKey: string): LastRecallSnapshot | null;
|
|
1777
|
-
/**
|
|
1778
|
-
* Check if a new memory contradicts an existing one.
|
|
1779
|
-
* Uses QMD to find similar memories, then LLM to verify contradiction.
|
|
1780
|
-
*/
|
|
1781
|
-
private checkForContradiction;
|
|
1782
|
-
/**
|
|
1783
|
-
* Suggest links for a new memory based on similar existing memories.
|
|
1784
|
-
*/
|
|
1785
|
-
private suggestLinksForMemory;
|
|
1786
|
-
private namespaceFromPath;
|
|
1787
|
-
private namespaceFromStorageDir;
|
|
1788
|
-
private readAllMemoriesForNamespaces;
|
|
1789
|
-
private readArchivedMemoriesForNamespaces;
|
|
1790
|
-
}
|
|
1791
|
-
|
|
1792
|
-
export { shouldFilterLifecycleRecallCandidate as $, computeArtifactCandidateFetchLimit as A, type BulkImportSource as B, type CompoundingPromotionReport as C, computeArtifactRecallLimit as D, computeQmdHybridFetchLimit as E, dedupeEntitySynthesisEvidenceEntries as F, type GraphRecallSnapshot as G, deriveTopicsFromExtraction as H, type IntentDebugSnapshot as I, filterRecallCandidates as J, formatCompressionGuidelinesForRecall as K, graphPathRelativeToStorage as L, hasIdentityRecoveryIntent as M, isArtifactMemoryPath as N, Orchestrator as O, type PatternReinforcementResult as P, type QmdRecallSnapshot as Q, type ReplaySource as R, type SemanticDedupLookup as S, lifecycleRecallScoreAdjustment as T, mergeArtifactRecallCandidates as U, mergeGraphExpandedResults as V, resolveEffectiveIdentityInjectionMode as W, resolveEffectiveRecallMode as X, resolvePersistedMemoryRelativePath as Y, resolveRecallModeDecision as Z, resolveRecentThreadMemoryPaths as _, type ReplayWarning as a, summarizeGraphShadowComparison as a0, type ImportTurn as b, type BulkImportOptions as c, type BulkImportResult as d, type ReplayTurn as e, type BulkImportSourceAdapter as f, type BulkImportError as g, type ImportSourceRole as h, type ImportTurnValidationIssue as i, type SemanticDedupDecision as j, type SemanticDedupHit as k, type SemanticDedupOptions as l, decideSemanticDedup as m, defaultWorkspaceDir as n, isImportRole as o, parseIsoTimestamp as p, type GraphRecallRankedResult as q, type GraphRecallShadowComparison as r, sanitizeSessionKeyForFilename as s, type RecallInvocationOptions as t, type RecallModeDecision as u, validateImportTurn as v, appendMemoryToGraphContext as w, blendGraphExpandedRecallScore as x, buildCompressionGuidelinesMarkdown as y, buildMemoryPathById as z };
|