@remnic/core 1.1.11 → 1.1.13

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