@remnic/core 1.1.12 → 1.1.14
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 +258 -0
- package/src/qmd.ts +2614 -0
- package/src/reasoning-trace-recall.ts +201 -0
- package/src/reasoning-trace-types.ts +235 -0
- package/src/recall-audit-anomaly.test.ts +246 -0
- package/src/recall-audit-anomaly.ts +297 -0
- package/src/recall-audit.test.ts +51 -0
- package/src/recall-audit.ts +72 -0
- package/src/recall-budget-config.test.ts +87 -0
- package/src/recall-disclosure-escalation.test.ts +196 -0
- package/src/recall-disclosure-escalation.ts +158 -0
- package/src/recall-disclosure-shaping.test.ts +146 -0
- package/src/recall-disclosure.test.ts +214 -0
- package/src/recall-explain-renderer.test.ts +140 -0
- package/src/recall-explain-renderer.ts +356 -0
- package/src/recall-mmr.test.ts +808 -0
- package/src/recall-mmr.ts +607 -0
- package/src/recall-qos.test.ts +85 -0
- package/src/recall-qos.ts +82 -0
- package/src/recall-query-policy.ts +221 -0
- package/src/recall-state.test.ts +233 -0
- package/src/recall-state.ts +456 -0
- package/src/recall-tag-filter.ts +143 -0
- package/src/recall-tokenization.ts +35 -0
- package/src/recall-xray-cli.test.ts +118 -0
- package/src/recall-xray-cli.ts +100 -0
- package/src/recall-xray-disclosure-telemetry.test.ts +183 -0
- package/src/recall-xray-renderer.test.ts +539 -0
- package/src/recall-xray-renderer.ts +487 -0
- package/src/recall-xray.test.ts +503 -0
- package/src/recall-xray.ts +621 -0
- package/src/reconstruct.ts +41 -0
- package/src/release-changelog.ts +35 -0
- package/src/relevance.ts +67 -0
- package/src/replay/normalizers/chatgpt.ts +133 -0
- package/src/replay/normalizers/claude.ts +102 -0
- package/src/replay/normalizers/openclaw.ts +119 -0
- package/src/replay/normalizers/shared.ts +69 -0
- package/src/replay/runner.ts +197 -0
- package/src/replay/types.ts +143 -0
- package/src/rerank.test.ts +48 -0
- package/src/rerank.ts +176 -0
- package/src/resolve-auth-token.test.ts +226 -0
- package/src/resolve-auth-token.ts +151 -0
- package/src/resolve-provider-secret.test.ts +187 -0
- package/src/resolve-provider-secret.ts +410 -0
- package/src/response-guidance-recall.test.ts +3952 -0
- package/src/response-guidance-recall.ts +4431 -0
- package/src/resume-bundles.ts +415 -0
- package/src/retrieval-agents.ts +623 -0
- package/src/retrieval-tiers.ts +25 -0
- package/src/retrieval.ts +104 -0
- package/src/review/index.test.ts +201 -0
- package/src/review/index.ts +536 -0
- package/src/routing/engine.ts +162 -0
- package/src/routing/store.ts +321 -0
- package/src/runtime/better-sqlite.test.ts +32 -0
- package/src/runtime/better-sqlite.ts +76 -0
- package/src/runtime/child-process.ts +67 -0
- package/src/runtime/env.ts +48 -0
- package/src/sanitize.ts +58 -0
- package/src/schemas.ts +449 -0
- package/src/sdk-compat.ts +87 -0
- package/src/search/document-scanner.ts +96 -0
- package/src/search/embed-helper.ts +142 -0
- package/src/search/factory.ts +189 -0
- package/src/search/index.ts +10 -0
- package/src/search/lancedb-backend.ts +342 -0
- package/src/search/meilisearch-backend.ts +232 -0
- package/src/search/noop-backend.ts +57 -0
- package/src/search/orama-backend.ts +358 -0
- package/src/search/port.ts +86 -0
- package/src/search/remote-backend.ts +124 -0
- package/src/secure-store/cipher.ts +271 -0
- package/src/secure-store/cli-handlers.ts +355 -0
- package/src/secure-store/cli-renderer.ts +131 -0
- package/src/secure-store/header.ts +373 -0
- package/src/secure-store/index.ts +137 -0
- package/src/secure-store/kdf.ts +263 -0
- package/src/secure-store/keyring.ts +106 -0
- package/src/secure-store/metadata.ts +394 -0
- package/src/secure-store/passphrase-reader.ts +252 -0
- package/src/secure-store/secure-fs.ts +571 -0
- package/src/secure-store/secure-store.test.ts +755 -0
- package/src/semantic-chunking.ts +545 -0
- package/src/semantic-consolidation.test.ts +182 -0
- package/src/semantic-consolidation.ts +432 -0
- package/src/semantic-rule-promotion.ts +183 -0
- package/src/semantic-rule-verifier.ts +160 -0
- package/src/session-integrity.ts +569 -0
- package/src/session-observer-bands.ts +11 -0
- package/src/session-observer-state.ts +346 -0
- package/src/session-toggles.test.ts +96 -0
- package/src/session-toggles.ts +159 -0
- package/src/shared-context/manager.ts +810 -0
- package/src/signal.ts +84 -0
- package/src/skills-registry.test.ts +277 -0
- package/src/skills-registry.ts +120 -0
- package/src/source-attribution-roundtrip.test.ts +215 -0
- package/src/source-attribution.test.ts +1425 -0
- package/src/source-attribution.ts +639 -0
- package/src/spaces/index.ts +627 -0
- package/src/storage-paths.ts +117 -0
- package/src/storage.ts +6657 -0
- package/src/store-contract.ts +55 -0
- package/src/summarizer.ts +844 -0
- package/src/summary-snapshot.test.ts +681 -0
- package/src/summary-snapshot.ts +238 -0
- package/src/surfaces/dreams.test.ts +394 -0
- package/src/surfaces/dreams.ts +346 -0
- package/src/surfaces/heartbeat.test.ts +415 -0
- package/src/surfaces/heartbeat.ts +325 -0
- package/src/sync/index.ts +308 -0
- package/src/targeted-fact-recall.test.ts +1694 -0
- package/src/targeted-fact-recall.ts +2905 -0
- package/src/taxonomy/default-taxonomy.ts +87 -0
- package/src/taxonomy/index.ts +26 -0
- package/src/taxonomy/resolver-doc-generator.ts +57 -0
- package/src/taxonomy/resolver.ts +184 -0
- package/src/taxonomy/taxonomy-loader.ts +186 -0
- package/src/taxonomy/types.ts +48 -0
- package/src/telemetry-transcript.ts +70 -0
- package/src/temporal-index.ts +890 -0
- package/src/temporal-supersession.test.ts +2703 -0
- package/src/temporal-supersession.ts +493 -0
- package/src/temporal-validity.test.ts +448 -0
- package/src/temporal-validity.ts +123 -0
- package/src/threading.ts +395 -0
- package/src/tier-migration.ts +124 -0
- package/src/tier-routing.ts +102 -0
- package/src/tmt.ts +462 -0
- package/src/tokens.test.ts +178 -0
- package/src/tokens.ts +279 -0
- package/src/topics.ts +147 -0
- package/src/training-export/cli-date-validation.test.ts +258 -0
- package/src/training-export/converter.test.ts +452 -0
- package/src/training-export/converter.ts +319 -0
- package/src/training-export/date-parse.ts +117 -0
- package/src/training-export/index.ts +26 -0
- package/src/training-export/registry.test.ts +85 -0
- package/src/training-export/registry.ts +57 -0
- package/src/training-export/types.ts +31 -0
- package/src/transcript.ts +1179 -0
- package/src/transfer/autodetect.ts +30 -0
- package/src/transfer/backup.ts +138 -0
- package/src/transfer/capsule-crypto.ts +485 -0
- package/src/transfer/capsule-encrypt.test.ts +690 -0
- package/src/transfer/capsule-export.ts +543 -0
- package/src/transfer/capsule-fork.ts +375 -0
- package/src/transfer/capsule-import.ts +564 -0
- package/src/transfer/capsule-merge.ts +433 -0
- package/src/transfer/conflict-policy.ts +16 -0
- package/src/transfer/constants.ts +13 -0
- package/src/transfer/exclusions.ts +37 -0
- package/src/transfer/export-json.ts +65 -0
- package/src/transfer/export-md.ts +59 -0
- package/src/transfer/export-sqlite.ts +52 -0
- package/src/transfer/fs-utils.ts +269 -0
- package/src/transfer/import-json.ts +108 -0
- package/src/transfer/import-md.ts +84 -0
- package/src/transfer/import-sqlite.ts +100 -0
- package/src/transfer/integrity.ts +71 -0
- package/src/transfer/sqlite-schema.ts +16 -0
- package/src/transfer/types.ts +297 -0
- package/src/trust-zones.ts +1186 -0
- package/src/types.ts +3074 -0
- package/src/user-model.test.ts +124 -0
- package/src/user-model.ts +162 -0
- package/src/utility-learner.ts +353 -0
- package/src/utility-runtime.ts +88 -0
- package/src/utility-telemetry.ts +215 -0
- package/src/utils/category-dir.ts +44 -0
- package/src/utils/errno.ts +6 -0
- package/src/utils/iso-timestamp.test.ts +37 -0
- package/src/utils/iso-timestamp.ts +164 -0
- package/src/utils/path.ts +26 -0
- package/src/verified-recall.ts +138 -0
- package/src/version-utils.test.ts +10 -0
- package/src/version-utils.ts +9 -0
- package/src/whitespace.ts +10 -0
- package/src/work/board.ts +359 -0
- package/src/work/boundary.ts +107 -0
- package/src/work/storage.ts +436 -0
- package/src/work/types.ts +82 -0
- package/src/work-product-ledger.ts +265 -0
- package/dist/access-service-DDjzFALq.d.ts +0 -2088
- package/dist/capsule-crypto-SJS5VVAP.js +0 -18
- package/dist/capsule-export-7QNCBZOQ.js +0 -17
- package/dist/capsule-import-EPBHD2EN.js +0 -16
- package/dist/capsule-merge-DI7PNQ2H.js +0 -189
- package/dist/chunk-23ZZK64Y.js +0 -26
- package/dist/chunk-23ZZK64Y.js.map +0 -1
- package/dist/chunk-242S3I2A.js +0 -647
- package/dist/chunk-2LGMW3DJ.js +0 -111
- package/dist/chunk-3B6KIRBH.js +0 -5213
- package/dist/chunk-3B6KIRBH.js.map +0 -1
- package/dist/chunk-457A4P3L.js +0 -119
- package/dist/chunk-457A4P3L.js.map +0 -1
- package/dist/chunk-4IS4SXIQ.js +0 -2040
- package/dist/chunk-4YM32CRU.js +0 -721
- package/dist/chunk-6TBWYBJ3.js +0 -236
- package/dist/chunk-74EMIVE4.js +0 -329
- package/dist/chunk-74EMIVE4.js.map +0 -1
- package/dist/chunk-767ODGE6.js +0 -183
- package/dist/chunk-7V22HTMD.js +0 -623
- package/dist/chunk-7V22HTMD.js.map +0 -1
- package/dist/chunk-7ZM3BFKK.js +0 -9705
- package/dist/chunk-7ZM3BFKK.js.map +0 -1
- package/dist/chunk-AQJNPMOA.js +0 -643
- package/dist/chunk-AQJNPMOA.js.map +0 -1
- package/dist/chunk-ASAITVLA.js +0 -64
- package/dist/chunk-ASAITVLA.js.map +0 -1
- package/dist/chunk-BBE34QBJ.js +0 -275
- package/dist/chunk-BBE34QBJ.js.map +0 -1
- package/dist/chunk-BZSQEPRW.js +0 -14710
- package/dist/chunk-BZSQEPRW.js.map +0 -1
- package/dist/chunk-CPKTBRS2.js +0 -891
- package/dist/chunk-CPKTBRS2.js.map +0 -1
- package/dist/chunk-D4GAOFF6.js +0 -562
- package/dist/chunk-D4GAOFF6.js.map +0 -1
- package/dist/chunk-D54LZC5L.js +0 -147
- package/dist/chunk-DF3RVK3X.js +0 -119
- package/dist/chunk-DF3RVK3X.js.map +0 -1
- package/dist/chunk-DZZPC36E.js +0 -1451
- package/dist/chunk-DZZPC36E.js.map +0 -1
- package/dist/chunk-E2UCDP5S.js +0 -570
- package/dist/chunk-E6K4NIEU.js +0 -747
- package/dist/chunk-E6K4NIEU.js.map +0 -1
- package/dist/chunk-EEQLFRUM.js +0 -89
- package/dist/chunk-ETOW6ACV.js +0 -158
- package/dist/chunk-ETOW6ACV.js.map +0 -1
- package/dist/chunk-FMEBPEAO.js +0 -347
- package/dist/chunk-FMEBPEAO.js.map +0 -1
- package/dist/chunk-FQDPCE3I.js +0 -1837
- package/dist/chunk-FQDPCE3I.js.map +0 -1
- package/dist/chunk-FYIYMQ5N.js +0 -221
- package/dist/chunk-FYIYMQ5N.js.map +0 -1
- package/dist/chunk-G2WADRQ3.js +0 -219
- package/dist/chunk-G4SK7DSQ.js +0 -121
- package/dist/chunk-GVPWB7EY.js +0 -390
- package/dist/chunk-GVPWB7EY.js.map +0 -1
- package/dist/chunk-HELQZFZO.js +0 -1075
- package/dist/chunk-HL5LRPNA.js +0 -1914
- package/dist/chunk-HL5LRPNA.js.map +0 -1
- package/dist/chunk-HQZVVSVB.js +0 -147
- package/dist/chunk-HQZVVSVB.js.map +0 -1
- package/dist/chunk-HY3L4WKC.js +0 -2195
- package/dist/chunk-HY3L4WKC.js.map +0 -1
- package/dist/chunk-IB3BFHGN.js +0 -228
- package/dist/chunk-IXEJRKCZ.js +0 -18
- package/dist/chunk-JBMSGZEQ.js +0 -441
- package/dist/chunk-JBMSGZEQ.js.map +0 -1
- package/dist/chunk-JESOB2HO.js +0 -108
- package/dist/chunk-JKDVIE52.js +0 -272
- package/dist/chunk-JRNQ3RNA.js +0 -284
- package/dist/chunk-JRNQ3RNA.js.map +0 -1
- package/dist/chunk-K6WK37A6.js +0 -865
- package/dist/chunk-K6WK37A6.js.map +0 -1
- package/dist/chunk-MARWOCVP.js +0 -48
- package/dist/chunk-MNU6ZBWT.js +0 -4454
- package/dist/chunk-MNU6ZBWT.js.map +0 -1
- package/dist/chunk-N5AKDXAI.js +0 -74
- package/dist/chunk-OA3L7BFR.js +0 -183
- package/dist/chunk-OA3L7BFR.js.map +0 -1
- package/dist/chunk-OR64ZGRZ.js +0 -23
- package/dist/chunk-P77UEOU2.js +0 -1521
- package/dist/chunk-P77UEOU2.js.map +0 -1
- package/dist/chunk-PH4C2U43.js +0 -239
- package/dist/chunk-PH4C2U43.js.map +0 -1
- package/dist/chunk-RVPLBATS.js +0 -1586
- package/dist/chunk-RVPLBATS.js.map +0 -1
- package/dist/chunk-U5JMRGKX.js +0 -340
- package/dist/chunk-U5JMRGKX.js.map +0 -1
- package/dist/chunk-URB2WSKZ.js +0 -350
- package/dist/chunk-URB2WSKZ.js.map +0 -1
- package/dist/chunk-UVMUAWVT.js +0 -596
- package/dist/chunk-WEJG4TB5.js +0 -118
- package/dist/chunk-X7HPGUVG.js +0 -271
- package/dist/chunk-XAMBKFQS.js +0 -2777
- package/dist/chunk-XAMBKFQS.js.map +0 -1
- package/dist/chunk-XJKFSSDW.js +0 -726
- package/dist/chunk-XJKFSSDW.js.map +0 -1
- package/dist/chunk-XMHBH5H6.js +0 -283
- package/dist/chunk-XMHBH5H6.js.map +0 -1
- package/dist/chunk-XMVFHBHT.js +0 -277
- package/dist/chunk-Y3VMVTYX.js +0 -53
- package/dist/chunk-YNB73F22.js +0 -137
- package/dist/chunk-YNB73F22.js.map +0 -1
- package/dist/chunk-Z2E7VW55.js +0 -335
- package/dist/chunk-Z2E7VW55.js.map +0 -1
- package/dist/chunk-ZG7PTKBK.js +0 -2296
- package/dist/chunk-ZNQN6ZTA.js +0 -135
- package/dist/chunk-ZVTKDVVM.js +0 -827
- package/dist/chunk-ZVTKDVVM.js.map +0 -1
- package/dist/cli-BR8KpIU0.d.ts +0 -1259
- package/dist/codex-materialize-CQlLTzke.d.ts +0 -139
- package/dist/connectors-cli-DFGtY2DB.d.ts +0 -257
- package/dist/contradiction-review-5LTTVDQV.js +0 -22
- package/dist/contradiction-scan-QTXAMBUA.js +0 -414
- package/dist/contradiction-scan-QTXAMBUA.js.map +0 -1
- package/dist/engine-35M5BKQ7.js +0 -28
- package/dist/fs-utils-IRVUFB6G.js +0 -30
- package/dist/graph-edge-decay-PWB63GRE.js +0 -207
- package/dist/memory-governance-IMPQZXFC.js +0 -37
- package/dist/memory-projection-store-CY8TU40w.d.ts +0 -222
- package/dist/orchestrator-DDMPqU6R.d.ts +0 -1792
- package/dist/path-RMTY5Y5A.js +0 -9
- package/dist/port-B6VEDIkC.d.ts +0 -53
- package/dist/resolution-YGIBORXI.js +0 -101
- package/dist/resolution-YGIBORXI.js.map +0 -1
- package/dist/secure-store-4R2GSO7S.js +0 -156
- package/dist/semantic-consolidation-ByBXb-sf.d.ts +0 -180
- package/dist/state-store-3EH7HYIN.js +0 -16
- package/dist/types-V3FJ26TF.js +0 -30
- /package/dist/{capsule-crypto-SJS5VVAP.js.map → adapters/claude-code.js.map} +0 -0
- /package/dist/{capsule-export-7QNCBZOQ.js.map → adapters/codex.js.map} +0 -0
- /package/dist/{capsule-import-EPBHD2EN.js.map → adapters/hermes.js.map} +0 -0
- /package/dist/{contradiction-review-5LTTVDQV.js.map → adapters/index.js.map} +0 -0
- /package/dist/{engine-35M5BKQ7.js.map → adapters/registry.js.map} +0 -0
- /package/dist/{fs-utils-IRVUFB6G.js.map → adapters/replit.js.map} +0 -0
- /package/dist/{memory-governance-IMPQZXFC.js.map → adapters/types.js.map} +0 -0
- /package/dist/{path-RMTY5Y5A.js.map → capsule-crypto-5CYAGVC5.js.map} +0 -0
- /package/dist/{capsule-merge-DI7PNQ2H.js.map → capsule-merge-4MGKE7C5.js.map} +0 -0
- /package/dist/{chunk-G4SK7DSQ.js.map → chunk-2WWLHTZY.js.map} +0 -0
- /package/dist/{chunk-X7HPGUVG.js.map → chunk-4CRG46BG.js.map} +0 -0
- /package/dist/{chunk-UVMUAWVT.js.map → chunk-7IASACLB.js.map} +0 -0
- /package/dist/{chunk-HELQZFZO.js.map → chunk-EDTHC6UD.js.map} +0 -0
- /package/dist/{chunk-4YM32CRU.js.map → chunk-EFJ3MQ4V.js.map} +0 -0
- /package/dist/{chunk-E2UCDP5S.js.map → chunk-FBYESMQ2.js.map} +0 -0
- /package/dist/{chunk-D54LZC5L.js.map → chunk-FDU6HUUL.js.map} +0 -0
- /package/dist/{chunk-IB3BFHGN.js.map → chunk-GGKRUQOO.js.map} +0 -0
- /package/dist/{chunk-242S3I2A.js.map → chunk-GL6I6MEQ.js.map} +0 -0
- /package/dist/{secure-store-4R2GSO7S.js.map → chunk-HHLLAQGZ.js.map} +0 -0
- /package/dist/{chunk-4IS4SXIQ.js.map → chunk-HXXBL2KD.js.map} +0 -0
- /package/dist/{chunk-767ODGE6.js.map → chunk-KNKUID7G.js.map} +0 -0
- /package/dist/{chunk-6TBWYBJ3.js.map → chunk-LPMVBPA3.js.map} +0 -0
- /package/dist/{chunk-WEJG4TB5.js.map → chunk-MC26UJIM.js.map} +0 -0
- /package/dist/{chunk-JKDVIE52.js.map → chunk-MGKYQQYF.js.map} +0 -0
- /package/dist/{chunk-Y3VMVTYX.js.map → chunk-MT4HVDUZ.js.map} +0 -0
- /package/dist/{chunk-G2WADRQ3.js.map → chunk-MY6TPVXW.js.map} +0 -0
- /package/dist/{chunk-OR64ZGRZ.js.map → chunk-NNVTUXEB.js.map} +0 -0
- /package/dist/{chunk-JESOB2HO.js.map → chunk-P4NEIHUT.js.map} +0 -0
- /package/dist/{chunk-IXEJRKCZ.js.map → chunk-QRNI5JBH.js.map} +0 -0
- /package/dist/{chunk-EEQLFRUM.js.map → chunk-RRF5UOBJ.js.map} +0 -0
- /package/dist/{state-store-3EH7HYIN.js.map → chunk-SEDEKFYQ.js.map} +0 -0
- /package/dist/{chunk-2LGMW3DJ.js.map → chunk-U3PN77QT.js.map} +0 -0
- /package/dist/{chunk-XMVFHBHT.js.map → chunk-U3WSW6PZ.js.map} +0 -0
- /package/dist/{chunk-N5AKDXAI.js.map → chunk-UWVJF25J.js.map} +0 -0
- /package/dist/{types-V3FJ26TF.js.map → chunk-V5OCT34X.js.map} +0 -0
- /package/dist/{chunk-ZG7PTKBK.js.map → chunk-W3LR522O.js.map} +0 -0
- /package/dist/{chunk-MARWOCVP.js.map → chunk-XIG5PDM7.js.map} +0 -0
- /package/dist/{chunk-ZNQN6ZTA.js.map → chunk-XVZ7B3HG.js.map} +0 -0
- /package/dist/{graph-edge-decay-PWB63GRE.js.map → graph-edge-decay-5DI5GUNL.js.map} +0 -0
package/dist/chunk-XAMBKFQS.js
DELETED
|
@@ -1,2777 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
REMNIC_CHATGPT_MEMORY_INSPECTOR_MIME_TYPE,
|
|
3
|
-
REMNIC_CHATGPT_MEMORY_INSPECTOR_TOOL,
|
|
4
|
-
REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_HTML,
|
|
5
|
-
REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
|
|
6
|
-
buildChatGptMemoryInspectorActionRequest,
|
|
7
|
-
buildChatGptMemoryInspectorResult
|
|
8
|
-
} from "./chunk-C5BCH4ZS.js";
|
|
9
|
-
import {
|
|
10
|
-
buildCitationGuidance
|
|
11
|
-
} from "./chunk-IQT3XTKW.js";
|
|
12
|
-
import {
|
|
13
|
-
EngramAccessInputError
|
|
14
|
-
} from "./chunk-MNU6ZBWT.js";
|
|
15
|
-
import {
|
|
16
|
-
validateBriefingFormat
|
|
17
|
-
} from "./chunk-ZVTKDVVM.js";
|
|
18
|
-
import {
|
|
19
|
-
expandTildePath
|
|
20
|
-
} from "./chunk-IXEJRKCZ.js";
|
|
21
|
-
import {
|
|
22
|
-
readEnvVar
|
|
23
|
-
} from "./chunk-MARWOCVP.js";
|
|
24
|
-
import {
|
|
25
|
-
validateRequest
|
|
26
|
-
} from "./chunk-U5JMRGKX.js";
|
|
27
|
-
|
|
28
|
-
// src/access-mcp.ts
|
|
29
|
-
import { readFile } from "fs/promises";
|
|
30
|
-
import { randomUUID } from "crypto";
|
|
31
|
-
var MCP_PROTOCOL_VERSION = "2024-11-05";
|
|
32
|
-
var LEGACY_MCP_PREFIX = "engram.";
|
|
33
|
-
var CANONICAL_MCP_PREFIX = "remnic.";
|
|
34
|
-
function toCanonicalToolName(name) {
|
|
35
|
-
return name.startsWith(LEGACY_MCP_PREFIX) ? `${CANONICAL_MCP_PREFIX}${name.slice(LEGACY_MCP_PREFIX.length)}` : name;
|
|
36
|
-
}
|
|
37
|
-
function toLegacyToolName(name) {
|
|
38
|
-
return name.startsWith(CANONICAL_MCP_PREFIX) ? `${LEGACY_MCP_PREFIX}${name.slice(CANONICAL_MCP_PREFIX.length)}` : name;
|
|
39
|
-
}
|
|
40
|
-
function withToolAliases(tool) {
|
|
41
|
-
const canonicalName = toCanonicalToolName(tool.name);
|
|
42
|
-
const canonicalTool = canonicalName === tool.name ? tool : { ...tool, name: canonicalName };
|
|
43
|
-
if (canonicalName === tool.name) return [canonicalTool];
|
|
44
|
-
return [canonicalTool, tool];
|
|
45
|
-
}
|
|
46
|
-
function resolveChatGptInspectorRecallSessionKey(explicitSessionKey, authenticatedPrincipal) {
|
|
47
|
-
if (explicitSessionKey) return explicitSessionKey;
|
|
48
|
-
if (!authenticatedPrincipal) return void 0;
|
|
49
|
-
return `remnic:chatgpt-memory-inspector:${randomUUID()}`;
|
|
50
|
-
}
|
|
51
|
-
var STRICT_MCP_SCHEMA_KEYS = {
|
|
52
|
-
capsuleExport: [
|
|
53
|
-
"name",
|
|
54
|
-
"namespace",
|
|
55
|
-
"since",
|
|
56
|
-
"includeKinds",
|
|
57
|
-
"peerIds",
|
|
58
|
-
"includeTranscripts",
|
|
59
|
-
"encrypt"
|
|
60
|
-
],
|
|
61
|
-
capsuleImport: ["archivePath", "namespace", "mode"],
|
|
62
|
-
capsuleList: ["namespace"]
|
|
63
|
-
};
|
|
64
|
-
function parseMcpRequest(schemaName, args) {
|
|
65
|
-
const allowedKeys = STRICT_MCP_SCHEMA_KEYS[schemaName];
|
|
66
|
-
if (allowedKeys) {
|
|
67
|
-
const allowed = new Set(allowedKeys);
|
|
68
|
-
const unexpected = Object.keys(args).filter((key) => !allowed.has(key));
|
|
69
|
-
if (unexpected.length > 0) {
|
|
70
|
-
throw new EngramAccessInputError(
|
|
71
|
-
`request validation failed: (root): Unrecognized key(s) in object: ${unexpected.join(", ")}`
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
const validation = validateRequest(schemaName, args);
|
|
76
|
-
if (validation.success) return validation.data;
|
|
77
|
-
const details = validation.error.details.map((detail) => `${detail.field}: ${detail.message}`).join("; ");
|
|
78
|
-
throw new EngramAccessInputError(
|
|
79
|
-
details.length > 0 ? `${validation.error.error}: ${details}` : validation.error.error
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
async function getMcpServerVersion() {
|
|
83
|
-
const envVersion = readEnvVar("OPENCLAW_ENGRAM_VERSION")?.trim() || readEnvVar("npm_package_version")?.trim();
|
|
84
|
-
if (envVersion) return envVersion;
|
|
85
|
-
try {
|
|
86
|
-
const pkgPath = new URL("../package.json", import.meta.url);
|
|
87
|
-
const raw = await readFile(pkgPath, "utf-8");
|
|
88
|
-
const parsed = JSON.parse(raw);
|
|
89
|
-
return parsed.version?.trim() || "unknown";
|
|
90
|
-
} catch {
|
|
91
|
-
return "unknown";
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
var EngramMcpServer = class {
|
|
95
|
-
constructor(service, options = {}) {
|
|
96
|
-
this.service = service;
|
|
97
|
-
this.citationsEnabled = options.citationsEnabled === true;
|
|
98
|
-
this.citationsAutoDetect = options.citationsAutoDetect !== false;
|
|
99
|
-
this.authenticatedPrincipal = options.principal?.trim() || readEnvVar("OPENCLAW_ENGRAM_ACCESS_PRINCIPAL")?.trim() || void 0;
|
|
100
|
-
this.resources = [
|
|
101
|
-
{
|
|
102
|
-
uri: REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
|
|
103
|
-
name: "remnic-memory-inspector",
|
|
104
|
-
title: "Remnic Memory Inspector",
|
|
105
|
-
description: "Apps-compatible widget for inspecting retrieved Remnic memories, provenance, safety, and correction/scoping affordances.",
|
|
106
|
-
mimeType: REMNIC_CHATGPT_MEMORY_INSPECTOR_MIME_TYPE,
|
|
107
|
-
_meta: {
|
|
108
|
-
ui: {
|
|
109
|
-
csp: {
|
|
110
|
-
connectDomains: [],
|
|
111
|
-
resourceDomains: []
|
|
112
|
-
},
|
|
113
|
-
prefersBorder: true
|
|
114
|
-
},
|
|
115
|
-
"openai/widgetDescription": "Inspect retrieved Remnic memories, provenance, safety, and correction/scoping affordances."
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
];
|
|
119
|
-
this.resourceTextByUri = /* @__PURE__ */ new Map([
|
|
120
|
-
[
|
|
121
|
-
REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
|
|
122
|
-
REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_HTML
|
|
123
|
-
]
|
|
124
|
-
]);
|
|
125
|
-
this.tools = [
|
|
126
|
-
{
|
|
127
|
-
name: "engram.recall",
|
|
128
|
-
description: "Recall Engram context for a query.",
|
|
129
|
-
inputSchema: {
|
|
130
|
-
type: "object",
|
|
131
|
-
properties: {
|
|
132
|
-
query: { type: "string" },
|
|
133
|
-
sessionKey: { type: "string" },
|
|
134
|
-
namespace: { type: "string" },
|
|
135
|
-
topK: { type: "number" },
|
|
136
|
-
mode: { type: "string", enum: ["auto", "no_recall", "minimal", "full", "graph_mode"] },
|
|
137
|
-
includeDebug: { type: "boolean" },
|
|
138
|
-
// Recall disclosure depth (issue #677). Default `chunk` when
|
|
139
|
-
// omitted. Section/raw payload shaping ships in PR 2; this PR
|
|
140
|
-
// wires the field end-to-end so clients can already pass it
|
|
141
|
-
// without it being silently dropped.
|
|
142
|
-
disclosure: { type: "string", enum: ["chunk", "section", "raw"] },
|
|
143
|
-
cwd: { type: "string", description: "Working directory for auto git-context resolution." },
|
|
144
|
-
projectTag: { type: "string", description: "Project tag for non-git project scoping (e.g. 'blend-supply')." },
|
|
145
|
-
asOf: {
|
|
146
|
-
type: "string",
|
|
147
|
-
description: "Historical recall pin (issue #680). ISO 8601 timestamp; when set, the recall returns the corpus as it existed at this instant."
|
|
148
|
-
},
|
|
149
|
-
tags: {
|
|
150
|
-
type: "array",
|
|
151
|
-
items: { type: "string" },
|
|
152
|
-
description: "Filter recall results to memories whose frontmatter tags match (issue #689)."
|
|
153
|
-
},
|
|
154
|
-
tagMatch: {
|
|
155
|
-
type: "string",
|
|
156
|
-
enum: ["any", "all"],
|
|
157
|
-
description: "Tag-filter match mode. 'any' (default) admits results with at least one filter tag; 'all' requires every filter tag."
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
required: ["query"],
|
|
161
|
-
additionalProperties: false
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
name: "engram.recall_explain",
|
|
166
|
-
description: "Return the last recall snapshot for a session or the most recent one.",
|
|
167
|
-
inputSchema: {
|
|
168
|
-
type: "object",
|
|
169
|
-
properties: {
|
|
170
|
-
sessionKey: { type: "string" },
|
|
171
|
-
namespace: { type: "string" }
|
|
172
|
-
},
|
|
173
|
-
additionalProperties: false
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
name: "engram.set_coding_context",
|
|
178
|
-
description: "Attach a coding-agent context (project / branch) to a session so recall routes to a project- / branch-scoped namespace (issue #569). For MCP clients that do not ship cwd automatically (Cursor, generic agents, etc.). Also aliased as remnic.set_coding_context. Pass codingContext: null to clear. Alternatively, pass just a projectTag for non-git project scoping (e.g. OpenClaw channels).",
|
|
179
|
-
inputSchema: {
|
|
180
|
-
type: "object",
|
|
181
|
-
properties: {
|
|
182
|
-
sessionKey: {
|
|
183
|
-
type: "string",
|
|
184
|
-
description: "Session identifier the context should attach to."
|
|
185
|
-
},
|
|
186
|
-
codingContext: {
|
|
187
|
-
anyOf: [
|
|
188
|
-
{ type: "null" },
|
|
189
|
-
{
|
|
190
|
-
type: "object",
|
|
191
|
-
properties: {
|
|
192
|
-
projectId: { type: "string", description: "Stable project id (origin:<hex> or root:<hex>)." },
|
|
193
|
-
branch: { type: ["string", "null"], description: "Current branch, or null in detached HEAD." },
|
|
194
|
-
rootPath: { type: "string", description: "Absolute path to the repo root." },
|
|
195
|
-
defaultBranch: { type: ["string", "null"], description: "Default branch (usually main/master), or null when unknown." }
|
|
196
|
-
},
|
|
197
|
-
required: ["projectId", "branch", "rootPath", "defaultBranch"],
|
|
198
|
-
additionalProperties: false
|
|
199
|
-
}
|
|
200
|
-
],
|
|
201
|
-
description: "The context to attach, or null to clear. Omit when using projectTag instead."
|
|
202
|
-
},
|
|
203
|
-
projectTag: {
|
|
204
|
-
type: "string",
|
|
205
|
-
description: "Arbitrary project tag for non-git project scoping (e.g. 'blend-supply'). Creates a coding context with projectId 'tag:<projectTag>'. Use instead of codingContext when the session isn't tied to a specific git repo."
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
required: ["sessionKey"],
|
|
209
|
-
additionalProperties: false
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
name: "engram.recall_tier_explain",
|
|
214
|
-
description: "Return a structured tier-explain payload for the last direct-answer-eligible recall (issue #518). Orthogonal to engram.recall_explain, which returns a graph-path explanation.",
|
|
215
|
-
inputSchema: {
|
|
216
|
-
type: "object",
|
|
217
|
-
properties: {
|
|
218
|
-
sessionKey: {
|
|
219
|
-
type: "string",
|
|
220
|
-
description: "Optional session key. Omit to read the most recent snapshot."
|
|
221
|
-
},
|
|
222
|
-
namespace: {
|
|
223
|
-
type: "string",
|
|
224
|
-
description: "Optional namespace to scope the returned snapshot."
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
additionalProperties: false
|
|
228
|
-
}
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
// Registered as `engram.recall_xray`; `withToolAliases` below
|
|
232
|
-
// emits the canonical `remnic.recall_xray` alias automatically
|
|
233
|
-
// (dual-naming invariant for every new MCP tool).
|
|
234
|
-
name: "engram.recall_xray",
|
|
235
|
-
description: "Run a recall with X-ray capture enabled and return the unified per-result attribution snapshot (tier + audit + MMR + filters in one view). Issue #570.",
|
|
236
|
-
inputSchema: {
|
|
237
|
-
type: "object",
|
|
238
|
-
properties: {
|
|
239
|
-
query: {
|
|
240
|
-
type: "string",
|
|
241
|
-
description: "Query to recall against. Required; non-empty."
|
|
242
|
-
},
|
|
243
|
-
sessionKey: {
|
|
244
|
-
type: "string",
|
|
245
|
-
description: "Optional session key to scope the recall."
|
|
246
|
-
},
|
|
247
|
-
namespace: {
|
|
248
|
-
type: "string",
|
|
249
|
-
description: "Optional namespace. Enforced against the caller's principal; a mismatch yields snapshotFound:false."
|
|
250
|
-
},
|
|
251
|
-
budget: {
|
|
252
|
-
type: "integer",
|
|
253
|
-
minimum: 1,
|
|
254
|
-
description: "Optional positive-integer override for the recall character budget."
|
|
255
|
-
},
|
|
256
|
-
disclosure: {
|
|
257
|
-
type: "string",
|
|
258
|
-
enum: ["chunk", "section", "raw"],
|
|
259
|
-
description: "Optional disclosure depth for X-ray telemetry (issue #677). When set, populates the per-disclosure token-spend summary on each result."
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
|
-
required: ["query"],
|
|
263
|
-
additionalProperties: false
|
|
264
|
-
}
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
name: "engram.action_confidence",
|
|
268
|
-
description: "Advisory ask/draft/act/refuse/escalate decision helper for interruption budgeting. Read-only; never mutates memory.",
|
|
269
|
-
inputSchema: {
|
|
270
|
-
type: "object",
|
|
271
|
-
properties: {
|
|
272
|
-
intendedAction: { type: "string" },
|
|
273
|
-
confidence: { type: "number", minimum: 0, maximum: 1 },
|
|
274
|
-
risk: {
|
|
275
|
-
type: "string",
|
|
276
|
-
enum: ["low", "medium", "high", "irreversible", "restricted"]
|
|
277
|
-
},
|
|
278
|
-
contextReadiness: {
|
|
279
|
-
type: "string",
|
|
280
|
-
enum: ["none", "partial", "sufficient"]
|
|
281
|
-
},
|
|
282
|
-
currentContextScopes: {
|
|
283
|
-
type: "array",
|
|
284
|
-
items: { type: "string" }
|
|
285
|
-
},
|
|
286
|
-
userRules: {
|
|
287
|
-
type: "array",
|
|
288
|
-
items: {
|
|
289
|
-
type: "object",
|
|
290
|
-
properties: {
|
|
291
|
-
kind: {
|
|
292
|
-
type: "string",
|
|
293
|
-
enum: [
|
|
294
|
-
"ask-before",
|
|
295
|
-
"do-not-use-outside-this-context",
|
|
296
|
-
"never",
|
|
297
|
-
"requires-escalation"
|
|
298
|
-
]
|
|
299
|
-
},
|
|
300
|
-
description: { type: "string" },
|
|
301
|
-
matched: { type: "boolean" }
|
|
302
|
-
},
|
|
303
|
-
required: ["kind"],
|
|
304
|
-
additionalProperties: false
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
retrievedMemories: {
|
|
308
|
-
type: "array",
|
|
309
|
-
items: {
|
|
310
|
-
type: "object",
|
|
311
|
-
properties: {
|
|
312
|
-
source: { type: "string" },
|
|
313
|
-
created: { type: "string" },
|
|
314
|
-
updated: { type: "string" },
|
|
315
|
-
scope: { type: "string" },
|
|
316
|
-
userContextScopes: {
|
|
317
|
-
type: "array",
|
|
318
|
-
items: { type: "string" }
|
|
319
|
-
},
|
|
320
|
-
retrievalReason: { type: "string" },
|
|
321
|
-
confidence: { type: "number", minimum: 0, maximum: 1 },
|
|
322
|
-
stale: { type: "boolean" },
|
|
323
|
-
corrected: { type: "boolean" },
|
|
324
|
-
correctionState: {
|
|
325
|
-
type: "string",
|
|
326
|
-
enum: ["none", "correction", "superseded", "disputed", "forgotten"]
|
|
327
|
-
},
|
|
328
|
-
safeToUse: { type: "boolean" },
|
|
329
|
-
safety: {
|
|
330
|
-
type: "string",
|
|
331
|
-
enum: ["safe", "requires-review", "blocked"]
|
|
332
|
-
},
|
|
333
|
-
safetyReasons: {
|
|
334
|
-
type: "array",
|
|
335
|
-
items: { type: "string" }
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
additionalProperties: false
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
},
|
|
342
|
-
additionalProperties: false
|
|
343
|
-
}
|
|
344
|
-
},
|
|
345
|
-
{
|
|
346
|
-
name: REMNIC_CHATGPT_MEMORY_INSPECTOR_TOOL,
|
|
347
|
-
title: "Show Remnic Memory Inspector",
|
|
348
|
-
description: "Use this when the user wants a ChatGPT Apps-compatible UI for inspecting Remnic recall, provenance, safety, and correction/forget/scoping affordances. Read-only; correction and forget actions are proposed as follow-up prompts.",
|
|
349
|
-
inputSchema: {
|
|
350
|
-
type: "object",
|
|
351
|
-
properties: {
|
|
352
|
-
query: {
|
|
353
|
-
type: "string",
|
|
354
|
-
description: "Memory question to inspect."
|
|
355
|
-
},
|
|
356
|
-
sessionKey: {
|
|
357
|
-
type: "string",
|
|
358
|
-
description: "Optional Remnic session key for scoped recall."
|
|
359
|
-
},
|
|
360
|
-
namespace: {
|
|
361
|
-
type: "string",
|
|
362
|
-
description: "Optional Remnic namespace to inspect."
|
|
363
|
-
},
|
|
364
|
-
currentContextScopes: {
|
|
365
|
-
type: "array",
|
|
366
|
-
items: { type: "string" },
|
|
367
|
-
description: "Optional current user-context scopes, such as repo, work, personal, client, or private."
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
required: ["query"],
|
|
371
|
-
additionalProperties: false
|
|
372
|
-
},
|
|
373
|
-
outputSchema: {
|
|
374
|
-
type: "object",
|
|
375
|
-
properties: {
|
|
376
|
-
app: { type: "object" },
|
|
377
|
-
query: { type: "string" },
|
|
378
|
-
sessionKey: { type: "string" },
|
|
379
|
-
namespace: { type: "string" },
|
|
380
|
-
safeRecallPreview: { type: "string" },
|
|
381
|
-
memoryCount: { type: "number" },
|
|
382
|
-
memoryIds: { type: "array", items: { type: "string" } },
|
|
383
|
-
memories: { type: "array", items: { type: "object" } },
|
|
384
|
-
actionConfidence: { type: "object" },
|
|
385
|
-
affordances: { type: "array", items: { type: "object" } },
|
|
386
|
-
guidance: { type: "object" }
|
|
387
|
-
},
|
|
388
|
-
required: [
|
|
389
|
-
"app",
|
|
390
|
-
"query",
|
|
391
|
-
"namespace",
|
|
392
|
-
"safeRecallPreview",
|
|
393
|
-
"memoryCount",
|
|
394
|
-
"memoryIds",
|
|
395
|
-
"memories",
|
|
396
|
-
"actionConfidence",
|
|
397
|
-
"affordances",
|
|
398
|
-
"guidance"
|
|
399
|
-
],
|
|
400
|
-
additionalProperties: false
|
|
401
|
-
},
|
|
402
|
-
annotations: {
|
|
403
|
-
readOnlyHint: true,
|
|
404
|
-
destructiveHint: false,
|
|
405
|
-
idempotentHint: true,
|
|
406
|
-
openWorldHint: false
|
|
407
|
-
},
|
|
408
|
-
_meta: {
|
|
409
|
-
ui: {
|
|
410
|
-
resourceUri: REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
|
|
411
|
-
visibility: ["model", "app"]
|
|
412
|
-
},
|
|
413
|
-
"openai/outputTemplate": REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
|
|
414
|
-
"openai/toolInvocation/invoking": "Inspecting Remnic memory...",
|
|
415
|
-
"openai/toolInvocation/invoked": "Remnic memory inspector ready."
|
|
416
|
-
}
|
|
417
|
-
},
|
|
418
|
-
{
|
|
419
|
-
name: "engram.day_summary",
|
|
420
|
-
description: "Generate a structured end-of-day summary. When memories is omitted or empty, auto-gathers today's facts and hourly summaries from storage.",
|
|
421
|
-
inputSchema: {
|
|
422
|
-
type: "object",
|
|
423
|
-
properties: {
|
|
424
|
-
memories: { type: "string" },
|
|
425
|
-
sessionKey: { type: "string" },
|
|
426
|
-
namespace: { type: "string" }
|
|
427
|
-
},
|
|
428
|
-
required: [],
|
|
429
|
-
additionalProperties: false
|
|
430
|
-
}
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
name: "engram.capsule_export",
|
|
434
|
-
description: "Export a portable Remnic capsule archive from the namespace-scoped memory store.",
|
|
435
|
-
inputSchema: {
|
|
436
|
-
type: "object",
|
|
437
|
-
properties: {
|
|
438
|
-
name: {
|
|
439
|
-
type: "string",
|
|
440
|
-
description: "Capsule id (alphanumeric with single dashes, max 64 characters)."
|
|
441
|
-
},
|
|
442
|
-
namespace: { type: "string" },
|
|
443
|
-
since: {
|
|
444
|
-
type: "string",
|
|
445
|
-
description: "Only include files modified on or after this ISO 8601 timestamp."
|
|
446
|
-
},
|
|
447
|
-
includeKinds: {
|
|
448
|
-
type: "array",
|
|
449
|
-
items: { type: "string" },
|
|
450
|
-
description: "Optional top-level directory allow-list."
|
|
451
|
-
},
|
|
452
|
-
peerIds: {
|
|
453
|
-
type: "array",
|
|
454
|
-
items: { type: "string" },
|
|
455
|
-
description: "Optional peer id allow-list for the peers/ subtree."
|
|
456
|
-
},
|
|
457
|
-
includeTranscripts: { type: "boolean" },
|
|
458
|
-
encrypt: { type: "boolean" }
|
|
459
|
-
},
|
|
460
|
-
required: ["name"],
|
|
461
|
-
additionalProperties: false
|
|
462
|
-
}
|
|
463
|
-
},
|
|
464
|
-
{
|
|
465
|
-
name: "engram.capsule_import",
|
|
466
|
-
description: "Import a Remnic capsule archive into the namespace-scoped memory store.",
|
|
467
|
-
inputSchema: {
|
|
468
|
-
type: "object",
|
|
469
|
-
properties: {
|
|
470
|
-
archivePath: {
|
|
471
|
-
type: "string",
|
|
472
|
-
description: "Path to a .capsule.json.gz or .capsule.json.gz.enc archive."
|
|
473
|
-
},
|
|
474
|
-
namespace: { type: "string" },
|
|
475
|
-
mode: {
|
|
476
|
-
type: "string",
|
|
477
|
-
enum: ["skip", "overwrite", "fork"],
|
|
478
|
-
description: "Conflict handling mode. Defaults to skip."
|
|
479
|
-
}
|
|
480
|
-
},
|
|
481
|
-
required: ["archivePath"],
|
|
482
|
-
additionalProperties: false
|
|
483
|
-
}
|
|
484
|
-
},
|
|
485
|
-
{
|
|
486
|
-
name: "engram.capsule_list",
|
|
487
|
-
description: "List capsule archives in the namespace-scoped capsule store.",
|
|
488
|
-
inputSchema: {
|
|
489
|
-
type: "object",
|
|
490
|
-
properties: {
|
|
491
|
-
namespace: { type: "string" }
|
|
492
|
-
},
|
|
493
|
-
additionalProperties: false
|
|
494
|
-
}
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
name: "engram.memory_governance_run",
|
|
498
|
-
description: "Run Remnic memory governance in a bounded shadow/apply pass.",
|
|
499
|
-
inputSchema: {
|
|
500
|
-
type: "object",
|
|
501
|
-
properties: {
|
|
502
|
-
namespace: { type: "string" },
|
|
503
|
-
mode: { type: "string", enum: ["shadow", "apply"] },
|
|
504
|
-
recentDays: { type: "number" },
|
|
505
|
-
maxMemories: { type: "number" },
|
|
506
|
-
batchSize: { type: "number" }
|
|
507
|
-
},
|
|
508
|
-
additionalProperties: false
|
|
509
|
-
}
|
|
510
|
-
},
|
|
511
|
-
{
|
|
512
|
-
name: "engram.procedure_mining_run",
|
|
513
|
-
description: "Run procedural memory mining from causal trajectories (issue #519). Respects procedural.enabled; writes under procedures/ when clusters qualify.",
|
|
514
|
-
inputSchema: {
|
|
515
|
-
type: "object",
|
|
516
|
-
properties: {
|
|
517
|
-
namespace: { type: "string" }
|
|
518
|
-
},
|
|
519
|
-
additionalProperties: false
|
|
520
|
-
}
|
|
521
|
-
},
|
|
522
|
-
{
|
|
523
|
-
name: "engram.pattern_reinforcement_run",
|
|
524
|
-
description: "Run the pattern-reinforcement maintenance job (issue #687 PR 2/4). Clusters duplicate non-procedural memories by normalized content, promotes the most-recent member to canonical, and supersedes the older duplicates. Gated on patternReinforcementEnabled and the patternReinforcementCadenceMs floor \u2014 pass force=true to bypass the cadence for an ad-hoc operator run.",
|
|
525
|
-
inputSchema: {
|
|
526
|
-
type: "object",
|
|
527
|
-
properties: {
|
|
528
|
-
namespace: { type: "string" },
|
|
529
|
-
force: { type: "boolean" }
|
|
530
|
-
},
|
|
531
|
-
additionalProperties: false
|
|
532
|
-
}
|
|
533
|
-
},
|
|
534
|
-
{
|
|
535
|
-
// The canonical `remnic.procedural_stats` alias is added automatically
|
|
536
|
-
// by `withToolAliases` — the dual-naming invariant keeps both names
|
|
537
|
-
// alive for the legacy surface.
|
|
538
|
-
name: "engram.procedural_stats",
|
|
539
|
-
description: "Procedural memory stats (issue #567): counts by status, recent write activity, and the active procedural.* config. Read-only, namespace-scoped.",
|
|
540
|
-
inputSchema: {
|
|
541
|
-
type: "object",
|
|
542
|
-
properties: {
|
|
543
|
-
namespace: { type: "string" }
|
|
544
|
-
},
|
|
545
|
-
additionalProperties: false
|
|
546
|
-
}
|
|
547
|
-
},
|
|
548
|
-
{
|
|
549
|
-
name: "engram.memory_get",
|
|
550
|
-
description: "Fetch one Remnic memory by id.",
|
|
551
|
-
inputSchema: {
|
|
552
|
-
type: "object",
|
|
553
|
-
properties: {
|
|
554
|
-
memoryId: { type: "string" },
|
|
555
|
-
namespace: { type: "string" }
|
|
556
|
-
},
|
|
557
|
-
required: ["memoryId"],
|
|
558
|
-
additionalProperties: false
|
|
559
|
-
}
|
|
560
|
-
},
|
|
561
|
-
{
|
|
562
|
-
name: "engram.memory_timeline",
|
|
563
|
-
description: "Fetch one Remnic memory timeline by id.",
|
|
564
|
-
inputSchema: {
|
|
565
|
-
type: "object",
|
|
566
|
-
properties: {
|
|
567
|
-
memoryId: { type: "string" },
|
|
568
|
-
namespace: { type: "string" },
|
|
569
|
-
limit: { type: "number" }
|
|
570
|
-
},
|
|
571
|
-
required: ["memoryId"],
|
|
572
|
-
additionalProperties: false
|
|
573
|
-
}
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
name: "engram.memory_store",
|
|
577
|
-
description: "Store an explicit Remnic memory through the access layer.",
|
|
578
|
-
inputSchema: {
|
|
579
|
-
type: "object",
|
|
580
|
-
properties: {
|
|
581
|
-
schemaVersion: { type: "number" },
|
|
582
|
-
idempotencyKey: { type: "string" },
|
|
583
|
-
dryRun: { type: "boolean" },
|
|
584
|
-
sessionKey: { type: "string" },
|
|
585
|
-
content: { type: "string" },
|
|
586
|
-
category: { type: "string" },
|
|
587
|
-
confidence: { type: "number" },
|
|
588
|
-
namespace: { type: "string" },
|
|
589
|
-
tags: { type: "array", items: { type: "string" } },
|
|
590
|
-
entityRef: { type: "string" },
|
|
591
|
-
ttl: { type: "string" },
|
|
592
|
-
sourceReason: { type: "string" }
|
|
593
|
-
},
|
|
594
|
-
required: ["content"],
|
|
595
|
-
additionalProperties: false
|
|
596
|
-
}
|
|
597
|
-
},
|
|
598
|
-
{
|
|
599
|
-
name: "engram.suggestion_submit",
|
|
600
|
-
description: "Queue a suggested Remnic memory for review.",
|
|
601
|
-
inputSchema: {
|
|
602
|
-
type: "object",
|
|
603
|
-
properties: {
|
|
604
|
-
schemaVersion: { type: "number" },
|
|
605
|
-
idempotencyKey: { type: "string" },
|
|
606
|
-
dryRun: { type: "boolean" },
|
|
607
|
-
sessionKey: { type: "string" },
|
|
608
|
-
content: { type: "string" },
|
|
609
|
-
category: { type: "string" },
|
|
610
|
-
confidence: { type: "number" },
|
|
611
|
-
namespace: { type: "string" },
|
|
612
|
-
tags: { type: "array", items: { type: "string" } },
|
|
613
|
-
entityRef: { type: "string" },
|
|
614
|
-
ttl: { type: "string" },
|
|
615
|
-
sourceReason: { type: "string" }
|
|
616
|
-
},
|
|
617
|
-
required: ["content"],
|
|
618
|
-
additionalProperties: false
|
|
619
|
-
}
|
|
620
|
-
},
|
|
621
|
-
{
|
|
622
|
-
name: "engram.entity_get",
|
|
623
|
-
description: "Fetch one Engram entity by name.",
|
|
624
|
-
inputSchema: {
|
|
625
|
-
type: "object",
|
|
626
|
-
properties: {
|
|
627
|
-
name: { type: "string" },
|
|
628
|
-
namespace: { type: "string" }
|
|
629
|
-
},
|
|
630
|
-
required: ["name"],
|
|
631
|
-
additionalProperties: false
|
|
632
|
-
}
|
|
633
|
-
},
|
|
634
|
-
{
|
|
635
|
-
name: "engram.review_queue_list",
|
|
636
|
-
description: "Fetch the latest Engram review queue artifact bundle.",
|
|
637
|
-
inputSchema: {
|
|
638
|
-
type: "object",
|
|
639
|
-
properties: {
|
|
640
|
-
runId: { type: "string" },
|
|
641
|
-
namespace: { type: "string" }
|
|
642
|
-
},
|
|
643
|
-
additionalProperties: false
|
|
644
|
-
}
|
|
645
|
-
},
|
|
646
|
-
{
|
|
647
|
-
name: "engram.observe",
|
|
648
|
-
description: "Feed conversation messages into Engram's memory pipeline (LCM archive + extraction).",
|
|
649
|
-
inputSchema: {
|
|
650
|
-
type: "object",
|
|
651
|
-
properties: {
|
|
652
|
-
sessionKey: { type: "string", description: "Conversation session identifier" },
|
|
653
|
-
messages: {
|
|
654
|
-
type: "array",
|
|
655
|
-
items: {
|
|
656
|
-
type: "object",
|
|
657
|
-
properties: {
|
|
658
|
-
role: { type: "string", enum: ["user", "assistant"] },
|
|
659
|
-
content: { type: "string" },
|
|
660
|
-
sourceFormat: {
|
|
661
|
-
type: "string",
|
|
662
|
-
enum: ["openai", "anthropic", "openclaw", "pi", "lossless-claw", "remnic"]
|
|
663
|
-
},
|
|
664
|
-
rawContent: {
|
|
665
|
-
description: "Optional native provider content blocks for structured message-part capture."
|
|
666
|
-
},
|
|
667
|
-
parts: {
|
|
668
|
-
type: "array",
|
|
669
|
-
description: "Optional normalized Remnic LCM message parts.",
|
|
670
|
-
items: {
|
|
671
|
-
type: "object",
|
|
672
|
-
properties: {
|
|
673
|
-
ordinal: { type: ["number", "null"], minimum: 0 },
|
|
674
|
-
kind: {
|
|
675
|
-
type: "string",
|
|
676
|
-
enum: [
|
|
677
|
-
"text",
|
|
678
|
-
"tool_call",
|
|
679
|
-
"tool_result",
|
|
680
|
-
"patch",
|
|
681
|
-
"file_read",
|
|
682
|
-
"file_write",
|
|
683
|
-
"step_start",
|
|
684
|
-
"step_finish",
|
|
685
|
-
"snapshot",
|
|
686
|
-
"retry"
|
|
687
|
-
]
|
|
688
|
-
},
|
|
689
|
-
payload: { type: "object", additionalProperties: true },
|
|
690
|
-
toolName: { type: ["string", "null"] },
|
|
691
|
-
tool_name: { type: ["string", "null"] },
|
|
692
|
-
filePath: { type: ["string", "null"] },
|
|
693
|
-
file_path: { type: ["string", "null"] },
|
|
694
|
-
createdAt: { type: ["string", "null"] },
|
|
695
|
-
created_at: { type: ["string", "null"] }
|
|
696
|
-
},
|
|
697
|
-
required: ["kind", "payload"],
|
|
698
|
-
additionalProperties: false
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
},
|
|
702
|
-
required: ["role", "content"],
|
|
703
|
-
additionalProperties: false
|
|
704
|
-
},
|
|
705
|
-
description: "Conversation messages to observe"
|
|
706
|
-
},
|
|
707
|
-
namespace: { type: "string" },
|
|
708
|
-
skipExtraction: { type: "boolean" },
|
|
709
|
-
cwd: { type: "string", description: "Working directory for auto git-context resolution." },
|
|
710
|
-
projectTag: { type: "string", description: "Project tag for non-git project scoping (e.g. 'blend-supply')." }
|
|
711
|
-
},
|
|
712
|
-
required: ["sessionKey", "messages"],
|
|
713
|
-
additionalProperties: false
|
|
714
|
-
}
|
|
715
|
-
},
|
|
716
|
-
{
|
|
717
|
-
name: "engram.lcm_search",
|
|
718
|
-
description: "Search the LCM conversation archive for matching content.",
|
|
719
|
-
inputSchema: {
|
|
720
|
-
type: "object",
|
|
721
|
-
properties: {
|
|
722
|
-
query: { type: "string", description: "Search query" },
|
|
723
|
-
sessionKey: { type: "string", description: "Optional session filter" },
|
|
724
|
-
namespace: { type: "string" },
|
|
725
|
-
limit: { type: "number", description: "Max results to return" }
|
|
726
|
-
},
|
|
727
|
-
required: ["query"],
|
|
728
|
-
additionalProperties: false
|
|
729
|
-
}
|
|
730
|
-
},
|
|
731
|
-
{
|
|
732
|
-
name: "engram.lcm_compaction_flush",
|
|
733
|
-
description: "Flush pending LCM observe work and incremental summaries before a host compacts session context.",
|
|
734
|
-
inputSchema: {
|
|
735
|
-
type: "object",
|
|
736
|
-
properties: {
|
|
737
|
-
sessionKey: { type: "string", description: "Conversation session identifier" },
|
|
738
|
-
namespace: { type: "string" }
|
|
739
|
-
},
|
|
740
|
-
required: ["sessionKey"],
|
|
741
|
-
additionalProperties: false
|
|
742
|
-
}
|
|
743
|
-
},
|
|
744
|
-
{
|
|
745
|
-
name: "engram.lcm_compaction_record",
|
|
746
|
-
description: "Record a host compaction event with before/after token counts in the LCM archive.",
|
|
747
|
-
inputSchema: {
|
|
748
|
-
type: "object",
|
|
749
|
-
properties: {
|
|
750
|
-
sessionKey: { type: "string", description: "Conversation session identifier" },
|
|
751
|
-
namespace: { type: "string" },
|
|
752
|
-
tokensBefore: { type: "integer", minimum: 0 },
|
|
753
|
-
tokensAfter: { type: "integer", minimum: 0 }
|
|
754
|
-
},
|
|
755
|
-
required: ["sessionKey", "tokensBefore", "tokensAfter"],
|
|
756
|
-
additionalProperties: false
|
|
757
|
-
}
|
|
758
|
-
},
|
|
759
|
-
// ── Continuity / Identity tools ─────────────────────────────────────
|
|
760
|
-
{
|
|
761
|
-
name: "engram.continuity_audit_generate",
|
|
762
|
-
description: "Generate a deterministic identity continuity audit report (weekly/monthly).",
|
|
763
|
-
inputSchema: {
|
|
764
|
-
type: "object",
|
|
765
|
-
properties: {
|
|
766
|
-
period: { type: "string", enum: ["weekly", "monthly"] },
|
|
767
|
-
key: { type: "string", description: "Period key (weekly: YYYY-Www, monthly: YYYY-MM). Defaults to current." }
|
|
768
|
-
},
|
|
769
|
-
additionalProperties: false
|
|
770
|
-
}
|
|
771
|
-
},
|
|
772
|
-
{
|
|
773
|
-
name: "engram.continuity_incident_open",
|
|
774
|
-
description: "Create a new continuity incident record in append-only storage.",
|
|
775
|
-
inputSchema: {
|
|
776
|
-
type: "object",
|
|
777
|
-
properties: {
|
|
778
|
-
symptom: { type: "string", description: "Observed continuity failure symptom." },
|
|
779
|
-
namespace: { type: "string" },
|
|
780
|
-
triggerWindow: { type: "string", description: "Time window when incident occurred." },
|
|
781
|
-
suspectedCause: { type: "string" }
|
|
782
|
-
},
|
|
783
|
-
required: ["symptom"],
|
|
784
|
-
additionalProperties: false
|
|
785
|
-
}
|
|
786
|
-
},
|
|
787
|
-
{
|
|
788
|
-
name: "engram.continuity_incident_close",
|
|
789
|
-
description: "Close an open continuity incident with verification details.",
|
|
790
|
-
inputSchema: {
|
|
791
|
-
type: "object",
|
|
792
|
-
properties: {
|
|
793
|
-
id: { type: "string", description: "Incident ID to close." },
|
|
794
|
-
namespace: { type: "string" },
|
|
795
|
-
fixApplied: { type: "string", description: "What fix was applied." },
|
|
796
|
-
verificationResult: { type: "string", description: "How closure was verified." },
|
|
797
|
-
preventiveRule: { type: "string", description: "Optional preventive follow-up rule." }
|
|
798
|
-
},
|
|
799
|
-
required: ["id", "fixApplied", "verificationResult"],
|
|
800
|
-
additionalProperties: false
|
|
801
|
-
}
|
|
802
|
-
},
|
|
803
|
-
{
|
|
804
|
-
name: "engram.continuity_incident_list",
|
|
805
|
-
description: "List continuity incidents, optionally filtered by state.",
|
|
806
|
-
inputSchema: {
|
|
807
|
-
type: "object",
|
|
808
|
-
properties: {
|
|
809
|
-
state: { type: "string", enum: ["open", "closed", "all"] },
|
|
810
|
-
namespace: { type: "string" },
|
|
811
|
-
limit: { type: "number", description: "Max incidents (default 25, max 200)." }
|
|
812
|
-
},
|
|
813
|
-
additionalProperties: false
|
|
814
|
-
}
|
|
815
|
-
},
|
|
816
|
-
{
|
|
817
|
-
name: "engram.continuity_loop_add_or_update",
|
|
818
|
-
description: "Add or update a continuity improvement loop entry.",
|
|
819
|
-
inputSchema: {
|
|
820
|
-
type: "object",
|
|
821
|
-
properties: {
|
|
822
|
-
id: { type: "string", description: "Stable loop identifier." },
|
|
823
|
-
cadence: { type: "string", enum: ["daily", "weekly", "monthly", "quarterly"] },
|
|
824
|
-
purpose: { type: "string", description: "What this recurring loop improves." },
|
|
825
|
-
status: { type: "string", enum: ["active", "paused", "retired"] },
|
|
826
|
-
killCondition: { type: "string", description: "Clear condition for retiring this loop." },
|
|
827
|
-
namespace: { type: "string" },
|
|
828
|
-
lastReviewed: { type: "string", description: "ISO timestamp for last review." },
|
|
829
|
-
notes: { type: "string" }
|
|
830
|
-
},
|
|
831
|
-
required: ["id", "cadence", "purpose", "status", "killCondition"],
|
|
832
|
-
additionalProperties: false
|
|
833
|
-
}
|
|
834
|
-
},
|
|
835
|
-
{
|
|
836
|
-
name: "engram.continuity_loop_review",
|
|
837
|
-
description: "Update review metadata for an existing continuity improvement loop.",
|
|
838
|
-
inputSchema: {
|
|
839
|
-
type: "object",
|
|
840
|
-
properties: {
|
|
841
|
-
id: { type: "string", description: "Loop ID to review." },
|
|
842
|
-
namespace: { type: "string" },
|
|
843
|
-
status: { type: "string", enum: ["active", "paused", "retired"] },
|
|
844
|
-
notes: { type: "string" },
|
|
845
|
-
reviewedAt: { type: "string", description: "ISO timestamp for review event." }
|
|
846
|
-
},
|
|
847
|
-
required: ["id"],
|
|
848
|
-
additionalProperties: false
|
|
849
|
-
}
|
|
850
|
-
},
|
|
851
|
-
{
|
|
852
|
-
name: "engram.identity_anchor_get",
|
|
853
|
-
description: "Read the identity continuity anchor document (recovery-safe identity context).",
|
|
854
|
-
inputSchema: {
|
|
855
|
-
type: "object",
|
|
856
|
-
properties: {
|
|
857
|
-
namespace: { type: "string" }
|
|
858
|
-
},
|
|
859
|
-
additionalProperties: false
|
|
860
|
-
}
|
|
861
|
-
},
|
|
862
|
-
{
|
|
863
|
-
name: "engram.identity_anchor_update",
|
|
864
|
-
description: "Conservatively merge identity anchor sections without overwriting existing material.",
|
|
865
|
-
inputSchema: {
|
|
866
|
-
type: "object",
|
|
867
|
-
properties: {
|
|
868
|
-
namespace: { type: "string" },
|
|
869
|
-
identityTraits: { type: "string", description: "Updates for 'Identity Traits' section." },
|
|
870
|
-
communicationPreferences: { type: "string", description: "Updates for 'Communication Preferences' section." },
|
|
871
|
-
operatingPrinciples: { type: "string", description: "Updates for 'Operating Principles' section." },
|
|
872
|
-
continuityNotes: { type: "string", description: "Updates for 'Continuity Notes' section." }
|
|
873
|
-
},
|
|
874
|
-
additionalProperties: false
|
|
875
|
-
}
|
|
876
|
-
},
|
|
877
|
-
{
|
|
878
|
-
name: "engram.memory_identity",
|
|
879
|
-
description: "Read the agent's identity reflections from the workspace IDENTITY.md file.",
|
|
880
|
-
inputSchema: {
|
|
881
|
-
type: "object",
|
|
882
|
-
properties: {
|
|
883
|
-
namespace: { type: "string" }
|
|
884
|
-
},
|
|
885
|
-
additionalProperties: false
|
|
886
|
-
}
|
|
887
|
-
},
|
|
888
|
-
// ── Work Layer tools ─────────────────────────────────────────────────
|
|
889
|
-
{
|
|
890
|
-
name: "engram.work_task",
|
|
891
|
-
description: "Manage work-layer tasks (create, get, list, update, transition, delete). Excluded from memory extraction.",
|
|
892
|
-
inputSchema: {
|
|
893
|
-
type: "object",
|
|
894
|
-
properties: {
|
|
895
|
-
action: { type: "string", enum: ["create", "get", "list", "update", "transition", "delete"] },
|
|
896
|
-
id: { type: "string" },
|
|
897
|
-
title: { type: "string" },
|
|
898
|
-
description: { type: "string" },
|
|
899
|
-
status: { type: "string", enum: ["todo", "in_progress", "blocked", "done", "cancelled"] },
|
|
900
|
-
priority: { type: "string", enum: ["low", "medium", "high"] },
|
|
901
|
-
owner: { type: "string" },
|
|
902
|
-
assignee: { type: "string" },
|
|
903
|
-
projectId: { type: "string" },
|
|
904
|
-
tags: { type: "array", items: { type: "string" } },
|
|
905
|
-
dueAt: { type: "string" }
|
|
906
|
-
},
|
|
907
|
-
required: ["action"],
|
|
908
|
-
additionalProperties: false
|
|
909
|
-
}
|
|
910
|
-
},
|
|
911
|
-
{
|
|
912
|
-
name: "engram.work_project",
|
|
913
|
-
description: "Manage work-layer projects (create, get, list, update, delete, link_task). Excluded from memory extraction.",
|
|
914
|
-
inputSchema: {
|
|
915
|
-
type: "object",
|
|
916
|
-
properties: {
|
|
917
|
-
action: { type: "string", enum: ["create", "get", "list", "update", "delete", "link_task"] },
|
|
918
|
-
id: { type: "string" },
|
|
919
|
-
name: { type: "string" },
|
|
920
|
-
description: { type: "string" },
|
|
921
|
-
status: { type: "string", enum: ["active", "on_hold", "completed", "archived"] },
|
|
922
|
-
owner: { type: "string" },
|
|
923
|
-
tags: { type: "array", items: { type: "string" } },
|
|
924
|
-
taskId: { type: "string", description: "Task ID for link_task." },
|
|
925
|
-
projectId: { type: "string", description: "Project ID for link_task." }
|
|
926
|
-
},
|
|
927
|
-
required: ["action"],
|
|
928
|
-
additionalProperties: false
|
|
929
|
-
}
|
|
930
|
-
},
|
|
931
|
-
{
|
|
932
|
-
name: "engram.work_board",
|
|
933
|
-
description: "Export/import work-layer board snapshots and markdown.",
|
|
934
|
-
inputSchema: {
|
|
935
|
-
type: "object",
|
|
936
|
-
properties: {
|
|
937
|
-
action: { type: "string", enum: ["export_markdown", "export_snapshot", "import_snapshot"] },
|
|
938
|
-
projectId: { type: "string" },
|
|
939
|
-
snapshotJson: { type: "string", description: "Snapshot JSON for import_snapshot." },
|
|
940
|
-
linkToMemory: { type: "boolean", description: "If true, output can be retained as long-term memory." }
|
|
941
|
-
},
|
|
942
|
-
required: ["action"],
|
|
943
|
-
additionalProperties: false
|
|
944
|
-
}
|
|
945
|
-
},
|
|
946
|
-
// ── Shared Context / Compounding tools ────────────────────────────
|
|
947
|
-
{
|
|
948
|
-
name: "engram.shared_context_write_output",
|
|
949
|
-
description: "Write agent work product into shared-context directory for cross-agent coordination.",
|
|
950
|
-
inputSchema: {
|
|
951
|
-
type: "object",
|
|
952
|
-
properties: {
|
|
953
|
-
agentId: { type: "string", description: "Agent ID producing this output." },
|
|
954
|
-
title: { type: "string", description: "Short title for the output." },
|
|
955
|
-
content: { type: "string", description: "Markdown content to write." }
|
|
956
|
-
},
|
|
957
|
-
required: ["agentId", "title", "content"],
|
|
958
|
-
additionalProperties: false
|
|
959
|
-
}
|
|
960
|
-
},
|
|
961
|
-
{
|
|
962
|
-
name: "engram.shared_feedback_record",
|
|
963
|
-
description: "Append approval/rejection decision into shared-context feedback inbox for compounding learning.",
|
|
964
|
-
inputSchema: {
|
|
965
|
-
type: "object",
|
|
966
|
-
properties: {
|
|
967
|
-
agent: { type: "string", description: "Agent name that produced the output." },
|
|
968
|
-
decision: { type: "string", enum: ["approved", "approved_with_feedback", "rejected"] },
|
|
969
|
-
reason: { type: "string" },
|
|
970
|
-
date: { type: "string", description: "ISO timestamp. Defaults to now." },
|
|
971
|
-
learning: { type: "string" },
|
|
972
|
-
outcome: { type: "string" },
|
|
973
|
-
severity: { type: "string", enum: ["low", "medium", "high"] },
|
|
974
|
-
confidence: { type: "number", description: "Confidence 0-1." },
|
|
975
|
-
workflow: { type: "string" },
|
|
976
|
-
tags: { type: "array", items: { type: "string" } },
|
|
977
|
-
evidenceWindowStart: { type: "string" },
|
|
978
|
-
evidenceWindowEnd: { type: "string" },
|
|
979
|
-
refs: { type: "array", items: { type: "string" } }
|
|
980
|
-
},
|
|
981
|
-
required: ["agent", "decision", "reason"],
|
|
982
|
-
additionalProperties: false
|
|
983
|
-
}
|
|
984
|
-
},
|
|
985
|
-
{
|
|
986
|
-
name: "engram.shared_priorities_append",
|
|
987
|
-
description: "Append priorities text into shared-context inbox for curator merge.",
|
|
988
|
-
inputSchema: {
|
|
989
|
-
type: "object",
|
|
990
|
-
properties: {
|
|
991
|
-
agentId: { type: "string" },
|
|
992
|
-
text: { type: "string", description: "Priority notes (markdown)." }
|
|
993
|
-
},
|
|
994
|
-
required: ["agentId", "text"],
|
|
995
|
-
additionalProperties: false
|
|
996
|
-
}
|
|
997
|
-
},
|
|
998
|
-
{
|
|
999
|
-
name: "engram.shared_context_cross_signals_run",
|
|
1000
|
-
description: "Generate cross-signal markdown + JSON artifacts from agent outputs and feedback.",
|
|
1001
|
-
inputSchema: {
|
|
1002
|
-
type: "object",
|
|
1003
|
-
properties: {
|
|
1004
|
-
date: { type: "string", description: "YYYY-MM-DD. Defaults to today." }
|
|
1005
|
-
},
|
|
1006
|
-
additionalProperties: false
|
|
1007
|
-
}
|
|
1008
|
-
},
|
|
1009
|
-
{
|
|
1010
|
-
name: "engram.shared_context_curate_daily",
|
|
1011
|
-
description: "Generate daily roundtable summary (deterministic baseline aggregation).",
|
|
1012
|
-
inputSchema: {
|
|
1013
|
-
type: "object",
|
|
1014
|
-
properties: {
|
|
1015
|
-
date: { type: "string", description: "YYYY-MM-DD. Defaults to today." }
|
|
1016
|
-
},
|
|
1017
|
-
additionalProperties: false
|
|
1018
|
-
}
|
|
1019
|
-
},
|
|
1020
|
-
{
|
|
1021
|
-
name: "engram.compounding_weekly_synthesize",
|
|
1022
|
-
description: "Generate weekly compounding outputs: reports, mistake registry, rubrics, and promotion candidates.",
|
|
1023
|
-
inputSchema: {
|
|
1024
|
-
type: "object",
|
|
1025
|
-
properties: {
|
|
1026
|
-
weekId: { type: "string", description: "ISO week ID (YYYY-Www). Defaults to current week." }
|
|
1027
|
-
},
|
|
1028
|
-
additionalProperties: false
|
|
1029
|
-
}
|
|
1030
|
-
},
|
|
1031
|
-
{
|
|
1032
|
-
name: "engram.compounding_promote_candidate",
|
|
1033
|
-
description: "Promote a compounding candidate from weekly report into durable rule/principle memory.",
|
|
1034
|
-
inputSchema: {
|
|
1035
|
-
type: "object",
|
|
1036
|
-
properties: {
|
|
1037
|
-
weekId: { type: "string" },
|
|
1038
|
-
candidateId: { type: "string" },
|
|
1039
|
-
dryRun: { type: "boolean", description: "Preview without writing." }
|
|
1040
|
-
},
|
|
1041
|
-
required: ["weekId", "candidateId"],
|
|
1042
|
-
additionalProperties: false
|
|
1043
|
-
}
|
|
1044
|
-
},
|
|
1045
|
-
// ── Compression Guidelines tools ────────────────────────────────────
|
|
1046
|
-
{
|
|
1047
|
-
name: "engram.compression_guidelines_optimize",
|
|
1048
|
-
description: "Run compression guideline optimizer, optionally persisting new guidelines.",
|
|
1049
|
-
inputSchema: {
|
|
1050
|
-
type: "object",
|
|
1051
|
-
properties: {
|
|
1052
|
-
dryRun: { type: "boolean" },
|
|
1053
|
-
eventLimit: { type: "number" }
|
|
1054
|
-
},
|
|
1055
|
-
additionalProperties: false
|
|
1056
|
-
}
|
|
1057
|
-
},
|
|
1058
|
-
{
|
|
1059
|
-
name: "engram.compression_guidelines_activate",
|
|
1060
|
-
description: "Promote staged compression guideline draft to active (after review).",
|
|
1061
|
-
inputSchema: {
|
|
1062
|
-
type: "object",
|
|
1063
|
-
properties: {
|
|
1064
|
-
expectedContentHash: { type: "string" },
|
|
1065
|
-
expectedGuidelineVersion: { type: "number" }
|
|
1066
|
-
},
|
|
1067
|
-
additionalProperties: false
|
|
1068
|
-
}
|
|
1069
|
-
},
|
|
1070
|
-
// ── Memory search & debug tools ────────────────────────────────────
|
|
1071
|
-
{
|
|
1072
|
-
name: "engram.memory_search",
|
|
1073
|
-
description: "Direct semantic search over memory files using the QMD index. Returns matching memories with relevance scores.",
|
|
1074
|
-
inputSchema: {
|
|
1075
|
-
type: "object",
|
|
1076
|
-
properties: {
|
|
1077
|
-
query: { type: "string" },
|
|
1078
|
-
namespace: { type: "string" },
|
|
1079
|
-
maxResults: { type: "number" },
|
|
1080
|
-
collection: { type: "string", description: "QMD collection (omit for memory, 'global' for all)" }
|
|
1081
|
-
},
|
|
1082
|
-
required: ["query"],
|
|
1083
|
-
additionalProperties: false
|
|
1084
|
-
}
|
|
1085
|
-
},
|
|
1086
|
-
{
|
|
1087
|
-
name: "engram.memory_profile",
|
|
1088
|
-
description: "Read the user's behavioral profile \u2014 a living document of their preferences, habits, and personality.",
|
|
1089
|
-
inputSchema: {
|
|
1090
|
-
type: "object",
|
|
1091
|
-
properties: { namespace: { type: "string" } },
|
|
1092
|
-
additionalProperties: false
|
|
1093
|
-
}
|
|
1094
|
-
},
|
|
1095
|
-
{
|
|
1096
|
-
name: "engram.memory_entities_list",
|
|
1097
|
-
description: "List all tracked entities (people, projects, tools, companies).",
|
|
1098
|
-
inputSchema: {
|
|
1099
|
-
type: "object",
|
|
1100
|
-
properties: { namespace: { type: "string" } },
|
|
1101
|
-
additionalProperties: false
|
|
1102
|
-
}
|
|
1103
|
-
},
|
|
1104
|
-
{
|
|
1105
|
-
name: "engram.memory_questions",
|
|
1106
|
-
description: "List open questions the system is curious about from past conversations.",
|
|
1107
|
-
inputSchema: {
|
|
1108
|
-
type: "object",
|
|
1109
|
-
properties: { namespace: { type: "string" } },
|
|
1110
|
-
additionalProperties: false
|
|
1111
|
-
}
|
|
1112
|
-
},
|
|
1113
|
-
{
|
|
1114
|
-
name: "engram.memory_last_recall",
|
|
1115
|
-
description: "Return the last recall snapshot for a session (debug introspection).",
|
|
1116
|
-
inputSchema: {
|
|
1117
|
-
type: "object",
|
|
1118
|
-
properties: { sessionKey: { type: "string" } },
|
|
1119
|
-
additionalProperties: false
|
|
1120
|
-
}
|
|
1121
|
-
},
|
|
1122
|
-
{
|
|
1123
|
-
name: "engram.memory_intent_debug",
|
|
1124
|
-
description: "Return the last intent classification debug snapshot.",
|
|
1125
|
-
inputSchema: {
|
|
1126
|
-
type: "object",
|
|
1127
|
-
properties: { namespace: { type: "string" } },
|
|
1128
|
-
additionalProperties: false
|
|
1129
|
-
}
|
|
1130
|
-
},
|
|
1131
|
-
{
|
|
1132
|
-
name: "engram.memory_qmd_debug",
|
|
1133
|
-
description: "Return QMD search index debug information from the last recall.",
|
|
1134
|
-
inputSchema: {
|
|
1135
|
-
type: "object",
|
|
1136
|
-
properties: { namespace: { type: "string" } },
|
|
1137
|
-
additionalProperties: false
|
|
1138
|
-
}
|
|
1139
|
-
},
|
|
1140
|
-
{
|
|
1141
|
-
name: "engram.memory_graph_explain",
|
|
1142
|
-
description: "Explain the last entity graph recall \u2014 which entities were activated and why.",
|
|
1143
|
-
inputSchema: {
|
|
1144
|
-
type: "object",
|
|
1145
|
-
properties: { namespace: { type: "string" } },
|
|
1146
|
-
additionalProperties: false
|
|
1147
|
-
}
|
|
1148
|
-
},
|
|
1149
|
-
{
|
|
1150
|
-
// Graph snapshot for the admin pane (issue #691 PR 2/5). Returns
|
|
1151
|
-
// a read-only `{ nodes, edges, generatedAt }` view of the
|
|
1152
|
-
// multi-graph adjacency, with the same filter knobs as the HTTP
|
|
1153
|
-
// surface so connectors / CLI clients can hit either endpoint
|
|
1154
|
-
// interchangeably.
|
|
1155
|
-
name: "engram.graph_snapshot",
|
|
1156
|
-
description: "Return a read-only graph snapshot (nodes + edges) for the admin pane. Filters: limit (default 500, max 5000), since (ISO timestamp), focusNodeId (restricts to neighborhood), categories (allow-list of memory categories).",
|
|
1157
|
-
inputSchema: {
|
|
1158
|
-
type: "object",
|
|
1159
|
-
properties: {
|
|
1160
|
-
namespace: { type: "string" },
|
|
1161
|
-
limit: { type: "number", description: "Maximum number of edges to return (default 500, max 5000)." },
|
|
1162
|
-
since: { type: "string", description: "Inclusive lower bound on edge timestamp (ISO-8601)." },
|
|
1163
|
-
focusNodeId: { type: "string", description: "When set, restrict the snapshot to the focus node and its neighbors." },
|
|
1164
|
-
categories: {
|
|
1165
|
-
type: "array",
|
|
1166
|
-
items: { type: "string" },
|
|
1167
|
-
description: "Optional category allow-list (e.g. ['fact', 'decision'])."
|
|
1168
|
-
}
|
|
1169
|
-
},
|
|
1170
|
-
additionalProperties: false
|
|
1171
|
-
}
|
|
1172
|
-
},
|
|
1173
|
-
{
|
|
1174
|
-
name: "engram.memory_feedback",
|
|
1175
|
-
description: "Record relevance feedback (thumbs up/down) for a specific memory.",
|
|
1176
|
-
inputSchema: {
|
|
1177
|
-
type: "object",
|
|
1178
|
-
properties: {
|
|
1179
|
-
memoryId: { type: "string" },
|
|
1180
|
-
vote: { type: "string", enum: ["up", "down"] },
|
|
1181
|
-
note: { type: "string" }
|
|
1182
|
-
},
|
|
1183
|
-
required: ["memoryId", "vote"],
|
|
1184
|
-
additionalProperties: false
|
|
1185
|
-
}
|
|
1186
|
-
},
|
|
1187
|
-
{
|
|
1188
|
-
name: "engram.memory_promote",
|
|
1189
|
-
description: "Promote a memory's lifecycle state (e.g. from draft to active).",
|
|
1190
|
-
inputSchema: {
|
|
1191
|
-
type: "object",
|
|
1192
|
-
properties: {
|
|
1193
|
-
memoryId: { type: "string" },
|
|
1194
|
-
namespace: { type: "string" },
|
|
1195
|
-
sessionKey: { type: "string" }
|
|
1196
|
-
},
|
|
1197
|
-
required: ["memoryId"],
|
|
1198
|
-
additionalProperties: false
|
|
1199
|
-
}
|
|
1200
|
-
},
|
|
1201
|
-
// Memory Worth outcome signal (issue #560 PR 3). Callers record whether
|
|
1202
|
-
// a session that used a given memory ultimately succeeded or failed;
|
|
1203
|
-
// the counter is persisted in the memory's frontmatter (mw_success /
|
|
1204
|
-
// mw_fail) and will feed the recall-time filter added in PR 4.
|
|
1205
|
-
{
|
|
1206
|
-
name: "engram.memory_outcome",
|
|
1207
|
-
description: "Record a Memory Worth outcome (success/failure) for a memory. Increments mw_success or mw_fail in the memory's frontmatter for use by the recall filter.",
|
|
1208
|
-
inputSchema: {
|
|
1209
|
-
type: "object",
|
|
1210
|
-
properties: {
|
|
1211
|
-
memoryId: { type: "string" },
|
|
1212
|
-
outcome: { type: "string", enum: ["success", "failure"] },
|
|
1213
|
-
namespace: { type: "string" },
|
|
1214
|
-
sessionKey: { type: "string" },
|
|
1215
|
-
timestamp: { type: "string", description: "Optional ISO-8601 timestamp of the observation." }
|
|
1216
|
-
},
|
|
1217
|
-
required: ["memoryId", "outcome"],
|
|
1218
|
-
additionalProperties: false
|
|
1219
|
-
}
|
|
1220
|
-
},
|
|
1221
|
-
{
|
|
1222
|
-
name: "engram.memory_action_apply",
|
|
1223
|
-
description: "Record a memory-action application event for policy-learning telemetry.",
|
|
1224
|
-
inputSchema: {
|
|
1225
|
-
type: "object",
|
|
1226
|
-
properties: {
|
|
1227
|
-
action: {
|
|
1228
|
-
type: "string",
|
|
1229
|
-
enum: [
|
|
1230
|
-
"store_episode",
|
|
1231
|
-
"store_note",
|
|
1232
|
-
"update_note",
|
|
1233
|
-
"create_artifact",
|
|
1234
|
-
"summarize_node",
|
|
1235
|
-
"discard",
|
|
1236
|
-
"link_graph"
|
|
1237
|
-
]
|
|
1238
|
-
},
|
|
1239
|
-
category: { type: "string" },
|
|
1240
|
-
content: { type: "string" },
|
|
1241
|
-
outcome: { type: "string", enum: ["applied", "skipped", "failed"] },
|
|
1242
|
-
reason: { type: "string" },
|
|
1243
|
-
memoryId: { type: "string" },
|
|
1244
|
-
sessionKey: { type: "string" },
|
|
1245
|
-
linkTargetId: { type: "string" },
|
|
1246
|
-
linkType: { type: "string" },
|
|
1247
|
-
linkStrength: { type: "number" },
|
|
1248
|
-
artifactType: { type: "string" },
|
|
1249
|
-
execute: { type: "boolean" },
|
|
1250
|
-
sourcePrompt: { type: "string" },
|
|
1251
|
-
namespace: { type: "string" },
|
|
1252
|
-
dryRun: { type: "boolean" }
|
|
1253
|
-
},
|
|
1254
|
-
required: ["action"],
|
|
1255
|
-
additionalProperties: false
|
|
1256
|
-
}
|
|
1257
|
-
},
|
|
1258
|
-
{
|
|
1259
|
-
name: "engram.context_checkpoint",
|
|
1260
|
-
description: "Save a structured context checkpoint for a session (preserves conversation state to disk).",
|
|
1261
|
-
inputSchema: {
|
|
1262
|
-
type: "object",
|
|
1263
|
-
properties: {
|
|
1264
|
-
sessionKey: { type: "string" },
|
|
1265
|
-
context: { type: "string", description: "Context content to checkpoint" },
|
|
1266
|
-
namespace: { type: "string" }
|
|
1267
|
-
},
|
|
1268
|
-
required: ["sessionKey", "context"],
|
|
1269
|
-
additionalProperties: false
|
|
1270
|
-
}
|
|
1271
|
-
},
|
|
1272
|
-
// ── Daily Context Briefing (#370) ───────────────────────────────────
|
|
1273
|
-
// Uses the legacy "engram.*" prefix like every other tool in this array;
|
|
1274
|
-
// withToolAliases (applied via .flatMap below) generates the canonical
|
|
1275
|
-
// "remnic.briefing" alias automatically.
|
|
1276
|
-
...service.briefingEnabled ? [{
|
|
1277
|
-
name: "engram.briefing",
|
|
1278
|
-
description: "Generate a daily context briefing by cross-referencing active entities, recent facts, open commitments, and optional calendar events.",
|
|
1279
|
-
inputSchema: {
|
|
1280
|
-
type: "object",
|
|
1281
|
-
properties: {
|
|
1282
|
-
since: { type: "string", description: "Lookback window (e.g. 'yesterday', '3d', '1w', '24h')." },
|
|
1283
|
-
focus: { type: "string", description: "Optional focus filter (e.g. 'person:Jane Doe', 'project:remnic-core', 'topic:retrieval')." },
|
|
1284
|
-
namespace: { type: "string" },
|
|
1285
|
-
format: { type: "string", enum: ["markdown", "json"] },
|
|
1286
|
-
maxFollowups: { type: "number", description: "Maximum LLM-suggested follow-ups (0 disables that section)." }
|
|
1287
|
-
},
|
|
1288
|
-
additionalProperties: false
|
|
1289
|
-
}
|
|
1290
|
-
}] : [],
|
|
1291
|
-
// ── Contradiction Review (issue #520) ────────────────────────────────
|
|
1292
|
-
{
|
|
1293
|
-
name: "engram.review_list",
|
|
1294
|
-
description: "List contradiction review items pending user resolution.",
|
|
1295
|
-
inputSchema: {
|
|
1296
|
-
type: "object",
|
|
1297
|
-
properties: {
|
|
1298
|
-
filter: { type: "string", enum: ["all", "unresolved", "contradicts", "independent", "duplicates", "needs-user"], description: "Filter by verdict type. Default: unresolved." },
|
|
1299
|
-
namespace: { type: "string" },
|
|
1300
|
-
limit: { type: "number", description: "Max items to return (default 50)." }
|
|
1301
|
-
},
|
|
1302
|
-
additionalProperties: false
|
|
1303
|
-
}
|
|
1304
|
-
},
|
|
1305
|
-
{
|
|
1306
|
-
name: "engram.review_resolve",
|
|
1307
|
-
description: "Resolve a contradiction pair with a chosen verb.",
|
|
1308
|
-
inputSchema: {
|
|
1309
|
-
type: "object",
|
|
1310
|
-
properties: {
|
|
1311
|
-
pairId: { type: "string", description: "The contradiction pair ID to resolve." },
|
|
1312
|
-
verb: { type: "string", enum: ["keep-a", "keep-b", "merge", "both-valid", "needs-more-context"], description: "Resolution action." }
|
|
1313
|
-
},
|
|
1314
|
-
required: ["pairId", "verb"],
|
|
1315
|
-
additionalProperties: false
|
|
1316
|
-
}
|
|
1317
|
-
},
|
|
1318
|
-
{
|
|
1319
|
-
name: "engram.contradiction_scan_run",
|
|
1320
|
-
description: "Run an on-demand contradiction scan over the memory corpus.",
|
|
1321
|
-
inputSchema: {
|
|
1322
|
-
type: "object",
|
|
1323
|
-
properties: {
|
|
1324
|
-
namespace: { type: "string" }
|
|
1325
|
-
},
|
|
1326
|
-
additionalProperties: false
|
|
1327
|
-
}
|
|
1328
|
-
},
|
|
1329
|
-
{
|
|
1330
|
-
name: "engram.memory_summarize_hourly",
|
|
1331
|
-
description: "Generate hourly summaries for recent conversations.",
|
|
1332
|
-
inputSchema: {
|
|
1333
|
-
type: "object",
|
|
1334
|
-
properties: {},
|
|
1335
|
-
additionalProperties: false
|
|
1336
|
-
}
|
|
1337
|
-
},
|
|
1338
|
-
{
|
|
1339
|
-
name: "engram.conversation_index_update",
|
|
1340
|
-
description: "Chunk transcript history into conversation-index documents.",
|
|
1341
|
-
inputSchema: {
|
|
1342
|
-
type: "object",
|
|
1343
|
-
properties: {
|
|
1344
|
-
sessionKey: { type: "string" },
|
|
1345
|
-
hours: { type: "number", description: "How many hours of transcript history to include." },
|
|
1346
|
-
embed: { type: "boolean", description: "If true, run QMD embed after update for this invocation." }
|
|
1347
|
-
},
|
|
1348
|
-
additionalProperties: false
|
|
1349
|
-
}
|
|
1350
|
-
},
|
|
1351
|
-
{
|
|
1352
|
-
name: "engram.profiling_report",
|
|
1353
|
-
description: "Return timing and performance data for Remnic recall and extraction pipelines. Requires profilingEnabled: true.",
|
|
1354
|
-
inputSchema: {
|
|
1355
|
-
type: "object",
|
|
1356
|
-
properties: {
|
|
1357
|
-
format: {
|
|
1358
|
-
type: "string",
|
|
1359
|
-
enum: ["ascii", "json"],
|
|
1360
|
-
description: "Output format. Defaults to ascii."
|
|
1361
|
-
},
|
|
1362
|
-
limit: {
|
|
1363
|
-
type: "integer",
|
|
1364
|
-
minimum: 1,
|
|
1365
|
-
maximum: 20,
|
|
1366
|
-
description: "Number of recent traces to include. Defaults to 5."
|
|
1367
|
-
}
|
|
1368
|
-
},
|
|
1369
|
-
additionalProperties: false
|
|
1370
|
-
}
|
|
1371
|
-
},
|
|
1372
|
-
{
|
|
1373
|
-
name: "engram.graph_edge_decay_run",
|
|
1374
|
-
description: "Run the graph-edge-confidence decay maintenance pass (issue #681 PR 2/3). Respects graphEdgeDecayEnabled; writes a structured telemetry record to state/graph-edge-decay-status.json.",
|
|
1375
|
-
inputSchema: {
|
|
1376
|
-
type: "object",
|
|
1377
|
-
properties: {
|
|
1378
|
-
dryRun: { type: "boolean" }
|
|
1379
|
-
},
|
|
1380
|
-
additionalProperties: false
|
|
1381
|
-
}
|
|
1382
|
-
},
|
|
1383
|
-
{
|
|
1384
|
-
name: "engram.live_connectors_run",
|
|
1385
|
-
description: "Run due live connectors once. Used by the live-connector cron and available for operator-triggered sync checks.",
|
|
1386
|
-
inputSchema: {
|
|
1387
|
-
type: "object",
|
|
1388
|
-
properties: {
|
|
1389
|
-
force: {
|
|
1390
|
-
type: "boolean",
|
|
1391
|
-
description: "When true, run enabled connectors even if their poll interval has not elapsed."
|
|
1392
|
-
}
|
|
1393
|
-
},
|
|
1394
|
-
additionalProperties: false
|
|
1395
|
-
}
|
|
1396
|
-
},
|
|
1397
|
-
// ── Peer Registry tools (issue #679 PR 4/5) ─────────────────────────
|
|
1398
|
-
{
|
|
1399
|
-
name: "engram.peer_list",
|
|
1400
|
-
description: "List all registered peers in the peer registry (issue #679). Returns an array of peer identity records sorted alphabetically by id.",
|
|
1401
|
-
inputSchema: {
|
|
1402
|
-
type: "object",
|
|
1403
|
-
properties: {},
|
|
1404
|
-
additionalProperties: false
|
|
1405
|
-
}
|
|
1406
|
-
},
|
|
1407
|
-
{
|
|
1408
|
-
name: "engram.peer_get",
|
|
1409
|
-
description: "Get a single peer by id. Returns the peer's identity record or { found: false } when not found (issue #679).",
|
|
1410
|
-
inputSchema: {
|
|
1411
|
-
type: "object",
|
|
1412
|
-
properties: {
|
|
1413
|
-
id: { type: "string", description: "Peer id to look up." }
|
|
1414
|
-
},
|
|
1415
|
-
required: ["id"],
|
|
1416
|
-
additionalProperties: false
|
|
1417
|
-
}
|
|
1418
|
-
},
|
|
1419
|
-
{
|
|
1420
|
-
name: "engram.peer_set",
|
|
1421
|
-
description: "Create or update a peer identity record (issue #679). On first write, creates the peer with the given kind (default 'human'). On subsequent writes, updates displayName and/or notes; kind and createdAt are immutable.",
|
|
1422
|
-
inputSchema: {
|
|
1423
|
-
type: "object",
|
|
1424
|
-
properties: {
|
|
1425
|
-
id: { type: "string", description: "Peer id \u2014 must match PEER_ID_PATTERN." },
|
|
1426
|
-
kind: {
|
|
1427
|
-
type: "string",
|
|
1428
|
-
enum: ["self", "human", "agent", "integration"],
|
|
1429
|
-
description: "Kind of peer. Required on first write; ignored on updates."
|
|
1430
|
-
},
|
|
1431
|
-
displayName: { type: "string", description: "Human-readable display name." },
|
|
1432
|
-
notes: { type: "string", description: "Optional free-form markdown notes." }
|
|
1433
|
-
},
|
|
1434
|
-
required: ["id"],
|
|
1435
|
-
additionalProperties: false
|
|
1436
|
-
}
|
|
1437
|
-
},
|
|
1438
|
-
{
|
|
1439
|
-
name: "engram.peer_delete",
|
|
1440
|
-
description: "Delete a peer's identity record (issue #679). Idempotent \u2014 succeeds even if the peer does not exist. The peer directory is preserved so profile and interaction-log data are not destroyed.",
|
|
1441
|
-
inputSchema: {
|
|
1442
|
-
type: "object",
|
|
1443
|
-
properties: {
|
|
1444
|
-
id: { type: "string", description: "Peer id to delete." }
|
|
1445
|
-
},
|
|
1446
|
-
required: ["id"],
|
|
1447
|
-
additionalProperties: false
|
|
1448
|
-
}
|
|
1449
|
-
},
|
|
1450
|
-
{
|
|
1451
|
-
name: "engram.peer_profile_get",
|
|
1452
|
-
description: "Get the evolving cognitive profile for a peer (issue #679). Returns the profile written by the async reasoner (PR 2/5), or { found: false } if no profile has been generated yet.",
|
|
1453
|
-
inputSchema: {
|
|
1454
|
-
type: "object",
|
|
1455
|
-
properties: {
|
|
1456
|
-
id: { type: "string", description: "Peer id whose profile to retrieve." }
|
|
1457
|
-
},
|
|
1458
|
-
required: ["id"],
|
|
1459
|
-
additionalProperties: false
|
|
1460
|
-
}
|
|
1461
|
-
},
|
|
1462
|
-
{
|
|
1463
|
-
name: "engram.peer_forget",
|
|
1464
|
-
description: "DESTRUCTIVELY purge the entire peer directory (identity.md + profile.md + interactions.log.md and any companion files). Requires confirm: 'yes'. Idempotent \u2014 safe to call twice. Use engram.peer_delete when you only want to remove the identity record and preserve profile data.",
|
|
1465
|
-
inputSchema: {
|
|
1466
|
-
type: "object",
|
|
1467
|
-
properties: {
|
|
1468
|
-
id: { type: "string", description: "Peer id to purge." },
|
|
1469
|
-
confirm: {
|
|
1470
|
-
type: "string",
|
|
1471
|
-
enum: ["yes"],
|
|
1472
|
-
description: "Must be exactly 'yes' to proceed. Guard against accidental invocation."
|
|
1473
|
-
}
|
|
1474
|
-
},
|
|
1475
|
-
required: ["id", "confirm"],
|
|
1476
|
-
additionalProperties: false
|
|
1477
|
-
}
|
|
1478
|
-
},
|
|
1479
|
-
// ── Operator Console state (issue #688 PR 2/3) ─────────────────────────
|
|
1480
|
-
{
|
|
1481
|
-
name: "engram.console_state",
|
|
1482
|
-
description: "Return a point-in-time ConsoleStateSnapshot of the engine's runtime state \u2014 buffer, extraction queue, dedup decisions, maintenance ledger tail, QMD probe, and daemon info (issue #688). Read-only; never mutates state.",
|
|
1483
|
-
inputSchema: {
|
|
1484
|
-
type: "object",
|
|
1485
|
-
properties: {
|
|
1486
|
-
namespace: {
|
|
1487
|
-
type: "string",
|
|
1488
|
-
description: "Optional namespace to scope the snapshot."
|
|
1489
|
-
}
|
|
1490
|
-
},
|
|
1491
|
-
additionalProperties: false
|
|
1492
|
-
}
|
|
1493
|
-
},
|
|
1494
|
-
// ── Dreams telemetry (issue #678 PR 3+4) ─────────────────────────────
|
|
1495
|
-
{
|
|
1496
|
-
name: "engram.dreams_status",
|
|
1497
|
-
description: "Return per-phase Dreams pipeline telemetry for the last N hours (default 24). Reports run count, total duration, and items processed for each phase: lightSleep, rem, deepSleep.",
|
|
1498
|
-
inputSchema: {
|
|
1499
|
-
type: "object",
|
|
1500
|
-
properties: {
|
|
1501
|
-
windowHours: {
|
|
1502
|
-
type: "number",
|
|
1503
|
-
description: "How many hours to look back (default 24, minimum 1)."
|
|
1504
|
-
},
|
|
1505
|
-
namespace: {
|
|
1506
|
-
type: "string",
|
|
1507
|
-
description: "Optional namespace to read Dreams telemetry from."
|
|
1508
|
-
}
|
|
1509
|
-
},
|
|
1510
|
-
additionalProperties: false
|
|
1511
|
-
}
|
|
1512
|
-
},
|
|
1513
|
-
{
|
|
1514
|
-
name: "engram.dreams_run",
|
|
1515
|
-
description: "Manually invoke a single Dreams pipeline phase (lightSleep, rem, or deepSleep). Returns the same telemetry shape as a scheduled run. Pass dryRun: true to preview without committing writes.",
|
|
1516
|
-
inputSchema: {
|
|
1517
|
-
type: "object",
|
|
1518
|
-
properties: {
|
|
1519
|
-
phase: {
|
|
1520
|
-
type: "string",
|
|
1521
|
-
enum: ["lightSleep", "rem", "deepSleep"],
|
|
1522
|
-
description: "Which phase to run."
|
|
1523
|
-
},
|
|
1524
|
-
dryRun: {
|
|
1525
|
-
type: "boolean",
|
|
1526
|
-
description: "When true, report what would change without committing writes (default false)."
|
|
1527
|
-
},
|
|
1528
|
-
namespace: {
|
|
1529
|
-
type: "string",
|
|
1530
|
-
description: "Optional namespace to run the phase in."
|
|
1531
|
-
}
|
|
1532
|
-
},
|
|
1533
|
-
required: ["phase"],
|
|
1534
|
-
additionalProperties: false
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
].flatMap((tool) => withToolAliases(tool));
|
|
1538
|
-
}
|
|
1539
|
-
service;
|
|
1540
|
-
buffer = Buffer.alloc(0);
|
|
1541
|
-
flushTask = null;
|
|
1542
|
-
tools;
|
|
1543
|
-
resources;
|
|
1544
|
-
resourceTextByUri;
|
|
1545
|
-
authenticatedPrincipal;
|
|
1546
|
-
/**
|
|
1547
|
-
* MCP client info keyed by server-assigned session ID. On each `initialize`
|
|
1548
|
-
* handshake the server generates a UUID, stores the client's clientInfo
|
|
1549
|
-
* against it, and returns the ID as `Mcp-Session-Id` in the response
|
|
1550
|
-
* metadata. Subsequent requests from the same client include this header,
|
|
1551
|
-
* allowing per-session clientInfo lookup without cross-session leaks.
|
|
1552
|
-
*/
|
|
1553
|
-
clientInfoBySession = /* @__PURE__ */ new Map();
|
|
1554
|
-
/**
|
|
1555
|
-
* Session IDs generated during initialize, keyed by caller-supplied correlation
|
|
1556
|
-
* ID (unique per HTTP request) to avoid collisions when multiple clients send
|
|
1557
|
-
* initialize with the same JSON-RPC id concurrently.
|
|
1558
|
-
*/
|
|
1559
|
-
initSessionIds = /* @__PURE__ */ new Map();
|
|
1560
|
-
/** Whether oai-mem-citation guidance is explicitly enabled via config. */
|
|
1561
|
-
citationsEnabled;
|
|
1562
|
-
/** Whether to auto-enable citations for Codex adapter connections. */
|
|
1563
|
-
citationsAutoDetect;
|
|
1564
|
-
/** Get clientInfo for a specific MCP session. Returns undefined for non-MCP requests. */
|
|
1565
|
-
getClientInfo(sessionId) {
|
|
1566
|
-
if (sessionId) {
|
|
1567
|
-
return this.clientInfoBySession.get(sessionId);
|
|
1568
|
-
}
|
|
1569
|
-
return void 0;
|
|
1570
|
-
}
|
|
1571
|
-
/** Pop the session ID generated during an initialize handshake, keyed by correlation ID. */
|
|
1572
|
-
popInitSessionId(correlationId) {
|
|
1573
|
-
const sid = this.initSessionIds.get(correlationId);
|
|
1574
|
-
if (sid !== void 0) this.initSessionIds.delete(correlationId);
|
|
1575
|
-
return sid;
|
|
1576
|
-
}
|
|
1577
|
-
async handleRequest(request, options) {
|
|
1578
|
-
const id = request.id ?? null;
|
|
1579
|
-
const method = request.method ?? "";
|
|
1580
|
-
if (method === "notifications/initialized") return null;
|
|
1581
|
-
if (method === "ping") {
|
|
1582
|
-
return { jsonrpc: "2.0", id, result: {} };
|
|
1583
|
-
}
|
|
1584
|
-
if (method === "initialize") {
|
|
1585
|
-
const params = request.params ?? {};
|
|
1586
|
-
const rawClientInfo = params.clientInfo;
|
|
1587
|
-
const newSessionId = randomUUID();
|
|
1588
|
-
if (rawClientInfo && typeof rawClientInfo.name === "string") {
|
|
1589
|
-
const info = { name: rawClientInfo.name, version: rawClientInfo.version };
|
|
1590
|
-
this.clientInfoBySession.set(newSessionId, info);
|
|
1591
|
-
if (this.clientInfoBySession.size > 1e3) {
|
|
1592
|
-
const firstKey = this.clientInfoBySession.keys().next().value;
|
|
1593
|
-
if (firstKey) this.clientInfoBySession.delete(firstKey);
|
|
1594
|
-
}
|
|
1595
|
-
}
|
|
1596
|
-
const version = await getMcpServerVersion();
|
|
1597
|
-
const corrId = options?.correlationId;
|
|
1598
|
-
if (corrId) this.initSessionIds.set(corrId, newSessionId);
|
|
1599
|
-
return {
|
|
1600
|
-
jsonrpc: "2.0",
|
|
1601
|
-
id,
|
|
1602
|
-
result: {
|
|
1603
|
-
protocolVersion: MCP_PROTOCOL_VERSION,
|
|
1604
|
-
capabilities: {
|
|
1605
|
-
tools: {},
|
|
1606
|
-
resources: {}
|
|
1607
|
-
},
|
|
1608
|
-
serverInfo: {
|
|
1609
|
-
name: "remnic",
|
|
1610
|
-
version
|
|
1611
|
-
}
|
|
1612
|
-
}
|
|
1613
|
-
};
|
|
1614
|
-
}
|
|
1615
|
-
if (method === "tools/list") {
|
|
1616
|
-
return {
|
|
1617
|
-
jsonrpc: "2.0",
|
|
1618
|
-
id,
|
|
1619
|
-
result: {
|
|
1620
|
-
tools: this.tools
|
|
1621
|
-
}
|
|
1622
|
-
};
|
|
1623
|
-
}
|
|
1624
|
-
if (method === "resources/list") {
|
|
1625
|
-
return {
|
|
1626
|
-
jsonrpc: "2.0",
|
|
1627
|
-
id,
|
|
1628
|
-
result: {
|
|
1629
|
-
resources: this.resources
|
|
1630
|
-
}
|
|
1631
|
-
};
|
|
1632
|
-
}
|
|
1633
|
-
if (method === "resources/templates/list") {
|
|
1634
|
-
return {
|
|
1635
|
-
jsonrpc: "2.0",
|
|
1636
|
-
id,
|
|
1637
|
-
result: {
|
|
1638
|
-
resourceTemplates: []
|
|
1639
|
-
}
|
|
1640
|
-
};
|
|
1641
|
-
}
|
|
1642
|
-
if (method === "resources/read") {
|
|
1643
|
-
const params = request.params ?? {};
|
|
1644
|
-
const uri = typeof params.uri === "string" ? params.uri : "";
|
|
1645
|
-
const resource = this.resources.find((entry) => entry.uri === uri);
|
|
1646
|
-
if (!resource) {
|
|
1647
|
-
return {
|
|
1648
|
-
jsonrpc: "2.0",
|
|
1649
|
-
id,
|
|
1650
|
-
error: {
|
|
1651
|
-
code: -32602,
|
|
1652
|
-
message: `Unknown resource URI: ${uri}`
|
|
1653
|
-
}
|
|
1654
|
-
};
|
|
1655
|
-
}
|
|
1656
|
-
const text = this.resourceTextByUri.get(resource.uri);
|
|
1657
|
-
if (text === void 0) {
|
|
1658
|
-
return {
|
|
1659
|
-
jsonrpc: "2.0",
|
|
1660
|
-
id,
|
|
1661
|
-
error: {
|
|
1662
|
-
code: -32603,
|
|
1663
|
-
message: `Resource content unavailable: ${resource.uri}`
|
|
1664
|
-
}
|
|
1665
|
-
};
|
|
1666
|
-
}
|
|
1667
|
-
return {
|
|
1668
|
-
jsonrpc: "2.0",
|
|
1669
|
-
id,
|
|
1670
|
-
result: {
|
|
1671
|
-
contents: [
|
|
1672
|
-
{
|
|
1673
|
-
uri: resource.uri,
|
|
1674
|
-
mimeType: resource.mimeType,
|
|
1675
|
-
text,
|
|
1676
|
-
_meta: resource._meta
|
|
1677
|
-
}
|
|
1678
|
-
]
|
|
1679
|
-
}
|
|
1680
|
-
};
|
|
1681
|
-
}
|
|
1682
|
-
if (method === "tools/call") {
|
|
1683
|
-
const params = request.params ?? {};
|
|
1684
|
-
const name = typeof params.name === "string" ? params.name : "";
|
|
1685
|
-
try {
|
|
1686
|
-
let argumentsObject = {};
|
|
1687
|
-
if ("arguments" in params && params.arguments !== void 0) {
|
|
1688
|
-
if (params.arguments === null || typeof params.arguments !== "object" || Array.isArray(params.arguments)) {
|
|
1689
|
-
throw new EngramAccessInputError("tools/call arguments must be an object when provided");
|
|
1690
|
-
}
|
|
1691
|
-
argumentsObject = params.arguments;
|
|
1692
|
-
}
|
|
1693
|
-
const effectivePrincipal = options?.principalOverride ?? this.authenticatedPrincipal;
|
|
1694
|
-
const result = await this.callTool(name, argumentsObject, effectivePrincipal, options?.sessionId);
|
|
1695
|
-
return {
|
|
1696
|
-
jsonrpc: "2.0",
|
|
1697
|
-
id,
|
|
1698
|
-
result: {
|
|
1699
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
1700
|
-
structuredContent: result,
|
|
1701
|
-
isError: false
|
|
1702
|
-
}
|
|
1703
|
-
};
|
|
1704
|
-
} catch (err) {
|
|
1705
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
1706
|
-
return {
|
|
1707
|
-
jsonrpc: "2.0",
|
|
1708
|
-
id,
|
|
1709
|
-
result: {
|
|
1710
|
-
content: [{ type: "text", text: message }],
|
|
1711
|
-
isError: true
|
|
1712
|
-
}
|
|
1713
|
-
};
|
|
1714
|
-
}
|
|
1715
|
-
}
|
|
1716
|
-
return {
|
|
1717
|
-
jsonrpc: "2.0",
|
|
1718
|
-
id,
|
|
1719
|
-
error: {
|
|
1720
|
-
code: -32601,
|
|
1721
|
-
message: `Method not found: ${method}`
|
|
1722
|
-
}
|
|
1723
|
-
};
|
|
1724
|
-
}
|
|
1725
|
-
async runStdio(input, output) {
|
|
1726
|
-
input.on("data", (chunk) => {
|
|
1727
|
-
this.buffer = Buffer.concat([this.buffer, Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)]);
|
|
1728
|
-
this.scheduleFlush(output);
|
|
1729
|
-
});
|
|
1730
|
-
await new Promise((resolve, reject) => {
|
|
1731
|
-
input.on("end", resolve);
|
|
1732
|
-
input.on("error", reject);
|
|
1733
|
-
});
|
|
1734
|
-
while (this.flushTask) {
|
|
1735
|
-
await this.flushTask;
|
|
1736
|
-
}
|
|
1737
|
-
}
|
|
1738
|
-
scheduleFlush(output) {
|
|
1739
|
-
if (this.flushTask) return;
|
|
1740
|
-
const task = this.flushBuffer(output).catch((err) => {
|
|
1741
|
-
this.writeMessage(output, {
|
|
1742
|
-
jsonrpc: "2.0",
|
|
1743
|
-
id: null,
|
|
1744
|
-
error: {
|
|
1745
|
-
code: -32700,
|
|
1746
|
-
message: err instanceof Error ? err.message : String(err)
|
|
1747
|
-
}
|
|
1748
|
-
});
|
|
1749
|
-
}).finally(() => {
|
|
1750
|
-
if (this.flushTask === task) {
|
|
1751
|
-
this.flushTask = null;
|
|
1752
|
-
}
|
|
1753
|
-
if (this.buffer.length > 0) {
|
|
1754
|
-
this.scheduleFlush(output);
|
|
1755
|
-
}
|
|
1756
|
-
});
|
|
1757
|
-
this.flushTask = task;
|
|
1758
|
-
}
|
|
1759
|
-
async flushBuffer(output) {
|
|
1760
|
-
while (true) {
|
|
1761
|
-
const headerEnd = this.buffer.indexOf("\r\n\r\n");
|
|
1762
|
-
if (headerEnd < 0) return;
|
|
1763
|
-
const headerText = this.buffer.slice(0, headerEnd).toString("utf-8");
|
|
1764
|
-
const headers = headerText.split("\r\n");
|
|
1765
|
-
const contentLengthHeader = headers.find((line) => line.toLowerCase().startsWith("content-length:"));
|
|
1766
|
-
if (!contentLengthHeader) {
|
|
1767
|
-
this.buffer = Buffer.alloc(0);
|
|
1768
|
-
return;
|
|
1769
|
-
}
|
|
1770
|
-
const contentLength = parseInt(contentLengthHeader.split(":")[1]?.trim() ?? "0", 10);
|
|
1771
|
-
if (!Number.isFinite(contentLength) || contentLength < 0) {
|
|
1772
|
-
this.buffer = Buffer.alloc(0);
|
|
1773
|
-
return;
|
|
1774
|
-
}
|
|
1775
|
-
const messageStart = headerEnd + 4;
|
|
1776
|
-
const messageEnd = messageStart + contentLength;
|
|
1777
|
-
if (this.buffer.length < messageEnd) return;
|
|
1778
|
-
const body = this.buffer.slice(messageStart, messageEnd).toString("utf-8");
|
|
1779
|
-
this.buffer = this.buffer.slice(messageEnd);
|
|
1780
|
-
let parsed;
|
|
1781
|
-
try {
|
|
1782
|
-
parsed = JSON.parse(body);
|
|
1783
|
-
} catch {
|
|
1784
|
-
this.writeMessage(output, {
|
|
1785
|
-
jsonrpc: "2.0",
|
|
1786
|
-
id: null,
|
|
1787
|
-
error: {
|
|
1788
|
-
code: -32700,
|
|
1789
|
-
message: "Parse error"
|
|
1790
|
-
}
|
|
1791
|
-
});
|
|
1792
|
-
continue;
|
|
1793
|
-
}
|
|
1794
|
-
const response = await this.handleRequest(parsed);
|
|
1795
|
-
if (response) {
|
|
1796
|
-
this.writeMessage(output, response);
|
|
1797
|
-
}
|
|
1798
|
-
}
|
|
1799
|
-
}
|
|
1800
|
-
writeMessage(output, payload) {
|
|
1801
|
-
const body = JSON.stringify(payload);
|
|
1802
|
-
const message = `Content-Length: ${Buffer.byteLength(body, "utf-8")}\r
|
|
1803
|
-
\r
|
|
1804
|
-
${body}`;
|
|
1805
|
-
output.write(message);
|
|
1806
|
-
}
|
|
1807
|
-
/**
|
|
1808
|
-
* Determine whether oai-mem-citation guidance should be appended to recall.
|
|
1809
|
-
* Returns true when explicitly enabled via config OR when auto-detect is
|
|
1810
|
-
* active and the current MCP session belongs to a Codex adapter client.
|
|
1811
|
-
*
|
|
1812
|
-
* When no sessionId is provided (e.g., stdio transport where there are no
|
|
1813
|
-
* HTTP headers carrying mcp-session-id), fall back to checking if there is
|
|
1814
|
-
* exactly one known session whose clientInfo matches the Codex pattern.
|
|
1815
|
-
* This covers the common stdio case where a single client connection exists.
|
|
1816
|
-
*/
|
|
1817
|
-
shouldEmitCitations(mcpSessionId) {
|
|
1818
|
-
if (this.citationsEnabled) return true;
|
|
1819
|
-
if (!this.citationsAutoDetect) return false;
|
|
1820
|
-
if (mcpSessionId) {
|
|
1821
|
-
const info = this.clientInfoBySession.get(mcpSessionId);
|
|
1822
|
-
if (!info) return false;
|
|
1823
|
-
return this.isCodexClient(info);
|
|
1824
|
-
}
|
|
1825
|
-
if (this.clientInfoBySession.size === 1) {
|
|
1826
|
-
const [info] = [...this.clientInfoBySession.values()];
|
|
1827
|
-
if (info) return this.isCodexClient(info);
|
|
1828
|
-
}
|
|
1829
|
-
return false;
|
|
1830
|
-
}
|
|
1831
|
-
/** Check whether a clientInfo record identifies a Codex adapter client. */
|
|
1832
|
-
isCodexClient(info) {
|
|
1833
|
-
const lowerName = info.name.toLowerCase();
|
|
1834
|
-
return lowerName === "codex-mcp-client" || lowerName.includes("codex");
|
|
1835
|
-
}
|
|
1836
|
-
/**
|
|
1837
|
-
* Build citation metadata for each recall result that has a path.
|
|
1838
|
-
* Line range defaults to 1-1 when not determinable from the summary.
|
|
1839
|
-
*/
|
|
1840
|
-
buildRecallCitations(response) {
|
|
1841
|
-
return response.results.filter((r) => r.path && r.path.length > 0).map((r) => ({
|
|
1842
|
-
memoryId: r.id,
|
|
1843
|
-
path: r.path,
|
|
1844
|
-
lineStart: 1,
|
|
1845
|
-
lineEnd: 1,
|
|
1846
|
-
noteDefault: r.preview?.slice(0, 60) || r.id
|
|
1847
|
-
}));
|
|
1848
|
-
}
|
|
1849
|
-
async callTool(name, args, effectivePrincipal, mcpSessionId) {
|
|
1850
|
-
switch (toLegacyToolName(name)) {
|
|
1851
|
-
case "engram.recall": {
|
|
1852
|
-
let disclosure;
|
|
1853
|
-
if ("disclosure" in args && args.disclosure !== void 0 && args.disclosure !== null) {
|
|
1854
|
-
if (typeof args.disclosure !== "string") {
|
|
1855
|
-
throw new EngramAccessInputError(
|
|
1856
|
-
"disclosure must be a string (one of: chunk, section, raw)"
|
|
1857
|
-
);
|
|
1858
|
-
}
|
|
1859
|
-
disclosure = args.disclosure;
|
|
1860
|
-
}
|
|
1861
|
-
if ("cwd" in args && args.cwd !== void 0 && args.cwd !== null && typeof args.cwd !== "string") {
|
|
1862
|
-
throw new EngramAccessInputError("cwd must be a string");
|
|
1863
|
-
}
|
|
1864
|
-
if ("projectTag" in args && args.projectTag !== void 0 && args.projectTag !== null && typeof args.projectTag !== "string") {
|
|
1865
|
-
throw new EngramAccessInputError("projectTag must be a string");
|
|
1866
|
-
}
|
|
1867
|
-
if ("asOf" in args && args.asOf !== void 0 && args.asOf !== null && typeof args.asOf !== "string") {
|
|
1868
|
-
throw new EngramAccessInputError("asOf must be a string (ISO 8601 timestamp)");
|
|
1869
|
-
}
|
|
1870
|
-
let tags;
|
|
1871
|
-
if ("tags" in args && args.tags !== void 0 && args.tags !== null) {
|
|
1872
|
-
if (!Array.isArray(args.tags) || !args.tags.every((t) => typeof t === "string")) {
|
|
1873
|
-
throw new EngramAccessInputError("tags must be an array of strings");
|
|
1874
|
-
}
|
|
1875
|
-
tags = args.tags;
|
|
1876
|
-
}
|
|
1877
|
-
let tagMatch;
|
|
1878
|
-
if ("tagMatch" in args && args.tagMatch !== void 0 && args.tagMatch !== null) {
|
|
1879
|
-
if (typeof args.tagMatch !== "string" || args.tagMatch !== "any" && args.tagMatch !== "all") {
|
|
1880
|
-
throw new EngramAccessInputError(
|
|
1881
|
-
`tagMatch must be one of: any, all (got: ${String(args.tagMatch)})`
|
|
1882
|
-
);
|
|
1883
|
-
}
|
|
1884
|
-
tagMatch = args.tagMatch;
|
|
1885
|
-
}
|
|
1886
|
-
const response = await this.service.recall({
|
|
1887
|
-
query: typeof args.query === "string" ? args.query : "",
|
|
1888
|
-
sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
|
|
1889
|
-
authenticatedPrincipal: effectivePrincipal,
|
|
1890
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
1891
|
-
topK: typeof args.topK === "number" && Number.isFinite(args.topK) ? args.topK : void 0,
|
|
1892
|
-
mode: typeof args.mode === "string" ? args.mode : void 0,
|
|
1893
|
-
includeDebug: args.includeDebug === true,
|
|
1894
|
-
disclosure,
|
|
1895
|
-
cwd: typeof args.cwd === "string" ? args.cwd : void 0,
|
|
1896
|
-
projectTag: typeof args.projectTag === "string" ? args.projectTag : void 0,
|
|
1897
|
-
asOf: typeof args.asOf === "string" ? args.asOf : void 0,
|
|
1898
|
-
...tags !== void 0 ? { tags } : {},
|
|
1899
|
-
...tagMatch !== void 0 ? { tagMatch } : {}
|
|
1900
|
-
});
|
|
1901
|
-
if (this.shouldEmitCitations(mcpSessionId)) {
|
|
1902
|
-
const citations = this.buildRecallCitations(response);
|
|
1903
|
-
const guidance = buildCitationGuidance(citations);
|
|
1904
|
-
if (guidance.length > 0) {
|
|
1905
|
-
return {
|
|
1906
|
-
...response,
|
|
1907
|
-
context: response.context + guidance,
|
|
1908
|
-
citations
|
|
1909
|
-
};
|
|
1910
|
-
}
|
|
1911
|
-
}
|
|
1912
|
-
return response;
|
|
1913
|
-
}
|
|
1914
|
-
case "engram.recall_explain":
|
|
1915
|
-
return this.service.recallExplain({
|
|
1916
|
-
sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
|
|
1917
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0
|
|
1918
|
-
});
|
|
1919
|
-
case "engram.set_coding_context": {
|
|
1920
|
-
const sessionKey = typeof args.sessionKey === "string" ? args.sessionKey : "";
|
|
1921
|
-
const hasProjectTag = typeof args.projectTag === "string" && args.projectTag.trim().length > 0;
|
|
1922
|
-
const hasCodingContext = "codingContext" in args;
|
|
1923
|
-
if (!hasCodingContext && hasProjectTag) {
|
|
1924
|
-
const tag = args.projectTag.trim();
|
|
1925
|
-
this.service.setCodingContext({
|
|
1926
|
-
sessionKey,
|
|
1927
|
-
codingContext: {
|
|
1928
|
-
projectId: `tag:${tag}`,
|
|
1929
|
-
branch: null,
|
|
1930
|
-
rootPath: `tag:${tag}`,
|
|
1931
|
-
defaultBranch: null
|
|
1932
|
-
}
|
|
1933
|
-
});
|
|
1934
|
-
return { ok: true };
|
|
1935
|
-
}
|
|
1936
|
-
if (!hasCodingContext && !hasProjectTag) {
|
|
1937
|
-
throw new EngramAccessInputError(
|
|
1938
|
-
"set_coding_context requires either codingContext or projectTag"
|
|
1939
|
-
);
|
|
1940
|
-
}
|
|
1941
|
-
const rawCtx = args.codingContext;
|
|
1942
|
-
let codingContext = null;
|
|
1943
|
-
if (rawCtx !== null) {
|
|
1944
|
-
if (typeof rawCtx !== "object" || rawCtx === void 0) {
|
|
1945
|
-
throw new EngramAccessInputError("codingContext must be an object or null");
|
|
1946
|
-
}
|
|
1947
|
-
const obj = rawCtx;
|
|
1948
|
-
const projectId = typeof obj.projectId === "string" ? obj.projectId : "";
|
|
1949
|
-
const rootPath = typeof obj.rootPath === "string" ? obj.rootPath : "";
|
|
1950
|
-
const branch = obj.branch === null ? null : typeof obj.branch === "string" ? obj.branch : void 0;
|
|
1951
|
-
const defaultBranch = obj.defaultBranch === null ? null : typeof obj.defaultBranch === "string" ? obj.defaultBranch : void 0;
|
|
1952
|
-
if (branch === void 0) {
|
|
1953
|
-
throw new EngramAccessInputError("codingContext.branch must be a string or null");
|
|
1954
|
-
}
|
|
1955
|
-
if (defaultBranch === void 0) {
|
|
1956
|
-
throw new EngramAccessInputError("codingContext.defaultBranch must be a string or null");
|
|
1957
|
-
}
|
|
1958
|
-
codingContext = { projectId, branch, rootPath, defaultBranch };
|
|
1959
|
-
}
|
|
1960
|
-
this.service.setCodingContext({ sessionKey, codingContext });
|
|
1961
|
-
return { ok: true };
|
|
1962
|
-
}
|
|
1963
|
-
case "engram.recall_tier_explain":
|
|
1964
|
-
return this.service.recallTierExplain(
|
|
1965
|
-
typeof args.sessionKey === "string" && args.sessionKey.length > 0 ? args.sessionKey : void 0,
|
|
1966
|
-
typeof args.namespace === "string" && args.namespace.length > 0 ? args.namespace : void 0,
|
|
1967
|
-
effectivePrincipal
|
|
1968
|
-
);
|
|
1969
|
-
case "engram.recall_xray": {
|
|
1970
|
-
const query = typeof args.query === "string" ? args.query : "";
|
|
1971
|
-
const sessionKey = typeof args.sessionKey === "string" && args.sessionKey.length > 0 ? args.sessionKey : void 0;
|
|
1972
|
-
const namespace = typeof args.namespace === "string" && args.namespace.length > 0 ? args.namespace : void 0;
|
|
1973
|
-
let budget;
|
|
1974
|
-
if (args.budget !== void 0 && args.budget !== null) {
|
|
1975
|
-
if (typeof args.budget !== "number" && typeof args.budget !== "string") {
|
|
1976
|
-
throw new Error(
|
|
1977
|
-
`engram.recall_xray: budget expects a positive integer; got ${JSON.stringify(args.budget)}`
|
|
1978
|
-
);
|
|
1979
|
-
}
|
|
1980
|
-
const parsed = typeof args.budget === "number" ? args.budget : Number(args.budget);
|
|
1981
|
-
if (!Number.isFinite(parsed) || parsed <= 0 || !Number.isInteger(parsed)) {
|
|
1982
|
-
throw new Error(
|
|
1983
|
-
`engram.recall_xray: budget expects a positive integer; got ${JSON.stringify(args.budget)}`
|
|
1984
|
-
);
|
|
1985
|
-
}
|
|
1986
|
-
budget = parsed;
|
|
1987
|
-
}
|
|
1988
|
-
let disclosure;
|
|
1989
|
-
if ("disclosure" in args && args.disclosure !== void 0 && args.disclosure !== null && args.disclosure !== "") {
|
|
1990
|
-
if (typeof args.disclosure !== "string") {
|
|
1991
|
-
throw new Error(
|
|
1992
|
-
"engram.recall_xray: disclosure must be a string (one of: chunk, section, raw)"
|
|
1993
|
-
);
|
|
1994
|
-
}
|
|
1995
|
-
disclosure = args.disclosure;
|
|
1996
|
-
}
|
|
1997
|
-
return this.service.recallXray({
|
|
1998
|
-
query,
|
|
1999
|
-
sessionKey,
|
|
2000
|
-
namespace,
|
|
2001
|
-
budget,
|
|
2002
|
-
authenticatedPrincipal: effectivePrincipal,
|
|
2003
|
-
...disclosure !== void 0 ? { disclosure } : {}
|
|
2004
|
-
});
|
|
2005
|
-
}
|
|
2006
|
-
case "engram.action_confidence": {
|
|
2007
|
-
const body = parseMcpRequest("actionConfidence", args);
|
|
2008
|
-
return this.service.actionConfidence(body);
|
|
2009
|
-
}
|
|
2010
|
-
case REMNIC_CHATGPT_MEMORY_INSPECTOR_TOOL: {
|
|
2011
|
-
if (typeof args.query !== "string" || args.query.trim().length === 0) {
|
|
2012
|
-
throw new EngramAccessInputError(
|
|
2013
|
-
"chatgpt_memory_inspector requires a non-empty query string"
|
|
2014
|
-
);
|
|
2015
|
-
}
|
|
2016
|
-
if ("sessionKey" in args && args.sessionKey !== void 0 && args.sessionKey !== null && typeof args.sessionKey !== "string") {
|
|
2017
|
-
throw new EngramAccessInputError("sessionKey must be a string");
|
|
2018
|
-
}
|
|
2019
|
-
if ("namespace" in args && args.namespace !== void 0 && args.namespace !== null && typeof args.namespace !== "string") {
|
|
2020
|
-
throw new EngramAccessInputError("namespace must be a string");
|
|
2021
|
-
}
|
|
2022
|
-
let currentContextScopes;
|
|
2023
|
-
if (args.currentContextScopes !== void 0 && args.currentContextScopes !== null) {
|
|
2024
|
-
if (!Array.isArray(args.currentContextScopes) || !args.currentContextScopes.every((scope) => typeof scope === "string")) {
|
|
2025
|
-
throw new EngramAccessInputError(
|
|
2026
|
-
"currentContextScopes must be an array of strings"
|
|
2027
|
-
);
|
|
2028
|
-
}
|
|
2029
|
-
currentContextScopes = args.currentContextScopes;
|
|
2030
|
-
}
|
|
2031
|
-
const input = {
|
|
2032
|
-
query: args.query.trim()
|
|
2033
|
-
};
|
|
2034
|
-
if (typeof args.sessionKey === "string" && args.sessionKey.trim().length > 0) {
|
|
2035
|
-
input.sessionKey = args.sessionKey;
|
|
2036
|
-
}
|
|
2037
|
-
if (typeof args.namespace === "string" && args.namespace.trim().length > 0) {
|
|
2038
|
-
input.namespace = args.namespace;
|
|
2039
|
-
}
|
|
2040
|
-
if (currentContextScopes !== void 0) {
|
|
2041
|
-
input.currentContextScopes = currentContextScopes;
|
|
2042
|
-
}
|
|
2043
|
-
const recallSessionKey = resolveChatGptInspectorRecallSessionKey(
|
|
2044
|
-
input.sessionKey,
|
|
2045
|
-
effectivePrincipal
|
|
2046
|
-
);
|
|
2047
|
-
const xrayResponse = await this.service.recallXray({
|
|
2048
|
-
query: input.query,
|
|
2049
|
-
sessionKey: recallSessionKey,
|
|
2050
|
-
namespace: input.namespace,
|
|
2051
|
-
currentContextScopes: input.currentContextScopes,
|
|
2052
|
-
authenticatedPrincipal: effectivePrincipal,
|
|
2053
|
-
mode: "full",
|
|
2054
|
-
disclosure: "chunk",
|
|
2055
|
-
includeRecall: true
|
|
2056
|
-
});
|
|
2057
|
-
const xray = xrayResponse.snapshotFound === true ? xrayResponse.snapshot ?? null : null;
|
|
2058
|
-
const recall = xrayResponse.recall ?? {
|
|
2059
|
-
query: input.query,
|
|
2060
|
-
namespace: input.namespace ?? xray?.namespace ?? "global",
|
|
2061
|
-
context: "",
|
|
2062
|
-
count: 0,
|
|
2063
|
-
memoryIds: [],
|
|
2064
|
-
results: [],
|
|
2065
|
-
fallbackUsed: false,
|
|
2066
|
-
sourcesUsed: [],
|
|
2067
|
-
disclosure: "chunk"
|
|
2068
|
-
};
|
|
2069
|
-
const actionRequest = buildChatGptMemoryInspectorActionRequest(
|
|
2070
|
-
input,
|
|
2071
|
-
recall,
|
|
2072
|
-
xray
|
|
2073
|
-
);
|
|
2074
|
-
const actionConfidence = await this.service.actionConfidence(actionRequest);
|
|
2075
|
-
return buildChatGptMemoryInspectorResult(
|
|
2076
|
-
input,
|
|
2077
|
-
recall,
|
|
2078
|
-
xray,
|
|
2079
|
-
actionConfidence
|
|
2080
|
-
);
|
|
2081
|
-
}
|
|
2082
|
-
case "engram.day_summary":
|
|
2083
|
-
return this.service.daySummary({
|
|
2084
|
-
memories: typeof args.memories === "string" ? args.memories : "",
|
|
2085
|
-
sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
|
|
2086
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0
|
|
2087
|
-
});
|
|
2088
|
-
case "engram.capsule_export": {
|
|
2089
|
-
const body = parseMcpRequest("capsuleExport", args);
|
|
2090
|
-
return this.service.capsuleExport({
|
|
2091
|
-
name: body.name,
|
|
2092
|
-
namespace: body.namespace,
|
|
2093
|
-
principal: effectivePrincipal,
|
|
2094
|
-
since: body.since,
|
|
2095
|
-
includeKinds: body.includeKinds,
|
|
2096
|
-
peerIds: body.peerIds,
|
|
2097
|
-
includeTranscripts: body.includeTranscripts,
|
|
2098
|
-
encrypt: body.encrypt
|
|
2099
|
-
});
|
|
2100
|
-
}
|
|
2101
|
-
case "engram.capsule_import": {
|
|
2102
|
-
const body = parseMcpRequest("capsuleImport", args);
|
|
2103
|
-
return this.service.capsuleImport({
|
|
2104
|
-
archivePath: expandTildePath(body.archivePath),
|
|
2105
|
-
namespace: body.namespace,
|
|
2106
|
-
principal: effectivePrincipal,
|
|
2107
|
-
mode: body.mode
|
|
2108
|
-
});
|
|
2109
|
-
}
|
|
2110
|
-
case "engram.capsule_list": {
|
|
2111
|
-
const body = parseMcpRequest("capsuleList", args);
|
|
2112
|
-
return this.service.capsuleList({
|
|
2113
|
-
namespace: body.namespace,
|
|
2114
|
-
principal: effectivePrincipal
|
|
2115
|
-
});
|
|
2116
|
-
}
|
|
2117
|
-
case "engram.memory_governance_run":
|
|
2118
|
-
return this.service.governanceRun({
|
|
2119
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2120
|
-
mode: args.mode === "apply" ? "apply" : "shadow",
|
|
2121
|
-
recentDays: typeof args.recentDays === "number" && Number.isFinite(args.recentDays) ? args.recentDays : void 0,
|
|
2122
|
-
maxMemories: typeof args.maxMemories === "number" && Number.isFinite(args.maxMemories) ? args.maxMemories : void 0,
|
|
2123
|
-
batchSize: typeof args.batchSize === "number" && Number.isFinite(args.batchSize) ? args.batchSize : void 0,
|
|
2124
|
-
authenticatedPrincipal: effectivePrincipal
|
|
2125
|
-
}, effectivePrincipal);
|
|
2126
|
-
case "engram.procedure_mining_run":
|
|
2127
|
-
return this.service.procedureMiningRun(
|
|
2128
|
-
{
|
|
2129
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2130
|
-
authenticatedPrincipal: effectivePrincipal
|
|
2131
|
-
},
|
|
2132
|
-
effectivePrincipal
|
|
2133
|
-
);
|
|
2134
|
-
case "engram.pattern_reinforcement_run":
|
|
2135
|
-
return this.service.patternReinforcementRun(
|
|
2136
|
-
{
|
|
2137
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2138
|
-
authenticatedPrincipal: effectivePrincipal,
|
|
2139
|
-
force: args.force === true
|
|
2140
|
-
},
|
|
2141
|
-
effectivePrincipal
|
|
2142
|
-
);
|
|
2143
|
-
case "remnic.procedural_stats":
|
|
2144
|
-
case "engram.procedural_stats":
|
|
2145
|
-
return this.service.procedureStats(
|
|
2146
|
-
{
|
|
2147
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0
|
|
2148
|
-
},
|
|
2149
|
-
effectivePrincipal
|
|
2150
|
-
);
|
|
2151
|
-
case "engram.memory_get":
|
|
2152
|
-
return this.service.memoryGet(
|
|
2153
|
-
typeof args.memoryId === "string" ? args.memoryId : "",
|
|
2154
|
-
typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2155
|
-
effectivePrincipal
|
|
2156
|
-
);
|
|
2157
|
-
case "engram.memory_timeline": {
|
|
2158
|
-
const limit = typeof args.limit === "number" && Number.isFinite(args.limit) ? args.limit : 200;
|
|
2159
|
-
return this.service.memoryTimeline(
|
|
2160
|
-
typeof args.memoryId === "string" ? args.memoryId : "",
|
|
2161
|
-
typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2162
|
-
limit,
|
|
2163
|
-
effectivePrincipal
|
|
2164
|
-
);
|
|
2165
|
-
}
|
|
2166
|
-
case "engram.memory_store":
|
|
2167
|
-
return this.service.memoryStore({
|
|
2168
|
-
schemaVersion: typeof args.schemaVersion === "number" ? args.schemaVersion : void 0,
|
|
2169
|
-
idempotencyKey: typeof args.idempotencyKey === "string" ? args.idempotencyKey : void 0,
|
|
2170
|
-
dryRun: args.dryRun === true,
|
|
2171
|
-
sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
|
|
2172
|
-
authenticatedPrincipal: effectivePrincipal,
|
|
2173
|
-
content: typeof args.content === "string" ? args.content : "",
|
|
2174
|
-
category: typeof args.category === "string" ? args.category : void 0,
|
|
2175
|
-
confidence: typeof args.confidence === "number" ? args.confidence : void 0,
|
|
2176
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2177
|
-
tags: Array.isArray(args.tags) ? args.tags.filter((tag) => typeof tag === "string") : void 0,
|
|
2178
|
-
entityRef: typeof args.entityRef === "string" ? args.entityRef : void 0,
|
|
2179
|
-
ttl: typeof args.ttl === "string" ? args.ttl : void 0,
|
|
2180
|
-
sourceReason: typeof args.sourceReason === "string" ? args.sourceReason : void 0
|
|
2181
|
-
});
|
|
2182
|
-
case "engram.suggestion_submit":
|
|
2183
|
-
return this.service.suggestionSubmit({
|
|
2184
|
-
schemaVersion: typeof args.schemaVersion === "number" ? args.schemaVersion : void 0,
|
|
2185
|
-
idempotencyKey: typeof args.idempotencyKey === "string" ? args.idempotencyKey : void 0,
|
|
2186
|
-
dryRun: args.dryRun === true,
|
|
2187
|
-
sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
|
|
2188
|
-
authenticatedPrincipal: effectivePrincipal,
|
|
2189
|
-
content: typeof args.content === "string" ? args.content : "",
|
|
2190
|
-
category: typeof args.category === "string" ? args.category : void 0,
|
|
2191
|
-
confidence: typeof args.confidence === "number" ? args.confidence : void 0,
|
|
2192
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2193
|
-
tags: Array.isArray(args.tags) ? args.tags.filter((tag) => typeof tag === "string") : void 0,
|
|
2194
|
-
entityRef: typeof args.entityRef === "string" ? args.entityRef : void 0,
|
|
2195
|
-
ttl: typeof args.ttl === "string" ? args.ttl : void 0,
|
|
2196
|
-
sourceReason: typeof args.sourceReason === "string" ? args.sourceReason : void 0
|
|
2197
|
-
});
|
|
2198
|
-
case "engram.entity_get":
|
|
2199
|
-
return this.service.entityGet(
|
|
2200
|
-
typeof args.name === "string" ? args.name : "",
|
|
2201
|
-
typeof args.namespace === "string" ? args.namespace : void 0
|
|
2202
|
-
);
|
|
2203
|
-
case "engram.review_queue_list":
|
|
2204
|
-
return this.service.reviewQueue(
|
|
2205
|
-
typeof args.runId === "string" ? args.runId : void 0,
|
|
2206
|
-
typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2207
|
-
effectivePrincipal
|
|
2208
|
-
);
|
|
2209
|
-
case "engram.observe": {
|
|
2210
|
-
const body = parseMcpRequest("observe", args);
|
|
2211
|
-
return this.service.observe({
|
|
2212
|
-
sessionKey: body.sessionKey,
|
|
2213
|
-
messages: body.messages.map((message) => ({
|
|
2214
|
-
role: message.role,
|
|
2215
|
-
content: message.content,
|
|
2216
|
-
parts: message.parts ?? void 0,
|
|
2217
|
-
rawContent: message.rawContent ?? void 0,
|
|
2218
|
-
sourceFormat: message.sourceFormat ?? void 0
|
|
2219
|
-
})),
|
|
2220
|
-
namespace: body.namespace,
|
|
2221
|
-
authenticatedPrincipal: effectivePrincipal,
|
|
2222
|
-
skipExtraction: body.skipExtraction === true,
|
|
2223
|
-
cwd: body.cwd,
|
|
2224
|
-
projectTag: body.projectTag
|
|
2225
|
-
});
|
|
2226
|
-
}
|
|
2227
|
-
case "engram.lcm_search":
|
|
2228
|
-
return this.service.lcmSearch({
|
|
2229
|
-
query: typeof args.query === "string" ? args.query : "",
|
|
2230
|
-
sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
|
|
2231
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2232
|
-
limit: typeof args.limit === "number" && Number.isFinite(args.limit) ? args.limit : void 0,
|
|
2233
|
-
authenticatedPrincipal: effectivePrincipal
|
|
2234
|
-
});
|
|
2235
|
-
case "engram.lcm_compaction_flush": {
|
|
2236
|
-
const body = parseMcpRequest("lcmCompactionFlush", args);
|
|
2237
|
-
return this.service.lcmCompactionFlush({
|
|
2238
|
-
sessionKey: body.sessionKey,
|
|
2239
|
-
namespace: body.namespace,
|
|
2240
|
-
authenticatedPrincipal: effectivePrincipal
|
|
2241
|
-
});
|
|
2242
|
-
}
|
|
2243
|
-
case "engram.lcm_compaction_record": {
|
|
2244
|
-
const body = parseMcpRequest("lcmCompactionRecord", args);
|
|
2245
|
-
return this.service.lcmCompactionRecord({
|
|
2246
|
-
sessionKey: body.sessionKey,
|
|
2247
|
-
namespace: body.namespace,
|
|
2248
|
-
tokensBefore: body.tokensBefore,
|
|
2249
|
-
tokensAfter: body.tokensAfter,
|
|
2250
|
-
authenticatedPrincipal: effectivePrincipal
|
|
2251
|
-
});
|
|
2252
|
-
}
|
|
2253
|
-
// ── Continuity / Identity tools ───────────────────────────────────
|
|
2254
|
-
case "engram.continuity_audit_generate":
|
|
2255
|
-
return this.service.continuityAuditGenerate({
|
|
2256
|
-
period: args.period === "monthly" ? "monthly" : args.period === "weekly" ? "weekly" : void 0,
|
|
2257
|
-
key: typeof args.key === "string" ? args.key : void 0
|
|
2258
|
-
});
|
|
2259
|
-
case "engram.continuity_incident_open":
|
|
2260
|
-
return this.service.continuityIncidentOpen({
|
|
2261
|
-
symptom: typeof args.symptom === "string" ? args.symptom : "",
|
|
2262
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2263
|
-
principal: effectivePrincipal,
|
|
2264
|
-
triggerWindow: typeof args.triggerWindow === "string" ? args.triggerWindow : void 0,
|
|
2265
|
-
suspectedCause: typeof args.suspectedCause === "string" ? args.suspectedCause : void 0
|
|
2266
|
-
});
|
|
2267
|
-
case "engram.continuity_incident_close":
|
|
2268
|
-
return this.service.continuityIncidentClose({
|
|
2269
|
-
id: typeof args.id === "string" ? args.id : "",
|
|
2270
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2271
|
-
principal: effectivePrincipal,
|
|
2272
|
-
fixApplied: typeof args.fixApplied === "string" ? args.fixApplied : "",
|
|
2273
|
-
verificationResult: typeof args.verificationResult === "string" ? args.verificationResult : "",
|
|
2274
|
-
preventiveRule: typeof args.preventiveRule === "string" ? args.preventiveRule : void 0
|
|
2275
|
-
});
|
|
2276
|
-
case "engram.continuity_incident_list":
|
|
2277
|
-
return this.service.continuityIncidentList({
|
|
2278
|
-
state: args.state === "closed" ? "closed" : args.state === "all" ? "all" : args.state === "open" ? "open" : void 0,
|
|
2279
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2280
|
-
principal: effectivePrincipal,
|
|
2281
|
-
limit: typeof args.limit === "number" ? args.limit : void 0
|
|
2282
|
-
});
|
|
2283
|
-
case "engram.continuity_loop_add_or_update":
|
|
2284
|
-
return this.service.continuityLoopAddOrUpdate({
|
|
2285
|
-
id: typeof args.id === "string" ? args.id : "",
|
|
2286
|
-
cadence: args.cadence ?? "weekly",
|
|
2287
|
-
purpose: typeof args.purpose === "string" ? args.purpose : "",
|
|
2288
|
-
status: args.status ?? "active",
|
|
2289
|
-
killCondition: typeof args.killCondition === "string" ? args.killCondition : "",
|
|
2290
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2291
|
-
principal: effectivePrincipal,
|
|
2292
|
-
lastReviewed: typeof args.lastReviewed === "string" ? args.lastReviewed : void 0,
|
|
2293
|
-
notes: typeof args.notes === "string" ? args.notes : void 0
|
|
2294
|
-
});
|
|
2295
|
-
case "engram.continuity_loop_review":
|
|
2296
|
-
return this.service.continuityLoopReview({
|
|
2297
|
-
id: typeof args.id === "string" ? args.id : "",
|
|
2298
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2299
|
-
principal: effectivePrincipal,
|
|
2300
|
-
status: args.status === "active" || args.status === "paused" || args.status === "retired" ? args.status : void 0,
|
|
2301
|
-
notes: typeof args.notes === "string" ? args.notes : void 0,
|
|
2302
|
-
reviewedAt: typeof args.reviewedAt === "string" ? args.reviewedAt : void 0
|
|
2303
|
-
});
|
|
2304
|
-
case "engram.identity_anchor_get":
|
|
2305
|
-
return this.service.identityAnchorGet({
|
|
2306
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2307
|
-
principal: effectivePrincipal
|
|
2308
|
-
});
|
|
2309
|
-
case "engram.identity_anchor_update":
|
|
2310
|
-
return this.service.identityAnchorUpdate({
|
|
2311
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2312
|
-
principal: effectivePrincipal,
|
|
2313
|
-
identityTraits: typeof args.identityTraits === "string" ? args.identityTraits : void 0,
|
|
2314
|
-
communicationPreferences: typeof args.communicationPreferences === "string" ? args.communicationPreferences : void 0,
|
|
2315
|
-
operatingPrinciples: typeof args.operatingPrinciples === "string" ? args.operatingPrinciples : void 0,
|
|
2316
|
-
continuityNotes: typeof args.continuityNotes === "string" ? args.continuityNotes : void 0
|
|
2317
|
-
});
|
|
2318
|
-
case "engram.memory_identity":
|
|
2319
|
-
return this.service.memoryIdentity({
|
|
2320
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2321
|
-
principal: effectivePrincipal
|
|
2322
|
-
});
|
|
2323
|
-
// ── Work Layer tools ──────────────────────────────────────────────
|
|
2324
|
-
case "engram.work_task":
|
|
2325
|
-
return this.service.workTask({
|
|
2326
|
-
action: args.action ?? "list",
|
|
2327
|
-
id: typeof args.id === "string" ? args.id : void 0,
|
|
2328
|
-
title: typeof args.title === "string" ? args.title : void 0,
|
|
2329
|
-
description: typeof args.description === "string" ? args.description : void 0,
|
|
2330
|
-
status: typeof args.status === "string" ? args.status : void 0,
|
|
2331
|
-
priority: typeof args.priority === "string" ? args.priority : void 0,
|
|
2332
|
-
owner: typeof args.owner === "string" ? args.owner : void 0,
|
|
2333
|
-
assignee: typeof args.assignee === "string" ? args.assignee : void 0,
|
|
2334
|
-
projectId: typeof args.projectId === "string" ? args.projectId : void 0,
|
|
2335
|
-
tags: Array.isArray(args.tags) ? args.tags.filter((x) => typeof x === "string") : void 0,
|
|
2336
|
-
dueAt: typeof args.dueAt === "string" ? args.dueAt : void 0
|
|
2337
|
-
});
|
|
2338
|
-
case "engram.work_project":
|
|
2339
|
-
return this.service.workProject({
|
|
2340
|
-
action: args.action ?? "list",
|
|
2341
|
-
id: typeof args.id === "string" ? args.id : void 0,
|
|
2342
|
-
name: typeof args.name === "string" ? args.name : void 0,
|
|
2343
|
-
description: typeof args.description === "string" ? args.description : void 0,
|
|
2344
|
-
status: typeof args.status === "string" ? args.status : void 0,
|
|
2345
|
-
owner: typeof args.owner === "string" ? args.owner : void 0,
|
|
2346
|
-
tags: Array.isArray(args.tags) ? args.tags.filter((x) => typeof x === "string") : void 0,
|
|
2347
|
-
taskId: typeof args.taskId === "string" ? args.taskId : void 0,
|
|
2348
|
-
projectId: typeof args.projectId === "string" ? args.projectId : void 0
|
|
2349
|
-
});
|
|
2350
|
-
case "engram.work_board":
|
|
2351
|
-
return this.service.workBoard({
|
|
2352
|
-
action: args.action ?? "export_markdown",
|
|
2353
|
-
projectId: typeof args.projectId === "string" ? args.projectId : void 0,
|
|
2354
|
-
snapshotJson: typeof args.snapshotJson === "string" ? args.snapshotJson : void 0,
|
|
2355
|
-
linkToMemory: args.linkToMemory === true
|
|
2356
|
-
});
|
|
2357
|
-
// ── Shared Context / Compounding tools ─────────────────────────
|
|
2358
|
-
case "engram.shared_context_write_output":
|
|
2359
|
-
return this.service.sharedContextWriteOutput({
|
|
2360
|
-
agentId: typeof args.agentId === "string" ? args.agentId : "",
|
|
2361
|
-
title: typeof args.title === "string" ? args.title : "",
|
|
2362
|
-
content: typeof args.content === "string" ? args.content : ""
|
|
2363
|
-
});
|
|
2364
|
-
case "engram.shared_feedback_record":
|
|
2365
|
-
return this.service.sharedFeedbackRecord({
|
|
2366
|
-
agent: typeof args.agent === "string" ? args.agent : "",
|
|
2367
|
-
decision: args.decision ?? "approved",
|
|
2368
|
-
reason: typeof args.reason === "string" ? args.reason : "",
|
|
2369
|
-
date: typeof args.date === "string" ? args.date : void 0,
|
|
2370
|
-
learning: typeof args.learning === "string" ? args.learning : void 0,
|
|
2371
|
-
outcome: typeof args.outcome === "string" ? args.outcome : void 0,
|
|
2372
|
-
severity: args.severity === "low" || args.severity === "medium" || args.severity === "high" ? args.severity : void 0,
|
|
2373
|
-
confidence: typeof args.confidence === "number" ? args.confidence : void 0,
|
|
2374
|
-
workflow: typeof args.workflow === "string" ? args.workflow : void 0,
|
|
2375
|
-
tags: Array.isArray(args.tags) ? args.tags.filter((x) => typeof x === "string") : void 0,
|
|
2376
|
-
evidenceWindowStart: typeof args.evidenceWindowStart === "string" ? args.evidenceWindowStart : void 0,
|
|
2377
|
-
evidenceWindowEnd: typeof args.evidenceWindowEnd === "string" ? args.evidenceWindowEnd : void 0,
|
|
2378
|
-
refs: Array.isArray(args.refs) ? args.refs.filter((x) => typeof x === "string") : void 0
|
|
2379
|
-
});
|
|
2380
|
-
case "engram.shared_priorities_append":
|
|
2381
|
-
return this.service.sharedPrioritiesAppend({
|
|
2382
|
-
agentId: typeof args.agentId === "string" ? args.agentId : "",
|
|
2383
|
-
text: typeof args.text === "string" ? args.text : ""
|
|
2384
|
-
});
|
|
2385
|
-
case "engram.shared_context_cross_signals_run":
|
|
2386
|
-
return this.service.sharedContextCrossSignalsRun({
|
|
2387
|
-
date: typeof args.date === "string" ? args.date : void 0
|
|
2388
|
-
});
|
|
2389
|
-
case "engram.shared_context_curate_daily":
|
|
2390
|
-
return this.service.sharedContextCurateDaily({
|
|
2391
|
-
date: typeof args.date === "string" ? args.date : void 0
|
|
2392
|
-
});
|
|
2393
|
-
case "engram.compounding_weekly_synthesize":
|
|
2394
|
-
return this.service.compoundingWeeklySynthesize({
|
|
2395
|
-
weekId: typeof args.weekId === "string" ? args.weekId : void 0
|
|
2396
|
-
});
|
|
2397
|
-
case "engram.compounding_promote_candidate":
|
|
2398
|
-
return this.service.compoundingPromoteCandidate({
|
|
2399
|
-
weekId: typeof args.weekId === "string" ? args.weekId : "",
|
|
2400
|
-
candidateId: typeof args.candidateId === "string" ? args.candidateId : "",
|
|
2401
|
-
dryRun: args.dryRun === true
|
|
2402
|
-
});
|
|
2403
|
-
// ── Compression Guidelines tools ───────────────────────────────────
|
|
2404
|
-
case "engram.compression_guidelines_optimize":
|
|
2405
|
-
return this.service.compressionGuidelinesOptimize({
|
|
2406
|
-
dryRun: args.dryRun === true,
|
|
2407
|
-
eventLimit: typeof args.eventLimit === "number" ? args.eventLimit : void 0
|
|
2408
|
-
});
|
|
2409
|
-
case "engram.compression_guidelines_activate":
|
|
2410
|
-
return this.service.compressionGuidelinesActivate({
|
|
2411
|
-
expectedContentHash: typeof args.expectedContentHash === "string" ? args.expectedContentHash : void 0,
|
|
2412
|
-
expectedGuidelineVersion: typeof args.expectedGuidelineVersion === "number" ? args.expectedGuidelineVersion : void 0
|
|
2413
|
-
});
|
|
2414
|
-
// ── Memory search & debug tools ──────────────────────────────────
|
|
2415
|
-
case "engram.memory_search":
|
|
2416
|
-
return this.service.memorySearch({
|
|
2417
|
-
query: typeof args.query === "string" ? args.query : "",
|
|
2418
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2419
|
-
maxResults: typeof args.maxResults === "number" && Number.isFinite(args.maxResults) ? args.maxResults : void 0,
|
|
2420
|
-
collection: typeof args.collection === "string" ? args.collection : void 0,
|
|
2421
|
-
principal: effectivePrincipal
|
|
2422
|
-
});
|
|
2423
|
-
case "engram.memory_profile":
|
|
2424
|
-
return this.service.memoryProfile(
|
|
2425
|
-
typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2426
|
-
effectivePrincipal
|
|
2427
|
-
);
|
|
2428
|
-
case "engram.memory_entities_list":
|
|
2429
|
-
return this.service.memoryEntitiesList(
|
|
2430
|
-
typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2431
|
-
effectivePrincipal
|
|
2432
|
-
);
|
|
2433
|
-
case "engram.memory_questions":
|
|
2434
|
-
return this.service.memoryQuestions(
|
|
2435
|
-
typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2436
|
-
effectivePrincipal
|
|
2437
|
-
);
|
|
2438
|
-
case "engram.memory_last_recall":
|
|
2439
|
-
return this.service.lastRecallSnapshot(
|
|
2440
|
-
typeof args.sessionKey === "string" ? args.sessionKey : void 0
|
|
2441
|
-
);
|
|
2442
|
-
case "engram.memory_intent_debug":
|
|
2443
|
-
return this.service.intentDebug(
|
|
2444
|
-
typeof args.namespace === "string" ? args.namespace : void 0
|
|
2445
|
-
);
|
|
2446
|
-
case "engram.memory_qmd_debug":
|
|
2447
|
-
return this.service.qmdDebug(
|
|
2448
|
-
typeof args.namespace === "string" ? args.namespace : void 0
|
|
2449
|
-
);
|
|
2450
|
-
case "engram.memory_graph_explain":
|
|
2451
|
-
return this.service.graphExplainLastRecall(
|
|
2452
|
-
typeof args.namespace === "string" ? args.namespace : void 0
|
|
2453
|
-
);
|
|
2454
|
-
case "engram.graph_snapshot": {
|
|
2455
|
-
if (args.limit !== void 0 && typeof args.limit !== "number") {
|
|
2456
|
-
throw new Error("engram.graph_snapshot: limit must be a number");
|
|
2457
|
-
}
|
|
2458
|
-
if (args.since !== void 0 && typeof args.since !== "string") {
|
|
2459
|
-
throw new Error("engram.graph_snapshot: since must be a string");
|
|
2460
|
-
}
|
|
2461
|
-
if (args.focusNodeId !== void 0 && typeof args.focusNodeId !== "string") {
|
|
2462
|
-
throw new Error("engram.graph_snapshot: focusNodeId must be a string");
|
|
2463
|
-
}
|
|
2464
|
-
let categories;
|
|
2465
|
-
if (args.categories !== void 0) {
|
|
2466
|
-
if (!Array.isArray(args.categories)) {
|
|
2467
|
-
throw new Error(
|
|
2468
|
-
"engram.graph_snapshot: categories must be an array of strings"
|
|
2469
|
-
);
|
|
2470
|
-
}
|
|
2471
|
-
categories = args.categories.map((value, index) => {
|
|
2472
|
-
if (typeof value !== "string") {
|
|
2473
|
-
throw new Error(
|
|
2474
|
-
`engram.graph_snapshot: categories[${index}] must be a string`
|
|
2475
|
-
);
|
|
2476
|
-
}
|
|
2477
|
-
return value;
|
|
2478
|
-
});
|
|
2479
|
-
}
|
|
2480
|
-
return this.service.graphSnapshot(
|
|
2481
|
-
{
|
|
2482
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2483
|
-
limit: typeof args.limit === "number" ? args.limit : void 0,
|
|
2484
|
-
since: typeof args.since === "string" ? args.since : void 0,
|
|
2485
|
-
focusNodeId: typeof args.focusNodeId === "string" ? args.focusNodeId : void 0,
|
|
2486
|
-
...categories !== void 0 ? { categories } : {}
|
|
2487
|
-
},
|
|
2488
|
-
effectivePrincipal
|
|
2489
|
-
);
|
|
2490
|
-
}
|
|
2491
|
-
case "engram.memory_feedback":
|
|
2492
|
-
return this.service.memoryFeedback({
|
|
2493
|
-
memoryId: typeof args.memoryId === "string" ? args.memoryId : "",
|
|
2494
|
-
vote: args.vote === "down" ? "down" : "up",
|
|
2495
|
-
note: typeof args.note === "string" ? args.note : void 0
|
|
2496
|
-
});
|
|
2497
|
-
case "engram.memory_promote":
|
|
2498
|
-
return this.service.memoryPromote({
|
|
2499
|
-
memoryId: typeof args.memoryId === "string" ? args.memoryId : "",
|
|
2500
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2501
|
-
principal: effectivePrincipal,
|
|
2502
|
-
sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0
|
|
2503
|
-
});
|
|
2504
|
-
case "engram.memory_outcome": {
|
|
2505
|
-
const outcome = args.outcome;
|
|
2506
|
-
if (outcome !== "success" && outcome !== "failure") {
|
|
2507
|
-
throw new Error(
|
|
2508
|
-
`engram.memory_outcome: outcome must be "success" or "failure"; got ${JSON.stringify(outcome)}`
|
|
2509
|
-
);
|
|
2510
|
-
}
|
|
2511
|
-
return this.service.memoryOutcome({
|
|
2512
|
-
memoryId: typeof args.memoryId === "string" ? args.memoryId : "",
|
|
2513
|
-
outcome,
|
|
2514
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2515
|
-
principal: effectivePrincipal,
|
|
2516
|
-
sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
|
|
2517
|
-
timestamp: typeof args.timestamp === "string" ? args.timestamp : void 0
|
|
2518
|
-
});
|
|
2519
|
-
}
|
|
2520
|
-
case "engram.memory_action_apply":
|
|
2521
|
-
return this.service.memoryActionApply({
|
|
2522
|
-
action: typeof args.action === "string" ? args.action : "",
|
|
2523
|
-
outcome: typeof args.outcome === "string" ? args.outcome : void 0,
|
|
2524
|
-
reason: typeof args.reason === "string" ? args.reason : void 0,
|
|
2525
|
-
memoryId: typeof args.memoryId === "string" ? args.memoryId : void 0,
|
|
2526
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2527
|
-
principal: effectivePrincipal,
|
|
2528
|
-
sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
|
|
2529
|
-
content: typeof args.content === "string" ? args.content : void 0,
|
|
2530
|
-
category: typeof args.category === "string" ? args.category : void 0,
|
|
2531
|
-
linkTargetId: typeof args.linkTargetId === "string" ? args.linkTargetId : void 0,
|
|
2532
|
-
linkType: typeof args.linkType === "string" ? args.linkType : void 0,
|
|
2533
|
-
linkStrength: typeof args.linkStrength === "number" ? args.linkStrength : void 0,
|
|
2534
|
-
artifactType: typeof args.artifactType === "string" ? args.artifactType : void 0,
|
|
2535
|
-
execute: typeof args.execute === "boolean" ? args.execute : void 0,
|
|
2536
|
-
sourcePrompt: typeof args.sourcePrompt === "string" ? args.sourcePrompt : void 0,
|
|
2537
|
-
dryRun: args.dryRun === true
|
|
2538
|
-
});
|
|
2539
|
-
case "engram.context_checkpoint":
|
|
2540
|
-
return this.service.contextCheckpoint({
|
|
2541
|
-
sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : "",
|
|
2542
|
-
context: typeof args.context === "string" ? args.context : "",
|
|
2543
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2544
|
-
principal: effectivePrincipal
|
|
2545
|
-
});
|
|
2546
|
-
// ── Daily Context Briefing (#370) ───────────────────────────────────
|
|
2547
|
-
case "engram.briefing": {
|
|
2548
|
-
const rawFormat = typeof args.format === "string" ? args.format : void 0;
|
|
2549
|
-
const formatErr = validateBriefingFormat(rawFormat);
|
|
2550
|
-
if (formatErr) throw new Error(formatErr);
|
|
2551
|
-
return this.service.briefing({
|
|
2552
|
-
since: typeof args.since === "string" ? args.since : void 0,
|
|
2553
|
-
focus: typeof args.focus === "string" ? args.focus : void 0,
|
|
2554
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2555
|
-
format: rawFormat,
|
|
2556
|
-
maxFollowups: typeof args.maxFollowups === "number" ? args.maxFollowups : void 0,
|
|
2557
|
-
principal: effectivePrincipal
|
|
2558
|
-
});
|
|
2559
|
-
}
|
|
2560
|
-
// ── Contradiction Review (issue #520) ──────────────────────────────────
|
|
2561
|
-
case "engram.review_list":
|
|
2562
|
-
case "remnic.review_list": {
|
|
2563
|
-
const { listPairs } = await import("./contradiction-review-5LTTVDQV.js");
|
|
2564
|
-
const VALID_REVIEW_FILTERS = /* @__PURE__ */ new Set(["all", "unresolved", "contradicts", "independent", "duplicates", "needs-user"]);
|
|
2565
|
-
const rawFilter = typeof args.filter === "string" ? args.filter : "unresolved";
|
|
2566
|
-
if (!VALID_REVIEW_FILTERS.has(rawFilter)) {
|
|
2567
|
-
throw new Error(`Invalid filter '${rawFilter}'. Valid: ${[...VALID_REVIEW_FILTERS].join(", ")}`);
|
|
2568
|
-
}
|
|
2569
|
-
const filter = rawFilter;
|
|
2570
|
-
const ns = typeof args.namespace === "string" ? args.namespace : void 0;
|
|
2571
|
-
const limit = typeof args.limit === "number" ? args.limit : 50;
|
|
2572
|
-
return listPairs(this.service.memoryDir, { filter, namespace: ns, limit });
|
|
2573
|
-
}
|
|
2574
|
-
case "engram.review_resolve":
|
|
2575
|
-
case "remnic.review_resolve": {
|
|
2576
|
-
const pairId = typeof args.pairId === "string" ? args.pairId : "";
|
|
2577
|
-
const verb = typeof args.verb === "string" ? args.verb : "";
|
|
2578
|
-
if (!pairId) throw new Error("pairId is required");
|
|
2579
|
-
if (!verb) throw new Error("verb is required");
|
|
2580
|
-
const { isValidResolutionVerb } = await import("./resolution-YGIBORXI.js");
|
|
2581
|
-
if (!isValidResolutionVerb(verb)) throw new Error(`Invalid verb: ${verb}. Must be one of: keep-a, keep-b, merge, both-valid, needs-more-context`);
|
|
2582
|
-
const { executeResolution } = await import("./resolution-YGIBORXI.js");
|
|
2583
|
-
return executeResolution(this.service.memoryDir, this.service.storageRef, pairId, verb);
|
|
2584
|
-
}
|
|
2585
|
-
case "engram.contradiction_scan_run":
|
|
2586
|
-
case "remnic.contradiction_scan_run": {
|
|
2587
|
-
const { runContradictionScan } = await import("./contradiction-scan-QTXAMBUA.js");
|
|
2588
|
-
return runContradictionScan({
|
|
2589
|
-
storage: this.service.storageRef,
|
|
2590
|
-
config: this.service.configRef,
|
|
2591
|
-
memoryDir: this.service.memoryDir,
|
|
2592
|
-
embeddingLookupFactory: this.service.embeddingLookupFactoryRef,
|
|
2593
|
-
localLlm: this.service.localLlmRef,
|
|
2594
|
-
fallbackLlm: this.service.fallbackLlmRef,
|
|
2595
|
-
namespace: typeof args.namespace === "string" ? args.namespace : void 0
|
|
2596
|
-
});
|
|
2597
|
-
}
|
|
2598
|
-
case "engram.memory_summarize_hourly":
|
|
2599
|
-
case "remnic.memory_summarize_hourly":
|
|
2600
|
-
return this.service.memorySummarizeHourly();
|
|
2601
|
-
case "engram.conversation_index_update":
|
|
2602
|
-
case "remnic.conversation_index_update": {
|
|
2603
|
-
if ("sessionKey" in args && args.sessionKey !== void 0 && typeof args.sessionKey !== "string") {
|
|
2604
|
-
throw new Error("sessionKey must be a string when provided");
|
|
2605
|
-
}
|
|
2606
|
-
const sessionKey = typeof args.sessionKey === "string" ? args.sessionKey : void 0;
|
|
2607
|
-
return this.service.conversationIndexUpdate({
|
|
2608
|
-
sessionKey,
|
|
2609
|
-
hours: typeof args.hours === "number" && Number.isFinite(args.hours) ? args.hours : void 0,
|
|
2610
|
-
embed: typeof args.embed === "boolean" ? args.embed : void 0
|
|
2611
|
-
});
|
|
2612
|
-
}
|
|
2613
|
-
case "engram.profiling_report":
|
|
2614
|
-
case "remnic.profiling_report": {
|
|
2615
|
-
if ("format" in args && args.format !== void 0 && typeof args.format !== "string") {
|
|
2616
|
-
throw new EngramAccessInputError("format must be a string when provided");
|
|
2617
|
-
}
|
|
2618
|
-
if ("limit" in args && args.limit !== void 0 && typeof args.limit !== "number") {
|
|
2619
|
-
throw new EngramAccessInputError("limit must be a number when provided");
|
|
2620
|
-
}
|
|
2621
|
-
return this.service.profilingReport({
|
|
2622
|
-
format: typeof args.format === "string" ? args.format : void 0,
|
|
2623
|
-
limit: typeof args.limit === "number" ? args.limit : void 0
|
|
2624
|
-
});
|
|
2625
|
-
}
|
|
2626
|
-
case "engram.graph_edge_decay_run":
|
|
2627
|
-
case "remnic.graph_edge_decay_run": {
|
|
2628
|
-
const cfg = this.service.configRef;
|
|
2629
|
-
if (!cfg.graphEdgeDecayEnabled) {
|
|
2630
|
-
return {
|
|
2631
|
-
ranAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2632
|
-
disabled: true,
|
|
2633
|
-
reason: "graphEdgeDecayEnabled is false"
|
|
2634
|
-
};
|
|
2635
|
-
}
|
|
2636
|
-
const { runGraphEdgeDecayMaintenanceAcrossNamespaces } = await import("./graph-edge-decay-PWB63GRE.js");
|
|
2637
|
-
const dryRun = args.dryRun === true;
|
|
2638
|
-
const results = await runGraphEdgeDecayMaintenanceAcrossNamespaces(
|
|
2639
|
-
this.service.memoryDir,
|
|
2640
|
-
{
|
|
2641
|
-
windowMs: cfg.graphEdgeDecayWindowMs,
|
|
2642
|
-
perWindow: cfg.graphEdgeDecayPerWindow,
|
|
2643
|
-
floor: cfg.graphEdgeDecayFloor,
|
|
2644
|
-
visibilityThreshold: cfg.graphEdgeDecayVisibilityThreshold,
|
|
2645
|
-
dryRun,
|
|
2646
|
-
namespacesEnabled: cfg.namespacesEnabled === true,
|
|
2647
|
-
defaultNamespace: cfg.defaultNamespace
|
|
2648
|
-
}
|
|
2649
|
-
);
|
|
2650
|
-
return { results };
|
|
2651
|
-
}
|
|
2652
|
-
case "engram.live_connectors_run":
|
|
2653
|
-
case "remnic.live_connectors_run":
|
|
2654
|
-
return this.service.liveConnectorsRun(
|
|
2655
|
-
{
|
|
2656
|
-
authenticatedPrincipal: effectivePrincipal,
|
|
2657
|
-
force: args.force === true
|
|
2658
|
-
},
|
|
2659
|
-
effectivePrincipal
|
|
2660
|
-
);
|
|
2661
|
-
// ── Peer Registry dispatchers (issue #679 PR 4/5) ─────────────────
|
|
2662
|
-
case "engram.peer_list":
|
|
2663
|
-
case "remnic.peer_list":
|
|
2664
|
-
return this.service.peerList();
|
|
2665
|
-
case "engram.peer_get":
|
|
2666
|
-
case "remnic.peer_get": {
|
|
2667
|
-
const id = typeof args.id === "string" ? args.id : "";
|
|
2668
|
-
if (!id) throw new Error("engram.peer_get: id is required");
|
|
2669
|
-
return this.service.peerGet(id);
|
|
2670
|
-
}
|
|
2671
|
-
case "engram.peer_set":
|
|
2672
|
-
case "remnic.peer_set": {
|
|
2673
|
-
const id = typeof args.id === "string" ? args.id : "";
|
|
2674
|
-
if (!id) throw new Error("engram.peer_set: id is required");
|
|
2675
|
-
if (args.kind !== void 0 && typeof args.kind !== "string") {
|
|
2676
|
-
throw new Error("engram.peer_set: kind must be a string when provided");
|
|
2677
|
-
}
|
|
2678
|
-
if (args.displayName !== void 0 && typeof args.displayName !== "string") {
|
|
2679
|
-
throw new Error("engram.peer_set: displayName must be a string when provided");
|
|
2680
|
-
}
|
|
2681
|
-
if (args.notes !== void 0 && typeof args.notes !== "string") {
|
|
2682
|
-
throw new Error("engram.peer_set: notes must be a string when provided");
|
|
2683
|
-
}
|
|
2684
|
-
return this.service.peerSet({
|
|
2685
|
-
id,
|
|
2686
|
-
kind: typeof args.kind === "string" ? args.kind : void 0,
|
|
2687
|
-
displayName: typeof args.displayName === "string" ? args.displayName : void 0,
|
|
2688
|
-
notes: typeof args.notes === "string" ? args.notes : void 0
|
|
2689
|
-
});
|
|
2690
|
-
}
|
|
2691
|
-
case "engram.peer_delete":
|
|
2692
|
-
case "remnic.peer_delete": {
|
|
2693
|
-
const id = typeof args.id === "string" ? args.id : "";
|
|
2694
|
-
if (!id) throw new Error("engram.peer_delete: id is required");
|
|
2695
|
-
return this.service.peerDelete(id);
|
|
2696
|
-
}
|
|
2697
|
-
case "engram.peer_profile_get":
|
|
2698
|
-
case "remnic.peer_profile_get": {
|
|
2699
|
-
const id = typeof args.id === "string" ? args.id : "";
|
|
2700
|
-
if (!id) throw new Error("engram.peer_profile_get: id is required");
|
|
2701
|
-
return this.service.peerProfileGet(id);
|
|
2702
|
-
}
|
|
2703
|
-
case "engram.peer_forget":
|
|
2704
|
-
case "remnic.peer_forget": {
|
|
2705
|
-
const id = typeof args.id === "string" ? args.id : "";
|
|
2706
|
-
if (!id) throw new Error("engram.peer_forget: id is required");
|
|
2707
|
-
const confirm = typeof args.confirm === "string" ? args.confirm : "";
|
|
2708
|
-
if (confirm !== "yes") {
|
|
2709
|
-
throw new Error(
|
|
2710
|
-
"engram.peer_forget: confirm must be 'yes' to prevent accidental data loss"
|
|
2711
|
-
);
|
|
2712
|
-
}
|
|
2713
|
-
return this.service.peerForget(id, { confirm: "yes" });
|
|
2714
|
-
}
|
|
2715
|
-
// ── Operator Console state (issue #688 PR 2/3) ──────────────────────────
|
|
2716
|
-
case "engram.console_state":
|
|
2717
|
-
case "remnic.console_state":
|
|
2718
|
-
return this.service.consoleState(
|
|
2719
|
-
typeof args.namespace === "string" ? args.namespace : void 0,
|
|
2720
|
-
effectivePrincipal
|
|
2721
|
-
);
|
|
2722
|
-
// ── Dreams telemetry (issue #678 PR 3+4) ──────────────────────────────
|
|
2723
|
-
case "engram.dreams_status":
|
|
2724
|
-
case "remnic.dreams_status": {
|
|
2725
|
-
const { normalizeDreamsStatusWindowHours } = await import("./dreams-ledger-LR2NBAZE.js");
|
|
2726
|
-
let windowHours = 24;
|
|
2727
|
-
try {
|
|
2728
|
-
windowHours = normalizeDreamsStatusWindowHours(args.windowHours);
|
|
2729
|
-
} catch {
|
|
2730
|
-
throw new Error(
|
|
2731
|
-
`engram.dreams_status: windowHours must be a positive integer (e.g. 24). Got: ${String(args.windowHours)}`
|
|
2732
|
-
);
|
|
2733
|
-
}
|
|
2734
|
-
if ("namespace" in args && args.namespace !== void 0 && typeof args.namespace !== "string") {
|
|
2735
|
-
throw new Error("engram.dreams_status: namespace must be a string when provided");
|
|
2736
|
-
}
|
|
2737
|
-
const namespace = typeof args.namespace === "string" ? args.namespace : void 0;
|
|
2738
|
-
return this.service.dreamsStatus({
|
|
2739
|
-
windowHours,
|
|
2740
|
-
namespace,
|
|
2741
|
-
principal: effectivePrincipal
|
|
2742
|
-
});
|
|
2743
|
-
}
|
|
2744
|
-
case "engram.dreams_run":
|
|
2745
|
-
case "remnic.dreams_run": {
|
|
2746
|
-
const VALID_PHASES = ["lightSleep", "rem", "deepSleep"];
|
|
2747
|
-
const phase = typeof args.phase === "string" ? args.phase : "";
|
|
2748
|
-
if (!phase || !VALID_PHASES.includes(phase)) {
|
|
2749
|
-
throw new Error(
|
|
2750
|
-
`engram.dreams_run: phase is required and must be one of: ${VALID_PHASES.join(", ")}`
|
|
2751
|
-
);
|
|
2752
|
-
}
|
|
2753
|
-
if ("dryRun" in args && args.dryRun !== void 0 && typeof args.dryRun !== "boolean") {
|
|
2754
|
-
throw new Error("engram.dreams_run: dryRun must be a boolean when provided");
|
|
2755
|
-
}
|
|
2756
|
-
if ("namespace" in args && args.namespace !== void 0 && typeof args.namespace !== "string") {
|
|
2757
|
-
throw new Error("engram.dreams_run: namespace must be a string when provided");
|
|
2758
|
-
}
|
|
2759
|
-
const namespace = typeof args.namespace === "string" ? args.namespace : void 0;
|
|
2760
|
-
const dryRun = args.dryRun === true;
|
|
2761
|
-
return this.service.dreamsRun({
|
|
2762
|
-
phase,
|
|
2763
|
-
dryRun,
|
|
2764
|
-
namespace,
|
|
2765
|
-
authenticatedPrincipal: effectivePrincipal
|
|
2766
|
-
});
|
|
2767
|
-
}
|
|
2768
|
-
default:
|
|
2769
|
-
throw new Error(`unknown tool: ${name}`);
|
|
2770
|
-
}
|
|
2771
|
-
}
|
|
2772
|
-
};
|
|
2773
|
-
|
|
2774
|
-
export {
|
|
2775
|
-
EngramMcpServer
|
|
2776
|
-
};
|
|
2777
|
-
//# sourceMappingURL=chunk-XAMBKFQS.js.map
|