@remnic/core 9.66.0 → 9.66.1

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 (482) hide show
  1. package/dist/access-admin-ops-surface.d.ts +11 -11
  2. package/dist/access-admin-ops-surface.js +22 -22
  3. package/dist/access-authorization-probe.d.ts +11 -11
  4. package/dist/access-authorization-probe.js +23 -23
  5. package/dist/access-boundary.d.ts +11 -11
  6. package/dist/access-boundary.js +22 -22
  7. package/dist/access-cli.js +86 -84
  8. package/dist/access-cli.js.map +1 -1
  9. package/dist/access-coding-context-resolution.d.ts +1 -1
  10. package/dist/access-extraction-force-flush.d.ts +11 -11
  11. package/dist/access-extraction-force-flush.js +22 -22
  12. package/dist/access-health-types.d.ts +1 -1
  13. package/dist/access-http-lcm-compaction.d.ts +11 -11
  14. package/dist/access-http-lifecycle-flush.d.ts +11 -11
  15. package/dist/access-http-offline-stream.d.ts +11 -11
  16. package/dist/access-http-query.d.ts +2 -2
  17. package/dist/access-http-query.js +24 -24
  18. package/dist/access-http.d.ts +12 -12
  19. package/dist/access-http.js +39 -39
  20. package/dist/access-identity-continuity-surface.d.ts +9 -9
  21. package/dist/access-identity-continuity-surface.js +22 -22
  22. package/dist/access-lcm-surface.d.ts +11 -11
  23. package/dist/access-lcm-surface.js +22 -22
  24. package/dist/access-mcp.d.ts +11 -11
  25. package/dist/access-mcp.js +29 -29
  26. package/dist/access-memory-search-fanout.d.ts +2 -2
  27. package/dist/{access-namespace-preflight-CLWUoMyW.d.ts → access-namespace-preflight-50VIkPhB.d.ts} +1 -1
  28. package/dist/access-namespace-preflight.d.ts +3 -3
  29. package/dist/access-namespace-preflight.js +22 -22
  30. package/dist/access-observe-write-surface.d.ts +11 -11
  31. package/dist/access-observe-write-surface.js +22 -22
  32. package/dist/access-offline-manifest.d.ts +9 -9
  33. package/dist/access-operations-batch.js +24 -24
  34. package/dist/access-operations.d.ts +16 -16
  35. package/dist/access-operations.js +28 -28
  36. package/dist/access-recall-concurrency.d.ts +11 -11
  37. package/dist/access-recall-concurrency.js +22 -22
  38. package/dist/access-recall-response.d.ts +11 -11
  39. package/dist/access-recall-response.js +22 -22
  40. package/dist/access-recall-surface.d.ts +11 -11
  41. package/dist/access-recall-surface.js +22 -22
  42. package/dist/access-schema.d.ts +89 -89
  43. package/dist/access-schema.js +3 -3
  44. package/dist/{access-service-CEUE1Isj.d.ts → access-service-C2tV2-uL.d.ts} +65 -65
  45. package/dist/access-service-helpers.d.ts +11 -11
  46. package/dist/access-service.d.ts +11 -11
  47. package/dist/access-service.js +22 -22
  48. package/dist/access-surface-catalog.d.ts +11 -11
  49. package/dist/access-surface-catalog.js +24 -24
  50. package/dist/access-wearables-meetings-surface.d.ts +3 -3
  51. package/dist/action-confidence.d.ts +1 -1
  52. package/dist/active-memory-bridge.d.ts +1 -1
  53. package/dist/active-recall.d.ts +1 -1
  54. package/dist/active-recall.js +2 -2
  55. package/dist/adapters/index.js +7 -7
  56. package/dist/adapters/registry.js +3 -3
  57. package/dist/ambient-provenance.d.ts +1 -1
  58. package/dist/artifact-search.d.ts +1 -1
  59. package/dist/behavior-learner.d.ts +1 -1
  60. package/dist/behavior-signals.d.ts +1 -1
  61. package/dist/bootstrap.d.ts +9 -9
  62. package/dist/briefing-window.d.ts +2 -2
  63. package/dist/briefing.d.ts +2 -2
  64. package/dist/briefing.js +9 -9
  65. package/dist/buffer-surprise-report.d.ts +1 -1
  66. package/dist/buffer-turn-helpers.d.ts +1 -1
  67. package/dist/buffer.d.ts +2 -2
  68. package/dist/bulk-import/index.d.ts +3 -3
  69. package/dist/calibration.d.ts +1 -1
  70. package/dist/capabilities.d.ts +1 -1
  71. package/dist/{catalog-D1HgugTA.d.ts → catalog-C2jA-gLm.d.ts} +1 -1
  72. package/dist/causal-behavior.d.ts +1 -1
  73. package/dist/causal-consolidation.d.ts +1 -1
  74. package/dist/causal-consolidation.js +10 -10
  75. package/dist/causal-trajectory-graph.d.ts +1 -1
  76. package/dist/{chunk-J3OND5QT.js → chunk-2FA7U5XY.js} +2 -2
  77. package/dist/{chunk-GEJKYA7D.js → chunk-2ITZ74A6.js} +9 -9
  78. package/dist/{chunk-2LBAFHOQ.js → chunk-2X6BGKQL.js} +8 -8
  79. package/dist/{chunk-KODXCHXJ.js → chunk-46XR5FNZ.js} +39 -3
  80. package/dist/chunk-46XR5FNZ.js.map +1 -0
  81. package/dist/{chunk-4STAANV7.js → chunk-4XLTUR6R.js} +3 -3
  82. package/dist/{chunk-FTTJRVB7.js → chunk-65JOGLIS.js} +2 -2
  83. package/dist/{chunk-FESUGFIL.js → chunk-7UOXCCCI.js} +2 -2
  84. package/dist/{chunk-PEBH5DCK.js → chunk-AF5H7TKI.js} +100 -18
  85. package/dist/chunk-AF5H7TKI.js.map +1 -0
  86. package/dist/{chunk-6CEGSTBD.js → chunk-B4AOWRYF.js} +4 -4
  87. package/dist/{chunk-FYWLSFFS.js → chunk-C5IUOBCN.js} +2 -2
  88. package/dist/{chunk-FKKGCGYL.js → chunk-CHGG74CY.js} +2 -2
  89. package/dist/{chunk-H7VDIF2V.js → chunk-CX4OLNIH.js} +2 -2
  90. package/dist/{chunk-Z3YEGSR4.js → chunk-D3UXGE5D.js} +10 -10
  91. package/dist/{chunk-7XOG75AU.js → chunk-D6Q5EPOV.js} +2 -2
  92. package/dist/{chunk-MJRGVXPQ.js → chunk-EH65UV2Z.js} +2 -2
  93. package/dist/{chunk-VQ4AMTGZ.js → chunk-EWKVYCFP.js} +1 -1
  94. package/dist/{chunk-23CVL7HS.js → chunk-FFUMTH27.js} +2 -2
  95. package/dist/{chunk-GX6FTSYH.js → chunk-GAJK3DQ5.js} +2 -2
  96. package/dist/{chunk-O57GM3FR.js → chunk-GBEOUCBB.js} +2 -2
  97. package/dist/{chunk-DMEHOEC7.js → chunk-H2IRSXZN.js} +3 -3
  98. package/dist/{chunk-CFVTRUR3.js → chunk-H6RSANGQ.js} +2 -2
  99. package/dist/chunk-HVAEXYPL.js +98 -0
  100. package/dist/chunk-HVAEXYPL.js.map +1 -0
  101. package/dist/{chunk-OAJMQKQR.js → chunk-IGZCAHFL.js} +2 -2
  102. package/dist/{chunk-CN4VKV3S.js → chunk-INUBU6I5.js} +2 -2
  103. package/dist/{chunk-CTCGHNWN.js → chunk-J2R275FN.js} +4 -4
  104. package/dist/{chunk-2QSZNTDO.js → chunk-JBPKEARU.js} +7 -7
  105. package/dist/{chunk-VQNRICAQ.js → chunk-JKTV3JNX.js} +3 -3
  106. package/dist/{chunk-33MFRY25.js → chunk-KI64TTBL.js} +2 -2
  107. package/dist/{chunk-VCKWULAK.js → chunk-KJXCD7VR.js} +5 -5
  108. package/dist/{chunk-7LCGFUMB.js → chunk-KQAFEZQX.js} +4 -4
  109. package/dist/{chunk-GSKINLAK.js → chunk-LJABGXC4.js} +3 -3
  110. package/dist/{chunk-NPIBN2VL.js → chunk-LK4TOYPU.js} +2 -2
  111. package/dist/{chunk-EZSCW4EM.js → chunk-LYUUA6QB.js} +2 -2
  112. package/dist/{chunk-I5VB44ZK.js → chunk-M5ERTI4I.js} +2 -2
  113. package/dist/{chunk-IHGMRDEE.js → chunk-MUEGIKKY.js} +227 -144
  114. package/dist/chunk-MUEGIKKY.js.map +1 -0
  115. package/dist/{chunk-QCRJMU5V.js → chunk-NFP4KPTA.js} +2 -2
  116. package/dist/{chunk-YXFCALVT.js → chunk-NSTNGMSS.js} +8 -8
  117. package/dist/{chunk-L4X4PJYK.js → chunk-NUF7VSEX.js} +2 -2
  118. package/dist/{chunk-IVIAHQBR.js → chunk-OJUEUQDJ.js} +2 -2
  119. package/dist/{chunk-ZW4VXELZ.js → chunk-OMX6TKXH.js} +2 -2
  120. package/dist/{chunk-EFQCDJZ2.js → chunk-QBNE55VA.js} +2 -2
  121. package/dist/{chunk-6QDXA26G.js → chunk-RPIS5FQ7.js} +47 -47
  122. package/dist/{chunk-HJXA6ZM7.js → chunk-S4CDUXQY.js} +2 -2
  123. package/dist/{chunk-72OIT7KS.js → chunk-S4Z2OBTX.js} +3 -3
  124. package/dist/{chunk-4FHRZD5T.js → chunk-SZMYGDSM.js} +2 -2
  125. package/dist/{chunk-MAH64N55.js → chunk-TBCDF556.js} +4 -4
  126. package/dist/{chunk-56IV4J5W.js → chunk-TCF4MU7L.js} +443 -58
  127. package/dist/chunk-TCF4MU7L.js.map +1 -0
  128. package/dist/{chunk-K66OY4EI.js → chunk-TCQRIIIN.js} +2 -2
  129. package/dist/{chunk-KXIXO76C.js → chunk-U65VJSCJ.js} +14 -14
  130. package/dist/{chunk-HNPE66LB.js → chunk-U6NGKS32.js} +7 -7
  131. package/dist/{chunk-WKJFIMVN.js → chunk-UW4RYPWC.js} +2 -2
  132. package/dist/{chunk-MN5NOOI7.js → chunk-VG4SSPAW.js} +2 -2
  133. package/dist/chunk-WFCWP4XU.js +17 -0
  134. package/dist/chunk-WFCWP4XU.js.map +1 -0
  135. package/dist/{chunk-UNUMFURP.js → chunk-X5PIDJ3L.js} +3 -3
  136. package/dist/{chunk-RZ3IZIJG.js → chunk-XOHYGIWF.js} +2 -2
  137. package/dist/{chunk-MINHJ55X.js → chunk-XXW32OL7.js} +1 -1
  138. package/dist/{chunk-MINHJ55X.js.map → chunk-XXW32OL7.js.map} +1 -1
  139. package/dist/{chunk-6RUHELWR.js → chunk-YWPLOJ7T.js} +2 -2
  140. package/dist/{chunk-ZJPM7GZ3.js → chunk-ZPS724LT.js} +2 -2
  141. package/dist/{chunk-7UTDHQZ5.js → chunk-ZZZWEDF4.js} +2 -2
  142. package/dist/{cli-BEkm2MEf.d.ts → cli-CsfFMe6n.d.ts} +5 -5
  143. package/dist/cli.d.ts +13 -13
  144. package/dist/cli.js +63 -63
  145. package/dist/coding/export-okf-codegraph.d.ts +1 -1
  146. package/dist/coding/export-okf-codegraph.js +9 -9
  147. package/dist/coding/pre-action-gate.d.ts +1 -1
  148. package/dist/compounding/engine.d.ts +2 -2
  149. package/dist/compounding/engine.js +9 -9
  150. package/dist/compounding/preference-consolidator.d.ts +1 -1
  151. package/dist/compression-optimizer.d.ts +1 -1
  152. package/dist/config.d.ts +1 -1
  153. package/dist/config.js +2 -2
  154. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  155. package/dist/connectors/codex-materialize-runner.js +9 -9
  156. package/dist/connectors/codex-materialize.d.ts +1 -1
  157. package/dist/connectors/index.d.ts +1 -1
  158. package/dist/connectors/index.js +9 -9
  159. package/dist/consolidation-provenance-check.d.ts +2 -2
  160. package/dist/consolidation-undo.d.ts +2 -2
  161. package/dist/contradiction/index.d.ts +3 -3
  162. package/dist/converge-config.d.ts +1 -1
  163. package/dist/convergence-refresh.d.ts +2 -2
  164. package/dist/convergence-refresh.js +11 -11
  165. package/dist/conversation-index/backend.d.ts +1 -1
  166. package/dist/conversation-index/chunker.d.ts +1 -1
  167. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  168. package/dist/conversation-index/indexer.d.ts +1 -1
  169. package/dist/conversation-index/search.d.ts +1 -1
  170. package/dist/corpus-watermark.d.ts +1 -1
  171. package/dist/corpus-watermark.js +11 -11
  172. package/dist/cross-lingual-recall.d.ts +1 -1
  173. package/dist/day-summary.d.ts +1 -1
  174. package/dist/delinearize.d.ts +1 -1
  175. package/dist/dependency-propagation-config.d.ts +1 -1
  176. package/dist/{dependency-propagation-delivery-BCpeo14F.d.ts → dependency-propagation-delivery-D4WMbOwA.d.ts} +1 -1
  177. package/dist/direct-answer-wiring.d.ts +1 -1
  178. package/dist/direct-answer.d.ts +1 -1
  179. package/dist/embedding-fallback.d.ts +1 -1
  180. package/dist/enrichment/index.d.ts +1 -1
  181. package/dist/entity-origin-fields.d.ts +1 -1
  182. package/dist/entity-retrieval.d.ts +2 -2
  183. package/dist/entity-retrieval.js +9 -9
  184. package/dist/entity-schema.d.ts +1 -1
  185. package/dist/episodic-context.d.ts +1 -1
  186. package/dist/eval-trajectory-contracts.d.ts +1 -1
  187. package/dist/eval-trajectory-store.d.ts +1 -1
  188. package/dist/eval-trajectory.d.ts +1 -1
  189. package/dist/explicit-capture.d.ts +9 -9
  190. package/dist/external-wiki-access.d.ts +11 -11
  191. package/dist/external-wiki-access.js +23 -23
  192. package/dist/external-wiki-collection-registration.d.ts +1 -1
  193. package/dist/external-wiki-collection.d.ts +1 -1
  194. package/dist/external-wiki-mcp-tools.d.ts +11 -11
  195. package/dist/extraction-error-classification.d.ts +1 -1
  196. package/dist/extraction-faithfulness.d.ts +1 -1
  197. package/dist/extraction-judge-telemetry.d.ts +1 -1
  198. package/dist/extraction-judge-training.d.ts +1 -1
  199. package/dist/extraction-judge.d.ts +1 -1
  200. package/dist/extraction-liveness.d.ts +1 -1
  201. package/dist/extraction-normalization.d.ts +1 -1
  202. package/dist/extraction-prompt.d.ts +1 -1
  203. package/dist/extraction-source-grounding-rules.d.ts +1 -1
  204. package/dist/extraction-source-grounding.d.ts +1 -1
  205. package/dist/extraction.d.ts +1 -1
  206. package/dist/extraction.js +9 -9
  207. package/dist/fallback-llm.d.ts +1 -1
  208. package/dist/graph-dashboard-diff.d.ts +1 -1
  209. package/dist/graph-dashboard-key.d.ts +1 -1
  210. package/dist/graph-dashboard-parser.d.ts +1 -1
  211. package/dist/graph-edge-reinforcement.d.ts +1 -1
  212. package/dist/graph-path-reconstruction.d.ts +1 -1
  213. package/dist/graph-path-scoring.d.ts +1 -1
  214. package/dist/graph-snapshot.d.ts +1 -1
  215. package/dist/graph.d.ts +1 -1
  216. package/dist/harmonic-retrieval.js +1 -1
  217. package/dist/importance.d.ts +1 -1
  218. package/dist/importers/index.d.ts +1 -1
  219. package/dist/in-flight-reads.d.ts +1 -1
  220. package/dist/{index-D_pyMUaP.d.ts → index-DuJnzwHv.d.ts} +2 -2
  221. package/dist/index.d.ts +807 -698
  222. package/dist/index.js +130 -102
  223. package/dist/intent.d.ts +1 -1
  224. package/dist/lcm/engine.d.ts +1 -1
  225. package/dist/lcm/engine.js +4 -4
  226. package/dist/lcm/index.d.ts +1 -1
  227. package/dist/lcm/index.js +10 -10
  228. package/dist/lcm/tools.d.ts +1 -1
  229. package/dist/lifecycle.d.ts +1 -1
  230. package/dist/live-connectors-runner.d.ts +1 -1
  231. package/dist/local-llm.d.ts +1 -1
  232. package/dist/local-model-endpoint.d.ts +1 -1
  233. package/dist/location/index.d.ts +3 -3
  234. package/dist/location/index.js +11 -11
  235. package/dist/maintenance/memory-governance.d.ts +1 -1
  236. package/dist/maintenance/memory-governance.js +9 -9
  237. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
  238. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +9 -9
  239. package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
  240. package/dist/maintenance/rebuild-memory-projection.js +10 -10
  241. package/dist/{maintenance-DDUX9d6D.d.ts → maintenance-BBeaeYRR.d.ts} +3 -3
  242. package/dist/mcp-memory-inspector-app.d.ts +11 -11
  243. package/dist/memory-action-policy.d.ts +1 -1
  244. package/dist/memory-cache.d.ts +1 -1
  245. package/dist/memory-controller.d.ts +1 -1
  246. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  247. package/dist/memory-projection-store.d.ts +1 -1
  248. package/dist/memory-provenance.d.ts +1 -1
  249. package/dist/memory-snapshot.d.ts +1 -1
  250. package/dist/memory-subject-cli.d.ts +11 -11
  251. package/dist/memory-subject.d.ts +11 -11
  252. package/dist/memory-worth-outcomes.d.ts +2 -2
  253. package/dist/models-json.d.ts +1 -1
  254. package/dist/namespaces/migrate.d.ts +3 -3
  255. package/dist/namespaces/migrate.js +10 -10
  256. package/dist/namespaces/principal.d.ts +1 -1
  257. package/dist/namespaces/search.d.ts +1 -1
  258. package/dist/namespaces/search.js +5 -5
  259. package/dist/namespaces/storage.d.ts +3 -3
  260. package/dist/namespaces/storage.js +9 -9
  261. package/dist/native-knowledge.d.ts +1 -1
  262. package/dist/offline-sync-impression-drain.d.ts +1 -1
  263. package/dist/operator-doctor-corpus.d.ts +1 -1
  264. package/dist/operator-doctor-corpus.js +12 -12
  265. package/dist/operator-doctor-replica.d.ts +1 -1
  266. package/dist/operator-toolkit.d.ts +3 -3
  267. package/dist/operator-toolkit.js +19 -19
  268. package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
  269. package/dist/orchestration/maintenance.d.ts +4 -4
  270. package/dist/orchestration/maintenance.js +18 -18
  271. package/dist/{orchestrator-3F4jihCo.d.ts → orchestrator-CaqnwNwM.d.ts} +8 -8
  272. package/dist/orchestrator.d.ts +9 -9
  273. package/dist/orchestrator.js +86 -84
  274. package/dist/patterns-cli.d.ts +1 -1
  275. package/dist/{pipeline-CB1dj6Uh.d.ts → pipeline-CrxVjlJr.d.ts} +1 -1
  276. package/dist/policy-runtime.d.ts +1 -1
  277. package/dist/proactive-contention.d.ts +1 -1
  278. package/dist/provenance.d.ts +1 -1
  279. package/dist/{public-http-34-JIAGQ.d.ts → public-http-Cwvl4QZr.d.ts} +1 -1
  280. package/dist/{qmd-edLLZXc5.d.ts → qmd-BZgbJm0g.d.ts} +1 -1
  281. package/dist/qmd-preflight.d.ts +2 -2
  282. package/dist/qmd-recall-cache.d.ts +1 -1
  283. package/dist/qmd.d.ts +2 -2
  284. package/dist/recall-concurrency-config.d.ts +1 -1
  285. package/dist/recall-deep.d.ts +37 -0
  286. package/dist/recall-deep.js +81 -0
  287. package/dist/recall-deep.js.map +1 -0
  288. package/dist/recall-disclosure-escalation.d.ts +1 -1
  289. package/dist/recall-explain-renderer.d.ts +1 -1
  290. package/dist/recall-explain-renderer.js +3 -3
  291. package/dist/recall-memory-map.d.ts +1 -1
  292. package/dist/recall-navigate.d.ts +70 -0
  293. package/dist/recall-navigate.js +51 -0
  294. package/dist/recall-navigate.js.map +1 -0
  295. package/dist/recall-planner-llm.d.ts +1 -1
  296. package/dist/recall-state-view-wire.d.ts +14 -0
  297. package/dist/recall-state-view-wire.js +11 -0
  298. package/dist/recall-state-view-wire.js.map +1 -0
  299. package/dist/recall-state-view.d.ts +25 -0
  300. package/dist/recall-state-view.js +22 -0
  301. package/dist/recall-state-view.js.map +1 -0
  302. package/dist/recall-state.d.ts +1 -1
  303. package/dist/recall-tag-filter.d.ts +1 -1
  304. package/dist/recall-timings.d.ts +1 -1
  305. package/dist/recall-xray-cli.d.ts +1 -1
  306. package/dist/recall-xray-cli.js +4 -4
  307. package/dist/recall-xray-renderer.d.ts +1 -1
  308. package/dist/recall-xray-renderer.js +3 -3
  309. package/dist/recall-xray.d.ts +1 -1
  310. package/dist/recall-xray.js +2 -2
  311. package/dist/reconcile/cursor.d.ts +1 -1
  312. package/dist/reconcile/manifest.d.ts +1 -1
  313. package/dist/reconcile/plan.d.ts +1 -1
  314. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  315. package/dist/replay/normalizers/claude.d.ts +1 -1
  316. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  317. package/dist/replay/normalizers/shared.d.ts +1 -1
  318. package/dist/replay/runner.d.ts +1 -1
  319. package/dist/replay/types.d.ts +1 -1
  320. package/dist/replica-divergence.d.ts +1 -1
  321. package/dist/replica-peers-config.d.ts +1 -1
  322. package/dist/resolve-auth-token.d.ts +1 -1
  323. package/dist/resume-bundles.js +3 -3
  324. package/dist/retrieval-agents.d.ts +2 -2
  325. package/dist/retrieval-tiers.d.ts +1 -1
  326. package/dist/routing/engine.d.ts +1 -1
  327. package/dist/routing/store.d.ts +1 -1
  328. package/dist/salvage-envelope.d.ts +1 -1
  329. package/dist/schemas.d.ts +152 -152
  330. package/dist/{scope-profiles-BF2lu81V.d.ts → scope-profiles-DFaojvoP.d.ts} +1 -1
  331. package/dist/search/embed-helper.d.ts +1 -1
  332. package/dist/search/factory.d.ts +1 -1
  333. package/dist/search/factory.js +4 -4
  334. package/dist/search/index.d.ts +1 -1
  335. package/dist/search/index.js +10 -10
  336. package/dist/search/lancedb-backend.d.ts +1 -1
  337. package/dist/search/meilisearch-backend.d.ts +1 -1
  338. package/dist/search/noop-backend.d.ts +1 -1
  339. package/dist/search/orama-backend.d.ts +1 -1
  340. package/dist/search/port.d.ts +1 -1
  341. package/dist/search/remote-backend.d.ts +1 -1
  342. package/dist/{semantic-consolidation-5OuWXBRt.d.ts → semantic-consolidation-BiX68wZA.d.ts} +1 -1
  343. package/dist/semantic-consolidation.d.ts +2 -2
  344. package/dist/semantic-consolidation.js +10 -10
  345. package/dist/semantic-rule-promotion.js +9 -9
  346. package/dist/semantic-rule-verifier.d.ts +1 -1
  347. package/dist/semantic-rule-verifier.js +9 -9
  348. package/dist/{service-CrqEhLXD.d.ts → service-D5h2zZ0M.d.ts} +2 -2
  349. package/dist/session-observer-bands.d.ts +1 -1
  350. package/dist/session-observer-state.d.ts +1 -1
  351. package/dist/shared-context/manager.d.ts +7 -7
  352. package/dist/signal.d.ts +1 -1
  353. package/dist/source-agent-qualifier.d.ts +1 -1
  354. package/dist/source-agent-qualifier.js +9 -9
  355. package/dist/{storage-BQn-xnxm.d.ts → storage-CtsaojWD.d.ts} +1 -1
  356. package/dist/storage.d.ts +2 -2
  357. package/dist/storage.js +8 -8
  358. package/dist/subject-config.d.ts +1 -1
  359. package/dist/summarizer.d.ts +1 -1
  360. package/dist/summary-snapshot.d.ts +1 -1
  361. package/dist/support-passport/index.d.ts +14 -14
  362. package/dist/support-passport/index.js +25 -25
  363. package/dist/temporal-supersession.d.ts +2 -2
  364. package/dist/temporal-timeline-recall.d.ts +1 -1
  365. package/dist/temporal-validity.d.ts +1 -1
  366. package/dist/threading.d.ts +1 -1
  367. package/dist/tier-migration.d.ts +2 -2
  368. package/dist/tier-routing.d.ts +1 -1
  369. package/dist/topics.d.ts +1 -1
  370. package/dist/transcript.d.ts +1 -1
  371. package/dist/transfer/capsule-export.js +2 -2
  372. package/dist/transfer/capsule-import.js +2 -2
  373. package/dist/transfer/export-okf.d.ts +1 -1
  374. package/dist/transfer/export-okf.js +10 -10
  375. package/dist/transfer/types.d.ts +78 -78
  376. package/dist/trust-score-stage.d.ts +1 -1
  377. package/dist/trust-score.d.ts +1 -1
  378. package/dist/{types-BRpcNjHZ.d.ts → types-CIpfYz1I.d.ts} +16 -11
  379. package/dist/types.d.ts +1 -1
  380. package/dist/types.js +1 -1
  381. package/dist/utility-runtime.d.ts +1 -1
  382. package/dist/verified-recall.js +9 -9
  383. package/dist/who-knows-cli.d.ts +11 -11
  384. package/dist/who-knows-cli.js +10 -10
  385. package/dist/who-knows.d.ts +11 -11
  386. package/dist/who-knows.js +9 -9
  387. package/dist/write-envelope.d.ts +1 -1
  388. package/package.json +2 -2
  389. package/src/activity/config.test.ts +1 -1
  390. package/src/activity/config.ts +48 -3
  391. package/src/activity/index.ts +2 -0
  392. package/src/activity/journal.test.ts +97 -0
  393. package/src/activity/journal.ts +113 -0
  394. package/src/activity/privacy.test.ts +53 -0
  395. package/src/activity/privacy.ts +80 -0
  396. package/src/activity/timeline/index.ts +2 -0
  397. package/src/activity/timeline/journal-recap.test.ts +113 -0
  398. package/src/activity/timeline/journal-recap.ts +130 -0
  399. package/src/activity/timeline/query.test.ts +198 -0
  400. package/src/activity/timeline/query.ts +313 -0
  401. package/src/activity/timeline/weekly.test.ts +215 -0
  402. package/src/activity/timeline/weekly.ts +234 -0
  403. package/src/activity/types.ts +14 -0
  404. package/src/activity/vault-publish.test.ts +166 -0
  405. package/src/activity/vault-publish.ts +101 -0
  406. package/src/config.test.ts +1 -1
  407. package/src/config.ts +2 -22
  408. package/src/dedup/merge-on-write.test.ts +91 -0
  409. package/src/dedup/merge-on-write.ts +75 -0
  410. package/src/dedup/novelty-gate.test.ts +143 -0
  411. package/src/dedup/novelty-gate.ts +163 -0
  412. package/src/location/recall-exclusion.test.ts +1 -0
  413. package/src/orchestration/extraction-persist.ts +22 -23
  414. package/src/orchestration/generic-recall-paths.ts +11 -0
  415. package/src/orchestration/recall-entry.ts +8 -3
  416. package/src/recall-deep.test.ts +72 -0
  417. package/src/recall-deep.ts +113 -0
  418. package/src/recall-navigate.test.ts +84 -0
  419. package/src/recall-navigate.ts +100 -0
  420. package/src/recall-state-view-wire.test.ts +35 -0
  421. package/src/recall-state-view-wire.ts +28 -0
  422. package/src/recall-state-view.test.ts +131 -0
  423. package/src/recall-state-view.ts +138 -0
  424. package/src/shared-context/governance.test.ts +53 -0
  425. package/src/shared-context/governance.ts +86 -0
  426. package/src/types.ts +3 -10
  427. package/dist/chunk-56IV4J5W.js.map +0 -1
  428. package/dist/chunk-IHGMRDEE.js.map +0 -1
  429. package/dist/chunk-KODXCHXJ.js.map +0 -1
  430. package/dist/chunk-PEBH5DCK.js.map +0 -1
  431. /package/dist/{chunk-J3OND5QT.js.map → chunk-2FA7U5XY.js.map} +0 -0
  432. /package/dist/{chunk-GEJKYA7D.js.map → chunk-2ITZ74A6.js.map} +0 -0
  433. /package/dist/{chunk-2LBAFHOQ.js.map → chunk-2X6BGKQL.js.map} +0 -0
  434. /package/dist/{chunk-4STAANV7.js.map → chunk-4XLTUR6R.js.map} +0 -0
  435. /package/dist/{chunk-FTTJRVB7.js.map → chunk-65JOGLIS.js.map} +0 -0
  436. /package/dist/{chunk-FESUGFIL.js.map → chunk-7UOXCCCI.js.map} +0 -0
  437. /package/dist/{chunk-6CEGSTBD.js.map → chunk-B4AOWRYF.js.map} +0 -0
  438. /package/dist/{chunk-FYWLSFFS.js.map → chunk-C5IUOBCN.js.map} +0 -0
  439. /package/dist/{chunk-FKKGCGYL.js.map → chunk-CHGG74CY.js.map} +0 -0
  440. /package/dist/{chunk-H7VDIF2V.js.map → chunk-CX4OLNIH.js.map} +0 -0
  441. /package/dist/{chunk-Z3YEGSR4.js.map → chunk-D3UXGE5D.js.map} +0 -0
  442. /package/dist/{chunk-7XOG75AU.js.map → chunk-D6Q5EPOV.js.map} +0 -0
  443. /package/dist/{chunk-MJRGVXPQ.js.map → chunk-EH65UV2Z.js.map} +0 -0
  444. /package/dist/{chunk-VQ4AMTGZ.js.map → chunk-EWKVYCFP.js.map} +0 -0
  445. /package/dist/{chunk-23CVL7HS.js.map → chunk-FFUMTH27.js.map} +0 -0
  446. /package/dist/{chunk-GX6FTSYH.js.map → chunk-GAJK3DQ5.js.map} +0 -0
  447. /package/dist/{chunk-O57GM3FR.js.map → chunk-GBEOUCBB.js.map} +0 -0
  448. /package/dist/{chunk-DMEHOEC7.js.map → chunk-H2IRSXZN.js.map} +0 -0
  449. /package/dist/{chunk-CFVTRUR3.js.map → chunk-H6RSANGQ.js.map} +0 -0
  450. /package/dist/{chunk-OAJMQKQR.js.map → chunk-IGZCAHFL.js.map} +0 -0
  451. /package/dist/{chunk-CN4VKV3S.js.map → chunk-INUBU6I5.js.map} +0 -0
  452. /package/dist/{chunk-CTCGHNWN.js.map → chunk-J2R275FN.js.map} +0 -0
  453. /package/dist/{chunk-2QSZNTDO.js.map → chunk-JBPKEARU.js.map} +0 -0
  454. /package/dist/{chunk-VQNRICAQ.js.map → chunk-JKTV3JNX.js.map} +0 -0
  455. /package/dist/{chunk-33MFRY25.js.map → chunk-KI64TTBL.js.map} +0 -0
  456. /package/dist/{chunk-VCKWULAK.js.map → chunk-KJXCD7VR.js.map} +0 -0
  457. /package/dist/{chunk-7LCGFUMB.js.map → chunk-KQAFEZQX.js.map} +0 -0
  458. /package/dist/{chunk-GSKINLAK.js.map → chunk-LJABGXC4.js.map} +0 -0
  459. /package/dist/{chunk-NPIBN2VL.js.map → chunk-LK4TOYPU.js.map} +0 -0
  460. /package/dist/{chunk-EZSCW4EM.js.map → chunk-LYUUA6QB.js.map} +0 -0
  461. /package/dist/{chunk-I5VB44ZK.js.map → chunk-M5ERTI4I.js.map} +0 -0
  462. /package/dist/{chunk-QCRJMU5V.js.map → chunk-NFP4KPTA.js.map} +0 -0
  463. /package/dist/{chunk-YXFCALVT.js.map → chunk-NSTNGMSS.js.map} +0 -0
  464. /package/dist/{chunk-L4X4PJYK.js.map → chunk-NUF7VSEX.js.map} +0 -0
  465. /package/dist/{chunk-IVIAHQBR.js.map → chunk-OJUEUQDJ.js.map} +0 -0
  466. /package/dist/{chunk-ZW4VXELZ.js.map → chunk-OMX6TKXH.js.map} +0 -0
  467. /package/dist/{chunk-EFQCDJZ2.js.map → chunk-QBNE55VA.js.map} +0 -0
  468. /package/dist/{chunk-6QDXA26G.js.map → chunk-RPIS5FQ7.js.map} +0 -0
  469. /package/dist/{chunk-HJXA6ZM7.js.map → chunk-S4CDUXQY.js.map} +0 -0
  470. /package/dist/{chunk-72OIT7KS.js.map → chunk-S4Z2OBTX.js.map} +0 -0
  471. /package/dist/{chunk-4FHRZD5T.js.map → chunk-SZMYGDSM.js.map} +0 -0
  472. /package/dist/{chunk-MAH64N55.js.map → chunk-TBCDF556.js.map} +0 -0
  473. /package/dist/{chunk-K66OY4EI.js.map → chunk-TCQRIIIN.js.map} +0 -0
  474. /package/dist/{chunk-KXIXO76C.js.map → chunk-U65VJSCJ.js.map} +0 -0
  475. /package/dist/{chunk-HNPE66LB.js.map → chunk-U6NGKS32.js.map} +0 -0
  476. /package/dist/{chunk-WKJFIMVN.js.map → chunk-UW4RYPWC.js.map} +0 -0
  477. /package/dist/{chunk-MN5NOOI7.js.map → chunk-VG4SSPAW.js.map} +0 -0
  478. /package/dist/{chunk-UNUMFURP.js.map → chunk-X5PIDJ3L.js.map} +0 -0
  479. /package/dist/{chunk-RZ3IZIJG.js.map → chunk-XOHYGIWF.js.map} +0 -0
  480. /package/dist/{chunk-6RUHELWR.js.map → chunk-YWPLOJ7T.js.map} +0 -0
  481. /package/dist/{chunk-ZJPM7GZ3.js.map → chunk-ZPS724LT.js.map} +0 -0
  482. /package/dist/{chunk-7UTDHQZ5.js.map → chunk-ZZZWEDF4.js.map} +0 -0
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-GDB4J2H3.js";
9
9
  import {
10
10
  importCapsule
11
- } from "./chunk-CTCGHNWN.js";
11
+ } from "./chunk-J2R275FN.js";
12
12
  import {
13
13
  ACTIVE_DECISION_STATUSES,
14
14
  CodegraphRuntimeError,
@@ -27,15 +27,15 @@ import {
27
27
  resolveCodegraphProjectId,
28
28
  serializeDecisionRecord
29
29
  } from "./chunk-QJCWK2A7.js";
30
+ import {
31
+ WriteQuarantineStore
32
+ } from "./chunk-PJSK6OJM.js";
30
33
  import {
31
34
  WHO_KNOWS_DEFAULT_LIMIT,
32
35
  computeWhoKnows,
33
36
  loadWhoKnowsEntities,
34
37
  validateWhoKnowsInput
35
- } from "./chunk-WKJFIMVN.js";
36
- import {
37
- WriteQuarantineStore
38
- } from "./chunk-PJSK6OJM.js";
38
+ } from "./chunk-UW4RYPWC.js";
39
39
  import {
40
40
  trustResultFor
41
41
  } from "./chunk-GNVZQ5JN.js";
@@ -59,13 +59,13 @@ import {
59
59
  } from "./chunk-H7XKCNR6.js";
60
60
  import {
61
61
  toRecallExplainJson
62
- } from "./chunk-CFVTRUR3.js";
62
+ } from "./chunk-H6RSANGQ.js";
63
63
  import {
64
64
  estimateRecallTokens
65
- } from "./chunk-NPIBN2VL.js";
65
+ } from "./chunk-LK4TOYPU.js";
66
66
  import {
67
67
  readAggregateExtractionWatermark
68
- } from "./chunk-ZW4VXELZ.js";
68
+ } from "./chunk-OMX6TKXH.js";
69
69
  import {
70
70
  ReplicaDivergenceMonitor
71
71
  } from "./chunk-CVILPI77.js";
@@ -118,7 +118,7 @@ import {
118
118
  import {
119
119
  CorpusWatermarkCache,
120
120
  computeServiceCorpusCensus
121
- } from "./chunk-4FHRZD5T.js";
121
+ } from "./chunk-SZMYGDSM.js";
122
122
  import {
123
123
  CrossNamespaceBudget,
124
124
  toBudgetWarning
@@ -130,7 +130,7 @@ import {
130
130
  listMemoryGovernanceRuns,
131
131
  readMemoryGovernanceRunArtifact,
132
132
  runMemoryGovernance
133
- } from "./chunk-EFQCDJZ2.js";
133
+ } from "./chunk-QBNE55VA.js";
134
134
  import {
135
135
  ExtractionDeadlineError,
136
136
  isActivityDigestPath,
@@ -147,7 +147,7 @@ import {
147
147
  enqueuePassiveCorrectionNotification,
148
148
  parseBriefingFocus,
149
149
  parseBriefingWindow
150
- } from "./chunk-FESUGFIL.js";
150
+ } from "./chunk-7UOXCCCI.js";
151
151
  import {
152
152
  OKF_RESERVED_BASENAMES,
153
153
  parseEntityFile,
@@ -155,14 +155,14 @@ import {
155
155
  qmdCollectionPathParts,
156
156
  qmdResultPathCandidates,
157
157
  selfDeps
158
- } from "./chunk-GEJKYA7D.js";
158
+ } from "./chunk-2ITZ74A6.js";
159
159
  import {
160
160
  namespaceCollectionName
161
- } from "./chunk-FYWLSFFS.js";
161
+ } from "./chunk-C5IUOBCN.js";
162
162
  import {
163
163
  DEFAULT_RECALL_DISCLOSURE,
164
164
  isRecallDisclosure
165
- } from "./chunk-MINHJ55X.js";
165
+ } from "./chunk-XXW32OL7.js";
166
166
  import {
167
167
  normalizeProjectionPreview,
168
168
  normalizeProjectionTags
@@ -217,6 +217,9 @@ import {
217
217
  normalizeProcedureSteps,
218
218
  parseProcedureStepsFromBody
219
219
  } from "./chunk-QDW3E4RD.js";
220
+ import {
221
+ isValidActivityDate
222
+ } from "./chunk-M6L7HI7R.js";
220
223
  import {
221
224
  filterTrajectoriesByLookbackDays,
222
225
  readCausalTrajectoryRecords
@@ -226,7 +229,7 @@ import {
226
229
  } from "./chunk-ME35HVDJ.js";
227
230
  import {
228
231
  exportCapsule
229
- } from "./chunk-7LCGFUMB.js";
232
+ } from "./chunk-KQAFEZQX.js";
230
233
  import {
231
234
  evaluateActionConfidence
232
235
  } from "./chunk-Z2YFLXHU.js";
@@ -3454,7 +3457,74 @@ function buildNotificationSummary(plan) {
3454
3457
  }
3455
3458
 
3456
3459
  // src/orchestration/generic-recall-paths.ts
3460
+ import path5 from "path";
3461
+
3462
+ // src/activity/journal.ts
3463
+ import { mkdirSync, statSync, writeFileSync } from "fs";
3457
3464
  import path4 from "path";
3465
+ var JOURNAL_DIR_NAME = "journal";
3466
+ var JOURNAL_DAY_TOPLEVEL = /^journal[\\/]\d{4}-\d{2}-\d{2}\.md$/i;
3467
+ var JOURNAL_DAY_ANYWHERE = /(?:^|[\\/])journal[\\/]\d{4}-\d{2}-\d{2}\.md$/i;
3468
+ function journalPath(memoryDir, date) {
3469
+ if (!isValidActivityDate(date)) {
3470
+ throw new RangeError(`Invalid journal date "${date}"; expected YYYY-MM-DD.`);
3471
+ }
3472
+ return path4.join(memoryDir, JOURNAL_DIR_NAME, `${date}.md`);
3473
+ }
3474
+ function isJournalDayPath(filePath, memoryRoot) {
3475
+ if (memoryRoot !== void 0 && memoryRoot.length > 0) {
3476
+ const relative2 = path4.relative(memoryRoot, path4.resolve(memoryRoot, filePath));
3477
+ return JOURNAL_DAY_TOPLEVEL.test(relative2);
3478
+ }
3479
+ return JOURNAL_DAY_ANYWHERE.test(filePath);
3480
+ }
3481
+ function todayJournalDate(now = /* @__PURE__ */ new Date()) {
3482
+ const year = now.getFullYear();
3483
+ const month = String(now.getMonth() + 1).padStart(2, "0");
3484
+ const day = String(now.getDate()).padStart(2, "0");
3485
+ return `${year}-${month}-${day}`;
3486
+ }
3487
+ function formatCardDuration(card) {
3488
+ const start = Date.parse(card.startUtc);
3489
+ const end = Date.parse(card.endUtc);
3490
+ const minutes = Number.isFinite(start) && Number.isFinite(end) && end > start ? Math.round((end - start) / 6e4) : 0;
3491
+ return `${minutes}m`;
3492
+ }
3493
+ function renderJournalSeed(date, cards) {
3494
+ const ordered = [...cards].sort((left, right) => {
3495
+ const byStart = left.startUtc.localeCompare(right.startUtc);
3496
+ return byStart !== 0 ? byStart : left.title.localeCompare(right.title);
3497
+ });
3498
+ const glance = ordered.length === 0 ? ["_No cards._"] : ordered.map((card) => `- ${formatCardDuration(card)} ${card.title}`);
3499
+ return [`# Journal \u2014 ${date}`, "", "## Day at a glance", "", ...glance, "", "## Notes", "", ""].join(
3500
+ "\n"
3501
+ );
3502
+ }
3503
+ function writeJournalFile(filePath, content, force) {
3504
+ let exists = false;
3505
+ try {
3506
+ statSync(filePath);
3507
+ exists = true;
3508
+ } catch (err) {
3509
+ const code = err.code;
3510
+ if (code !== "ENOENT") throw err;
3511
+ }
3512
+ if (exists && !force) return false;
3513
+ mkdirSync(path4.dirname(filePath), { recursive: true });
3514
+ writeFileSync(filePath, content);
3515
+ return true;
3516
+ }
3517
+ function seedJournal(input) {
3518
+ const filePath = journalPath(input.memoryDir, input.date);
3519
+ const wrote = writeJournalFile(
3520
+ filePath,
3521
+ renderJournalSeed(input.date, input.cards ?? []),
3522
+ input.force === true
3523
+ );
3524
+ return { path: filePath, wrote };
3525
+ }
3526
+
3527
+ // src/orchestration/generic-recall-paths.ts
3458
3528
  var CATEGORY_MEMORY_ROOTS = Object.fromEntries(
3459
3529
  ALL_CATEGORY_DIRS.map((directory) => [directory, true])
3460
3530
  );
@@ -3479,7 +3549,7 @@ function normalizeQmdUriPath(relativePath, source) {
3479
3549
  }
3480
3550
  }
3481
3551
  function stripQmdCollectionPrefix(relativePath, policy, source) {
3482
- const normalized = path4.posix.normalize(normalizeQmdUriPath(relativePath, source).replace(/\\/g, "/"));
3552
+ const normalized = path5.posix.normalize(normalizeQmdUriPath(relativePath, source).replace(/\\/g, "/"));
3483
3553
  const slashIndex = normalized.indexOf("/");
3484
3554
  if (slashIndex <= 0 || slashIndex >= normalized.length - 1) return normalized;
3485
3555
  const prefix = normalized.slice(0, slashIndex);
@@ -3488,8 +3558,8 @@ function stripQmdCollectionPrefix(relativePath, policy, source) {
3488
3558
  return matchesHotCollection || matchesColdCollection ? normalized.slice(slashIndex + 1) : normalized;
3489
3559
  }
3490
3560
  function isTopLevelArchivePath(filePath, policy = {}, source = "filesystem") {
3491
- const isAbsolutePath = path4.isAbsolute(filePath);
3492
- const relative2 = policy.memoryDir && isAbsolutePath ? path4.relative(policy.memoryDir, path4.resolve(filePath)) : filePath;
3561
+ const isAbsolutePath = path5.isAbsolute(filePath);
3562
+ const relative2 = policy.memoryDir && isAbsolutePath ? path5.relative(policy.memoryDir, path5.resolve(filePath)) : filePath;
3493
3563
  const normalized = !isAbsolutePath ? stripQmdCollectionPrefix(relative2, policy, source) : relative2;
3494
3564
  return /^(?:archive|namespaces[\\/][^\\/]+[\\/]archive)(?:[\\/]|$)/i.test(normalized);
3495
3565
  }
@@ -3503,7 +3573,7 @@ function isExternalWikiQmdPath(filePath, source) {
3503
3573
  function isSearchExcludedPath(filePath, policy = {}, source = "filesystem") {
3504
3574
  if (isExternalWikiQmdPath(filePath, source)) return true;
3505
3575
  for (const candidate of collectionSpellings(filePath, policy, source)) {
3506
- if (isArtifactMemoryPath(candidate) || isNamespacedActivityDigestPath(candidate, policy.memoryDir) || isNamespacedLocationDayPath(candidate, policy.memoryDir) || isMeetingRecordPath(candidate)) {
3576
+ if (isArtifactMemoryPath(candidate) || isNamespacedActivityDigestPath(candidate, policy.memoryDir) || isNamespacedLocationDayPath(candidate, policy.memoryDir) || isNamespacedJournalDayPath(candidate, policy.memoryDir) || isMeetingRecordPath(candidate)) {
3507
3577
  return true;
3508
3578
  }
3509
3579
  }
@@ -3512,7 +3582,7 @@ function isSearchExcludedPath(filePath, policy = {}, source = "filesystem") {
3512
3582
  function isNamespacedActivityDigestPath(candidate, memoryDir) {
3513
3583
  if (isActivityDigestPath(candidate, memoryDir)) return true;
3514
3584
  if (memoryDir === void 0 || memoryDir.length === 0) return false;
3515
- const relative2 = path4.relative(memoryDir, path4.resolve(memoryDir, candidate));
3585
+ const relative2 = path5.relative(memoryDir, path5.resolve(memoryDir, candidate));
3516
3586
  const namespaced = /^namespaces[\\/]([^\\/]+)[\\/](.*)$/.exec(relative2);
3517
3587
  if (namespaced === null) return false;
3518
3588
  return isActivityDigestPath(namespaced[2] ?? "", memoryDir);
@@ -3520,19 +3590,27 @@ function isNamespacedActivityDigestPath(candidate, memoryDir) {
3520
3590
  function isNamespacedLocationDayPath(candidate, memoryDir) {
3521
3591
  if (isLocationDayPath(candidate, memoryDir)) return true;
3522
3592
  if (memoryDir === void 0 || memoryDir.length === 0) return false;
3523
- const relative2 = path4.relative(memoryDir, path4.resolve(memoryDir, candidate));
3593
+ const relative2 = path5.relative(memoryDir, path5.resolve(memoryDir, candidate));
3524
3594
  const namespaced = /^namespaces[\\/]([^\\/]+)[\\/](.*)$/.exec(relative2);
3525
3595
  if (namespaced === null) return false;
3526
3596
  return isLocationDayPath(namespaced[2] ?? "", memoryDir);
3527
3597
  }
3598
+ function isNamespacedJournalDayPath(candidate, memoryDir) {
3599
+ if (isJournalDayPath(candidate, memoryDir)) return true;
3600
+ if (memoryDir === void 0 || memoryDir.length === 0) return false;
3601
+ const relative2 = path5.relative(memoryDir, path5.resolve(memoryDir, candidate));
3602
+ const namespaced = /^namespaces[\\/]([^\\/]+)[\\/](.*)$/.exec(relative2);
3603
+ if (namespaced === null) return false;
3604
+ return isJournalDayPath(namespaced[2] ?? "", memoryDir);
3605
+ }
3528
3606
  function collectionSpellings(filePath, policy, source) {
3529
- if (path4.isAbsolute(filePath)) return [filePath];
3607
+ if (path5.isAbsolute(filePath)) return [filePath];
3530
3608
  if (source === "qmd" && filePath.startsWith("qmd://")) {
3531
- const normalized2 = path4.posix.normalize(normalizeQmdUriPath(filePath, source).replace(/\\/g, "/"));
3609
+ const normalized2 = path5.posix.normalize(normalizeQmdUriPath(filePath, source).replace(/\\/g, "/"));
3532
3610
  const slashIndex2 = normalized2.indexOf("/");
3533
3611
  return slashIndex2 <= 0 || slashIndex2 >= normalized2.length - 1 ? [normalized2] : [normalized2, normalized2.slice(slashIndex2 + 1)];
3534
3612
  }
3535
- const normalized = path4.posix.normalize(
3613
+ const normalized = path5.posix.normalize(
3536
3614
  normalizeQmdUriPath(filePath, source).replace(/\\/g, "/")
3537
3615
  );
3538
3616
  const stripped = stripQmdCollectionPrefix(filePath, policy, source);
@@ -3549,7 +3627,7 @@ function collectionSpellings(filePath, policy, source) {
3549
3627
  return spellings;
3550
3628
  }
3551
3629
  function isGenericRecallExcludedPath(filePath, policy = {}, source = "filesystem") {
3552
- return isSearchExcludedPath(filePath, policy, source) || isTopLevelArchivePath(filePath, policy, source) || OKF_RESERVED_BASENAMES[path4.basename(filePath)] === true;
3630
+ return isSearchExcludedPath(filePath, policy, source) || isTopLevelArchivePath(filePath, policy, source) || OKF_RESERVED_BASENAMES[path5.basename(filePath)] === true;
3553
3631
  }
3554
3632
  function filterRecallCandidates(candidates, options) {
3555
3633
  const pathPolicy = options.pathPolicy ?? (options.memoryRoot === void 0 ? void 0 : { memoryDir: options.memoryRoot });
@@ -3562,7 +3640,7 @@ function filterRecallCandidates(candidates, options) {
3562
3640
  // src/procedural/procedure-miner.ts
3563
3641
  import { createHash as createHash2 } from "crypto";
3564
3642
  import { mkdir as mkdir2, rm, stat } from "fs/promises";
3565
- import path5 from "path";
3643
+ import path6 from "path";
3566
3644
 
3567
3645
  // src/procedural/reinforcement-core.ts
3568
3646
  function clusterByKey(items, keyFn) {
@@ -3615,8 +3693,8 @@ function sleep(ms) {
3615
3693
  return new Promise((resolve4) => setTimeout(resolve4, ms));
3616
3694
  }
3617
3695
  async function acquireClusterWriteLock(memoryDir, clusterHash) {
3618
- const lockRoot = path5.join(path5.resolve(memoryDir), "state", "procedure-miner-locks");
3619
- const lockDir = path5.join(lockRoot, `${clusterHash}.lock`);
3696
+ const lockRoot = path6.join(path6.resolve(memoryDir), "state", "procedure-miner-locks");
3697
+ const lockDir = path6.join(lockRoot, `${clusterHash}.lock`);
3620
3698
  await mkdir2(lockRoot, { recursive: true });
3621
3699
  const startedAt = Date.now();
3622
3700
  let attempts = 0;
@@ -3647,7 +3725,7 @@ async function acquireClusterWriteLock(memoryDir, clusterHash) {
3647
3725
  }
3648
3726
  }
3649
3727
  async function withClusterWriteLock(memoryDir, clusterHash, fn) {
3650
- const inProcessKey = `${path5.resolve(memoryDir)}:${clusterHash}`;
3728
+ const inProcessKey = `${path6.resolve(memoryDir)}:${clusterHash}`;
3651
3729
  const previous = inProcessClusterWriteLocks.get(inProcessKey) ?? Promise.resolve();
3652
3730
  let releaseInProcess;
3653
3731
  const current = previous.catch(() => void 0).then(
@@ -3785,7 +3863,7 @@ async function runProcedureMining(options) {
3785
3863
  }
3786
3864
 
3787
3865
  // src/support-passport/offline-sync-guard.ts
3788
- import path6 from "path";
3866
+ import path7 from "path";
3789
3867
  var MAX_SUPPORT_PASSPORT_FRONTMATTER_BYTES = 1048576;
3790
3868
  var SUPPORT_PASSPORT_MARKER = "support-passport-";
3791
3869
  var FRONTMATTER_PREFIXES = ["---\n", "---\r\n"];
@@ -3855,7 +3933,7 @@ function createSupportPassportOfflineSyncGuard(storage) {
3855
3933
  return {
3856
3934
  root: storage.dir,
3857
3935
  path: normalizedPath,
3858
- filePath: path6.resolve(storage.dir, ...normalizedPath.split("/"))
3936
+ filePath: path7.resolve(storage.dir, ...normalizedPath.split("/"))
3859
3937
  };
3860
3938
  };
3861
3939
  const assertTargetAllowed = async (target) => {
@@ -4187,10 +4265,10 @@ function formatZodIssues(error) {
4187
4265
  const parts = [];
4188
4266
  for (const issue of error.issues) {
4189
4267
  const hasNumeric = issue.path.some((p) => typeof p === "number");
4190
- const path18 = hasNumeric ? issue.path.filter((p) => typeof p === "string").join(".") || "(root)" : issue.path.length > 0 ? issue.path.join(".") : "(root)";
4268
+ const path19 = hasNumeric ? issue.path.filter((p) => typeof p === "string").join(".") || "(root)" : issue.path.length > 0 ? issue.path.join(".") : "(root)";
4191
4269
  const options = enumOptionsFromIssue(issue);
4192
4270
  const suffix = options ? `. Valid: ${options.join(", ")}` : "";
4193
- parts.push(`${path18}: ${issue.message}${suffix}`);
4271
+ parts.push(`${path19}: ${issue.message}${suffix}`);
4194
4272
  }
4195
4273
  return parts.length > 0 ? `request validation failed: ${parts.join("; ")}` : "request validation failed";
4196
4274
  }
@@ -4332,7 +4410,7 @@ function resolveQueryNamespaceWritablePreflight(caps, params, authenticatedPrinc
4332
4410
  }
4333
4411
 
4334
4412
  // src/admin/admin-surfaces.ts
4335
- import path7 from "path";
4413
+ import path8 from "path";
4336
4414
  var REDACTED = "<redacted>";
4337
4415
  var SENSITIVE_KEY_RE = /(token|secret|password|api[_-]?key|bearer|authorization|credential|private[_-]?key)/i;
4338
4416
  var BEARER_VALUE_RE = /^(bearer|sk-|pk-|xox[bp]-|AKIA)/i;
@@ -4605,7 +4683,7 @@ async function auditTranscripts(memoryDir) {
4605
4683
  movedEntries: file.groups.reduce((sum, group) => sum + group.entryCount, 0),
4606
4684
  unmovableLines: file.unmovableLines
4607
4685
  }));
4608
- const mixedOtherDefault = files.some((file) => file.sourceRelPath.split(path7.sep).includes("other"));
4686
+ const mixedOtherDefault = files.some((file) => file.sourceRelPath.split(path8.sep).includes("other"));
4609
4687
  const summary = plan.movedEntries === 0 ? "No mixed-session transcript data detected; nothing to migrate." : `Found ${plan.movedEntries} entries across ${plan.distinctSessions} distinct sessions stranded in shared/legacy directories. Run the CLI migration command to re-home them.`;
4610
4688
  return {
4611
4689
  generatedAt: plan.generatedAt,
@@ -4744,11 +4822,11 @@ async function promoteMemory(options) {
4744
4822
  }
4745
4823
 
4746
4824
  // src/procedural/library-maintenance.ts
4747
- import path8 from "path";
4825
+ import path9 from "path";
4748
4826
  var MAINTENANCE_ACTOR = "procedure-library-maintenance";
4749
4827
  var MAINTENANCE_RULE_VERSION = "procedure-library-maintenance:1";
4750
4828
  function maintenanceMarkerPath(memoryDir) {
4751
- return path8.join(memoryDir, "state", "procedure-maintenance.json");
4829
+ return path9.join(memoryDir, "state", "procedure-maintenance.json");
4752
4830
  }
4753
4831
  async function readProcedureMaintenanceMarker(memoryDir) {
4754
4832
  try {
@@ -7668,7 +7746,7 @@ import { createHash as createHash4 } from "crypto";
7668
7746
  import * as nodePath2 from "path";
7669
7747
 
7670
7748
  // src/orchestration/recall-result-formatter.ts
7671
- import path9 from "path";
7749
+ import path10 from "path";
7672
7750
  function renderConnectorLabel(connector) {
7673
7751
  if (!isValidConnectorId(connector)) return null;
7674
7752
  return connector.length <= CONNECTOR_LABEL_MAX_LENGTH ? connector : `${connector.slice(0, CONNECTOR_LABEL_MAX_LENGTH - 1)}\u2026`;
@@ -7690,15 +7768,15 @@ function resolveEffectiveIdentityInjectionMode(options) {
7690
7768
  return { mode: options.configuredMode, shouldInject: true };
7691
7769
  }
7692
7770
  function displayResultPath(resultPath, memoryDir, namespace) {
7693
- if (!path9.isAbsolute(resultPath)) return resultPath;
7694
- const root = path9.resolve(memoryDir);
7695
- const nsRoot = path9.join(root, "namespaces");
7696
- if (namespace && (resultPath === nsRoot || resultPath.startsWith(nsRoot + path9.sep))) {
7697
- const afterNs = path9.relative(nsRoot, resultPath).split(path9.sep).slice(1).join("/");
7771
+ if (!path10.isAbsolute(resultPath)) return resultPath;
7772
+ const root = path10.resolve(memoryDir);
7773
+ const nsRoot = path10.join(root, "namespaces");
7774
+ if (namespace && (resultPath === nsRoot || resultPath.startsWith(nsRoot + path10.sep))) {
7775
+ const afterNs = path10.relative(nsRoot, resultPath).split(path10.sep).slice(1).join("/");
7698
7776
  if (afterNs) return `${namespace}/${afterNs}`;
7699
7777
  }
7700
- const rel = path9.relative(root, resultPath);
7701
- return rel && !rel.startsWith("..") && !path9.isAbsolute(rel) ? rel.split(path9.sep).join("/") : resultPath;
7778
+ const rel = path10.relative(root, resultPath);
7779
+ return rel && !rel.startsWith("..") && !path10.isAbsolute(rel) ? rel.split(path10.sep).join("/") : resultPath;
7702
7780
  }
7703
7781
  function displaySafeRecallSnapshot(snapshot, memoryDir) {
7704
7782
  const includedMemories = coerceIncludedMemories(snapshot).map((memory) => ({
@@ -9163,14 +9241,14 @@ function parseCursorPayload(cursor) {
9163
9241
  // src/review/review-deck-mutation.ts
9164
9242
  import { createHash as createHash6, randomUUID } from "crypto";
9165
9243
  import fs3 from "fs";
9166
- import path12 from "path";
9244
+ import path13 from "path";
9167
9245
 
9168
9246
  // src/review/index.ts
9169
9247
  import fs from "fs";
9170
- import path10 from "path";
9248
+ import path11 from "path";
9171
9249
  var historicalIdCache = new HistoricalEntityCanonicalIdCache();
9172
9250
  function writeReviewFileCanonicalized(memoryDir, filePath, content) {
9173
- const stateDir = path10.join(memoryDir, "state");
9251
+ const stateDir = path11.join(memoryDir, "state");
9174
9252
  const idsAtWrite = historicalIdCache.get(stateDir);
9175
9253
  let originalBytes = null;
9176
9254
  try {
@@ -9212,8 +9290,8 @@ function realMemoryRoot(memoryDir) {
9212
9290
  }
9213
9291
  }
9214
9292
  function isPathInside(rootReal, candidateReal) {
9215
- const relative2 = path10.relative(rootReal, candidateReal);
9216
- return relative2 === "" || !!relative2 && !relative2.startsWith("..") && !path10.isAbsolute(relative2);
9293
+ const relative2 = path11.relative(rootReal, candidateReal);
9294
+ return relative2 === "" || !!relative2 && !relative2.startsWith("..") && !path11.isAbsolute(relative2);
9217
9295
  }
9218
9296
  function isSafeDirectory(rootReal, dir) {
9219
9297
  try {
@@ -9256,7 +9334,7 @@ function listReviewItems(options) {
9256
9334
  if (filterReason && item.reviewReason !== filterReason) return;
9257
9335
  items.push(item);
9258
9336
  };
9259
- const suggestionsDir = path10.join(memoryDir, "suggestions");
9337
+ const suggestionsDir = path11.join(memoryDir, "suggestions");
9260
9338
  if (!isLimitReached() && fs.existsSync(suggestionsDir) && isSafeDirectory(rootReal, suggestionsDir)) {
9261
9339
  walkMd(rootReal, suggestionsDir, (filePath, content) => {
9262
9340
  if (isLimitReached()) return true;
@@ -9277,7 +9355,7 @@ function listReviewItems(options) {
9277
9355
  return isLimitReached();
9278
9356
  });
9279
9357
  }
9280
- const reviewDir = path10.join(memoryDir, "review");
9358
+ const reviewDir = path11.join(memoryDir, "review");
9281
9359
  if (!isLimitReached() && fs.existsSync(reviewDir) && isSafeDirectory(rootReal, reviewDir)) {
9282
9360
  walkMd(rootReal, reviewDir, (filePath, content) => {
9283
9361
  if (isLimitReached()) return true;
@@ -9302,7 +9380,7 @@ function listReviewItems(options) {
9302
9380
  const categories = ALL_CATEGORY_DIRS;
9303
9381
  for (const category of categories) {
9304
9382
  if (isLimitReached()) break;
9305
- const dir = path10.join(memoryDir, category);
9383
+ const dir = path11.join(memoryDir, category);
9306
9384
  if (!fs.existsSync(dir) || !isSafeDirectory(rootReal, dir)) continue;
9307
9385
  walkMd(rootReal, dir, (filePath, content) => {
9308
9386
  if (isLimitReached()) return true;
@@ -9384,9 +9462,9 @@ function approveItem(memoryDir, itemId, options) {
9384
9462
  const targetDir = getCategoryDir(memoryDir, category);
9385
9463
  const dateDir = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
9386
9464
  ensureSafeDirectory(rootReal, targetDir);
9387
- const outputPath = path10.join(targetDir, dateDir, path10.basename(found.filePath));
9388
- ensureSafeDirectory(rootReal, path10.dirname(outputPath));
9389
- const reviewStateDir = path10.join(memoryDir, "state");
9465
+ const outputPath = path11.join(targetDir, dateDir, path11.basename(found.filePath));
9466
+ ensureSafeDirectory(rootReal, path11.dirname(outputPath));
9467
+ const reviewStateDir = path11.join(memoryDir, "state");
9390
9468
  const idsAtWrite = historicalIdCache.get(reviewStateDir);
9391
9469
  const promotedWritten = canonicalizeEntityRefFrontmatter(updatedContent, idsAtWrite);
9392
9470
  const promotedPath = writeFileWithoutClobber(outputPath, promotedWritten, itemId);
@@ -9463,13 +9541,13 @@ function findReviewFileById(memoryDir, id, options = {}) {
9463
9541
  const rootReal = realMemoryRoot(memoryDir);
9464
9542
  if (!rootReal) return null;
9465
9543
  for (const loc of ["suggestions", "review"]) {
9466
- const dir = path10.join(memoryDir, loc);
9544
+ const dir = path11.join(memoryDir, loc);
9467
9545
  if (!fs.existsSync(dir) || !isSafeDirectory(rootReal, dir)) continue;
9468
9546
  const found = findFileById(rootReal, dir, id);
9469
9547
  if (found) return { filePath: found, location: "queue" };
9470
9548
  }
9471
9549
  for (const category of ALL_CATEGORY_DIRS) {
9472
- const dir = path10.join(memoryDir, category);
9550
+ const dir = path11.join(memoryDir, category);
9473
9551
  if (!fs.existsSync(dir) || !isSafeDirectory(rootReal, dir)) continue;
9474
9552
  const found = findFileById(rootReal, dir, id, (fm) => isLowConfidenceReviewCandidate(fm, options));
9475
9553
  if (found) return { filePath: found, location: "category" };
@@ -9545,10 +9623,10 @@ function readFileSafe(filePath) {
9545
9623
  }
9546
9624
  }
9547
9625
  function writeFileWithoutClobber(basePath, content, discriminator) {
9548
- const parsed = path10.parse(basePath);
9626
+ const parsed = path11.parse(basePath);
9549
9627
  const safeDiscriminator = sanitizeFilePart(discriminator);
9550
9628
  for (let attempt = 0; attempt < 1e3; attempt++) {
9551
- const candidate = attempt === 0 ? basePath : path10.join(
9629
+ const candidate = attempt === 0 ? basePath : path11.join(
9552
9630
  parsed.dir,
9553
9631
  `${parsed.name}-${safeDiscriminator}${attempt === 1 ? "" : `-${attempt}`}${parsed.ext || ".md"}`
9554
9632
  );
@@ -9604,7 +9682,7 @@ function extractBody(content) {
9604
9682
  function walkMd(rootReal, dir, callback) {
9605
9683
  if (!isSafeDirectory(rootReal, dir)) return false;
9606
9684
  for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
9607
- const fullPath = path10.join(dir, entry.name);
9685
+ const fullPath = path11.join(dir, entry.name);
9608
9686
  if (entry.isSymbolicLink()) continue;
9609
9687
  if (entry.isDirectory()) {
9610
9688
  if (walkMd(rootReal, fullPath, callback)) return true;
@@ -9619,7 +9697,7 @@ function walkMdPaths(rootReal, dir) {
9619
9697
  const results = [];
9620
9698
  if (!isSafeDirectory(rootReal, dir)) return results;
9621
9699
  for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
9622
- const fullPath = path10.join(dir, entry.name);
9700
+ const fullPath = path11.join(dir, entry.name);
9623
9701
  if (entry.isSymbolicLink()) continue;
9624
9702
  if (entry.isDirectory()) {
9625
9703
  results.push(...walkMdPaths(rootReal, fullPath));
@@ -9632,7 +9710,7 @@ function walkMdPaths(rootReal, dir) {
9632
9710
 
9633
9711
  // src/review/review-deck-snapshot.ts
9634
9712
  import fs2 from "fs";
9635
- import path11 from "path";
9713
+ import path12 from "path";
9636
9714
  var QUEUE_DIRS = ["suggestions", "review"];
9637
9715
  function readReviewDeckSnapshot(opts) {
9638
9716
  const corpusVersion = readCorpusVersion(opts.memoryDir);
@@ -9640,7 +9718,7 @@ function readReviewDeckSnapshot(opts) {
9640
9718
  if (!rootReal) return { corpusVersion, total: 0, rows: [] };
9641
9719
  const rows = [];
9642
9720
  for (const location of QUEUE_DIRS) {
9643
- const dir = path11.join(opts.memoryDir, location);
9721
+ const dir = path12.join(opts.memoryDir, location);
9644
9722
  if (!fs2.existsSync(dir) || !isSafeDirectory2(rootReal, dir)) continue;
9645
9723
  walkMd2(rootReal, dir, (filePath, content) => {
9646
9724
  const row = rowFromQueueFile(filePath, content, location);
@@ -9653,7 +9731,7 @@ function readReviewDeckRow(opts) {
9653
9731
  const rootReal = realMemoryRoot2(opts.memoryDir);
9654
9732
  if (!rootReal) return null;
9655
9733
  for (const location of QUEUE_DIRS) {
9656
- const dir = path11.join(opts.memoryDir, location);
9734
+ const dir = path12.join(opts.memoryDir, location);
9657
9735
  if (!fs2.existsSync(dir) || !isSafeDirectory2(rootReal, dir)) continue;
9658
9736
  let found = null;
9659
9737
  walkMd2(rootReal, dir, (filePath, content) => {
@@ -9669,7 +9747,7 @@ function readReviewDeckRow(opts) {
9669
9747
  }
9670
9748
  function readCorpusVersion(memoryDir) {
9671
9749
  try {
9672
- return String(fs2.statSync(path11.join(memoryDir, "state", MEMORY_CORPUS_VERSION_SENTINEL)).size);
9750
+ return String(fs2.statSync(path12.join(memoryDir, "state", MEMORY_CORPUS_VERSION_SENTINEL)).size);
9673
9751
  } catch {
9674
9752
  return "0";
9675
9753
  }
@@ -9719,8 +9797,8 @@ function realMemoryRoot2(memoryDir) {
9719
9797
  }
9720
9798
  }
9721
9799
  function isPathInside2(rootReal, candidateReal) {
9722
- const relative2 = path11.relative(rootReal, candidateReal);
9723
- return relative2 === "" || !!relative2 && !relative2.startsWith("..") && !path11.isAbsolute(relative2);
9800
+ const relative2 = path12.relative(rootReal, candidateReal);
9801
+ return relative2 === "" || !!relative2 && !relative2.startsWith("..") && !path12.isAbsolute(relative2);
9724
9802
  }
9725
9803
  function isSafeDirectory2(rootReal, dir) {
9726
9804
  try {
@@ -9734,7 +9812,7 @@ function isSafeDirectory2(rootReal, dir) {
9734
9812
  function walkMd2(rootReal, dir, callback) {
9735
9813
  if (!isSafeDirectory2(rootReal, dir)) return false;
9736
9814
  for (const entry of fs2.readdirSync(dir, { withFileTypes: true })) {
9737
- const fullPath = path11.join(dir, entry.name);
9815
+ const fullPath = path12.join(dir, entry.name);
9738
9816
  if (entry.isSymbolicLink()) continue;
9739
9817
  if (entry.isDirectory()) {
9740
9818
  if (walkMd2(rootReal, fullPath, callback)) return true;
@@ -9849,7 +9927,7 @@ function parseReviewLifecycleReceipt(value) {
9849
9927
  if (!isReceiptAction(rec.action)) return null;
9850
9928
  if (typeof rec.beforeRevision !== "string") return null;
9851
9929
  if (typeof rec.afterRevision !== "string") return null;
9852
- if (!isNonEmptyString(rec.sourcePath) || path12.isAbsolute(rec.sourcePath)) return null;
9930
+ if (!isNonEmptyString(rec.sourcePath) || path13.isAbsolute(rec.sourcePath)) return null;
9853
9931
  if (rec.revisionArtifact !== void 0 && typeof rec.revisionArtifact !== "string") return null;
9854
9932
  if (rec.undoOfReceiptId !== void 0 && typeof rec.undoOfReceiptId !== "string") return null;
9855
9933
  const parsed = {
@@ -9881,11 +9959,11 @@ function findStoredReceipt(events, receiptId) {
9881
9959
  return null;
9882
9960
  }
9883
9961
  function resolveInside(memoryDir, rel) {
9884
- if (!rel || path12.isAbsolute(rel)) return null;
9885
- const root = path12.resolve(memoryDir);
9886
- const abs = path12.resolve(root, rel.split("/").join(path12.sep));
9887
- const next = path12.relative(root, abs);
9888
- if (next.startsWith("..") || path12.isAbsolute(next)) return null;
9962
+ if (!rel || path13.isAbsolute(rel)) return null;
9963
+ const root = path13.resolve(memoryDir);
9964
+ const abs = path13.resolve(root, rel.split("/").join(path13.sep));
9965
+ const next = path13.relative(root, abs);
9966
+ if (next.startsWith("..") || path13.isAbsolute(next)) return null;
9889
9967
  return abs;
9890
9968
  }
9891
9969
  function currentRevision(absPath) {
@@ -10548,14 +10626,14 @@ async function completeSupportPassportReplacementPrior(input) {
10548
10626
  }
10549
10627
 
10550
10628
  // src/support-passport/generated-batch.ts
10551
- import path14 from "path";
10629
+ import path15 from "path";
10552
10630
  import { z as z2 } from "zod";
10553
10631
 
10554
10632
  // src/support-passport/private-file.ts
10555
10633
  import { randomUUID as randomUUID2 } from "crypto";
10556
10634
  import { constants as fsConstants } from "fs";
10557
10635
  import { lstat as lstat2, mkdir as mkdir3, open, rename as rename2, rm as rm2, stat as stat2 } from "fs/promises";
10558
- import path13 from "path";
10636
+ import path14 from "path";
10559
10637
  var UNSUPPORTED_DIRECTORY_SYNC_ERRORS = /* @__PURE__ */ new Set(["EINVAL", "ENOSYS", "ENOTSUP", "EOPNOTSUPP"]);
10560
10638
  var NON_WRITABLE_ANCESTOR_SYNC_ERRORS = /* @__PURE__ */ new Set(["EROFS", "EPERM", "EACCES"]);
10561
10639
  function assertStableDirectory(before, opened, after, errorMessage) {
@@ -10581,8 +10659,8 @@ function openFlags(...flags) {
10581
10659
  return combined;
10582
10660
  }
10583
10661
  function assertContainedPath(trustedRoot, directory, errorMessage) {
10584
- const relative2 = path13.relative(path13.resolve(trustedRoot), path13.resolve(directory));
10585
- if (relative2 === ".." || relative2.startsWith(`..${path13.sep}`) || path13.isAbsolute(relative2)) {
10662
+ const relative2 = path14.relative(path14.resolve(trustedRoot), path14.resolve(directory));
10663
+ if (relative2 === ".." || relative2.startsWith(`..${path14.sep}`) || path14.isAbsolute(relative2)) {
10586
10664
  throw new Error(errorMessage);
10587
10665
  }
10588
10666
  }
@@ -10615,7 +10693,7 @@ async function syncDirectoryHandle(handle) {
10615
10693
  }
10616
10694
  async function resolvePrivateDirectoryPath(directory, handle, opened, errorMessage, platform = process.platform) {
10617
10695
  const descriptorRoot = requirePrivateFileDescriptorRoot(platform, errorMessage);
10618
- const pinnedPath = path13.join(descriptorRoot, String(handle.fd));
10696
+ const pinnedPath = path14.join(descriptorRoot, String(handle.fd));
10619
10697
  const metadata = await stat2(pinnedPath);
10620
10698
  if (!metadata.isDirectory() || metadata.dev !== opened.dev || metadata.ino !== opened.ino) {
10621
10699
  throw new Error(errorMessage);
@@ -10631,12 +10709,12 @@ function requirePrivateFileDescriptorRoot(platform, errorMessage) {
10631
10709
  throw new Error(errorMessage);
10632
10710
  }
10633
10711
  async function openStableDirectoryFromRoot(trustedRoot, directory, errorMessage, platform = process.platform) {
10634
- const root = path13.resolve(trustedRoot);
10635
- const target = path13.resolve(directory);
10712
+ const root = path14.resolve(trustedRoot);
10713
+ const target = path14.resolve(directory);
10636
10714
  assertContainedPath(root, target, errorMessage);
10637
10715
  requirePrivateFileDescriptorRoot(platform, errorMessage);
10638
- const relative2 = path13.relative(root, target);
10639
- const components = relative2 === "" ? [] : relative2.split(path13.sep);
10716
+ const relative2 = path14.relative(root, target);
10717
+ const components = relative2 === "" ? [] : relative2.split(path14.sep);
10640
10718
  const handles = [];
10641
10719
  let currentPath = root;
10642
10720
  try {
@@ -10644,10 +10722,10 @@ async function openStableDirectoryFromRoot(trustedRoot, directory, errorMessage,
10644
10722
  handles.push(current.handle);
10645
10723
  for (const component of components) {
10646
10724
  const pinnedParent = await resolvePrivateDirectoryPath(currentPath, current.handle, current.opened, errorMessage);
10647
- const child = await openDirectoryNoFollow(path13.join(pinnedParent, component), errorMessage);
10725
+ const child = await openDirectoryNoFollow(path14.join(pinnedParent, component), errorMessage);
10648
10726
  handles.push(child.handle);
10649
10727
  assertStableDirectory(current.before, current.opened, await lstat2(currentPath), errorMessage);
10650
- currentPath = path13.join(currentPath, component);
10728
+ currentPath = path14.join(currentPath, component);
10651
10729
  current = child;
10652
10730
  }
10653
10731
  assertStableDirectory(current.before, current.opened, await lstat2(target), errorMessage);
@@ -10668,12 +10746,12 @@ async function openStableDirectoryFromRoot(trustedRoot, directory, errorMessage,
10668
10746
  }
10669
10747
  }
10670
10748
  async function ensurePrivateDirectoryNoFollow(trustedRoot, directory, errorMessage, syncVerifiedParent = syncDirectoryHandle, hardenExistingChildren = true, platform = process.platform) {
10671
- const root = path13.resolve(trustedRoot);
10672
- const target = path13.resolve(directory);
10749
+ const root = path14.resolve(trustedRoot);
10750
+ const target = path14.resolve(directory);
10673
10751
  assertContainedPath(root, target, errorMessage);
10674
- const relative2 = path13.relative(root, target);
10752
+ const relative2 = path14.relative(root, target);
10675
10753
  requirePrivateFileDescriptorRoot(platform, errorMessage);
10676
- const components = relative2 === "" ? [] : relative2.split(path13.sep);
10754
+ const components = relative2 === "" ? [] : relative2.split(path14.sep);
10677
10755
  const handles = [];
10678
10756
  let currentPath = root;
10679
10757
  try {
@@ -10681,7 +10759,7 @@ async function ensurePrivateDirectoryNoFollow(trustedRoot, directory, errorMessa
10681
10759
  handles.push(current.handle);
10682
10760
  for (const component of components) {
10683
10761
  const pinnedParent = await resolvePrivateDirectoryPath(currentPath, current.handle, current.opened, errorMessage);
10684
- const childPath = path13.join(pinnedParent, component);
10762
+ const childPath = path14.join(pinnedParent, component);
10685
10763
  let created = false;
10686
10764
  try {
10687
10765
  await mkdir3(childPath, { mode: 448 });
@@ -10696,7 +10774,7 @@ async function ensurePrivateDirectoryNoFollow(trustedRoot, directory, errorMessa
10696
10774
  await child.handle.chmod(448);
10697
10775
  }
10698
10776
  assertStableDirectory(current.before, current.opened, await lstat2(currentPath), errorMessage);
10699
- currentPath = path13.join(currentPath, component);
10777
+ currentPath = path14.join(currentPath, component);
10700
10778
  current = child;
10701
10779
  }
10702
10780
  assertStableDirectory(current.before, current.opened, await lstat2(target), errorMessage);
@@ -10705,8 +10783,8 @@ async function ensurePrivateDirectoryNoFollow(trustedRoot, directory, errorMessa
10705
10783
  }
10706
10784
  }
10707
10785
  async function ensurePrivateDirectoryTreeNoFollow(directory, errorMessage, syncVerifiedParent = syncDirectoryHandle, platform = process.platform) {
10708
- const target = path13.resolve(directory);
10709
- const filesystemRoot = path13.parse(target).root;
10786
+ const target = path14.resolve(directory);
10787
+ const filesystemRoot = path14.parse(target).root;
10710
10788
  const rootMetadata = await stat2(filesystemRoot);
10711
10789
  await ensurePrivateDirectoryNoFollow(
10712
10790
  filesystemRoot,
@@ -10741,15 +10819,15 @@ async function withPrivateDirectoryNoFollow(trustedRoot, directory, errorMessage
10741
10819
  }
10742
10820
  }
10743
10821
  async function readPrivateFileNoFollow(directory, filePath, errorMessage, trustedRoot = directory, platform = process.platform) {
10744
- if (path13.dirname(filePath) !== path13.resolve(directory)) throw new Error(errorMessage);
10745
- const targetName = path13.basename(filePath);
10822
+ if (path14.dirname(filePath) !== path14.resolve(directory)) throw new Error(errorMessage);
10823
+ const targetName = path14.basename(filePath);
10746
10824
  let directoryHandles = [];
10747
10825
  let fileHandle;
10748
10826
  try {
10749
10827
  const stableDirectory = await openStableDirectoryFromRoot(trustedRoot, directory, errorMessage, platform);
10750
10828
  directoryHandles = stableDirectory.handles;
10751
10829
  const pinnedDirectory = stableDirectory.pinnedDirectory;
10752
- const targetPath = path13.join(pinnedDirectory, targetName);
10830
+ const targetPath = path14.join(pinnedDirectory, targetName);
10753
10831
  const before = await lstat2(targetPath);
10754
10832
  if (before.isSymbolicLink() || !before.isFile()) throw new Error(errorMessage);
10755
10833
  try {
@@ -10768,10 +10846,10 @@ async function readPrivateFileNoFollow(directory, filePath, errorMessage, truste
10768
10846
  }
10769
10847
  }
10770
10848
  async function appendPrivateFileAtPinnedDirectory(pinnedDirectory, targetName, content, errorMessage, directoryHandle, openFile) {
10771
- if (targetName.length === 0 || targetName === "." || targetName === ".." || path13.basename(targetName) !== targetName) {
10849
+ if (targetName.length === 0 || targetName === "." || targetName === ".." || path14.basename(targetName) !== targetName) {
10772
10850
  throw new Error(errorMessage);
10773
10851
  }
10774
- const targetPath = path13.join(pinnedDirectory, targetName);
10852
+ const targetPath = path14.join(pinnedDirectory, targetName);
10775
10853
  let fileHandle;
10776
10854
  try {
10777
10855
  try {
@@ -10807,8 +10885,8 @@ async function appendPrivateFileAtPinnedDirectory(pinnedDirectory, targetName, c
10807
10885
  }
10808
10886
  async function appendPrivateFileInPinnedDirectory(pinnedDirectory, fileName, content, errorMessage, platform = process.platform) {
10809
10887
  const descriptorRoot = requirePrivateFileDescriptorRoot(platform, errorMessage);
10810
- const resolvedDirectory = path13.resolve(pinnedDirectory);
10811
- const descriptor = path13.relative(descriptorRoot, resolvedDirectory);
10888
+ const resolvedDirectory = path14.resolve(pinnedDirectory);
10889
+ const descriptor = path14.relative(descriptorRoot, resolvedDirectory);
10812
10890
  if (!/^\d+$/.test(descriptor)) throw new Error(errorMessage);
10813
10891
  const before = await stat2(resolvedDirectory);
10814
10892
  if (!before.isDirectory()) throw new Error(errorMessage);
@@ -10824,8 +10902,8 @@ async function appendPrivateFileInPinnedDirectory(pinnedDirectory, fileName, con
10824
10902
  }
10825
10903
  }
10826
10904
  async function writePrivateFileAtomicallyNoFollow(directory, filePath, content, errorMessage, trustedRoot = directory, platform = process.platform, syncVerifiedDirectory = syncDirectoryHandle) {
10827
- if (path13.dirname(filePath) !== path13.resolve(directory)) throw new Error(errorMessage);
10828
- const targetName = path13.basename(filePath);
10905
+ if (path14.dirname(filePath) !== path14.resolve(directory)) throw new Error(errorMessage);
10906
+ const targetName = path14.basename(filePath);
10829
10907
  const tempName = `.${targetName}.${randomUUID2()}.tmp`;
10830
10908
  let tempPath;
10831
10909
  let directoryHandles = [];
@@ -10834,8 +10912,8 @@ async function writePrivateFileAtomicallyNoFollow(directory, filePath, content,
10834
10912
  const stableDirectory = await openStableDirectoryFromRoot(trustedRoot, directory, errorMessage, platform);
10835
10913
  directoryHandles = stableDirectory.handles;
10836
10914
  const pinnedDirectory = stableDirectory.pinnedDirectory;
10837
- tempPath = path13.join(pinnedDirectory, tempName);
10838
- const targetPath = path13.join(pinnedDirectory, targetName);
10915
+ tempPath = path14.join(pinnedDirectory, tempName);
10916
+ const targetPath = path14.join(pinnedDirectory, targetName);
10839
10917
  try {
10840
10918
  fileHandle = await open(
10841
10919
  tempPath,
@@ -10872,7 +10950,7 @@ async function writePrivateFileAtomicallyNoFollow(directory, filePath, content,
10872
10950
  }
10873
10951
  async function removePrivateFilesNoFollow(directory, fileNames, errorMessage, trustedRoot = directory, platform = process.platform) {
10874
10952
  if (fileNames.some(
10875
- (fileName) => fileName.length === 0 || fileName === "." || fileName === ".." || path13.basename(fileName) !== fileName
10953
+ (fileName) => fileName.length === 0 || fileName === "." || fileName === ".." || path14.basename(fileName) !== fileName
10876
10954
  )) {
10877
10955
  throw new Error(errorMessage);
10878
10956
  }
@@ -10882,7 +10960,7 @@ async function removePrivateFilesNoFollow(directory, fileNames, errorMessage, tr
10882
10960
  directoryHandles = stableDirectory.handles;
10883
10961
  const pinnedDirectory = stableDirectory.pinnedDirectory;
10884
10962
  for (const fileName of fileNames) {
10885
- await rm2(path13.join(pinnedDirectory, fileName), { force: true });
10963
+ await rm2(path14.join(pinnedDirectory, fileName), { force: true });
10886
10964
  }
10887
10965
  assertStableDirectory(stableDirectory.before, stableDirectory.opened, await lstat2(directory), errorMessage);
10888
10966
  if (stableDirectory.handle) await syncDirectoryHandle(stableDirectory.handle);
@@ -10903,13 +10981,13 @@ var GeneratedBatchMarkerSchema = z2.object({
10903
10981
  }).strict();
10904
10982
  var BATCH_ERROR = "The generated draft batch state is not safe.";
10905
10983
  function batchDirectory(storage) {
10906
- return path14.join(storage.dir, "state", "support-passport", "generated-batches");
10984
+ return path15.join(storage.dir, "state", "support-passport", "generated-batches");
10907
10985
  }
10908
10986
  function batchFileName(batchId) {
10909
10987
  return `${BatchIdSchema.parse(batchId)}.json`;
10910
10988
  }
10911
10989
  function batchPath(storage, batchId) {
10912
- return path14.join(batchDirectory(storage), batchFileName(batchId));
10990
+ return path15.join(batchDirectory(storage), batchFileName(batchId));
10913
10991
  }
10914
10992
  function markerFor(context, batchId, size, complete) {
10915
10993
  return GeneratedBatchMarkerSchema.parse({
@@ -11334,7 +11412,7 @@ var SupportPassportAnswerModelInputSchema = z4.object({
11334
11412
 
11335
11413
  // src/support-passport/owner-lock.ts
11336
11414
  import { createHash as createHash8 } from "crypto";
11337
- import path15 from "path";
11415
+ import path16 from "path";
11338
11416
  var CARD_MUTATION_LOCK_STALE_MS = 6e4;
11339
11417
  var CARD_MUTATION_LOCK_MAX_WAIT_MS = 3e4;
11340
11418
  function computeSupportPassportOwnerLockKey(namespace, principal) {
@@ -11345,7 +11423,7 @@ function supportPassportOwnerLockPath(storage, scope) {
11345
11423
  if (!/^[a-f0-9]{64}$/.test(ownerLockKey)) {
11346
11424
  throw new SupportPassportError("card_data_invalid", "The support passport owner scope is invalid.", 500);
11347
11425
  }
11348
- return path15.join(storage.dir, "state", `support-passport-cards-${ownerLockKey}.lock`);
11426
+ return path16.join(storage.dir, "state", `support-passport-cards-${ownerLockKey}.lock`);
11349
11427
  }
11350
11428
  async function withSupportPassportOwnerLock(storage, scope, task) {
11351
11429
  const lockPath = supportPassportOwnerLockPath(storage, scope);
@@ -12243,7 +12321,7 @@ var SupportPassportCardService = class {
12243
12321
  // src/support-passport/grant-store.ts
12244
12322
  import { createHash as createHash9, randomBytes, randomUUID as randomUUID4, timingSafeEqual } from "crypto";
12245
12323
  import { lstat as lstat3, open as open2, readdir as readdir3 } from "fs/promises";
12246
- import path16 from "path";
12324
+ import path17 from "path";
12247
12325
  var GRANT_LOCK_STALE_MS = 3e4;
12248
12326
  var GRANT_LOCK_WAIT_MS = 5e3;
12249
12327
  var GRANT_LOCK_HEARTBEAT_MS = 1e4;
@@ -12335,9 +12413,9 @@ var SupportPassportGrantStore = class {
12335
12413
  runWithHeldFileLock;
12336
12414
  syncDirectory;
12337
12415
  constructor(options) {
12338
- this.memoryDir = path16.resolve(expandTildePath(options.memoryDir));
12339
- this.grantsDir = path16.join(this.memoryDir, "state", "support-passport", "grants");
12340
- this.ownerIndexesDir = path16.join(this.grantsDir, "owners");
12416
+ this.memoryDir = path17.resolve(expandTildePath(options.memoryDir));
12417
+ this.grantsDir = path17.join(this.memoryDir, "state", "support-passport", "grants");
12418
+ this.ownerIndexesDir = path17.join(this.grantsDir, "owners");
12341
12419
  this.now = options.now ?? (() => /* @__PURE__ */ new Date());
12342
12420
  this.makeSecret = options.makeSecret ?? (() => randomBytes(32));
12343
12421
  this.makeGrantId = options.makeGrantId ?? randomUUID4;
@@ -12550,11 +12628,11 @@ var SupportPassportGrantStore = class {
12550
12628
  }
12551
12629
  filePath(grantId) {
12552
12630
  const normalizedGrantId = normalizeGrantId(grantId);
12553
- return path16.join(this.grantsDir, `${normalizedGrantId}.json`);
12631
+ return path17.join(this.grantsDir, `${normalizedGrantId}.json`);
12554
12632
  }
12555
12633
  ownerIndexPath(ownerHash) {
12556
12634
  if (!SAFE_OWNER_INDEX_HASH.test(ownerHash)) throw new Error("support passport owner index hash is invalid");
12557
- return path16.join(this.ownerIndexesDir, `${ownerHash}.json`);
12635
+ return path17.join(this.ownerIndexesDir, `${ownerHash}.json`);
12558
12636
  }
12559
12637
  ownerHash(namespace, principalHash) {
12560
12638
  return sha256("support-passport-owner-index:v1", `${namespace}\0${principalHash}`);
@@ -12610,12 +12688,12 @@ var SupportPassportGrantStore = class {
12610
12688
  this.grantsDir,
12611
12689
  grantIds.map((grantId) => `${grantId}.json`),
12612
12690
  "support passport grant files must be regular files in a stable directory",
12613
- path16.parse(this.memoryDir).root
12691
+ path17.parse(this.memoryDir).root
12614
12692
  );
12615
12693
  }
12616
12694
  ownerMembershipDirectory(ownerHash) {
12617
12695
  if (!SAFE_OWNER_INDEX_HASH.test(ownerHash)) throw new Error("support passport owner index hash is invalid");
12618
- return path16.join(this.ownerIndexesDir, ownerHash);
12696
+ return path17.join(this.ownerIndexesDir, ownerHash);
12619
12697
  }
12620
12698
  async ensureOwnerMembershipDirectory(ownerHash) {
12621
12699
  const directory = this.ownerMembershipDirectory(ownerHash);
@@ -12630,11 +12708,11 @@ var SupportPassportGrantStore = class {
12630
12708
  const directory = await this.ensureOwnerMembershipDirectory(ownerHash);
12631
12709
  await writePrivateFileAtomicallyNoFollow(
12632
12710
  directory,
12633
- path16.join(directory, `${state.grantId}.json`),
12711
+ path17.join(directory, `${state.grantId}.json`),
12634
12712
  `${JSON.stringify({ schemaVersion: 1, grantId: state.grantId })}
12635
12713
  `,
12636
12714
  "support passport owner membership must be regular files in a stable directory",
12637
- path16.parse(this.memoryDir).root
12715
+ path17.parse(this.memoryDir).root
12638
12716
  );
12639
12717
  }
12640
12718
  async removeOwnerMembership(state) {
@@ -12644,7 +12722,7 @@ var SupportPassportGrantStore = class {
12644
12722
  directory,
12645
12723
  [`${state.grantId}.json`],
12646
12724
  "support passport owner membership must be regular files in a stable directory",
12647
- path16.parse(this.memoryDir).root
12725
+ path17.parse(this.memoryDir).root
12648
12726
  );
12649
12727
  }
12650
12728
  async removeStoredGrant(state) {
@@ -12745,7 +12823,7 @@ var SupportPassportGrantStore = class {
12745
12823
  const ownerHash = this.ownerHash(namespace, principalHash);
12746
12824
  const directory = await this.ensureOwnerMembershipDirectory(ownerHash);
12747
12825
  const grantIds = await withPrivateDirectoryNoFollow(
12748
- path16.parse(this.memoryDir).root,
12826
+ path17.parse(this.memoryDir).root,
12749
12827
  directory,
12750
12828
  "support passport owner membership must be regular files in a stable directory",
12751
12829
  async (pinnedDirectory) => {
@@ -12776,7 +12854,7 @@ var SupportPassportGrantStore = class {
12776
12854
  this.ownerIndexesDir,
12777
12855
  filePath,
12778
12856
  "support passport owner indexes must be regular files in a stable directory",
12779
- path16.parse(this.memoryDir).root
12857
+ path17.parse(this.memoryDir).root
12780
12858
  );
12781
12859
  } catch (error) {
12782
12860
  if (error.code === "ENOENT") return [];
@@ -12816,7 +12894,7 @@ var SupportPassportGrantStore = class {
12816
12894
  `${JSON.stringify({ schemaVersion: 1, ownerHash, grantIds }, null, 2)}
12817
12895
  `,
12818
12896
  "support passport owner indexes must be regular files in a stable directory",
12819
- path16.parse(this.memoryDir).root
12897
+ path17.parse(this.memoryDir).root
12820
12898
  );
12821
12899
  }
12822
12900
  async readState(grantId) {
@@ -12826,7 +12904,7 @@ var SupportPassportGrantStore = class {
12826
12904
  this.grantsDir,
12827
12905
  filePath,
12828
12906
  "support passport grant files must be regular files in a stable directory",
12829
- path16.parse(this.memoryDir).root
12907
+ path17.parse(this.memoryDir).root
12830
12908
  );
12831
12909
  try {
12832
12910
  const state = SupportPassportGrantStateSchema.parse(JSON.parse(content));
@@ -12860,7 +12938,7 @@ var SupportPassportGrantStore = class {
12860
12938
  `${JSON.stringify(state, null, 2)}
12861
12939
  `,
12862
12940
  "support passport grant files must be regular files in a stable directory",
12863
- path16.parse(this.memoryDir).root
12941
+ path17.parse(this.memoryDir).root
12864
12942
  );
12865
12943
  }
12866
12944
  async ensureSafeDirectories() {
@@ -12894,8 +12972,8 @@ var SupportPassportGrantStore = class {
12894
12972
  void 0
12895
12973
  );
12896
12974
  this.memoryDir = configuredMemoryDir;
12897
- this.grantsDir = path16.join(configuredMemoryDir, "state", "support-passport", "grants");
12898
- this.ownerIndexesDir = path16.join(this.grantsDir, "owners");
12975
+ this.grantsDir = path17.join(configuredMemoryDir, "state", "support-passport", "grants");
12976
+ this.ownerIndexesDir = path17.join(this.grantsDir, "owners");
12899
12977
  })();
12900
12978
  }
12901
12979
  const currentAttempt = this.memoryRootReady;
@@ -12909,12 +12987,12 @@ var SupportPassportGrantStore = class {
12909
12987
  async withMutationLock(task) {
12910
12988
  await this.ensureSafeDirectories();
12911
12989
  return await withPrivateDirectoryNoFollow(
12912
- path16.parse(this.memoryDir).root,
12990
+ path17.parse(this.memoryDir).root,
12913
12991
  this.grantsDir,
12914
12992
  "support passport grant lock directory must remain inside the memory directory",
12915
12993
  async (pinnedDirectory) => await this.withExclusiveLock(
12916
12994
  `support-passport-grants:${this.grantsDir}`,
12917
- path16.join(pinnedDirectory, ".grants.lock"),
12995
+ path17.join(pinnedDirectory, ".grants.lock"),
12918
12996
  task
12919
12997
  )
12920
12998
  );
@@ -12923,12 +13001,12 @@ var SupportPassportGrantStore = class {
12923
13001
  const normalizedGrantId = normalizeGrantId(grantId);
12924
13002
  await this.ensureSafeDirectories();
12925
13003
  return await withPrivateDirectoryNoFollow(
12926
- path16.parse(this.memoryDir).root,
13004
+ path17.parse(this.memoryDir).root,
12927
13005
  this.grantsDir,
12928
13006
  "support passport grant lock directory must remain inside the memory directory",
12929
13007
  async (pinnedDirectory) => await this.withExclusiveLock(
12930
13008
  `support-passport-grant:${this.grantsDir}:${normalizedGrantId}`,
12931
- path16.join(pinnedDirectory, `.${normalizedGrantId}.lock`),
13009
+ path17.join(pinnedDirectory, `.${normalizedGrantId}.lock`),
12932
13010
  task
12933
13011
  )
12934
13012
  );
@@ -12936,12 +13014,12 @@ var SupportPassportGrantStore = class {
12936
13014
  async withOwnerIndexLock(ownerHash, task) {
12937
13015
  await this.ensureSafeDirectories();
12938
13016
  return await withPrivateDirectoryNoFollow(
12939
- path16.parse(this.memoryDir).root,
13017
+ path17.parse(this.memoryDir).root,
12940
13018
  this.ownerIndexesDir,
12941
13019
  "support passport owner lock directory must remain inside the memory directory",
12942
13020
  async (pinnedDirectory) => await this.withExclusiveLock(
12943
13021
  `support-passport-owner:${this.ownerIndexesDir}:${ownerHash}`,
12944
- path16.join(pinnedDirectory, `.${ownerHash}.lock`),
13022
+ path17.join(pinnedDirectory, `.${ownerHash}.lock`),
12945
13023
  task
12946
13024
  )
12947
13025
  );
@@ -13779,7 +13857,7 @@ var SupportPassportModelAdapter = class {
13779
13857
 
13780
13858
  // src/support-passport/model-audit.ts
13781
13859
  import { createHash as createHash10 } from "crypto";
13782
- import path17 from "path";
13860
+ import path18 from "path";
13783
13861
  import { z as z5 } from "zod";
13784
13862
  var HashSchema = z5.string().regex(/^[a-f0-9]{64}$/);
13785
13863
  var SupportPassportModelAuditRecordSchema = z5.object({
@@ -13824,15 +13902,15 @@ var SupportPassportModelAuditStore = class {
13824
13902
  memoryRootReady;
13825
13903
  runWithHeldFileLock;
13826
13904
  constructor(options) {
13827
- this.memoryDir = path17.resolve(expandTildePath(options.memoryDir));
13828
- this.auditDir = path17.join(this.memoryDir, "state", "support-passport", "audit");
13905
+ this.memoryDir = path18.resolve(expandTildePath(options.memoryDir));
13906
+ this.auditDir = path18.join(this.memoryDir, "state", "support-passport", "audit");
13829
13907
  this.runWithHeldFileLock = options.withHeldFileLock ?? withHeldFileLock;
13830
13908
  }
13831
13909
  async record(input) {
13832
13910
  const record = SupportPassportModelAuditRecordSchema.parse(input);
13833
13911
  await this.ensureSafeDirectories();
13834
13912
  const day = record.occurredAt.slice(0, 10);
13835
- const filePath = path17.join(this.auditDir, `${day}.jsonl`);
13913
+ const filePath = path18.join(this.auditDir, `${day}.jsonl`);
13836
13914
  await serializeMutations(
13837
13915
  `support-passport-audit:${filePath}`,
13838
13916
  () => withPrivateDirectoryNoFollow(
@@ -13840,7 +13918,7 @@ var SupportPassportModelAuditStore = class {
13840
13918
  this.auditDir,
13841
13919
  "support passport audit directory must remain inside the memory directory",
13842
13920
  async (pinnedDirectory) => await this.runWithHeldFileLock(
13843
- path17.join(pinnedDirectory, `.${day}.lock`),
13921
+ path18.join(pinnedDirectory, `.${day}.lock`),
13844
13922
  {
13845
13923
  staleMs: 3e4,
13846
13924
  maxWaitMs: 5e3,
@@ -13877,7 +13955,7 @@ var SupportPassportModelAuditStore = class {
13877
13955
  "support passport memory directory must be a stable directory"
13878
13956
  );
13879
13957
  this.memoryDir = configuredMemoryDir;
13880
- this.auditDir = path17.join(configuredMemoryDir, "state", "support-passport", "audit");
13958
+ this.auditDir = path18.join(configuredMemoryDir, "state", "support-passport", "audit");
13881
13959
  })();
13882
13960
  }
13883
13961
  const currentAttempt = this.memoryRootReady;
@@ -17425,7 +17503,7 @@ var EngramAccessService = class extends SupportPassportAccessServiceBase {
17425
17503
  const resolvedNamespace = this.resolveReadableNamespace(options.namespace, options.principal);
17426
17504
  const storage = await offlineSyncStorageForSnapshot(this.orchestrator, resolvedNamespace);
17427
17505
  const storageHash = createHash12("sha256").update(storage.dir).digest("hex").slice(0, 16);
17428
- const deletions = [...await storage.readDeletionRevisions()].map(([path18, mtimeMs]) => ({ path: path18, mtimeMs }));
17506
+ const deletions = [...await storage.readDeletionRevisions()].map(([path19, mtimeMs]) => ({ path: path19, mtimeMs }));
17429
17507
  const snapshotBuilder = options.includeContent === false && options.baseFiles && options.baseFiles.length > 0 ? buildOfflineSyncSnapshotFromBase : buildOfflineSyncSnapshot;
17430
17508
  const snapshot = await snapshotBuilder({
17431
17509
  root: storage.dir,
@@ -17451,7 +17529,7 @@ var EngramAccessService = class extends SupportPassportAccessServiceBase {
17451
17529
  const storageHash = createHash12("sha256").update(storage.dir).digest("hex").slice(0, 16);
17452
17530
  const deletions = await filterOfflineSyncDeletionRevisions({
17453
17531
  root: storage.dir,
17454
- deletions: [...await storage.readDeletionRevisions()].map(([path18, mtimeMs]) => ({ path: path18, mtimeMs })),
17532
+ deletions: [...await storage.readDeletionRevisions()].map(([path19, mtimeMs]) => ({ path: path19, mtimeMs })),
17455
17533
  includeTranscripts: options.includeTranscripts !== false,
17456
17534
  userExcludeRegexps: this.offlineSyncUserExcludes
17457
17535
  });
@@ -18073,6 +18151,11 @@ export {
18073
18151
  CorrectionContractError,
18074
18152
  detectPassiveCorrections,
18075
18153
  capturePassiveCorrections,
18154
+ JOURNAL_DIR_NAME,
18155
+ journalPath,
18156
+ isJournalDayPath,
18157
+ todayJournalDate,
18158
+ seedJournal,
18076
18159
  isTopLevelArchivePath,
18077
18160
  isGenericRecallExcludedPath,
18078
18161
  filterRecallCandidates,
@@ -18164,4 +18247,4 @@ export {
18164
18247
  EngramAccessService,
18165
18248
  AccessAdminOpsSurface
18166
18249
  };
18167
- //# sourceMappingURL=chunk-IHGMRDEE.js.map
18250
+ //# sourceMappingURL=chunk-MUEGIKKY.js.map