@remnic/core 9.6.1 → 9.6.3

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 (332) hide show
  1. package/dist/access-admin-ops-surface.d.ts +7 -8
  2. package/dist/access-admin-ops-surface.js +8 -8
  3. package/dist/access-boundary.d.ts +9 -8
  4. package/dist/access-boundary.js +9 -9
  5. package/dist/access-cli.js +40 -40
  6. package/dist/access-http.d.ts +47 -16
  7. package/dist/access-http.js +13 -13
  8. package/dist/access-identity-continuity-surface.d.ts +6 -7
  9. package/dist/access-identity-continuity-surface.js +8 -8
  10. package/dist/access-lcm-surface.d.ts +7 -8
  11. package/dist/access-lcm-surface.js +8 -8
  12. package/dist/access-mcp.d.ts +13 -8
  13. package/dist/access-mcp.js +12 -12
  14. package/dist/access-observe-write-surface.d.ts +7 -8
  15. package/dist/access-observe-write-surface.js +8 -8
  16. package/dist/access-operations-batch.js +10 -10
  17. package/dist/access-operations.d.ts +8 -9
  18. package/dist/access-operations.js +11 -11
  19. package/dist/access-recall-surface.d.ts +7 -8
  20. package/dist/access-recall-surface.js +8 -8
  21. package/dist/access-schema.d.ts +6 -6
  22. package/dist/{access-service-CXJaql3A.d.ts → access-service-Bps_9G1t.d.ts} +9 -9
  23. package/dist/access-service.d.ts +7 -8
  24. package/dist/access-service.js +8 -8
  25. package/dist/access-surface-catalog.d.ts +7 -8
  26. package/dist/action-confidence.d.ts +1 -2
  27. package/dist/active-memory-bridge.d.ts +1 -2
  28. package/dist/active-recall.d.ts +1 -2
  29. package/dist/behavior-learner.d.ts +1 -2
  30. package/dist/behavior-signals.d.ts +1 -2
  31. package/dist/bootstrap.d.ts +6 -7
  32. package/dist/briefing.d.ts +2 -3
  33. package/dist/briefing.js +3 -3
  34. package/dist/buffer-surprise-report.d.ts +1 -2
  35. package/dist/buffer.d.ts +2 -3
  36. package/dist/buffer.js +1 -1
  37. package/dist/bulk-import/index.d.ts +3 -3
  38. package/dist/bulk-import/index.js +2 -2
  39. package/dist/calibration.d.ts +1 -2
  40. package/dist/capabilities.d.ts +1 -2
  41. package/dist/{catalog-C9cu67Ig.d.ts → catalog-9WanSGtt.d.ts} +1 -1
  42. package/dist/causal-behavior.d.ts +1 -2
  43. package/dist/causal-consolidation.d.ts +1 -2
  44. package/dist/causal-consolidation.js +4 -4
  45. package/dist/causal-trajectory-graph.d.ts +1 -2
  46. package/dist/{chunk-PNLFN2PZ.js → chunk-23G3T2Q5.js} +2 -2
  47. package/dist/{chunk-SIRPLF54.js → chunk-2K3OSLHE.js} +2 -2
  48. package/dist/{chunk-JS2HKKOK.js → chunk-3AC5UYKI.js} +1 -1
  49. package/dist/{chunk-JS2HKKOK.js.map → chunk-3AC5UYKI.js.map} +1 -1
  50. package/dist/{chunk-LQHDIS7L.js → chunk-54BGIBCR.js} +2 -2
  51. package/dist/{chunk-PVUJ6WVV.js → chunk-5MH5NF3U.js} +5 -5
  52. package/dist/{chunk-Y7UNNAZD.js → chunk-7ZYBDQ7V.js} +2 -2
  53. package/dist/{chunk-2PRQG7PV.js → chunk-AJVLDJU6.js} +1 -1
  54. package/dist/chunk-AJVLDJU6.js.map +1 -0
  55. package/dist/{chunk-LR5DZ56F.js → chunk-AXALUFAH.js} +2 -2
  56. package/dist/{chunk-AYZJID4S.js → chunk-B5GBWBCZ.js} +2 -2
  57. package/dist/{chunk-H2DXDQCQ.js → chunk-BT3PTVYZ.js} +48 -44
  58. package/dist/chunk-BT3PTVYZ.js.map +1 -0
  59. package/dist/{chunk-TLUDFPZL.js → chunk-CAZ3Z5M6.js} +2 -2
  60. package/dist/{chunk-P454KXD6.js → chunk-CJPVWAJF.js} +21 -21
  61. package/dist/{chunk-RGK27ELN.js → chunk-DEKIXXIG.js} +2 -2
  62. package/dist/{chunk-XCL57M6Q.js → chunk-DPZKMGEP.js} +21 -20
  63. package/dist/chunk-DPZKMGEP.js.map +1 -0
  64. package/dist/{chunk-2KK5WNQB.js → chunk-DQ42IQSK.js} +2 -2
  65. package/dist/{chunk-UFUKHGZD.js → chunk-EIGE4IMQ.js} +89 -33
  66. package/dist/chunk-EIGE4IMQ.js.map +1 -0
  67. package/dist/{chunk-HOJZMQ4J.js → chunk-FGDKJJZS.js} +2 -2
  68. package/dist/{chunk-ABP6QMVM.js → chunk-FQ7HAWWC.js} +2 -2
  69. package/dist/{chunk-CYWA2CXR.js → chunk-FVTLSFWU.js} +2 -2
  70. package/dist/{chunk-JJEJJ7RK.js → chunk-FXZTL7F7.js} +2 -2
  71. package/dist/{chunk-DANV2HTH.js → chunk-GQGDRLDM.js} +3 -3
  72. package/dist/{chunk-7F7Z6MOS.js → chunk-H4CKS5B2.js} +2 -2
  73. package/dist/{chunk-SVOHGUMI.js → chunk-H4FHR4UM.js} +174 -197
  74. package/dist/chunk-H4FHR4UM.js.map +1 -0
  75. package/dist/{chunk-CKITWVWJ.js → chunk-HSSERO3E.js} +2 -2
  76. package/dist/{chunk-23JFRB73.js → chunk-JODHPNLN.js} +2 -2
  77. package/dist/{chunk-DS7MM2ES.js → chunk-JZKR6ZAV.js} +2 -2
  78. package/dist/{chunk-BEM4D2QG.js → chunk-KJIJNLXT.js} +3 -3
  79. package/dist/{chunk-JSNVWNGX.js → chunk-KVSVVKHA.js} +2 -2
  80. package/dist/{chunk-MC4FJXPA.js → chunk-MMACM5G2.js} +2 -2
  81. package/dist/{chunk-PCLIWBGD.js → chunk-N2RP4K5Q.js} +8 -6
  82. package/dist/chunk-N2RP4K5Q.js.map +1 -0
  83. package/dist/{chunk-OUELRE5E.js → chunk-NOUJNHWG.js} +1 -1
  84. package/dist/chunk-NOUJNHWG.js.map +1 -0
  85. package/dist/{chunk-3XIY7MDQ.js → chunk-O6YI4CVI.js} +2 -2
  86. package/dist/{chunk-F53UF7CI.js → chunk-QLVLW7UD.js} +6 -2
  87. package/dist/{chunk-F53UF7CI.js.map → chunk-QLVLW7UD.js.map} +1 -1
  88. package/dist/{chunk-LADFWYHY.js → chunk-QMC3BI3K.js} +6 -6
  89. package/dist/chunk-QMC3BI3K.js.map +1 -0
  90. package/dist/{chunk-72WG5QKN.js → chunk-SDAXPXER.js} +2 -2
  91. package/dist/{chunk-FKCRGLRD.js → chunk-T43VKQU3.js} +269 -167
  92. package/dist/chunk-T43VKQU3.js.map +1 -0
  93. package/dist/{chunk-4LV23CHK.js → chunk-VHJARF5R.js} +2 -2
  94. package/dist/{chunk-6MMONPHM.js → chunk-W2AHSCKY.js} +2 -2
  95. package/dist/{chunk-4GNEDXDI.js → chunk-WULTHJRU.js} +2 -2
  96. package/dist/chunk-WULTHJRU.js.map +1 -0
  97. package/dist/{chunk-K5LLP4CY.js → chunk-ZGPDSEKG.js} +20 -9
  98. package/dist/chunk-ZGPDSEKG.js.map +1 -0
  99. package/dist/{cli-CqdPA6z9.d.ts → cli-SBWBw_eK.d.ts} +4 -5
  100. package/dist/cli.d.ts +9 -10
  101. package/dist/cli.js +32 -32
  102. package/dist/compounding/engine.d.ts +2 -3
  103. package/dist/compounding/engine.js +3 -3
  104. package/dist/compounding/preference-consolidator.d.ts +1 -2
  105. package/dist/compression-optimizer.d.ts +1 -2
  106. package/dist/config.d.ts +1 -2
  107. package/dist/connectors/codex-materialize-runner.d.ts +1 -2
  108. package/dist/connectors/codex-materialize-runner.js +3 -3
  109. package/dist/connectors/codex-materialize.d.ts +1 -2
  110. package/dist/connectors/index.d.ts +1 -2
  111. package/dist/connectors/index.js +3 -3
  112. package/dist/consolidation-provenance-check.d.ts +2 -3
  113. package/dist/consolidation-undo.d.ts +2 -3
  114. package/dist/contradiction/index.d.ts +3 -4
  115. package/dist/conversation-index/backend.d.ts +1 -2
  116. package/dist/conversation-index/chunker.d.ts +1 -2
  117. package/dist/conversation-index/faiss-adapter.d.ts +1 -2
  118. package/dist/conversation-index/indexer.d.ts +1 -2
  119. package/dist/conversation-index/search.d.ts +1 -2
  120. package/dist/day-summary.d.ts +1 -2
  121. package/dist/delinearize.d.ts +1 -2
  122. package/dist/direct-answer-wiring.d.ts +1 -2
  123. package/dist/direct-answer.d.ts +1 -2
  124. package/dist/embedding-fallback.d.ts +1 -2
  125. package/dist/enrichment/index.d.ts +1 -2
  126. package/dist/entity-retrieval.d.ts +2 -3
  127. package/dist/entity-retrieval.js +3 -3
  128. package/dist/entity-schema.d.ts +1 -2
  129. package/dist/explicit-capture.d.ts +8 -7
  130. package/dist/explicit-capture.js +1 -1
  131. package/dist/extraction-faithfulness.d.ts +1 -2
  132. package/dist/extraction-judge-telemetry.d.ts +1 -2
  133. package/dist/extraction-judge-training.d.ts +1 -2
  134. package/dist/extraction-judge.d.ts +1 -2
  135. package/dist/extraction.d.ts +1 -2
  136. package/dist/fallback-llm.d.ts +1 -2
  137. package/dist/graph-dashboard-diff.d.ts +1 -2
  138. package/dist/graph-dashboard-key.d.ts +1 -2
  139. package/dist/graph-dashboard-parser.d.ts +1 -2
  140. package/dist/graph-edge-reinforcement.d.ts +1 -2
  141. package/dist/graph-snapshot.d.ts +1 -2
  142. package/dist/graph.d.ts +1 -2
  143. package/dist/identity-continuity.d.ts +1 -2
  144. package/dist/importance.d.ts +1 -2
  145. package/dist/importers/index.d.ts +1 -1
  146. package/dist/importers/index.js +2 -2
  147. package/dist/index.d.ts +14 -15
  148. package/dist/index.js +40 -40
  149. package/dist/intent.d.ts +1 -2
  150. package/dist/lcm/engine.d.ts +1 -2
  151. package/dist/lcm/index.d.ts +1 -2
  152. package/dist/lcm/tools.d.ts +1 -2
  153. package/dist/lifecycle.d.ts +1 -2
  154. package/dist/live-connectors-runner.d.ts +1 -2
  155. package/dist/local-llm.d.ts +1 -2
  156. package/dist/local-model-endpoint.d.ts +1 -2
  157. package/dist/maintenance/memory-governance.d.ts +1 -2
  158. package/dist/maintenance/memory-governance.js +3 -3
  159. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
  160. package/dist/maintenance/rebuild-memory-projection.js +4 -4
  161. package/dist/mcp-memory-inspector-app.d.ts +7 -8
  162. package/dist/memory-action-policy.d.ts +1 -2
  163. package/dist/memory-cache.d.ts +1 -2
  164. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -2
  165. package/dist/memory-projection-store.d.ts +1 -2
  166. package/dist/memory-provenance.d.ts +1 -2
  167. package/dist/memory-worth-outcomes.d.ts +2 -3
  168. package/dist/models-json.d.ts +1 -2
  169. package/dist/namespaces/migrate.d.ts +3 -4
  170. package/dist/namespaces/migrate.js +4 -4
  171. package/dist/namespaces/principal.d.ts +1 -2
  172. package/dist/namespaces/search.d.ts +1 -2
  173. package/dist/namespaces/storage.d.ts +3 -4
  174. package/dist/namespaces/storage.js +3 -3
  175. package/dist/native-knowledge.d.ts +1 -2
  176. package/dist/operator-toolkit.d.ts +2 -3
  177. package/dist/operator-toolkit.js +7 -7
  178. package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -3
  179. package/dist/orchestration/maintenance.d.ts +2 -3
  180. package/dist/orchestration/maintenance.js +5 -5
  181. package/dist/{orchestrator-CWFrT8AF.d.ts → orchestrator-B0YrUl2H.d.ts} +40 -38
  182. package/dist/orchestrator.d.ts +6 -7
  183. package/dist/orchestrator.js +40 -40
  184. package/dist/patterns-cli.d.ts +1 -2
  185. package/dist/{pipeline-DmqtvION.d.ts → pipeline-CiD86zIk.d.ts} +1 -1
  186. package/dist/policy-runtime.d.ts +1 -2
  187. package/dist/provenance.d.ts +1 -2
  188. package/dist/{qmd--fnPMK60.d.ts → qmd-Bef7DDuQ.d.ts} +1 -1
  189. package/dist/qmd-preflight.d.ts +2 -3
  190. package/dist/qmd-recall-cache.d.ts +1 -2
  191. package/dist/qmd.d.ts +2 -3
  192. package/dist/recall-disclosure-escalation.d.ts +1 -2
  193. package/dist/recall-explain-renderer.d.ts +1 -2
  194. package/dist/recall-explain-renderer.js +3 -3
  195. package/dist/recall-planner-llm.d.ts +1 -2
  196. package/dist/recall-state.d.ts +1 -2
  197. package/dist/recall-tag-filter.d.ts +1 -2
  198. package/dist/recall-timings.d.ts +1 -2
  199. package/dist/recall-xray-cli.d.ts +1 -2
  200. package/dist/recall-xray-cli.js +4 -4
  201. package/dist/recall-xray-renderer.d.ts +1 -2
  202. package/dist/recall-xray-renderer.js +3 -3
  203. package/dist/recall-xray.d.ts +1 -2
  204. package/dist/recall-xray.js +2 -2
  205. package/dist/replay/normalizers/chatgpt.d.ts +1 -0
  206. package/dist/replay/normalizers/chatgpt.js +3 -3
  207. package/dist/replay/normalizers/claude.d.ts +1 -0
  208. package/dist/replay/normalizers/claude.js +3 -3
  209. package/dist/replay/normalizers/openclaw.d.ts +1 -0
  210. package/dist/replay/normalizers/openclaw.js +3 -3
  211. package/dist/replay/normalizers/shared.d.ts +1 -0
  212. package/dist/replay/normalizers/shared.js +2 -2
  213. package/dist/replay/runner.d.ts +1 -0
  214. package/dist/replay/runner.js +2 -2
  215. package/dist/replay/types.d.ts +2 -1
  216. package/dist/replay/types.js +1 -1
  217. package/dist/resolve-auth-token.d.ts +1 -2
  218. package/dist/retrieval-agents.d.ts +2 -3
  219. package/dist/retrieval-tiers.d.ts +1 -2
  220. package/dist/routing/engine.d.ts +1 -2
  221. package/dist/routing/store.d.ts +1 -2
  222. package/dist/schemas.d.ts +22 -22
  223. package/dist/search/embed-helper.d.ts +1 -2
  224. package/dist/search/factory.d.ts +1 -2
  225. package/dist/search/index.d.ts +1 -2
  226. package/dist/search/lancedb-backend.d.ts +1 -2
  227. package/dist/search/meilisearch-backend.d.ts +1 -2
  228. package/dist/search/noop-backend.d.ts +1 -2
  229. package/dist/search/orama-backend.d.ts +1 -2
  230. package/dist/search/port.d.ts +1 -2
  231. package/dist/search/remote-backend.d.ts +1 -2
  232. package/dist/{semantic-DJR8_DMQ.d.ts → semantic-TddhF0y7.d.ts} +17 -1
  233. package/dist/{semantic-consolidation-O5lMZ4LG.d.ts → semantic-consolidation-BTShF2Fo.d.ts} +1 -1
  234. package/dist/semantic-consolidation.d.ts +2 -3
  235. package/dist/semantic-consolidation.js +4 -4
  236. package/dist/semantic-rule-promotion.js +3 -3
  237. package/dist/semantic-rule-verifier.d.ts +1 -2
  238. package/dist/semantic-rule-verifier.js +3 -3
  239. package/dist/session-observer-bands.d.ts +1 -2
  240. package/dist/session-observer-state.d.ts +1 -2
  241. package/dist/shared-context/manager.d.ts +3 -4
  242. package/dist/signal.d.ts +1 -2
  243. package/dist/{storage-C1maCNbc.d.ts → storage-DxPDAiU9.d.ts} +5 -1
  244. package/dist/storage.d.ts +2 -3
  245. package/dist/storage.js +2 -2
  246. package/dist/summarizer.d.ts +1 -2
  247. package/dist/summary-snapshot.d.ts +1 -2
  248. package/dist/temporal-supersession.d.ts +2 -3
  249. package/dist/temporal-validity.d.ts +1 -2
  250. package/dist/threading.d.ts +1 -2
  251. package/dist/tier-migration.d.ts +2 -3
  252. package/dist/tier-routing.d.ts +1 -2
  253. package/dist/topics.d.ts +1 -2
  254. package/dist/transcript.d.ts +1 -2
  255. package/dist/trust-score-stage.d.ts +1 -2
  256. package/dist/trust-score.d.ts +1 -2
  257. package/dist/{types-CGgcNWCG.d.ts → types-DDUDgd7T.d.ts} +93 -4
  258. package/dist/types.d.ts +1 -2
  259. package/dist/types.js +1 -1
  260. package/dist/utility-runtime.d.ts +1 -2
  261. package/dist/verified-recall.js +3 -3
  262. package/package.json +2 -2
  263. package/src/access-admin-ops-surface.ts +1 -0
  264. package/src/access-boundary.ts +2 -0
  265. package/src/access-http.test.ts +129 -0
  266. package/src/access-http.ts +92 -23
  267. package/src/access-mcp.ts +11 -2
  268. package/src/access-observe-write-surface.ts +87 -113
  269. package/src/access-operations-batch.ts +2 -2
  270. package/src/access-operations.ts +17 -16
  271. package/src/access-service.ts +13 -5
  272. package/src/admin/admin-surfaces.ts +2 -0
  273. package/src/buffer.ts +6 -1
  274. package/src/bulk-import/types.ts +2 -1
  275. package/src/coding/architecture-surfaces.test.ts +79 -5
  276. package/src/coding/architecture-surfaces.ts +7 -1
  277. package/src/coding/decision-surfaces.test.ts +1 -0
  278. package/src/coding/decision-surfaces.ts +4 -0
  279. package/src/connector-provenance-lifecycle.test.ts +618 -0
  280. package/src/connector-provenance.test.ts +219 -0
  281. package/src/dedup/semantic.test.ts +105 -0
  282. package/src/dedup/semantic.ts +69 -1
  283. package/src/explicit-capture.ts +21 -4
  284. package/src/orchestration/extraction-persist.ts +154 -6
  285. package/src/orchestration/extraction-run.ts +138 -228
  286. package/src/orchestration/persistence-index.ts +40 -5
  287. package/src/orchestration/turn-ingestion.ts +16 -9
  288. package/src/orchestrator-connector-dedup.test.ts +1082 -0
  289. package/src/orchestrator.ts +10 -26
  290. package/src/replay/types.ts +2 -1
  291. package/src/storage.ts +426 -553
  292. package/src/types.ts +11 -2
  293. package/src/utils/yaml-scalar.ts +20 -0
  294. package/dist/chunk-2PRQG7PV.js.map +0 -1
  295. package/dist/chunk-4GNEDXDI.js.map +0 -1
  296. package/dist/chunk-FKCRGLRD.js.map +0 -1
  297. package/dist/chunk-H2DXDQCQ.js.map +0 -1
  298. package/dist/chunk-K5LLP4CY.js.map +0 -1
  299. package/dist/chunk-LADFWYHY.js.map +0 -1
  300. package/dist/chunk-OUELRE5E.js.map +0 -1
  301. package/dist/chunk-PCLIWBGD.js.map +0 -1
  302. package/dist/chunk-SVOHGUMI.js.map +0 -1
  303. package/dist/chunk-UFUKHGZD.js.map +0 -1
  304. package/dist/chunk-XCL57M6Q.js.map +0 -1
  305. package/dist/types-gb_SNtjR.d.ts +0 -85
  306. /package/dist/{chunk-PNLFN2PZ.js.map → chunk-23G3T2Q5.js.map} +0 -0
  307. /package/dist/{chunk-SIRPLF54.js.map → chunk-2K3OSLHE.js.map} +0 -0
  308. /package/dist/{chunk-LQHDIS7L.js.map → chunk-54BGIBCR.js.map} +0 -0
  309. /package/dist/{chunk-PVUJ6WVV.js.map → chunk-5MH5NF3U.js.map} +0 -0
  310. /package/dist/{chunk-Y7UNNAZD.js.map → chunk-7ZYBDQ7V.js.map} +0 -0
  311. /package/dist/{chunk-LR5DZ56F.js.map → chunk-AXALUFAH.js.map} +0 -0
  312. /package/dist/{chunk-AYZJID4S.js.map → chunk-B5GBWBCZ.js.map} +0 -0
  313. /package/dist/{chunk-TLUDFPZL.js.map → chunk-CAZ3Z5M6.js.map} +0 -0
  314. /package/dist/{chunk-P454KXD6.js.map → chunk-CJPVWAJF.js.map} +0 -0
  315. /package/dist/{chunk-RGK27ELN.js.map → chunk-DEKIXXIG.js.map} +0 -0
  316. /package/dist/{chunk-2KK5WNQB.js.map → chunk-DQ42IQSK.js.map} +0 -0
  317. /package/dist/{chunk-HOJZMQ4J.js.map → chunk-FGDKJJZS.js.map} +0 -0
  318. /package/dist/{chunk-ABP6QMVM.js.map → chunk-FQ7HAWWC.js.map} +0 -0
  319. /package/dist/{chunk-CYWA2CXR.js.map → chunk-FVTLSFWU.js.map} +0 -0
  320. /package/dist/{chunk-JJEJJ7RK.js.map → chunk-FXZTL7F7.js.map} +0 -0
  321. /package/dist/{chunk-DANV2HTH.js.map → chunk-GQGDRLDM.js.map} +0 -0
  322. /package/dist/{chunk-7F7Z6MOS.js.map → chunk-H4CKS5B2.js.map} +0 -0
  323. /package/dist/{chunk-CKITWVWJ.js.map → chunk-HSSERO3E.js.map} +0 -0
  324. /package/dist/{chunk-23JFRB73.js.map → chunk-JODHPNLN.js.map} +0 -0
  325. /package/dist/{chunk-DS7MM2ES.js.map → chunk-JZKR6ZAV.js.map} +0 -0
  326. /package/dist/{chunk-BEM4D2QG.js.map → chunk-KJIJNLXT.js.map} +0 -0
  327. /package/dist/{chunk-JSNVWNGX.js.map → chunk-KVSVVKHA.js.map} +0 -0
  328. /package/dist/{chunk-MC4FJXPA.js.map → chunk-MMACM5G2.js.map} +0 -0
  329. /package/dist/{chunk-3XIY7MDQ.js.map → chunk-O6YI4CVI.js.map} +0 -0
  330. /package/dist/{chunk-72WG5QKN.js.map → chunk-SDAXPXER.js.map} +0 -0
  331. /package/dist/{chunk-4LV23CHK.js.map → chunk-VHJARF5R.js.map} +0 -0
  332. /package/dist/{chunk-6MMONPHM.js.map → chunk-W2AHSCKY.js.map} +0 -0
@@ -37,7 +37,7 @@ import {
37
37
  import {
38
38
  SPECULATIVE_TTL_DAYS,
39
39
  confidenceTier
40
- } from "./chunk-JS2HKKOK.js";
40
+ } from "./chunk-3AC5UYKI.js";
41
41
  import {
42
42
  markProjectedMemoryPathInvalid,
43
43
  readProjectedGovernanceRecord,
@@ -124,7 +124,19 @@ import {
124
124
  } from "./chunk-VS2IYZRU.js";
125
125
 
126
126
  // src/storage.ts
127
- import { access, lstat as lstat2, readdir as readdir4, readFile, realpath as realpath2, stat as stat2, writeFile, mkdir, unlink as unlink2, appendFile, open as open2 } from "fs/promises";
127
+ import {
128
+ access,
129
+ lstat as lstat2,
130
+ readdir as readdir4,
131
+ readFile,
132
+ realpath as realpath2,
133
+ stat as stat2,
134
+ writeFile,
135
+ mkdir,
136
+ unlink as unlink2,
137
+ appendFile,
138
+ open as open2
139
+ } from "fs/promises";
128
140
  import { appendFileSync, createReadStream as createReadStream2, mkdirSync, readFileSync, statSync } from "fs";
129
141
  import { createHash as createHash3 } from "crypto";
130
142
  import path5 from "path";
@@ -1265,6 +1277,20 @@ var IdentityContinuityStore = class {
1265
1277
  }
1266
1278
  };
1267
1279
 
1280
+ // src/utils/yaml-scalar.ts
1281
+ function decodeYamlScalar(value) {
1282
+ const trimmed = value.trim();
1283
+ if (trimmed.length >= 2 && trimmed.startsWith('"') && trimmed.endsWith('"')) {
1284
+ try {
1285
+ const decoded = JSON.parse(trimmed);
1286
+ if (typeof decoded === "string") return decoded;
1287
+ } catch {
1288
+ }
1289
+ return trimmed.slice(1, -1);
1290
+ }
1291
+ return trimmed;
1292
+ }
1293
+
1268
1294
  // src/wearables/fusion/cluster.ts
1269
1295
  var DEFAULT_PROXIMITY_GAP_MS = 5 * 6e4;
1270
1296
  function maxSegmentExtent(segments) {
@@ -2458,6 +2484,10 @@ function serializeFrontmatter(fm) {
2458
2484
  `tags: [${fm.tags.map((t) => `"${t}"`).join(", ")}]`
2459
2485
  ];
2460
2486
  if (fm.entityRef) lines.push(`entityRef: ${fm.entityRef}`);
2487
+ if (fm.sourceConnector) {
2488
+ const safe = /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(fm.sourceConnector);
2489
+ lines.push(`sourceConnector: ${safe ? fm.sourceConnector : JSON.stringify(fm.sourceConnector)}`);
2490
+ }
2461
2491
  if (fm.supersedes) lines.push(`supersedes: ${fm.supersedes}`);
2462
2492
  if (fm.expiresAt) lines.push(`expiresAt: ${fm.expiresAt}`);
2463
2493
  if (fm.lineage && fm.lineage.length > 0) {
@@ -2542,9 +2572,7 @@ function serializeFrontmatter(fm) {
2542
2572
  if (fm.contentHash) lines.push(`contentHash: ${fm.contentHash}`);
2543
2573
  if (fm.derived_from !== void 0) {
2544
2574
  if (!Array.isArray(fm.derived_from)) {
2545
- throw new Error(
2546
- `serializeFrontmatter: derived_from must be an array of "<path>:<version>" strings`
2547
- );
2575
+ throw new Error(`serializeFrontmatter: derived_from must be an array of "<path>:<version>" strings`);
2548
2576
  }
2549
2577
  for (const entry of fm.derived_from) {
2550
2578
  if (!isValidDerivedFromEntry(entry)) {
@@ -2626,6 +2654,32 @@ function parseFrontmatterStringValue(rawValue) {
2626
2654
  }
2627
2655
  return trimmed;
2628
2656
  }
2657
+ function bracketListInner(raw) {
2658
+ const trimmed = raw.trim();
2659
+ if (!trimmed.startsWith("[") || !trimmed.endsWith("]")) return void 0;
2660
+ return trimmed.slice(1, -1);
2661
+ }
2662
+ function quotedArrayValues(raw) {
2663
+ const inner = bracketListInner(raw);
2664
+ if (inner === void 0) return [];
2665
+ const values = [];
2666
+ let i = 0;
2667
+ while (i < inner.length) {
2668
+ while (i < inner.length && inner[i] !== '"') i++;
2669
+ if (i >= inner.length) break;
2670
+ i++;
2671
+ let value = "";
2672
+ while (i < inner.length) {
2673
+ const ch = inner[i++];
2674
+ if (ch === "\\" && i < inner.length) value += ch + inner[i++];
2675
+ else if (ch === '"') {
2676
+ values.push(value);
2677
+ break;
2678
+ } else value += ch;
2679
+ }
2680
+ }
2681
+ return values;
2682
+ }
2629
2683
  function parseMemoryWorthCounterField(raw) {
2630
2684
  if (raw === void 0) return void 0;
2631
2685
  const trimmed = raw.trim();
@@ -2690,22 +2744,22 @@ function parseFrontmatter(raw) {
2690
2744
  }
2691
2745
  let tags = [];
2692
2746
  const tagsStr = fm.tags ?? "";
2693
- const tagMatch = tagsStr.match(/\[(.*)]/);
2694
- if (tagMatch) {
2695
- tags = tagMatch[1].split(",").map((t) => t.trim().replace(/^"|"$/g, "")).filter(Boolean);
2747
+ const tagInner = bracketListInner(tagsStr);
2748
+ if (tagInner !== void 0) {
2749
+ tags = tagInner.split(",").map((t) => t.trim().replace(/^"|"$/g, "")).filter(Boolean);
2696
2750
  }
2697
2751
  let intentEntityTypes;
2698
2752
  const intentEntityTypesStr = fm.intentEntityTypes ?? "";
2699
- const intentEntityTypesMatch = intentEntityTypesStr.match(/\[(.*)]/);
2700
- if (intentEntityTypesMatch) {
2701
- intentEntityTypes = intentEntityTypesMatch[1].split(",").map((t) => t.trim().replace(/^"|"$/g, "")).filter(Boolean);
2753
+ const intentEntityTypesInner = bracketListInner(intentEntityTypesStr);
2754
+ if (intentEntityTypesInner !== void 0) {
2755
+ intentEntityTypes = intentEntityTypesInner.split(",").map((t) => t.trim().replace(/^"|"$/g, "")).filter(Boolean);
2702
2756
  }
2703
2757
  const conf = parseFloat(fm.confidence ?? "0.8");
2704
2758
  let lineage;
2705
2759
  const lineageStr = fm.lineage ?? "";
2706
- const lineageMatch = lineageStr.match(/\[(.*)]/);
2707
- if (lineageMatch) {
2708
- lineage = lineageMatch[1].split(",").map((l) => l.trim().replace(/^"|"$/g, "")).filter(Boolean);
2760
+ const lineageInner = bracketListInner(lineageStr);
2761
+ if (lineageInner !== void 0) {
2762
+ lineage = lineageInner.split(",").map((l) => l.trim().replace(/^"|"$/g, "")).filter(Boolean);
2709
2763
  }
2710
2764
  let derived_from;
2711
2765
  const derivedFromStr = (fm.derived_from ?? "").trim();
@@ -2792,19 +2846,16 @@ function parseFrontmatter(raw) {
2792
2846
  let reasons = [];
2793
2847
  const reasonsStr = fm.importanceReasons ?? "";
2794
2848
  if (reasonsStr.trim().startsWith("[") && reasonsStr.trim().endsWith("]")) {
2795
- const reasonMatches = reasonsStr.matchAll(/"((?:\\.|[^"\\])*)"/g);
2796
- for (const match2 of reasonMatches) {
2797
- const reason = parseLinkReasonValue(match2[1]);
2798
- if (reason.length > 0) {
2799
- reasons.push(reason);
2800
- }
2849
+ for (const rawReason of quotedArrayValues(reasonsStr)) {
2850
+ const reason = parseLinkReasonValue(rawReason);
2851
+ if (reason.length > 0) reasons.push(reason);
2801
2852
  }
2802
2853
  }
2803
2854
  let keywords = [];
2804
2855
  const keywordsStr = fm.importanceKeywords ?? "";
2805
- const keywordsMatch = keywordsStr.match(/\[(.*)]/);
2806
- if (keywordsMatch) {
2807
- keywords = keywordsMatch[1].split(",").map((k) => k.trim().replace(/^"|"$/g, "")).filter(Boolean);
2856
+ const keywordsInner = bracketListInner(keywordsStr);
2857
+ if (keywordsInner !== void 0) {
2858
+ keywords = keywordsInner.split(",").map((k) => k.trim().replace(/^"|"$/g, "")).filter(Boolean);
2808
2859
  }
2809
2860
  importance = { score, level, reasons, keywords };
2810
2861
  }
@@ -2819,6 +2870,7 @@ function parseFrontmatter(raw) {
2819
2870
  confidenceTier: fm.confidenceTier || confidenceTier(conf),
2820
2871
  tags,
2821
2872
  entityRef: fm.entityRef || void 0,
2873
+ sourceConnector: fm.sourceConnector ? decodeYamlScalar(fm.sourceConnector) || void 0 : void 0,
2822
2874
  supersedes: fm.supersedes || void 0,
2823
2875
  expiresAt: fm.expiresAt || void 0,
2824
2876
  lineage: lineage && lineage.length > 0 ? lineage : void 0,
@@ -2905,15 +2957,7 @@ function inferEntityTypeFromContent(content) {
2905
2957
  const typeMatch = content.match(/^\*\*Type:\*\*\s*([^\n]+)/m)?.[1]?.trim().toLowerCase();
2906
2958
  return typeMatch || void 0;
2907
2959
  }
2908
- var KNOWN_ENTITY_FILENAME_PREFIXES = /* @__PURE__ */ new Set([
2909
- "company",
2910
- "other",
2911
- "person",
2912
- "place",
2913
- "project",
2914
- "tool",
2915
- "topic"
2916
- ]);
2960
+ var KNOWN_ENTITY_FILENAME_PREFIXES = /* @__PURE__ */ new Set(["company", "other", "person", "place", "project", "tool", "topic"]);
2917
2961
  function inferEntityTypeFromFilename(pathRel) {
2918
2962
  const basename = path5.basename(pathRel, ".md").toLowerCase();
2919
2963
  const separator = basename.indexOf("-");
@@ -3435,17 +3479,13 @@ function serializeEntityTimelineEntry(entry) {
3435
3479
  return `- ${serializedMetadata}${entry.text}`.trimEnd();
3436
3480
  }
3437
3481
  function dedupeEntityTimelineFacts(timeline) {
3438
- return [...new Set(
3439
- timeline.map((entry) => entry.text.trim()).filter((entry) => entry.length > 0)
3440
- )];
3482
+ return [...new Set(timeline.map((entry) => entry.text.trim()).filter((entry) => entry.length > 0))];
3441
3483
  }
3442
3484
  function normalizeEntitySectionFact(value) {
3443
3485
  return value.replace(/\s+/g, " ").trim();
3444
3486
  }
3445
3487
  function normalizeStructuredSectionFacts(facts) {
3446
- return [...new Set(
3447
- facts.map((fact) => normalizeEntitySectionFact(fact)).filter((fact) => fact.length > 0)
3448
- )];
3488
+ return [...new Set(facts.map((fact) => normalizeEntitySectionFact(fact)).filter((fact) => fact.length > 0))];
3449
3489
  }
3450
3490
  function collectStructuredSectionFacts(structuredSections) {
3451
3491
  const facts = [];
@@ -3516,11 +3556,7 @@ function partitionEntityStructuredSections(entityType, extraSections, entitySche
3516
3556
  remainingExtraSections.push(section);
3517
3557
  continue;
3518
3558
  }
3519
- const normalizedSection = matchedSection ? { key: matchedSection.key, title: matchedSection.title } : normalizeEntityStructuredSection(
3520
- entityType,
3521
- { key: section.title, title: section.title },
3522
- entitySchemas
3523
- );
3559
+ const normalizedSection = matchedSection ? { key: matchedSection.key, title: matchedSection.title } : normalizeEntityStructuredSection(entityType, { key: section.title, title: section.title }, entitySchemas);
3524
3560
  if (facts.length === 0) {
3525
3561
  remainingExtraSections.push(section);
3526
3562
  continue;
@@ -3580,7 +3616,9 @@ function fingerprintEntityStructuredFacts(entity) {
3580
3616
  key: section.key.trim().toLowerCase(),
3581
3617
  title: section.title.replace(/\s+/g, " ").trim(),
3582
3618
  facts: normalizeStructuredSectionFacts(section.facts).slice().sort((left, right) => left.localeCompare(right))
3583
- })).filter((section) => section.facts.length > 0).sort((left, right) => left.key.localeCompare(right.key) || left.title.localeCompare(right.title) || left.facts.join("\n").localeCompare(right.facts.join("\n")));
3619
+ })).filter((section) => section.facts.length > 0).sort(
3620
+ (left, right) => left.key.localeCompare(right.key) || left.title.localeCompare(right.title) || left.facts.join("\n").localeCompare(right.facts.join("\n"))
3621
+ );
3584
3622
  if (normalizedSections.length === 0) return void 0;
3585
3623
  return createHash3("sha256").update(JSON.stringify(normalizedSections)).digest("hex");
3586
3624
  }
@@ -3670,20 +3708,14 @@ function parseEntityFile(content, entitySchemas) {
3670
3708
  legacyFacts.push(bullet);
3671
3709
  break;
3672
3710
  case "timeline": {
3673
- const parsed = parseEntityTimelineBullet(
3674
- bullet,
3675
- fallbackTimestamp
3676
- );
3711
+ const parsed = parseEntityTimelineBullet(bullet, fallbackTimestamp);
3677
3712
  if (parsed) timeline.push(parsed);
3678
3713
  break;
3679
3714
  }
3680
3715
  case "summary":
3681
3716
  case "synthesis":
3682
3717
  if (isEntitySynthesisTimelinePromotionBullet(bullet)) {
3683
- const parsed = parseEntityTimelineBullet(
3684
- bullet,
3685
- fallbackTimestamp
3686
- );
3718
+ const parsed = parseEntityTimelineBullet(bullet, fallbackTimestamp);
3687
3719
  if (parsed) timeline.push(parsed);
3688
3720
  }
3689
3721
  break;
@@ -3770,9 +3802,11 @@ function serializeEntityFile(entity, entitySchemas) {
3770
3802
  entitySchemas
3771
3803
  );
3772
3804
  const sectionFacts = new Set(collectStructuredSectionFacts(structuredSections));
3773
- const legacyFacts = timeline.length === 0 ? [...new Set(
3774
- entity.facts.map((fact) => normalizeEntitySectionFact(fact)).filter((fact) => fact.length > 0 && !sectionFacts.has(fact))
3775
- )] : [];
3805
+ const legacyFacts = timeline.length === 0 ? [
3806
+ ...new Set(
3807
+ entity.facts.map((fact) => normalizeEntitySectionFact(fact)).filter((fact) => fact.length > 0 && !sectionFacts.has(fact))
3808
+ )
3809
+ ] : [];
3776
3810
  const synthesisUpdatedAt = entity.synthesisUpdatedAt?.trim() || "";
3777
3811
  const synthesisTimelineCount = entity.synthesisTimelineCount;
3778
3812
  const synthesisStructuredFactCount = entity.synthesisStructuredFactCount;
@@ -4132,9 +4166,7 @@ var StorageManager3 = class _StorageManager {
4132
4166
  _memoryReadStore;
4133
4167
  get memoryReadStore() {
4134
4168
  if (!this._memoryReadStore) {
4135
- this._memoryReadStore = new MemoryReadStore(
4136
- selfDeps(this)
4137
- );
4169
+ this._memoryReadStore = new MemoryReadStore(selfDeps(this));
4138
4170
  }
4139
4171
  return this._memoryReadStore;
4140
4172
  }
@@ -4142,9 +4174,7 @@ var StorageManager3 = class _StorageManager {
4142
4174
  _entityStore;
4143
4175
  get entityStore() {
4144
4176
  if (!this._entityStore) {
4145
- this._entityStore = new EntityStore(
4146
- selfDeps(this)
4147
- );
4177
+ this._entityStore = new EntityStore(selfDeps(this));
4148
4178
  }
4149
4179
  return this._entityStore;
4150
4180
  }
@@ -4230,9 +4260,7 @@ var StorageManager3 = class _StorageManager {
4230
4260
  );
4231
4261
  }
4232
4262
  if (!isValidTranscriptDate(date)) {
4233
- throw new Error(
4234
- `invalid wearable transcript date '${String(date)}' \u2014 expected YYYY-MM-DD`
4235
- );
4263
+ throw new Error(`invalid wearable transcript date '${String(date)}' \u2014 expected YYYY-MM-DD`);
4236
4264
  }
4237
4265
  return path5.join(this.wearablesDir, sourceId, `${date}.md`);
4238
4266
  }
@@ -4251,9 +4279,7 @@ var StorageManager3 = class _StorageManager {
4251
4279
  }
4252
4280
  }
4253
4281
  async listWearableTranscriptDays(sourceId) {
4254
- return this.memoryReadStore.listWearableTranscriptDays(
4255
- sourceId
4256
- );
4282
+ return this.memoryReadStore.listWearableTranscriptDays(sourceId);
4257
4283
  }
4258
4284
  _fusionStore;
4259
4285
  /** Derived fusion-day IO; file IO lives in wearables/fusion (#1810). */
@@ -4361,10 +4387,14 @@ var StorageManager3 = class _StorageManager {
4361
4387
  return readMaybeEncryptedFile(filePath, this._secureStoreKey, this.baseDir);
4362
4388
  }
4363
4389
  writeStorageSecureFile(filePath, content) {
4364
- return writeMaybeEncryptedFile(filePath, content, this.resolveWriteKey(), {}, this.baseDir).then(() => this.notifyCatalogWrite());
4390
+ return writeMaybeEncryptedFile(filePath, content, this.resolveWriteKey(), {}, this.baseDir).then(
4391
+ () => this.notifyCatalogWrite()
4392
+ );
4365
4393
  }
4366
4394
  writeStorageSecureFileChunks(filePath, chunks) {
4367
- return writeMaybeEncryptedFileFromChunks(filePath, chunks, this.resolveWriteKey(), {}, this.baseDir).then(() => this.notifyCatalogWrite());
4395
+ return writeMaybeEncryptedFileFromChunks(filePath, chunks, this.resolveWriteKey(), {}, this.baseDir).then(
4396
+ () => this.notifyCatalogWrite()
4397
+ );
4368
4398
  }
4369
4399
  assertManagedStoragePath(filePath, method) {
4370
4400
  const resolved = path5.resolve(filePath);
@@ -4486,12 +4516,8 @@ var StorageManager3 = class _StorageManager {
4486
4516
  if (!cache) return;
4487
4517
  const entries = [...cache.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([entryPath, entry]) => ({ path: entryPath, ...entry }));
4488
4518
  await mkdir(path5.dirname(this.offlineSyncDigestCachePath), { recursive: true });
4489
- await writeFile(
4490
- this.offlineSyncDigestCachePath,
4491
- `${JSON.stringify({ version: 1, entries })}
4492
- `,
4493
- "utf-8"
4494
- );
4519
+ await writeFile(this.offlineSyncDigestCachePath, `${JSON.stringify({ version: 1, entries })}
4520
+ `, "utf-8");
4495
4521
  }).catch((err) => {
4496
4522
  log.warn(
4497
4523
  `storage.offlineSyncDigestCache: failed to write cache: ${err instanceof Error ? err.message : String(err)}`
@@ -4650,12 +4676,7 @@ var StorageManager3 = class _StorageManager {
4650
4676
  // stat lets the store own its cross-process staleness probe (#1579).
4651
4677
  stat: (filePath) => statSync(filePath)
4652
4678
  };
4653
- return new TombstoneStore(
4654
- this.tombstonesPath,
4655
- this.tombstonesConfig.namespace,
4656
- options,
4657
- io
4658
- );
4679
+ return new TombstoneStore(this.tombstonesPath, this.tombstonesConfig.namespace, options, io);
4659
4680
  }
4660
4681
  /**
4661
4682
  * Lazily load the tombstone store. Mirrors the fact-hash-index lazy-load
@@ -4793,15 +4814,11 @@ var StorageManager3 = class _StorageManager {
4793
4814
  const content = memory.content;
4794
4815
  const stripped = stripCitationForTemplate(content, this.citationTemplate);
4795
4816
  if (stripped !== content) {
4796
- factHashIndex.addByHash(
4797
- ContentHashIndex.computeHash(sanitizeMemoryContent(stripped).text)
4798
- );
4817
+ factHashIndex.addByHash(ContentHashIndex.computeHash(sanitizeMemoryContent(stripped).text));
4799
4818
  continue;
4800
4819
  }
4801
4820
  if (!hasCitation(content)) {
4802
- factHashIndex.addByHash(
4803
- ContentHashIndex.computeHash(sanitizeMemoryContent(content).text)
4804
- );
4821
+ factHashIndex.addByHash(ContentHashIndex.computeHash(sanitizeMemoryContent(content).text));
4805
4822
  continue;
4806
4823
  }
4807
4824
  legacyRecovered++;
@@ -4894,10 +4911,7 @@ var StorageManager3 = class _StorageManager {
4894
4911
  */
4895
4912
  userAliases = {};
4896
4913
  normalizeEntityName(raw, type) {
4897
- return this.entityStore.normalizeEntityName(
4898
- raw,
4899
- type
4900
- );
4914
+ return this.entityStore.normalizeEntityName(raw, type);
4901
4915
  }
4902
4916
  /**
4903
4917
  * Read-only view of this store's user alias table, for call sites that
@@ -4932,9 +4946,7 @@ var StorageManager3 = class _StorageManager {
4932
4946
  this.userAliases = cleaned;
4933
4947
  log.debug(`loaded ${Object.keys(cleaned).length} entity aliases from ${aliasPath}`);
4934
4948
  } else {
4935
- log.warn(
4936
- `ignoring ${aliasPath}: payload must be a JSON object mapping variant \u2192 canonical strings`
4937
- );
4949
+ log.warn(`ignoring ${aliasPath}: payload must be a JSON object mapping variant \u2192 canonical strings`);
4938
4950
  }
4939
4951
  } catch {
4940
4952
  log.debug("no config/aliases.json found \u2014 using built-in aliases only");
@@ -4985,10 +4997,7 @@ var StorageManager3 = class _StorageManager {
4985
4997
  const conf = options.confidence ?? 0.8;
4986
4998
  const tier = confidenceTier(conf);
4987
4999
  const validAt = normalizeMemoryWriteTimestamp("validAt", options.validAt);
4988
- const observedAt = normalizeMemoryWriteTimestamp(
4989
- "observedAt",
4990
- options.observedAt
4991
- );
5000
+ const observedAt = normalizeMemoryWriteTimestamp("observedAt", options.observedAt);
4992
5001
  let expiresAt;
4993
5002
  if (typeof options.expiresAt === "string" && options.expiresAt.length > 0) {
4994
5003
  expiresAt = options.expiresAt;
@@ -5042,6 +5051,9 @@ var StorageManager3 = class _StorageManager {
5042
5051
  if (options.provenance !== void 0) {
5043
5052
  fm.provenance = options.provenance;
5044
5053
  }
5054
+ if (options.sourceConnector !== void 0) {
5055
+ fm.sourceConnector = options.sourceConnector;
5056
+ }
5045
5057
  let enrichedContent = content;
5046
5058
  if (options.structuredAttributes && Object.keys(options.structuredAttributes).length > 0) {
5047
5059
  enrichedContent = `${content}
@@ -5197,10 +5209,7 @@ ${sanitized.text}
5197
5209
  }
5198
5210
  if (removedHashes.size === 0) return;
5199
5211
  const remainingActiveHashes = /* @__PURE__ */ new Set();
5200
- const remainingMemories = [
5201
- ...await this.readAllMemories(),
5202
- ...await this.readAllColdMemories()
5203
- ];
5212
+ const remainingMemories = [...await this.readAllMemories(), ...await this.readAllColdMemories()];
5204
5213
  for (const memory of remainingMemories) {
5205
5214
  if (memory.frontmatter.category !== "fact") continue;
5206
5215
  if (removedIds.has(memory.frontmatter.id)) continue;
@@ -5242,7 +5251,8 @@ ${sanitized.text}
5242
5251
  sourceTurnId: options.sourceTurnId,
5243
5252
  intentGoal: options.intentGoal,
5244
5253
  intentActionType: options.intentActionType,
5245
- intentEntityTypes: options.intentEntityTypes
5254
+ intentEntityTypes: options.intentEntityTypes,
5255
+ ...options.sourceConnector ? { sourceConnector: options.sourceConnector } : {}
5246
5256
  };
5247
5257
  const sanitized = sanitizeMemoryContent(quote);
5248
5258
  if (!sanitized.clean) {
@@ -5288,12 +5298,7 @@ ${sanitized.text}
5288
5298
  return hits.slice(0, maxResults).map((h) => h.memory);
5289
5299
  }
5290
5300
  async writeEntity(name, type, facts, options = {}) {
5291
- return this.entityStore.writeEntity(
5292
- name,
5293
- type,
5294
- facts,
5295
- options
5296
- );
5301
+ return this.entityStore.writeEntity(name, type, facts, options);
5297
5302
  }
5298
5303
  async readProfile() {
5299
5304
  try {
@@ -5357,10 +5362,7 @@ ${sanitized.text}
5357
5362
  ].join("\n");
5358
5363
  await this.writeProfile(content);
5359
5364
  } else {
5360
- const updatedTimestamp = existing.replace(
5361
- /\*Last updated:.*\*/,
5362
- `*Last updated: ${(/* @__PURE__ */ new Date()).toISOString()}*`
5363
- );
5365
+ const updatedTimestamp = existing.replace(/\*Last updated:.*\*/, `*Last updated: ${(/* @__PURE__ */ new Date()).toISOString()}*`);
5364
5366
  const withBullets = updatedTimestamp.trimEnd() + "\n" + newBullets.map((b) => `- ${b}`).join("\n") + "\n";
5365
5367
  await this.writeProfile(withBullets);
5366
5368
  }
@@ -5523,18 +5525,20 @@ ${sanitized.text}
5523
5525
  }
5524
5526
  }
5525
5527
  async filterWindowPathsByUpdatedAfter(filePaths, updatedAfterMs) {
5526
- const results = await Promise.all(filePaths.map(async (filePath) => {
5527
- const updatedMs = await this.readWindowUpdatedMs(filePath);
5528
- if (updatedMs !== null) {
5529
- return updatedMs >= updatedAfterMs ? filePath : null;
5530
- }
5531
- try {
5532
- const fileStat = await stat2(filePath);
5533
- return fileStat.mtimeMs >= updatedAfterMs ? filePath : null;
5534
- } catch {
5535
- return filePath;
5536
- }
5537
- }));
5528
+ const results = await Promise.all(
5529
+ filePaths.map(async (filePath) => {
5530
+ const updatedMs = await this.readWindowUpdatedMs(filePath);
5531
+ if (updatedMs !== null) {
5532
+ return updatedMs >= updatedAfterMs ? filePath : null;
5533
+ }
5534
+ try {
5535
+ const fileStat = await stat2(filePath);
5536
+ return fileStat.mtimeMs >= updatedAfterMs ? filePath : null;
5537
+ } catch {
5538
+ return filePath;
5539
+ }
5540
+ })
5541
+ );
5538
5542
  return results.filter((filePath) => filePath !== null);
5539
5543
  }
5540
5544
  orderWindowPaths(filePaths) {
@@ -5584,9 +5588,7 @@ ${sanitized.text}
5584
5588
  return { memories, filePaths };
5585
5589
  }
5586
5590
  async readMemoriesWindow(options = {}) {
5587
- return this.memoryReadStore.readMemoriesWindow(
5588
- options
5589
- );
5591
+ return this.memoryReadStore.readMemoriesWindow(options);
5590
5592
  }
5591
5593
  async _readAllMemoriesFromDisk() {
5592
5594
  const filePaths = await this.collectActiveMemoryPaths();
@@ -5636,9 +5638,7 @@ ${sanitized.text}
5636
5638
  return memories;
5637
5639
  }
5638
5640
  async readMemoryByPath(filePath) {
5639
- return this.memoryReadStore.readMemoryByPath(
5640
- filePath
5641
- );
5641
+ return this.memoryReadStore.readMemoryByPath(filePath);
5642
5642
  }
5643
5643
  resolveTierRootDir(tier) {
5644
5644
  return tier === "cold" ? path5.join(this.baseDir, "cold") : this.baseDir;
@@ -5780,9 +5780,7 @@ ${memory.content}
5780
5780
  }
5781
5781
  }
5782
5782
  async readEntity(name) {
5783
- return this.entityStore.readEntity(
5784
- name
5785
- );
5783
+ return this.entityStore.readEntity(name);
5786
5784
  }
5787
5785
  async listEntityNames() {
5788
5786
  return this.entityStore.listEntityNames();
@@ -5841,15 +5839,15 @@ ${memory.content}
5841
5839
  const memories = await this.readAllMemories();
5842
5840
  const memory = memories.find((m) => m.frontmatter.id === id);
5843
5841
  if (!memory) return false;
5844
- const mergedLineage = [
5845
- ...memory.frontmatter.lineage ?? [],
5846
- ...options?.lineage ?? []
5847
- ].filter((v, i, a) => a.indexOf(v) === i);
5842
+ const mergedLineage = [...memory.frontmatter.lineage ?? [], ...options?.lineage ?? []].filter(
5843
+ (v, i, a) => a.indexOf(v) === i
5844
+ );
5848
5845
  const updated = {
5849
5846
  ...memory.frontmatter,
5850
5847
  updated: (/* @__PURE__ */ new Date()).toISOString(),
5851
5848
  supersedes: options?.supersedes ?? memory.frontmatter.supersedes,
5852
- lineage: mergedLineage.length > 0 ? mergedLineage : void 0
5849
+ lineage: mergedLineage.length > 0 ? mergedLineage : void 0,
5850
+ ...memory.frontmatter.sourceConnector === void 0 && options?.sourceConnector ? { sourceConnector: options.sourceConnector } : {}
5853
5851
  };
5854
5852
  const sanitized = sanitizeMemoryContent(newContent);
5855
5853
  if (!sanitized.clean) {
@@ -5897,13 +5895,10 @@ ${memory.content}
5897
5895
  this.invalidateColdMemoriesCache();
5898
5896
  }
5899
5897
  try {
5900
- await this.syncFactHashIndexAfterRewrite(
5901
- memory,
5902
- {
5903
- ...memory,
5904
- frontmatter: updated
5905
- }
5906
- );
5898
+ await this.syncFactHashIndexAfterRewrite(memory, {
5899
+ ...memory,
5900
+ frontmatter: updated
5901
+ });
5907
5902
  } catch (err) {
5908
5903
  log.warn(`storage.writeMemoryFrontmatter completed but failed to update fact hash index: ${err}`);
5909
5904
  }
@@ -5992,9 +5987,7 @@ ${memory.content}
5992
5987
  lastConsolidationAt: parsed.lastConsolidationAt ?? null,
5993
5988
  totalMemories: typeof parsed.totalMemories === "number" ? parsed.totalMemories : 0,
5994
5989
  totalEntities: typeof parsed.totalEntities === "number" ? parsed.totalEntities : 0,
5995
- processedExtractionFingerprints: Array.isArray(
5996
- parsed.processedExtractionFingerprints
5997
- ) ? parsed.processedExtractionFingerprints.filter(
5990
+ processedExtractionFingerprints: Array.isArray(parsed.processedExtractionFingerprints) ? parsed.processedExtractionFingerprints.filter(
5998
5991
  (entry) => entry && typeof entry === "object" && typeof entry.fingerprint === "string" && typeof entry.observedAt === "string"
5999
5992
  ).map((entry) => ({
6000
5993
  fingerprint: entry.fingerprint,
@@ -6050,14 +6043,10 @@ ${memory.content}
6050
6043
  return events.length;
6051
6044
  }
6052
6045
  async appendBufferSurpriseEvents(events) {
6053
- return this.memoryReadStore.appendBufferSurpriseEvents(
6054
- events
6055
- );
6046
+ return this.memoryReadStore.appendBufferSurpriseEvents(events);
6056
6047
  }
6057
6048
  async readBufferSurpriseEvents(options = {}) {
6058
- return this.memoryReadStore.readBufferSurpriseEvents(
6059
- options
6060
- );
6049
+ return this.memoryReadStore.readBufferSurpriseEvents(options);
6061
6050
  }
6062
6051
  async appendBehaviorSignals(events) {
6063
6052
  if (events.length === 0) return 0;
@@ -6176,10 +6165,7 @@ ${memory.content}
6176
6165
  if (cappedLimit === 0 || Number.isNaN(cappedLimit)) return [];
6177
6166
  try {
6178
6167
  return await readMemoryActionEventRowsFromLines(
6179
- readMaybeEncryptedLines(
6180
- this.memoryActionsPath,
6181
- () => this.readStorageSecureFile(this.memoryActionsPath)
6182
- ),
6168
+ readMaybeEncryptedLines(this.memoryActionsPath, () => this.readStorageSecureFile(this.memoryActionsPath)),
6183
6169
  cappedLimit
6184
6170
  );
6185
6171
  } catch (err) {
@@ -6288,9 +6274,7 @@ ${memory.content}
6288
6274
  return true;
6289
6275
  }
6290
6276
  async readCompressionGuidelineStateFile(filePath) {
6291
- return this.memoryReadStore.readCompressionGuidelineStateFile(
6292
- filePath
6293
- );
6277
+ return this.memoryReadStore.readCompressionGuidelineStateFile(filePath);
6294
6278
  }
6295
6279
  async writeIdentityAnchor(content) {
6296
6280
  return this.identityContinuityStore.writeIdentityAnchor(content);
@@ -6373,9 +6357,7 @@ ${question}
6373
6357
  const body = match[2].trim();
6374
6358
  const id = this.extractFrontmatterValue(frontmatterStr, "id") ?? path5.basename(filePath, ".md");
6375
6359
  const created = this.extractFrontmatterValue(frontmatterStr, "created") ?? "";
6376
- const priority = parseFloat(
6377
- this.extractFrontmatterValue(frontmatterStr, "priority") ?? "0.5"
6378
- );
6360
+ const priority = parseFloat(this.extractFrontmatterValue(frontmatterStr, "priority") ?? "0.5");
6379
6361
  const resolved = this.extractFrontmatterValue(frontmatterStr, "resolved") === "true";
6380
6362
  const contextMatch = body.match(/\*\*Context:\*\*\s*(.*)/);
6381
6363
  const question = contextMatch ? body.slice(0, contextMatch.index).trim() : body;
@@ -6383,9 +6365,7 @@ ${question}
6383
6365
  return { id, question, context, priority, resolved, created, filePath };
6384
6366
  }
6385
6367
  extractFrontmatterValue(frontmatter, key) {
6386
- const match = frontmatter.match(
6387
- new RegExp(`^${key}:\\s*"?([^"\\n]*)"?`, "m")
6388
- );
6368
+ const match = frontmatter.match(new RegExp(`^${key}:\\s*"?([^"\\n]*)"?`, "m"));
6389
6369
  return match ? match[1] : null;
6390
6370
  }
6391
6371
  async resolveQuestion(id) {
@@ -6394,13 +6374,10 @@ ${question}
6394
6374
  if (!q) return false;
6395
6375
  let raw = await this.readStorageSecureFile(q.filePath);
6396
6376
  raw = raw.replace(/resolved: false/, "resolved: true");
6397
- raw = raw.replace(
6398
- /---\n\n/,
6399
- `resolvedAt: "${(/* @__PURE__ */ new Date()).toISOString()}"
6377
+ raw = raw.replace(/---\n\n/, `resolvedAt: "${(/* @__PURE__ */ new Date()).toISOString()}"
6400
6378
  ---
6401
6379
 
6402
- `
6403
- );
6380
+ `);
6404
6381
  await this.writeStorageSecureFile(q.filePath, raw);
6405
6382
  this.invalidateQuestionsCache();
6406
6383
  log.debug(`resolved question ${id}`);
@@ -6447,13 +6424,13 @@ ${question}
6447
6424
  });
6448
6425
  await writeFile(identityPath, newContent, "utf-8");
6449
6426
  existing = newContent;
6450
- log.info(
6451
- `rotated IDENTITY.md to archive (size=${existing.length} chars, maxBytes=${maxBytes})`
6452
- );
6427
+ log.info(`rotated IDENTITY.md to archive (size=${existing.length} chars, maxBytes=${maxBytes})`);
6453
6428
  }
6454
6429
  } else {
6455
6430
  if (existing.length > _StorageManager.IDENTITY_MAX_BYTES) {
6456
- log.debug(`IDENTITY.md is ${existing.length} chars (limit ${_StorageManager.IDENTITY_MAX_BYTES}); skipping reflection`);
6431
+ log.debug(
6432
+ `IDENTITY.md is ${existing.length} chars (limit ${_StorageManager.IDENTITY_MAX_BYTES}); skipping reflection`
6433
+ );
6457
6434
  return;
6458
6435
  }
6459
6436
  }
@@ -6464,7 +6441,9 @@ ${question}
6464
6441
  const lastTimestamp = allMatches[allMatches.length - 1][1];
6465
6442
  const elapsed = Date.now() - new Date(lastTimestamp).getTime();
6466
6443
  if (elapsed < _StorageManager.REFLECTION_COOLDOWN_MS) {
6467
- log.debug(`reflection cooldown: ${Math.round(elapsed / 1e3)}s since last (need ${_StorageManager.REFLECTION_COOLDOWN_MS / 1e3}s)`);
6444
+ log.debug(
6445
+ `reflection cooldown: ${Math.round(elapsed / 1e3)}s since last (need ${_StorageManager.REFLECTION_COOLDOWN_MS / 1e3}s)`
6446
+ );
6468
6447
  return;
6469
6448
  }
6470
6449
  }
@@ -6543,9 +6522,7 @@ ${reflection}
6543
6522
  log.debug(`addEntityRelationship: entity file ${name}.md not found`);
6544
6523
  return;
6545
6524
  }
6546
- const exists = entity.relationships.some(
6547
- (r) => r.target === rel.target && r.label === rel.label
6548
- );
6525
+ const exists = entity.relationships.some((r) => r.target === rel.target && r.label === rel.label);
6549
6526
  if (exists) return;
6550
6527
  entity.relationships.push(rel);
6551
6528
  entity.updated = (/* @__PURE__ */ new Date()).toISOString();
@@ -6598,11 +6575,7 @@ ${reflection}
6598
6575
  this.invalidateKnowledgeIndexCache();
6599
6576
  }
6600
6577
  async updateEntitySynthesis(name, synthesis, options = {}) {
6601
- return this.entityStore.updateEntitySynthesis(
6602
- name,
6603
- synthesis,
6604
- options
6605
- );
6578
+ return this.entityStore.updateEntitySynthesis(name, synthesis, options);
6606
6579
  }
6607
6580
  /**
6608
6581
  * Backward-compatible alias for legacy callers/tests.
@@ -6737,10 +6710,7 @@ ${reflection}
6737
6710
  return recency * 0.4 + frequency * 0.25 + activityScore * 0.15 + typePriority * 0.1 + relDensity * 0.1;
6738
6711
  }
6739
6712
  async buildKnowledgeIndex(config, overrides) {
6740
- return this.entityStore.buildKnowledgeIndex(
6741
- config,
6742
- overrides
6743
- );
6713
+ return this.entityStore.buildKnowledgeIndex(config, overrides);
6744
6714
  }
6745
6715
  /** Invalidate the Knowledge Index cache (call after entity mutations). */
6746
6716
  invalidateKnowledgeIndexCache() {
@@ -6760,9 +6730,7 @@ ${reflection}
6760
6730
  const deleted = [];
6761
6731
  for (const m of memories) {
6762
6732
  if (m.frontmatter.category !== "commitment") continue;
6763
- const isResolved = m.frontmatter.tags.some(
6764
- (t) => t === "fulfilled" || t === "expired"
6765
- );
6733
+ const isResolved = m.frontmatter.tags.some((t) => t === "fulfilled" || t === "expired");
6766
6734
  if (!isResolved) continue;
6767
6735
  const updatedAt = new Date(m.frontmatter.updated).getTime();
6768
6736
  if (updatedAt < cutoff) {
@@ -6938,7 +6906,8 @@ ${memory.content}
6938
6906
  ...options.blockedBy ? { blockedBy: options.blockedBy } : {},
6939
6907
  ...options.faithfulness ? { faithfulness: options.faithfulness } : {},
6940
6908
  ...options.sources ? { sources: options.sources } : {},
6941
- ...options.provenance ? { provenance: options.provenance } : {}
6909
+ ...options.provenance ? { provenance: options.provenance } : {},
6910
+ ...options.sourceConnector ? { sourceConnector: options.sourceConnector } : {}
6942
6911
  };
6943
6912
  const sanitized = sanitizeMemoryContent(content);
6944
6913
  if (!sanitized.clean) {
@@ -7007,7 +6976,12 @@ ${oldMemory.content}
7007
6976
  entityRef: oldMemory.frontmatter.entityRef,
7008
6977
  structuredAttributes: oldMemory.frontmatter.structuredAttributes
7009
6978
  },
7010
- { reason: "contradiction_resolution", createdBy: "contradiction_resolution", createdAt: now, supersessionKeysForFact }
6979
+ {
6980
+ reason: "contradiction_resolution",
6981
+ createdBy: "contradiction_resolution",
6982
+ createdAt: now,
6983
+ supersessionKeysForFact
6984
+ }
7011
6985
  )) {
7012
6986
  await this.appendTombstone(input);
7013
6987
  }
@@ -7113,7 +7087,10 @@ ${memory.content}
7113
7087
  async saveTopics(topics) {
7114
7088
  const metaPath = path5.join(this.stateDir, "topics.json");
7115
7089
  await mkdir(this.stateDir, { recursive: true });
7116
- await this.writeStorageSecureFile(metaPath, JSON.stringify({ topics, updatedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2));
7090
+ await this.writeStorageSecureFile(
7091
+ metaPath,
7092
+ JSON.stringify({ topics, updatedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2)
7093
+ );
7117
7094
  log.debug(`saved ${topics.length} topic scores`);
7118
7095
  }
7119
7096
  /**
@@ -7230,4 +7207,4 @@ export {
7230
7207
  isValidBufferSurpriseEvent,
7231
7208
  StorageManager3 as StorageManager
7232
7209
  };
7233
- //# sourceMappingURL=chunk-SVOHGUMI.js.map
7210
+ //# sourceMappingURL=chunk-H4FHR4UM.js.map