@remnic/core 9.69.41 → 9.69.43

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 (611) hide show
  1. package/dist/access-admin-ops-surface.d.ts +16 -13
  2. package/dist/access-admin-ops-surface.js +48 -40
  3. package/dist/access-authorization-probe.d.ts +16 -13
  4. package/dist/access-authorization-probe.js +49 -41
  5. package/dist/access-boundary.d.ts +16 -13
  6. package/dist/access-boundary.js +48 -40
  7. package/dist/access-cli.js +115 -105
  8. package/dist/access-cli.js.map +1 -1
  9. package/dist/access-coding-context-resolution.d.ts +2 -1
  10. package/dist/access-extraction-force-flush.d.ts +16 -13
  11. package/dist/access-extraction-force-flush.js +48 -40
  12. package/dist/access-health-types.d.ts +2 -1
  13. package/dist/access-http-briefing.d.ts +16 -13
  14. package/dist/access-http-briefing.js +49 -41
  15. package/dist/access-http-lcm-compaction.d.ts +16 -13
  16. package/dist/access-http-lifecycle-flush.d.ts +16 -13
  17. package/dist/access-http-offline-stream.d.ts +16 -13
  18. package/dist/access-http-query.d.ts +3 -2
  19. package/dist/access-http-query.js +50 -42
  20. package/dist/access-http.d.ts +17 -14
  21. package/dist/access-http.js +70 -60
  22. package/dist/access-identity-continuity-surface.d.ts +12 -11
  23. package/dist/access-identity-continuity-surface.js +48 -40
  24. package/dist/access-lcm-surface.d.ts +16 -13
  25. package/dist/access-lcm-surface.js +48 -40
  26. package/dist/access-mcp-output-schemas.js +1 -1
  27. package/dist/access-mcp-shared-context-tools.d.ts +16 -13
  28. package/dist/access-mcp.d.ts +16 -13
  29. package/dist/access-mcp.js +60 -51
  30. package/dist/access-memory-search-fanout.d.ts +3 -2
  31. package/dist/{access-namespace-preflight-DWsMc9Dh.d.ts → access-namespace-preflight-CE-RrXKu.d.ts} +1 -1
  32. package/dist/access-namespace-preflight.d.ts +4 -3
  33. package/dist/access-namespace-preflight.js +48 -40
  34. package/dist/access-observe-transcript.d.ts +12 -11
  35. package/dist/access-observe-write-category.d.ts +18 -1
  36. package/dist/access-observe-write-category.js +21 -4
  37. package/dist/access-observe-write-surface.d.ts +16 -13
  38. package/dist/access-observe-write-surface.js +48 -40
  39. package/dist/access-offline-manifest.d.ts +12 -11
  40. package/dist/access-offline-manifest.js +6 -6
  41. package/dist/access-operations-batch.js +50 -43
  42. package/dist/access-operations.d.ts +17 -14
  43. package/dist/access-operations.js +56 -48
  44. package/dist/access-recall-concurrency.d.ts +16 -13
  45. package/dist/access-recall-concurrency.js +48 -40
  46. package/dist/access-recall-response.d.ts +16 -13
  47. package/dist/access-recall-response.js +48 -40
  48. package/dist/access-recall-surface.d.ts +16 -13
  49. package/dist/access-recall-surface.js +48 -40
  50. package/dist/access-schema.d.ts +5 -1
  51. package/dist/access-schema.js +3 -3
  52. package/dist/{access-service-Cisy5YDq.d.ts → access-service-DxTTTg9O.d.ts} +15 -11
  53. package/dist/access-service-helpers.d.ts +16 -13
  54. package/dist/access-service.d.ts +16 -13
  55. package/dist/access-service.js +48 -40
  56. package/dist/access-surface-catalog.d.ts +16 -13
  57. package/dist/access-surface-catalog.js +54 -42
  58. package/dist/access-surface-catalog.js.map +1 -1
  59. package/dist/access-wearables-meetings-surface.d.ts +5 -4
  60. package/dist/action-confidence.d.ts +2 -1
  61. package/dist/active-memory-bridge.d.ts +2 -1
  62. package/dist/active-recall.d.ts +2 -1
  63. package/dist/active-recall.js +9 -7
  64. package/dist/active-recall.js.map +1 -1
  65. package/dist/activity/digest.d.ts +2 -1
  66. package/dist/ambient-provenance.d.ts +2 -1
  67. package/dist/artifact-search.d.ts +2 -1
  68. package/dist/{auto-sync-7PGUFY7U.js → auto-sync-QZD4RD6H.js} +9 -5
  69. package/dist/{auto-sync-7PGUFY7U.js.map → auto-sync-QZD4RD6H.js.map} +1 -1
  70. package/dist/background-generation.d.ts +2 -1
  71. package/dist/behavior-learner.d.ts +2 -1
  72. package/dist/behavior-signals.d.ts +2 -1
  73. package/dist/bootstrap.d.ts +12 -11
  74. package/dist/briefing-window.d.ts +3 -2
  75. package/dist/briefing.d.ts +3 -2
  76. package/dist/briefing.js +13 -13
  77. package/dist/buffer-surprise-report.d.ts +2 -1
  78. package/dist/buffer-turn-helpers.d.ts +2 -1
  79. package/dist/buffer.d.ts +3 -2
  80. package/dist/buffer.js +7 -7
  81. package/dist/bulk-import/index.d.ts +4 -3
  82. package/dist/calibration.d.ts +2 -1
  83. package/dist/capabilities.d.ts +2 -1
  84. package/dist/{capsule-crypto-YO5QJ6L3.js → capsule-crypto-7FJQINUR.js} +2 -2
  85. package/dist/{catalog-wcX1QhtQ.d.ts → catalog-Ya3DDn_T.d.ts} +1 -1
  86. package/dist/causal-behavior.d.ts +2 -1
  87. package/dist/causal-consolidation.d.ts +2 -1
  88. package/dist/causal-consolidation.js +14 -14
  89. package/dist/causal-trajectory-graph.d.ts +2 -1
  90. package/dist/{chunk-QVSRE355.js → chunk-2AV75BJW.js} +29 -1
  91. package/dist/chunk-2AV75BJW.js.map +1 -0
  92. package/dist/{chunk-563X6JJX.js → chunk-2HDLDBJW.js} +2 -2
  93. package/dist/{chunk-BXLOS5AJ.js → chunk-2NLLXCJG.js} +2 -2
  94. package/dist/{chunk-WBQ4ONQJ.js → chunk-2PIC6CEN.js} +2 -2
  95. package/dist/chunk-2WFOVXVJ.js +95 -0
  96. package/dist/chunk-2WFOVXVJ.js.map +1 -0
  97. package/dist/{chunk-54QPOE45.js → chunk-2YIUUXNK.js} +2 -2
  98. package/dist/{chunk-XRS65T4O.js → chunk-324HBGS4.js} +6 -6
  99. package/dist/chunk-324HBGS4.js.map +1 -0
  100. package/dist/{chunk-AKABVXFS.js → chunk-3254BYQV.js} +1 -1
  101. package/dist/{chunk-XCPNH2MG.js → chunk-3KJTSCSX.js} +5 -5
  102. package/dist/{chunk-I33QYUAF.js → chunk-3YQ7VLP3.js} +2 -2
  103. package/dist/{chunk-JMWUPUE6.js → chunk-46FVFU7S.js} +2 -2
  104. package/dist/{chunk-PFKIOYJH.js → chunk-4WMGRLTV.js} +7 -7
  105. package/dist/{chunk-KLUC2GSG.js → chunk-5AJZ7EUW.js} +5 -5
  106. package/dist/chunk-5KVT6G5U.js +31 -0
  107. package/dist/chunk-5KVT6G5U.js.map +1 -0
  108. package/dist/{chunk-WN2OXGGH.js → chunk-66YUOI53.js} +1 -1
  109. package/dist/chunk-66YUOI53.js.map +1 -0
  110. package/dist/{chunk-Z7NBT6AK.js → chunk-6EGIQEKC.js} +2 -2
  111. package/dist/{chunk-6MQMYXSQ.js → chunk-7F47R4H4.js} +2 -2
  112. package/dist/{chunk-YFXAWGMR.js → chunk-7L54ARML.js} +2 -2
  113. package/dist/{chunk-2EYZ32LH.js → chunk-7RGX7BMF.js} +24 -2
  114. package/dist/{chunk-2EYZ32LH.js.map → chunk-7RGX7BMF.js.map} +1 -1
  115. package/dist/{chunk-LVFI5LG7.js → chunk-A7GQBJP5.js} +7 -7
  116. package/dist/{chunk-EMSYMYXO.js → chunk-AKB44K3D.js} +8 -8
  117. package/dist/chunk-AS2NOPDM.js +30 -0
  118. package/dist/chunk-AS2NOPDM.js.map +1 -0
  119. package/dist/{chunk-3BLHPQHT.js → chunk-BPXJINHW.js} +5 -5
  120. package/dist/{chunk-D6PY63OM.js → chunk-BZDK5EOD.js} +2 -2
  121. package/dist/{chunk-2J3V5QEO.js → chunk-C3QXITIP.js} +4 -4
  122. package/dist/{chunk-PLJ2MQFT.js → chunk-C3YEB7CR.js} +7 -7
  123. package/dist/{chunk-DM5CU5J7.js → chunk-CRK6F6N3.js} +3 -2
  124. package/dist/chunk-CRK6F6N3.js.map +1 -0
  125. package/dist/{chunk-2ZG2LLZT.js → chunk-D7UUB33A.js} +2 -2
  126. package/dist/{chunk-E3I3NDUP.js → chunk-DABSYX7V.js} +7 -7
  127. package/dist/{chunk-KJLLPG26.js → chunk-DDGQDNQW.js} +2 -2
  128. package/dist/{chunk-K5D2XVNN.js → chunk-F2FJTOV6.js} +2 -2
  129. package/dist/{chunk-EAARGPWI.js → chunk-F3TURDFG.js} +3 -1
  130. package/dist/chunk-F3TURDFG.js.map +1 -0
  131. package/dist/{chunk-7ZLC4DTZ.js → chunk-F6PTJLEM.js} +1 -1
  132. package/dist/chunk-F6PTJLEM.js.map +1 -0
  133. package/dist/{chunk-P66QH6R6.js → chunk-GKKLI23D.js} +2 -2
  134. package/dist/{chunk-ICN37XHG.js → chunk-GMU7MAHS.js} +19 -19
  135. package/dist/{chunk-RQQO3ORQ.js → chunk-GR76OKET.js} +13 -4
  136. package/dist/{chunk-RQQO3ORQ.js.map → chunk-GR76OKET.js.map} +1 -1
  137. package/dist/{chunk-PQ42DJNG.js → chunk-H2N6SLTR.js} +2 -2
  138. package/dist/{chunk-ND7MAIJC.js → chunk-HKQAI6XI.js} +2 -2
  139. package/dist/{chunk-C3G6MW4W.js → chunk-IB7FDRRC.js} +2 -2
  140. package/dist/{chunk-WFMQN7JE.js → chunk-IWHNT35B.js} +3 -3
  141. package/dist/{chunk-W7UV2ZCA.js → chunk-JDL5BYYF.js} +3 -3
  142. package/dist/{chunk-N6XTC56E.js → chunk-JWBDHA4F.js} +15 -11
  143. package/dist/chunk-JWBDHA4F.js.map +1 -0
  144. package/dist/{chunk-5EQT62HH.js → chunk-KDLOKVX7.js} +2 -2
  145. package/dist/chunk-KIW3OOZE.js +39 -0
  146. package/dist/chunk-KIW3OOZE.js.map +1 -0
  147. package/dist/{chunk-GMH5QPUU.js → chunk-KOM36ILJ.js} +19 -15
  148. package/dist/chunk-KOM36ILJ.js.map +1 -0
  149. package/dist/{chunk-V62YYBBY.js → chunk-KORQWGUA.js} +2 -2
  150. package/dist/{chunk-VDX2J7OX.js → chunk-KQAFEZQX.js} +2 -2
  151. package/dist/{chunk-WZIO3TW6.js → chunk-KY75VZKG.js} +2 -2
  152. package/dist/{chunk-4IGOLIWM.js → chunk-L63M2PE4.js} +2 -2
  153. package/dist/{chunk-PGGPRF6J.js → chunk-LD22AAJI.js} +2 -2
  154. package/dist/{chunk-NYWCFC3K.js → chunk-LT4H7SL5.js} +113 -59
  155. package/dist/chunk-LT4H7SL5.js.map +1 -0
  156. package/dist/{chunk-A4OIJYCV.js → chunk-LUAQHDUI.js} +2 -2
  157. package/dist/chunk-LVTT5AUG.js +79 -0
  158. package/dist/chunk-LVTT5AUG.js.map +1 -0
  159. package/dist/{chunk-S4MJTIPG.js → chunk-LXMZM7LM.js} +330 -78
  160. package/dist/chunk-LXMZM7LM.js.map +1 -0
  161. package/dist/{chunk-DIXZQTGY.js → chunk-M6FKXOYV.js} +2 -2
  162. package/dist/{chunk-Z535ADTC.js → chunk-M7H56FOQ.js} +2 -2
  163. package/dist/{chunk-JSD7Q7LD.js → chunk-MOL7JK4F.js} +2 -2
  164. package/dist/{chunk-I46BYY7U.js → chunk-NHFXGNGC.js} +92 -71
  165. package/dist/chunk-NHFXGNGC.js.map +1 -0
  166. package/dist/{chunk-ZX6NNFSY.js → chunk-OGAKUA7I.js} +2 -2
  167. package/dist/{chunk-KZJM7R4F.js → chunk-PF7LQ22G.js} +6 -6
  168. package/dist/{chunk-UZGHKD3T.js → chunk-PPDZSJXB.js} +2 -2
  169. package/dist/{chunk-AUSRUOMQ.js → chunk-PW4HTWXL.js} +2 -2
  170. package/dist/{chunk-LE2KZ72G.js → chunk-QCTXQ2HW.js} +2 -2
  171. package/dist/{chunk-I3H5LFOI.js → chunk-QNJQCLI6.js} +4 -4
  172. package/dist/{chunk-46RII65S.js → chunk-QUBPZQED.js} +2 -2
  173. package/dist/chunk-QZ4U67KO.js +98 -0
  174. package/dist/chunk-QZ4U67KO.js.map +1 -0
  175. package/dist/{chunk-E4LMQTST.js → chunk-R3H2AXO2.js} +2 -2
  176. package/dist/{chunk-XVDZFTN5.js → chunk-RFIJH2OE.js} +5 -5
  177. package/dist/{chunk-BTPCP535.js → chunk-RJ7Z7YXK.js} +5 -5
  178. package/dist/{chunk-TBXAY2SS.js → chunk-SGHGCFVV.js} +5 -5
  179. package/dist/{chunk-AIVRD66I.js → chunk-T3F2HWIG.js} +2 -2
  180. package/dist/chunk-TE6S7KDF.js +47 -0
  181. package/dist/chunk-TE6S7KDF.js.map +1 -0
  182. package/dist/{chunk-WPGA4RYI.js → chunk-UCLWIMVW.js} +2 -2
  183. package/dist/{chunk-6P4REYKL.js → chunk-UDAUULK2.js} +28 -2
  184. package/dist/{chunk-6P4REYKL.js.map → chunk-UDAUULK2.js.map} +1 -1
  185. package/dist/{chunk-V2EXYQEQ.js → chunk-VHANUT45.js} +7 -7
  186. package/dist/{chunk-AFJHNHAM.js → chunk-VJXMFBVR.js} +2 -2
  187. package/dist/{chunk-FGFC2EFR.js → chunk-VKDXYEA6.js} +3 -3
  188. package/dist/{chunk-Q62GA5U2.js → chunk-VW5TGNJN.js} +2 -2
  189. package/dist/{chunk-Q62GA5U2.js.map → chunk-VW5TGNJN.js.map} +1 -1
  190. package/dist/chunk-VYDGHJIN.js +17 -0
  191. package/dist/chunk-VYDGHJIN.js.map +1 -0
  192. package/dist/{chunk-GWNSKQDA.js → chunk-W44T2KHG.js} +3 -3
  193. package/dist/{chunk-H3TKENU4.js → chunk-WIKO4SCR.js} +5 -5
  194. package/dist/{chunk-DQEMWVMT.js → chunk-X7Y7WX73.js} +1 -1
  195. package/dist/{chunk-MCMS4VUK.js → chunk-XIJHRQ4A.js} +14 -8
  196. package/dist/chunk-XIJHRQ4A.js.map +1 -0
  197. package/dist/{chunk-2HQPE2NM.js → chunk-XOCGC3FJ.js} +2 -2
  198. package/dist/chunk-YE4JBZO5.js +44 -0
  199. package/dist/chunk-YE4JBZO5.js.map +1 -0
  200. package/dist/{chunk-V2TOGJPM.js → chunk-YPB3Y57U.js} +14 -13
  201. package/dist/chunk-YPB3Y57U.js.map +1 -0
  202. package/dist/{chunk-ZZEIL3MI.js → chunk-YTV6J4T6.js} +2 -2
  203. package/dist/{chunk-ZZEIL3MI.js.map → chunk-YTV6J4T6.js.map} +1 -1
  204. package/dist/{chunk-IYIPXAIJ.js → chunk-ZBSP4BSN.js} +2 -2
  205. package/dist/{chunk-VVX5PZFS.js → chunk-ZHXSOMYH.js} +2 -2
  206. package/dist/{cli-CUlMlS2N.d.ts → cli-BfCl5kWD.d.ts} +5 -5
  207. package/dist/cli.d.ts +18 -15
  208. package/dist/cli.js +94 -84
  209. package/dist/coding/export-okf-codegraph.d.ts +2 -1
  210. package/dist/coding/export-okf-codegraph.js +13 -13
  211. package/dist/coding/pre-action-gate.d.ts +2 -1
  212. package/dist/compounding/engine.d.ts +3 -2
  213. package/dist/compounding/engine.js +13 -13
  214. package/dist/compounding/preference-consolidator.d.ts +2 -1
  215. package/dist/compression-optimizer.d.ts +2 -1
  216. package/dist/config.d.ts +2 -1
  217. package/dist/config.js +9 -7
  218. package/dist/connectors/codex-materialize-runner.d.ts +2 -1
  219. package/dist/connectors/codex-materialize-runner.js +13 -13
  220. package/dist/connectors/codex-materialize.d.ts +2 -1
  221. package/dist/connectors/index.d.ts +2 -1
  222. package/dist/connectors/index.js +14 -14
  223. package/dist/consolidation-provenance-check.d.ts +3 -2
  224. package/dist/consolidation-undo.d.ts +3 -2
  225. package/dist/contradiction/index.d.ts +5 -4
  226. package/dist/contradiction/index.js +3 -3
  227. package/dist/converge-config.d.ts +2 -1
  228. package/dist/convergence-refresh.d.ts +3 -2
  229. package/dist/convergence-refresh.js +16 -16
  230. package/dist/conversation-index/backend.d.ts +2 -1
  231. package/dist/conversation-index/chunker.d.ts +2 -1
  232. package/dist/conversation-index/faiss-adapter.d.ts +2 -1
  233. package/dist/conversation-index/indexer.d.ts +2 -1
  234. package/dist/conversation-index/search.d.ts +2 -1
  235. package/dist/corpus-watermark.d.ts +2 -1
  236. package/dist/corpus-watermark.js +16 -16
  237. package/dist/cross-lingual-recall.d.ts +2 -1
  238. package/dist/day-summary.d.ts +2 -1
  239. package/dist/deep-recall-config.d.ts +11 -1
  240. package/dist/deep-recall-config.js +6 -3
  241. package/dist/deep-recall-http-glue.d.ts +16 -13
  242. package/dist/deep-recall-http-glue.js +5 -5
  243. package/dist/deep-recall-mcp-tools.d.ts +16 -13
  244. package/dist/deep-recall-policy-llm.d.ts +3 -2
  245. package/dist/deep-recall-seeds.d.ts +2 -1
  246. package/dist/delinearize.d.ts +2 -1
  247. package/dist/dependency-propagation-config.d.ts +2 -1
  248. package/dist/{dependency-propagation-delivery-BDDjImQn.d.ts → dependency-propagation-delivery-CggS9BFT.d.ts} +1 -1
  249. package/dist/direct-answer-wiring.d.ts +2 -1
  250. package/dist/direct-answer.d.ts +2 -1
  251. package/dist/embedding-fallback.d.ts +2 -1
  252. package/dist/enrichment/index.d.ts +2 -1
  253. package/dist/entity-origin-fields.d.ts +2 -1
  254. package/dist/entity-retrieval.d.ts +3 -2
  255. package/dist/entity-retrieval.js +13 -13
  256. package/dist/entity-schema.d.ts +2 -1
  257. package/dist/episodic-context.d.ts +2 -1
  258. package/dist/eval-trajectory-contracts.d.ts +2 -1
  259. package/dist/eval-trajectory-store.d.ts +2 -1
  260. package/dist/eval-trajectory.d.ts +2 -1
  261. package/dist/explicit-capture.d.ts +12 -11
  262. package/dist/explicit-capture.js +3 -3
  263. package/dist/external-wiki-access.d.ts +16 -13
  264. package/dist/external-wiki-access.js +49 -41
  265. package/dist/external-wiki-collection-registration.d.ts +2 -1
  266. package/dist/external-wiki-collection.d.ts +2 -1
  267. package/dist/external-wiki-mcp-tools.d.ts +16 -13
  268. package/dist/extraction-error-classification.d.ts +2 -1
  269. package/dist/extraction-faithfulness.d.ts +3 -2
  270. package/dist/extraction-judge-telemetry.d.ts +3 -2
  271. package/dist/extraction-judge-training.d.ts +3 -2
  272. package/dist/extraction-judge.d.ts +3 -2
  273. package/dist/extraction-liveness.d.ts +2 -1
  274. package/dist/extraction-normalization.d.ts +2 -1
  275. package/dist/extraction-prompt.d.ts +2 -1
  276. package/dist/extraction-source-grounding-rules.d.ts +2 -1
  277. package/dist/extraction-source-grounding.d.ts +2 -1
  278. package/dist/extraction-span-config.d.ts +2 -1
  279. package/dist/extraction-span-materialize.d.ts +2 -1
  280. package/dist/extraction.d.ts +3 -2
  281. package/dist/extraction.js +21 -21
  282. package/dist/fallback-llm-codex-subscription.d.ts +2 -1
  283. package/dist/fallback-llm.d.ts +2 -1
  284. package/dist/{generic-recall-paths-CpDzNO_I.d.ts → generic-recall-paths-CoXPSnCw.d.ts} +1 -1
  285. package/dist/graph-append-error.d.ts +2 -1
  286. package/dist/graph-dashboard-diff.d.ts +2 -1
  287. package/dist/graph-dashboard-key.d.ts +2 -1
  288. package/dist/graph-dashboard-parser.d.ts +2 -1
  289. package/dist/graph-edge-reinforcement.d.ts +2 -1
  290. package/dist/graph-jsonl.d.ts +2 -1
  291. package/dist/graph-path-reconstruction.d.ts +2 -1
  292. package/dist/graph-path-scoring.d.ts +2 -1
  293. package/dist/graph-snapshot.d.ts +2 -1
  294. package/dist/graph.d.ts +2 -1
  295. package/dist/harmonic-retrieval.js +1 -1
  296. package/dist/importance.d.ts +2 -1
  297. package/dist/importers/index.d.ts +2 -1
  298. package/dist/importers/test-utils.d.ts +2 -1
  299. package/dist/in-flight-reads.d.ts +2 -1
  300. package/dist/{index-CtmmCJoo.d.ts → index-fdw_oK5a.d.ts} +3 -3
  301. package/dist/index.d.ts +28 -25
  302. package/dist/index.js +183 -162
  303. package/dist/intent.d.ts +2 -1
  304. package/dist/lcm/engine.d.ts +2 -1
  305. package/dist/lcm/engine.js +3 -3
  306. package/dist/lcm/index.d.ts +2 -1
  307. package/dist/lcm/index.js +11 -11
  308. package/dist/lcm/tools.d.ts +2 -1
  309. package/dist/lifecycle.d.ts +2 -1
  310. package/dist/live-connectors-runner.d.ts +2 -1
  311. package/dist/{local-llm-DpXIvm6F.d.ts → local-llm-3-jtw52a.d.ts} +1 -1
  312. package/dist/local-llm-helpers.d.ts +3 -2
  313. package/dist/local-llm.d.ts +3 -2
  314. package/dist/local-model-endpoint.d.ts +2 -1
  315. package/dist/location/index.d.ts +7 -209
  316. package/dist/location/index.js +68 -62
  317. package/dist/maintenance/memory-governance.d.ts +2 -1
  318. package/dist/maintenance/memory-governance.js +13 -13
  319. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +3 -2
  320. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +14 -14
  321. package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
  322. package/dist/maintenance/rebuild-memory-projection.js +15 -15
  323. package/dist/{maintenance-CNgoLsoM.d.ts → maintenance-DgeeH0a1.d.ts} +3 -3
  324. package/dist/mcp-memory-inspector-app.d.ts +18 -15
  325. package/dist/mcp-read-only-tools.js +1 -1
  326. package/dist/memory-action-policy.d.ts +2 -1
  327. package/dist/memory-cache.d.ts +2 -1
  328. package/dist/memory-controller.d.ts +2 -1
  329. package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
  330. package/dist/memory-projection-store.d.ts +2 -1
  331. package/dist/memory-provenance.d.ts +2 -1
  332. package/dist/memory-snapshot.d.ts +2 -1
  333. package/dist/memory-subject-cli.d.ts +16 -13
  334. package/dist/memory-subject.d.ts +16 -13
  335. package/dist/memory-worth-outcomes.d.ts +3 -2
  336. package/dist/models-json.d.ts +2 -1
  337. package/dist/namespaces/migrate.d.ts +4 -3
  338. package/dist/namespaces/migrate.js +14 -14
  339. package/dist/namespaces/principal.d.ts +2 -1
  340. package/dist/namespaces/search.d.ts +2 -1
  341. package/dist/namespaces/search.js +4 -4
  342. package/dist/namespaces/storage.d.ts +4 -3
  343. package/dist/namespaces/storage.js +13 -13
  344. package/dist/native-knowledge.d.ts +2 -1
  345. package/dist/offline-sync-impression-drain.d.ts +2 -1
  346. package/dist/offline-sync-impression-drain.js +5 -5
  347. package/dist/operator-doctor-corpus.d.ts +2 -1
  348. package/dist/operator-doctor-corpus.js +17 -17
  349. package/dist/operator-doctor-replica.d.ts +2 -1
  350. package/dist/operator-toolkit.d.ts +4 -3
  351. package/dist/operator-toolkit.js +29 -28
  352. package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
  353. package/dist/orchestration/maintenance.d.ts +5 -4
  354. package/dist/orchestration/maintenance.js +26 -26
  355. package/dist/{orchestrator-DT7ybIFz.d.ts → orchestrator-VXWKdatm.d.ts} +12 -10
  356. package/dist/orchestrator.d.ts +12 -11
  357. package/dist/orchestrator.js +115 -105
  358. package/dist/patterns-cli.d.ts +2 -1
  359. package/dist/{pipeline-CgBEmHcz.d.ts → pipeline-CwXZBKR5.d.ts} +1 -1
  360. package/dist/policy-runtime.d.ts +2 -1
  361. package/dist/proactive-contention.d.ts +3 -2
  362. package/dist/provenance.d.ts +2 -1
  363. package/dist/{public-http-C8P8fyiO.d.ts → public-http-B55s59aR.d.ts} +1 -1
  364. package/dist/{qmd-BkY8KpCh.d.ts → qmd-DOLTPIQg.d.ts} +1 -1
  365. package/dist/qmd-preflight.d.ts +3 -2
  366. package/dist/qmd-recall-cache.d.ts +2 -1
  367. package/dist/qmd.d.ts +3 -2
  368. package/dist/recall-concurrency-config.d.ts +2 -1
  369. package/dist/recall-disclosure-escalation.d.ts +2 -1
  370. package/dist/recall-explain-renderer.d.ts +2 -1
  371. package/dist/recall-explain-renderer.js +3 -3
  372. package/dist/recall-memory-map.d.ts +2 -1
  373. package/dist/recall-navigate-access.d.ts +2 -1
  374. package/dist/recall-navigate-access.js +2 -2
  375. package/dist/recall-navigate-budget.js +3 -13
  376. package/dist/recall-navigate-budget.js.map +1 -1
  377. package/dist/recall-navigate-disclosure.d.ts +2 -1
  378. package/dist/recall-navigate-disclosure.js +4 -23
  379. package/dist/recall-navigate-disclosure.js.map +1 -1
  380. package/dist/recall-navigate-traverse.js +4 -37
  381. package/dist/recall-navigate-traverse.js.map +1 -1
  382. package/dist/recall-navigate-window.js +4 -26
  383. package/dist/recall-navigate-window.js.map +1 -1
  384. package/dist/recall-navigate.d.ts +2 -1
  385. package/dist/recall-navigate.js +2 -2
  386. package/dist/recall-navigation-config.d.ts +34 -0
  387. package/dist/recall-navigation-config.js +16 -0
  388. package/dist/recall-navigation-config.js.map +1 -0
  389. package/dist/recall-navigation-http-glue.d.ts +171 -0
  390. package/dist/recall-navigation-http-glue.js +9 -0
  391. package/dist/recall-navigation-http-glue.js.map +1 -0
  392. package/dist/recall-navigation-mcp-tools.d.ts +162 -0
  393. package/dist/recall-navigation-mcp-tools.js +8 -0
  394. package/dist/recall-navigation-mcp-tools.js.map +1 -0
  395. package/dist/recall-navigation-operations.d.ts +2 -0
  396. package/dist/recall-navigation-operations.js +245 -0
  397. package/dist/recall-navigation-operations.js.map +1 -0
  398. package/dist/recall-navigation-renderer.d.ts +36 -0
  399. package/dist/recall-navigation-renderer.js +8 -0
  400. package/dist/recall-navigation-renderer.js.map +1 -0
  401. package/dist/recall-navigation.d.ts +121 -0
  402. package/dist/recall-navigation.js +249 -0
  403. package/dist/recall-navigation.js.map +1 -0
  404. package/dist/recall-planner-llm.d.ts +2 -1
  405. package/dist/recall-state-view-admission.d.ts +3 -2
  406. package/dist/recall-state-view-admission.js +4 -4
  407. package/dist/recall-state-view-anchors.d.ts +2 -1
  408. package/dist/recall-state.d.ts +2 -1
  409. package/dist/recall-tag-filter.d.ts +2 -1
  410. package/dist/recall-timings.d.ts +2 -1
  411. package/dist/recall-xray-cli.d.ts +2 -1
  412. package/dist/recall-xray-cli.js +4 -4
  413. package/dist/recall-xray-renderer.d.ts +2 -1
  414. package/dist/recall-xray-renderer.js +3 -3
  415. package/dist/recall-xray.d.ts +3 -2
  416. package/dist/recall-xray.js +2 -2
  417. package/dist/reconcile/cursor.d.ts +2 -1
  418. package/dist/reconcile/manifest.d.ts +2 -1
  419. package/dist/reconcile/plan.d.ts +2 -1
  420. package/dist/replay/normalizers/chatgpt.d.ts +2 -1
  421. package/dist/replay/normalizers/claude.d.ts +2 -1
  422. package/dist/replay/normalizers/openclaw.d.ts +2 -1
  423. package/dist/replay/normalizers/shared.d.ts +2 -1
  424. package/dist/replay/runner.d.ts +2 -1
  425. package/dist/replay/types.d.ts +2 -1
  426. package/dist/replica-divergence.d.ts +2 -1
  427. package/dist/replica-peers-config.d.ts +2 -1
  428. package/dist/resolution-LXFQQ4AE.js +3 -3
  429. package/dist/resolve-auth-token.d.ts +2 -1
  430. package/dist/resume-bundles.js +10 -8
  431. package/dist/retrieval-agents.d.ts +3 -2
  432. package/dist/retrieval-tiers.d.ts +2 -1
  433. package/dist/routing/engine.d.ts +2 -1
  434. package/dist/routing/store.d.ts +2 -1
  435. package/dist/salvage-envelope.d.ts +2 -1
  436. package/dist/schemas.d.ts +2 -2
  437. package/dist/{scope-profiles-BBPjZ9jb.d.ts → scope-profiles-C564-hrv.d.ts} +1 -1
  438. package/dist/search/embed-helper.d.ts +2 -1
  439. package/dist/search/factory.d.ts +2 -1
  440. package/dist/search/factory.js +3 -3
  441. package/dist/search/index.d.ts +2 -1
  442. package/dist/search/index.js +7 -7
  443. package/dist/search/lancedb-backend.d.ts +2 -1
  444. package/dist/search/meilisearch-backend.d.ts +2 -1
  445. package/dist/search/noop-backend.d.ts +2 -1
  446. package/dist/search/orama-backend.d.ts +2 -1
  447. package/dist/search/port.d.ts +2 -1
  448. package/dist/search/remote-backend.d.ts +2 -1
  449. package/dist/{semantic-consolidation-BPFFVO84.d.ts → semantic-consolidation-g6x-ShY8.d.ts} +1 -1
  450. package/dist/semantic-consolidation.d.ts +3 -2
  451. package/dist/semantic-consolidation.js +14 -14
  452. package/dist/semantic-rule-promotion.js +13 -13
  453. package/dist/semantic-rule-verifier.d.ts +2 -1
  454. package/dist/semantic-rule-verifier.js +13 -13
  455. package/dist/{service-jKcr6Jvr.d.ts → service-CaCOk0rd.d.ts} +13 -2
  456. package/dist/session-observer-bands.d.ts +2 -1
  457. package/dist/session-observer-state.d.ts +2 -1
  458. package/dist/shared-context/manager.d.ts +2 -1
  459. package/dist/signal.d.ts +2 -1
  460. package/dist/source-agent-qualifier.d.ts +2 -1
  461. package/dist/source-agent-qualifier.js +20 -20
  462. package/dist/standup/build.js +14 -14
  463. package/dist/{storage-C-0Ah5OY.d.ts → storage-C9nsZX5Q.d.ts} +1 -1
  464. package/dist/storage.d.ts +3 -2
  465. package/dist/storage.js +12 -12
  466. package/dist/subject-config.d.ts +2 -1
  467. package/dist/subject-config.js +2 -2
  468. package/dist/summarizer.d.ts +2 -1
  469. package/dist/summary-snapshot.d.ts +2 -1
  470. package/dist/support-passport/index.d.ts +19 -16
  471. package/dist/support-passport/index.js +51 -43
  472. package/dist/tagging-BA4RFdH3.d.ts +240 -0
  473. package/dist/temporal-supersession.d.ts +3 -2
  474. package/dist/temporal-timeline-recall.d.ts +2 -1
  475. package/dist/temporal-validity.d.ts +2 -1
  476. package/dist/threading.d.ts +2 -1
  477. package/dist/tier-migration.d.ts +3 -2
  478. package/dist/tier-routing.d.ts +2 -1
  479. package/dist/topics.d.ts +2 -1
  480. package/dist/transcript.d.ts +2 -1
  481. package/dist/transfer/backup.js +2 -2
  482. package/dist/transfer/capsule-export.js +2 -2
  483. package/dist/transfer/capsule-import.js +2 -2
  484. package/dist/transfer/export-okf.d.ts +2 -1
  485. package/dist/transfer/export-okf.js +13 -13
  486. package/dist/trust-score-stage.d.ts +2 -1
  487. package/dist/trust-score.d.ts +2 -1
  488. package/dist/{types-cK5LydjL.d.ts → types-Sps-lg5I.d.ts} +3 -2
  489. package/dist/types.d.ts +2 -1
  490. package/dist/types.js +1 -1
  491. package/dist/utility-runtime.d.ts +2 -1
  492. package/dist/verified-recall.js +13 -13
  493. package/dist/who-knows-cli.d.ts +16 -13
  494. package/dist/who-knows-cli.js +14 -14
  495. package/dist/who-knows.d.ts +16 -13
  496. package/dist/who-knows.js +13 -13
  497. package/dist/write-envelope.d.ts +2 -1
  498. package/package.json +2 -2
  499. package/src/access-boundary.ts +2 -0
  500. package/src/access-http.test.ts +1 -0
  501. package/src/access-http.ts +3 -3
  502. package/src/access-mcp-output-schemas.ts +30 -0
  503. package/src/access-mcp.ts +6 -9
  504. package/src/access-observe-write-category.ts +1 -0
  505. package/src/access-observe-write-surface.ts +3 -3
  506. package/src/access-operations-batch.ts +2 -2
  507. package/src/access-operations.ts +2 -0
  508. package/src/access-schema.ts +1 -0
  509. package/src/access-service.ts +17 -28
  510. package/src/access-surface-catalog.test.ts +30 -2
  511. package/src/access-surface-catalog.ts +4 -0
  512. package/src/cli/recall-navigation-commands.ts +85 -0
  513. package/src/cli.ts +2 -2
  514. package/src/config.ts +4 -0
  515. package/src/deep-recall-config.ts +32 -0
  516. package/src/index.ts +1 -2
  517. package/src/location/phase5-wiring.test.ts +408 -0
  518. package/src/location/tagging.ts +58 -0
  519. package/src/mcp-read-only-tools.ts +2 -0
  520. package/src/orchestration/orchestrator-helpers.ts +2 -0
  521. package/src/orchestration/recall-internal.ts +4 -4
  522. package/src/orchestration/workspace-ops.ts +14 -0
  523. package/src/recall-navigation-config.test.ts +56 -0
  524. package/src/recall-navigation-config.ts +107 -0
  525. package/src/recall-navigation-http-glue.ts +141 -0
  526. package/src/recall-navigation-mcp-tools.ts +60 -0
  527. package/src/recall-navigation-operations.ts +111 -0
  528. package/src/recall-navigation-renderer.ts +49 -0
  529. package/src/recall-navigation-surface.test.ts +474 -0
  530. package/src/recall-navigation.test.ts +405 -0
  531. package/src/recall-navigation.ts +429 -0
  532. package/src/recall-xray.ts +1 -1
  533. package/src/types.ts +2 -0
  534. package/src/wearables/pipeline.ts +19 -0
  535. package/src/wearables/service.ts +8 -0
  536. package/dist/chunk-7ZLC4DTZ.js.map +0 -1
  537. package/dist/chunk-DM5CU5J7.js.map +0 -1
  538. package/dist/chunk-EAARGPWI.js.map +0 -1
  539. package/dist/chunk-GMH5QPUU.js.map +0 -1
  540. package/dist/chunk-I46BYY7U.js.map +0 -1
  541. package/dist/chunk-MCMS4VUK.js.map +0 -1
  542. package/dist/chunk-N6XTC56E.js.map +0 -1
  543. package/dist/chunk-NYWCFC3K.js.map +0 -1
  544. package/dist/chunk-QVSRE355.js.map +0 -1
  545. package/dist/chunk-S4MJTIPG.js.map +0 -1
  546. package/dist/chunk-V2TOGJPM.js.map +0 -1
  547. package/dist/chunk-WN2OXGGH.js.map +0 -1
  548. package/dist/chunk-XRS65T4O.js.map +0 -1
  549. /package/dist/{capsule-crypto-YO5QJ6L3.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
  550. /package/dist/{chunk-563X6JJX.js.map → chunk-2HDLDBJW.js.map} +0 -0
  551. /package/dist/{chunk-BXLOS5AJ.js.map → chunk-2NLLXCJG.js.map} +0 -0
  552. /package/dist/{chunk-WBQ4ONQJ.js.map → chunk-2PIC6CEN.js.map} +0 -0
  553. /package/dist/{chunk-54QPOE45.js.map → chunk-2YIUUXNK.js.map} +0 -0
  554. /package/dist/{chunk-AKABVXFS.js.map → chunk-3254BYQV.js.map} +0 -0
  555. /package/dist/{chunk-XCPNH2MG.js.map → chunk-3KJTSCSX.js.map} +0 -0
  556. /package/dist/{chunk-I33QYUAF.js.map → chunk-3YQ7VLP3.js.map} +0 -0
  557. /package/dist/{chunk-JMWUPUE6.js.map → chunk-46FVFU7S.js.map} +0 -0
  558. /package/dist/{chunk-PFKIOYJH.js.map → chunk-4WMGRLTV.js.map} +0 -0
  559. /package/dist/{chunk-KLUC2GSG.js.map → chunk-5AJZ7EUW.js.map} +0 -0
  560. /package/dist/{chunk-Z7NBT6AK.js.map → chunk-6EGIQEKC.js.map} +0 -0
  561. /package/dist/{chunk-6MQMYXSQ.js.map → chunk-7F47R4H4.js.map} +0 -0
  562. /package/dist/{chunk-YFXAWGMR.js.map → chunk-7L54ARML.js.map} +0 -0
  563. /package/dist/{chunk-LVFI5LG7.js.map → chunk-A7GQBJP5.js.map} +0 -0
  564. /package/dist/{chunk-EMSYMYXO.js.map → chunk-AKB44K3D.js.map} +0 -0
  565. /package/dist/{chunk-3BLHPQHT.js.map → chunk-BPXJINHW.js.map} +0 -0
  566. /package/dist/{chunk-D6PY63OM.js.map → chunk-BZDK5EOD.js.map} +0 -0
  567. /package/dist/{chunk-2J3V5QEO.js.map → chunk-C3QXITIP.js.map} +0 -0
  568. /package/dist/{chunk-PLJ2MQFT.js.map → chunk-C3YEB7CR.js.map} +0 -0
  569. /package/dist/{chunk-2ZG2LLZT.js.map → chunk-D7UUB33A.js.map} +0 -0
  570. /package/dist/{chunk-E3I3NDUP.js.map → chunk-DABSYX7V.js.map} +0 -0
  571. /package/dist/{chunk-KJLLPG26.js.map → chunk-DDGQDNQW.js.map} +0 -0
  572. /package/dist/{chunk-K5D2XVNN.js.map → chunk-F2FJTOV6.js.map} +0 -0
  573. /package/dist/{chunk-P66QH6R6.js.map → chunk-GKKLI23D.js.map} +0 -0
  574. /package/dist/{chunk-ICN37XHG.js.map → chunk-GMU7MAHS.js.map} +0 -0
  575. /package/dist/{chunk-PQ42DJNG.js.map → chunk-H2N6SLTR.js.map} +0 -0
  576. /package/dist/{chunk-ND7MAIJC.js.map → chunk-HKQAI6XI.js.map} +0 -0
  577. /package/dist/{chunk-C3G6MW4W.js.map → chunk-IB7FDRRC.js.map} +0 -0
  578. /package/dist/{chunk-WFMQN7JE.js.map → chunk-IWHNT35B.js.map} +0 -0
  579. /package/dist/{chunk-W7UV2ZCA.js.map → chunk-JDL5BYYF.js.map} +0 -0
  580. /package/dist/{chunk-5EQT62HH.js.map → chunk-KDLOKVX7.js.map} +0 -0
  581. /package/dist/{chunk-V62YYBBY.js.map → chunk-KORQWGUA.js.map} +0 -0
  582. /package/dist/{chunk-VDX2J7OX.js.map → chunk-KQAFEZQX.js.map} +0 -0
  583. /package/dist/{chunk-WZIO3TW6.js.map → chunk-KY75VZKG.js.map} +0 -0
  584. /package/dist/{chunk-4IGOLIWM.js.map → chunk-L63M2PE4.js.map} +0 -0
  585. /package/dist/{chunk-PGGPRF6J.js.map → chunk-LD22AAJI.js.map} +0 -0
  586. /package/dist/{chunk-A4OIJYCV.js.map → chunk-LUAQHDUI.js.map} +0 -0
  587. /package/dist/{chunk-DIXZQTGY.js.map → chunk-M6FKXOYV.js.map} +0 -0
  588. /package/dist/{chunk-Z535ADTC.js.map → chunk-M7H56FOQ.js.map} +0 -0
  589. /package/dist/{chunk-JSD7Q7LD.js.map → chunk-MOL7JK4F.js.map} +0 -0
  590. /package/dist/{chunk-ZX6NNFSY.js.map → chunk-OGAKUA7I.js.map} +0 -0
  591. /package/dist/{chunk-KZJM7R4F.js.map → chunk-PF7LQ22G.js.map} +0 -0
  592. /package/dist/{chunk-UZGHKD3T.js.map → chunk-PPDZSJXB.js.map} +0 -0
  593. /package/dist/{chunk-AUSRUOMQ.js.map → chunk-PW4HTWXL.js.map} +0 -0
  594. /package/dist/{chunk-LE2KZ72G.js.map → chunk-QCTXQ2HW.js.map} +0 -0
  595. /package/dist/{chunk-I3H5LFOI.js.map → chunk-QNJQCLI6.js.map} +0 -0
  596. /package/dist/{chunk-46RII65S.js.map → chunk-QUBPZQED.js.map} +0 -0
  597. /package/dist/{chunk-E4LMQTST.js.map → chunk-R3H2AXO2.js.map} +0 -0
  598. /package/dist/{chunk-XVDZFTN5.js.map → chunk-RFIJH2OE.js.map} +0 -0
  599. /package/dist/{chunk-BTPCP535.js.map → chunk-RJ7Z7YXK.js.map} +0 -0
  600. /package/dist/{chunk-TBXAY2SS.js.map → chunk-SGHGCFVV.js.map} +0 -0
  601. /package/dist/{chunk-AIVRD66I.js.map → chunk-T3F2HWIG.js.map} +0 -0
  602. /package/dist/{chunk-WPGA4RYI.js.map → chunk-UCLWIMVW.js.map} +0 -0
  603. /package/dist/{chunk-V2EXYQEQ.js.map → chunk-VHANUT45.js.map} +0 -0
  604. /package/dist/{chunk-AFJHNHAM.js.map → chunk-VJXMFBVR.js.map} +0 -0
  605. /package/dist/{chunk-FGFC2EFR.js.map → chunk-VKDXYEA6.js.map} +0 -0
  606. /package/dist/{chunk-GWNSKQDA.js.map → chunk-W44T2KHG.js.map} +0 -0
  607. /package/dist/{chunk-H3TKENU4.js.map → chunk-WIKO4SCR.js.map} +0 -0
  608. /package/dist/{chunk-DQEMWVMT.js.map → chunk-X7Y7WX73.js.map} +0 -0
  609. /package/dist/{chunk-2HQPE2NM.js.map → chunk-XOCGC3FJ.js.map} +0 -0
  610. /package/dist/{chunk-IYIPXAIJ.js.map → chunk-ZBSP4BSN.js.map} +0 -0
  611. /package/dist/{chunk-VVX5PZFS.js.map → chunk-ZHXSOMYH.js.map} +0 -0
@@ -0,0 +1,30 @@
1
+ import {
2
+ RECALL_DISCLOSURE_LEVELS,
3
+ isRecallDisclosure
4
+ } from "./chunk-66YUOI53.js";
5
+
6
+ // src/recall-navigate-disclosure.ts
7
+ function disclosureRank(level) {
8
+ const index = RECALL_DISCLOSURE_LEVELS.indexOf(level);
9
+ if (index < 0) {
10
+ throw new RangeError(
11
+ `unknown disclosure level ${JSON.stringify(level)}; expected one of ${RECALL_DISCLOSURE_LEVELS.join(", ")}`
12
+ );
13
+ }
14
+ return index;
15
+ }
16
+ function planDisclosureStep(input) {
17
+ if (!isRecallDisclosure(input.from) || !isRecallDisclosure(input.to)) {
18
+ return { ok: false, error: "unknown_level" };
19
+ }
20
+ const fromRank = disclosureRank(input.from);
21
+ const toRank = disclosureRank(input.to);
22
+ if (toRank <= fromRank) return { ok: false, error: "not_deeper" };
23
+ return { ok: true, from: input.from, to: input.to, steps: toRank - fromRank };
24
+ }
25
+
26
+ export {
27
+ disclosureRank,
28
+ planDisclosureStep
29
+ };
30
+ //# sourceMappingURL=chunk-AS2NOPDM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/recall-navigate-disclosure.ts"],"sourcesContent":["/**\n * Disclosure-step planning for recall navigation (issue #1956).\n *\n * The ladder itself is NOT redefined here: `types.ts` designates\n * `RECALL_DISCLOSURE_LEVELS` the single source of truth and forbids\n * hard-coding disclosure strings elsewhere, so a second copy could drift out\n * of agreement with recall validation and rendering. This module only adds\n * the rule that an expansion must go strictly deeper, so a caller cannot\n * re-pay recall budget for output it already holds. Pure — no I/O.\n */\n\nimport {\n isRecallDisclosure,\n RECALL_DISCLOSURE_LEVELS,\n type RecallDisclosure,\n} from \"./types.js\";\n\nexport type DisclosureStepResult =\n | { ok: true; from: RecallDisclosure; to: RecallDisclosure; steps: number }\n | { ok: false; error: \"unknown_level\" | \"not_deeper\" };\n\n/** Index in the canonical shallow-to-deep ladder. Throws for a non-level. */\nexport function disclosureRank(level: string): number {\n const index = (RECALL_DISCLOSURE_LEVELS as readonly string[]).indexOf(level);\n if (index < 0) {\n throw new RangeError(\n `unknown disclosure level ${JSON.stringify(level)}; expected one of ${RECALL_DISCLOSURE_LEVELS.join(\", \")}`,\n );\n }\n return index;\n}\n\n/**\n * Plan one expansion. A bad level from an agent is a typed refusal rather\n * than a throw; equal or shallower targets are `not_deeper`.\n */\nexport function planDisclosureStep(input: { from: string; to: string }): DisclosureStepResult {\n if (!isRecallDisclosure(input.from) || !isRecallDisclosure(input.to)) {\n return { ok: false, error: \"unknown_level\" };\n }\n const fromRank = disclosureRank(input.from);\n const toRank = disclosureRank(input.to);\n if (toRank <= fromRank) return { ok: false, error: \"not_deeper\" };\n return { ok: true, from: input.from, to: input.to, steps: toRank - fromRank };\n}\n"],"mappings":";;;;;;AAsBO,SAAS,eAAe,OAAuB;AACpD,QAAM,QAAS,yBAA+C,QAAQ,KAAK;AAC3E,MAAI,QAAQ,GAAG;AACb,UAAM,IAAI;AAAA,MACR,4BAA4B,KAAK,UAAU,KAAK,CAAC,qBAAqB,yBAAyB,KAAK,IAAI,CAAC;AAAA,IAC3G;AAAA,EACF;AACA,SAAO;AACT;AAMO,SAAS,mBAAmB,OAA2D;AAC5F,MAAI,CAAC,mBAAmB,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,EAAE,GAAG;AACpE,WAAO,EAAE,IAAI,OAAO,OAAO,gBAAgB;AAAA,EAC7C;AACA,QAAM,WAAW,eAAe,MAAM,IAAI;AAC1C,QAAM,SAAS,eAAe,MAAM,EAAE;AACtC,MAAI,UAAU,SAAU,QAAO,EAAE,IAAI,OAAO,OAAO,aAAa;AAChE,SAAO,EAAE,IAAI,MAAM,MAAM,MAAM,MAAM,IAAI,MAAM,IAAI,OAAO,SAAS,SAAS;AAC9E;","names":[]}
@@ -1,13 +1,13 @@
1
- import {
2
- tagPersistedMemories
3
- } from "./chunk-6P4REYKL.js";
4
1
  import {
5
2
  raceRecallAbort,
6
3
  throwIfRecallAborted
7
- } from "./chunk-7ZLC4DTZ.js";
4
+ } from "./chunk-F6PTJLEM.js";
8
5
  import {
9
6
  classifyOrigin
10
7
  } from "./chunk-6Q3ZTEF6.js";
8
+ import {
9
+ tagPersistedMemories
10
+ } from "./chunk-UDAUULK2.js";
11
11
  import {
12
12
  resolveScopeProfilePlan
13
13
  } from "./chunk-MNIPH6LD.js";
@@ -1081,4 +1081,4 @@ export {
1081
1081
  ExtractionDeadlineError,
1082
1082
  ExtractionRunCoordinator
1083
1083
  };
1084
- //# sourceMappingURL=chunk-3BLHPQHT.js.map
1084
+ //# sourceMappingURL=chunk-BPXJINHW.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isNamespaceKind
3
- } from "./chunk-P66QH6R6.js";
3
+ } from "./chunk-GKKLI23D.js";
4
4
  import {
5
5
  EngramAccessInputError
6
6
  } from "./chunk-2Z24E5W2.js";
@@ -40,4 +40,4 @@ export {
40
40
  positiveIntQueryParam,
41
41
  optionalNamespaceKindQueryParam
42
42
  };
43
- //# sourceMappingURL=chunk-D6PY63OM.js.map
43
+ //# sourceMappingURL=chunk-BZDK5EOD.js.map
@@ -2,12 +2,12 @@ import {
2
2
  buildCodingGraphInstallHint,
3
3
  tryLoadCodingGraphModule
4
4
  } from "./chunk-VQ7B2Q6M.js";
5
- import {
6
- composeMemoryEnvelope
7
- } from "./chunk-GDYU6VF4.js";
8
5
  import {
9
6
  isCodingKnowledgeFeatureEnabled
10
7
  } from "./chunk-FEHIOYML.js";
8
+ import {
9
+ composeMemoryEnvelope
10
+ } from "./chunk-GDYU6VF4.js";
11
11
  import {
12
12
  displayErrorDetail
13
13
  } from "./chunk-RL6NEVXT.js";
@@ -1463,4 +1463,4 @@ export {
1463
1463
  serializeDecisionRecord,
1464
1464
  parseDecisionRecord
1465
1465
  };
1466
- //# sourceMappingURL=chunk-2J3V5QEO.js.map
1466
+ //# sourceMappingURL=chunk-C3QXITIP.js.map
@@ -1,9 +1,3 @@
1
- import {
2
- MeilisearchBackend
3
- } from "./chunk-KVO2BTA4.js";
4
- import {
5
- NoopSearchBackend
6
- } from "./chunk-CYEPCZN5.js";
7
1
  import {
8
2
  OramaBackend
9
3
  } from "./chunk-G6NQ3L4T.js";
@@ -16,6 +10,12 @@ import {
16
10
  import {
17
11
  LanceDbBackend
18
12
  } from "./chunk-D7MAYFQP.js";
13
+ import {
14
+ MeilisearchBackend
15
+ } from "./chunk-KVO2BTA4.js";
16
+ import {
17
+ NoopSearchBackend
18
+ } from "./chunk-CYEPCZN5.js";
19
19
  import {
20
20
  createConversationIndexBackend
21
21
  } from "./chunk-TFA6HPOA.js";
@@ -179,4 +179,4 @@ export {
179
179
  createConversationSearchBackend,
180
180
  createConversationIndexRuntime
181
181
  };
182
- //# sourceMappingURL=chunk-PLJ2MQFT.js.map
182
+ //# sourceMappingURL=chunk-C3YEB7CR.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isValidCapsuleSince
3
- } from "./chunk-VDX2J7OX.js";
3
+ } from "./chunk-KQAFEZQX.js";
4
4
  import {
5
5
  CAPSULE_ID_PATTERN
6
6
  } from "./chunk-WEHSQBFR.js";
@@ -356,6 +356,7 @@ var lcmCompactionRecordRequestSchema = z.object({
356
356
  });
357
357
  var daySummaryRequestSchema = z.object({
358
358
  memories: z.string().max(1e5).optional(),
359
+ includeLocation: z.boolean().optional(),
359
360
  sessionKey: sessionKeySchema,
360
361
  namespace: namespaceSchema,
361
362
  timeZone: timeZoneSchema.optional()
@@ -558,4 +559,4 @@ export {
558
559
  actionConfidenceRequestSchema,
559
560
  validateRequest
560
561
  };
561
- //# sourceMappingURL=chunk-DM5CU5J7.js.map
562
+ //# sourceMappingURL=chunk-CRK6F6N3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/access-schema.ts"],"sourcesContent":["// Request/response schema validation for the Remnic HTTP API.\n// Uses zod for runtime validation — returns structured 400 errors with\n// field-level detail so consumers get clear feedback on malformed requests.\n\nimport { z } from \"zod\";\n\nimport type { MemoryCategory } from \"./types.js\";\nimport {\n ACTION_CONFIDENCE_CONTEXT_READINESS,\n ACTION_CONFIDENCE_RISK_CATEGORIES,\n ACTION_CONFIDENCE_RULE_KINDS,\n} from \"./action-confidence.js\";\nimport { isValidCapsuleSince } from \"./transfer/capsule-export.js\";\nimport { validateArchiveRelativePath } from \"./transfer/fs-utils.js\";\nimport { CAPSULE_ID_PATTERN } from \"./transfer/types.js\";\nimport {\n OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES,\n OFFLINE_SYNC_MAX_MTIME_MS,\n} from \"./offline-sync.js\";\n\n// ---------------------------------------------------------------------------\n// Error formatting\n// ---------------------------------------------------------------------------\n\nexport interface SchemaValidationError {\n error: string;\n code: \"validation_error\";\n details: Array<{ field: string; message: string }>;\n}\n\nexport function formatZodError(error: z.ZodError): SchemaValidationError {\n return {\n error: \"request validation failed\",\n code: \"validation_error\",\n details: error.issues.map((issue) => ({\n field: issue.path.join(\".\") || \"(root)\",\n message: issue.message,\n })),\n };\n}\n\n// ---------------------------------------------------------------------------\n// Shared fields\n// ---------------------------------------------------------------------------\n\nconst namespaceSchema = z.string().trim().max(256).optional();\nconst sessionKeySchema = z.string().trim().min(1).max(512).optional();\nconst idempotencyKeySchema = z.string().trim().min(1).max(256).optional();\nconst cwdSchema = z.string().trim().min(1, \"cwd must be non-empty when provided\").max(2048).optional();\nconst projectTagSchema = z\n .string()\n .trim()\n .min(1, \"projectTag must be non-empty when provided\")\n .max(256)\n .optional();\nconst deadlineMsSchema = z.number().finite().min(0).max(Number.MAX_SAFE_INTEGER).optional();\nconst dryRunSchema = z.boolean().optional();\nconst schemaVersionSchema = z.number().int().optional();\nconst timeZoneSchema = z\n .string()\n .trim()\n .min(1)\n .max(128)\n .refine((value) => {\n try {\n Intl.DateTimeFormat(undefined, { timeZone: value });\n return true;\n } catch {\n return false;\n }\n }, \"must be a valid IANA timezone\");\n\n// ---------------------------------------------------------------------------\n// Recall\n// ---------------------------------------------------------------------------\n\n/**\n * Coding-agent context (issue #569). Optional payload that connectors may\n * ship with a recall request so the project/branch namespace overlay\n * applies to that recall. All fields are validated per CLAUDE.md #51 —\n * empty-string projectId / rootPath is rejected, not silently accepted.\n */\nexport const codingContextSchema = z\n .object({\n projectId: z.string().trim().min(1, \"codingContext.projectId is required\").max(128),\n branch: z.string().trim().max(256).nullable(),\n rootPath: z.string().trim().min(1, \"codingContext.rootPath is required\").max(1024),\n defaultBranch: z.string().trim().max(256).nullable(),\n })\n .nullable();\n\n/**\n * Recall disclosure depth (issue #677). Mirrors the `RecallDisclosure`\n * type in `types.ts` — keep these in sync. Default-application happens\n * inside `EngramAccessService.recall()`; the schema only accepts/rejects.\n * Invalid values throw a structured 400 instead of silently defaulting,\n * per CLAUDE.md rule 51.\n */\nexport const recallDisclosureSchema = z.enum([\"chunk\", \"section\", \"raw\"]);\n\n/**\n * Tag-match semantics (issue #689). `any` (default when `tags` is provided\n * and `tagMatch` is omitted) admits a result when it carries at least one\n * of the filter tags. `all` requires every filter tag to be present.\n * Schema rejects unknown values up front — never silently defaults\n * (CLAUDE.md rule 51).\n */\nexport const tagMatchSchema = z.enum([\"any\", \"all\"]);\n\nexport const recallRequestSchema = z.object({\n query: z.string().min(1, \"query is required\"),\n sessionKey: sessionKeySchema,\n namespace: namespaceSchema,\n topK: z.number().int().min(0).max(200).optional(),\n mode: z.enum([\"auto\", \"no_recall\", \"minimal\", \"full\", \"graph_mode\"]).optional(),\n includeDebug: z.boolean().optional(),\n idempotencyKey: idempotencyKeySchema,\n disclosure: recallDisclosureSchema.optional(),\n codingContext: codingContextSchema.optional(),\n /** Working directory for auto git-context resolution (issue #569). */\n cwd: cwdSchema,\n /**\n * Arbitrary project tag for non-git-based project scoping (issue #569).\n * Creates a coding context with `projectId: \"tag:<projectTag>\"`.\n */\n projectTag: projectTagSchema,\n /**\n * Historical recall pin (issue #680). ISO 8601 timestamp. The\n * schema only enforces the basic shape; the access service runs\n * `Date.parse` and emits a structured 400 on malformed input\n * (CLAUDE.md rule 51).\n */\n asOf: z.string().trim().min(1, \"asOf must be a non-empty ISO 8601 timestamp\").max(64).optional(),\n /**\n * Free-form recall tag filter (issue #689). When provided, recall results\n * whose frontmatter `tags` do not match the filter are removed before the\n * response is returned. Comparison is case-sensitive exact match.\n */\n tags: z.array(z.string().trim().min(1).max(256)).max(50).optional(),\n /**\n * Match mode for `tags` (issue #689). Defaults to `\"any\"` when `tags` is\n * provided and `tagMatch` is omitted. Ignored when `tags` is absent.\n */\n tagMatch: tagMatchSchema.optional(),\n /**\n * Include graph edges below `graphTraversalConfidenceFloor` for diagnostic\n * recall traversal (issue #681). Defaults to false.\n */\n includeLowConfidence: z.boolean().optional(),\n /**\n * #1952 — per-call opt-in to state-aware recall views for this recall.\n * ORs with the `recallStateViews` config flag; a change-intent query\n * (e.g. \"when did\", \"used to\", \"switched\") is still required for any\n * effect, so this can never perturb ordinary recalls.\n */\n stateView: z.boolean().optional(),\n});\n\nexport const recallExplainRequestSchema = z.object({\n sessionKey: sessionKeySchema,\n namespace: namespaceSchema,\n});\n\n/**\n * Standalone \"set coding context\" request. Used by the HTTP endpoint\n * `POST /engram/v1/coding-context` and the MCP `remnic.set_coding_context`\n * tool (PR 7). `codingContext: null` clears the attached context.\n */\nexport const setCodingContextRequestSchema = z\n .object({\n sessionKey: z.string().trim().min(1, \"sessionKey is required\").max(512),\n codingContext: codingContextSchema.optional(),\n /**\n * Project tag shorthand for non-git-based project scoping. When\n * `codingContext` is omitted, this becomes\n * `{ projectId: \"tag:<projectTag>\", branch: null, rootPath: \"tag:<projectTag>\", defaultBranch: null }`.\n */\n projectTag: z.string().trim().min(1, \"projectTag must be non-empty when provided\").max(256).optional(),\n })\n .superRefine((value, ctx) => {\n if (value.codingContext === undefined && value.projectTag === undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"codingContext or projectTag is required\",\n path: [\"codingContext\"],\n });\n }\n });\n\n// ---------------------------------------------------------------------------\n// Observe\n// ---------------------------------------------------------------------------\n\nconst messageSchema = z.object({\n role: z.enum([\"user\", \"assistant\"]),\n content: z.string().min(1, \"message content must be non-empty\"),\n sourceFormat: z\n .enum([\"openai\", \"anthropic\", \"openclaw\", \"pi\", \"lossless-claw\", \"remnic\"])\n .nullable()\n .optional(),\n rawContent: z.unknown().nullable().optional(),\n parts: z\n .array(\n z.object({\n ordinal: z.number().int().min(0).nullable().optional(),\n kind: z.enum([\n \"text\",\n \"tool_call\",\n \"tool_result\",\n \"patch\",\n \"file_read\",\n \"file_write\",\n \"step_start\",\n \"step_finish\",\n \"snapshot\",\n \"retry\",\n ]),\n payload: z.record(z.string(), z.unknown()),\n toolName: z.string().nullable().optional(),\n tool_name: z.string().nullable().optional(),\n filePath: z.string().nullable().optional(),\n file_path: z.string().nullable().optional(),\n createdAt: z.string().nullable().optional(),\n created_at: z.string().nullable().optional(),\n }),\n )\n .nullable()\n .optional(),\n});\n\nexport const observeRequestSchema = z.object({\n sessionKey: z.string().trim().min(1, \"sessionKey is required\").max(512),\n messages: z.array(messageSchema).min(1, \"messages must be a non-empty array\"),\n namespace: namespaceSchema,\n skipExtraction: z.boolean().optional(),\n /**\n * Optional idempotency key for server-side dedup of retried observe POSTs\n * (issue #1649). A retry that reaches the daemon after the first attempt\n * already processed is replayed from cache instead of re-ingested. When the\n * key is reused with a DIFFERENT payload the request is rejected as a\n * conflict (same contract as memory_store/suggestion_submit).\n */\n idempotencyKey: idempotencyKeySchema,\n /** Working directory for auto git-context resolution (issue #569). */\n cwd: cwdSchema,\n /**\n * Arbitrary project tag for non-git-based project scoping (issue #569).\n * Creates a coding context with `projectId: \"tag:<projectTag>\"`.\n */\n projectTag: projectTagSchema,\n});\n\n// ---------------------------------------------------------------------------\n// Deep recall (issue #2332)\n// ---------------------------------------------------------------------------\n\nexport const deepRecallRequestSchema = z.object({\n query: z.string().trim().min(1, \"query is required\").max(2000),\n /** Optional policy-step ceiling; validated against the configured maximum in the service. */\n maxSteps: z.union([z.number().int().min(0), z.string()]).optional(),\n namespace: namespaceSchema,\n sessionKey: z.string().optional(),\n});\n\n// ---------------------------------------------------------------------------\n// Memory store / suggestion submit\n// ---------------------------------------------------------------------------\n\nconst writeContentSchema = z.string().min(1, \"content is required\").max(50000);\n// ---------------------------------------------------------------------------\n// Category wire contract (issue #2829): truthful input/output modeling.\n// ---------------------------------------------------------------------------\n\n/** Canonical input spellings — exactly the `MemoryCategory` union. */\nconst MEMORY_CATEGORY_CANONICAL_INPUT = [\n \"fact\", \"preference\", \"correction\", \"entity\", \"decision\",\n \"relationship\", \"principle\", \"commitment\", \"moment\", \"skill\", \"rule\", \"procedure\",\n \"reasoning_trace\",\n] as const satisfies readonly MemoryCategory[];\n\n/**\n * Compatibility alias spellings admitted on input. The four project-shaped\n * categories fleet telemetry actually shows do not exist in the taxonomy;\n * they parse to the canonical \"fact\". Exact match only — no trimming, no\n * case folding, so near-misses like `projection` or `Project_State` reject\n * like any other invalid category, with the full valid list in the error.\n */\nconst MEMORY_CATEGORY_ALIAS_INPUT = [\n \"project\",\n \"project_state\",\n \"project-state\",\n \"project_update\",\n] as const;\n\nexport type MemoryCategoryAlias = (typeof MEMORY_CATEGORY_ALIAS_INPUT)[number];\n\nconst MEMORY_CATEGORY_ALIAS_TO_CANONICAL: Readonly<\n Record<MemoryCategoryAlias, Extract<MemoryCategory, \"fact\">>\n> = {\n project: \"fact\",\n project_state: \"fact\",\n \"project-state\": \"fact\",\n project_update: \"fact\",\n};\n\nexport function isMemoryCategoryAlias(value: string): value is MemoryCategoryAlias {\n return Object.prototype.hasOwnProperty.call(MEMORY_CATEGORY_ALIAS_TO_CANONICAL, value);\n}\n\n/** Coercion diagnostic for a write whose input category was a compat alias. */\nexport interface CategoryAliasCoercion {\n from: MemoryCategoryAlias;\n to: \"fact\";\n}\n\n/** Boundary-derived coercion note for a retained raw spelling. */\nexport function categoryAliasCoercion(rawCategory: string | undefined): CategoryAliasCoercion | undefined {\n return rawCategory !== undefined && isMemoryCategoryAlias(rawCategory)\n ? { from: rawCategory, to: \"fact\" }\n : undefined;\n}\n\n/**\n * Recover the retained alias spelling from a pre-parse raw envelope: the\n * `rawCategory` minted by a previous parse of the same schema (the HTTP/MCP\n * validate-then-dispatch double pass), or — for single-parse callers like the\n * CLI store command — the as-yet-untransformed alias still sitting on\n * `category` (issue #2889). A minted `rawCategory` always wins: it names the\n * spelling the transform actually canonicalized.\n */\nexport function retainedCategoryAlias(rawInput: unknown): MemoryCategoryAlias | undefined {\n if (!rawInput || typeof rawInput !== \"object\") return undefined;\n const envelope = rawInput as Record<string, unknown>;\n const minted = envelope.rawCategory;\n if (typeof minted === \"string\" && isMemoryCategoryAlias(minted)) return minted;\n const category = envelope.category;\n return typeof category === \"string\" && isMemoryCategoryAlias(category) ? category : undefined;\n}\n\n/**\n * An idempotent replay returns the FIRST request's stored response, whose\n * coercion note names that request's spelling. Rewrite the note from the\n * CURRENT request's retained spelling so every response identifies what its\n * caller actually sent; the stored idempotent result is reused untouched.\n */\nexport function reapplyCategoryCoercion<T extends object>(\n response: T,\n categoryCoercion: CategoryAliasCoercion | undefined,\n): T & { categoryCoercion?: CategoryAliasCoercion } {\n const restamped: T & { categoryCoercion?: CategoryAliasCoercion } = { ...response };\n if (categoryCoercion !== undefined) {\n restamped.categoryCoercion = categoryCoercion;\n } else {\n delete restamped.categoryCoercion;\n }\n return restamped;\n}\n\nconst categoryWireSchema = z.enum(\n [...MEMORY_CATEGORY_CANONICAL_INPUT, ...MEMORY_CATEGORY_ALIAS_INPUT],\n {\n errorMap: () => ({\n message:\n `category must be one of: ${[...MEMORY_CATEGORY_CANONICAL_INPUT, ...MEMORY_CATEGORY_ALIAS_INPUT].join(\", \")}; ` +\n 'for project state/facts use \"fact\"',\n }),\n },\n);\n\nconst confidenceSchema = z.number().min(0).max(1).optional();\nconst tagsSchema = z.array(z.string().max(256)).max(50).optional();\nconst entityRefSchema = z.string().trim().max(512).optional();\nconst ttlSchema = z.string().trim().max(128).optional();\nconst sourceReasonSchema = z.string().trim().max(2000).optional();\n\nconst memoryStoreRequestShape = z.object({\n schemaVersion: schemaVersionSchema,\n idempotencyKey: idempotencyKeySchema,\n dryRun: dryRunSchema,\n sessionKey: sessionKeySchema,\n content: writeContentSchema,\n category: categoryWireSchema.optional(),\n confidence: confidenceSchema,\n namespace: namespaceSchema,\n tags: tagsSchema,\n entityRef: entityRefSchema,\n ttl: ttlSchema,\n sourceReason: sourceReasonSchema,\n // Git/project context for project-scoped writes (#1434). When no explicit\n // `namespace` is given, these route the write to the same project namespace\n // recall/observe resolve from `cwd`/`projectTag` (issue #569, rule 42). Also\n // lets MCP clients that auto-inject `cwd` (e.g. Pi MCPorter) call write tools.\n cwd: cwdSchema,\n projectTag: projectTagSchema,\n});\n\n/**\n * Parsed memory-store request (issue #2829): the category transform maps\n * compat aliases to the canonical \"fact\" DURING parsing, so the output type\n * stays the finite `MemoryCategory` union — never an alias spelling. The raw\n * spelling travels separately on `rawCategory`, minted only by the transform\n * (zod strips it from client bodies), for the write surface's coercion note\n * and idempotent-replay rebuild.\n */\nexport type MemoryStoreParsedRequest = Omit<z.infer<typeof memoryStoreRequestShape>, \"category\"> & {\n category?: MemoryCategory;\n rawCategory?: MemoryCategoryAlias;\n};\n\nexport const memoryStoreRequestSchema = memoryStoreRequestShape.transform(\n (request): MemoryStoreParsedRequest => {\n if (request.category === undefined || !isMemoryCategoryAlias(request.category)) {\n // Spread so the narrowed canonical category, not the wide wire union,\n // becomes the output type.\n return { ...request, category: request.category };\n }\n return {\n ...request,\n category: MEMORY_CATEGORY_ALIAS_TO_CANONICAL[request.category],\n rawCategory: request.category,\n };\n },\n);\n\nexport const suggestionSubmitRequestSchema = memoryStoreRequestSchema;\n\n// ---------------------------------------------------------------------------\n// Review disposition\n// ---------------------------------------------------------------------------\n\nexport const reviewDispositionRequestSchema = z.object({\n memoryId: z.string().trim().min(1, \"memoryId is required\"),\n status: z.enum([\n \"active\", \"pending_review\", \"quarantined\", \"rejected\", \"superseded\", \"archived\",\n ]),\n reasonCode: z.string().trim().min(1, \"reasonCode is required\"),\n namespace: namespaceSchema,\n});\n\n// ---------------------------------------------------------------------------\n// Trust-zone promote\n// ---------------------------------------------------------------------------\n\nexport const trustZonePromoteRequestSchema = z.object({\n recordId: z.string().trim().min(1, \"recordId is required\"),\n targetZone: z.enum([\"working\", \"trusted\"], {\n errorMap: () => ({ message: \"targetZone must be 'working' or 'trusted'\" }),\n }),\n promotionReason: z.string().trim().min(1, \"promotionReason is required\"),\n recordedAt: z.string().trim().optional(),\n summary: z.string().trim().max(5000).optional(),\n dryRun: dryRunSchema,\n namespace: namespaceSchema,\n});\n\n// ---------------------------------------------------------------------------\n// Trust-zone demo-seed\n// ---------------------------------------------------------------------------\n\nexport const trustZoneDemoSeedRequestSchema = z.object({\n scenario: z.string().trim().max(256).optional(),\n recordedAt: z.string().trim().optional(),\n dryRun: dryRunSchema,\n namespace: namespaceSchema,\n});\n\n// ---------------------------------------------------------------------------\n// LCM search\n// ---------------------------------------------------------------------------\n\nexport const lcmSearchRequestSchema = z.object({\n query: z.string().min(1, \"query is required\"),\n sessionKey: sessionKeySchema,\n sessionPrefix: z.string().trim().min(1).max(512).optional(),\n namespace: namespaceSchema,\n limit: z.number().int().min(1).max(100).optional(),\n});\n\nexport const lcmCompactionFlushRequestSchema = z\n .object({\n sessionKey: z.string().trim().min(1, \"sessionKey is required\").max(512),\n namespace: namespaceSchema,\n cwd: cwdSchema,\n projectTag: projectTagSchema,\n /**\n * Optional multi-namespace flush used by delegate lifecycle replay. The\n * server handles the whole list as one quota-counted write.\n */\n namespaces: z.array(z.string().trim().max(256)).min(1).max(64).optional(),\n })\n .superRefine((value, ctx) => {\n if (value.namespace !== undefined && value.namespaces !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"namespace and namespaces are mutually exclusive\",\n path: [\"namespaces\"],\n });\n }\n if (\n value.namespaces !== undefined &&\n new Set(value.namespaces).size !== value.namespaces.length\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"namespaces must not contain duplicates\",\n path: [\"namespaces\"],\n });\n }\n });\n\nexport const extractionForceFlushRequestSchema = z.object({\n sessionKey: z.string().trim().min(1, \"sessionKey is required\").max(512),\n namespace: namespaceSchema,\n cwd: cwdSchema,\n projectTag: projectTagSchema,\n deadlineMs: deadlineMsSchema,\n});\n\nexport const lcmCompactionRecordRequestSchema = z.object({\n sessionKey: z.string().trim().min(1, \"sessionKey is required\").max(512),\n namespace: namespaceSchema,\n tokensBefore: z.number().int().min(0, \"tokensBefore must be a non-negative integer\"),\n tokensAfter: z.number().int().min(0, \"tokensAfter must be a non-negative integer\"),\n});\n\n// ---------------------------------------------------------------------------\n// Day summary\n// ---------------------------------------------------------------------------\n\nexport const daySummaryRequestSchema = z.object({\n memories: z.string().max(100000).optional(),\n includeLocation: z.boolean().optional(),\n sessionKey: sessionKeySchema,\n namespace: namespaceSchema,\n timeZone: timeZoneSchema.optional(),\n});\n\n// ---------------------------------------------------------------------------\n// Capsule export\n// ---------------------------------------------------------------------------\n\nconst capsuleTopLevelSegmentSchema = z\n .string()\n .trim()\n .min(1)\n .max(128)\n .refine(\n (value) => !value.includes(\"/\") && !value.includes(\"\\\\\"),\n \"must be a top-level directory name without path separators\",\n );\n\nconst capsulePeerIdSchema = z\n .string()\n .trim()\n .min(1)\n .max(256)\n .refine(\n (value) => value !== \".\" && value !== \"..\" && !value.includes(\"/\") && !value.includes(\"\\\\\"),\n \"must be a plain peer id without path separators\",\n );\n\nconst capsuleIsoSinceSchema = z\n .string()\n .trim()\n .min(1, \"since must be a non-empty ISO 8601 timestamp\")\n .max(128)\n .refine(\n isValidCapsuleSince,\n \"since must be a valid ISO 8601 timestamp with no calendar overflow\",\n );\n\nexport const capsuleExportRequestSchema = z\n .object({\n name: z\n .string()\n .trim()\n .min(1, \"name is required\")\n .max(64, \"name must be 64 characters or fewer\")\n .regex(\n CAPSULE_ID_PATTERN,\n \"name must be alphanumeric with single dashes (no spaces, no leading/trailing dashes)\",\n ),\n namespace: namespaceSchema,\n since: capsuleIsoSinceSchema.optional(),\n includeKinds: z.array(capsuleTopLevelSegmentSchema).max(50).optional(),\n peerIds: z.array(capsulePeerIdSchema).max(100).optional(),\n includeTranscripts: z.boolean().optional(),\n encrypt: z.boolean().optional(),\n });\n\nexport const capsuleImportRequestSchema = z\n .object({\n archivePath: z.string().trim().min(1, \"archivePath is required\").max(4096),\n namespace: namespaceSchema,\n mode: z.enum([\"skip\", \"overwrite\", \"fork\"]).optional(),\n passphrase: z.string().min(1, \"passphrase must not be empty\").max(4096).optional(),\n });\n\nexport const capsuleListRequestSchema = z\n .object({\n namespace: namespaceSchema,\n sessionKey: sessionKeySchema,\n });\n\n// ---------------------------------------------------------------------------\n// Offline sync\n// ---------------------------------------------------------------------------\n\nfunction isValidOfflineSyncPath(value: string): boolean {\n try {\n validateArchiveRelativePath(value, \"path\");\n return true;\n } catch {\n return false;\n }\n}\n\nconst offlineSyncPathSchema = z\n .string()\n .trim()\n .min(1, \"path must be non-empty\")\n .max(4096)\n .refine(\n isValidOfflineSyncPath,\n \"path must be a POSIX relative path without unsafe segments\",\n );\n\nconst offlineSyncFileStateSchema = z.object({\n path: offlineSyncPathSchema,\n sha256: z.string().regex(/^[a-f0-9]{64}$/i, \"sha256 must be a 64-character hex digest\"),\n bytes: z.number().int().min(0),\n mtimeMs: z.number().finite().min(0).max(OFFLINE_SYNC_MAX_MTIME_MS),\n});\n\nconst offlineSyncBaseCapturedAtSchema = z\n .string()\n .trim()\n .min(1, \"baseCapturedAt must be non-empty when provided\")\n .max(64)\n .refine((value) => Number.isFinite(Date.parse(value)), {\n message: \"baseCapturedAt must be a valid ISO 8601 timestamp\",\n });\n\nexport const offlineSyncSnapshotRequestSchema = z.object({\n namespace: namespaceSchema,\n includeTranscripts: z.boolean().optional(),\n includeContent: z.boolean().optional(),\n baseCapturedAt: offlineSyncBaseCapturedAtSchema.optional(),\n baseFiles: z\n .array(offlineSyncFileStateSchema)\n .max(300_000, \"baseFiles must contain 300000 or fewer entries\")\n .optional(),\n});\n\nexport const offlineSyncApplyRequestSchema = z\n .object({\n namespace: namespaceSchema,\n changeset: z.unknown(),\n returnCurrentFiles: z.boolean().optional(),\n })\n .refine((value) => value.changeset !== undefined && value.changeset !== null, {\n message: \"changeset is required\",\n path: [\"changeset\"],\n });\n\nexport const offlineSyncFilesRequestSchema = z.object({\n namespace: namespaceSchema,\n includeTranscripts: z.boolean().optional(),\n paths: z\n .array(offlineSyncPathSchema)\n .max(5000, \"paths must contain 5000 or fewer entries\"),\n});\n\nexport const offlineSyncFileContentRequestSchema = z.object({\n namespace: namespaceSchema,\n includeTranscripts: z.boolean().optional(),\n path: offlineSyncPathSchema,\n offset: z.number().int().min(0).optional(),\n length: z.number().int().min(1).max(OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES).optional(),\n});\n\n// ---------------------------------------------------------------------------\n// Action confidence\n// ---------------------------------------------------------------------------\n\nconst nullableOptional = <T extends z.ZodTypeAny>(schema: T) =>\n schema.optional().nullable().transform((value) => value ?? undefined);\n\nconst actionConfidenceRuleSchema = z\n .object({\n kind: z.enum(ACTION_CONFIDENCE_RULE_KINDS),\n description: nullableOptional(z.string().trim().min(1).max(2000)),\n matched: nullableOptional(z.boolean()),\n })\n .strict();\n\nconst actionConfidenceMemorySchema = z\n .object({\n source: nullableOptional(z.string().trim().min(1).max(256)),\n created: nullableOptional(z.string().trim().min(1).max(128)),\n updated: nullableOptional(z.string().trim().min(1).max(128)),\n scope: nullableOptional(z.string().trim().min(1).max(512)),\n userContextScopes: nullableOptional(z.array(z.string().trim().min(1).max(128)).max(50)),\n retrievalReason: nullableOptional(z.string().trim().min(1).max(2000)),\n confidence: nullableOptional(z.number().min(0).max(1)),\n stale: nullableOptional(z.boolean()),\n corrected: nullableOptional(z.boolean()),\n correctionState: nullableOptional(z.enum([\"none\", \"correction\", \"superseded\", \"disputed\", \"forgotten\"])),\n safeToUse: nullableOptional(z.boolean()),\n safety: nullableOptional(z.enum([\"safe\", \"requires-review\", \"blocked\"])),\n safetyReasons: nullableOptional(z.array(z.string().trim().min(1).max(1000)).max(50)),\n })\n .strict();\n\nexport const actionConfidenceRequestSchema = z\n .object({\n intendedAction: nullableOptional(z.string().trim().min(1).max(1000)),\n confidence: nullableOptional(z.number().min(0).max(1)),\n risk: nullableOptional(z.enum(ACTION_CONFIDENCE_RISK_CATEGORIES)),\n contextReadiness: nullableOptional(z.enum(ACTION_CONFIDENCE_CONTEXT_READINESS)),\n currentContextScopes: nullableOptional(z.array(z.string().trim().min(1).max(128)).max(50)),\n userRules: nullableOptional(z.array(actionConfidenceRuleSchema).max(100)),\n retrievedMemories: nullableOptional(z.array(actionConfidenceMemorySchema).max(200)),\n })\n .strict();\n\n// ---------------------------------------------------------------------------\n// Inferred types\n// ---------------------------------------------------------------------------\n\nexport type RecallRequest = z.infer<typeof recallRequestSchema>;\nexport type RecallExplainRequest = z.infer<typeof recallExplainRequestSchema>;\nexport type SetCodingContextRequest = z.infer<typeof setCodingContextRequestSchema>;\nexport type ObserveRequest = z.infer<typeof observeRequestSchema>;\nexport type MemoryStoreRequest = z.infer<typeof memoryStoreRequestSchema>;\nexport type SuggestionSubmitRequest = z.infer<typeof suggestionSubmitRequestSchema>;\nexport type ReviewDispositionRequest = z.infer<typeof reviewDispositionRequestSchema>;\nexport type TrustZonePromoteRequest = z.infer<typeof trustZonePromoteRequestSchema>;\nexport type TrustZoneDemoSeedRequest = z.infer<typeof trustZoneDemoSeedRequestSchema>;\nexport type LcmSearchRequest = z.infer<typeof lcmSearchRequestSchema>;\nexport type LcmCompactionFlushRequest = z.infer<typeof lcmCompactionFlushRequestSchema>;\nexport type ExtractionForceFlushRequest = z.infer<typeof extractionForceFlushRequestSchema>;\nexport type LcmCompactionRecordRequest = z.infer<typeof lcmCompactionRecordRequestSchema>;\nexport type DaySummaryRequest = z.infer<typeof daySummaryRequestSchema>;\nexport type CapsuleExportRequest = z.infer<typeof capsuleExportRequestSchema>;\nexport type CapsuleImportRequest = z.infer<typeof capsuleImportRequestSchema>;\nexport type CapsuleListRequest = z.infer<typeof capsuleListRequestSchema>;\nexport type OfflineSyncApplyRequest = z.infer<typeof offlineSyncApplyRequestSchema>;\nexport type OfflineSyncSnapshotRequest = z.infer<typeof offlineSyncSnapshotRequestSchema>;\nexport type OfflineSyncFilesRequest = z.infer<typeof offlineSyncFilesRequestSchema>;\nexport type OfflineSyncFileContentRequest = z.infer<typeof offlineSyncFileContentRequestSchema>;\nexport type ActionConfidenceRequest = z.infer<typeof actionConfidenceRequestSchema>;\n\n// ---------------------------------------------------------------------------\n// Validation helper\n// ---------------------------------------------------------------------------\n\nexport type SchemaName =\n | \"recall\"\n | \"recallExplain\"\n | \"setCodingContext\"\n | \"observe\"\n | \"memoryStore\"\n | \"suggestionSubmit\"\n | \"reviewDisposition\"\n | \"trustZonePromote\"\n | \"trustZoneDemoSeed\"\n | \"lcmSearch\"\n | \"lcmCompactionFlush\"\n | \"extractionForceFlush\"\n | \"lcmCompactionRecord\"\n | \"daySummary\"\n | \"capsuleExport\"\n | \"capsuleImport\"\n | \"capsuleList\"\n | \"offlineSyncSnapshot\"\n | \"offlineSyncFiles\"\n | \"offlineSyncFileContent\"\n | \"offlineSyncApply\"\n | \"actionConfidence\";\n\nexport type SchemaTypeFor<N extends SchemaName> =\n N extends \"recall\" ? RecallRequest\n : N extends \"recallExplain\" ? RecallExplainRequest\n : N extends \"setCodingContext\" ? SetCodingContextRequest\n : N extends \"observe\" ? ObserveRequest\n : N extends \"memoryStore\" ? MemoryStoreRequest\n : N extends \"suggestionSubmit\" ? SuggestionSubmitRequest\n : N extends \"reviewDisposition\" ? ReviewDispositionRequest\n : N extends \"trustZonePromote\" ? TrustZonePromoteRequest\n : N extends \"trustZoneDemoSeed\" ? TrustZoneDemoSeedRequest\n : N extends \"lcmSearch\" ? LcmSearchRequest\n : N extends \"lcmCompactionFlush\" ? LcmCompactionFlushRequest\n : N extends \"extractionForceFlush\" ? ExtractionForceFlushRequest\n : N extends \"lcmCompactionRecord\" ? LcmCompactionRecordRequest\n : N extends \"daySummary\" ? DaySummaryRequest\n : N extends \"capsuleExport\" ? CapsuleExportRequest\n : N extends \"capsuleImport\" ? CapsuleImportRequest\n : N extends \"capsuleList\" ? CapsuleListRequest\n : N extends \"offlineSyncSnapshot\" ? OfflineSyncSnapshotRequest\n : N extends \"offlineSyncFiles\" ? OfflineSyncFilesRequest\n : N extends \"offlineSyncFileContent\" ? OfflineSyncFileContentRequest\n : N extends \"offlineSyncApply\" ? OfflineSyncApplyRequest\n : N extends \"actionConfidence\" ? ActionConfidenceRequest\n : never;\n\nconst schemas: Record<SchemaName, z.ZodTypeAny> = {\n recall: recallRequestSchema,\n recallExplain: recallExplainRequestSchema,\n setCodingContext: setCodingContextRequestSchema,\n observe: observeRequestSchema,\n memoryStore: memoryStoreRequestSchema,\n suggestionSubmit: suggestionSubmitRequestSchema,\n reviewDisposition: reviewDispositionRequestSchema,\n trustZonePromote: trustZonePromoteRequestSchema,\n trustZoneDemoSeed: trustZoneDemoSeedRequestSchema,\n lcmSearch: lcmSearchRequestSchema,\n lcmCompactionFlush: lcmCompactionFlushRequestSchema,\n extractionForceFlush: extractionForceFlushRequestSchema,\n lcmCompactionRecord: lcmCompactionRecordRequestSchema,\n daySummary: daySummaryRequestSchema,\n capsuleExport: capsuleExportRequestSchema,\n capsuleImport: capsuleImportRequestSchema,\n capsuleList: capsuleListRequestSchema,\n offlineSyncSnapshot: offlineSyncSnapshotRequestSchema,\n offlineSyncFiles: offlineSyncFilesRequestSchema,\n offlineSyncFileContent: offlineSyncFileContentRequestSchema,\n offlineSyncApply: offlineSyncApplyRequestSchema,\n actionConfidence: actionConfidenceRequestSchema,\n};\n\n/**\n * Validate a request body against the named schema.\n * Returns `{ success: true, data }` on pass or\n * `{ success: false, error }` on failure with field-level detail.\n */\nexport function validateRequest<T = unknown>(\n schemaName: SchemaName,\n body: unknown,\n): { success: true; data: T } | { success: false; error: SchemaValidationError } {\n const schema = schemas[schemaName];\n if (!schema) {\n return {\n success: false,\n error: {\n error: `unknown schema: ${schemaName}`,\n code: \"validation_error\",\n details: [],\n },\n };\n }\n const result = schema.safeParse(stripNullsExceptCodingContext(body));\n if (result.success) {\n return { success: true, data: result.data as T };\n }\n return { success: false, error: formatZodError(result.error) };\n}\n\nfunction stripNullsExceptCodingContext(data: unknown): unknown {\n if (!data || typeof data !== \"object\" || Array.isArray(data)) return data;\n const cleaned: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(data as Record<string, unknown>)) {\n if (value === null && key !== \"codingContext\") continue;\n cleaned[key] = value;\n }\n return cleaned;\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,SAAS,SAAS;AA0BX,SAAS,eAAe,OAA0C;AACvE,SAAO;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,IACN,SAAS,MAAM,OAAO,IAAI,CAAC,WAAW;AAAA,MACpC,OAAO,MAAM,KAAK,KAAK,GAAG,KAAK;AAAA,MAC/B,SAAS,MAAM;AAAA,IACjB,EAAE;AAAA,EACJ;AACF;AAMA,IAAM,kBAAkB,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,SAAS;AAC5D,IAAM,mBAAmB,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS;AACpE,IAAM,uBAAuB,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS;AACxE,IAAM,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,qCAAqC,EAAE,IAAI,IAAI,EAAE,SAAS;AACrG,IAAM,mBAAmB,EACtB,OAAO,EACP,KAAK,EACL,IAAI,GAAG,4CAA4C,EACnD,IAAI,GAAG,EACP,SAAS;AACZ,IAAM,mBAAmB,EAAE,OAAO,EAAE,OAAO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AAA,EACf,eAAe;AAAA,EACf,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,wBAAwB;AAAA,EACxB,kBAAkB;AAAA,EAClB,kBAAkB;AACpB;AAOO,SAAS,gBACd,YACA,MAC+E;AAC/E,QAAM,SAAS,QAAQ,UAAU;AACjC,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO;AAAA,QACL,OAAO,mBAAmB,UAAU;AAAA,QACpC,MAAM;AAAA,QACN,SAAS,CAAC;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AACA,QAAM,SAAS,OAAO,UAAU,8BAA8B,IAAI,CAAC;AACnE,MAAI,OAAO,SAAS;AAClB,WAAO,EAAE,SAAS,MAAM,MAAM,OAAO,KAAU;AAAA,EACjD;AACA,SAAO,EAAE,SAAS,OAAO,OAAO,eAAe,OAAO,KAAK,EAAE;AAC/D;AAEA,SAAS,8BAA8B,MAAwB;AAC7D,MAAI,CAAC,QAAQ,OAAO,SAAS,YAAY,MAAM,QAAQ,IAAI,EAAG,QAAO;AACrE,QAAM,UAAmC,CAAC;AAC1C,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAA+B,GAAG;AAC1E,QAAI,UAAU,QAAQ,QAAQ,gBAAiB;AAC/C,YAAQ,GAAG,IAAI;AAAA,EACjB;AACA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseEntityFile
3
- } from "./chunk-ICN37XHG.js";
3
+ } from "./chunk-GMU7MAHS.js";
4
4
  import {
5
5
  inferMemoryStatus
6
6
  } from "./chunk-7RJUVTVF.js";
@@ -253,4 +253,4 @@ export {
253
253
  WHO_KNOWS_MCP_TOOLS,
254
254
  handleWhoKnowsHttpQuery
255
255
  };
256
- //# sourceMappingURL=chunk-2ZG2LLZT.js.map
256
+ //# sourceMappingURL=chunk-D7UUB33A.js.map
@@ -7,24 +7,21 @@ import {
7
7
  import {
8
8
  listMemoryGovernanceRuns,
9
9
  readMemoryGovernanceRunArtifact
10
- } from "./chunk-KLUC2GSG.js";
10
+ } from "./chunk-5AJZ7EUW.js";
11
11
  import {
12
12
  StorageManager
13
- } from "./chunk-ICN37XHG.js";
13
+ } from "./chunk-GMU7MAHS.js";
14
14
  import {
15
15
  normalizeProjectionPreview,
16
16
  normalizeProjectionTags
17
17
  } from "./chunk-SCU65EZI.js";
18
- import {
19
- commitPreparedFileAtomically
20
- } from "./chunk-AW4QUFQF.js";
21
18
  import {
22
19
  assertInjectedStorageRooted,
23
20
  readProjectedEntityMentionRows,
24
21
  readProjectedGovernanceRows,
25
22
  readProjectedNativeKnowledgeRows,
26
23
  writeProjectionMetaHighWater
27
- } from "./chunk-TBXAY2SS.js";
24
+ } from "./chunk-SGHGCFVV.js";
28
25
  import {
29
26
  MEMORY_PROJECTION_SCHEMA_VERSION,
30
27
  getMemoryProjectionPath,
@@ -48,6 +45,9 @@ import {
48
45
  sortMemoryLifecycleEvents,
49
46
  toMemoryPathRel
50
47
  } from "./chunk-7RJUVTVF.js";
48
+ import {
49
+ commitPreparedFileAtomically
50
+ } from "./chunk-AW4QUFQF.js";
51
51
  import {
52
52
  isErrnoCode
53
53
  } from "./chunk-KNA3BXXL.js";
@@ -1005,4 +1005,4 @@ export {
1005
1005
  verifyMemoryProjection,
1006
1006
  repairMemoryProjection
1007
1007
  };
1008
- //# sourceMappingURL=chunk-E3I3NDUP.js.map
1008
+ //# sourceMappingURL=chunk-DABSYX7V.js.map
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-5JMAGU26.js";
6
6
  import {
7
7
  runPostConsolidationMaterialize
8
- } from "./chunk-V62YYBBY.js";
8
+ } from "./chunk-KORQWGUA.js";
9
9
  import {
10
10
  isSemanticConsolidationLlmOperator
11
11
  } from "./chunk-G7D6GZ5J.js";
@@ -220,4 +220,4 @@ export {
220
220
  buildExtensionsBlockForConsolidation,
221
221
  materializeAfterSemanticConsolidation
222
222
  };
223
- //# sourceMappingURL=chunk-KJLLPG26.js.map
223
+ //# sourceMappingURL=chunk-DDGQDNQW.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-DBB5JPSL.js";
4
4
  import {
5
5
  isGenericRecallExcludedPath
6
- } from "./chunk-JMWUPUE6.js";
6
+ } from "./chunk-46FVFU7S.js";
7
7
  import {
8
8
  shouldFilterSupersededFromRecall
9
9
  } from "./chunk-5WITETWU.js";
@@ -69,4 +69,4 @@ export {
69
69
  filterRecentScanMemoriesForStateView,
70
70
  indexStateViewAnnotatedResults
71
71
  };
72
- //# sourceMappingURL=chunk-K5D2XVNN.js.map
72
+ //# sourceMappingURL=chunk-F2FJTOV6.js.map
@@ -16,6 +16,8 @@ var MCP_READ_ONLY_TOOL_SUFFIXES = {
16
16
  meetings_list: true,
17
17
  meetings_get: true,
18
18
  deep_recall: true,
19
+ memory_expand: true,
20
+ memory_traverse: true,
19
21
  standup: true,
20
22
  action_confidence: true,
21
23
  capsule_list: true,
@@ -63,4 +65,4 @@ var MCP_READ_ONLY_TOOL_SUFFIXES = {
63
65
  export {
64
66
  MCP_READ_ONLY_TOOL_SUFFIXES
65
67
  };
66
- //# sourceMappingURL=chunk-EAARGPWI.js.map
68
+ //# sourceMappingURL=chunk-F3TURDFG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/mcp-read-only-tools.ts"],"sourcesContent":["/**\n * Conservative allowlist of canonical MCP tool suffixes that are\n * unambiguously read-only. Tools in this set are tagged with\n * `annotations: { readOnlyHint: true }` so ChatGPT (and other MCP\n * clients that honor the hint) can skip per-call confirmation.\n *\n * The list is suffix-based so it covers both the `remnic.*` and\n * `engram.*` naming forms. Anything not on it stays unannotated:\n * uncertainty is resolved as \"might mutate\".\n *\n * Excluded by construction: anything that writes, runs a pipeline,\n * flushes, applies, records, imports, or destructively deletes.\n */\nexport const MCP_READ_ONLY_TOOL_SUFFIXES: Readonly<Record<string, true>> = {\n recall: true,\n recall_explain: true,\n recall_tier_explain: true,\n recall_xray: true,\n who_knows: true,\n promotion_candidates: true,\n briefing: true,\n wearables_status: true,\n transcript_day: true,\n transcript_search: true,\n transcript_memories: true,\n location_status: true,\n location_day: true,\n meetings_list: true,\n meetings_get: true,\n deep_recall: true,\n memory_expand: true,\n memory_traverse: true,\n standup: true,\n action_confidence: true,\n capsule_list: true,\n procedural_stats: true,\n memory_get: true,\n memory_timeline: true,\n entity_get: true,\n review_queue_list: true,\n lcm_search: true,\n continuity_incident_list: true,\n identity_anchor_get: true,\n memory_identity: true,\n memory_search: true,\n external_wiki_search: true,\n memory_profile: true,\n memory_entities_list: true,\n memory_questions: true,\n memory_last_recall: true,\n memory_intent_debug: true,\n memory_qmd_debug: true,\n memory_graph_explain: true,\n graph_snapshot: true,\n review_list: true,\n profiling_report: true,\n peer_list: true,\n peer_get: true,\n peer_profile_get: true,\n console_state: true,\n dreams_status: true,\n codegraph_list_projects: true,\n codegraph_index_status: true,\n codegraph_search_graph: true,\n codegraph_trace_path: true,\n codegraph_detect_changes: true,\n codegraph_query_graph: true,\n codegraph_get_schema: true,\n codegraph_get_snippet: true,\n codegraph_get_architecture: true,\n codegraph_search_code: true,\n support_passport_memory_preview: true,\n support_passport_cards_list: true,\n support_passport_grants_list: true,\n};\n"],"mappings":";AAaO,IAAM,8BAA8D;AAAA,EACzE,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,sBAAsB;AAAA,EACtB,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,cAAc;AAAA,EACd,aAAa;AAAA,EACb,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,0BAA0B;AAAA,EAC1B,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,sBAAsB;AAAA,EACtB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,eAAe;AAAA,EACf,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,0BAA0B;AAAA,EAC1B,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,4BAA4B;AAAA,EAC5B,uBAAuB;AAAA,EACvB,iCAAiC;AAAA,EACjC,6BAA6B;AAAA,EAC7B,8BAA8B;AAChC;","names":[]}
@@ -645,4 +645,4 @@ export {
645
645
  appendMemoryToGraphContext,
646
646
  resolvePersistedMemoryRelativePath
647
647
  };
648
- //# sourceMappingURL=chunk-7ZLC4DTZ.js.map
648
+ //# sourceMappingURL=chunk-F6PTJLEM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/orchestration/orchestrator-helpers.ts"],"sourcesContent":["/**\n * Orchestrator module-level helpers — relocated from orchestrator.ts\n * (issue #1526, seam 25).\n *\n * Pure functions, types, and constants that previously lived at module\n * level in orchestrator.ts: recall-mode planning, recall snapshots and\n * parsers, abort/race helpers, artifact recall limits, replay\n * source-time slicing, day-summary date utilities, and QMD startup\n * checks. orchestrator.ts re-exports the previously-public names so\n * every existing importer (coordinators, tests, root shims) keeps\n * working unchanged.\n *\n * Behavior-preserving move — no logic changes.\n */\n\nimport { createHash } from \"node:crypto\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { abortError as sharedAbortError, throwIfAborted as sharedThrowIfAborted } from \"../abort-error.js\";\nimport type { CapabilitySet } from \"../capabilities.js\";\nimport { buildCompressionGuidelinesMarkdown as buildCompressionGuidelinesMarkdownV2 } from \"../compression-optimizer.js\";\nimport { FallbackLlmClient } from \"../fallback-llm.js\";\nimport { hasBroadGraphIntent, planRecallMode } from \"../intent.js\";\nimport { resolveLifecycleState } from \"../lifecycle.js\";\nimport { log } from \"../logger.js\";\nimport type { GraphRecallRankedResult, GraphRecallShadowComparison } from \"./graph-recall-coordinator.js\";\nimport { parseQmdExplain } from \"../qmd.js\";\nimport type { GraphRecallExpandedEntry } from \"../recall-state.js\";\nimport type { RecallXrayServedBy } from \"../recall-xray.js\";\nimport type { RecallContextComposition } from \"../recall-context-composition.js\";\nimport { type BufferTurn, type MemoryActionEvent, type MemoryFile, type MemoryFrontmatter, type MemoryIntent, type PluginConfig, type QmdSearchResult, type RecallPlanMode, confidenceTier } from \"../types.js\";\nimport { categoryDirName } from \"../utils/category-dir.js\";\nimport { parseFlexibleIsoTimestamp } from \"../utils/iso-timestamp.js\";\n\n/** Freshness window for the artifact source status cache read by NamespaceReadFanoutCoordinator. */\nexport const ARTIFACT_STATUS_CACHE_TTL_MS = 60_000;\nexport interface BulkImportBatchIngestResult {\n attemptedTurnCount: number;\n extractionCount: number;\n persistedCount: number;\n durableOutputCount: number;\n skippedCount: number;\n failedCount: number;\n postPersistMetadataFailureCount: number;\n processedTurnCount: number;\n}\n\nexport class BulkImportBatchPartialFailureError extends Error {\n readonly partialResult: BulkImportBatchIngestResult;\n\n readonly originalError: unknown;\n\n constructor(\n message: string,\n partialResult: BulkImportBatchIngestResult,\n originalError: unknown,\n ) {\n super(message);\n this.name = \"BulkImportBatchPartialFailureError\";\n this.partialResult = partialResult;\n this.originalError = originalError;\n }\n}\n\nexport interface GraphRecallSnapshot {\n recordedAt: string;\n mode: RecallPlanMode | string;\n queryHash: string;\n queryLength: number;\n namespaces: string[];\n seedCount: number;\n expandedCount: number;\n seeds: string[];\n expanded: GraphRecallExpandedEntry[];\n status?: \"completed\" | \"skipped\" | \"aborted\";\n reason?: string;\n shadowMode?: boolean;\n queryIntent?: MemoryIntent;\n seedResults?: GraphRecallRankedResult[];\n finalResults?: GraphRecallRankedResult[];\n shadowComparison?: GraphRecallShadowComparison;\n}\n\nexport interface IntentDebugSnapshot {\n recordedAt: string;\n promptHash: string;\n promptLength: number;\n retrievalQueryHash: string;\n retrievalQueryLength: number;\n plannerEnabled: boolean;\n plannedMode: RecallPlanMode;\n effectiveMode: RecallPlanMode;\n recallResultLimit: number;\n queryIntent: MemoryIntent;\n graphExpandedIntentDetected: boolean;\n graphDecision: {\n status: \"not_requested\" | \"skipped\" | \"completed\" | \"aborted\";\n reason?: string;\n shadowMode: boolean;\n qmdAvailable: boolean;\n graphRecallEnabled: boolean;\n multiGraphMemoryEnabled: boolean;\n };\n}\n\nexport interface QmdRecallSnapshot {\n recordedAt: string;\n queryHash: string;\n queryLength: number;\n collection?: string;\n namespaces: string[];\n fetchLimit: number;\n primaryResultCount: number;\n hybridResultCount: number;\n queryAwareSeedCount: number;\n resultCount: number;\n intentHint?: string;\n explainEnabled: boolean;\n hybridTopUpUsed: boolean;\n hybridTopUpSkippedReason?: string;\n results: QmdSearchResult[];\n}\n\nexport interface RecallModeDecision {\n plannedMode: RecallPlanMode;\n effectiveMode: RecallPlanMode;\n graphExpandedIntentDetected: boolean;\n graphReason?: string;\n /**\n * Where `plannedMode` came from (issue #1367 / Option C). `\"heuristic\"` for\n * the regex planner; `\"llm\"` when the LLM planner classified it; and\n * `\"heuristic-fallback\"` when the LLM was enabled but errored/timed out and we\n * fell back. Absent on the synchronous heuristic-only path.\n */\n plannerSource?: \"heuristic\" | \"llm\" | \"heuristic-fallback\";\n /** Short rationale from the planner (for telemetry / x-ray). */\n plannerReason?: string;\n /** Wall-clock spent in the LLM planner call, when one was made. */\n plannerLatencyMs?: number;\n /** True when the LLM planner was enabled but fell back to the heuristic. */\n plannerFallbackUsed?: boolean;\n /** Model that served the LLM classification, when one was used. */\n plannerModelUsed?: string;\n /**\n * The regex-heuristic baseline mode, captured whenever the LLM planner ran\n * (any source). Lets operators compare planned-vs-heuristic during rollout —\n * distinct from `plannedMode`, which on the LLM path is the LLM's choice.\n */\n plannerHeuristicMode?: RecallPlanMode;\n /**\n * In shadow mode, the mode the LLM *would* have chosen (recorded for\n * comparison) while `effectiveMode` stays on the heuristic decision.\n */\n shadowLlmMode?: RecallPlanMode;\n}\n\n/**\n * Map the orchestrator's internal `recallSource` strings to the\n * X-ray `servedBy` vocabulary (issue #570 PR 1). The X-ray tier\n * ladder intentionally flattens QMD / embedding / cold-fallback to\n * the `hybrid` tier because they all materialize through the same\n * hybrid BM25+vector pipeline from the caller's perspective. The\n * `recent_scan` path gets its own dedicated tier because it bypasses\n * the hybrid pipeline entirely. `none` is treated as `hybrid` on the\n * theory that a query that returned nothing still routed through the\n * hybrid pipeline — but callers should normally gate capture on\n * `recalledMemoryIds.length > 0`.\n */\nexport function mapRecallSourceToXrayServedBy(\n source:\n | \"none\"\n | \"hot_qmd\"\n | \"hot_embedding\"\n | \"cold_fallback\"\n | \"recent_scan\",\n): RecallXrayServedBy {\n // Exhaustive switch: every current union member is explicitly\n // listed so TypeScript surfaces a compile error if a new source is\n // added without a deliberate mapping. The `never`-typed fallthrough\n // keeps the function total at runtime — if the caller passes an\n // unexpected value that slipped past the type system (e.g. a JSON\n // deserialization), we still fall back to `hybrid`.\n switch (source) {\n case \"recent_scan\":\n return \"recent-scan\";\n case \"hot_qmd\":\n case \"hot_embedding\":\n case \"cold_fallback\":\n case \"none\":\n return \"hybrid\";\n }\n const _exhaustive: never = source;\n void _exhaustive;\n return \"hybrid\";\n}\n\nexport interface RecallInvocationOptions {\n namespace?: string;\n topK?: number;\n mode?: RecallPlanMode;\n abortSignal?: AbortSignal;\n /** Server-resolved identity of the connector performing this recall. */\n sourceConnector?: string;\n /**\n * Capture a `RecallXraySnapshot` for this recall (issue #570). When\n * `true`, the orchestrator builds a snapshot from the data it has\n * already gathered and stashes it in memory, accessible via\n * `getLastXraySnapshot()`. When `false` or absent, nothing is\n * captured and recall behavior is unchanged (schema-only slice).\n */\n xrayCapture?: boolean;\n /**\n * Per-invocation override for `recallBudgetChars` (issue #570 PR 3/4).\n * Flows through `getRecallBudgetChars()` for this recall only — no\n * shared config mutation, so concurrent recalls on the same\n * orchestrator are not affected (CLAUDE.md rule 47: no shared\n * mutable state across async boundaries). Must be a non-negative\n * finite integer; non-conforming values are ignored and the\n * configured budget is used.\n */\n budgetCharsOverride?: number;\n /**\n * Per-invocation principal override (issue #570 PR 4). When set,\n * the orchestrator uses this principal for ACL / namespace checks\n * instead of `resolvePrincipal(sessionKey, config)`. This is the\n * escape hatch for access surfaces (HTTP / MCP) that have already\n * authenticated the caller upstream — threading an unmapped\n * principal through the session-key-based resolver would otherwise\n * collapse it to `\"default\"` and produce false denials in\n * namespace-enabled deployments (CLAUDE.md rule 42).\n */\n principalOverride?: string;\n /**\n * Historical recall point (issue #680). When set, the orchestrator\n * filters out memories whose `valid_at` is after this timestamp OR\n * whose `invalid_at` is at-or-before this timestamp, so callers see\n * the corpus as it existed at `asOf`. ISO 8601 string; comparisons\n * use `Date.parse()` so timezone-aware values round-trip correctly\n * (CLAUDE.md gotcha — never compare ISO strings lexicographically).\n * Invalid values must be rejected at input boundaries (CLAUDE.md\n * rule 51); the orchestrator does NOT silently fall back here.\n */\n asOf?: string;\n /**\n * Issue #681 — when `true`, bypasses `graphTraversalConfidenceFloor`\n * and includes edges below the floor in graph traversal. Useful for\n * diagnostic recall queries that need to surface results that would\n * normally be pruned by confidence decay. Default `false`.\n */\n includeLowConfidence?: boolean;\n /**\n * #1952 — per-call override enabling state-aware recall views for this\n * recall only (MCP `stateView` boolean). ORs with the `recallStateViews`\n * config flag; a change-intent query is still required for any effect.\n */\n stateView?: boolean;\n /**\n * User-aware context scopes active for this recall. Used by X-ray\n * provenance safety checks so boundary-scoped memories are evaluated\n * against the caller's real context.\n */\n currentContextScopes?: readonly unknown[];\n /**\n * Wall-clock ms the caller waited to begin execution — per-principal\n * semaphore queue + single-flight wait (issue #1906). Folded into\n * recall-timings additively as `queueWaitMs`; omitted phases are simply\n * absent, so existing timing consumers are unaffected.\n */\n queueWaitMs?: number;\n onContextComposition?: (composition: RecallContextComposition) => void | PromiseLike<void>;\n}\n\nexport type QueryAwarePrefilter = {\n candidatePaths: Set<string> | null;\n temporalFromDate: string | null;\n matchedTags: string[];\n expandedTags: string[];\n combination: \"none\" | \"temporal\" | \"tag\" | \"intersection\" | \"union\";\n filteredToFullSearch: boolean;\n};\n\n// Recall-specific abort helpers. Thin wrappers over the shared\n// `abort-error.ts` module so every abort in the codebase shares the\n// same `name === \"AbortError\"` classification contract (`isAbortError`\n// works uniformly). We keep the \"recall aborted\" default message for\n// back-compat with call-site logs; callers that pass an explicit\n// message (e.g. \"extraction aborted (before_extract)\") are unaffected.\nexport const abortRecallError = sharedAbortError;\n\nexport function throwIfRecallAborted(\n signal?: AbortSignal,\n message = \"recall aborted\",\n): void {\n sharedThrowIfAborted(signal, message);\n}\n\nexport async function raceRecallAbort<T>(\n promise: Promise<T>,\n signal?: AbortSignal,\n message = \"recall aborted\",\n): Promise<T> {\n throwIfRecallAborted(signal, message);\n if (!signal) return promise;\n\n let onAbort: (() => void) | null = null;\n const abortPromise = new Promise<T>((_resolve, reject) => {\n onAbort = () => reject(abortRecallError(message));\n signal.addEventListener(\"abort\", onAbort, { once: true });\n });\n\n try {\n return await Promise.race([promise, abortPromise]);\n } finally {\n if (onAbort) {\n signal.removeEventListener(\"abort\", onAbort);\n }\n }\n}\n\n/** Maximum age (ms) before a compaction-reset signal file is considered stale and removed. */\nexport const COMPACTION_SIGNAL_MAX_AGE_MS = 60 * 60 * 1000; // 1 hour\n\nexport const DEFAULT_QMD_STARTUP_COLLECTION_CHECK_TIMEOUT_MS = 10_000;\n\nexport type DaySummaryGatherOptions = {\n timeZone?: string;\n now?: Date;\n /** Opt-in location context (issue #2925); false/absent keeps output byte-identical. */\n includeLocation?: boolean;\n};\n\nexport function normalizeIanaTimeZone(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const trimmed = value.trim();\n if (!trimmed) return undefined;\n try {\n Intl.DateTimeFormat(undefined, { timeZone: trimmed });\n return trimmed;\n } catch {\n return undefined;\n }\n}\n\nexport function formatDateInTimeZone(date: Date, timeZone: string): string {\n const parts = new Intl.DateTimeFormat(\"en-US\", {\n timeZone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n }).formatToParts(date);\n const get = (type: string): string => parts.find((part) => part.type === type)?.value ?? \"\";\n return `${get(\"year\")}-${get(\"month\")}-${get(\"day\")}`;\n}\n\nexport function utcDateKey(date: Date): string {\n return date.toISOString().slice(0, 10);\n}\n\nexport function utcDateKeysAround(date: Date): string[] {\n const dayMs = 86_400_000;\n const keys = [\n utcDateKey(new Date(date.getTime() - dayMs)),\n utcDateKey(date),\n utcDateKey(new Date(date.getTime() + dayMs)),\n ];\n return keys.filter((value, index, array) => array.indexOf(value) === index);\n}\n\nexport function utcDateKeysForLocalDay(date: Date, timeZone: string): string[] {\n const targetLocalDate = formatDateInTimeZone(date, timeZone);\n const keys = new Set<string>();\n const hourMs = 3_600_000;\n const scanStart = date.getTime() - 48 * hourMs;\n const scanEnd = date.getTime() + 48 * hourMs;\n for (let ms = scanStart; ms <= scanEnd; ms += hourMs) {\n const candidate = new Date(ms);\n if (formatDateInTimeZone(candidate, timeZone) === targetLocalDate) {\n keys.add(utcDateKey(candidate));\n }\n }\n return keys.size > 0 ? [...keys].sort() : utcDateKeysAround(date);\n}\n\nexport function parseFiniteDate(value: unknown): Date | null {\n if (typeof value !== \"string\" || value.trim().length === 0) return null;\n const parsed = new Date(value);\n return Number.isFinite(parsed.getTime()) ? parsed : null;\n}\n\nexport function filterHourlySummaryMarkdownForLocalDay(\n raw: string,\n utcDate: string,\n timeZone: string,\n targetLocalDate: string,\n): string | null {\n const hourHeaderPattern = /^## ([01]\\d|2[0-3]):00[ \\t]*$/gm;\n const matches = Array.from(raw.matchAll(hourHeaderPattern));\n if (matches.length === 0) return null;\n\n const firstSectionStart = matches[0]?.index ?? 0;\n const preamble = raw.slice(0, firstSectionStart).trim();\n const sections: string[] = [];\n for (let index = 0; index < matches.length; index += 1) {\n const match = matches[index];\n const hour = match[1];\n if (!hour) continue;\n const sectionTimestamp = parseFiniteDate(`${utcDate}T${hour}:00:00.000Z`);\n if (\n !sectionTimestamp ||\n formatDateInTimeZone(sectionTimestamp, timeZone) !== targetLocalDate\n ) {\n continue;\n }\n const sectionStart = match.index ?? 0;\n const sectionEnd = matches[index + 1]?.index ?? raw.length;\n const section = raw.slice(sectionStart, sectionEnd).trim();\n if (section.length > 0) sections.push(section);\n }\n\n if (sections.length === 0) return null;\n return [preamble, ...sections]\n .filter((section) => section.length > 0)\n .join(\"\\n\\n\");\n}\n\nexport type SearchCollectionState = \"present\" | \"missing\" | \"unknown\" | \"skipped\";\n\nexport function qmdStartupCollectionCheckTimeoutMs(): number {\n const raw =\n process.env.REMNIC_QMD_STARTUP_COLLECTION_CHECK_TIMEOUT_MS ??\n process.env.ENGRAM_QMD_STARTUP_COLLECTION_CHECK_TIMEOUT_MS;\n if (raw === undefined) return DEFAULT_QMD_STARTUP_COLLECTION_CHECK_TIMEOUT_MS;\n const parsed = Number(raw);\n return Number.isFinite(parsed) && parsed >= 1_000\n ? Math.floor(parsed)\n : DEFAULT_QMD_STARTUP_COLLECTION_CHECK_TIMEOUT_MS;\n}\n\nexport async function qmdStartupCollectionCheckWithTimeout(\n promise: Promise<SearchCollectionState>,\n controller: AbortController,\n label: string,\n): Promise<SearchCollectionState> {\n const timeoutMs = qmdStartupCollectionCheckTimeoutMs();\n let timer: NodeJS.Timeout | undefined;\n let settled = false;\n\n const timeoutPromise = new Promise<SearchCollectionState>((resolve) => {\n timer = setTimeout(() => {\n if (settled) return;\n controller.abort();\n log.warn(\n `QMD startup collection check for ${label} timed out after ${timeoutMs}ms; keeping search enabled fail-open`,\n );\n resolve(\"unknown\");\n }, timeoutMs);\n timer.unref?.();\n });\n\n const checkedPromise = promise\n .catch((err): SearchCollectionState => {\n log.warn(\n `QMD startup collection check for ${label} failed; keeping search enabled fail-open: ${err}`,\n );\n return \"unknown\";\n })\n .finally(() => {\n settled = true;\n if (timer) clearTimeout(timer);\n });\n\n return await Promise.race([checkedPromise, timeoutPromise]);\n}\n\n/** Default workspace directory when no per-agent or config workspace is available. */\nexport function defaultWorkspaceDir(): string {\n return path.join(os.homedir(), \".openclaw\", \"workspace\");\n}\n\n/**\n * Produce a collision-resistant, filesystem-safe identifier from a session key.\n *\n * Session keys follow colon-delimited forms (e.g., `agent:gpucodebot:main`).\n * A naive replace (`:` → `_`) is lossy: different keys like `agent:alpha` and\n * `agent/alpha` would collide. Instead we append a short SHA-256 hash of the\n * original key to the human-readable sanitized prefix, guaranteeing uniqueness\n * while keeping filenames debuggable.\n *\n * Format: `<sanitized>-<12-char-hex-hash>`\n * Example: `agent:gpucodebot:main` → `agent_gpucodebot_main-a1b2c3d4e5f6`\n */\nexport function sanitizeSessionKeyForFilename(sessionKey: string): string {\n const readable = sessionKey.replace(/[^a-zA-Z0-9._-]/g, \"_\");\n const hash = createHash(\"sha256\")\n .update(sessionKey)\n .digest(\"hex\")\n .slice(0, 12);\n return `${readable}-${hash}`;\n}\n\nexport function sourceValidAtMs(turn: BufferTurn): number | null {\n if (typeof turn.sourceValidAt !== \"string\") return null;\n return parseFlexibleIsoTimestamp(turn.sourceValidAt.trim());\n}\n\nexport const SOURCE_VALID_AT_CONTEXT_TURNS = 2;\n\nexport function sourceValidAtSliceKey(turn: BufferTurn, index: number): string {\n const validAtMs = sourceValidAtMs(turn);\n return validAtMs === null ? `unknown:${index}` : String(validAtMs);\n}\n\nexport function asExtractionContextTurn(turn: BufferTurn): BufferTurn {\n return { ...turn, extractionContextOnly: true };\n}\n\nexport function asExtractionTargetTurn(turn: BufferTurn): BufferTurn {\n const { extractionContextOnly: _contextOnly, ...targetTurn } = turn;\n return targetTurn;\n}\n\nexport function sourceValidAtContextTurns(\n turns: readonly BufferTurn[],\n targetStart: number,\n targetEnd: number,\n targetValidAtMs: number | null,\n): BufferTurn[] {\n if (targetValidAtMs === null) return [];\n return turns\n .flatMap((turn, index) => {\n if (index >= targetStart && index < targetEnd) return [];\n const contextValidAtMs = sourceValidAtMs(turn);\n if (contextValidAtMs === null || contextValidAtMs > targetValidAtMs) {\n return [];\n }\n return [{ turn, index, validAtMs: contextValidAtMs }];\n })\n .sort((a, b) => {\n if (a.validAtMs < b.validAtMs) return -1;\n if (a.validAtMs > b.validAtMs) return 1;\n if (a.index === b.index) return 0;\n return a.index < b.index ? -1 : 1;\n })\n .slice(-SOURCE_VALID_AT_CONTEXT_TURNS)\n .map(({ turn }) => asExtractionContextTurn(turn));\n}\n\nexport function targetSourceValidAtSortMs(turns: readonly BufferTurn[]): number {\n let latestMs: number | null = null;\n for (const turn of turns) {\n if (turn.extractionContextOnly === true) continue;\n const validAtMs = sourceValidAtMs(turn);\n if (validAtMs === null) continue;\n if (latestMs === null || validAtMs > latestMs) {\n latestMs = validAtMs;\n }\n }\n return latestMs ?? Number.POSITIVE_INFINITY;\n}\n\nexport function sortSourceValidAtSlicesChronologically(\n slices: BufferTurn[][],\n): BufferTurn[][] {\n return slices\n .map((turns, order) => ({\n turns,\n order,\n targetValidAtMs: targetSourceValidAtSortMs(turns),\n }))\n .sort((a, b) => {\n if (a.targetValidAtMs < b.targetValidAtMs) return -1;\n if (a.targetValidAtMs > b.targetValidAtMs) return 1;\n if (a.order === b.order) return 0;\n return a.order < b.order ? -1 : 1;\n })\n .map((slice) => slice.turns);\n}\n\nexport function splitTurnsBySourceValidAt(\n turns: readonly BufferTurn[],\n options: { includeContext?: boolean } = {},\n): BufferTurn[][] {\n if (turns.length === 0) return [];\n if (!turns.some((turn) => sourceValidAtMs(turn) !== null)) {\n return [[...turns]];\n }\n\n const slices: BufferTurn[][] = [];\n let start = 0;\n while (start < turns.length) {\n const targetValidAtMs = sourceValidAtMs(turns[start]);\n const activeKey = sourceValidAtSliceKey(turns[start], start);\n let end = start + 1;\n while (\n end < turns.length &&\n sourceValidAtSliceKey(turns[end], end) === activeKey\n ) {\n end += 1;\n }\n\n const contextTurns =\n options.includeContext === false\n ? []\n : sourceValidAtContextTurns(turns, start, end, targetValidAtMs);\n slices.push([\n ...contextTurns,\n ...turns.slice(start, end).map(asExtractionTargetTurn),\n ]);\n start = end;\n }\n return sortSourceValidAtSlicesChronologically(slices);\n}\n\nexport function isArtifactMemoryPath(filePath: string): boolean {\n return /(?:^|[\\\\/])artifacts(?:[\\\\/]|$)/i.test(filePath);\n}\n\n/**\n * Meeting records (issue #1900) live at\n * `<root>/meetings/<YYYY-MM-DD>/mtg-<YYYY-MM-DD>-<hash>.md` — inside the QMD\n * collection root (full-text searchable) but NEVER surfaced through generic\n * recall, exactly like `artifacts/`. The predicate matches the FULL record\n * shape (anchored at the filename) rather than any `meetings` path segment, so\n * a namespaced deployment whose non-default namespace is literally named\n * `meetings` (`.../namespaces/meetings/facts/…`) keeps its ordinary memories in\n * recall — only true meeting records are excluded.\n */\nexport function isMeetingRecordPath(filePath: string): boolean {\n return /(?:^|[\\\\/])meetings[\\\\/]\\d{4}-\\d{2}-\\d{2}[\\\\/]mtg-\\d{4}-\\d{2}-\\d{2}-[0-9a-f]{8}\\.md$/i.test(filePath);\n}\n\n/** Exactly `activity/<YYYY-MM-DD>.md`, at the top level of a memory root. */\nconst ACTIVITY_DIGEST_TOPLEVEL = /^activity[\\\\/]\\d{4}-\\d{2}-\\d{2}\\.md$/i;\n/** The digest FILE shape anywhere in a path (root-unaware best-effort). */\nconst ACTIVITY_DIGEST_ANYWHERE = /(?:^|[\\\\/])activity[\\\\/]\\d{4}-\\d{2}-\\d{2}\\.md$/i;\n\n/**\n * Activity day-digests live at `<memoryRoot>/activity/<YYYY-MM-DD>.md` — a\n * dedicated searchable surface (explicit activity search), never generic recall.\n * Captured screen text must not auto-inject into ordinary prompts (issue #1899).\n * Keyed on the path (parseFrontmatter drops the digest's `kind` marker).\n *\n * Root-aware: when `memoryRoot` is given, the path is resolved relative to it and\n * must be the TOP-LEVEL `activity/<date>.md`, so an ordinary memory nested under\n * a category (e.g. `facts/proj/activity/<date>.md`) stays recallable. Without a\n * root, falls back to the digest file shape anywhere (best-effort).\n */\nexport function isActivityDigestPath(filePath: string, memoryRoot?: string): boolean {\n if (memoryRoot !== undefined && memoryRoot.length > 0) {\n const relative = path.relative(memoryRoot, path.resolve(memoryRoot, filePath));\n return ACTIVITY_DIGEST_TOPLEVEL.test(relative);\n }\n return ACTIVITY_DIGEST_ANYWHERE.test(filePath);\n}\n\n/** Exactly `locations/<YYYY-MM-DD>.md`, at the top level of a memory root. */\nconst LOCATION_DAY_TOPLEVEL = /^locations[\\\\/]\\d{4}-\\d{2}-\\d{2}\\.md$/i;\n/** The day-file shape anywhere in a path (root-unaware best-effort). */\nconst LOCATION_DAY_ANYWHERE = /(?:^|[\\\\/])locations[\\\\/]\\d{4}-\\d{2}-\\d{2}\\.md$/i;\n\n/**\n * Location day documents (issue #2044) live at\n * `<memoryRoot>/locations/<YYYY-MM-DD>.md` — a dedicated searchable surface,\n * never generic recall (place history must not auto-inject into ordinary\n * prompts). Root-aware exactly like `isActivityDigestPath`: with a root, only\n * the top-level `locations/<date>.md` matches, so an ordinary memory nested\n * under a category (e.g. `facts/locations-note.md`) stays recallable; without\n * a root, falls back to the day-file shape anywhere (best-effort).\n */\nexport function isLocationDayPath(filePath: string, memoryRoot?: string): boolean {\n if (memoryRoot !== undefined && memoryRoot.length > 0) {\n const relative = path.relative(memoryRoot, path.resolve(memoryRoot, filePath));\n return LOCATION_DAY_TOPLEVEL.test(relative);\n }\n return LOCATION_DAY_ANYWHERE.test(filePath);\n}\n\nexport function buildCompressionGuidelinesMarkdown(\n events: MemoryActionEvent[],\n generatedAtIso: string = new Date().toISOString(),\n): string {\n return buildCompressionGuidelinesMarkdownV2(events, generatedAtIso);\n}\n\n\nexport function applyQueryAwareCandidateFilter(\n candidates: QmdSearchResult[],\n candidatePaths: Set<string> | null,\n): QmdSearchResult[] {\n if (!candidatePaths) return candidates;\n if (candidatePaths.size === 0) return [];\n const filtered = candidates.filter((candidate) =>\n candidatePaths.has(candidate.path),\n );\n return filtered.length > 0 ? filtered : candidates;\n}\n\nexport function tokenizeRecallQuery(prompt: string): string[] {\n return prompt\n .toLowerCase()\n .split(/[^a-z0-9]+/i)\n .map((t) => t.trim())\n .filter((t) => t.length >= 3);\n}\n\nexport function hasLifecycleMetadata(frontmatter: MemoryFrontmatter): boolean {\n return (\n frontmatter.lifecycleState !== undefined ||\n frontmatter.verificationState !== undefined ||\n frontmatter.policyClass !== undefined ||\n frontmatter.lastValidatedAt !== undefined ||\n frontmatter.decayScore !== undefined ||\n frontmatter.heatScore !== undefined\n );\n}\n\nexport function shouldFilterLifecycleRecallCandidate(\n frontmatter: MemoryFrontmatter,\n options: {\n lifecyclePolicyEnabled: boolean;\n lifecycleFilterStaleEnabled: boolean;\n },\n): boolean {\n if (!options.lifecyclePolicyEnabled || !options.lifecycleFilterStaleEnabled)\n return false;\n if (!hasLifecycleMetadata(frontmatter)) return false;\n const lifecycleState = resolveLifecycleState(frontmatter);\n return lifecycleState === \"stale\" || lifecycleState === \"archived\";\n}\n\nexport function lifecycleRecallScoreAdjustment(\n frontmatter: MemoryFrontmatter,\n options: {\n lifecyclePolicyEnabled: boolean;\n },\n): number {\n if (!options.lifecyclePolicyEnabled) return 0;\n if (!hasLifecycleMetadata(frontmatter)) return 0;\n\n let delta = 0;\n const lifecycleState = resolveLifecycleState(frontmatter);\n switch (lifecycleState) {\n case \"active\":\n delta += 0.05;\n break;\n case \"validated\":\n delta += 0.03;\n break;\n case \"candidate\":\n delta -= 0.01;\n break;\n case \"stale\":\n delta -= 0.06;\n break;\n case \"archived\":\n delta -= 0.08;\n break;\n }\n if (frontmatter.verificationState === \"disputed\") {\n delta -= 0.12;\n }\n return delta;\n}\n\nexport function computeArtifactRecallLimit(\n recallMode: RecallPlanMode,\n recallResultLimit: number,\n verbatimArtifactsMaxRecall: number,\n): number {\n if (recallMode === \"no_recall\") return 0;\n if (Math.max(0, recallResultLimit) === 0) return 0;\n const base = Math.max(0, verbatimArtifactsMaxRecall);\n if (recallMode === \"minimal\") {\n return Math.min(base, Math.max(0, recallResultLimit));\n }\n return base;\n}\n\nexport function resolveEffectiveRecallMode(options: {\n plannerEnabled: boolean;\n graphRecallEnabled: boolean;\n multiGraphMemoryEnabled: boolean;\n graphExpandedIntentEnabled?: boolean;\n prompt: string;\n}): RecallPlanMode {\n return resolveRecallModeDecision(options).effectiveMode;\n}\n\nexport interface RecallModeGraphOptions {\n plannerEnabled: boolean;\n graphRecallEnabled: boolean;\n multiGraphMemoryEnabled: boolean;\n graphExpandedIntentEnabled?: boolean;\n prompt: string;\n}\n\n/**\n * Apply the graph-mode overlay + gating to a planner-produced mode.\n *\n * Shared by the heuristic ({@link resolveRecallModeDecision}) and LLM\n * ({@link resolveRecallModeDecisionAsync}) paths so graph promotion and the\n * \"graph disabled → fall back to full\" gating behave identically regardless of\n * which planner produced `plannedModeRaw` (gotcha #39).\n */\nexport function finalizeRecallModeDecision(\n plannedModeRaw: RecallPlanMode,\n options: RecallModeGraphOptions,\n): RecallModeDecision {\n let plannedMode: RecallPlanMode = plannedModeRaw;\n const graphExpandedIntentDetected =\n options.plannerEnabled &&\n options.graphExpandedIntentEnabled === true &&\n hasBroadGraphIntent(options.prompt);\n if (plannedMode !== \"graph_mode\" && graphExpandedIntentDetected) {\n plannedMode = \"graph_mode\";\n }\n if (\n plannedMode === \"graph_mode\" &&\n (!options.graphRecallEnabled || !options.multiGraphMemoryEnabled)\n ) {\n return {\n plannedMode,\n effectiveMode: \"full\",\n graphExpandedIntentDetected,\n graphReason: !options.graphRecallEnabled\n ? \"graph recall disabled by config\"\n : \"multi-graph memory disabled by config\",\n };\n }\n return {\n plannedMode,\n effectiveMode: plannedMode,\n graphExpandedIntentDetected,\n };\n}\n\nexport function resolveRecallModeDecision(options: RecallModeGraphOptions): RecallModeDecision {\n const plannedMode: RecallPlanMode = options.plannerEnabled\n ? planRecallMode(options.prompt)\n : \"full\";\n return finalizeRecallModeDecision(plannedMode, options);\n}\n\n/**\n * Async recall-mode decision with optional LLM-based planning (issue #1367 /\n * Option C). Falls back to the heuristic decision when the LLM planner is\n * disabled, in shadow mode, or unavailable/failed — so this is always safe to\n * await on the recall hot path. Provider-agnostic: the LLM call routes through\n * the gateway/fallback chain.\n *\n * `recallPlannerEnabled === false` keeps the legacy \"always full\" behavior and\n * skips the LLM entirely (the planner as a whole is off).\n */\nexport async function resolveRecallModeDecisionAsync(\n options: RecallModeGraphOptions & {\n config: PluginConfig;\n /**\n * Recall-operation capability gates (issue #1523). REQUIRED: the recall\n * orchestrator always passes a resolved set — the LLM planner gate reads\n * `caps.recallPlannerLlm`, never re-derives from config.\n */\n caps: CapabilitySet;\n hints?: string[];\n llm?: FallbackLlmClient;\n signal?: AbortSignal;\n },\n): Promise<RecallModeDecision> {\n const heuristicDecision = resolveRecallModeDecision(options);\n\n // Planner globally off, or LLM planning not opted into → heuristic only.\n // Read the resolved capability (issue #1523) — never re-derive from config.\n const plannerLlmEnabled = options.caps.recallPlannerLlm;\n if (!options.plannerEnabled || !plannerLlmEnabled) {\n return heuristicDecision;\n }\n\n const { planRecallModeLLM } = await import(\"../recall-planner-llm.js\");\n const planned = await planRecallModeLLM(\n options.prompt,\n options.hints,\n options.config,\n options.caps,\n options.llm,\n options.signal,\n );\n\n // Shadow mode: record what the LLM would have chosen but keep the heuristic\n // effective decision (safe rollout / comparison — gotcha #30).\n if (options.config.recallPlannerShadowMode) {\n return {\n ...heuristicDecision,\n plannerSource: planned.source,\n plannerReason: `shadow:${planned.reason}`,\n plannerLatencyMs: planned.latencyMs,\n plannerFallbackUsed: planned.fallbackUsed,\n plannerModelUsed: planned.modelUsed,\n plannerHeuristicMode: planned.heuristicMode,\n shadowLlmMode: planned.mode,\n };\n }\n\n const llmDecision = finalizeRecallModeDecision(planned.mode, options);\n return {\n ...llmDecision,\n plannerSource: planned.source,\n plannerReason: planned.reason,\n plannerLatencyMs: planned.latencyMs,\n plannerFallbackUsed: planned.fallbackUsed,\n plannerModelUsed: planned.modelUsed,\n plannerHeuristicMode: planned.heuristicMode,\n };\n}\n\nexport function computeArtifactCandidateFetchLimit(\n targetCount: number,\n): number {\n const cappedTarget = Math.max(0, targetCount);\n if (cappedTarget === 0) return 0;\n const headroom = Math.max(8, cappedTarget * 4);\n return Math.min(200, cappedTarget + headroom);\n}\n\nexport function computeQmdHybridFetchLimit(\n recallFetchLimit: number,\n artifactsEnabled: boolean,\n maxArtifactRecall: number,\n): number {\n const cappedRecallLimit = Math.max(0, recallFetchLimit);\n if (cappedRecallLimit === 0) return 0;\n if (!artifactsEnabled) return cappedRecallLimit;\n // Overscan when artifacts are enabled, then filter artifact paths before\n // re-applying the recall cap to avoid artifact-dominated top-N starvation.\n const artifactHeadroom = Math.max(20, Math.max(0, maxArtifactRecall) * 8);\n return Math.min(400, cappedRecallLimit + artifactHeadroom);\n}\n\nexport function summarizeGraphShadowComparison(\n baseline: QmdSearchResult[],\n merged: QmdSearchResult[],\n topN: number,\n): {\n baselineCount: number;\n graphCount: number;\n overlapCount: number;\n overlapRatio: number;\n averageOverlapDelta: number;\n} {\n const limit = Math.max(0, Math.floor(topN));\n const baselineTop = limit > 0 ? baseline.slice(0, limit) : [];\n const graphTop = limit > 0 ? merged.slice(0, limit) : [];\n const baselineByPath = new Map(\n baselineTop.map((item) => [item.path, item.score]),\n );\n const graphByPath = new Map(graphTop.map((item) => [item.path, item.score]));\n\n let overlapCount = 0;\n let overlapDeltaSum = 0;\n for (const [p, baselineScore] of baselineByPath.entries()) {\n const graphScore = graphByPath.get(p);\n if (typeof graphScore !== \"number\") continue;\n overlapCount += 1;\n overlapDeltaSum += graphScore - baselineScore;\n }\n\n const baselineCount = baselineTop.length;\n return {\n baselineCount,\n graphCount: graphTop.length,\n overlapCount,\n overlapRatio: baselineCount > 0 ? overlapCount / baselineCount : 0,\n averageOverlapDelta: overlapCount > 0 ? overlapDeltaSum / overlapCount : 0,\n };\n}\n\nexport function parseGraphRecallRankedResults(\n value: unknown,\n): GraphRecallRankedResult[] {\n if (!Array.isArray(value)) return [];\n const parsed: GraphRecallRankedResult[] = [];\n for (const entry of value) {\n if (!entry || typeof entry !== \"object\") continue;\n const candidate = entry as Partial<GraphRecallRankedResult>;\n if (\n typeof candidate.path !== \"string\" ||\n typeof candidate.score !== \"number\"\n )\n continue;\n parsed.push({\n path: candidate.path,\n score: candidate.score,\n docid: typeof candidate.docid === \"string\" ? candidate.docid : undefined,\n sourceLabels: Array.isArray(candidate.sourceLabels)\n ? candidate.sourceLabels.filter(\n (item): item is string => typeof item === \"string\",\n )\n : [],\n });\n }\n return parsed.slice(0, 64);\n}\n\nexport function parseMemoryIntentSnapshot(value: unknown): MemoryIntent {\n const candidate =\n value && typeof value === \"object\" ? (value as Partial<MemoryIntent>) : {};\n return {\n goal: typeof candidate.goal === \"string\" ? candidate.goal : \"unknown\",\n actionType:\n typeof candidate.actionType === \"string\"\n ? candidate.actionType\n : \"unknown\",\n entityTypes: Array.isArray(candidate.entityTypes)\n ? candidate.entityTypes.filter(\n (item): item is string => typeof item === \"string\",\n )\n : [],\n taskInitiation: candidate.taskInitiation === true,\n };\n}\n\nexport function buildQmdIntentHint(intent: MemoryIntent): string | undefined {\n const parts: string[] = [];\n if (intent.goal !== \"unknown\") {\n parts.push(`goal:${intent.goal.replace(/_/g, \" \")}`);\n }\n if (intent.actionType !== \"unknown\") {\n parts.push(`action:${intent.actionType.replace(/_/g, \" \")}`);\n }\n if (intent.entityTypes.length > 0) {\n parts.push(`entities:${intent.entityTypes.join(\",\")}`);\n }\n if (intent.taskInitiation === true) {\n parts.push(\"task_initiation\");\n }\n return parts.length > 0 ? parts.join(\" \") : undefined;\n}\n\nexport function parseQmdRecallResults(value: unknown): QmdSearchResult[] {\n if (!Array.isArray(value)) return [];\n const parsed: QmdSearchResult[] = [];\n for (const entry of value) {\n if (!entry || typeof entry !== \"object\") continue;\n const candidate = entry as Partial<QmdSearchResult>;\n if (\n typeof candidate.path !== \"string\" ||\n typeof candidate.score !== \"number\"\n )\n continue;\n parsed.push({\n docid: typeof candidate.docid === \"string\" ? candidate.docid : \"\",\n path: candidate.path,\n snippet: typeof candidate.snippet === \"string\" ? candidate.snippet : \"\",\n score: candidate.score,\n explain: parseQmdExplain(candidate.explain),\n transport:\n candidate.transport === \"daemon\" ||\n candidate.transport === \"subprocess\" ||\n candidate.transport === \"hybrid\" ||\n candidate.transport === \"scoped_prefilter\"\n ? candidate.transport\n : undefined,\n });\n }\n return parsed.slice(0, 32);\n}\n\nexport function mergeArtifactRecallCandidates(\n candidatesByNamespace: MemoryFile[][],\n limit: number,\n): MemoryFile[] {\n const cappedLimit = Math.max(0, limit);\n if (cappedLimit === 0) return [];\n\n const out: MemoryFile[] = [];\n const seen = new Set<string>();\n let offset = 0;\n while (out.length < cappedLimit) {\n let hasAnyCandidateAtOffset = false;\n for (const list of candidatesByNamespace) {\n if (offset >= list.length) continue;\n hasAnyCandidateAtOffset = true;\n const item = list[offset];\n const dedupeKey = `${item.frontmatter.id}:${item.frontmatter.sourceMemoryId ?? \"\"}:${item.content}`;\n if (seen.has(dedupeKey)) continue;\n seen.add(dedupeKey);\n out.push(item);\n if (out.length >= cappedLimit) break;\n }\n if (!hasAnyCandidateAtOffset) break;\n offset += 1;\n }\n return out;\n}\n\nexport function resolveRecentThreadMemoryPaths(options: {\n threadEpisodeIds: string[];\n currentMemoryId: string;\n allMemsForGraph: MemoryFile[] | null | undefined;\n pathById?: Map<string, string>;\n storageDir: string;\n maxRecent: number;\n}): string[] {\n const maxRecent = Math.max(0, options.maxRecent);\n if (options.threadEpisodeIds.length === 0 || maxRecent === 0) return [];\n const pathById =\n options.pathById ??\n buildMemoryPathById(options.allMemsForGraph, options.storageDir);\n if (pathById.size === 0) return [];\n\n // #1635 (defensive): skip pending_review ids from legacy episode sets.\n const pendingReviewIds = new Set<string>(\n (options.allMemsForGraph ?? [])\n .filter((m) => m.frontmatter.status === \"pending_review\" && m.frontmatter.id)\n .map((m) => m.frontmatter.id as string),\n );\n\n return options.threadEpisodeIds\n .filter((id) => id !== options.currentMemoryId)\n .filter((id) => !pendingReviewIds.has(id))\n .slice(-maxRecent)\n .map((id) => pathById.get(id))\n .filter((p): p is string => typeof p === \"string\" && p.length > 0);\n}\n\nexport function buildMemoryPathById(\n allMemsForGraph: MemoryFile[] | null | undefined,\n storageDir: string,\n): Map<string, string> {\n const pathById = new Map<string, string>();\n for (const mem of allMemsForGraph ?? []) {\n const id = mem.frontmatter.id;\n if (!id) continue;\n pathById.set(id, path.relative(storageDir, mem.path));\n }\n return pathById;\n}\n\nexport function appendMemoryToGraphContext(options: {\n allMemsForGraph: MemoryFile[] | null | undefined;\n storageDir: string;\n memoryRelPath: string;\n memoryId: string;\n category: MemoryFile[\"frontmatter\"][\"category\"];\n content: string;\n entityRef: string | undefined;\n}): void {\n if (!Array.isArray(options.allMemsForGraph)) return;\n\n const nowIso = new Date().toISOString();\n options.allMemsForGraph.push({\n path: path.join(options.storageDir, options.memoryRelPath),\n content: options.content,\n frontmatter: {\n id: options.memoryId,\n category: options.category,\n created: nowIso,\n updated: nowIso,\n source: \"extraction\",\n confidence: 0.8,\n confidenceTier: \"implied\",\n tags: [],\n entityRef: options.entityRef,\n status: \"active\",\n },\n });\n}\n\nexport function resolvePersistedMemoryRelativePath(options: {\n memoryId: string;\n pathById: Map<string, string>;\n category: string;\n}): string {\n const persisted = options.pathById.get(options.memoryId);\n if (persisted) return persisted;\n if (options.category === \"correction\") {\n return path.join(\"corrections\", `${options.memoryId}.md`);\n }\n // Pick the subtree that matches the StorageManager.writeMemory routing\n // so fallback paths (used before memoryPathById has seen the fresh\n // write) agree with where the file actually lives. Routing goes through\n // the shared categoryDirName() chokepoint (utils/category-dir.ts) so\n // every category — decisions/, preferences/, reasoning-traces/, ... —\n // resolves to the same dir the writer used; otherwise graph edges point\n // at the wrong subtree and graph expansion silently drops those nodes\n // when readMemoryByPath cannot resolve them (issue #564 PR 3 / #1546).\n const subtree = categoryDirName(options.category);\n const idParts = options.memoryId.split(\"-\");\n const maybeTimestamp = Number(idParts[1]);\n if (Number.isFinite(maybeTimestamp) && maybeTimestamp > 0) {\n const day = new Date(maybeTimestamp).toISOString().slice(0, 10);\n return path.join(subtree, day, `${options.memoryId}.md`);\n }\n return path.join(subtree, `${options.memoryId}.md`);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAAS,kBAAkB;AAC3B,OAAO,QAAQ;AACf,OAAO,UAAU;AAkBV,IAAM,+BAA+B;AAYrC,IAAM,qCAAN,cAAiD,MAAM;AAAA,EACnD;AAAA,EAEA;AAAA,EAET,YACE,SACA,eACA,eACA;AACA,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,gBAAgB;AACrB,SAAK,gBAAgB;AAAA,EACvB;AACF;AA0GO,SAAS,8BACd,QAMoB;AAOpB,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,EACX;AACA,QAAM,cAAqB;AAC3B,OAAK;AACL,SAAO;AACT;AA6FO,IAAM,mBAAmB;AAEzB,SAAS,qBACd,QACA,UAAU,kBACJ;AACN,iBAAqB,QAAQ,OAAO;AACtC;AAEA,eAAsB,gBACpB,SACA,QACA,UAAU,kBACE;AACZ,uBAAqB,QAAQ,OAAO;AACpC,MAAI,CAAC,OAAQ,QAAO;AAEpB,MAAI,UAA+B;AACnC,QAAM,eAAe,IAAI,QAAW,CAAC,UAAU,WAAW;AACxD,cAAU,MAAM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,KAAK,eAAe,GAAG,QAAQ,QAAQ,KAAK;AAAA,EAC1D;AASA,QAAM,UAAU,gBAAgB,QAAQ,QAAQ;AAChD,QAAM,UAAU,QAAQ,SAAS,MAAM,GAAG;AAC1C,QAAM,iBAAiB,OAAO,QAAQ,CAAC,CAAC;AACxC,MAAI,OAAO,SAAS,cAAc,KAAK,iBAAiB,GAAG;AACzD,UAAM,MAAM,IAAI,KAAK,cAAc,EAAE,YAAY,EAAE,MAAM,GAAG,EAAE;AAC9D,WAAO,KAAK,KAAK,SAAS,KAAK,GAAG,QAAQ,QAAQ,KAAK;AAAA,EACzD;AACA,SAAO,KAAK,KAAK,SAAS,GAAG,QAAQ,QAAQ,KAAK;AACpD;","names":["buildCompressionGuidelinesMarkdown"]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  resolveDefaultNamespaceRoot,
3
3
  resolveNamespaceStorageRoot
4
- } from "./chunk-I33QYUAF.js";
4
+ } from "./chunk-3YQ7VLP3.js";
5
5
  import {
6
6
  MutationSerializer,
7
7
  withHeldFileLock
@@ -1473,4 +1473,4 @@ export {
1473
1473
  isNamespaceKind,
1474
1474
  NamespaceCatalog
1475
1475
  };
1476
- //# sourceMappingURL=chunk-P66QH6R6.js.map
1476
+ //# sourceMappingURL=chunk-GKKLI23D.js.map