@remnic/core 1.1.1 → 1.1.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 (497) hide show
  1. package/dist/abort-error.js +1 -0
  2. package/dist/abstraction-nodes.js +1 -0
  3. package/dist/access-audit.js +1 -0
  4. package/dist/access-cli.js +76 -51
  5. package/dist/access-cli.js.map +1 -1
  6. package/dist/access-http.d.ts +50 -5
  7. package/dist/access-http.js +38 -16
  8. package/dist/access-idempotency.js +1 -0
  9. package/dist/access-mcp.d.ts +10 -5
  10. package/dist/access-mcp.js +37 -14
  11. package/dist/access-schema.d.ts +133 -13
  12. package/dist/access-schema.js +20 -1
  13. package/dist/access-service-_AEUMVyX.d.ts +1981 -0
  14. package/dist/access-service.d.ts +11 -6
  15. package/dist/access-service.js +39 -14
  16. package/dist/active-memory-bridge.js +1 -0
  17. package/dist/active-recall.js +1 -0
  18. package/dist/active-recall.js.map +1 -1
  19. package/dist/behavior-learner.js +1 -0
  20. package/dist/behavior-learner.js.map +1 -1
  21. package/dist/behavior-signals.js +1 -0
  22. package/dist/bootstrap.d.ts +6 -4
  23. package/dist/bootstrap.js +1 -0
  24. package/dist/boxes.js +1 -0
  25. package/dist/briefing.d.ts +9 -5
  26. package/dist/briefing.js +10 -6
  27. package/dist/buffer-surprise-report.js +1 -0
  28. package/dist/buffer-surprise.js +1 -0
  29. package/dist/buffer.d.ts +1 -1
  30. package/dist/buffer.js +1 -0
  31. package/dist/calibration.d.ts +8 -1
  32. package/dist/calibration.js +10 -2
  33. package/dist/calibration.js.map +1 -1
  34. package/dist/capsule-cli.d.ts +137 -0
  35. package/dist/capsule-cli.js +34 -0
  36. package/dist/capsule-crypto-5CYAGVC5.js +18 -0
  37. package/dist/capsule-export-NZQPOTQ4.js +17 -0
  38. package/dist/capsule-export-NZQPOTQ4.js.map +1 -0
  39. package/dist/capsule-import-SDCUXLEV.js +16 -0
  40. package/dist/capsule-import-SDCUXLEV.js.map +1 -0
  41. package/dist/capsule-merge-DI7PNQ2H.js +189 -0
  42. package/dist/capsule-merge-DI7PNQ2H.js.map +1 -0
  43. package/dist/causal-behavior.js +1 -0
  44. package/dist/causal-behavior.js.map +1 -1
  45. package/dist/causal-chain.js +1 -0
  46. package/dist/causal-consolidation.js +12 -9
  47. package/dist/causal-consolidation.js.map +1 -1
  48. package/dist/causal-retrieval.js +2 -1
  49. package/dist/causal-retrieval.js.map +1 -1
  50. package/dist/causal-trajectory-graph.js +4 -1
  51. package/dist/causal-trajectory-graph.js.map +1 -1
  52. package/dist/causal-trajectory.js +2 -1
  53. package/dist/chunk-2LSZVONP.js +67 -0
  54. package/dist/chunk-2LSZVONP.js.map +1 -0
  55. package/dist/chunk-32KD5IHZ.js +245 -0
  56. package/dist/chunk-32KD5IHZ.js.map +1 -0
  57. package/dist/{chunk-VDX363PS.js → chunk-34F3PLWZ.js} +10 -3
  58. package/dist/chunk-34F3PLWZ.js.map +1 -0
  59. package/dist/chunk-3KIS4VGT.js +228 -0
  60. package/dist/chunk-3KIS4VGT.js.map +1 -0
  61. package/dist/chunk-3LCWFNVS.js +350 -0
  62. package/dist/chunk-3LCWFNVS.js.map +1 -0
  63. package/dist/chunk-43EKP2UK.js +26 -0
  64. package/dist/chunk-43EKP2UK.js.map +1 -0
  65. package/dist/chunk-457A4P3L.js +119 -0
  66. package/dist/chunk-457A4P3L.js.map +1 -0
  67. package/dist/{chunk-KUB6JU6H.js → chunk-47WOM4YW.js} +2 -2
  68. package/dist/{chunk-HK3FGIEW.js → chunk-4PLGJRBV.js} +656 -20
  69. package/dist/chunk-4PLGJRBV.js.map +1 -0
  70. package/dist/{chunk-BGJGXLZ7.js → chunk-55FXRRSJ.js} +11 -8
  71. package/dist/chunk-55FXRRSJ.js.map +1 -0
  72. package/dist/{chunk-ULYOGL6R.js → chunk-5HRY2WRF.js} +7 -3
  73. package/dist/chunk-5HRY2WRF.js.map +1 -0
  74. package/dist/chunk-6TBWYBJ3.js +236 -0
  75. package/dist/chunk-6TBWYBJ3.js.map +1 -0
  76. package/dist/chunk-74EMIVE4.js +329 -0
  77. package/dist/chunk-74EMIVE4.js.map +1 -0
  78. package/dist/chunk-74WWN7ZW.js +82 -0
  79. package/dist/chunk-74WWN7ZW.js.map +1 -0
  80. package/dist/{chunk-B5WXLVDY.js → chunk-7GCMLT7J.js} +245 -25
  81. package/dist/chunk-7GCMLT7J.js.map +1 -0
  82. package/dist/chunk-A6XUJE5D.js +126 -0
  83. package/dist/chunk-A6XUJE5D.js.map +1 -0
  84. package/dist/chunk-AJA46VX5.js +393 -0
  85. package/dist/chunk-AJA46VX5.js.map +1 -0
  86. package/dist/{chunk-DFTTJYSO.js → chunk-AKUCB2OG.js} +525 -24
  87. package/dist/chunk-AKUCB2OG.js.map +1 -0
  88. package/dist/chunk-ASIQZXYO.js +277 -0
  89. package/dist/chunk-ASIQZXYO.js.map +1 -0
  90. package/dist/{chunk-ZEM3OK2K.js → chunk-B2TL6GA2.js} +3 -3
  91. package/dist/chunk-BJMBJZ2Y.js +290 -0
  92. package/dist/chunk-BJMBJZ2Y.js.map +1 -0
  93. package/dist/chunk-BT7NVCML.js +79 -0
  94. package/dist/chunk-BT7NVCML.js.map +1 -0
  95. package/dist/chunk-CK5NTM2S.js +454 -0
  96. package/dist/chunk-CK5NTM2S.js.map +1 -0
  97. package/dist/{chunk-3GXCSUXR.js → chunk-CRU27Q4J.js} +2 -2
  98. package/dist/{chunk-F5VP6YCB.js → chunk-DCE6SQLA.js} +572 -155
  99. package/dist/chunk-DCE6SQLA.js.map +1 -0
  100. package/dist/{chunk-CUPFXL3J.js → chunk-DHRQHX36.js} +4 -4
  101. package/dist/chunk-DHRQHX36.js.map +1 -0
  102. package/dist/{chunk-GKFXUTJ2.js → chunk-DR7MCMPS.js} +981 -61
  103. package/dist/chunk-DR7MCMPS.js.map +1 -0
  104. package/dist/chunk-FP2373TW.js +149 -0
  105. package/dist/chunk-FP2373TW.js.map +1 -0
  106. package/dist/{chunk-RBBWYEFJ.js → chunk-G2WADRQ3.js} +1 -1
  107. package/dist/chunk-G7D6GZ5J.js +48 -0
  108. package/dist/chunk-G7D6GZ5J.js.map +1 -0
  109. package/dist/chunk-H7XKCNR6.js +60 -0
  110. package/dist/chunk-H7XKCNR6.js.map +1 -0
  111. package/dist/{chunk-VYM3VWOF.js → chunk-IM3JSE73.js} +966 -329
  112. package/dist/chunk-IM3JSE73.js.map +1 -0
  113. package/dist/chunk-IXEJRKCZ.js +18 -0
  114. package/dist/chunk-IXEJRKCZ.js.map +1 -0
  115. package/dist/chunk-IYY4MCPG.js +275 -0
  116. package/dist/chunk-IYY4MCPG.js.map +1 -0
  117. package/dist/{chunk-BK2EFTE2.js → chunk-JWSENLQI.js} +508 -28
  118. package/dist/chunk-JWSENLQI.js.map +1 -0
  119. package/dist/chunk-KNKUID7G.js +183 -0
  120. package/dist/chunk-KNKUID7G.js.map +1 -0
  121. package/dist/chunk-L2IO2QPY.js +2036 -0
  122. package/dist/chunk-L2IO2QPY.js.map +1 -0
  123. package/dist/{chunk-SPI27QT6.js → chunk-L5IIGA5V.js} +9 -4
  124. package/dist/chunk-L5IIGA5V.js.map +1 -0
  125. package/dist/{chunk-RGLL5SPU.js → chunk-LVYGDT5V.js} +56 -82
  126. package/dist/chunk-LVYGDT5V.js.map +1 -0
  127. package/dist/{chunk-ZAIM4TUE.js → chunk-LW2NMHDW.js} +46 -1
  128. package/dist/chunk-LW2NMHDW.js.map +1 -0
  129. package/dist/{chunk-3OGMS3PE.js → chunk-LZRYQK6L.js} +3 -2
  130. package/dist/chunk-LZRYQK6L.js.map +1 -0
  131. package/dist/chunk-MDYG7VI7.js +48 -0
  132. package/dist/chunk-MDYG7VI7.js.map +1 -0
  133. package/dist/chunk-MXC3AP5I.js +74 -0
  134. package/dist/chunk-MXC3AP5I.js.map +1 -0
  135. package/dist/{chunk-S3EEFKNY.js → chunk-N7X62G74.js} +26 -11
  136. package/dist/chunk-N7X62G74.js.map +1 -0
  137. package/dist/chunk-NN3TS5BM.js +147 -0
  138. package/dist/chunk-NN3TS5BM.js.map +1 -0
  139. package/dist/chunk-OA3L7BFR.js +183 -0
  140. package/dist/chunk-OA3L7BFR.js.map +1 -0
  141. package/dist/{chunk-LK6SGL53.js → chunk-OR64ZGRZ.js} +3 -2
  142. package/dist/chunk-OR64ZGRZ.js.map +1 -0
  143. package/dist/chunk-OZHRDTDX.js +240 -0
  144. package/dist/chunk-OZHRDTDX.js.map +1 -0
  145. package/dist/chunk-PCUKNJAZ.js +165 -0
  146. package/dist/chunk-PCUKNJAZ.js.map +1 -0
  147. package/dist/{chunk-6PFRXT4K.js → chunk-PFV5C235.js} +11 -6
  148. package/dist/chunk-PFV5C235.js.map +1 -0
  149. package/dist/chunk-PZ5AY32C.js +10 -0
  150. package/dist/chunk-PZ5AY32C.js.map +1 -0
  151. package/dist/{chunk-XZ2TIKGC.js → chunk-Q7FJ5ZHM.js} +30 -10
  152. package/dist/chunk-Q7FJ5ZHM.js.map +1 -0
  153. package/dist/{chunk-7I7FKFZH.js → chunk-R2L7SUX2.js} +6 -6
  154. package/dist/{chunk-JL2PU6AI.js → chunk-R2XRID2N.js} +2 -2
  155. package/dist/{chunk-WCLICCGB.js → chunk-RILIVK4O.js} +91 -4
  156. package/dist/chunk-RILIVK4O.js.map +1 -0
  157. package/dist/{chunk-C2EFFULQ.js → chunk-RK2Y4XOM.js} +163 -20
  158. package/dist/chunk-RK2Y4XOM.js.map +1 -0
  159. package/dist/{chunk-TP4FZJIZ.js → chunk-RULE4VG5.js} +5 -1
  160. package/dist/chunk-RULE4VG5.js.map +1 -0
  161. package/dist/{chunk-PVPWZSSI.js → chunk-SMA4IMHV.js} +19 -3
  162. package/dist/chunk-SMA4IMHV.js.map +1 -0
  163. package/dist/{chunk-WVVA7F5A.js → chunk-SS253RXF.js} +30 -16
  164. package/dist/chunk-SS253RXF.js.map +1 -0
  165. package/dist/chunk-TUFG6VXY.js +875 -0
  166. package/dist/chunk-TUFG6VXY.js.map +1 -0
  167. package/dist/chunk-TYEOAFH3.js +251 -0
  168. package/dist/chunk-TYEOAFH3.js.map +1 -0
  169. package/dist/chunk-UKJAGEXH.js +260 -0
  170. package/dist/chunk-UKJAGEXH.js.map +1 -0
  171. package/dist/{chunk-KVBLZUKV.js → chunk-USFPPRAF.js} +93 -3
  172. package/dist/chunk-USFPPRAF.js.map +1 -0
  173. package/dist/{chunk-EPQJM2GC.js → chunk-VTJVUHRK.js} +22 -36
  174. package/dist/chunk-VTJVUHRK.js.map +1 -0
  175. package/dist/{chunk-O5ETUNBT.js → chunk-VTU2B4VF.js} +7 -3
  176. package/dist/chunk-VTU2B4VF.js.map +1 -0
  177. package/dist/chunk-WIICJPET.js +45 -0
  178. package/dist/chunk-WIICJPET.js.map +1 -0
  179. package/dist/{chunk-VBVG2M5G.js → chunk-WPGJYVUH.js} +6 -2
  180. package/dist/chunk-WPGJYVUH.js.map +1 -0
  181. package/dist/{chunk-YNQKWQT4.js → chunk-WSZIHQBK.js} +31 -11
  182. package/dist/{chunk-YNQKWQT4.js.map → chunk-WSZIHQBK.js.map} +1 -1
  183. package/dist/{chunk-NZLQTHS5.js → chunk-WW3QQF4H.js} +4 -1
  184. package/dist/chunk-WW3QQF4H.js.map +1 -0
  185. package/dist/{chunk-FVA6TGI3.js → chunk-Y3WQ4ZWK.js} +42 -2
  186. package/dist/chunk-Y3WQ4ZWK.js.map +1 -0
  187. package/dist/chunk-YNJHCGDT.js +309 -0
  188. package/dist/chunk-YNJHCGDT.js.map +1 -0
  189. package/dist/{chunk-ALXMCZEU.js → chunk-Z2E7VW55.js} +6 -3
  190. package/dist/chunk-Z2E7VW55.js.map +1 -0
  191. package/dist/{chunk-INXV5JBT.js → chunk-ZGXSCMQN.js} +1992 -410
  192. package/dist/chunk-ZGXSCMQN.js.map +1 -0
  193. package/dist/{chunk-W6SL7OFG.js → chunk-ZTSE2ZJ6.js} +12 -2
  194. package/dist/{chunk-W6SL7OFG.js.map → chunk-ZTSE2ZJ6.js.map} +1 -1
  195. package/dist/chunking.js +1 -0
  196. package/dist/cipher-GVE2GQ5H.js +28 -0
  197. package/dist/cipher-GVE2GQ5H.js.map +1 -0
  198. package/dist/citations.js +1 -0
  199. package/dist/{cli-BkeRaYfk.d.ts → cli-x2APT9a6.d.ts} +26 -7
  200. package/dist/cli.d.ts +11 -6
  201. package/dist/cli.js +68 -34
  202. package/dist/codex-thread-key.js +1 -0
  203. package/dist/commitment-ledger.js +1 -0
  204. package/dist/compression-optimizer.js +1 -0
  205. package/dist/config.d.ts +2 -1
  206. package/dist/config.js +5 -2
  207. package/dist/connectors-cli-DFGtY2DB.d.ts +257 -0
  208. package/dist/connectors-cli.d.ts +2 -0
  209. package/dist/connectors-cli.js +22 -0
  210. package/dist/connectors-cli.js.map +1 -0
  211. package/dist/consolidation-operator.d.ts +65 -5
  212. package/dist/consolidation-operator.js +6 -1
  213. package/dist/consolidation-provenance-check.d.ts +1 -1
  214. package/dist/consolidation-provenance-check.js +3 -2
  215. package/dist/consolidation-undo.d.ts +1 -1
  216. package/dist/consolidation-undo.js +1 -0
  217. package/dist/consolidation-undo.js.map +1 -1
  218. package/dist/{contradiction-review-WIUBAR52.js → contradiction-review-5LTTVDQV.js} +2 -1
  219. package/dist/contradiction-review-5LTTVDQV.js.map +1 -0
  220. package/dist/{contradiction-scan-E3GJTI4F.js → contradiction-scan-3Z6YW7YA.js} +2 -1
  221. package/dist/{contradiction-scan-E3GJTI4F.js.map → contradiction-scan-3Z6YW7YA.js.map} +1 -1
  222. package/dist/cross-namespace-budget.js +1 -0
  223. package/dist/cue-anchors.js +1 -0
  224. package/dist/dashboard-runtime.js +1 -0
  225. package/dist/day-summary.js +1 -0
  226. package/dist/delinearize.js +1 -0
  227. package/dist/direct-answer-wiring.js +1 -0
  228. package/dist/direct-answer.js +1 -0
  229. package/dist/dreams-ledger-LR2NBAZE.js +286 -0
  230. package/dist/dreams-ledger-LR2NBAZE.js.map +1 -0
  231. package/dist/embedding-fallback.js +3 -1
  232. package/dist/{engine-F3GOXGE5.js → engine-ICC2DSQF.js} +10 -7
  233. package/dist/engine-ICC2DSQF.js.map +1 -0
  234. package/dist/entity-retrieval.d.ts +1 -1
  235. package/dist/entity-retrieval.js +9 -6
  236. package/dist/entity-schema.js +1 -0
  237. package/dist/evals.js +1 -0
  238. package/dist/evidence-pack.d.ts +16 -0
  239. package/dist/evidence-pack.js +8 -0
  240. package/dist/evidence-pack.js.map +1 -0
  241. package/dist/explicit-capture.d.ts +6 -4
  242. package/dist/explicit-capture.js +1 -0
  243. package/dist/extraction-judge-telemetry.js +1 -0
  244. package/dist/extraction-judge-training.js +1 -0
  245. package/dist/extraction-judge.js +1 -0
  246. package/dist/extraction.js +9 -8
  247. package/dist/fallback-llm.js +3 -2
  248. package/dist/first-start-migration-4MHQEOSD.js +263 -0
  249. package/dist/first-start-migration-4MHQEOSD.js.map +1 -0
  250. package/dist/forget-PLR6J5DN.js +69 -0
  251. package/dist/forget-PLR6J5DN.js.map +1 -0
  252. package/dist/framework-CyHYDcri.d.ts +153 -0
  253. package/dist/fs-utils-IRVUFB6G.js +30 -0
  254. package/dist/fs-utils-IRVUFB6G.js.map +1 -0
  255. package/dist/graph-dashboard-diff.js +1 -0
  256. package/dist/graph-dashboard-key.js +1 -0
  257. package/dist/graph-dashboard-parser.js +1 -0
  258. package/dist/graph-edge-decay-PWB63GRE.js +207 -0
  259. package/dist/graph-edge-decay-PWB63GRE.js.map +1 -0
  260. package/dist/graph-edge-reinforcement.d.ts +81 -0
  261. package/dist/graph-edge-reinforcement.js +24 -0
  262. package/dist/graph-edge-reinforcement.js.map +1 -0
  263. package/dist/graph-events.d.ts +87 -0
  264. package/dist/graph-events.js +14 -0
  265. package/dist/graph-events.js.map +1 -0
  266. package/dist/graph-recall.js +1 -0
  267. package/dist/graph-retrieval.js +1 -0
  268. package/dist/graph-snapshot.d.ts +112 -0
  269. package/dist/graph-snapshot.js +19 -0
  270. package/dist/graph-snapshot.js.map +1 -0
  271. package/dist/graph.d.ts +105 -7
  272. package/dist/graph.js +20 -3
  273. package/dist/harmonic-retrieval.js +1 -0
  274. package/dist/himem.js +1 -0
  275. package/dist/hygiene.js +1 -0
  276. package/dist/identity-continuity.js +1 -0
  277. package/dist/importance.js +1 -0
  278. package/dist/index.d.ts +562 -13
  279. package/dist/index.js +365 -96
  280. package/dist/index.js.map +1 -1
  281. package/dist/intent.js +1 -0
  282. package/dist/json-extract.js +1 -0
  283. package/dist/json-store.js +1 -0
  284. package/dist/kdf-7S6RWKLZ.js +26 -0
  285. package/dist/kdf-7S6RWKLZ.js.map +1 -0
  286. package/dist/legacy-hook-compat.js +1 -0
  287. package/dist/legacy-hook-compat.js.map +1 -1
  288. package/dist/lifecycle.js +1 -0
  289. package/dist/live-connectors-runner.d.ts +48 -0
  290. package/dist/live-connectors-runner.js +17 -0
  291. package/dist/live-connectors-runner.js.map +1 -0
  292. package/dist/local-llm.js +3 -2
  293. package/dist/logger.js +1 -0
  294. package/dist/memory-action-policy.js +1 -0
  295. package/dist/memory-cache.d.ts +2 -1
  296. package/dist/memory-cache.js +4 -1
  297. package/dist/memory-governance-KG52RITE.js +37 -0
  298. package/dist/memory-governance-KG52RITE.js.map +1 -0
  299. package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
  300. package/dist/memory-lifecycle-ledger-utils.js +4 -1
  301. package/dist/memory-projection-format.js +1 -0
  302. package/dist/{memory-projection-store-DeSXPh1j.d.ts → memory-projection-store-D3vBHS4J.d.ts} +1 -0
  303. package/dist/memory-projection-store.d.ts +1 -1
  304. package/dist/memory-projection-store.js +1 -0
  305. package/dist/memory-worth-bench.js +1 -0
  306. package/dist/memory-worth-bench.js.map +1 -1
  307. package/dist/memory-worth-filter.js +1 -0
  308. package/dist/memory-worth-outcomes.d.ts +1 -1
  309. package/dist/memory-worth-outcomes.js +1 -0
  310. package/dist/memory-worth.js +1 -0
  311. package/dist/metadata-FC3XPDRQ.js +21 -0
  312. package/dist/metadata-FC3XPDRQ.js.map +1 -0
  313. package/dist/migrate-from-identity-anchor-TTEDEJGX.js +8 -0
  314. package/dist/migrate-from-identity-anchor-TTEDEJGX.js.map +1 -0
  315. package/dist/model-registry.js +1 -0
  316. package/dist/models-json.js +1 -0
  317. package/dist/native-knowledge.js +1 -0
  318. package/dist/negative.js +1 -0
  319. package/dist/objective-state-writers.js +1 -0
  320. package/dist/objective-state-writers.js.map +1 -1
  321. package/dist/objective-state.js +1 -0
  322. package/dist/openai-chat-compat.js +1 -0
  323. package/dist/operator-toolkit.d.ts +46 -2
  324. package/dist/operator-toolkit.js +29 -17
  325. package/dist/opik-exporter.js +1 -0
  326. package/dist/opik-exporter.js.map +1 -1
  327. package/dist/{orchestrator-CmJ-NTdJ.d.ts → orchestrator-ChkesB8U.d.ts} +177 -13
  328. package/dist/orchestrator.d.ts +6 -4
  329. package/dist/orchestrator.js +58 -42
  330. package/dist/page-versioning.js +1 -0
  331. package/dist/path-RMTY5Y5A.js +9 -0
  332. package/dist/path-RMTY5Y5A.js.map +1 -0
  333. package/dist/patterns-cli.d.ts +160 -0
  334. package/dist/patterns-cli.js +29 -0
  335. package/dist/patterns-cli.js.map +1 -0
  336. package/dist/peers-6OSQ3NK6.js +44 -0
  337. package/dist/peers-6OSQ3NK6.js.map +1 -0
  338. package/dist/plugin-id.js +1 -0
  339. package/dist/policy-runtime.js +1 -0
  340. package/dist/{port-BADbLZU5.d.ts → port-hqGnoStS.d.ts} +6 -0
  341. package/dist/profiling.js +1 -0
  342. package/dist/purge-6ATBGT77.js +205 -0
  343. package/dist/purge-6ATBGT77.js.map +1 -0
  344. package/dist/qmd-recall-cache.d.ts +1 -1
  345. package/dist/qmd-recall-cache.js +1 -0
  346. package/dist/qmd.d.ts +2 -1
  347. package/dist/qmd.js +4 -3
  348. package/dist/reasoning-trace-recall.js +1 -0
  349. package/dist/reasoning-trace-types.js +1 -0
  350. package/dist/recall-audit-anomaly.js +1 -0
  351. package/dist/recall-audit.js +1 -0
  352. package/dist/recall-disclosure-escalation.d.ts +84 -0
  353. package/dist/recall-disclosure-escalation.js +14 -0
  354. package/dist/recall-disclosure-escalation.js.map +1 -0
  355. package/dist/recall-explain-renderer.js +4 -1
  356. package/dist/recall-mmr.js +1 -0
  357. package/dist/recall-qos.js +1 -0
  358. package/dist/recall-query-policy.js +1 -0
  359. package/dist/recall-state.d.ts +7 -0
  360. package/dist/recall-state.js +2 -1
  361. package/dist/recall-tag-filter.d.ts +56 -0
  362. package/dist/recall-tag-filter.js +14 -0
  363. package/dist/recall-tag-filter.js.map +1 -0
  364. package/dist/recall-tokenization.js +1 -0
  365. package/dist/recall-xray-cli.d.ts +9 -2
  366. package/dist/recall-xray-cli.js +9 -4
  367. package/dist/recall-xray-renderer.js +4 -1
  368. package/dist/recall-xray.d.ts +116 -2
  369. package/dist/recall-xray.js +9 -3
  370. package/dist/reconstruct.js +1 -0
  371. package/dist/release-changelog.js +2 -0
  372. package/dist/release-changelog.js.map +1 -1
  373. package/dist/relevance.js +1 -0
  374. package/dist/rerank.js +1 -0
  375. package/dist/{resolution-QBTDHTG7.js → resolution-YGIBORXI.js} +2 -1
  376. package/dist/{resolution-QBTDHTG7.js.map → resolution-YGIBORXI.js.map} +1 -1
  377. package/dist/resolve-auth-token.d.ts +51 -0
  378. package/dist/resolve-auth-token.js +12 -0
  379. package/dist/resolve-auth-token.js.map +1 -0
  380. package/dist/resolve-provider-secret.d.ts +13 -1
  381. package/dist/resolve-provider-secret.js +6 -1
  382. package/dist/resume-bundles.js +5 -4
  383. package/dist/retrieval-agents.d.ts +1 -1
  384. package/dist/retrieval-agents.js +1 -0
  385. package/dist/retrieval-tiers.js +1 -0
  386. package/dist/retrieval.js +1 -0
  387. package/dist/sanitize.js +1 -0
  388. package/dist/schemas.d.ts +15 -2
  389. package/dist/schemas.js +2 -1
  390. package/dist/sdk-compat.js +1 -0
  391. package/dist/sdk-compat.js.map +1 -1
  392. package/dist/secure-store-4R2GSO7S.js +156 -0
  393. package/dist/secure-store-4R2GSO7S.js.map +1 -0
  394. package/dist/semantic-chunking.js +1 -0
  395. package/dist/{semantic-consolidation-CxJU6MJk.d.ts → semantic-consolidation-ByBXb-sf.d.ts} +3 -3
  396. package/dist/semantic-consolidation.d.ts +2 -2
  397. package/dist/semantic-consolidation.js +12 -6
  398. package/dist/semantic-rule-promotion.d.ts +1 -1
  399. package/dist/semantic-rule-promotion.js +9 -6
  400. package/dist/semantic-rule-verifier.d.ts +1 -1
  401. package/dist/semantic-rule-verifier.js +9 -6
  402. package/dist/session-integrity.js +1 -0
  403. package/dist/session-observer-bands.js +1 -0
  404. package/dist/session-observer-state.js +1 -0
  405. package/dist/session-toggles.js +2 -0
  406. package/dist/session-toggles.js.map +1 -1
  407. package/dist/signal.js +1 -0
  408. package/dist/skills-registry.js +2 -0
  409. package/dist/skills-registry.js.map +1 -1
  410. package/dist/source-attribution.js +1 -0
  411. package/dist/state-NCHQ4TRG.js +8 -0
  412. package/dist/state-NCHQ4TRG.js.map +1 -0
  413. package/dist/state-store-3EH7HYIN.js +16 -0
  414. package/dist/state-store-3EH7HYIN.js.map +1 -0
  415. package/dist/storage.d.ts +76 -2
  416. package/dist/storage.js +8 -5
  417. package/dist/store-contract.js +1 -0
  418. package/dist/summarizer.js +6 -5
  419. package/dist/summary-snapshot.js +1 -0
  420. package/dist/temporal-index.js +1 -0
  421. package/dist/temporal-supersession.d.ts +1 -1
  422. package/dist/temporal-supersession.js +2 -1
  423. package/dist/temporal-validity.d.ts +52 -0
  424. package/dist/temporal-validity.js +14 -0
  425. package/dist/temporal-validity.js.map +1 -0
  426. package/dist/threading.js +1 -0
  427. package/dist/tier-migration.d.ts +2 -2
  428. package/dist/tier-migration.js +1 -0
  429. package/dist/tier-routing.js +1 -0
  430. package/dist/tier-stats-62ZVDFKS.js +152 -0
  431. package/dist/tier-stats-62ZVDFKS.js.map +1 -0
  432. package/dist/tmt.js +1 -0
  433. package/dist/tokens.js +3 -1
  434. package/dist/topics.js +1 -0
  435. package/dist/trace-C5ETWBEF.js +290 -0
  436. package/dist/trace-C5ETWBEF.js.map +1 -0
  437. package/dist/transcript.js +1 -0
  438. package/dist/trust-zones.js +1 -0
  439. package/dist/tui-RI7P6PBS.js +13 -0
  440. package/dist/tui-RI7P6PBS.js.map +1 -0
  441. package/dist/types-V3FJ26TF.js +30 -0
  442. package/dist/types-V3FJ26TF.js.map +1 -0
  443. package/dist/types.d.ts +634 -9
  444. package/dist/types.js +10 -3
  445. package/dist/utility-learner.js +1 -0
  446. package/dist/utility-runtime.js +1 -0
  447. package/dist/utility-telemetry.js +1 -0
  448. package/dist/verified-recall.js +9 -6
  449. package/dist/version-utils.js +1 -0
  450. package/dist/whitespace.js +1 -0
  451. package/dist/work-product-ledger.js +1 -0
  452. package/package.json +2 -1
  453. package/dist/access-service-Br8ZydTK.d.ts +0 -827
  454. package/dist/chunk-3OGMS3PE.js.map +0 -1
  455. package/dist/chunk-6PFRXT4K.js.map +0 -1
  456. package/dist/chunk-ALXMCZEU.js.map +0 -1
  457. package/dist/chunk-B5WXLVDY.js.map +0 -1
  458. package/dist/chunk-BGJGXLZ7.js.map +0 -1
  459. package/dist/chunk-BK2EFTE2.js.map +0 -1
  460. package/dist/chunk-C2EFFULQ.js.map +0 -1
  461. package/dist/chunk-CUPFXL3J.js.map +0 -1
  462. package/dist/chunk-DFTTJYSO.js.map +0 -1
  463. package/dist/chunk-EPQJM2GC.js.map +0 -1
  464. package/dist/chunk-F5VP6YCB.js.map +0 -1
  465. package/dist/chunk-FVA6TGI3.js.map +0 -1
  466. package/dist/chunk-GKFXUTJ2.js.map +0 -1
  467. package/dist/chunk-HK3FGIEW.js.map +0 -1
  468. package/dist/chunk-INXV5JBT.js.map +0 -1
  469. package/dist/chunk-KVBLZUKV.js.map +0 -1
  470. package/dist/chunk-LK6SGL53.js.map +0 -1
  471. package/dist/chunk-LTCGGW2D.js +0 -14
  472. package/dist/chunk-LTCGGW2D.js.map +0 -1
  473. package/dist/chunk-NZLQTHS5.js.map +0 -1
  474. package/dist/chunk-O5ETUNBT.js.map +0 -1
  475. package/dist/chunk-PVPWZSSI.js.map +0 -1
  476. package/dist/chunk-RGLL5SPU.js.map +0 -1
  477. package/dist/chunk-S3EEFKNY.js.map +0 -1
  478. package/dist/chunk-SPI27QT6.js.map +0 -1
  479. package/dist/chunk-TP4FZJIZ.js.map +0 -1
  480. package/dist/chunk-ULYOGL6R.js.map +0 -1
  481. package/dist/chunk-VBVG2M5G.js.map +0 -1
  482. package/dist/chunk-VDX363PS.js.map +0 -1
  483. package/dist/chunk-VYM3VWOF.js.map +0 -1
  484. package/dist/chunk-WCLICCGB.js.map +0 -1
  485. package/dist/chunk-WVVA7F5A.js.map +0 -1
  486. package/dist/chunk-X6GF3FX2.js +0 -26
  487. package/dist/chunk-X6GF3FX2.js.map +0 -1
  488. package/dist/chunk-XZ2TIKGC.js.map +0 -1
  489. package/dist/chunk-ZAIM4TUE.js.map +0 -1
  490. /package/dist/{contradiction-review-WIUBAR52.js.map → capsule-cli.js.map} +0 -0
  491. /package/dist/{engine-F3GOXGE5.js.map → capsule-crypto-5CYAGVC5.js.map} +0 -0
  492. /package/dist/{chunk-KUB6JU6H.js.map → chunk-47WOM4YW.js.map} +0 -0
  493. /package/dist/{chunk-ZEM3OK2K.js.map → chunk-B2TL6GA2.js.map} +0 -0
  494. /package/dist/{chunk-3GXCSUXR.js.map → chunk-CRU27Q4J.js.map} +0 -0
  495. /package/dist/{chunk-RBBWYEFJ.js.map → chunk-G2WADRQ3.js.map} +0 -0
  496. /package/dist/{chunk-7I7FKFZH.js.map → chunk-R2L7SUX2.js.map} +0 -0
  497. /package/dist/{chunk-JL2PU6AI.js.map → chunk-R2XRID2N.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,26 +1,30 @@
1
1
  export { LEGACY_PLUGIN_ID, PLUGIN_ID, resolveRemnicPluginEntry } from './plugin-id.js';
2
2
  export { parseConfig } from './config.js';
3
- import { f as BulkImportSourceAdapter, b as ImportTurn } from './orchestrator-CmJ-NTdJ.js';
4
- export { g as BulkImportError, c as BulkImportOptions, d as BulkImportResult, B as BulkImportSource, h as ImportSourceRole, i as ImportTurnValidationIssue, O as Orchestrator, j as SemanticDedupDecision, k as SemanticDedupHit, S as SemanticDedupLookup, l as SemanticDedupOptions, m as decideSemanticDedup, n as defaultWorkspaceDir, o as isImportRole, p as parseIsoTimestamp, s as sanitizeSessionKeyForFilename, v as validateImportTurn } from './orchestrator-CmJ-NTdJ.js';
3
+ import { f as BulkImportSourceAdapter, b as ImportTurn } from './orchestrator-ChkesB8U.js';
4
+ export { g as BulkImportError, c as BulkImportOptions, d as BulkImportResult, B as BulkImportSource, h as ImportSourceRole, i as ImportTurnValidationIssue, O as Orchestrator, j as SemanticDedupDecision, k as SemanticDedupHit, S as SemanticDedupLookup, l as SemanticDedupOptions, m as decideSemanticDedup, n as defaultWorkspaceDir, o as isImportRole, p as parseIsoTimestamp, s as sanitizeSessionKeyForFilename, v as validateImportTurn } from './orchestrator-ChkesB8U.js';
5
+ export { EvidencePackItem, EvidencePackOptions, buildEvidencePack } from './evidence-pack.js';
5
6
  import { StorageManager } from './storage.js';
6
7
  export { ExtractionEngine } from './extraction.js';
7
8
  export { BufferSurpriseProbe, SmartBuffer, TriggerDecision } from './buffer.js';
8
9
  export { ComputeSurpriseOptions, DEFAULT_SURPRISE_K, RecentMemoryLike, computeSurprise } from './buffer-surprise.js';
9
10
  export { BufferSurpriseDistribution, BufferSurpriseReader, BufferSurpriseReportOptions, reportBufferSurpriseDistribution } from './buffer-surprise-report.js';
10
11
  import { PluginConfig, CodingContext, CodingModeConfig, MemoryFile, MemoryCategory, ImportanceLevel } from './types.js';
11
- export { BriefingActiveThread, BriefingConfig, BriefingFocus, BriefingFollowup, BriefingOpenCommitment, BriefingRecentEntity, BriefingResult, BriefingSections, BriefingWindow, BufferSurpriseEvent, CalendarEvent, CalendarSource, CodexCompatConfig, ContinuityImprovementLoop, GatewayConfig, MemoryActionEligibilityContext, MemoryActionEligibilitySource, MemoryActionType } from './types.js';
12
+ export { AgentAccessAuthToken, BriefingActiveThread, BriefingConfig, BriefingFocus, BriefingFollowup, BriefingOpenCommitment, BriefingRecentEntity, BriefingResult, BriefingSections, BriefingWindow, BufferSurpriseEvent, CalendarEvent, CalendarSource, CodexCompatConfig, ContinuityImprovementLoop, DEFAULT_RECALL_DISCLOSURE, ExtractedFact, GatewayConfig, MemoryActionEligibilityContext, MemoryActionEligibilitySource, MemoryActionType, MemoryObservation, MemoryScope, RECALL_DISCLOSURE_LEVELS, RecallDisclosure, SecretRef, isRecallDisclosure } from './types.js';
12
13
  export { JudgeBatchResult, JudgeCandidate, JudgeVerdict, JudgeVerdictKind, clearVerdictCache, createVerdictCache, getVerdictKind, isDurableVerdict, isValidCachedVerdict, judgeFactDurability, normalizeCachedVerdict, verdictCacheSize } from './extraction-judge.js';
13
14
  export { hasBroadGraphIntent, inferIntentFromText, intentCompatibilityScore, isTaskInitiationIntent, planRecallMode } from './intent.js';
14
- export { a as EngramAccessInputError, E as EngramAccessService, P as ProcedureStatsConfigSnapshot, b as ProcedureStatsRecent, c as ProcedureStatsReport, d as ProcedureStatusCounts, e as computeProcedureStats, f as formatProcedureStatsText } from './access-service-Br8ZydTK.js';
15
+ import { P as PeerInteractionLogEntry, a as Peer, b as PeerProfile, c as ExportManifestV2, I as ImportCapsuleResult, C as CapsuleParent } from './access-service-_AEUMVyX.js';
16
+ export { d as EngramAccessInputError, E as EngramAccessService, e as PEER_ID_MAX_LENGTH, f as PEER_ID_PATTERN, g as PeerKind, h as PeerProfileFieldProvenance, i as ProcedureStatsConfigSnapshot, j as ProcedureStatsRecent, k as ProcedureStatsReport, l as ProcedureStatusCounts, m as computeProcedureStats, n as formatProcedureStatsText } from './access-service-_AEUMVyX.js';
15
17
  export { FILTER_LABELS as DIRECT_ANSWER_FILTER_LABELS, DirectAnswerCandidate, DirectAnswerConfig, DirectAnswerInput, DirectAnswerReason, DirectAnswerResult, isDirectAnswerEligible } from './direct-answer.js';
18
+ export { MemoryTier, TierRoutingPolicy, TierTransitionDecision, computeTierValueScore, decideTierTransition } from './tier-routing.js';
16
19
  export { ApplyReasoningTraceBoostOptions, BoostableResult, DEFAULT_REASONING_TRACE_BOOST, applyReasoningTraceBoost, isReasoningTracePath, looksLikeProblemSolvingQuery } from './reasoning-trace-recall.js';
17
20
  export { CITATION_UNKNOWN, CitationContext, DEFAULT_CITATION_FORMAT, ParsedCitation, attachCitation, deriveSessionId, formatCitation, hasCitation, parseAllCitations, parseCitation, stripCitation } from './source-attribution.js';
18
21
  export { QmdClient } from './qmd.js';
19
- import { S as SearchBackend, a as SearchQueryOptions, b as SearchExecutionOptions, c as SearchResult } from './port-BADbLZU5.js';
22
+ import { S as SearchBackend, a as SearchQueryOptions, b as SearchExecutionOptions, c as SearchResult } from './port-hqGnoStS.js';
20
23
  export { buildEntityRecallSection } from './entity-retrieval.js';
21
24
  export { TrustZoneName, TrustZoneRecord, TrustZoneRecordKind, TrustZoneSourceClass, isTrustZoneName } from './trust-zones.js';
22
25
  export { EngramAccessHttpServer } from './access-http.js';
23
26
  export { EngramMcpServer } from './access-mcp.js';
27
+ export { ResolveSecretRefFn, clearAuthTokenSecretCache, isAgentAccessSecretRef, resolveAgentAccessAuthToken } from './resolve-auth-token.js';
24
28
  export { ParsedXrayCliOptions, parseXrayBudgetFlag, parseXrayCliOptions } from './recall-xray-cli.js';
25
29
  export { RECALL_XRAY_FORMATS, RecallXrayFormat, parseXrayFormat, renderXray, renderXrayJson, renderXrayMarkdown, renderXrayText } from './recall-xray-renderer.js';
26
30
  export { RecallFilterTrace, RecallXrayResult, RecallXrayScoreDecomposition, RecallXrayServedBy, RecallXraySnapshot } from './recall-xray.js';
@@ -34,14 +38,18 @@ export { PageVersion, VersionHistory, VersionTrigger, VersioningConfig, Versioni
34
38
  export { CitationBlock, CitationEntry, CitationMetadata, buildCitationGuidance, formatOaiMemCitation, parseOaiMemCitation, sanitizeNoteForCitation } from './citations.js';
35
39
  import { LoggerBackend } from './logger.js';
36
40
  export { initLogger, log } from './logger.js';
37
- import { D as DiscoveredExtension } from './semantic-consolidation-CxJU6MJk.js';
38
- export { E as ExtensionSchema, R as REMNIC_EXTENSIONS_TOTAL_TOKEN_LIMIT, b as buildExtensionsBlockForConsolidation, d as discoverMemoryExtensions, r as resolveExtensionsRoot } from './semantic-consolidation-CxJU6MJk.js';
41
+ import { D as DiscoveredExtension } from './semantic-consolidation-ByBXb-sf.js';
42
+ export { E as ExtensionSchema, R as REMNIC_EXTENSIONS_TOTAL_TOKEN_LIMIT, b as buildExtensionsBlockForConsolidation, d as discoverMemoryExtensions, r as resolveExtensionsRoot } from './semantic-consolidation-ByBXb-sf.js';
43
+ import { L as LiveConnector, S as SyncIncrementalResult } from './framework-CyHYDcri.js';
44
+ export { c as CONNECTOR_ID_PATTERN, C as ConnectorConfig, b as ConnectorCursor, a as ConnectorDocument, d as ConnectorDocumentSource, e as SyncIncrementalArgs, i as isValidConnectorId } from './framework-CyHYDcri.js';
45
+ export { C as CONNECTORS_OUTPUT_FORMATS, a as ConnectorRow, b as ConnectorRunResult, c as ConnectorState, d as ConnectorSyncStatus, e as ConnectorsOutputFormat, P as ParsedConnectorsListOptions, f as ParsedConnectorsStatusOptions, R as RunConnectorPollOnceArgs, l as listConnectorStates, p as parseConnectorsFormat, g as parseConnectorsListOptions, h as parseConnectorsRunName, i as parseConnectorsStatusOptions, r as readConnectorState, j as renderConnectorsList, k as renderConnectorsRunResult, m as runConnectorPollOnce, w as writeConnectorState } from './connectors-cli-DFGtY2DB.js';
46
+ export { LiveConnectorDefinition, LiveConnectorRunItem, LiveConnectorSkipReason, LiveConnectorsRunSummary, builtInLiveConnectorDefinitions, hasEnabledLiveConnector, runLiveConnectorsOnce } from './live-connectors-runner.js';
39
47
  export { TokenEntry, TokenStore, generateToken, getAllValidTokens, getAllValidTokensCached, listTokens, loadTokenStore, resolveConnectorFromToken, revokeToken, saveTokenStore } from './tokens.js';
40
48
  import { R as RolloutSummaryInput, M as MaterializeResult } from './codex-materialize-CQlLTzke.js';
41
49
  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';
42
50
  import { T as Taxonomy, R as ResolverDecision } from './types-DJhqDJUV.js';
43
51
  export { a as TaxonomyCategory } from './types-DJhqDJUV.js';
44
- export { B as BulkImportCliCommandOptions, P as ProcessBatchFn, a as ProcessBatchResult, f as formatBatchTranscript, p as parseStrictCliDate, r as runBulkImportCliCommand, b as runBulkImportPipeline } from './cli-BkeRaYfk.js';
52
+ export { B as BulkImportCliCommandOptions, P as ProcessBatchFn, a as ProcessBatchResult, f as formatBatchTranscript, p as parseStrictCliDate, r as runBulkImportCliCommand, b as runBulkImportPipeline } from './cli-x2APT9a6.js';
45
53
  export { FallbackLlmClient, FallbackLlmOptions, FallbackLlmResponse, FallbackLlmRuntimeContext } from './fallback-llm.js';
46
54
  export { ComputeMemoryWorthInput, MemoryWorthResult, computeMemoryWorth } from './memory-worth.js';
47
55
  export { MemoryOutcomeKind, RecordMemoryOutcomeInput, RecordMemoryOutcomeResult, memoryWorthOutcomeEligibleCategories, recordMemoryOutcome } from './memory-worth-outcomes.js';
@@ -65,17 +73,20 @@ import 'zod';
65
73
  import './policy-runtime.js';
66
74
  import './profiling.js';
67
75
  import './consolidation-operator.js';
68
- import './memory-projection-store-DeSXPh1j.js';
76
+ import './memory-projection-store-D3vBHS4J.js';
69
77
  import 'better-sqlite3';
70
78
  import './schemas.js';
71
79
  import './recall-explain-renderer.js';
72
80
  import './explicit-capture.js';
81
+ import './graph-snapshot.js';
82
+ import './graph.js';
83
+ import './capsule-cli.js';
84
+ import './lifecycle.js';
73
85
  import 'node:http';
74
86
  import './recall-audit.js';
75
87
  import 'node:stream';
76
88
  import './dashboard-runtime.js';
77
89
  import './evals.js';
78
- import './graph.js';
79
90
  import './causal-trajectory.js';
80
91
  import './objective-state.js';
81
92
  import './abstraction-nodes.js';
@@ -91,6 +102,343 @@ import './utility-learner.js';
91
102
  import './resume-bundles.js';
92
103
  import './semantic-rule-promotion.js';
93
104
 
105
+ /**
106
+ * @remnic/core — Live Connectors Registry (issue #683 PR 1/N)
107
+ *
108
+ * Pure in-memory registry. No I/O. Concrete connectors register themselves at
109
+ * orchestrator boot (later PRs); the maintenance scheduler asks the registry
110
+ * for the active set when running due syncs.
111
+ */
112
+
113
+ /**
114
+ * Thrown when registering a duplicate id or an id that fails validation.
115
+ *
116
+ * Distinct error class so callers can distinguish framework-level mistakes
117
+ * (which are programmer errors) from connector-runtime failures.
118
+ */
119
+ declare class LiveConnectorRegistryError extends Error {
120
+ constructor(message: string);
121
+ }
122
+ /**
123
+ * In-memory registry of live connectors. One instance per orchestrator. Not
124
+ * safe for cross-process sharing — wire each process to its own registry.
125
+ */
126
+ declare class LiveConnectorRegistry {
127
+ private readonly connectors;
128
+ /**
129
+ * Register a connector. Throws `LiveConnectorRegistryError` if the id is
130
+ * malformed or already registered.
131
+ *
132
+ * Re-registration is rejected (rather than silently overwriting) because
133
+ * silent overwrites mask plugin loading bugs in development and could let
134
+ * a malicious extension shadow a built-in connector.
135
+ */
136
+ register(connector: LiveConnector): void;
137
+ /**
138
+ * Look up a connector by id. Returns `undefined` if not registered.
139
+ */
140
+ get(id: string): LiveConnector | undefined;
141
+ /**
142
+ * Return all registered connectors, sorted by id for stable enumeration.
143
+ */
144
+ list(): LiveConnector[];
145
+ /**
146
+ * Remove a connector. Returns `true` if a connector was removed, `false`
147
+ * otherwise. The cursor / state file on disk is **not** touched — callers
148
+ * who want to fully decommission a connector must also delete its state
149
+ * file via the `state-store` module.
150
+ */
151
+ unregister(id: string): boolean;
152
+ /**
153
+ * Number of registered connectors. Cheap; safe to call frequently.
154
+ */
155
+ size(): number;
156
+ }
157
+
158
+ /**
159
+ * @remnic/core — Google Drive live connector (issue #683 PR 2/N)
160
+ *
161
+ * Concrete `LiveConnector` implementation that incrementally imports text
162
+ * content from a user's Google Drive into Remnic. Built on top of the
163
+ * framework shipped in PR 1/N (`framework.ts` / `registry.ts` /
164
+ * `state-store.ts`).
165
+ *
166
+ * Design notes:
167
+ *
168
+ * - **Cursor semantics.** We page Drive with the official `changes` API
169
+ * when a `startPageToken` is available. The cursor is opaque from the
170
+ * framework's POV (`{kind: "drivePageToken", value: ...}`), and on the
171
+ * very first sync (cursor=null) we call `changes.getStartPageToken()`
172
+ * to seed it without importing anything. This matches the documented
173
+ * Drive incremental-sync recipe and means re-runs never re-ingest the
174
+ * same file as long as the cursor file survives.
175
+ *
176
+ * - **Folder scope.** When `folderIds` is non-empty, files are filtered
177
+ * to those whose `parents` intersect the configured folder set. Drive
178
+ * does not currently support server-side parent filtering on the
179
+ * `changes.list` endpoint, so we pull the change record's `file` payload
180
+ * and apply the filter on our side. Folder ids are validated up front so
181
+ * a typo in config doesn't silently cause a broad import.
182
+ *
183
+ * - **Content extraction.** Google-native MIME types
184
+ * (`application/vnd.google-apps.{document,spreadsheet,presentation}`)
185
+ * are exported via `files.export` to plaintext. Plain-text MIME types
186
+ * are pulled with `files.get?alt=media`. Everything else is skipped —
187
+ * bytes from binary formats (images, PDFs, archives) belong in the
188
+ * binary-lifecycle pipeline, not in the textual ingestion path.
189
+ *
190
+ * - **Idempotency.** Each emitted `ConnectorDocument.source` carries
191
+ * `externalId = file.id` plus `externalRevision = file.modifiedTime`,
192
+ * so downstream dedup (CLAUDE.md gotcha #44 — never index content that
193
+ * failed to persist) can recognise repeat fetches even if the cursor is
194
+ * manually rewound.
195
+ *
196
+ * - **Privacy.** No document content is ever logged. Folder ids and
197
+ * counts may be logged. OAuth credentials (`clientId`,
198
+ * `clientSecret`, `refreshToken`) are accepted via config but the
199
+ * intent is for callers to populate them from a secret store; we never
200
+ * persist credentials through the connector state-store. Per CLAUDE.md
201
+ * repository-privacy rules, no real credentials may appear in tests,
202
+ * fixtures, or comments.
203
+ *
204
+ * - **À-la-carte packaging (CLAUDE.md gotcha #57).** `googleapis` is NOT
205
+ * listed as a hard dependency of `@remnic/core`. It is loaded via a
206
+ * computed-specifier dynamic import (`await import("google" + "apis")`)
207
+ * so bundlers cannot statically resolve it, and it is declared as an
208
+ * optional peer dependency. Operators who never enable the connector
209
+ * pay nothing for it.
210
+ *
211
+ * - **Read-only.** This connector only reads. It never marks files as
212
+ * read, edits metadata, or modifies sharing settings.
213
+ */
214
+
215
+ /**
216
+ * Stable connector id. Lives in the registry under this exact string.
217
+ */
218
+ declare const GOOGLE_DRIVE_CONNECTOR_ID = "google-drive";
219
+ /**
220
+ * Cursor `kind` we emit. Treated as opaque by the framework; documented
221
+ * here so tests can assert on it.
222
+ */
223
+ declare const GOOGLE_DRIVE_CURSOR_KIND = "drivePageToken";
224
+ /**
225
+ * Default poll interval (5 minutes). Surfaced in `openclaw.plugin.json`
226
+ * defaults and in the documented config schema. Drive's `changes.list`
227
+ * endpoint is cheap, but polling sub-minute is wasteful for a personal
228
+ * memory layer.
229
+ */
230
+ declare const DEFAULT_POLL_INTERVAL_MS: number;
231
+ /**
232
+ * Validated, frozen view of `connectors.googleDrive.*`.
233
+ */
234
+ interface GoogleDriveConnectorConfig {
235
+ readonly clientId: string;
236
+ readonly clientSecret: string;
237
+ readonly refreshToken: string;
238
+ /** Poll interval surfaced to the scheduler. */
239
+ readonly pollIntervalMs: number;
240
+ /** Folder ids to scope import to. Empty = "all accessible". */
241
+ readonly folderIds: readonly string[];
242
+ }
243
+ /**
244
+ * Optional injection point for tests. The real connector dynamically imports
245
+ * `googleapis`; tests pass a stub here to avoid the optional-peer-dep
246
+ * machinery and to keep the test suite hermetic.
247
+ *
248
+ * The shape only covers the tiny slice of the SDK we actually use.
249
+ */
250
+ interface GoogleDriveClientFactory {
251
+ (config: GoogleDriveConnectorConfig): Promise<GoogleDriveClient>;
252
+ }
253
+ /**
254
+ * Minimal Drive client surface. Tests provide a fake; production wraps
255
+ * `googleapis` to fit. Method shapes mirror the upstream API where it
256
+ * matters (`startPageToken` / `nextPageToken` / `newStartPageToken`,
257
+ * `files.modifiedTime` ISO 8601 strings).
258
+ */
259
+ interface GoogleDriveClient {
260
+ /** Mirrors `drive.changes.getStartPageToken()`. */
261
+ getStartPageToken(): Promise<{
262
+ startPageToken: string;
263
+ }>;
264
+ /**
265
+ * Mirrors `drive.changes.list(...)`. We page until the response yields a
266
+ * `newStartPageToken` (i.e., no more pages). Each `change.file`, when
267
+ * present, includes the metadata we need to decide whether to ingest.
268
+ */
269
+ listChanges(args: {
270
+ pageToken: string;
271
+ pageSize: number;
272
+ }): Promise<DriveChangesPage>;
273
+ /**
274
+ * Export a Google-native doc to plaintext. Returns the body as a string.
275
+ */
276
+ exportFile(args: {
277
+ fileId: string;
278
+ mimeType: string;
279
+ }): Promise<string>;
280
+ /**
281
+ * Download a non-Google-native file as a string. Used for `text/*` MIME
282
+ * types; binary formats are filtered out before we get here.
283
+ */
284
+ getFileMedia(args: {
285
+ fileId: string;
286
+ }): Promise<string>;
287
+ }
288
+ interface DriveChangesPage {
289
+ readonly changes: readonly DriveChange[];
290
+ readonly newStartPageToken?: string;
291
+ readonly nextPageToken?: string;
292
+ }
293
+ interface DriveChange {
294
+ readonly removed?: boolean;
295
+ readonly fileId?: string;
296
+ readonly file?: DriveFileMetadata;
297
+ }
298
+ interface DriveFileMetadata {
299
+ readonly id: string;
300
+ readonly name?: string;
301
+ readonly mimeType?: string;
302
+ readonly modifiedTime?: string;
303
+ readonly trashed?: boolean;
304
+ readonly parents?: readonly string[];
305
+ readonly webViewLink?: string;
306
+ readonly size?: string | number;
307
+ }
308
+ /**
309
+ * Result of a single sync pass — exposed for richer test assertions.
310
+ * Strict superset of `SyncIncrementalResult`.
311
+ */
312
+ interface GoogleDriveSyncResult extends SyncIncrementalResult {
313
+ readonly skippedBinary: number;
314
+ readonly skippedFolderScope: number;
315
+ readonly skippedTooLarge: number;
316
+ }
317
+ /**
318
+ * Validate and normalise raw config. Throws with a concrete message on any
319
+ * malformed input — never silently defaults (CLAUDE.md gotcha #51).
320
+ */
321
+ declare function validateGoogleDriveConfig(raw: unknown): GoogleDriveConnectorConfig;
322
+ /**
323
+ * Construct the connector. The `clientFactory` argument is the test hook —
324
+ * production callers omit it and the connector lazy-loads `googleapis`.
325
+ */
326
+ declare function createGoogleDriveConnector(options?: {
327
+ clientFactory?: GoogleDriveClientFactory;
328
+ }): LiveConnector;
329
+ /**
330
+ * Production client factory. Lazy-loads `googleapis` via a computed-specifier
331
+ * dynamic import so bundlers never statically resolve it (CLAUDE.md gotcha
332
+ * #57). Surfaces a precise install hint on miss.
333
+ *
334
+ * Exported only for the `index.ts` barrel; consumers that already inject a
335
+ * test factory don't need to touch this.
336
+ */
337
+ declare const defaultGoogleDriveClientFactory: GoogleDriveClientFactory;
338
+
339
+ /**
340
+ * @remnic/core — Notion live connector (issue #683 PR 3/N)
341
+ *
342
+ * Concrete `LiveConnector` implementation that incrementally imports text
343
+ * content from Notion database pages into Remnic. Built on top of the
344
+ * framework shipped in PR 1/N (`framework.ts` / `registry.ts` /
345
+ * `state-store.ts`) and mirrors the structure of the Google Drive connector
346
+ * (PR 2/N).
347
+ *
348
+ * Design notes:
349
+ *
350
+ * - **Auth.** Integration token from config (`connectors.notion.token`).
351
+ * The token is accepted at config-parse time but never logged. Operators
352
+ * must populate it from a secret store; per the repo-wide privacy policy
353
+ * no real value may appear in tests or comments.
354
+ *
355
+ * - **Scope.** `databaseIds` in config limits the import to the listed
356
+ * Notion databases. The connector queries each database for pages whose
357
+ * `last_edited_time` is after a per-page high-water mark stored in the
358
+ * cursor. When `databaseIds` is empty the connector does nothing (safe
359
+ * default — no credentials → no import).
360
+ *
361
+ * - **Cursor semantics.** The cursor is a JSON string encoding a
362
+ * `NotionCursorPayload`: a map from page-id to last-seen
363
+ * `last_edited_time` ISO string. On the first sync (cursor=null) we
364
+ * seed the payload from the current state of each database WITHOUT
365
+ * importing any content, so "first install" doesn't re-ingest history.
366
+ * Each subsequent pass only imports pages edited after the stored
367
+ * watermark.
368
+ *
369
+ * - **Block extraction.** Page content is fetched via
370
+ * `blocks.children.list` recursively up to `MAX_BLOCK_DEPTH` levels.
371
+ * Block text is extracted to Markdown-ish plain text (no raw JSON blobs).
372
+ * Only text-bearing block types are included; unsupported types are
373
+ * silently skipped.
374
+ *
375
+ * - **Raw `fetch`.** We call the Notion REST API directly rather than using
376
+ * `@notionhq/client` — there is no optional-peer-dep machinery needed and
377
+ * the API surface we consume is tiny. The `fetchFn` argument is the test
378
+ * hook allowing stubbing without network access.
379
+ *
380
+ * - **Idempotency.** `ConnectorDocument.source.externalId` is the page id
381
+ * and `externalRevision` is `last_edited_time`, so downstream dedup can
382
+ * recognise repeat fetches if the cursor is rewound.
383
+ *
384
+ * - **Privacy.** No page content is ever logged. Database ids and counts
385
+ * may be logged. The integration token is never exposed in logs, state,
386
+ * or error messages.
387
+ *
388
+ * - **Read-only.** This connector only reads. It never modifies pages,
389
+ * databases, or any other Notion resource.
390
+ */
391
+
392
+ /** Stable connector id. Lives in the registry under this exact string. */
393
+ declare const NOTION_CONNECTOR_ID = "notion";
394
+ /**
395
+ * Cursor `kind` we emit. Opaque to the framework; documented here so
396
+ * tests can assert on it.
397
+ */
398
+ declare const NOTION_CURSOR_KIND = "notionWatermark";
399
+ /**
400
+ * Default poll interval (5 minutes). Notion's API has no push capability;
401
+ * polling sub-minute wastes quota for a personal memory layer.
402
+ */
403
+ declare const NOTION_DEFAULT_POLL_INTERVAL_MS: number;
404
+ /**
405
+ * Validated, frozen view of `connectors.notion.*`.
406
+ */
407
+ interface NotionConnectorConfig {
408
+ /** Notion integration token. Starts with `secret_`. */
409
+ readonly token: string;
410
+ /** Database ids to import pages from. Empty = connector is a no-op. */
411
+ readonly databaseIds: readonly string[];
412
+ /** Poll interval surfaced to the scheduler (ms). */
413
+ readonly pollIntervalMs: number;
414
+ }
415
+ /**
416
+ * Minimal fetch-compatible surface we use. The real connector delegates to
417
+ * the global `fetch`; tests inject a stub factory.
418
+ */
419
+ type NotionFetchFn = (url: string, init: {
420
+ method: string;
421
+ headers: Record<string, string>;
422
+ body?: string;
423
+ signal?: AbortSignal;
424
+ }) => Promise<{
425
+ ok: boolean;
426
+ status: number;
427
+ json(): Promise<unknown>;
428
+ }>;
429
+ /**
430
+ * Validate and normalise raw config. Throws with a concrete message on any
431
+ * malformed input — never silently defaults (CLAUDE.md gotcha #51).
432
+ */
433
+ declare function validateNotionConfig(raw: unknown): NotionConnectorConfig;
434
+ /**
435
+ * Construct the connector. The `fetchFn` argument is the test hook —
436
+ * production callers omit it and the connector uses the global `fetch`.
437
+ */
438
+ declare function createNotionConnector(options?: {
439
+ fetchFn?: NotionFetchFn;
440
+ }): LiveConnector;
441
+
94
442
  /**
95
443
  * memory-extension-host/render-extensions-block.ts — Render discovered extensions
96
444
  * into a markdown block for injection into consolidation prompts.
@@ -534,8 +882,15 @@ declare function branchNamespaceName(projectId: string, branch: string): string;
534
882
  * existing `defaultNamespaceForPrincipal(...)` result unchanged. This keeps
535
883
  * CLAUDE.md #30 (escape hatch): setting `codingMode.projectScope: false`
536
884
  * exactly restores pre-#569 behaviour at every call site.
885
+ *
886
+ * @param codingContext — git context from the connector
887
+ * @param config — coding mode flags (projectScope, branchScope, globalFallback)
888
+ * @param defaultNamespace — retained for call-site compatibility; no longer
889
+ * used. The global fallback is expressed as an empty-string sentinel in
890
+ * `readFallbacks`, which `combineNamespaces(principal, "")` resolves to the
891
+ * principal's own namespace at the call site.
537
892
  */
538
- declare function resolveCodingNamespaceOverlay(codingContext: CodingContext | null | undefined, config: Pick<CodingModeConfig, "projectScope" | "branchScope">): CodingNamespaceOverlay | null;
893
+ declare function resolveCodingNamespaceOverlay(codingContext: CodingContext | null | undefined, config: Pick<CodingModeConfig, "projectScope" | "branchScope" | "globalFallback">, defaultNamespace?: string): CodingNamespaceOverlay | null;
539
894
  interface CodingScopeDescription {
540
895
  /** "none" when no overlay is active; otherwise the resolved scope level. */
541
896
  scope: "none" | "project" | "branch";
@@ -562,7 +917,7 @@ interface CodingScopeDescription {
562
917
  *
563
918
  * Pure — callers pass the coding context + config they already have.
564
919
  */
565
- declare function describeCodingScope(codingContext: CodingContext | null | undefined, config: Pick<CodingModeConfig, "projectScope" | "branchScope">): CodingScopeDescription;
920
+ declare function describeCodingScope(codingContext: CodingContext | null | undefined, config: Pick<CodingModeConfig, "projectScope" | "branchScope" | "globalFallback">, defaultNamespace?: string): CodingScopeDescription;
566
921
 
567
922
  /**
568
923
  * Diff-aware review-context packer (issue #569 PR 4).
@@ -2503,4 +2858,198 @@ declare function clearTrainingExportAdapters(): void;
2503
2858
  */
2504
2859
  declare function convertMemoriesToRecords(options: TrainingExportOptions): Promise<TrainingExportRecord[]>;
2505
2860
 
2506
- export { type AuditEntry, type BinaryAssetRecord, type BinaryAssetStatus, type BinaryLifecycleConfig, type BinaryLifecycleManifest, type BinaryStorageBackend, type BinaryStorageBackendConfig, BulkImportSourceAdapter, ClaudeCodeMemoryExtensionPublisher, CodexMemoryExtensionPublisher, type CodingNamespaceOverlay, type CodingScopeDescription, 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_IMPORT_BATCH_SIZE, 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, type GitContext, type GitInvoker, HermesMemoryExtensionPublisher, type ImportProgress, ImportTurn, type ImportedMemory, type ImporterAdapter, type ImporterParseOptions, type ImporterTransformOptions, type ImporterWriteResult, type ImporterWriteTarget, 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, ResolverDecision, type ReviewAction, type ReviewCandidate, type ReviewContext, type ReviewItem, type ReviewListResult, type ReviewOptions, type ReviewResult, type RollbackResult, RolloutSummaryInput, type RunImportOptions, type RunImporterResult, type RunMaterializeOptions, 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, Taxonomy, type TrainingExportAdapter, type TrainingExportOptions, type TrainingExportRecord, type TreeNode, type WebSearchFn, WebSearchProvider, type WebSearchProviderOptions, appendAuditEntry, branchNamespaceName, buildProcedureMarkdownBody, buildProcedureRecallSection, checkMarketplaceManifest, clearBulkImportSources, clearTrainingExportAdapters, coerceInstallExtension, convertMemoriesToRecords, createBackend, createSpace, curate, defaultEnrichmentPipelineConfig, defaultWriteMemoriesToOrchestrator, deleteSpace, describeCodingScope, doctorConnector, emptyManifest, expandTildePath, findContradictions, findDuplicates, generateContextTree, generateMarketplaceManifest, generateResolverDocument, getActiveSpace, getAuditLog, getBulkImportSource, getManifestPath, getSpacesDir, getTaxonomyDir, getTaxonomyFilePath, getTrainingExportAdapter, hostIdForConnector, importedMemoryToTurn, installConnector, installFromMarketplace, isReviewPrompt, listBulkImportSources, listConnectors, listReviewItems, listSpaces, listTrainingExportAdapters, loadManifest, loadRegistry, loadTaxonomy, manifestDir, manifestPath, matchesPatterns, mergeSpaces, migrateFromEngram, normalizeOriginUrl, onboard, packReviewContext, parseProcedureStepsFromBody, parseTouchedFiles, performReview, projectNamespaceName, promoteSpace, publisherFor, publisherForConnector, pullFromSpace, pushToSpace, rankReviewCandidates, readAuditLog, readManifest, registerBulkImportSource, registerPublisher, registerTrainingExportAdapter, removeConnector, renderExtensionsBlock, renderExtensionsFooter, resolveCategory, resolveCodingNamespaceOverlay, resolveGitContext, resolvePrincipal, rollbackFromEngramMigration, runBinaryLifecyclePipeline, runCodexMaterialize, runEnrichmentPipeline, runImporter, runPostConsolidationMaterialize, saveManifest, saveRegistry, saveTaxonomy, scanForBinaries, shareSpace, stableHash, switchSpace, syncChanges, validateImportBatchSize, validateImportRateLimit, validateMarketplaceManifest, validateSlug, validateTaxonomy, watchForChanges, writeManifest, writeMarketplaceManifest };
2861
+ /**
2862
+ * Peer registry storage primitives — issue #679 PR 1/5.
2863
+ *
2864
+ * Pure file-I/O helpers for the per-peer kernel files:
2865
+ *
2866
+ * peers/{peer-id}/identity.md — slow, human-edited identity facts
2867
+ * peers/{peer-id}/profile.md — evolving profile (reasoner-owned)
2868
+ * peers/{peer-id}/interactions.log.md — append-only signal log
2869
+ *
2870
+ * No reasoner logic, no recall integration, no migration of existing
2871
+ * identity-anchor data — those land in PR 2/5 — 5/5.
2872
+ *
2873
+ * Path safety: `peerId` is validated against PEER_ID_PATTERN before any
2874
+ * filesystem operation. Reading a non-existent peer returns null (does not
2875
+ * throw). Reading malformed files throws — callers can catch and recover.
2876
+ */
2877
+
2878
+ /**
2879
+ * Validate a peer id. Throws `Error` with a descriptive message on failure.
2880
+ * Exported so callers can pre-check user input before constructing a Peer.
2881
+ */
2882
+ declare function assertValidPeerId(peerId: unknown): asserts peerId is string;
2883
+ /** Root directory holding the peer registry, relative to memoryDir. */
2884
+ declare const PEERS_DIR_NAME = "peers";
2885
+ /**
2886
+ * Read a peer's identity kernel.
2887
+ *
2888
+ * Returns `null` (does not throw) when the peer directory or identity
2889
+ * file does not exist. Throws on filesystem errors other than ENOENT and
2890
+ * on malformed files.
2891
+ */
2892
+ declare function readPeer(memoryDir: string, peerId: string): Promise<Peer | null>;
2893
+ /**
2894
+ * Write (create or overwrite) a peer's identity kernel.
2895
+ *
2896
+ * Creates `peers/{id}/` if it does not exist. Does not touch the peer's
2897
+ * profile or interaction log. Atomic-write semantics are deferred to
2898
+ * later PRs — for the schema slice we simply write the file.
2899
+ */
2900
+ declare function writePeer(memoryDir: string, peer: Peer): Promise<void>;
2901
+ /**
2902
+ * Enumerate all peers under `memoryDir/peers/`.
2903
+ *
2904
+ * Returns an empty array if the peers root does not exist. Subdirectories
2905
+ * whose name fails `PEER_ID_PATTERN` are skipped (defensive: the user
2906
+ * may have hand-edited the directory). Directories that exist but lack
2907
+ * `identity.md` are also skipped.
2908
+ */
2909
+ declare function listPeers(memoryDir: string): Promise<Peer[]>;
2910
+ /**
2911
+ * Append one entry to a peer's interaction log.
2912
+ *
2913
+ * Creates `peers/{id}/` and `interactions.log.md` if needed. The file is
2914
+ * append-only by contract — this helper never rewrites prior entries.
2915
+ * Returns the absolute path of the log file (useful for tests).
2916
+ */
2917
+ declare function appendInteractionLog(memoryDir: string, peerId: string, entry: PeerInteractionLogEntry): Promise<string>;
2918
+ /**
2919
+ * Read a peer's profile. Returns null if the profile file does not exist.
2920
+ *
2921
+ * The PR-1 surface only ships the structured read/write so the reasoner
2922
+ * (PR 2/5) and recall integration (PR 3/5) have a stable target. We do
2923
+ * not yet expose any field-update helpers.
2924
+ */
2925
+ declare function readPeerProfile(memoryDir: string, peerId: string): Promise<PeerProfile | null>;
2926
+ /**
2927
+ * Write (create or overwrite) a peer's profile.
2928
+ */
2929
+ declare function writePeerProfile(memoryDir: string, profile: PeerProfile): Promise<void>;
2930
+ /**
2931
+ * Read the raw interaction log for a peer.
2932
+ *
2933
+ * Returns the empty string if the log does not yet exist. Callers parse
2934
+ * the log themselves — this PR does not ship structured log parsing.
2935
+ * Exposed primarily so tests can verify monotonic append semantics.
2936
+ */
2937
+ declare function readInteractionLogRaw(memoryDir: string, peerId: string): Promise<string>;
2938
+
2939
+ /**
2940
+ * Capsule fork semantics — issue #676 PR 4/6.
2941
+ *
2942
+ * A fork takes an existing capsule archive, imports it into a target memory
2943
+ * root under the `fork` conflict-resolution mode (which rebases all records
2944
+ * under `forks/<capsule-id>/`), and then writes a lineage breadcrumb at
2945
+ * `<targetRoot>/forks/<forkId>/lineage.json` recording the parent capsule's
2946
+ * identity. Subsequent forks of the same parent or of a fork produce a
2947
+ * queryable chain.
2948
+ *
2949
+ * The lineage breadcrumb is a pure JSON file — no gzip, no bundle format —
2950
+ * so downstream tooling can read it with a single `readFile` + `JSON.parse`
2951
+ * without pulling in the transfer pipeline.
2952
+ */
2953
+
2954
+ /**
2955
+ * Options accepted by {@link forkCapsule}.
2956
+ *
2957
+ * `sourceArchive` — absolute or cwd-relative path to a `.capsule.json.gz`
2958
+ * archive produced by `exportCapsule`.
2959
+ *
2960
+ * `targetRoot` — absolute or cwd-relative path to the memory directory that
2961
+ * will receive the forked records. Must be an existing directory.
2962
+ *
2963
+ * `forkId` — user-chosen id for the fork. Validated against
2964
+ * {@link CAPSULE_ID_PATTERN}; must be unique under `<targetRoot>/forks/` (a
2965
+ * pre-existing `forks/<forkId>/` directory is rejected before any write).
2966
+ *
2967
+ * `versioning` — optional page-versioning config forwarded to
2968
+ * {@link importCapsule}. Only relevant when the target root already has files
2969
+ * that would be overwritten (fork mode is skip-on-exist by design, so this is
2970
+ * a no-op unless mode is changed in a future subclass).
2971
+ *
2972
+ * `now` — optional clock override (ms epoch) forwarded to `importCapsule` for
2973
+ * deterministic fork-id rewriting in tests.
2974
+ */
2975
+ interface ForkCapsuleOptions {
2976
+ sourceArchive: string;
2977
+ targetRoot: string;
2978
+ forkId: string;
2979
+ now?: number;
2980
+ }
2981
+ /**
2982
+ * The lineage breadcrumb written to `forks/<forkId>/lineage.json`.
2983
+ *
2984
+ * Fields are intentionally flat so the file is human-readable at a glance
2985
+ * and trivially diffable by `git diff`.
2986
+ *
2987
+ * `forkId` — the id supplied to `forkCapsule`.
2988
+ * `forkedAt` — ISO-8601 creation timestamp (UTC).
2989
+ * `parent` — structured linkage to the source capsule.
2990
+ * `importedRecords` — number of records written by the fork import.
2991
+ * `skippedRecords` — number of records skipped (target already existed).
2992
+ */
2993
+ interface ForkLineage {
2994
+ forkId: string;
2995
+ forkedAt: string;
2996
+ parent: CapsuleParent;
2997
+ importedRecords: number;
2998
+ skippedRecords: number;
2999
+ }
3000
+ interface ForkCapsuleResult {
3001
+ /** Absolute path to the source archive (unchanged, for chaining). */
3002
+ archivePath: string;
3003
+ /** The V2 manifest decoded from the source archive. */
3004
+ manifest: ExportManifestV2;
3005
+ /** Result of the underlying `importCapsule` call. */
3006
+ importResult: ImportCapsuleResult;
3007
+ /** The lineage breadcrumb that was written. */
3008
+ lineage: ForkLineage;
3009
+ /** Absolute path to the lineage breadcrumb file. */
3010
+ lineagePath: string;
3011
+ }
3012
+ /**
3013
+ * Fork a capsule archive into a target memory root.
3014
+ *
3015
+ * Sequence:
3016
+ * 1. Validate `forkId` against {@link CAPSULE_ID_PATTERN}.
3017
+ * 2. Resolve `targetRoot` and verify it is an existing directory (not a
3018
+ * symlink — mirrors {@link importCapsule}'s root validation).
3019
+ * 3. Reject if `forks/<forkId>/` already exists in the target root
3020
+ * (gotcha #49: deduplicate batch inputs; gotcha #25: don't destroy
3021
+ * old state).
3022
+ * 4. Import the archive in `"fork"` mode via {@link importCapsule}.
3023
+ * 5. Write the lineage breadcrumb at `forks/<forkId>/lineage.json`.
3024
+ * The breadcrumb dir is created by step 4 (importCapsule writes records
3025
+ * under `forks/<sourceId>/`); if `forkId !== sourceId` we may need to
3026
+ * create the fork dir ourselves. We always `mkdir -p` defensively.
3027
+ *
3028
+ * Error semantics:
3029
+ * - All validation errors throw before any filesystem write (fail-closed,
3030
+ * gotcha #25).
3031
+ * - If `importCapsule` throws after writing some records, the lineage
3032
+ * breadcrumb is NOT written (partial state is better than a false
3033
+ * "fork complete" marker — gotcha #12: write rollback data before
3034
+ * success markers).
3035
+ */
3036
+ declare function forkCapsule(opts: ForkCapsuleOptions): Promise<ForkCapsuleResult>;
3037
+ /**
3038
+ * Read the lineage breadcrumb for a given fork in a memory root.
3039
+ *
3040
+ * Returns `null` when no breadcrumb exists (the directory is not a fork, or
3041
+ * was created before PR 4/6). Never throws for a missing file — callers
3042
+ * that need to distinguish "not a fork" from "corrupt breadcrumb" should
3043
+ * handle the JSON parse error themselves.
3044
+ *
3045
+ * `forkId` is validated against {@link CAPSULE_ID_PATTERN} before being
3046
+ * joined into the breadcrumb path so a malicious value like
3047
+ * `../../../../tmp` cannot escape the `forks/` namespace and resolve to
3048
+ * unrelated files outside the configured memory root (Codex P2 #751).
3049
+ * Invalid ids return `null` (same shape as "no breadcrumb"); callers that
3050
+ * need to distinguish "invalid id" from "absent breadcrumb" should validate
3051
+ * upstream.
3052
+ */
3053
+ declare function readForkLineage(targetRoot: string, forkId: string): Promise<ForkLineage | null>;
3054
+
3055
+ export { type AuditEntry, type BinaryAssetRecord, type BinaryAssetStatus, type BinaryLifecycleConfig, type BinaryLifecycleManifest, type BinaryStorageBackend, type BinaryStorageBackendConfig, BulkImportSourceAdapter, ClaudeCodeMemoryExtensionPublisher, CodexMemoryExtensionPublisher, type CodingNamespaceOverlay, type CodingScopeDescription, 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_IMPORT_BATCH_SIZE, DEFAULT_MAX_BINARY_SIZE_BYTES, DEFAULT_SCAN_PATTERNS, DEFAULT_TAXONOMY, type DedupOptions, type DedupResult, DiscoveredExtension, type DocFile, type DoctorCheck, type DoctorResult, type DriveChange, type DriveChangesPage, type DriveFileMetadata, type DuplicatePair, type EnrichmentAuditEntry, type EnrichmentCandidate, type EnrichmentCostTier, type EnrichmentPipelineConfig, type EnrichmentProvider, type EnrichmentProviderConfig, EnrichmentProviderRegistry, type EnrichmentResult, type EntityEnrichmentInput, type FileChange, FilesystemBackend, type ForkCapsuleOptions, type ForkCapsuleResult, type ForkLineage, GOOGLE_DRIVE_CONNECTOR_ID, GOOGLE_DRIVE_CURSOR_KIND, DEFAULT_POLL_INTERVAL_MS as GOOGLE_DRIVE_DEFAULT_POLL_INTERVAL_MS, type GenerateOptions, type GenerateResult, type GitContext, type GitInvoker, type GoogleDriveClient, type GoogleDriveClientFactory, type GoogleDriveConnectorConfig, type GoogleDriveSyncResult, HermesMemoryExtensionPublisher, type ImportProgress, ImportTurn, type ImportedMemory, type ImporterAdapter, type ImporterParseOptions, type ImporterTransformOptions, type ImporterWriteResult, type ImporterWriteTarget, type IngestionPlan, type InstallOptions, type InstallResult, LanceDbBackend, type LanguageInfo, LiveConnector, LiveConnectorRegistry, LiveConnectorRegistryError, 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, NOTION_CONNECTOR_ID, NOTION_CURSOR_KIND, NOTION_DEFAULT_POLL_INTERVAL_MS, NoneBackend, type NotionConnectorConfig, type OnboardOptions, type OnboardResult, OramaBackend, PEERS_DIR_NAME, PUBLISHERS, Peer, PeerInteractionLogEntry, PeerProfile, 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, ResolverDecision, type ReviewAction, type ReviewCandidate, type ReviewContext, type ReviewItem, type ReviewListResult, type ReviewOptions, type ReviewResult, type RollbackResult, RolloutSummaryInput, type RunImportOptions, type RunImporterResult, type RunMaterializeOptions, type Space, type SpaceKind, type SpaceManifest, type SpacePromoteResult, type SpacePullResult, type SpacePushResult, type SpaceShareResult, type SpaceSwitchResult, type StatementProvenance, StorageManager, SyncIncrementalResult, type SyncOptions, type SyncResult, type SyncState, Taxonomy, type TrainingExportAdapter, type TrainingExportOptions, type TrainingExportRecord, type TreeNode, type WebSearchFn, WebSearchProvider, type WebSearchProviderOptions, appendAuditEntry, appendInteractionLog, assertValidPeerId, branchNamespaceName, buildProcedureMarkdownBody, buildProcedureRecallSection, checkMarketplaceManifest, clearBulkImportSources, clearTrainingExportAdapters, coerceInstallExtension, convertMemoriesToRecords, createBackend, createGoogleDriveConnector, createNotionConnector, createSpace, curate, defaultEnrichmentPipelineConfig, defaultGoogleDriveClientFactory, defaultWriteMemoriesToOrchestrator, deleteSpace, describeCodingScope, doctorConnector, emptyManifest, expandTildePath, findContradictions, findDuplicates, forkCapsule, generateContextTree, generateMarketplaceManifest, generateResolverDocument, getActiveSpace, getAuditLog, getBulkImportSource, getManifestPath, getSpacesDir, getTaxonomyDir, getTaxonomyFilePath, getTrainingExportAdapter, hostIdForConnector, importedMemoryToTurn, installConnector, installFromMarketplace, isReviewPrompt, listBulkImportSources, listConnectors, listPeers, listReviewItems, listSpaces, listTrainingExportAdapters, loadManifest, loadRegistry, loadTaxonomy, manifestDir, manifestPath, matchesPatterns, mergeSpaces, migrateFromEngram, normalizeOriginUrl, onboard, packReviewContext, parseProcedureStepsFromBody, parseTouchedFiles, performReview, projectNamespaceName, promoteSpace, publisherFor, publisherForConnector, pullFromSpace, pushToSpace, rankReviewCandidates, readAuditLog, readForkLineage, readInteractionLogRaw, readManifest, readPeer, readPeerProfile, registerBulkImportSource, registerPublisher, registerTrainingExportAdapter, removeConnector, renderExtensionsBlock, renderExtensionsFooter, resolveCategory, resolveCodingNamespaceOverlay, resolveGitContext, resolvePrincipal, rollbackFromEngramMigration, runBinaryLifecyclePipeline, runCodexMaterialize, runEnrichmentPipeline, runImporter, runPostConsolidationMaterialize, saveManifest, saveRegistry, saveTaxonomy, scanForBinaries, shareSpace, stableHash, switchSpace, syncChanges, validateGoogleDriveConfig, validateImportBatchSize, validateImportRateLimit, validateMarketplaceManifest, validateNotionConfig, validateSlug, validateTaxonomy, watchForChanges, writeManifest, writeMarketplaceManifest, writePeer, writePeerProfile };