@remnic/core 9.69.75 → 9.69.76

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 (250) hide show
  1. package/dist/access-admin-ops-surface.js +25 -26
  2. package/dist/access-authorization-probe.js +26 -27
  3. package/dist/access-boundary.js +25 -26
  4. package/dist/access-cli.js +71 -72
  5. package/dist/access-cli.js.map +1 -1
  6. package/dist/access-extraction-force-flush.js +25 -26
  7. package/dist/access-http-briefing.js +26 -27
  8. package/dist/access-http-query.js +27 -28
  9. package/dist/access-http.js +42 -43
  10. package/dist/access-identity-continuity-surface.js +25 -26
  11. package/dist/access-lcm-surface.js +25 -26
  12. package/dist/access-mcp.js +35 -36
  13. package/dist/access-namespace-preflight.js +25 -26
  14. package/dist/access-observe-write-category.js +2 -2
  15. package/dist/access-observe-write-surface.js +25 -26
  16. package/dist/access-offline-manifest.js +3 -3
  17. package/dist/access-operations-batch.js +26 -27
  18. package/dist/access-operations.js +33 -34
  19. package/dist/access-recall-concurrency.js +25 -26
  20. package/dist/access-recall-diagnostics.js +2 -2
  21. package/dist/access-recall-response.js +25 -26
  22. package/dist/access-recall-surface.js +25 -26
  23. package/dist/access-service.js +25 -26
  24. package/dist/access-surface-catalog.js +27 -28
  25. package/dist/access-surface-catalog.js.map +1 -1
  26. package/dist/active-recall.js +5 -4
  27. package/dist/active-recall.js.map +1 -1
  28. package/dist/{auto-sync-QJNIKZHV.js → auto-sync-WEUDMXUW.js} +4 -4
  29. package/dist/briefing.js +5 -4
  30. package/dist/buffer.js +4 -4
  31. package/dist/causal-consolidation.js +6 -5
  32. package/dist/causal-consolidation.js.map +1 -1
  33. package/dist/{chunk-IGSVMAPQ.js → chunk-252U6XYX.js} +2 -2
  34. package/dist/{chunk-IXLHREAB.js → chunk-2MLWQMXH.js} +2 -2
  35. package/dist/{chunk-HZDOLAZV.js → chunk-34R75BVF.js} +2 -2
  36. package/dist/{chunk-Y52T5Y6B.js → chunk-364F6EMG.js} +2 -2
  37. package/dist/{chunk-YMSPN4W4.js → chunk-4MONIKIY.js} +2 -2
  38. package/dist/{chunk-OB2YI57R.js → chunk-5D6IMOW6.js} +19 -19
  39. package/dist/{chunk-NF6LF76X.js → chunk-5ELXQQY7.js} +2 -2
  40. package/dist/{chunk-ZUT4FK5W.js → chunk-5Z574AVZ.js} +2 -2
  41. package/dist/{chunk-MKNENZCK.js → chunk-6FJCKMSJ.js} +3 -3
  42. package/dist/{chunk-7COBZFUF.js → chunk-6OR3AQHP.js} +2 -2
  43. package/dist/{chunk-ZPED47SP.js → chunk-6RBUAPQT.js} +18 -24
  44. package/dist/chunk-6RBUAPQT.js.map +1 -0
  45. package/dist/{chunk-WQC54W25.js → chunk-6VQFPA3J.js} +2 -2
  46. package/dist/{chunk-AQJBFLUA.js → chunk-74C5FI4S.js} +5 -5
  47. package/dist/{chunk-GFD7TWAZ.js → chunk-AV5K5QH4.js} +4 -4
  48. package/dist/{chunk-5KNEOYTF.js → chunk-BFDBLAVG.js} +2 -2
  49. package/dist/{chunk-IGEZE6QB.js → chunk-BMYZTZ5D.js} +4 -4
  50. package/dist/{chunk-7JFQI6DQ.js → chunk-BOUFVFV2.js} +2 -2
  51. package/dist/{chunk-CGO3A7SR.js → chunk-BRBB62TS.js} +2 -2
  52. package/dist/{chunk-GZBNEZIU.js → chunk-DBYAY6UW.js} +3 -3
  53. package/dist/{chunk-U3NBO4IX.js → chunk-FAT6HY7N.js} +119 -37
  54. package/dist/chunk-FAT6HY7N.js.map +1 -0
  55. package/dist/{chunk-S5FWSNLI.js → chunk-FCVPZIHF.js} +2 -2
  56. package/dist/{chunk-B5EZWPSM.js → chunk-FUWW7ED4.js} +2 -2
  57. package/dist/{chunk-YCYFXA6P.js → chunk-GN7YTM5I.js} +2 -2
  58. package/dist/{chunk-XDOXR3U6.js → chunk-HC4RWJR3.js} +2 -2
  59. package/dist/{chunk-JOMGKV72.js → chunk-HKPGEFIT.js} +2 -2
  60. package/dist/{chunk-MB3HMRXM.js → chunk-I6PZTU3Q.js} +2 -2
  61. package/dist/{chunk-6BSPRNFF.js → chunk-IGJL6JOD.js} +2 -2
  62. package/dist/{chunk-LH6UP5SR.js → chunk-IV2CY3RE.js} +3 -3
  63. package/dist/{chunk-5LPDXYU3.js → chunk-J3NN2Q4Z.js} +4 -4
  64. package/dist/{chunk-LDOURFFA.js → chunk-JBHCTDYF.js} +2 -2
  65. package/dist/{chunk-D4SPMHEW.js → chunk-JLPNONPH.js} +2 -2
  66. package/dist/{chunk-62AE2EUZ.js → chunk-JOAR32R6.js} +2 -2
  67. package/dist/{chunk-YYRMOMX3.js → chunk-JU5MAF2L.js} +2 -2
  68. package/dist/{chunk-AEGQ5PJ7.js → chunk-JX6USXZR.js} +2 -2
  69. package/dist/{chunk-VEBYLZQQ.js → chunk-KN6CIN7I.js} +2 -2
  70. package/dist/{chunk-UJX4I26O.js → chunk-KOXUUJE3.js} +2 -2
  71. package/dist/{chunk-5UBH37SL.js → chunk-LI76ESJL.js} +4 -4
  72. package/dist/{chunk-HPK66ZM5.js → chunk-LTS2XIU3.js} +2 -2
  73. package/dist/{chunk-ZVTG7JTG.js → chunk-MKGIW5W6.js} +2 -2
  74. package/dist/{chunk-5LWVTSF7.js → chunk-MOQPEFLN.js} +4 -4
  75. package/dist/{chunk-6JA22L5X.js → chunk-N25RPRSI.js} +8 -8
  76. package/dist/{chunk-VXNWOHOR.js → chunk-N6TUO3O6.js} +2 -2
  77. package/dist/{chunk-5HP5F2SQ.js → chunk-NC7OAEYY.js} +2 -2
  78. package/dist/{chunk-JDES3G7T.js → chunk-NQBD3R24.js} +2 -2
  79. package/dist/{chunk-S52VKUUW.js → chunk-NRPLDEFR.js} +2 -2
  80. package/dist/{chunk-MSRNAAWW.js → chunk-OH6AMNSA.js} +2 -2
  81. package/dist/{chunk-B6PY25JB.js → chunk-OIKX22FU.js} +1 -1
  82. package/dist/{chunk-WZKKI6S2.js → chunk-OJMAM4RO.js} +2 -2
  83. package/dist/{chunk-AWEMJYN2.js → chunk-OOWUOWXK.js} +2 -2
  84. package/dist/{chunk-BXCZPPRO.js → chunk-P2FJ2KYJ.js} +12 -12
  85. package/dist/{chunk-F5O6WEDO.js → chunk-PWF4JXKD.js} +1 -1
  86. package/dist/chunk-PWF4JXKD.js.map +1 -0
  87. package/dist/{chunk-ODP62HIA.js → chunk-RQIETS2K.js} +2 -2
  88. package/dist/{chunk-UFBHEMNR.js → chunk-SFDZ66MD.js} +2 -2
  89. package/dist/{chunk-YR6A6ZK7.js → chunk-SSUDD72S.js} +2 -2
  90. package/dist/{chunk-O4QH33GV.js → chunk-TWUMZCGA.js} +5 -5
  91. package/dist/{chunk-25LKLNSJ.js → chunk-TYR4D4GH.js} +2 -2
  92. package/dist/{chunk-SA2JMMMS.js → chunk-UHKME3I7.js} +2 -2
  93. package/dist/{chunk-COHJUEBQ.js → chunk-VKWMW32Y.js} +2 -2
  94. package/dist/{chunk-YF3JERFZ.js → chunk-VL4X7ZHC.js} +2 -2
  95. package/dist/{chunk-6BFW7SGF.js → chunk-W5VYWOU3.js} +2 -2
  96. package/dist/{chunk-KMHE76A2.js → chunk-WZ7M2QRP.js} +2 -2
  97. package/dist/{chunk-WDP7CJZQ.js → chunk-XC4MDMQE.js} +4 -4
  98. package/dist/{chunk-LBL77UXO.js → chunk-XIA4CN3T.js} +3 -3
  99. package/dist/{chunk-GH5YSAAI.js → chunk-XLLRMUMH.js} +5 -4
  100. package/dist/chunk-XLLRMUMH.js.map +1 -0
  101. package/dist/{chunk-TY5JOP2W.js → chunk-XNTIX4LA.js} +45 -33
  102. package/dist/chunk-XNTIX4LA.js.map +1 -0
  103. package/dist/{chunk-I6Y6QKWF.js → chunk-XQSAPG34.js} +2 -2
  104. package/dist/{chunk-VIRTAUJO.js → chunk-Y37KZVUM.js} +2 -2
  105. package/dist/{chunk-WDBKDYK2.js → chunk-YNNXM6FN.js} +27 -27
  106. package/dist/{chunk-SB4ZWVKI.js → chunk-YPWOZ6ME.js} +3 -5
  107. package/dist/{chunk-SB4ZWVKI.js.map → chunk-YPWOZ6ME.js.map} +1 -1
  108. package/dist/{chunk-KPSJA45G.js → chunk-YYI5DZAQ.js} +2 -2
  109. package/dist/cli.js +56 -57
  110. package/dist/coding/export-okf-codegraph.js +5 -4
  111. package/dist/coding/export-okf-codegraph.js.map +1 -1
  112. package/dist/compounding/engine.js +5 -4
  113. package/dist/config.d.ts.map +1 -1
  114. package/dist/config.js +5 -4
  115. package/dist/connectors/codex-materialize-runner.js +5 -4
  116. package/dist/connectors/index.js +5 -4
  117. package/dist/convergence-refresh.js +7 -7
  118. package/dist/corpus-watermark.js +7 -6
  119. package/dist/directory-sidecars.d.ts +3 -0
  120. package/dist/directory-sidecars.d.ts.map +1 -1
  121. package/dist/directory-sidecars.js +7 -4
  122. package/dist/entity-retrieval.js +5 -4
  123. package/dist/external-wiki-access.js +26 -27
  124. package/dist/extraction.js +9 -9
  125. package/dist/harmonic-retrieval.js +1 -1
  126. package/dist/index.js +74 -75
  127. package/dist/location/index.js +8 -8
  128. package/dist/maintenance/memory-governance.js +5 -4
  129. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +5 -5
  130. package/dist/maintenance/rebuild-memory-projection.js +6 -6
  131. package/dist/memory-browse-operations.js +26 -27
  132. package/dist/memory-browse.js +3 -4
  133. package/dist/namespaces/migrate.js +6 -5
  134. package/dist/namespaces/storage.js +5 -4
  135. package/dist/offline-sync-impression-drain.js +2 -2
  136. package/dist/operator-doctor-corpus.js +8 -7
  137. package/dist/operator-toolkit.js +14 -13
  138. package/dist/orchestration/maintenance.js +14 -14
  139. package/dist/orchestration/recall-search-pipeline.d.ts.map +1 -1
  140. package/dist/orchestrator.d.ts.map +1 -1
  141. package/dist/orchestrator.js +71 -72
  142. package/dist/recall-explain-renderer.js +3 -3
  143. package/dist/recall-navigate-access.js +2 -2
  144. package/dist/recall-navigate-disclosure.js +2 -2
  145. package/dist/recall-navigate.js +2 -2
  146. package/dist/recall-navigation-operations.js +26 -27
  147. package/dist/recall-navigation.js +25 -26
  148. package/dist/recall-state-view-admission.js +3 -4
  149. package/dist/recall-state.js +2 -2
  150. package/dist/recall-why-service.js +3 -4
  151. package/dist/recall-xray-cli.js +4 -4
  152. package/dist/recall-xray-renderer.js +3 -3
  153. package/dist/recall-xray.js +2 -2
  154. package/dist/resume-bundles.js +6 -5
  155. package/dist/semantic-consolidation.js +6 -5
  156. package/dist/semantic-rule-promotion.js +5 -4
  157. package/dist/semantic-rule-verifier.js +5 -4
  158. package/dist/source-agent-qualifier.js +8 -8
  159. package/dist/standup/build.js +5 -4
  160. package/dist/storage.d.ts +1 -19
  161. package/dist/storage.d.ts.map +1 -1
  162. package/dist/storage.js +4 -3
  163. package/dist/support-passport/index.js +28 -29
  164. package/dist/transfer/export-okf.js +6 -5
  165. package/dist/types.d.ts +3 -3
  166. package/dist/types.d.ts.map +1 -1
  167. package/dist/types.js +1 -1
  168. package/dist/verified-recall.js +5 -4
  169. package/dist/who-knows-cli.js +6 -5
  170. package/dist/who-knows.js +5 -4
  171. package/package.json +2 -2
  172. package/src/config.ts +2 -3
  173. package/src/directory-sidecars-config.test.ts +34 -0
  174. package/src/directory-sidecars.ts +27 -6
  175. package/src/orchestration/recall-search-pipeline.ts +4 -6
  176. package/src/orchestrator.ts +8 -0
  177. package/src/storage.ts +13 -22
  178. package/src/types.ts +3 -3
  179. package/dist/chunk-F5O6WEDO.js.map +0 -1
  180. package/dist/chunk-GH5YSAAI.js.map +0 -1
  181. package/dist/chunk-PCEYGOSL.js +0 -66
  182. package/dist/chunk-PCEYGOSL.js.map +0 -1
  183. package/dist/chunk-TY5JOP2W.js.map +0 -1
  184. package/dist/chunk-U3NBO4IX.js.map +0 -1
  185. package/dist/chunk-ZPED47SP.js.map +0 -1
  186. /package/dist/{auto-sync-QJNIKZHV.js.map → auto-sync-WEUDMXUW.js.map} +0 -0
  187. /package/dist/{chunk-IGSVMAPQ.js.map → chunk-252U6XYX.js.map} +0 -0
  188. /package/dist/{chunk-IXLHREAB.js.map → chunk-2MLWQMXH.js.map} +0 -0
  189. /package/dist/{chunk-HZDOLAZV.js.map → chunk-34R75BVF.js.map} +0 -0
  190. /package/dist/{chunk-Y52T5Y6B.js.map → chunk-364F6EMG.js.map} +0 -0
  191. /package/dist/{chunk-YMSPN4W4.js.map → chunk-4MONIKIY.js.map} +0 -0
  192. /package/dist/{chunk-OB2YI57R.js.map → chunk-5D6IMOW6.js.map} +0 -0
  193. /package/dist/{chunk-NF6LF76X.js.map → chunk-5ELXQQY7.js.map} +0 -0
  194. /package/dist/{chunk-ZUT4FK5W.js.map → chunk-5Z574AVZ.js.map} +0 -0
  195. /package/dist/{chunk-MKNENZCK.js.map → chunk-6FJCKMSJ.js.map} +0 -0
  196. /package/dist/{chunk-7COBZFUF.js.map → chunk-6OR3AQHP.js.map} +0 -0
  197. /package/dist/{chunk-WQC54W25.js.map → chunk-6VQFPA3J.js.map} +0 -0
  198. /package/dist/{chunk-AQJBFLUA.js.map → chunk-74C5FI4S.js.map} +0 -0
  199. /package/dist/{chunk-GFD7TWAZ.js.map → chunk-AV5K5QH4.js.map} +0 -0
  200. /package/dist/{chunk-5KNEOYTF.js.map → chunk-BFDBLAVG.js.map} +0 -0
  201. /package/dist/{chunk-IGEZE6QB.js.map → chunk-BMYZTZ5D.js.map} +0 -0
  202. /package/dist/{chunk-7JFQI6DQ.js.map → chunk-BOUFVFV2.js.map} +0 -0
  203. /package/dist/{chunk-CGO3A7SR.js.map → chunk-BRBB62TS.js.map} +0 -0
  204. /package/dist/{chunk-GZBNEZIU.js.map → chunk-DBYAY6UW.js.map} +0 -0
  205. /package/dist/{chunk-S5FWSNLI.js.map → chunk-FCVPZIHF.js.map} +0 -0
  206. /package/dist/{chunk-B5EZWPSM.js.map → chunk-FUWW7ED4.js.map} +0 -0
  207. /package/dist/{chunk-YCYFXA6P.js.map → chunk-GN7YTM5I.js.map} +0 -0
  208. /package/dist/{chunk-XDOXR3U6.js.map → chunk-HC4RWJR3.js.map} +0 -0
  209. /package/dist/{chunk-JOMGKV72.js.map → chunk-HKPGEFIT.js.map} +0 -0
  210. /package/dist/{chunk-MB3HMRXM.js.map → chunk-I6PZTU3Q.js.map} +0 -0
  211. /package/dist/{chunk-6BSPRNFF.js.map → chunk-IGJL6JOD.js.map} +0 -0
  212. /package/dist/{chunk-LH6UP5SR.js.map → chunk-IV2CY3RE.js.map} +0 -0
  213. /package/dist/{chunk-5LPDXYU3.js.map → chunk-J3NN2Q4Z.js.map} +0 -0
  214. /package/dist/{chunk-LDOURFFA.js.map → chunk-JBHCTDYF.js.map} +0 -0
  215. /package/dist/{chunk-D4SPMHEW.js.map → chunk-JLPNONPH.js.map} +0 -0
  216. /package/dist/{chunk-62AE2EUZ.js.map → chunk-JOAR32R6.js.map} +0 -0
  217. /package/dist/{chunk-YYRMOMX3.js.map → chunk-JU5MAF2L.js.map} +0 -0
  218. /package/dist/{chunk-AEGQ5PJ7.js.map → chunk-JX6USXZR.js.map} +0 -0
  219. /package/dist/{chunk-VEBYLZQQ.js.map → chunk-KN6CIN7I.js.map} +0 -0
  220. /package/dist/{chunk-UJX4I26O.js.map → chunk-KOXUUJE3.js.map} +0 -0
  221. /package/dist/{chunk-5UBH37SL.js.map → chunk-LI76ESJL.js.map} +0 -0
  222. /package/dist/{chunk-HPK66ZM5.js.map → chunk-LTS2XIU3.js.map} +0 -0
  223. /package/dist/{chunk-ZVTG7JTG.js.map → chunk-MKGIW5W6.js.map} +0 -0
  224. /package/dist/{chunk-5LWVTSF7.js.map → chunk-MOQPEFLN.js.map} +0 -0
  225. /package/dist/{chunk-6JA22L5X.js.map → chunk-N25RPRSI.js.map} +0 -0
  226. /package/dist/{chunk-VXNWOHOR.js.map → chunk-N6TUO3O6.js.map} +0 -0
  227. /package/dist/{chunk-5HP5F2SQ.js.map → chunk-NC7OAEYY.js.map} +0 -0
  228. /package/dist/{chunk-JDES3G7T.js.map → chunk-NQBD3R24.js.map} +0 -0
  229. /package/dist/{chunk-S52VKUUW.js.map → chunk-NRPLDEFR.js.map} +0 -0
  230. /package/dist/{chunk-MSRNAAWW.js.map → chunk-OH6AMNSA.js.map} +0 -0
  231. /package/dist/{chunk-B6PY25JB.js.map → chunk-OIKX22FU.js.map} +0 -0
  232. /package/dist/{chunk-WZKKI6S2.js.map → chunk-OJMAM4RO.js.map} +0 -0
  233. /package/dist/{chunk-AWEMJYN2.js.map → chunk-OOWUOWXK.js.map} +0 -0
  234. /package/dist/{chunk-BXCZPPRO.js.map → chunk-P2FJ2KYJ.js.map} +0 -0
  235. /package/dist/{chunk-ODP62HIA.js.map → chunk-RQIETS2K.js.map} +0 -0
  236. /package/dist/{chunk-UFBHEMNR.js.map → chunk-SFDZ66MD.js.map} +0 -0
  237. /package/dist/{chunk-YR6A6ZK7.js.map → chunk-SSUDD72S.js.map} +0 -0
  238. /package/dist/{chunk-O4QH33GV.js.map → chunk-TWUMZCGA.js.map} +0 -0
  239. /package/dist/{chunk-25LKLNSJ.js.map → chunk-TYR4D4GH.js.map} +0 -0
  240. /package/dist/{chunk-SA2JMMMS.js.map → chunk-UHKME3I7.js.map} +0 -0
  241. /package/dist/{chunk-COHJUEBQ.js.map → chunk-VKWMW32Y.js.map} +0 -0
  242. /package/dist/{chunk-YF3JERFZ.js.map → chunk-VL4X7ZHC.js.map} +0 -0
  243. /package/dist/{chunk-6BFW7SGF.js.map → chunk-W5VYWOU3.js.map} +0 -0
  244. /package/dist/{chunk-KMHE76A2.js.map → chunk-WZ7M2QRP.js.map} +0 -0
  245. /package/dist/{chunk-WDP7CJZQ.js.map → chunk-XC4MDMQE.js.map} +0 -0
  246. /package/dist/{chunk-LBL77UXO.js.map → chunk-XIA4CN3T.js.map} +0 -0
  247. /package/dist/{chunk-I6Y6QKWF.js.map → chunk-XQSAPG34.js.map} +0 -0
  248. /package/dist/{chunk-VIRTAUJO.js.map → chunk-Y37KZVUM.js.map} +0 -0
  249. /package/dist/{chunk-WDBKDYK2.js.map → chunk-YNNXM6FN.js.map} +0 -0
  250. /package/dist/{chunk-KPSJA45G.js.map → chunk-YYI5DZAQ.js.map} +0 -0
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-5JMAGU26.js";
6
6
  import {
7
7
  runPostConsolidationMaterialize
8
- } from "./chunk-6BFW7SGF.js";
8
+ } from "./chunk-W5VYWOU3.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-I6Y6QKWF.js.map
223
+ //# sourceMappingURL=chunk-XQSAPG34.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  listNamespaces
3
- } from "./chunk-5HP5F2SQ.js";
3
+ } from "./chunk-NC7OAEYY.js";
4
4
  import {
5
5
  capabilityAllowsNamespace
6
6
  } from "./chunk-IG747LRN.js";
@@ -282,4 +282,4 @@ export {
282
282
  computeServiceCorpusWatermarks,
283
283
  computeServiceCorpusCensus
284
284
  };
285
- //# sourceMappingURL=chunk-VIRTAUJO.js.map
285
+ //# sourceMappingURL=chunk-Y37KZVUM.js.map
@@ -19,7 +19,7 @@ import {
19
19
  import {
20
20
  exportOkfBundle,
21
21
  parseIncludeStatus
22
- } from "./chunk-GFD7TWAZ.js";
22
+ } from "./chunk-AV5K5QH4.js";
23
23
  import {
24
24
  exportSqlite
25
25
  } from "./chunk-BV2TIZ4F.js";
@@ -58,7 +58,7 @@ import {
58
58
  } from "./chunk-IIFFC3RL.js";
59
59
  import {
60
60
  rebuildMemoryLifecycleLedger
61
- } from "./chunk-ODP62HIA.js";
61
+ } from "./chunk-RQIETS2K.js";
62
62
  import {
63
63
  rebuildObservations
64
64
  } from "./chunk-DQTCGVFK.js";
@@ -73,13 +73,13 @@ import {
73
73
  } from "./chunk-HSSERO3E.js";
74
74
  import {
75
75
  lintOkfDir
76
- } from "./chunk-UJX4I26O.js";
76
+ } from "./chunk-KOXUUJE3.js";
77
77
  import {
78
78
  runCompatChecks
79
79
  } from "./chunk-2524MOWK.js";
80
80
  import {
81
81
  searchVerifiedEpisodes
82
- } from "./chunk-YCYFXA6P.js";
82
+ } from "./chunk-GN7YTM5I.js";
83
83
  import {
84
84
  getUtilityLearningStatus,
85
85
  learnUtilityPromotionWeights
@@ -93,15 +93,15 @@ import {
93
93
  } from "./chunk-OJP3N7UK.js";
94
94
  import {
95
95
  promoteSemanticRuleFromMemory
96
- } from "./chunk-SA2JMMMS.js";
96
+ } from "./chunk-UHKME3I7.js";
97
97
  import {
98
98
  searchVerifiedSemanticRules
99
- } from "./chunk-25LKLNSJ.js";
99
+ } from "./chunk-TYR4D4GH.js";
100
100
  import {
101
101
  buildResumeBundleFromState,
102
102
  getResumeBundleStatus,
103
103
  recordResumeBundle
104
- } from "./chunk-VXNWOHOR.js";
104
+ } from "./chunk-N6TUO3O6.js";
105
105
  import {
106
106
  getWorkProductLedgerStatus,
107
107
  recordWorkProductLedgerEntry,
@@ -112,7 +112,7 @@ import {
112
112
  } from "./chunk-AM4T6CHX.js";
113
113
  import {
114
114
  parseXrayCliOptions
115
- } from "./chunk-GZBNEZIU.js";
115
+ } from "./chunk-DBYAY6UW.js";
116
116
  import {
117
117
  collectPatternMemories,
118
118
  explainPatternMemory,
@@ -134,7 +134,7 @@ import {
134
134
  runOperatorInventory,
135
135
  runOperatorRepair,
136
136
  runOperatorSetup
137
- } from "./chunk-6JA22L5X.js";
137
+ } from "./chunk-N25RPRSI.js";
138
138
  import {
139
139
  analyzeSessionIntegrity,
140
140
  applySessionRepair,
@@ -176,7 +176,7 @@ import {
176
176
  rebuildMemoryProjection,
177
177
  repairMemoryProjection,
178
178
  verifyMemoryProjection
179
- } from "./chunk-LH6UP5SR.js";
179
+ } from "./chunk-IV2CY3RE.js";
180
180
  import {
181
181
  buildConnectorRowsFromDefinitions,
182
182
  parseConnectorsListOptions,
@@ -197,7 +197,7 @@ import {
197
197
  } from "./chunk-6TBIWIAG.js";
198
198
  import {
199
199
  parseConfig
200
- } from "./chunk-GH5YSAAI.js";
200
+ } from "./chunk-XLLRMUMH.js";
201
201
  import {
202
202
  applyManagedRegion,
203
203
  expandVaultTemplateTokens,
@@ -210,7 +210,7 @@ import {
210
210
  import {
211
211
  EngramAccessHttpServer,
212
212
  MeetingsInputError
213
- } from "./chunk-BXCZPPRO.js";
213
+ } from "./chunk-P2FJ2KYJ.js";
214
214
  import {
215
215
  WearablesInputError
216
216
  } from "./chunk-V7IZKJI3.js";
@@ -220,10 +220,10 @@ import {
220
220
  loadChatSession,
221
221
  processChatMessage,
222
222
  sessionBelongsToPrincipal
223
- } from "./chunk-5LPDXYU3.js";
223
+ } from "./chunk-J3NN2Q4Z.js";
224
224
  import {
225
225
  EngramAccessService
226
- } from "./chunk-OB2YI57R.js";
226
+ } from "./chunk-5D6IMOW6.js";
227
227
  import {
228
228
  WorkStorage
229
229
  } from "./chunk-MPC7TYTZ.js";
@@ -240,30 +240,30 @@ import {
240
240
  parseRecallExplainFormat,
241
241
  renderRecallExplain,
242
242
  renderXray
243
- } from "./chunk-VEBYLZQQ.js";
243
+ } from "./chunk-KN6CIN7I.js";
244
244
  import {
245
245
  readAggregateExtractionWatermark
246
- } from "./chunk-HZDOLAZV.js";
246
+ } from "./chunk-34R75BVF.js";
247
247
  import {
248
248
  getObjectiveStateStoreStatus
249
249
  } from "./chunk-HM7RHKS4.js";
250
250
  import {
251
251
  journalPath
252
- } from "./chunk-SB4ZWVKI.js";
252
+ } from "./chunk-YPWOZ6ME.js";
253
253
  import {
254
254
  searchHarmonicRetrieval
255
- } from "./chunk-B6PY25JB.js";
255
+ } from "./chunk-OIKX22FU.js";
256
256
  import {
257
257
  listMemoryGovernanceRuns,
258
258
  readMemoryGovernanceRunArtifact,
259
259
  restoreMemoryGovernanceRun,
260
260
  runMemoryGovernance
261
- } from "./chunk-62AE2EUZ.js";
261
+ } from "./chunk-JOAR32R6.js";
262
262
  import {
263
263
  listNamespaces,
264
264
  runNamespaceMigration,
265
265
  verifyNamespaces
266
- } from "./chunk-5HP5F2SQ.js";
266
+ } from "./chunk-NC7OAEYY.js";
267
267
  import {
268
268
  getCueAnchorStoreStatus
269
269
  } from "./chunk-BMWN7B3Y.js";
@@ -303,14 +303,14 @@ import {
303
303
  } from "./chunk-VZBW6CDG.js";
304
304
  import {
305
305
  meetingIdDate
306
- } from "./chunk-ZPED47SP.js";
306
+ } from "./chunk-6RBUAPQT.js";
307
307
  import {
308
308
  isValidTranscriptDate
309
309
  } from "./chunk-UHVXE24Y.js";
310
310
  import {
311
311
  OKF_RESERVED_BASENAMES,
312
312
  okfTypeForCategory
313
- } from "./chunk-PCEYGOSL.js";
313
+ } from "./chunk-FAT6HY7N.js";
314
314
  import {
315
315
  normalizeProjectionPreview
316
316
  } from "./chunk-SCU65EZI.js";
@@ -344,17 +344,17 @@ import {
344
344
  isArchivedMemoryPath,
345
345
  toMemoryPathRel
346
346
  } from "./chunk-7RJUVTVF.js";
347
- import {
348
- writeFileAtomically
349
- } from "./chunk-AW4QUFQF.js";
350
347
  import {
351
348
  assertPathInsideRoot,
352
349
  pathIsInside
353
350
  } from "./chunk-C7HJ3NEI.js";
351
+ import {
352
+ writeFileAtomically
353
+ } from "./chunk-AW4QUFQF.js";
354
354
  import {
355
355
  RECALL_DISCLOSURE_LEVELS,
356
356
  isRecallDisclosure
357
- } from "./chunk-F5O6WEDO.js";
357
+ } from "./chunk-PWF4JXKD.js";
358
358
  import {
359
359
  isSupportPassportPrivateMemory
360
360
  } from "./chunk-PWPIERBM.js";
@@ -10131,4 +10131,4 @@ export {
10131
10131
  listMemoryMarkdownFilePaths,
10132
10132
  registerCli
10133
10133
  };
10134
- //# sourceMappingURL=chunk-WDBKDYK2.js.map
10134
+ //# sourceMappingURL=chunk-YNNXM6FN.js.map
@@ -1,6 +1,3 @@
1
- import {
2
- DIRECTORY_SIDECAR_BASENAME
3
- } from "./chunk-U3NBO4IX.js";
4
1
  import {
5
2
  isActivityDigestPath,
6
3
  isArtifactMemoryPath,
@@ -11,8 +8,9 @@ import {
11
8
  isExternalWikiCollectionName
12
9
  } from "./chunk-JV3C2MNQ.js";
13
10
  import {
11
+ DIRECTORY_SIDECAR_BASENAME,
14
12
  OKF_RESERVED_BASENAMES
15
- } from "./chunk-PCEYGOSL.js";
13
+ } from "./chunk-FAT6HY7N.js";
16
14
  import {
17
15
  isValidActivityDate
18
16
  } from "./chunk-353C5UNV.js";
@@ -213,4 +211,4 @@ export {
213
211
  isGenericRecallExcludedPath,
214
212
  filterRecallCandidates
215
213
  };
216
- //# sourceMappingURL=chunk-SB4ZWVKI.js.map
214
+ //# sourceMappingURL=chunk-YPWOZ6ME.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/activity/journal.ts","../src/orchestration/generic-recall-paths.ts"],"sourcesContent":["/**\n * User-owned daily journal (issue #1984 PR1).\n *\n * Files live at `<memoryDir>/journal/<YYYY-MM-DD>.md` — inside the memory\n * directory but outside scan roots, same placement as activity digests.\n * Once written, Remnic never rewrites the file except `seed` with force.\n * All writes go through writeJournalFile, which stats first.\n */\nimport { mkdirSync, statSync, writeFileSync } from \"node:fs\";\nimport path from \"node:path\";\n\nimport { isValidActivityDate } from \"./digest.js\";\n\nexport const JOURNAL_DIR_NAME = \"journal\";\n\n/** Minimal card shape the seed renderer needs. TimelineCard is assignable. */\nexport interface JournalSeedCard {\n title: string;\n startUtc: string;\n endUtc: string;\n}\n\nexport interface SeedJournalInput {\n memoryDir: string;\n date: string;\n cards?: readonly JournalSeedCard[];\n force?: boolean;\n}\n\nexport interface SeedJournalResult {\n path: string;\n wrote: boolean;\n}\n\nconst JOURNAL_DAY_TOPLEVEL = /^journal[\\\\/]\\d{4}-\\d{2}-\\d{2}\\.md$/i;\nconst JOURNAL_DAY_ANYWHERE = /(?:^|[\\\\/])journal[\\\\/]\\d{4}-\\d{2}-\\d{2}\\.md$/i;\n\nexport function journalPath(memoryDir: string, date: string): string {\n if (!isValidActivityDate(date)) {\n throw new RangeError(`Invalid journal date \"${date}\"; expected YYYY-MM-DD.`);\n }\n return path.join(memoryDir, JOURNAL_DIR_NAME, `${date}.md`);\n}\n\n/**\n * Root-aware journal day-file check. With a memory root, only the top-level\n * `journal/<date>.md` matches so a nested `facts/journal/<date>.md` stays\n * recallable. Without a root, fall back to the day-file shape anywhere.\n */\nexport function isJournalDayPath(filePath: string, memoryRoot?: string): boolean {\n if (memoryRoot !== undefined && memoryRoot.length > 0) {\n const relative = path.relative(memoryRoot, path.resolve(memoryRoot, filePath));\n return JOURNAL_DAY_TOPLEVEL.test(relative);\n }\n return JOURNAL_DAY_ANYWHERE.test(filePath);\n}\n\nexport function todayJournalDate(now: Date = new Date()): string {\n const year = now.getFullYear();\n const month = String(now.getMonth() + 1).padStart(2, \"0\");\n const day = String(now.getDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n}\n\nfunction formatCardDuration(card: JournalSeedCard): string {\n const start = Date.parse(card.startUtc);\n const end = Date.parse(card.endUtc);\n const minutes =\n Number.isFinite(start) && Number.isFinite(end) && end > start\n ? Math.round((end - start) / 60_000)\n : 0;\n return `${minutes}m`;\n}\n\nfunction renderJournalSeed(date: string, cards: readonly JournalSeedCard[]): string {\n const ordered = [...cards].sort((left, right) => {\n const byStart = left.startUtc.localeCompare(right.startUtc);\n return byStart !== 0 ? byStart : left.title.localeCompare(right.title);\n });\n const glance =\n ordered.length === 0\n ? [\"_No cards._\"]\n : ordered.map((card) => `- ${formatCardDuration(card)} ${card.title}`);\n return [`# Journal — ${date}`, \"\", \"## Day at a glance\", \"\", ...glance, \"\", \"## Notes\", \"\", \"\"].join(\n \"\\n\",\n );\n}\n\n/** The only journal write. Stats first; existing files are a no-op unless force. */\nexport function writeJournalFile(filePath: string, content: string, force: boolean): boolean {\n let exists = false;\n try {\n statSync(filePath);\n exists = true;\n } catch (err) {\n const code = (err as NodeJS.ErrnoException).code;\n if (code !== \"ENOENT\") throw err;\n }\n if (exists && !force) return false;\n mkdirSync(path.dirname(filePath), { recursive: true });\n writeFileSync(filePath, content);\n return true;\n}\n\nexport function seedJournal(input: SeedJournalInput): SeedJournalResult {\n const filePath = journalPath(input.memoryDir, input.date);\n const wrote = writeJournalFile(\n filePath,\n renderJournalSeed(input.date, input.cards ?? []),\n input.force === true,\n );\n return { path: filePath, wrote };\n}\n","import path from \"node:path\";\nimport type { QmdSearchResult } from \"../types.js\";\nimport { isExternalWikiCollectionName } from \"../external-wiki-guard.js\";\nexport { isExternalWikiCollectionName } from \"../external-wiki-guard.js\";\nimport { ALL_CATEGORY_DIRS } from \"../utils/category-dir.js\";\nimport {\n isActivityDigestPath,\n isArtifactMemoryPath,\n isLocationDayPath,\n isMeetingRecordPath,\n} from \"./orchestrator-helpers.js\";\nimport { isJournalDayPath } from \"../activity/journal.js\";\nimport { DIRECTORY_SIDECAR_BASENAME } from \"../directory-sidecars.js\";\nimport { OKF_RESERVED_BASENAMES } from \"../okf/type-mapping.js\";\n\n\nexport interface GenericRecallPathPolicy {\n readonly memoryDir?: string;\n readonly qmdCollection?: string;\n readonly qmdColdCollection?: string;\n /**\n * The collection THIS request named, when it named one. A caller may select\n * a custom collection whose name is also a memory category, which the\n * configured names alone cannot disambiguate.\n */\n readonly requestedCollection?: string;\n}\n\ntype GenericRecallPathSource = \"filesystem\" | \"qmd\";\n\nconst CATEGORY_MEMORY_ROOTS: Record<string, true> = Object.fromEntries(\n ALL_CATEGORY_DIRS.map((directory) => [directory, true]),\n);\nconst RESERVED_ARCHIVE_ROOTS: Record<string, true> = { archive: true, namespaces: true };\n\nfunction isQmdCollectionPrefix(\n prefix: string,\n collection: string | undefined,\n source: GenericRecallPathSource,\n): boolean {\n if (typeof collection !== \"string\" || collection.length === 0) return false;\n if (prefix.startsWith(`${collection}--`)) return true;\n if (prefix !== collection) return false;\n if (source === \"qmd\") return true;\n return (\n !Object.hasOwn(CATEGORY_MEMORY_ROOTS, prefix) &&\n !Object.hasOwn(RESERVED_ARCHIVE_ROOTS, prefix)\n );\n}\n\nfunction normalizeQmdUriPath(relativePath: string, source: GenericRecallPathSource): string {\n if (source !== \"qmd\" || !relativePath.startsWith(\"qmd://\")) return relativePath;\n try {\n const parsed = new URL(relativePath);\n if (parsed.protocol !== \"qmd:\" || !parsed.hostname) return relativePath;\n const collection = decodeURIComponent(parsed.hostname);\n const pathname = decodeURIComponent(parsed.pathname.replace(/^\\/+/, \"\"));\n return pathname ? `${collection}/${pathname}` : collection;\n } catch {\n return relativePath;\n }\n}\n\nfunction stripQmdCollectionPrefix(\n relativePath: string,\n policy: GenericRecallPathPolicy,\n source: GenericRecallPathSource,\n): string {\n const normalized = path.posix.normalize(normalizeQmdUriPath(relativePath, source).replace(/\\\\/g, \"/\"));\n const slashIndex = normalized.indexOf(\"/\");\n if (slashIndex <= 0 || slashIndex >= normalized.length - 1) return normalized;\n\n const prefix = normalized.slice(0, slashIndex);\n const matchesHotCollection = isQmdCollectionPrefix(prefix, policy.qmdCollection, source);\n const matchesColdCollection = isQmdCollectionPrefix(prefix, policy.qmdColdCollection, source);\n return matchesHotCollection || matchesColdCollection\n ? normalized.slice(slashIndex + 1)\n : normalized;\n}\n\nexport function isTopLevelArchivePath(\n filePath: string,\n policy: GenericRecallPathPolicy = {},\n source: GenericRecallPathSource = \"filesystem\",\n): boolean {\n const isAbsolutePath = path.isAbsolute(filePath);\n const relative =\n policy.memoryDir && isAbsolutePath\n ? path.relative(policy.memoryDir, path.resolve(filePath))\n : filePath;\n const normalized = !isAbsolutePath\n ? stripQmdCollectionPrefix(relative, policy, source)\n : relative;\n return /^(?:archive|namespaces[\\\\/][^\\\\/]+[\\\\/]archive)(?:[\\\\/]|$)/i.test(normalized);\n}\n\nfunction isExternalWikiQmdPath(\n filePath: string,\n source: GenericRecallPathSource,\n): boolean {\n if (source !== \"qmd\") return false;\n const normalized = normalizeQmdUriPath(filePath, source).replace(/\\\\/g, \"/\");\n const slashIndex = normalized.indexOf(\"/\");\n const collection = slashIndex === -1 ? normalized : normalized.slice(0, slashIndex);\n return isExternalWikiCollectionName(collection);\n}\n\n/**\n * Paths an EXPLICIT ranked search must not return.\n *\n * Narrower than {@link isGenericRecallExcludedPath} on purpose. Recall\n * injection also drops archived memories because they are cold by definition,\n * but archive is explicitly reserved for \"explicit read or search surfaces\"\n * (docs/architecture/memory-lifecycle.md) — hiding it from `memory_search`\n * would remove the only way to find it. Everything else stays excluded: those\n * paths flow through their own dedicated surfaces, never a generic search.\n */\nexport function isSearchExcludedPath(\n filePath: string,\n policy: GenericRecallPathPolicy = {},\n source: GenericRecallPathSource = \"filesystem\",\n): boolean {\n if (isExternalWikiQmdPath(filePath, source)) return true;\n // A QMD transport hands back collection-qualified paths\n // (`qmd://<collection>/activity/<date>.md`, or `<collection>/activity/…`),\n // and the collection is not always one this policy knows: a caller may name\n // a custom one, and global search spans every collection. The activity\n // predicate is ROOT-AWARE — it matches only the top-level\n // `activity/<date>.md` so a nested ordinary memory stays recallable — so an\n // un-stripped prefix reads as a nested path and the digest would be served.\n //\n // Both spellings are therefore tested. Widening is safe in this direction\n // and only here: a leading segment is dropped ONLY to re-test the dedicated\n // surface shapes, never to decide anything else, and a segment that names a\n // memory CATEGORY (`facts/proj/activity/…`) is never treated as a\n // collection, so ordinary nested memories stay searchable.\n for (const candidate of collectionSpellings(filePath, policy, source)) {\n if (\n isArtifactMemoryPath(candidate) ||\n isNamespacedActivityDigestPath(candidate, policy.memoryDir) ||\n isNamespacedLocationDayPath(candidate, policy.memoryDir) ||\n isNamespacedJournalDayPath(candidate, policy.memoryDir) ||\n isMeetingRecordPath(candidate)\n ) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The activity check, applied against the NAMESPACE root a hit came from.\n *\n * `isActivityDigestPath` is root-aware — the digest must sit directly under\n * the root it is given — but a namespaced search rewrites hits to absolute\n * paths beneath `…/namespaces/<ns>/`, and only the global `memoryDir` is\n * available here. Measured against that root, a real digest at\n * `<memoryDir>/namespaces/team/activity/<date>.md` reads as nested and is\n * served. Re-measuring against the namespace's own root closes that.\n */\nfunction isNamespacedActivityDigestPath(candidate: string, memoryDir?: string): boolean {\n if (isActivityDigestPath(candidate, memoryDir)) return true;\n if (memoryDir === undefined || memoryDir.length === 0) return false;\n const relative = path.relative(memoryDir, path.resolve(memoryDir, candidate));\n const namespaced = /^namespaces[\\\\/]([^\\\\/]+)[\\\\/](.*)$/.exec(relative);\n if (namespaced === null) return false;\n return isActivityDigestPath(namespaced[2] ?? \"\", memoryDir);\n}\n\n/**\n * The location day-file check, applied against the NAMESPACE root a hit came\n * from — same rationale as `isNamespacedActivityDigestPath`: a namespaced\n * search rewrites hits to absolute paths beneath `…/namespaces/<ns>/`, so the\n * root-aware predicate is re-measured against the namespace's own root.\n */\nfunction isNamespacedLocationDayPath(candidate: string, memoryDir?: string): boolean {\n if (isLocationDayPath(candidate, memoryDir)) return true;\n if (memoryDir === undefined || memoryDir.length === 0) return false;\n const relative = path.relative(memoryDir, path.resolve(memoryDir, candidate));\n const namespaced = /^namespaces[\\\\/]([^\\\\/]+)[\\\\/](.*)$/.exec(relative);\n if (namespaced === null) return false;\n return isLocationDayPath(namespaced[2] ?? \"\", memoryDir);\n}\n\nfunction isNamespacedJournalDayPath(candidate: string, memoryDir?: string): boolean {\n if (isJournalDayPath(candidate, memoryDir)) return true;\n if (memoryDir === undefined || memoryDir.length === 0) return false;\n const relative = path.relative(memoryDir, path.resolve(memoryDir, candidate));\n const namespaced = /^namespaces[\\\\/]([^\\\\/]+)[\\\\/](.*)$/.exec(relative);\n if (namespaced === null) return false;\n return isJournalDayPath(namespaced[2] ?? \"\", memoryDir);\n}\n\n/** A path as given, plus its form with a leading COLLECTION segment removed. */\nfunction collectionSpellings(\n filePath: string,\n policy: GenericRecallPathPolicy,\n source: GenericRecallPathSource,\n): string[] {\n if (path.isAbsolute(filePath)) return [filePath];\n // A `qmd://<collection>/<path>` URI states its collection UNAMBIGUOUSLY in\n // the authority, so the leading segment of its normalized form is never a\n // memory category — strip it outright rather than guessing.\n if (source === \"qmd\" && filePath.startsWith(\"qmd://\")) {\n const normalized = path.posix.normalize(normalizeQmdUriPath(filePath, source).replace(/\\\\/g, \"/\"));\n const slashIndex = normalized.indexOf(\"/\");\n return slashIndex <= 0 || slashIndex >= normalized.length - 1\n ? [normalized]\n : [normalized, normalized.slice(slashIndex + 1)];\n }\n const normalized = path.posix.normalize(\n normalizeQmdUriPath(filePath, source).replace(/\\\\/g, \"/\"),\n );\n const stripped = stripQmdCollectionPrefix(filePath, policy, source);\n const spellings = [stripped];\n // If the AUTHORITATIVE strip already fired — the prefix matched a configured\n // collection — stop. Removing a second segment would take a real directory\n // with it: `memories/projects/activity/<date>.md` would become\n // `activity/<date>.md` and an ordinary nested memory would read as a\n // top-level digest, vanishing from search AND recall.\n if (stripped !== normalized) return spellings;\n const slashIndex = stripped.indexOf(\"/\");\n if (slashIndex <= 0 || slashIndex >= stripped.length - 1) return spellings;\n const prefix = stripped.slice(0, slashIndex);\n // The CALLER's own collection is authoritative: a request for\n // `collection: \"facts\"` means that segment is the collection, whatever it is\n // also the name of. Otherwise a category-shaped prefix stays part of the\n // path, so an ordinary `facts/proj/activity/<date>.md` memory is searchable.\n const requested = policy.requestedCollection;\n if (\n prefix !== requested &&\n (Object.hasOwn(CATEGORY_MEMORY_ROOTS, prefix) || Object.hasOwn(RESERVED_ARCHIVE_ROOTS, prefix))\n ) {\n return spellings;\n }\n spellings.push(stripped.slice(slashIndex + 1));\n return spellings;\n}\n\nexport function isGenericRecallExcludedPath(\n filePath: string,\n policy: GenericRecallPathPolicy = {},\n source: GenericRecallPathSource = \"filesystem\",\n): boolean {\n return (\n isSearchExcludedPath(filePath, policy, source) ||\n isTopLevelArchivePath(filePath, policy, source) ||\n OKF_RESERVED_BASENAMES[path.basename(filePath)] === true ||\n // Derived per-directory sidecars (#2977): recall-excluded like OKF index\n // files, still searchable. Basename-only, the same accepted tradeoff.\n path.basename(filePath) === DIRECTORY_SIDECAR_BASENAME\n );\n}\n\nexport function filterRecallCandidates(\n candidates: QmdSearchResult[],\n options: {\n namespacesEnabled: boolean;\n recallNamespaces: string[];\n resolveNamespace: (path: string) => string;\n limit: number;\n pathPolicy?: GenericRecallPathPolicy;\n memoryRoot?: string;\n },\n): QmdSearchResult[] {\n const pathPolicy =\n options.pathPolicy ??\n (options.memoryRoot === undefined ? undefined : { memoryDir: options.memoryRoot });\n const scopedByNamespace = options.namespacesEnabled\n ? candidates.filter((r) =>\n options.recallNamespaces.includes(r.namespace ?? options.resolveNamespace(r.path)),\n )\n : candidates;\n return scopedByNamespace\n .filter((r) => !isGenericRecallExcludedPath(r.path, pathPolicy, \"qmd\"))\n .slice(0, Math.max(0, options.limit));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAQA,SAAS,WAAW,UAAU,qBAAqB;AACnD,OAAO,UAAU;AAIV,IAAM,mBAAmB;AAqBhC,IAAM,uBAAuB;AAC7B,IAAM,uBAAuB;AAEtB,SAAS,YAAY,WAAmB,MAAsB;AACnE,MAAI,CAAC,oBAAoB,IAAI,GAAG;AAC9B,UAAM,IAAI,WAAW,yBAAyB,IAAI,yBAAyB;AAAA,EAC7E;AACA,SAAO,KAAK,KAAK,WAAW,kBAAkB,GAAG,IAAI,KAAK;AAC5D;AAOO,SAAS,iBAAiB,UAAkB,YAA8B;AAC/E,MAAI,eAAe,UAAa,WAAW,SAAS,GAAG;AACrD,UAAM,WAAW,KAAK,SAAS,YAAY,KAAK,QAAQ,YAAY,QAAQ,CAAC;AAC7E,WAAO,qBAAqB,KAAK,QAAQ;AAAA,EAC3C;AACA,SAAO,qBAAqB,KAAK,QAAQ;AAC3C;AAEO,SAAS,iBAAiB,MAAY,oBAAI,KAAK,GAAW;AAC/D,QAAM,OAAO,IAAI,YAAY;AAC7B,QAAM,QAAQ,OAAO,IAAI,SAAS,IAAI,CAAC,EAAE,SAAS,GAAG,GAAG;AACxD,QAAM,MAAM,OAAO,IAAI,QAAQ,CAAC,EAAE,SAAS,GAAG,GAAG;AACjD,SAAO,G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ts","../src/orchestration/generic-recall-paths.ts"],"sourcesContent":["/**\n * User-owned daily journal (issue #1984 PR1).\n *\n * Files live at `<memoryDir>/journal/<YYYY-MM-DD>.md` — inside the memory\n * directory but outside scan roots, same placement as activity digests.\n * Once written, Remnic never rewrites the file except `seed` with force.\n * All writes go through writeJournalFile, which stats first.\n */\nimport { mkdirSync, statSync, writeFileSync } from \"node:fs\";\nimport path from \"node:path\";\n\nimport { isValidActivityDate } from \"./digest.js\";\n\nexport const JOURNAL_DIR_NAME = \"journal\";\n\n/** Minimal card shape the seed renderer needs. TimelineCard is assignable. */\nexport interface JournalSeedCard {\n title: string;\n startUtc: string;\n endUtc: string;\n}\n\nexport interface SeedJournalInput {\n memoryDir: string;\n date: string;\n cards?: readonly JournalSeedCard[];\n force?: boolean;\n}\n\nexport interface SeedJournalResult {\n path: string;\n wrote: boolean;\n}\n\nconst JOURNAL_DAY_TOPLEVEL = /^journal[\\\\/]\\d{4}-\\d{2}-\\d{2}\\.md$/i;\nconst JOURNAL_DAY_ANYWHERE = /(?:^|[\\\\/])journal[\\\\/]\\d{4}-\\d{2}-\\d{2}\\.md$/i;\n\nexport function journalPath(memoryDir: string, date: string): string {\n if (!isValidActivityDate(date)) {\n throw new RangeError(`Invalid journal date \"${date}\"; expected YYYY-MM-DD.`);\n }\n return path.join(memoryDir, JOURNAL_DIR_NAME, `${date}.md`);\n}\n\n/**\n * Root-aware journal day-file check. With a memory root, only the top-level\n * `journal/<date>.md` matches so a nested `facts/journal/<date>.md` stays\n * recallable. Without a root, fall back to the day-file shape anywhere.\n */\nexport function isJournalDayPath(filePath: string, memoryRoot?: string): boolean {\n if (memoryRoot !== undefined && memoryRoot.length > 0) {\n const relative = path.relative(memoryRoot, path.resolve(memoryRoot, filePath));\n return JOURNAL_DAY_TOPLEVEL.test(relative);\n }\n return JOURNAL_DAY_ANYWHERE.test(filePath);\n}\n\nexport function todayJournalDate(now: Date = new Date()): string {\n const year = now.getFullYear();\n const month = String(now.getMonth() + 1).padStart(2, \"0\");\n const day = String(now.getDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n}\n\nfunction formatCardDuration(card: JournalSeedCard): string {\n const start = Date.parse(card.startUtc);\n const end = Date.parse(card.endUtc);\n const minutes =\n Number.isFinite(start) && Number.isFinite(end) && end > start\n ? Math.round((end - start) / 60_000)\n : 0;\n return `${minutes}m`;\n}\n\nfunction renderJournalSeed(date: string, cards: readonly JournalSeedCard[]): string {\n const ordered = [...cards].sort((left, right) => {\n const byStart = left.startUtc.localeCompare(right.startUtc);\n return byStart !== 0 ? byStart : left.title.localeCompare(right.title);\n });\n const glance =\n ordered.length === 0\n ? [\"_No cards._\"]\n : ordered.map((card) => `- ${formatCardDuration(card)} ${card.title}`);\n return [`# Journal — ${date}`, \"\", \"## Day at a glance\", \"\", ...glance, \"\", \"## Notes\", \"\", \"\"].join(\n \"\\n\",\n );\n}\n\n/** The only journal write. Stats first; existing files are a no-op unless force. */\nexport function writeJournalFile(filePath: string, content: string, force: boolean): boolean {\n let exists = false;\n try {\n statSync(filePath);\n exists = true;\n } catch (err) {\n const code = (err as NodeJS.ErrnoException).code;\n if (code !== \"ENOENT\") throw err;\n }\n if (exists && !force) return false;\n mkdirSync(path.dirname(filePath), { recursive: true });\n writeFileSync(filePath, content);\n return true;\n}\n\nexport function seedJournal(input: SeedJournalInput): SeedJournalResult {\n const filePath = journalPath(input.memoryDir, input.date);\n const wrote = writeJournalFile(\n filePath,\n renderJournalSeed(input.date, input.cards ?? []),\n input.force === true,\n );\n return { path: filePath, wrote };\n}\n","import path from \"node:path\";\nimport type { QmdSearchResult } from \"../types.js\";\nimport { isExternalWikiCollectionName } from \"../external-wiki-guard.js\";\nexport { isExternalWikiCollectionName } from \"../external-wiki-guard.js\";\nimport { ALL_CATEGORY_DIRS } from \"../utils/category-dir.js\";\nimport {\n isActivityDigestPath,\n isArtifactMemoryPath,\n isLocationDayPath,\n isMeetingRecordPath,\n} from \"./orchestrator-helpers.js\";\nimport { isJournalDayPath } from \"../activity/journal.js\";\nimport { DIRECTORY_SIDECAR_BASENAME } from \"../directory-sidecars.js\";\nimport { OKF_RESERVED_BASENAMES } from \"../okf/type-mapping.js\";\n\n\nexport interface GenericRecallPathPolicy {\n readonly memoryDir?: string;\n readonly qmdCollection?: string;\n readonly qmdColdCollection?: string;\n /**\n * The collection THIS request named, when it named one. A caller may select\n * a custom collection whose name is also a memory category, which the\n * configured names alone cannot disambiguate.\n */\n readonly requestedCollection?: string;\n}\n\ntype GenericRecallPathSource = \"filesystem\" | \"qmd\";\n\nconst CATEGORY_MEMORY_ROOTS: Record<string, true> = Object.fromEntries(\n ALL_CATEGORY_DIRS.map((directory) => [directory, true]),\n);\nconst RESERVED_ARCHIVE_ROOTS: Record<string, true> = { archive: true, namespaces: true };\n\nfunction isQmdCollectionPrefix(\n prefix: string,\n collection: string | undefined,\n source: GenericRecallPathSource,\n): boolean {\n if (typeof collection !== \"string\" || collection.length === 0) return false;\n if (prefix.startsWith(`${collection}--`)) return true;\n if (prefix !== collection) return false;\n if (source === \"qmd\") return true;\n return (\n !Object.hasOwn(CATEGORY_MEMORY_ROOTS, prefix) &&\n !Object.hasOwn(RESERVED_ARCHIVE_ROOTS, prefix)\n );\n}\n\nfunction normalizeQmdUriPath(relativePath: string, source: GenericRecallPathSource): string {\n if (source !== \"qmd\" || !relativePath.startsWith(\"qmd://\")) return relativePath;\n try {\n const parsed = new URL(relativePath);\n if (parsed.protocol !== \"qmd:\" || !parsed.hostname) return relativePath;\n const collection = decodeURIComponent(parsed.hostname);\n const pathname = decodeURIComponent(parsed.pathname.replace(/^\\/+/, \"\"));\n return pathname ? `${collection}/${pathname}` : collection;\n } catch {\n return relativePath;\n }\n}\n\nfunction stripQmdCollectionPrefix(\n relativePath: string,\n policy: GenericRecallPathPolicy,\n source: GenericRecallPathSource,\n): string {\n const normalized = path.posix.normalize(normalizeQmdUriPath(relativePath, source).replace(/\\\\/g, \"/\"));\n const slashIndex = normalized.indexOf(\"/\");\n if (slashIndex <= 0 || slashIndex >= normalized.length - 1) return normalized;\n\n const prefix = normalized.slice(0, slashIndex);\n const matchesHotCollection = isQmdCollectionPrefix(prefix, policy.qmdCollection, source);\n const matchesColdCollection = isQmdCollectionPrefix(prefix, policy.qmdColdCollection, source);\n return matchesHotCollection || matchesColdCollection\n ? normalized.slice(slashIndex + 1)\n : normalized;\n}\n\nexport function isTopLevelArchivePath(\n filePath: string,\n policy: GenericRecallPathPolicy = {},\n source: GenericRecallPathSource = \"filesystem\",\n): boolean {\n const isAbsolutePath = path.isAbsolute(filePath);\n const relative =\n policy.memoryDir && isAbsolutePath\n ? path.relative(policy.memoryDir, path.resolve(filePath))\n : filePath;\n const normalized = !isAbsolutePath\n ? stripQmdCollectionPrefix(relative, policy, source)\n : relative;\n return /^(?:archive|namespaces[\\\\/][^\\\\/]+[\\\\/]archive)(?:[\\\\/]|$)/i.test(normalized);\n}\n\nfunction isExternalWikiQmdPath(\n filePath: string,\n source: GenericRecallPathSource,\n): boolean {\n if (source !== \"qmd\") return false;\n const normalized = normalizeQmdUriPath(filePath, source).replace(/\\\\/g, \"/\");\n const slashIndex = normalized.indexOf(\"/\");\n const collection = slashIndex === -1 ? normalized : normalized.slice(0, slashIndex);\n return isExternalWikiCollectionName(collection);\n}\n\n/**\n * Paths an EXPLICIT ranked search must not return.\n *\n * Narrower than {@link isGenericRecallExcludedPath} on purpose. Recall\n * injection also drops archived memories because they are cold by definition,\n * but archive is explicitly reserved for \"explicit read or search surfaces\"\n * (docs/architecture/memory-lifecycle.md) — hiding it from `memory_search`\n * would remove the only way to find it. Everything else stays excluded: those\n * paths flow through their own dedicated surfaces, never a generic search.\n */\nexport function isSearchExcludedPath(\n filePath: string,\n policy: GenericRecallPathPolicy = {},\n source: GenericRecallPathSource = \"filesystem\",\n): boolean {\n if (isExternalWikiQmdPath(filePath, source)) return true;\n // A QMD transport hands back collection-qualified paths\n // (`qmd://<collection>/activity/<date>.md`, or `<collection>/activity/…`),\n // and the collection is not always one this policy knows: a caller may name\n // a custom one, and global search spans every collection. The activity\n // predicate is ROOT-AWARE — it matches only the top-level\n // `activity/<date>.md` so a nested ordinary memory stays recallable — so an\n // un-stripped prefix reads as a nested path and the digest would be served.\n //\n // Both spellings are therefore tested. Widening is safe in this direction\n // and only here: a leading segment is dropped ONLY to re-test the dedicated\n // surface shapes, never to decide anything else, and a segment that names a\n // memory CATEGORY (`facts/proj/activity/…`) is never treated as a\n // collection, so ordinary nested memories stay searchable.\n for (const candidate of collectionSpellings(filePath, policy, source)) {\n if (\n isArtifactMemoryPath(candidate) ||\n isNamespacedActivityDigestPath(candidate, policy.memoryDir) ||\n isNamespacedLocationDayPath(candidate, policy.memoryDir) ||\n isNamespacedJournalDayPath(candidate, policy.memoryDir) ||\n isMeetingRecordPath(candidate)\n ) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The activity check, applied against the NAMESPACE root a hit came from.\n *\n * `isActivityDigestPath` is root-aware — the digest must sit directly under\n * the root it is given — but a namespaced search rewrites hits to absolute\n * paths beneath `…/namespaces/<ns>/`, and only the global `memoryDir` is\n * available here. Measured against that root, a real digest at\n * `<memoryDir>/namespaces/team/activity/<date>.md` reads as nested and is\n * served. Re-measuring against the namespace's own root closes that.\n */\nfunction isNamespacedActivityDigestPath(candidate: string, memoryDir?: string): boolean {\n if (isActivityDigestPath(candidate, memoryDir)) return true;\n if (memoryDir === undefined || memoryDir.length === 0) return false;\n const relative = path.relative(memoryDir, path.resolve(memoryDir, candidate));\n const namespaced = /^namespaces[\\\\/]([^\\\\/]+)[\\\\/](.*)$/.exec(relative);\n if (namespaced === null) return false;\n return isActivityDigestPath(namespaced[2] ?? \"\", memoryDir);\n}\n\n/**\n * The location day-file check, applied against the NAMESPACE root a hit came\n * from — same rationale as `isNamespacedActivityDigestPath`: a namespaced\n * search rewrites hits to absolute paths beneath `…/namespaces/<ns>/`, so the\n * root-aware predicate is re-measured against the namespace's own root.\n */\nfunction isNamespacedLocationDayPath(candidate: string, memoryDir?: string): boolean {\n if (isLocationDayPath(candidate, memoryDir)) return true;\n if (memoryDir === undefined || memoryDir.length === 0) return false;\n const relative = path.relative(memoryDir, path.resolve(memoryDir, candidate));\n const namespaced = /^namespaces[\\\\/]([^\\\\/]+)[\\\\/](.*)$/.exec(relative);\n if (namespaced === null) return false;\n return isLocationDayPath(namespaced[2] ?? \"\", memoryDir);\n}\n\nfunction isNamespacedJournalDayPath(candidate: string, memoryDir?: string): boolean {\n if (isJournalDayPath(candidate, memoryDir)) return true;\n if (memoryDir === undefined || memoryDir.length === 0) return false;\n const relative = path.relative(memoryDir, path.resolve(memoryDir, candidate));\n const namespaced = /^namespaces[\\\\/]([^\\\\/]+)[\\\\/](.*)$/.exec(relative);\n if (namespaced === null) return false;\n return isJournalDayPath(namespaced[2] ?? \"\", memoryDir);\n}\n\n/** A path as given, plus its form with a leading COLLECTION segment removed. */\nfunction collectionSpellings(\n filePath: string,\n policy: GenericRecallPathPolicy,\n source: GenericRecallPathSource,\n): string[] {\n if (path.isAbsolute(filePath)) return [filePath];\n // A `qmd://<collection>/<path>` URI states its collection UNAMBIGUOUSLY in\n // the authority, so the leading segment of its normalized form is never a\n // memory category — strip it outright rather than guessing.\n if (source === \"qmd\" && filePath.startsWith(\"qmd://\")) {\n const normalized = path.posix.normalize(normalizeQmdUriPath(filePath, source).replace(/\\\\/g, \"/\"));\n const slashIndex = normalized.indexOf(\"/\");\n return slashIndex <= 0 || slashIndex >= normalized.length - 1\n ? [normalized]\n : [normalized, normalized.slice(slashIndex + 1)];\n }\n const normalized = path.posix.normalize(\n normalizeQmdUriPath(filePath, source).replace(/\\\\/g, \"/\"),\n );\n const stripped = stripQmdCollectionPrefix(filePath, policy, source);\n const spellings = [stripped];\n // If the AUTHORITATIVE strip already fired — the prefix matched a configured\n // collection — stop. Removing a second segment would take a real directory\n // with it: `memories/projects/activity/<date>.md` would become\n // `activity/<date>.md` and an ordinary nested memory would read as a\n // top-level digest, vanishing from search AND recall.\n if (stripped !== normalized) return spellings;\n const slashIndex = stripped.indexOf(\"/\");\n if (slashIndex <= 0 || slashIndex >= stripped.length - 1) return spellings;\n const prefix = stripped.slice(0, slashIndex);\n // The CALLER's own collection is authoritative: a request for\n // `collection: \"facts\"` means that segment is the collection, whatever it is\n // also the name of. Otherwise a category-shaped prefix stays part of the\n // path, so an ordinary `facts/proj/activity/<date>.md` memory is searchable.\n const requested = policy.requestedCollection;\n if (\n prefix !== requested &&\n (Object.hasOwn(CATEGORY_MEMORY_ROOTS, prefix) || Object.hasOwn(RESERVED_ARCHIVE_ROOTS, prefix))\n ) {\n return spellings;\n }\n spellings.push(stripped.slice(slashIndex + 1));\n return spellings;\n}\n\nexport function isGenericRecallExcludedPath(\n filePath: string,\n policy: GenericRecallPathPolicy = {},\n source: GenericRecallPathSource = \"filesystem\",\n): boolean {\n return (\n isSearchExcludedPath(filePath, policy, source) ||\n isTopLevelArchivePath(filePath, policy, source) ||\n OKF_RESERVED_BASENAMES[path.basename(filePath)] === true ||\n // Derived per-directory sidecars (#2977): recall-excluded like OKF index\n // files, still searchable. Basename-only, the same accepted tradeoff.\n path.basename(filePath) === DIRECTORY_SIDECAR_BASENAME\n );\n}\n\nexport function filterRecallCandidates(\n candidates: QmdSearchResult[],\n options: {\n namespacesEnabled: boolean;\n recallNamespaces: string[];\n resolveNamespace: (path: string) => string;\n limit: number;\n pathPolicy?: GenericRecallPathPolicy;\n memoryRoot?: string;\n },\n): QmdSearchResult[] {\n const pathPolicy =\n options.pathPolicy ??\n (options.memoryRoot === undefined ? undefined : { memoryDir: options.memoryRoot });\n const scopedByNamespace = options.namespacesEnabled\n ? candidates.filter((r) =>\n options.recallNamespaces.includes(r.namespace ?? options.resolveNamespace(r.path)),\n )\n : candidates;\n return scopedByNamespace\n .filter((r) => !isGenericRecallExcludedPath(r.path, pathPolicy, \"qmd\"))\n .slice(0, Math.max(0, options.limit));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,SAAS,WAAW,UAAU,qBAAqB;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AU,KAAK,SAAS,MAAM,aAAa,CAAC,CAAC;AAC7C,SAAO;AACT;AAEO,SAAS,4BACd,UACA,SAAkC,CAAC,GACnC,SAAkC,cACzB;AACT,SACE,qBAAqB,UAAU,QAAQ,MAAM,KAC7C,sBAAsB,UAAU,QAAQ,MAAM,KAC9C,uBAAuBA,MAAK,SAAS,QAAQ,CAAC,MAAM;AAAA;AAAA,EAGpDA,MAAK,SAAS,QAAQ,MAAM;AAEhC;AAEO,SAAS,uBACd,YACA,SAQmB;AACnB,QAAM,aACJ,QAAQ,eACP,QAAQ,eAAe,SAAY,SAAY,EAAE,WAAW,QAAQ,WAAW;AAClF,QAAM,oBAAoB,QAAQ,oBAC9B,WAAW;AAAA,IAAO,CAAC,MACjB,QAAQ,iBAAiB,SAAS,EAAE,aAAa,QAAQ,iBAAiB,EAAE,IAAI,CAAC;AAAA,EACnF,IACA;AACJ,SAAO,kBACJ,OAAO,CAAC,MAAM,CAAC,4BAA4B,EAAE,MAAM,YAAY,KAAK,CAAC,EACrE,MAAM,GAAG,KAAK,IAAI,GAAG,QAAQ,KAAK,CAAC;AACxC;","names":["path","path","normalized","slashIndex"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseEntityFile
3
- } from "./chunk-ZPED47SP.js";
3
+ } from "./chunk-6RBUAPQT.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-KPSJA45G.js.map
256
+ //# sourceMappingURL=chunk-YYI5DZAQ.js.map