@remnic/core 1.1.12 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1324) hide show
  1. package/dist/access-cli.d.ts +2 -1
  2. package/dist/access-cli.js +263 -82
  3. package/dist/access-cli.js.map +1 -1
  4. package/dist/access-http.d.ts +26 -60
  5. package/dist/access-http.js +43 -29
  6. package/dist/access-mcp.d.ts +24 -6
  7. package/dist/access-mcp.js +35 -28
  8. package/dist/access-schema.d.ts +9 -6
  9. package/dist/access-schema.js +7 -5
  10. package/dist/access-service-DcCDmNYC.d.ts +1542 -0
  11. package/dist/access-service.d.ts +25 -7
  12. package/dist/access-service.js +33 -26
  13. package/dist/active-memory-bridge.js +2 -2
  14. package/dist/active-recall.js +11 -3
  15. package/dist/active-recall.js.map +1 -1
  16. package/dist/adapters/claude-code.d.ts +24 -0
  17. package/dist/adapters/claude-code.js +9 -0
  18. package/dist/adapters/codex.d.ts +25 -0
  19. package/dist/adapters/codex.js +9 -0
  20. package/dist/adapters/hermes.d.ts +35 -0
  21. package/dist/adapters/hermes.js +9 -0
  22. package/dist/adapters/index.d.ts +6 -0
  23. package/dist/adapters/index.js +26 -0
  24. package/dist/adapters/registry.d.ts +20 -0
  25. package/dist/adapters/registry.js +13 -0
  26. package/dist/adapters/replit.d.ts +28 -0
  27. package/dist/adapters/replit.js +9 -0
  28. package/dist/adapters/types.d.ts +43 -0
  29. package/dist/adapters/types.js +8 -0
  30. package/dist/bootstrap.d.ts +20 -5
  31. package/dist/boxes.d.ts +7 -0
  32. package/dist/boxes.js +1 -1
  33. package/dist/briefing.d.ts +5 -3
  34. package/dist/briefing.js +9 -6
  35. package/dist/buffer-surprise-report.js +1 -1
  36. package/dist/buffer.d.ts +18 -4
  37. package/dist/buffer.js +1 -1
  38. package/dist/calibration.js +4 -4
  39. package/dist/capsule-cli.d.ts +4 -4
  40. package/dist/capsule-cli.js +1 -1
  41. package/dist/capsule-crypto-5CYAGVC5.js +18 -0
  42. package/dist/capsule-merge-4MGKE7C5.js +189 -0
  43. package/dist/causal-behavior.d.ts +8 -28
  44. package/dist/causal-behavior.js +6 -3
  45. package/dist/causal-behavior.js.map +1 -1
  46. package/dist/causal-chain.js +3 -2
  47. package/dist/causal-consolidation.d.ts +1 -1
  48. package/dist/causal-consolidation.js +24 -13
  49. package/dist/causal-consolidation.js.map +1 -1
  50. package/dist/causal-retrieval.js +3 -3
  51. package/dist/causal-trajectory.js +1 -1
  52. package/dist/chunk-25MQ7IHJ.js +427 -0
  53. package/dist/chunk-25MQ7IHJ.js.map +1 -0
  54. package/dist/chunk-2F2W355T.js +256 -0
  55. package/dist/chunk-2F2W355T.js.map +1 -0
  56. package/dist/chunk-2KI4QFHU.js +228 -0
  57. package/dist/chunk-2KI4QFHU.js.map +1 -0
  58. package/dist/chunk-2PRQG7PV.js +86 -0
  59. package/dist/chunk-2PRQG7PV.js.map +1 -0
  60. package/dist/chunk-2QR3XXIC.js +2272 -0
  61. package/dist/chunk-2QR3XXIC.js.map +1 -0
  62. package/dist/chunk-2WWLHTZY.js +121 -0
  63. package/dist/chunk-326G7DJK.js +2185 -0
  64. package/dist/chunk-326G7DJK.js.map +1 -0
  65. package/dist/chunk-34DQE4KF.js +174 -0
  66. package/dist/chunk-34DQE4KF.js.map +1 -0
  67. package/dist/chunk-3APJ5EVB.js +601 -0
  68. package/dist/chunk-3APJ5EVB.js.map +1 -0
  69. package/dist/chunk-3HPAPHUK.js +51 -0
  70. package/dist/chunk-3HPAPHUK.js.map +1 -0
  71. package/dist/chunk-3JXBXXM2.js +69 -0
  72. package/dist/chunk-3JXBXXM2.js.map +1 -0
  73. package/dist/chunk-3KW65B36.js +681 -0
  74. package/dist/chunk-3KW65B36.js.map +1 -0
  75. package/dist/chunk-3UXOZBHV.js +20 -0
  76. package/dist/chunk-3UXOZBHV.js.map +1 -0
  77. package/dist/chunk-3VAL7ZL2.js +266 -0
  78. package/dist/chunk-3VAL7ZL2.js.map +1 -0
  79. package/dist/chunk-3Y4P7RXM.js +31 -0
  80. package/dist/chunk-3Y4P7RXM.js.map +1 -0
  81. package/dist/chunk-47VWKCAF.js +273 -0
  82. package/dist/chunk-47VWKCAF.js.map +1 -0
  83. package/dist/chunk-4CRG46BG.js +271 -0
  84. package/dist/chunk-5375UYTQ.js +914 -0
  85. package/dist/chunk-5375UYTQ.js.map +1 -0
  86. package/dist/chunk-56K5QLHX.js +506 -0
  87. package/dist/chunk-56K5QLHX.js.map +1 -0
  88. package/dist/chunk-5RGLBDQF.js +596 -0
  89. package/dist/chunk-5RGLBDQF.js.map +1 -0
  90. package/dist/chunk-5UZXUTVO.js +9 -0
  91. package/dist/chunk-5UZXUTVO.js.map +1 -0
  92. package/dist/chunk-65PG43EQ.js +105 -0
  93. package/dist/chunk-65PG43EQ.js.map +1 -0
  94. package/dist/chunk-66DHUKLO.js +57 -0
  95. package/dist/chunk-66DHUKLO.js.map +1 -0
  96. package/dist/chunk-6FC5EGNV.js +46 -0
  97. package/dist/chunk-6FC5EGNV.js.map +1 -0
  98. package/dist/chunk-6H2TESSP.js +62 -0
  99. package/dist/chunk-6H2TESSP.js.map +1 -0
  100. package/dist/chunk-6LVVDPJ4.js +32 -0
  101. package/dist/chunk-6LVVDPJ4.js.map +1 -0
  102. package/dist/chunk-6RVI47ZR.js +159 -0
  103. package/dist/chunk-6RVI47ZR.js.map +1 -0
  104. package/dist/chunk-7AAT6G4Q.js +5117 -0
  105. package/dist/chunk-7AAT6G4Q.js.map +1 -0
  106. package/dist/chunk-7DTASS5T.js +29 -0
  107. package/dist/chunk-7DTASS5T.js.map +1 -0
  108. package/dist/chunk-7IASACLB.js +596 -0
  109. package/dist/chunk-7MNMYOFP.js +32 -0
  110. package/dist/chunk-7MNMYOFP.js.map +1 -0
  111. package/dist/chunk-7N4KAIGN.js +133 -0
  112. package/dist/chunk-7N4KAIGN.js.map +1 -0
  113. package/dist/chunk-7OZ53EXP.js +101 -0
  114. package/dist/chunk-7OZ53EXP.js.map +1 -0
  115. package/dist/chunk-7XYTQGCC.js +134 -0
  116. package/dist/chunk-7XYTQGCC.js.map +1 -0
  117. package/dist/chunk-A2XUIMJ3.js +341 -0
  118. package/dist/chunk-A2XUIMJ3.js.map +1 -0
  119. package/dist/chunk-AGZQD76C.js +201 -0
  120. package/dist/chunk-AGZQD76C.js.map +1 -0
  121. package/dist/chunk-APO3DCMU.js +361 -0
  122. package/dist/chunk-APO3DCMU.js.map +1 -0
  123. package/dist/chunk-BFBF3XEF.js +283 -0
  124. package/dist/chunk-BFBF3XEF.js.map +1 -0
  125. package/dist/chunk-BJ3KMYTB.js +1974 -0
  126. package/dist/chunk-BJ3KMYTB.js.map +1 -0
  127. package/dist/chunk-CHEL3SKB.js +6758 -0
  128. package/dist/chunk-CHEL3SKB.js.map +1 -0
  129. package/dist/chunk-CQZRLNMV.js +1491 -0
  130. package/dist/chunk-CQZRLNMV.js.map +1 -0
  131. package/dist/chunk-D46YSIYX.js +892 -0
  132. package/dist/chunk-D46YSIYX.js.map +1 -0
  133. package/dist/chunk-DINWEURR.js +648 -0
  134. package/dist/chunk-DINWEURR.js.map +1 -0
  135. package/dist/chunk-DK5LDEQM.js +530 -0
  136. package/dist/chunk-DK5LDEQM.js.map +1 -0
  137. package/dist/chunk-DOM4GKSW.js +34 -0
  138. package/dist/chunk-DOM4GKSW.js.map +1 -0
  139. package/dist/chunk-EDTHC6UD.js +1075 -0
  140. package/dist/chunk-EFJ3MQ4V.js +721 -0
  141. package/dist/chunk-EHRTFRWW.js +89 -0
  142. package/dist/chunk-EHRTFRWW.js.map +1 -0
  143. package/dist/chunk-FAJ7FZYM.js +11 -0
  144. package/dist/chunk-FAJ7FZYM.js.map +1 -0
  145. package/dist/chunk-FBYESMQ2.js +570 -0
  146. package/dist/chunk-FDU6HUUL.js +147 -0
  147. package/dist/chunk-FF4KLI5W.js +99 -0
  148. package/dist/chunk-FF4KLI5W.js.map +1 -0
  149. package/dist/chunk-FIT6DMX6.js +310 -0
  150. package/dist/chunk-FIT6DMX6.js.map +1 -0
  151. package/dist/chunk-FJ43PRLT.js +272 -0
  152. package/dist/chunk-FJ43PRLT.js.map +1 -0
  153. package/dist/chunk-FKFMOY3N.js +32 -0
  154. package/dist/chunk-FKFMOY3N.js.map +1 -0
  155. package/dist/chunk-FLTNHQK6.js +262 -0
  156. package/dist/chunk-FLTNHQK6.js.map +1 -0
  157. package/dist/chunk-GA454ALV.js +12436 -0
  158. package/dist/chunk-GA454ALV.js.map +1 -0
  159. package/dist/chunk-GGKRUQOO.js +228 -0
  160. package/dist/chunk-GIF42EW3.js +63 -0
  161. package/dist/chunk-GIF42EW3.js.map +1 -0
  162. package/dist/chunk-GL6I6MEQ.js +647 -0
  163. package/dist/chunk-H3ME6L6D.js +709 -0
  164. package/dist/chunk-H3ME6L6D.js.map +1 -0
  165. package/dist/chunk-HHLLAQGZ.js +1 -0
  166. package/dist/chunk-HXXBL2KD.js +2040 -0
  167. package/dist/chunk-I5V2VDIW.js +219 -0
  168. package/dist/chunk-I5V2VDIW.js.map +1 -0
  169. package/dist/chunk-I6K5FBRQ.js +35 -0
  170. package/dist/chunk-I6K5FBRQ.js.map +1 -0
  171. package/dist/chunk-ICRIXAP2.js +121 -0
  172. package/dist/chunk-ICRIXAP2.js.map +1 -0
  173. package/dist/chunk-J4EB7DNW.js +11 -0
  174. package/dist/chunk-J4EB7DNW.js.map +1 -0
  175. package/dist/chunk-JLFA7DQG.js +62 -0
  176. package/dist/chunk-JLFA7DQG.js.map +1 -0
  177. package/dist/chunk-KJTKLXTH.js +9 -0
  178. package/dist/chunk-KJTKLXTH.js.map +1 -0
  179. package/dist/chunk-KLAO5DGL.js +917 -0
  180. package/dist/chunk-KLAO5DGL.js.map +1 -0
  181. package/dist/chunk-KNKUID7G.js +183 -0
  182. package/dist/chunk-KOSORCJG.js +624 -0
  183. package/dist/chunk-KOSORCJG.js.map +1 -0
  184. package/dist/chunk-KUJVMMZQ.js +1262 -0
  185. package/dist/chunk-KUJVMMZQ.js.map +1 -0
  186. package/dist/chunk-LCR46JY5.js +123 -0
  187. package/dist/chunk-LCR46JY5.js.map +1 -0
  188. package/dist/chunk-LLQ2LLWF.js +148 -0
  189. package/dist/chunk-LLQ2LLWF.js.map +1 -0
  190. package/dist/chunk-LPMVBPA3.js +236 -0
  191. package/dist/chunk-LT3NLYSI.js +50 -0
  192. package/dist/chunk-LT3NLYSI.js.map +1 -0
  193. package/dist/chunk-LUDTDZLK.js +287 -0
  194. package/dist/chunk-LUDTDZLK.js.map +1 -0
  195. package/dist/chunk-M23FSH32.js +3963 -0
  196. package/dist/chunk-M23FSH32.js.map +1 -0
  197. package/dist/chunk-MC26UJIM.js +118 -0
  198. package/dist/chunk-ME6ESPZU.js +119 -0
  199. package/dist/chunk-ME6ESPZU.js.map +1 -0
  200. package/dist/chunk-MGKYQQYF.js +272 -0
  201. package/dist/chunk-MJFNCJXV.js +66 -0
  202. package/dist/chunk-MJFNCJXV.js.map +1 -0
  203. package/dist/chunk-MSWG7JI6.js +237 -0
  204. package/dist/chunk-MSWG7JI6.js.map +1 -0
  205. package/dist/chunk-MT25YHYH.js +141 -0
  206. package/dist/chunk-MT25YHYH.js.map +1 -0
  207. package/dist/chunk-MT4HVDUZ.js +53 -0
  208. package/dist/chunk-MY6TPVXW.js +219 -0
  209. package/dist/chunk-N2D6GXBM.js +267 -0
  210. package/dist/chunk-N2D6GXBM.js.map +1 -0
  211. package/dist/chunk-NJ3MJQZX.js +46 -0
  212. package/dist/chunk-NJ3MJQZX.js.map +1 -0
  213. package/dist/chunk-NMZY542O.js +335 -0
  214. package/dist/chunk-NMZY542O.js.map +1 -0
  215. package/dist/chunk-NNVTUXEB.js +23 -0
  216. package/dist/chunk-NZL6GGQE.js +375 -0
  217. package/dist/chunk-NZL6GGQE.js.map +1 -0
  218. package/dist/chunk-P4NEIHUT.js +108 -0
  219. package/dist/chunk-P7FMDTKL.js +103 -0
  220. package/dist/chunk-P7FMDTKL.js.map +1 -0
  221. package/dist/chunk-PHK3HARR.js +32 -0
  222. package/dist/chunk-PHK3HARR.js.map +1 -0
  223. package/dist/chunk-PIRJPV5T.js +98 -0
  224. package/dist/chunk-PIRJPV5T.js.map +1 -0
  225. package/dist/chunk-PK7H5L6Y.js +159 -0
  226. package/dist/chunk-PK7H5L6Y.js.map +1 -0
  227. package/dist/chunk-PR5FBTFU.js +233 -0
  228. package/dist/chunk-PR5FBTFU.js.map +1 -0
  229. package/dist/chunk-PU63GXWS.js +174 -0
  230. package/dist/chunk-PU63GXWS.js.map +1 -0
  231. package/dist/chunk-PZIAX57I.js +124 -0
  232. package/dist/chunk-PZIAX57I.js.map +1 -0
  233. package/dist/chunk-Q7P4WJDP.js +26 -0
  234. package/dist/chunk-Q7P4WJDP.js.map +1 -0
  235. package/dist/chunk-QQUAB63I.js +63 -0
  236. package/dist/chunk-QQUAB63I.js.map +1 -0
  237. package/dist/chunk-QRNI5JBH.js +18 -0
  238. package/dist/chunk-RHY3HH7P.js +601 -0
  239. package/dist/chunk-RHY3HH7P.js.map +1 -0
  240. package/dist/chunk-RRF5UOBJ.js +91 -0
  241. package/dist/chunk-RXDLTSWT.js +124 -0
  242. package/dist/chunk-RXDLTSWT.js.map +1 -0
  243. package/dist/chunk-RYED3SPJ.js +42 -0
  244. package/dist/chunk-RYED3SPJ.js.map +1 -0
  245. package/dist/chunk-S7KDBTWT.js +106 -0
  246. package/dist/chunk-S7KDBTWT.js.map +1 -0
  247. package/dist/chunk-SEDEKFYQ.js +1 -0
  248. package/dist/chunk-TECVW3JP.js +36 -0
  249. package/dist/chunk-TECVW3JP.js.map +1 -0
  250. package/dist/chunk-TFO23QT4.js +88 -0
  251. package/dist/chunk-TFO23QT4.js.map +1 -0
  252. package/dist/chunk-TK4UEOSK.js +76 -0
  253. package/dist/chunk-TK4UEOSK.js.map +1 -0
  254. package/dist/chunk-TKWGAOLV.js +122 -0
  255. package/dist/chunk-TKWGAOLV.js.map +1 -0
  256. package/dist/chunk-TMM4S4IJ.js +597 -0
  257. package/dist/chunk-TMM4S4IJ.js.map +1 -0
  258. package/dist/chunk-TMQLARTH.js +188 -0
  259. package/dist/chunk-TMQLARTH.js.map +1 -0
  260. package/dist/chunk-TPDBFYEG.js +130 -0
  261. package/dist/chunk-TPDBFYEG.js.map +1 -0
  262. package/dist/chunk-TPMQ3G6Z.js +145 -0
  263. package/dist/chunk-TPMQ3G6Z.js.map +1 -0
  264. package/dist/chunk-TZOLIGIG.js +61 -0
  265. package/dist/chunk-TZOLIGIG.js.map +1 -0
  266. package/dist/chunk-U3PN77QT.js +113 -0
  267. package/dist/chunk-U3WSW6PZ.js +277 -0
  268. package/dist/chunk-U4SCL7B7.js +640 -0
  269. package/dist/chunk-U4SCL7B7.js.map +1 -0
  270. package/dist/chunk-UWK5OXUJ.js +156 -0
  271. package/dist/chunk-UWK5OXUJ.js.map +1 -0
  272. package/dist/chunk-UWVJF25J.js +74 -0
  273. package/dist/chunk-UXHQAFNA.js +1317 -0
  274. package/dist/chunk-UXHQAFNA.js.map +1 -0
  275. package/dist/chunk-V5OCT34X.js +1 -0
  276. package/dist/chunk-VLXA6PI2.js +304 -0
  277. package/dist/chunk-VLXA6PI2.js.map +1 -0
  278. package/dist/chunk-VNO6ZJ35.js +500 -0
  279. package/dist/chunk-VNO6ZJ35.js.map +1 -0
  280. package/dist/chunk-VW676BEI.js +827 -0
  281. package/dist/chunk-VW676BEI.js.map +1 -0
  282. package/dist/chunk-W3LR522O.js +2296 -0
  283. package/dist/chunk-W4L6CZKA.js +96 -0
  284. package/dist/chunk-W4L6CZKA.js.map +1 -0
  285. package/dist/chunk-W4RVMTHR.js +372 -0
  286. package/dist/chunk-W4RVMTHR.js.map +1 -0
  287. package/dist/chunk-WEHSQBFR.js +188 -0
  288. package/dist/chunk-WEHSQBFR.js.map +1 -0
  289. package/dist/chunk-WELDCG6C.js +380 -0
  290. package/dist/chunk-WELDCG6C.js.map +1 -0
  291. package/dist/chunk-WZYKANL3.js +2800 -0
  292. package/dist/chunk-WZYKANL3.js.map +1 -0
  293. package/dist/chunk-XIG5PDM7.js +48 -0
  294. package/dist/chunk-XJNBEDFE.js +193 -0
  295. package/dist/chunk-XJNBEDFE.js.map +1 -0
  296. package/dist/chunk-XVVIG67A.js +291 -0
  297. package/dist/chunk-XVVIG67A.js.map +1 -0
  298. package/dist/chunk-XVZ7B3HG.js +135 -0
  299. package/dist/chunk-YBPYIAA5.js +73 -0
  300. package/dist/chunk-YBPYIAA5.js.map +1 -0
  301. package/dist/chunk-Z734BLO3.js +21 -0
  302. package/dist/chunk-Z734BLO3.js.map +1 -0
  303. package/dist/chunk-ZKSK55RC.js +269 -0
  304. package/dist/chunk-ZKSK55RC.js.map +1 -0
  305. package/dist/chunk-ZTFCYYEZ.js +69 -0
  306. package/dist/chunk-ZTFCYYEZ.js.map +1 -0
  307. package/dist/chunk-ZY2MNJR6.js +329 -0
  308. package/dist/chunk-ZY2MNJR6.js.map +1 -0
  309. package/dist/cli-D3VpkVwB.d.ts +1136 -0
  310. package/dist/cli.d.ts +39 -10
  311. package/dist/cli.js +108 -49
  312. package/dist/commitment-ledger.js +1 -1
  313. package/dist/compat/checks.d.ts +5 -0
  314. package/dist/compat/checks.js +11 -0
  315. package/dist/compat/checks.js.map +1 -0
  316. package/dist/compat/types.d.ts +30 -0
  317. package/dist/compat/types.js +1 -0
  318. package/dist/compat/types.js.map +1 -0
  319. package/dist/compounding/engine.d.ts +221 -0
  320. package/dist/compounding/engine.js +32 -0
  321. package/dist/compounding/engine.js.map +1 -0
  322. package/dist/compounding/preference-consolidator.d.ts +92 -0
  323. package/dist/compounding/preference-consolidator.js +553 -0
  324. package/dist/compounding/preference-consolidator.js.map +1 -0
  325. package/dist/config.d.ts +4 -2
  326. package/dist/config.js +9 -4
  327. package/dist/conflict-policy-DyJ2wd-h.d.ts +4 -0
  328. package/dist/connectors/codex-materialize-runner.d.ts +64 -0
  329. package/dist/connectors/codex-materialize-runner.js +33 -0
  330. package/dist/connectors/codex-materialize-runner.js.map +1 -0
  331. package/dist/connectors/codex-materialize.d.ts +195 -0
  332. package/dist/connectors/codex-materialize.js +38 -0
  333. package/dist/connectors/codex-materialize.js.map +1 -0
  334. package/dist/connectors/index.d.ts +444 -0
  335. package/dist/connectors/index.js +115 -0
  336. package/dist/connectors/index.js.map +1 -0
  337. package/dist/connectors-cli-CwbyjGR7.d.ts +257 -0
  338. package/dist/connectors-cli.d.ts +1 -1
  339. package/dist/consolidation-provenance-check.d.ts +3 -1
  340. package/dist/consolidation-undo.d.ts +3 -1
  341. package/dist/contradiction/index.d.ts +258 -0
  342. package/dist/contradiction/index.js +43 -0
  343. package/dist/contradiction/index.js.map +1 -0
  344. package/dist/contradiction-review-ATP4S6IC.js +30 -0
  345. package/dist/contradiction-review-ATP4S6IC.js.map +1 -0
  346. package/dist/contradiction-scan-5A4IDZV5.js +13 -0
  347. package/dist/contradiction-scan-5A4IDZV5.js.map +1 -0
  348. package/dist/conversation-index/backend.d.ts +97 -0
  349. package/dist/conversation-index/backend.js +13 -0
  350. package/dist/conversation-index/backend.js.map +1 -0
  351. package/dist/conversation-index/chunker.d.ts +16 -0
  352. package/dist/conversation-index/chunker.js +8 -0
  353. package/dist/conversation-index/chunker.js.map +1 -0
  354. package/dist/conversation-index/cleanup.d.ts +11 -0
  355. package/dist/conversation-index/cleanup.js +9 -0
  356. package/dist/conversation-index/cleanup.js.map +1 -0
  357. package/dist/conversation-index/faiss-adapter.d.ts +6 -0
  358. package/dist/conversation-index/faiss-adapter.js +16 -0
  359. package/dist/conversation-index/faiss-adapter.js.map +1 -0
  360. package/dist/conversation-index/indexer.d.ts +23 -0
  361. package/dist/conversation-index/indexer.js +15 -0
  362. package/dist/conversation-index/indexer.js.map +1 -0
  363. package/dist/conversation-index/search.d.ts +6 -0
  364. package/dist/conversation-index/search.js +11 -0
  365. package/dist/conversation-index/search.js.map +1 -0
  366. package/dist/embedding-fallback.js +2 -2
  367. package/dist/enrichment/index.d.ts +163 -0
  368. package/dist/enrichment/index.js +18 -0
  369. package/dist/enrichment/index.js.map +1 -0
  370. package/dist/entity-retrieval.d.ts +4 -2
  371. package/dist/entity-retrieval.js +8 -5
  372. package/dist/evals.js +1 -1
  373. package/dist/explicit-capture.d.ts +20 -5
  374. package/dist/explicit-capture.js +2 -2
  375. package/dist/extraction-judge-training.js +1 -1
  376. package/dist/extraction.js +8 -8
  377. package/dist/faiss-adapter-CzPghc4C.d.ts +70 -0
  378. package/dist/fallback-llm.d.ts +2 -0
  379. package/dist/fallback-llm.js +4 -4
  380. package/dist/graph-edge-decay-5DI5GUNL.js +207 -0
  381. package/dist/index.d.ts +66 -711
  382. package/dist/index.js +556 -2680
  383. package/dist/index.js.map +1 -1
  384. package/dist/lcm/archive.d.ts +89 -0
  385. package/dist/lcm/archive.js +12 -0
  386. package/dist/lcm/archive.js.map +1 -0
  387. package/dist/lcm/dag.d.ts +48 -0
  388. package/dist/lcm/dag.js +8 -0
  389. package/dist/lcm/dag.js.map +1 -0
  390. package/dist/lcm/engine.d.ts +116 -0
  391. package/dist/lcm/engine.js +20 -0
  392. package/dist/lcm/engine.js.map +1 -0
  393. package/dist/lcm/index.d.ts +12 -0
  394. package/dist/lcm/index.js +44 -0
  395. package/dist/lcm/index.js.map +1 -0
  396. package/dist/lcm/queue.d.ts +62 -0
  397. package/dist/lcm/queue.js +8 -0
  398. package/dist/lcm/queue.js.map +1 -0
  399. package/dist/lcm/recall.d.ts +20 -0
  400. package/dist/lcm/recall.js +8 -0
  401. package/dist/lcm/recall.js.map +1 -0
  402. package/dist/lcm/schema.d.ts +16 -0
  403. package/dist/lcm/schema.js +14 -0
  404. package/dist/lcm/schema.js.map +1 -0
  405. package/dist/lcm/summarizer.d.ts +38 -0
  406. package/dist/lcm/summarizer.js +12 -0
  407. package/dist/lcm/summarizer.js.map +1 -0
  408. package/dist/lcm/tools.d.ts +29 -0
  409. package/dist/lcm/tools.js +8 -0
  410. package/dist/lcm/tools.js.map +1 -0
  411. package/dist/live-connectors-runner.js +5 -5
  412. package/dist/local-llm.js +3 -3
  413. package/dist/maintenance/archive-observations.d.ts +18 -0
  414. package/dist/maintenance/archive-observations.js +8 -0
  415. package/dist/maintenance/archive-observations.js.map +1 -0
  416. package/dist/maintenance/backup-stamp.d.ts +3 -0
  417. package/dist/maintenance/backup-stamp.js +8 -0
  418. package/dist/maintenance/backup-stamp.js.map +1 -0
  419. package/dist/maintenance/memory-governance-cron.d.ts +85 -0
  420. package/dist/maintenance/memory-governance-cron.js +22 -0
  421. package/dist/maintenance/memory-governance-cron.js.map +1 -0
  422. package/dist/maintenance/memory-governance.d.ts +137 -0
  423. package/dist/maintenance/memory-governance.js +40 -0
  424. package/dist/maintenance/memory-governance.js.map +1 -0
  425. package/dist/maintenance/migrate-observations.d.ts +18 -0
  426. package/dist/maintenance/migrate-observations.js +9 -0
  427. package/dist/maintenance/migrate-observations.js.map +1 -0
  428. package/dist/maintenance/observation-ledger-utils.d.ts +10 -0
  429. package/dist/maintenance/observation-ledger-utils.js +10 -0
  430. package/dist/maintenance/observation-ledger-utils.js.map +1 -0
  431. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +15 -0
  432. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +28 -0
  433. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js.map +1 -0
  434. package/dist/maintenance/rebuild-memory-projection.d.ts +77 -0
  435. package/dist/maintenance/rebuild-memory-projection.js +35 -0
  436. package/dist/maintenance/rebuild-memory-projection.js.map +1 -0
  437. package/dist/maintenance/rebuild-observations.d.ts +17 -0
  438. package/dist/maintenance/rebuild-observations.js +9 -0
  439. package/dist/maintenance/rebuild-observations.js.map +1 -0
  440. package/dist/mcp-memory-inspector-app.d.ts +24 -6
  441. package/dist/memory-projection-store.d.ts +108 -3
  442. package/dist/memory-projection-store.js +2 -1
  443. package/dist/memory-worth-outcomes.d.ts +4 -2
  444. package/dist/migrate/from-engram.d.ts +24 -0
  445. package/dist/migrate/from-engram.js +12 -0
  446. package/dist/migrate/from-engram.js.map +1 -0
  447. package/dist/namespaces/migrate.d.ts +50 -0
  448. package/dist/namespaces/migrate.js +50 -0
  449. package/dist/namespaces/migrate.js.map +1 -0
  450. package/dist/namespaces/principal.d.ts +17 -0
  451. package/dist/namespaces/principal.js +16 -0
  452. package/dist/namespaces/principal.js.map +1 -0
  453. package/dist/namespaces/search.d.ts +46 -0
  454. package/dist/namespaces/search.js +28 -0
  455. package/dist/namespaces/search.js.map +1 -0
  456. package/dist/namespaces/storage.d.ts +32 -0
  457. package/dist/namespaces/storage.js +28 -0
  458. package/dist/namespaces/storage.js.map +1 -0
  459. package/dist/network/tailscale.d.ts +41 -0
  460. package/dist/network/tailscale.js +9 -0
  461. package/dist/network/tailscale.js.map +1 -0
  462. package/dist/network/webdav.d.ts +39 -0
  463. package/dist/network/webdav.js +10 -0
  464. package/dist/network/webdav.js.map +1 -0
  465. package/dist/objective-state-writers.js +2 -2
  466. package/dist/operator-toolkit.d.ts +4 -2
  467. package/dist/operator-toolkit.js +32 -14
  468. package/dist/opik-exporter.js +2 -2
  469. package/dist/opik-exporter.js.map +1 -1
  470. package/dist/orchestrator-DuWl9Hwx.d.ts +1244 -0
  471. package/dist/orchestrator.d.ts +22 -7
  472. package/dist/orchestrator.js +79 -44
  473. package/dist/path-MR5JPYOP.js +9 -0
  474. package/dist/path-MR5JPYOP.js.map +1 -0
  475. package/dist/qmd-recall-cache.d.ts +1 -1
  476. package/dist/qmd.d.ts +102 -3
  477. package/dist/qmd.js +23 -5
  478. package/dist/recall-explain-renderer.js +3 -3
  479. package/dist/recall-xray-cli.js +4 -4
  480. package/dist/recall-xray-renderer.js +3 -3
  481. package/dist/recall-xray.js +2 -2
  482. package/dist/replay/normalizers/chatgpt.d.ts +6 -0
  483. package/dist/replay/normalizers/chatgpt.js +11 -0
  484. package/dist/replay/normalizers/chatgpt.js.map +1 -0
  485. package/dist/replay/normalizers/claude.d.ts +6 -0
  486. package/dist/replay/normalizers/claude.js +11 -0
  487. package/dist/replay/normalizers/claude.js.map +1 -0
  488. package/dist/replay/normalizers/openclaw.d.ts +6 -0
  489. package/dist/replay/normalizers/openclaw.js +11 -0
  490. package/dist/replay/normalizers/openclaw.js.map +1 -0
  491. package/dist/replay/normalizers/shared.d.ts +16 -0
  492. package/dist/replay/normalizers/shared.js +14 -0
  493. package/dist/replay/normalizers/shared.js.map +1 -0
  494. package/dist/replay/runner.d.ts +35 -0
  495. package/dist/replay/runner.js +16 -0
  496. package/dist/replay/runner.js.map +1 -0
  497. package/dist/replay/types.d.ts +57 -0
  498. package/dist/replay/types.js +19 -0
  499. package/dist/replay/types.js.map +1 -0
  500. package/dist/resolution-B7FNQSSP.js +12 -0
  501. package/dist/resolution-B7FNQSSP.js.map +1 -0
  502. package/dist/resolve-provider-secret.js +2 -2
  503. package/dist/resume-bundles.js +8 -6
  504. package/dist/retrieval-agents.d.ts +1 -1
  505. package/dist/routing/engine.d.ts +35 -0
  506. package/dist/routing/engine.js +16 -0
  507. package/dist/routing/engine.js.map +1 -0
  508. package/dist/routing/store.d.ts +27 -0
  509. package/dist/routing/store.js +10 -0
  510. package/dist/routing/store.js.map +1 -0
  511. package/dist/runtime/better-sqlite.d.ts +8 -0
  512. package/dist/runtime/better-sqlite.js +10 -0
  513. package/dist/runtime/better-sqlite.js.map +1 -0
  514. package/dist/runtime/child-process.d.ts +32 -0
  515. package/dist/runtime/child-process.js +10 -0
  516. package/dist/runtime/child-process.js.map +1 -0
  517. package/dist/runtime/env.d.ts +5 -0
  518. package/dist/runtime/env.js +12 -0
  519. package/dist/runtime/env.js.map +1 -0
  520. package/dist/schemas.d.ts +22 -22
  521. package/dist/sdk-compat.js +1 -1
  522. package/dist/search/document-scanner.d.ts +22 -0
  523. package/dist/search/document-scanner.js +8 -0
  524. package/dist/search/document-scanner.js.map +1 -0
  525. package/dist/search/embed-helper.d.ts +35 -0
  526. package/dist/search/embed-helper.js +9 -0
  527. package/dist/search/embed-helper.js.map +1 -0
  528. package/dist/search/factory.d.ts +32 -0
  529. package/dist/search/factory.js +29 -0
  530. package/dist/search/factory.js.map +1 -0
  531. package/dist/search/index.d.ts +15 -0
  532. package/dist/search/index.js +50 -0
  533. package/dist/search/index.js.map +1 -0
  534. package/dist/search/lancedb-backend.d.ts +51 -0
  535. package/dist/search/lancedb-backend.js +10 -0
  536. package/dist/search/lancedb-backend.js.map +1 -0
  537. package/dist/search/meilisearch-backend.d.ts +48 -0
  538. package/dist/search/meilisearch-backend.js +10 -0
  539. package/dist/search/meilisearch-backend.js.map +1 -0
  540. package/dist/search/noop-backend.d.ts +26 -0
  541. package/dist/search/noop-backend.js +8 -0
  542. package/dist/search/noop-backend.js.map +1 -0
  543. package/dist/search/orama-backend.d.ts +53 -0
  544. package/dist/search/orama-backend.js +10 -0
  545. package/dist/search/orama-backend.js.map +1 -0
  546. package/dist/search/port.d.ts +61 -0
  547. package/dist/search/port.js +1 -0
  548. package/dist/search/port.js.map +1 -0
  549. package/dist/search/remote-backend.d.ts +39 -0
  550. package/dist/search/remote-backend.js +9 -0
  551. package/dist/search/remote-backend.js.map +1 -0
  552. package/dist/secure-store/index.d.ts +890 -0
  553. package/dist/secure-store/index.js +156 -0
  554. package/dist/secure-store/index.js.map +1 -0
  555. package/dist/semantic-VwGI14Ok.d.ts +69 -0
  556. package/dist/semantic-consolidation-4HkHWgeI.d.ts +180 -0
  557. package/dist/semantic-consolidation.d.ts +2 -2
  558. package/dist/semantic-consolidation.js +13 -6
  559. package/dist/semantic-rule-promotion.js +8 -5
  560. package/dist/semantic-rule-verifier.js +8 -5
  561. package/dist/shared-context/manager.d.ts +131 -0
  562. package/dist/shared-context/manager.js +15 -0
  563. package/dist/shared-context/manager.js.map +1 -0
  564. package/dist/skills-registry.js +13 -1
  565. package/dist/skills-registry.js.map +1 -1
  566. package/dist/state-store-VZU2IA53.js +16 -0
  567. package/dist/state-store-VZU2IA53.js.map +1 -0
  568. package/dist/storage-paths.d.ts +9 -0
  569. package/dist/storage-paths.js +20 -0
  570. package/dist/storage-paths.js.map +1 -0
  571. package/dist/storage.d.ts +3 -1
  572. package/dist/storage.js +7 -4
  573. package/dist/summarizer.d.ts +5 -0
  574. package/dist/summarizer.js +9 -8
  575. package/dist/summary-snapshot.js +2 -1
  576. package/dist/surfaces/dreams.d.ts +16 -0
  577. package/dist/surfaces/dreams.js +282 -0
  578. package/dist/surfaces/dreams.js.map +1 -0
  579. package/dist/surfaces/heartbeat.d.ts +17 -0
  580. package/dist/surfaces/heartbeat.js +265 -0
  581. package/dist/surfaces/heartbeat.js.map +1 -0
  582. package/dist/temporal-supersession.d.ts +3 -1
  583. package/dist/threading.d.ts +5 -0
  584. package/dist/threading.js +2 -1
  585. package/dist/tier-migration.d.ts +4 -2
  586. package/dist/tokens.js +2 -2
  587. package/dist/transcript.d.ts +15 -1
  588. package/dist/transcript.js +2 -1
  589. package/dist/transfer/autodetect.d.ts +4 -0
  590. package/dist/transfer/autodetect.js +15 -0
  591. package/dist/transfer/autodetect.js.map +1 -0
  592. package/dist/transfer/backup.d.ts +21 -0
  593. package/dist/transfer/backup.js +17 -0
  594. package/dist/transfer/backup.js.map +1 -0
  595. package/dist/transfer/capsule-export.d.ts +113 -0
  596. package/dist/transfer/capsule-export.js +19 -0
  597. package/dist/transfer/capsule-export.js.map +1 -0
  598. package/dist/transfer/capsule-import.d.ts +124 -0
  599. package/dist/transfer/capsule-import.js +16 -0
  600. package/dist/transfer/capsule-import.js.map +1 -0
  601. package/dist/transfer/constants.d.ts +13 -0
  602. package/dist/transfer/constants.js +12 -0
  603. package/dist/transfer/constants.js.map +1 -0
  604. package/dist/transfer/export-json.d.ts +11 -0
  605. package/dist/transfer/export-json.js +11 -0
  606. package/dist/transfer/export-json.js.map +1 -0
  607. package/dist/transfer/export-md.d.ts +10 -0
  608. package/dist/transfer/export-md.js +13 -0
  609. package/dist/transfer/export-md.js.map +1 -0
  610. package/dist/transfer/export-sqlite.d.ts +9 -0
  611. package/dist/transfer/export-sqlite.js +12 -0
  612. package/dist/transfer/export-sqlite.js.map +1 -0
  613. package/dist/transfer/fs-utils.d.ts +61 -0
  614. package/dist/transfer/fs-utils.js +40 -0
  615. package/dist/transfer/fs-utils.js.map +1 -0
  616. package/dist/transfer/import-json.d.ts +16 -0
  617. package/dist/transfer/import-json.js +13 -0
  618. package/dist/transfer/import-json.js.map +1 -0
  619. package/dist/transfer/import-md.d.ts +14 -0
  620. package/dist/transfer/import-md.js +11 -0
  621. package/dist/transfer/import-md.js.map +1 -0
  622. package/dist/transfer/import-sqlite.d.ts +14 -0
  623. package/dist/transfer/import-sqlite.js +12 -0
  624. package/dist/transfer/import-sqlite.js.map +1 -0
  625. package/dist/transfer/sqlite-schema.d.ts +4 -0
  626. package/dist/transfer/sqlite-schema.js +10 -0
  627. package/dist/transfer/sqlite-schema.js.map +1 -0
  628. package/dist/transfer/types.d.ts +916 -0
  629. package/dist/transfer/types.js +30 -0
  630. package/dist/transfer/types.js.map +1 -0
  631. package/dist/types.d.ts +28 -1
  632. package/dist/types.js +1 -1
  633. package/dist/verified-recall.js +9 -6
  634. package/dist/work/board.d.ts +43 -0
  635. package/dist/work/board.js +14 -0
  636. package/dist/work/board.js.map +1 -0
  637. package/dist/work/boundary.d.ts +8 -0
  638. package/dist/work/boundary.js +14 -0
  639. package/dist/work/boundary.js.map +1 -0
  640. package/dist/work/storage.d.ts +39 -0
  641. package/dist/work/storage.js +11 -0
  642. package/dist/work/storage.js.map +1 -0
  643. package/dist/work/types.d.ts +75 -0
  644. package/dist/work/types.js +1 -0
  645. package/dist/work/types.js.map +1 -0
  646. package/package.json +2767 -6
  647. package/scripts/faiss_index.py +816 -0
  648. package/scripts/faiss_requirements.txt +3 -0
  649. package/skills/remnic-entities/SKILL.md +51 -0
  650. package/skills/remnic-memory-workflow/SKILL.md +61 -0
  651. package/skills/remnic-recall/SKILL.md +51 -0
  652. package/skills/remnic-remember/SKILL.md +56 -0
  653. package/skills/remnic-search/SKILL.md +51 -0
  654. package/skills/remnic-status/SKILL.md +51 -0
  655. package/src/abort-error.test.ts +49 -0
  656. package/src/abort-error.ts +46 -0
  657. package/src/abstraction-nodes.ts +162 -0
  658. package/src/access-audit.test.ts +178 -0
  659. package/src/access-audit.ts +125 -0
  660. package/src/access-cli.test.ts +439 -0
  661. package/src/access-cli.ts +438 -0
  662. package/src/access-http.test.ts +225 -0
  663. package/src/access-http.ts +1899 -0
  664. package/src/access-idempotency.ts +232 -0
  665. package/src/access-mcp.test.ts +568 -0
  666. package/src/access-mcp.ts +3056 -0
  667. package/src/access-schema-pi.test.ts +60 -0
  668. package/src/access-schema.ts +522 -0
  669. package/src/access-service-namespace.test.ts +123 -0
  670. package/src/access-service.ts +5629 -0
  671. package/src/action-confidence.test.ts +206 -0
  672. package/src/action-confidence.ts +466 -0
  673. package/src/active-memory-bridge.test.ts +285 -0
  674. package/src/active-memory-bridge.ts +217 -0
  675. package/src/active-recall.test.ts +484 -0
  676. package/src/active-recall.ts +459 -0
  677. package/src/adapters/claude-code.ts +56 -0
  678. package/src/adapters/codex.ts +57 -0
  679. package/src/adapters/hermes.ts +64 -0
  680. package/src/adapters/index.ts +6 -0
  681. package/src/adapters/registry.ts +41 -0
  682. package/src/adapters/replit.ts +55 -0
  683. package/src/adapters/types.ts +51 -0
  684. package/src/behavior-learner.ts +144 -0
  685. package/src/behavior-signals.ts +73 -0
  686. package/src/binary-lifecycle/backend.ts +117 -0
  687. package/src/binary-lifecycle/index.ts +35 -0
  688. package/src/binary-lifecycle/manifest.ts +79 -0
  689. package/src/binary-lifecycle/pipeline.ts +352 -0
  690. package/src/binary-lifecycle/scanner.ts +89 -0
  691. package/src/binary-lifecycle/types.ts +89 -0
  692. package/src/bootstrap.ts +178 -0
  693. package/src/boxes.ts +521 -0
  694. package/src/briefing.test.ts +1535 -0
  695. package/src/briefing.ts +1382 -0
  696. package/src/buffer-session.test.ts +443 -0
  697. package/src/buffer-surprise-report.ts +176 -0
  698. package/src/buffer-surprise-telemetry.test.ts +606 -0
  699. package/src/buffer-surprise-trigger.test.ts +766 -0
  700. package/src/buffer-surprise.test.ts +339 -0
  701. package/src/buffer-surprise.ts +203 -0
  702. package/src/buffer.ts +900 -0
  703. package/src/bulk-import/cli-command.test.ts +204 -0
  704. package/src/bulk-import/index.ts +34 -0
  705. package/src/bulk-import/pipeline.test.ts +445 -0
  706. package/src/bulk-import/pipeline.ts +178 -0
  707. package/src/bulk-import/registry.test.ts +151 -0
  708. package/src/bulk-import/registry.ts +72 -0
  709. package/src/bulk-import/types.test.ts +272 -0
  710. package/src/bulk-import/types.ts +145 -0
  711. package/src/calibration.ts +394 -0
  712. package/src/capsule-cli.test.ts +398 -0
  713. package/src/capsule-cli.ts +565 -0
  714. package/src/causal-behavior.ts +308 -0
  715. package/src/causal-chain.ts +419 -0
  716. package/src/causal-consolidation.ts +370 -0
  717. package/src/causal-retrieval.ts +286 -0
  718. package/src/causal-trajectory-graph.ts +60 -0
  719. package/src/causal-trajectory.ts +303 -0
  720. package/src/chunking.ts +220 -0
  721. package/src/citations.ts +232 -0
  722. package/src/cli.ts +9403 -0
  723. package/src/codex-cli-fallback.ts +162 -0
  724. package/src/codex-thread-key.ts +1 -0
  725. package/src/coding/access-coding-context.test.ts +197 -0
  726. package/src/coding/coding-branch-scope.test.ts +281 -0
  727. package/src/coding/coding-namespace.test.ts +360 -0
  728. package/src/coding/coding-namespace.ts +412 -0
  729. package/src/coding/coding-orchestrator.test.ts +249 -0
  730. package/src/coding/git-context.test.ts +507 -0
  731. package/src/coding/git-context.ts +336 -0
  732. package/src/coding/mcp-set-coding-context.test.ts +174 -0
  733. package/src/coding/review-context.test.ts +316 -0
  734. package/src/coding/review-context.ts +349 -0
  735. package/src/coding/wire-coding-context.test.ts +468 -0
  736. package/src/commitment-ledger.test.ts +78 -0
  737. package/src/commitment-ledger.ts +337 -0
  738. package/src/compat/checks.test.ts +206 -0
  739. package/src/compat/checks.ts +716 -0
  740. package/src/compat/types.ts +33 -0
  741. package/src/compounding/engine.ts +1686 -0
  742. package/src/compounding/preference-consolidator.ts +778 -0
  743. package/src/compression-optimizer.ts +312 -0
  744. package/src/config.test.ts +930 -0
  745. package/src/config.ts +3807 -0
  746. package/src/connectors/codex/instructions.md +160 -0
  747. package/src/connectors/codex/resources/namespace-cheatsheet.md +48 -0
  748. package/src/connectors/codex-marketplace.ts +500 -0
  749. package/src/connectors/codex-materialize-runner.ts +212 -0
  750. package/src/connectors/codex-materialize.ts +983 -0
  751. package/src/connectors/coerce.ts +62 -0
  752. package/src/connectors/index.test.ts +1570 -0
  753. package/src/connectors/index.ts +3222 -0
  754. package/src/connectors/live/framework.ts +164 -0
  755. package/src/connectors/live/github.test.ts +1218 -0
  756. package/src/connectors/live/github.ts +1068 -0
  757. package/src/connectors/live/gmail.test.ts +1706 -0
  758. package/src/connectors/live/gmail.ts +1293 -0
  759. package/src/connectors/live/google-drive.test.ts +696 -0
  760. package/src/connectors/live/google-drive.ts +724 -0
  761. package/src/connectors/live/index.ts +101 -0
  762. package/src/connectors/live/live-connectors.test.ts +689 -0
  763. package/src/connectors/live/notion.test.ts +1109 -0
  764. package/src/connectors/live/notion.ts +978 -0
  765. package/src/connectors/live/registry.ts +103 -0
  766. package/src/connectors/live/state-store.ts +399 -0
  767. package/src/connectors/live/transient-errors.ts +150 -0
  768. package/src/connectors/weclone-installer.test.ts +850 -0
  769. package/src/connectors-cli.ts +513 -0
  770. package/src/console/state.test.ts +224 -0
  771. package/src/console/state.ts +514 -0
  772. package/src/console/trace.test.ts +813 -0
  773. package/src/console/trace.ts +603 -0
  774. package/src/console/tui.test.ts +582 -0
  775. package/src/console/tui.ts +508 -0
  776. package/src/consolidation-operator.ts +182 -0
  777. package/src/consolidation-provenance-check.ts +551 -0
  778. package/src/consolidation-undo.ts +718 -0
  779. package/src/contradiction/contradiction-judge.test.ts +189 -0
  780. package/src/contradiction/contradiction-judge.ts +333 -0
  781. package/src/contradiction/contradiction-review.ts +574 -0
  782. package/src/contradiction/contradiction-scan.ts +504 -0
  783. package/src/contradiction/contradiction.test.ts +2230 -0
  784. package/src/contradiction/index.ts +37 -0
  785. package/src/contradiction/resolution.ts +383 -0
  786. package/src/conversation-index/backend.ts +323 -0
  787. package/src/conversation-index/chunker.ts +47 -0
  788. package/src/conversation-index/cleanup.ts +53 -0
  789. package/src/conversation-index/faiss-adapter.ts +384 -0
  790. package/src/conversation-index/indexer.test.ts +164 -0
  791. package/src/conversation-index/indexer.ts +192 -0
  792. package/src/conversation-index/search.ts +37 -0
  793. package/src/cross-namespace-budget.test.ts +275 -0
  794. package/src/cross-namespace-budget.ts +365 -0
  795. package/src/cue-anchors.ts +163 -0
  796. package/src/curation/index.ts +544 -0
  797. package/src/dashboard-runtime.ts +337 -0
  798. package/src/day-summary.ts +122 -0
  799. package/src/dedup/index.ts +330 -0
  800. package/src/dedup/semantic.test.ts +1577 -0
  801. package/src/dedup/semantic.ts +148 -0
  802. package/src/delinearize.ts +193 -0
  803. package/src/direct-answer-wiring.test.ts +473 -0
  804. package/src/direct-answer-wiring.ts +180 -0
  805. package/src/direct-answer.test.ts +484 -0
  806. package/src/direct-answer.ts +273 -0
  807. package/src/embedding-fallback.ts +565 -0
  808. package/src/enrichment/audit.ts +89 -0
  809. package/src/enrichment/index.ts +27 -0
  810. package/src/enrichment/pipeline.ts +197 -0
  811. package/src/enrichment/provider-registry.ts +85 -0
  812. package/src/enrichment/types.ts +100 -0
  813. package/src/enrichment/web-search-provider.ts +63 -0
  814. package/src/entity-retrieval.ts +774 -0
  815. package/src/entity-schema.ts +239 -0
  816. package/src/evals.ts +1312 -0
  817. package/src/event-order-recall.test.ts +4164 -0
  818. package/src/event-order-recall.ts +2802 -0
  819. package/src/evidence-pack.test.ts +89 -0
  820. package/src/evidence-pack.ts +388 -0
  821. package/src/explicit-capture.ts +530 -0
  822. package/src/explicit-cue-recall.test.ts +3019 -0
  823. package/src/explicit-cue-recall.ts +5545 -0
  824. package/src/extraction-judge-telemetry.ts +234 -0
  825. package/src/extraction-judge-training.ts +221 -0
  826. package/src/extraction-judge.ts +846 -0
  827. package/src/extraction-timeout.test.ts +265 -0
  828. package/src/extraction.ts +2719 -0
  829. package/src/fallback-llm.test.ts +1060 -0
  830. package/src/fallback-llm.ts +918 -0
  831. package/src/focused-list-recall.test.ts +734 -0
  832. package/src/focused-list-recall.ts +1160 -0
  833. package/src/graph-dashboard-diff.ts +35 -0
  834. package/src/graph-dashboard-key.ts +5 -0
  835. package/src/graph-dashboard-parser.ts +104 -0
  836. package/src/graph-edge-reinforcement.ts +192 -0
  837. package/src/graph-events.ts +151 -0
  838. package/src/graph-recall.test.ts +164 -0
  839. package/src/graph-recall.ts +189 -0
  840. package/src/graph-retrieval.test.ts +809 -0
  841. package/src/graph-retrieval.ts +823 -0
  842. package/src/graph-snapshot.ts +329 -0
  843. package/src/graph.ts +813 -0
  844. package/src/harmonic-retrieval.ts +223 -0
  845. package/src/himem.ts +154 -0
  846. package/src/hygiene.ts +87 -0
  847. package/src/identity-continuity.ts +333 -0
  848. package/src/importance.ts +328 -0
  849. package/src/importers/base.test.ts +294 -0
  850. package/src/importers/base.ts +436 -0
  851. package/src/importers/index.ts +21 -0
  852. package/src/index.ts +1204 -0
  853. package/src/intent.ts +154 -0
  854. package/src/json-extract.ts +85 -0
  855. package/src/json-store.ts +42 -0
  856. package/src/lcm/archive.ts +617 -0
  857. package/src/lcm/dag.ts +199 -0
  858. package/src/lcm/engine.ts +645 -0
  859. package/src/lcm/index.ts +7 -0
  860. package/src/lcm/queue.test.ts +178 -0
  861. package/src/lcm/queue.ts +200 -0
  862. package/src/lcm/recall.ts +117 -0
  863. package/src/lcm/schema.ts +154 -0
  864. package/src/lcm/summarizer.ts +235 -0
  865. package/src/lcm/tools.ts +191 -0
  866. package/src/lcm-engine.test.ts +660 -0
  867. package/src/legacy-hook-compat.test.ts +20 -0
  868. package/src/legacy-hook-compat.ts +45 -0
  869. package/src/lifecycle.ts +289 -0
  870. package/src/live-connectors-runner.ts +385 -0
  871. package/src/local-llm-qos.test.ts +303 -0
  872. package/src/local-llm-thinking.test.ts +292 -0
  873. package/src/local-llm.ts +1464 -0
  874. package/src/logger.ts +49 -0
  875. package/src/maintenance/archive-observations.ts +147 -0
  876. package/src/maintenance/backup-stamp.ts +3 -0
  877. package/src/maintenance/dreams-ledger.ts +516 -0
  878. package/src/maintenance/first-start-migration.ts +362 -0
  879. package/src/maintenance/forget.test.ts +206 -0
  880. package/src/maintenance/forget.ts +126 -0
  881. package/src/maintenance/graph-edge-decay.test.ts +409 -0
  882. package/src/maintenance/graph-edge-decay.ts +394 -0
  883. package/src/maintenance/memory-governance-cron.ts +447 -0
  884. package/src/maintenance/memory-governance.ts +1039 -0
  885. package/src/maintenance/migrate-observations.ts +216 -0
  886. package/src/maintenance/observation-ledger-utils.ts +54 -0
  887. package/src/maintenance/pattern-reinforcement.test.ts +875 -0
  888. package/src/maintenance/pattern-reinforcement.ts +369 -0
  889. package/src/maintenance/purge.ts +334 -0
  890. package/src/maintenance/rebuild-memory-lifecycle-ledger.ts +78 -0
  891. package/src/maintenance/rebuild-memory-projection.ts +1234 -0
  892. package/src/maintenance/rebuild-observations.ts +178 -0
  893. package/src/maintenance/tier-stats.test.ts +378 -0
  894. package/src/maintenance/tier-stats.ts +222 -0
  895. package/src/mcp-memory-inspector-app.ts +421 -0
  896. package/src/memory-action-policy.ts +80 -0
  897. package/src/memory-cache.ts +208 -0
  898. package/src/memory-extension/claude-code-publisher.ts +51 -0
  899. package/src/memory-extension/codex-publisher.ts +149 -0
  900. package/src/memory-extension/hermes-publisher.ts +51 -0
  901. package/src/memory-extension/index.ts +100 -0
  902. package/src/memory-extension/shared-instructions.ts +133 -0
  903. package/src/memory-extension/types.ts +86 -0
  904. package/src/memory-extension-host/host-discovery.ts +276 -0
  905. package/src/memory-extension-host/index.ts +14 -0
  906. package/src/memory-extension-host/render-extensions-block.ts +73 -0
  907. package/src/memory-extension-host/types.ts +21 -0
  908. package/src/memory-lifecycle-ledger-utils.ts +116 -0
  909. package/src/memory-projection-format.ts +11 -0
  910. package/src/memory-projection-store.ts +951 -0
  911. package/src/memory-provenance.test.ts +196 -0
  912. package/src/memory-provenance.ts +484 -0
  913. package/src/memory-worth-bench.test.ts +71 -0
  914. package/src/memory-worth-bench.ts +265 -0
  915. package/src/memory-worth-filter.test.ts +209 -0
  916. package/src/memory-worth-filter.ts +204 -0
  917. package/src/memory-worth-frontmatter.test.ts +311 -0
  918. package/src/memory-worth-outcomes.test.ts +316 -0
  919. package/src/memory-worth-outcomes.ts +286 -0
  920. package/src/memory-worth.test.ts +317 -0
  921. package/src/memory-worth.ts +215 -0
  922. package/src/message-parts/index.ts +806 -0
  923. package/src/message-parts/message-parts.test.ts +421 -0
  924. package/src/migrate/from-engram.ts +789 -0
  925. package/src/model-registry.ts +313 -0
  926. package/src/models-json.ts +76 -0
  927. package/src/namespaces/migrate.ts +187 -0
  928. package/src/namespaces/path.ts +25 -0
  929. package/src/namespaces/principal.test.ts +195 -0
  930. package/src/namespaces/principal.ts +86 -0
  931. package/src/namespaces/search.test.ts +105 -0
  932. package/src/namespaces/search.ts +233 -0
  933. package/src/namespaces/storage.ts +74 -0
  934. package/src/native-knowledge.ts +1823 -0
  935. package/src/negative.ts +72 -0
  936. package/src/network/tailscale.ts +179 -0
  937. package/src/network/webdav.ts +385 -0
  938. package/src/objective-state-writers.ts +951 -0
  939. package/src/objective-state.ts +320 -0
  940. package/src/onboarding/index.ts +529 -0
  941. package/src/openai-chat-compat.ts +56 -0
  942. package/src/operator-toolkit.ts +2132 -0
  943. package/src/opik-exporter.test.ts +72 -0
  944. package/src/opik-exporter.ts +587 -0
  945. package/src/orchestrator-extraction-queue.test.ts +197 -0
  946. package/src/orchestrator-flush.test.ts +1171 -0
  947. package/src/orchestrator-pattern-reinforcement.test.ts +128 -0
  948. package/src/orchestrator-source-attribution.test.ts +701 -0
  949. package/src/orchestrator.ts +16368 -0
  950. package/src/page-versioning.ts +450 -0
  951. package/src/patterns-cli.ts +574 -0
  952. package/src/peers/index.ts +54 -0
  953. package/src/peers/migrate-from-identity-anchor.test.ts +291 -0
  954. package/src/peers/migrate-from-identity-anchor.ts +350 -0
  955. package/src/peers/peers.test.ts +419 -0
  956. package/src/peers/profile-reasoner.ts +694 -0
  957. package/src/peers/storage.ts +1350 -0
  958. package/src/peers/types.ts +138 -0
  959. package/src/plugin-id.ts +84 -0
  960. package/src/policy-runtime.ts +209 -0
  961. package/src/procedural/procedure-miner.ts +150 -0
  962. package/src/procedural/procedure-recall.ts +93 -0
  963. package/src/procedural/procedure-stats.ts +213 -0
  964. package/src/procedural/procedure-types.ts +132 -0
  965. package/src/procedural/reinforcement-core.test.ts +132 -0
  966. package/src/procedural/reinforcement-core.ts +73 -0
  967. package/src/profiling.test.ts +263 -0
  968. package/src/profiling.ts +435 -0
  969. package/src/projection/index.ts +398 -0
  970. package/src/qmd-recall-cache.test.ts +138 -0
  971. package/src/qmd-recall-cache.ts +111 -0
  972. package/src/qmd.test.ts +257 -0
  973. package/src/qmd.ts +2614 -0
  974. package/src/reasoning-trace-recall.ts +201 -0
  975. package/src/reasoning-trace-types.ts +235 -0
  976. package/src/recall-audit-anomaly.test.ts +246 -0
  977. package/src/recall-audit-anomaly.ts +297 -0
  978. package/src/recall-audit.test.ts +51 -0
  979. package/src/recall-audit.ts +72 -0
  980. package/src/recall-budget-config.test.ts +87 -0
  981. package/src/recall-disclosure-escalation.test.ts +196 -0
  982. package/src/recall-disclosure-escalation.ts +158 -0
  983. package/src/recall-disclosure-shaping.test.ts +146 -0
  984. package/src/recall-disclosure.test.ts +214 -0
  985. package/src/recall-explain-renderer.test.ts +140 -0
  986. package/src/recall-explain-renderer.ts +356 -0
  987. package/src/recall-mmr.test.ts +808 -0
  988. package/src/recall-mmr.ts +607 -0
  989. package/src/recall-qos.test.ts +85 -0
  990. package/src/recall-qos.ts +82 -0
  991. package/src/recall-query-policy.ts +221 -0
  992. package/src/recall-state.test.ts +233 -0
  993. package/src/recall-state.ts +456 -0
  994. package/src/recall-tag-filter.ts +143 -0
  995. package/src/recall-tokenization.ts +35 -0
  996. package/src/recall-xray-cli.test.ts +118 -0
  997. package/src/recall-xray-cli.ts +100 -0
  998. package/src/recall-xray-disclosure-telemetry.test.ts +183 -0
  999. package/src/recall-xray-renderer.test.ts +539 -0
  1000. package/src/recall-xray-renderer.ts +487 -0
  1001. package/src/recall-xray.test.ts +503 -0
  1002. package/src/recall-xray.ts +621 -0
  1003. package/src/reconstruct.ts +41 -0
  1004. package/src/release-changelog.ts +35 -0
  1005. package/src/relevance.ts +67 -0
  1006. package/src/replay/normalizers/chatgpt.ts +133 -0
  1007. package/src/replay/normalizers/claude.ts +102 -0
  1008. package/src/replay/normalizers/openclaw.ts +119 -0
  1009. package/src/replay/normalizers/shared.ts +69 -0
  1010. package/src/replay/runner.ts +197 -0
  1011. package/src/replay/types.ts +143 -0
  1012. package/src/rerank.test.ts +48 -0
  1013. package/src/rerank.ts +176 -0
  1014. package/src/resolve-auth-token.test.ts +226 -0
  1015. package/src/resolve-auth-token.ts +151 -0
  1016. package/src/resolve-provider-secret.test.ts +187 -0
  1017. package/src/resolve-provider-secret.ts +410 -0
  1018. package/src/response-guidance-recall.test.ts +3952 -0
  1019. package/src/response-guidance-recall.ts +4431 -0
  1020. package/src/resume-bundles.ts +415 -0
  1021. package/src/retrieval-agents.ts +623 -0
  1022. package/src/retrieval-tiers.ts +25 -0
  1023. package/src/retrieval.ts +104 -0
  1024. package/src/review/index.test.ts +201 -0
  1025. package/src/review/index.ts +536 -0
  1026. package/src/routing/engine.ts +162 -0
  1027. package/src/routing/store.ts +321 -0
  1028. package/src/runtime/better-sqlite.test.ts +32 -0
  1029. package/src/runtime/better-sqlite.ts +76 -0
  1030. package/src/runtime/child-process.ts +67 -0
  1031. package/src/runtime/env.ts +48 -0
  1032. package/src/sanitize.ts +58 -0
  1033. package/src/schemas.ts +449 -0
  1034. package/src/sdk-compat.ts +87 -0
  1035. package/src/search/document-scanner.ts +96 -0
  1036. package/src/search/embed-helper.ts +142 -0
  1037. package/src/search/factory.ts +189 -0
  1038. package/src/search/index.ts +10 -0
  1039. package/src/search/lancedb-backend.ts +342 -0
  1040. package/src/search/meilisearch-backend.ts +232 -0
  1041. package/src/search/noop-backend.ts +57 -0
  1042. package/src/search/orama-backend.ts +358 -0
  1043. package/src/search/port.ts +86 -0
  1044. package/src/search/remote-backend.ts +124 -0
  1045. package/src/secure-store/cipher.ts +271 -0
  1046. package/src/secure-store/cli-handlers.ts +355 -0
  1047. package/src/secure-store/cli-renderer.ts +131 -0
  1048. package/src/secure-store/header.ts +373 -0
  1049. package/src/secure-store/index.ts +137 -0
  1050. package/src/secure-store/kdf.ts +263 -0
  1051. package/src/secure-store/keyring.ts +106 -0
  1052. package/src/secure-store/metadata.ts +394 -0
  1053. package/src/secure-store/passphrase-reader.ts +252 -0
  1054. package/src/secure-store/secure-fs.ts +571 -0
  1055. package/src/secure-store/secure-store.test.ts +755 -0
  1056. package/src/semantic-chunking.ts +545 -0
  1057. package/src/semantic-consolidation.test.ts +182 -0
  1058. package/src/semantic-consolidation.ts +432 -0
  1059. package/src/semantic-rule-promotion.ts +183 -0
  1060. package/src/semantic-rule-verifier.ts +160 -0
  1061. package/src/session-integrity.ts +569 -0
  1062. package/src/session-observer-bands.ts +11 -0
  1063. package/src/session-observer-state.ts +346 -0
  1064. package/src/session-toggles.test.ts +96 -0
  1065. package/src/session-toggles.ts +159 -0
  1066. package/src/shared-context/manager.ts +810 -0
  1067. package/src/signal.ts +84 -0
  1068. package/src/skills-registry.test.ts +277 -0
  1069. package/src/skills-registry.ts +120 -0
  1070. package/src/source-attribution-roundtrip.test.ts +215 -0
  1071. package/src/source-attribution.test.ts +1425 -0
  1072. package/src/source-attribution.ts +639 -0
  1073. package/src/spaces/index.ts +627 -0
  1074. package/src/storage-paths.ts +117 -0
  1075. package/src/storage.ts +6657 -0
  1076. package/src/store-contract.ts +55 -0
  1077. package/src/summarizer.ts +844 -0
  1078. package/src/summary-snapshot.test.ts +681 -0
  1079. package/src/summary-snapshot.ts +238 -0
  1080. package/src/surfaces/dreams.test.ts +394 -0
  1081. package/src/surfaces/dreams.ts +346 -0
  1082. package/src/surfaces/heartbeat.test.ts +415 -0
  1083. package/src/surfaces/heartbeat.ts +325 -0
  1084. package/src/sync/index.ts +308 -0
  1085. package/src/targeted-fact-recall.test.ts +1694 -0
  1086. package/src/targeted-fact-recall.ts +2905 -0
  1087. package/src/taxonomy/default-taxonomy.ts +87 -0
  1088. package/src/taxonomy/index.ts +26 -0
  1089. package/src/taxonomy/resolver-doc-generator.ts +57 -0
  1090. package/src/taxonomy/resolver.ts +184 -0
  1091. package/src/taxonomy/taxonomy-loader.ts +186 -0
  1092. package/src/taxonomy/types.ts +48 -0
  1093. package/src/telemetry-transcript.ts +70 -0
  1094. package/src/temporal-index.ts +890 -0
  1095. package/src/temporal-supersession.test.ts +2703 -0
  1096. package/src/temporal-supersession.ts +493 -0
  1097. package/src/temporal-validity.test.ts +448 -0
  1098. package/src/temporal-validity.ts +123 -0
  1099. package/src/threading.ts +395 -0
  1100. package/src/tier-migration.ts +124 -0
  1101. package/src/tier-routing.ts +102 -0
  1102. package/src/tmt.ts +462 -0
  1103. package/src/tokens.test.ts +178 -0
  1104. package/src/tokens.ts +279 -0
  1105. package/src/topics.ts +147 -0
  1106. package/src/training-export/cli-date-validation.test.ts +258 -0
  1107. package/src/training-export/converter.test.ts +452 -0
  1108. package/src/training-export/converter.ts +319 -0
  1109. package/src/training-export/date-parse.ts +117 -0
  1110. package/src/training-export/index.ts +26 -0
  1111. package/src/training-export/registry.test.ts +85 -0
  1112. package/src/training-export/registry.ts +57 -0
  1113. package/src/training-export/types.ts +31 -0
  1114. package/src/transcript.ts +1179 -0
  1115. package/src/transfer/autodetect.ts +30 -0
  1116. package/src/transfer/backup.ts +138 -0
  1117. package/src/transfer/capsule-crypto.ts +485 -0
  1118. package/src/transfer/capsule-encrypt.test.ts +690 -0
  1119. package/src/transfer/capsule-export.ts +543 -0
  1120. package/src/transfer/capsule-fork.ts +375 -0
  1121. package/src/transfer/capsule-import.ts +564 -0
  1122. package/src/transfer/capsule-merge.ts +433 -0
  1123. package/src/transfer/conflict-policy.ts +16 -0
  1124. package/src/transfer/constants.ts +13 -0
  1125. package/src/transfer/exclusions.ts +37 -0
  1126. package/src/transfer/export-json.ts +65 -0
  1127. package/src/transfer/export-md.ts +59 -0
  1128. package/src/transfer/export-sqlite.ts +52 -0
  1129. package/src/transfer/fs-utils.ts +269 -0
  1130. package/src/transfer/import-json.ts +108 -0
  1131. package/src/transfer/import-md.ts +84 -0
  1132. package/src/transfer/import-sqlite.ts +100 -0
  1133. package/src/transfer/integrity.ts +71 -0
  1134. package/src/transfer/sqlite-schema.ts +16 -0
  1135. package/src/transfer/types.ts +297 -0
  1136. package/src/trust-zones.ts +1186 -0
  1137. package/src/types.ts +3074 -0
  1138. package/src/user-model.test.ts +124 -0
  1139. package/src/user-model.ts +162 -0
  1140. package/src/utility-learner.ts +353 -0
  1141. package/src/utility-runtime.ts +88 -0
  1142. package/src/utility-telemetry.ts +215 -0
  1143. package/src/utils/category-dir.ts +44 -0
  1144. package/src/utils/errno.ts +6 -0
  1145. package/src/utils/iso-timestamp.test.ts +37 -0
  1146. package/src/utils/iso-timestamp.ts +164 -0
  1147. package/src/utils/path.ts +26 -0
  1148. package/src/verified-recall.ts +138 -0
  1149. package/src/version-utils.test.ts +10 -0
  1150. package/src/version-utils.ts +9 -0
  1151. package/src/whitespace.ts +10 -0
  1152. package/src/work/board.ts +359 -0
  1153. package/src/work/boundary.ts +107 -0
  1154. package/src/work/storage.ts +436 -0
  1155. package/src/work/types.ts +82 -0
  1156. package/src/work-product-ledger.ts +265 -0
  1157. package/dist/access-service-DDjzFALq.d.ts +0 -2088
  1158. package/dist/capsule-crypto-SJS5VVAP.js +0 -18
  1159. package/dist/capsule-export-7QNCBZOQ.js +0 -17
  1160. package/dist/capsule-import-EPBHD2EN.js +0 -16
  1161. package/dist/capsule-merge-DI7PNQ2H.js +0 -189
  1162. package/dist/chunk-23ZZK64Y.js +0 -26
  1163. package/dist/chunk-23ZZK64Y.js.map +0 -1
  1164. package/dist/chunk-242S3I2A.js +0 -647
  1165. package/dist/chunk-2LGMW3DJ.js +0 -111
  1166. package/dist/chunk-3B6KIRBH.js +0 -5213
  1167. package/dist/chunk-3B6KIRBH.js.map +0 -1
  1168. package/dist/chunk-457A4P3L.js +0 -119
  1169. package/dist/chunk-457A4P3L.js.map +0 -1
  1170. package/dist/chunk-4IS4SXIQ.js +0 -2040
  1171. package/dist/chunk-4YM32CRU.js +0 -721
  1172. package/dist/chunk-6TBWYBJ3.js +0 -236
  1173. package/dist/chunk-74EMIVE4.js +0 -329
  1174. package/dist/chunk-74EMIVE4.js.map +0 -1
  1175. package/dist/chunk-767ODGE6.js +0 -183
  1176. package/dist/chunk-7V22HTMD.js +0 -623
  1177. package/dist/chunk-7V22HTMD.js.map +0 -1
  1178. package/dist/chunk-7ZM3BFKK.js +0 -9705
  1179. package/dist/chunk-7ZM3BFKK.js.map +0 -1
  1180. package/dist/chunk-AQJNPMOA.js +0 -643
  1181. package/dist/chunk-AQJNPMOA.js.map +0 -1
  1182. package/dist/chunk-ASAITVLA.js +0 -64
  1183. package/dist/chunk-ASAITVLA.js.map +0 -1
  1184. package/dist/chunk-BBE34QBJ.js +0 -275
  1185. package/dist/chunk-BBE34QBJ.js.map +0 -1
  1186. package/dist/chunk-BZSQEPRW.js +0 -14710
  1187. package/dist/chunk-BZSQEPRW.js.map +0 -1
  1188. package/dist/chunk-CPKTBRS2.js +0 -891
  1189. package/dist/chunk-CPKTBRS2.js.map +0 -1
  1190. package/dist/chunk-D4GAOFF6.js +0 -562
  1191. package/dist/chunk-D4GAOFF6.js.map +0 -1
  1192. package/dist/chunk-D54LZC5L.js +0 -147
  1193. package/dist/chunk-DF3RVK3X.js +0 -119
  1194. package/dist/chunk-DF3RVK3X.js.map +0 -1
  1195. package/dist/chunk-DZZPC36E.js +0 -1451
  1196. package/dist/chunk-DZZPC36E.js.map +0 -1
  1197. package/dist/chunk-E2UCDP5S.js +0 -570
  1198. package/dist/chunk-E6K4NIEU.js +0 -747
  1199. package/dist/chunk-E6K4NIEU.js.map +0 -1
  1200. package/dist/chunk-EEQLFRUM.js +0 -89
  1201. package/dist/chunk-ETOW6ACV.js +0 -158
  1202. package/dist/chunk-ETOW6ACV.js.map +0 -1
  1203. package/dist/chunk-FMEBPEAO.js +0 -347
  1204. package/dist/chunk-FMEBPEAO.js.map +0 -1
  1205. package/dist/chunk-FQDPCE3I.js +0 -1837
  1206. package/dist/chunk-FQDPCE3I.js.map +0 -1
  1207. package/dist/chunk-FYIYMQ5N.js +0 -221
  1208. package/dist/chunk-FYIYMQ5N.js.map +0 -1
  1209. package/dist/chunk-G2WADRQ3.js +0 -219
  1210. package/dist/chunk-G4SK7DSQ.js +0 -121
  1211. package/dist/chunk-GVPWB7EY.js +0 -390
  1212. package/dist/chunk-GVPWB7EY.js.map +0 -1
  1213. package/dist/chunk-HELQZFZO.js +0 -1075
  1214. package/dist/chunk-HL5LRPNA.js +0 -1914
  1215. package/dist/chunk-HL5LRPNA.js.map +0 -1
  1216. package/dist/chunk-HQZVVSVB.js +0 -147
  1217. package/dist/chunk-HQZVVSVB.js.map +0 -1
  1218. package/dist/chunk-HY3L4WKC.js +0 -2195
  1219. package/dist/chunk-HY3L4WKC.js.map +0 -1
  1220. package/dist/chunk-IB3BFHGN.js +0 -228
  1221. package/dist/chunk-IXEJRKCZ.js +0 -18
  1222. package/dist/chunk-JBMSGZEQ.js +0 -441
  1223. package/dist/chunk-JBMSGZEQ.js.map +0 -1
  1224. package/dist/chunk-JESOB2HO.js +0 -108
  1225. package/dist/chunk-JKDVIE52.js +0 -272
  1226. package/dist/chunk-JRNQ3RNA.js +0 -284
  1227. package/dist/chunk-JRNQ3RNA.js.map +0 -1
  1228. package/dist/chunk-K6WK37A6.js +0 -865
  1229. package/dist/chunk-K6WK37A6.js.map +0 -1
  1230. package/dist/chunk-MARWOCVP.js +0 -48
  1231. package/dist/chunk-MNU6ZBWT.js +0 -4454
  1232. package/dist/chunk-MNU6ZBWT.js.map +0 -1
  1233. package/dist/chunk-N5AKDXAI.js +0 -74
  1234. package/dist/chunk-OA3L7BFR.js +0 -183
  1235. package/dist/chunk-OA3L7BFR.js.map +0 -1
  1236. package/dist/chunk-OR64ZGRZ.js +0 -23
  1237. package/dist/chunk-P77UEOU2.js +0 -1521
  1238. package/dist/chunk-P77UEOU2.js.map +0 -1
  1239. package/dist/chunk-PH4C2U43.js +0 -239
  1240. package/dist/chunk-PH4C2U43.js.map +0 -1
  1241. package/dist/chunk-RVPLBATS.js +0 -1586
  1242. package/dist/chunk-RVPLBATS.js.map +0 -1
  1243. package/dist/chunk-U5JMRGKX.js +0 -340
  1244. package/dist/chunk-U5JMRGKX.js.map +0 -1
  1245. package/dist/chunk-URB2WSKZ.js +0 -350
  1246. package/dist/chunk-URB2WSKZ.js.map +0 -1
  1247. package/dist/chunk-UVMUAWVT.js +0 -596
  1248. package/dist/chunk-WEJG4TB5.js +0 -118
  1249. package/dist/chunk-X7HPGUVG.js +0 -271
  1250. package/dist/chunk-XAMBKFQS.js +0 -2777
  1251. package/dist/chunk-XAMBKFQS.js.map +0 -1
  1252. package/dist/chunk-XJKFSSDW.js +0 -726
  1253. package/dist/chunk-XJKFSSDW.js.map +0 -1
  1254. package/dist/chunk-XMHBH5H6.js +0 -283
  1255. package/dist/chunk-XMHBH5H6.js.map +0 -1
  1256. package/dist/chunk-XMVFHBHT.js +0 -277
  1257. package/dist/chunk-Y3VMVTYX.js +0 -53
  1258. package/dist/chunk-YNB73F22.js +0 -137
  1259. package/dist/chunk-YNB73F22.js.map +0 -1
  1260. package/dist/chunk-Z2E7VW55.js +0 -335
  1261. package/dist/chunk-Z2E7VW55.js.map +0 -1
  1262. package/dist/chunk-ZG7PTKBK.js +0 -2296
  1263. package/dist/chunk-ZNQN6ZTA.js +0 -135
  1264. package/dist/chunk-ZVTKDVVM.js +0 -827
  1265. package/dist/chunk-ZVTKDVVM.js.map +0 -1
  1266. package/dist/cli-BR8KpIU0.d.ts +0 -1259
  1267. package/dist/codex-materialize-CQlLTzke.d.ts +0 -139
  1268. package/dist/connectors-cli-DFGtY2DB.d.ts +0 -257
  1269. package/dist/contradiction-review-5LTTVDQV.js +0 -22
  1270. package/dist/contradiction-scan-QTXAMBUA.js +0 -414
  1271. package/dist/contradiction-scan-QTXAMBUA.js.map +0 -1
  1272. package/dist/engine-35M5BKQ7.js +0 -28
  1273. package/dist/fs-utils-IRVUFB6G.js +0 -30
  1274. package/dist/graph-edge-decay-PWB63GRE.js +0 -207
  1275. package/dist/memory-governance-IMPQZXFC.js +0 -37
  1276. package/dist/memory-projection-store-CY8TU40w.d.ts +0 -222
  1277. package/dist/orchestrator-DDMPqU6R.d.ts +0 -1792
  1278. package/dist/path-RMTY5Y5A.js +0 -9
  1279. package/dist/port-B6VEDIkC.d.ts +0 -53
  1280. package/dist/resolution-YGIBORXI.js +0 -101
  1281. package/dist/resolution-YGIBORXI.js.map +0 -1
  1282. package/dist/secure-store-4R2GSO7S.js +0 -156
  1283. package/dist/semantic-consolidation-ByBXb-sf.d.ts +0 -180
  1284. package/dist/state-store-3EH7HYIN.js +0 -16
  1285. package/dist/types-V3FJ26TF.js +0 -30
  1286. /package/dist/{capsule-crypto-SJS5VVAP.js.map → adapters/claude-code.js.map} +0 -0
  1287. /package/dist/{capsule-export-7QNCBZOQ.js.map → adapters/codex.js.map} +0 -0
  1288. /package/dist/{capsule-import-EPBHD2EN.js.map → adapters/hermes.js.map} +0 -0
  1289. /package/dist/{contradiction-review-5LTTVDQV.js.map → adapters/index.js.map} +0 -0
  1290. /package/dist/{engine-35M5BKQ7.js.map → adapters/registry.js.map} +0 -0
  1291. /package/dist/{fs-utils-IRVUFB6G.js.map → adapters/replit.js.map} +0 -0
  1292. /package/dist/{memory-governance-IMPQZXFC.js.map → adapters/types.js.map} +0 -0
  1293. /package/dist/{path-RMTY5Y5A.js.map → capsule-crypto-5CYAGVC5.js.map} +0 -0
  1294. /package/dist/{capsule-merge-DI7PNQ2H.js.map → capsule-merge-4MGKE7C5.js.map} +0 -0
  1295. /package/dist/{chunk-G4SK7DSQ.js.map → chunk-2WWLHTZY.js.map} +0 -0
  1296. /package/dist/{chunk-X7HPGUVG.js.map → chunk-4CRG46BG.js.map} +0 -0
  1297. /package/dist/{chunk-UVMUAWVT.js.map → chunk-7IASACLB.js.map} +0 -0
  1298. /package/dist/{chunk-HELQZFZO.js.map → chunk-EDTHC6UD.js.map} +0 -0
  1299. /package/dist/{chunk-4YM32CRU.js.map → chunk-EFJ3MQ4V.js.map} +0 -0
  1300. /package/dist/{chunk-E2UCDP5S.js.map → chunk-FBYESMQ2.js.map} +0 -0
  1301. /package/dist/{chunk-D54LZC5L.js.map → chunk-FDU6HUUL.js.map} +0 -0
  1302. /package/dist/{chunk-IB3BFHGN.js.map → chunk-GGKRUQOO.js.map} +0 -0
  1303. /package/dist/{chunk-242S3I2A.js.map → chunk-GL6I6MEQ.js.map} +0 -0
  1304. /package/dist/{secure-store-4R2GSO7S.js.map → chunk-HHLLAQGZ.js.map} +0 -0
  1305. /package/dist/{chunk-4IS4SXIQ.js.map → chunk-HXXBL2KD.js.map} +0 -0
  1306. /package/dist/{chunk-767ODGE6.js.map → chunk-KNKUID7G.js.map} +0 -0
  1307. /package/dist/{chunk-6TBWYBJ3.js.map → chunk-LPMVBPA3.js.map} +0 -0
  1308. /package/dist/{chunk-WEJG4TB5.js.map → chunk-MC26UJIM.js.map} +0 -0
  1309. /package/dist/{chunk-JKDVIE52.js.map → chunk-MGKYQQYF.js.map} +0 -0
  1310. /package/dist/{chunk-Y3VMVTYX.js.map → chunk-MT4HVDUZ.js.map} +0 -0
  1311. /package/dist/{chunk-G2WADRQ3.js.map → chunk-MY6TPVXW.js.map} +0 -0
  1312. /package/dist/{chunk-OR64ZGRZ.js.map → chunk-NNVTUXEB.js.map} +0 -0
  1313. /package/dist/{chunk-JESOB2HO.js.map → chunk-P4NEIHUT.js.map} +0 -0
  1314. /package/dist/{chunk-IXEJRKCZ.js.map → chunk-QRNI5JBH.js.map} +0 -0
  1315. /package/dist/{chunk-EEQLFRUM.js.map → chunk-RRF5UOBJ.js.map} +0 -0
  1316. /package/dist/{state-store-3EH7HYIN.js.map → chunk-SEDEKFYQ.js.map} +0 -0
  1317. /package/dist/{chunk-2LGMW3DJ.js.map → chunk-U3PN77QT.js.map} +0 -0
  1318. /package/dist/{chunk-XMVFHBHT.js.map → chunk-U3WSW6PZ.js.map} +0 -0
  1319. /package/dist/{chunk-N5AKDXAI.js.map → chunk-UWVJF25J.js.map} +0 -0
  1320. /package/dist/{types-V3FJ26TF.js.map → chunk-V5OCT34X.js.map} +0 -0
  1321. /package/dist/{chunk-ZG7PTKBK.js.map → chunk-W3LR522O.js.map} +0 -0
  1322. /package/dist/{chunk-MARWOCVP.js.map → chunk-XIG5PDM7.js.map} +0 -0
  1323. /package/dist/{chunk-ZNQN6ZTA.js.map → chunk-XVZ7B3HG.js.map} +0 -0
  1324. /package/dist/{graph-edge-decay-PWB63GRE.js.map → graph-edge-decay-5DI5GUNL.js.map} +0 -0
package/src/types.ts ADDED
@@ -0,0 +1,3074 @@
1
+ export type ReasoningEffort = "none" | "low" | "medium" | "high";
2
+ export type TriggerMode = "smart" | "every_n" | "time_based";
3
+ export type SignalLevel = "none" | "low" | "medium" | "high";
4
+ export type MemoryCategory = "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
5
+ export type ConsolidationAction = "ADD" | "MERGE" | "UPDATE" | "INVALIDATE" | "SKIP";
6
+ export type ConfidenceTier = "explicit" | "implied" | "inferred" | "speculative";
7
+ export type PrincipalFromSessionKeyMode = "map" | "prefix" | "regex";
8
+ export type RecallPlanMode = "no_recall" | "minimal" | "full" | "graph_mode";
9
+ export type CronRecallMode = "all" | "none" | "allowlist";
10
+ export type CronConversationRecallMode = "auto" | "always" | "never";
11
+ export type IdentityInjectionMode = "recovery_only" | "minimal" | "full";
12
+ export type CaptureMode = "implicit" | "explicit" | "hybrid";
13
+ export type MemoryOsPresetName = "conservative" | "balanced" | "research-max" | "local-llm-heavy";
14
+ export type ExtractionPassSource = "base" | "proactive";
15
+ /**
16
+ * Scope classification for extracted facts (issue #XXX).
17
+ *
18
+ * - `"project"` — knowledge specific to one codebase: file paths, environment
19
+ * configs, deployment details, project-specific workarounds, team/stakeholder
20
+ * info tied to one project.
21
+ * - `"global"` — knowledge that applies across projects: core framework bugs,
22
+ * library behavior, API patterns, user preferences, tool configurations,
23
+ * general coding patterns, infrastructure knowledge.
24
+ *
25
+ * Default is `"project"` when a coding context is active, `"global"` when no
26
+ * coding context is present.
27
+ */
28
+ export type MemoryScope = "project" | "global";
29
+ export type SlotMismatchMode = "error" | "warn" | "silent";
30
+ export type CodexCompactionFlushMode = "signal" | "heuristic" | "auto";
31
+ export type DreamingNarrativePromptStyle = "reflective" | "diary" | "analytical";
32
+ export type HeartbeatDetectionMode = "runtime-signal" | "heuristic" | "auto";
33
+ export type ActiveRecallQueryMode = "message" | "recent" | "full";
34
+ export type ActiveRecallPromptStyle =
35
+ | "balanced"
36
+ | "strict"
37
+ | "contextual"
38
+ | "recall-heavy"
39
+ | "precision-heavy"
40
+ | "preference-only";
41
+ export type ActiveRecallThinking =
42
+ | "off"
43
+ | "minimal"
44
+ | "low"
45
+ | "medium"
46
+ | "high"
47
+ | "xhigh"
48
+ | "adaptive";
49
+ export type ActiveRecallChatType = "direct" | "group" | "channel";
50
+ export type ActiveRecallModelFallbackPolicy = "default-remote" | "resolved-only";
51
+
52
+ /**
53
+ * Retrieval tier ladder (issue #518). Identifies which tier served a recall
54
+ * result. Ordered top-to-bottom by cost, but routing is not strictly
55
+ * sequential — callers may jump straight to a lower tier when eligibility
56
+ * does not hold.
57
+ */
58
+ export type RetrievalTier =
59
+ | "exact-cache"
60
+ | "fuzzy-cache"
61
+ | "direct-answer"
62
+ | "hybrid"
63
+ | "rerank-graph"
64
+ | "agentic";
65
+
66
+ /**
67
+ * Per-recall annotation describing which retrieval tier served a result,
68
+ * why that tier was chosen, and what was filtered along the way. Added as
69
+ * part of issue #518 (direct-answer tier + `query --explain`).
70
+ *
71
+ * Not to be confused with the existing `recallExplain` operation
72
+ * (graph-path explanation) — that is a user-invoked RPC; this is a
73
+ * per-result annotation that can be attached to any recall response.
74
+ */
75
+ export interface RecallTierExplain {
76
+ tier: RetrievalTier;
77
+ tierReason: string;
78
+ filteredBy: string[];
79
+ candidatesConsidered: number;
80
+ latencyMs: number;
81
+ sourceAnchors?: Array<{ path: string; lineRange?: [number, number] }>;
82
+ }
83
+
84
+ /**
85
+ * Recall disclosure depth (issue #677). Selects how much content each
86
+ * recall result returns:
87
+ *
88
+ * - `"chunk"` — semantic chunk excerpt (cheapest; default).
89
+ * - `"section"` — full markdown section / memory body (current pre-#677 behavior).
90
+ * - `"raw"` — raw transcript / archive excerpts from `lcm/` when present.
91
+ *
92
+ * Disclosure is **orthogonal** to the retrieval-tier ladder
93
+ * (`RetrievalTier` / `RETRIEVAL_TIERS`). The tier ladder controls *which
94
+ * pipeline stage served a result*; disclosure controls *how deep into the
95
+ * underlying memory the result reaches*. A request can mix any retrieval
96
+ * tier with any disclosure depth.
97
+ *
98
+ * Default is `"chunk"` when the caller omits the field; this preserves the
99
+ * existing recall behavior because callers that did not request a disclosure
100
+ * level continue to receive the same chunk-shaped previews they always had.
101
+ * Surfaces (CLI / HTTP / MCP) and downstream telemetry are wired in later
102
+ * PRs of #677.
103
+ */
104
+ export type RecallDisclosure = "chunk" | "section" | "raw";
105
+
106
+ /**
107
+ * Ordered list of disclosure levels, cheapest to most expensive. Used for
108
+ * validation, escalation policy comparisons, and future telemetry rollups.
109
+ * Treat this as the single source of truth — do not hard-code disclosure
110
+ * strings elsewhere.
111
+ */
112
+ export const RECALL_DISCLOSURE_LEVELS: readonly RecallDisclosure[] = [
113
+ "chunk",
114
+ "section",
115
+ "raw",
116
+ ] as const;
117
+
118
+ /**
119
+ * Default disclosure level when a caller omits `disclosure`. Set to `chunk`
120
+ * so callers that did not opt in to deeper disclosure see the same
121
+ * preview-shaped behavior as before #677.
122
+ */
123
+ export const DEFAULT_RECALL_DISCLOSURE: RecallDisclosure = "chunk";
124
+
125
+ export function isRecallDisclosure(value: unknown): value is RecallDisclosure {
126
+ return typeof value === "string"
127
+ && (RECALL_DISCLOSURE_LEVELS as readonly string[]).includes(value);
128
+ }
129
+
130
+ export interface RecallSectionConfig {
131
+ id: string;
132
+ enabled?: boolean;
133
+ maxChars?: number | null;
134
+ maxHints?: number;
135
+ maxSupportingFacts?: number;
136
+ maxRelatedEntities?: number;
137
+ consolidateTriggerLines?: number;
138
+ consolidateTargetLines?: number;
139
+ maxEntities?: number;
140
+ maxResults?: number;
141
+ recentTurns?: number;
142
+ maxTurns?: number;
143
+ maxTokens?: number;
144
+ lookbackHours?: number;
145
+ maxCount?: number;
146
+ topK?: number;
147
+ timeoutMs?: number;
148
+ maxPatterns?: number;
149
+ maxRubrics?: number;
150
+ forceGeneric?: boolean;
151
+ }
152
+
153
+ export interface RecallPipelineConfig {
154
+ recallBudgetChars: number;
155
+ pipeline: RecallSectionConfig[];
156
+ }
157
+
158
+ export interface SessionObserverBandConfig {
159
+ maxBytes: number;
160
+ triggerDeltaBytes: number;
161
+ triggerDeltaTokens: number;
162
+ }
163
+
164
+ export interface FileHygieneConfig {
165
+ enabled: boolean;
166
+ // Lint (warn before truncation risk)
167
+ lintEnabled: boolean;
168
+ lintBudgetBytes: number;
169
+ lintWarnRatio: number;
170
+ lintPaths: string[];
171
+ // Rotation/splitting
172
+ rotateEnabled: boolean;
173
+ rotateMaxBytes: number;
174
+ rotateKeepTailChars: number;
175
+ rotatePaths: string[];
176
+ archiveDir: string;
177
+ // Cadence
178
+ runMinIntervalMs: number;
179
+ // Optional warnings log (future-proofed)
180
+ warningsLogEnabled: boolean;
181
+ warningsLogPath: string;
182
+ // Optional index file (future-proofed)
183
+ indexEnabled: boolean;
184
+ indexPath: string;
185
+ }
186
+
187
+ export interface NativeKnowledgeConfig {
188
+ enabled: boolean;
189
+ includeFiles: string[];
190
+ maxChunkChars: number;
191
+ maxResults: number;
192
+ maxChars: number;
193
+ stateDir: string;
194
+ obsidianVaults: NativeKnowledgeObsidianVaultConfig[];
195
+ openclawWorkspace?: NativeKnowledgeOpenClawWorkspaceConfig;
196
+ }
197
+
198
+ export interface NativeKnowledgeFolderRuleConfig {
199
+ pathPrefix: string;
200
+ namespace?: string;
201
+ privacyClass?: string;
202
+ }
203
+
204
+ export interface NativeKnowledgeObsidianVaultConfig {
205
+ id: string;
206
+ rootDir: string;
207
+ includeGlobs: string[];
208
+ excludeGlobs: string[];
209
+ namespace?: string;
210
+ privacyClass?: string;
211
+ folderRules: NativeKnowledgeFolderRuleConfig[];
212
+ dailyNotePatterns: string[];
213
+ materializeBacklinks: boolean;
214
+ }
215
+
216
+ export interface NativeKnowledgeOpenClawWorkspaceConfig {
217
+ enabled: boolean;
218
+ bootstrapFiles: string[];
219
+ handoffGlobs: string[];
220
+ dailySummaryGlobs: string[];
221
+ automationNoteGlobs: string[];
222
+ workspaceDocGlobs: string[];
223
+ excludeGlobs: string[];
224
+ sharedSafeGlobs: string[];
225
+ }
226
+
227
+ /**
228
+ * OpenClaw SecretRef shape (issue #757).
229
+ *
230
+ * OpenClaw resolves these at runtime via its built-in secret resolver
231
+ * (e.g. exec providers like `kc_*` for macOS Keychain). Plugins receive
232
+ * the raw object in `pluginConfig` and must call the gateway's resolver
233
+ * before using the value. Standalone Remnic does NOT resolve SecretRefs;
234
+ * operators must use plain strings or `${ENV_VAR}` expansion instead.
235
+ */
236
+ export interface SecretRef {
237
+ source: string;
238
+ provider?: string;
239
+ id?: string;
240
+ command?: unknown;
241
+ [key: string]: unknown;
242
+ }
243
+
244
+ export type AgentAccessAuthToken = string | SecretRef;
245
+
246
+ export interface AgentAccessHttpConfig {
247
+ enabled: boolean;
248
+ host: string;
249
+ port: number;
250
+ /**
251
+ * Bearer token. Either a literal string (env-expanded) or an unresolved
252
+ * SecretRef object preserved verbatim from openclaw.json — resolved at
253
+ * service-start time via {@link resolveAgentAccessAuthToken}.
254
+ */
255
+ authToken?: AgentAccessAuthToken;
256
+ principal?: string;
257
+ maxBodyBytes: number;
258
+ }
259
+
260
+ export interface DreamingConfig {
261
+ enabled: boolean;
262
+ journalPath: string;
263
+ maxEntries: number;
264
+ injectRecentCount: number;
265
+ minIntervalMinutes: number;
266
+ narrativeModel: string | null;
267
+ narrativePromptStyle: DreamingNarrativePromptStyle;
268
+ watchFile: boolean;
269
+ }
270
+
271
+ /**
272
+ * Light-sleep phase config (issue #678 PR 2/4).
273
+ *
274
+ * Groups existing top-level lifecycle-policy gates under a unified namespace.
275
+ * When `dreams.phases.lightSleep.*` keys are set they WIN over the legacy
276
+ * top-level keys; the legacy keys remain readable for backward compatibility.
277
+ *
278
+ * Light sleep: recent activity scoring + clustering (tier-routing value score,
279
+ * observation ledger, buffer state — `runLifecyclePolicyPass` in orchestrator).
280
+ */
281
+ export interface DreamsLightSleepConfig {
282
+ /** Phase master switch. Mirrors `lifecyclePolicyEnabled` when not set explicitly. */
283
+ enabled: boolean;
284
+ /** Minimum interval between light-sleep passes in milliseconds. */
285
+ cadenceMs: number;
286
+ /** Value score above which a memory is treated as hot. Mirrors `lifecyclePromoteHeatThreshold`. */
287
+ promoteHeatThreshold: number;
288
+ /** Value score below which a memory starts to decay. Mirrors `lifecycleStaleDecayThreshold`. */
289
+ staleDecayThreshold: number;
290
+ /** Value score below which a memory is eligible for archive. Mirrors `lifecycleArchiveDecayThreshold`. */
291
+ archiveDecayThreshold: number;
292
+ /** Whether stale memories are filtered from recall. Mirrors `lifecycleFilterStaleEnabled`. */
293
+ filterStaleEnabled: boolean;
294
+ }
295
+
296
+ /**
297
+ * REM phase config (issue #678 PR 2/4).
298
+ *
299
+ * Groups existing top-level semantic-consolidation and supersession gates.
300
+ * When `dreams.phases.rem.*` keys are set they WIN over the legacy top-level
301
+ * keys.
302
+ *
303
+ * REM: cross-session synthesis, supersession resolution, semantic consolidation
304
+ * (`runSemanticConsolidation` in orchestrator).
305
+ */
306
+ export interface DreamsRemConfig {
307
+ /** Phase master switch. Mirrors `semanticConsolidationEnabled` when not set explicitly. */
308
+ enabled: boolean;
309
+ /**
310
+ * How often the REM pass runs, in milliseconds.
311
+ * Derived from `semanticConsolidationIntervalHours` (×3 600 000) when not set explicitly.
312
+ */
313
+ cadenceMs: number;
314
+ /** Cosine-similarity threshold for cluster membership. Mirrors `semanticConsolidationThreshold`. */
315
+ similarityThreshold: number;
316
+ /** Minimum cluster size before consolidation runs. Mirrors `semanticConsolidationMinClusterSize`. */
317
+ minClusterSize: number;
318
+ /** Max cluster operations per run. Mirrors `semanticConsolidationMaxPerRun`. */
319
+ maxPerRun: number;
320
+ /** Minimum gap between consolidation passes (ms). Mirrors `consolidationMinIntervalMs`. */
321
+ minIntervalMs: number;
322
+ }
323
+
324
+ /**
325
+ * Deep-sleep phase config (issue #678 PR 2/4).
326
+ *
327
+ * Groups existing versioning and tier-migration gates.
328
+ * When `dreams.phases.deepSleep.*` keys are set they WIN over the legacy
329
+ * top-level keys.
330
+ *
331
+ * Deep sleep: promotion to durable memory, hot→cold tier migration,
332
+ * page-version snapshots, archive (`engram-nightly-governance` cron,
333
+ * `tier-migration.ts`, `page-versioning.ts`, `hygiene.ts`).
334
+ */
335
+ export interface DreamsDeepSleepConfig {
336
+ /**
337
+ * Phase master switch. No single direct legacy mirror; defaults false unless
338
+ * an existing deep-sleep surface such as nightly governance auto-registration,
339
+ * tier migration, or page versioning is explicitly enabled. Set to `false`
340
+ * to disable those surfaces without removing legacy config keys.
341
+ */
342
+ enabled: boolean;
343
+ /** True only when dreams.phases.deepSleep.enabled was explicitly configured. */
344
+ enabledExplicitlySet?: boolean;
345
+ /**
346
+ * Minimum interval between deep-sleep passes in milliseconds.
347
+ * Informational only in PR 2; PR 4 will wire this into the cron scheduler.
348
+ */
349
+ cadenceMs: number;
350
+ /** Enable page-version snapshots on every overwrite. Mirrors `versioningEnabled`. */
351
+ versioningEnabled: boolean;
352
+ /** Max snapshots per page. Mirrors `versioningMaxPerPage`. */
353
+ versioningMaxPerPage: number;
354
+ }
355
+
356
+ /**
357
+ * Unified dreams phases config block (issue #678 PR 2/4).
358
+ *
359
+ * Operators set `dreams.phases.{lightSleep,rem,deepSleep}.*` in their plugin
360
+ * config. Values under this block WIN over the equivalent legacy top-level keys
361
+ * when both are set. Legacy keys continue to be parsed so existing configs do
362
+ * not need to change.
363
+ *
364
+ * This block is intentionally separate from `DreamingConfig` which controls the
365
+ * diary surface (`surfaces/dreams.ts`) — a different feature. See docs/dreams.md.
366
+ */
367
+ export interface DreamsPhasesConfig {
368
+ lightSleep: DreamsLightSleepConfig;
369
+ rem: DreamsRemConfig;
370
+ deepSleep: DreamsDeepSleepConfig;
371
+ }
372
+
373
+ /** Procedural memory (issue #519): mining + recall gates. All sub-features default off. */
374
+ export interface ProceduralConfig {
375
+ enabled: boolean;
376
+ /** Minimum cluster size before emitting a candidate; `0` disables mining (`minOccurrences_zero`). */
377
+ minOccurrences: number;
378
+ /** Minimum success rate from trajectory outcomes in [0, 1]. */
379
+ successFloor: number;
380
+ /** When auto-promotion is enabled, promote pending_review → active after this many occurrences. */
381
+ autoPromoteOccurrences: number;
382
+ autoPromoteEnabled: boolean;
383
+ lookbackDays: number;
384
+ /** When true, installer may register the nightly procedural mining cron (default off). */
385
+ proceduralMiningCronAutoRegister: boolean;
386
+ /** Max procedure memories to inject on task-initiation recall (1–10). */
387
+ recallMaxProcedures: number;
388
+ }
389
+
390
+ /**
391
+ * Coding-agent mode config (issue #569).
392
+ *
393
+ * When the connector provides a `CodingContext` (see below), Remnic overlays
394
+ * a project- and/or branch-scoped namespace on top of the principal's default
395
+ * namespace so that memories written while working on project A do not surface
396
+ * while working on project B.
397
+ *
398
+ * Both flags default off-for-branch / on-for-project. Per CLAUDE.md #30 every
399
+ * filter or transform needs an escape hatch: set `projectScope: false` to
400
+ * exactly restore pre-#569 behaviour.
401
+ */
402
+ export interface CodingModeConfig {
403
+ /**
404
+ * When true (default), a session with a resolved `CodingContext` uses a
405
+ * project-scoped namespace. When false, the principal's default namespace
406
+ * is used unchanged (pre-#569 behaviour).
407
+ */
408
+ projectScope: boolean;
409
+ /**
410
+ * When true, recall/write also overlay the current branch on top of the
411
+ * project namespace. Default false — branch-scope is opt-in because active
412
+ * development typically wants recall across branches. (Wired by PR 3 of
413
+ * issue #569; declared here so the schema ships in one slice.)
414
+ */
415
+ branchScope: boolean;
416
+ /**
417
+ * When true (default), project-scoped and branch-scoped sessions include
418
+ * the root/default namespace in their read fallbacks so globally useful
419
+ * memories remain visible from any project. When false, project-scoped
420
+ * sessions only see their own namespace (strict isolation).
421
+ *
422
+ * CLAUDE.md #30: configuration gate for the recall fan-out to the root
423
+ * namespace. Does not affect writes — those always go to the project
424
+ * namespace only.
425
+ */
426
+ globalFallback: boolean;
427
+ }
428
+
429
+ /**
430
+ * Session-scoped coding context. Produced by `resolveGitContext()` in the
431
+ * connector layer and attached to a session so that recall + write paths can
432
+ * compute an overlay namespace.
433
+ *
434
+ * All fields mirror `GitContext` from `./coding/git-context.ts`; kept as a
435
+ * separate interface because `types.ts` must stay dependency-free (it is
436
+ * imported by every other module).
437
+ */
438
+ export interface CodingContext {
439
+ projectId: string;
440
+ branch: string | null;
441
+ rootPath: string;
442
+ defaultBranch: string | null;
443
+ }
444
+
445
+ /** Configuration for the nightly contradiction-scan cron (issue #520). */
446
+ export interface ContradictionScanConfig {
447
+ /** Master switch for the contradiction scan cron. Default true. */
448
+ enabled: boolean;
449
+ /** Embedding cosine similarity floor for candidate pair generation. Default 0.82. */
450
+ similarityFloor: number;
451
+ /** Minimum topic-token Jaccard overlap for unstructured pairs. Default 0.4. */
452
+ topicOverlapFloor: number;
453
+ /** Cap on candidate pairs evaluated per cron run. Default 500. */
454
+ maxPairsPerRun: number;
455
+ /** Cooldown in days before re-evaluating a pair judged independent/both-valid. Default 14. */
456
+ cooldownDays: number;
457
+ /** When true, pairs judged "duplicates" are auto-flagged for dedup (still need user approval). Default false. */
458
+ autoMergeDuplicates: boolean;
459
+ }
460
+
461
+ export interface HeartbeatConfig {
462
+ enabled: boolean;
463
+ journalPath: string;
464
+ maxPreviousRuns: number;
465
+ watchFile: boolean;
466
+ detectionMode: HeartbeatDetectionMode;
467
+ gateExtractionDuringHeartbeat: boolean;
468
+ }
469
+
470
+ export interface SlotBehaviorConfig {
471
+ requireExclusiveMemorySlot: boolean;
472
+ onSlotMismatch: SlotMismatchMode;
473
+ }
474
+
475
+ export interface CodexCompatConfig {
476
+ enabled: boolean;
477
+ threadIdBufferKeying: boolean;
478
+ compactionFlushMode: CodexCompactionFlushMode;
479
+ fingerprintDedup: boolean;
480
+ }
481
+
482
+ export function confidenceTier(score: number): ConfidenceTier {
483
+ if (score >= 0.95) return "explicit";
484
+ if (score >= 0.70) return "implied";
485
+ if (score >= 0.40) return "inferred";
486
+ return "speculative";
487
+ }
488
+
489
+ /** Default TTL in days for speculative memories (auto-expire if unconfirmed) */
490
+ export const SPECULATIVE_TTL_DAYS = 30;
491
+
492
+ /**
493
+ * Shape for semantic chunking config overrides stored in PluginConfig.
494
+ * Mirrors SemanticChunkingConfig from semantic-chunking.ts without creating
495
+ * a circular import (types.ts is imported by everything).
496
+ */
497
+ export interface SemanticChunkingConfigShape {
498
+ targetTokens: number;
499
+ minTokens: number;
500
+ maxTokens: number;
501
+ smoothingWindowSize: number;
502
+ boundaryThresholdStdDevs: number;
503
+ embeddingBatchSize: number;
504
+ fallbackToRecursive: boolean;
505
+ }
506
+
507
+ export interface PluginConfig {
508
+ openaiApiKey: string | undefined;
509
+ openaiBaseUrl: string | undefined;
510
+ model: string;
511
+ reasoningEffort: ReasoningEffort;
512
+ triggerMode: TriggerMode;
513
+ bufferMaxTurns: number;
514
+ bufferMaxMinutes: number;
515
+ /**
516
+ * Surprise-gated buffer flush (issue #563, D-MEM).
517
+ *
518
+ * When enabled, every turn added to the smart buffer is scored against a
519
+ * configurable window of recent memories using an embedding-distance proxy
520
+ * for novelty (see `buffer-surprise.ts`). A turn whose surprise score
521
+ * exceeds `bufferSurpriseThreshold` triggers an immediate extract flush,
522
+ * even if the existing signal/turn-count/time triggers would otherwise keep
523
+ * buffering. Disabled by default — when `false`, buffer behavior is
524
+ * identical to pre-#563 code. Additive only: existing triggers are never
525
+ * suppressed by this flag.
526
+ */
527
+ bufferSurpriseTriggerEnabled: boolean;
528
+ /**
529
+ * Threshold in `[0, 1]` above which a surprise score causes an immediate
530
+ * flush. `0.35` is a conservative default chosen to favor precision over
531
+ * recall during the opt-in phase. Ignored unless
532
+ * `bufferSurpriseTriggerEnabled` is `true`.
533
+ */
534
+ bufferSurpriseThreshold: number;
535
+ /**
536
+ * Number of nearest neighbors to average over when computing the surprise
537
+ * score (see `computeSurprise`). Default `5`. Clamped to the recent-memory
538
+ * window size at call time.
539
+ */
540
+ bufferSurpriseK: number;
541
+ /**
542
+ * Maximum number of recent memories to sample when computing the surprise
543
+ * score. Bounds embedding cost per turn. Default `20`. Set to `0` to
544
+ * disable the trigger even when the flag is on (no memories to compare
545
+ * against → treat as not-applicable rather than maximally surprising).
546
+ */
547
+ bufferSurpriseRecentMemoryCount: number;
548
+ /**
549
+ * Hard timeout (ms) for the surprise probe. If the probe does not
550
+ * resolve within this window, the buffer treats the probe as failed,
551
+ * logs at debug, and falls through to the existing triggers. Ensures
552
+ * a slow or hung embedder cannot stall the turn-append path. Default
553
+ * `2000` (2s).
554
+ */
555
+ bufferSurpriseProbeTimeoutMs: number;
556
+ consolidateEveryN: number;
557
+ highSignalPatterns: string[];
558
+ maxMemoryTokens: number;
559
+ memoryOsPreset?: MemoryOsPresetName;
560
+ qmdEnabled: boolean;
561
+ qmdCollection: string;
562
+ qmdMaxResults: number;
563
+ qmdColdTierEnabled?: boolean;
564
+ qmdColdCollection?: string;
565
+ qmdColdMaxResults?: number;
566
+ qmdTierMigrationEnabled: boolean;
567
+ qmdTierDemotionMinAgeDays: number;
568
+ qmdTierDemotionValueThreshold: number;
569
+ qmdTierPromotionValueThreshold: number;
570
+ qmdTierParityGraphEnabled: boolean;
571
+ qmdTierParityHiMemEnabled: boolean;
572
+ qmdTierAutoBackfillEnabled: boolean;
573
+ qmdSupportedVersion: string;
574
+ qmdAutoUpgradeEnabled: boolean;
575
+ qmdAutoUpgradeCheckIntervalMs: number;
576
+ qmdChunkStrategy: "auto" | "regex";
577
+ qmdCandidateLimit?: number;
578
+ qmdQueryRerankEnabled: boolean;
579
+ qmdIndexName?: string;
580
+ qmdForceCpu: boolean;
581
+ qmdGpuBackend?: "auto" | "metal" | "cuda" | "vulkan" | "false";
582
+ qmdEmbedParallelism?: number;
583
+ qmdEmbedModel?: string;
584
+ qmdRerankModel?: string;
585
+ qmdGenerateModel?: string;
586
+ embeddingFallbackEnabled: boolean;
587
+ embeddingFallbackProvider: "auto" | "openai" | "local";
588
+ /**
589
+ * Optional model identifier for local embedding fallback requests.
590
+ *
591
+ * Local chat/completion models and local embedding models are often
592
+ * different LM Studio/Ollama model IDs. When unset, Remnic preserves the
593
+ * legacy behavior and falls back to `localLlmModel`.
594
+ */
595
+ embeddingFallbackModel: string;
596
+ /** Optional absolute path to qmd binary. If unset, PATH/fallback discovery is used. */
597
+ qmdPath?: string;
598
+ memoryDir: string;
599
+ debug: boolean;
600
+ identityEnabled: boolean;
601
+ identityContinuityEnabled: boolean;
602
+ identityInjectionMode: IdentityInjectionMode;
603
+ identityMaxInjectChars: number;
604
+ continuityIncidentLoggingEnabled: boolean;
605
+ continuityAuditEnabled: boolean;
606
+ sessionObserverEnabled?: boolean;
607
+ sessionObserverDebounceMs?: number;
608
+ sessionObserverBands?: SessionObserverBandConfig[];
609
+ injectQuestions: boolean;
610
+ commitmentDecayDays: number;
611
+ workspaceDir: string;
612
+ captureMode: CaptureMode;
613
+ fileHygiene?: FileHygieneConfig;
614
+ nativeKnowledge?: NativeKnowledgeConfig;
615
+ agentAccessHttp: AgentAccessHttpConfig;
616
+ // Access tracking (Phase 1A)
617
+ accessTrackingEnabled: boolean;
618
+ accessTrackingBufferMaxSize: number;
619
+ // Retrieval options
620
+ recencyWeight: number;
621
+ boostAccessCount: boolean;
622
+ /** Record empty recall impressions (memoryIds: []) when no memories are injected. Disabled by default. */
623
+ recordEmptyRecallImpressions: boolean;
624
+ // v2.2 Advanced Retrieval
625
+ queryExpansionEnabled: boolean;
626
+ queryExpansionMaxQueries: number;
627
+ /** Minimum token length to consider for query expansion. */
628
+ queryExpansionMinTokenLen: number;
629
+ rerankEnabled: boolean;
630
+ /** Rerank provider. "local" uses Local LLM only; "cloud" uses gateway fallback chain. */
631
+ rerankProvider: "local" | "cloud";
632
+ rerankMaxCandidates: number;
633
+ rerankTimeoutMs: number;
634
+ rerankCacheEnabled: boolean;
635
+ rerankCacheTtlMs: number;
636
+ feedbackEnabled: boolean;
637
+ // v2.2 Negative Examples (safe defaults: off unless enabled)
638
+ /** If true, allow recording negative examples and apply a soft penalty during ranking. */
639
+ negativeExamplesEnabled: boolean;
640
+ /** Score penalty per "not useful" hit (typical QMD scores ~0-1). Keep small. */
641
+ negativeExamplesPenaltyPerHit: number;
642
+ /** Maximum penalty applied from negative examples. */
643
+ negativeExamplesPenaltyCap: number;
644
+ // Chunking (Phase 2A)
645
+ chunkingEnabled: boolean;
646
+ chunkingTargetTokens: number;
647
+ chunkingMinTokens: number;
648
+ chunkingOverlapSentences: number;
649
+ // Semantic Chunking (Issue #368)
650
+ /** Enable semantic chunking with embedding-based topic boundary detection. Default: false. */
651
+ semanticChunkingEnabled: boolean;
652
+ /** Optional overrides for the semantic chunking algorithm. */
653
+ semanticChunkingConfig: Partial<SemanticChunkingConfigShape>;
654
+ // Contradiction Detection (Phase 2B)
655
+ contradictionDetectionEnabled: boolean;
656
+ contradictionSimilarityThreshold: number;
657
+ contradictionMinConfidence: number;
658
+ contradictionAutoResolve: boolean;
659
+ /** Nightly contradiction-scan cron config (issue #520). */
660
+ contradictionScan: ContradictionScanConfig;
661
+ // Temporal Supersession (issue #375)
662
+ /**
663
+ * When enabled, writes that carry `structuredAttributes` mark any older
664
+ * fact with the same `entityRef + attribute_name` supersession key and a
665
+ * conflicting value as `status: "superseded"`.
666
+ */
667
+ temporalSupersessionEnabled: boolean;
668
+ /**
669
+ * When enabled, superseded memories are still returned by recall (useful
670
+ * for audit/history queries). Default: false — superseded memories are
671
+ * filtered out.
672
+ */
673
+ temporalSupersessionIncludeInRecall: boolean;
674
+ // Direct-answer retrieval tier (issue #518)
675
+ /**
676
+ * When true, recall checks whether a single validated memory in a
677
+ * high-trust taxonomy bucket can answer the query before invoking QMD.
678
+ * Default false — enable explicitly after bench validation.
679
+ */
680
+ recallDirectAnswerEnabled: boolean;
681
+ /**
682
+ * Disclosure auto-escalation policy (issue #677 PR 4/4). When set to
683
+ * `"auto"`, recalls without an explicit caller-supplied disclosure
684
+ * escalate from `chunk` to `section` if the top-K confidence falls
685
+ * below {@link recallDisclosureEscalationThreshold}. `raw` is never
686
+ * auto-selected — it requires an explicit caller request. Default
687
+ * `"manual"` preserves pre-#677 behavior.
688
+ */
689
+ recallDisclosureEscalation: "manual" | "auto";
690
+ /**
691
+ * Top-K confidence threshold (in `[0, 1]`) below which auto-escalation
692
+ * promotes `chunk` → `section`. Only consulted when
693
+ * {@link recallDisclosureEscalation} is `"auto"`. Default `0.5`.
694
+ */
695
+ recallDisclosureEscalationThreshold: number;
696
+ /**
697
+ * Graph-based retrieval tier via Personalized PageRank (issue #559 PR 4).
698
+ * When true, recall builds a retrieval graph from memory frontmatter
699
+ * and runs PPR, merging the result with QMD via MMR. Default false —
700
+ * ships off pending the retrieval-graph bench in PR 5.
701
+ */
702
+ recallGraphEnabled: boolean;
703
+ /** PPR damping factor used when `recallGraphEnabled` is true. */
704
+ recallGraphDamping: number;
705
+ /** PPR power-iteration cap used when `recallGraphEnabled` is true. */
706
+ recallGraphIterations: number;
707
+ /**
708
+ * Max memories returned by the graph tier before MMR. Set to 0 to
709
+ * disable the graph tier's contribution without flipping the flag.
710
+ */
711
+ recallGraphTopK: number;
712
+ /**
713
+ * Minimum token-overlap ratio (query tokens ∩ memory tokens / query tokens)
714
+ * required for direct-answer eligibility. Set to 0 to disable the gate.
715
+ */
716
+ recallDirectAnswerTokenOverlapFloor: number;
717
+ /**
718
+ * Minimum calibrated importance score required for direct-answer
719
+ * eligibility. Set to 0 to disable the gate.
720
+ */
721
+ recallDirectAnswerImportanceFloor: number;
722
+ /**
723
+ * Ambiguity margin: if the second-best candidate scores within this
724
+ * ratio of the top candidate, direct-answer defers to the hybrid tier.
725
+ */
726
+ recallDirectAnswerAmbiguityMargin: number;
727
+ /**
728
+ * Taxonomy category IDs eligible for direct-answer routing. Memories
729
+ * whose resolved taxonomy category is not in this list never qualify.
730
+ */
731
+ recallDirectAnswerEligibleTaxonomyBuckets: string[];
732
+ /**
733
+ * Cross-namespace query-budget limiter (issue #565 PR 4/5). When true,
734
+ * a principal that issues a burst of recalls against namespaces other
735
+ * than their own is throttled once its per-window count crosses
736
+ * `recallCrossNamespaceBudgetHardLimit`. Default false — ships disabled.
737
+ */
738
+ recallCrossNamespaceBudgetEnabled: boolean;
739
+ /** Rolling window in milliseconds over which cross-namespace reads are counted. */
740
+ recallCrossNamespaceBudgetWindowMs: number;
741
+ /**
742
+ * Soft threshold — the first point at which the limiter flags a burst.
743
+ * Calls are still allowed; anomaly detection (issue #565 PR 5) will
744
+ * surface the warning.
745
+ */
746
+ recallCrossNamespaceBudgetSoftLimit: number;
747
+ /** Hard threshold — calls past this count are denied in the window. */
748
+ recallCrossNamespaceBudgetHardLimit: number;
749
+ // Memory Worth recall filter (issue #560 PR 4)
750
+ /**
751
+ * When true, recall multiplies candidate scores by the Memory Worth
752
+ * factor computed from `mw_success` / `mw_fail` counters on each
753
+ * memory's frontmatter (see `computeMemoryWorth`). Memories with a
754
+ * history of failed sessions sink; neutral / uninstrumented memories
755
+ * are untouched (multiplier 1.0). Default false — flip to true in PR 5
756
+ * once the benchmark shows precision tie-or-win.
757
+ */
758
+ recallMemoryWorthFilterEnabled: boolean;
759
+ /**
760
+ * Recall-audit anomaly detector (issue #565 PR 5/5). When true,
761
+ * access surfaces run the anomaly detector over a tail of the audit
762
+ * trail after each recall and surface any flags via logs / metrics.
763
+ * Ships disabled.
764
+ */
765
+ recallAuditAnomalyDetectionEnabled: boolean;
766
+ /** Rolling window over which audit entries are analyzed. */
767
+ recallAuditAnomalyWindowMs: number;
768
+ /** Threshold for the `repeat-query` flag. */
769
+ recallAuditAnomalyRepeatQueryLimit: number;
770
+ /** Threshold for the `namespace-walk` flag (distinct namespaces). */
771
+ recallAuditAnomalyNamespaceWalkLimit: number;
772
+ /** Threshold for the `high-cardinality-return` flag. */
773
+ recallAuditAnomalyHighCardinalityLimit: number;
774
+ /** Threshold for the `rapid-fire` flag. */
775
+ recallAuditAnomalyRapidFireLimit: number;
776
+ /**
777
+ * Optional half-life for Memory Worth decay, in milliseconds. When
778
+ * positive, older outcome observations are exponentially decayed toward
779
+ * the uniform prior. Set to 0 (default) to disable decay and use raw
780
+ * counter values.
781
+ */
782
+ recallMemoryWorthHalfLifeMs: number;
783
+ // Memory Linking (Phase 3A)
784
+ memoryLinkingEnabled: boolean;
785
+ // Conversation Threading (Phase 3B)
786
+ threadingEnabled: boolean;
787
+ threadingGapMinutes: number;
788
+ // Memory Summarization (Phase 4A)
789
+ summarizationEnabled: boolean;
790
+ summarizationTriggerCount: number;
791
+ summarizationRecentToKeep: number;
792
+ summarizationImportanceThreshold: number;
793
+ summarizationProtectedTags: string[];
794
+ // Topic Extraction (Phase 4B)
795
+ topicExtractionEnabled: boolean;
796
+ topicExtractionTopN: number;
797
+ // Transcript & Context Preservation (v2.0)
798
+ // Transcript archive
799
+ transcriptEnabled: boolean;
800
+ transcriptRetentionDays: number;
801
+ /** Channel types to skip from transcript logging (e.g., ["cron"]) */
802
+ transcriptSkipChannelTypes: string[];
803
+ // Transcript injection
804
+ transcriptRecallHours: number;
805
+ maxTranscriptTurns: number;
806
+ maxTranscriptTokens: number;
807
+ // Checkpoint
808
+ checkpointEnabled: boolean;
809
+ checkpointTurns: number;
810
+ // Compaction reset: trigger session reset after compaction instead of continuing degraded.
811
+ // Requires OC fork with PR #29985 (api.resetSession).
812
+ compactionResetEnabled: boolean;
813
+ beforeResetTimeoutMs: number;
814
+ initGateTimeoutMs: number;
815
+ flushOnResetEnabled: boolean;
816
+ commandsListEnabled: boolean;
817
+ openclawToolsEnabled: boolean;
818
+ openclawToolSnippetMaxChars: number;
819
+ sessionTogglesEnabled: boolean;
820
+ verboseRecallVisibility: boolean;
821
+ recallTranscriptsEnabled: boolean;
822
+ recallTranscriptRetentionDays: number;
823
+ respectBundledActiveMemoryToggle: boolean;
824
+ activeRecallEnabled: boolean;
825
+ activeRecallAgents: string[] | null;
826
+ activeRecallAllowedChatTypes: ActiveRecallChatType[];
827
+ activeRecallQueryMode: ActiveRecallQueryMode;
828
+ activeRecallPromptStyle: ActiveRecallPromptStyle;
829
+ activeRecallCustomInstruction: string | null;
830
+ activeRecallPromptAppend: string | null;
831
+ activeRecallMaxSummaryChars: number;
832
+ activeRecallRecentUserTurns: number;
833
+ activeRecallRecentAssistantTurns: number;
834
+ activeRecallRecentUserChars: number;
835
+ activeRecallRecentAssistantChars: number;
836
+ activeRecallThinking: ActiveRecallThinking;
837
+ activeRecallTimeoutMs: number;
838
+ activeRecallCacheTtlMs: number;
839
+ activeRecallModel: string | null;
840
+ activeRecallModelFallbackPolicy: ActiveRecallModelFallbackPolicy;
841
+ activeRecallPersistTranscripts: boolean;
842
+ activeRecallTranscriptDir: string;
843
+ activeRecallEntityGraphDepth: number;
844
+ activeRecallIncludeCausalTrajectories: boolean;
845
+ activeRecallIncludeDaySummary: boolean;
846
+ activeRecallAttachRecallExplain: boolean;
847
+ activeRecallAllowChainedActiveMemory: boolean;
848
+ dreaming: DreamingConfig;
849
+ /**
850
+ * Unified dreams-phases config block (issue #678 PR 2/4).
851
+ * Groups existing lifecycle, REM, and deep-sleep gates under one namespace.
852
+ * Values here WIN over equivalent legacy top-level keys when set. See docs/dreams.md.
853
+ */
854
+ dreamsPhases: DreamsPhasesConfig;
855
+ procedural: ProceduralConfig;
856
+ /**
857
+ * At-rest encryption configuration (issue #690 PR 3/4).
858
+ *
859
+ * When `secureStoreEnabled` is true, `StorageManager` reads and
860
+ * writes memory files through the `secure-fs` encryption layer.
861
+ * The store must be unlocked via `remnic secure-store unlock` before
862
+ * any recall or store operations will succeed.
863
+ *
864
+ * When `secureStoreEncryptOnWrite` is true (the default when enabled),
865
+ * every new memory write is encrypted. Set to false to pause new
866
+ * encryptions while still being able to decrypt existing files.
867
+ */
868
+ secureStoreEnabled: boolean;
869
+ /** Encrypt new writes when the secure-store is unlocked. Default true. */
870
+ secureStoreEncryptOnWrite: boolean;
871
+ // Coding-agent project/branch scoping (issue #569)
872
+ codingMode: CodingModeConfig;
873
+ heartbeat: HeartbeatConfig;
874
+ slotBehavior: SlotBehaviorConfig;
875
+ codexCompat: CodexCompatConfig;
876
+ /**
877
+ * When true (default), the extraction prompt instructs the LLM to classify
878
+ * each fact as `"project"` or `"global"` scope. Global-scoped facts are
879
+ * promoted to the shared namespace so they are visible across all projects.
880
+ * When false, all facts go to whatever namespace the session is in (pre-
881
+ * scope-classification behavior). Rule 30: configuration gate.
882
+ */
883
+ extractionScopeClassificationEnabled: boolean;
884
+ // Extraction judge (issue #376)
885
+ /** Enable the LLM-as-judge fact-worthiness gate on extracted facts. Default false (opt-in). */
886
+ extractionJudgeEnabled: boolean;
887
+ /** Model override for the judge LLM. Empty string means use the local model. */
888
+ extractionJudgeModel: string;
889
+ /** Maximum number of candidate facts per judge LLM batch call. */
890
+ extractionJudgeBatchSize: number;
891
+ /** Shadow mode: log judge verdicts but do not filter facts. Default false. */
892
+ extractionJudgeShadow: boolean;
893
+ /**
894
+ * Maximum number of times the same candidate text may be deferred before
895
+ * the judge forcibly converts the verdict to `"reject"`. Prevents
896
+ * pathological LLM responses from looping forever on ambiguous facts.
897
+ * Defaults to 2 (issue #562, PR 2).
898
+ */
899
+ extractionJudgeMaxDeferrals: number;
900
+ /**
901
+ * Emit structured telemetry rows to
902
+ * `state/observation-ledger/extraction-judge-verdicts.jsonl` on every
903
+ * judge verdict. Off by default; enable to collect defer-rate / latency
904
+ * metrics for operator dashboards (issue #562, PR 3).
905
+ */
906
+ extractionJudgeTelemetryEnabled: boolean;
907
+ /**
908
+ * Collect `(candidate_text, verdict_kind, reason)` tuples into
909
+ * `~/.remnic/judge-training/<date>.jsonl` for use by a future GRPO
910
+ * training pipeline (issue #562, PR 4). Off by default. Rows live in
911
+ * the user's home directory rather than the shared memory directory so
912
+ * they are not committed, sync'd, or bundled into memory exports.
913
+ */
914
+ collectJudgeTrainingPairs: boolean;
915
+ /**
916
+ * Override directory for judge training-pair collection. Empty string
917
+ * means use the default (`~/.remnic/judge-training`). Primarily for
918
+ * tests and for operators who want the output to land in a specific
919
+ * location.
920
+ */
921
+ judgeTrainingDir: string;
922
+ // Hourly summaries
923
+ hourlySummariesEnabled: boolean;
924
+ daySummaryEnabled: boolean;
925
+ /** If true, Engram may attempt to auto-register an hourly summary cron job (default off). */
926
+ hourlySummaryCronAutoRegister: boolean;
927
+ /** If true, Engram may attempt to auto-register the nightly governance cron job (default off). */
928
+ nightlyGovernanceCronAutoRegister: boolean;
929
+ summaryRecallHours: number;
930
+ maxSummaryCount: number;
931
+ summaryModel: string;
932
+ // v2.4 Extended hourly summaries
933
+ hourlySummariesExtendedEnabled: boolean;
934
+ hourlySummariesIncludeToolStats: boolean;
935
+ hourlySummariesIncludeSystemMessages: boolean;
936
+ hourlySummariesMaxTurnsPerRun: number;
937
+ // v2.4 Conversation index (optional)
938
+ conversationIndexEnabled: boolean;
939
+ conversationIndexBackend: "qmd" | "faiss";
940
+ conversationIndexQmdCollection: string;
941
+ conversationIndexRetentionDays: number;
942
+ conversationIndexMinUpdateIntervalMs: number;
943
+ conversationIndexEmbedOnUpdate: boolean;
944
+ conversationIndexFaissScriptPath?: string;
945
+ conversationIndexFaissPythonBin?: string;
946
+ conversationIndexFaissModelId: string;
947
+ conversationIndexFaissIndexDir: string;
948
+ conversationIndexFaissUpsertTimeoutMs: number;
949
+ conversationIndexFaissSearchTimeoutMs: number;
950
+ conversationIndexFaissHealthTimeoutMs: number;
951
+ conversationIndexFaissMaxBatchSize: number;
952
+ conversationIndexFaissMaxSearchK: number;
953
+ conversationRecallTopK: number;
954
+ conversationRecallMaxChars: number;
955
+ conversationRecallTimeoutMs: number;
956
+ // Evaluation harness foundation
957
+ evalHarnessEnabled: boolean;
958
+ evalShadowModeEnabled: boolean;
959
+ benchmarkBaselineSnapshotsEnabled: boolean;
960
+ benchmarkDeltaReporterEnabled: boolean;
961
+ benchmarkStoredBaselineEnabled: boolean;
962
+ evalStoreDir: string;
963
+ // Objective-state memory foundation
964
+ objectiveStateMemoryEnabled: boolean;
965
+ objectiveStateSnapshotWritesEnabled: boolean;
966
+ objectiveStateRecallEnabled: boolean;
967
+ objectiveStateStoreDir: string;
968
+ // Causal trajectory memory foundation
969
+ causalTrajectoryMemoryEnabled: boolean;
970
+ causalTrajectoryStoreDir: string;
971
+ causalTrajectoryRecallEnabled: boolean;
972
+ actionGraphRecallEnabled: boolean;
973
+ // Trust-zone memory foundation
974
+ trustZonesEnabled: boolean;
975
+ quarantinePromotionEnabled: boolean;
976
+ trustZoneStoreDir: string;
977
+ trustZoneRecallEnabled: boolean;
978
+ memoryPoisoningDefenseEnabled: boolean;
979
+ memoryRedTeamBenchEnabled: boolean;
980
+ // Harmonic retrieval foundation
981
+ harmonicRetrievalEnabled: boolean;
982
+ abstractionAnchorsEnabled: boolean;
983
+ abstractionNodeStoreDir: string;
984
+ // Episodic/semantic split foundation
985
+ verifiedRecallEnabled: boolean;
986
+ semanticRulePromotionEnabled: boolean;
987
+ semanticRuleVerificationEnabled: boolean;
988
+ semanticConsolidationEnabled: boolean;
989
+ semanticConsolidationModel: string;
990
+ semanticConsolidationThreshold: number;
991
+ semanticConsolidationMinClusterSize: number;
992
+ semanticConsolidationExcludeCategories: string[];
993
+ semanticConsolidationIntervalHours: number;
994
+ semanticConsolidationMaxPerRun: number;
995
+ /**
996
+ * When true (default), semantic-consolidation prompts the LLM with an
997
+ * operator-aware format asking for JSON `{operator, output}` and records
998
+ * the resulting SPLIT/MERGE/UPDATE operator on `derived_via`. When
999
+ * false, falls back to the legacy plain-text prompt — `derived_via` is
1000
+ * still populated via the cluster-shape heuristic in
1001
+ * `chooseConsolidationOperator`. Issue #561 PR 3.
1002
+ */
1003
+ operatorAwareConsolidationEnabled: boolean;
1004
+ // Pattern reinforcement (issue #687 PR 2/4)
1005
+ /**
1006
+ * When true, the pattern-reinforcement maintenance job runs on its
1007
+ * configured cadence and clusters duplicate non-procedural memories
1008
+ * by normalized content. Clusters with `>= patternReinforcementMinCount`
1009
+ * members produce a canonical (most-recent) memory tagged with
1010
+ * `reinforcement_count` + `last_reinforced_at`; the older duplicates
1011
+ * are marked `superseded` and pointed at the canonical. Default
1012
+ * `false` — opt-in until bench validation lands.
1013
+ */
1014
+ patternReinforcementEnabled: boolean;
1015
+ /**
1016
+ * Minimum interval (ms) between pattern-reinforcement runs. Default
1017
+ * `7 * 24 * 60 * 60 * 1000` (7 days). Set to `0` to disable cadence
1018
+ * gating (useful for tests / manual invocation).
1019
+ */
1020
+ patternReinforcementCadenceMs: number;
1021
+ /**
1022
+ * Minimum cluster size before pattern reinforcement promotes a
1023
+ * canonical and supersedes duplicates. Default `3`. Clamped to
1024
+ * `>= 2` at config-parse time — a "cluster of 1" is just a single
1025
+ * memory and a "cluster of 0" is meaningless.
1026
+ */
1027
+ patternReinforcementMinCount: number;
1028
+ /**
1029
+ * Memory categories the pattern-reinforcement job considers.
1030
+ * Default `["preference", "fact", "decision"]`. The job
1031
+ * intentionally skips procedural memories so it stays disjoint from
1032
+ * the procedural mining pipeline.
1033
+ */
1034
+ patternReinforcementCategories: string[];
1035
+ /** issue #687 PR 3/4: opt-in recall score boost for reinforced memories. Default false. */
1036
+ reinforcementRecallBoostEnabled: boolean;
1037
+ /** Score bonus per unit of reinforcement_count. Range [0, 1]. Default 0.05. */
1038
+ reinforcementRecallBoostWeight: number;
1039
+ /** Maximum additive reinforcement boost per result. Range [0, 1]. Default 0.3. */
1040
+ reinforcementRecallBoostMax: number;
1041
+ /**
1042
+ * Async peer profile reasoner — issue #679 PR 2/5.
1043
+ *
1044
+ * Default `false` (opt-in). When enabled, the reasoner runs after
1045
+ * `runSemanticConsolidation` (the REM phase of the dreams pipeline)
1046
+ * and updates per-peer profile.md files with provenance-tagged
1047
+ * field updates derived from the peer's interaction log.
1048
+ */
1049
+ peerProfileReasonerEnabled: boolean;
1050
+ /**
1051
+ * Model identifier used by the peer profile reasoner. Logged for
1052
+ * telemetry only — actual dispatch is via the same FallbackLlmClient
1053
+ * the orchestrator uses for semantic consolidation. Default `gpt-5.5`.
1054
+ */
1055
+ peerProfileReasonerModel: string;
1056
+ /**
1057
+ * Minimum new interaction-log entries a peer must accumulate since
1058
+ * the previous reasoner run before being processed again. Default 5.
1059
+ * Setting to 0 forces every run to consider every peer.
1060
+ */
1061
+ peerProfileReasonerMinInteractions: number;
1062
+ /**
1063
+ * Hard cap on the total number of profile fields the reasoner will
1064
+ * apply across all peers in a single run. Default 8.
1065
+ */
1066
+ peerProfileReasonerMaxFieldsPerRun: number;
1067
+ /**
1068
+ * When true, inject the active peer's profile fields into the recall
1069
+ * context as a "## Peer Profile" section. Default false (opt-in,
1070
+ * Gotcha #30/#48 — least-privileged default). Requires the session's
1071
+ * peer ID to be registered via `setPeerIdForSession` before recall.
1072
+ */
1073
+ peerProfileRecallEnabled: boolean;
1074
+ /**
1075
+ * Maximum number of peer profile fields to inject per recall. Only
1076
+ * the most-recently-updated N fields are included to keep the context
1077
+ * budget predictable. Default 5. Setting to 0 disables field
1078
+ * injection even when `peerProfileRecallEnabled` is true.
1079
+ */
1080
+ peerProfileRecallMaxFields: number;
1081
+ // Creation-memory foundation
1082
+ creationMemoryEnabled: boolean;
1083
+ memoryUtilityLearningEnabled: boolean;
1084
+ promotionByOutcomeEnabled: boolean;
1085
+ commitmentLedgerEnabled: boolean;
1086
+ commitmentLifecycleEnabled: boolean;
1087
+ commitmentStaleDays: number;
1088
+ commitmentLedgerDir: string;
1089
+ resumeBundlesEnabled: boolean;
1090
+ resumeBundleDir: string;
1091
+ workProductRecallEnabled: boolean;
1092
+ workProductLedgerDir: string;
1093
+ workTasksEnabled: boolean;
1094
+ workProjectsEnabled: boolean;
1095
+ workTasksDir: string;
1096
+ workProjectsDir: string;
1097
+ workIndexEnabled: boolean;
1098
+ workIndexDir: string;
1099
+ workTaskIndexEnabled: boolean;
1100
+ workProjectIndexEnabled: boolean;
1101
+ workIndexAutoRebuildEnabled: boolean;
1102
+ workIndexAutoRebuildDebounceMs: number;
1103
+ // Local LLM Provider (v2.1)
1104
+ localLlmEnabled: boolean;
1105
+ localLlmUrl: string;
1106
+ localLlmModel: string;
1107
+ /** Optional API key for authenticated OpenAI-compatible endpoints. */
1108
+ localLlmApiKey?: string;
1109
+ /** Additional headers for local/compatible endpoint requests. */
1110
+ localLlmHeaders?: Record<string, string>;
1111
+ /** If false, do not send Authorization header even when localLlmApiKey is set. */
1112
+ localLlmAuthHeader: boolean;
1113
+ localLlmFallback: boolean;
1114
+ /** Optional home directory override for local LLM helpers (LM Studio settings, CLI PATH). */
1115
+ localLlmHomeDir?: string;
1116
+ /** Optional absolute path to LMS CLI binary (preferred over auto-detection). */
1117
+ localLmsCliPath?: string;
1118
+ /** Optional bin directory prepended to PATH for LMS CLI execution. */
1119
+ localLmsBinDir?: string;
1120
+ /** Hard timeout for local LLM and gateway fallback requests (ms). */
1121
+ localLlmTimeoutMs: number;
1122
+ /** Max context window for local LLM (override auto-detection). Set lower if your LLM server defaults to smaller contexts. */
1123
+ localLlmMaxContext?: number;
1124
+ // Observability
1125
+ /** If true, log slow operations (local LLM + related I/O) with durations and metadata (no content). */
1126
+ slowLogEnabled: boolean;
1127
+ /**
1128
+ * If true, include the full recalled memory text in `RecallTraceEvent.recalledContent`.
1129
+ * Disabled by default — enable only when you want external trace subscribers (e.g. Langfuse)
1130
+ * to see the exact memory context injected into each conversation turn.
1131
+ * This adds payload to trace events but does not log to files or the gateway log.
1132
+ */
1133
+ traceRecallContent: boolean;
1134
+ /** Threshold for slow operation logging (ms). */
1135
+ slowLogThresholdMs: number;
1136
+ // Performance profiling (opt-in)
1137
+ /** If true, collect and persist timing traces for recall and extraction pipelines. */
1138
+ profilingEnabled: boolean;
1139
+ /** Directory for profiling trace JSONL files. Defaults to <memoryDir>/profiling. */
1140
+ profilingStorageDir: string;
1141
+ /** Maximum number of trace files to keep (rolling window). */
1142
+ profilingMaxTraces: number;
1143
+ // Extraction stability guards (P0/P1)
1144
+ extractionDedupeEnabled: boolean;
1145
+ extractionDedupeWindowMs: number;
1146
+ extractionMinChars: number;
1147
+ extractionMinUserTurns: number;
1148
+ /**
1149
+ * When true, skip semantic memory extraction for mechanical action/state
1150
+ * telemetry transcripts that have no durable-memory cue. Raw transcript
1151
+ * storage/recall still runs; this only prevents expensive low-value fact
1152
+ * extraction over state logs. Default true.
1153
+ */
1154
+ extractionTelemetryPrefilterEnabled: boolean;
1155
+ /**
1156
+ * When true, LCM uses deterministic compression instead of semantic LLM
1157
+ * summarization for mechanical action/state telemetry transcripts with no
1158
+ * durable-memory cue. Raw transcript storage/recall still runs. Default true.
1159
+ */
1160
+ lcmTelemetryPrefilterEnabled: boolean;
1161
+ extractionMaxTurnChars: number;
1162
+ extractionMaxFactsPerRun: number;
1163
+ extractionMaxEntitiesPerRun: number;
1164
+ extractionMaxQuestionsPerRun: number;
1165
+ extractionMaxProfileUpdatesPerRun: number;
1166
+ /**
1167
+ * Minimum importance level required to persist an extracted fact. Facts
1168
+ * whose locally-scored level falls below this threshold are dropped before
1169
+ * write and counted toward the `importance_gated` metric. Defaults to
1170
+ * "low" so trivial content (greetings, single-word replies, filler) is
1171
+ * silently dropped while everything else still passes.
1172
+ */
1173
+ extractionMinImportanceLevel: ImportanceLevel;
1174
+ /**
1175
+ * Inline source attribution (issue #369).
1176
+ * When enabled, extracted facts carry a compact provenance tag (agent,
1177
+ * session, timestamp) inlined into the fact text — not just in YAML
1178
+ * frontmatter — so the citation survives hostile memory text, copy/paste,
1179
+ * and LLM quoting. Off by default to preserve backwards compatibility
1180
+ * with existing downstream consumers that expect raw fact text.
1181
+ */
1182
+ inlineSourceAttributionEnabled: boolean;
1183
+ /**
1184
+ * Template used when injecting inline citations. Supported placeholders:
1185
+ * `{agent}`, `{session}`, `{sessionId}`, `{ts}`, `{date}`. Defaults to
1186
+ * `[Source: agent={agent}, session={sessionId}, ts={ts}]`.
1187
+ */
1188
+ inlineSourceAttributionFormat: string;
1189
+ consolidationRequireNonZeroExtraction: boolean;
1190
+ consolidationMinIntervalMs: number;
1191
+ // QMD maintenance (debounced singleflight)
1192
+ qmdMaintenanceEnabled: boolean;
1193
+ qmdMaintenanceDebounceMs: number;
1194
+ qmdAutoEmbedEnabled: boolean;
1195
+ qmdEmbedMinIntervalMs: number;
1196
+ qmdUpdateTimeoutMs: number;
1197
+ qmdUpdateMinIntervalMs: number;
1198
+ // Local LLM resilience
1199
+ localLlmRetry5xxCount: number;
1200
+ localLlmRetryBackoffMs: number;
1201
+ localLlm400TripThreshold: number;
1202
+ localLlm400CooldownMs: number;
1203
+ // Local LLM fast tier (v9.1) — smaller model for quick ops
1204
+ localLlmFastEnabled: boolean;
1205
+ localLlmFastModel: string;
1206
+ localLlmFastUrl: string;
1207
+ localLlmFastTimeoutMs: number;
1208
+ /**
1209
+ * Suppress chain-of-thought / thinking mode on the main local LLM
1210
+ * (issue #548). When true, Remnic injects
1211
+ * `chat_template_kwargs: { enable_thinking: false }` on every
1212
+ * request so thinking-capable models (Qwen 3.5, Gemma 4, DeepSeek,
1213
+ * etc.) skip reasoning tokens that structured-output tasks like
1214
+ * extraction and consolidation cannot benefit from. Default: true
1215
+ * — the dominant localLlm use case is JSON-shaped extraction where
1216
+ * thinking is pure latency tax and a common cause of 60s timeouts.
1217
+ * Set to false to restore thinking for narrative tasks.
1218
+ *
1219
+ * The fast-tier client (`fastLlm`) always disables thinking; that
1220
+ * contract is baked into "fast tier" and is unaffected by this flag.
1221
+ */
1222
+ localLlmDisableThinking: boolean;
1223
+ // Gateway config for fallback AI
1224
+ gatewayConfig?: GatewayConfig;
1225
+ // Gateway model source (v9.2) — route LLM calls through gateway agent model chain
1226
+ modelSource: "plugin" | "gateway";
1227
+ gatewayAgentId: string;
1228
+ fastGatewayAgentId: string;
1229
+
1230
+ // v3.0 Multi-agent memory (namespaces)
1231
+ namespacesEnabled: boolean;
1232
+ defaultNamespace: string;
1233
+ sharedNamespace: string;
1234
+ principalFromSessionKeyMode: PrincipalFromSessionKeyMode;
1235
+ principalFromSessionKeyRules: PrincipalRule[];
1236
+ namespacePolicies: NamespacePolicy[];
1237
+ defaultRecallNamespaces: Array<"self" | "shared">;
1238
+ cronRecallMode: CronRecallMode;
1239
+ cronRecallAllowlist: string[];
1240
+ cronRecallPolicyEnabled: boolean;
1241
+ cronRecallNormalizedQueryMaxChars: number;
1242
+ cronRecallInstructionHeavyTokenCap: number;
1243
+ cronConversationRecallMode: CronConversationRecallMode;
1244
+ autoPromoteToSharedEnabled: boolean;
1245
+ autoPromoteToSharedCategories: Array<"fact" | "correction" | "decision" | "preference">;
1246
+ autoPromoteMinConfidenceTier: ConfidenceTier;
1247
+ routingRulesEnabled: boolean;
1248
+ routingRulesStateFile: string;
1249
+
1250
+ // v4.0 Shared-context (cross-agent shared intelligence)
1251
+ sharedContextEnabled: boolean;
1252
+ sharedContextDir?: string;
1253
+ sharedContextMaxInjectChars: number;
1254
+ crossSignalsSemanticEnabled: boolean;
1255
+ crossSignalsSemanticTimeoutMs: number;
1256
+ sharedCrossSignalSemanticEnabled?: boolean;
1257
+ sharedCrossSignalSemanticTimeoutMs?: number;
1258
+ sharedCrossSignalSemanticMaxCandidates?: number;
1259
+
1260
+ // v5.0 Compounding engine
1261
+ compoundingEnabled: boolean;
1262
+ compoundingWeeklyCronEnabled: boolean;
1263
+ compoundingSemanticEnabled: boolean;
1264
+ compoundingSynthesisTimeoutMs: number;
1265
+ compoundingInjectEnabled: boolean;
1266
+
1267
+ // IRC (Inductive Rule Consolidation) — preference synthesis
1268
+ ircEnabled: boolean;
1269
+ ircMaxPreferences: number;
1270
+ ircIncludeCorrections: boolean;
1271
+ ircMinConfidence: number;
1272
+
1273
+ // CMC (Causal Memory Consolidation) — cross-session causal reasoning
1274
+ cmcEnabled: boolean;
1275
+ cmcStitchLookbackDays: number;
1276
+ cmcStitchMinScore: number;
1277
+ cmcStitchMaxEdgesPerTrajectory: number;
1278
+ cmcConsolidationEnabled: boolean;
1279
+ cmcConsolidationMinRecurrence: number;
1280
+ cmcConsolidationMinSessions: number;
1281
+ cmcConsolidationSuccessThreshold: number;
1282
+ cmcRetrievalEnabled: boolean;
1283
+ cmcRetrievalMaxDepth: number;
1284
+ cmcRetrievalMaxChars: number;
1285
+ cmcRetrievalCounterfactualBoost: number;
1286
+ cmcBehaviorLearningEnabled: boolean;
1287
+ cmcBehaviorMinFrequency: number;
1288
+ cmcBehaviorMinSessions: number;
1289
+ cmcBehaviorConfidenceThreshold: number;
1290
+ cmcLifecycleCausalImpactWeight: number;
1291
+
1292
+ // PEDC (Prediction-Error-Driven Calibration) — model-user alignment
1293
+ calibrationEnabled: boolean;
1294
+ calibrationMaxRulesPerRecall: number;
1295
+ calibrationMaxChars: number;
1296
+
1297
+ // Search backend abstraction
1298
+ searchBackend?: "qmd" | "remote" | "noop" | "lancedb" | "meilisearch" | "orama";
1299
+ remoteSearchBaseUrl?: string;
1300
+ remoteSearchApiKey?: string;
1301
+ remoteSearchTimeoutMs?: number;
1302
+
1303
+ // LanceDB backend
1304
+ lancedbEnabled: boolean;
1305
+ lanceDbPath?: string;
1306
+ lanceEmbeddingDimension?: number;
1307
+
1308
+ // Meilisearch backend
1309
+ meilisearchEnabled: boolean;
1310
+ meilisearchHost?: string;
1311
+ meilisearchApiKey?: string;
1312
+ meilisearchTimeoutMs?: number;
1313
+ meilisearchAutoIndex?: boolean;
1314
+
1315
+ // Orama backend
1316
+ oramaEnabled: boolean;
1317
+ oramaDbPath?: string;
1318
+ oramaEmbeddingDimension?: number;
1319
+
1320
+ // QMD daemon mode
1321
+ qmdDaemonEnabled: boolean;
1322
+ qmdDaemonUrl: string;
1323
+ qmdDaemonRecheckIntervalMs: number;
1324
+ qmdIntentHintsEnabled: boolean;
1325
+ qmdExplainEnabled: boolean;
1326
+
1327
+ // v7.0 Knowledge Graph Enhancement
1328
+ knowledgeIndexEnabled: boolean;
1329
+ knowledgeIndexMaxEntities: number;
1330
+ knowledgeIndexMaxChars: number;
1331
+ entityRetrievalEnabled: boolean;
1332
+ entityRetrievalMaxChars: number;
1333
+ entityRetrievalMaxHints: number;
1334
+ entityRetrievalMaxSupportingFacts: number;
1335
+ entityRetrievalMaxRelatedEntities: number;
1336
+ entityRetrievalRecentTurns: number;
1337
+ entitySchemas?: Record<string, EntitySchemaDefinition>;
1338
+ // Recall assembly controls
1339
+ recallBudgetChars: number;
1340
+ recallOuterTimeoutMs: number;
1341
+ recallCoreDeadlineMs: number;
1342
+ recallEnrichmentDeadlineMs: number;
1343
+ recallPipeline: RecallSectionConfig[];
1344
+ /** Apply Maximal Marginal Relevance to the final recall selection per-section. */
1345
+ recallMmrEnabled: boolean;
1346
+ /** MMR λ parameter. 1.0 = pure relevance, 0.0 = pure diversity. Default 0.7. */
1347
+ recallMmrLambda: number;
1348
+ /** MMR is applied over the top N candidates per section. Default 40. */
1349
+ recallMmrTopN: number;
1350
+ /**
1351
+ * Boost stored `reasoning_trace` memories in recall results when the
1352
+ * incoming query reads like a problem-solving ask (e.g. "how do I…",
1353
+ * "step by step", "walk me through…"). Default false — opt in after
1354
+ * benchmarking (issue #564 PR 3).
1355
+ */
1356
+ recallReasoningTraceBoostEnabled: boolean;
1357
+ qmdRecallCacheTtlMs: number;
1358
+ qmdRecallCacheStaleTtlMs: number;
1359
+ qmdRecallCacheMaxEntries: number;
1360
+ entityRelationshipsEnabled: boolean;
1361
+ entityActivityLogEnabled: boolean;
1362
+ entityActivityLogMaxEntries: number;
1363
+ entityAliasesEnabled: boolean;
1364
+ entitySummaryEnabled: boolean;
1365
+ entitySynthesisMaxTokens: number;
1366
+
1367
+ // v6.0 Fact deduplication & archival
1368
+ /** Enable content-hash deduplication to prevent storing semantically identical facts. */
1369
+ factDeduplicationEnabled: boolean;
1370
+ /**
1371
+ * Issue #373 — Write-time semantic similarity guard. When enabled (default),
1372
+ * the orchestrator embeds each candidate fact and queries the existing
1373
+ * embedding index for its top-K nearest neighbors. If the best cosine
1374
+ * similarity is at or above `semanticDedupThreshold`, the fact is dropped
1375
+ * as a near-duplicate. Fails open (keeps the fact) if the embedding backend
1376
+ * is unavailable.
1377
+ */
1378
+ semanticDedupEnabled: boolean;
1379
+ /** Cosine similarity threshold in [0, 1] above which a candidate fact is skipped. */
1380
+ semanticDedupThreshold: number;
1381
+ /** Number of nearest-neighbor candidates to consider during semantic dedup. */
1382
+ semanticDedupCandidates: number;
1383
+ /** Enable automatic archival of old, low-importance, rarely-accessed facts. */
1384
+ factArchivalEnabled: boolean;
1385
+ /** Minimum age in days before a fact is eligible for archival. */
1386
+ factArchivalAgeDays: number;
1387
+ /** Maximum importance score for archival eligibility (0-1). Only facts below this are archived. */
1388
+ factArchivalMaxImportance: number;
1389
+ /** Maximum access count for archival eligibility. Only rarely-accessed facts are archived. */
1390
+ factArchivalMaxAccessCount: number;
1391
+ /** Tags that protect a fact from archival regardless of other criteria. */
1392
+ factArchivalProtectedCategories: string[];
1393
+ // v8.3 Lifecycle policy engine
1394
+ lifecyclePolicyEnabled: boolean;
1395
+ lifecycleFilterStaleEnabled: boolean;
1396
+ lifecyclePromoteHeatThreshold: number;
1397
+ lifecycleStaleDecayThreshold: number;
1398
+ lifecycleArchiveDecayThreshold: number;
1399
+ lifecycleProtectedCategories: MemoryCategory[];
1400
+ lifecycleMetricsEnabled: boolean;
1401
+ // v8.3 proactive + policy learning
1402
+ proactiveExtractionEnabled: boolean;
1403
+ contextCompressionActionsEnabled: boolean;
1404
+ compressionGuidelineLearningEnabled: boolean;
1405
+ compressionGuidelineSemanticRefinementEnabled: boolean;
1406
+ compressionGuidelineSemanticTimeoutMs: number;
1407
+ maxProactiveQuestionsPerExtraction: number;
1408
+ proactiveExtractionTimeoutMs: number;
1409
+ proactiveExtractionMaxTokens: number;
1410
+ extractionMaxOutputTokens: number;
1411
+ proactiveExtractionCategoryAllowlist?: MemoryCategory[];
1412
+ maxCompressionTokensPerHour: number;
1413
+ behaviorLoopAutoTuneEnabled: boolean;
1414
+ behaviorLoopLearningWindowDays: number;
1415
+ behaviorLoopMinSignalCount: number;
1416
+ behaviorLoopMaxDeltaPerCycle: number;
1417
+ behaviorLoopProtectedParams: string[];
1418
+ // v8.0 Phase 1: recall planner + intent routing + verbatim artifacts
1419
+ recallPlannerEnabled: boolean;
1420
+ recallPlannerModel: string;
1421
+ recallPlannerTimeoutMs: number;
1422
+ recallPlannerUseResponsesApi: boolean;
1423
+ recallPlannerMaxPromptChars: number;
1424
+ recallPlannerMaxMemoryHints: number;
1425
+ recallPlannerShadowMode: boolean;
1426
+ recallPlannerTelemetryEnabled: boolean;
1427
+ recallPlannerMaxQmdResultsMinimal: number;
1428
+ recallPlannerMaxQmdResultsFull: number;
1429
+ intentRoutingEnabled: boolean;
1430
+ intentRoutingBoost: number;
1431
+ verbatimArtifactsEnabled: boolean;
1432
+ verbatimArtifactsMinConfidence: number;
1433
+ verbatimArtifactsMaxRecall: number;
1434
+ verbatimArtifactCategories: MemoryCategory[];
1435
+ // v8.0 Phase 2A: Memory Boxes + Trace Weaving
1436
+ memoryBoxesEnabled: boolean;
1437
+ /** Jaccard overlap threshold below which a topic shift triggers box sealing (0-1, default 0.35) */
1438
+ boxTopicShiftThreshold: number;
1439
+ /** Time gap in ms before an open box is sealed (default 30 min) */
1440
+ boxTimeGapMs: number;
1441
+ /** Max memories per box before forced seal */
1442
+ boxMaxMemories: number;
1443
+ traceWeaverEnabled: boolean;
1444
+ /** Days back to search for trace links */
1445
+ traceWeaverLookbackDays: number;
1446
+ /** Minimum Jaccard overlap to assign the same traceId (0-1, default 0.4) */
1447
+ traceWeaverOverlapThreshold: number;
1448
+ /** Number of recent days of boxes to inject during recall */
1449
+ boxRecallDays: number;
1450
+ // v8.0 Phase 2B: Episode/Note dual store (HiMem)
1451
+ /** Classify extracted memories as episode or note and tag with memoryKind */
1452
+ episodeNoteModeEnabled: boolean;
1453
+ // v8.1 Temporal + Tag Indexes (SwiftMem-inspired)
1454
+ /** Build and maintain temporal (state/index_time.json) and tag (state/index_tags.json) indexes */
1455
+ queryAwareIndexingEnabled: boolean;
1456
+ /** Max candidate paths returned from index prefilter (0 = no cap) */
1457
+ queryAwareIndexingMaxCandidates: number;
1458
+ temporalIndexWindowDays: number;
1459
+ temporalIndexMaxEntries: number;
1460
+ temporalBoostRecentDays: number;
1461
+ temporalBoostScore: number;
1462
+ temporalDecayEnabled: boolean;
1463
+ tagMemoryEnabled: boolean;
1464
+ tagMaxPerMemory: number;
1465
+ tagIndexMaxEntries: number;
1466
+ tagRecallBoost: number;
1467
+ tagRecallMaxMatches: number;
1468
+ // v8.2 multi-graph memory (PR 18)
1469
+ multiGraphMemoryEnabled: boolean;
1470
+ // v8.2 PR 19A: graph recall planner gating
1471
+ graphRecallEnabled: boolean;
1472
+ graphRecallMaxExpansions: number;
1473
+ graphRecallMaxPerSeed: number;
1474
+ graphRecallMinEdgeWeight: number;
1475
+ graphRecallShadowEnabled: boolean;
1476
+ graphRecallSnapshotEnabled: boolean;
1477
+ graphRecallShadowSampleRate: number;
1478
+ graphRecallExplainToolEnabled: boolean;
1479
+ graphRecallStoreColdMirror: boolean;
1480
+ graphRecallColdMirrorCollection?: string;
1481
+ graphRecallColdMirrorMinAgeDays: number;
1482
+ graphRecallUseEntityPriors: boolean;
1483
+ graphRecallEntityPriorBoost: number;
1484
+ graphRecallPreferHubSeeds: boolean;
1485
+ graphRecallHubBias: number;
1486
+ graphRecallRecencyHalfLifeDays: number;
1487
+ graphRecallDampingFactor: number;
1488
+ graphRecallMaxSeedNodes: number;
1489
+ graphRecallMaxExpandedNodes: number;
1490
+ graphRecallMaxTrailPerNode: number;
1491
+ graphRecallMinSeedScore: number;
1492
+ graphRecallExpansionScoreThreshold: number;
1493
+ graphRecallExplainMaxPaths: number;
1494
+ graphRecallExplainMaxChars: number;
1495
+ graphRecallExplainEdgeLimit: number;
1496
+ graphRecallExplainEnabled: boolean;
1497
+ graphRecallEntityHintsEnabled: boolean;
1498
+ graphRecallEntityHintMax: number;
1499
+ graphRecallEntityHintMaxChars: number;
1500
+ graphRecallSnapshotDir: string;
1501
+ graphRecallEnableTrace: boolean;
1502
+ graphRecallEnableDebug: boolean;
1503
+ /** Allow graph_mode escalation for broader causal/timeline phrasing beyond strict keywords. */
1504
+ graphExpandedIntentEnabled?: boolean;
1505
+ /** Run bounded graph expansion in full mode when enough recall seeds exist. */
1506
+ graphAssistInFullModeEnabled?: boolean;
1507
+ /** In full mode, compute graph assist for telemetry/snapshotting but do not inject merged results. */
1508
+ graphAssistShadowEvalEnabled?: boolean;
1509
+ /** Minimum seed results required before full-mode graph assist runs. */
1510
+ graphAssistMinSeedResults?: number;
1511
+ entityGraphEnabled: boolean;
1512
+ timeGraphEnabled: boolean;
1513
+ /** When true, write fallback temporal adjacency edges for consecutive extracted memories. */
1514
+ graphWriteSessionAdjacencyEnabled?: boolean;
1515
+ causalGraphEnabled: boolean;
1516
+ maxGraphTraversalSteps: number;
1517
+ graphActivationDecay: number;
1518
+ /** Weight of graph activation score when blending with seed QMD score (0-1). */
1519
+ graphExpansionActivationWeight: number;
1520
+ /** Lower bound for blended graph-expanded recall scores (0-1). */
1521
+ graphExpansionBlendMin: number;
1522
+ /** Upper bound for blended graph-expanded recall scores (0-1). */
1523
+ graphExpansionBlendMax: number;
1524
+ maxEntityGraphEdgesPerMemory: number;
1525
+ /** SimpleMem-inspired de-linearization: resolve pronouns and anchor relative dates after extraction. */
1526
+ delinearizeEnabled: boolean;
1527
+ /** Synapse-inspired confidence gate — skip memory injection when top score is below threshold. */
1528
+ recallConfidenceGateEnabled: boolean;
1529
+ recallConfidenceGateThreshold: number;
1530
+ /** PlugMem-inspired causal rule extraction: mine IF→THEN rules during consolidation. */
1531
+ causalRuleExtractionEnabled: boolean;
1532
+ /** E-Mem-inspired memory reconstruction: targeted retrieval for missing entity context. */
1533
+ memoryReconstructionEnabled: boolean;
1534
+ /** Maximum number of entity expansions per recall. */
1535
+ memoryReconstructionMaxExpansions: number;
1536
+ /** Synapse-inspired lateral inhibition to suppress hub-node dominance. */
1537
+ graphLateralInhibitionEnabled: boolean;
1538
+ /** Inhibition strength (default 0.15). Higher = more suppression. */
1539
+ graphLateralInhibitionBeta: number;
1540
+ /** Number of top competing nodes considered for inhibition (default 7). */
1541
+ graphLateralInhibitionTopM: number;
1542
+
1543
+ // Issue #681 PR 2/3 — graph-edge confidence decay maintenance.
1544
+ /** Enable the periodic graph-edge confidence decay job. Default false (opt-in). */
1545
+ graphEdgeDecayEnabled: boolean;
1546
+ /** Cadence in milliseconds at which the cron triggers the decay job. Default 7d. */
1547
+ graphEdgeDecayCadenceMs: number;
1548
+ /** Decay window passed through to `decayEdgeConfidence`. Default 90 days. */
1549
+ graphEdgeDecayWindowMs: number;
1550
+ /** Per-window confidence drop. Default 0.1. */
1551
+ graphEdgeDecayPerWindow: number;
1552
+ /** Floor confidence will not decay below. Default 0.1. */
1553
+ graphEdgeDecayFloor: number;
1554
+ /** Confidence threshold for the "below visibility" telemetry counter. Default 0.2. */
1555
+ graphEdgeDecayVisibilityThreshold: number;
1556
+
1557
+ /**
1558
+ * Issue #681 PR 3/3 — minimum edge confidence required for an edge to be
1559
+ * traversed during spreading activation. Edges with `confidence` below this
1560
+ * floor are pruned and contribute neither activation nor downstream
1561
+ * neighbors. Legacy edges without `confidence` are treated as 1.0 so they
1562
+ * always pass the floor. Range `[0, 1]`; default `0.2`.
1563
+ */
1564
+ graphTraversalConfidenceFloor: number;
1565
+ /**
1566
+ * Issue #681 PR 3/3 — number of PageRank-style refinement iterations applied
1567
+ * on top of the BFS spreading-activation scores. Each iteration redistributes
1568
+ * a node's confidence-weighted activation along its outgoing edges. Set to 0
1569
+ * to disable refinement and use raw BFS scores. Default `8`.
1570
+ */
1571
+ graphTraversalPageRankIterations: number;
1572
+ // v8.2: Temporal Memory Tree
1573
+ temporalMemoryTreeEnabled: boolean;
1574
+ tmtHourlyMinMemories: number;
1575
+ tmtSummaryMaxTokens: number;
1576
+ // Explicit cue recall
1577
+ /** Front-load exact stored evidence for query-visible cues like turns, dates, ids, files, and tools. */
1578
+ explicitCueRecallEnabled: boolean;
1579
+ /** Character budget for the explicit cue evidence section. */
1580
+ explicitCueRecallMaxChars: number;
1581
+ /** Maximum query-visible cues expanded per recall. */
1582
+ explicitCueRecallMaxReferences: number;
1583
+ /** Enable targeted fact evidence recall for direct answer questions. */
1584
+ targetedFactRecallEnabled: boolean;
1585
+ /** Character budget for the targeted fact evidence section. */
1586
+ targetedFactRecallMaxChars: number;
1587
+ /** Maximum recalled items for targeted fact evidence. */
1588
+ targetedFactRecallMaxResults: number;
1589
+ /** Recent-turn scan window for targeted fact evidence. */
1590
+ targetedFactRecallScanWindowTurns: number;
1591
+ /** Recent-token scan window for targeted fact evidence. */
1592
+ targetedFactRecallScanWindowTokens: number;
1593
+ /** Enable focused list evidence recall for count, relation, and recommendation questions. */
1594
+ focusedListRecallEnabled: boolean;
1595
+ /** Character budget for the focused list evidence section. */
1596
+ focusedListRecallMaxChars: number;
1597
+ /** Maximum recalled items for focused list evidence. */
1598
+ focusedListRecallMaxResults: number;
1599
+ /** Recent-turn scan window for focused list evidence. */
1600
+ focusedListRecallScanWindowTurns: number;
1601
+ /** Recent-token scan window for focused list evidence. */
1602
+ focusedListRecallScanWindowTokens: number;
1603
+ /** Enable response guidance recall for user answer-shape preferences. */
1604
+ responseGuidanceRecallEnabled: boolean;
1605
+ /** Character budget for the response guidance recall section. */
1606
+ responseGuidanceRecallMaxChars: number;
1607
+ /** Maximum recalled items for response guidance. */
1608
+ responseGuidanceRecallMaxResults: number;
1609
+ /** Recent-turn scan window for response guidance. */
1610
+ responseGuidanceRecallScanWindowTurns: number;
1611
+ /** Recent-token scan window for response guidance. */
1612
+ responseGuidanceRecallScanWindowTokens: number;
1613
+ /** Enable event-order evidence recall for chronology questions. */
1614
+ eventOrderRecallEnabled: boolean;
1615
+ /** Character budget for the event-order evidence section. */
1616
+ eventOrderRecallMaxChars: number;
1617
+ /** Maximum recalled items for event-order evidence. */
1618
+ eventOrderRecallMaxResults: number;
1619
+ /** Recent-turn scan window for event-order evidence. */
1620
+ eventOrderRecallScanWindowTurns: number;
1621
+ /** Recent-token scan window for event-order evidence. */
1622
+ eventOrderRecallScanWindowTokens: number;
1623
+ // Lossless Context Management (LCM)
1624
+ lcmEnabled: boolean;
1625
+ lcmLeafBatchSize: number;
1626
+ lcmRollupFanIn: number;
1627
+ lcmFreshTailTurns: number;
1628
+ lcmMaxDepth: number;
1629
+ lcmRecallBudgetShare: number;
1630
+ lcmDeterministicMaxTokens: number;
1631
+ lcmArchiveRetentionDays: number;
1632
+ /** Max independent LCM observe jobs to process concurrently. Default 1. */
1633
+ lcmObserveConcurrency: number;
1634
+ /** Opt-in structured message-part capture/recall sidecar for LCM. Default false. */
1635
+ messagePartsEnabled: boolean;
1636
+ /** Max structured file/tool matches injected into recall. */
1637
+ messagePartsRecallMaxResults: number;
1638
+
1639
+ // v9.1 Parallel Specialized Retrieval (ASMR-inspired)
1640
+ /** Enable three-agent parallel retrieval (DirectFact + Contextual + Temporal). Default false. */
1641
+ parallelRetrievalEnabled: boolean;
1642
+ /** Per-agent source weights for score blending during merge. */
1643
+ parallelAgentWeights: { direct: number; contextual: number; temporal: number };
1644
+ /** Max results fetched per agent before merge. */
1645
+ parallelMaxResultsPerAgent: number;
1646
+
1647
+ // Daily Context Briefing (Issue #370)
1648
+ /** Briefing configuration knobs — see BriefingConfig for field docs. */
1649
+ briefing: BriefingConfig;
1650
+
1651
+ // Codex CLI connector settings (install-time)
1652
+ codex: CodexConnectorConfig;
1653
+
1654
+ // Live connectors (issue #683). Concrete implementations live under
1655
+ // packages/remnic-core/src/connectors/live/. Each child block maps to one
1656
+ // connector. All defaults are off — operators opt in.
1657
+ connectors: LiveConnectorsConfig;
1658
+
1659
+ // MECE Taxonomy (#366)
1660
+ /** Enable the MECE taxonomy knowledge directory. Default false. */
1661
+ taxonomyEnabled: boolean;
1662
+ /** Auto-regenerate RESOLVER.md when taxonomy changes. Default true. */
1663
+ taxonomyAutoGenResolver: boolean;
1664
+
1665
+ // Codex CLI — native memory materialization (#378)
1666
+ /** Materialize Remnic memories into Codex's expected ~/.codex/memories/ layout. Default true. */
1667
+ codexMaterializeMemories: boolean;
1668
+ /** Namespace to materialize; "auto" derives from the connector context. Default "auto". */
1669
+ codexMaterializeNamespace: string;
1670
+ /** Max whitespace-tokenized size of memory_summary.md. Default 4500. */
1671
+ codexMaterializeMaxSummaryTokens: number;
1672
+ /** Max age in days for rollout_summaries/*.md before pruning. Default 30. */
1673
+ codexMaterializeRolloutRetentionDays: number;
1674
+ /** Run materialization after semantic/causal consolidation completes. Default true. */
1675
+ codexMaterializeOnConsolidation: boolean;
1676
+ /** Run materialization at Codex session-end hook. Default true. */
1677
+ codexMaterializeOnSessionEnd: boolean;
1678
+ /** Enable Codex marketplace integration. Default true. */
1679
+ codexMarketplaceEnabled: boolean;
1680
+
1681
+ // Page-level versioning (issue #371)
1682
+ /** Enable page-level versioning with sidecar snapshots. Default false. */
1683
+ versioningEnabled: boolean;
1684
+ /** Maximum number of version snapshots to keep per page. Default 50. Set to 0 to disable pruning. */
1685
+ versioningMaxPerPage: number;
1686
+ /** Name of the sidecar directory inside memoryDir. Default ".versions". */
1687
+ versioningSidecarDir: string;
1688
+
1689
+ // Binary file lifecycle management (#367)
1690
+ /** Enable binary file lifecycle management (mirror, redirect, clean). Default: false. */
1691
+ binaryLifecycleEnabled: boolean;
1692
+ /** Grace period in days before a mirrored binary is eligible for local cleanup. Default: 7. */
1693
+ binaryLifecycleGracePeriodDays: number;
1694
+ /** Storage backend type: "filesystem" copies to a local dir, "none" is no-op. Default: "none". */
1695
+ binaryLifecycleBackendType: "filesystem" | "s3" | "none";
1696
+ /** Base path for the filesystem backend. Required when backendType is "filesystem". */
1697
+ binaryLifecycleBackendPath: string;
1698
+
1699
+ // Codex citation parity (issue #379)
1700
+ /** Enable oai-mem-citation blocks in recall responses. Default false. */
1701
+ citationsEnabled: boolean;
1702
+ /** Auto-enable citations when the Codex adapter is detected. Default true. */
1703
+ citationsAutoDetect: boolean;
1704
+
1705
+ // External enrichment pipeline (issue #365)
1706
+ /** Enable the external enrichment pipeline. Default false. */
1707
+ enrichmentEnabled: boolean;
1708
+ /** Automatically enrich new entities on creation. Default false. */
1709
+ enrichmentAutoOnCreate: boolean;
1710
+ /** Max candidates accepted per entity per enrichment run. Default 20. */
1711
+ enrichmentMaxCandidatesPerEntity: number;
1712
+
1713
+ // Memory extensions discovery (#382)
1714
+ /** Whether third-party memory extensions are discovered and injected into consolidation. Default true. */
1715
+ memoryExtensionsEnabled: boolean;
1716
+ /**
1717
+ * Root directory for memory extensions. Empty string means derive from
1718
+ * memoryDir: go up to the Remnic home dir and append memory_extensions.
1719
+ */
1720
+ memoryExtensionsRoot: string;
1721
+ }
1722
+
1723
+ /** Runtime configuration for the daily context briefing feature. */
1724
+ export interface BriefingConfig {
1725
+ /** Whether `remnic briefing` CLI and MCP tool are enabled. */
1726
+ enabled: boolean;
1727
+ /** Default lookback window token (e.g. "yesterday", "3d", "1w", "24h"). */
1728
+ defaultWindow: string;
1729
+ /** Default output format for the CLI. */
1730
+ defaultFormat: "markdown" | "json";
1731
+ /** Maximum number of LLM-generated suggested follow-ups. */
1732
+ maxFollowups: number;
1733
+ /** Optional path to an ICS or JSON calendar file. null disables the section. */
1734
+ calendarSource: string | null;
1735
+ /** If true, CLI writes a dated briefing file by default. */
1736
+ saveByDefault: boolean;
1737
+ /** Override directory for saved briefings. null → $REMNIC_HOME/briefings/. */
1738
+ saveDir: string | null;
1739
+ /** Whether to call the Responses API for follow-up suggestions. */
1740
+ llmFollowups: boolean;
1741
+ }
1742
+
1743
+ /** Parsed representation of a briefing lookback window. */
1744
+ export type BriefingWindow = "yesterday" | "today" | string;
1745
+
1746
+ /** Filter the briefing to a single entity / project / topic. */
1747
+ export interface BriefingFocus {
1748
+ type: "person" | "project" | "topic";
1749
+ value: string;
1750
+ }
1751
+
1752
+ /** Calendar event surfaced by a CalendarSource implementation. */
1753
+ export interface CalendarEvent {
1754
+ /** Stable identifier for dedupe / linking. */
1755
+ id: string;
1756
+ /** Event title (short). */
1757
+ title: string;
1758
+ /** ISO 8601 start timestamp. */
1759
+ start: string;
1760
+ /** Optional ISO 8601 end timestamp. */
1761
+ end?: string;
1762
+ /** Optional freeform location. */
1763
+ location?: string;
1764
+ /** Optional short notes. */
1765
+ notes?: string;
1766
+ }
1767
+
1768
+ /** Abstraction over any calendar backend. Concrete implementations: `FileCalendarSource`. */
1769
+ export interface CalendarSource {
1770
+ /** Return events that fall on the given UTC date (YYYY-MM-DD). */
1771
+ eventsForDate(dateIso: string): Promise<CalendarEvent[]>;
1772
+ }
1773
+
1774
+ /** A single "active thread" surfaced in a briefing. */
1775
+ export interface BriefingActiveThread {
1776
+ id: string;
1777
+ title: string;
1778
+ updatedAt: string;
1779
+ reason: string;
1780
+ }
1781
+
1782
+ /** A single "recent entity" entry. */
1783
+ export interface BriefingRecentEntity {
1784
+ name: string;
1785
+ type: string;
1786
+ updatedAt: string;
1787
+ score: number;
1788
+ summary?: string;
1789
+ }
1790
+
1791
+ /** A single unresolved commitment or open question. */
1792
+ export interface BriefingOpenCommitment {
1793
+ id: string;
1794
+ kind: "question" | "commitment" | "pending_memory";
1795
+ text: string;
1796
+ source?: string;
1797
+ createdAt?: string;
1798
+ }
1799
+
1800
+ /** An LLM-generated short follow-up suggestion. */
1801
+ export interface BriefingFollowup {
1802
+ text: string;
1803
+ rationale?: string;
1804
+ }
1805
+
1806
+ /** Structured sections of a briefing result. */
1807
+ export interface BriefingSections {
1808
+ activeThreads: BriefingActiveThread[];
1809
+ recentEntities: BriefingRecentEntity[];
1810
+ openCommitments: BriefingOpenCommitment[];
1811
+ suggestedFollowups: BriefingFollowup[];
1812
+ /** Only populated when a calendar source is configured and returns events. */
1813
+ todayCalendar?: CalendarEvent[];
1814
+ }
1815
+
1816
+ /** A calendar source failure recorded when a CalendarSource throws during briefing generation. */
1817
+ export interface BriefingCalendarSourceError {
1818
+ /** Human-readable description of the source (e.g. file path or source name). */
1819
+ source: string;
1820
+ /** Stringified error message from the failed source. */
1821
+ error: string;
1822
+ }
1823
+
1824
+ /** Result returned by `buildBriefing`. */
1825
+ export interface BriefingResult {
1826
+ markdown: string;
1827
+ json: Record<string, unknown>;
1828
+ sections: BriefingSections;
1829
+ /** Reason why suggested follow-ups were omitted (e.g. missing API key, LLM error). */
1830
+ followupsUnavailableReason?: string;
1831
+ /** Effective lookback window (ISO date range) used for this briefing. */
1832
+ window: { from: string; to: string };
1833
+ /**
1834
+ * Calendar sources that failed during this briefing run.
1835
+ * Only present (non-empty) when at least one source threw.
1836
+ * Allows callers to distinguish "no events today" from "source unavailable".
1837
+ */
1838
+ calendarSourceErrors?: BriefingCalendarSourceError[];
1839
+ }
1840
+
1841
+ /**
1842
+ * Settings for the Codex CLI connector. These are consumed by
1843
+ * `remnic connectors install codex-cli` to decide where the phase-2 memory
1844
+ * extension is dropped and whether to install it at all.
1845
+ */
1846
+ export interface CodexConnectorConfig {
1847
+ /**
1848
+ * Whether to install the Remnic memory extension into
1849
+ * `<codex_home>/memories_extensions/remnic/` when the `codex-cli`
1850
+ * connector is installed. Default `true`. Set to `false` for users who
1851
+ * self-manage the Codex memory extensions folder.
1852
+ */
1853
+ installExtension: boolean;
1854
+ /**
1855
+ * Optional override for the Codex home directory. When `null`, the
1856
+ * connector reads `$CODEX_HOME` and falls back to `~/.codex`. Setting
1857
+ * this is useful for integration tests and non-default installs.
1858
+ */
1859
+ codexHome: string | null;
1860
+ }
1861
+
1862
+ /**
1863
+ * Container for live-connector config blocks (issue #683 PR 2/N).
1864
+ *
1865
+ * Lives at `connectors.*` rather than the top level so future connectors
1866
+ * (Notion, Gmail, GitHub) can slot in without bloating `PluginConfig`.
1867
+ *
1868
+ * Every child block must default to `enabled: false` per CLAUDE.md gotcha
1869
+ * #30 (escape hatch by default) and gotcha #48 (least-privileged enum
1870
+ * defaults). Concrete connectors are also expected to short-circuit at
1871
+ * registration time when their credentials are not populated.
1872
+ */
1873
+ export interface LiveConnectorsConfig {
1874
+ /** Google Drive live connector (issue #683 PR 2/N). */
1875
+ googleDrive: GoogleDriveLiveConnectorConfig;
1876
+ /** Notion live connector (issue #683 PR 3/N). */
1877
+ notion: NotionLiveConnectorConfig;
1878
+ /** Gmail live connector (issue #683 PR 4/6). */
1879
+ gmail: GmailLiveConnectorConfig;
1880
+ /** GitHub live connector (issue #683 PR 5/6). */
1881
+ github: GitHubLiveConnectorConfig;
1882
+ }
1883
+
1884
+ /**
1885
+ * Operator-facing config for the Google Drive live connector. The connector
1886
+ * module itself defines a separate, *validated* `GoogleDriveConnectorConfig`
1887
+ * shape (frozen, post-validation). This interface is the pre-validation
1888
+ * shape that `parseConfig` round-trips through.
1889
+ *
1890
+ * `clientId` / `clientSecret` / `refreshToken` are stored as strings here so
1891
+ * the schema can ship in `openclaw.plugin.json` and operators can populate
1892
+ * them from a secret store (e.g. an env-substituted plist or systemd
1893
+ * EnvironmentFile). They MUST NEVER be committed to source. The repo-wide
1894
+ * privacy policy in CLAUDE.md applies.
1895
+ */
1896
+ export interface GoogleDriveLiveConnectorConfig {
1897
+ /** Master gate. Default false — operators must opt in explicitly. */
1898
+ enabled: boolean;
1899
+ /** OAuth2 client id. Populate from a secret store; never commit. */
1900
+ clientId: string;
1901
+ /** OAuth2 client secret. Populate from a secret store; never commit. */
1902
+ clientSecret: string;
1903
+ /** OAuth2 refresh token. Populate from a secret store; never commit. */
1904
+ refreshToken: string;
1905
+ /** Poll interval in ms. Default 300000 (5 min); min 1000; max 86400000 (24h). */
1906
+ pollIntervalMs: number;
1907
+ /** Optional folder-id scope. Empty array = all accessible files. */
1908
+ folderIds: string[];
1909
+ }
1910
+
1911
+ /**
1912
+ * Operator-facing config for the Notion live connector (issue #683 PR 3/N).
1913
+ * The connector module defines a separate validated `NotionConnectorConfig`
1914
+ * shape (frozen, post-validation). This interface is the pre-validation shape
1915
+ * that `parseConfig` round-trips through.
1916
+ *
1917
+ * `token` is stored as a string here so operators can populate it from a
1918
+ * secret store (e.g. an env-substituted plist or systemd EnvironmentFile).
1919
+ * It MUST NEVER be committed to source. The repo-wide privacy policy in
1920
+ * CLAUDE.md applies.
1921
+ */
1922
+ export interface NotionLiveConnectorConfig {
1923
+ /** Master gate. Default false — operators must opt in explicitly. */
1924
+ enabled: boolean;
1925
+ /** Notion integration token. Starts with `secret_`. Populate from a secret store; never commit. */
1926
+ token: string;
1927
+ /** Array of Notion database ids to import pages from. Empty = connector is a no-op. */
1928
+ databaseIds: string[];
1929
+ /** Poll interval in ms. Default 300000 (5 min); min 1000; max 86400000 (24h). */
1930
+ pollIntervalMs: number;
1931
+ }
1932
+
1933
+ /**
1934
+ * Operator-facing config for the Gmail live connector (issue #683 PR 4/6).
1935
+ * The connector module defines a separate validated `GmailConnectorConfig`
1936
+ * shape (frozen, post-validation). This interface is the pre-validation shape
1937
+ * that `parseConfig` round-trips through.
1938
+ *
1939
+ * OAuth2 credentials are stored as strings here so operators can populate
1940
+ * them from a secret store (e.g. env-substituted plist or systemd
1941
+ * EnvironmentFile). They MUST NEVER be committed to source. The repo-wide
1942
+ * privacy policy in CLAUDE.md applies.
1943
+ */
1944
+ export interface GmailLiveConnectorConfig {
1945
+ /** Master gate. Default false — operators must opt in explicitly. */
1946
+ enabled: boolean;
1947
+ /** OAuth2 client id. Populate from a secret store; never commit. */
1948
+ clientId: string;
1949
+ /** OAuth2 client secret. Populate from a secret store; never commit. */
1950
+ clientSecret: string;
1951
+ /** OAuth2 refresh token issued for the Gmail scope. Populate from a secret store; never commit. */
1952
+ refreshToken: string;
1953
+ /** Gmail userId. Defaults to "me" (the authenticated user). */
1954
+ userId: string;
1955
+ /** Gmail search query applied in addition to the watermark filter. Default "in:inbox". */
1956
+ query: string;
1957
+ /** Poll interval in ms. Default 300000 (5 min); min 1000; max 86400000 (24h). */
1958
+ pollIntervalMs: number;
1959
+ }
1960
+
1961
+ /**
1962
+ * Operator-facing config for the GitHub live connector (issue #683 PR 5/6).
1963
+ * The connector module defines a separate validated `GitHubConnectorConfig`
1964
+ * shape (frozen, post-validation). This interface is the pre-validation shape
1965
+ * that `parseConfig` round-trips through.
1966
+ *
1967
+ * `token` is stored as a string here so operators can populate it from a
1968
+ * secret store (e.g. an env-substituted plist or systemd EnvironmentFile).
1969
+ * It MUST NEVER be committed to source. The repo-wide privacy policy in
1970
+ * CLAUDE.md applies.
1971
+ */
1972
+ export interface GitHubLiveConnectorConfig {
1973
+ /** Master gate. Default false — operators must opt in explicitly. */
1974
+ enabled: boolean;
1975
+ /** GitHub personal access token. Populate from a secret store; never commit. */
1976
+ token: string;
1977
+ /** GitHub login of the user whose comments will be imported. Required. */
1978
+ userLogin: string;
1979
+ /** Repos to poll in "owner/repo" format. Empty = connector is a no-op. */
1980
+ repos: string[];
1981
+ /** Poll interval in ms. Default 300000 (5 min); min 1000; max 86400000 (24h). */
1982
+ pollIntervalMs: number;
1983
+ /** Whether to fetch Discussion comments in addition to issue/PR comments. Default false. */
1984
+ includeDiscussions: boolean;
1985
+ }
1986
+
1987
+ export interface BootstrapOptions {
1988
+ dryRun?: boolean;
1989
+ sessionsDir?: string;
1990
+ limit?: number;
1991
+ since?: Date;
1992
+ }
1993
+
1994
+ export interface BootstrapResult {
1995
+ sessionsScanned: number;
1996
+ turnsProcessed: number;
1997
+ highSignalTurns: number;
1998
+ memoriesCreated: number;
1999
+ skipped: number;
2000
+ }
2001
+
2002
+ export interface PrincipalRule {
2003
+ match: string;
2004
+ principal: string;
2005
+ }
2006
+
2007
+ export interface NamespacePolicy {
2008
+ name: string;
2009
+ readPrincipals: string[];
2010
+ writePrincipals: string[];
2011
+ includeInRecallByDefault?: boolean;
2012
+ }
2013
+
2014
+ export interface RelevanceFeedback {
2015
+ up: number;
2016
+ down: number;
2017
+ lastUpdatedAt: string;
2018
+ notes?: string[];
2019
+ }
2020
+
2021
+ export interface BufferTurn {
2022
+ role: "user" | "assistant";
2023
+ content: string;
2024
+ timestamp: string;
2025
+ sourceValidAt?: string;
2026
+ sessionKey?: string;
2027
+ logicalSessionKey?: string;
2028
+ providerThreadId?: string | null;
2029
+ turnFingerprint?: string;
2030
+ persistProcessedFingerprint?: boolean;
2031
+ extractionContextOnly?: boolean;
2032
+ parts?: import("./message-parts/index.js").LcmMessagePartInput[];
2033
+ rawContent?: unknown;
2034
+ sourceFormat?: import("./message-parts/index.js").MessagePartSourceFormat;
2035
+ }
2036
+
2037
+ export interface BufferEntryState {
2038
+ turns: BufferTurn[];
2039
+ lastExtractionAt: string | null;
2040
+ extractionCount: number;
2041
+ /**
2042
+ * Turns retained across `clearAfterExtraction` so a later extraction pass
2043
+ * sees the context that caused a defer verdict (issue #562, PR 2). Bounded
2044
+ * to the configured retention cap by `retainDeferredTurns`. Empty / absent
2045
+ * means no retention in effect.
2046
+ */
2047
+ retainedTurns?: BufferTurn[];
2048
+ }
2049
+
2050
+ export interface BufferState {
2051
+ turns: BufferTurn[];
2052
+ lastExtractionAt: string | null;
2053
+ extractionCount: number;
2054
+ entries?: Record<string, BufferEntryState>;
2055
+ }
2056
+
2057
+ export interface BehaviorLoopAdjustment {
2058
+ parameter: string;
2059
+ previousValue: number;
2060
+ nextValue: number;
2061
+ delta: number;
2062
+ evidenceCount: number;
2063
+ confidence: number;
2064
+ reason: string;
2065
+ appliedAt: string;
2066
+ }
2067
+
2068
+ export interface BehaviorLoopPolicyState {
2069
+ version: number;
2070
+ windowDays: number;
2071
+ minSignalCount: number;
2072
+ maxDeltaPerCycle: number;
2073
+ protectedParams: string[];
2074
+ adjustments: BehaviorLoopAdjustment[];
2075
+ updatedAt: string;
2076
+ }
2077
+
2078
+ export type BehaviorSignalType = "correction_override" | "preference_affinity" | "topic_revisitation" | "action_pattern" | "outcome_preference" | "phrasing_style";
2079
+ export type BehaviorSignalDirection = "positive" | "negative";
2080
+
2081
+ export interface BehaviorSignalEvent {
2082
+ timestamp: string;
2083
+ namespace: string;
2084
+ memoryId: string;
2085
+ category: Extract<MemoryCategory, "correction" | "preference">;
2086
+ signalType: BehaviorSignalType;
2087
+ direction: BehaviorSignalDirection;
2088
+ confidence: number;
2089
+ signalHash: string;
2090
+ source: "extraction" | "correction";
2091
+ }
2092
+
2093
+ /**
2094
+ * One row of the buffer-surprise telemetry ledger (issue #563 PR 3).
2095
+ *
2096
+ * Emitted by `SmartBuffer` each time the surprise probe produces a score
2097
+ * for an incoming turn (i.e. the feature flag is on and the existing
2098
+ * trigger-logic path called through to the probe). Not written when the
2099
+ * probe is skipped — the absence of a row is meaningful and matches the
2100
+ * "probe was not consulted" state.
2101
+ *
2102
+ * The ledger is intentionally lean: we record the score, the threshold in
2103
+ * force, whether the turn caused a flush, and the turn count so operators
2104
+ * can re-derive precision/recall without replaying traffic. Turn content
2105
+ * is never persisted — this ledger is safe to commit to shared storage.
2106
+ */
2107
+ export interface BufferSurpriseEvent {
2108
+ /** Literal tag to simplify multiplexed log consumers. */
2109
+ event: "BUFFER_SURPRISE";
2110
+ /** ISO timestamp when the decision was made. Server-side, not turn ts. */
2111
+ timestamp: string;
2112
+ /** Buffer identifier (session / thread). Opaque string. */
2113
+ bufferKey: string;
2114
+ /** Session key if available; null when the turn has no session binding. */
2115
+ sessionKey: string | null;
2116
+ /** Role of the scored turn. */
2117
+ turnRole: "user" | "assistant";
2118
+ /** Surprise score in `[0, 1]`, already clamped. */
2119
+ surpriseScore: number;
2120
+ /** Threshold in force when the decision was made. */
2121
+ threshold: number;
2122
+ /** Whether this turn upgraded `keep_buffering` → `extract_now`. */
2123
+ triggeredFlush: boolean;
2124
+ /** Number of turns in the buffer (including the current turn). */
2125
+ turnCountInWindow: number;
2126
+ }
2127
+
2128
+ /** Memory status for lifecycle management */
2129
+ export type MemoryStatus =
2130
+ | "active"
2131
+ | "pending_review"
2132
+ | "rejected"
2133
+ | "quarantined"
2134
+ | "superseded"
2135
+ | "archived"
2136
+ /**
2137
+ * Operator explicitly forgot the memory (issue #686 PR 4/6). Soft
2138
+ * delete: the file stays on disk and a page-version snapshot is kept
2139
+ * so the act is reversible during a configurable retention window
2140
+ * (default 90 days), but the memory is excluded from recall, browse,
2141
+ * and entity attribution. After the retention window passes, a
2142
+ * future maintenance cron will hard-delete forgotten memories.
2143
+ */
2144
+ | "forgotten";
2145
+ export type LifecycleState = "candidate" | "validated" | "active" | "stale" | "archived";
2146
+ export type VerificationState = "unverified" | "user_confirmed" | "system_inferred" | "disputed";
2147
+ export type PolicyClass = "ephemeral" | "durable" | "protected";
2148
+
2149
+ /** Importance level tiers */
2150
+ export type ImportanceLevel = "critical" | "high" | "normal" | "low" | "trivial";
2151
+
2152
+ /** Importance scoring result */
2153
+ export interface ImportanceScore {
2154
+ /** Numeric score 0-1 */
2155
+ score: number;
2156
+ /** Tier level */
2157
+ level: ImportanceLevel;
2158
+ /** Reasons for this score */
2159
+ reasons: string[];
2160
+ /** Salient keywords extracted */
2161
+ keywords: string[];
2162
+ }
2163
+
2164
+ export interface MemoryFrontmatter {
2165
+ id: string;
2166
+ category: MemoryCategory;
2167
+ created: string;
2168
+ updated: string;
2169
+ source: string;
2170
+ confidence: number;
2171
+ confidenceTier: ConfidenceTier;
2172
+ tags: string[];
2173
+ entityRef?: string;
2174
+ supersedes?: string;
2175
+ /** ISO 8601 date — memory expires and gets cleaned up after this date */
2176
+ expiresAt?: string;
2177
+ /** IDs of parent memories this was derived from (lineage tracking) */
2178
+ lineage?: string[];
2179
+ /** Memory status: active (default), pending_review, rejected, quarantined, superseded, archived, or forgotten */
2180
+ status?: MemoryStatus;
2181
+ /** ID of memory that superseded this one */
2182
+ supersededBy?: string;
2183
+ /** Timestamp when superseded */
2184
+ supersededAt?: string;
2185
+ /** Timestamp when archived */
2186
+ archivedAt?: string;
2187
+ /**
2188
+ * Explicit fact validity start (issue #680). ISO 8601 timestamp.
2189
+ *
2190
+ * When present, marks the moment at which the fact begins being
2191
+ * "true" / authoritative. When absent at read time, callers fall
2192
+ * back to `created` so legacy memories written before #680 still
2193
+ * participate in `as_of` recall filtering without a migration.
2194
+ */
2195
+ valid_at?: string;
2196
+ /**
2197
+ * Explicit fact validity end (issue #680). ISO 8601 timestamp.
2198
+ *
2199
+ * Set automatically by the temporal-supersession pipeline when a
2200
+ * newer fact supersedes this one — the value is the superseder's
2201
+ * `valid_at` (or `created` if no `valid_at` was set). May also be
2202
+ * set manually for facts that are known to expire at a specific
2203
+ * point in time.
2204
+ */
2205
+ invalid_at?: string;
2206
+ /**
2207
+ * Timestamp when the operator explicitly forgot this memory
2208
+ * (issue #686 PR 4/6). Set by `remnic forget <id>`. Memories with
2209
+ * `status === "forgotten"` are excluded from recall, browse, and
2210
+ * entity attribution; the file remains on disk until the retention
2211
+ * window passes.
2212
+ */
2213
+ forgottenAt?: string;
2214
+ /** Optional human-readable reason captured by `remnic forget --reason`. */
2215
+ forgottenReason?: string;
2216
+ /** Policy-driven lifecycle state used for retrieval eligibility/ranking. */
2217
+ lifecycleState?: LifecycleState;
2218
+ /** Verification provenance used by lifecycle policy. */
2219
+ verificationState?: VerificationState;
2220
+ /** Policy class used by lifecycle guardrails. */
2221
+ policyClass?: PolicyClass;
2222
+ /** Last lifecycle validation timestamp (ISO 8601). */
2223
+ lastValidatedAt?: string;
2224
+ /** Lifecycle decay score in [0,1]. */
2225
+ decayScore?: number;
2226
+ /** Lifecycle heat score in [0,1]. */
2227
+ heatScore?: number;
2228
+ // Access tracking (Phase 1A)
2229
+ /** Number of times this memory has been retrieved */
2230
+ accessCount?: number;
2231
+ /** Last time this memory was accessed (ISO 8601) */
2232
+ lastAccessed?: string;
2233
+ // Memory Worth counters (issue #560)
2234
+ //
2235
+ // Per-fact outcome counters used to derive a dynamic utility score —
2236
+ // `p(success | retrieved)` — as a complement to the static `importance`
2237
+ // field. Absent on legacy memories written before #560; readers must treat
2238
+ // `undefined` as zero observations (uniform Beta(1,1) prior).
2239
+ //
2240
+ // Both values must be non-negative integers on write. PR 1 wires only the
2241
+ // schema + storage round-trip — no increments, scoring, or filtering yet.
2242
+ /** Number of sessions where this memory was retrieved and the outcome was judged a success. */
2243
+ mw_success?: number;
2244
+ /** Number of sessions where this memory was retrieved and the outcome was judged a failure. */
2245
+ mw_fail?: number;
2246
+ // Importance scoring (Phase 1B)
2247
+ /** Importance score with level, reasons, and keywords */
2248
+ importance?: ImportanceScore;
2249
+ // Chunking (Phase 2A)
2250
+ /** Parent memory ID if this is a chunk */
2251
+ parentId?: string;
2252
+ /** Chunk index within parent (0-based) */
2253
+ chunkIndex?: number;
2254
+ /** Total number of chunks for this parent */
2255
+ chunkTotal?: number;
2256
+ // Memory Linking (Phase 3A)
2257
+ /** Links to other memories */
2258
+ links?: MemoryLink[];
2259
+ // Intent-grounded memory routing (v8.0 phase 1)
2260
+ intentGoal?: string;
2261
+ intentActionType?: string;
2262
+ intentEntityTypes?: string[];
2263
+ // Verbatim artifact lineage (v8.0 phase 1)
2264
+ artifactType?: "decision" | "constraint" | "todo" | "definition" | "commitment" | "correction" | "fact";
2265
+ sourceMemoryId?: string;
2266
+ sourceTurnId?: string;
2267
+ // v8.0 Phase 2B: HiMem episode/note classification
2268
+ /** episode = time-specific event; note = stable belief/preference/decision */
2269
+ memoryKind?: "episode" | "note" | "box" | "dream" | "procedural";
2270
+ /** Structured key-value attributes extracted from the content (e.g., product attributes, dates, quantities). */
2271
+ structuredAttributes?: Record<string, string>;
2272
+ /**
2273
+ * SHA-256 (via ContentHashIndex.computeHash) of the raw content that was
2274
+ * used as the dedup key at write time. Persists through archive and
2275
+ * consolidation so the hash can be removed from the index even if the stored
2276
+ * content has been transformed (e.g. an inline citation was appended).
2277
+ *
2278
+ * When present, archive/consolidation paths use this directly instead of
2279
+ * calling stripCitation(memory.content), which only handles the default
2280
+ * [Source: ...] format and silently fails for custom citation templates.
2281
+ */
2282
+ contentHash?: string;
2283
+ /**
2284
+ * Consolidation provenance — pointers to the page-versioning snapshots
2285
+ * that this memory was derived from (issue #561). Each entry is a
2286
+ * `"<memory-path>:<version-number>"` string (e.g.
2287
+ * `"facts/preferences.md:3"`) referencing a snapshot recorded by
2288
+ * `page-versioning.ts`.
2289
+ *
2290
+ * PR 1 introduces this field as read-through only — storage preserves
2291
+ * it verbatim but no code produces it yet. PR 2 populates it on
2292
+ * consolidation writes; PR 4 adds a `remnic doctor` integrity check
2293
+ * that validates each referent actually exists.
2294
+ */
2295
+ derived_from?: string[];
2296
+ /**
2297
+ * Which consolidation operator produced this memory (issue #561,
2298
+ * extended in #687). See `ConsolidationOperator` in
2299
+ * `semantic-consolidation.ts` for the operator algebra. Absent on
2300
+ * memories that were not produced by a consolidation pass.
2301
+ *
2302
+ * `"pattern-reinforcement"` (issue #687 PR 2/4) tags memories that
2303
+ * were promoted to canonical by the pattern-reinforcement
2304
+ * maintenance job after observing the same content across
2305
+ * multiple sessions.
2306
+ */
2307
+ derived_via?: "split" | "merge" | "update" | "pattern-reinforcement";
2308
+ /**
2309
+ * Number of source memories that reinforced this canonical memory
2310
+ * (issue #687 PR 2/4). Set by the pattern-reinforcement
2311
+ * maintenance job when it clusters duplicate memories and promotes
2312
+ * the most recent member to canonical. Counts the cluster size at
2313
+ * the time of the run; subsequent runs update this monotonically.
2314
+ *
2315
+ * Always a positive integer when present. Absent on memories that
2316
+ * have not been touched by pattern reinforcement.
2317
+ */
2318
+ reinforcement_count?: number;
2319
+ /**
2320
+ * ISO 8601 timestamp recording the most recent pattern-reinforcement
2321
+ * run that touched this memory (issue #687 PR 2/4). Updated each
2322
+ * time the cluster size grows. Absent when `reinforcement_count`
2323
+ * is absent.
2324
+ */
2325
+ last_reinforced_at?: string;
2326
+ }
2327
+
2328
+ /** Memory link relationship types */
2329
+ export type MemoryLinkType = "follows" | "references" | "contradicts" | "supports" | "related";
2330
+
2331
+ /** A link between memories */
2332
+ export interface MemoryLink {
2333
+ targetId: string;
2334
+ linkType: MemoryLinkType;
2335
+ strength: number;
2336
+ reason?: string;
2337
+ }
2338
+
2339
+ // Conversation Threading (Phase 3B)
2340
+ export interface ConversationThread {
2341
+ id: string;
2342
+ title: string;
2343
+ createdAt: string;
2344
+ updatedAt: string;
2345
+ sessionKey?: string;
2346
+ episodeIds: string[];
2347
+ linkedThreadIds: string[];
2348
+ }
2349
+
2350
+ // Memory Summarization (Phase 4A)
2351
+ export interface MemorySummary {
2352
+ id: string;
2353
+ createdAt: string;
2354
+ timeRangeStart: string;
2355
+ timeRangeEnd: string;
2356
+ summaryText: string;
2357
+ keyFacts: string[];
2358
+ keyEntities: string[];
2359
+ sourceEpisodeIds: string[];
2360
+ }
2361
+
2362
+ export interface DaySummaryResult {
2363
+ summary: string;
2364
+ bullets: string[];
2365
+ next_actions: string[];
2366
+ risks_or_open_loops: string[];
2367
+ }
2368
+
2369
+ // Topic Extraction (Phase 4B)
2370
+ export interface TopicScore {
2371
+ term: string;
2372
+ score: number;
2373
+ count: number;
2374
+ }
2375
+
2376
+ export interface MemoryFile {
2377
+ path: string;
2378
+ frontmatter: MemoryFrontmatter;
2379
+ content: string;
2380
+ }
2381
+
2382
+ /**
2383
+ * Public type representing the **Observation** stage in the
2384
+ * Trace → Observation → Primitive pipeline (issue #685).
2385
+ *
2386
+ * - **Trace**: raw conversation turns captured in `buffer.ts`. Noisy,
2387
+ * verbose, ephemeral.
2388
+ * - **Observation** (this type): post-extraction, importance-scored
2389
+ * fact candidate emitted by `extraction.ts` / `extraction-judge.ts`.
2390
+ * Already distilled — but not yet consolidated against the corpus.
2391
+ * - **Primitive**: the durable `MemoryFile` written by `storage.ts`,
2392
+ * reinforced over time by `compounding/engine.ts`.
2393
+ *
2394
+ * `MemoryObservation` is the named handle on the intermediate stage
2395
+ * the codebase has always produced but never publicly typed. It lets
2396
+ * callers (telemetry, doctor surfaces, tests, downstream tooling)
2397
+ * inspect the post-extraction shape without reaching into extraction
2398
+ * internals.
2399
+ *
2400
+ * Naming note: this is intentionally NOT the same as the existing
2401
+ * `state/observation-ledger/` directory, which is telemetry storage
2402
+ * for the extraction pipeline (turn-count aggregates rebuilt by
2403
+ * `maintenance/rebuild-observations.ts` and judge verdict events
2404
+ * appended by `extraction-judge-telemetry.ts`). Lifecycle events on
2405
+ * primitives — status flips, supersessions, archival, forget — live
2406
+ * in `state/memory-lifecycle-ledger.jsonl`, written by
2407
+ * `StorageManager`. A `MemoryObservation` describes the in-flight
2408
+ * candidate that became (or didn't become) a primitive; the ledger
2409
+ * directory is how the pipeline reports on itself. See
2410
+ * `docs/trace-to-primitive.md` for the full pipeline walkthrough.
2411
+ */
2412
+ export interface MemoryObservation {
2413
+ /** Stable id for this observation, distinct from any primitive id. */
2414
+ id: string;
2415
+ /** Source session id the trace came from. */
2416
+ sessionId?: string;
2417
+ /** ISO timestamp the observation was emitted. */
2418
+ observedAt: string;
2419
+ /** The extracted fact candidate (category, content, confidence, tags, etc.). */
2420
+ fact: ExtractedFact;
2421
+ /** Importance score in [0,1], from `importance.ts`. */
2422
+ importance?: number;
2423
+ /**
2424
+ * Whether the observation passed the extraction judge
2425
+ * (`extraction-judge.ts`). When `false`, the observation was
2426
+ * captured for telemetry but not persisted as a primitive.
2427
+ */
2428
+ judgeAccepted?: boolean;
2429
+ /** Optional reason the judge gave when rejecting. */
2430
+ judgeRejectionReason?: string;
2431
+ /**
2432
+ * Id of the resulting `MemoryFile` primitive once consolidation runs.
2433
+ * Absent until consolidation decides to ADD/MERGE/UPDATE the
2434
+ * observation into the corpus.
2435
+ */
2436
+ resultingPrimitiveId?: string;
2437
+ }
2438
+
2439
+ /** Ordered step for extracted procedure memories (issue #519). */
2440
+ export interface ExtractedProcedureStep {
2441
+ order: number;
2442
+ intent: string;
2443
+ toolCall?: { kind: string; signature: string };
2444
+ expectedOutcome?: string;
2445
+ optional?: boolean;
2446
+ }
2447
+
2448
+ export interface ExtractedFact {
2449
+ category: MemoryCategory;
2450
+ content: string;
2451
+ confidence: number;
2452
+ tags: string[];
2453
+ entityRef?: string;
2454
+ source?: ExtractionPassSource;
2455
+ promptedByQuestion?: string;
2456
+ /**
2457
+ * Whether this fact is project-scoped or globally applicable.
2458
+ * When `extractionScopeClassificationEnabled` is true, the extraction LLM
2459
+ * classifies each fact. Default is `"project"` when a coding context is
2460
+ * active, `"global"` when no coding context is present.
2461
+ */
2462
+ scope?: MemoryScope;
2463
+ /** Structured key-value attributes extracted from the content (e.g., product attributes, dates, quantities). */
2464
+ structuredAttributes?: Record<string, string>;
2465
+ /** When category is `procedure`, ordered steps with intents (persisted under procedures/). */
2466
+ procedureSteps?: ExtractedProcedureStep[];
2467
+ /**
2468
+ * When category is `reasoning_trace`, the stored solution chain the user
2469
+ * walked through. Persisted under reasoning-traces/.
2470
+ */
2471
+ reasoningTrace?: ExtractedReasoningTrace;
2472
+ }
2473
+
2474
+ export interface ExtractedReasoningTraceStep {
2475
+ order: number;
2476
+ description: string;
2477
+ }
2478
+
2479
+ export interface ExtractedReasoningTrace {
2480
+ steps: ExtractedReasoningTraceStep[];
2481
+ finalAnswer: string;
2482
+ observedOutcome?: string;
2483
+ }
2484
+
2485
+ export interface MemoryIntent {
2486
+ goal: string;
2487
+ actionType: string;
2488
+ entityTypes: string[];
2489
+ /** True when the prompt reads like starting a concrete task (ship/deploy/tests/PR, etc.). */
2490
+ taskInitiation?: boolean;
2491
+ }
2492
+
2493
+ export interface ExtractedQuestion {
2494
+ question: string;
2495
+ context: string;
2496
+ priority: number;
2497
+ }
2498
+
2499
+ export interface QuestionEntry {
2500
+ id: string;
2501
+ question: string;
2502
+ context: string;
2503
+ priority: number; // 0-1, higher = more important
2504
+ created: string;
2505
+ resolved: boolean;
2506
+ resolvedAt?: string;
2507
+ }
2508
+
2509
+ export interface ExtractionResult {
2510
+ facts: ExtractedFact[];
2511
+ profileUpdates: string[];
2512
+ entities: EntityMention[];
2513
+ questions: ExtractedQuestion[];
2514
+ identityReflection?: string;
2515
+ relationships?: ExtractedRelationship[];
2516
+ }
2517
+
2518
+ export interface EntityMention {
2519
+ name: string;
2520
+ type: "person" | "project" | "tool" | "company" | "place" | "other";
2521
+ facts: string[];
2522
+ structuredSections?: EntityStructuredSection[];
2523
+ source?: ExtractionPassSource;
2524
+ promptedByQuestion?: string;
2525
+ }
2526
+
2527
+ // ---------------------------------------------------------------------------
2528
+ // Knowledge Graph Enhancement (Entity Relationships, Activity, Scoring)
2529
+ // ---------------------------------------------------------------------------
2530
+
2531
+ export interface EntityRelationship {
2532
+ target: string;
2533
+ label: string;
2534
+ }
2535
+
2536
+ export interface EntityActivityEntry {
2537
+ date: string;
2538
+ note: string;
2539
+ }
2540
+
2541
+ export interface EntityTimelineEntry {
2542
+ timestamp: string;
2543
+ text: string;
2544
+ source?: string;
2545
+ sessionKey?: string;
2546
+ principal?: string;
2547
+ }
2548
+
2549
+ export interface EntityStructuredSection {
2550
+ key: string;
2551
+ title: string;
2552
+ facts: string[];
2553
+ }
2554
+
2555
+ export interface EntitySchemaSectionDefinition {
2556
+ key: string;
2557
+ title: string;
2558
+ description: string;
2559
+ aliases?: string[];
2560
+ }
2561
+
2562
+ export interface EntitySchemaDefinition {
2563
+ sections: EntitySchemaSectionDefinition[];
2564
+ }
2565
+
2566
+ export interface EntityFile {
2567
+ name: string;
2568
+ type: string;
2569
+ created?: string;
2570
+ updated: string;
2571
+ extraFrontmatterLines?: string[];
2572
+ preSectionLines?: string[];
2573
+ facts: string[];
2574
+ summary?: string;
2575
+ synthesis?: string;
2576
+ synthesisUpdatedAt?: string;
2577
+ synthesisTimelineCount?: number;
2578
+ synthesisStructuredFactCount?: number;
2579
+ synthesisStructuredFactDigest?: string;
2580
+ synthesisVersion?: number;
2581
+ timeline: EntityTimelineEntry[];
2582
+ structuredSections?: EntityStructuredSection[];
2583
+ relationships: EntityRelationship[];
2584
+ activity: EntityActivityEntry[];
2585
+ aliases: string[];
2586
+ extraSections?: Array<{
2587
+ title: string;
2588
+ lines: string[];
2589
+ }>;
2590
+ }
2591
+
2592
+ export interface ScoredEntity {
2593
+ name: string;
2594
+ type: string;
2595
+ score: number;
2596
+ factCount: number;
2597
+ summary?: string;
2598
+ topRelationships: string[];
2599
+ }
2600
+
2601
+ export interface ExtractedRelationship {
2602
+ source: string;
2603
+ target: string;
2604
+ label: string;
2605
+ extractionSource?: ExtractionPassSource;
2606
+ promptedByQuestion?: string;
2607
+ }
2608
+
2609
+ export interface ConsolidationItem {
2610
+ existingId: string;
2611
+ action: ConsolidationAction;
2612
+ mergeWith?: string;
2613
+ updatedContent?: string;
2614
+ reason: string;
2615
+ }
2616
+
2617
+ export interface ConsolidationResult {
2618
+ items: ConsolidationItem[];
2619
+ profileUpdates: string[];
2620
+ entityUpdates: EntityMention[];
2621
+ }
2622
+
2623
+ export interface ConsolidationObservation {
2624
+ runAt: string;
2625
+ recentMemories: MemoryFile[];
2626
+ existingMemories: MemoryFile[];
2627
+ profile: string;
2628
+ result: ConsolidationResult;
2629
+ merged: number;
2630
+ invalidated: number;
2631
+ }
2632
+
2633
+ export interface QmdSearchResult {
2634
+ docid: string;
2635
+ path: string;
2636
+ snippet: string;
2637
+ score: number;
2638
+ line?: number;
2639
+ explain?: QmdSearchExplain;
2640
+ transport?: "daemon" | "subprocess" | "hybrid" | "scoped_prefilter";
2641
+ }
2642
+
2643
+ export interface QmdSearchExplain {
2644
+ ftsScores?: number[];
2645
+ vectorScores?: number[];
2646
+ /** QMD 2.5 nested RRF `totalScore`, or legacy numeric RRF score. */
2647
+ rrf?: number;
2648
+ rrfRank?: number;
2649
+ rrfPositionScore?: number;
2650
+ rrfBaseScore?: number;
2651
+ rrfTopRankBonus?: number;
2652
+ rerankScore?: number;
2653
+ blendedScore?: number;
2654
+ /** Additive boost applied from `reinforcement_count` frontmatter (issue #687 PR 3/4). */
2655
+ reinforcementBoost?: number;
2656
+ }
2657
+
2658
+ export interface MetaState {
2659
+ extractionCount: number;
2660
+ lastExtractionAt: string | null;
2661
+ lastConsolidationAt: string | null;
2662
+ totalMemories: number;
2663
+ totalEntities: number;
2664
+ processedExtractionFingerprints?: Array<{
2665
+ fingerprint: string;
2666
+ observedAt: string;
2667
+ }>;
2668
+ }
2669
+
2670
+ export type MemoryActionType =
2671
+ | "store_episode"
2672
+ | "store_note"
2673
+ | "update_note"
2674
+ | "create_artifact"
2675
+ | "summarize_node"
2676
+ | "discard"
2677
+ | "link_graph";
2678
+
2679
+ export type MemoryActionOutcome = "applied" | "skipped" | "failed";
2680
+
2681
+ export type MemoryActionPolicyDecision = "allow" | "defer" | "deny";
2682
+
2683
+ export type MemoryActionStatus = "validated" | "applied" | "rejected";
2684
+
2685
+ export type MemoryActionEligibilitySource =
2686
+ | "extraction"
2687
+ | "consolidation"
2688
+ | "replay"
2689
+ | "manual"
2690
+ | "unknown";
2691
+
2692
+ export interface MemoryActionEligibilityContext {
2693
+ confidence: number;
2694
+ lifecycleState: LifecycleState;
2695
+ importance: number;
2696
+ source: MemoryActionEligibilitySource;
2697
+ }
2698
+
2699
+ export interface MemoryActionPolicyResult {
2700
+ action: MemoryActionType;
2701
+ decision: MemoryActionPolicyDecision;
2702
+ rationale: string;
2703
+ eligibility: MemoryActionEligibilityContext;
2704
+ }
2705
+
2706
+ export interface MemoryActionEvent {
2707
+ schemaVersion?: number;
2708
+ actionId?: string;
2709
+ timestamp: string;
2710
+ action: MemoryActionType;
2711
+ outcome: MemoryActionOutcome;
2712
+ status?: MemoryActionStatus;
2713
+ actor?: string;
2714
+ subsystem?: string;
2715
+ reason?: string;
2716
+ memoryId?: string;
2717
+ namespace?: string;
2718
+ sessionKey?: string;
2719
+ sourceSessionKey?: string;
2720
+ checkpointCapturedAt?: string;
2721
+ checkpointTtl?: string;
2722
+ checkpointTurnCount?: number;
2723
+ inputSummary?: string;
2724
+ outputMemoryIds?: string[];
2725
+ dryRun?: boolean;
2726
+ policyVersion?: string;
2727
+ promptHash?: string;
2728
+ policyDecision?: MemoryActionPolicyDecision;
2729
+ policyRationale?: string;
2730
+ policyEligibility?: MemoryActionEligibilityContext;
2731
+ }
2732
+
2733
+ export type MemoryLifecycleEventType =
2734
+ | "created"
2735
+ | "updated"
2736
+ | "superseded"
2737
+ | "archived"
2738
+ | "rejected"
2739
+ | "restored"
2740
+ | "merged"
2741
+ | "imported"
2742
+ | "promoted"
2743
+ | "explicit_capture_accepted"
2744
+ | "explicit_capture_queued";
2745
+
2746
+ export interface MemoryLifecycleStateSummary {
2747
+ category?: MemoryCategory;
2748
+ path?: string;
2749
+ status?: MemoryStatus;
2750
+ lifecycleState?: LifecycleState;
2751
+ }
2752
+
2753
+ export interface MemoryLifecycleEvent {
2754
+ eventId: string;
2755
+ memoryId: string;
2756
+ eventType: MemoryLifecycleEventType;
2757
+ timestamp: string;
2758
+ actor: string;
2759
+ reasonCode?: string;
2760
+ ruleVersion: string;
2761
+ relatedMemoryIds?: string[];
2762
+ before?: MemoryLifecycleStateSummary;
2763
+ after?: MemoryLifecycleStateSummary;
2764
+ correlationId?: string;
2765
+ }
2766
+
2767
+ export interface MemoryProjectionCurrentState {
2768
+ memoryId: string;
2769
+ category: MemoryCategory;
2770
+ status: MemoryStatus;
2771
+ lifecycleState?: LifecycleState;
2772
+ path: string;
2773
+ pathRel: string;
2774
+ created: string;
2775
+ updated: string;
2776
+ archivedAt?: string;
2777
+ supersededAt?: string;
2778
+ entityRef?: string;
2779
+ source: string;
2780
+ confidence: number;
2781
+ confidenceTier: ConfidenceTier;
2782
+ memoryKind?: MemoryFrontmatter["memoryKind"];
2783
+ accessCount?: number;
2784
+ lastAccessed?: string;
2785
+ tags?: string[];
2786
+ preview?: string;
2787
+ }
2788
+
2789
+ export interface CompressionGuidelineOptimizerSourceWindow {
2790
+ from: string;
2791
+ to: string;
2792
+ }
2793
+
2794
+ export interface CompressionGuidelineOptimizerEventCounts {
2795
+ total: number;
2796
+ applied: number;
2797
+ skipped: number;
2798
+ failed: number;
2799
+ }
2800
+
2801
+ export type CompressionGuidelineActivationState = "draft" | "active";
2802
+
2803
+ export interface CompressionGuidelineOptimizerActionSummary {
2804
+ action: MemoryActionType;
2805
+ total: number;
2806
+ outcomes: Record<MemoryActionOutcome, number>;
2807
+ quality: {
2808
+ good: number;
2809
+ poor: number;
2810
+ unknown: number;
2811
+ };
2812
+ }
2813
+
2814
+ export interface CompressionGuidelineOptimizerRuleUpdate {
2815
+ action: MemoryActionType;
2816
+ delta: number;
2817
+ direction: "increase" | "decrease" | "hold";
2818
+ confidence: "low" | "medium" | "high";
2819
+ notes: string[];
2820
+ }
2821
+
2822
+ export interface CompressionGuidelineOptimizerState {
2823
+ version: number;
2824
+ updatedAt: string;
2825
+ sourceWindow: CompressionGuidelineOptimizerSourceWindow;
2826
+ eventCounts: CompressionGuidelineOptimizerEventCounts;
2827
+ guidelineVersion: number;
2828
+ contentHash?: string;
2829
+ activationState?: CompressionGuidelineActivationState;
2830
+ actionSummaries?: CompressionGuidelineOptimizerActionSummary[];
2831
+ ruleUpdates?: CompressionGuidelineOptimizerRuleUpdate[];
2832
+ }
2833
+
2834
+ export type ContinuityIncidentState = "open" | "closed";
2835
+
2836
+ export interface ContinuityIncidentRecord {
2837
+ id: string;
2838
+ state: ContinuityIncidentState;
2839
+ openedAt: string;
2840
+ updatedAt: string;
2841
+ triggerWindow?: string;
2842
+ symptom: string;
2843
+ suspectedCause?: string;
2844
+ fixApplied?: string;
2845
+ verificationResult?: string;
2846
+ preventiveRule?: string;
2847
+ closedAt?: string;
2848
+ filePath?: string;
2849
+ }
2850
+
2851
+ export interface ContinuityIncidentOpenInput {
2852
+ triggerWindow?: string;
2853
+ symptom: string;
2854
+ suspectedCause?: string;
2855
+ }
2856
+
2857
+ export interface ContinuityIncidentCloseInput {
2858
+ fixApplied: string;
2859
+ verificationResult: string;
2860
+ preventiveRule?: string;
2861
+ }
2862
+
2863
+ export type ContinuityLoopCadence = "daily" | "weekly" | "monthly" | "quarterly";
2864
+ export type ContinuityLoopStatus = "active" | "paused" | "retired";
2865
+
2866
+ export interface ContinuityImprovementLoop {
2867
+ id: string;
2868
+ cadence: ContinuityLoopCadence;
2869
+ purpose: string;
2870
+ status: ContinuityLoopStatus;
2871
+ killCondition: string;
2872
+ lastReviewed: string;
2873
+ notes?: string;
2874
+ }
2875
+
2876
+ export interface ContinuityLoopUpsertInput {
2877
+ id: string;
2878
+ cadence: ContinuityLoopCadence;
2879
+ purpose: string;
2880
+ status: ContinuityLoopStatus;
2881
+ killCondition: string;
2882
+ lastReviewed?: string;
2883
+ notes?: string;
2884
+ }
2885
+
2886
+ export interface ContinuityLoopReviewInput {
2887
+ status?: ContinuityLoopStatus;
2888
+ notes?: string;
2889
+ reviewedAt?: string;
2890
+ }
2891
+
2892
+ /** Entry in the access tracking buffer (batched updates) */
2893
+ export interface AccessTrackingEntry {
2894
+ memoryId: string;
2895
+ newCount: number;
2896
+ lastAccessed: string;
2897
+ }
2898
+
2899
+ export interface SignalScanResult {
2900
+ level: SignalLevel;
2901
+ patterns: string[];
2902
+ }
2903
+
2904
+ // ============================================================================
2905
+ // LLM Trace Callback (for external observability plugins)
2906
+ // ============================================================================
2907
+
2908
+ export interface LlmTraceEvent {
2909
+ kind: "llm_start" | "llm_end" | "llm_error";
2910
+ traceId: string;
2911
+ model: string;
2912
+ operation: "extraction" | "consolidation" | "profile_consolidation" | "identity_consolidation" | "day_summary";
2913
+ input?: string;
2914
+ output?: string;
2915
+ durationMs?: number;
2916
+ error?: string;
2917
+ tokenUsage?: { input?: number; output?: number; total?: number };
2918
+ }
2919
+
2920
+ export interface RecallTraceEvent {
2921
+ kind: "recall_summary";
2922
+ traceId: string;
2923
+ operation: "recall";
2924
+ sessionKey?: string;
2925
+ promptHash: string;
2926
+ promptLength: number;
2927
+ retrievalQueryHash: string;
2928
+ retrievalQueryLength: number;
2929
+ recallMode: RecallPlanMode;
2930
+ recallResultLimit: number;
2931
+ qmdEnabled: boolean;
2932
+ qmdAvailable: boolean;
2933
+ recallNamespaces: string[];
2934
+ source: "none" | "hot_qmd" | "hot_embedding" | "cold_fallback" | "recent_scan";
2935
+ recalledMemoryCount: number;
2936
+ injected: boolean;
2937
+ contextChars: number;
2938
+ policyVersion?: string;
2939
+ identityInjectionMode?: IdentityInjectionMode | "none";
2940
+ identityInjectedChars?: number;
2941
+ identityInjectionTruncated?: boolean;
2942
+ durationMs: number;
2943
+ timings?: Record<string, string>;
2944
+ /**
2945
+ * The full recalled memory context added to the runtime context.
2946
+ * Only populated when `traceRecallContent` config option is `true`.
2947
+ * Omitted by default to avoid sending potentially sensitive memory content
2948
+ * to external trace collectors unless explicitly opted in.
2949
+ */
2950
+ recalledContent?: string;
2951
+ }
2952
+
2953
+ export type EngramTraceEvent = LlmTraceEvent | RecallTraceEvent;
2954
+ export type LlmTraceCallback = (event: EngramTraceEvent) => void;
2955
+
2956
+ // ============================================================================
2957
+ // Gateway Configuration Types (for fallback AI)
2958
+ // ============================================================================
2959
+
2960
+ export type ModelApi =
2961
+ | "openai-completions"
2962
+ | "anthropic-messages"
2963
+ | "google-generative"
2964
+ | "codex-cli"
2965
+ | string;
2966
+ export type CodexCliReasoningEffort = "low" | "medium" | "high" | "xhigh";
2967
+
2968
+ export type ModelProviderAuthMode = "bearer" | "header" | "query";
2969
+
2970
+ export interface ModelDefinitionConfig {
2971
+ id: string;
2972
+ name?: string;
2973
+ contextWindow?: number;
2974
+ maxOutputTokens?: number;
2975
+ costPer1MInput?: number;
2976
+ costPer1MOutput?: number;
2977
+ aliases?: string[];
2978
+ }
2979
+
2980
+ export interface ModelProviderConfig {
2981
+ baseUrl: string;
2982
+ apiKey?: string | Record<string, unknown>;
2983
+ auth?: ModelProviderAuthMode;
2984
+ api?: ModelApi;
2985
+ headers?: Record<string, string>;
2986
+ authHeader?: boolean;
2987
+ disableThinking?: boolean;
2988
+ executable?: string;
2989
+ reasoningEffort?: CodexCliReasoningEffort;
2990
+ codexCliExecutable?: string;
2991
+ codexCliReasoningEffort?: CodexCliReasoningEffort;
2992
+ retryOptions?: {
2993
+ timeoutMs?: number;
2994
+ };
2995
+ models: ModelDefinitionConfig[];
2996
+ }
2997
+
2998
+ export interface AgentDefaultsConfig {
2999
+ model?: {
3000
+ primary?: string;
3001
+ backup?: string;
3002
+ fallbacks?: string[];
3003
+ };
3004
+ thinking?: {
3005
+ mode?: "off" | "on" | "adaptive";
3006
+ budget?: number;
3007
+ };
3008
+ }
3009
+
3010
+ export interface AgentPersonaModelConfig {
3011
+ primary?: string;
3012
+ fallbacks?: string[];
3013
+ }
3014
+
3015
+ export interface AgentPersona {
3016
+ id: string;
3017
+ name?: string;
3018
+ model?: AgentPersonaModelConfig;
3019
+ }
3020
+
3021
+ export interface GatewayConfig {
3022
+ agents?: {
3023
+ defaults?: AgentDefaultsConfig;
3024
+ list?: AgentPersona[];
3025
+ };
3026
+ models?: {
3027
+ providers?: Record<string, ModelProviderConfig>;
3028
+ };
3029
+ }
3030
+
3031
+ // ============================================================================
3032
+ // Transcript & Context Preservation (v2.0)
3033
+ // ============================================================================
3034
+
3035
+ export interface TranscriptEntry {
3036
+ timestamp: string;
3037
+ role: "user" | "assistant";
3038
+ content: string;
3039
+ sessionKey: string;
3040
+ turnId: string;
3041
+ metadata?: {
3042
+ compactAfter?: boolean;
3043
+ compactionId?: string | null;
3044
+ };
3045
+ }
3046
+
3047
+ export interface Checkpoint {
3048
+ sessionKey: string;
3049
+ capturedAt: string;
3050
+ turns: TranscriptEntry[];
3051
+ ttl: string; // ISO timestamp when checkpoint expires
3052
+ }
3053
+
3054
+ export interface HourlySummary {
3055
+ hour: string; // "2026-02-08T14:00:00Z"
3056
+ sessionKey: string;
3057
+ bullets: string[];
3058
+ turnCount: number;
3059
+ generatedAt: string;
3060
+ }
3061
+
3062
+ // ============================================================================
3063
+ // Dreams Pipeline Telemetry (issue #678 PR 3/4)
3064
+ // ============================================================================
3065
+
3066
+ // Re-export from the authoritative source to avoid duplicate definitions.
3067
+ // dreams-ledger.ts is the single source of truth; types.ts re-exports so
3068
+ // callers that import from types.js continue to work unchanged.
3069
+ export type {
3070
+ DreamsPhase,
3071
+ DreamsPhaseStatus,
3072
+ DreamsStatusResult,
3073
+ DreamsRunResult,
3074
+ } from "./maintenance/dreams-ledger.js";