@remnic/core 9.3.637 → 9.3.639

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 (279) hide show
  1. package/dist/access-cli.js +29 -29
  2. package/dist/access-http.d.ts +56 -5
  3. package/dist/access-http.js +15 -13
  4. package/dist/access-mcp.d.ts +4 -4
  5. package/dist/access-mcp.js +14 -12
  6. package/dist/access-schema.d.ts +3 -0
  7. package/dist/access-schema.js +1 -1
  8. package/dist/{access-service-GVOE5U3C.d.ts → access-service-jyYute38.d.ts} +4 -2
  9. package/dist/access-service.d.ts +4 -4
  10. package/dist/access-service.js +12 -10
  11. package/dist/action-confidence.d.ts +1 -1
  12. package/dist/active-memory-bridge.d.ts +1 -1
  13. package/dist/active-recall.d.ts +1 -1
  14. package/dist/active-recall.js +1 -1
  15. package/dist/{auto-sync-RFADEHIQ.js → auto-sync-54QQHOG5.js} +4 -4
  16. package/dist/behavior-learner.d.ts +1 -1
  17. package/dist/behavior-signals.d.ts +1 -1
  18. package/dist/bootstrap.d.ts +3 -3
  19. package/dist/briefing.d.ts +1 -1
  20. package/dist/briefing.js +3 -3
  21. package/dist/buffer-surprise-report.d.ts +1 -1
  22. package/dist/buffer.d.ts +1 -1
  23. package/dist/calibration.d.ts +1 -1
  24. package/dist/calibration.js +1 -1
  25. package/dist/causal-behavior.d.ts +1 -1
  26. package/dist/causal-behavior.js +2 -2
  27. package/dist/causal-chain.js +2 -2
  28. package/dist/causal-consolidation.d.ts +1 -1
  29. package/dist/causal-consolidation.js +7 -7
  30. package/dist/causal-retrieval.js +2 -2
  31. package/dist/causal-trajectory-graph.js +1 -1
  32. package/dist/causal-trajectory.js +1 -1
  33. package/dist/{chunk-TFICNXXU.js → chunk-2BHNQRE5.js} +1153 -294
  34. package/dist/chunk-2BHNQRE5.js.map +1 -0
  35. package/dist/{chunk-3RDYU3JS.js → chunk-3AZDLWDW.js} +3 -3
  36. package/dist/{chunk-FPNQF475.js → chunk-3F7RMHC4.js} +1 -1
  37. package/dist/chunk-3F7RMHC4.js.map +1 -0
  38. package/dist/{chunk-3EJ5OOZ3.js → chunk-3SF7QNKF.js} +3 -3
  39. package/dist/{chunk-NFNQ7TWF.js → chunk-4VTVCWVB.js} +20 -12
  40. package/dist/chunk-4VTVCWVB.js.map +1 -0
  41. package/dist/{chunk-XM6M6DHG.js → chunk-52XI77OQ.js} +204 -13
  42. package/dist/chunk-52XI77OQ.js.map +1 -0
  43. package/dist/{chunk-6BDVBBBY.js → chunk-666A3MOW.js} +88 -30
  44. package/dist/chunk-666A3MOW.js.map +1 -0
  45. package/dist/{chunk-242XFZ36.js → chunk-7OH7KPF5.js} +2 -2
  46. package/dist/{chunk-HZVIYZYN.js → chunk-7R37SOT4.js} +6 -6
  47. package/dist/{chunk-7A2QKUUA.js → chunk-7XRSLMUD.js} +2 -2
  48. package/dist/{chunk-723OMPUI.js → chunk-A3BS64GV.js} +7 -1
  49. package/dist/chunk-A3BS64GV.js.map +1 -0
  50. package/dist/{chunk-JCLECECB.js → chunk-A3UPMOJZ.js} +2 -2
  51. package/dist/{chunk-YCX45GOQ.js → chunk-AFH2JXSF.js} +2 -2
  52. package/dist/{chunk-BK35NOJL.js → chunk-BB6FNMMB.js} +52 -6
  53. package/dist/chunk-BB6FNMMB.js.map +1 -0
  54. package/dist/{chunk-3XNMN242.js → chunk-BTY5XQG3.js} +7 -7
  55. package/dist/{chunk-QHXW3LZV.js → chunk-C3EJ3UIS.js} +3 -3
  56. package/dist/{chunk-A3HKTPPV.js → chunk-C63WC454.js} +12 -1
  57. package/dist/chunk-C63WC454.js.map +1 -0
  58. package/dist/{chunk-4S3N6HFG.js → chunk-C6XO6ONP.js} +2 -2
  59. package/dist/{chunk-WD2W4234.js → chunk-CDHRUNBX.js} +11 -2
  60. package/dist/chunk-CDHRUNBX.js.map +1 -0
  61. package/dist/{chunk-YQNADJCT.js → chunk-CMZLMIZI.js} +2 -2
  62. package/dist/{chunk-KVDUDYEN.js → chunk-DDRNDPX4.js} +2 -2
  63. package/dist/{chunk-PW6GURU3.js → chunk-EKIQBGAY.js} +2 -2
  64. package/dist/{chunk-QJGTSCJN.js → chunk-FGRV3X3Y.js} +19 -19
  65. package/dist/{chunk-2IT7WFYE.js → chunk-FWIROLS6.js} +2 -1
  66. package/dist/chunk-FWIROLS6.js.map +1 -0
  67. package/dist/{chunk-X7EJF46S.js → chunk-H4RWKZE2.js} +2 -2
  68. package/dist/{chunk-A6D7A2FW.js → chunk-IHG27THY.js} +4 -4
  69. package/dist/{chunk-PUEAEQSN.js → chunk-ISMZIMD3.js} +2 -2
  70. package/dist/{chunk-LEG7XWS2.js → chunk-IXSTQGYV.js} +2 -2
  71. package/dist/{chunk-CMN5AWAZ.js → chunk-J2KFC47S.js} +2 -2
  72. package/dist/{chunk-K47C6M2C.js → chunk-M75TBFKQ.js} +2 -2
  73. package/dist/{chunk-7V2SGZ3H.js → chunk-NE566K4E.js} +2 -2
  74. package/dist/{chunk-YROCXMCK.js → chunk-RJGPH2Q3.js} +2 -2
  75. package/dist/{chunk-UXFOGILU.js → chunk-SBHQBC37.js} +2 -2
  76. package/dist/{chunk-QYGIQ5NM.js → chunk-SHHT4JTC.js} +2 -2
  77. package/dist/{chunk-TQOU3VAT.js → chunk-SSOMTUCA.js} +1 -1
  78. package/dist/{chunk-NRST7W5Q.js → chunk-UI2UP7XX.js} +2 -2
  79. package/dist/{chunk-C4KKM62E.js → chunk-UU5LHD6J.js} +2 -2
  80. package/dist/{chunk-EWC6W6AB.js → chunk-UXA5L2DZ.js} +2 -2
  81. package/dist/{chunk-XL7FK7PJ.js → chunk-Y56J7CXW.js} +33 -16
  82. package/dist/{chunk-XL7FK7PJ.js.map → chunk-Y56J7CXW.js.map} +1 -1
  83. package/dist/{cli-B-fHk59D.d.ts → cli-A4AIhv9e.d.ts} +3 -3
  84. package/dist/cli.d.ts +5 -5
  85. package/dist/cli.js +28 -27
  86. package/dist/compounding/engine.d.ts +1 -1
  87. package/dist/compounding/engine.js +3 -3
  88. package/dist/compounding/preference-consolidator.d.ts +1 -1
  89. package/dist/compression-optimizer.d.ts +1 -1
  90. package/dist/config.d.ts +1 -1
  91. package/dist/config.js +1 -1
  92. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  93. package/dist/connectors/codex-materialize-runner.js +3 -3
  94. package/dist/connectors/codex-materialize.d.ts +1 -1
  95. package/dist/connectors/index.d.ts +1 -1
  96. package/dist/connectors/index.js +3 -3
  97. package/dist/consolidation-provenance-check.d.ts +1 -1
  98. package/dist/consolidation-undo.d.ts +1 -1
  99. package/dist/contradiction/index.d.ts +1 -1
  100. package/dist/conversation-index/backend.d.ts +1 -1
  101. package/dist/conversation-index/chunker.d.ts +1 -1
  102. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  103. package/dist/conversation-index/indexer.d.ts +1 -1
  104. package/dist/conversation-index/search.d.ts +1 -1
  105. package/dist/day-summary.d.ts +1 -1
  106. package/dist/delinearize.d.ts +1 -1
  107. package/dist/direct-answer-wiring.d.ts +1 -1
  108. package/dist/direct-answer.d.ts +1 -1
  109. package/dist/embedding-fallback.d.ts +1 -1
  110. package/dist/enrichment/index.d.ts +1 -1
  111. package/dist/entity-retrieval.d.ts +1 -1
  112. package/dist/entity-retrieval.js +3 -3
  113. package/dist/entity-schema.d.ts +1 -1
  114. package/dist/explicit-capture.d.ts +3 -3
  115. package/dist/extraction-judge-telemetry.d.ts +1 -1
  116. package/dist/extraction-judge-training.d.ts +1 -1
  117. package/dist/extraction-judge.d.ts +1 -1
  118. package/dist/extraction-judge.js +2 -2
  119. package/dist/extraction.d.ts +1 -1
  120. package/dist/extraction.js +2 -2
  121. package/dist/fallback-llm.d.ts +1 -1
  122. package/dist/fallback-llm.js +1 -1
  123. package/dist/{graph-edge-decay-5ZOK7ZNO.js → graph-edge-decay-PUFNHOBS.js} +2 -2
  124. package/dist/graph-snapshot.js +2 -2
  125. package/dist/graph.d.ts +3 -0
  126. package/dist/graph.js +1 -1
  127. package/dist/identity-continuity.d.ts +1 -1
  128. package/dist/importance.d.ts +1 -1
  129. package/dist/index.d.ts +9 -9
  130. package/dist/index.js +40 -40
  131. package/dist/intent.d.ts +1 -1
  132. package/dist/lcm/engine.d.ts +1 -1
  133. package/dist/lcm/index.d.ts +1 -1
  134. package/dist/lcm/tools.d.ts +1 -1
  135. package/dist/lifecycle.d.ts +1 -1
  136. package/dist/live-connectors-runner.d.ts +1 -1
  137. package/dist/local-llm.d.ts +1 -1
  138. package/dist/maintenance/memory-governance-cron.d.ts +8 -0
  139. package/dist/maintenance/memory-governance-cron.js +1 -1
  140. package/dist/maintenance/memory-governance.d.ts +1 -1
  141. package/dist/maintenance/memory-governance.js +3 -3
  142. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
  143. package/dist/maintenance/rebuild-memory-projection.js +4 -4
  144. package/dist/mcp-memory-inspector-app.d.ts +4 -4
  145. package/dist/memory-action-policy.d.ts +1 -1
  146. package/dist/memory-cache.d.ts +1 -1
  147. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  148. package/dist/memory-projection-store.d.ts +1 -1
  149. package/dist/memory-provenance.d.ts +1 -1
  150. package/dist/memory-worth-outcomes.d.ts +1 -1
  151. package/dist/models-json.d.ts +1 -1
  152. package/dist/namespaces/migrate.d.ts +1 -1
  153. package/dist/namespaces/migrate.js +4 -4
  154. package/dist/namespaces/principal.d.ts +1 -1
  155. package/dist/namespaces/search.d.ts +1 -1
  156. package/dist/namespaces/storage.d.ts +1 -1
  157. package/dist/namespaces/storage.js +3 -3
  158. package/dist/native-knowledge.d.ts +1 -1
  159. package/dist/operator-toolkit.d.ts +1 -1
  160. package/dist/operator-toolkit.js +8 -8
  161. package/dist/{orchestrator-CoqytbK_.d.ts → orchestrator-BEDTiuEO.d.ts} +20 -5
  162. package/dist/orchestrator.d.ts +3 -3
  163. package/dist/orchestrator.js +24 -24
  164. package/dist/patterns-cli.d.ts +1 -1
  165. package/dist/policy-runtime.d.ts +1 -1
  166. package/dist/qmd-recall-cache.d.ts +1 -1
  167. package/dist/qmd.d.ts +1 -1
  168. package/dist/recall-disclosure-escalation.d.ts +1 -1
  169. package/dist/recall-explain-renderer.d.ts +1 -1
  170. package/dist/recall-explain-renderer.js +3 -3
  171. package/dist/recall-planner-llm.d.ts +1 -1
  172. package/dist/recall-planner-llm.js +1 -1
  173. package/dist/recall-state.d.ts +3 -1
  174. package/dist/recall-state.js +1 -1
  175. package/dist/recall-tag-filter.d.ts +1 -1
  176. package/dist/recall-xray-cli.d.ts +1 -1
  177. package/dist/recall-xray-cli.js +4 -4
  178. package/dist/recall-xray-renderer.d.ts +1 -1
  179. package/dist/recall-xray-renderer.js +3 -3
  180. package/dist/recall-xray.d.ts +1 -1
  181. package/dist/recall-xray.js +2 -2
  182. package/dist/resolve-auth-token.d.ts +1 -1
  183. package/dist/resume-bundles.js +4 -4
  184. package/dist/retrieval-agents.d.ts +1 -1
  185. package/dist/retrieval-tiers.d.ts +1 -1
  186. package/dist/routing/engine.d.ts +1 -1
  187. package/dist/routing/store.d.ts +1 -1
  188. package/dist/search/embed-helper.d.ts +1 -1
  189. package/dist/search/factory.d.ts +1 -1
  190. package/dist/search/index.d.ts +1 -1
  191. package/dist/search/lancedb-backend.d.ts +1 -1
  192. package/dist/search/meilisearch-backend.d.ts +1 -1
  193. package/dist/search/noop-backend.d.ts +1 -1
  194. package/dist/search/orama-backend.d.ts +1 -1
  195. package/dist/search/port.d.ts +1 -1
  196. package/dist/search/remote-backend.d.ts +1 -1
  197. package/dist/{semantic-consolidation-BPs6BURk.d.ts → semantic-consolidation-Byut1ufK.d.ts} +1 -1
  198. package/dist/semantic-consolidation.d.ts +2 -2
  199. package/dist/semantic-consolidation.js +4 -4
  200. package/dist/semantic-rule-promotion.js +3 -3
  201. package/dist/semantic-rule-verifier.d.ts +1 -1
  202. package/dist/semantic-rule-verifier.js +3 -3
  203. package/dist/session-observer-bands.d.ts +1 -1
  204. package/dist/session-observer-state.d.ts +1 -1
  205. package/dist/shared-context/manager.d.ts +1 -1
  206. package/dist/signal.d.ts +1 -1
  207. package/dist/storage.d.ts +1 -1
  208. package/dist/storage.js +2 -2
  209. package/dist/summarizer.d.ts +1 -1
  210. package/dist/summarizer.js +3 -3
  211. package/dist/summary-snapshot.d.ts +1 -1
  212. package/dist/temporal-supersession.d.ts +1 -1
  213. package/dist/temporal-validity.d.ts +1 -1
  214. package/dist/threading.d.ts +1 -1
  215. package/dist/tier-migration.d.ts +1 -1
  216. package/dist/tier-routing.d.ts +1 -1
  217. package/dist/topics.d.ts +1 -1
  218. package/dist/transcript.d.ts +1 -1
  219. package/dist/transcript.js +2 -2
  220. package/dist/{types-CpMPD8xl.d.ts → types-BzA1FKbg.d.ts} +4 -0
  221. package/dist/types.d.ts +1 -1
  222. package/dist/types.js +1 -1
  223. package/dist/utility-runtime.d.ts +1 -1
  224. package/dist/verified-recall.js +3 -3
  225. package/package.json +1 -1
  226. package/src/access-http.test.ts +110 -2
  227. package/src/access-http.ts +117 -1
  228. package/src/access-mcp.ts +15 -6
  229. package/src/access-schema.ts +14 -0
  230. package/src/access-service-namespace.test.ts +740 -0
  231. package/src/access-service.ts +226 -4
  232. package/src/config.ts +14 -0
  233. package/src/fallback-llm.ts +16 -0
  234. package/src/graph.ts +39 -17
  235. package/src/index.ts +9 -1
  236. package/src/maintenance/memory-governance-cron.ts +113 -30
  237. package/src/orchestrator.ts +1456 -336
  238. package/src/recall-state.ts +3 -0
  239. package/src/types.ts +4 -0
  240. package/dist/chunk-2IT7WFYE.js.map +0 -1
  241. package/dist/chunk-6BDVBBBY.js.map +0 -1
  242. package/dist/chunk-723OMPUI.js.map +0 -1
  243. package/dist/chunk-A3HKTPPV.js.map +0 -1
  244. package/dist/chunk-BK35NOJL.js.map +0 -1
  245. package/dist/chunk-FPNQF475.js.map +0 -1
  246. package/dist/chunk-NFNQ7TWF.js.map +0 -1
  247. package/dist/chunk-TFICNXXU.js.map +0 -1
  248. package/dist/chunk-WD2W4234.js.map +0 -1
  249. package/dist/chunk-XM6M6DHG.js.map +0 -1
  250. /package/dist/{auto-sync-RFADEHIQ.js.map → auto-sync-54QQHOG5.js.map} +0 -0
  251. /package/dist/{chunk-3RDYU3JS.js.map → chunk-3AZDLWDW.js.map} +0 -0
  252. /package/dist/{chunk-3EJ5OOZ3.js.map → chunk-3SF7QNKF.js.map} +0 -0
  253. /package/dist/{chunk-242XFZ36.js.map → chunk-7OH7KPF5.js.map} +0 -0
  254. /package/dist/{chunk-HZVIYZYN.js.map → chunk-7R37SOT4.js.map} +0 -0
  255. /package/dist/{chunk-7A2QKUUA.js.map → chunk-7XRSLMUD.js.map} +0 -0
  256. /package/dist/{chunk-JCLECECB.js.map → chunk-A3UPMOJZ.js.map} +0 -0
  257. /package/dist/{chunk-YCX45GOQ.js.map → chunk-AFH2JXSF.js.map} +0 -0
  258. /package/dist/{chunk-3XNMN242.js.map → chunk-BTY5XQG3.js.map} +0 -0
  259. /package/dist/{chunk-QHXW3LZV.js.map → chunk-C3EJ3UIS.js.map} +0 -0
  260. /package/dist/{chunk-4S3N6HFG.js.map → chunk-C6XO6ONP.js.map} +0 -0
  261. /package/dist/{chunk-YQNADJCT.js.map → chunk-CMZLMIZI.js.map} +0 -0
  262. /package/dist/{chunk-KVDUDYEN.js.map → chunk-DDRNDPX4.js.map} +0 -0
  263. /package/dist/{chunk-PW6GURU3.js.map → chunk-EKIQBGAY.js.map} +0 -0
  264. /package/dist/{chunk-QJGTSCJN.js.map → chunk-FGRV3X3Y.js.map} +0 -0
  265. /package/dist/{chunk-X7EJF46S.js.map → chunk-H4RWKZE2.js.map} +0 -0
  266. /package/dist/{chunk-A6D7A2FW.js.map → chunk-IHG27THY.js.map} +0 -0
  267. /package/dist/{chunk-PUEAEQSN.js.map → chunk-ISMZIMD3.js.map} +0 -0
  268. /package/dist/{chunk-LEG7XWS2.js.map → chunk-IXSTQGYV.js.map} +0 -0
  269. /package/dist/{chunk-CMN5AWAZ.js.map → chunk-J2KFC47S.js.map} +0 -0
  270. /package/dist/{chunk-K47C6M2C.js.map → chunk-M75TBFKQ.js.map} +0 -0
  271. /package/dist/{chunk-7V2SGZ3H.js.map → chunk-NE566K4E.js.map} +0 -0
  272. /package/dist/{chunk-YROCXMCK.js.map → chunk-RJGPH2Q3.js.map} +0 -0
  273. /package/dist/{chunk-UXFOGILU.js.map → chunk-SBHQBC37.js.map} +0 -0
  274. /package/dist/{chunk-QYGIQ5NM.js.map → chunk-SHHT4JTC.js.map} +0 -0
  275. /package/dist/{chunk-TQOU3VAT.js.map → chunk-SSOMTUCA.js.map} +0 -0
  276. /package/dist/{chunk-NRST7W5Q.js.map → chunk-UI2UP7XX.js.map} +0 -0
  277. /package/dist/{chunk-C4KKM62E.js.map → chunk-UU5LHD6J.js.map} +0 -0
  278. /package/dist/{chunk-EWC6W6AB.js.map → chunk-UXA5L2DZ.js.map} +0 -0
  279. /package/dist/{graph-edge-decay-5ZOK7ZNO.js.map → graph-edge-decay-PUFNHOBS.js.map} +0 -0
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-DGNQRNLL.js";
12
12
  import {
13
13
  toRecallExplainJson
14
- } from "./chunk-PW6GURU3.js";
14
+ } from "./chunk-EKIQBGAY.js";
15
15
  import {
16
16
  applyTagFilter,
17
17
  normalizeTags,
@@ -27,7 +27,7 @@ import {
27
27
  listMemoryGovernanceRuns,
28
28
  readMemoryGovernanceRunArtifact,
29
29
  runMemoryGovernance
30
- } from "./chunk-C4KKM62E.js";
30
+ } from "./chunk-UU5LHD6J.js";
31
31
  import {
32
32
  clusterByKey,
33
33
  combineNamespaces,
@@ -44,12 +44,18 @@ import {
44
44
  seedTrustZoneDemoDataset,
45
45
  summarizeTrustZonePromotionReadiness
46
46
  } from "./chunk-JGSKJHF7.js";
47
+ import {
48
+ isPathInsideStorageRoot
49
+ } from "./chunk-FF4KLI5W.js";
47
50
  import {
48
51
  estimateRecallTokens
49
- } from "./chunk-YQNADJCT.js";
52
+ } from "./chunk-CMZLMIZI.js";
50
53
  import {
51
54
  namespaceCollectionName
52
55
  } from "./chunk-LASA46TQ.js";
56
+ import {
57
+ namespaceIdentityFromToken
58
+ } from "./chunk-ZFXCQPNO.js";
53
59
  import {
54
60
  recordObjectiveStateSnapshotsFromObservedMessages
55
61
  } from "./chunk-BMFZLLNI.js";
@@ -61,7 +67,7 @@ import {
61
67
  } from "./chunk-EIR5VLIH.js";
62
68
  import {
63
69
  buildGraphSnapshot
64
- } from "./chunk-7V2SGZ3H.js";
70
+ } from "./chunk-NE566K4E.js";
65
71
  import {
66
72
  wrapWorkLayerContext
67
73
  } from "./chunk-EI6V5UXY.js";
@@ -85,14 +91,14 @@ import {
85
91
  buildBriefing,
86
92
  parseBriefingFocus,
87
93
  parseBriefingWindow
88
- } from "./chunk-CMN5AWAZ.js";
94
+ } from "./chunk-J2KFC47S.js";
89
95
  import {
90
96
  parseEntityFile
91
- } from "./chunk-QYGIQ5NM.js";
97
+ } from "./chunk-SHHT4JTC.js";
92
98
  import {
93
99
  DEFAULT_RECALL_DISCLOSURE,
94
100
  isRecallDisclosure
95
- } from "./chunk-FPNQF475.js";
101
+ } from "./chunk-3F7RMHC4.js";
96
102
  import {
97
103
  inferMemoryStatus,
98
104
  toMemoryPathRel
@@ -110,7 +116,7 @@ import {
110
116
  import {
111
117
  filterTrajectoriesByLookbackDays,
112
118
  readCausalTrajectoryRecords
113
- } from "./chunk-TQOU3VAT.js";
119
+ } from "./chunk-SSOMTUCA.js";
114
120
  import {
115
121
  canReadNamespace,
116
122
  canWriteNamespace,
@@ -141,6 +147,9 @@ import {
141
147
  iterateOfflineSyncSnapshotFileRecords,
142
148
  readOfflineSyncFileContentChunk
143
149
  } from "./chunk-ZLDUQWT2.js";
150
+ import {
151
+ SecureStoreLockedError
152
+ } from "./chunk-ILXTATKK.js";
144
153
  import {
145
154
  evaluateActionConfidence
146
155
  } from "./chunk-AH2JUU6X.js";
@@ -449,6 +458,42 @@ function formatProcedureStatsText(report) {
449
458
  import * as nodePath from "path";
450
459
  var EngramAccessInputError = class extends Error {
451
460
  };
461
+ function qmdCollectionPathParts(resultPath) {
462
+ if (!resultPath || nodePath.isAbsolute(resultPath)) return null;
463
+ const normalized = resultPath.replace(/\\/g, "/").replace(/^\/+/, "");
464
+ const slashIndex = normalized.indexOf("/");
465
+ if (slashIndex <= 0 || slashIndex >= normalized.length - 1) return null;
466
+ const collection = normalized.slice(0, slashIndex);
467
+ if (/^\d{4}-\d{2}-\d{2}$/.test(collection)) return null;
468
+ return {
469
+ collection,
470
+ relativePath: normalized.slice(slashIndex + 1)
471
+ };
472
+ }
473
+ function qmdResultPathCandidates(storageDir, resultPath) {
474
+ const candidates = /* @__PURE__ */ new Set();
475
+ const storageRoot = nodePath.resolve(storageDir);
476
+ const addCandidate = (candidate) => {
477
+ const resolved = nodePath.resolve(candidate);
478
+ if (isPathInsideStorageRoot(storageRoot, resolved)) {
479
+ candidates.add(resolved);
480
+ }
481
+ };
482
+ const addRelativeCandidates = (relativePath) => {
483
+ const normalized = relativePath.replace(/\\/g, "/").replace(/^\/+/, "");
484
+ if (!normalized) return;
485
+ addCandidate(nodePath.join(storageRoot, normalized));
486
+ if (/^\d{4}-\d{2}-\d{2}\//.test(normalized)) {
487
+ addCandidate(nodePath.join(storageRoot, "facts", normalized));
488
+ }
489
+ };
490
+ if (nodePath.isAbsolute(resultPath)) {
491
+ addCandidate(resultPath);
492
+ } else {
493
+ addRelativeCandidates(resultPath);
494
+ }
495
+ return [...candidates];
496
+ }
452
497
  var cachedPackageVersion = null;
453
498
  async function getPackageVersion() {
454
499
  if (cachedPackageVersion !== null) return cachedPackageVersion;
@@ -874,6 +919,7 @@ var EngramAccessService = class {
874
919
  queryLen: options.query.length,
875
920
  memoryIds,
876
921
  namespace,
922
+ recallNamespaces: [namespace],
877
923
  traceId: options.snapshot.traceId,
878
924
  plannerMode: options.normalizedMode,
879
925
  requestedMode: options.requestedMode && options.requestedMode !== "auto" ? options.requestedMode : void 0,
@@ -922,8 +968,108 @@ var EngramAccessService = class {
922
968
  const namespace = snapshot.namespace ? this.resolveNamespace(snapshot.namespace) : this.orchestrator.config.defaultNamespace;
923
969
  const storage = await this.orchestrator.getStorage(namespace);
924
970
  const storageDir = storage.dir;
971
+ const recallNamespaces = Array.from(
972
+ new Set(
973
+ [
974
+ namespace,
975
+ ...Array.isArray(snapshot.recallNamespaces) ? snapshot.recallNamespaces.map((ns) => this.resolveNamespace(ns)) : [],
976
+ this.orchestrator.config.defaultNamespace,
977
+ this.orchestrator.config.sharedNamespace,
978
+ ...(this.orchestrator.config.namespacePolicies ?? []).map((p) => p.name)
979
+ ].filter((ns) => typeof ns === "string" && ns.length > 0)
980
+ )
981
+ );
925
982
  const results = [];
926
983
  const seen = /* @__PURE__ */ new Set();
984
+ const collectionNamespaceFromPrefix = (collectionPrefix) => {
985
+ const baseCollection = this.orchestrator.config.qmdCollection;
986
+ if (collectionPrefix === baseCollection) return this.orchestrator.config.defaultNamespace;
987
+ const namespaceSuffix = collectionPrefix.startsWith(`${baseCollection}--`) ? collectionPrefix.slice(baseCollection.length + 2) : "";
988
+ if (!namespaceSuffix) return null;
989
+ const decoded = namespaceIdentityFromToken(namespaceSuffix);
990
+ if (decoded !== null) return decoded || this.orchestrator.config.defaultNamespace;
991
+ if (namespaceSuffix.startsWith("ns--")) {
992
+ const legacyNamespace = namespaceSuffix.slice("ns--".length).trim();
993
+ return legacyNamespace || null;
994
+ }
995
+ return null;
996
+ };
997
+ const readResultPath = async (memoryPath) => {
998
+ const parts = qmdCollectionPathParts(memoryPath);
999
+ const coldCollection = this.orchestrator.config.qmdColdCollection ?? "openclaw-engram-cold";
1000
+ if (parts && parts.collection === coldCollection) {
1001
+ const storages = [];
1002
+ const seenStorageDirs = /* @__PURE__ */ new Set();
1003
+ const addStorage = (candidateStorage) => {
1004
+ const candidateDir = nodePath.resolve(candidateStorage.dir);
1005
+ if (seenStorageDirs.has(candidateDir)) return;
1006
+ seenStorageDirs.add(candidateDir);
1007
+ storages.push({ storage: candidateStorage, dir: candidateDir });
1008
+ };
1009
+ addStorage(storage);
1010
+ for (const recallNamespace of recallNamespaces) {
1011
+ try {
1012
+ addStorage(await this.orchestrator.getStorage(recallNamespace));
1013
+ } catch {
1014
+ continue;
1015
+ }
1016
+ }
1017
+ for (const candidateStorage of storages) {
1018
+ try {
1019
+ const coldRoot = nodePath.join(candidateStorage.dir, "cold");
1020
+ for (const candidatePath of qmdResultPathCandidates(
1021
+ coldRoot,
1022
+ parts.relativePath
1023
+ )) {
1024
+ const memory = await candidateStorage.storage.readMemoryByPath(candidatePath);
1025
+ if (memory) return { memory, baseDir: candidateStorage.dir };
1026
+ }
1027
+ } catch (err) {
1028
+ if (err instanceof SecureStoreLockedError) throw err;
1029
+ continue;
1030
+ }
1031
+ }
1032
+ return null;
1033
+ }
1034
+ const collectionNamespace = parts ? collectionNamespaceFromPrefix(parts.collection) : null;
1035
+ if (parts && collectionNamespace) {
1036
+ try {
1037
+ const collectionStorage = await this.orchestrator.getStorage(collectionNamespace);
1038
+ for (const candidate of qmdResultPathCandidates(
1039
+ collectionStorage.dir,
1040
+ parts.relativePath
1041
+ )) {
1042
+ const memory = await collectionStorage.readMemoryByPath(candidate);
1043
+ if (memory) return { memory, baseDir: collectionStorage.dir };
1044
+ }
1045
+ return null;
1046
+ } catch (err) {
1047
+ if (err instanceof SecureStoreLockedError) throw err;
1048
+ return null;
1049
+ }
1050
+ }
1051
+ if (nodePath.isAbsolute(memoryPath)) {
1052
+ const ownerStorage = await this.storageForAbsoluteRecallPath(
1053
+ memoryPath,
1054
+ namespace,
1055
+ recallNamespaces
1056
+ );
1057
+ if (!ownerStorage) return null;
1058
+ for (const candidate of qmdResultPathCandidates(
1059
+ ownerStorage.dir,
1060
+ memoryPath
1061
+ )) {
1062
+ const memory = await ownerStorage.storage.readMemoryByPath(candidate);
1063
+ if (memory) return { memory, baseDir: ownerStorage.dir };
1064
+ }
1065
+ return null;
1066
+ }
1067
+ for (const candidate of qmdResultPathCandidates(storageDir, memoryPath)) {
1068
+ const memory = await storage.readMemoryByPath(candidate);
1069
+ if (memory) return { memory, baseDir: storageDir };
1070
+ }
1071
+ return null;
1072
+ };
927
1073
  const rawExcerptsResult = await this.fetchRawExcerpts(
928
1074
  disclosure,
929
1075
  rawContext ? { ...rawContext, namespace } : null
@@ -931,13 +1077,14 @@ var EngramAccessService = class {
931
1077
  const rawExcerpts = rawExcerptsResult ?? void 0;
932
1078
  for (const memoryPath of snapshot.resultPaths ?? []) {
933
1079
  if (!memoryPath || seen.has(memoryPath)) continue;
934
- const memory = await storage.readMemoryByPath(memoryPath);
935
- if (!memory) continue;
1080
+ const resolved = await readResultPath(memoryPath);
1081
+ if (!resolved) continue;
1082
+ const { memory, baseDir } = resolved;
936
1083
  seen.add(memoryPath);
937
1084
  results.push(
938
1085
  this.serializeMemorySummary(
939
1086
  memory,
940
- storageDir,
1087
+ baseDir,
941
1088
  disclosure,
942
1089
  // Attach the (possibly empty) raw excerpts to the first raw
943
1090
  // result; subsequent results do not duplicate the array.
@@ -961,6 +1108,48 @@ var EngramAccessService = class {
961
1108
  }
962
1109
  return results;
963
1110
  }
1111
+ async storageForAbsoluteRecallPath(memoryPath, primaryNamespace, recallNamespaces = []) {
1112
+ const resolvedPath = nodePath.resolve(memoryPath);
1113
+ const memoryRoot = nodePath.resolve(this.orchestrator.config.memoryDir);
1114
+ const namespacesRoot = nodePath.join(memoryRoot, "namespaces");
1115
+ const configuredNamespaces = /* @__PURE__ */ new Set();
1116
+ configuredNamespaces.add(primaryNamespace);
1117
+ for (const namespace of recallNamespaces) {
1118
+ configuredNamespaces.add(namespace);
1119
+ }
1120
+ configuredNamespaces.add(this.orchestrator.config.defaultNamespace);
1121
+ configuredNamespaces.add(this.orchestrator.config.sharedNamespace);
1122
+ if (isPathInsideStorageRoot(namespacesRoot, resolvedPath)) {
1123
+ const relativeToNamespaces = nodePath.relative(namespacesRoot, resolvedPath);
1124
+ const [namespaceSegment] = relativeToNamespaces.split(/[\\/]/);
1125
+ if (namespaceSegment) {
1126
+ configuredNamespaces.add(
1127
+ namespaceIdentityFromToken(namespaceSegment) ?? namespaceSegment
1128
+ );
1129
+ }
1130
+ }
1131
+ for (const policy of this.orchestrator.config.namespacePolicies ?? []) {
1132
+ configuredNamespaces.add(policy.name);
1133
+ }
1134
+ const matches = [];
1135
+ for (const ns of configuredNamespaces) {
1136
+ if (!ns) continue;
1137
+ let candidateStorage;
1138
+ try {
1139
+ candidateStorage = await this.orchestrator.getStorage(ns);
1140
+ } catch {
1141
+ continue;
1142
+ }
1143
+ const candidateRoot = nodePath.resolve(candidateStorage.dir);
1144
+ if (!isPathInsideStorageRoot(candidateRoot, resolvedPath)) continue;
1145
+ if (candidateRoot === memoryRoot && isPathInsideStorageRoot(namespacesRoot, resolvedPath)) {
1146
+ continue;
1147
+ }
1148
+ matches.push({ storage: candidateStorage, dir: candidateRoot });
1149
+ }
1150
+ matches.sort((a, b) => b.dir.length - a.dir.length);
1151
+ return matches[0] ?? null;
1152
+ }
964
1153
  /**
965
1154
  * Fetch raw transcript excerpts from the LCM archive for `disclosure ===
966
1155
  * "raw"` recalls (issue #677 PR 2/4). Returns `null` for non-raw recall
@@ -1152,7 +1341,9 @@ var EngramAccessService = class {
1152
1341
  const memories = (request.memories ?? "").trim();
1153
1342
  const namespace = this.resolveRecallNamespace(request.namespace, request.sessionKey);
1154
1343
  if (memories.length === 0) {
1155
- return this.orchestrator.generateDaySummaryAuto(namespace);
1344
+ return this.orchestrator.generateDaySummaryAuto(namespace, {
1345
+ timeZone: request.timeZone
1346
+ });
1156
1347
  }
1157
1348
  return this.orchestrator.generateDaySummary(memories);
1158
1349
  }
@@ -4458,4 +4649,4 @@ export {
4458
4649
  shapeMemorySummary,
4459
4650
  EngramAccessService
4460
4651
  };
4461
- //# sourceMappingURL=chunk-XM6M6DHG.js.map
4652
+ //# sourceMappingURL=chunk-52XI77OQ.js.map