@remnic/core 1.0.0

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 (551) hide show
  1. package/dist/abstraction-nodes.d.ts +52 -0
  2. package/dist/abstraction-nodes.js +15 -0
  3. package/dist/abstraction-nodes.js.map +1 -0
  4. package/dist/access-cli.d.ts +5 -0
  5. package/dist/access-cli.js +308 -0
  6. package/dist/access-cli.js.map +1 -0
  7. package/dist/access-http.d.ts +158 -0
  8. package/dist/access-http.js +32 -0
  9. package/dist/access-http.js.map +1 -0
  10. package/dist/access-idempotency.d.ts +31 -0
  11. package/dist/access-idempotency.js +11 -0
  12. package/dist/access-idempotency.js.map +1 -0
  13. package/dist/access-mcp.d.ts +76 -0
  14. package/dist/access-mcp.js +8 -0
  15. package/dist/access-mcp.js.map +1 -0
  16. package/dist/access-schema.d.ts +266 -0
  17. package/dist/access-schema.js +29 -0
  18. package/dist/access-schema.js.map +1 -0
  19. package/dist/access-service.d.ts +614 -0
  20. package/dist/access-service.js +32 -0
  21. package/dist/access-service.js.map +1 -0
  22. package/dist/behavior-learner.d.ts +16 -0
  23. package/dist/behavior-learner.js +124 -0
  24. package/dist/behavior-learner.js.map +1 -0
  25. package/dist/behavior-signals.d.ts +15 -0
  26. package/dist/behavior-signals.js +11 -0
  27. package/dist/behavior-signals.js.map +1 -0
  28. package/dist/bootstrap.d.ts +46 -0
  29. package/dist/bootstrap.js +9 -0
  30. package/dist/bootstrap.js.map +1 -0
  31. package/dist/boxes.d.ts +93 -0
  32. package/dist/boxes.js +14 -0
  33. package/dist/boxes.js.map +1 -0
  34. package/dist/buffer.d.ts +22 -0
  35. package/dist/buffer.js +9 -0
  36. package/dist/buffer.js.map +1 -0
  37. package/dist/calibration.d.ts +81 -0
  38. package/dist/calibration.js +239 -0
  39. package/dist/calibration.js.map +1 -0
  40. package/dist/causal-behavior.d.ts +79 -0
  41. package/dist/causal-behavior.js +190 -0
  42. package/dist/causal-behavior.js.map +1 -0
  43. package/dist/causal-chain.d.ts +61 -0
  44. package/dist/causal-chain.js +24 -0
  45. package/dist/causal-chain.js.map +1 -0
  46. package/dist/causal-consolidation.d.ts +71 -0
  47. package/dist/causal-consolidation.js +211 -0
  48. package/dist/causal-consolidation.js.map +1 -0
  49. package/dist/causal-retrieval.d.ts +44 -0
  50. package/dist/causal-retrieval.js +184 -0
  51. package/dist/causal-retrieval.js.map +1 -0
  52. package/dist/causal-trajectory-graph.d.ts +13 -0
  53. package/dist/causal-trajectory-graph.js +59 -0
  54. package/dist/causal-trajectory-graph.js.map +1 -0
  55. package/dist/causal-trajectory.d.ts +68 -0
  56. package/dist/causal-trajectory.js +18 -0
  57. package/dist/causal-trajectory.js.map +1 -0
  58. package/dist/chunk-2CJCWDMR.js +87 -0
  59. package/dist/chunk-2CJCWDMR.js.map +1 -0
  60. package/dist/chunk-2NMMFZ5T.js +216 -0
  61. package/dist/chunk-2NMMFZ5T.js.map +1 -0
  62. package/dist/chunk-2PO5ZRKV.js +103 -0
  63. package/dist/chunk-2PO5ZRKV.js.map +1 -0
  64. package/dist/chunk-3QKK7QOS.js +154 -0
  65. package/dist/chunk-3QKK7QOS.js.map +1 -0
  66. package/dist/chunk-3SLRNYNG.js +26 -0
  67. package/dist/chunk-3SLRNYNG.js.map +1 -0
  68. package/dist/chunk-4A24LIM2.js +68 -0
  69. package/dist/chunk-4A24LIM2.js.map +1 -0
  70. package/dist/chunk-6HZ6AO2P.js +164 -0
  71. package/dist/chunk-6HZ6AO2P.js.map +1 -0
  72. package/dist/chunk-763GUIOU.js +302 -0
  73. package/dist/chunk-763GUIOU.js.map +1 -0
  74. package/dist/chunk-AAI7JARD.js +173 -0
  75. package/dist/chunk-AAI7JARD.js.map +1 -0
  76. package/dist/chunk-B7LOFDVE.js +112 -0
  77. package/dist/chunk-B7LOFDVE.js.map +1 -0
  78. package/dist/chunk-BDFZXRSO.js +318 -0
  79. package/dist/chunk-BDFZXRSO.js.map +1 -0
  80. package/dist/chunk-BOUYNNYD.js +707 -0
  81. package/dist/chunk-BOUYNNYD.js.map +1 -0
  82. package/dist/chunk-BRK4ODMI.js +60 -0
  83. package/dist/chunk-BRK4ODMI.js.map +1 -0
  84. package/dist/chunk-C6QPK5GG.js +111 -0
  85. package/dist/chunk-C6QPK5GG.js.map +1 -0
  86. package/dist/chunk-C7VW7C3F.js +117 -0
  87. package/dist/chunk-C7VW7C3F.js.map +1 -0
  88. package/dist/chunk-CDW777AI.js +621 -0
  89. package/dist/chunk-CDW777AI.js.map +1 -0
  90. package/dist/chunk-CULXMQJH.js +185 -0
  91. package/dist/chunk-CULXMQJH.js.map +1 -0
  92. package/dist/chunk-CXWFUJR2.js +1203 -0
  93. package/dist/chunk-CXWFUJR2.js.map +1 -0
  94. package/dist/chunk-DGXUHMOV.js +61 -0
  95. package/dist/chunk-DGXUHMOV.js.map +1 -0
  96. package/dist/chunk-DM2T26WE.js +61 -0
  97. package/dist/chunk-DM2T26WE.js.map +1 -0
  98. package/dist/chunk-DORBM6OB.js +81 -0
  99. package/dist/chunk-DORBM6OB.js.map +1 -0
  100. package/dist/chunk-DT5TVLJE.js +32 -0
  101. package/dist/chunk-DT5TVLJE.js.map +1 -0
  102. package/dist/chunk-EEQLFRUM.js +89 -0
  103. package/dist/chunk-EEQLFRUM.js.map +1 -0
  104. package/dist/chunk-EQINRHYR.js +672 -0
  105. package/dist/chunk-EQINRHYR.js.map +1 -0
  106. package/dist/chunk-ESSMF2FR.js +146 -0
  107. package/dist/chunk-ESSMF2FR.js.map +1 -0
  108. package/dist/chunk-ETOW6ACV.js +158 -0
  109. package/dist/chunk-ETOW6ACV.js.map +1 -0
  110. package/dist/chunk-FYIYMQ5N.js +221 -0
  111. package/dist/chunk-FYIYMQ5N.js.map +1 -0
  112. package/dist/chunk-G3AG3KZN.js +78 -0
  113. package/dist/chunk-G3AG3KZN.js.map +1 -0
  114. package/dist/chunk-GJR6D6KC.js +61 -0
  115. package/dist/chunk-GJR6D6KC.js.map +1 -0
  116. package/dist/chunk-GPGBSNKM.js +380 -0
  117. package/dist/chunk-GPGBSNKM.js.map +1 -0
  118. package/dist/chunk-H63EDPFJ.js +57 -0
  119. package/dist/chunk-H63EDPFJ.js.map +1 -0
  120. package/dist/chunk-HG2NKWR2.js +185 -0
  121. package/dist/chunk-HG2NKWR2.js.map +1 -0
  122. package/dist/chunk-HL4DB7TO.js +13 -0
  123. package/dist/chunk-HL4DB7TO.js.map +1 -0
  124. package/dist/chunk-HLBYLYRD.js +346 -0
  125. package/dist/chunk-HLBYLYRD.js.map +1 -0
  126. package/dist/chunk-HLXVTBF3.js +109 -0
  127. package/dist/chunk-HLXVTBF3.js.map +1 -0
  128. package/dist/chunk-IFFFR3MR.js +68 -0
  129. package/dist/chunk-IFFFR3MR.js.map +1 -0
  130. package/dist/chunk-ISY75RLM.js +1027 -0
  131. package/dist/chunk-ISY75RLM.js.map +1 -0
  132. package/dist/chunk-IZME7KW2.js +1886 -0
  133. package/dist/chunk-IZME7KW2.js.map +1 -0
  134. package/dist/chunk-J3BT33K7.js +720 -0
  135. package/dist/chunk-J3BT33K7.js.map +1 -0
  136. package/dist/chunk-J47FNDR7.js +113 -0
  137. package/dist/chunk-J47FNDR7.js.map +1 -0
  138. package/dist/chunk-JWPLJLDU.js +63 -0
  139. package/dist/chunk-JWPLJLDU.js.map +1 -0
  140. package/dist/chunk-K6WK37A6.js +865 -0
  141. package/dist/chunk-K6WK37A6.js.map +1 -0
  142. package/dist/chunk-KL4CP4SB.js +130 -0
  143. package/dist/chunk-KL4CP4SB.js.map +1 -0
  144. package/dist/chunk-KT4NEUNF.js +315 -0
  145. package/dist/chunk-KT4NEUNF.js.map +1 -0
  146. package/dist/chunk-KWBU5S5U.js +42 -0
  147. package/dist/chunk-KWBU5S5U.js.map +1 -0
  148. package/dist/chunk-L5RPWGFK.js +59 -0
  149. package/dist/chunk-L5RPWGFK.js.map +1 -0
  150. package/dist/chunk-L7WO3MZ4.js +128 -0
  151. package/dist/chunk-L7WO3MZ4.js.map +1 -0
  152. package/dist/chunk-LIRZNNUP.js +74 -0
  153. package/dist/chunk-LIRZNNUP.js.map +1 -0
  154. package/dist/chunk-LK6SGL53.js +22 -0
  155. package/dist/chunk-LK6SGL53.js.map +1 -0
  156. package/dist/chunk-LOBRX7VD.js +200 -0
  157. package/dist/chunk-LOBRX7VD.js.map +1 -0
  158. package/dist/chunk-LPSF4OQH.js +47 -0
  159. package/dist/chunk-LPSF4OQH.js.map +1 -0
  160. package/dist/chunk-LU3GQNDQ.js +152 -0
  161. package/dist/chunk-LU3GQNDQ.js.map +1 -0
  162. package/dist/chunk-M5KEYE5E.js +350 -0
  163. package/dist/chunk-M5KEYE5E.js.map +1 -0
  164. package/dist/chunk-M62O4P4T.js +41 -0
  165. package/dist/chunk-M62O4P4T.js.map +1 -0
  166. package/dist/chunk-MARWOCVP.js +48 -0
  167. package/dist/chunk-MARWOCVP.js.map +1 -0
  168. package/dist/chunk-MDDAA2AO.js +925 -0
  169. package/dist/chunk-MDDAA2AO.js.map +1 -0
  170. package/dist/chunk-MWGVGUIS.js +198 -0
  171. package/dist/chunk-MWGVGUIS.js.map +1 -0
  172. package/dist/chunk-N5AKDXAI.js +74 -0
  173. package/dist/chunk-N5AKDXAI.js.map +1 -0
  174. package/dist/chunk-NGAVDO7E.js +115 -0
  175. package/dist/chunk-NGAVDO7E.js.map +1 -0
  176. package/dist/chunk-NTTLPF7F.js +283 -0
  177. package/dist/chunk-NTTLPF7F.js.map +1 -0
  178. package/dist/chunk-ONRU4L2N.js +240 -0
  179. package/dist/chunk-ONRU4L2N.js.map +1 -0
  180. package/dist/chunk-ORZMT74A.js +209 -0
  181. package/dist/chunk-ORZMT74A.js.map +1 -0
  182. package/dist/chunk-OTAVQCSF.js +268 -0
  183. package/dist/chunk-OTAVQCSF.js.map +1 -0
  184. package/dist/chunk-PGK3VUHN.js +160 -0
  185. package/dist/chunk-PGK3VUHN.js.map +1 -0
  186. package/dist/chunk-Q6FETXJA.js +1362 -0
  187. package/dist/chunk-Q6FETXJA.js.map +1 -0
  188. package/dist/chunk-QANCTXQF.js +271 -0
  189. package/dist/chunk-QANCTXQF.js.map +1 -0
  190. package/dist/chunk-QCCCQT3O.js +189 -0
  191. package/dist/chunk-QCCCQT3O.js.map +1 -0
  192. package/dist/chunk-QDOSNLB4.js +1048 -0
  193. package/dist/chunk-QDOSNLB4.js.map +1 -0
  194. package/dist/chunk-QFQVZOGA.js +2168 -0
  195. package/dist/chunk-QFQVZOGA.js.map +1 -0
  196. package/dist/chunk-QPKFPHOO.js +178 -0
  197. package/dist/chunk-QPKFPHOO.js.map +1 -0
  198. package/dist/chunk-QSVPYQPG.js +268 -0
  199. package/dist/chunk-QSVPYQPG.js.map +1 -0
  200. package/dist/chunk-QWUUMMIK.js +3045 -0
  201. package/dist/chunk-QWUUMMIK.js.map +1 -0
  202. package/dist/chunk-QY2BHY5O.js +2378 -0
  203. package/dist/chunk-QY2BHY5O.js.map +1 -0
  204. package/dist/chunk-SCHEKPYH.js +349 -0
  205. package/dist/chunk-SCHEKPYH.js.map +1 -0
  206. package/dist/chunk-SCU65EZI.js +15 -0
  207. package/dist/chunk-SCU65EZI.js.map +1 -0
  208. package/dist/chunk-T4WRIV2C.js +170 -0
  209. package/dist/chunk-T4WRIV2C.js.map +1 -0
  210. package/dist/chunk-TKO4HZCK.js +1852 -0
  211. package/dist/chunk-TKO4HZCK.js.map +1 -0
  212. package/dist/chunk-TP4FZJIZ.js +93 -0
  213. package/dist/chunk-TP4FZJIZ.js.map +1 -0
  214. package/dist/chunk-TPB3I2AC.js +403 -0
  215. package/dist/chunk-TPB3I2AC.js.map +1 -0
  216. package/dist/chunk-TVVVQQAK.js +1431 -0
  217. package/dist/chunk-TVVVQQAK.js.map +1 -0
  218. package/dist/chunk-U4PV25RD.js +14 -0
  219. package/dist/chunk-U4PV25RD.js.map +1 -0
  220. package/dist/chunk-UCYSTFZR.js +284 -0
  221. package/dist/chunk-UCYSTFZR.js.map +1 -0
  222. package/dist/chunk-UHGBNIOS.js +205 -0
  223. package/dist/chunk-UHGBNIOS.js.map +1 -0
  224. package/dist/chunk-UIYZ5T3I.js +108 -0
  225. package/dist/chunk-UIYZ5T3I.js.map +1 -0
  226. package/dist/chunk-UV2FO7J4.js +747 -0
  227. package/dist/chunk-UV2FO7J4.js.map +1 -0
  228. package/dist/chunk-UZB5KHKX.js +63 -0
  229. package/dist/chunk-UZB5KHKX.js.map +1 -0
  230. package/dist/chunk-V3RXWQIE.js +626 -0
  231. package/dist/chunk-V3RXWQIE.js.map +1 -0
  232. package/dist/chunk-V4YC4LUK.js +444 -0
  233. package/dist/chunk-V4YC4LUK.js.map +1 -0
  234. package/dist/chunk-VEWZZM3H.js +133 -0
  235. package/dist/chunk-VEWZZM3H.js.map +1 -0
  236. package/dist/chunk-WWIQTB2Y.js +98 -0
  237. package/dist/chunk-WWIQTB2Y.js.map +1 -0
  238. package/dist/chunk-X7XN6YU4.js +24 -0
  239. package/dist/chunk-X7XN6YU4.js.map +1 -0
  240. package/dist/chunk-XKECPATV.js +202 -0
  241. package/dist/chunk-XKECPATV.js.map +1 -0
  242. package/dist/chunk-XYIK4LF6.js +75 -0
  243. package/dist/chunk-XYIK4LF6.js.map +1 -0
  244. package/dist/chunk-Y27UJK6V.js +39 -0
  245. package/dist/chunk-Y27UJK6V.js.map +1 -0
  246. package/dist/chunk-Y4Z4I6WK.js +9 -0
  247. package/dist/chunk-Y4Z4I6WK.js.map +1 -0
  248. package/dist/chunk-YAPUAHAY.js +10761 -0
  249. package/dist/chunk-YAPUAHAY.js.map +1 -0
  250. package/dist/chunk-YAZNBMNF.js +92 -0
  251. package/dist/chunk-YAZNBMNF.js.map +1 -0
  252. package/dist/chunk-YCN4BVDK.js +66 -0
  253. package/dist/chunk-YCN4BVDK.js.map +1 -0
  254. package/dist/chunk-YNCQ7E4M.js +388 -0
  255. package/dist/chunk-YNCQ7E4M.js.map +1 -0
  256. package/dist/chunk-YNI4S5WT.js +143 -0
  257. package/dist/chunk-YNI4S5WT.js.map +1 -0
  258. package/dist/chunk-YRMVARQP.js +406 -0
  259. package/dist/chunk-YRMVARQP.js.map +1 -0
  260. package/dist/chunk-Z5AAYHUC.js +79 -0
  261. package/dist/chunk-Z5AAYHUC.js.map +1 -0
  262. package/dist/chunk-Z5LAYHGJ.js +15 -0
  263. package/dist/chunk-Z5LAYHGJ.js.map +1 -0
  264. package/dist/chunk-ZJLY4QSU.js +823 -0
  265. package/dist/chunk-ZJLY4QSU.js.map +1 -0
  266. package/dist/chunk-ZKYI7UVO.js +276 -0
  267. package/dist/chunk-ZKYI7UVO.js.map +1 -0
  268. package/dist/chunk-ZPKBYX2F.js +297 -0
  269. package/dist/chunk-ZPKBYX2F.js.map +1 -0
  270. package/dist/chunking.d.ts +48 -0
  271. package/dist/chunking.js +11 -0
  272. package/dist/chunking.js.map +1 -0
  273. package/dist/cli.d.ts +1162 -0
  274. package/dist/cli.js +7187 -0
  275. package/dist/cli.js.map +1 -0
  276. package/dist/commitment-ledger.d.ts +83 -0
  277. package/dist/commitment-ledger.js +19 -0
  278. package/dist/commitment-ledger.js.map +1 -0
  279. package/dist/compression-optimizer.d.ts +37 -0
  280. package/dist/compression-optimizer.js +13 -0
  281. package/dist/compression-optimizer.js.map +1 -0
  282. package/dist/config.d.ts +6 -0
  283. package/dist/config.js +12 -0
  284. package/dist/config.js.map +1 -0
  285. package/dist/cue-anchors.d.ts +50 -0
  286. package/dist/cue-anchors.js +15 -0
  287. package/dist/cue-anchors.js.map +1 -0
  288. package/dist/dashboard-runtime.d.ts +46 -0
  289. package/dist/dashboard-runtime.js +10 -0
  290. package/dist/dashboard-runtime.js.map +1 -0
  291. package/dist/day-summary.d.ts +6 -0
  292. package/dist/day-summary.js +10 -0
  293. package/dist/day-summary.js.map +1 -0
  294. package/dist/delinearize.d.ts +34 -0
  295. package/dist/delinearize.js +11 -0
  296. package/dist/delinearize.js.map +1 -0
  297. package/dist/embedding-fallback.d.ts +22 -0
  298. package/dist/embedding-fallback.js +8 -0
  299. package/dist/embedding-fallback.js.map +1 -0
  300. package/dist/engine-P26JFSVY.js +19 -0
  301. package/dist/engine-P26JFSVY.js.map +1 -0
  302. package/dist/entity-retrieval.d.ts +23 -0
  303. package/dist/entity-retrieval.js +24 -0
  304. package/dist/entity-retrieval.js.map +1 -0
  305. package/dist/evals.d.ts +282 -0
  306. package/dist/evals.js +32 -0
  307. package/dist/evals.js.map +1 -0
  308. package/dist/explicit-capture.d.ts +60 -0
  309. package/dist/explicit-capture.js +23 -0
  310. package/dist/explicit-capture.js.map +1 -0
  311. package/dist/extraction.d.ts +141 -0
  312. package/dist/extraction.js +22 -0
  313. package/dist/extraction.js.map +1 -0
  314. package/dist/fallback-llm.d.ts +95 -0
  315. package/dist/fallback-llm.js +12 -0
  316. package/dist/fallback-llm.js.map +1 -0
  317. package/dist/graph-dashboard-diff.d.ts +12 -0
  318. package/dist/graph-dashboard-diff.js +8 -0
  319. package/dist/graph-dashboard-diff.js.map +1 -0
  320. package/dist/graph-dashboard-key.d.ts +5 -0
  321. package/dist/graph-dashboard-key.js +7 -0
  322. package/dist/graph-dashboard-key.js.map +1 -0
  323. package/dist/graph-dashboard-parser.d.ts +20 -0
  324. package/dist/graph-dashboard-parser.js +8 -0
  325. package/dist/graph-dashboard-parser.js.map +1 -0
  326. package/dist/graph.d.ts +157 -0
  327. package/dist/graph.js +27 -0
  328. package/dist/graph.js.map +1 -0
  329. package/dist/harmonic-retrieval.d.ts +27 -0
  330. package/dist/harmonic-retrieval.js +12 -0
  331. package/dist/harmonic-retrieval.js.map +1 -0
  332. package/dist/himem.d.ts +23 -0
  333. package/dist/himem.js +7 -0
  334. package/dist/himem.js.map +1 -0
  335. package/dist/hygiene.d.ts +24 -0
  336. package/dist/hygiene.js +9 -0
  337. package/dist/hygiene.js.map +1 -0
  338. package/dist/identity-continuity.d.ts +17 -0
  339. package/dist/identity-continuity.js +19 -0
  340. package/dist/identity-continuity.js.map +1 -0
  341. package/dist/importance.d.ts +25 -0
  342. package/dist/importance.js +11 -0
  343. package/dist/importance.js.map +1 -0
  344. package/dist/index.d.ts +923 -0
  345. package/dist/index.js +2512 -0
  346. package/dist/index.js.map +1 -0
  347. package/dist/intent.d.ts +8 -0
  348. package/dist/intent.js +13 -0
  349. package/dist/intent.js.map +1 -0
  350. package/dist/json-extract.d.ts +14 -0
  351. package/dist/json-extract.js +9 -0
  352. package/dist/json-extract.js.map +1 -0
  353. package/dist/json-store.d.ts +5 -0
  354. package/dist/json-store.js +11 -0
  355. package/dist/json-store.js.map +1 -0
  356. package/dist/legacy-hook-compat.d.ts +3 -0
  357. package/dist/legacy-hook-compat.js +35 -0
  358. package/dist/legacy-hook-compat.js.map +1 -0
  359. package/dist/lifecycle.d.ts +52 -0
  360. package/dist/lifecycle.js +21 -0
  361. package/dist/lifecycle.js.map +1 -0
  362. package/dist/local-llm.d.ts +154 -0
  363. package/dist/local-llm.js +10 -0
  364. package/dist/local-llm.js.map +1 -0
  365. package/dist/logger.d.ts +15 -0
  366. package/dist/logger.js +9 -0
  367. package/dist/logger.js.map +1 -0
  368. package/dist/memory-action-policy.d.ts +13 -0
  369. package/dist/memory-action-policy.js +7 -0
  370. package/dist/memory-action-policy.js.map +1 -0
  371. package/dist/memory-cache.d.ts +35 -0
  372. package/dist/memory-cache.js +37 -0
  373. package/dist/memory-cache.js.map +1 -0
  374. package/dist/memory-lifecycle-ledger-utils.d.ts +13 -0
  375. package/dist/memory-lifecycle-ledger-utils.js +23 -0
  376. package/dist/memory-lifecycle-ledger-utils.js.map +1 -0
  377. package/dist/memory-projection-format.d.ts +4 -0
  378. package/dist/memory-projection-format.js +9 -0
  379. package/dist/memory-projection-format.js.map +1 -0
  380. package/dist/memory-projection-store-NxMkbocT.d.ts +221 -0
  381. package/dist/memory-projection-store.d.ts +3 -0
  382. package/dist/memory-projection-store.js +31 -0
  383. package/dist/memory-projection-store.js.map +1 -0
  384. package/dist/model-registry.d.ts +60 -0
  385. package/dist/model-registry.js +8 -0
  386. package/dist/model-registry.js.map +1 -0
  387. package/dist/native-knowledge.d.ts +94 -0
  388. package/dist/native-knowledge.js +26 -0
  389. package/dist/native-knowledge.js.map +1 -0
  390. package/dist/negative.d.ts +26 -0
  391. package/dist/negative.js +8 -0
  392. package/dist/negative.js.map +1 -0
  393. package/dist/objective-state-writers.d.ts +22 -0
  394. package/dist/objective-state-writers.js +313 -0
  395. package/dist/objective-state-writers.js.map +1 -0
  396. package/dist/objective-state.d.ts +75 -0
  397. package/dist/objective-state.js +17 -0
  398. package/dist/objective-state.js.map +1 -0
  399. package/dist/openai-chat-compat.d.ts +13 -0
  400. package/dist/openai-chat-compat.js +11 -0
  401. package/dist/openai-chat-compat.js.map +1 -0
  402. package/dist/operator-toolkit.d.ts +304 -0
  403. package/dist/operator-toolkit.js +41 -0
  404. package/dist/operator-toolkit.js.map +1 -0
  405. package/dist/opik-exporter.d.ts +72 -0
  406. package/dist/opik-exporter.js +361 -0
  407. package/dist/opik-exporter.js.map +1 -0
  408. package/dist/orchestrator-zTa-Qo-1.d.ts +1104 -0
  409. package/dist/orchestrator.d.ts +21 -0
  410. package/dist/orchestrator.js +145 -0
  411. package/dist/orchestrator.js.map +1 -0
  412. package/dist/policy-runtime.d.ts +37 -0
  413. package/dist/policy-runtime.js +13 -0
  414. package/dist/policy-runtime.js.map +1 -0
  415. package/dist/port-C1GZFv8h.d.ts +41 -0
  416. package/dist/profiling.d.ts +80 -0
  417. package/dist/profiling.js +10 -0
  418. package/dist/profiling.js.map +1 -0
  419. package/dist/qmd-recall-cache.d.ts +29 -0
  420. package/dist/qmd-recall-cache.js +13 -0
  421. package/dist/qmd-recall-cache.js.map +1 -0
  422. package/dist/qmd.d.ts +105 -0
  423. package/dist/qmd.js +13 -0
  424. package/dist/qmd.js.map +1 -0
  425. package/dist/recall-qos.d.ts +33 -0
  426. package/dist/recall-qos.js +10 -0
  427. package/dist/recall-qos.js.map +1 -0
  428. package/dist/recall-query-policy.d.ts +20 -0
  429. package/dist/recall-query-policy.js +11 -0
  430. package/dist/recall-query-policy.js.map +1 -0
  431. package/dist/recall-state.d.ts +113 -0
  432. package/dist/recall-state.js +12 -0
  433. package/dist/recall-state.js.map +1 -0
  434. package/dist/recall-tokenization.d.ts +4 -0
  435. package/dist/recall-tokenization.js +9 -0
  436. package/dist/recall-tokenization.js.map +1 -0
  437. package/dist/reconstruct.d.ts +16 -0
  438. package/dist/reconstruct.js +7 -0
  439. package/dist/reconstruct.js.map +1 -0
  440. package/dist/release-changelog.d.ts +7 -0
  441. package/dist/release-changelog.js +30 -0
  442. package/dist/release-changelog.js.map +1 -0
  443. package/dist/relevance.d.ts +18 -0
  444. package/dist/relevance.js +8 -0
  445. package/dist/relevance.js.map +1 -0
  446. package/dist/rerank.d.ts +57 -0
  447. package/dist/rerank.js +11 -0
  448. package/dist/rerank.js.map +1 -0
  449. package/dist/resolve-provider-secret.d.ts +16 -0
  450. package/dist/resolve-provider-secret.js +11 -0
  451. package/dist/resolve-provider-secret.js.map +1 -0
  452. package/dist/resume-bundles.d.ts +66 -0
  453. package/dist/resume-bundles.js +27 -0
  454. package/dist/resume-bundles.js.map +1 -0
  455. package/dist/retrieval-agents.d.ts +129 -0
  456. package/dist/retrieval-agents.js +23 -0
  457. package/dist/retrieval-agents.js.map +1 -0
  458. package/dist/retrieval.d.ts +19 -0
  459. package/dist/retrieval.js +10 -0
  460. package/dist/retrieval.js.map +1 -0
  461. package/dist/sanitize.d.ts +9 -0
  462. package/dist/sanitize.js +9 -0
  463. package/dist/sanitize.js.map +1 -0
  464. package/dist/schemas.d.ts +688 -0
  465. package/dist/schemas.js +51 -0
  466. package/dist/schemas.js.map +1 -0
  467. package/dist/sdk-compat.d.ts +21 -0
  468. package/dist/sdk-compat.js +28 -0
  469. package/dist/sdk-compat.js.map +1 -0
  470. package/dist/semantic-consolidation.d.ts +42 -0
  471. package/dist/semantic-consolidation.js +12 -0
  472. package/dist/semantic-consolidation.js.map +1 -0
  473. package/dist/semantic-rule-promotion.d.ts +28 -0
  474. package/dist/semantic-rule-promotion.js +17 -0
  475. package/dist/semantic-rule-promotion.js.map +1 -0
  476. package/dist/semantic-rule-verifier.d.ts +19 -0
  477. package/dist/semantic-rule-verifier.js +18 -0
  478. package/dist/semantic-rule-verifier.js.map +1 -0
  479. package/dist/session-integrity.d.ts +67 -0
  480. package/dist/session-integrity.js +11 -0
  481. package/dist/session-integrity.js.map +1 -0
  482. package/dist/session-observer-bands.d.ts +6 -0
  483. package/dist/session-observer-bands.js +9 -0
  484. package/dist/session-observer-bands.js.map +1 -0
  485. package/dist/session-observer-state.d.ts +40 -0
  486. package/dist/session-observer-state.js +11 -0
  487. package/dist/session-observer-state.js.map +1 -0
  488. package/dist/signal.d.ts +6 -0
  489. package/dist/signal.js +9 -0
  490. package/dist/signal.js.map +1 -0
  491. package/dist/storage.d.ts +453 -0
  492. package/dist/storage.js +24 -0
  493. package/dist/storage.js.map +1 -0
  494. package/dist/store-contract.d.ts +10 -0
  495. package/dist/store-contract.js +21 -0
  496. package/dist/store-contract.js.map +1 -0
  497. package/dist/summarizer.d.ts +35 -0
  498. package/dist/summarizer.js +17 -0
  499. package/dist/summarizer.js.map +1 -0
  500. package/dist/summary-snapshot.d.ts +8 -0
  501. package/dist/summary-snapshot.js +13 -0
  502. package/dist/summary-snapshot.js.map +1 -0
  503. package/dist/temporal-index.d.ts +139 -0
  504. package/dist/temporal-index.js +29 -0
  505. package/dist/temporal-index.js.map +1 -0
  506. package/dist/threading.d.ts +62 -0
  507. package/dist/threading.js +8 -0
  508. package/dist/threading.js.map +1 -0
  509. package/dist/tier-migration.d.ts +44 -0
  510. package/dist/tier-migration.js +7 -0
  511. package/dist/tier-migration.js.map +1 -0
  512. package/dist/tier-routing.d.ts +21 -0
  513. package/dist/tier-routing.js +10 -0
  514. package/dist/tier-routing.js.map +1 -0
  515. package/dist/tmt.d.ts +79 -0
  516. package/dist/tmt.js +29 -0
  517. package/dist/tmt.js.map +1 -0
  518. package/dist/tokens.d.ts +24 -0
  519. package/dist/tokens.js +21 -0
  520. package/dist/tokens.js.map +1 -0
  521. package/dist/topics.d.ts +29 -0
  522. package/dist/topics.js +9 -0
  523. package/dist/topics.js.map +1 -0
  524. package/dist/transcript.d.ts +171 -0
  525. package/dist/transcript.js +9 -0
  526. package/dist/transcript.js.map +1 -0
  527. package/dist/trust-zones.d.ts +170 -0
  528. package/dist/trust-zones.js +32 -0
  529. package/dist/trust-zones.js.map +1 -0
  530. package/dist/types.d.ts +1243 -0
  531. package/dist/types.js +9 -0
  532. package/dist/types.js.map +1 -0
  533. package/dist/utility-learner.d.ts +59 -0
  534. package/dist/utility-learner.js +17 -0
  535. package/dist/utility-learner.js.map +1 -0
  536. package/dist/utility-runtime.d.ts +21 -0
  537. package/dist/utility-runtime.js +16 -0
  538. package/dist/utility-runtime.js.map +1 -0
  539. package/dist/utility-telemetry.d.ts +68 -0
  540. package/dist/utility-telemetry.js +17 -0
  541. package/dist/utility-telemetry.js.map +1 -0
  542. package/dist/verified-recall.d.ts +17 -0
  543. package/dist/verified-recall.js +19 -0
  544. package/dist/verified-recall.js.map +1 -0
  545. package/dist/version-utils.d.ts +4 -0
  546. package/dist/version-utils.js +7 -0
  547. package/dist/version-utils.js.map +1 -0
  548. package/dist/work-product-ledger.d.ts +65 -0
  549. package/dist/work-product-ledger.js +18 -0
  550. package/dist/work-product-ledger.js.map +1 -0
  551. package/package.json +58 -0
@@ -0,0 +1,1203 @@
1
+ import {
2
+ readEnvVar
3
+ } from "./chunk-MARWOCVP.js";
4
+
5
+ // src/access-mcp.ts
6
+ import { readFile } from "fs/promises";
7
+ import { randomUUID } from "crypto";
8
+ var MCP_PROTOCOL_VERSION = "2024-11-05";
9
+ var LEGACY_MCP_PREFIX = "engram.";
10
+ var CANONICAL_MCP_PREFIX = "remnic.";
11
+ function toCanonicalToolName(name) {
12
+ return name.startsWith(LEGACY_MCP_PREFIX) ? `${CANONICAL_MCP_PREFIX}${name.slice(LEGACY_MCP_PREFIX.length)}` : name;
13
+ }
14
+ function toLegacyToolName(name) {
15
+ return name.startsWith(CANONICAL_MCP_PREFIX) ? `${LEGACY_MCP_PREFIX}${name.slice(CANONICAL_MCP_PREFIX.length)}` : name;
16
+ }
17
+ function withToolAliases(tool) {
18
+ const canonicalName = toCanonicalToolName(tool.name);
19
+ const canonicalTool = canonicalName === tool.name ? tool : { ...tool, name: canonicalName };
20
+ if (canonicalName === tool.name) return [canonicalTool];
21
+ return [canonicalTool, tool];
22
+ }
23
+ async function getMcpServerVersion() {
24
+ const envVersion = readEnvVar("OPENCLAW_ENGRAM_VERSION")?.trim() || readEnvVar("npm_package_version")?.trim();
25
+ if (envVersion) return envVersion;
26
+ try {
27
+ const pkgPath = new URL("../package.json", import.meta.url);
28
+ const raw = await readFile(pkgPath, "utf-8");
29
+ const parsed = JSON.parse(raw);
30
+ return parsed.version?.trim() || "unknown";
31
+ } catch {
32
+ return "unknown";
33
+ }
34
+ }
35
+ var EngramMcpServer = class {
36
+ constructor(service, options = {}) {
37
+ this.service = service;
38
+ this.authenticatedPrincipal = options.principal?.trim() || readEnvVar("OPENCLAW_ENGRAM_ACCESS_PRINCIPAL")?.trim() || void 0;
39
+ this.tools = [
40
+ {
41
+ name: "engram.recall",
42
+ description: "Recall Engram context for a query.",
43
+ inputSchema: {
44
+ type: "object",
45
+ properties: {
46
+ query: { type: "string" },
47
+ sessionKey: { type: "string" },
48
+ namespace: { type: "string" },
49
+ topK: { type: "number" },
50
+ mode: { type: "string", enum: ["auto", "no_recall", "minimal", "full", "graph_mode"] },
51
+ includeDebug: { type: "boolean" }
52
+ },
53
+ required: ["query"],
54
+ additionalProperties: false
55
+ }
56
+ },
57
+ {
58
+ name: "engram.recall_explain",
59
+ description: "Return the last recall snapshot for a session or the most recent one.",
60
+ inputSchema: {
61
+ type: "object",
62
+ properties: {
63
+ sessionKey: { type: "string" },
64
+ namespace: { type: "string" }
65
+ },
66
+ additionalProperties: false
67
+ }
68
+ },
69
+ {
70
+ name: "engram.day_summary",
71
+ description: "Generate a structured end-of-day summary. When memories is omitted or empty, auto-gathers today's facts and hourly summaries from storage.",
72
+ inputSchema: {
73
+ type: "object",
74
+ properties: {
75
+ memories: { type: "string" },
76
+ sessionKey: { type: "string" },
77
+ namespace: { type: "string" }
78
+ },
79
+ required: [],
80
+ additionalProperties: false
81
+ }
82
+ },
83
+ {
84
+ name: "engram.memory_governance_run",
85
+ description: "Run Remnic memory governance in a bounded shadow/apply pass.",
86
+ inputSchema: {
87
+ type: "object",
88
+ properties: {
89
+ namespace: { type: "string" },
90
+ mode: { type: "string", enum: ["shadow", "apply"] },
91
+ recentDays: { type: "number" },
92
+ maxMemories: { type: "number" },
93
+ batchSize: { type: "number" }
94
+ },
95
+ additionalProperties: false
96
+ }
97
+ },
98
+ {
99
+ name: "engram.memory_get",
100
+ description: "Fetch one Remnic memory by id.",
101
+ inputSchema: {
102
+ type: "object",
103
+ properties: {
104
+ memoryId: { type: "string" },
105
+ namespace: { type: "string" }
106
+ },
107
+ required: ["memoryId"],
108
+ additionalProperties: false
109
+ }
110
+ },
111
+ {
112
+ name: "engram.memory_timeline",
113
+ description: "Fetch one Remnic memory timeline by id.",
114
+ inputSchema: {
115
+ type: "object",
116
+ properties: {
117
+ memoryId: { type: "string" },
118
+ namespace: { type: "string" },
119
+ limit: { type: "number" }
120
+ },
121
+ required: ["memoryId"],
122
+ additionalProperties: false
123
+ }
124
+ },
125
+ {
126
+ name: "engram.memory_store",
127
+ description: "Store an explicit Remnic memory through the access layer.",
128
+ inputSchema: {
129
+ type: "object",
130
+ properties: {
131
+ schemaVersion: { type: "number" },
132
+ idempotencyKey: { type: "string" },
133
+ dryRun: { type: "boolean" },
134
+ sessionKey: { type: "string" },
135
+ content: { type: "string" },
136
+ category: { type: "string" },
137
+ confidence: { type: "number" },
138
+ namespace: { type: "string" },
139
+ tags: { type: "array", items: { type: "string" } },
140
+ entityRef: { type: "string" },
141
+ ttl: { type: "string" },
142
+ sourceReason: { type: "string" }
143
+ },
144
+ required: ["content"],
145
+ additionalProperties: false
146
+ }
147
+ },
148
+ {
149
+ name: "engram.suggestion_submit",
150
+ description: "Queue a suggested Remnic memory for review.",
151
+ inputSchema: {
152
+ type: "object",
153
+ properties: {
154
+ schemaVersion: { type: "number" },
155
+ idempotencyKey: { type: "string" },
156
+ dryRun: { type: "boolean" },
157
+ sessionKey: { type: "string" },
158
+ content: { type: "string" },
159
+ category: { type: "string" },
160
+ confidence: { type: "number" },
161
+ namespace: { type: "string" },
162
+ tags: { type: "array", items: { type: "string" } },
163
+ entityRef: { type: "string" },
164
+ ttl: { type: "string" },
165
+ sourceReason: { type: "string" }
166
+ },
167
+ required: ["content"],
168
+ additionalProperties: false
169
+ }
170
+ },
171
+ {
172
+ name: "engram.entity_get",
173
+ description: "Fetch one Engram entity by name.",
174
+ inputSchema: {
175
+ type: "object",
176
+ properties: {
177
+ name: { type: "string" },
178
+ namespace: { type: "string" }
179
+ },
180
+ required: ["name"],
181
+ additionalProperties: false
182
+ }
183
+ },
184
+ {
185
+ name: "engram.review_queue_list",
186
+ description: "Fetch the latest Engram review queue artifact bundle.",
187
+ inputSchema: {
188
+ type: "object",
189
+ properties: {
190
+ runId: { type: "string" },
191
+ namespace: { type: "string" }
192
+ },
193
+ additionalProperties: false
194
+ }
195
+ },
196
+ {
197
+ name: "engram.observe",
198
+ description: "Feed conversation messages into Engram's memory pipeline (LCM archive + extraction).",
199
+ inputSchema: {
200
+ type: "object",
201
+ properties: {
202
+ sessionKey: { type: "string", description: "Conversation session identifier" },
203
+ messages: {
204
+ type: "array",
205
+ items: {
206
+ type: "object",
207
+ properties: {
208
+ role: { type: "string", enum: ["user", "assistant"] },
209
+ content: { type: "string" }
210
+ },
211
+ required: ["role", "content"]
212
+ },
213
+ description: "Conversation messages to observe"
214
+ },
215
+ namespace: { type: "string" },
216
+ skipExtraction: { type: "boolean" }
217
+ },
218
+ required: ["sessionKey", "messages"],
219
+ additionalProperties: false
220
+ }
221
+ },
222
+ {
223
+ name: "engram.lcm_search",
224
+ description: "Search the LCM conversation archive for matching content.",
225
+ inputSchema: {
226
+ type: "object",
227
+ properties: {
228
+ query: { type: "string", description: "Search query" },
229
+ sessionKey: { type: "string", description: "Optional session filter" },
230
+ namespace: { type: "string" },
231
+ limit: { type: "number", description: "Max results to return" }
232
+ },
233
+ required: ["query"],
234
+ additionalProperties: false
235
+ }
236
+ },
237
+ // ── Continuity / Identity tools ─────────────────────────────────────
238
+ {
239
+ name: "engram.continuity_audit_generate",
240
+ description: "Generate a deterministic identity continuity audit report (weekly/monthly).",
241
+ inputSchema: {
242
+ type: "object",
243
+ properties: {
244
+ period: { type: "string", enum: ["weekly", "monthly"] },
245
+ key: { type: "string", description: "Period key (weekly: YYYY-Www, monthly: YYYY-MM). Defaults to current." }
246
+ },
247
+ additionalProperties: false
248
+ }
249
+ },
250
+ {
251
+ name: "engram.continuity_incident_open",
252
+ description: "Create a new continuity incident record in append-only storage.",
253
+ inputSchema: {
254
+ type: "object",
255
+ properties: {
256
+ symptom: { type: "string", description: "Observed continuity failure symptom." },
257
+ namespace: { type: "string" },
258
+ triggerWindow: { type: "string", description: "Time window when incident occurred." },
259
+ suspectedCause: { type: "string" }
260
+ },
261
+ required: ["symptom"],
262
+ additionalProperties: false
263
+ }
264
+ },
265
+ {
266
+ name: "engram.continuity_incident_close",
267
+ description: "Close an open continuity incident with verification details.",
268
+ inputSchema: {
269
+ type: "object",
270
+ properties: {
271
+ id: { type: "string", description: "Incident ID to close." },
272
+ namespace: { type: "string" },
273
+ fixApplied: { type: "string", description: "What fix was applied." },
274
+ verificationResult: { type: "string", description: "How closure was verified." },
275
+ preventiveRule: { type: "string", description: "Optional preventive follow-up rule." }
276
+ },
277
+ required: ["id", "fixApplied", "verificationResult"],
278
+ additionalProperties: false
279
+ }
280
+ },
281
+ {
282
+ name: "engram.continuity_incident_list",
283
+ description: "List continuity incidents, optionally filtered by state.",
284
+ inputSchema: {
285
+ type: "object",
286
+ properties: {
287
+ state: { type: "string", enum: ["open", "closed", "all"] },
288
+ namespace: { type: "string" },
289
+ limit: { type: "number", description: "Max incidents (default 25, max 200)." }
290
+ },
291
+ additionalProperties: false
292
+ }
293
+ },
294
+ {
295
+ name: "engram.continuity_loop_add_or_update",
296
+ description: "Add or update a continuity improvement loop entry.",
297
+ inputSchema: {
298
+ type: "object",
299
+ properties: {
300
+ id: { type: "string", description: "Stable loop identifier." },
301
+ cadence: { type: "string", enum: ["daily", "weekly", "monthly", "quarterly"] },
302
+ purpose: { type: "string", description: "What this recurring loop improves." },
303
+ status: { type: "string", enum: ["active", "paused", "retired"] },
304
+ killCondition: { type: "string", description: "Clear condition for retiring this loop." },
305
+ namespace: { type: "string" },
306
+ lastReviewed: { type: "string", description: "ISO timestamp for last review." },
307
+ notes: { type: "string" }
308
+ },
309
+ required: ["id", "cadence", "purpose", "status", "killCondition"],
310
+ additionalProperties: false
311
+ }
312
+ },
313
+ {
314
+ name: "engram.continuity_loop_review",
315
+ description: "Update review metadata for an existing continuity improvement loop.",
316
+ inputSchema: {
317
+ type: "object",
318
+ properties: {
319
+ id: { type: "string", description: "Loop ID to review." },
320
+ namespace: { type: "string" },
321
+ status: { type: "string", enum: ["active", "paused", "retired"] },
322
+ notes: { type: "string" },
323
+ reviewedAt: { type: "string", description: "ISO timestamp for review event." }
324
+ },
325
+ required: ["id"],
326
+ additionalProperties: false
327
+ }
328
+ },
329
+ {
330
+ name: "engram.identity_anchor_get",
331
+ description: "Read the identity continuity anchor document (recovery-safe identity context).",
332
+ inputSchema: {
333
+ type: "object",
334
+ properties: {
335
+ namespace: { type: "string" }
336
+ },
337
+ additionalProperties: false
338
+ }
339
+ },
340
+ {
341
+ name: "engram.identity_anchor_update",
342
+ description: "Conservatively merge identity anchor sections without overwriting existing material.",
343
+ inputSchema: {
344
+ type: "object",
345
+ properties: {
346
+ namespace: { type: "string" },
347
+ identityTraits: { type: "string", description: "Updates for 'Identity Traits' section." },
348
+ communicationPreferences: { type: "string", description: "Updates for 'Communication Preferences' section." },
349
+ operatingPrinciples: { type: "string", description: "Updates for 'Operating Principles' section." },
350
+ continuityNotes: { type: "string", description: "Updates for 'Continuity Notes' section." }
351
+ },
352
+ additionalProperties: false
353
+ }
354
+ },
355
+ {
356
+ name: "engram.memory_identity",
357
+ description: "Read the agent's identity reflections from the workspace IDENTITY.md file.",
358
+ inputSchema: {
359
+ type: "object",
360
+ properties: {
361
+ namespace: { type: "string" }
362
+ },
363
+ additionalProperties: false
364
+ }
365
+ },
366
+ // ── Work Layer tools ─────────────────────────────────────────────────
367
+ {
368
+ name: "engram.work_task",
369
+ description: "Manage work-layer tasks (create, get, list, update, transition, delete). Excluded from memory extraction.",
370
+ inputSchema: {
371
+ type: "object",
372
+ properties: {
373
+ action: { type: "string", enum: ["create", "get", "list", "update", "transition", "delete"] },
374
+ id: { type: "string" },
375
+ title: { type: "string" },
376
+ description: { type: "string" },
377
+ status: { type: "string", enum: ["todo", "in_progress", "blocked", "done", "cancelled"] },
378
+ priority: { type: "string", enum: ["low", "medium", "high"] },
379
+ owner: { type: "string" },
380
+ assignee: { type: "string" },
381
+ projectId: { type: "string" },
382
+ tags: { type: "array", items: { type: "string" } },
383
+ dueAt: { type: "string" }
384
+ },
385
+ required: ["action"],
386
+ additionalProperties: false
387
+ }
388
+ },
389
+ {
390
+ name: "engram.work_project",
391
+ description: "Manage work-layer projects (create, get, list, update, delete, link_task). Excluded from memory extraction.",
392
+ inputSchema: {
393
+ type: "object",
394
+ properties: {
395
+ action: { type: "string", enum: ["create", "get", "list", "update", "delete", "link_task"] },
396
+ id: { type: "string" },
397
+ name: { type: "string" },
398
+ description: { type: "string" },
399
+ status: { type: "string", enum: ["active", "on_hold", "completed", "archived"] },
400
+ owner: { type: "string" },
401
+ tags: { type: "array", items: { type: "string" } },
402
+ taskId: { type: "string", description: "Task ID for link_task." },
403
+ projectId: { type: "string", description: "Project ID for link_task." }
404
+ },
405
+ required: ["action"],
406
+ additionalProperties: false
407
+ }
408
+ },
409
+ {
410
+ name: "engram.work_board",
411
+ description: "Export/import work-layer board snapshots and markdown.",
412
+ inputSchema: {
413
+ type: "object",
414
+ properties: {
415
+ action: { type: "string", enum: ["export_markdown", "export_snapshot", "import_snapshot"] },
416
+ projectId: { type: "string" },
417
+ snapshotJson: { type: "string", description: "Snapshot JSON for import_snapshot." },
418
+ linkToMemory: { type: "boolean", description: "If true, output can be retained as long-term memory." }
419
+ },
420
+ required: ["action"],
421
+ additionalProperties: false
422
+ }
423
+ },
424
+ // ── Shared Context / Compounding tools ────────────────────────────
425
+ {
426
+ name: "engram.shared_context_write_output",
427
+ description: "Write agent work product into shared-context directory for cross-agent coordination.",
428
+ inputSchema: {
429
+ type: "object",
430
+ properties: {
431
+ agentId: { type: "string", description: "Agent ID producing this output." },
432
+ title: { type: "string", description: "Short title for the output." },
433
+ content: { type: "string", description: "Markdown content to write." }
434
+ },
435
+ required: ["agentId", "title", "content"],
436
+ additionalProperties: false
437
+ }
438
+ },
439
+ {
440
+ name: "engram.shared_feedback_record",
441
+ description: "Append approval/rejection decision into shared-context feedback inbox for compounding learning.",
442
+ inputSchema: {
443
+ type: "object",
444
+ properties: {
445
+ agent: { type: "string", description: "Agent name that produced the output." },
446
+ decision: { type: "string", enum: ["approved", "approved_with_feedback", "rejected"] },
447
+ reason: { type: "string" },
448
+ date: { type: "string", description: "ISO timestamp. Defaults to now." },
449
+ learning: { type: "string" },
450
+ outcome: { type: "string" },
451
+ severity: { type: "string", enum: ["low", "medium", "high"] },
452
+ confidence: { type: "number", description: "Confidence 0-1." },
453
+ workflow: { type: "string" },
454
+ tags: { type: "array", items: { type: "string" } },
455
+ evidenceWindowStart: { type: "string" },
456
+ evidenceWindowEnd: { type: "string" },
457
+ refs: { type: "array", items: { type: "string" } }
458
+ },
459
+ required: ["agent", "decision", "reason"],
460
+ additionalProperties: false
461
+ }
462
+ },
463
+ {
464
+ name: "engram.shared_priorities_append",
465
+ description: "Append priorities text into shared-context inbox for curator merge.",
466
+ inputSchema: {
467
+ type: "object",
468
+ properties: {
469
+ agentId: { type: "string" },
470
+ text: { type: "string", description: "Priority notes (markdown)." }
471
+ },
472
+ required: ["agentId", "text"],
473
+ additionalProperties: false
474
+ }
475
+ },
476
+ {
477
+ name: "engram.shared_context_cross_signals_run",
478
+ description: "Generate cross-signal markdown + JSON artifacts from agent outputs and feedback.",
479
+ inputSchema: {
480
+ type: "object",
481
+ properties: {
482
+ date: { type: "string", description: "YYYY-MM-DD. Defaults to today." }
483
+ },
484
+ additionalProperties: false
485
+ }
486
+ },
487
+ {
488
+ name: "engram.shared_context_curate_daily",
489
+ description: "Generate daily roundtable summary (deterministic baseline aggregation).",
490
+ inputSchema: {
491
+ type: "object",
492
+ properties: {
493
+ date: { type: "string", description: "YYYY-MM-DD. Defaults to today." }
494
+ },
495
+ additionalProperties: false
496
+ }
497
+ },
498
+ {
499
+ name: "engram.compounding_weekly_synthesize",
500
+ description: "Generate weekly compounding outputs: reports, mistake registry, rubrics, and promotion candidates.",
501
+ inputSchema: {
502
+ type: "object",
503
+ properties: {
504
+ weekId: { type: "string", description: "ISO week ID (YYYY-Www). Defaults to current week." }
505
+ },
506
+ additionalProperties: false
507
+ }
508
+ },
509
+ {
510
+ name: "engram.compounding_promote_candidate",
511
+ description: "Promote a compounding candidate from weekly report into durable rule/principle memory.",
512
+ inputSchema: {
513
+ type: "object",
514
+ properties: {
515
+ weekId: { type: "string" },
516
+ candidateId: { type: "string" },
517
+ dryRun: { type: "boolean", description: "Preview without writing." }
518
+ },
519
+ required: ["weekId", "candidateId"],
520
+ additionalProperties: false
521
+ }
522
+ },
523
+ // ── Compression Guidelines tools ────────────────────────────────────
524
+ {
525
+ name: "engram.compression_guidelines_optimize",
526
+ description: "Run compression guideline optimizer, optionally persisting new guidelines.",
527
+ inputSchema: {
528
+ type: "object",
529
+ properties: {
530
+ dryRun: { type: "boolean" },
531
+ eventLimit: { type: "number" }
532
+ },
533
+ additionalProperties: false
534
+ }
535
+ },
536
+ {
537
+ name: "engram.compression_guidelines_activate",
538
+ description: "Promote staged compression guideline draft to active (after review).",
539
+ inputSchema: {
540
+ type: "object",
541
+ properties: {
542
+ expectedContentHash: { type: "string" },
543
+ expectedGuidelineVersion: { type: "number" }
544
+ },
545
+ additionalProperties: false
546
+ }
547
+ },
548
+ // ── Memory search & debug tools ────────────────────────────────────
549
+ {
550
+ name: "engram.memory_search",
551
+ description: "Direct semantic search over memory files using the QMD index. Returns matching memories with relevance scores.",
552
+ inputSchema: {
553
+ type: "object",
554
+ properties: {
555
+ query: { type: "string" },
556
+ namespace: { type: "string" },
557
+ maxResults: { type: "number" },
558
+ collection: { type: "string", description: "QMD collection (omit for memory, 'global' for all)" }
559
+ },
560
+ required: ["query"],
561
+ additionalProperties: false
562
+ }
563
+ },
564
+ {
565
+ name: "engram.memory_profile",
566
+ description: "Read the user's behavioral profile \u2014 a living document of their preferences, habits, and personality.",
567
+ inputSchema: {
568
+ type: "object",
569
+ properties: { namespace: { type: "string" } },
570
+ additionalProperties: false
571
+ }
572
+ },
573
+ {
574
+ name: "engram.memory_entities_list",
575
+ description: "List all tracked entities (people, projects, tools, companies).",
576
+ inputSchema: {
577
+ type: "object",
578
+ properties: { namespace: { type: "string" } },
579
+ additionalProperties: false
580
+ }
581
+ },
582
+ {
583
+ name: "engram.memory_questions",
584
+ description: "List open questions the system is curious about from past conversations.",
585
+ inputSchema: {
586
+ type: "object",
587
+ properties: { namespace: { type: "string" } },
588
+ additionalProperties: false
589
+ }
590
+ },
591
+ {
592
+ name: "engram.memory_last_recall",
593
+ description: "Return the last recall snapshot for a session (debug introspection).",
594
+ inputSchema: {
595
+ type: "object",
596
+ properties: { sessionKey: { type: "string" } },
597
+ additionalProperties: false
598
+ }
599
+ },
600
+ {
601
+ name: "engram.memory_intent_debug",
602
+ description: "Return the last intent classification debug snapshot.",
603
+ inputSchema: {
604
+ type: "object",
605
+ properties: { namespace: { type: "string" } },
606
+ additionalProperties: false
607
+ }
608
+ },
609
+ {
610
+ name: "engram.memory_qmd_debug",
611
+ description: "Return QMD search index debug information from the last recall.",
612
+ inputSchema: {
613
+ type: "object",
614
+ properties: { namespace: { type: "string" } },
615
+ additionalProperties: false
616
+ }
617
+ },
618
+ {
619
+ name: "engram.memory_graph_explain",
620
+ description: "Explain the last entity graph recall \u2014 which entities were activated and why.",
621
+ inputSchema: {
622
+ type: "object",
623
+ properties: { namespace: { type: "string" } },
624
+ additionalProperties: false
625
+ }
626
+ },
627
+ {
628
+ name: "engram.memory_feedback",
629
+ description: "Record relevance feedback (thumbs up/down) for a specific memory.",
630
+ inputSchema: {
631
+ type: "object",
632
+ properties: {
633
+ memoryId: { type: "string" },
634
+ vote: { type: "string", enum: ["up", "down"] },
635
+ note: { type: "string" }
636
+ },
637
+ required: ["memoryId", "vote"],
638
+ additionalProperties: false
639
+ }
640
+ },
641
+ {
642
+ name: "engram.memory_promote",
643
+ description: "Promote a memory's lifecycle state (e.g. from draft to active).",
644
+ inputSchema: {
645
+ type: "object",
646
+ properties: {
647
+ memoryId: { type: "string" },
648
+ namespace: { type: "string" },
649
+ sessionKey: { type: "string" }
650
+ },
651
+ required: ["memoryId"],
652
+ additionalProperties: false
653
+ }
654
+ },
655
+ {
656
+ name: "engram.context_checkpoint",
657
+ description: "Save a structured context checkpoint for a session (preserves conversation state to disk).",
658
+ inputSchema: {
659
+ type: "object",
660
+ properties: {
661
+ sessionKey: { type: "string" },
662
+ context: { type: "string", description: "Context content to checkpoint" },
663
+ namespace: { type: "string" }
664
+ },
665
+ required: ["sessionKey", "context"],
666
+ additionalProperties: false
667
+ }
668
+ }
669
+ ].flatMap((tool) => withToolAliases(tool));
670
+ }
671
+ service;
672
+ buffer = Buffer.alloc(0);
673
+ flushTask = null;
674
+ tools;
675
+ authenticatedPrincipal;
676
+ /**
677
+ * MCP client info keyed by server-assigned session ID. On each `initialize`
678
+ * handshake the server generates a UUID, stores the client's clientInfo
679
+ * against it, and returns the ID as `Mcp-Session-Id` in the response
680
+ * metadata. Subsequent requests from the same client include this header,
681
+ * allowing per-session clientInfo lookup without cross-session leaks.
682
+ */
683
+ clientInfoBySession = /* @__PURE__ */ new Map();
684
+ /**
685
+ * Session IDs generated during initialize, keyed by caller-supplied correlation
686
+ * ID (unique per HTTP request) to avoid collisions when multiple clients send
687
+ * initialize with the same JSON-RPC id concurrently.
688
+ */
689
+ initSessionIds = /* @__PURE__ */ new Map();
690
+ /** Get clientInfo for a specific MCP session. Returns undefined for non-MCP requests. */
691
+ getClientInfo(sessionId) {
692
+ if (sessionId) {
693
+ return this.clientInfoBySession.get(sessionId);
694
+ }
695
+ return void 0;
696
+ }
697
+ /** Pop the session ID generated during an initialize handshake, keyed by correlation ID. */
698
+ popInitSessionId(correlationId) {
699
+ const sid = this.initSessionIds.get(correlationId);
700
+ if (sid !== void 0) this.initSessionIds.delete(correlationId);
701
+ return sid;
702
+ }
703
+ async handleRequest(request, options) {
704
+ const id = request.id ?? null;
705
+ const method = request.method ?? "";
706
+ if (method === "notifications/initialized") return null;
707
+ if (method === "ping") {
708
+ return { jsonrpc: "2.0", id, result: {} };
709
+ }
710
+ if (method === "initialize") {
711
+ const params = request.params ?? {};
712
+ const rawClientInfo = params.clientInfo;
713
+ const newSessionId = randomUUID();
714
+ if (rawClientInfo && typeof rawClientInfo.name === "string") {
715
+ const info = { name: rawClientInfo.name, version: rawClientInfo.version };
716
+ this.clientInfoBySession.set(newSessionId, info);
717
+ if (this.clientInfoBySession.size > 1e3) {
718
+ const firstKey = this.clientInfoBySession.keys().next().value;
719
+ if (firstKey) this.clientInfoBySession.delete(firstKey);
720
+ }
721
+ }
722
+ const version = await getMcpServerVersion();
723
+ const corrId = options?.correlationId;
724
+ if (corrId) this.initSessionIds.set(corrId, newSessionId);
725
+ return {
726
+ jsonrpc: "2.0",
727
+ id,
728
+ result: {
729
+ protocolVersion: MCP_PROTOCOL_VERSION,
730
+ capabilities: {
731
+ tools: {}
732
+ },
733
+ serverInfo: {
734
+ name: "remnic",
735
+ version
736
+ }
737
+ }
738
+ };
739
+ }
740
+ if (method === "tools/list") {
741
+ return {
742
+ jsonrpc: "2.0",
743
+ id,
744
+ result: {
745
+ tools: this.tools
746
+ }
747
+ };
748
+ }
749
+ if (method === "tools/call") {
750
+ const params = request.params ?? {};
751
+ const name = typeof params.name === "string" ? params.name : "";
752
+ const argumentsObject = params.arguments && typeof params.arguments === "object" && !Array.isArray(params.arguments) ? params.arguments : {};
753
+ try {
754
+ const effectivePrincipal = options?.principalOverride ?? this.authenticatedPrincipal;
755
+ const result = await this.callTool(name, argumentsObject, effectivePrincipal);
756
+ return {
757
+ jsonrpc: "2.0",
758
+ id,
759
+ result: {
760
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
761
+ structuredContent: result,
762
+ isError: false
763
+ }
764
+ };
765
+ } catch (err) {
766
+ const message = err instanceof Error ? err.message : String(err);
767
+ return {
768
+ jsonrpc: "2.0",
769
+ id,
770
+ result: {
771
+ content: [{ type: "text", text: message }],
772
+ isError: true
773
+ }
774
+ };
775
+ }
776
+ }
777
+ return {
778
+ jsonrpc: "2.0",
779
+ id,
780
+ error: {
781
+ code: -32601,
782
+ message: `Method not found: ${method}`
783
+ }
784
+ };
785
+ }
786
+ async runStdio(input, output) {
787
+ input.on("data", (chunk) => {
788
+ this.buffer = Buffer.concat([this.buffer, Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)]);
789
+ this.scheduleFlush(output);
790
+ });
791
+ await new Promise((resolve, reject) => {
792
+ input.on("end", resolve);
793
+ input.on("error", reject);
794
+ });
795
+ while (this.flushTask) {
796
+ await this.flushTask;
797
+ }
798
+ }
799
+ scheduleFlush(output) {
800
+ if (this.flushTask) return;
801
+ const task = this.flushBuffer(output).catch((err) => {
802
+ this.writeMessage(output, {
803
+ jsonrpc: "2.0",
804
+ id: null,
805
+ error: {
806
+ code: -32700,
807
+ message: err instanceof Error ? err.message : String(err)
808
+ }
809
+ });
810
+ }).finally(() => {
811
+ if (this.flushTask === task) {
812
+ this.flushTask = null;
813
+ }
814
+ if (this.buffer.length > 0) {
815
+ this.scheduleFlush(output);
816
+ }
817
+ });
818
+ this.flushTask = task;
819
+ }
820
+ async flushBuffer(output) {
821
+ while (true) {
822
+ const headerEnd = this.buffer.indexOf("\r\n\r\n");
823
+ if (headerEnd < 0) return;
824
+ const headerText = this.buffer.slice(0, headerEnd).toString("utf-8");
825
+ const headers = headerText.split("\r\n");
826
+ const contentLengthHeader = headers.find((line) => line.toLowerCase().startsWith("content-length:"));
827
+ if (!contentLengthHeader) {
828
+ this.buffer = Buffer.alloc(0);
829
+ return;
830
+ }
831
+ const contentLength = parseInt(contentLengthHeader.split(":")[1]?.trim() ?? "0", 10);
832
+ if (!Number.isFinite(contentLength) || contentLength < 0) {
833
+ this.buffer = Buffer.alloc(0);
834
+ return;
835
+ }
836
+ const messageStart = headerEnd + 4;
837
+ const messageEnd = messageStart + contentLength;
838
+ if (this.buffer.length < messageEnd) return;
839
+ const body = this.buffer.slice(messageStart, messageEnd).toString("utf-8");
840
+ this.buffer = this.buffer.slice(messageEnd);
841
+ let parsed;
842
+ try {
843
+ parsed = JSON.parse(body);
844
+ } catch {
845
+ this.writeMessage(output, {
846
+ jsonrpc: "2.0",
847
+ id: null,
848
+ error: {
849
+ code: -32700,
850
+ message: "Parse error"
851
+ }
852
+ });
853
+ continue;
854
+ }
855
+ const response = await this.handleRequest(parsed);
856
+ if (response) {
857
+ this.writeMessage(output, response);
858
+ }
859
+ }
860
+ }
861
+ writeMessage(output, payload) {
862
+ const body = JSON.stringify(payload);
863
+ const message = `Content-Length: ${Buffer.byteLength(body, "utf-8")}\r
864
+ \r
865
+ ${body}`;
866
+ output.write(message);
867
+ }
868
+ async callTool(name, args, effectivePrincipal) {
869
+ switch (toLegacyToolName(name)) {
870
+ case "engram.recall":
871
+ return this.service.recall({
872
+ query: typeof args.query === "string" ? args.query : "",
873
+ sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
874
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
875
+ topK: typeof args.topK === "number" && Number.isFinite(args.topK) ? args.topK : void 0,
876
+ mode: typeof args.mode === "string" ? args.mode : void 0,
877
+ includeDebug: args.includeDebug === true
878
+ });
879
+ case "engram.recall_explain":
880
+ return this.service.recallExplain({
881
+ sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
882
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0
883
+ });
884
+ case "engram.day_summary":
885
+ return this.service.daySummary({
886
+ memories: typeof args.memories === "string" ? args.memories : "",
887
+ sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
888
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0
889
+ });
890
+ case "engram.memory_governance_run":
891
+ return this.service.governanceRun({
892
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
893
+ mode: args.mode === "apply" ? "apply" : "shadow",
894
+ recentDays: typeof args.recentDays === "number" && Number.isFinite(args.recentDays) ? args.recentDays : void 0,
895
+ maxMemories: typeof args.maxMemories === "number" && Number.isFinite(args.maxMemories) ? args.maxMemories : void 0,
896
+ batchSize: typeof args.batchSize === "number" && Number.isFinite(args.batchSize) ? args.batchSize : void 0,
897
+ authenticatedPrincipal: effectivePrincipal
898
+ }, effectivePrincipal);
899
+ case "engram.memory_get":
900
+ return this.service.memoryGet(
901
+ typeof args.memoryId === "string" ? args.memoryId : "",
902
+ typeof args.namespace === "string" ? args.namespace : void 0,
903
+ effectivePrincipal
904
+ );
905
+ case "engram.memory_timeline": {
906
+ const limit = typeof args.limit === "number" && Number.isFinite(args.limit) ? args.limit : 200;
907
+ return this.service.memoryTimeline(
908
+ typeof args.memoryId === "string" ? args.memoryId : "",
909
+ typeof args.namespace === "string" ? args.namespace : void 0,
910
+ limit,
911
+ effectivePrincipal
912
+ );
913
+ }
914
+ case "engram.memory_store":
915
+ return this.service.memoryStore({
916
+ schemaVersion: typeof args.schemaVersion === "number" ? args.schemaVersion : void 0,
917
+ idempotencyKey: typeof args.idempotencyKey === "string" ? args.idempotencyKey : void 0,
918
+ dryRun: args.dryRun === true,
919
+ sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
920
+ authenticatedPrincipal: effectivePrincipal,
921
+ content: typeof args.content === "string" ? args.content : "",
922
+ category: typeof args.category === "string" ? args.category : void 0,
923
+ confidence: typeof args.confidence === "number" ? args.confidence : void 0,
924
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
925
+ tags: Array.isArray(args.tags) ? args.tags.filter((tag) => typeof tag === "string") : void 0,
926
+ entityRef: typeof args.entityRef === "string" ? args.entityRef : void 0,
927
+ ttl: typeof args.ttl === "string" ? args.ttl : void 0,
928
+ sourceReason: typeof args.sourceReason === "string" ? args.sourceReason : void 0
929
+ });
930
+ case "engram.suggestion_submit":
931
+ return this.service.suggestionSubmit({
932
+ schemaVersion: typeof args.schemaVersion === "number" ? args.schemaVersion : void 0,
933
+ idempotencyKey: typeof args.idempotencyKey === "string" ? args.idempotencyKey : void 0,
934
+ dryRun: args.dryRun === true,
935
+ sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
936
+ authenticatedPrincipal: effectivePrincipal,
937
+ content: typeof args.content === "string" ? args.content : "",
938
+ category: typeof args.category === "string" ? args.category : void 0,
939
+ confidence: typeof args.confidence === "number" ? args.confidence : void 0,
940
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
941
+ tags: Array.isArray(args.tags) ? args.tags.filter((tag) => typeof tag === "string") : void 0,
942
+ entityRef: typeof args.entityRef === "string" ? args.entityRef : void 0,
943
+ ttl: typeof args.ttl === "string" ? args.ttl : void 0,
944
+ sourceReason: typeof args.sourceReason === "string" ? args.sourceReason : void 0
945
+ });
946
+ case "engram.entity_get":
947
+ return this.service.entityGet(
948
+ typeof args.name === "string" ? args.name : "",
949
+ typeof args.namespace === "string" ? args.namespace : void 0
950
+ );
951
+ case "engram.review_queue_list":
952
+ return this.service.reviewQueue(
953
+ typeof args.runId === "string" ? args.runId : void 0,
954
+ typeof args.namespace === "string" ? args.namespace : void 0,
955
+ effectivePrincipal
956
+ );
957
+ case "engram.observe":
958
+ return this.service.observe({
959
+ sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : "",
960
+ messages: Array.isArray(args.messages) ? args.messages : [],
961
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
962
+ authenticatedPrincipal: effectivePrincipal,
963
+ skipExtraction: args.skipExtraction === true
964
+ });
965
+ case "engram.lcm_search":
966
+ return this.service.lcmSearch({
967
+ query: typeof args.query === "string" ? args.query : "",
968
+ sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0,
969
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
970
+ limit: typeof args.limit === "number" && Number.isFinite(args.limit) ? args.limit : void 0,
971
+ authenticatedPrincipal: effectivePrincipal
972
+ });
973
+ // ── Continuity / Identity tools ───────────────────────────────────
974
+ case "engram.continuity_audit_generate":
975
+ return this.service.continuityAuditGenerate({
976
+ period: args.period === "monthly" ? "monthly" : args.period === "weekly" ? "weekly" : void 0,
977
+ key: typeof args.key === "string" ? args.key : void 0
978
+ });
979
+ case "engram.continuity_incident_open":
980
+ return this.service.continuityIncidentOpen({
981
+ symptom: typeof args.symptom === "string" ? args.symptom : "",
982
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
983
+ principal: effectivePrincipal,
984
+ triggerWindow: typeof args.triggerWindow === "string" ? args.triggerWindow : void 0,
985
+ suspectedCause: typeof args.suspectedCause === "string" ? args.suspectedCause : void 0
986
+ });
987
+ case "engram.continuity_incident_close":
988
+ return this.service.continuityIncidentClose({
989
+ id: typeof args.id === "string" ? args.id : "",
990
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
991
+ principal: effectivePrincipal,
992
+ fixApplied: typeof args.fixApplied === "string" ? args.fixApplied : "",
993
+ verificationResult: typeof args.verificationResult === "string" ? args.verificationResult : "",
994
+ preventiveRule: typeof args.preventiveRule === "string" ? args.preventiveRule : void 0
995
+ });
996
+ case "engram.continuity_incident_list":
997
+ return this.service.continuityIncidentList({
998
+ state: args.state === "closed" ? "closed" : args.state === "all" ? "all" : args.state === "open" ? "open" : void 0,
999
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
1000
+ principal: effectivePrincipal,
1001
+ limit: typeof args.limit === "number" ? args.limit : void 0
1002
+ });
1003
+ case "engram.continuity_loop_add_or_update":
1004
+ return this.service.continuityLoopAddOrUpdate({
1005
+ id: typeof args.id === "string" ? args.id : "",
1006
+ cadence: args.cadence ?? "weekly",
1007
+ purpose: typeof args.purpose === "string" ? args.purpose : "",
1008
+ status: args.status ?? "active",
1009
+ killCondition: typeof args.killCondition === "string" ? args.killCondition : "",
1010
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
1011
+ principal: effectivePrincipal,
1012
+ lastReviewed: typeof args.lastReviewed === "string" ? args.lastReviewed : void 0,
1013
+ notes: typeof args.notes === "string" ? args.notes : void 0
1014
+ });
1015
+ case "engram.continuity_loop_review":
1016
+ return this.service.continuityLoopReview({
1017
+ id: typeof args.id === "string" ? args.id : "",
1018
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
1019
+ principal: effectivePrincipal,
1020
+ status: args.status === "active" || args.status === "paused" || args.status === "retired" ? args.status : void 0,
1021
+ notes: typeof args.notes === "string" ? args.notes : void 0,
1022
+ reviewedAt: typeof args.reviewedAt === "string" ? args.reviewedAt : void 0
1023
+ });
1024
+ case "engram.identity_anchor_get":
1025
+ return this.service.identityAnchorGet({
1026
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
1027
+ principal: effectivePrincipal
1028
+ });
1029
+ case "engram.identity_anchor_update":
1030
+ return this.service.identityAnchorUpdate({
1031
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
1032
+ principal: effectivePrincipal,
1033
+ identityTraits: typeof args.identityTraits === "string" ? args.identityTraits : void 0,
1034
+ communicationPreferences: typeof args.communicationPreferences === "string" ? args.communicationPreferences : void 0,
1035
+ operatingPrinciples: typeof args.operatingPrinciples === "string" ? args.operatingPrinciples : void 0,
1036
+ continuityNotes: typeof args.continuityNotes === "string" ? args.continuityNotes : void 0
1037
+ });
1038
+ case "engram.memory_identity":
1039
+ return this.service.memoryIdentity({
1040
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
1041
+ principal: effectivePrincipal
1042
+ });
1043
+ // ── Work Layer tools ──────────────────────────────────────────────
1044
+ case "engram.work_task":
1045
+ return this.service.workTask({
1046
+ action: args.action ?? "list",
1047
+ id: typeof args.id === "string" ? args.id : void 0,
1048
+ title: typeof args.title === "string" ? args.title : void 0,
1049
+ description: typeof args.description === "string" ? args.description : void 0,
1050
+ status: typeof args.status === "string" ? args.status : void 0,
1051
+ priority: typeof args.priority === "string" ? args.priority : void 0,
1052
+ owner: typeof args.owner === "string" ? args.owner : void 0,
1053
+ assignee: typeof args.assignee === "string" ? args.assignee : void 0,
1054
+ projectId: typeof args.projectId === "string" ? args.projectId : void 0,
1055
+ tags: Array.isArray(args.tags) ? args.tags.filter((x) => typeof x === "string") : void 0,
1056
+ dueAt: typeof args.dueAt === "string" ? args.dueAt : void 0
1057
+ });
1058
+ case "engram.work_project":
1059
+ return this.service.workProject({
1060
+ action: args.action ?? "list",
1061
+ id: typeof args.id === "string" ? args.id : void 0,
1062
+ name: typeof args.name === "string" ? args.name : void 0,
1063
+ description: typeof args.description === "string" ? args.description : void 0,
1064
+ status: typeof args.status === "string" ? args.status : void 0,
1065
+ owner: typeof args.owner === "string" ? args.owner : void 0,
1066
+ tags: Array.isArray(args.tags) ? args.tags.filter((x) => typeof x === "string") : void 0,
1067
+ taskId: typeof args.taskId === "string" ? args.taskId : void 0,
1068
+ projectId: typeof args.projectId === "string" ? args.projectId : void 0
1069
+ });
1070
+ case "engram.work_board":
1071
+ return this.service.workBoard({
1072
+ action: args.action ?? "export_markdown",
1073
+ projectId: typeof args.projectId === "string" ? args.projectId : void 0,
1074
+ snapshotJson: typeof args.snapshotJson === "string" ? args.snapshotJson : void 0,
1075
+ linkToMemory: args.linkToMemory === true
1076
+ });
1077
+ // ── Shared Context / Compounding tools ─────────────────────────
1078
+ case "engram.shared_context_write_output":
1079
+ return this.service.sharedContextWriteOutput({
1080
+ agentId: typeof args.agentId === "string" ? args.agentId : "",
1081
+ title: typeof args.title === "string" ? args.title : "",
1082
+ content: typeof args.content === "string" ? args.content : ""
1083
+ });
1084
+ case "engram.shared_feedback_record":
1085
+ return this.service.sharedFeedbackRecord({
1086
+ agent: typeof args.agent === "string" ? args.agent : "",
1087
+ decision: args.decision ?? "approved",
1088
+ reason: typeof args.reason === "string" ? args.reason : "",
1089
+ date: typeof args.date === "string" ? args.date : void 0,
1090
+ learning: typeof args.learning === "string" ? args.learning : void 0,
1091
+ outcome: typeof args.outcome === "string" ? args.outcome : void 0,
1092
+ severity: args.severity === "low" || args.severity === "medium" || args.severity === "high" ? args.severity : void 0,
1093
+ confidence: typeof args.confidence === "number" ? args.confidence : void 0,
1094
+ workflow: typeof args.workflow === "string" ? args.workflow : void 0,
1095
+ tags: Array.isArray(args.tags) ? args.tags.filter((x) => typeof x === "string") : void 0,
1096
+ evidenceWindowStart: typeof args.evidenceWindowStart === "string" ? args.evidenceWindowStart : void 0,
1097
+ evidenceWindowEnd: typeof args.evidenceWindowEnd === "string" ? args.evidenceWindowEnd : void 0,
1098
+ refs: Array.isArray(args.refs) ? args.refs.filter((x) => typeof x === "string") : void 0
1099
+ });
1100
+ case "engram.shared_priorities_append":
1101
+ return this.service.sharedPrioritiesAppend({
1102
+ agentId: typeof args.agentId === "string" ? args.agentId : "",
1103
+ text: typeof args.text === "string" ? args.text : ""
1104
+ });
1105
+ case "engram.shared_context_cross_signals_run":
1106
+ return this.service.sharedContextCrossSignalsRun({
1107
+ date: typeof args.date === "string" ? args.date : void 0
1108
+ });
1109
+ case "engram.shared_context_curate_daily":
1110
+ return this.service.sharedContextCurateDaily({
1111
+ date: typeof args.date === "string" ? args.date : void 0
1112
+ });
1113
+ case "engram.compounding_weekly_synthesize":
1114
+ return this.service.compoundingWeeklySynthesize({
1115
+ weekId: typeof args.weekId === "string" ? args.weekId : void 0
1116
+ });
1117
+ case "engram.compounding_promote_candidate":
1118
+ return this.service.compoundingPromoteCandidate({
1119
+ weekId: typeof args.weekId === "string" ? args.weekId : "",
1120
+ candidateId: typeof args.candidateId === "string" ? args.candidateId : "",
1121
+ dryRun: args.dryRun === true
1122
+ });
1123
+ // ── Compression Guidelines tools ───────────────────────────────────
1124
+ case "engram.compression_guidelines_optimize":
1125
+ return this.service.compressionGuidelinesOptimize({
1126
+ dryRun: args.dryRun === true,
1127
+ eventLimit: typeof args.eventLimit === "number" ? args.eventLimit : void 0
1128
+ });
1129
+ case "engram.compression_guidelines_activate":
1130
+ return this.service.compressionGuidelinesActivate({
1131
+ expectedContentHash: typeof args.expectedContentHash === "string" ? args.expectedContentHash : void 0,
1132
+ expectedGuidelineVersion: typeof args.expectedGuidelineVersion === "number" ? args.expectedGuidelineVersion : void 0
1133
+ });
1134
+ // ── Memory search & debug tools ──────────────────────────────────
1135
+ case "engram.memory_search":
1136
+ return this.service.memorySearch({
1137
+ query: typeof args.query === "string" ? args.query : "",
1138
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
1139
+ maxResults: typeof args.maxResults === "number" && Number.isFinite(args.maxResults) ? args.maxResults : void 0,
1140
+ collection: typeof args.collection === "string" ? args.collection : void 0,
1141
+ principal: effectivePrincipal
1142
+ });
1143
+ case "engram.memory_profile":
1144
+ return this.service.memoryProfile(
1145
+ typeof args.namespace === "string" ? args.namespace : void 0,
1146
+ effectivePrincipal
1147
+ );
1148
+ case "engram.memory_entities_list":
1149
+ return this.service.memoryEntitiesList(
1150
+ typeof args.namespace === "string" ? args.namespace : void 0,
1151
+ effectivePrincipal
1152
+ );
1153
+ case "engram.memory_questions":
1154
+ return this.service.memoryQuestions(
1155
+ typeof args.namespace === "string" ? args.namespace : void 0,
1156
+ effectivePrincipal
1157
+ );
1158
+ case "engram.memory_last_recall":
1159
+ return this.service.lastRecallSnapshot(
1160
+ typeof args.sessionKey === "string" ? args.sessionKey : void 0
1161
+ );
1162
+ case "engram.memory_intent_debug":
1163
+ return this.service.intentDebug(
1164
+ typeof args.namespace === "string" ? args.namespace : void 0
1165
+ );
1166
+ case "engram.memory_qmd_debug":
1167
+ return this.service.qmdDebug(
1168
+ typeof args.namespace === "string" ? args.namespace : void 0
1169
+ );
1170
+ case "engram.memory_graph_explain":
1171
+ return this.service.graphExplainLastRecall(
1172
+ typeof args.namespace === "string" ? args.namespace : void 0
1173
+ );
1174
+ case "engram.memory_feedback":
1175
+ return this.service.memoryFeedback({
1176
+ memoryId: typeof args.memoryId === "string" ? args.memoryId : "",
1177
+ vote: args.vote === "down" ? "down" : "up",
1178
+ note: typeof args.note === "string" ? args.note : void 0
1179
+ });
1180
+ case "engram.memory_promote":
1181
+ return this.service.memoryPromote({
1182
+ memoryId: typeof args.memoryId === "string" ? args.memoryId : "",
1183
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
1184
+ principal: effectivePrincipal,
1185
+ sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : void 0
1186
+ });
1187
+ case "engram.context_checkpoint":
1188
+ return this.service.contextCheckpoint({
1189
+ sessionKey: typeof args.sessionKey === "string" ? args.sessionKey : "",
1190
+ context: typeof args.context === "string" ? args.context : "",
1191
+ namespace: typeof args.namespace === "string" ? args.namespace : void 0,
1192
+ principal: effectivePrincipal
1193
+ });
1194
+ default:
1195
+ throw new Error(`unknown tool: ${name}`);
1196
+ }
1197
+ }
1198
+ };
1199
+
1200
+ export {
1201
+ EngramMcpServer
1202
+ };
1203
+ //# sourceMappingURL=chunk-CXWFUJR2.js.map