@remnic/core 1.0.3 → 1.1.1

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 (323) hide show
  1. package/dist/abort-error.d.ts +32 -0
  2. package/dist/abort-error.js +11 -0
  3. package/dist/access-audit.d.ts +56 -0
  4. package/dist/access-audit.js +9 -0
  5. package/dist/access-audit.js.map +1 -0
  6. package/dist/access-cli.js +72 -54
  7. package/dist/access-cli.js.map +1 -1
  8. package/dist/access-http.d.ts +16 -8
  9. package/dist/access-http.js +25 -17
  10. package/dist/access-mcp.d.ts +16 -8
  11. package/dist/access-mcp.js +28 -6
  12. package/dist/access-schema.d.ts +130 -39
  13. package/dist/access-schema.js +5 -1
  14. package/dist/access-service-Br8ZydTK.d.ts +827 -0
  15. package/dist/access-service.d.ts +20 -660
  16. package/dist/access-service.js +22 -14
  17. package/dist/bootstrap.d.ts +6 -3
  18. package/dist/briefing.d.ts +1 -0
  19. package/dist/briefing.js +6 -5
  20. package/dist/buffer-surprise-report.d.ts +70 -0
  21. package/dist/buffer-surprise-report.js +7 -0
  22. package/dist/buffer-surprise-report.js.map +1 -0
  23. package/dist/buffer-surprise.d.ts +98 -0
  24. package/dist/buffer-surprise.js +11 -0
  25. package/dist/buffer-surprise.js.map +1 -0
  26. package/dist/buffer.d.ts +100 -2
  27. package/dist/buffer.js +1 -1
  28. package/dist/calibration.js +5 -5
  29. package/dist/causal-behavior.js +4 -4
  30. package/dist/causal-chain.js +2 -2
  31. package/dist/causal-consolidation.js +17 -16
  32. package/dist/causal-consolidation.js.map +1 -1
  33. package/dist/causal-retrieval.js +4 -4
  34. package/dist/causal-trajectory.js +1 -1
  35. package/dist/{chunk-QNJMBKFK.js → chunk-2LGMW3DJ.js} +3 -2
  36. package/dist/chunk-2LGMW3DJ.js.map +1 -0
  37. package/dist/{chunk-QDYXG4CS.js → chunk-3FPTCC3Z.js} +4 -3
  38. package/dist/chunk-3FPTCC3Z.js.map +1 -0
  39. package/dist/chunk-3GPTTA4J.js +57 -0
  40. package/dist/chunk-3GPTTA4J.js.map +1 -0
  41. package/dist/{chunk-QKAH5B6E.js → chunk-3GXCSUXR.js} +94 -6
  42. package/dist/chunk-3GXCSUXR.js.map +1 -0
  43. package/dist/{chunk-POBPGDWI.js → chunk-3OGMS3PE.js} +2 -2
  44. package/dist/chunk-54V4BZWP.js +139 -0
  45. package/dist/chunk-54V4BZWP.js.map +1 -0
  46. package/dist/chunk-5JRF2PZA.js +67 -0
  47. package/dist/chunk-5JRF2PZA.js.map +1 -0
  48. package/dist/chunk-64NJRYU2.js +332 -0
  49. package/dist/chunk-64NJRYU2.js.map +1 -0
  50. package/dist/chunk-6AUUAZEX.js +150 -0
  51. package/dist/chunk-6AUUAZEX.js.map +1 -0
  52. package/dist/{chunk-HITJFT7E.js → chunk-7I7FKFZH.js} +28 -21
  53. package/dist/chunk-7I7FKFZH.js.map +1 -0
  54. package/dist/chunk-AJU4PJGY.js +126 -0
  55. package/dist/chunk-AJU4PJGY.js.map +1 -0
  56. package/dist/chunk-ASAITVLA.js +64 -0
  57. package/dist/chunk-ASAITVLA.js.map +1 -0
  58. package/dist/{chunk-X4WESCKA.js → chunk-B5WXLVDY.js} +187 -6
  59. package/dist/chunk-B5WXLVDY.js.map +1 -0
  60. package/dist/{chunk-RCICHSHL.js → chunk-BGJGXLZ7.js} +111 -2
  61. package/dist/{chunk-RCICHSHL.js.map → chunk-BGJGXLZ7.js.map} +1 -1
  62. package/dist/{chunk-OJFGVJS6.js → chunk-BK2EFTE2.js} +319 -18
  63. package/dist/chunk-BK2EFTE2.js.map +1 -0
  64. package/dist/chunk-C4SQJZAF.js +486 -0
  65. package/dist/chunk-C4SQJZAF.js.map +1 -0
  66. package/dist/{chunk-GJQPH5G3.js → chunk-CUPFXL3J.js} +2 -2
  67. package/dist/chunk-DF3RVK3X.js +119 -0
  68. package/dist/chunk-DF3RVK3X.js.map +1 -0
  69. package/dist/{chunk-PMB3WGDL.js → chunk-DFTTJYSO.js} +167 -7
  70. package/dist/chunk-DFTTJYSO.js.map +1 -0
  71. package/dist/chunk-DGVM5SFL.js +69 -0
  72. package/dist/chunk-DGVM5SFL.js.map +1 -0
  73. package/dist/chunk-EIR5VLIH.js +90 -0
  74. package/dist/chunk-EIR5VLIH.js.map +1 -0
  75. package/dist/{chunk-PAORGQRI.js → chunk-EPQJM2GC.js} +37 -23
  76. package/dist/chunk-EPQJM2GC.js.map +1 -0
  77. package/dist/{chunk-POMSFKTB.js → chunk-F5VP6YCB.js} +368 -10
  78. package/dist/chunk-F5VP6YCB.js.map +1 -0
  79. package/dist/{chunk-6ZH4TU6I.js → chunk-FAAFWE4G.js} +2 -1
  80. package/dist/chunk-FAAFWE4G.js.map +1 -0
  81. package/dist/{chunk-74JR4N5J.js → chunk-FVA6TGI3.js} +2 -2
  82. package/dist/chunk-GDFS42HT.js +206 -0
  83. package/dist/chunk-GDFS42HT.js.map +1 -0
  84. package/dist/{chunk-BKQJBXXX.js → chunk-GGD5W7TB.js} +2 -2
  85. package/dist/chunk-GGD5W7TB.js.map +1 -0
  86. package/dist/{chunk-V7XCAHIB.js → chunk-GKFXUTJ2.js} +508 -26
  87. package/dist/chunk-GKFXUTJ2.js.map +1 -0
  88. package/dist/{chunk-NSB3WSYS.js → chunk-HK3FGIEW.js} +278 -3
  89. package/dist/chunk-HK3FGIEW.js.map +1 -0
  90. package/dist/{chunk-AAI7JARD.js → chunk-HMDCOMYU.js} +8 -11
  91. package/dist/chunk-HMDCOMYU.js.map +1 -0
  92. package/dist/chunk-IISBCCWR.js +52 -0
  93. package/dist/chunk-IISBCCWR.js.map +1 -0
  94. package/dist/{chunk-YFYL2SIJ.js → chunk-INXV5JBT.js} +290 -46
  95. package/dist/chunk-INXV5JBT.js.map +1 -0
  96. package/dist/chunk-JBMSGZEQ.js +441 -0
  97. package/dist/chunk-JBMSGZEQ.js.map +1 -0
  98. package/dist/{chunk-UPMD5XND.js → chunk-JL2PU6AI.js} +16 -5
  99. package/dist/chunk-JL2PU6AI.js.map +1 -0
  100. package/dist/{chunk-J4IYOZZ5.js → chunk-JXS5PDQ7.js} +3 -1
  101. package/dist/chunk-JXS5PDQ7.js.map +1 -0
  102. package/dist/{chunk-AYPYCLR7.js → chunk-KUB6JU6H.js} +4 -4
  103. package/dist/chunk-KVBLZUKV.js +173 -0
  104. package/dist/chunk-KVBLZUKV.js.map +1 -0
  105. package/dist/chunk-LBLXEFWK.js +51 -0
  106. package/dist/chunk-LBLXEFWK.js.map +1 -0
  107. package/dist/{chunk-U2IQTSBY.js → chunk-LTCGGW2D.js} +1 -1
  108. package/dist/chunk-LTCGGW2D.js.map +1 -0
  109. package/dist/{chunk-UEYA6UC7.js → chunk-NZLQTHS5.js} +25 -2
  110. package/dist/chunk-NZLQTHS5.js.map +1 -0
  111. package/dist/chunk-PVGDJXVK.js +21 -0
  112. package/dist/chunk-PVGDJXVK.js.map +1 -0
  113. package/dist/chunk-PVPWZSSI.js +37 -0
  114. package/dist/chunk-PVPWZSSI.js.map +1 -0
  115. package/dist/{chunk-4NRAJUDS.js → chunk-RBBWYEFJ.js} +1 -1
  116. package/dist/chunk-RFYAYKTD.js +146 -0
  117. package/dist/chunk-RFYAYKTD.js.map +1 -0
  118. package/dist/{chunk-JROGC36Y.js → chunk-RGLL5SPU.js} +2 -2
  119. package/dist/{chunk-2VFW5K5U.js → chunk-S3EEFKNY.js} +103 -65
  120. package/dist/chunk-S3EEFKNY.js.map +1 -0
  121. package/dist/chunk-SOBJ6NEY.js +18 -0
  122. package/dist/chunk-SOBJ6NEY.js.map +1 -0
  123. package/dist/{chunk-MYQWXITD.js → chunk-SPI27QT6.js} +2 -2
  124. package/dist/chunk-TVVEYCNW.js +65 -0
  125. package/dist/chunk-TVVEYCNW.js.map +1 -0
  126. package/dist/chunk-ULYOGL6R.js +322 -0
  127. package/dist/chunk-ULYOGL6R.js.map +1 -0
  128. package/dist/{chunk-S4LX5EBI.js → chunk-VBVG2M5G.js} +64 -10
  129. package/dist/chunk-VBVG2M5G.js.map +1 -0
  130. package/dist/{chunk-KWP7T3DP.js → chunk-VDX363PS.js} +2 -2
  131. package/dist/{chunk-XMGSSBFX.js → chunk-VYM3VWOF.js} +1560 -244
  132. package/dist/chunk-VYM3VWOF.js.map +1 -0
  133. package/dist/{chunk-MTLYEMJB.js → chunk-WCLICCGB.js} +18 -3
  134. package/dist/chunk-WCLICCGB.js.map +1 -0
  135. package/dist/{chunk-ECKDIK5F.js → chunk-WVVA7F5A.js} +2 -2
  136. package/dist/chunk-X6GF3FX2.js +26 -0
  137. package/dist/chunk-X6GF3FX2.js.map +1 -0
  138. package/dist/{chunk-3QFQGRHO.js → chunk-XMHBH5H6.js} +4 -4
  139. package/dist/{chunk-KEG4GNGI.js → chunk-XZ2TIKGC.js} +38 -8
  140. package/dist/chunk-XZ2TIKGC.js.map +1 -0
  141. package/dist/chunk-Y4FHOFJ2.js +140 -0
  142. package/dist/chunk-Y4FHOFJ2.js.map +1 -0
  143. package/dist/chunk-YNB73F22.js +137 -0
  144. package/dist/chunk-YNB73F22.js.map +1 -0
  145. package/dist/{chunk-7PA4OZEU.js → chunk-YNQKWQT4.js} +55 -30
  146. package/dist/chunk-YNQKWQT4.js.map +1 -0
  147. package/dist/chunk-ZAIM4TUE.js +488 -0
  148. package/dist/chunk-ZAIM4TUE.js.map +1 -0
  149. package/dist/{chunk-BTY5RRRF.js → chunk-ZEM3OK2K.js} +5 -5
  150. package/dist/chunk-ZZTOURJI.js +91 -0
  151. package/dist/chunk-ZZTOURJI.js.map +1 -0
  152. package/dist/{cli-DwIBnp2g.d.ts → cli-BkeRaYfk.d.ts} +2 -2
  153. package/dist/cli.d.ts +13 -5
  154. package/dist/cli.js +45 -33
  155. package/dist/config.js +1 -1
  156. package/dist/consolidation-operator.d.ts +41 -0
  157. package/dist/consolidation-operator.js +11 -0
  158. package/dist/consolidation-operator.js.map +1 -0
  159. package/dist/consolidation-provenance-check.d.ts +68 -0
  160. package/dist/consolidation-provenance-check.js +9 -0
  161. package/dist/consolidation-provenance-check.js.map +1 -0
  162. package/dist/consolidation-undo.d.ts +123 -0
  163. package/dist/consolidation-undo.js +426 -0
  164. package/dist/consolidation-undo.js.map +1 -0
  165. package/dist/contradiction-review-WIUBAR52.js +21 -0
  166. package/dist/contradiction-review-WIUBAR52.js.map +1 -0
  167. package/dist/contradiction-scan-E3GJTI4F.js +412 -0
  168. package/dist/contradiction-scan-E3GJTI4F.js.map +1 -0
  169. package/dist/cross-namespace-budget.d.ts +133 -0
  170. package/dist/cross-namespace-budget.js +9 -0
  171. package/dist/cross-namespace-budget.js.map +1 -0
  172. package/dist/direct-answer-wiring.d.ts +77 -0
  173. package/dist/direct-answer-wiring.js +10 -0
  174. package/dist/direct-answer-wiring.js.map +1 -0
  175. package/dist/direct-answer.d.ts +106 -0
  176. package/dist/direct-answer.js +10 -0
  177. package/dist/direct-answer.js.map +1 -0
  178. package/dist/{engine-X7X3AAG3.js → engine-F3GOXGE5.js} +7 -6
  179. package/dist/engine-F3GOXGE5.js.map +1 -0
  180. package/dist/entity-retrieval.d.ts +1 -0
  181. package/dist/entity-retrieval.js +6 -5
  182. package/dist/explicit-capture.d.ts +6 -3
  183. package/dist/explicit-capture.js +2 -2
  184. package/dist/extraction-judge-telemetry.d.ts +113 -0
  185. package/dist/extraction-judge-telemetry.js +14 -0
  186. package/dist/extraction-judge-telemetry.js.map +1 -0
  187. package/dist/extraction-judge-training.d.ts +85 -0
  188. package/dist/extraction-judge-training.js +16 -0
  189. package/dist/extraction-judge-training.js.map +1 -0
  190. package/dist/extraction-judge.d.ts +124 -2
  191. package/dist/extraction-judge.js +11 -1
  192. package/dist/extraction.js +7 -6
  193. package/dist/fallback-llm.d.ts +11 -2
  194. package/dist/fallback-llm.js +2 -2
  195. package/dist/graph-recall.d.ts +100 -0
  196. package/dist/graph-recall.js +8 -0
  197. package/dist/graph-recall.js.map +1 -0
  198. package/dist/graph-retrieval.d.ts +271 -0
  199. package/dist/graph-retrieval.js +21 -0
  200. package/dist/graph-retrieval.js.map +1 -0
  201. package/dist/harmonic-retrieval.js +2 -1
  202. package/dist/importance.js +1 -1
  203. package/dist/index.d.ts +589 -138
  204. package/dist/index.js +531 -403
  205. package/dist/index.js.map +1 -1
  206. package/dist/intent.js +1 -1
  207. package/dist/local-llm.d.ts +10 -3
  208. package/dist/local-llm.js +1 -1
  209. package/dist/memory-worth-bench.d.ts +51 -0
  210. package/dist/memory-worth-bench.js +131 -0
  211. package/dist/memory-worth-bench.js.map +1 -0
  212. package/dist/memory-worth-filter.d.ts +128 -0
  213. package/dist/memory-worth-filter.js +10 -0
  214. package/dist/memory-worth-filter.js.map +1 -0
  215. package/dist/memory-worth-outcomes.d.ts +118 -0
  216. package/dist/memory-worth-outcomes.js +9 -0
  217. package/dist/memory-worth-outcomes.js.map +1 -0
  218. package/dist/memory-worth.d.ts +102 -0
  219. package/dist/memory-worth.js +7 -0
  220. package/dist/memory-worth.js.map +1 -0
  221. package/dist/operator-toolkit.d.ts +40 -1
  222. package/dist/operator-toolkit.js +24 -14
  223. package/dist/{orchestrator-B9kwlCep.d.ts → orchestrator-CmJ-NTdJ.d.ts} +254 -10
  224. package/dist/orchestrator.d.ts +6 -3
  225. package/dist/orchestrator.js +59 -48
  226. package/dist/page-versioning.d.ts +12 -1
  227. package/dist/page-versioning.js +5 -3
  228. package/dist/{port-C1GZFv8h.d.ts → port-BADbLZU5.d.ts} +2 -2
  229. package/dist/qmd-recall-cache.d.ts +1 -1
  230. package/dist/qmd.d.ts +5 -3
  231. package/dist/qmd.js +2 -1
  232. package/dist/reasoning-trace-recall.d.ts +90 -0
  233. package/dist/reasoning-trace-recall.js +13 -0
  234. package/dist/reasoning-trace-recall.js.map +1 -0
  235. package/dist/reasoning-trace-types.d.ts +54 -0
  236. package/dist/reasoning-trace-types.js +17 -0
  237. package/dist/reasoning-trace-types.js.map +1 -0
  238. package/dist/recall-audit-anomaly.d.ts +112 -0
  239. package/dist/recall-audit-anomaly.js +11 -0
  240. package/dist/recall-audit-anomaly.js.map +1 -0
  241. package/dist/recall-audit.js +5 -44
  242. package/dist/recall-audit.js.map +1 -1
  243. package/dist/recall-explain-renderer.d.ts +49 -0
  244. package/dist/recall-explain-renderer.js +18 -0
  245. package/dist/recall-explain-renderer.js.map +1 -0
  246. package/dist/recall-state.d.ts +39 -1
  247. package/dist/recall-state.js +1 -1
  248. package/dist/recall-xray-cli.d.ts +40 -0
  249. package/dist/recall-xray-cli.js +11 -0
  250. package/dist/recall-xray-cli.js.map +1 -0
  251. package/dist/recall-xray-renderer.d.ts +44 -0
  252. package/dist/recall-xray-renderer.js +18 -0
  253. package/dist/recall-xray-renderer.js.map +1 -0
  254. package/dist/recall-xray.d.ts +179 -0
  255. package/dist/recall-xray.js +13 -0
  256. package/dist/recall-xray.js.map +1 -0
  257. package/dist/resolution-QBTDHTG7.js +100 -0
  258. package/dist/resolution-QBTDHTG7.js.map +1 -0
  259. package/dist/resolve-provider-secret.d.ts +24 -1
  260. package/dist/resolve-provider-secret.js +3 -1
  261. package/dist/resume-bundles.js +6 -6
  262. package/dist/retrieval-agents.d.ts +1 -1
  263. package/dist/retrieval-tiers.d.ts +17 -0
  264. package/dist/retrieval-tiers.js +9 -0
  265. package/dist/retrieval-tiers.js.map +1 -0
  266. package/dist/schemas.d.ts +301 -45
  267. package/dist/schemas.js +1 -1
  268. package/dist/{semantic-consolidation-DrvSYRdB.d.ts → semantic-consolidation-CxJU6MJk.d.ts} +62 -1
  269. package/dist/semantic-consolidation.d.ts +2 -1
  270. package/dist/semantic-consolidation.js +20 -6
  271. package/dist/semantic-rule-promotion.js +6 -5
  272. package/dist/semantic-rule-verifier.js +6 -5
  273. package/dist/storage.d.ts +82 -1
  274. package/dist/storage.js +5 -4
  275. package/dist/summarizer.js +4 -4
  276. package/dist/temporal-supersession.d.ts +1 -0
  277. package/dist/tier-migration.d.ts +2 -1
  278. package/dist/types-DJhqDJUV.d.ts +50 -0
  279. package/dist/types.d.ts +309 -3
  280. package/dist/types.js +1 -1
  281. package/dist/verified-recall.js +6 -5
  282. package/package.json +1 -1
  283. package/dist/chunk-2VFW5K5U.js.map +0 -1
  284. package/dist/chunk-6ZH4TU6I.js.map +0 -1
  285. package/dist/chunk-7PA4OZEU.js.map +0 -1
  286. package/dist/chunk-AAI7JARD.js.map +0 -1
  287. package/dist/chunk-BKQJBXXX.js.map +0 -1
  288. package/dist/chunk-HITJFT7E.js.map +0 -1
  289. package/dist/chunk-J4IYOZZ5.js.map +0 -1
  290. package/dist/chunk-KEG4GNGI.js.map +0 -1
  291. package/dist/chunk-LAYN4LDC.js +0 -267
  292. package/dist/chunk-LAYN4LDC.js.map +0 -1
  293. package/dist/chunk-MTLYEMJB.js.map +0 -1
  294. package/dist/chunk-NSB3WSYS.js.map +0 -1
  295. package/dist/chunk-OJFGVJS6.js.map +0 -1
  296. package/dist/chunk-PAORGQRI.js.map +0 -1
  297. package/dist/chunk-PMB3WGDL.js.map +0 -1
  298. package/dist/chunk-POMSFKTB.js.map +0 -1
  299. package/dist/chunk-QDYXG4CS.js.map +0 -1
  300. package/dist/chunk-QKAH5B6E.js.map +0 -1
  301. package/dist/chunk-QNJMBKFK.js.map +0 -1
  302. package/dist/chunk-S4LX5EBI.js.map +0 -1
  303. package/dist/chunk-U2IQTSBY.js.map +0 -1
  304. package/dist/chunk-UEYA6UC7.js.map +0 -1
  305. package/dist/chunk-UPMD5XND.js.map +0 -1
  306. package/dist/chunk-UVJFDP7P.js +0 -202
  307. package/dist/chunk-UVJFDP7P.js.map +0 -1
  308. package/dist/chunk-V7XCAHIB.js.map +0 -1
  309. package/dist/chunk-X4WESCKA.js.map +0 -1
  310. package/dist/chunk-XMGSSBFX.js.map +0 -1
  311. package/dist/chunk-YFYL2SIJ.js.map +0 -1
  312. /package/dist/{engine-X7X3AAG3.js.map → abort-error.js.map} +0 -0
  313. /package/dist/{chunk-POBPGDWI.js.map → chunk-3OGMS3PE.js.map} +0 -0
  314. /package/dist/{chunk-GJQPH5G3.js.map → chunk-CUPFXL3J.js.map} +0 -0
  315. /package/dist/{chunk-74JR4N5J.js.map → chunk-FVA6TGI3.js.map} +0 -0
  316. /package/dist/{chunk-AYPYCLR7.js.map → chunk-KUB6JU6H.js.map} +0 -0
  317. /package/dist/{chunk-4NRAJUDS.js.map → chunk-RBBWYEFJ.js.map} +0 -0
  318. /package/dist/{chunk-JROGC36Y.js.map → chunk-RGLL5SPU.js.map} +0 -0
  319. /package/dist/{chunk-MYQWXITD.js.map → chunk-SPI27QT6.js.map} +0 -0
  320. /package/dist/{chunk-KWP7T3DP.js.map → chunk-VDX363PS.js.map} +0 -0
  321. /package/dist/{chunk-ECKDIK5F.js.map → chunk-WVVA7F5A.js.map} +0 -0
  322. /package/dist/{chunk-3QFQGRHO.js.map → chunk-XMHBH5H6.js.map} +0 -0
  323. /package/dist/{chunk-BTY5RRRF.js.map → chunk-ZEM3OK2K.js.map} +0 -0
@@ -0,0 +1,827 @@
1
+ import { StorageManager } from './storage.js';
2
+ import { RecallXraySnapshot } from './recall-xray.js';
3
+ import { RecallExplainJsonPayload } from './recall-explain-renderer.js';
4
+ import { PluginConfig, DaySummaryResult, RecallPlanMode, MemoryFile, MemoryLifecycleEvent, EntityFile, MemoryStatus } from './types.js';
5
+ import { AnomalyDetectorResult } from './recall-audit-anomaly.js';
6
+ import { ExplicitCaptureInput } from './explicit-capture.js';
7
+ import { BudgetDecision } from './cross-namespace-budget.js';
8
+ import { r as readMemoryGovernanceRunArtifact } from './memory-projection-store-DeSXPh1j.js';
9
+ import { LastRecallSnapshot } from './recall-state.js';
10
+ import { O as Orchestrator, I as IntentDebugSnapshot, G as GraphRecallSnapshot, S as SemanticDedupLookup } from './orchestrator-CmJ-NTdJ.js';
11
+ import { TrustZoneStoreStatus, TrustZoneName, TrustZoneRecordKind, TrustZoneSourceClass, TrustZoneProvenanceScore, TrustZonePromotionResult, TrustZoneDemoSeedResult } from './trust-zones.js';
12
+ import { LocalLlmClient } from './local-llm.js';
13
+ import { FallbackLlmClient } from './fallback-llm.js';
14
+ import { MemoryOutcomeKind, RecordMemoryOutcomeResult } from './memory-worth-outcomes.js';
15
+
16
+ /**
17
+ * Procedural memory stats surface (issue #567 PR 5/5).
18
+ *
19
+ * Pure helper that tallies procedure memories by status and summarizes the
20
+ * current `procedural.*` config so operators (and the dashboard) can see,
21
+ * in one call, how procedural memory is behaving in a namespace.
22
+ *
23
+ * Consumed by:
24
+ * - CLI `remnic procedural stats`
25
+ * - HTTP `GET /engram/v1/procedural/stats`
26
+ * - MCP `remnic.procedural_stats` (+ `engram.procedural_stats` alias)
27
+ */
28
+
29
+ interface ProcedureStatusCounts {
30
+ total: number;
31
+ active: number;
32
+ pending_review: number;
33
+ rejected: number;
34
+ quarantined: number;
35
+ superseded: number;
36
+ archived: number;
37
+ /** Any status the enum doesn't yet cover. */
38
+ other: number;
39
+ }
40
+ interface ProcedureStatsConfigSnapshot {
41
+ enabled: boolean;
42
+ minOccurrences: number;
43
+ successFloor: number;
44
+ autoPromoteOccurrences: number;
45
+ autoPromoteEnabled: boolean;
46
+ lookbackDays: number;
47
+ recallMaxProcedures: number;
48
+ }
49
+ interface ProcedureStatsRecent {
50
+ /** ISO 8601 timestamp of the most recent procedure write, or null. */
51
+ lastWriteAt: string | null;
52
+ /** Count of procedure files with `created` (or `updated`) in the last 7 days. */
53
+ writesLast7Days: number;
54
+ /** Count of procedures whose `source` is the procedure miner. */
55
+ minerSourced: number;
56
+ }
57
+ interface ProcedureStatsReport {
58
+ schemaVersion: 1;
59
+ generatedAt: string;
60
+ counts: ProcedureStatusCounts;
61
+ recent: ProcedureStatsRecent;
62
+ config: ProcedureStatsConfigSnapshot;
63
+ }
64
+ /**
65
+ * Read all memories from storage and tally procedures by status + recency.
66
+ * `nowMs` is injectable so tests can pin the "last 7 days" window.
67
+ */
68
+ declare function computeProcedureStats(options: {
69
+ storage: StorageManager;
70
+ config: PluginConfig;
71
+ nowMs?: number;
72
+ }): Promise<ProcedureStatsReport>;
73
+ /**
74
+ * Render `ProcedureStatsReport` as a human-friendly plain-text block for CLI
75
+ * operators. Keep it deterministic — no colors, no ANSI. Used by `--format text`.
76
+ */
77
+ declare function formatProcedureStatsText(report: ProcedureStatsReport): string;
78
+
79
+ declare class EngramAccessInputError extends Error {
80
+ }
81
+ declare const ENGRAM_ACCESS_WRITE_SCHEMA_VERSION = 1;
82
+ interface EngramAccessHealthResponse {
83
+ ok: true;
84
+ memoryDir: string;
85
+ namespacesEnabled: boolean;
86
+ defaultNamespace: string;
87
+ searchBackend: string;
88
+ qmdEnabled: boolean;
89
+ nativeKnowledgeEnabled: boolean;
90
+ projectionAvailable: boolean;
91
+ }
92
+ interface EngramAccessRecallRequest {
93
+ query: string;
94
+ sessionKey?: string;
95
+ namespace?: string;
96
+ topK?: number;
97
+ mode?: RecallPlanMode | "auto";
98
+ includeDebug?: boolean;
99
+ /**
100
+ * Coding-agent context (issue #569). When a connector resolves a git
101
+ * context for the session's cwd, it passes it here and the access service
102
+ * attaches it to the orchestrator before recall so project- / branch-
103
+ * scoped namespace overlays apply.
104
+ *
105
+ * Keyed by `sessionKey`; ignored when `sessionKey` is absent.
106
+ */
107
+ codingContext?: {
108
+ projectId: string;
109
+ branch: string | null;
110
+ rootPath: string;
111
+ defaultBranch: string | null;
112
+ } | null;
113
+ }
114
+ /**
115
+ * Standalone request to attach / clear the coding context for a session
116
+ * without performing a recall. Used by the Claude Code / Codex connectors
117
+ * at session start, and by the `remnic.set_coding_context` MCP tool (PR 7).
118
+ */
119
+ interface EngramAccessSetCodingContextRequest {
120
+ sessionKey: string;
121
+ codingContext: {
122
+ projectId: string;
123
+ branch: string | null;
124
+ rootPath: string;
125
+ defaultBranch: string | null;
126
+ } | null;
127
+ }
128
+ interface EngramAccessRecallResponse {
129
+ query: string;
130
+ sessionKey?: string;
131
+ namespace: string;
132
+ context: string;
133
+ count: number;
134
+ memoryIds: string[];
135
+ results: EngramAccessMemorySummary[];
136
+ recordedAt?: string;
137
+ traceId?: string;
138
+ plannerMode?: RecallPlanMode;
139
+ fallbackUsed: boolean;
140
+ sourcesUsed: string[];
141
+ budgetsApplied?: LastRecallSnapshot["budgetsApplied"];
142
+ auditAnomalies?: AnomalyDetectorResult;
143
+ budgetWarning?: BudgetDecision;
144
+ latencyMs?: number;
145
+ debug?: {
146
+ snapshot?: LastRecallSnapshot;
147
+ intent?: IntentDebugSnapshot | null;
148
+ graph?: GraphRecallSnapshot | null;
149
+ };
150
+ }
151
+ interface EngramAccessRecallExplainRequest {
152
+ sessionKey?: string;
153
+ namespace?: string;
154
+ }
155
+ interface EngramAccessRecallExplainResponse {
156
+ found: boolean;
157
+ snapshot?: LastRecallSnapshot;
158
+ intent?: IntentDebugSnapshot | null;
159
+ graph?: GraphRecallSnapshot | null;
160
+ }
161
+ interface EngramAccessDaySummaryRequest {
162
+ memories?: string;
163
+ sessionKey?: string;
164
+ namespace?: string;
165
+ }
166
+ /** Inputs accepted by the `remnic_briefing` MCP tool. */
167
+ interface EngramAccessBriefingRequest {
168
+ since?: string;
169
+ focus?: string;
170
+ namespace?: string;
171
+ format?: "markdown" | "json";
172
+ maxFollowups?: number;
173
+ /** Caller principal for namespace access checks. Transport-bound — never from untrusted payloads. */
174
+ principal?: string;
175
+ }
176
+ /** Response for `remnic_briefing`. */
177
+ interface EngramAccessBriefingResponse {
178
+ format: "markdown" | "json";
179
+ window: {
180
+ from: string;
181
+ to: string;
182
+ };
183
+ namespace: string;
184
+ markdown: string;
185
+ json: Record<string, unknown>;
186
+ followupsUnavailableReason?: string;
187
+ }
188
+ interface EngramAccessMemoryRecord {
189
+ id: string;
190
+ path: string;
191
+ category: string;
192
+ status?: string;
193
+ created?: string;
194
+ updated?: string;
195
+ content: string;
196
+ frontmatter: MemoryFile["frontmatter"];
197
+ }
198
+ interface EngramAccessMemorySummary {
199
+ id: string;
200
+ path: string;
201
+ category: string;
202
+ status: string;
203
+ created?: string;
204
+ updated?: string;
205
+ tags: string[];
206
+ entityRef?: string;
207
+ preview: string;
208
+ }
209
+ interface EngramAccessMemoryBrowseRequest {
210
+ query?: string;
211
+ status?: string;
212
+ category?: string;
213
+ namespace?: string;
214
+ sort?: "updated_desc" | "updated_asc" | "created_desc" | "created_asc";
215
+ limit?: number;
216
+ offset?: number;
217
+ }
218
+ interface EngramAccessMemoryBrowseResponse {
219
+ namespace: string;
220
+ sort: "updated_desc" | "updated_asc" | "created_desc" | "created_asc";
221
+ total: number;
222
+ count: number;
223
+ limit: number;
224
+ offset: number;
225
+ memories: EngramAccessMemorySummary[];
226
+ }
227
+ interface EngramAccessMemoryResponse {
228
+ found: boolean;
229
+ namespace: string;
230
+ memory?: EngramAccessMemoryRecord;
231
+ }
232
+ interface EngramAccessTimelineResponse {
233
+ found: boolean;
234
+ namespace: string;
235
+ count: number;
236
+ timeline: MemoryLifecycleEvent[];
237
+ }
238
+ interface EngramAccessEntitySummary {
239
+ name: string;
240
+ type: string;
241
+ updated: string;
242
+ summary?: string;
243
+ aliases: string[];
244
+ }
245
+ interface EngramAccessEntityListResponse {
246
+ namespace: string;
247
+ total: number;
248
+ count: number;
249
+ limit: number;
250
+ offset: number;
251
+ entities: EngramAccessEntitySummary[];
252
+ }
253
+ interface EngramAccessEntityResponse {
254
+ found: boolean;
255
+ namespace: string;
256
+ entity?: EntityFile;
257
+ }
258
+ interface EngramAccessReviewQueueResponse {
259
+ found: boolean;
260
+ namespace?: string;
261
+ runId?: string;
262
+ summary?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["summary"];
263
+ metrics?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["metrics"];
264
+ qualityScore?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["qualityScore"];
265
+ reviewQueue?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["reviewQueue"];
266
+ appliedActions?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["appliedActions"];
267
+ transitionReport?: Awaited<ReturnType<typeof readMemoryGovernanceRunArtifact>>["transitionReport"];
268
+ report?: string;
269
+ }
270
+ interface EngramAccessMaintenanceResponse {
271
+ namespace: string;
272
+ health: EngramAccessHealthResponse;
273
+ latestGovernanceRun: EngramAccessReviewQueueResponse;
274
+ }
275
+ interface EngramAccessTrustZoneStatusResponse {
276
+ namespace: string;
277
+ status: TrustZoneStoreStatus;
278
+ }
279
+ interface EngramAccessTrustZoneRecordSummary {
280
+ recordId: string;
281
+ filePath: string;
282
+ zone: TrustZoneName;
283
+ recordedAt: string;
284
+ kind: TrustZoneRecordKind;
285
+ summary: string;
286
+ sourceClass: TrustZoneSourceClass;
287
+ sessionKey?: string;
288
+ sourceId?: string;
289
+ evidenceHashPresent: boolean;
290
+ anchored: boolean;
291
+ entityRefs: string[];
292
+ tags: string[];
293
+ metadata?: Record<string, string>;
294
+ trustScore?: TrustZoneProvenanceScore;
295
+ nextPromotionTarget?: TrustZoneName;
296
+ nextPromotionAllowed: boolean;
297
+ nextPromotionReasons: string[];
298
+ corroborationCount?: number;
299
+ corroborationSourceClasses?: TrustZoneSourceClass[];
300
+ }
301
+ interface EngramAccessTrustZoneBrowseRequest {
302
+ query?: string;
303
+ zone?: TrustZoneName;
304
+ kind?: TrustZoneRecordKind;
305
+ sourceClass?: TrustZoneSourceClass;
306
+ namespace?: string;
307
+ limit?: number;
308
+ offset?: number;
309
+ }
310
+ interface EngramAccessTrustZoneBrowseResponse {
311
+ namespace: string;
312
+ total: number;
313
+ count: number;
314
+ limit: number;
315
+ offset: number;
316
+ records: EngramAccessTrustZoneRecordSummary[];
317
+ }
318
+ interface EngramAccessTrustZonePromoteRequest {
319
+ recordId: string;
320
+ targetZone: TrustZoneName;
321
+ promotionReason: string;
322
+ recordedAt?: string;
323
+ summary?: string;
324
+ dryRun?: boolean;
325
+ namespace?: string;
326
+ authenticatedPrincipal?: string;
327
+ }
328
+ interface EngramAccessTrustZonePromoteResponse extends TrustZonePromotionResult {
329
+ namespace: string;
330
+ dryRun: boolean;
331
+ }
332
+ interface EngramAccessTrustZoneDemoSeedRequest {
333
+ scenario?: string;
334
+ recordedAt?: string;
335
+ dryRun?: boolean;
336
+ namespace?: string;
337
+ authenticatedPrincipal?: string;
338
+ }
339
+ interface EngramAccessTrustZoneDemoSeedResponse extends TrustZoneDemoSeedResult {
340
+ namespace: string;
341
+ }
342
+ interface EngramAccessQualityResponse {
343
+ namespace: string;
344
+ totalMemories: number;
345
+ statusCounts: Record<string, number>;
346
+ categoryCounts: Record<string, number>;
347
+ confidenceTierCounts: Record<string, number>;
348
+ ageBucketCounts: Record<string, number>;
349
+ archivePressure: {
350
+ pendingReview: number;
351
+ quarantined: number;
352
+ archived: number;
353
+ staleActive: number;
354
+ lowConfidenceActive: number;
355
+ };
356
+ latestGovernanceRun: {
357
+ found: boolean;
358
+ runId?: string;
359
+ qualityScore?: EngramAccessReviewQueueResponse["qualityScore"];
360
+ reviewQueueCount: number;
361
+ };
362
+ }
363
+ interface EngramAccessReviewDispositionRequest {
364
+ memoryId: string;
365
+ status: MemoryStatus | "archived";
366
+ reasonCode: string;
367
+ namespace?: string;
368
+ /**
369
+ * Trusted transport-bound principal. This must never come from untrusted client payloads.
370
+ * When present, write authorization is evaluated against this principal instead of sessionKey.
371
+ */
372
+ authenticatedPrincipal?: string;
373
+ }
374
+ interface EngramAccessReviewDispositionResponse {
375
+ ok: boolean;
376
+ namespace: string;
377
+ memoryId: string;
378
+ status: MemoryStatus | "archived";
379
+ previousStatus: MemoryStatus;
380
+ currentPath?: string;
381
+ }
382
+ interface EngramAccessWriteEnvelope {
383
+ schemaVersion?: number;
384
+ idempotencyKey?: string;
385
+ dryRun?: boolean;
386
+ sessionKey?: string;
387
+ /**
388
+ * Trusted transport-bound principal. This must never come from untrusted client payloads.
389
+ * When present, write authorization is evaluated against this principal instead of sessionKey.
390
+ */
391
+ authenticatedPrincipal?: string;
392
+ }
393
+ interface EngramAccessMemoryStoreRequest extends EngramAccessWriteEnvelope, ExplicitCaptureInput {
394
+ }
395
+ interface EngramAccessSuggestionSubmitRequest extends EngramAccessWriteEnvelope, ExplicitCaptureInput {
396
+ }
397
+ interface EngramAccessWriteResponse {
398
+ schemaVersion: 1;
399
+ operation: "memory_store" | "suggestion_submit";
400
+ namespace: string;
401
+ dryRun: boolean;
402
+ accepted: boolean;
403
+ queued: boolean;
404
+ status: "validated" | "stored" | "duplicate" | "queued_for_review";
405
+ memoryId?: string;
406
+ duplicateOf?: string;
407
+ idempotencyKey?: string;
408
+ idempotencyReplay?: boolean;
409
+ }
410
+ interface EngramAccessObserveRequest {
411
+ sessionKey: string;
412
+ messages: Array<{
413
+ role: "user" | "assistant";
414
+ content: string;
415
+ }>;
416
+ namespace?: string;
417
+ authenticatedPrincipal?: string;
418
+ skipExtraction?: boolean;
419
+ }
420
+ interface EngramAccessObserveResponse {
421
+ accepted: number;
422
+ sessionKey: string;
423
+ namespace: string;
424
+ lcmArchived: boolean;
425
+ extractionQueued: boolean;
426
+ }
427
+ interface EngramAccessLcmSearchRequest {
428
+ query: string;
429
+ sessionKey?: string;
430
+ namespace?: string;
431
+ limit?: number;
432
+ authenticatedPrincipal?: string;
433
+ }
434
+ interface EngramAccessLcmSearchResponse {
435
+ query: string;
436
+ namespace: string;
437
+ results: Array<{
438
+ sessionId: string;
439
+ content: string;
440
+ turnIndex?: number;
441
+ }>;
442
+ count: number;
443
+ lcmEnabled: boolean;
444
+ }
445
+ interface EngramAccessLcmStatusResponse {
446
+ enabled: boolean;
447
+ archiveAvailable: boolean;
448
+ stats?: {
449
+ totalTurns?: number;
450
+ };
451
+ }
452
+ type EngramAccessIdempotencyStatus = "miss" | "replay" | "conflict";
453
+ declare class EngramAccessService {
454
+ private readonly orchestrator;
455
+ private readonly idempotency;
456
+ private readonly idempotencyLocks;
457
+ private readonly budget;
458
+ private readonly auditAdapter;
459
+ constructor(orchestrator: Orchestrator);
460
+ get briefingEnabled(): boolean;
461
+ private resolveNamespace;
462
+ private normalizeRecallMode;
463
+ private resolveRecallNamespace;
464
+ private resolveWritePrincipal;
465
+ private resolveWritableNamespace;
466
+ private resolveReadableNamespace;
467
+ private buildRecallDebug;
468
+ private serializeRecallResults;
469
+ private handleIdempotentWrite;
470
+ private peekIdempotentWrite;
471
+ private withIdempotencyLock;
472
+ health(namespace?: string): Promise<EngramAccessHealthResponse>;
473
+ daySummary(request: EngramAccessDaySummaryRequest): Promise<DaySummaryResult | null>;
474
+ /**
475
+ * Build a daily context briefing. Gracefully degrades when the OpenAI key
476
+ * or Responses API is unavailable — never throws for LLM-related problems.
477
+ */
478
+ briefing(request: EngramAccessBriefingRequest): Promise<EngramAccessBriefingResponse>;
479
+ /**
480
+ * Attach a coding context to a session (issue #569). Used by the Claude
481
+ * Code / Codex / generic-MCP connectors at session start so that recall +
482
+ * write paths can route to a project- / branch-scoped namespace.
483
+ *
484
+ * Validates the input shape and rejects malformed payloads rather than
485
+ * silently accepting them (CLAUDE.md #51). Pass `codingContext: null` to
486
+ * clear.
487
+ */
488
+ setCodingContext(request: EngramAccessSetCodingContextRequest): void;
489
+ recall(request: EngramAccessRecallRequest): Promise<EngramAccessRecallResponse>;
490
+ recallExplain(request?: EngramAccessRecallExplainRequest): Promise<EngramAccessRecallExplainResponse>;
491
+ recallTierExplain(sessionKey?: string, namespace?: string, authenticatedPrincipal?: string): Promise<RecallExplainJsonPayload>;
492
+ /**
493
+ * Recall X-ray (issue #570). Runs a recall with `xrayCapture: true`
494
+ * and returns the resulting snapshot as structured JSON so every
495
+ * surface (CLI / HTTP / MCP) gets the same payload. Namespace scope
496
+ * is enforced before the recall fires (CLAUDE.md rule 42 — read and
497
+ * write paths must resolve through the same namespace layer) so an
498
+ * unauthorized principal cannot capture an x-ray for a namespace it
499
+ * cannot read.
500
+ */
501
+ recallXray(request: {
502
+ query: string;
503
+ sessionKey?: string;
504
+ namespace?: string;
505
+ budget?: number;
506
+ authenticatedPrincipal?: string;
507
+ }): Promise<{
508
+ snapshotFound: boolean;
509
+ snapshot?: RecallXraySnapshot;
510
+ }>;
511
+ private xrayQueue;
512
+ memoryStore(request: EngramAccessMemoryStoreRequest): Promise<EngramAccessWriteResponse>;
513
+ peekMemoryStoreIdempotency(request: EngramAccessMemoryStoreRequest): Promise<EngramAccessIdempotencyStatus>;
514
+ suggestionSubmit(request: EngramAccessSuggestionSubmitRequest): Promise<EngramAccessWriteResponse>;
515
+ peekSuggestionSubmitIdempotency(request: EngramAccessSuggestionSubmitRequest): Promise<EngramAccessIdempotencyStatus>;
516
+ private validateWriteCandidate;
517
+ memoryGet(memoryId: string, namespace?: string, principal?: string): Promise<EngramAccessMemoryResponse>;
518
+ memoryBrowse(request?: EngramAccessMemoryBrowseRequest): Promise<EngramAccessMemoryBrowseResponse>;
519
+ memoryTimeline(memoryId: string, namespace?: string, limit?: number, principal?: string): Promise<EngramAccessTimelineResponse>;
520
+ entityList(options?: {
521
+ namespace?: string;
522
+ query?: string;
523
+ limit?: number;
524
+ offset?: number;
525
+ }): Promise<EngramAccessEntityListResponse>;
526
+ entityGet(name: string, namespace?: string): Promise<EngramAccessEntityResponse>;
527
+ reviewQueue(runId?: string, namespace?: string, principal?: string): Promise<EngramAccessReviewQueueResponse>;
528
+ maintenance(namespace?: string, principal?: string): Promise<EngramAccessMaintenanceResponse>;
529
+ quality(namespace?: string, principal?: string): Promise<EngramAccessQualityResponse>;
530
+ governanceRun(request: {
531
+ namespace?: string;
532
+ mode?: "shadow" | "apply";
533
+ recentDays?: number;
534
+ maxMemories?: number;
535
+ batchSize?: number;
536
+ authenticatedPrincipal?: string;
537
+ }, principal?: string): Promise<{
538
+ namespace: string;
539
+ runId: string;
540
+ traceId: string;
541
+ mode: "shadow" | "apply";
542
+ reviewQueueCount: number;
543
+ proposedActionCount: number;
544
+ appliedActionCount: number;
545
+ summaryPath: string;
546
+ reportPath: string;
547
+ }>;
548
+ procedureMiningRun(request: {
549
+ namespace?: string;
550
+ authenticatedPrincipal?: string;
551
+ }, principal?: string): Promise<{
552
+ namespace: string;
553
+ clustersProcessed: number;
554
+ proceduresWritten: number;
555
+ skippedReason?: string;
556
+ }>;
557
+ /**
558
+ * Procedural memory stats (issue #567 PR 5/5). Read-only — resolves the
559
+ * namespace via the same path used by `recallExplain` / `trustZoneStatus`
560
+ * so cross-tenant reads are impossible (CLAUDE.md rule 42).
561
+ */
562
+ procedureStats(request?: {
563
+ namespace?: string;
564
+ }, principal?: string): Promise<ProcedureStatsReport & {
565
+ namespace: string;
566
+ }>;
567
+ trustZoneStatus(namespace?: string, principal?: string): Promise<EngramAccessTrustZoneStatusResponse>;
568
+ trustZoneBrowse(request: EngramAccessTrustZoneBrowseRequest, principal?: string): Promise<EngramAccessTrustZoneBrowseResponse>;
569
+ trustZonePromote(request: EngramAccessTrustZonePromoteRequest): Promise<EngramAccessTrustZonePromoteResponse>;
570
+ trustZoneDemoSeed(request: EngramAccessTrustZoneDemoSeedRequest): Promise<EngramAccessTrustZoneDemoSeedResponse>;
571
+ reviewDisposition(request: EngramAccessReviewDispositionRequest): Promise<EngramAccessReviewDispositionResponse>;
572
+ private serializeMemory;
573
+ private serializeMemorySummary;
574
+ observe(request: EngramAccessObserveRequest): Promise<EngramAccessObserveResponse>;
575
+ lcmSearch(request: EngramAccessLcmSearchRequest): Promise<EngramAccessLcmSearchResponse>;
576
+ continuityAuditGenerate(request: {
577
+ period?: "weekly" | "monthly";
578
+ key?: string;
579
+ }): Promise<{
580
+ enabled: boolean;
581
+ reason?: string;
582
+ period?: string;
583
+ key?: string;
584
+ reportPath?: string;
585
+ }>;
586
+ continuityIncidentOpen(request: {
587
+ symptom: string;
588
+ namespace?: string;
589
+ principal?: string;
590
+ triggerWindow?: string;
591
+ suspectedCause?: string;
592
+ }): Promise<unknown>;
593
+ continuityIncidentClose(request: {
594
+ id: string;
595
+ namespace?: string;
596
+ principal?: string;
597
+ fixApplied: string;
598
+ verificationResult: string;
599
+ preventiveRule?: string;
600
+ }): Promise<unknown>;
601
+ continuityIncidentList(request: {
602
+ state?: "open" | "closed" | "all";
603
+ namespace?: string;
604
+ principal?: string;
605
+ limit?: number;
606
+ }): Promise<unknown>;
607
+ continuityLoopAddOrUpdate(request: {
608
+ id: string;
609
+ cadence: "daily" | "weekly" | "monthly" | "quarterly";
610
+ purpose: string;
611
+ status: "active" | "paused" | "retired";
612
+ killCondition: string;
613
+ namespace?: string;
614
+ principal?: string;
615
+ lastReviewed?: string;
616
+ notes?: string;
617
+ }): Promise<unknown>;
618
+ continuityLoopReview(request: {
619
+ id: string;
620
+ namespace?: string;
621
+ principal?: string;
622
+ status?: "active" | "paused" | "retired";
623
+ notes?: string;
624
+ reviewedAt?: string;
625
+ }): Promise<unknown>;
626
+ identityAnchorGet(request: {
627
+ namespace?: string;
628
+ principal?: string;
629
+ }): Promise<unknown>;
630
+ identityAnchorUpdate(request: {
631
+ namespace?: string;
632
+ principal?: string;
633
+ identityTraits?: string;
634
+ communicationPreferences?: string;
635
+ operatingPrinciples?: string;
636
+ continuityNotes?: string;
637
+ }): Promise<unknown>;
638
+ memoryIdentity(request: {
639
+ namespace?: string;
640
+ principal?: string;
641
+ }): Promise<unknown>;
642
+ workTask(request: {
643
+ action: "create" | "get" | "list" | "update" | "transition" | "delete";
644
+ id?: string;
645
+ title?: string;
646
+ description?: string;
647
+ status?: string;
648
+ priority?: string;
649
+ owner?: string;
650
+ assignee?: string;
651
+ projectId?: string;
652
+ tags?: string[];
653
+ dueAt?: string;
654
+ }): Promise<unknown>;
655
+ workProject(request: {
656
+ action: "create" | "get" | "list" | "update" | "delete" | "link_task";
657
+ id?: string;
658
+ name?: string;
659
+ description?: string;
660
+ status?: string;
661
+ owner?: string;
662
+ tags?: string[];
663
+ taskId?: string;
664
+ projectId?: string;
665
+ }): Promise<unknown>;
666
+ workBoard(request: {
667
+ action: "export_markdown" | "export_snapshot" | "import_snapshot";
668
+ projectId?: string;
669
+ snapshotJson?: string;
670
+ linkToMemory?: boolean;
671
+ }): Promise<unknown>;
672
+ sharedContextWriteOutput(request: {
673
+ agentId: string;
674
+ title: string;
675
+ content: string;
676
+ }): Promise<unknown>;
677
+ sharedFeedbackRecord(request: {
678
+ agent: string;
679
+ decision: "approved" | "approved_with_feedback" | "rejected";
680
+ reason: string;
681
+ date?: string;
682
+ learning?: string;
683
+ outcome?: string;
684
+ severity?: "low" | "medium" | "high";
685
+ confidence?: number;
686
+ workflow?: string;
687
+ tags?: string[];
688
+ evidenceWindowStart?: string;
689
+ evidenceWindowEnd?: string;
690
+ refs?: string[];
691
+ }): Promise<unknown>;
692
+ sharedPrioritiesAppend(request: {
693
+ agentId: string;
694
+ text: string;
695
+ }): Promise<unknown>;
696
+ sharedContextCrossSignalsRun(request: {
697
+ date?: string;
698
+ }): Promise<unknown>;
699
+ sharedContextCurateDaily(request: {
700
+ date?: string;
701
+ }): Promise<unknown>;
702
+ compoundingWeeklySynthesize(request: {
703
+ weekId?: string;
704
+ }): Promise<unknown>;
705
+ compoundingPromoteCandidate(request: {
706
+ weekId: string;
707
+ candidateId: string;
708
+ dryRun?: boolean;
709
+ }): Promise<unknown>;
710
+ compressionGuidelinesOptimize(request: {
711
+ dryRun?: boolean;
712
+ eventLimit?: number;
713
+ }): Promise<unknown>;
714
+ compressionGuidelinesActivate(request: {
715
+ expectedContentHash?: string;
716
+ expectedGuidelineVersion?: number;
717
+ }): Promise<unknown>;
718
+ /** Conservative identity anchor section merge (matches tools.ts mergeIdentityAnchor logic). */
719
+ private mergeIdentityAnchorSections;
720
+ memorySearch(request: {
721
+ query: string;
722
+ namespace?: string;
723
+ maxResults?: number;
724
+ collection?: string;
725
+ principal?: string;
726
+ }): Promise<{
727
+ query: string;
728
+ results: Array<{
729
+ path: string;
730
+ score: number;
731
+ snippet: string;
732
+ }>;
733
+ count: number;
734
+ }>;
735
+ memoryProfile(namespace?: string, principal?: string): Promise<Record<string, unknown>>;
736
+ memoryEntitiesList(namespace?: string, principal?: string): Promise<{
737
+ entities: string[];
738
+ count: number;
739
+ }>;
740
+ memoryQuestions(namespace?: string, principal?: string): Promise<{
741
+ questions: Array<{
742
+ id: string;
743
+ question: string;
744
+ resolved: boolean;
745
+ }>;
746
+ count: number;
747
+ }>;
748
+ lastRecallSnapshot(sessionKey?: string): Promise<unknown>;
749
+ intentDebug(namespace?: string): Promise<unknown>;
750
+ qmdDebug(namespace?: string): Promise<unknown>;
751
+ graphExplainLastRecall(namespace?: string): Promise<unknown>;
752
+ memoryFeedback(request: {
753
+ memoryId: string;
754
+ vote: "up" | "down";
755
+ note?: string;
756
+ }): Promise<{
757
+ recorded: boolean;
758
+ enabled?: boolean;
759
+ reason?: string;
760
+ }>;
761
+ /**
762
+ * Record a Memory Worth outcome observation (issue #560 PR 3).
763
+ *
764
+ * This is distinct from `memoryFeedback` — feedback is a human thumbs
765
+ * up/down on whether a recalled memory was relevant; outcome is an
766
+ * automated signal about whether the session that consumed the memory
767
+ * ultimately succeeded or failed. Outcomes feed the Laplace-smoothed
768
+ * worth score (`computeMemoryWorth`, PR 2) that PR 4 will use to
769
+ * downweight memories correlated with bad sessions.
770
+ *
771
+ * The underlying writer only touches fact-category memories. Corrections,
772
+ * procedures, and other kinds return `{ ok: false, reason:
773
+ * "ineligible_category" }` so a ledger drainer doesn't need to pre-filter.
774
+ */
775
+ memoryOutcome(request: {
776
+ memoryId: string;
777
+ outcome: MemoryOutcomeKind;
778
+ namespace?: string;
779
+ principal?: string;
780
+ sessionKey?: string;
781
+ timestamp?: string;
782
+ }): Promise<RecordMemoryOutcomeResult>;
783
+ memoryPromote(request: {
784
+ memoryId: string;
785
+ namespace?: string;
786
+ principal?: string;
787
+ sessionKey?: string;
788
+ }): Promise<unknown>;
789
+ contextCheckpoint(request: {
790
+ sessionKey: string;
791
+ context: string;
792
+ namespace?: string;
793
+ principal?: string;
794
+ }): Promise<{
795
+ saved: boolean;
796
+ }>;
797
+ lcmStatus(): Promise<EngramAccessLcmStatusResponse>;
798
+ /**
799
+ * Record citation usage from an observed oai-mem-citation block.
800
+ * For each citation entry, extract the memory ID from the path and
801
+ * increment its access tracking via the orchestrator. Returns the
802
+ * count of submitted IDs and the count of IDs that matched real memories.
803
+ */
804
+ recordCitationUsage(request: {
805
+ sessionId?: string;
806
+ namespace?: string;
807
+ authenticatedPrincipal?: string;
808
+ entries: Array<{
809
+ path: string;
810
+ lineStart: number;
811
+ lineEnd: number;
812
+ note: string;
813
+ }>;
814
+ rolloutIds: string[];
815
+ }): Promise<{
816
+ submitted: number;
817
+ matched: number;
818
+ }>;
819
+ get memoryDir(): string;
820
+ get storageRef(): StorageManager;
821
+ get configRef(): PluginConfig;
822
+ get localLlmRef(): LocalLlmClient | null;
823
+ get fallbackLlmRef(): FallbackLlmClient | null;
824
+ get embeddingLookupFactoryRef(): (storage: StorageManager) => SemanticDedupLookup | undefined;
825
+ }
826
+
827
+ export { type EngramAccessQualityResponse as A, type EngramAccessRecallExplainRequest as B, type EngramAccessRecallExplainResponse as C, type EngramAccessRecallRequest as D, EngramAccessService as E, type EngramAccessRecallResponse as F, type EngramAccessReviewDispositionRequest as G, type EngramAccessReviewDispositionResponse as H, type EngramAccessReviewQueueResponse as I, type EngramAccessSetCodingContextRequest as J, type EngramAccessSuggestionSubmitRequest as K, type EngramAccessTimelineResponse as L, type EngramAccessTrustZoneBrowseRequest as M, type EngramAccessTrustZoneBrowseResponse as N, type EngramAccessTrustZoneDemoSeedRequest as O, type ProcedureStatsConfigSnapshot as P, type EngramAccessTrustZoneDemoSeedResponse as Q, type EngramAccessTrustZonePromoteRequest as R, type EngramAccessTrustZonePromoteResponse as S, type EngramAccessTrustZoneRecordSummary as T, type EngramAccessTrustZoneStatusResponse as U, type EngramAccessWriteEnvelope as V, type EngramAccessWriteResponse as W, EngramAccessInputError as a, type ProcedureStatsRecent as b, type ProcedureStatsReport as c, type ProcedureStatusCounts as d, computeProcedureStats as e, formatProcedureStatsText as f, ENGRAM_ACCESS_WRITE_SCHEMA_VERSION as g, type EngramAccessBriefingRequest as h, type EngramAccessBriefingResponse as i, type EngramAccessDaySummaryRequest as j, type EngramAccessEntityListResponse as k, type EngramAccessEntityResponse as l, type EngramAccessEntitySummary as m, type EngramAccessHealthResponse as n, type EngramAccessLcmSearchRequest as o, type EngramAccessLcmSearchResponse as p, type EngramAccessLcmStatusResponse as q, type EngramAccessMaintenanceResponse as r, type EngramAccessMemoryBrowseRequest as s, type EngramAccessMemoryBrowseResponse as t, type EngramAccessMemoryRecord as u, type EngramAccessMemoryResponse as v, type EngramAccessMemoryStoreRequest as w, type EngramAccessMemorySummary as x, type EngramAccessObserveRequest as y, type EngramAccessObserveResponse as z };