@remnic/core 9.65.6 → 9.65.8

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 (623) hide show
  1. package/dist/access-admin-ops-surface.d.ts +15 -13
  2. package/dist/access-admin-ops-surface.js +54 -54
  3. package/dist/access-audit.js +2 -2
  4. package/dist/access-authorization-probe.d.ts +15 -13
  5. package/dist/access-authorization-probe.js +55 -55
  6. package/dist/access-boundary.d.ts +15 -13
  7. package/dist/access-boundary.js +54 -54
  8. package/dist/access-cli.js +156 -148
  9. package/dist/access-cli.js.map +1 -1
  10. package/dist/access-coding-context-resolution.d.ts +2 -1
  11. package/dist/access-extraction-force-flush.d.ts +15 -13
  12. package/dist/access-extraction-force-flush.js +54 -54
  13. package/dist/access-health-types.d.ts +2 -1
  14. package/dist/access-http-lcm-compaction.d.ts +15 -13
  15. package/dist/access-http-lifecycle-flush.d.ts +15 -13
  16. package/dist/access-http-offline-stream.d.ts +15 -13
  17. package/dist/access-http-query.d.ts +3 -2
  18. package/dist/access-http-query.js +56 -56
  19. package/dist/access-http.d.ts +17 -20
  20. package/dist/access-http.js +75 -73
  21. package/dist/access-identity-continuity-surface.d.ts +13 -11
  22. package/dist/access-identity-continuity-surface.js +54 -54
  23. package/dist/access-lcm-surface.d.ts +15 -13
  24. package/dist/access-lcm-surface.js +54 -54
  25. package/dist/access-mcp-output-schemas.js +1 -1
  26. package/dist/access-mcp.d.ts +15 -13
  27. package/dist/access-mcp.js +66 -64
  28. package/dist/access-memory-search-fanout.d.ts +3 -2
  29. package/dist/{access-namespace-preflight-D_6mo8ms.d.ts → access-namespace-preflight-CpAOrS-9.d.ts} +1 -1
  30. package/dist/access-namespace-preflight.d.ts +4 -3
  31. package/dist/access-namespace-preflight.js +54 -54
  32. package/dist/access-observe-write-surface.d.ts +15 -13
  33. package/dist/access-observe-write-surface.js +54 -54
  34. package/dist/access-offline-manifest.d.ts +13 -11
  35. package/dist/access-offline-manifest.js +6 -6
  36. package/dist/access-operations-batch.js +58 -58
  37. package/dist/access-operations.d.ts +21 -19
  38. package/dist/access-operations.js +63 -61
  39. package/dist/access-recall-concurrency.d.ts +15 -13
  40. package/dist/access-recall-concurrency.js +54 -54
  41. package/dist/access-recall-response.d.ts +15 -13
  42. package/dist/access-recall-response.js +54 -54
  43. package/dist/access-recall-surface.d.ts +15 -13
  44. package/dist/access-recall-surface.js +54 -54
  45. package/dist/access-schema.d.ts +83 -83
  46. package/dist/access-schema.js +3 -3
  47. package/dist/{access-service-sbiNS5UB.d.ts → access-service-Diu61Cfv.d.ts} +72 -72
  48. package/dist/access-service-helpers.d.ts +15 -13
  49. package/dist/access-service.d.ts +15 -13
  50. package/dist/access-service.js +54 -54
  51. package/dist/access-surface-catalog.d.ts +15 -13
  52. package/dist/access-surface-catalog.js +66 -56
  53. package/dist/access-surface-catalog.js.map +1 -1
  54. package/dist/access-wearables-meetings-surface.d.ts +6 -3
  55. package/dist/action-confidence.d.ts +2 -1
  56. package/dist/active-context-config.d.ts +27 -0
  57. package/dist/active-context-config.js +14 -0
  58. package/dist/active-context-transform.d.ts +267 -0
  59. package/dist/active-context-transform.js +31 -0
  60. package/dist/active-memory-bridge.d.ts +2 -1
  61. package/dist/active-recall.d.ts +2 -1
  62. package/dist/active-recall.js +13 -12
  63. package/dist/active-recall.js.map +1 -1
  64. package/dist/adapters/index.js +4 -4
  65. package/dist/adapters/registry.js +2 -2
  66. package/dist/ambient-provenance.d.ts +2 -1
  67. package/dist/artifact-search.d.ts +2 -1
  68. package/dist/{auto-sync-XVMLL2RH.js → auto-sync-2YPITIWN.js} +6 -6
  69. package/dist/behavior-learner.d.ts +2 -1
  70. package/dist/behavior-signals.d.ts +2 -1
  71. package/dist/bootstrap.d.ts +13 -11
  72. package/dist/briefing-window.d.ts +5 -2
  73. package/dist/briefing.d.ts +5 -2
  74. package/dist/briefing.js +25 -25
  75. package/dist/buffer-surprise-report.d.ts +2 -1
  76. package/dist/buffer-turn-helpers.d.ts +2 -1
  77. package/dist/buffer.d.ts +5 -2
  78. package/dist/buffer.js +6 -6
  79. package/dist/bulk-import/index.d.ts +4 -3
  80. package/dist/calibration.d.ts +2 -1
  81. package/dist/capabilities.d.ts +2 -1
  82. package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
  83. package/dist/{catalog-DO_7zfkv.d.ts → catalog-9f-vEQLS.d.ts} +1 -1
  84. package/dist/causal-behavior.d.ts +4 -3
  85. package/dist/causal-behavior.js +2 -2
  86. package/dist/causal-chain.js +2 -2
  87. package/dist/causal-consolidation.d.ts +2 -1
  88. package/dist/causal-consolidation.js +28 -28
  89. package/dist/causal-retrieval.js +2 -2
  90. package/dist/causal-trajectory-graph.d.ts +2 -1
  91. package/dist/causal-trajectory-graph.js +2 -2
  92. package/dist/causal-trajectory.js +1 -1
  93. package/dist/{chunk-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
  94. package/dist/{chunk-NZPFCP5A.js → chunk-2PSX5BJU.js} +2 -2
  95. package/dist/{chunk-RKNJBZ55.js → chunk-2QSZNTDO.js} +4 -4
  96. package/dist/{chunk-X2DWBWOX.js → chunk-3A2NJP2U.js} +2 -2
  97. package/dist/chunk-3BCULS4U.js +1093 -0
  98. package/dist/chunk-3BCULS4U.js.map +1 -0
  99. package/dist/{chunk-JGG5HVI2.js → chunk-3PKAS6VL.js} +2 -2
  100. package/dist/{chunk-LSYD7GHZ.js → chunk-3SZD4CYO.js} +3 -3
  101. package/dist/chunk-43HUVDTD.js +114 -0
  102. package/dist/chunk-43HUVDTD.js.map +1 -0
  103. package/dist/{chunk-5TG4MU2U.js → chunk-4F4AQFWL.js} +8 -8
  104. package/dist/{chunk-D35XLYQ7.js → chunk-4QEYREAV.js} +12 -12
  105. package/dist/{chunk-46WM6JX2.js → chunk-4ZWCQJNM.js} +5 -5
  106. package/dist/{chunk-DVYRD4HY.js → chunk-5ACCD4L7.js} +30 -1
  107. package/dist/chunk-5ACCD4L7.js.map +1 -0
  108. package/dist/{chunk-W6J4POB6.js → chunk-5DHKCO52.js} +2 -2
  109. package/dist/{chunk-IRXMJLTW.js → chunk-5HK3CJAR.js} +2 -2
  110. package/dist/{chunk-NLUCDKLT.js → chunk-5RWZH6PH.js} +2 -2
  111. package/dist/{chunk-H7BZBSP6.js → chunk-645WOU5I.js} +4 -4
  112. package/dist/{chunk-AYAZWXJI.js → chunk-76DIF5KT.js} +2 -2
  113. package/dist/{chunk-OPPBTPUU.js → chunk-7KQB4EBS.js} +4 -4
  114. package/dist/{chunk-I2HTKOOP.js → chunk-7VZFRUQU.js} +3 -3
  115. package/dist/{chunk-DPNXADEI.js → chunk-7WOWGRAU.js} +11 -7
  116. package/dist/chunk-7WOWGRAU.js.map +1 -0
  117. package/dist/{chunk-JCWY73FK.js → chunk-AHPIFKNG.js} +2 -2
  118. package/dist/{chunk-FC7TIRFS.js → chunk-AX7UXCHJ.js} +6 -1
  119. package/dist/chunk-AX7UXCHJ.js.map +1 -0
  120. package/dist/{chunk-3I22VWB3.js → chunk-AZMLH5UT.js} +2 -2
  121. package/dist/chunk-B32WYRXX.js +77 -0
  122. package/dist/chunk-B32WYRXX.js.map +1 -0
  123. package/dist/{chunk-JOEJG4SD.js → chunk-BEC4YBNA.js} +4 -4
  124. package/dist/chunk-BWGCOLEL.js +61 -0
  125. package/dist/chunk-BWGCOLEL.js.map +1 -0
  126. package/dist/{chunk-BXXOPKT5.js → chunk-CAMNRAJF.js} +2 -2
  127. package/dist/{chunk-C24UZSFW.js → chunk-CEH2AFXG.js} +6 -6
  128. package/dist/{chunk-YOXVZJFM.js → chunk-CFVTRUR3.js} +2 -2
  129. package/dist/{chunk-SVSRPG6M.js → chunk-CPA5NBHN.js} +2 -2
  130. package/dist/{chunk-7BEPVIH3.js → chunk-CRML27CO.js} +3 -3
  131. package/dist/{chunk-AXGFOFNY.js → chunk-DA7ITC5Z.js} +2 -2
  132. package/dist/{chunk-5W7MKXMU.js → chunk-DEACDKE3.js} +144 -78
  133. package/dist/chunk-DEACDKE3.js.map +1 -0
  134. package/dist/{chunk-FEO2CDXR.js → chunk-DPCXDG7G.js} +2 -2
  135. package/dist/{chunk-HZNYJN77.js → chunk-F3NVYTTA.js} +2 -2
  136. package/dist/{chunk-7SSRXEZJ.js → chunk-F7XUD3PL.js} +2 -2
  137. package/dist/{chunk-LDBFXD4F.js → chunk-FP7YTTVO.js} +3 -1
  138. package/dist/chunk-FP7YTTVO.js.map +1 -0
  139. package/dist/{chunk-XZBXINXZ.js → chunk-GIC6BASP.js} +4 -4
  140. package/dist/{chunk-PP7R754B.js → chunk-GPFZFCRN.js} +1 -1
  141. package/dist/{chunk-53MZQEBD.js → chunk-GTO56JY5.js} +2 -2
  142. package/dist/{chunk-RAIUTAZZ.js → chunk-H2YSH3DG.js} +2 -2
  143. package/dist/{chunk-HWVNYNIV.js → chunk-HMZKGHMD.js} +2 -2
  144. package/dist/{chunk-ZXUZ54Z5.js → chunk-HRHO3ZNG.js} +2 -2
  145. package/dist/{chunk-SDEPLF7V.js → chunk-IBJ6U753.js} +2 -2
  146. package/dist/chunk-JCCWJHOP.js +240 -0
  147. package/dist/chunk-JCCWJHOP.js.map +1 -0
  148. package/dist/{chunk-T3JQTCCO.js → chunk-JI7U6AS3.js} +4 -4
  149. package/dist/{chunk-TR7DGXGI.js → chunk-JOZUBF4A.js} +5 -5
  150. package/dist/{chunk-YWBOOBDP.js → chunk-JYSN42VN.js} +71 -71
  151. package/dist/{chunk-ZPUIRTIZ.js → chunk-KOLJJN5G.js} +12 -75
  152. package/dist/chunk-KOLJJN5G.js.map +1 -0
  153. package/dist/{chunk-5W7CTZ2E.js → chunk-KQAFEZQX.js} +4 -4
  154. package/dist/{chunk-D2YNNDML.js → chunk-KWIGDKM2.js} +2 -2
  155. package/dist/{chunk-YUTTMSC7.js → chunk-KZIF6XHX.js} +93 -30
  156. package/dist/chunk-KZIF6XHX.js.map +1 -0
  157. package/dist/chunk-LB7WCZHY.js +553 -0
  158. package/dist/chunk-LB7WCZHY.js.map +1 -0
  159. package/dist/{chunk-RIAM7DND.js → chunk-LDKPDODJ.js} +2 -2
  160. package/dist/{chunk-227UFSEQ.js → chunk-LEPOP46W.js} +4 -4
  161. package/dist/{chunk-2JHRCWHT.js → chunk-LKYIOCWL.js} +107 -107
  162. package/dist/{chunk-XAWIL7TC.js → chunk-LOXHYCVS.js} +2 -2
  163. package/dist/{chunk-OMZLBT4B.js → chunk-LPNCR4QK.js} +48 -27
  164. package/dist/chunk-LPNCR4QK.js.map +1 -0
  165. package/dist/{chunk-OLBZ2WGG.js → chunk-LTBKKSCX.js} +2 -2
  166. package/dist/{chunk-O4BAGJDN.js → chunk-MDD2RINF.js} +2 -2
  167. package/dist/{chunk-H63EDPFJ.js → chunk-MI2OTWV5.js} +15 -2
  168. package/dist/{chunk-H63EDPFJ.js.map → chunk-MI2OTWV5.js.map} +1 -1
  169. package/dist/{chunk-LBFFNDFM.js → chunk-MINHJ55X.js} +1 -1
  170. package/dist/chunk-MINHJ55X.js.map +1 -0
  171. package/dist/{chunk-ROEAEANL.js → chunk-MY2BC6UE.js} +15 -15
  172. package/dist/{chunk-RACZB5HT.js → chunk-N37X5RU7.js} +4 -4
  173. package/dist/{chunk-AG46P24C.js → chunk-NNBZS3DY.js} +4 -4
  174. package/dist/{chunk-PGW64IFQ.js → chunk-NPFUNWNX.js} +2 -2
  175. package/dist/{chunk-MFOSZUIT.js → chunk-NPIBN2VL.js} +2 -2
  176. package/dist/{chunk-IF4EY26E.js → chunk-OA2O2GJ4.js} +3 -3
  177. package/dist/{chunk-6FUMA6AA.js → chunk-ODU2CNNX.js} +2 -2
  178. package/dist/{chunk-PNAGNVGK.js → chunk-OXRRJXPR.js} +42 -37
  179. package/dist/chunk-OXRRJXPR.js.map +1 -0
  180. package/dist/{chunk-TWBQQ3FT.js → chunk-P36Z4JRA.js} +2 -2
  181. package/dist/{chunk-OUKBMQ2O.js → chunk-PD66CVSD.js} +2 -2
  182. package/dist/{chunk-MVIYRRVJ.js → chunk-PMVPCZJZ.js} +5 -5
  183. package/dist/{chunk-US4IRASK.js → chunk-PU56CXZA.js} +6 -6
  184. package/dist/{chunk-IDQ6DKXC.js → chunk-S5XOSTYM.js} +3 -3
  185. package/dist/{chunk-DYO24BNB.js → chunk-SEEJOGQX.js} +5 -5
  186. package/dist/{chunk-7OZSHBWK.js → chunk-SNOIKAHM.js} +2 -2
  187. package/dist/{chunk-SR7JIRAR.js → chunk-T6ILXUAH.js} +2 -2
  188. package/dist/{chunk-2RXUZVPU.js → chunk-T7XP6IZE.js} +2 -2
  189. package/dist/{chunk-KBOG7FJV.js → chunk-TFR3HG4K.js} +3 -3
  190. package/dist/{chunk-XUZ5CIEE.js → chunk-TUHBYJXL.js} +1 -1
  191. package/dist/{chunk-7K5Q6COX.js → chunk-TVVEYCNW.js} +4 -4
  192. package/dist/{chunk-ZK4BFABK.js → chunk-U7EW2W4W.js} +13 -13
  193. package/dist/{chunk-4K7IW3F7.js → chunk-UD7UNYRD.js} +34 -3
  194. package/dist/chunk-UD7UNYRD.js.map +1 -0
  195. package/dist/{chunk-VFYRYFLL.js → chunk-UEBDCMOO.js} +2 -2
  196. package/dist/{chunk-JFWZRUKP.js → chunk-UENKPWCS.js} +4 -4
  197. package/dist/{chunk-AAXJNINV.js → chunk-UL4MKZHI.js} +2 -2
  198. package/dist/chunk-ULM7JCDH.js +154 -0
  199. package/dist/chunk-ULM7JCDH.js.map +1 -0
  200. package/dist/{chunk-R2MZCYA6.js → chunk-UNUMFURP.js} +3 -3
  201. package/dist/{chunk-5GIZM4RX.js → chunk-UPFNQJC7.js} +2 -2
  202. package/dist/{chunk-W4BMEGQA.js → chunk-UTQUEHC7.js} +2 -2
  203. package/dist/{chunk-I32NKXE2.js → chunk-V4IDF3EZ.js} +2 -2
  204. package/dist/{chunk-6LS5OX3U.js → chunk-W2BAGGEW.js} +50 -18
  205. package/dist/chunk-W2BAGGEW.js.map +1 -0
  206. package/dist/chunk-W2UOAATB.js +521 -0
  207. package/dist/chunk-W2UOAATB.js.map +1 -0
  208. package/dist/{chunk-QMZY3GG6.js → chunk-WNXYT4MK.js} +3 -3
  209. package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
  210. package/dist/{chunk-T42L3S6A.js → chunk-XBGHAAKR.js} +2 -2
  211. package/dist/{chunk-RQ2EQRRR.js → chunk-XNWXSGHS.js} +80 -7
  212. package/dist/chunk-XNWXSGHS.js.map +1 -0
  213. package/dist/{chunk-THG4GYIE.js → chunk-YEUXERJ6.js} +5 -5
  214. package/dist/{chunk-BIJAWZYW.js → chunk-YMOPYG3K.js} +6 -6
  215. package/dist/{chunk-M4AHBM72.js → chunk-Z3YEGSR4.js} +2 -2
  216. package/dist/{cli-Bfgo0n1L.d.ts → cli-O3F-ht3i.d.ts} +5 -5
  217. package/dist/cli.d.ts +17 -15
  218. package/dist/cli.js +106 -104
  219. package/dist/coding/pre-action-gate.d.ts +2 -1
  220. package/dist/coding/pre-action-gate.js +2 -2
  221. package/dist/compounding/engine.d.ts +5 -2
  222. package/dist/compounding/engine.js +26 -26
  223. package/dist/compounding/preference-consolidator.d.ts +4 -3
  224. package/dist/compression-optimizer.d.ts +2 -1
  225. package/dist/config-security.js +2 -2
  226. package/dist/config.d.ts +2 -1
  227. package/dist/config.js +13 -12
  228. package/dist/connectors/codex-materialize-runner.d.ts +2 -1
  229. package/dist/connectors/codex-materialize-runner.js +25 -25
  230. package/dist/connectors/codex-materialize.d.ts +2 -1
  231. package/dist/connectors/index.d.ts +2 -1
  232. package/dist/connectors/index.js +25 -25
  233. package/dist/consolidation-provenance-check.d.ts +5 -2
  234. package/dist/consolidation-provenance-check.js +2 -2
  235. package/dist/consolidation-undo.d.ts +5 -2
  236. package/dist/context-summary.d.ts +43 -0
  237. package/dist/context-summary.js +14 -0
  238. package/dist/context-summary.js.map +1 -0
  239. package/dist/contradiction/index.d.ts +6 -3
  240. package/dist/contradiction/index.js +5 -5
  241. package/dist/converge-config.d.ts +2 -1
  242. package/dist/convergence-refresh.d.ts +5 -2
  243. package/dist/convergence-refresh.js +28 -28
  244. package/dist/conversation-index/backend.d.ts +2 -1
  245. package/dist/conversation-index/backend.js +2 -2
  246. package/dist/conversation-index/chunker.d.ts +2 -1
  247. package/dist/conversation-index/faiss-adapter.d.ts +2 -1
  248. package/dist/conversation-index/indexer.d.ts +2 -1
  249. package/dist/conversation-index/search.d.ts +2 -1
  250. package/dist/corpus-watermark.d.ts +2 -1
  251. package/dist/corpus-watermark.js +27 -27
  252. package/dist/cross-lingual-recall.d.ts +2 -1
  253. package/dist/day-summary.d.ts +2 -1
  254. package/dist/delinearize.d.ts +2 -1
  255. package/dist/dependency-propagation-config.d.ts +2 -1
  256. package/dist/{dependency-propagation-delivery-D23_x-s5.d.ts → dependency-propagation-delivery-CL6RWXTA.d.ts} +1 -1
  257. package/dist/direct-answer-wiring.d.ts +2 -1
  258. package/dist/direct-answer.d.ts +2 -1
  259. package/dist/embedding-fallback.d.ts +2 -1
  260. package/dist/enrichment/index.d.ts +2 -1
  261. package/dist/entity-origin-fields.d.ts +2 -1
  262. package/dist/entity-retrieval.d.ts +5 -2
  263. package/dist/entity-retrieval.js +26 -26
  264. package/dist/entity-schema.d.ts +2 -1
  265. package/dist/episodic-context.d.ts +2 -1
  266. package/dist/eval-trajectory-contracts.d.ts +257 -0
  267. package/dist/eval-trajectory-contracts.js +56 -0
  268. package/dist/eval-trajectory-contracts.js.map +1 -0
  269. package/dist/eval-trajectory-store.d.ts +40 -0
  270. package/dist/eval-trajectory-store.js +19 -0
  271. package/dist/eval-trajectory-store.js.map +1 -0
  272. package/dist/eval-trajectory.d.ts +68 -0
  273. package/dist/eval-trajectory.js +46 -0
  274. package/dist/eval-trajectory.js.map +1 -0
  275. package/dist/event-order-recall.js +2 -2
  276. package/dist/explicit-capture.d.ts +13 -11
  277. package/dist/explicit-capture.js +6 -6
  278. package/dist/external-wiki-access.d.ts +15 -13
  279. package/dist/external-wiki-access.js +55 -55
  280. package/dist/external-wiki-collection-registration.d.ts +2 -1
  281. package/dist/external-wiki-collection.d.ts +2 -1
  282. package/dist/external-wiki-mcp-tools.d.ts +15 -13
  283. package/dist/extraction-error-classification.d.ts +2 -1
  284. package/dist/extraction-faithfulness.d.ts +2 -1
  285. package/dist/extraction-judge-telemetry.d.ts +2 -1
  286. package/dist/extraction-judge-training.d.ts +2 -1
  287. package/dist/extraction-judge.d.ts +2 -1
  288. package/dist/extraction-liveness.d.ts +2 -1
  289. package/dist/extraction-normalization.d.ts +2 -1
  290. package/dist/extraction-prompt.d.ts +2 -1
  291. package/dist/extraction-source-grounding-rules.d.ts +2 -1
  292. package/dist/extraction-source-grounding.d.ts +2 -1
  293. package/dist/extraction.d.ts +2 -1
  294. package/dist/extraction.js +33 -33
  295. package/dist/fallback-llm.d.ts +2 -1
  296. package/dist/{forget-SZ2BXDGF.js → forget-2AE4MDK3.js} +3 -3
  297. package/dist/graph-dashboard-diff.d.ts +2 -1
  298. package/dist/graph-dashboard-key.d.ts +2 -1
  299. package/dist/graph-dashboard-parser.d.ts +2 -1
  300. package/dist/{graph-edge-decay-FXGELBFA.js → graph-edge-decay-A4SDFMMS.js} +4 -4
  301. package/dist/graph-edge-decay-A4SDFMMS.js.map +1 -0
  302. package/dist/graph-edge-reinforcement.d.ts +2 -1
  303. package/dist/graph-path-reconstruction.d.ts +2 -1
  304. package/dist/graph-path-scoring.d.ts +2 -1
  305. package/dist/graph-snapshot.d.ts +2 -1
  306. package/dist/graph-snapshot.js +3 -3
  307. package/dist/graph.d.ts +2 -1
  308. package/dist/graph.js +3 -3
  309. package/dist/harmonic-retrieval.js +1 -1
  310. package/dist/importance.d.ts +2 -1
  311. package/dist/importers/index.d.ts +2 -1
  312. package/dist/in-flight-reads.d.ts +2 -1
  313. package/dist/{index--QhGIXF2.d.ts → index-C7Xep6S9.d.ts} +2 -2
  314. package/dist/index.d.ts +706 -701
  315. package/dist/index.js +271 -200
  316. package/dist/intent.d.ts +2 -1
  317. package/dist/lcm/engine.d.ts +3 -2
  318. package/dist/lcm/engine.js +3 -2
  319. package/dist/lcm/index.d.ts +4 -2
  320. package/dist/lcm/index.js +6 -5
  321. package/dist/lcm/summarizer.d.ts +4 -6
  322. package/dist/lcm/summarizer.js +2 -1
  323. package/dist/lcm/tools.d.ts +4 -3
  324. package/dist/lifecycle.d.ts +2 -1
  325. package/dist/live-connectors-runner.d.ts +2 -1
  326. package/dist/local-llm.d.ts +2 -1
  327. package/dist/local-model-endpoint.d.ts +2 -1
  328. package/dist/location/index.d.ts +128 -1
  329. package/dist/location/index.js +60 -750
  330. package/dist/location/index.js.map +1 -1
  331. package/dist/maintenance/memory-governance.d.ts +2 -1
  332. package/dist/maintenance/memory-governance.js +26 -26
  333. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +5 -2
  334. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +25 -25
  335. package/dist/maintenance/rebuild-memory-projection.d.ts +5 -2
  336. package/dist/maintenance/rebuild-memory-projection.js +27 -27
  337. package/dist/{maintenance-PFvY1Pw_.d.ts → maintenance-CJ-xqFp0.d.ts} +4 -3
  338. package/dist/mcp-memory-inspector-app.d.ts +15 -13
  339. package/dist/mcp-read-only-tools.js +1 -1
  340. package/dist/memory-action-policy.d.ts +18 -2
  341. package/dist/memory-action-policy.js +3 -1
  342. package/dist/memory-cache.d.ts +2 -1
  343. package/dist/memory-controller.d.ts +2 -1
  344. package/dist/memory-controller.js +2 -2
  345. package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
  346. package/dist/memory-projection-store.d.ts +2 -1
  347. package/dist/memory-provenance.d.ts +2 -1
  348. package/dist/memory-snapshot.d.ts +2 -1
  349. package/dist/memory-subject-cli.d.ts +15 -13
  350. package/dist/memory-subject.d.ts +15 -13
  351. package/dist/memory-subject.js +3 -3
  352. package/dist/memory-worth-outcomes.d.ts +50 -3
  353. package/dist/memory-worth-outcomes.js +5 -3
  354. package/dist/models-json.d.ts +2 -1
  355. package/dist/namespaces/migrate.d.ts +6 -3
  356. package/dist/namespaces/migrate.js +26 -26
  357. package/dist/namespaces/principal.d.ts +2 -1
  358. package/dist/namespaces/search.d.ts +2 -1
  359. package/dist/namespaces/search.js +11 -11
  360. package/dist/namespaces/storage.d.ts +6 -3
  361. package/dist/namespaces/storage.js +25 -25
  362. package/dist/native-knowledge.d.ts +2 -1
  363. package/dist/offline-sync-impression-drain.d.ts +2 -1
  364. package/dist/offline-sync-impression-drain.js +2 -2
  365. package/dist/operator-doctor-corpus.d.ts +2 -1
  366. package/dist/operator-doctor-corpus.js +28 -28
  367. package/dist/operator-doctor-replica.d.ts +2 -1
  368. package/dist/operator-toolkit.d.ts +6 -3
  369. package/dist/operator-toolkit.js +45 -44
  370. package/dist/orchestration/compression-guideline-coordinator.d.ts +5 -2
  371. package/dist/orchestration/maintenance.d.ts +7 -4
  372. package/dist/orchestration/maintenance.js +34 -32
  373. package/dist/{orchestrator-4wzJrPVm.d.ts → orchestrator-BsntWxLy.d.ts} +8 -8
  374. package/dist/orchestrator.d.ts +13 -11
  375. package/dist/orchestrator.js +156 -148
  376. package/dist/patterns-cli.d.ts +2 -1
  377. package/dist/{pipeline-CgXgdIrF.d.ts → pipeline-CVoysPm2.d.ts} +1 -1
  378. package/dist/policy-runtime.d.ts +2 -1
  379. package/dist/proactive-contention.d.ts +2 -1
  380. package/dist/provenance.d.ts +2 -1
  381. package/dist/{public-http-BP3VQDl5.d.ts → public-http-CuOxlTC2.d.ts} +1 -1
  382. package/dist/{qmd-BppGGxsi.d.ts → qmd-DWMAGA5l.d.ts} +1 -1
  383. package/dist/qmd-preflight.d.ts +3 -2
  384. package/dist/qmd-recall-cache.d.ts +2 -1
  385. package/dist/qmd.d.ts +3 -2
  386. package/dist/qmd.js +4 -4
  387. package/dist/recall-concurrency-config.d.ts +2 -1
  388. package/dist/recall-disclosure-escalation.d.ts +2 -1
  389. package/dist/recall-explain-renderer.d.ts +2 -1
  390. package/dist/recall-explain-renderer.js +3 -3
  391. package/dist/recall-memory-map.d.ts +2 -1
  392. package/dist/recall-planner-llm.d.ts +2 -1
  393. package/dist/recall-state.d.ts +2 -1
  394. package/dist/recall-tag-filter.d.ts +2 -1
  395. package/dist/recall-timings.d.ts +2 -1
  396. package/dist/recall-xray-cli.d.ts +2 -1
  397. package/dist/recall-xray-cli.js +4 -4
  398. package/dist/recall-xray-renderer.d.ts +2 -1
  399. package/dist/recall-xray-renderer.js +3 -3
  400. package/dist/recall-xray.d.ts +2 -1
  401. package/dist/recall-xray.js +2 -2
  402. package/dist/reconcile/cursor.d.ts +2 -1
  403. package/dist/reconcile/manifest.d.ts +2 -1
  404. package/dist/reconcile/manifest.js +3 -3
  405. package/dist/reconcile/plan.d.ts +2 -1
  406. package/dist/replay/normalizers/chatgpt.d.ts +2 -1
  407. package/dist/replay/normalizers/claude.d.ts +2 -1
  408. package/dist/replay/normalizers/openclaw.d.ts +2 -1
  409. package/dist/replay/normalizers/shared.d.ts +2 -1
  410. package/dist/replay/runner.d.ts +2 -1
  411. package/dist/replay/types.d.ts +2 -1
  412. package/dist/replica-divergence.d.ts +2 -1
  413. package/dist/replica-peers-config.d.ts +2 -1
  414. package/dist/{resolution-4552BNRV.js → resolution-XWBPKYFB.js} +6 -6
  415. package/dist/resolution-XWBPKYFB.js.map +1 -0
  416. package/dist/resolve-auth-token.d.ts +2 -1
  417. package/dist/resume-bundles.js +14 -13
  418. package/dist/retrieval-agents.d.ts +3 -2
  419. package/dist/retrieval-tiers.d.ts +2 -1
  420. package/dist/routing/engine.d.ts +2 -1
  421. package/dist/routing/store.d.ts +2 -1
  422. package/dist/salvage-envelope.d.ts +2 -1
  423. package/dist/salvage-envelope.js +5 -5
  424. package/dist/schemas.d.ts +124 -124
  425. package/dist/{scope-profiles-ChZUtxDU.d.ts → scope-profiles-CPWkW_dI.d.ts} +1 -1
  426. package/dist/search/embed-helper.d.ts +2 -1
  427. package/dist/search/factory.d.ts +2 -1
  428. package/dist/search/factory.js +10 -10
  429. package/dist/search/index.d.ts +2 -1
  430. package/dist/search/index.js +15 -15
  431. package/dist/search/lancedb-backend.d.ts +2 -1
  432. package/dist/search/lancedb-backend.js +2 -2
  433. package/dist/search/meilisearch-backend.d.ts +2 -1
  434. package/dist/search/meilisearch-backend.js +2 -2
  435. package/dist/search/noop-backend.d.ts +2 -1
  436. package/dist/search/orama-backend.d.ts +2 -1
  437. package/dist/search/orama-backend.js +2 -2
  438. package/dist/search/port.d.ts +2 -1
  439. package/dist/search/remote-backend.d.ts +2 -1
  440. package/dist/{semantic-consolidation-mSPwQSmF.d.ts → semantic-consolidation-CNFVBXFc.d.ts} +1 -1
  441. package/dist/semantic-consolidation.d.ts +3 -2
  442. package/dist/semantic-consolidation.js +31 -31
  443. package/dist/semantic-rule-promotion.js +25 -25
  444. package/dist/semantic-rule-verifier.d.ts +2 -1
  445. package/dist/semantic-rule-verifier.js +25 -25
  446. package/dist/{service-BICWLwSP.d.ts → service-Bb-JIdQ0.d.ts} +2 -2
  447. package/dist/session-observer-bands.d.ts +2 -1
  448. package/dist/session-observer-state.d.ts +2 -1
  449. package/dist/shared-context/manager.d.ts +8 -7
  450. package/dist/signal.d.ts +2 -1
  451. package/dist/source-agent-qualifier.d.ts +2 -1
  452. package/dist/source-agent-qualifier.js +29 -29
  453. package/dist/{storage-B7urx1K3.d.ts → storage-CukrlNKk.d.ts} +4 -1
  454. package/dist/storage.d.ts +5 -2
  455. package/dist/storage.js +24 -24
  456. package/dist/subject-config.d.ts +2 -1
  457. package/dist/subject-config.js +4 -4
  458. package/dist/summarizer.d.ts +2 -1
  459. package/dist/summary-snapshot.d.ts +2 -1
  460. package/dist/support-passport/index.d.ts +18 -16
  461. package/dist/support-passport/index.js +57 -57
  462. package/dist/temporal-supersession.d.ts +3 -2
  463. package/dist/temporal-timeline-recall.d.ts +2 -1
  464. package/dist/temporal-validity.d.ts +2 -1
  465. package/dist/threading.d.ts +2 -1
  466. package/dist/tier-migration.d.ts +5 -2
  467. package/dist/tier-routing.d.ts +2 -1
  468. package/dist/topics.d.ts +2 -1
  469. package/dist/transcript.d.ts +2 -1
  470. package/dist/transfer/backup.js +2 -2
  471. package/dist/transfer/capsule-export.js +2 -2
  472. package/dist/transfer/capsule-import.js +2 -2
  473. package/dist/transfer/types.d.ts +78 -78
  474. package/dist/trust-score-stage.d.ts +2 -1
  475. package/dist/trust-score.d.ts +2 -1
  476. package/dist/{types-ETU5N6nB.d.ts → types-djxQlxJ7.d.ts} +3 -2
  477. package/dist/types.d.ts +2 -1
  478. package/dist/types.js +1 -1
  479. package/dist/utility-runtime.d.ts +2 -1
  480. package/dist/verified-recall.js +25 -25
  481. package/dist/who-knows-cli.d.ts +15 -13
  482. package/dist/who-knows-cli.js +26 -26
  483. package/dist/who-knows.d.ts +15 -13
  484. package/dist/who-knows.js +25 -25
  485. package/dist/write-envelope.d.ts +2 -1
  486. package/dist/write-envelope.js +4 -4
  487. package/package.json +22 -2
  488. package/src/access-boundary.ts +5 -0
  489. package/src/access-http.ts +15 -16
  490. package/src/access-mcp-output-schemas.ts +5 -0
  491. package/src/access-mcp.ts +6 -6
  492. package/src/access-operations.ts +2 -0
  493. package/src/access-surface-catalog.ts +10 -0
  494. package/src/active-context-config.ts +98 -0
  495. package/src/active-context-transform.test.ts +533 -0
  496. package/src/active-context-transform.ts +981 -0
  497. package/src/config.ts +3 -5
  498. package/src/context-summary.ts +182 -0
  499. package/src/eval-trajectory-contracts.ts +411 -0
  500. package/src/eval-trajectory-store.ts +306 -0
  501. package/src/eval-trajectory.test.ts +534 -0
  502. package/src/eval-trajectory.ts +773 -0
  503. package/src/index.ts +6 -11
  504. package/src/lcm/summarizer.ts +14 -93
  505. package/src/location/access-operations.ts +84 -0
  506. package/src/location/http-glue.test.ts +100 -0
  507. package/src/location/http-glue.ts +85 -0
  508. package/src/location/index.ts +3 -0
  509. package/src/location/mcp-tools.ts +82 -0
  510. package/src/location/provider-setup.test.ts +106 -0
  511. package/src/location/provider-setup.ts +103 -0
  512. package/src/location/scheduler.test.ts +113 -0
  513. package/src/location/scheduler.ts +98 -0
  514. package/src/location/surfaces.test.ts +241 -0
  515. package/src/location/surfaces.ts +329 -0
  516. package/src/maintenance/day-summary-cron.ts +45 -0
  517. package/src/mcp-read-only-tools.ts +2 -0
  518. package/src/memory-action-policy.ts +28 -0
  519. package/src/memory-worth-outcomes.test.ts +53 -18
  520. package/src/memory-worth-outcomes.ts +91 -9
  521. package/src/orchestration/maintenance.ts +22 -30
  522. package/src/storage/context-transform-ledger.ts +39 -0
  523. package/src/storage/secure-line-reader.ts +50 -1
  524. package/src/storage.ts +4 -1
  525. package/src/types.ts +2 -3
  526. package/src/wearables/http-glue.ts +28 -0
  527. package/dist/chunk-4K7IW3F7.js.map +0 -1
  528. package/dist/chunk-5W7MKXMU.js.map +0 -1
  529. package/dist/chunk-6LS5OX3U.js.map +0 -1
  530. package/dist/chunk-DPNXADEI.js.map +0 -1
  531. package/dist/chunk-DVYRD4HY.js.map +0 -1
  532. package/dist/chunk-FC7TIRFS.js.map +0 -1
  533. package/dist/chunk-LBFFNDFM.js.map +0 -1
  534. package/dist/chunk-LDBFXD4F.js.map +0 -1
  535. package/dist/chunk-OMZLBT4B.js.map +0 -1
  536. package/dist/chunk-PNAGNVGK.js.map +0 -1
  537. package/dist/chunk-RQ2EQRRR.js.map +0 -1
  538. package/dist/chunk-YUTTMSC7.js.map +0 -1
  539. package/dist/chunk-ZPUIRTIZ.js.map +0 -1
  540. /package/dist/{capsule-crypto-GWVG7LGC.js.map → active-context-config.js.map} +0 -0
  541. /package/dist/{graph-edge-decay-FXGELBFA.js.map → active-context-transform.js.map} +0 -0
  542. /package/dist/{auto-sync-XVMLL2RH.js.map → auto-sync-2YPITIWN.js.map} +0 -0
  543. /package/dist/{resolution-4552BNRV.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
  544. /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
  545. /package/dist/{chunk-NZPFCP5A.js.map → chunk-2PSX5BJU.js.map} +0 -0
  546. /package/dist/{chunk-RKNJBZ55.js.map → chunk-2QSZNTDO.js.map} +0 -0
  547. /package/dist/{chunk-X2DWBWOX.js.map → chunk-3A2NJP2U.js.map} +0 -0
  548. /package/dist/{chunk-JGG5HVI2.js.map → chunk-3PKAS6VL.js.map} +0 -0
  549. /package/dist/{chunk-LSYD7GHZ.js.map → chunk-3SZD4CYO.js.map} +0 -0
  550. /package/dist/{chunk-5TG4MU2U.js.map → chunk-4F4AQFWL.js.map} +0 -0
  551. /package/dist/{chunk-D35XLYQ7.js.map → chunk-4QEYREAV.js.map} +0 -0
  552. /package/dist/{chunk-46WM6JX2.js.map → chunk-4ZWCQJNM.js.map} +0 -0
  553. /package/dist/{chunk-W6J4POB6.js.map → chunk-5DHKCO52.js.map} +0 -0
  554. /package/dist/{chunk-IRXMJLTW.js.map → chunk-5HK3CJAR.js.map} +0 -0
  555. /package/dist/{chunk-NLUCDKLT.js.map → chunk-5RWZH6PH.js.map} +0 -0
  556. /package/dist/{chunk-H7BZBSP6.js.map → chunk-645WOU5I.js.map} +0 -0
  557. /package/dist/{chunk-AYAZWXJI.js.map → chunk-76DIF5KT.js.map} +0 -0
  558. /package/dist/{chunk-OPPBTPUU.js.map → chunk-7KQB4EBS.js.map} +0 -0
  559. /package/dist/{chunk-I2HTKOOP.js.map → chunk-7VZFRUQU.js.map} +0 -0
  560. /package/dist/{chunk-JCWY73FK.js.map → chunk-AHPIFKNG.js.map} +0 -0
  561. /package/dist/{chunk-3I22VWB3.js.map → chunk-AZMLH5UT.js.map} +0 -0
  562. /package/dist/{chunk-JOEJG4SD.js.map → chunk-BEC4YBNA.js.map} +0 -0
  563. /package/dist/{chunk-BXXOPKT5.js.map → chunk-CAMNRAJF.js.map} +0 -0
  564. /package/dist/{chunk-C24UZSFW.js.map → chunk-CEH2AFXG.js.map} +0 -0
  565. /package/dist/{chunk-YOXVZJFM.js.map → chunk-CFVTRUR3.js.map} +0 -0
  566. /package/dist/{chunk-SVSRPG6M.js.map → chunk-CPA5NBHN.js.map} +0 -0
  567. /package/dist/{chunk-7BEPVIH3.js.map → chunk-CRML27CO.js.map} +0 -0
  568. /package/dist/{chunk-AXGFOFNY.js.map → chunk-DA7ITC5Z.js.map} +0 -0
  569. /package/dist/{chunk-FEO2CDXR.js.map → chunk-DPCXDG7G.js.map} +0 -0
  570. /package/dist/{chunk-HZNYJN77.js.map → chunk-F3NVYTTA.js.map} +0 -0
  571. /package/dist/{chunk-7SSRXEZJ.js.map → chunk-F7XUD3PL.js.map} +0 -0
  572. /package/dist/{chunk-XZBXINXZ.js.map → chunk-GIC6BASP.js.map} +0 -0
  573. /package/dist/{chunk-PP7R754B.js.map → chunk-GPFZFCRN.js.map} +0 -0
  574. /package/dist/{chunk-53MZQEBD.js.map → chunk-GTO56JY5.js.map} +0 -0
  575. /package/dist/{chunk-RAIUTAZZ.js.map → chunk-H2YSH3DG.js.map} +0 -0
  576. /package/dist/{chunk-HWVNYNIV.js.map → chunk-HMZKGHMD.js.map} +0 -0
  577. /package/dist/{chunk-ZXUZ54Z5.js.map → chunk-HRHO3ZNG.js.map} +0 -0
  578. /package/dist/{chunk-SDEPLF7V.js.map → chunk-IBJ6U753.js.map} +0 -0
  579. /package/dist/{chunk-T3JQTCCO.js.map → chunk-JI7U6AS3.js.map} +0 -0
  580. /package/dist/{chunk-TR7DGXGI.js.map → chunk-JOZUBF4A.js.map} +0 -0
  581. /package/dist/{chunk-YWBOOBDP.js.map → chunk-JYSN42VN.js.map} +0 -0
  582. /package/dist/{chunk-5W7CTZ2E.js.map → chunk-KQAFEZQX.js.map} +0 -0
  583. /package/dist/{chunk-D2YNNDML.js.map → chunk-KWIGDKM2.js.map} +0 -0
  584. /package/dist/{chunk-RIAM7DND.js.map → chunk-LDKPDODJ.js.map} +0 -0
  585. /package/dist/{chunk-227UFSEQ.js.map → chunk-LEPOP46W.js.map} +0 -0
  586. /package/dist/{chunk-2JHRCWHT.js.map → chunk-LKYIOCWL.js.map} +0 -0
  587. /package/dist/{chunk-XAWIL7TC.js.map → chunk-LOXHYCVS.js.map} +0 -0
  588. /package/dist/{chunk-OLBZ2WGG.js.map → chunk-LTBKKSCX.js.map} +0 -0
  589. /package/dist/{chunk-O4BAGJDN.js.map → chunk-MDD2RINF.js.map} +0 -0
  590. /package/dist/{chunk-ROEAEANL.js.map → chunk-MY2BC6UE.js.map} +0 -0
  591. /package/dist/{chunk-RACZB5HT.js.map → chunk-N37X5RU7.js.map} +0 -0
  592. /package/dist/{chunk-AG46P24C.js.map → chunk-NNBZS3DY.js.map} +0 -0
  593. /package/dist/{chunk-PGW64IFQ.js.map → chunk-NPFUNWNX.js.map} +0 -0
  594. /package/dist/{chunk-MFOSZUIT.js.map → chunk-NPIBN2VL.js.map} +0 -0
  595. /package/dist/{chunk-IF4EY26E.js.map → chunk-OA2O2GJ4.js.map} +0 -0
  596. /package/dist/{chunk-6FUMA6AA.js.map → chunk-ODU2CNNX.js.map} +0 -0
  597. /package/dist/{chunk-TWBQQ3FT.js.map → chunk-P36Z4JRA.js.map} +0 -0
  598. /package/dist/{chunk-OUKBMQ2O.js.map → chunk-PD66CVSD.js.map} +0 -0
  599. /package/dist/{chunk-MVIYRRVJ.js.map → chunk-PMVPCZJZ.js.map} +0 -0
  600. /package/dist/{chunk-US4IRASK.js.map → chunk-PU56CXZA.js.map} +0 -0
  601. /package/dist/{chunk-IDQ6DKXC.js.map → chunk-S5XOSTYM.js.map} +0 -0
  602. /package/dist/{chunk-DYO24BNB.js.map → chunk-SEEJOGQX.js.map} +0 -0
  603. /package/dist/{chunk-7OZSHBWK.js.map → chunk-SNOIKAHM.js.map} +0 -0
  604. /package/dist/{chunk-SR7JIRAR.js.map → chunk-T6ILXUAH.js.map} +0 -0
  605. /package/dist/{chunk-2RXUZVPU.js.map → chunk-T7XP6IZE.js.map} +0 -0
  606. /package/dist/{chunk-KBOG7FJV.js.map → chunk-TFR3HG4K.js.map} +0 -0
  607. /package/dist/{chunk-XUZ5CIEE.js.map → chunk-TUHBYJXL.js.map} +0 -0
  608. /package/dist/{chunk-7K5Q6COX.js.map → chunk-TVVEYCNW.js.map} +0 -0
  609. /package/dist/{chunk-ZK4BFABK.js.map → chunk-U7EW2W4W.js.map} +0 -0
  610. /package/dist/{chunk-VFYRYFLL.js.map → chunk-UEBDCMOO.js.map} +0 -0
  611. /package/dist/{chunk-JFWZRUKP.js.map → chunk-UENKPWCS.js.map} +0 -0
  612. /package/dist/{chunk-AAXJNINV.js.map → chunk-UL4MKZHI.js.map} +0 -0
  613. /package/dist/{chunk-R2MZCYA6.js.map → chunk-UNUMFURP.js.map} +0 -0
  614. /package/dist/{chunk-5GIZM4RX.js.map → chunk-UPFNQJC7.js.map} +0 -0
  615. /package/dist/{chunk-W4BMEGQA.js.map → chunk-UTQUEHC7.js.map} +0 -0
  616. /package/dist/{chunk-I32NKXE2.js.map → chunk-V4IDF3EZ.js.map} +0 -0
  617. /package/dist/{chunk-QMZY3GG6.js.map → chunk-WNXYT4MK.js.map} +0 -0
  618. /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
  619. /package/dist/{chunk-T42L3S6A.js.map → chunk-XBGHAAKR.js.map} +0 -0
  620. /package/dist/{chunk-THG4GYIE.js.map → chunk-YEUXERJ6.js.map} +0 -0
  621. /package/dist/{chunk-BIJAWZYW.js.map → chunk-YMOPYG3K.js.map} +0 -0
  622. /package/dist/{chunk-M4AHBM72.js.map → chunk-Z3YEGSR4.js.map} +0 -0
  623. /package/dist/{forget-SZ2BXDGF.js.map → forget-2AE4MDK3.js.map} +0 -0
package/src/index.ts CHANGED
@@ -1,17 +1,10 @@
1
1
  /**
2
- * @remnic/core
3
- *
4
- * Framework-agnostic Remnic memory engine.
5
- *
6
- * Exports the orchestrator, config parsing, storage, search,
7
- * extraction, graph, trust zones, and access layer.
8
- *
9
- * This package has ZERO OpenClaw imports — it can be consumed by
10
- * any host adapter (CLI, HTTP server, MCP server, etc.).
11
- *
2
+ * @remnic/core — framework-agnostic Remnic memory engine.
3
+ * Zero OpenClaw imports. Any host adapter can consume this package.
12
4
  */
13
-
14
5
  export { collapseWhitespace, displayWidth, graphemeUnits, padEndDisplay, truncateCodePointSafe, truncateGraphemeSafe } from "./whitespace.js";
6
+ export * from "./context-summary.js";
7
+ export * from "./active-context-transform.js";
15
8
 
16
9
  // ---------------------------------------------------------------------------
17
10
  // Plugin entry resolution
@@ -1461,5 +1454,7 @@ export type {
1461
1454
  export type { ResolvedScopeProfilePlan } from "./namespaces/scope-profiles.js";
1462
1455
  export * from "./maintenance/atomic-file.js";
1463
1456
 
1457
+ // Privacy-safe action-to-outcome trajectory eval (issue #2345)
1458
+ export * from "./eval-trajectory.js";
1464
1459
  export { MemoryControllerCoordinator, chooseAction, computeEvidenceReportHash, controllerConfigHash, evaluateActiveGates, hashControllerState, verifyEvidenceReport } from "./memory-controller.js";
1465
1460
  export type { ActiveContextAdapter, ActiveContextMessage, ActiveContextPlan, MemoryControllerActionFamily, MemoryControllerChoice, MemoryControllerConfig, MemoryControllerDeps, MemoryControllerEvent, MemoryControllerEvidence, MemoryControllerEvidenceReport, MemoryControllerExecutors, MemoryControllerMode, MemoryControllerPairedSeedEvidence, MemoryControllerReceipt, MemoryControllerRecorder, MemoryControllerReportReader, MemoryControllerRunResult, MemoryControllerState } from "./memory-controller.js";
@@ -1,8 +1,6 @@
1
- import { log } from "../logger.js";
2
- import { looksLikeMechanicalTelemetryTranscript } from "../telemetry-transcript.js";
3
- import { estimateTokenCount } from "../token-estimate.js";
4
- import type { LcmArchive, LcmMessage } from "./archive.js";
1
+ import { summarizeContextPure, type SummarizeFn } from "../context-summary.js";
5
2
  import { estimateTokens } from "./archive.js";
3
+ import type { LcmArchive, LcmMessage } from "./archive.js";
6
4
  import type { LcmDag } from "./dag.js";
7
5
 
8
6
  /** Generate a ULID-like ID (timestamp + random). */
@@ -12,11 +10,9 @@ function generateNodeId(): string {
12
10
  return `lcm-${ts}-${rand}`;
13
11
  }
14
12
 
15
- export type SummarizeFn = (
16
- text: string,
17
- targetTokens: number,
18
- aggressive: boolean,
19
- ) => Promise<string | null>;
13
+ // `SummarizeFn` moved to the shared pure summary seam (context-summary.ts,
14
+ // #2347); re-exported here for back-compat with existing imports.
15
+ export type { SummarizeFn };
20
16
 
21
17
  export interface LcmSummarizerConfig {
22
18
  leafBatchSize: number;
@@ -145,98 +141,23 @@ export class LcmSummarizer {
145
141
  }
146
142
 
147
143
  /**
148
- * Three-level escalation:
149
- * 0 = Normal LLM summary
150
- * 1 = Aggressive bullet compression
151
- * 2 = Deterministic truncation (no LLM)
144
+ * Three-level escalation, delegated to the shared pure summary seam
145
+ * (context-summary.ts): 0 = normal LLM, 1 = aggressive, 2 = deterministic.
152
146
  */
153
147
  private async summarizeWithEscalation(
154
148
  text: string,
155
149
  targetTokens: number,
156
150
  ): Promise<{ text: string; escalation: number }> {
157
- const { telemetryPrefilterEnabled } = this.config;
158
- if (
159
- telemetryPrefilterEnabled &&
160
- looksLikeMechanicalTelemetryTranscript(text)
161
- ) {
162
- return {
163
- text: deterministicTruncate(
164
- text,
165
- Math.min(targetTokens, this.config.deterministicMaxTokens),
166
- ),
167
- escalation: 2,
168
- };
169
- }
170
-
171
- // Level 0: Normal LLM summary
172
- try {
173
- const result = await this.summarizeFn(text, targetTokens, false);
174
- if (result && estimateTokens(result) <= targetTokens * 1.5) {
175
- return { text: result, escalation: 0 };
176
- }
177
- // If too long, try aggressive
178
- } catch (err) {
179
- log.debug(`LCM level-0 summary failed: ${err}`);
180
- }
181
-
182
- // Level 1: Aggressive bullet compression
183
- try {
184
- const aggressiveTarget = Math.max(32, Math.ceil(targetTokens * 0.5));
185
- const result = await this.summarizeFn(text, aggressiveTarget, true);
186
- if (result && estimateTokens(result) <= targetTokens * 1.5) {
187
- return { text: result, escalation: 1 };
188
- }
189
- } catch (err) {
190
- log.debug(`LCM level-1 summary failed: ${err}`);
191
- }
192
-
193
- // Level 2: Deterministic truncation (guaranteed, no LLM)
194
- return {
195
- text: deterministicTruncate(text, this.config.deterministicMaxTokens),
196
- escalation: 2,
197
- };
198
- }
199
- }
200
-
201
- /** Deterministic truncation: first and last sentence, plus middle truncation. */
202
- function deterministicTruncate(text: string, maxTokens: number): string {
203
- if (maxTokens <= 0 || estimateTokenCount(text) <= maxTokens) return text;
204
-
205
- const sentences = text.split(/(?<=[.!?])\s+/).filter((s) => s.length > 0);
206
- if (sentences.length <= 2) return clampToTokenBudget(text, maxTokens);
207
-
208
- const first = sentences[0];
209
- const last = sentences[sentences.length - 1];
210
- const render = (middle: string[], truncated: boolean): string =>
211
- `${first} ${middle.join(" ")}${truncated ? " [...] " : " "}${last}`;
212
-
213
- const base = render([], false);
214
- if (estimateTokenCount(base) > maxTokens) return clampToTokenBudget(text, maxTokens);
215
- if (estimateTokenCount(render([], true)) > maxTokens) return base;
216
-
217
- const middle: string[] = [];
218
- for (let i = 1; i < sentences.length - 1; i++) {
219
- const candidate = [...middle, sentences[i]];
220
- const truncated = i < sentences.length - 2;
221
- if (estimateTokenCount(render(candidate, truncated)) > maxTokens) break;
222
- middle.push(sentences[i]);
151
+ const { deterministicMaxTokens, telemetryPrefilterEnabled } = this.config;
152
+ const result = await summarizeContextPure(text, targetTokens, "auto", {
153
+ llm: this.summarizeFn,
154
+ deterministicMaxTokens,
155
+ telemetryPrefilterEnabled,
156
+ });
157
+ return { text: result.text, escalation: result.escalation ?? 2 };
223
158
  }
224
-
225
- const truncated = middle.length < sentences.length - 2;
226
- return clampToTokenBudget(render(middle, truncated), maxTokens);
227
159
  }
228
160
 
229
- function clampToTokenBudget(text: string, maxTokens: number): string {
230
- const codePoints = [...text];
231
- let low = 0;
232
- let high = codePoints.length;
233
- while (low < high) {
234
- const mid = Math.ceil((low + high) / 2);
235
- if (estimateTokenCount(codePoints.slice(0, mid).join("")) <= maxTokens) low = mid;
236
- else high = mid - 1;
237
- }
238
- return codePoints.slice(0, low).join("");
239
- }
240
161
 
241
162
  function chunkArray<T>(arr: T[], size: number): T[][] {
242
163
  const chunks: T[][] = [];
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Location boundary operations (issue #2047) — the five `location_*`
3
+ * operations registered through the access boundary so MCP, HTTP, and any
4
+ * batch transport share one validated dispatch. Handlers are thin: they run
5
+ * the same `location/surfaces.ts` runners the CLI uses. Fleet-wide: location
6
+ * config and day files are machine-level (no namespace scoping).
7
+ */
8
+
9
+ import { z } from "zod";
10
+ import { defineOperation } from "../access-boundary.js";
11
+ import type { EngramAccessService } from "../access-service.js";
12
+ import {
13
+ parseLocationBackfillRange,
14
+ runLocationCheck,
15
+ runLocationDay,
16
+ runLocationStatus,
17
+ runLocationSync,
18
+ type LocationSurfaceDeps,
19
+ } from "./surfaces.js";
20
+
21
+ /** Zod shape shared by the location operations (null-for-absent tolerant). */
22
+ const dateField = z.union([z.string(), z.null()]).optional();
23
+ const daysField = z.union([z.number(), z.string(), z.null()]).optional();
24
+
25
+ function locationDeps(service: EngramAccessService): LocationSurfaceDeps {
26
+ return { config: service.configRef.location, memoryDir: service.memoryDir };
27
+ }
28
+
29
+ defineOperation({
30
+ name: "location_status",
31
+ description: "Location sync status (gates, providers, last sync, day counts).",
32
+ fleetWide: true,
33
+ schema: z.object({}).passthrough(),
34
+ handler: async (_input, ctx) => ({
35
+ result: await runLocationStatus(locationDeps(ctx.service)),
36
+ }),
37
+ });
38
+
39
+ defineOperation({
40
+ name: "location_check",
41
+ description: "Probe every enabled location provider.",
42
+ fleetWide: true,
43
+ schema: z.object({}).passthrough(),
44
+ handler: async (_input, ctx) => ({
45
+ result: await runLocationCheck(locationDeps(ctx.service)),
46
+ }),
47
+ });
48
+
49
+ defineOperation({
50
+ name: "location_sync",
51
+ description: "Sync location days (default window: syncDays ending yesterday).",
52
+ fleetWide: true,
53
+ schema: z.object({ date: dateField, days: daysField }).passthrough(),
54
+ handler: async (input, ctx) => ({
55
+ result: {
56
+ days: await runLocationSync(locationDeps(ctx.service), {
57
+ ...(input.date !== undefined && input.date !== null && input.date !== "" ? { endDate: input.date } : {}),
58
+ ...(input.days !== undefined && input.days !== null && input.days !== "" ? { days: Number(input.days) } : {}),
59
+ }),
60
+ },
61
+ }),
62
+ });
63
+
64
+ defineOperation({
65
+ name: "location_backfill",
66
+ description: "Sync an explicit historical day range (≤ 90 days).",
67
+ fleetWide: true,
68
+ schema: z.object({ from: dateField, to: dateField }).passthrough(),
69
+ handler: async (input, ctx) => {
70
+ const range = parseLocationBackfillRange(input.from, input.to);
71
+ return { result: { days: await runLocationSync(locationDeps(ctx.service), range) } };
72
+ },
73
+ });
74
+
75
+ defineOperation({
76
+ name: "location_day",
77
+ description: "Read one stored location day.",
78
+ fleetWide: true,
79
+ schema: z.object({ date: dateField }).passthrough(),
80
+ handler: async (input, ctx) => ({
81
+ result: await runLocationDay(locationDeps(ctx.service).memoryDir, input.date),
82
+ }),
83
+ });
84
+
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Location HTTP glue regression (issue #2047): the /engram/v1/location/...
3
+ * responders dispatch through the same boundary operations the MCP tools
4
+ * use — identical validation messages, 404 for unstored days, 200 otherwise.
5
+ */
6
+
7
+ import assert from "node:assert/strict";
8
+ import { mkdtemp, rm } from "node:fs/promises";
9
+ import { tmpdir } from "node:os";
10
+ import path from "node:path";
11
+ import test from "node:test";
12
+ import type { ServerResponse } from "node:http";
13
+
14
+ // Import the operations module so getOperation() has the location_* set.
15
+ import "../access-operations.js";
16
+ import { EngramAccessInputError } from "../access-errors.js";
17
+ import type { EngramAccessService } from "../access-service.js";
18
+ import { parseLocationConfig } from "./config.js";
19
+ import {
20
+ respondLocationBackfill,
21
+ respondLocationCheck,
22
+ respondLocationDay,
23
+ respondLocationStatus,
24
+ respondLocationSync,
25
+ } from "./http-glue.js";
26
+
27
+ const DUMMY_RES = {} as ServerResponse;
28
+
29
+ function makeService(memoryDir: string): EngramAccessService {
30
+ const config = {
31
+ location: parseLocationConfig({ enabled: true, timezone: "UTC", sources: [{ id: "reitti" }] }),
32
+ };
33
+ return { configRef: config, memoryDir } as unknown as EngramAccessService;
34
+ }
35
+
36
+ test("status and check respond 200 with the shared runner's disabled/empty semantics", async () => {
37
+ const memoryDir = await mkdtemp(path.join(tmpdir(), "remnic-location-http-"));
38
+ try {
39
+ const box: { s?: number; b?: unknown } = {};
40
+ const respondJson = (_res: ServerResponse, status: number, payload: unknown) => {
41
+ box.s = status;
42
+ box.b = payload;
43
+ };
44
+ const service = makeService(memoryDir);
45
+ await respondLocationStatus(DUMMY_RES, respondJson, service);
46
+ assert.equal(box.s, 200);
47
+ const report = box.b as { enabled: boolean; sources: Array<{ providerRegistered: boolean }> };
48
+ assert.equal(report.enabled, true);
49
+ assert.equal(report.sources[0]?.providerRegistered, false, "absent provider is a skip state");
50
+
51
+ await respondLocationCheck(DUMMY_RES, respondJson, service);
52
+ assert.equal(box.s, 200);
53
+ const check = box.b as { results: Array<{ id: string; ok: boolean; skipped?: string }> };
54
+ assert.deepEqual(check.results, [{ id: "reitti", ok: false, skipped: "provider-not-registered" }]);
55
+ } finally {
56
+ await rm(memoryDir, { recursive: true, force: true });
57
+ }
58
+ });
59
+
60
+ test("invalid sync/backfill/day inputs reject with the SAME messages as the CLI runner", async () => {
61
+ const memoryDir = await mkdtemp(path.join(tmpdir(), "remnic-location-http-invalid-"));
62
+ const service = makeService(memoryDir);
63
+ const respondJson = () => {};
64
+ try {
65
+ await assert.rejects(
66
+ () => respondLocationSync({ date: "2026-13-99" }, DUMMY_RES, respondJson, service),
67
+ (err: unknown) => err instanceof EngramAccessInputError && /date is required \(YYYY-MM-DD\)/.test(err.message),
68
+ );
69
+ await assert.rejects(
70
+ () => respondLocationSync({ days: 0 }, DUMMY_RES, respondJson, service),
71
+ (err: unknown) => err instanceof EngramAccessInputError && /days expects an integer from 1 to 90/.test(err.message),
72
+ );
73
+ await assert.rejects(
74
+ () => respondLocationBackfill({ from: "2026-08-10", to: "2026-08-01" }, DUMMY_RES, respondJson, service),
75
+ (err: unknown) => err instanceof EngramAccessInputError && /--from must not be after --to/.test(err.message),
76
+ );
77
+ await assert.rejects(
78
+ () => respondLocationDay(null, DUMMY_RES, respondJson, service),
79
+ (err: unknown) => err instanceof EngramAccessInputError && /date is required \(YYYY-MM-DD\)/.test(err.message),
80
+ );
81
+ } finally {
82
+ await rm(memoryDir, { recursive: true, force: true });
83
+ }
84
+ });
85
+
86
+ test("day responds 404 for an unstored day", async () => {
87
+ const memoryDir = await mkdtemp(path.join(tmpdir(), "remnic-location-http-day-"));
88
+ try {
89
+ const box: { s?: number; b?: unknown } = {};
90
+ const respondJson = (_res: ServerResponse, status: number, payload: unknown) => {
91
+ box.s = status;
92
+ box.b = payload;
93
+ };
94
+ await respondLocationDay("2026-08-16", DUMMY_RES, respondJson, makeService(memoryDir));
95
+ assert.equal(box.s, 404);
96
+ assert.equal((box.b as { found: boolean }).found, false, "unstored day is an explicit not-found");
97
+ } finally {
98
+ await rm(memoryDir, { recursive: true, force: true });
99
+ }
100
+ });
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Location HTTP route glue (issue #2047) — the `/engram/v1/location/...` (and
3
+ * `/remnic/v1/...` alias) route bodies, extracted so access-http.ts (size-
4
+ * grandfathered) keeps only thin route branches (same pattern as
5
+ * meetings/http-glue.ts). Every responder dispatches through the access
6
+ * boundary operation — the identical validated path the MCP tools use — so
7
+ * HTTP and MCP can never diverge on validation or error mapping.
8
+ * EngramAccessInputError bubbles to the global 400 handler; backend faults
9
+ * keep flowing to the global 500 handler.
10
+ */
11
+
12
+ import type { ServerResponse } from "node:http";
13
+ import { getOperation, type OperationName } from "../access-boundary.js";
14
+ import type { EngramAccessService } from "../access-service.js";
15
+
16
+ type RespondJson = (res: ServerResponse, status: number, payload: unknown) => void;
17
+
18
+ function requireLocationOperation(name: OperationName) {
19
+ const op = getOperation(name);
20
+ if (!op) {
21
+ throw new Error(`access-boundary: operation not registered: ${name}`);
22
+ }
23
+ return op;
24
+ }
25
+
26
+ export async function respondLocationStatus(
27
+ res: ServerResponse,
28
+ respondJson: RespondJson,
29
+ service: EngramAccessService,
30
+ ): Promise<void> {
31
+ const output = (await requireLocationOperation("location_status").run({}, { service })) as {
32
+ result: unknown;
33
+ };
34
+ respondJson(res, 200, output.result);
35
+ }
36
+
37
+ export async function respondLocationCheck(
38
+ res: ServerResponse,
39
+ respondJson: RespondJson,
40
+ service: EngramAccessService,
41
+ ): Promise<void> {
42
+ const output = (await requireLocationOperation("location_check").run({}, { service })) as {
43
+ result: unknown;
44
+ };
45
+ respondJson(res, 200, { results: output.result });
46
+ }
47
+
48
+ export async function respondLocationSync(
49
+ body: Record<string, unknown>,
50
+ res: ServerResponse,
51
+ respondJson: RespondJson,
52
+ service: EngramAccessService,
53
+ ): Promise<void> {
54
+ const output = (await requireLocationOperation("location_sync").run(
55
+ { date: body.date ?? null, days: body.days ?? null },
56
+ { service },
57
+ )) as { result: unknown };
58
+ respondJson(res, 200, output.result);
59
+ }
60
+
61
+ export async function respondLocationBackfill(
62
+ body: Record<string, unknown>,
63
+ res: ServerResponse,
64
+ respondJson: RespondJson,
65
+ service: EngramAccessService,
66
+ ): Promise<void> {
67
+ const output = (await requireLocationOperation("location_backfill").run(
68
+ { from: body.from ?? null, to: body.to ?? null },
69
+ { service },
70
+ )) as { result: unknown };
71
+ respondJson(res, 200, output.result);
72
+ }
73
+
74
+ export async function respondLocationDay(
75
+ date: string | null,
76
+ res: ServerResponse,
77
+ respondJson: RespondJson,
78
+ service: EngramAccessService,
79
+ ): Promise<void> {
80
+ const output = (await requireLocationOperation("location_day").run(
81
+ { date: date ?? null },
82
+ { service },
83
+ )) as { result: { found: boolean } & Record<string, unknown> };
84
+ respondJson(res, output.result.found ? 200 : 404, output.result);
85
+ }
@@ -13,4 +13,7 @@ export * from "./config.js";
13
13
  export * from "./intervals.js";
14
14
  export * from "./store.js";
15
15
  export * from "./pipeline.js";
16
+ export * from "./surfaces.js";
17
+ export * from "./provider-setup.js";
18
+ export * from "./scheduler.js";
16
19
  export * from "./cli.js";
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Location MCP tool definitions (issue #2047) — the five
3
+ * `engram.location_*` tool-def objects, extracted from access-mcp.ts so the
4
+ * surface file stays at its structural ceiling (same pattern as
5
+ * wearables/mcp-tools.ts). Spread back into `this.tools`
6
+ * (`...LOCATION_MCP_TOOLS`); MCP_MIGRATED_OPERATIONS + boundary dispatch
7
+ * stay inline in access-mcp.ts. Location is fleet-wide: no namespace arg
8
+ * (day files live under the memory root, outside every namespace).
9
+ */
10
+
11
+ import type { McpTool } from "../access-mcp.js";
12
+
13
+ export const LOCATION_MCP_TOOLS: McpTool[] = [
14
+ {
15
+ name: "engram.location_status",
16
+ description:
17
+ "Location sync status: master gate, timezone, per-source provider registration, last sync, and recent stored day counts. Never returns secrets, addresses, coordinates, or place labels.",
18
+ inputSchema: {
19
+ type: "object",
20
+ properties: {},
21
+ additionalProperties: false,
22
+ },
23
+ },
24
+ {
25
+ name: "engram.location_check",
26
+ description:
27
+ "Probe every enabled location provider (auth/connectivity). Reports ok/detail per source; a disabled master gate or source reports a skip reason, never an error.",
28
+ inputSchema: {
29
+ type: "object",
30
+ properties: {},
31
+ additionalProperties: false,
32
+ },
33
+ },
34
+ {
35
+ name: "engram.location_sync",
36
+ description:
37
+ "Sync local-day place observations from every enabled location provider (default: location.syncDays ending yesterday). Same shared runner as the CLI and HTTP surfaces; a forced sync never bypasses the enabled gates or validation. Returns per-day, per-source synced/skipped/failed results.",
38
+ inputSchema: {
39
+ type: "object",
40
+ properties: {
41
+ date: {
42
+ type: "string",
43
+ description: "Optional exclusive-window end day (YYYY-MM-DD, inclusive); defaults to yesterday in location.timezone.",
44
+ },
45
+ days: {
46
+ type: "integer",
47
+ minimum: 1,
48
+ maximum: 90,
49
+ description: "Optional window size (1..90); defaults to location.syncDays.",
50
+ },
51
+ },
52
+ additionalProperties: false,
53
+ },
54
+ },
55
+ {
56
+ name: "engram.location_backfill",
57
+ description:
58
+ "Sync an explicit historical day range (inclusive, capped at 90 days) for every enabled location provider. Same shared sync runner as location_sync; never makes an unbounded scan.",
59
+ inputSchema: {
60
+ type: "object",
61
+ properties: {
62
+ from: { type: "string", description: "Range start day (YYYY-MM-DD)." },
63
+ to: { type: "string", description: "Range end day (YYYY-MM-DD, inclusive)." },
64
+ },
65
+ required: ["from", "to"],
66
+ additionalProperties: false,
67
+ },
68
+ },
69
+ {
70
+ name: "engram.location_day",
71
+ description:
72
+ "Return one stored location day (place segments per source). Coordinates appear only when location.retainCoordinates is enabled; an unstored day returns found:false.",
73
+ inputSchema: {
74
+ type: "object",
75
+ properties: {
76
+ date: { type: "string", description: "Day to read (YYYY-MM-DD)." },
77
+ },
78
+ required: ["date"],
79
+ additionalProperties: false,
80
+ },
81
+ },
82
+ ];
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Provider setup regression (issue #2047): env-credential bootstrapping of
3
+ * optional provider packages — absent credentials or package are skips
4
+ * (never errors), tokens never reach logs, and registration is idempotent.
5
+ */
6
+
7
+ import assert from "node:assert/strict";
8
+ import test from "node:test";
9
+
10
+ import { parseLocationConfig } from "./config.js";
11
+ import { clearLocationProviders, getLocationProvider, registerLocationProvider } from "./registry.js";
12
+ import { ensureConfiguredLocationProviders, type LocationProviderEnv } from "./provider-setup.js";
13
+ import type { LocationProvider } from "./types.js";
14
+
15
+ const ENV: LocationProviderEnv = {
16
+ baseUrl: "https://reitti.example.invalid",
17
+ token: "secret-token",
18
+ authMode: "x-api-token",
19
+ };
20
+
21
+ function importModuleDouble(options: { registered: boolean; failWith?: Error }) {
22
+ const calls: Array<Record<string, unknown>> = [];
23
+ return {
24
+ calls,
25
+ importModule: async () => {
26
+ if (options.failWith) throw options.failWith;
27
+ return {
28
+ ensureReittiProviderRegistered: (opts: Record<string, unknown>) => {
29
+ calls.push(opts);
30
+ if (options.registered) {
31
+ registerLocationProvider({
32
+ id: "reitti",
33
+ displayName: "Reitti",
34
+ verify: async () => ({ ok: true }),
35
+ fetchObservations: async () => ({ observations: [], nextCursor: null }),
36
+ } satisfies LocationProvider);
37
+ return true;
38
+ }
39
+ return false;
40
+ },
41
+ };
42
+ },
43
+ };
44
+ }
45
+
46
+ test.afterEach(() => clearLocationProviders());
47
+
48
+ test("registers reitti from env credentials with timezone threaded through", async () => {
49
+ const config = parseLocationConfig({ enabled: true, timezone: "Europe/Berlin", sources: [{ id: "reitti" }] });
50
+ const loader = importModuleDouble({ registered: true });
51
+ const registered = await ensureConfiguredLocationProviders(config, { env: ENV, importModule: loader.importModule });
52
+ assert.deepEqual(registered, ["reitti"]);
53
+ assert.ok(getLocationProvider("reitti"));
54
+ assert.deepEqual(loader.calls, [
55
+ { baseUrl: ENV.baseUrl, token: ENV.token, timezone: "Europe/Berlin", authMode: "x-api-token" },
56
+ ]);
57
+
58
+ // Idempotent: a second call sees the registry and never re-imports.
59
+ const registeredAgain = await ensureConfiguredLocationProviders(config, { env: ENV, importModule: loader.importModule });
60
+ assert.deepEqual(registeredAgain, []);
61
+ assert.equal(loader.calls.length, 1);
62
+ });
63
+
64
+ test("missing credentials or disabled config stay unregistered — skip, not error", async () => {
65
+ const loader = importModuleDouble({ registered: true });
66
+ const disabled = parseLocationConfig({ enabled: false, sources: [{ id: "reitti" }] });
67
+ assert.deepEqual(await ensureConfiguredLocationProviders(disabled, { env: ENV, importModule: loader.importModule }), []);
68
+ assert.equal(loader.calls.length, 0, "disabled config never loads packages");
69
+
70
+ const missingToken = await ensureConfiguredLocationProviders(
71
+ parseLocationConfig({ enabled: true, sources: [{ id: "reitti" }] }),
72
+ { env: { baseUrl: ENV.baseUrl }, importModule: loader.importModule },
73
+ );
74
+ assert.deepEqual(missingToken, []);
75
+ assert.equal(loader.calls.length, 0, "missing token never loads packages");
76
+ assert.equal(getLocationProvider("reitti"), undefined);
77
+ });
78
+
79
+ test("optional package absent (module-not-found naming the specifier) is silent", async () => {
80
+ const config = parseLocationConfig({ enabled: true, sources: [{ id: "reitti" }] });
81
+ const registered = await ensureConfiguredLocationProviders(config, {
82
+ env: ENV,
83
+ importModule: async () => {
84
+ throw Object.assign(new Error("Cannot find module '@remnic/connector-reitti'"), { code: "ERR_MODULE_NOT_FOUND" });
85
+ },
86
+ });
87
+ assert.deepEqual(registered, []);
88
+ assert.equal(getLocationProvider("reitti"), undefined);
89
+ });
90
+
91
+ test("unknown provider ids and unknown sources are skipped without imports", async () => {
92
+ const loader = importModuleDouble({ registered: true });
93
+ const config = parseLocationConfig({ enabled: true, sources: [{ id: "future-provider" }, { id: "reitti", enabled: false }] });
94
+ assert.deepEqual(await ensureConfiguredLocationProviders(config, { env: ENV, importModule: loader.importModule }), []);
95
+ assert.equal(loader.calls.length, 0, "unknown + disabled sources never load packages");
96
+ });
97
+
98
+ test("invalid authMode falls back to the connector default (single header form)", async () => {
99
+ const loader = importModuleDouble({ registered: true });
100
+ const config = parseLocationConfig({ enabled: true, sources: [{ id: "reitti" }] });
101
+ await ensureConfiguredLocationProviders(config, {
102
+ env: { ...ENV, authMode: "both" },
103
+ importModule: loader.importModule,
104
+ });
105
+ assert.equal("authMode" in (loader.calls[0] ?? {}), false, "invalid mode must not be forwarded");
106
+ });