@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
@@ -54,7 +54,10 @@ import {
54
54
  } from "./memory-lifecycle-ledger-utils.js";
55
55
  import { getMemoryProjectionPath } from "./memory-projection-store.js";
56
56
  import { canReadNamespace, canWriteNamespace, defaultNamespaceForPrincipal, recallNamespacesForPrincipal, resolvePrincipal } from "./namespaces/principal.js";
57
+ import { namespaceIdentityFromToken } from "./namespaces/identity.js";
57
58
  import { namespaceCollectionName } from "./namespaces/search.js";
59
+ import { SecureStoreLockedError } from "./secure-store/index.js";
60
+ import { isPathInsideStorageRoot } from "./storage-paths.js";
58
61
  import type { LastRecallSnapshot } from "./recall-state.js";
59
62
  import type {
60
63
  GraphRecallSnapshot,
@@ -168,6 +171,52 @@ import { formatProfileTraceAscii } from "./profiling.js";
168
171
 
169
172
  export class EngramAccessInputError extends Error {}
170
173
 
174
+ function qmdCollectionPathParts(resultPath: string): {
175
+ collection: string;
176
+ relativePath: string;
177
+ } | null {
178
+ if (!resultPath || nodePath.isAbsolute(resultPath)) return null;
179
+ const normalized = resultPath.replace(/\\/g, "/").replace(/^\/+/, "");
180
+ const slashIndex = normalized.indexOf("/");
181
+ if (slashIndex <= 0 || slashIndex >= normalized.length - 1) return null;
182
+ const collection = normalized.slice(0, slashIndex);
183
+ if (/^\d{4}-\d{2}-\d{2}$/.test(collection)) return null;
184
+ return {
185
+ collection,
186
+ relativePath: normalized.slice(slashIndex + 1),
187
+ };
188
+ }
189
+
190
+ function qmdResultPathCandidates(
191
+ storageDir: string,
192
+ resultPath: string,
193
+ ): string[] {
194
+ const candidates = new Set<string>();
195
+ const storageRoot = nodePath.resolve(storageDir);
196
+ const addCandidate = (candidate: string) => {
197
+ const resolved = nodePath.resolve(candidate);
198
+ if (isPathInsideStorageRoot(storageRoot, resolved)) {
199
+ candidates.add(resolved);
200
+ }
201
+ };
202
+ const addRelativeCandidates = (relativePath: string) => {
203
+ const normalized = relativePath.replace(/\\/g, "/").replace(/^\/+/, "");
204
+ if (!normalized) return;
205
+ addCandidate(nodePath.join(storageRoot, normalized));
206
+ if (/^\d{4}-\d{2}-\d{2}\//.test(normalized)) {
207
+ addCandidate(nodePath.join(storageRoot, "facts", normalized));
208
+ }
209
+ };
210
+
211
+ if (nodePath.isAbsolute(resultPath)) {
212
+ addCandidate(resultPath);
213
+ } else {
214
+ addRelativeCandidates(resultPath);
215
+ }
216
+
217
+ return [...candidates];
218
+ }
219
+
171
220
  type AccessProfilingReportRequest = {
172
221
  format?: string;
173
222
  limit?: number;
@@ -376,6 +425,7 @@ export interface EngramAccessDaySummaryRequest {
376
425
  memories?: string;
377
426
  sessionKey?: string;
378
427
  namespace?: string;
428
+ timeZone?: string;
379
429
  }
380
430
 
381
431
  /** Inputs accepted by the `remnic_briefing` MCP tool. */
@@ -1437,6 +1487,7 @@ export class EngramAccessService {
1437
1487
  queryLen: options.query.length,
1438
1488
  memoryIds,
1439
1489
  namespace,
1490
+ recallNamespaces: [namespace],
1440
1491
  traceId: options.snapshot.traceId,
1441
1492
  plannerMode: options.normalizedMode,
1442
1493
  requestedMode:
@@ -1500,8 +1551,124 @@ export class EngramAccessService {
1500
1551
  const namespace = snapshot.namespace ? this.resolveNamespace(snapshot.namespace) : this.orchestrator.config.defaultNamespace;
1501
1552
  const storage = await this.orchestrator.getStorage(namespace);
1502
1553
  const storageDir = storage.dir;
1554
+ const recallNamespaces = Array.from(
1555
+ new Set(
1556
+ [
1557
+ namespace,
1558
+ ...(Array.isArray(snapshot.recallNamespaces)
1559
+ ? snapshot.recallNamespaces.map((ns) => this.resolveNamespace(ns))
1560
+ : []),
1561
+ this.orchestrator.config.defaultNamespace,
1562
+ this.orchestrator.config.sharedNamespace,
1563
+ ...(this.orchestrator.config.namespacePolicies ?? []).map((p) => p.name),
1564
+ ].filter((ns): ns is string => typeof ns === "string" && ns.length > 0),
1565
+ ),
1566
+ );
1503
1567
  const results: EngramAccessMemorySummary[] = [];
1504
1568
  const seen = new Set<string>();
1569
+ const collectionNamespaceFromPrefix = (collectionPrefix: string): string | null => {
1570
+ const baseCollection = this.orchestrator.config.qmdCollection;
1571
+ if (collectionPrefix === baseCollection) return this.orchestrator.config.defaultNamespace;
1572
+ const namespaceSuffix = collectionPrefix.startsWith(`${baseCollection}--`)
1573
+ ? collectionPrefix.slice(baseCollection.length + 2)
1574
+ : "";
1575
+ if (!namespaceSuffix) return null;
1576
+
1577
+ const decoded = namespaceIdentityFromToken(namespaceSuffix);
1578
+ if (decoded !== null) return decoded || this.orchestrator.config.defaultNamespace;
1579
+ if (namespaceSuffix.startsWith("ns--")) {
1580
+ const legacyNamespace = namespaceSuffix.slice("ns--".length).trim();
1581
+ return legacyNamespace || null;
1582
+ }
1583
+ return null;
1584
+ };
1585
+ const readResultPath = async (
1586
+ memoryPath: string,
1587
+ ): Promise<{ memory: MemoryFile; baseDir: string } | null> => {
1588
+ const parts = qmdCollectionPathParts(memoryPath);
1589
+ const coldCollection =
1590
+ this.orchestrator.config.qmdColdCollection ?? "openclaw-engram-cold";
1591
+ if (parts && parts.collection === coldCollection) {
1592
+ const storages: Array<{ storage: StorageManager; dir: string }> = [];
1593
+ const seenStorageDirs = new Set<string>();
1594
+ const addStorage = (candidateStorage: StorageManager): void => {
1595
+ const candidateDir = nodePath.resolve(candidateStorage.dir);
1596
+ if (seenStorageDirs.has(candidateDir)) return;
1597
+ seenStorageDirs.add(candidateDir);
1598
+ storages.push({ storage: candidateStorage, dir: candidateDir });
1599
+ };
1600
+ addStorage(storage);
1601
+ for (const recallNamespace of recallNamespaces) {
1602
+ try {
1603
+ addStorage(await this.orchestrator.getStorage(recallNamespace));
1604
+ } catch {
1605
+ continue;
1606
+ }
1607
+ }
1608
+ for (const candidateStorage of storages) {
1609
+ try {
1610
+ const coldRoot = nodePath.join(candidateStorage.dir, "cold");
1611
+ for (const candidatePath of qmdResultPathCandidates(
1612
+ coldRoot,
1613
+ parts.relativePath,
1614
+ )) {
1615
+ const memory =
1616
+ await candidateStorage.storage.readMemoryByPath(candidatePath);
1617
+ if (memory) return { memory, baseDir: candidateStorage.dir };
1618
+ }
1619
+ } catch (err) {
1620
+ if (err instanceof SecureStoreLockedError) throw err;
1621
+ continue;
1622
+ }
1623
+ }
1624
+ return null;
1625
+ }
1626
+
1627
+ const collectionNamespace = parts
1628
+ ? collectionNamespaceFromPrefix(parts.collection)
1629
+ : null;
1630
+
1631
+ if (parts && collectionNamespace) {
1632
+ try {
1633
+ const collectionStorage =
1634
+ await this.orchestrator.getStorage(collectionNamespace);
1635
+ for (const candidate of qmdResultPathCandidates(
1636
+ collectionStorage.dir,
1637
+ parts.relativePath,
1638
+ )) {
1639
+ const memory = await collectionStorage.readMemoryByPath(candidate);
1640
+ if (memory) return { memory, baseDir: collectionStorage.dir };
1641
+ }
1642
+ return null;
1643
+ } catch (err) {
1644
+ if (err instanceof SecureStoreLockedError) throw err;
1645
+ return null;
1646
+ }
1647
+ }
1648
+
1649
+ if (nodePath.isAbsolute(memoryPath)) {
1650
+ const ownerStorage = await this.storageForAbsoluteRecallPath(
1651
+ memoryPath,
1652
+ namespace,
1653
+ recallNamespaces,
1654
+ );
1655
+ if (!ownerStorage) return null;
1656
+ for (const candidate of qmdResultPathCandidates(
1657
+ ownerStorage.dir,
1658
+ memoryPath,
1659
+ )) {
1660
+ const memory = await ownerStorage.storage.readMemoryByPath(candidate);
1661
+ if (memory) return { memory, baseDir: ownerStorage.dir };
1662
+ }
1663
+ return null;
1664
+ }
1665
+
1666
+ for (const candidate of qmdResultPathCandidates(storageDir, memoryPath)) {
1667
+ const memory = await storage.readMemoryByPath(candidate);
1668
+ if (memory) return { memory, baseDir: storageDir };
1669
+ }
1670
+ return null;
1671
+ };
1505
1672
 
1506
1673
  // Pre-fetch raw excerpts once when `disclosure === "raw"` so we don't
1507
1674
  // hit the LCM archive per-result (issue #677 PR 2/4). Excerpts are
@@ -1519,13 +1686,14 @@ export class EngramAccessService {
1519
1686
 
1520
1687
  for (const memoryPath of snapshot.resultPaths ?? []) {
1521
1688
  if (!memoryPath || seen.has(memoryPath)) continue;
1522
- const memory = await storage.readMemoryByPath(memoryPath);
1523
- if (!memory) continue;
1689
+ const resolved = await readResultPath(memoryPath);
1690
+ if (!resolved) continue;
1691
+ const { memory, baseDir } = resolved;
1524
1692
  seen.add(memoryPath);
1525
1693
  results.push(
1526
1694
  this.serializeMemorySummary(
1527
1695
  memory,
1528
- storageDir,
1696
+ baseDir,
1529
1697
  disclosure,
1530
1698
  // Attach the (possibly empty) raw excerpts to the first raw
1531
1699
  // result; subsequent results do not duplicate the array.
@@ -1552,6 +1720,58 @@ export class EngramAccessService {
1552
1720
  return results;
1553
1721
  }
1554
1722
 
1723
+ private async storageForAbsoluteRecallPath(
1724
+ memoryPath: string,
1725
+ primaryNamespace: string,
1726
+ recallNamespaces: readonly string[] = [],
1727
+ ): Promise<{ storage: StorageManager; dir: string } | null> {
1728
+ const resolvedPath = nodePath.resolve(memoryPath);
1729
+ const memoryRoot = nodePath.resolve(this.orchestrator.config.memoryDir);
1730
+ const namespacesRoot = nodePath.join(memoryRoot, "namespaces");
1731
+ const configuredNamespaces = new Set<string>();
1732
+ configuredNamespaces.add(primaryNamespace);
1733
+ for (const namespace of recallNamespaces) {
1734
+ configuredNamespaces.add(namespace);
1735
+ }
1736
+ configuredNamespaces.add(this.orchestrator.config.defaultNamespace);
1737
+ configuredNamespaces.add(this.orchestrator.config.sharedNamespace);
1738
+ if (isPathInsideStorageRoot(namespacesRoot, resolvedPath)) {
1739
+ const relativeToNamespaces = nodePath.relative(namespacesRoot, resolvedPath);
1740
+ const [namespaceSegment] = relativeToNamespaces.split(/[\\/]/);
1741
+ if (namespaceSegment) {
1742
+ configuredNamespaces.add(
1743
+ namespaceIdentityFromToken(namespaceSegment) ?? namespaceSegment,
1744
+ );
1745
+ }
1746
+ }
1747
+ for (const policy of this.orchestrator.config.namespacePolicies ?? []) {
1748
+ configuredNamespaces.add(policy.name);
1749
+ }
1750
+
1751
+ const matches: Array<{ storage: StorageManager; dir: string }> = [];
1752
+ for (const ns of configuredNamespaces) {
1753
+ if (!ns) continue;
1754
+ let candidateStorage: StorageManager;
1755
+ try {
1756
+ candidateStorage = await this.orchestrator.getStorage(ns);
1757
+ } catch {
1758
+ continue;
1759
+ }
1760
+ const candidateRoot = nodePath.resolve(candidateStorage.dir);
1761
+ if (!isPathInsideStorageRoot(candidateRoot, resolvedPath)) continue;
1762
+ if (
1763
+ candidateRoot === memoryRoot &&
1764
+ isPathInsideStorageRoot(namespacesRoot, resolvedPath)
1765
+ ) {
1766
+ continue;
1767
+ }
1768
+ matches.push({ storage: candidateStorage, dir: candidateRoot });
1769
+ }
1770
+
1771
+ matches.sort((a, b) => b.dir.length - a.dir.length);
1772
+ return matches[0] ?? null;
1773
+ }
1774
+
1555
1775
  /**
1556
1776
  * Fetch raw transcript excerpts from the LCM archive for `disclosure ===
1557
1777
  * "raw"` recalls (issue #677 PR 2/4). Returns `null` for non-raw recall
@@ -1802,7 +2022,9 @@ export class EngramAccessService {
1802
2022
 
1803
2023
  if (memories.length === 0) {
1804
2024
  // Auto-gather today's facts from the resolved namespace
1805
- return this.orchestrator.generateDaySummaryAuto(namespace);
2025
+ return this.orchestrator.generateDaySummaryAuto(namespace, {
2026
+ timeZone: request.timeZone,
2027
+ });
1806
2028
  }
1807
2029
  return this.orchestrator.generateDaySummary(memories);
1808
2030
  }
package/src/config.ts CHANGED
@@ -2059,6 +2059,20 @@ export function parseConfig(raw: unknown): PluginConfig {
2059
2059
  hourlySummariesEnabled: cfg.hourlySummariesEnabled !== false, // default: true
2060
2060
  daySummaryEnabled: cfg.daySummaryEnabled !== false, // default: true
2061
2061
  hourlySummaryCronAutoRegister: cfg.hourlySummaryCronAutoRegister === true,
2062
+ // Day summary timezone override (issue #1475). When unset, the plugin
2063
+ // falls back to the server's local timezone.
2064
+ daySummaryTimezone:
2065
+ typeof cfg.daySummaryTimezone === "string" && cfg.daySummaryTimezone.trim().length > 0
2066
+ ? (() => {
2067
+ const tz = (cfg.daySummaryTimezone as string).trim();
2068
+ try {
2069
+ Intl.DateTimeFormat(undefined, { timeZone: tz });
2070
+ return tz;
2071
+ } catch {
2072
+ throw new Error(`daySummaryTimezone must be a valid IANA timezone: ${tz}`);
2073
+ }
2074
+ })()
2075
+ : undefined,
2062
2076
  // Codex P1 on PR 763 round 2: gate the nightly-governance cron
2063
2077
  // (deep-sleep's primary scheduled execution path) on
2064
2078
  // dreams.phases.deepSleep.enabled. When the phase is disabled the
@@ -109,6 +109,16 @@ const LEGACY_PROVIDER_IDS = new Set(["openai-codex", "claude-cli"]);
109
109
  const MANAGED_SECRETREF_MARKER = ["secretref", "managed"].join("-");
110
110
  const PROVIDER_API_KEY_FIELD = ["api", "Key"].join("") as keyof ModelProviderConfig;
111
111
 
112
+ /**
113
+ * Built-in provider fallbacks for providers that are commonly configured via
114
+ * OAuth or gateway-managed auth rather than an explicit apiKey in
115
+ * openclaw.json. These entries let resolveProviderConfig() succeed so the
116
+ * chain proceeds to tryModel() → resolveRuntimeAuth(), which is where the
117
+ * gateway's native OAuth token exchange happens.
118
+ *
119
+ * Without these, OAuth-only providers like `openai` are rejected with
120
+ * "provider not found" before runtime auth is ever attempted.
121
+ */
112
122
  const BUILT_IN_PROVIDER_FALLBACKS: Record<string, ModelProviderConfig> = {
113
123
  anthropic: {
114
124
  baseUrl: "https://api.anthropic.com/v1",
@@ -116,6 +126,12 @@ const BUILT_IN_PROVIDER_FALLBACKS: Record<string, ModelProviderConfig> = {
116
126
  models: [],
117
127
  [PROVIDER_API_KEY_FIELD]: MANAGED_SECRETREF_MARKER,
118
128
  },
129
+ openai: {
130
+ baseUrl: "https://api.openai.com/v1",
131
+ api: "openai-responses",
132
+ models: [],
133
+ [PROVIDER_API_KEY_FIELD]: MANAGED_SECRETREF_MARKER,
134
+ },
119
135
  };
120
136
 
121
137
  /**
package/src/graph.ts CHANGED
@@ -517,6 +517,8 @@ export class GraphIndex {
517
517
  * Default `false` (floor from config is applied).
518
518
  */
519
519
  includeLowConfidence?: boolean;
520
+ /** Absolute deadline in ms-since-epoch for post-retrieval assembly. */
521
+ deadlineAtMs?: number;
520
522
  }
521
523
  ): Promise<
522
524
  Array<{
@@ -545,15 +547,22 @@ export class GraphIndex {
545
547
  const floor =
546
548
  opts?.includeLowConfidence === true ? 0 : clampConfidenceFloor(this.cfg.graphTraversalConfidenceFloor);
547
549
  const iterations = clampPageRankIterations(this.cfg.graphTraversalPageRankIterations);
550
+ const deadlineAtMs = opts?.deadlineAtMs;
551
+ const deadlineExpired = (): boolean =>
552
+ typeof deadlineAtMs === "number" && Date.now() >= deadlineAtMs;
548
553
 
549
554
  try {
555
+ if (deadlineExpired()) return [];
550
556
  const allEdges = await this.loadEdgesCached();
557
+ if (deadlineExpired()) return [];
551
558
 
552
559
  // Build adjacency index: from → edges, to → edges (bidirectional for entity/time, directional for causal).
553
560
  // Edges below the confidence floor are pruned at index time so neither
554
561
  // direct activation nor downstream BFS expansion can re-introduce them.
555
562
  const adj = new Map<string, GraphEdge[]>();
556
- for (const edge of allEdges) {
563
+ for (let i = 0; i < allEdges.length; i += 1) {
564
+ if ((i & 1023) === 0 && deadlineExpired()) return [];
565
+ const edge = allEdges[i];
557
566
  const conf = readEdgeConfidence(edge);
558
567
  if (conf < floor) continue;
559
568
  if (!adj.has(edge.from)) adj.set(edge.from, []);
@@ -583,13 +592,28 @@ export class GraphIndex {
583
592
  frontier.set(`${seed}\0${seed}`, { node: seed, seed, activation: 1 });
584
593
  reachedBySeed.set(seed, new Set([seed]));
585
594
  }
595
+ const finalizeScores = () =>
596
+ Array.from(scores.entries())
597
+ .map(([p, score]) => ({
598
+ path: p,
599
+ score,
600
+ seed: provenance.get(p)?.seed ?? "",
601
+ hopDepth: provenance.get(p)?.hopDepth ?? 0,
602
+ decayedWeight: provenance.get(p)?.decayedWeight ?? 0,
603
+ graphType: provenance.get(p)?.graphType ?? "entity",
604
+ edgeConfidence: provenance.get(p)?.edgeConfidence ?? 1,
605
+ }))
606
+ .sort((a, b) => b.score - a.score);
586
607
 
587
608
  for (let hop = 0; hop < steps && frontier.size > 0; hop++) {
609
+ if (deadlineExpired()) return finalizeScores();
588
610
  const nextFrontier = new Map<string, { node: string; seed: string; activation: number }>();
589
611
 
590
612
  for (const { node, seed: sourceSeed, activation } of frontier.values()) {
591
613
  const edges = adj.get(node) ?? [];
592
- for (const edge of edges) {
614
+ for (let i = 0; i < edges.length; i += 1) {
615
+ if ((i & 1023) === 0 && deadlineExpired()) return finalizeScores();
616
+ const edge = edges[i];
593
617
  const neighbor = edge.to === node ? edge.from : edge.to;
594
618
  const conf = readEdgeConfidence(edge);
595
619
  // Defense in depth: the adjacency build already drops sub-floor
@@ -645,15 +669,17 @@ export class GraphIndex {
645
669
  // edges, weighted by edge confidence. Damping is fixed at the
646
670
  // canonical 0.85 so the ranking stays comparable across queries;
647
671
  // the `iterations` knob bounds compute, not behavior shape.
648
- if (iterations > 0 && scores.size > 1) {
672
+ if (!deadlineExpired() && iterations > 0 && scores.size > 1) {
649
673
  applyPageRankRefinement(scores, adj, {
650
674
  iterations,
651
675
  floor,
652
676
  damping: 0.85,
677
+ deadlineAtMs,
653
678
  });
654
679
  }
655
680
 
656
681
  // Apply lateral inhibition if enabled (Synapse-inspired competitive suppression)
682
+ if (deadlineExpired()) return finalizeScores();
657
683
  if (this.cfg.graphLateralInhibitionEnabled && scores.size > 1) {
658
684
  const inhibited = applyLateralInhibition(scores, {
659
685
  beta: this.cfg.graphLateralInhibitionBeta,
@@ -664,17 +690,7 @@ export class GraphIndex {
664
690
  }
665
691
  }
666
692
 
667
- return Array.from(scores.entries())
668
- .map(([p, score]) => ({
669
- path: p,
670
- score,
671
- seed: provenance.get(p)?.seed ?? "",
672
- hopDepth: provenance.get(p)?.hopDepth ?? 0,
673
- decayedWeight: provenance.get(p)?.decayedWeight ?? 0,
674
- graphType: provenance.get(p)?.graphType ?? "entity",
675
- edgeConfidence: provenance.get(p)?.edgeConfidence ?? 1,
676
- }))
677
- .sort((a, b) => b.score - a.score);
693
+ return finalizeScores();
678
694
  } catch (err) {
679
695
  const { log } = await import("./logger.js");
680
696
  log.warn(`[graph] spreadingActivation error: ${err}`);
@@ -725,11 +741,13 @@ export function clampPageRankIterations(raw: unknown): number {
725
741
  export function applyPageRankRefinement(
726
742
  scores: Map<string, number>,
727
743
  adj: Map<string, GraphEdge[]>,
728
- opts: { iterations: number; floor: number; damping: number }
744
+ opts: { iterations: number; floor: number; damping: number; deadlineAtMs?: number }
729
745
  ): void {
730
- const { iterations, floor, damping } = opts;
746
+ const { iterations, floor, damping, deadlineAtMs } = opts;
731
747
  if (iterations <= 0 || scores.size === 0) return;
732
748
  const safeDamping = Math.min(1, Math.max(0, damping));
749
+ const deadlineExpired = (): boolean =>
750
+ typeof deadlineAtMs === "number" && Date.now() >= deadlineAtMs;
733
751
 
734
752
  // Pre-compute confidence-weighted out-edge totals for normalization.
735
753
  // Done once per refinement, not per iteration, since adjacency is
@@ -748,6 +766,7 @@ export function applyPageRankRefinement(
748
766
  };
749
767
  const outboundTotal = new Map<string, number>();
750
768
  for (const [node, edges] of adj.entries()) {
769
+ if (deadlineExpired()) return;
751
770
  if (!scores.has(node)) continue; // only candidate nodes redistribute
752
771
  let sum = 0;
753
772
  for (const edge of edges) {
@@ -758,6 +777,7 @@ export function applyPageRankRefinement(
758
777
  }
759
778
 
760
779
  for (let i = 0; i < iterations; i += 1) {
780
+ if (deadlineExpired()) return;
761
781
  const next = new Map<string, number>();
762
782
  // Teleport / damping floor: every node retains `(1 - damping) * score`
763
783
  // of its current activation so dangling nodes do not bleed to zero.
@@ -776,7 +796,9 @@ export function applyPageRankRefinement(
776
796
  next.set(node, (next.get(node) ?? 0) + safeDamping * score);
777
797
  continue;
778
798
  }
779
- for (const edge of outEdges) {
799
+ for (let edgeIndex = 0; edgeIndex < outEdges.length; edgeIndex += 1) {
800
+ if ((edgeIndex & 1023) === 0 && deadlineExpired()) return;
801
+ const edge = outEdges[edgeIndex];
780
802
  if (!eligible(edge, node)) continue;
781
803
  const conf = readEdgeConfidence(edge);
782
804
  const neighbor = edge.to === node ? edge.from : edge.to;
package/src/index.ts CHANGED
@@ -341,7 +341,15 @@ export {
341
341
  // ---------------------------------------------------------------------------
342
342
 
343
343
  export { EngramAccessService, EngramAccessInputError } from "./access-service.js";
344
- export { EngramAccessHttpServer } from "./access-http.js";
344
+ export {
345
+ EngramAccessHttpServer,
346
+ type RemnicAdminConfigPatch,
347
+ type RemnicAdminControls,
348
+ type RemnicAdminDashboardStatus,
349
+ type RemnicAdminFeatureStatus,
350
+ type RemnicAdminHarnessStatus,
351
+ type RemnicAdminModelOption,
352
+ } from "./access-http.js";
345
353
  export { EngramMcpServer } from "./access-mcp.js";
346
354
 
347
355
  // agentAccessHttp.authToken SecretRef resolution (issue #757). Exposed so