@remnic/core 1.0.1 → 1.0.3

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 (347) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +48 -0
  3. package/dist/access-cli.d.ts +13 -3
  4. package/dist/access-cli.js +90 -75
  5. package/dist/access-cli.js.map +1 -1
  6. package/dist/access-http.d.ts +10 -3
  7. package/dist/access-http.js +25 -18
  8. package/dist/access-mcp.d.ts +30 -3
  9. package/dist/access-mcp.js +16 -1
  10. package/dist/access-schema.d.ts +46 -46
  11. package/dist/access-schema.js +1 -1
  12. package/dist/access-service.d.ts +65 -4
  13. package/dist/access-service.js +21 -15
  14. package/dist/active-memory-bridge.d.ts +66 -0
  15. package/dist/active-memory-bridge.js +11 -0
  16. package/dist/active-recall.d.ts +96 -0
  17. package/dist/active-recall.js +308 -0
  18. package/dist/active-recall.js.map +1 -0
  19. package/dist/behavior-learner.js +1 -1
  20. package/dist/bootstrap.d.ts +6 -3
  21. package/dist/bootstrap.js +2 -2
  22. package/dist/boxes.js +2 -2
  23. package/dist/briefing.d.ts +169 -0
  24. package/dist/briefing.js +52 -0
  25. package/dist/briefing.js.map +1 -0
  26. package/dist/buffer.d.ts +19 -5
  27. package/dist/buffer.js +2 -2
  28. package/dist/calibration.js +6 -6
  29. package/dist/causal-behavior.js +5 -5
  30. package/dist/causal-chain.js +3 -3
  31. package/dist/causal-consolidation.d.ts +22 -2
  32. package/dist/causal-consolidation.js +36 -9
  33. package/dist/causal-consolidation.js.map +1 -1
  34. package/dist/causal-retrieval.js +6 -6
  35. package/dist/causal-trajectory-graph.js +1 -1
  36. package/dist/causal-trajectory.d.ts +14 -1
  37. package/dist/causal-trajectory.js +5 -1
  38. package/dist/{chunk-KWBU5S5U.js → chunk-2ODBA7MQ.js} +9 -3
  39. package/dist/chunk-2ODBA7MQ.js.map +1 -0
  40. package/dist/{chunk-6UJQNRIO.js → chunk-2VFW5K5U.js} +93 -36
  41. package/dist/chunk-2VFW5K5U.js.map +1 -0
  42. package/dist/chunk-3PG3H5TD.js +7 -0
  43. package/dist/chunk-3PG3H5TD.js.map +1 -0
  44. package/dist/{chunk-NTTLPF7F.js → chunk-3QFQGRHO.js} +5 -5
  45. package/dist/chunk-4DJQYKMN.js +187 -0
  46. package/dist/chunk-4DJQYKMN.js.map +1 -0
  47. package/dist/chunk-4KAN3GZ3.js +225 -0
  48. package/dist/chunk-4KAN3GZ3.js.map +1 -0
  49. package/dist/{chunk-ORZMT74A.js → chunk-4NRAJUDS.js} +11 -1
  50. package/dist/chunk-4NRAJUDS.js.map +1 -0
  51. package/dist/{chunk-B7LOFDVE.js → chunk-4WMCPJWX.js} +8 -3
  52. package/dist/chunk-4WMCPJWX.js.map +1 -0
  53. package/dist/{chunk-G3AG3KZN.js → chunk-5IZL4DCV.js} +2 -2
  54. package/dist/{chunk-BRK4ODMI.js → chunk-5NPGSAVB.js} +2 -2
  55. package/dist/chunk-6MKAMLQL.js +16 -0
  56. package/dist/chunk-6MKAMLQL.js.map +1 -0
  57. package/dist/{chunk-ESSMF2FR.js → chunk-6PFRXT4K.js} +15 -6
  58. package/dist/chunk-6PFRXT4K.js.map +1 -0
  59. package/dist/chunk-6ZH4TU6I.js +245 -0
  60. package/dist/chunk-6ZH4TU6I.js.map +1 -0
  61. package/dist/{chunk-V4YC4LUK.js → chunk-74JR4N5J.js} +175 -63
  62. package/dist/chunk-74JR4N5J.js.map +1 -0
  63. package/dist/{chunk-L5RPWGFK.js → chunk-7DHTMOND.js} +2 -2
  64. package/dist/{chunk-TVVVQQAK.js → chunk-7PA4OZEU.js} +53 -11
  65. package/dist/chunk-7PA4OZEU.js.map +1 -0
  66. package/dist/{chunk-Q6FETXJA.js → chunk-7SEAZFFB.js} +2 -2
  67. package/dist/chunk-ALXMCZEU.js +332 -0
  68. package/dist/chunk-ALXMCZEU.js.map +1 -0
  69. package/dist/{chunk-QANCTXQF.js → chunk-AYPYCLR7.js} +3 -3
  70. package/dist/{chunk-WWIQTB2Y.js → chunk-BKQJBXXX.js} +9 -2
  71. package/dist/chunk-BKQJBXXX.js.map +1 -0
  72. package/dist/{chunk-LP47L3ZX.js → chunk-BTY5RRRF.js} +7 -7
  73. package/dist/{chunk-SCHEKPYH.js → chunk-C2EFFULQ.js} +1 -1
  74. package/dist/{chunk-GJR6D6KC.js → chunk-D654IBA6.js} +2 -2
  75. package/dist/{chunk-UV2FO7J4.js → chunk-E6K4NIEU.js} +2 -2
  76. package/dist/{chunk-T4WRIV2C.js → chunk-EABGC2TL.js} +2 -2
  77. package/dist/chunk-ECKDIK5F.js +813 -0
  78. package/dist/chunk-ECKDIK5F.js.map +1 -0
  79. package/dist/chunk-EJI5XIBB.js +232 -0
  80. package/dist/chunk-EJI5XIBB.js.map +1 -0
  81. package/dist/{chunk-ONRU4L2N.js → chunk-FEMOX5AD.js} +2 -2
  82. package/dist/{chunk-IFFFR3MR.js → chunk-FSFEQI74.js} +3 -3
  83. package/dist/chunk-G4SK7DSQ.js +121 -0
  84. package/dist/chunk-G4SK7DSQ.js.map +1 -0
  85. package/dist/{chunk-UIYZ5T3I.js → chunk-GJQPH5G3.js} +8 -8
  86. package/dist/{chunk-2PO5ZRKV.js → chunk-GZCUW5IC.js} +16 -3
  87. package/dist/chunk-GZCUW5IC.js.map +1 -0
  88. package/dist/{chunk-IZME7KW2.js → chunk-HITJFT7E.js} +24 -10
  89. package/dist/{chunk-IZME7KW2.js.map → chunk-HITJFT7E.js.map} +1 -1
  90. package/dist/chunk-IQT3XTKW.js +121 -0
  91. package/dist/chunk-IQT3XTKW.js.map +1 -0
  92. package/dist/{chunk-BDFZXRSO.js → chunk-J4IYOZZ5.js} +15 -2
  93. package/dist/chunk-J4IYOZZ5.js.map +1 -0
  94. package/dist/{chunk-ZKYI7UVO.js → chunk-JR4ZC3G4.js} +2 -2
  95. package/dist/{chunk-UCYSTFZR.js → chunk-JRNQ3RNA.js} +2 -2
  96. package/dist/{chunk-UYSKNO6E.js → chunk-JROGC36Y.js} +15 -4
  97. package/dist/chunk-JROGC36Y.js.map +1 -0
  98. package/dist/{chunk-GPGBSNKM.js → chunk-K4FLSOR5.js} +2 -2
  99. package/dist/{chunk-M5ZBBBJI.js → chunk-KEG4GNGI.js} +2 -2
  100. package/dist/chunk-KVE7R4CG.js +320 -0
  101. package/dist/chunk-KVE7R4CG.js.map +1 -0
  102. package/dist/{chunk-L7WO3MZ4.js → chunk-KWP7T3DP.js} +2 -2
  103. package/dist/chunk-LAYN4LDC.js +267 -0
  104. package/dist/chunk-LAYN4LDC.js.map +1 -0
  105. package/dist/{chunk-PGK3VUHN.js → chunk-MTLYEMJB.js} +3 -2
  106. package/dist/chunk-MTLYEMJB.js.map +1 -0
  107. package/dist/{chunk-J47FNDR7.js → chunk-MYQWXITD.js} +7 -7
  108. package/dist/{chunk-YNI4S5WT.js → chunk-N53K2EXC.js} +2 -2
  109. package/dist/{chunk-763GUIOU.js → chunk-NBNN5GOB.js} +2 -2
  110. package/dist/{chunk-CXWFUJR2.js → chunk-NSB3WSYS.js} +125 -6
  111. package/dist/chunk-NSB3WSYS.js.map +1 -0
  112. package/dist/{chunk-KL4CP4SB.js → chunk-O5ETUNBT.js} +17 -5
  113. package/dist/chunk-O5ETUNBT.js.map +1 -0
  114. package/dist/{chunk-OOSWAUYB.js → chunk-ODWDQNRE.js} +2 -2
  115. package/dist/{chunk-ISY75RLM.js → chunk-OJFGVJS6.js} +288 -7
  116. package/dist/chunk-OJFGVJS6.js.map +1 -0
  117. package/dist/{chunk-HLBYLYRD.js → chunk-PAORGQRI.js} +70 -13
  118. package/dist/chunk-PAORGQRI.js.map +1 -0
  119. package/dist/{chunk-ZJLY4QSU.js → chunk-PMB3WGDL.js} +69 -6
  120. package/dist/chunk-PMB3WGDL.js.map +1 -0
  121. package/dist/{chunk-J3BT33K7.js → chunk-POBPGDWI.js} +5 -5
  122. package/dist/{chunk-QWUUMMIK.js → chunk-POMSFKTB.js} +1351 -76
  123. package/dist/chunk-POMSFKTB.js.map +1 -0
  124. package/dist/{chunk-OTAVQCSF.js → chunk-PYXS46O7.js} +2 -2
  125. package/dist/chunk-QDW3E4RD.js +108 -0
  126. package/dist/chunk-QDW3E4RD.js.map +1 -0
  127. package/dist/{chunk-YNCQ7E4M.js → chunk-QDYXG4CS.js} +4 -3
  128. package/dist/chunk-QDYXG4CS.js.map +1 -0
  129. package/dist/{chunk-XUHI52HK.js → chunk-QKAH5B6E.js} +4 -4
  130. package/dist/{chunk-HLXVTBF3.js → chunk-QNJMBKFK.js} +3 -2
  131. package/dist/chunk-QNJMBKFK.js.map +1 -0
  132. package/dist/chunk-RCICHSHL.js +789 -0
  133. package/dist/chunk-RCICHSHL.js.map +1 -0
  134. package/dist/{chunk-HG2NKWR2.js → chunk-S4LX5EBI.js} +2 -2
  135. package/dist/{chunk-4A24LIM2.js → chunk-S75M5ZRK.js} +2 -2
  136. package/dist/{chunk-QCCCQT3O.js → chunk-TBBDFYXW.js} +2 -2
  137. package/dist/chunk-TBBDFYXW.js.map +1 -0
  138. package/dist/{chunk-U4PV25RD.js → chunk-U2IQTSBY.js} +1 -1
  139. package/dist/chunk-U2IQTSBY.js.map +1 -0
  140. package/dist/chunk-U66YHYC7.js +31 -0
  141. package/dist/chunk-U66YHYC7.js.map +1 -0
  142. package/dist/{chunk-MWGVGUIS.js → chunk-UEYA6UC7.js} +36 -4
  143. package/dist/chunk-UEYA6UC7.js.map +1 -0
  144. package/dist/{chunk-MDDAA2AO.js → chunk-UPMD5XND.js} +2 -2
  145. package/dist/{chunk-M5KEYE5E.js → chunk-URB2WSKZ.js} +2 -2
  146. package/dist/chunk-UVJFDP7P.js +202 -0
  147. package/dist/chunk-UVJFDP7P.js.map +1 -0
  148. package/dist/{chunk-QY2BHY5O.js → chunk-V7XCAHIB.js} +265 -25
  149. package/dist/chunk-V7XCAHIB.js.map +1 -0
  150. package/dist/chunk-W6SL7OFG.js +180 -0
  151. package/dist/chunk-W6SL7OFG.js.map +1 -0
  152. package/dist/{chunk-QDOSNLB4.js → chunk-X4WESCKA.js} +17 -15
  153. package/dist/chunk-X4WESCKA.js.map +1 -0
  154. package/dist/{chunk-OTFNI3OO.js → chunk-XMGSSBFX.js} +1738 -383
  155. package/dist/chunk-XMGSSBFX.js.map +1 -0
  156. package/dist/chunk-YDBIWGNI.js +298 -0
  157. package/dist/chunk-YDBIWGNI.js.map +1 -0
  158. package/dist/chunk-YFYL2SIJ.js +7857 -0
  159. package/dist/chunk-YFYL2SIJ.js.map +1 -0
  160. package/dist/chunking.js +1 -1
  161. package/dist/citations.d.ts +67 -0
  162. package/dist/citations.js +13 -0
  163. package/dist/citations.js.map +1 -0
  164. package/dist/cli-DwIBnp2g.d.ts +1240 -0
  165. package/dist/cli.d.ts +31 -1147
  166. package/dist/cli.js +149 -7092
  167. package/dist/cli.js.map +1 -1
  168. package/dist/codex-materialize-CQlLTzke.d.ts +139 -0
  169. package/dist/codex-thread-key.d.ts +3 -0
  170. package/dist/codex-thread-key.js +7 -0
  171. package/dist/codex-thread-key.js.map +1 -0
  172. package/dist/config.js +3 -2
  173. package/dist/connectors/codex/instructions.md +160 -0
  174. package/dist/connectors/codex/resources/namespace-cheatsheet.md +48 -0
  175. package/dist/day-summary.d.ts +7 -2
  176. package/dist/day-summary.js +5 -2
  177. package/dist/embedding-fallback.d.ts +96 -2
  178. package/dist/embedding-fallback.js +6 -4
  179. package/dist/{engine-2A6J4XEX.js → engine-X7X3AAG3.js} +10 -7
  180. package/dist/engine-X7X3AAG3.js.map +1 -0
  181. package/dist/entity-retrieval.d.ts +3 -2
  182. package/dist/entity-retrieval.js +10 -7
  183. package/dist/entity-schema.d.ts +11 -0
  184. package/dist/entity-schema.js +19 -0
  185. package/dist/entity-schema.js.map +1 -0
  186. package/dist/explicit-capture.d.ts +6 -3
  187. package/dist/explicit-capture.js +2 -2
  188. package/dist/extraction-judge.d.ts +66 -0
  189. package/dist/extraction-judge.js +18 -0
  190. package/dist/extraction-judge.js.map +1 -0
  191. package/dist/extraction.d.ts +1 -0
  192. package/dist/extraction.js +12 -10
  193. package/dist/fallback-llm.js +4 -4
  194. package/dist/graph.js +1 -1
  195. package/dist/importance.d.ts +11 -1
  196. package/dist/importance.js +3 -1
  197. package/dist/index.d.ts +1140 -8
  198. package/dist/index.js +3350 -333
  199. package/dist/index.js.map +1 -1
  200. package/dist/intent.d.ts +2 -1
  201. package/dist/intent.js +3 -1
  202. package/dist/lifecycle.js +1 -1
  203. package/dist/local-llm.js +2 -2
  204. package/dist/logger.d.ts +1 -1
  205. package/dist/logger.js +1 -1
  206. package/dist/memory-cache.d.ts +2 -2
  207. package/dist/memory-cache.js +1 -1
  208. package/dist/{memory-projection-store-NxMkbocT.d.ts → memory-projection-store-DeSXPh1j.d.ts} +1 -1
  209. package/dist/memory-projection-store.d.ts +1 -1
  210. package/dist/model-registry.js +2 -2
  211. package/dist/models-json.js +2 -2
  212. package/dist/native-knowledge.js +2 -2
  213. package/dist/negative.js +2 -2
  214. package/dist/operator-toolkit.js +20 -16
  215. package/dist/{orchestrator-CIvLFHx3.d.ts → orchestrator-B9kwlCep.d.ts} +254 -9
  216. package/dist/orchestrator.d.ts +6 -3
  217. package/dist/orchestrator.js +70 -58
  218. package/dist/page-versioning.d.ts +77 -0
  219. package/dist/page-versioning.js +15 -0
  220. package/dist/page-versioning.js.map +1 -0
  221. package/dist/plugin-id.d.ts +37 -0
  222. package/dist/plugin-id.js +11 -0
  223. package/dist/plugin-id.js.map +1 -0
  224. package/dist/policy-runtime.js +2 -2
  225. package/dist/profiling.js +2 -2
  226. package/dist/qmd.d.ts +5 -2
  227. package/dist/qmd.js +3 -3
  228. package/dist/recall-audit.d.ts +20 -0
  229. package/dist/recall-audit.js +50 -0
  230. package/dist/recall-audit.js.map +1 -0
  231. package/dist/recall-mmr.d.ts +152 -0
  232. package/dist/recall-mmr.js +17 -0
  233. package/dist/recall-mmr.js.map +1 -0
  234. package/dist/recall-qos.js +2 -2
  235. package/dist/recall-state.js +2 -2
  236. package/dist/relevance.js +2 -2
  237. package/dist/resolve-provider-secret.js +2 -2
  238. package/dist/resume-bundles.js +5 -4
  239. package/dist/retrieval-agents.js +2 -2
  240. package/dist/retrieval.js +2 -2
  241. package/dist/schemas.d.ts +422 -64
  242. package/dist/schemas.js +3 -1
  243. package/dist/sdk-compat.d.ts +2 -0
  244. package/dist/sdk-compat.js +6 -3
  245. package/dist/sdk-compat.js.map +1 -1
  246. package/dist/semantic-chunking.d.ts +87 -0
  247. package/dist/semantic-chunking.js +20 -0
  248. package/dist/semantic-chunking.js.map +1 -0
  249. package/dist/semantic-consolidation-DrvSYRdB.d.ts +119 -0
  250. package/dist/semantic-consolidation.d.ts +4 -42
  251. package/dist/semantic-consolidation.js +23 -2
  252. package/dist/semantic-rule-promotion.js +9 -6
  253. package/dist/semantic-rule-verifier.js +10 -7
  254. package/dist/session-observer-state.js +2 -2
  255. package/dist/session-toggles.d.ts +22 -0
  256. package/dist/session-toggles.js +116 -0
  257. package/dist/session-toggles.js.map +1 -0
  258. package/dist/skills-registry.d.ts +47 -0
  259. package/dist/skills-registry.js +48 -0
  260. package/dist/skills-registry.js.map +1 -0
  261. package/dist/source-attribution.d.ts +169 -0
  262. package/dist/source-attribution.js +27 -0
  263. package/dist/source-attribution.js.map +1 -0
  264. package/dist/storage.d.ts +171 -10
  265. package/dist/storage.js +16 -5
  266. package/dist/summarizer.js +7 -7
  267. package/dist/temporal-supersession.d.ts +127 -0
  268. package/dist/temporal-supersession.js +20 -0
  269. package/dist/temporal-supersession.js.map +1 -0
  270. package/dist/threading.js +2 -2
  271. package/dist/tier-migration.d.ts +2 -1
  272. package/dist/tier-routing.js +2 -2
  273. package/dist/tokens.d.ts +21 -1
  274. package/dist/tokens.js +5 -1
  275. package/dist/transcript.js +2 -2
  276. package/dist/types.d.ts +497 -3
  277. package/dist/types.js +1 -1
  278. package/dist/utility-learner.js +2 -2
  279. package/dist/utility-runtime.js +3 -3
  280. package/dist/verified-recall.js +11 -8
  281. package/dist/whitespace.d.ts +4 -0
  282. package/dist/whitespace.js +9 -0
  283. package/dist/whitespace.js.map +1 -0
  284. package/package.json +14 -8
  285. package/dist/chunk-2CJCWDMR.js +0 -87
  286. package/dist/chunk-2CJCWDMR.js.map +0 -1
  287. package/dist/chunk-2PO5ZRKV.js.map +0 -1
  288. package/dist/chunk-6UJQNRIO.js.map +0 -1
  289. package/dist/chunk-B7LOFDVE.js.map +0 -1
  290. package/dist/chunk-BDFZXRSO.js.map +0 -1
  291. package/dist/chunk-CXWFUJR2.js.map +0 -1
  292. package/dist/chunk-DORBM6OB.js +0 -81
  293. package/dist/chunk-DORBM6OB.js.map +0 -1
  294. package/dist/chunk-ESSMF2FR.js.map +0 -1
  295. package/dist/chunk-HLBYLYRD.js.map +0 -1
  296. package/dist/chunk-HLXVTBF3.js.map +0 -1
  297. package/dist/chunk-ISY75RLM.js.map +0 -1
  298. package/dist/chunk-KL4CP4SB.js.map +0 -1
  299. package/dist/chunk-KWBU5S5U.js.map +0 -1
  300. package/dist/chunk-MWGVGUIS.js.map +0 -1
  301. package/dist/chunk-ORZMT74A.js.map +0 -1
  302. package/dist/chunk-OTFNI3OO.js.map +0 -1
  303. package/dist/chunk-PGK3VUHN.js.map +0 -1
  304. package/dist/chunk-QCCCQT3O.js.map +0 -1
  305. package/dist/chunk-QDOSNLB4.js.map +0 -1
  306. package/dist/chunk-QPKFPHOO.js +0 -178
  307. package/dist/chunk-QPKFPHOO.js.map +0 -1
  308. package/dist/chunk-QWUUMMIK.js.map +0 -1
  309. package/dist/chunk-QY2BHY5O.js.map +0 -1
  310. package/dist/chunk-TVVVQQAK.js.map +0 -1
  311. package/dist/chunk-U4PV25RD.js.map +0 -1
  312. package/dist/chunk-UYSKNO6E.js.map +0 -1
  313. package/dist/chunk-V4YC4LUK.js.map +0 -1
  314. package/dist/chunk-WWIQTB2Y.js.map +0 -1
  315. package/dist/chunk-YNCQ7E4M.js.map +0 -1
  316. package/dist/chunk-ZJLY4QSU.js.map +0 -1
  317. /package/dist/{engine-2A6J4XEX.js.map → active-memory-bridge.js.map} +0 -0
  318. /package/dist/{chunk-NTTLPF7F.js.map → chunk-3QFQGRHO.js.map} +0 -0
  319. /package/dist/{chunk-G3AG3KZN.js.map → chunk-5IZL4DCV.js.map} +0 -0
  320. /package/dist/{chunk-BRK4ODMI.js.map → chunk-5NPGSAVB.js.map} +0 -0
  321. /package/dist/{chunk-L5RPWGFK.js.map → chunk-7DHTMOND.js.map} +0 -0
  322. /package/dist/{chunk-Q6FETXJA.js.map → chunk-7SEAZFFB.js.map} +0 -0
  323. /package/dist/{chunk-QANCTXQF.js.map → chunk-AYPYCLR7.js.map} +0 -0
  324. /package/dist/{chunk-LP47L3ZX.js.map → chunk-BTY5RRRF.js.map} +0 -0
  325. /package/dist/{chunk-SCHEKPYH.js.map → chunk-C2EFFULQ.js.map} +0 -0
  326. /package/dist/{chunk-GJR6D6KC.js.map → chunk-D654IBA6.js.map} +0 -0
  327. /package/dist/{chunk-UV2FO7J4.js.map → chunk-E6K4NIEU.js.map} +0 -0
  328. /package/dist/{chunk-T4WRIV2C.js.map → chunk-EABGC2TL.js.map} +0 -0
  329. /package/dist/{chunk-ONRU4L2N.js.map → chunk-FEMOX5AD.js.map} +0 -0
  330. /package/dist/{chunk-IFFFR3MR.js.map → chunk-FSFEQI74.js.map} +0 -0
  331. /package/dist/{chunk-UIYZ5T3I.js.map → chunk-GJQPH5G3.js.map} +0 -0
  332. /package/dist/{chunk-ZKYI7UVO.js.map → chunk-JR4ZC3G4.js.map} +0 -0
  333. /package/dist/{chunk-UCYSTFZR.js.map → chunk-JRNQ3RNA.js.map} +0 -0
  334. /package/dist/{chunk-GPGBSNKM.js.map → chunk-K4FLSOR5.js.map} +0 -0
  335. /package/dist/{chunk-M5ZBBBJI.js.map → chunk-KEG4GNGI.js.map} +0 -0
  336. /package/dist/{chunk-L7WO3MZ4.js.map → chunk-KWP7T3DP.js.map} +0 -0
  337. /package/dist/{chunk-J47FNDR7.js.map → chunk-MYQWXITD.js.map} +0 -0
  338. /package/dist/{chunk-YNI4S5WT.js.map → chunk-N53K2EXC.js.map} +0 -0
  339. /package/dist/{chunk-763GUIOU.js.map → chunk-NBNN5GOB.js.map} +0 -0
  340. /package/dist/{chunk-OOSWAUYB.js.map → chunk-ODWDQNRE.js.map} +0 -0
  341. /package/dist/{chunk-J3BT33K7.js.map → chunk-POBPGDWI.js.map} +0 -0
  342. /package/dist/{chunk-OTAVQCSF.js.map → chunk-PYXS46O7.js.map} +0 -0
  343. /package/dist/{chunk-XUHI52HK.js.map → chunk-QKAH5B6E.js.map} +0 -0
  344. /package/dist/{chunk-HG2NKWR2.js.map → chunk-S4LX5EBI.js.map} +0 -0
  345. /package/dist/{chunk-4A24LIM2.js.map → chunk-S75M5ZRK.js.map} +0 -0
  346. /package/dist/{chunk-MDDAA2AO.js.map → chunk-UPMD5XND.js.map} +0 -0
  347. /package/dist/{chunk-M5KEYE5E.js.map → chunk-URB2WSKZ.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,23 +1,39 @@
1
+ export { LEGACY_PLUGIN_ID, PLUGIN_ID, resolveRemnicPluginEntry } from './plugin-id.js';
1
2
  export { parseConfig } from './config.js';
2
- export { O as Orchestrator, d as defaultWorkspaceDir, s as sanitizeSessionKeyForFilename } from './orchestrator-CIvLFHx3.js';
3
- export { StorageManager } from './storage.js';
3
+ import { f as BulkImportSourceAdapter } from './orchestrator-B9kwlCep.js';
4
+ export { g as BulkImportError, c as BulkImportOptions, d as BulkImportResult, B as BulkImportSource, h as ImportSourceRole, b as ImportTurn, i as ImportTurnValidationIssue, O as Orchestrator, j as defaultWorkspaceDir, k as isImportRole, p as parseIsoTimestamp, s as sanitizeSessionKeyForFilename, v as validateImportTurn } from './orchestrator-B9kwlCep.js';
5
+ import { StorageManager } from './storage.js';
4
6
  export { ExtractionEngine } from './extraction.js';
7
+ export { JudgeBatchResult, JudgeCandidate, JudgeVerdict, clearVerdictCache, createVerdictCache, judgeFactDurability, verdictCacheSize } from './extraction-judge.js';
8
+ export { hasBroadGraphIntent, inferIntentFromText, intentCompatibilityScore, isTaskInitiationIntent, planRecallMode } from './intent.js';
9
+ import { PluginConfig, MemoryFile, MemoryCategory, ImportanceLevel } from './types.js';
10
+ export { BriefingActiveThread, BriefingConfig, BriefingFocus, BriefingFollowup, BriefingOpenCommitment, BriefingRecentEntity, BriefingResult, BriefingSections, BriefingWindow, CalendarEvent, CalendarSource, CodexCompatConfig, ContinuityImprovementLoop, MemoryActionEligibilityContext, MemoryActionEligibilitySource, MemoryActionType } from './types.js';
11
+ export { CITATION_UNKNOWN, CitationContext, DEFAULT_CITATION_FORMAT, ParsedCitation, attachCitation, deriveSessionId, formatCitation, hasCitation, parseAllCitations, parseCitation, stripCitation } from './source-attribution.js';
5
12
  export { QmdClient } from './qmd.js';
6
13
  import { S as SearchBackend, a as SearchQueryOptions, b as SearchExecutionOptions, c as SearchResult } from './port-C1GZFv8h.js';
7
- import { PluginConfig } from './types.js';
8
- export { ContinuityImprovementLoop, MemoryActionEligibilityContext, MemoryActionEligibilitySource, MemoryActionType, MemoryCategory, MemoryFile } from './types.js';
9
14
  export { buildEntityRecallSection } from './entity-retrieval.js';
10
15
  export { TrustZoneName, TrustZoneRecord, TrustZoneRecordKind, TrustZoneSourceClass, isTrustZoneName } from './trust-zones.js';
11
16
  export { EngramAccessInputError, EngramAccessService } from './access-service.js';
12
17
  export { EngramAccessHttpServer } from './access-http.js';
13
18
  export { EngramMcpServer } from './access-mcp.js';
14
19
  export { MemoryStoreRequest, ObserveRequest, RecallRequest, SchemaName, SchemaValidationError, SuggestionSubmitRequest, formatZodError, memoryStoreRequestSchema, observeRequestSchema, recallRequestSchema, suggestionSubmitRequestSchema, validateRequest } from './access-schema.js';
15
- export { loadDaySummaryPrompt } from './day-summary.js';
20
+ export { buildExtensionsFooterForSummary, loadDaySummaryPrompt } from './day-summary.js';
21
+ export { ActiveMemoryGetOutput, ActiveMemoryMetadata, ActiveMemoryRecallParams, ActiveMemorySearchOutput, ActiveMemorySearchResult, getMemoryForActiveMemory, recallForActiveMemory } from './active-memory-bridge.js';
22
+ export { BRIEFING_FORMAT_ALLOWED, BriefingFollowupGenerator, BriefingFormatValue, BuildBriefingOptions, FileCalendarSource, ParsedBriefingWindow, briefingFilename, buildBriefing, focusMatchesEntity, focusMatchesMemory, parseBriefingFocus, parseBriefingWindow, renderBriefingMarkdown, resolveBriefingSaveDir, validateBriefingFormat } from './briefing.js';
16
23
  export { BootstrapEngine } from './bootstrap.js';
24
+ export { CODEX_THREAD_KEY_PREFIX } from './codex-thread-key.js';
25
+ export { PageVersion, VersionHistory, VersionTrigger, VersioningConfig, VersioningLogger, createVersion, diffVersions, getVersion, listVersions, revertToVersion } from './page-versioning.js';
26
+ export { CitationBlock, CitationEntry, CitationMetadata, buildCitationGuidance, formatOaiMemCitation, parseOaiMemCitation, sanitizeNoteForCitation } from './citations.js';
27
+ import { LoggerBackend } from './logger.js';
17
28
  export { initLogger, log } from './logger.js';
29
+ import { D as DiscoveredExtension } from './semantic-consolidation-DrvSYRdB.js';
30
+ export { E as ExtensionSchema, R as REMNIC_EXTENSIONS_TOTAL_TOKEN_LIMIT, b as buildExtensionsBlockForConsolidation, d as discoverMemoryExtensions, r as resolveExtensionsRoot } from './semantic-consolidation-DrvSYRdB.js';
18
31
  export { TokenEntry, TokenStore, generateToken, getAllValidTokens, getAllValidTokensCached, listTokens, loadTokenStore, resolveConnectorFromToken, revokeToken, saveTokenStore } from './tokens.js';
32
+ import { R as RolloutSummaryInput, M as MaterializeResult } from './codex-materialize-CQlLTzke.js';
33
+ export { a as MATERIALIZE_VERSION, b as MaterializeOptions, S as SENTINEL_FILE, d as describeMemoriesDir, e as ensureSentinel, m as materializeForNamespace } from './codex-materialize-CQlLTzke.js';
34
+ export { B as BulkImportCliCommandOptions, P as ProcessBatchFn, a as ProcessBatchResult, f as formatBatchTranscript, p as parseStrictCliDate, r as runBulkImportCliCommand, b as runBulkImportPipeline } from './cli-DwIBnp2g.js';
19
35
  import './buffer.js';
20
- import './memory-projection-store-NxMkbocT.js';
36
+ import './memory-projection-store-DeSXPh1j.js';
21
37
  import 'better-sqlite3';
22
38
  import './transcript.js';
23
39
  import './session-integrity.js';
@@ -29,14 +45,76 @@ import './negative.js';
29
45
  import './recall-state.js';
30
46
  import './session-observer-state.js';
31
47
  import './embedding-fallback.js';
32
- import './semantic-consolidation.js';
33
48
  import 'zod';
34
49
  import './policy-runtime.js';
35
50
  import './profiling.js';
36
51
  import './schemas.js';
52
+ import './fallback-llm.js';
37
53
  import './explicit-capture.js';
38
54
  import 'node:http';
39
55
  import 'node:stream';
56
+ import './dashboard-runtime.js';
57
+ import './evals.js';
58
+ import './graph.js';
59
+ import './causal-trajectory.js';
60
+ import './objective-state.js';
61
+ import './abstraction-nodes.js';
62
+ import './cue-anchors.js';
63
+ import './harmonic-retrieval.js';
64
+ import './verified-recall.js';
65
+ import './boxes.js';
66
+ import './semantic-rule-verifier.js';
67
+ import './commitment-ledger.js';
68
+ import './work-product-ledger.js';
69
+ import './utility-telemetry.js';
70
+ import './utility-learner.js';
71
+ import './resume-bundles.js';
72
+ import './semantic-rule-promotion.js';
73
+
74
+ /**
75
+ * memory-extension-host/render-extensions-block.ts — Render discovered extensions
76
+ * into a markdown block for injection into consolidation prompts.
77
+ *
78
+ * Respects the global token budget (REMNIC_EXTENSIONS_TOTAL_TOKEN_LIMIT) and
79
+ * truncates with a footer listing omitted extensions when over budget.
80
+ */
81
+
82
+ /**
83
+ * Render a markdown block containing extension instructions for injection
84
+ * into consolidation prompts.
85
+ *
86
+ * If the list is empty, returns "".
87
+ * Inlines extensions in name order until the token budget is exhausted.
88
+ * If the budget is exceeded, appends a truncation footer listing omitted extensions.
89
+ */
90
+ declare function renderExtensionsBlock(extensions: DiscoveredExtension[]): string;
91
+ /**
92
+ * Render a compact one-line footer listing active extension names.
93
+ * Used by day-summary and summary-snapshot where full instructions are not needed.
94
+ */
95
+ declare function renderExtensionsFooter(extensions: DiscoveredExtension[]): string;
96
+
97
+ /**
98
+ * Register a source adapter. Rejects duplicate names and empty names.
99
+ */
100
+ declare function registerBulkImportSource(adapter: BulkImportSourceAdapter): void;
101
+ /**
102
+ * Retrieve a registered adapter by name.
103
+ *
104
+ * Names are trimmed on write (see `registerBulkImportSource`), so we
105
+ * also trim on read to avoid the asymmetric-lookup footgun where a
106
+ * whitespace-padded lookup would never find a registered adapter.
107
+ * Non-string or empty-after-trim inputs return undefined.
108
+ */
109
+ declare function getBulkImportSource(name: string): BulkImportSourceAdapter | undefined;
110
+ /**
111
+ * List all registered adapter names.
112
+ */
113
+ declare function listBulkImportSources(): string[];
114
+ /**
115
+ * Clear all registered adapters (for testing).
116
+ */
117
+ declare function clearBulkImportSources(): void;
40
118
 
41
119
  interface MigrationResult {
42
120
  status: "fresh-install" | "already-migrated" | "migrated";
@@ -61,6 +139,38 @@ interface RollbackResult {
61
139
  declare function rollbackFromEngramMigration(options?: MigrationOptions): Promise<RollbackResult>;
62
140
  declare function migrateFromEngram(options?: MigrationOptions): Promise<MigrationResult>;
63
141
 
142
+ /**
143
+ * Intent-gated recall for active procedure memories (issue #519).
144
+ */
145
+
146
+ /**
147
+ * Build markdown for the recall pipeline when procedural memory is enabled and
148
+ * the prompt looks like task initiation.
149
+ */
150
+ declare function buildProcedureRecallSection(storage: StorageManager, prompt: string, config: PluginConfig): Promise<string | null>;
151
+
152
+ /**
153
+ * Procedural memory types (issue #519).
154
+ * Bodies use ordered "## Step N" sections; machine fields live in frontmatter / structuredAttributes.
155
+ */
156
+ interface ProcedureStep {
157
+ order: number;
158
+ intent: string;
159
+ toolCall?: {
160
+ kind: string;
161
+ signature: string;
162
+ };
163
+ expectedOutcome?: string;
164
+ optional?: boolean;
165
+ }
166
+ /** Serialize steps into markdown body (human-editable). */
167
+ declare function buildProcedureMarkdownBody(steps: ProcedureStep[]): string;
168
+ /**
169
+ * Best-effort parse of "## Step N" blocks into ProcedureStep records.
170
+ * Returns null when no step headers are found.
171
+ */
172
+ declare function parseProcedureStepsFromBody(content: string): ProcedureStep[] | null;
173
+
64
174
  /**
65
175
  * Standalone embedding helper for search backend adapters.
66
176
  *
@@ -227,6 +337,180 @@ declare class MeilisearchBackend implements SearchBackend {
227
337
  private mapHits;
228
338
  }
229
339
 
340
+ declare function resolvePrincipal(sessionKey: string | undefined, config: PluginConfig): string;
341
+
342
+ /**
343
+ * Binary file lifecycle management types.
344
+ *
345
+ * Defines the configuration, manifest, and record structures for the
346
+ * three-stage binary lifecycle pipeline: mirror, redirect, clean.
347
+ */
348
+ interface BinaryLifecycleConfig {
349
+ /** Master toggle. Default: false. */
350
+ enabled: boolean;
351
+ /** Days after mirror before local copy is eligible for cleanup. Default: 7. */
352
+ gracePeriodDays: number;
353
+ /** Files larger than this are skipped during scan. Default: 50 MB. */
354
+ maxBinarySizeBytes: number;
355
+ /** Glob patterns for binary file types to manage. */
356
+ scanPatterns: string[];
357
+ /** Backend configuration for binary storage. */
358
+ backend: BinaryStorageBackendConfig;
359
+ }
360
+ interface BinaryStorageBackendConfig {
361
+ /** Backend type. "filesystem" copies to a local directory. "none" is a no-op (dry-run/testing). */
362
+ type: "filesystem" | "s3" | "none";
363
+ /** Destination directory for the filesystem backend. */
364
+ basePath?: string;
365
+ /** S3 bucket name (future). */
366
+ s3Bucket?: string;
367
+ /** S3 region (future). */
368
+ s3Region?: string;
369
+ /** S3 key prefix (future). */
370
+ s3Prefix?: string;
371
+ }
372
+ type BinaryAssetStatus = "pending" | "mirrored" | "redirected" | "cleaned" | "error";
373
+ interface BinaryAssetRecord {
374
+ /** Relative path from memoryDir to the original file. */
375
+ originalPath: string;
376
+ /** Path (or URL) in the backend storage. */
377
+ mirroredPath: string;
378
+ /** SHA-256 hex digest of file content. */
379
+ contentHash: string;
380
+ /** File size in bytes. */
381
+ sizeBytes: number;
382
+ /** MIME type (e.g. "image/png"). */
383
+ mimeType: string;
384
+ /** ISO 8601 timestamp when the file was mirrored. */
385
+ mirroredAt: string;
386
+ /** ISO 8601 timestamp when markdown references were rewritten. */
387
+ redirectedAt?: string;
388
+ /** ISO 8601 timestamp when the local copy was deleted. */
389
+ cleanedAt?: string;
390
+ /** Current lifecycle status. */
391
+ status: BinaryAssetStatus;
392
+ }
393
+ interface BinaryLifecycleManifest {
394
+ version: 1;
395
+ assets: BinaryAssetRecord[];
396
+ lastScanAt?: string;
397
+ }
398
+ interface PipelineResult {
399
+ scanned: number;
400
+ mirrored: number;
401
+ redirected: number;
402
+ cleaned: number;
403
+ errors: string[];
404
+ dryRun: boolean;
405
+ }
406
+ declare const DEFAULT_SCAN_PATTERNS: string[];
407
+ declare const DEFAULT_MAX_BINARY_SIZE_BYTES: number;
408
+ declare const DEFAULT_GRACE_PERIOD_DAYS = 7;
409
+
410
+ /**
411
+ * Binary storage backend interface and implementations.
412
+ *
413
+ * Backends handle the actual persistence of binary files to an external
414
+ * location. The pipeline calls upload/exists/delete through this interface
415
+ * so swapping storage providers requires no pipeline changes.
416
+ */
417
+
418
+ interface BinaryStorageBackend {
419
+ /** Discriminator for the backend type. */
420
+ readonly type: string;
421
+ /**
422
+ * Upload a local file to the backend.
423
+ * @returns The backend path or URL where the file was stored.
424
+ */
425
+ upload(localPath: string, remotePath: string): Promise<string>;
426
+ /** Check whether a remote path already exists in the backend. */
427
+ exists(remotePath: string): Promise<boolean>;
428
+ /** Delete a file from the backend. */
429
+ delete(remotePath: string): Promise<void>;
430
+ }
431
+ declare class FilesystemBackend implements BinaryStorageBackend {
432
+ readonly type = "filesystem";
433
+ private readonly basePath;
434
+ constructor(basePath: string);
435
+ upload(localPath: string, remotePath: string): Promise<string>;
436
+ exists(remotePath: string): Promise<boolean>;
437
+ delete(remotePath: string): Promise<void>;
438
+ }
439
+ declare class NoneBackend implements BinaryStorageBackend {
440
+ readonly type = "none";
441
+ upload(_localPath: string, remotePath: string): Promise<string>;
442
+ exists(_remotePath: string): Promise<boolean>;
443
+ delete(_remotePath: string): Promise<void>;
444
+ }
445
+ declare function createBackend(cfg: BinaryStorageBackendConfig): BinaryStorageBackend;
446
+
447
+ /**
448
+ * Binary file scanner.
449
+ *
450
+ * Recursively walks the memory directory, matches files against configured
451
+ * glob patterns, skips files already tracked in the manifest, and respects
452
+ * the max-size limit.
453
+ */
454
+
455
+ /**
456
+ * Test whether a filename matches any of the provided glob patterns.
457
+ * Supports simple `*.ext` patterns (the default scan patterns).
458
+ * For more complex globs a proper library should be used; this covers
459
+ * the 95% case without adding a dependency.
460
+ */
461
+ declare function matchesPatterns(filename: string, patterns: string[]): boolean;
462
+ /**
463
+ * Scan memoryDir recursively for binary files matching the configured patterns.
464
+ * Returns relative paths (relative to memoryDir) for files not yet tracked.
465
+ */
466
+ declare function scanForBinaries(memoryDir: string, config: BinaryLifecycleConfig, manifest: BinaryLifecycleManifest): Promise<string[]>;
467
+
468
+ /**
469
+ * Binary lifecycle manifest — read/write operations.
470
+ *
471
+ * The manifest lives at `${memoryDir}/.binary-lifecycle/manifest.json`.
472
+ * Writes use the atomic temp-then-rename pattern (CLAUDE.md #54).
473
+ */
474
+
475
+ declare function manifestDir(memoryDir: string): string;
476
+ declare function manifestPath(memoryDir: string): string;
477
+ /**
478
+ * Read the manifest from disk. Returns a fresh empty manifest if the file
479
+ * does not exist or contains invalid JSON (CLAUDE.md #18).
480
+ */
481
+ declare function readManifest(memoryDir: string): Promise<BinaryLifecycleManifest>;
482
+ /**
483
+ * Write the manifest atomically: write to a temp file, then rename.
484
+ * CLAUDE.md #54: never delete before write. Write temp first, rename atomically.
485
+ */
486
+ declare function writeManifest(memoryDir: string, manifest: BinaryLifecycleManifest): Promise<void>;
487
+ declare function emptyManifest(): BinaryLifecycleManifest;
488
+
489
+ /**
490
+ * Binary lifecycle pipeline — mirror, redirect, clean.
491
+ *
492
+ * Three-stage pipeline:
493
+ * 1. Mirror: upload binary to backend, record in manifest
494
+ * 2. Redirect: scan markdown for inline refs, replace with redirect path
495
+ * 3. Clean: after grace period, delete local copy
496
+ */
497
+
498
+ /** Minimal logger interface so we don't depend on the full logger module. */
499
+ interface PipelineLogger {
500
+ info(msg: string): void;
501
+ warn(msg: string): void;
502
+ error(msg: string): void;
503
+ }
504
+ interface PipelineOptions {
505
+ dryRun?: boolean;
506
+ /** Force-clean all files past grace period, ignoring redirect status. */
507
+ forceClean?: boolean;
508
+ }
509
+ /**
510
+ * Run the binary lifecycle pipeline: scan, mirror, redirect, clean.
511
+ */
512
+ declare function runBinaryLifecyclePipeline(memoryDir: string, config: BinaryLifecycleConfig, backend: BinaryStorageBackend, log: PipelineLogger, opts?: PipelineOptions): Promise<PipelineResult>;
513
+
230
514
  /**
231
515
  * @remnic/core — Workspace Tree Projection
232
516
  *
@@ -523,6 +807,74 @@ interface ContradictionPair {
523
807
  declare function findDuplicates(options: DedupOptions): DedupResult;
524
808
  declare function findContradictions(options: ContradictionOptions): ContradictionResult;
525
809
 
810
+ /**
811
+ * @remnic/core — Write-time semantic dedup guard
812
+ *
813
+ * Complements the exact content-hash check in the orchestrator's write path
814
+ * by detecting near-duplicate candidate facts via embedding cosine similarity.
815
+ *
816
+ * The module intentionally has no dependency on the EmbeddingFallback or QMD
817
+ * classes directly — callers pass in a `lookup` function that returns the
818
+ * top-K nearest neighbors with their cosine scores. This keeps the decision
819
+ * logic pure and trivially testable with synthetic fixtures, and lets the
820
+ * orchestrator reuse whichever backend it already has wired up.
821
+ *
822
+ * Related issue: joshuaswarren/remnic#373
823
+ */
824
+ /** A single nearest-neighbor hit from the embedding backend. */
825
+ interface SemanticDedupHit {
826
+ /** Memory id of the existing neighbor. */
827
+ id: string;
828
+ /** Cosine similarity score in [0, 1]. */
829
+ score: number;
830
+ /** Optional source path, purely informational. */
831
+ path?: string;
832
+ }
833
+ /**
834
+ * Lookup function passed by the caller. Must return an array of hits sorted
835
+ * descending by score. Implementations should return an empty array (never
836
+ * throw) when the embedding backend is unavailable — the decision function
837
+ * treats that as "no near duplicate" (fail-open).
838
+ */
839
+ type SemanticDedupLookup = (content: string, limit: number) => Promise<SemanticDedupHit[]>;
840
+ interface SemanticDedupOptions {
841
+ /** Master switch. When false, `decideSemanticDedup` always returns `keep`. */
842
+ enabled: boolean;
843
+ /** Cosine similarity threshold (0-1). ≥ threshold ⇒ treat as duplicate. */
844
+ threshold: number;
845
+ /** How many nearest neighbors to compare against. */
846
+ candidates: number;
847
+ }
848
+ type SemanticDedupDecision = {
849
+ action: "keep";
850
+ reason: "disabled" | "backend_unavailable" | "no_candidates" | "no_near_duplicate";
851
+ topScore?: number;
852
+ topId?: string;
853
+ } | {
854
+ action: "skip";
855
+ reason: "near_duplicate";
856
+ topScore: number;
857
+ topId: string;
858
+ topPath?: string;
859
+ };
860
+ /**
861
+ * Pure decision function: given a lookup callback and options, decide whether
862
+ * the candidate content should be written or skipped as a near-duplicate.
863
+ *
864
+ * Contract:
865
+ * - When `options.enabled` is false → always keep, reason="disabled".
866
+ * - When the lookup throws (provider down / network error) → keep,
867
+ * reason="backend_unavailable". Fail-open: a lookup failure must not block
868
+ * writes.
869
+ * - When the lookup succeeds but returns 0 hits (empty index or no
870
+ * neighbors above the score floor) → keep, reason="no_candidates".
871
+ * This is distinct from backend_unavailable so telemetry dashboards can
872
+ * correctly distinguish "provider is down" from "index is empty".
873
+ * - When the top hit's score ≥ threshold → skip with reason="near_duplicate".
874
+ * - Otherwise → keep with reason="no_near_duplicate".
875
+ */
876
+ declare function decideSemanticDedup(content: string, lookup: SemanticDedupLookup, options: SemanticDedupOptions): Promise<SemanticDedupDecision>;
877
+
526
878
  /**
527
879
  * @remnic/core — Review Inbox
528
880
  *
@@ -656,12 +1008,204 @@ declare function watchForChanges(options: SyncOptions, onChange: (changes: FileC
656
1008
  stop: () => void;
657
1009
  };
658
1010
 
1011
+ /**
1012
+ * Coerce the `installExtension` config value from a string (e.g. from CLI
1013
+ * `--config installExtension=false`) to a proper boolean.
1014
+ *
1015
+ * Delegates to the generic `coerceBool` helper. Kept for backward compatibility.
1016
+ */
1017
+ declare function coerceInstallExtension(value: unknown): boolean | undefined;
1018
+
1019
+ /**
1020
+ * codex-materialize-runner.ts — Thin I/O bridge for the Codex materializer.
1021
+ *
1022
+ * The pure rendering logic lives in {@link ./codex-materialize.js}. This file
1023
+ * is the place callers (consolidation hooks, CLI, session-end hook) go when
1024
+ * they want the whole "load memories from storage → render → write" flow.
1025
+ *
1026
+ * Kept deliberately small so #378 never has to reach into orchestrator.ts /
1027
+ * importance.ts — the two files Wave 1 agents are editing concurrently.
1028
+ */
1029
+
1030
+ /** Options accepted by the shared post-consolidation materialize helper. */
1031
+ interface PostConsolidationMaterializeOptions {
1032
+ config: PluginConfig;
1033
+ namespace?: string;
1034
+ memories?: MemoryFile[];
1035
+ memoryDir?: string;
1036
+ codexHome?: string;
1037
+ rolloutSummaries?: RolloutSummaryInput[];
1038
+ now?: Date;
1039
+ }
1040
+ /** Options accepted by the runner. */
1041
+ interface RunMaterializeOptions {
1042
+ /** Remnic config — we only read the `codexMaterialize*` fields. */
1043
+ config: PluginConfig;
1044
+ /** Namespace to materialize. Overrides the config's `codexMaterializeNamespace`. */
1045
+ namespace?: string;
1046
+ /** Override the memory directory (defaults to `config.memoryDir`). */
1047
+ memoryDir?: string;
1048
+ /** Override `<codex_home>` (useful for tests). */
1049
+ codexHome?: string;
1050
+ /** Optional pre-loaded memories (bypasses disk read — used in tests). */
1051
+ memories?: MemoryFile[];
1052
+ /** Optional rollout summaries supplied by the caller. */
1053
+ rolloutSummaries?: RolloutSummaryInput[];
1054
+ /** Current time injection for deterministic runs. */
1055
+ now?: Date;
1056
+ /** Reason string — logged for observability. */
1057
+ reason?: "consolidation" | "session_end" | "manual" | "cli";
1058
+ }
1059
+ /**
1060
+ * Run the Codex materialization end-to-end. Returns `null` when the feature
1061
+ * is disabled in config or when the user hasn't opted in via the sentinel.
1062
+ * Never throws for "expected" skips; only throws on schema validation or I/O
1063
+ * errors that callers actually need to surface.
1064
+ */
1065
+ declare function runCodexMaterialize(options: RunMaterializeOptions): Promise<MaterializeResult | null>;
1066
+ /**
1067
+ * Shared helper for post-consolidation materialize hooks.
1068
+ *
1069
+ * `materializeAfterSemanticConsolidation` and `materializeAfterCausalConsolidation`
1070
+ * used to be two nearly-identical copies of this logic; keeping the actual
1071
+ * body here means any future guard/logging change happens in one place.
1072
+ *
1073
+ * The only per-caller knob is `logPrefix`, which is used to tag the
1074
+ * non-fatal warning emitted when the materializer throws.
1075
+ */
1076
+ declare function runPostConsolidationMaterialize(logPrefix: string, options: PostConsolidationMaterializeOptions): Promise<MaterializeResult | null>;
1077
+
1078
+ /**
1079
+ * codex-marketplace.ts — Codex marketplace installation support (#418)
1080
+ *
1081
+ * Provides types and functions for integrating Remnic with the Codex CLI
1082
+ * marketplace system (`codex marketplace add`). This module handles:
1083
+ *
1084
+ * - Generating a `marketplace.json` manifest describing Remnic as an
1085
+ * installable plugin in the Codex marketplace ecosystem.
1086
+ * - Validating marketplace manifest files against the expected schema.
1087
+ * - Writing manifests to disk atomically.
1088
+ * - Installing plugins from marketplace sources (GitHub, git, local, URL).
1089
+ *
1090
+ * Privacy
1091
+ * -------
1092
+ * This module does not persist any user content. It only reads package
1093
+ * metadata (name, version, description) and writes public marketplace
1094
+ * manifest files.
1095
+ */
1096
+
1097
+ /** Source type for marketplace installation. */
1098
+ type MarketplaceInstallType = "github" | "git" | "local" | "url";
1099
+ /** A single plugin entry within a marketplace manifest. */
1100
+ interface MarketplaceEntry {
1101
+ /** Plugin name (e.g. "remnic"). */
1102
+ name: string;
1103
+ /** Semver version string. */
1104
+ version: string;
1105
+ /** Human-readable description. */
1106
+ description: string;
1107
+ /** Repository identifier (e.g. "joshuaswarren/remnic"). */
1108
+ repository: string;
1109
+ /** How this plugin should be installed. */
1110
+ installType: MarketplaceInstallType;
1111
+ /** Optional direct URL to the plugin manifest. */
1112
+ manifestUrl?: string;
1113
+ /** Optional entry point path within the repository. */
1114
+ entry?: string;
1115
+ /** Optional config schema reference. */
1116
+ configSchema?: string;
1117
+ }
1118
+ /** Top-level marketplace manifest. */
1119
+ interface MarketplaceManifest {
1120
+ /** Schema version. Must be 1. */
1121
+ version: 1;
1122
+ /** Marketplace name. */
1123
+ name: string;
1124
+ /** Human-readable description. */
1125
+ description: string;
1126
+ /** Available plugins. */
1127
+ plugins: MarketplaceEntry[];
1128
+ }
1129
+ /** Configuration for the marketplace subsystem. */
1130
+ interface MarketplaceConfig {
1131
+ /** Whether marketplace features are enabled. Default: true. */
1132
+ enabled: boolean;
1133
+ /** Local path where marketplace data is cached. */
1134
+ registryPath: string;
1135
+ /** Whether to auto-update marketplace data on install. Default: false. */
1136
+ autoUpdate: boolean;
1137
+ }
1138
+ /** Result of a marketplace install operation. */
1139
+ interface MarketplaceInstallResult {
1140
+ /** Whether the install succeeded. */
1141
+ ok: boolean;
1142
+ /** Human-readable message. */
1143
+ message: string;
1144
+ /** Source that was installed from. */
1145
+ source: string;
1146
+ /** Source type. */
1147
+ sourceType: MarketplaceInstallType;
1148
+ /** Plugins that were discovered. */
1149
+ pluginsFound: string[];
1150
+ /** Errors encountered (empty on success). */
1151
+ errors: string[];
1152
+ }
1153
+ /** Logger interface accepted by marketplace functions. */
1154
+ interface MarketplaceLogger {
1155
+ info: (msg: string) => void;
1156
+ warn: (msg: string) => void;
1157
+ debug?: (msg: string) => void;
1158
+ }
1159
+ /** Current marketplace schema version. */
1160
+ declare const MARKETPLACE_SCHEMA_VERSION: 1;
1161
+ /** Default marketplace manifest filename. */
1162
+ declare const MARKETPLACE_MANIFEST_FILENAME = "marketplace.json";
1163
+ /**
1164
+ * Generate a marketplace manifest describing Remnic as an installable plugin.
1165
+ *
1166
+ * Reads version from the workspace root `package.json` at the resolved path,
1167
+ * or falls back to a default version string.
1168
+ */
1169
+ declare function generateMarketplaceManifest(options?: {
1170
+ packageVersion?: string;
1171
+ }): MarketplaceManifest;
1172
+ /** Validation result with structured errors. */
1173
+ interface MarketplaceValidation {
1174
+ valid: boolean;
1175
+ errors: string[];
1176
+ }
1177
+ /**
1178
+ * Validate that an unknown value conforms to the MarketplaceManifest schema.
1179
+ *
1180
+ * Returns a typed manifest on success. Throws on invalid input with a
1181
+ * descriptive error message listing all schema violations.
1182
+ */
1183
+ declare function validateMarketplaceManifest(manifest: unknown): MarketplaceManifest;
1184
+ /**
1185
+ * Non-throwing validation. Returns a structured result with error details.
1186
+ */
1187
+ declare function checkMarketplaceManifest(manifest: unknown): MarketplaceValidation;
1188
+ /**
1189
+ * Write a marketplace manifest to disk atomically.
1190
+ *
1191
+ * Uses write-to-temp-then-rename to avoid partial writes (CLAUDE.md gotcha #54).
1192
+ */
1193
+ declare function writeMarketplaceManifest(outputDir: string, manifest: MarketplaceManifest): Promise<void>;
1194
+ /**
1195
+ * Install from a marketplace source.
1196
+ *
1197
+ * Reads the marketplace.json from the given source, validates it, and
1198
+ * returns a result describing what was found.
1199
+ */
1200
+ declare function installFromMarketplace(source: string, sourceType: MarketplaceInstallType, config: PluginConfig, logger?: MarketplaceLogger): Promise<MarketplaceInstallResult>;
1201
+
659
1202
  /**
660
1203
  * @remnic/core — Connector Manager
661
1204
  *
662
1205
  * Metadata-driven registry for host adapters (Codex CLI, Claude Code, Cursor, etc.).
663
1206
  * Manages connector lifecycle: install, remove, configure, health.
664
1207
  */
1208
+
665
1209
  interface ConnectorManifest {
666
1210
  /** Unique connector ID (e.g. "claude-code", "codex-cli") */
667
1211
  id: string;
@@ -685,6 +1229,15 @@ interface ConnectorManifest {
685
1229
  repository?: string;
686
1230
  /** Tags */
687
1231
  tags?: string[];
1232
+ /**
1233
+ * Whether this connector requires a bearer token for daemon authentication.
1234
+ * When false (the default), installConnector will NOT generate or persist a
1235
+ * token entry in tokens.json — credentials are never materialized on disk for
1236
+ * connectors that use MCP, embedded, CLI, or SDK transports that don't need
1237
+ * token auth. Set to true only for HTTP connectors that actually authenticate
1238
+ * requests with a bearer token (e.g. hermes, replit, generic-mcp).
1239
+ */
1240
+ requiresToken?: boolean;
688
1241
  }
689
1242
  interface ConnectorCapability {
690
1243
  /** Can observe conversations */
@@ -751,6 +1304,10 @@ interface RemoveResult {
751
1304
  configPath: string;
752
1305
  /** Message */
753
1306
  message: string;
1307
+ /** Status: "removed" on success, "error" if the removal failed partway, "not_found" if the connector was not installed, "skipped" if removal was aborted (e.g. malformed config). */
1308
+ status: "removed" | "error" | "not_found" | "skipped";
1309
+ /** Machine-readable skip reason (present when status === "skipped"). */
1310
+ reason?: string;
754
1311
  }
755
1312
  interface DoctorResult {
756
1313
  /** Connector ID */
@@ -768,6 +1325,7 @@ interface DoctorCheck {
768
1325
  /** Detail */
769
1326
  detail: string;
770
1327
  }
1328
+
771
1329
  declare function loadRegistry(): ConnectorRegistry;
772
1330
  declare function saveRegistry(registry: ConnectorRegistry): void;
773
1331
  declare function listConnectors(): {
@@ -920,4 +1478,578 @@ declare function mergeSpaces(sourceSpaceId: string, targetSpaceId: string, optio
920
1478
  }): MergeResult;
921
1479
  declare function getAuditLog(baseDir?: string): AuditEntry[];
922
1480
 
923
- export { type AuditEntry, type ConflictEntry, type ConnectorCapability, type ConnectorInstance, type ConnectorManifest, type ConnectorRegistry, type ContradictionOptions, type ContradictionPair, type ContradictionResult$1 as CurateContradictionResult, type DuplicateResult as CurateDuplicateResult, type CurateOptions, type CurateResult, type CuratedStatement, type DedupOptions, type DedupResult, type DocFile, type DoctorCheck, type DoctorResult, type DuplicatePair, type FileChange, type GenerateOptions, type GenerateResult, type IngestionPlan, type InstallOptions, type InstallResult, LanceDbBackend, type LanguageInfo, MeilisearchBackend, type MemoryEntry, type MergeResult, type MigrationOptions, type MigrationResult, type OnboardOptions, type OnboardResult, OramaBackend, PluginConfig, type ProjectShape, type ProvenanceEntry, type RemoveResult, type ReviewAction, type ReviewItem, type ReviewListResult, type ReviewOptions, type ReviewResult, type RollbackResult, type Space, type SpaceKind, type SpaceManifest, type SpacePromoteResult, type SpacePullResult, type SpacePushResult, type SpaceShareResult, type SpaceSwitchResult, type StatementProvenance, type SyncOptions, type SyncResult, type SyncState, type TreeNode, createSpace, curate, deleteSpace, doctorConnector, findContradictions, findDuplicates, generateContextTree, getActiveSpace, getAuditLog, getManifestPath, getSpacesDir, installConnector, listConnectors, listReviewItems, listSpaces, loadManifest, loadRegistry, mergeSpaces, migrateFromEngram, onboard, performReview, promoteSpace, pullFromSpace, pushToSpace, removeConnector, rollbackFromEngramMigration, saveManifest, saveRegistry, shareSpace, switchSpace, syncChanges, watchForChanges };
1481
+ /**
1482
+ * @remnic/core — Memory Extension Publisher Contract
1483
+ *
1484
+ * Defines the interface that every host-specific publisher must implement.
1485
+ * Each publisher knows how to write Remnic instruction files into the
1486
+ * host's extension directory so the host agent can discover and use
1487
+ * Remnic memories.
1488
+ */
1489
+ /**
1490
+ * A publisher that can install (and remove) Remnic memory-extension
1491
+ * artefacts into a specific host's extension directory.
1492
+ */
1493
+ interface MemoryExtensionPublisher {
1494
+ /** Unique host identifier (e.g. "codex", "claude-code", "hermes"). */
1495
+ readonly hostId: string;
1496
+ /**
1497
+ * Resolve the absolute path to the extension root for this host.
1498
+ * @param env Optional environment to read HOME / host-specific vars from.
1499
+ */
1500
+ resolveExtensionRoot(env?: NodeJS.ProcessEnv): Promise<string>;
1501
+ /** Return true when the host toolchain appears to be installed locally. */
1502
+ isHostAvailable(): Promise<boolean>;
1503
+ /** Render the full instructions markdown that will be written to disk. */
1504
+ renderInstructions(ctx: PublishContext): Promise<string>;
1505
+ /** Write extension artefacts to the host's extension directory. */
1506
+ publish(ctx: PublishContext): Promise<PublishResult>;
1507
+ /** Remove extension artefacts previously written by publish(). */
1508
+ unpublish(): Promise<void>;
1509
+ }
1510
+ /**
1511
+ * Context passed to every publisher method that needs configuration,
1512
+ * paths, or logging.
1513
+ */
1514
+ interface PublishContext {
1515
+ readonly config: {
1516
+ memoryDir: string;
1517
+ daemonPort?: number;
1518
+ namespace?: string;
1519
+ };
1520
+ readonly skillsRoot: string;
1521
+ readonly log: {
1522
+ info: (msg: string) => void;
1523
+ warn: (msg: string) => void;
1524
+ error: (msg: string) => void;
1525
+ };
1526
+ }
1527
+ /** Result returned by a successful publish() call. */
1528
+ interface PublishResult {
1529
+ readonly hostId: string;
1530
+ readonly extensionRoot: string;
1531
+ readonly filesWritten: string[];
1532
+ readonly skipped: string[];
1533
+ }
1534
+ /**
1535
+ * Declarative capability flags that describe what a given publisher
1536
+ * can produce. Useful for feature-gating UI or doctor output without
1537
+ * instantiating the publisher.
1538
+ */
1539
+ interface PublisherCapabilities {
1540
+ /** Whether the publisher writes an instructions.md file. */
1541
+ readonly instructionsMd: boolean;
1542
+ /** Whether the publisher populates a skills folder. */
1543
+ readonly skillsFolder: boolean;
1544
+ /** Whether the publisher embeds citation format guidance. */
1545
+ readonly citationFormat: boolean;
1546
+ /** Whether the publisher includes a read-path template for the host. */
1547
+ readonly readPathTemplate: boolean;
1548
+ }
1549
+
1550
+ /**
1551
+ * @remnic/core — Shared Instruction Blocks
1552
+ *
1553
+ * Reusable markdown fragments that every host-specific publisher can
1554
+ * compose into its instructions.md file. Keeping them here avoids
1555
+ * per-host copy-paste drift.
1556
+ */
1557
+ /**
1558
+ * Describes the Remnic memory types a host agent may encounter.
1559
+ */
1560
+ declare const REMNIC_SEMANTIC_OVERVIEW = "## Remnic Memory Types\n\nRemnic stores memories as plain Markdown files with YAML front-matter.\nEach memory has a **type** that describes its semantic role:\n\n| Type | Description |\n|------|-------------|\n| `fact` | An objective piece of knowledge the user confirmed or that was extracted from a session. |\n| `preference` | A stated or inferred user preference (e.g. coding style, tool choice). |\n| `decision` | An explicit decision or trade-off the user made. |\n| `entity` | A named thing the user cares about (project, service, person, API). |\n| `skill` | A reusable workflow or procedure documented for future sessions. |\n| `correction` | A fix or amendment to a previously stored memory. |\n| `question` | An open question or uncertainty flagged for future resolution. |\n| `observation` | A pattern noticed across sessions (e.g. \"user always runs tests before commits\"). |\n| `summary` | A condensed roll-up of recent sessions or a topic area. |\n\nWhen reading Remnic content, the front-matter `type` field tells you what\nkind of knowledge you are looking at and how much weight to give it.\n";
1561
+ /**
1562
+ * Explains the oai-mem-citation block format hosts should use when
1563
+ * referencing Remnic-sourced content.
1564
+ */
1565
+ declare const REMNIC_CITATION_FORMAT = "## Citing Remnic Memories\n\nWhen a piece of your output draws on a Remnic file, cite it using the\nmemory citation block format so the user can trace the source:\n\n```\n<oai-mem-citation path=\"<path-relative-to-remnic-memory-base>\" />\n```\n\nThe path must be **relative to the Remnic memory base** (the directory\nnamed `memories/` under `<remnic-home>`), not absolute. Examples:\n\n- `<oai-mem-citation path=\"default/MEMORY.md\" />`\n- `<oai-mem-citation path=\"my-project/skills/deploy/SKILL.md\" />`\n- `<oai-mem-citation path=\"shared/memory_summary.md\" />`\n\nCite each distinct source once near the fact it supports. Do not invent\ncitations for files you have not actually read.\n";
1566
+ /**
1567
+ * Table of MCP tools the Remnic daemon exposes. Hosts that can reach
1568
+ * the MCP server should prefer these over raw file reads.
1569
+ *
1570
+ * Tool names use the canonical `remnic.*` prefix. Legacy `engram.*`
1571
+ * aliases are also accepted by the server for backward compatibility.
1572
+ */
1573
+ declare const REMNIC_MCP_TOOL_INVENTORY = "## Remnic MCP Tools\n\nWhen the Remnic MCP server is reachable, the following tools are\navailable. Prefer MCP tools over direct file reads when the host\nsupports MCP connections.\n\n| Tool | Purpose |\n|------|---------|\n| `remnic.recall` | Retrieve contextually relevant memories for the current session. |\n| `remnic.recall_explain` | Like recall, but includes an explanation of why each memory was selected. |\n| `remnic.memory_store` | Persist a new memory (fact, preference, decision, etc.). |\n| `remnic.memory_get` | Fetch a specific memory by ID. |\n| `remnic.memory_search` | Full-text + semantic search across all memories. |\n| `remnic.memory_timeline` | Retrieve memories in chronological order within a time range. |\n| `remnic.observe` | Record an observation from the current conversation turn. |\n| `remnic.entity_get` | Look up a named entity and its relationships. |\n| `remnic.memory_entities_list` | List all known entities. |\n| `remnic.memory_profile` | Retrieve the user profile summary. |\n| `remnic.day_summary` | Generate a summary of memories from a specific day. |\n| `remnic.briefing` | Generate a structured briefing for an upcoming session. |\n| `remnic.memory_feedback` | Submit feedback on a recalled memory (useful, outdated, wrong). |\n| `remnic.memory_promote` | Promote a memory to a higher confidence tier. |\n| `remnic.context_checkpoint` | Save a conversation checkpoint for continuity. |\n| `remnic.suggestion_submit` | Submit a suggestion for a new memory to the review queue. |\n| `remnic.review_queue_list` | List pending suggestions in the review queue. |\n| `remnic.work_task` | Create or update a work task. |\n| `remnic.work_project` | Create or update a work project. |\n| `remnic.work_board` | View the work board. |\n\nLegacy `engram.*` prefixed names are accepted as aliases for all tools.\n";
1574
+ /**
1575
+ * Decision rules for when a host agent should use MCP recall vs
1576
+ * reading Remnic files directly from disk.
1577
+ */
1578
+ declare const REMNIC_RECALL_DECISION_RULES = "## When to Use Recall vs Direct Read\n\n### Use `remnic.recall` (MCP) when:\n\n- The Remnic MCP server is reachable (the host has an active MCP\n connection to the Remnic daemon).\n- You want contextually relevant memories ranked by the recall planner\n (semantic search + reranking + importance scoring).\n- You need memories across multiple namespaces or topics.\n- The conversation benefits from Remnic's intent detection and\n adaptive recall depth.\n\n### Use direct file reads when:\n\n- You are in a sandboxed environment with no network or MCP access\n (e.g. Codex phase-2 consolidation).\n- You need a specific file you already know the path to.\n- The MCP server is unavailable or unhealthy.\n- You are operating on the raw memory files for maintenance or\n migration purposes.\n\n### General guidance:\n\n- Prefer MCP tools when available \u2014 they provide ranked, deduplicated,\n and context-aware results.\n- Fall back to file reads gracefully \u2014 never block on a failed MCP call\n when the data is also on disk.\n- Never write directly to the Remnic memory directory unless you are an\n authorized extraction or consolidation process.\n";
1579
+
1580
+ /**
1581
+ * @remnic/core — Codex Memory Extension Publisher
1582
+ *
1583
+ * Writes Remnic instructions into ~/.codex/memories_extensions/remnic/
1584
+ * so the Codex agent can discover and use Remnic memories during its
1585
+ * consolidation phase.
1586
+ */
1587
+
1588
+ /**
1589
+ * Codex-specific publisher that knows the Codex extension layout:
1590
+ * ~/.codex/memories_extensions/remnic/instructions.md
1591
+ */
1592
+ declare class CodexMemoryExtensionPublisher implements MemoryExtensionPublisher {
1593
+ readonly hostId = "codex";
1594
+ static readonly capabilities: PublisherCapabilities;
1595
+ resolveExtensionRoot(env?: NodeJS.ProcessEnv): Promise<string>;
1596
+ isHostAvailable(): Promise<boolean>;
1597
+ renderInstructions(ctx: PublishContext): Promise<string>;
1598
+ publish(ctx: PublishContext): Promise<PublishResult>;
1599
+ unpublish(): Promise<void>;
1600
+ }
1601
+
1602
+ /**
1603
+ * @remnic/core — Claude Code Memory Extension Publisher (stub)
1604
+ *
1605
+ * Placeholder publisher for Claude Code. Claude Code does not yet
1606
+ * support a file-based memory extension directory, so all methods are
1607
+ * no-ops that return safe defaults.
1608
+ */
1609
+
1610
+ declare class ClaudeCodeMemoryExtensionPublisher implements MemoryExtensionPublisher {
1611
+ readonly hostId = "claude-code";
1612
+ static readonly capabilities: PublisherCapabilities;
1613
+ resolveExtensionRoot(): Promise<string>;
1614
+ isHostAvailable(): Promise<boolean>;
1615
+ renderInstructions(_ctx: PublishContext): Promise<string>;
1616
+ publish(_ctx: PublishContext): Promise<PublishResult>;
1617
+ unpublish(): Promise<void>;
1618
+ }
1619
+
1620
+ /**
1621
+ * @remnic/core — Hermes Memory Extension Publisher (stub)
1622
+ *
1623
+ * Placeholder publisher for Hermes. Hermes uses a daemon-based
1624
+ * transport and does not currently consume file-based memory
1625
+ * extensions, so all methods are no-ops.
1626
+ */
1627
+
1628
+ declare class HermesMemoryExtensionPublisher implements MemoryExtensionPublisher {
1629
+ readonly hostId = "hermes";
1630
+ static readonly capabilities: PublisherCapabilities;
1631
+ resolveExtensionRoot(): Promise<string>;
1632
+ isHostAvailable(): Promise<boolean>;
1633
+ renderInstructions(_ctx: PublishContext): Promise<string>;
1634
+ publish(_ctx: PublishContext): Promise<PublishResult>;
1635
+ unpublish(): Promise<void>;
1636
+ }
1637
+
1638
+ /**
1639
+ * @remnic/core — Memory Extension Publisher Registry
1640
+ *
1641
+ * Generic registry that host adapters populate at startup via
1642
+ * `registerPublisher()`. The publisher *classes* live in core so
1643
+ * adapters can import them, but the wiring of host-specific
1644
+ * implementations into the registry happens in the host adapter
1645
+ * layer (e.g. @remnic/cli), not here. This keeps core free of
1646
+ * host-specific knowledge (CLAUDE.md gotcha #31).
1647
+ *
1648
+ * Usage (from a host adapter):
1649
+ * import { registerPublisher, CodexMemoryExtensionPublisher } from "@remnic/core";
1650
+ * registerPublisher("codex", () => new CodexMemoryExtensionPublisher());
1651
+ */
1652
+
1653
+ /**
1654
+ * Factory registry keyed by host ID. Each value is a zero-argument
1655
+ * factory that returns a fresh publisher instance.
1656
+ *
1657
+ * Starts empty — host adapters populate it via registerPublisher().
1658
+ */
1659
+ declare const PUBLISHERS: Record<string, () => MemoryExtensionPublisher>;
1660
+ /**
1661
+ * Register a publisher factory for a given host ID.
1662
+ *
1663
+ * Host adapters call this at startup to wire their host-specific
1664
+ * publisher implementations into the registry. Calling with an
1665
+ * existing hostId replaces the previous factory.
1666
+ */
1667
+ declare function registerPublisher(hostId: string, factory: () => MemoryExtensionPublisher): void;
1668
+ /**
1669
+ * Resolve a connector ID to its publisher host ID.
1670
+ *
1671
+ * Returns the explicit mapping if one exists, otherwise returns
1672
+ * the connector ID itself (identity mapping covers the common case
1673
+ * where connector ID === host ID).
1674
+ */
1675
+ declare function hostIdForConnector(connectorId: string): string;
1676
+ /**
1677
+ * Look up a publisher by host ID.
1678
+ * Returns undefined for unknown host IDs rather than throwing.
1679
+ */
1680
+ declare function publisherFor(hostId: string): MemoryExtensionPublisher | undefined;
1681
+ /**
1682
+ * Look up a publisher by connector ID.
1683
+ *
1684
+ * Resolves the connector ID to its host ID first (e.g. "codex-cli" -> "codex"),
1685
+ * then looks up the publisher. Returns undefined if no publisher exists for
1686
+ * the resolved host ID.
1687
+ */
1688
+ declare function publisherForConnector(connectorId: string): MemoryExtensionPublisher | undefined;
1689
+
1690
+ /**
1691
+ * Taxonomy types for the MECE knowledge directory.
1692
+ *
1693
+ * A taxonomy defines a set of categories that partition the knowledge
1694
+ * space so that every memory maps to exactly one category (Mutually
1695
+ * Exclusive, Collectively Exhaustive).
1696
+ */
1697
+ /**
1698
+ * A single category in the taxonomy.
1699
+ *
1700
+ * @property id - Slug: lowercase letters, digits, hyphens; max 32 chars.
1701
+ * @property name - Human-readable display name.
1702
+ * @property description - What belongs in this category.
1703
+ * @property filingRules - Prose rules used by the resolver decision tree.
1704
+ * @property parentId - Optional parent category for nesting.
1705
+ * @property priority - Tie-breaker: lower number wins when a memory
1706
+ * could belong to multiple categories.
1707
+ * @property memoryCategories - Which MemoryCategory values map here.
1708
+ */
1709
+ interface TaxonomyCategory {
1710
+ id: string;
1711
+ name: string;
1712
+ description: string;
1713
+ filingRules: string[];
1714
+ parentId?: string;
1715
+ priority: number;
1716
+ memoryCategories: string[];
1717
+ }
1718
+ /**
1719
+ * A versioned taxonomy comprising an ordered list of categories.
1720
+ */
1721
+ interface Taxonomy {
1722
+ version: number;
1723
+ categories: TaxonomyCategory[];
1724
+ }
1725
+ /**
1726
+ * The output of the resolver: which category a piece of knowledge
1727
+ * belongs to, with confidence and alternatives.
1728
+ */
1729
+ interface ResolverDecision {
1730
+ categoryId: string;
1731
+ confidence: number;
1732
+ reason: string;
1733
+ alternatives: Array<{
1734
+ categoryId: string;
1735
+ reason: string;
1736
+ }>;
1737
+ }
1738
+
1739
+ /**
1740
+ * Default MECE taxonomy that maps every existing MemoryCategory value
1741
+ * to exactly one taxonomy category, ordered by priority.
1742
+ */
1743
+
1744
+ declare const DEFAULT_TAXONOMY: Taxonomy;
1745
+
1746
+ /**
1747
+ * Resolver decision tree for the MECE taxonomy.
1748
+ *
1749
+ * Given extracted content and its MemoryCategory, determines which
1750
+ * taxonomy category the knowledge should be filed under.
1751
+ */
1752
+
1753
+ /**
1754
+ * Resolve a piece of content to a taxonomy category.
1755
+ *
1756
+ * Algorithm:
1757
+ * 1. Find all taxonomy categories whose `memoryCategories` include
1758
+ * the given `memoryCategory`.
1759
+ * 2. If exactly one match, return it with confidence 1.0.
1760
+ * 3. If multiple matches, pick the one with the lowest priority
1761
+ * number (highest precedence). Apply keyword heuristics from
1762
+ * filing rules as a secondary signal.
1763
+ * 4. If no match, fall back to the "facts" category (or first
1764
+ * category if "facts" is absent) with low confidence.
1765
+ * 5. Always populate `alternatives` with other plausible categories.
1766
+ */
1767
+ declare function resolveCategory(content: string, memoryCategory: MemoryCategory, taxonomy: Taxonomy): ResolverDecision;
1768
+
1769
+ /**
1770
+ * Generates a markdown decision-tree document (RESOLVER.md) from a
1771
+ * taxonomy definition.
1772
+ *
1773
+ * The document walks a user through filing a new piece of knowledge
1774
+ * by checking each category in priority order (lowest number first).
1775
+ */
1776
+
1777
+ /**
1778
+ * Produce a markdown decision tree for the given taxonomy.
1779
+ *
1780
+ * Categories are listed in priority order (lowest number = checked first).
1781
+ * Each step asks whether the knowledge fits the category and, if so,
1782
+ * instructs the reader to file it there.
1783
+ */
1784
+ declare function generateResolverDocument(taxonomy: Taxonomy): string;
1785
+
1786
+ /**
1787
+ * Loads and validates a user-customized taxonomy from disk, merging
1788
+ * with the built-in defaults.
1789
+ *
1790
+ * User taxonomies are stored at `<memoryDir>/.taxonomy/taxonomy.json`.
1791
+ */
1792
+
1793
+ /**
1794
+ * Validate a taxonomy category slug.
1795
+ * Throws if the slug is invalid.
1796
+ */
1797
+ declare function validateSlug(slug: string): void;
1798
+ /**
1799
+ * Validate an entire taxonomy for structural correctness.
1800
+ * Throws on the first error found.
1801
+ */
1802
+ declare function validateTaxonomy(taxonomy: Taxonomy): void;
1803
+ /**
1804
+ * Load a taxonomy from the user's memory directory.
1805
+ *
1806
+ * If `<memoryDir>/.taxonomy/taxonomy.json` exists, loads it, validates
1807
+ * it, and merges with the defaults (user categories override defaults
1808
+ * by ID). If the file does not exist, returns the defaults.
1809
+ */
1810
+ declare function loadTaxonomy(memoryDir: string): Promise<Taxonomy>;
1811
+ /**
1812
+ * Save a taxonomy to the user's memory directory.
1813
+ */
1814
+ declare function saveTaxonomy(memoryDir: string, taxonomy: Taxonomy): Promise<void>;
1815
+ /**
1816
+ * Get the taxonomy directory path for a given memory directory.
1817
+ */
1818
+ declare function getTaxonomyDir(memoryDir: string): string;
1819
+ /**
1820
+ * Get the taxonomy file path for a given memory directory.
1821
+ */
1822
+ declare function getTaxonomyFilePath(memoryDir: string): string;
1823
+
1824
+ /**
1825
+ * Enrichment pipeline types (issue #365).
1826
+ *
1827
+ * Defines the provider interface, candidate shape, pipeline config,
1828
+ * and result types for the external enrichment subsystem.
1829
+ */
1830
+
1831
+ type EnrichmentCostTier = "free" | "cheap" | "expensive";
1832
+ interface EnrichmentProviderConfig {
1833
+ id: string;
1834
+ enabled: boolean;
1835
+ costTier: EnrichmentCostTier;
1836
+ rateLimit?: {
1837
+ maxPerMinute: number;
1838
+ maxPerDay: number;
1839
+ };
1840
+ }
1841
+ interface EnrichmentCandidate {
1842
+ text: string;
1843
+ source: string;
1844
+ sourceUrl?: string;
1845
+ confidence: number;
1846
+ category: MemoryCategory;
1847
+ tags?: string[];
1848
+ }
1849
+ interface EnrichmentProvider {
1850
+ readonly id: string;
1851
+ readonly costTier: EnrichmentCostTier;
1852
+ enrich(entity: EntityEnrichmentInput): Promise<EnrichmentCandidate[]>;
1853
+ isAvailable(): Promise<boolean>;
1854
+ }
1855
+ interface EntityEnrichmentInput {
1856
+ name: string;
1857
+ type: string;
1858
+ knownFacts: string[];
1859
+ importanceLevel: ImportanceLevel;
1860
+ }
1861
+ interface EnrichmentResult {
1862
+ entityName: string;
1863
+ provider: string;
1864
+ candidatesFound: number;
1865
+ candidatesAccepted: number;
1866
+ candidatesRejected: number;
1867
+ acceptedCandidates: EnrichmentCandidate[];
1868
+ elapsed: number;
1869
+ }
1870
+ interface EnrichmentPipelineConfig {
1871
+ enabled: boolean;
1872
+ providers: EnrichmentProviderConfig[];
1873
+ importanceThresholds: {
1874
+ critical: string[];
1875
+ high: string[];
1876
+ normal: string[];
1877
+ low: string[];
1878
+ };
1879
+ maxCandidatesPerEntity: number;
1880
+ autoEnrichOnCreate: boolean;
1881
+ scheduleIntervalMs: number;
1882
+ }
1883
+ /**
1884
+ * Build a default (disabled) pipeline config. Every consumer that needs a
1885
+ * config object should call this rather than duplicating the defaults.
1886
+ */
1887
+ declare function defaultEnrichmentPipelineConfig(): EnrichmentPipelineConfig;
1888
+
1889
+ /**
1890
+ * Enrichment provider registry (issue #365).
1891
+ *
1892
+ * Central registry for enrichment providers. Providers register themselves
1893
+ * at startup; the pipeline queries the registry to determine which providers
1894
+ * to run for a given importance tier.
1895
+ */
1896
+
1897
+ declare class EnrichmentProviderRegistry {
1898
+ private readonly providers;
1899
+ /** Register a provider. Overwrites any existing provider with the same id. */
1900
+ register(provider: EnrichmentProvider): void;
1901
+ /** Look up a single provider by id. */
1902
+ get(id: string): EnrichmentProvider | undefined;
1903
+ /**
1904
+ * Return all registered providers whose id appears in the config's
1905
+ * `providers` list with `enabled: true`.
1906
+ */
1907
+ listEnabled(config: EnrichmentPipelineConfig): EnrichmentProvider[];
1908
+ /**
1909
+ * Return providers that should run for a given importance level.
1910
+ * Providers are resolved from `config.importanceThresholds[level]` and
1911
+ * filtered to only those that are both registered and enabled.
1912
+ */
1913
+ getForImportance(level: ImportanceLevel, config: EnrichmentPipelineConfig): EnrichmentProvider[];
1914
+ }
1915
+
1916
+ /**
1917
+ * Web search enrichment provider stub (issue #365).
1918
+ *
1919
+ * A basic provider backed by web search. Since this is opt-in and we do not
1920
+ * want to hard-code an API key, the provider accepts an optional `searchFn`
1921
+ * injection point. When no search function is configured it returns empty
1922
+ * results, making it safe to register unconditionally.
1923
+ */
1924
+
1925
+ type WebSearchFn = (query: string) => Promise<string[]>;
1926
+ interface WebSearchProviderOptions {
1927
+ /**
1928
+ * Injected search function. Each returned string is treated as a raw
1929
+ * snippet. When `undefined` the provider returns empty results.
1930
+ */
1931
+ searchFn?: WebSearchFn;
1932
+ }
1933
+ declare class WebSearchProvider implements EnrichmentProvider {
1934
+ readonly id = "web-search";
1935
+ readonly costTier: EnrichmentCostTier;
1936
+ private readonly searchFn;
1937
+ constructor(options?: WebSearchProviderOptions);
1938
+ isAvailable(): Promise<boolean>;
1939
+ enrich(entity: EntityEnrichmentInput): Promise<EnrichmentCandidate[]>;
1940
+ }
1941
+
1942
+ /**
1943
+ * Enrichment pipeline orchestrator (issue #365).
1944
+ *
1945
+ * For each entity, determines the importance tier, resolves the providers
1946
+ * to run, executes them in sequence (respecting rate limits), tags
1947
+ * candidates, and caps at `maxCandidatesPerEntity`.
1948
+ *
1949
+ * Accepted candidates are returned in each `EnrichmentResult` via the
1950
+ * `acceptedCandidates` field so that callers can persist them.
1951
+ */
1952
+
1953
+ declare function runEnrichmentPipeline(entities: EntityEnrichmentInput[], registry: EnrichmentProviderRegistry, config: EnrichmentPipelineConfig, log: LoggerBackend): Promise<EnrichmentResult[]>;
1954
+
1955
+ /**
1956
+ * Enrichment audit trail (issue #365).
1957
+ *
1958
+ * Append-only JSONL log for every enrichment candidate that was evaluated.
1959
+ * Each entry records whether the candidate was accepted or rejected, the
1960
+ * provider that produced it, and an optional reason string.
1961
+ */
1962
+ interface EnrichmentAuditEntry {
1963
+ timestamp: string;
1964
+ entityName: string;
1965
+ provider: string;
1966
+ candidateText: string;
1967
+ sourceUrl?: string;
1968
+ accepted: boolean;
1969
+ reason?: string;
1970
+ }
1971
+ /**
1972
+ * Append a single audit entry to the JSONL log. Creates the audit directory
1973
+ * and file if they do not exist.
1974
+ */
1975
+ declare function appendAuditEntry(auditDir: string, entry: EnrichmentAuditEntry): Promise<void>;
1976
+ /**
1977
+ * Read the audit log and return entries, optionally filtered to entries at
1978
+ * or after `since` (ISO 8601 timestamp, half-open interval).
1979
+ */
1980
+ declare function readAuditLog(auditDir: string, since?: string): Promise<EnrichmentAuditEntry[]>;
1981
+
1982
+ /**
1983
+ * Training-data export types.
1984
+ *
1985
+ * Defines the generic interface that format-specific adapters
1986
+ * (WeClone, Axolotl, MLX, etc.) implement to convert Remnic
1987
+ * memories into fine-tuning datasets.
1988
+ */
1989
+ interface TrainingExportOptions {
1990
+ memoryDir: string;
1991
+ since?: Date;
1992
+ until?: Date;
1993
+ minConfidence?: number;
1994
+ categories?: string[];
1995
+ includeEntities?: boolean;
1996
+ }
1997
+ interface TrainingExportRecord {
1998
+ instruction: string;
1999
+ input: string;
2000
+ output: string;
2001
+ category?: string;
2002
+ confidence?: number;
2003
+ sourceIds?: string[];
2004
+ }
2005
+ interface TrainingExportAdapter {
2006
+ name: string;
2007
+ formatRecords(records: TrainingExportRecord[]): string;
2008
+ fileExtension: string;
2009
+ }
2010
+
2011
+ /**
2012
+ * Training-export adapter registry.
2013
+ *
2014
+ * Maintains a name → adapter map so CLI and programmatic callers
2015
+ * can look up format-specific adapters at runtime.
2016
+ */
2017
+
2018
+ /**
2019
+ * Register a training-export adapter.
2020
+ *
2021
+ * Rejects empty names and duplicate registrations with an error
2022
+ * listing valid actions (CLAUDE.md rule #51).
2023
+ */
2024
+ declare function registerTrainingExportAdapter(adapter: TrainingExportAdapter): void;
2025
+ /**
2026
+ * Retrieve a registered adapter by name, or `undefined` if not found.
2027
+ */
2028
+ declare function getTrainingExportAdapter(name: string): TrainingExportAdapter | undefined;
2029
+ /**
2030
+ * List the names of all registered adapters.
2031
+ */
2032
+ declare function listTrainingExportAdapters(): string[];
2033
+ /**
2034
+ * Remove all registered adapters. Intended for test teardown only.
2035
+ */
2036
+ declare function clearTrainingExportAdapters(): void;
2037
+
2038
+ /**
2039
+ * Training-data converter.
2040
+ *
2041
+ * Reads memory markdown files from a memoryDir, parses YAML
2042
+ * frontmatter, applies filters, and returns TrainingExportRecord[].
2043
+ *
2044
+ * Instruction is derived from the memory's category/tags.
2045
+ * Output is the memory content body.
2046
+ * The `input` field is empty string (synthesis is left to adapters).
2047
+ */
2048
+
2049
+ /**
2050
+ * Read memories from `memoryDir`, apply option filters, and return
2051
+ * an array of TrainingExportRecord for downstream adapters.
2052
+ */
2053
+ declare function convertMemoriesToRecords(options: TrainingExportOptions): Promise<TrainingExportRecord[]>;
2054
+
2055
+ export { type AuditEntry, type BinaryAssetRecord, type BinaryAssetStatus, type BinaryLifecycleConfig, type BinaryLifecycleManifest, type BinaryStorageBackend, type BinaryStorageBackendConfig, BulkImportSourceAdapter, ClaudeCodeMemoryExtensionPublisher, CodexMemoryExtensionPublisher, type ConflictEntry, type ConnectorCapability, type ConnectorInstance, type ConnectorManifest, type ConnectorRegistry, type ContradictionOptions, type ContradictionPair, type ContradictionResult$1 as CurateContradictionResult, type DuplicateResult as CurateDuplicateResult, type CurateOptions, type CurateResult, type CuratedStatement, DEFAULT_GRACE_PERIOD_DAYS, DEFAULT_MAX_BINARY_SIZE_BYTES, DEFAULT_SCAN_PATTERNS, DEFAULT_TAXONOMY, type DedupOptions, type DedupResult, DiscoveredExtension, type DocFile, type DoctorCheck, type DoctorResult, type DuplicatePair, type EnrichmentAuditEntry, type EnrichmentCandidate, type EnrichmentCostTier, type EnrichmentPipelineConfig, type EnrichmentProvider, type EnrichmentProviderConfig, EnrichmentProviderRegistry, type EnrichmentResult, type EntityEnrichmentInput, type FileChange, FilesystemBackend, type GenerateOptions, type GenerateResult, HermesMemoryExtensionPublisher, type IngestionPlan, type InstallOptions, type InstallResult, LanceDbBackend, type LanguageInfo, MARKETPLACE_MANIFEST_FILENAME, MARKETPLACE_SCHEMA_VERSION, type MarketplaceConfig, type MarketplaceEntry, type MarketplaceInstallResult, type MarketplaceInstallType, type MarketplaceLogger, type MarketplaceManifest, type MarketplaceValidation, MaterializeResult, MeilisearchBackend, MemoryCategory, type MemoryEntry, type MemoryExtensionPublisher, MemoryFile, type MergeResult, type MigrationOptions, type MigrationResult, NoneBackend, type OnboardOptions, type OnboardResult, OramaBackend, PUBLISHERS, type PipelineResult, PluginConfig, type PostConsolidationMaterializeOptions, type ProjectShape, type ProvenanceEntry, type PublishContext, type PublishResult, type PublisherCapabilities, REMNIC_CITATION_FORMAT, REMNIC_MCP_TOOL_INVENTORY, REMNIC_RECALL_DECISION_RULES, REMNIC_SEMANTIC_OVERVIEW, type RemoveResult, type ResolverDecision, type ReviewAction, type ReviewItem, type ReviewListResult, type ReviewOptions, type ReviewResult, type RollbackResult, RolloutSummaryInput, type RunMaterializeOptions, type SemanticDedupDecision, type SemanticDedupHit, type SemanticDedupLookup, type SemanticDedupOptions, type Space, type SpaceKind, type SpaceManifest, type SpacePromoteResult, type SpacePullResult, type SpacePushResult, type SpaceShareResult, type SpaceSwitchResult, type StatementProvenance, StorageManager, type SyncOptions, type SyncResult, type SyncState, type Taxonomy, type TaxonomyCategory, type TrainingExportAdapter, type TrainingExportOptions, type TrainingExportRecord, type TreeNode, type WebSearchFn, WebSearchProvider, type WebSearchProviderOptions, appendAuditEntry, buildProcedureMarkdownBody, buildProcedureRecallSection, checkMarketplaceManifest, clearBulkImportSources, clearTrainingExportAdapters, coerceInstallExtension, convertMemoriesToRecords, createBackend, createSpace, curate, decideSemanticDedup, defaultEnrichmentPipelineConfig, deleteSpace, doctorConnector, emptyManifest, findContradictions, findDuplicates, generateContextTree, generateMarketplaceManifest, generateResolverDocument, getActiveSpace, getAuditLog, getBulkImportSource, getManifestPath, getSpacesDir, getTaxonomyDir, getTaxonomyFilePath, getTrainingExportAdapter, hostIdForConnector, installConnector, installFromMarketplace, listBulkImportSources, listConnectors, listReviewItems, listSpaces, listTrainingExportAdapters, loadManifest, loadRegistry, loadTaxonomy, manifestDir, manifestPath, matchesPatterns, mergeSpaces, migrateFromEngram, onboard, parseProcedureStepsFromBody, performReview, promoteSpace, publisherFor, publisherForConnector, pullFromSpace, pushToSpace, readAuditLog, readManifest, registerBulkImportSource, registerPublisher, registerTrainingExportAdapter, removeConnector, renderExtensionsBlock, renderExtensionsFooter, resolveCategory, resolvePrincipal, rollbackFromEngramMigration, runBinaryLifecyclePipeline, runCodexMaterialize, runEnrichmentPipeline, runPostConsolidationMaterialize, saveManifest, saveRegistry, saveTaxonomy, scanForBinaries, shareSpace, switchSpace, syncChanges, validateMarketplaceManifest, validateSlug, validateTaxonomy, watchForChanges, writeManifest, writeMarketplaceManifest };