@remnic/core 9.3.770 → 9.4.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 (316) hide show
  1. package/dist/access-admin-ops-surface.js +35 -35
  2. package/dist/access-boundary.js +36 -36
  3. package/dist/access-cli.js +109 -108
  4. package/dist/access-cli.js.map +1 -1
  5. package/dist/access-http.js +47 -46
  6. package/dist/access-identity-continuity-surface.js +35 -35
  7. package/dist/access-lcm-surface.js +35 -35
  8. package/dist/access-mcp-output-schemas.d.ts +20 -0
  9. package/dist/access-mcp-output-schemas.js +8 -0
  10. package/dist/access-mcp.js +44 -43
  11. package/dist/access-observe-write-surface.js +35 -35
  12. package/dist/access-operations-batch.js +40 -40
  13. package/dist/access-operations.d.ts +4 -4
  14. package/dist/access-operations.js +42 -42
  15. package/dist/access-recall-surface.js +35 -35
  16. package/dist/access-schema.d.ts +68 -68
  17. package/dist/access-schema.js +3 -3
  18. package/dist/access-service.js +35 -35
  19. package/dist/active-recall.js +2 -2
  20. package/dist/adapters/index.js +4 -4
  21. package/dist/adapters/registry.js +2 -2
  22. package/dist/{auto-sync-2SOUW4JW.js → auto-sync-M47VTCFI.js} +7 -7
  23. package/dist/bootstrap.js +2 -2
  24. package/dist/boxes.js +2 -2
  25. package/dist/briefing.js +10 -10
  26. package/dist/buffer.js +2 -2
  27. package/dist/calibration.js +4 -4
  28. package/dist/causal-behavior.js +4 -4
  29. package/dist/causal-chain.js +4 -4
  30. package/dist/causal-consolidation.js +15 -15
  31. package/dist/causal-retrieval.js +4 -4
  32. package/dist/causal-trajectory-graph.js +1 -1
  33. package/dist/causal-trajectory.js +1 -1
  34. package/dist/{chunk-7FL4CNPV.js → chunk-2A3OXAP2.js} +2 -2
  35. package/dist/{chunk-GG6AJN7A.js → chunk-2IZAGAJR.js} +2 -2
  36. package/dist/{chunk-ZG4FT6IT.js → chunk-2TCZE3C2.js} +3 -3
  37. package/dist/chunk-37CTGERM.js +62 -0
  38. package/dist/chunk-37CTGERM.js.map +1 -0
  39. package/dist/{chunk-KYYL4U6X.js → chunk-42BBIR33.js} +2 -2
  40. package/dist/{chunk-DQC3ZZYM.js → chunk-4KJLYTLS.js} +2 -2
  41. package/dist/{chunk-7OSULYN2.js → chunk-4NMATTXV.js} +2 -2
  42. package/dist/{chunk-GY3SKOS4.js → chunk-5EZXHU36.js} +2 -2
  43. package/dist/{chunk-IOENSSZC.js → chunk-5H56JAHW.js} +4 -4
  44. package/dist/{chunk-K2I3AWBR.js → chunk-5K5VEDFY.js} +2 -2
  45. package/dist/chunk-5RUE3GHQ.js +445 -0
  46. package/dist/chunk-5RUE3GHQ.js.map +1 -0
  47. package/dist/{chunk-IBAU2RZN.js → chunk-64ZYXSCO.js} +2 -2
  48. package/dist/{chunk-2MR3MFQB.js → chunk-6Y4JTNX7.js} +2 -2
  49. package/dist/{chunk-XG4NBBRW.js → chunk-7BAJAXGB.js} +2 -2
  50. package/dist/{chunk-L24JROPR.js → chunk-7WSLR2CU.js} +2 -2
  51. package/dist/{chunk-EXM3CQTZ.js → chunk-A3GOMRJG.js} +2 -2
  52. package/dist/{chunk-KFIAFHOC.js → chunk-ABGDGBDT.js} +2 -2
  53. package/dist/{chunk-3JOFWTQD.js → chunk-APMGGGTY.js} +3 -3
  54. package/dist/{chunk-JBPKEARU.js → chunk-AU7Q3LSC.js} +4 -4
  55. package/dist/{chunk-XHYGJVXL.js → chunk-AXTXN4T6.js} +2 -2
  56. package/dist/{chunk-5QANTTY2.js → chunk-BRDJ2HFP.js} +2 -2
  57. package/dist/{chunk-QMN3CIFS.js → chunk-CGS7UKWM.js} +2 -2
  58. package/dist/{chunk-KYC3RLYJ.js → chunk-CXLNZXG5.js} +1 -1
  59. package/dist/{chunk-3O3BZNSH.js → chunk-CZGIIADK.js} +10 -10
  60. package/dist/{chunk-QRDOSYOR.js → chunk-DBRYEIGY.js} +2 -2
  61. package/dist/{chunk-UC4YOAC2.js → chunk-E5BK6CGV.js} +2 -2
  62. package/dist/{chunk-TKZ3AL5V.js → chunk-EHK6KZHK.js} +2 -2
  63. package/dist/{chunk-JZ7P26GF.js → chunk-F53UF7CI.js} +2 -2
  64. package/dist/{chunk-SJHM6I4J.js → chunk-FC77VUX5.js} +2 -2
  65. package/dist/{chunk-DKTSR7EK.js → chunk-FDPZVY6D.js} +2 -2
  66. package/dist/{chunk-CSHUSYUM.js → chunk-FT37KV7R.js} +2 -2
  67. package/dist/{chunk-MLDAD27I.js → chunk-FWPHPN3V.js} +8 -8
  68. package/dist/{chunk-SRSPVFSJ.js → chunk-G47FEGGK.js} +4 -4
  69. package/dist/{chunk-OP43P53G.js → chunk-GEVIE5NV.js} +163 -73
  70. package/dist/chunk-GEVIE5NV.js.map +1 -0
  71. package/dist/{chunk-52TEPNL7.js → chunk-H25TAODC.js} +7 -7
  72. package/dist/{chunk-5ACKQLGA.js → chunk-H2EJNV2Z.js} +3 -3
  73. package/dist/{chunk-XDRJQMYL.js → chunk-H5IT5JL7.js} +2 -2
  74. package/dist/{chunk-TQT3USCG.js → chunk-HG32URJJ.js} +2 -2
  75. package/dist/{chunk-ZQNCHPTZ.js → chunk-HLTAPHZZ.js} +2 -2
  76. package/dist/{chunk-LOPZ2DWR.js → chunk-I73G4UH7.js} +2 -2
  77. package/dist/{chunk-EWGMA5W5.js → chunk-IGF4DII6.js} +20 -20
  78. package/dist/{chunk-DCWIQFNA.js → chunk-JI5AVXYO.js} +4 -4
  79. package/dist/{chunk-VUA4S7P6.js → chunk-JIKJPDQJ.js} +4 -4
  80. package/dist/{chunk-VQ34TERH.js → chunk-JZHHREBL.js} +2 -2
  81. package/dist/{chunk-IQVQJJL7.js → chunk-K2ZLHESQ.js} +2 -2
  82. package/dist/{chunk-PWFWCGOO.js → chunk-KAWTOYAW.js} +2 -2
  83. package/dist/{chunk-DJECGBBM.js → chunk-KQDNAXOM.js} +2 -2
  84. package/dist/{chunk-WIWPSQYU.js → chunk-KQPJLK3X.js} +2 -2
  85. package/dist/{chunk-QKUWPSU3.js → chunk-KS4PRHRD.js} +2 -2
  86. package/dist/{chunk-DMKMQTBH.js → chunk-L4UZBJNM.js} +2 -2
  87. package/dist/{chunk-IQ7WCZRW.js → chunk-LLMZK53N.js} +2 -2
  88. package/dist/{chunk-YTU7WKYN.js → chunk-MNUHL34L.js} +3 -3
  89. package/dist/{chunk-ZCWIH4LH.js → chunk-MRHFJV44.js} +2 -2
  90. package/dist/{chunk-W4H5A3TJ.js → chunk-MTR7BZQN.js} +3 -3
  91. package/dist/{chunk-PNLCEFE4.js → chunk-MTWKDOVO.js} +2 -2
  92. package/dist/{chunk-3YYWUHA7.js → chunk-MWH5MAFP.js} +5 -5
  93. package/dist/{chunk-OSMBC3JU.js → chunk-O2EL7EGG.js} +2 -2
  94. package/dist/{chunk-HW5EF6LV.js → chunk-O7BBFJLP.js} +2 -2
  95. package/dist/{chunk-EHQ5HO5T.js → chunk-OBMR4VIX.js} +1 -1
  96. package/dist/{chunk-WRBDUNSW.js → chunk-OH6BKCPB.js} +3 -3
  97. package/dist/{chunk-6SHAUM5S.js → chunk-OUMTBFSQ.js} +4 -4
  98. package/dist/{chunk-FLVL4L3L.js → chunk-OUXPVWTZ.js} +5 -5
  99. package/dist/{chunk-EEKDRAWX.js → chunk-PRTA6444.js} +2 -2
  100. package/dist/{chunk-WB4CFKZ4.js → chunk-QGS7Z7YU.js} +2 -2
  101. package/dist/{chunk-T4AWNIXJ.js → chunk-QICQ35K5.js} +2 -2
  102. package/dist/{chunk-UUH4YQOF.js → chunk-QLULYKWZ.js} +2 -2
  103. package/dist/{chunk-DBSMLRTO.js → chunk-QT2RZNRT.js} +2 -2
  104. package/dist/{chunk-HM6UJPPO.js → chunk-QWGNDWKB.js} +2 -2
  105. package/dist/{chunk-KCQA46NR.js → chunk-R5VAVVHP.js} +2 -2
  106. package/dist/{chunk-MYNRJGOY.js → chunk-RBGL4MKQ.js} +2 -2
  107. package/dist/{chunk-O7GOFAM3.js → chunk-RP7YXA67.js} +2 -2
  108. package/dist/{chunk-BVKCV2ZY.js → chunk-SMX5267P.js} +2 -2
  109. package/dist/{chunk-U72WWTLR.js → chunk-TH2KIPP7.js} +4 -4
  110. package/dist/{chunk-PSNMICC2.js → chunk-TKUQSXU4.js} +10 -10
  111. package/dist/{chunk-XBZQRZ6G.js → chunk-TN7THW5U.js} +2 -2
  112. package/dist/{chunk-O5EKTMOJ.js → chunk-UAOZJX5J.js} +16 -16
  113. package/dist/{chunk-JRZV3767.js → chunk-UI4FVU6T.js} +2 -2
  114. package/dist/{chunk-E6LXM2GE.js → chunk-UQI2NHTY.js} +55 -55
  115. package/dist/{chunk-W7VA5667.js → chunk-UQMCR5RW.js} +3 -3
  116. package/dist/{chunk-VGUOEDTU.js → chunk-V3UE5I5F.js} +2 -2
  117. package/dist/{chunk-STN5KMSS.js → chunk-VBBMTSOV.js} +7 -7
  118. package/dist/{chunk-5QJZLJ7Q.js → chunk-VBVSN2TV.js} +3 -3
  119. package/dist/{chunk-VL7DP3OW.js → chunk-VFSP73LP.js} +2 -2
  120. package/dist/{chunk-KMKBD66B.js → chunk-XOE5DYQL.js} +3 -3
  121. package/dist/{chunk-TGROC2UP.js → chunk-XXEOGY77.js} +9 -9
  122. package/dist/{chunk-NNL4LJAD.js → chunk-XZ5I7OZR.js} +5 -5
  123. package/dist/{chunk-7XGF5HCC.js → chunk-XZJMIJLW.js} +85 -85
  124. package/dist/{chunk-3NN73CM7.js → chunk-YFBTVOMB.js} +3 -3
  125. package/dist/{chunk-RZ3KJZYE.js → chunk-YM7IEUO7.js} +3 -3
  126. package/dist/{chunk-ZT34X56N.js → chunk-YPL66L3U.js} +2 -2
  127. package/dist/{chunk-ZZMRXJFY.js → chunk-ZIDSD6VC.js} +2 -2
  128. package/dist/cli.js +71 -70
  129. package/dist/compounding/engine.js +11 -11
  130. package/dist/compounding/preference-consolidator.js +1 -1
  131. package/dist/config.js +2 -2
  132. package/dist/connectors/codex-materialize-runner.js +11 -11
  133. package/dist/connectors/codex-materialize.js +2 -2
  134. package/dist/connectors/index.js +12 -12
  135. package/dist/contradiction/index.js +3 -3
  136. package/dist/{contradiction-scan-3FJYWS3G.js → contradiction-scan-SSKCAMLX.js} +3 -3
  137. package/dist/conversation-index/backend.js +5 -5
  138. package/dist/conversation-index/cleanup.js +2 -2
  139. package/dist/conversation-index/faiss-adapter.js +2 -2
  140. package/dist/conversation-index/indexer.js +2 -2
  141. package/dist/conversation-index/search.js +2 -2
  142. package/dist/day-summary.js +2 -2
  143. package/dist/embedding-fallback.js +2 -2
  144. package/dist/entity-retrieval.js +11 -11
  145. package/dist/extraction-faithfulness.js +5 -5
  146. package/dist/extraction-judge-telemetry.js +2 -2
  147. package/dist/extraction-judge-training.js +2 -2
  148. package/dist/extraction-judge.js +5 -5
  149. package/dist/extraction.js +9 -9
  150. package/dist/fallback-llm.js +4 -4
  151. package/dist/{forget-WYLR4ZFV.js → forget-KHF7A44H.js} +4 -4
  152. package/dist/{graph-edge-decay-RXUCJIN4.js → graph-edge-decay-FO7AM4UR.js} +3 -3
  153. package/dist/graph-snapshot.js +2 -2
  154. package/dist/graph.js +1 -1
  155. package/dist/index.js +146 -145
  156. package/dist/lcm/archive.js +2 -2
  157. package/dist/lcm/engine.js +5 -5
  158. package/dist/lcm/index.js +8 -8
  159. package/dist/lcm/schema.js +2 -2
  160. package/dist/lcm/summarizer.js +3 -3
  161. package/dist/local-llm.js +2 -2
  162. package/dist/logger.d.ts +8 -2
  163. package/dist/logger.js +1 -1
  164. package/dist/maintenance/memory-governance.js +10 -10
  165. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -10
  166. package/dist/maintenance/rebuild-memory-projection.js +12 -12
  167. package/dist/model-registry.js +2 -2
  168. package/dist/models-json.js +2 -2
  169. package/dist/namespaces/migrate.js +23 -23
  170. package/dist/namespaces/search.js +13 -13
  171. package/dist/namespaces/storage.js +10 -10
  172. package/dist/native-knowledge.js +2 -2
  173. package/dist/negative.js +2 -2
  174. package/dist/operator-toolkit.js +30 -30
  175. package/dist/orchestration/compression-guideline-coordinator.js +2 -2
  176. package/dist/orchestration/maintenance.js +12 -12
  177. package/dist/orchestrator.js +109 -108
  178. package/dist/profiling.js +2 -2
  179. package/dist/qmd.js +2 -2
  180. package/dist/recall-planner-llm.js +4 -4
  181. package/dist/recall-qos.js +2 -2
  182. package/dist/recall-state.js +2 -2
  183. package/dist/relevance.js +2 -2
  184. package/dist/{resolution-33PIX3TT.js → resolution-VH4NGENZ.js} +3 -3
  185. package/dist/resolution-VH4NGENZ.js.map +1 -0
  186. package/dist/resolve-provider-secret.js +2 -2
  187. package/dist/resume-bundles.js +4 -4
  188. package/dist/retrieval-agents.js +2 -2
  189. package/dist/routing/store.js +2 -2
  190. package/dist/schemas.d.ts +84 -84
  191. package/dist/search/embed-helper.js +2 -2
  192. package/dist/search/factory.js +12 -12
  193. package/dist/search/index.js +12 -12
  194. package/dist/search/lancedb-backend.js +2 -2
  195. package/dist/search/meilisearch-backend.js +2 -2
  196. package/dist/search/orama-backend.js +2 -2
  197. package/dist/search/remote-backend.js +2 -2
  198. package/dist/semantic-consolidation.js +12 -12
  199. package/dist/semantic-rule-promotion.js +10 -10
  200. package/dist/semantic-rule-verifier.js +10 -10
  201. package/dist/session-observer-state.js +2 -2
  202. package/dist/session-transcript-migration.js +2 -2
  203. package/dist/shared-context/manager.d.ts +8 -8
  204. package/dist/shared-context/manager.js +2 -2
  205. package/dist/storage-guards.js +2 -2
  206. package/dist/storage.js +9 -9
  207. package/dist/summarizer.js +7 -7
  208. package/dist/temporal-supersession.js +2 -2
  209. package/dist/threading.js +2 -2
  210. package/dist/transcript.js +2 -2
  211. package/dist/transfer/autodetect.js +1 -1
  212. package/dist/transfer/backup.js +1 -1
  213. package/dist/transfer/capsule-export.js +2 -2
  214. package/dist/transfer/types.d.ts +66 -66
  215. package/dist/verified-recall.js +11 -11
  216. package/package.json +2 -2
  217. package/src/access-mcp-output-schemas.ts +472 -0
  218. package/src/access-mcp.ts +235 -143
  219. package/src/logger.test.ts +120 -0
  220. package/src/logger.ts +37 -9
  221. package/dist/chunk-NU3CSQ4H.js +0 -48
  222. package/dist/chunk-NU3CSQ4H.js.map +0 -1
  223. package/dist/chunk-OP43P53G.js.map +0 -1
  224. /package/dist/{contradiction-scan-3FJYWS3G.js.map → access-mcp-output-schemas.js.map} +0 -0
  225. /package/dist/{auto-sync-2SOUW4JW.js.map → auto-sync-M47VTCFI.js.map} +0 -0
  226. /package/dist/{chunk-7FL4CNPV.js.map → chunk-2A3OXAP2.js.map} +0 -0
  227. /package/dist/{chunk-GG6AJN7A.js.map → chunk-2IZAGAJR.js.map} +0 -0
  228. /package/dist/{chunk-ZG4FT6IT.js.map → chunk-2TCZE3C2.js.map} +0 -0
  229. /package/dist/{chunk-KYYL4U6X.js.map → chunk-42BBIR33.js.map} +0 -0
  230. /package/dist/{chunk-DQC3ZZYM.js.map → chunk-4KJLYTLS.js.map} +0 -0
  231. /package/dist/{chunk-7OSULYN2.js.map → chunk-4NMATTXV.js.map} +0 -0
  232. /package/dist/{chunk-GY3SKOS4.js.map → chunk-5EZXHU36.js.map} +0 -0
  233. /package/dist/{chunk-IOENSSZC.js.map → chunk-5H56JAHW.js.map} +0 -0
  234. /package/dist/{chunk-K2I3AWBR.js.map → chunk-5K5VEDFY.js.map} +0 -0
  235. /package/dist/{chunk-IBAU2RZN.js.map → chunk-64ZYXSCO.js.map} +0 -0
  236. /package/dist/{chunk-2MR3MFQB.js.map → chunk-6Y4JTNX7.js.map} +0 -0
  237. /package/dist/{chunk-XG4NBBRW.js.map → chunk-7BAJAXGB.js.map} +0 -0
  238. /package/dist/{chunk-L24JROPR.js.map → chunk-7WSLR2CU.js.map} +0 -0
  239. /package/dist/{chunk-EXM3CQTZ.js.map → chunk-A3GOMRJG.js.map} +0 -0
  240. /package/dist/{chunk-KFIAFHOC.js.map → chunk-ABGDGBDT.js.map} +0 -0
  241. /package/dist/{chunk-3JOFWTQD.js.map → chunk-APMGGGTY.js.map} +0 -0
  242. /package/dist/{chunk-JBPKEARU.js.map → chunk-AU7Q3LSC.js.map} +0 -0
  243. /package/dist/{chunk-XHYGJVXL.js.map → chunk-AXTXN4T6.js.map} +0 -0
  244. /package/dist/{chunk-5QANTTY2.js.map → chunk-BRDJ2HFP.js.map} +0 -0
  245. /package/dist/{chunk-QMN3CIFS.js.map → chunk-CGS7UKWM.js.map} +0 -0
  246. /package/dist/{chunk-KYC3RLYJ.js.map → chunk-CXLNZXG5.js.map} +0 -0
  247. /package/dist/{chunk-3O3BZNSH.js.map → chunk-CZGIIADK.js.map} +0 -0
  248. /package/dist/{chunk-QRDOSYOR.js.map → chunk-DBRYEIGY.js.map} +0 -0
  249. /package/dist/{chunk-UC4YOAC2.js.map → chunk-E5BK6CGV.js.map} +0 -0
  250. /package/dist/{chunk-TKZ3AL5V.js.map → chunk-EHK6KZHK.js.map} +0 -0
  251. /package/dist/{chunk-JZ7P26GF.js.map → chunk-F53UF7CI.js.map} +0 -0
  252. /package/dist/{chunk-SJHM6I4J.js.map → chunk-FC77VUX5.js.map} +0 -0
  253. /package/dist/{chunk-DKTSR7EK.js.map → chunk-FDPZVY6D.js.map} +0 -0
  254. /package/dist/{chunk-CSHUSYUM.js.map → chunk-FT37KV7R.js.map} +0 -0
  255. /package/dist/{chunk-MLDAD27I.js.map → chunk-FWPHPN3V.js.map} +0 -0
  256. /package/dist/{chunk-SRSPVFSJ.js.map → chunk-G47FEGGK.js.map} +0 -0
  257. /package/dist/{chunk-52TEPNL7.js.map → chunk-H25TAODC.js.map} +0 -0
  258. /package/dist/{chunk-5ACKQLGA.js.map → chunk-H2EJNV2Z.js.map} +0 -0
  259. /package/dist/{chunk-XDRJQMYL.js.map → chunk-H5IT5JL7.js.map} +0 -0
  260. /package/dist/{chunk-TQT3USCG.js.map → chunk-HG32URJJ.js.map} +0 -0
  261. /package/dist/{chunk-ZQNCHPTZ.js.map → chunk-HLTAPHZZ.js.map} +0 -0
  262. /package/dist/{chunk-LOPZ2DWR.js.map → chunk-I73G4UH7.js.map} +0 -0
  263. /package/dist/{chunk-EWGMA5W5.js.map → chunk-IGF4DII6.js.map} +0 -0
  264. /package/dist/{chunk-DCWIQFNA.js.map → chunk-JI5AVXYO.js.map} +0 -0
  265. /package/dist/{chunk-VUA4S7P6.js.map → chunk-JIKJPDQJ.js.map} +0 -0
  266. /package/dist/{chunk-VQ34TERH.js.map → chunk-JZHHREBL.js.map} +0 -0
  267. /package/dist/{chunk-IQVQJJL7.js.map → chunk-K2ZLHESQ.js.map} +0 -0
  268. /package/dist/{chunk-PWFWCGOO.js.map → chunk-KAWTOYAW.js.map} +0 -0
  269. /package/dist/{chunk-DJECGBBM.js.map → chunk-KQDNAXOM.js.map} +0 -0
  270. /package/dist/{chunk-WIWPSQYU.js.map → chunk-KQPJLK3X.js.map} +0 -0
  271. /package/dist/{chunk-QKUWPSU3.js.map → chunk-KS4PRHRD.js.map} +0 -0
  272. /package/dist/{chunk-DMKMQTBH.js.map → chunk-L4UZBJNM.js.map} +0 -0
  273. /package/dist/{chunk-IQ7WCZRW.js.map → chunk-LLMZK53N.js.map} +0 -0
  274. /package/dist/{chunk-YTU7WKYN.js.map → chunk-MNUHL34L.js.map} +0 -0
  275. /package/dist/{chunk-ZCWIH4LH.js.map → chunk-MRHFJV44.js.map} +0 -0
  276. /package/dist/{chunk-W4H5A3TJ.js.map → chunk-MTR7BZQN.js.map} +0 -0
  277. /package/dist/{chunk-PNLCEFE4.js.map → chunk-MTWKDOVO.js.map} +0 -0
  278. /package/dist/{chunk-3YYWUHA7.js.map → chunk-MWH5MAFP.js.map} +0 -0
  279. /package/dist/{chunk-OSMBC3JU.js.map → chunk-O2EL7EGG.js.map} +0 -0
  280. /package/dist/{chunk-HW5EF6LV.js.map → chunk-O7BBFJLP.js.map} +0 -0
  281. /package/dist/{chunk-EHQ5HO5T.js.map → chunk-OBMR4VIX.js.map} +0 -0
  282. /package/dist/{chunk-WRBDUNSW.js.map → chunk-OH6BKCPB.js.map} +0 -0
  283. /package/dist/{chunk-6SHAUM5S.js.map → chunk-OUMTBFSQ.js.map} +0 -0
  284. /package/dist/{chunk-FLVL4L3L.js.map → chunk-OUXPVWTZ.js.map} +0 -0
  285. /package/dist/{chunk-EEKDRAWX.js.map → chunk-PRTA6444.js.map} +0 -0
  286. /package/dist/{chunk-WB4CFKZ4.js.map → chunk-QGS7Z7YU.js.map} +0 -0
  287. /package/dist/{chunk-T4AWNIXJ.js.map → chunk-QICQ35K5.js.map} +0 -0
  288. /package/dist/{chunk-UUH4YQOF.js.map → chunk-QLULYKWZ.js.map} +0 -0
  289. /package/dist/{chunk-DBSMLRTO.js.map → chunk-QT2RZNRT.js.map} +0 -0
  290. /package/dist/{chunk-HM6UJPPO.js.map → chunk-QWGNDWKB.js.map} +0 -0
  291. /package/dist/{chunk-KCQA46NR.js.map → chunk-R5VAVVHP.js.map} +0 -0
  292. /package/dist/{chunk-MYNRJGOY.js.map → chunk-RBGL4MKQ.js.map} +0 -0
  293. /package/dist/{chunk-O7GOFAM3.js.map → chunk-RP7YXA67.js.map} +0 -0
  294. /package/dist/{chunk-BVKCV2ZY.js.map → chunk-SMX5267P.js.map} +0 -0
  295. /package/dist/{chunk-U72WWTLR.js.map → chunk-TH2KIPP7.js.map} +0 -0
  296. /package/dist/{chunk-PSNMICC2.js.map → chunk-TKUQSXU4.js.map} +0 -0
  297. /package/dist/{chunk-XBZQRZ6G.js.map → chunk-TN7THW5U.js.map} +0 -0
  298. /package/dist/{chunk-O5EKTMOJ.js.map → chunk-UAOZJX5J.js.map} +0 -0
  299. /package/dist/{chunk-JRZV3767.js.map → chunk-UI4FVU6T.js.map} +0 -0
  300. /package/dist/{chunk-E6LXM2GE.js.map → chunk-UQI2NHTY.js.map} +0 -0
  301. /package/dist/{chunk-W7VA5667.js.map → chunk-UQMCR5RW.js.map} +0 -0
  302. /package/dist/{chunk-VGUOEDTU.js.map → chunk-V3UE5I5F.js.map} +0 -0
  303. /package/dist/{chunk-STN5KMSS.js.map → chunk-VBBMTSOV.js.map} +0 -0
  304. /package/dist/{chunk-5QJZLJ7Q.js.map → chunk-VBVSN2TV.js.map} +0 -0
  305. /package/dist/{chunk-VL7DP3OW.js.map → chunk-VFSP73LP.js.map} +0 -0
  306. /package/dist/{chunk-KMKBD66B.js.map → chunk-XOE5DYQL.js.map} +0 -0
  307. /package/dist/{chunk-TGROC2UP.js.map → chunk-XXEOGY77.js.map} +0 -0
  308. /package/dist/{chunk-NNL4LJAD.js.map → chunk-XZ5I7OZR.js.map} +0 -0
  309. /package/dist/{chunk-7XGF5HCC.js.map → chunk-XZJMIJLW.js.map} +0 -0
  310. /package/dist/{chunk-3NN73CM7.js.map → chunk-YFBTVOMB.js.map} +0 -0
  311. /package/dist/{chunk-RZ3KJZYE.js.map → chunk-YM7IEUO7.js.map} +0 -0
  312. /package/dist/{chunk-ZT34X56N.js.map → chunk-YPL66L3U.js.map} +0 -0
  313. /package/dist/{chunk-ZZMRXJFY.js.map → chunk-ZIDSD6VC.js.map} +0 -0
  314. /package/dist/{graph-edge-decay-RXUCJIN4.js.map → contradiction-scan-SSKCAMLX.js.map} +0 -0
  315. /package/dist/{forget-WYLR4ZFV.js.map → forget-KHF7A44H.js.map} +0 -0
  316. /package/dist/{resolution-33PIX3TT.js.map → graph-edge-decay-FO7AM4UR.js.map} +0 -0
package/src/access-mcp.ts CHANGED
@@ -1,9 +1,11 @@
1
- import type { Readable, Writable } from "node:stream";
2
- import { readFile } from "node:fs/promises";
3
1
  import { randomUUID } from "node:crypto";
4
- import { EngramAccessInputError, type EngramAccessService, type EngramAccessRecallResponse } from "./access-service.js";
2
+ import { readFile } from "node:fs/promises";
3
+ import type { Readable, Writable } from "node:stream";
4
+ // Importing access-operations registers the pilot boundary operations
5
+ // (memory_get / memory_search / memory_store) as a side effect; callTool
6
+ // dispatches migrated tools through the registry (issue #1525).
7
+ import { type OperationName, getOperation } from "./access-boundary.js";
5
8
  import {
6
- validateRequest,
7
9
  type ActionConfidenceRequest,
8
10
  type CapsuleExportRequest,
9
11
  type CapsuleImportRequest,
@@ -12,30 +14,29 @@ import {
12
14
  type SchemaName,
13
15
  type SchemaTypeFor,
14
16
  type SuggestionSubmitRequest,
17
+ validateRequest,
15
18
  } from "./access-schema.js";
16
- // Importing access-operations registers the pilot boundary operations
17
- // (memory_get / memory_search / memory_store) as a side effect; callTool
18
- // dispatches migrated tools through the registry (issue #1525).
19
- import { getOperation, type OperationName } from "./access-boundary.js";
19
+ import { EngramAccessInputError, type EngramAccessRecallResponse, type EngramAccessService } from "./access-service.js";
20
20
  import "./access-operations.js";
21
- import { readEnvVar } from "./runtime/env.js";
22
- import type { RecallDisclosure, RecallPlanMode } from "./types.js";
23
21
  import { validateBriefingFormat } from "./briefing.js";
24
- import { buildCitationGuidance, type CitationMetadata } from "./citations.js";
22
+ import { processChatMessage } from "./chat/chat-factory.js";
23
+ import { type CitationMetadata, buildCitationGuidance } from "./citations.js";
25
24
  import { projectTagProjectId } from "./coding/coding-namespace.js";
26
- import { expandTildePath } from "./utils/path.js";
27
- import { resolvePrincipal } from "./namespaces/principal.js";
28
25
  import {
29
26
  REMNIC_CHATGPT_MEMORY_INSPECTOR_MIME_TYPE,
30
27
  REMNIC_CHATGPT_MEMORY_INSPECTOR_TOOL,
31
28
  REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_HTML,
32
29
  REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
30
+ type RemnicChatGptMemoryInspectorInput,
33
31
  buildChatGptMemoryInspectorActionRequest,
34
32
  buildChatGptMemoryInspectorResult,
35
- type RemnicChatGptMemoryInspectorInput,
36
33
  } from "./mcp-memory-inspector-app.js";
37
- import { processChatMessage } from "./chat/chat-factory.js";
34
+ import { resolvePrincipal } from "./namespaces/principal.js";
35
+ import { readEnvVar } from "./runtime/env.js";
36
+ import type { RecallDisclosure, RecallPlanMode } from "./types.js";
37
+ import { expandTildePath } from "./utils/path.js";
38
38
 
39
+ import { applyToolOutputSchemas } from "./access-mcp-output-schemas.js";
39
40
  type JsonRpcId = string | number | null;
40
41
 
41
42
  type JsonRpcRequest = {
@@ -145,19 +146,13 @@ const MCP_READ_ONLY_TOOL_SUFFIXES: Readonly<Record<string, true>> = {
145
146
  * Exported so the HTTP transport can validate the `MCP-Protocol-Version`
146
147
  * header and reject requests advertising an unknown version.
147
148
  */
148
- export const MCP_SUPPORTED_PROTOCOL_VERSIONS: readonly string[] = [
149
- "2025-06-18",
150
- "2025-03-26",
151
- "2024-11-05",
152
- ];
149
+ export const MCP_SUPPORTED_PROTOCOL_VERSIONS: readonly string[] = ["2025-06-18", "2025-03-26", "2024-11-05"];
153
150
  const MCP_DEFAULT_PROTOCOL_VERSION: string = MCP_SUPPORTED_PROTOCOL_VERSIONS[0] ?? "2025-06-18";
154
151
  const LEGACY_MCP_PREFIX = "engram.";
155
152
  const CANONICAL_MCP_PREFIX = "remnic.";
156
153
 
157
154
  function toCanonicalToolName(name: string): string {
158
- return name.startsWith(LEGACY_MCP_PREFIX)
159
- ? `${CANONICAL_MCP_PREFIX}${name.slice(LEGACY_MCP_PREFIX.length)}`
160
- : name;
155
+ return name.startsWith(LEGACY_MCP_PREFIX) ? `${CANONICAL_MCP_PREFIX}${name.slice(LEGACY_MCP_PREFIX.length)}` : name;
161
156
  }
162
157
  function toLegacyToolName(name: string): string {
163
158
  return name.startsWith(CANONICAL_MCP_PREFIX)
@@ -309,7 +304,7 @@ const MCP_MIGRATED_OPERATIONS: Readonly<Record<string, OperationName>> = {
309
304
 
310
305
  function resolveChatGptInspectorRecallSessionKey(
311
306
  explicitSessionKey: string | undefined,
312
- authenticatedPrincipal: string | undefined,
307
+ authenticatedPrincipal: string | undefined
313
308
  ): string | undefined {
314
309
  if (explicitSessionKey) return explicitSessionKey;
315
310
  if (!authenticatedPrincipal) return undefined;
@@ -317,14 +312,7 @@ function resolveChatGptInspectorRecallSessionKey(
317
312
  }
318
313
 
319
314
  const STRICT_MCP_SCHEMA_KEYS: Partial<Record<SchemaName, readonly string[]>> = {
320
- daySummary: [
321
- "memories",
322
- "sessionKey",
323
- "namespace",
324
- "timeZone",
325
- "cwd",
326
- "projectTag",
327
- ],
315
+ daySummary: ["memories", "sessionKey", "namespace", "timeZone", "cwd", "projectTag"],
328
316
  memoryStore: [
329
317
  "schemaVersion",
330
318
  "idempotencyKey",
@@ -392,8 +380,7 @@ const MCP_GIT_CONTEXT_SCHEMA_PROPS_SCOPED: Record<string, unknown> = {
392
380
  const MCP_GIT_CONTEXT_SCHEMA_PROPS_IGNORED: Record<string, unknown> = {
393
381
  cwd: {
394
382
  type: "string",
395
- description:
396
- "Accepted for MCP client compatibility (git-context auto-injection); ignored by this tool.",
383
+ description: "Accepted for MCP client compatibility (git-context auto-injection); ignored by this tool.",
397
384
  },
398
385
  projectTag: {
399
386
  type: "string",
@@ -401,29 +388,22 @@ const MCP_GIT_CONTEXT_SCHEMA_PROPS_IGNORED: Record<string, unknown> = {
401
388
  },
402
389
  };
403
390
 
404
- function parseMcpRequest<N extends SchemaName>(
405
- schemaName: N,
406
- args: Record<string, unknown>,
407
- ): SchemaTypeFor<N> {
391
+ function parseMcpRequest<N extends SchemaName>(schemaName: N, args: Record<string, unknown>): SchemaTypeFor<N> {
408
392
  const allowedKeys = STRICT_MCP_SCHEMA_KEYS[schemaName];
409
393
  if (allowedKeys) {
410
394
  const allowed = new Set(allowedKeys);
411
395
  const unexpected = Object.keys(args).filter((key) => !allowed.has(key));
412
396
  if (unexpected.length > 0) {
413
397
  throw new EngramAccessInputError(
414
- `request validation failed: (root): Unrecognized key(s) in object: ${unexpected.join(", ")}`,
398
+ `request validation failed: (root): Unrecognized key(s) in object: ${unexpected.join(", ")}`
415
399
  );
416
400
  }
417
401
  }
418
402
  const validation = validateRequest<SchemaTypeFor<N>>(schemaName, args);
419
403
  if (validation.success) return validation.data;
420
- const details = validation.error.details
421
- .map((detail) => `${detail.field}: ${detail.message}`)
422
- .join("; ");
404
+ const details = validation.error.details.map((detail) => `${detail.field}: ${detail.message}`).join("; ");
423
405
  throw new EngramAccessInputError(
424
- details.length > 0
425
- ? `${validation.error.error}: ${details}`
426
- : validation.error.error,
406
+ details.length > 0 ? `${validation.error.error}: ${details}` : validation.error.error
427
407
  );
428
408
  }
429
409
 
@@ -458,15 +438,11 @@ function optionalPositiveInteger(value: unknown, label: string): number | undefi
458
438
  }
459
439
 
460
440
  function getObjectProperties(value: unknown): Record<string, unknown> | undefined {
461
- return value && typeof value === "object" && !Array.isArray(value)
462
- ? (value as Record<string, unknown>)
463
- : undefined;
441
+ return value && typeof value === "object" && !Array.isArray(value) ? (value as Record<string, unknown>) : undefined;
464
442
  }
465
443
 
466
444
  async function getMcpServerVersion(): Promise<string> {
467
- const envVersion =
468
- readEnvVar("OPENCLAW_ENGRAM_VERSION")?.trim() ||
469
- readEnvVar("npm_package_version")?.trim();
445
+ const envVersion = readEnvVar("OPENCLAW_ENGRAM_VERSION")?.trim() || readEnvVar("npm_package_version")?.trim();
470
446
  if (envVersion) return envVersion;
471
447
  try {
472
448
  const pkgPath = new URL("../package.json", import.meta.url);
@@ -560,7 +536,7 @@ export class EngramMcpServer {
560
536
  sessionDeltaVisible?: boolean;
561
537
  correctionVisible?: boolean;
562
538
  chatVisible?: boolean;
563
- } = {},
539
+ } = {}
564
540
  ) {
565
541
  this.citationsEnabled = options.citationsEnabled === true;
566
542
  this.citationsAutoDetect = options.citationsAutoDetect !== false;
@@ -573,9 +549,7 @@ export class EngramMcpServer {
573
549
  this.correctionVisible = options.correctionVisible !== false;
574
550
  this.chatVisible = options.chatVisible === true;
575
551
  this.authenticatedPrincipal =
576
- options.principal?.trim() ||
577
- readEnvVar("OPENCLAW_ENGRAM_ACCESS_PRINCIPAL")?.trim() ||
578
- undefined;
552
+ options.principal?.trim() || readEnvVar("OPENCLAW_ENGRAM_ACCESS_PRINCIPAL")?.trim() || undefined;
579
553
  this.resources = [
580
554
  {
581
555
  uri: REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
@@ -598,10 +572,7 @@ export class EngramMcpServer {
598
572
  },
599
573
  ];
600
574
  this.resourceTextByUri = new Map([
601
- [
602
- REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
603
- REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_HTML,
604
- ],
575
+ [REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI, REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_HTML],
605
576
  ]);
606
577
  this.tools = [
607
578
  {
@@ -622,7 +593,10 @@ export class EngramMcpServer {
622
593
  // without it being silently dropped.
623
594
  disclosure: { type: "string", enum: ["chunk", "section", "raw"] },
624
595
  cwd: { type: "string", description: "Working directory for auto git-context resolution." },
625
- projectTag: { type: "string", description: "Project tag for non-git project scoping (e.g. 'blend-supply')." },
596
+ projectTag: {
597
+ type: "string",
598
+ description: "Project tag for non-git project scoping (e.g. 'blend-supply').",
599
+ },
626
600
  asOf: {
627
601
  type: "string",
628
602
  description:
@@ -636,7 +610,8 @@ export class EngramMcpServer {
636
610
  tagMatch: {
637
611
  type: "string",
638
612
  enum: ["any", "all"],
639
- description: "Tag-filter match mode. 'any' (default) admits results with at least one filter tag; 'all' requires every filter tag.",
613
+ description:
614
+ "Tag-filter match mode. 'any' (default) admits results with at least one filter tag; 'all' requires every filter tag.",
640
615
  },
641
616
  },
642
617
  required: ["query"],
@@ -675,7 +650,10 @@ export class EngramMcpServer {
675
650
  projectId: { type: "string", description: "Stable project id (origin:<hex> or root:<hex>)." },
676
651
  branch: { type: ["string", "null"], description: "Current branch, or null in detached HEAD." },
677
652
  rootPath: { type: "string", description: "Absolute path to the repo root." },
678
- defaultBranch: { type: ["string", "null"], description: "Default branch (usually main/master), or null when unknown." },
653
+ defaultBranch: {
654
+ type: ["string", "null"],
655
+ description: "Default branch (usually main/master), or null when unknown.",
656
+ },
679
657
  },
680
658
  required: ["projectId", "branch", "rootPath", "defaultBranch"],
681
659
  additionalProperties: false,
@@ -740,8 +718,7 @@ export class EngramMcpServer {
740
718
  budget: {
741
719
  type: "integer",
742
720
  minimum: 1,
743
- description:
744
- "Optional positive-integer override for the recall character budget.",
721
+ description: "Optional positive-integer override for the recall character budget.",
745
722
  },
746
723
  disclosure: {
747
724
  type: "string",
@@ -900,12 +877,7 @@ export class EngramMcpServer {
900
877
  properties: {
901
878
  kind: {
902
879
  type: "string",
903
- enum: [
904
- "ask-before",
905
- "do-not-use-outside-this-context",
906
- "never",
907
- "requires-escalation",
908
- ],
880
+ enum: ["ask-before", "do-not-use-outside-this-context", "never", "requires-escalation"],
909
881
  },
910
882
  description: { type: "string" },
911
883
  matched: { type: "boolean" },
@@ -975,8 +947,7 @@ export class EngramMcpServer {
975
947
  currentContextScopes: {
976
948
  type: "array",
977
949
  items: { type: "string" },
978
- description:
979
- "Optional current user-context scopes, such as repo, work, personal, client, or private.",
950
+ description: "Optional current user-context scopes, such as repo, work, personal, client, or private.",
980
951
  },
981
952
  allowUnverifiedPreview: {
982
953
  type: "boolean",
@@ -1117,7 +1088,8 @@ export class EngramMcpServer {
1117
1088
  namespace: { type: "string" },
1118
1089
  sessionKey: {
1119
1090
  type: "string",
1120
- description: "Optional session key used to derive namespace principal when no trusted transport principal is present.",
1091
+ description:
1092
+ "Optional session key used to derive namespace principal when no trusted transport principal is present.",
1121
1093
  },
1122
1094
  ...MCP_GIT_CONTEXT_SCHEMA_PROPS_IGNORED,
1123
1095
  },
@@ -1353,7 +1325,10 @@ export class EngramMcpServer {
1353
1325
  namespace: { type: "string" },
1354
1326
  skipExtraction: { type: "boolean" },
1355
1327
  cwd: { type: "string", description: "Working directory for auto git-context resolution." },
1356
- projectTag: { type: "string", description: "Project tag for non-git project scoping (e.g. 'blend-supply')." },
1328
+ projectTag: {
1329
+ type: "string",
1330
+ description: "Project tag for non-git project scoping (e.g. 'blend-supply').",
1331
+ },
1357
1332
  },
1358
1333
  required: ["sessionKey", "messages"],
1359
1334
  additionalProperties: false,
@@ -1377,8 +1352,7 @@ export class EngramMcpServer {
1377
1352
  },
1378
1353
  {
1379
1354
  name: "engram.lcm_compaction_flush",
1380
- description:
1381
- "Flush pending LCM observe work and incremental summaries before a host compacts session context.",
1355
+ description: "Flush pending LCM observe work and incremental summaries before a host compacts session context.",
1382
1356
  inputSchema: {
1383
1357
  type: "object",
1384
1358
  properties: {
@@ -1391,8 +1365,7 @@ export class EngramMcpServer {
1391
1365
  },
1392
1366
  {
1393
1367
  name: "engram.lcm_compaction_record",
1394
- description:
1395
- "Record a host compaction event with before/after token counts in the LCM archive.",
1368
+ description: "Record a host compaction event with before/after token counts in the LCM archive.",
1396
1369
  inputSchema: {
1397
1370
  type: "object",
1398
1371
  properties: {
@@ -1413,7 +1386,10 @@ export class EngramMcpServer {
1413
1386
  type: "object",
1414
1387
  properties: {
1415
1388
  period: { type: "string", enum: ["weekly", "monthly"] },
1416
- key: { type: "string", description: "Period key (weekly: YYYY-Www, monthly: YYYY-MM). Defaults to current." },
1389
+ key: {
1390
+ type: "string",
1391
+ description: "Period key (weekly: YYYY-Www, monthly: YYYY-MM). Defaults to current.",
1392
+ },
1417
1393
  },
1418
1394
  additionalProperties: false,
1419
1395
  },
@@ -1516,7 +1492,10 @@ export class EngramMcpServer {
1516
1492
  properties: {
1517
1493
  namespace: { type: "string" },
1518
1494
  identityTraits: { type: "string", description: "Updates for 'Identity Traits' section." },
1519
- communicationPreferences: { type: "string", description: "Updates for 'Communication Preferences' section." },
1495
+ communicationPreferences: {
1496
+ type: "string",
1497
+ description: "Updates for 'Communication Preferences' section.",
1498
+ },
1520
1499
  operatingPrinciples: { type: "string", description: "Updates for 'Operating Principles' section." },
1521
1500
  continuityNotes: { type: "string", description: "Updates for 'Continuity Notes' section." },
1522
1501
  },
@@ -1537,7 +1516,8 @@ export class EngramMcpServer {
1537
1516
  // ── Work Layer tools ─────────────────────────────────────────────────
1538
1517
  {
1539
1518
  name: "engram.work_task",
1540
- description: "Manage work-layer tasks (create, get, list, update, transition, delete). Excluded from memory extraction.",
1519
+ description:
1520
+ "Manage work-layer tasks (create, get, list, update, transition, delete). Excluded from memory extraction.",
1541
1521
  inputSchema: {
1542
1522
  type: "object",
1543
1523
  properties: {
@@ -1559,7 +1539,8 @@ export class EngramMcpServer {
1559
1539
  },
1560
1540
  {
1561
1541
  name: "engram.work_project",
1562
- description: "Manage work-layer projects (create, get, list, update, delete, link_task). Excluded from memory extraction.",
1542
+ description:
1543
+ "Manage work-layer projects (create, get, list, update, delete, link_task). Excluded from memory extraction.",
1563
1544
  inputSchema: {
1564
1545
  type: "object",
1565
1546
  properties: {
@@ -1668,7 +1649,8 @@ export class EngramMcpServer {
1668
1649
  },
1669
1650
  {
1670
1651
  name: "engram.compounding_weekly_synthesize",
1671
- description: "Generate weekly compounding outputs: reports, mistake registry, rubrics, and promotion candidates.",
1652
+ description:
1653
+ "Generate weekly compounding outputs: reports, mistake registry, rubrics, and promotion candidates.",
1672
1654
  inputSchema: {
1673
1655
  type: "object",
1674
1656
  properties: {
@@ -1719,14 +1701,19 @@ export class EngramMcpServer {
1719
1701
  // ── Memory search & debug tools ────────────────────────────────────
1720
1702
  {
1721
1703
  name: "engram.memory_search",
1722
- description: "Direct semantic search over memory files using the QMD index. Returns matching memories with relevance scores.",
1704
+ description:
1705
+ "Direct semantic search over memory files using the QMD index. Returns matching memories with relevance scores.",
1723
1706
  inputSchema: {
1724
1707
  type: "object",
1725
1708
  properties: {
1726
1709
  query: { type: "string" },
1727
1710
  namespace: { type: "string" },
1728
1711
  maxResults: { type: "number" },
1729
- collection: { type: "string", description: "QMD collection. With namespaces enabled, omitted, base, and 'global' searches stay scoped to readable namespaces; namespace-derived collections require matching namespace access." },
1712
+ collection: {
1713
+ type: "string",
1714
+ description:
1715
+ "QMD collection. With namespaces enabled, omitted, base, and 'global' searches stay scoped to readable namespaces; namespace-derived collections require matching namespace access.",
1716
+ },
1730
1717
  },
1731
1718
  required: ["query"],
1732
1719
  additionalProperties: false,
@@ -1734,7 +1721,8 @@ export class EngramMcpServer {
1734
1721
  },
1735
1722
  {
1736
1723
  name: "engram.memory_profile",
1737
- description: "Read the user's behavioral profile — a living document of their preferences, habits, and personality.",
1724
+ description:
1725
+ "Read the user's behavioral profile — a living document of their preferences, habits, and personality.",
1738
1726
  inputSchema: {
1739
1727
  type: "object",
1740
1728
  properties: { namespace: { type: "string" } },
@@ -1802,14 +1790,18 @@ export class EngramMcpServer {
1802
1790
  // surface so connectors / CLI clients can hit either endpoint
1803
1791
  // interchangeably.
1804
1792
  name: "engram.graph_snapshot",
1805
- 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).",
1793
+ description:
1794
+ "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).",
1806
1795
  inputSchema: {
1807
1796
  type: "object",
1808
1797
  properties: {
1809
1798
  namespace: { type: "string" },
1810
1799
  limit: { type: "number", description: "Maximum number of edges to return (default 500, max 5000)." },
1811
1800
  since: { type: "string", description: "Inclusive lower bound on edge timestamp (ISO-8601)." },
1812
- focusNodeId: { type: "string", description: "When set, restrict the snapshot to the focus node and its neighbors." },
1801
+ focusNodeId: {
1802
+ type: "string",
1803
+ description: "When set, restrict the snapshot to the focus node and its neighbors.",
1804
+ },
1813
1805
  categories: {
1814
1806
  type: "array",
1815
1807
  items: { type: "string" },
@@ -1853,7 +1845,8 @@ export class EngramMcpServer {
1853
1845
  // mw_fail) and will feed the recall-time filter added in PR 4.
1854
1846
  {
1855
1847
  name: "engram.memory_outcome",
1856
- 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.",
1848
+ description:
1849
+ "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.",
1857
1850
  inputSchema: {
1858
1851
  type: "object",
1859
1852
  properties: {
@@ -1869,8 +1862,7 @@ export class EngramMcpServer {
1869
1862
  },
1870
1863
  {
1871
1864
  name: "engram.memory_action_apply",
1872
- description:
1873
- "Record a memory-action application event for policy-learning telemetry.",
1865
+ description: "Record a memory-action application event for policy-learning telemetry.",
1874
1866
  inputSchema: {
1875
1867
  type: "object",
1876
1868
  properties: {
@@ -1923,21 +1915,33 @@ export class EngramMcpServer {
1923
1915
  // Uses the legacy "engram.*" prefix like every other tool in this array;
1924
1916
  // withToolAliases (applied via .flatMap below) generates the canonical
1925
1917
  // "remnic.briefing" alias automatically.
1926
- ...(service.briefingEnabled ? [{
1927
- name: "engram.briefing",
1928
- description: "Generate a daily context briefing by cross-referencing active entities, recent facts, open commitments, and optional calendar events.",
1929
- inputSchema: {
1930
- type: "object",
1931
- properties: {
1932
- since: { type: "string", description: "Lookback window (e.g. 'yesterday', '3d', '1w', '24h')." },
1933
- focus: { type: "string", description: "Optional focus filter (e.g. 'person:Jane Doe', 'project:remnic-core', 'topic:retrieval')." },
1934
- namespace: { type: "string" },
1935
- format: { type: "string", enum: ["markdown", "json"] },
1936
- maxFollowups: { type: "number", description: "Maximum LLM-suggested follow-ups (0 disables that section)." },
1937
- },
1938
- additionalProperties: false,
1939
- },
1940
- }] : []),
1918
+ ...(service.briefingEnabled
1919
+ ? [
1920
+ {
1921
+ name: "engram.briefing",
1922
+ description:
1923
+ "Generate a daily context briefing by cross-referencing active entities, recent facts, open commitments, and optional calendar events.",
1924
+ inputSchema: {
1925
+ type: "object",
1926
+ properties: {
1927
+ since: { type: "string", description: "Lookback window (e.g. 'yesterday', '3d', '1w', '24h')." },
1928
+ focus: {
1929
+ type: "string",
1930
+ description:
1931
+ "Optional focus filter (e.g. 'person:Jane Doe', 'project:remnic-core', 'topic:retrieval').",
1932
+ },
1933
+ namespace: { type: "string" },
1934
+ format: { type: "string", enum: ["markdown", "json"] },
1935
+ maxFollowups: {
1936
+ type: "number",
1937
+ description: "Maximum LLM-suggested follow-ups (0 disables that section).",
1938
+ },
1939
+ },
1940
+ additionalProperties: false,
1941
+ },
1942
+ },
1943
+ ]
1944
+ : []),
1941
1945
  // ── Contradiction Review (issue #520) ────────────────────────────────
1942
1946
  {
1943
1947
  name: "engram.review_list",
@@ -1945,7 +1949,11 @@ export class EngramMcpServer {
1945
1949
  inputSchema: {
1946
1950
  type: "object",
1947
1951
  properties: {
1948
- filter: { type: "string", enum: ["all", "unresolved", "contradicts", "independent", "duplicates", "needs-user"], description: "Filter by verdict type. Default: unresolved." },
1952
+ filter: {
1953
+ type: "string",
1954
+ enum: ["all", "unresolved", "contradicts", "independent", "duplicates", "needs-user"],
1955
+ description: "Filter by verdict type. Default: unresolved.",
1956
+ },
1949
1957
  namespace: { type: "string" },
1950
1958
  limit: { type: "number", description: "Max items to return (default 50)." },
1951
1959
  },
@@ -1959,7 +1967,11 @@ export class EngramMcpServer {
1959
1967
  type: "object",
1960
1968
  properties: {
1961
1969
  pairId: { type: "string", description: "The contradiction pair ID to resolve." },
1962
- verb: { type: "string", enum: ["keep-a", "keep-b", "merge", "both-valid", "needs-more-context"], description: "Resolution action." },
1970
+ verb: {
1971
+ type: "string",
1972
+ enum: ["keep-a", "keep-b", "merge", "both-valid", "needs-more-context"],
1973
+ description: "Resolution action.",
1974
+ },
1963
1975
  mergedMemoryId: { type: "string", description: "Existing merged memory ID to use when verb is merge." },
1964
1976
  mergedContent: { type: "string", description: "Content for a new merged memory when verb is merge." },
1965
1977
  },
@@ -2215,8 +2227,14 @@ export class EngramMcpServer {
2215
2227
  enum: ["list", "get", "record", "supersede"],
2216
2228
  description: "Which decision-record operation to run.",
2217
2229
  },
2218
- sessionKey: { type: "string", description: "Session identifier whose coding context scopes the operation." },
2219
- namespace: { type: "string", description: "Optional explicit namespace (overrides coding-context overlay)." },
2230
+ sessionKey: {
2231
+ type: "string",
2232
+ description: "Session identifier whose coding context scopes the operation.",
2233
+ },
2234
+ namespace: {
2235
+ type: "string",
2236
+ description: "Optional explicit namespace (overrides coding-context overlay).",
2237
+ },
2220
2238
  id: { type: "string", description: "Decision record id (required for get and supersede)." },
2221
2239
  title: { type: "string", description: "Decision title (required for record and supersede)." },
2222
2240
  status: {
@@ -2232,13 +2250,16 @@ export class EngramMcpServer {
2232
2250
  items: { type: "string" },
2233
2251
  description: "Entity references the decision relates to.",
2234
2252
  },
2235
- supersedesId: { type: "string", description: "Id of the record this decision supersedes (supersede only)." },
2253
+ supersedesId: {
2254
+ type: "string",
2255
+ description: "Id of the record this decision supersedes (supersede only).",
2256
+ },
2236
2257
  },
2237
2258
  required: ["subcommand"],
2238
2259
  additionalProperties: false,
2239
2260
  },
2240
2261
  },
2241
- this.emitLegacyTools,
2262
+ this.emitLegacyTools
2242
2263
  );
2243
2264
  this.tools = [...this.tools, ...codingDecisionTools];
2244
2265
  }
@@ -2256,14 +2277,20 @@ export class EngramMcpServer {
2256
2277
  enum: ["get", "refresh"],
2257
2278
  description: "Which architecture-card operation to run.",
2258
2279
  },
2259
- sessionKey: { type: "string", description: "Session identifier whose coding context scopes the operation." },
2260
- namespace: { type: "string", description: "Optional explicit namespace (overrides coding-context overlay)." },
2280
+ sessionKey: {
2281
+ type: "string",
2282
+ description: "Session identifier whose coding context scopes the operation.",
2283
+ },
2284
+ namespace: {
2285
+ type: "string",
2286
+ description: "Optional explicit namespace (overrides coding-context overlay).",
2287
+ },
2261
2288
  },
2262
2289
  required: ["subcommand"],
2263
2290
  additionalProperties: false,
2264
2291
  },
2265
2292
  },
2266
- this.emitLegacyTools,
2293
+ this.emitLegacyTools
2267
2294
  );
2268
2295
  this.tools = [...this.tools, ...architectureTools];
2269
2296
  }
@@ -2275,18 +2302,42 @@ export class EngramMcpServer {
2275
2302
  const codegraphToolDefs: Array<{ suffix: string; description: string; required?: string[] }> = [
2276
2303
  { suffix: "index", description: "Index a repository into the code graph.", required: ["repoRoot"] },
2277
2304
  { suffix: "list_projects", description: "List code graph projects for the principal." },
2278
- { suffix: "delete_project", description: "Delete a code graph project (requires confirm: true).", required: ["confirm"] },
2305
+ {
2306
+ suffix: "delete_project",
2307
+ description: "Delete a code graph project (requires confirm: true).",
2308
+ required: ["confirm"],
2309
+ },
2279
2310
  { suffix: "index_status", description: "Get the indexing status for a project." },
2280
2311
  { suffix: "search_graph", description: "Search the code graph for symbols.", required: ["query"] },
2281
- { suffix: "trace_path", description: "Trace call/dependency paths from a starting symbol.", required: ["start"] },
2312
+ {
2313
+ suffix: "trace_path",
2314
+ description: "Trace call/dependency paths from a starting symbol.",
2315
+ required: ["start"],
2316
+ },
2282
2317
  { suffix: "detect_changes", description: "Detect changed symbols since a git ref.", required: ["head"] },
2283
- { suffix: "query_graph", description: "Run a structured query against the code graph.", required: ["structuredQuery"] },
2318
+ {
2319
+ suffix: "query_graph",
2320
+ description: "Run a structured query against the code graph.",
2321
+ required: ["structuredQuery"],
2322
+ },
2284
2323
  { suffix: "get_schema", description: "Get the code graph schema statistics." },
2285
2324
  { suffix: "get_snippet", description: "Get a source code snippet for a symbol.", required: ["qualifiedName"] },
2286
2325
  { suffix: "get_architecture", description: "Get the composed architecture card + graph stats." },
2287
- { suffix: "search_code", description: "Search the code graph for code (functions, classes, methods).", required: ["query"] },
2288
- { suffix: "manage_adr", description: "Manage ADRs via Track A decision records (list, get, record, supersede).", required: ["subcommand"] },
2289
- { suffix: "ingest_traces", description: "Ingest call-site traces to upgrade edge confidence.", required: ["traces"] },
2326
+ {
2327
+ suffix: "search_code",
2328
+ description: "Search the code graph for code (functions, classes, methods).",
2329
+ required: ["query"],
2330
+ },
2331
+ {
2332
+ suffix: "manage_adr",
2333
+ description: "Manage ADRs via Track A decision records (list, get, record, supersede).",
2334
+ required: ["subcommand"],
2335
+ },
2336
+ {
2337
+ suffix: "ingest_traces",
2338
+ description: "Ingest call-site traces to upgrade edge confidence.",
2339
+ required: ["traces"],
2340
+ },
2290
2341
  ];
2291
2342
  for (const def of codegraphToolDefs) {
2292
2343
  const tools = withToolAliases(
@@ -2296,7 +2347,10 @@ export class EngramMcpServer {
2296
2347
  inputSchema: {
2297
2348
  type: "object",
2298
2349
  properties: {
2299
- sessionKey: { type: "string", description: "Session identifier whose coding context scopes the operation." },
2350
+ sessionKey: {
2351
+ type: "string",
2352
+ description: "Session identifier whose coding context scopes the operation.",
2353
+ },
2300
2354
  project: { type: "string", description: "Explicit project id (defaults to session coding context)." },
2301
2355
  principal: { type: "string", description: "Authenticated principal override." },
2302
2356
  query: { type: "string" },
@@ -2326,7 +2380,7 @@ export class EngramMcpServer {
2326
2380
  additionalProperties: false,
2327
2381
  },
2328
2382
  },
2329
- this.emitLegacyTools,
2383
+ this.emitLegacyTools
2330
2384
  );
2331
2385
  this.tools = [...this.tools, ...tools];
2332
2386
  }
@@ -2345,14 +2399,20 @@ export class EngramMcpServer {
2345
2399
  enum: ["get"],
2346
2400
  description: "Which delta operation to run.",
2347
2401
  },
2348
- sessionKey: { type: "string", description: "Session identifier whose coding context scopes the operation." },
2349
- namespace: { type: "string", description: "Optional explicit namespace (overrides coding-context overlay)." },
2402
+ sessionKey: {
2403
+ type: "string",
2404
+ description: "Session identifier whose coding context scopes the operation.",
2405
+ },
2406
+ namespace: {
2407
+ type: "string",
2408
+ description: "Optional explicit namespace (overrides coding-context overlay).",
2409
+ },
2350
2410
  },
2351
2411
  required: ["subcommand"],
2352
2412
  additionalProperties: false,
2353
2413
  },
2354
2414
  },
2355
- this.emitLegacyTools,
2415
+ this.emitLegacyTools
2356
2416
  );
2357
2417
  this.tools = [...this.tools, ...deltaTools];
2358
2418
  }
@@ -2371,7 +2431,7 @@ export class EngramMcpServer {
2371
2431
  properties: {
2372
2432
  text: {
2373
2433
  type: "string",
2374
- description: "The natural-language correction (e.g. \"we migrated to MySQL in March\").",
2434
+ description: 'The natural-language correction (e.g. "we migrated to MySQL in March").',
2375
2435
  },
2376
2436
  targetIds: {
2377
2437
  type: "array",
@@ -2385,7 +2445,7 @@ export class EngramMcpServer {
2385
2445
  additionalProperties: false,
2386
2446
  },
2387
2447
  },
2388
- this.emitLegacyTools,
2448
+ this.emitLegacyTools
2389
2449
  );
2390
2450
  const applyTool = withToolAliases(
2391
2451
  {
@@ -2404,7 +2464,7 @@ export class EngramMcpServer {
2404
2464
  additionalProperties: false,
2405
2465
  },
2406
2466
  },
2407
- this.emitLegacyTools,
2467
+ this.emitLegacyTools
2408
2468
  );
2409
2469
  this.tools = [...this.tools, ...planTool, ...applyTool];
2410
2470
  }
@@ -2417,14 +2477,21 @@ export class EngramMcpServer {
2417
2477
  inputSchema: {
2418
2478
  type: "object",
2419
2479
  properties: {
2420
- message: { type: "string", description: "The user's message — a question about memories, a correction request, or a confirmation (yes/apply) to proceed with a pending plan." },
2421
- chatSessionId: { type: "string", description: "Optional existing chat session id to resume. Omit to start a new session." },
2480
+ message: {
2481
+ type: "string",
2482
+ description:
2483
+ "The user's message — a question about memories, a correction request, or a confirmation (yes/apply) to proceed with a pending plan.",
2484
+ },
2485
+ chatSessionId: {
2486
+ type: "string",
2487
+ description: "Optional existing chat session id to resume. Omit to start a new session.",
2488
+ },
2422
2489
  },
2423
2490
  required: ["message"],
2424
2491
  additionalProperties: false,
2425
2492
  },
2426
2493
  },
2427
- this.emitLegacyTools,
2494
+ this.emitLegacyTools
2428
2495
  );
2429
2496
  this.tools = [...this.tools, ...chatTools];
2430
2497
  }
@@ -2437,8 +2504,14 @@ export class EngramMcpServer {
2437
2504
  this.tools = this.tools.map((tool) =>
2438
2505
  isReadOnlyToolName(tool.name) && tool.annotations?.readOnlyHint !== true
2439
2506
  ? { ...tool, annotations: { ...(tool.annotations ?? {}), readOnlyHint: true } }
2440
- : tool,
2507
+ : tool
2441
2508
  );
2509
+ // Apply `outputSchema` declarations from the registry. Like the
2510
+ // readOnlyHint pass above, this is a final suffix-based pass so every
2511
+ // tool (including both `remnic.*` and `engram.*` aliases) gets a
2512
+ // schema. Tools that already declare an outputSchema (e.g.
2513
+ // chatgpt_memory_inspector) are left untouched.
2514
+ this.tools = applyToolOutputSchemas(this.tools, CANONICAL_MCP_PREFIX, LEGACY_MCP_PREFIX);
2442
2515
  }
2443
2516
 
2444
2517
  /** Get clientInfo for a specific MCP session. Returns undefined for non-MCP requests. */
@@ -2478,9 +2551,7 @@ export class EngramMcpServer {
2478
2551
  id,
2479
2552
  error: {
2480
2553
  code: -32602,
2481
- message:
2482
- "initialize requires params.protocolVersion (string); " +
2483
- `supported versions: ${MCP_SUPPORTED_PROTOCOL_VERSIONS.join(", ")}`,
2554
+ message: `initialize requires params.protocolVersion (string); supported versions: ${MCP_SUPPORTED_PROTOCOL_VERSIONS.join(", ")}`,
2484
2555
  },
2485
2556
  };
2486
2557
  }
@@ -2625,7 +2696,14 @@ export class EngramMcpServer {
2625
2696
  ...(options?.namespaceOverride ? { namespace: options.namespaceOverride } : {}),
2626
2697
  ...(options?.sessionKeyOverride ? { sessionKey: options.sessionKeyOverride } : {}),
2627
2698
  };
2628
- const result = await this.callTool(name, argumentsObject, effectivePrincipal, options?.sessionId, mcpScope, options?.enforceWriteQuota);
2699
+ const result = await this.callTool(
2700
+ name,
2701
+ argumentsObject,
2702
+ effectivePrincipal,
2703
+ options?.sessionId,
2704
+ mcpScope,
2705
+ options?.enforceWriteQuota
2706
+ );
2629
2707
  return {
2630
2708
  jsonrpc: "2.0",
2631
2709
  id,
@@ -2707,7 +2785,7 @@ export class EngramMcpServer {
2707
2785
  this.buffer = Buffer.alloc(0);
2708
2786
  return;
2709
2787
  }
2710
- const contentLength = parseInt(contentLengthHeader.split(":")[1]?.trim() ?? "0", 10);
2788
+ const contentLength = Number.parseInt(contentLengthHeader.split(":")[1]?.trim() ?? "0", 10);
2711
2789
  if (!Number.isFinite(contentLength) || contentLength < 0) {
2712
2790
  this.buffer = Buffer.alloc(0);
2713
2791
  return;
@@ -2813,14 +2891,21 @@ export class EngramMcpServer {
2813
2891
  }));
2814
2892
  }
2815
2893
 
2816
- private async callTool(name: string, args: Record<string, unknown>, effectivePrincipal?: string, mcpSessionId?: string, scope?: { namespace?: string; sessionKey?: string }, enforceWriteQuota?: () => void | Promise<void>): Promise<unknown> {
2894
+ private async callTool(
2895
+ name: string,
2896
+ args: Record<string, unknown>,
2897
+ effectivePrincipal?: string,
2898
+ mcpSessionId?: string,
2899
+ scope?: { namespace?: string; sessionKey?: string },
2900
+ enforceWriteQuota?: () => void | Promise<void>
2901
+ ): Promise<unknown> {
2817
2902
  const migrated = MCP_MIGRATED_OPERATIONS[toLegacyToolName(name)];
2818
2903
  if (!migrated) {
2819
- throw new Error("unknown tool: " + name);
2904
+ throw new Error(`unknown tool: ${name}`);
2820
2905
  }
2821
2906
  const op = getOperation(migrated);
2822
2907
  if (!op) {
2823
- throw new EngramAccessInputError("access-boundary: operation not registered: " + migrated);
2908
+ throw new EngramAccessInputError(`access-boundary: operation not registered: ${migrated}`);
2824
2909
  }
2825
2910
  let envelope: Record<string, unknown>;
2826
2911
  if (migrated === "memory_store") {
@@ -2870,13 +2955,20 @@ export class EngramMcpServer {
2870
2955
  }
2871
2956
  // recall citation guidance (MCP-specific post-processing).
2872
2957
  if (migrated === "recall") {
2873
- const result = await op.run(envelope, { service: this.service, authenticatedPrincipal: effectivePrincipal }) as { result: unknown };
2958
+ const result = (await op.run(envelope, {
2959
+ service: this.service,
2960
+ authenticatedPrincipal: effectivePrincipal,
2961
+ })) as { result: unknown };
2874
2962
  const response = result.result as Record<string, unknown>;
2875
2963
  if (this.shouldEmitCitations(mcpSessionId)) {
2876
2964
  const citations = this.buildRecallCitations(response as unknown as EngramAccessRecallResponse);
2877
2965
  const guidance = buildCitationGuidance(citations);
2878
2966
  if (guidance.length > 0) {
2879
- return { ...response, context: ((response as Record<string, unknown>).context as string ?? "") + guidance, citations };
2967
+ return {
2968
+ ...response,
2969
+ context: (((response as Record<string, unknown>).context as string) ?? "") + guidance,
2970
+ citations,
2971
+ };
2880
2972
  }
2881
2973
  }
2882
2974
  return response;