@remnic/core 9.64.0 → 9.64.2

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 (486) hide show
  1. package/dist/access-admin-ops-surface.d.ts +12 -11
  2. package/dist/access-admin-ops-surface.js +24 -23
  3. package/dist/access-authorization-probe.d.ts +12 -11
  4. package/dist/access-authorization-probe.js +25 -24
  5. package/dist/access-boundary.d.ts +13 -12
  6. package/dist/access-boundary.js +24 -23
  7. package/dist/access-cli.js +74 -72
  8. package/dist/access-cli.js.map +1 -1
  9. package/dist/access-coding-context-resolution.d.ts +1 -1
  10. package/dist/access-extraction-force-flush.d.ts +12 -11
  11. package/dist/access-extraction-force-flush.js +24 -23
  12. package/dist/access-health-types.d.ts +1 -1
  13. package/dist/access-http-lcm-compaction.d.ts +12 -11
  14. package/dist/access-http-lifecycle-flush.d.ts +12 -11
  15. package/dist/access-http-offline-stream.d.ts +12 -11
  16. package/dist/access-http-query.d.ts +2 -2
  17. package/dist/access-http-query.js +26 -25
  18. package/dist/access-http.d.ts +13 -12
  19. package/dist/access-http.js +41 -40
  20. package/dist/access-identity-continuity-surface.d.ts +9 -9
  21. package/dist/access-identity-continuity-surface.js +24 -23
  22. package/dist/access-lcm-surface.d.ts +12 -11
  23. package/dist/access-lcm-surface.js +24 -23
  24. package/dist/access-mcp-output-schemas.js +1 -1
  25. package/dist/access-mcp.d.ts +12 -186
  26. package/dist/access-mcp.js +33 -32
  27. package/dist/access-memory-search-fanout.d.ts +2 -2
  28. package/dist/{access-namespace-preflight-CrF0FKaz.d.ts → access-namespace-preflight-CYeI1R2_.d.ts} +1 -1
  29. package/dist/access-namespace-preflight.d.ts +3 -3
  30. package/dist/access-namespace-preflight.js +24 -23
  31. package/dist/access-observe-write-surface.d.ts +12 -11
  32. package/dist/access-observe-write-surface.js +24 -23
  33. package/dist/access-offline-manifest.d.ts +9 -9
  34. package/dist/access-operations-batch.js +27 -26
  35. package/dist/access-operations.d.ts +13 -12
  36. package/dist/access-operations.js +30 -29
  37. package/dist/access-recall-concurrency.d.ts +12 -11
  38. package/dist/access-recall-concurrency.js +24 -23
  39. package/dist/access-recall-response.d.ts +12 -11
  40. package/dist/access-recall-response.js +24 -23
  41. package/dist/access-recall-surface.d.ts +12 -11
  42. package/dist/access-recall-surface.js +24 -23
  43. package/dist/access-schema.js +3 -3
  44. package/dist/{access-service-BqF4UK8Z.d.ts → access-service-BKtdXnyk.d.ts} +294 -12
  45. package/dist/access-service-helpers.d.ts +12 -11
  46. package/dist/access-service.d.ts +12 -11
  47. package/dist/access-service.js +24 -23
  48. package/dist/access-surface-catalog.d.ts +12 -11
  49. package/dist/access-surface-catalog.js +28 -25
  50. package/dist/access-surface-catalog.js.map +1 -1
  51. package/dist/access-wearables-meetings-surface.d.ts +3 -3
  52. package/dist/action-confidence.d.ts +1 -1
  53. package/dist/active-memory-bridge.d.ts +1 -1
  54. package/dist/active-recall.d.ts +1 -1
  55. package/dist/active-recall.js +1 -1
  56. package/dist/adapters/index.js +4 -4
  57. package/dist/adapters/registry.js +2 -2
  58. package/dist/ambient-provenance.d.ts +1 -1
  59. package/dist/artifact-search.d.ts +1 -1
  60. package/dist/behavior-learner.d.ts +1 -1
  61. package/dist/behavior-signals.d.ts +1 -1
  62. package/dist/bootstrap.d.ts +9 -9
  63. package/dist/briefing-window.d.ts +2 -2
  64. package/dist/briefing.d.ts +2 -2
  65. package/dist/briefing.js +10 -10
  66. package/dist/buffer-surprise-report.d.ts +1 -1
  67. package/dist/buffer-turn-helpers.d.ts +1 -1
  68. package/dist/buffer.d.ts +2 -2
  69. package/dist/buffer.js +2 -2
  70. package/dist/bulk-import/index.d.ts +3 -3
  71. package/dist/calibration.d.ts +1 -1
  72. package/dist/capabilities.d.ts +1 -1
  73. package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
  74. package/dist/{catalog-C0KIwZqR.d.ts → catalog-CLAqQO2L.d.ts} +1 -1
  75. package/dist/causal-behavior.d.ts +1 -1
  76. package/dist/causal-consolidation.d.ts +1 -1
  77. package/dist/causal-consolidation.js +11 -11
  78. package/dist/causal-trajectory-graph.d.ts +1 -1
  79. package/dist/{chunk-BTUIHRRR.js → chunk-246HFJVG.js} +2 -2
  80. package/dist/{chunk-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
  81. package/dist/{chunk-5SZ6CLGJ.js → chunk-2QI2JBLQ.js} +360 -238
  82. package/dist/chunk-2QI2JBLQ.js.map +1 -0
  83. package/dist/{chunk-6NMZXEJ7.js → chunk-3A46U7XG.js} +2 -2
  84. package/dist/{chunk-S6KMN6MJ.js → chunk-3LOQN3TO.js} +10 -5
  85. package/dist/chunk-3LOQN3TO.js.map +1 -0
  86. package/dist/{chunk-Z3Q5I5F6.js → chunk-44DSGZFF.js} +2 -2
  87. package/dist/{chunk-VENMDW4U.js → chunk-55SJFHVD.js} +6 -6
  88. package/dist/{chunk-VCBG52MM.js → chunk-5HERQ5FX.js} +7 -7
  89. package/dist/{chunk-IRXMJLTW.js → chunk-5HK3CJAR.js} +2 -2
  90. package/dist/{chunk-KG2CT762.js → chunk-6LTCUN3T.js} +2 -2
  91. package/dist/{chunk-UUYQWKHO.js → chunk-7BVO64UC.js} +2 -2
  92. package/dist/{chunk-X6HNXVXS.js → chunk-7V3AZWWZ.js} +4 -4
  93. package/dist/{chunk-EHC3FIJ4.js → chunk-A2IBK3TG.js} +2 -2
  94. package/dist/{chunk-6BV6ZZZA.js → chunk-C6AKYOFO.js} +2 -2
  95. package/dist/{chunk-7ML7STOD.js → chunk-CKZHKFY3.js} +3 -3
  96. package/dist/{chunk-CUDSA46O.js → chunk-CUIAHZPZ.js} +2 -2
  97. package/dist/{chunk-QFPX7QZG.js → chunk-DA2O3F5V.js} +25 -11
  98. package/dist/chunk-DA2O3F5V.js.map +1 -0
  99. package/dist/{chunk-CTD5CPD2.js → chunk-DC4FJY2G.js} +22 -7
  100. package/dist/{chunk-CTD5CPD2.js.map → chunk-DC4FJY2G.js.map} +1 -1
  101. package/dist/{chunk-2BRCV2IV.js → chunk-DG6MJD7W.js} +2 -2
  102. package/dist/{chunk-YGSDWO3U.js → chunk-DHKV6E4A.js} +2 -2
  103. package/dist/{chunk-DZFPHARJ.js → chunk-EJDLQRUO.js} +2 -2
  104. package/dist/{chunk-VD2OT77P.js → chunk-GEULB2VI.js} +2 -1
  105. package/dist/chunk-GEULB2VI.js.map +1 -0
  106. package/dist/{chunk-BPLPGOUJ.js → chunk-GVRLED7R.js} +2 -2
  107. package/dist/{chunk-YINSSARY.js → chunk-H5CGAD7L.js} +1 -1
  108. package/dist/{chunk-QICOU4RY.js → chunk-IFK3PVM7.js} +2 -2
  109. package/dist/{chunk-E7MYSCSL.js → chunk-IJXECCUV.js} +2 -2
  110. package/dist/{chunk-RKNJBZ55.js → chunk-JBPKEARU.js} +4 -4
  111. package/dist/{chunk-WQ6TRWAE.js → chunk-JCSUNXYJ.js} +3 -3
  112. package/dist/{chunk-5W7CTZ2E.js → chunk-KQAFEZQX.js} +4 -4
  113. package/dist/{chunk-6IKXAAJI.js → chunk-KRPE7ANR.js} +2 -2
  114. package/dist/{chunk-FEP45MYY.js → chunk-LOETWOEB.js} +2 -2
  115. package/dist/{chunk-4IIDTPSK.js → chunk-LZKCMK3U.js} +2 -2
  116. package/dist/{chunk-ML4MI2RR.js → chunk-MJRVF7SF.js} +29 -28
  117. package/dist/chunk-MJRVF7SF.js.map +1 -0
  118. package/dist/{chunk-K547KS3X.js → chunk-ML3U4KPR.js} +4 -4
  119. package/dist/{chunk-HIEWDJ2O.js → chunk-MSTNSVXI.js} +2 -1
  120. package/dist/chunk-MSTNSVXI.js.map +1 -0
  121. package/dist/{chunk-BTBAHTQ5.js → chunk-NO7B6DRB.js} +2 -2
  122. package/dist/{chunk-G5F4MXXC.js → chunk-ON2P3SHG.js} +2 -2
  123. package/dist/{chunk-2Q4UAPLD.js → chunk-OQIRBGUU.js} +4 -4
  124. package/dist/{chunk-PQODT53H.js → chunk-PE76XIDM.js} +3 -3
  125. package/dist/{chunk-MVIYRRVJ.js → chunk-PMVPCZJZ.js} +5 -5
  126. package/dist/{chunk-CK3DZ6OE.js → chunk-PVIXAMWM.js} +2 -2
  127. package/dist/{chunk-BB2LH5JM.js → chunk-RNORDDD6.js} +11 -1
  128. package/dist/chunk-RNORDDD6.js.map +1 -0
  129. package/dist/{chunk-HZXO2CJ6.js → chunk-RWLRKMZK.js} +2 -2
  130. package/dist/{chunk-SYU5JOBQ.js → chunk-SB6YBB2V.js} +2 -2
  131. package/dist/{chunk-3F3CVVDS.js → chunk-SHQFYZTD.js} +2 -2
  132. package/dist/chunk-TKI2WOL5.js +256 -0
  133. package/dist/chunk-TKI2WOL5.js.map +1 -0
  134. package/dist/chunk-TY35YQ6E.js +77 -0
  135. package/dist/chunk-TY35YQ6E.js.map +1 -0
  136. package/dist/{chunk-R7XE5ZUR.js → chunk-UIYYS2YI.js} +2 -2
  137. package/dist/{chunk-ZWYXSF2T.js → chunk-UMDZXW5J.js} +118 -4
  138. package/dist/chunk-UMDZXW5J.js.map +1 -0
  139. package/dist/{chunk-G5OB4XZX.js → chunk-VANZKHTN.js} +4 -4
  140. package/dist/{chunk-QATILW4B.js → chunk-VLES5S4K.js} +271 -62
  141. package/dist/chunk-VLES5S4K.js.map +1 -0
  142. package/dist/{chunk-AR253JBM.js → chunk-VRYEXPRX.js} +1 -1
  143. package/dist/chunk-VRYEXPRX.js.map +1 -0
  144. package/dist/{chunk-7DRSWPUV.js → chunk-VUP47UJI.js} +3 -3
  145. package/dist/{chunk-65NQFK7D.js → chunk-WBM5NR4E.js} +2 -2
  146. package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
  147. package/dist/{chunk-GIMQJ5RX.js → chunk-XACYILRA.js} +49 -14
  148. package/dist/chunk-XACYILRA.js.map +1 -0
  149. package/dist/{chunk-63JMI45N.js → chunk-XBRGJJK7.js} +2 -2
  150. package/dist/{chunk-WCWIV2JH.js → chunk-XH4IQVTN.js} +2 -2
  151. package/dist/{chunk-77E7LLMV.js → chunk-XZUCNVGE.js} +8 -8
  152. package/dist/{chunk-LJQGQUNS.js → chunk-YFQTDE7N.js} +2 -2
  153. package/dist/{chunk-5OOTHWGJ.js → chunk-YXGU3MDQ.js} +2 -2
  154. package/dist/{chunk-SRLQROQJ.js → chunk-Z6CJLYXT.js} +4 -4
  155. package/dist/{chunk-Z4UPRZR6.js → chunk-ZSYE2QVJ.js} +2 -2
  156. package/dist/{cli-BX0O688c.d.ts → cli-CLvBewKf.d.ts} +5 -5
  157. package/dist/cli.d.ts +13 -13
  158. package/dist/cli.js +57 -56
  159. package/dist/coding/pre-action-gate.d.ts +1 -1
  160. package/dist/compounding/engine.d.ts +2 -2
  161. package/dist/compounding/engine.js +10 -10
  162. package/dist/compounding/preference-consolidator.d.ts +1 -1
  163. package/dist/compression-optimizer.d.ts +1 -1
  164. package/dist/config.d.ts +1 -1
  165. package/dist/config.js +1 -1
  166. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  167. package/dist/connectors/codex-materialize-runner.js +10 -10
  168. package/dist/connectors/codex-materialize.d.ts +1 -1
  169. package/dist/connectors/index.d.ts +1 -1
  170. package/dist/connectors/index.js +10 -10
  171. package/dist/consolidation-provenance-check.d.ts +2 -2
  172. package/dist/consolidation-undo.d.ts +2 -2
  173. package/dist/contradiction/index.d.ts +2 -2
  174. package/dist/contradiction/index.js +4 -4
  175. package/dist/converge-config.d.ts +1 -1
  176. package/dist/convergence-refresh.d.ts +2 -2
  177. package/dist/convergence-refresh.js +12 -12
  178. package/dist/conversation-index/backend.d.ts +1 -1
  179. package/dist/conversation-index/chunker.d.ts +1 -1
  180. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  181. package/dist/conversation-index/indexer.d.ts +1 -1
  182. package/dist/conversation-index/search.d.ts +1 -1
  183. package/dist/corpus-watermark.d.ts +1 -1
  184. package/dist/corpus-watermark.js +12 -12
  185. package/dist/day-summary.d.ts +1 -1
  186. package/dist/delinearize.d.ts +1 -1
  187. package/dist/dependency-propagation-config.d.ts +1 -1
  188. package/dist/{dependency-propagation-delivery-Cph4PnBe.d.ts → dependency-propagation-delivery-DMqIw9Zh.d.ts} +1 -1
  189. package/dist/direct-answer-wiring.d.ts +1 -1
  190. package/dist/direct-answer.d.ts +1 -1
  191. package/dist/embedding-fallback.d.ts +1 -1
  192. package/dist/enrichment/index.d.ts +1 -1
  193. package/dist/entity-origin-fields.d.ts +1 -1
  194. package/dist/entity-retrieval.d.ts +2 -2
  195. package/dist/entity-retrieval.js +10 -10
  196. package/dist/entity-schema.d.ts +1 -1
  197. package/dist/episodic-context.d.ts +1 -1
  198. package/dist/explicit-capture.d.ts +9 -9
  199. package/dist/external-wiki-access.d.ts +12 -11
  200. package/dist/external-wiki-access.js +25 -24
  201. package/dist/external-wiki-collection-registration.d.ts +1 -1
  202. package/dist/external-wiki-collection.d.ts +1 -1
  203. package/dist/external-wiki-mcp-tools.d.ts +12 -13
  204. package/dist/extraction-error-classification.d.ts +1 -1
  205. package/dist/extraction-faithfulness.d.ts +1 -1
  206. package/dist/extraction-judge-telemetry.d.ts +1 -1
  207. package/dist/extraction-judge-training.d.ts +1 -1
  208. package/dist/extraction-judge.d.ts +1 -1
  209. package/dist/extraction-liveness.d.ts +1 -1
  210. package/dist/extraction-normalization.d.ts +1 -1
  211. package/dist/extraction-prompt.d.ts +1 -1
  212. package/dist/extraction-source-grounding-rules.d.ts +1 -1
  213. package/dist/extraction-source-grounding.d.ts +1 -1
  214. package/dist/extraction.d.ts +1 -1
  215. package/dist/extraction.js +13 -13
  216. package/dist/fallback-llm.d.ts +1 -1
  217. package/dist/graph-dashboard-diff.d.ts +1 -1
  218. package/dist/graph-dashboard-key.d.ts +1 -1
  219. package/dist/graph-dashboard-parser.d.ts +1 -1
  220. package/dist/graph-edge-reinforcement.d.ts +1 -1
  221. package/dist/graph-path-reconstruction.d.ts +1 -1
  222. package/dist/graph-path-scoring.d.ts +1 -1
  223. package/dist/graph-snapshot.d.ts +1 -1
  224. package/dist/graph.d.ts +1 -1
  225. package/dist/harmonic-retrieval.js +1 -1
  226. package/dist/importance.d.ts +1 -1
  227. package/dist/importers/index.d.ts +1 -1
  228. package/dist/in-flight-reads.d.ts +1 -1
  229. package/dist/index.d.ts +33 -24
  230. package/dist/index.js +120 -84
  231. package/dist/intent.d.ts +1 -1
  232. package/dist/lcm/engine.d.ts +1 -1
  233. package/dist/lcm/engine.js +3 -3
  234. package/dist/lcm/index.d.ts +1 -1
  235. package/dist/lcm/index.js +11 -11
  236. package/dist/lcm/tools.d.ts +1 -1
  237. package/dist/lifecycle.d.ts +1 -1
  238. package/dist/live-connectors-runner.d.ts +1 -1
  239. package/dist/local-llm.d.ts +1 -1
  240. package/dist/local-model-endpoint.d.ts +1 -1
  241. package/dist/maintenance/memory-governance.d.ts +1 -1
  242. package/dist/maintenance/memory-governance.js +10 -10
  243. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
  244. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -10
  245. package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
  246. package/dist/maintenance/rebuild-memory-projection.js +11 -11
  247. package/dist/{maintenance-BNq31xpo.d.ts → maintenance-DITiehFX.d.ts} +3 -3
  248. package/dist/mcp-memory-inspector-app.d.ts +12 -11
  249. package/dist/mcp-read-only-tools.js +1 -1
  250. package/dist/memory-action-policy.d.ts +1 -1
  251. package/dist/memory-cache.d.ts +1 -1
  252. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  253. package/dist/memory-projection-store.d.ts +1 -1
  254. package/dist/memory-provenance.d.ts +1 -1
  255. package/dist/memory-snapshot.d.ts +1 -1
  256. package/dist/memory-worth-outcomes.d.ts +2 -2
  257. package/dist/models-json.d.ts +1 -1
  258. package/dist/namespaces/migrate.d.ts +3 -3
  259. package/dist/namespaces/migrate.js +11 -11
  260. package/dist/namespaces/principal.d.ts +1 -1
  261. package/dist/namespaces/search.d.ts +1 -1
  262. package/dist/namespaces/search.js +7 -7
  263. package/dist/namespaces/storage.d.ts +3 -3
  264. package/dist/namespaces/storage.js +10 -10
  265. package/dist/native-knowledge.d.ts +1 -1
  266. package/dist/offline-sync-impression-drain.d.ts +1 -1
  267. package/dist/operator-doctor-corpus.d.ts +1 -1
  268. package/dist/operator-doctor-corpus.js +13 -13
  269. package/dist/operator-doctor-replica.d.ts +1 -1
  270. package/dist/operator-toolkit.d.ts +3 -3
  271. package/dist/operator-toolkit.js +19 -19
  272. package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
  273. package/dist/orchestration/maintenance.d.ts +4 -4
  274. package/dist/orchestration/maintenance.js +16 -16
  275. package/dist/{orchestrator-CBuUOP2J.d.ts → orchestrator-6fPa2l9x.d.ts} +8 -8
  276. package/dist/orchestrator.d.ts +9 -9
  277. package/dist/orchestrator.js +74 -72
  278. package/dist/patterns-cli.d.ts +1 -1
  279. package/dist/{pipeline-CW_Q4WvX.d.ts → pipeline-DHpYtfM3.d.ts} +1 -1
  280. package/dist/policy-runtime.d.ts +1 -1
  281. package/dist/proactive-contention.d.ts +1 -1
  282. package/dist/provenance.d.ts +1 -1
  283. package/dist/{public-http-BeJ1_JI1.d.ts → public-http-BT36aBb-.d.ts} +1 -1
  284. package/dist/{qmd-q-cAzYuC.d.ts → qmd-BaX31tM0.d.ts} +1 -1
  285. package/dist/qmd-preflight.d.ts +2 -2
  286. package/dist/qmd-recall-cache.d.ts +1 -1
  287. package/dist/qmd.d.ts +2 -2
  288. package/dist/recall-concurrency-config.d.ts +1 -1
  289. package/dist/recall-disclosure-escalation.d.ts +1 -1
  290. package/dist/recall-explain-renderer.d.ts +1 -1
  291. package/dist/recall-explain-renderer.js +3 -3
  292. package/dist/recall-memory-map.d.ts +1 -1
  293. package/dist/recall-planner-llm.d.ts +1 -1
  294. package/dist/recall-state.d.ts +1 -1
  295. package/dist/recall-tag-filter.d.ts +1 -1
  296. package/dist/recall-timings.d.ts +1 -1
  297. package/dist/recall-xray-cli.d.ts +1 -1
  298. package/dist/recall-xray-cli.js +4 -4
  299. package/dist/recall-xray-renderer.d.ts +1 -1
  300. package/dist/recall-xray-renderer.js +3 -3
  301. package/dist/recall-xray.d.ts +1 -1
  302. package/dist/recall-xray.js +2 -2
  303. package/dist/reconcile/cursor.d.ts +1 -1
  304. package/dist/reconcile/manifest.d.ts +1 -1
  305. package/dist/reconcile/plan.d.ts +1 -1
  306. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  307. package/dist/replay/normalizers/claude.d.ts +1 -1
  308. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  309. package/dist/replay/normalizers/shared.d.ts +1 -1
  310. package/dist/replay/runner.d.ts +1 -1
  311. package/dist/replay/types.d.ts +1 -1
  312. package/dist/replica-divergence.d.ts +1 -1
  313. package/dist/replica-peers-config.d.ts +1 -1
  314. package/dist/resolve-auth-token.d.ts +1 -1
  315. package/dist/resume-bundles.js +2 -2
  316. package/dist/retrieval-agents.d.ts +2 -2
  317. package/dist/retrieval-tiers.d.ts +1 -1
  318. package/dist/routing/engine.d.ts +1 -1
  319. package/dist/routing/store.d.ts +1 -1
  320. package/dist/salvage-envelope.d.ts +1 -1
  321. package/dist/{scope-profiles-CIr4mXgp.d.ts → scope-profiles-1hYWJ9bM.d.ts} +1 -1
  322. package/dist/search/embed-helper.d.ts +1 -1
  323. package/dist/search/factory.d.ts +1 -1
  324. package/dist/search/factory.js +6 -6
  325. package/dist/search/index.d.ts +1 -1
  326. package/dist/search/index.js +10 -10
  327. package/dist/search/lancedb-backend.d.ts +1 -1
  328. package/dist/search/lancedb-backend.js +2 -2
  329. package/dist/search/meilisearch-backend.d.ts +1 -1
  330. package/dist/search/meilisearch-backend.js +2 -2
  331. package/dist/search/noop-backend.d.ts +1 -1
  332. package/dist/search/orama-backend.d.ts +1 -1
  333. package/dist/search/orama-backend.js +2 -2
  334. package/dist/search/port.d.ts +1 -1
  335. package/dist/search/remote-backend.d.ts +1 -1
  336. package/dist/{semantic-consolidation-BZ6J46j-.d.ts → semantic-consolidation-Chmddvcg.d.ts} +1 -1
  337. package/dist/semantic-consolidation.d.ts +2 -2
  338. package/dist/semantic-consolidation.js +11 -11
  339. package/dist/semantic-rule-promotion.js +10 -10
  340. package/dist/semantic-rule-verifier.d.ts +1 -1
  341. package/dist/semantic-rule-verifier.js +10 -10
  342. package/dist/{service-CCl4iyyY.d.ts → service-DMs_dCCg.d.ts} +2 -2
  343. package/dist/session-observer-bands.d.ts +1 -1
  344. package/dist/session-observer-state.d.ts +1 -1
  345. package/dist/shared-context/manager.d.ts +1 -1
  346. package/dist/signal.d.ts +1 -1
  347. package/dist/source-agent-qualifier.d.ts +1 -1
  348. package/dist/source-agent-qualifier.js +12 -12
  349. package/dist/{storage-BPXmJKIt.d.ts → storage-CzorrpcN.d.ts} +12 -3
  350. package/dist/storage.d.ts +2 -2
  351. package/dist/storage.js +9 -9
  352. package/dist/summarizer.d.ts +1 -1
  353. package/dist/summary-snapshot.d.ts +1 -1
  354. package/dist/support-passport/index.d.ts +15 -14
  355. package/dist/support-passport/index.js +27 -26
  356. package/dist/temporal-supersession.d.ts +2 -2
  357. package/dist/temporal-timeline-recall.d.ts +1 -1
  358. package/dist/temporal-validity.d.ts +1 -1
  359. package/dist/threading.d.ts +1 -1
  360. package/dist/tier-migration.d.ts +2 -2
  361. package/dist/tier-routing.d.ts +1 -1
  362. package/dist/topics.d.ts +1 -1
  363. package/dist/transcript.d.ts +1 -1
  364. package/dist/transfer/backup.js +2 -2
  365. package/dist/transfer/capsule-export.js +2 -2
  366. package/dist/transfer/capsule-import.js +2 -2
  367. package/dist/trust-score-stage.d.ts +1 -1
  368. package/dist/trust-score.d.ts +1 -1
  369. package/dist/{types-CltSWcND.d.ts → types-BP5MC8UU.d.ts} +34 -8
  370. package/dist/types.d.ts +1 -1
  371. package/dist/types.js +1 -1
  372. package/dist/utility-runtime.d.ts +1 -1
  373. package/dist/verified-recall.js +10 -10
  374. package/dist/who-knows-cli.d.ts +155 -0
  375. package/dist/who-knows-cli.js +109 -0
  376. package/dist/who-knows-cli.js.map +1 -0
  377. package/dist/who-knows.d.ts +127 -0
  378. package/dist/who-knows.js +118 -0
  379. package/dist/who-knows.js.map +1 -0
  380. package/dist/write-envelope.d.ts +1 -1
  381. package/package.json +2 -2
  382. package/src/access-boundary.ts +1 -0
  383. package/src/access-http.ts +15 -0
  384. package/src/access-mcp-output-schemas.ts +1 -0
  385. package/src/access-mcp.ts +3 -2
  386. package/src/access-operations-batch.ts +8 -0
  387. package/src/access-service.ts +26 -0
  388. package/src/access-surface-catalog.ts +2 -0
  389. package/src/cli/okf-commands.ts +23 -0
  390. package/src/cli.ts +2 -1
  391. package/src/config.ts +7 -7
  392. package/src/index.ts +3 -0
  393. package/src/location/cli.ts +163 -0
  394. package/src/location/config.test.ts +75 -0
  395. package/src/location/config.ts +105 -0
  396. package/src/location/intervals.test.ts +202 -0
  397. package/src/location/intervals.ts +221 -0
  398. package/src/location/parse-companions.ts +12 -0
  399. package/src/location/pipeline.test.ts +324 -0
  400. package/src/location/pipeline.ts +245 -0
  401. package/src/location/recall-exclusion.test.ts +36 -0
  402. package/src/location/registry.test.ts +74 -0
  403. package/src/location/registry.ts +54 -0
  404. package/src/location/store.test.ts +170 -0
  405. package/src/location/store.ts +478 -0
  406. package/src/location/types.ts +95 -0
  407. package/src/mcp-read-only-tools.ts +1 -0
  408. package/src/okf/cli.ts +42 -0
  409. package/src/okf/config.ts +34 -0
  410. package/src/okf/lint.ts +110 -0
  411. package/src/okf/sweep.ts +63 -0
  412. package/src/okf/type-mapping.test.ts +207 -0
  413. package/src/okf/type-mapping.ts +79 -0
  414. package/src/orchestration/generic-recall-paths.ts +17 -0
  415. package/src/orchestration/orchestrator-helpers.ts +22 -0
  416. package/src/orchestration/qmd-result-resolver.ts +1 -0
  417. package/src/orchestrator.ts +2 -0
  418. package/src/storage/entity-store.ts +9 -5
  419. package/src/storage/profile-header.ts +33 -9
  420. package/src/storage/questions-file.ts +50 -0
  421. package/src/storage.ts +76 -63
  422. package/src/types.ts +6 -8
  423. package/src/who-knows-cli.ts +96 -0
  424. package/src/who-knows.test.ts +257 -0
  425. package/src/who-knows.ts +364 -0
  426. package/dist/chunk-5SZ6CLGJ.js.map +0 -1
  427. package/dist/chunk-AR253JBM.js.map +0 -1
  428. package/dist/chunk-BB2LH5JM.js.map +0 -1
  429. package/dist/chunk-GIMQJ5RX.js.map +0 -1
  430. package/dist/chunk-HIEWDJ2O.js.map +0 -1
  431. package/dist/chunk-ML4MI2RR.js.map +0 -1
  432. package/dist/chunk-QATILW4B.js.map +0 -1
  433. package/dist/chunk-QFPX7QZG.js.map +0 -1
  434. package/dist/chunk-S6KMN6MJ.js.map +0 -1
  435. package/dist/chunk-VD2OT77P.js.map +0 -1
  436. package/dist/chunk-ZWYXSF2T.js.map +0 -1
  437. /package/dist/{capsule-crypto-GWVG7LGC.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
  438. /package/dist/{chunk-BTUIHRRR.js.map → chunk-246HFJVG.js.map} +0 -0
  439. /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
  440. /package/dist/{chunk-6NMZXEJ7.js.map → chunk-3A46U7XG.js.map} +0 -0
  441. /package/dist/{chunk-Z3Q5I5F6.js.map → chunk-44DSGZFF.js.map} +0 -0
  442. /package/dist/{chunk-VENMDW4U.js.map → chunk-55SJFHVD.js.map} +0 -0
  443. /package/dist/{chunk-VCBG52MM.js.map → chunk-5HERQ5FX.js.map} +0 -0
  444. /package/dist/{chunk-IRXMJLTW.js.map → chunk-5HK3CJAR.js.map} +0 -0
  445. /package/dist/{chunk-KG2CT762.js.map → chunk-6LTCUN3T.js.map} +0 -0
  446. /package/dist/{chunk-UUYQWKHO.js.map → chunk-7BVO64UC.js.map} +0 -0
  447. /package/dist/{chunk-X6HNXVXS.js.map → chunk-7V3AZWWZ.js.map} +0 -0
  448. /package/dist/{chunk-EHC3FIJ4.js.map → chunk-A2IBK3TG.js.map} +0 -0
  449. /package/dist/{chunk-6BV6ZZZA.js.map → chunk-C6AKYOFO.js.map} +0 -0
  450. /package/dist/{chunk-7ML7STOD.js.map → chunk-CKZHKFY3.js.map} +0 -0
  451. /package/dist/{chunk-CUDSA46O.js.map → chunk-CUIAHZPZ.js.map} +0 -0
  452. /package/dist/{chunk-2BRCV2IV.js.map → chunk-DG6MJD7W.js.map} +0 -0
  453. /package/dist/{chunk-YGSDWO3U.js.map → chunk-DHKV6E4A.js.map} +0 -0
  454. /package/dist/{chunk-DZFPHARJ.js.map → chunk-EJDLQRUO.js.map} +0 -0
  455. /package/dist/{chunk-BPLPGOUJ.js.map → chunk-GVRLED7R.js.map} +0 -0
  456. /package/dist/{chunk-YINSSARY.js.map → chunk-H5CGAD7L.js.map} +0 -0
  457. /package/dist/{chunk-QICOU4RY.js.map → chunk-IFK3PVM7.js.map} +0 -0
  458. /package/dist/{chunk-E7MYSCSL.js.map → chunk-IJXECCUV.js.map} +0 -0
  459. /package/dist/{chunk-RKNJBZ55.js.map → chunk-JBPKEARU.js.map} +0 -0
  460. /package/dist/{chunk-WQ6TRWAE.js.map → chunk-JCSUNXYJ.js.map} +0 -0
  461. /package/dist/{chunk-5W7CTZ2E.js.map → chunk-KQAFEZQX.js.map} +0 -0
  462. /package/dist/{chunk-6IKXAAJI.js.map → chunk-KRPE7ANR.js.map} +0 -0
  463. /package/dist/{chunk-FEP45MYY.js.map → chunk-LOETWOEB.js.map} +0 -0
  464. /package/dist/{chunk-4IIDTPSK.js.map → chunk-LZKCMK3U.js.map} +0 -0
  465. /package/dist/{chunk-K547KS3X.js.map → chunk-ML3U4KPR.js.map} +0 -0
  466. /package/dist/{chunk-BTBAHTQ5.js.map → chunk-NO7B6DRB.js.map} +0 -0
  467. /package/dist/{chunk-G5F4MXXC.js.map → chunk-ON2P3SHG.js.map} +0 -0
  468. /package/dist/{chunk-2Q4UAPLD.js.map → chunk-OQIRBGUU.js.map} +0 -0
  469. /package/dist/{chunk-PQODT53H.js.map → chunk-PE76XIDM.js.map} +0 -0
  470. /package/dist/{chunk-MVIYRRVJ.js.map → chunk-PMVPCZJZ.js.map} +0 -0
  471. /package/dist/{chunk-CK3DZ6OE.js.map → chunk-PVIXAMWM.js.map} +0 -0
  472. /package/dist/{chunk-HZXO2CJ6.js.map → chunk-RWLRKMZK.js.map} +0 -0
  473. /package/dist/{chunk-SYU5JOBQ.js.map → chunk-SB6YBB2V.js.map} +0 -0
  474. /package/dist/{chunk-3F3CVVDS.js.map → chunk-SHQFYZTD.js.map} +0 -0
  475. /package/dist/{chunk-R7XE5ZUR.js.map → chunk-UIYYS2YI.js.map} +0 -0
  476. /package/dist/{chunk-G5OB4XZX.js.map → chunk-VANZKHTN.js.map} +0 -0
  477. /package/dist/{chunk-7DRSWPUV.js.map → chunk-VUP47UJI.js.map} +0 -0
  478. /package/dist/{chunk-65NQFK7D.js.map → chunk-WBM5NR4E.js.map} +0 -0
  479. /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
  480. /package/dist/{chunk-63JMI45N.js.map → chunk-XBRGJJK7.js.map} +0 -0
  481. /package/dist/{chunk-WCWIV2JH.js.map → chunk-XH4IQVTN.js.map} +0 -0
  482. /package/dist/{chunk-77E7LLMV.js.map → chunk-XZUCNVGE.js.map} +0 -0
  483. /package/dist/{chunk-LJQGQUNS.js.map → chunk-YFQTDE7N.js.map} +0 -0
  484. /package/dist/{chunk-5OOTHWGJ.js.map → chunk-YXGU3MDQ.js.map} +0 -0
  485. /package/dist/{chunk-SRLQROQJ.js.map → chunk-Z6CJLYXT.js.map} +0 -0
  486. /package/dist/{chunk-Z4UPRZR6.js.map → chunk-ZSYE2QVJ.js.map} +0 -0
package/src/access-mcp.ts CHANGED
@@ -45,6 +45,7 @@ import { applyToolOutputSchemas } from "./access-mcp-output-schemas.js";
45
45
  import { MCP_READ_ONLY_TOOL_SUFFIXES } from "./mcp-read-only-tools.js";
46
46
  import { MEETINGS_MCP_TOOLS } from "./meetings/mcp-tools.js";
47
47
  import { WEARABLES_MCP_TOOLS } from "./wearables/mcp-tools.js";
48
+ import { WHO_KNOWS_MCP_TOOLS } from "./who-knows.js";
48
49
  import { EXTERNAL_WIKI_MCP_TOOLS } from "./external-wiki-mcp-tools.js";
49
50
  import { abortError, isAbortError } from "./abort-error.js";
50
51
  import { SUPPORT_PASSPORT_MCP_MIGRATED_OPERATIONS, SUPPORT_PASSPORT_MCP_TOOLS } from "./support-passport/mcp-tools.js";
@@ -186,7 +187,7 @@ const MCP_MIGRATED_OPERATIONS: Readonly<Record<string, OperationName>> = {
186
187
  "engram.recall_explain": "recall_explain",
187
188
  "engram.set_coding_context": "set_coding_context",
188
189
  "engram.recall_tier_explain": "recall_tier_explain",
189
- "engram.recall_xray": "recall_xray",
190
+ "engram.recall_xray": "recall_xray", "engram.who_knows": "who_knows",
190
191
  "engram.wearables_status": "wearables_status",
191
192
  "engram.wearables_sync": "wearables_sync",
192
193
  "engram.transcript_day": "transcript_day",
@@ -705,7 +706,7 @@ export class EngramMcpServer {
705
706
  additionalProperties: false,
706
707
  },
707
708
  },
708
- ...WEARABLES_MCP_TOOLS, ...MEETINGS_MCP_TOOLS,
709
+ ...WEARABLES_MCP_TOOLS, ...MEETINGS_MCP_TOOLS, ...WHO_KNOWS_MCP_TOOLS,
709
710
  ...(service.supportPassportEnabled ? SUPPORT_PASSPORT_MCP_TOOLS : []),
710
711
  {
711
712
  name: "engram.action_confidence",
@@ -139,6 +139,14 @@ defineOperation({ name: "recall_xray", description: "X-ray recall.", schema: str
139
139
  return { result: await ctx.service.recallXray({ query: defStr(input.query, ""), sessionKey: optStr(input.sessionKey), namespace: optStr(input.namespace), budget, authenticatedPrincipal: ctx.authenticatedPrincipal, sourceConnector: ctx.sourceConnector, ...(dr && dr !== "" ? { disclosure: dr as RecallDisclosure } : {}), ...(ctx.abortSignal ? { abortSignal: ctx.abortSignal } : {}) }) };
140
140
  },
141
141
  });
142
+ defineOperation({ name: "who_knows", description: "Rank entities by demonstrated expertise for a topic (#2057).", schema: strictSchema({ topic: S.str, limit: S.flexNum, namespace: S.str }),
143
+ handler: async (input, ctx) => {
144
+ const topic = defStr(input.topic, "");
145
+ let limit: number | undefined;
146
+ if (input.limit !== undefined) { const p = typeof input.limit === "number" ? input.limit : Number(input.limit); if (!Number.isInteger(p) || p < 1) throw new EngramAccessInputError("who_knows: limit expects a positive integer"); limit = p; }
147
+ return { result: await ctx.service.whoKnows({ topic, ...(limit !== undefined ? { limit } : {}), namespace: optStr(input.namespace), authenticatedPrincipal: ctx.authenticatedPrincipal }) };
148
+ },
149
+ });
142
150
  defineOperation({ name: "namespace_writable", description: "Read-only preflight: is a namespace writable for the caller's principal?", allowedByOps: ["namespace_writable", "observe", "memory_store"], schema: strictSchema({ namespace: S.str, sessionKey: S.str, op: S.str, cwd: S.str, projectTag: S.str }), handler: async (input, ctx) => {
143
151
  const writeOp = parseNamespacePreflightWriteOp(optStr(input.op));
144
152
  const namespace = optStr(input.namespace);
@@ -304,6 +304,7 @@ import { decideDisclosureEscalation } from "./recall-disclosure-escalation.js";
304
304
  import { toRecallExplainJson } from "./recall-explain-renderer.js";
305
305
  import { type TagMatchMode, applyTagFilter, normalizeTags, parseTagMatch } from "./recall-tag-filter.js";
306
306
  import { type RecallXraySnapshot, estimateRecallTokens } from "./recall-xray.js";
307
+ import { computeWhoKnows, loadWhoKnowsEntities, validateWhoKnowsInput, WHO_KNOWS_DEFAULT_LIMIT, type WhoKnowsResult } from "./who-knows.js";
307
308
  import { SupportPassportAccessServiceBase } from "./support-passport/access-service-base.js";
308
309
  import {
309
310
  type ExportCapsuleOptions,
@@ -2712,6 +2713,31 @@ export class EngramAccessService extends SupportPassportAccessServiceBase {
2712
2713
  }> {
2713
2714
  return this.accessRecallSurface.recallXray(request);
2714
2715
  }
2716
+
2717
+ /**
2718
+ * Rank entities by demonstrated expertise for a topic (issue #2057).
2719
+ * Deterministic — no LLM, no QMD. Reads the namespace-scoped corpus and
2720
+ * entity files only; namespace resolution + ACL mirror recall semantics
2721
+ * (`resolveReadableNamespace`), so a principal cannot rank outside a
2722
+ * namespace it cannot read.
2723
+ */
2724
+ async whoKnows(request: {
2725
+ topic: string;
2726
+ limit?: number;
2727
+ namespace?: string;
2728
+ authenticatedPrincipal?: string;
2729
+ }): Promise<WhoKnowsResult> {
2730
+ const topic = request.topic?.trim() ?? "";
2731
+ const limit = request.limit ?? WHO_KNOWS_DEFAULT_LIMIT;
2732
+ validateWhoKnowsInput(topic, limit);
2733
+ const resolvedNamespace = this.resolveReadableNamespace(request.namespace, request.authenticatedPrincipal);
2734
+ const storage = await this.orchestrator.getStorage(resolvedNamespace);
2735
+ const [memories, entities] = await Promise.all([
2736
+ storage.readAllMemories(),
2737
+ loadWhoKnowsEntities(storage, this.orchestrator.config.entitySchemas),
2738
+ ]);
2739
+ return computeWhoKnows({ topic, limit, memories, entities });
2740
+ }
2715
2741
  async memoryStore(
2716
2742
  request: EngramAccessMemoryStoreRequest,
2717
2743
  hooks?: { enforceWriteQuota?: () => void | Promise<void> }
@@ -56,6 +56,7 @@ export const MCP_TOOLS: readonly McpToolEntry[] = [
56
56
  { tool: "set_coding_context", operation: "set_coding_context" },
57
57
  { tool: "recall_tier_explain", operation: "recall_tier_explain" },
58
58
  { tool: "recall_xray", operation: "recall_xray" },
59
+ { tool: "who_knows", operation: "who_knows" },
59
60
  { tool: "wearables_status", operation: "wearables_status" },
60
61
  { tool: "wearables_sync", operation: "wearables_sync" },
61
62
  { tool: "transcript_day", operation: "transcript_day" },
@@ -210,6 +211,7 @@ export const HTTP_ROUTES: readonly HttpRouteEntry[] = [
210
211
  { method: "POST", pathname: "/engram/v1/action-confidence", operation: "action_confidence" },
211
212
  { method: "GET", pathname: "/engram/v1/recall/tier-explain", operation: "recall_tier_explain" },
212
213
  { method: "GET", pathname: "/engram/v1/recall/xray", operation: "recall_xray" },
214
+ { method: "GET", pathname: "/engram/v1/who-knows", operation: "who_knows" },
213
215
  { method: "GET", pathname: "/engram/v1/namespace/writable", operation: "namespace_writable" },
214
216
  { method: "GET", pathname: "/engram/v1/wearables/status", operation: "wearables_status" },
215
217
  { method: "POST", pathname: "/engram/v1/wearables/sync", operation: "wearables_sync" },
@@ -0,0 +1,23 @@
1
+ import type { Orchestrator } from "../orchestrator.js";
2
+ import type { CliCommand } from "../cli.js";
3
+ import { runOkfCliCommand } from "../okf/cli.js";
4
+
5
+ export function registerOkfCommands(cmd: CliCommand, orchestrator: Orchestrator): void {
6
+ const okfCmd = cmd.command("okf").description("OKF v0.1 conformance (lint, sweep)");
7
+ const forward = async (argv: string[]): Promise<void> => {
8
+ const code = await runOkfCliCommand(argv, { stdout: process.stdout, stderr: process.stderr }, {
9
+ memoryDir: orchestrator.config.memoryDir,
10
+ conformanceEnabled: orchestrator.config.okf.conformanceEnabled,
11
+ sweepEnabled: orchestrator.config.okf.sweepEnabled,
12
+ });
13
+ if (code !== 0) process.exitCode = code;
14
+ };
15
+ okfCmd.command("lint").description("Report OKF conformance findings").option("--json", "JSON output").action(async (...args: unknown[]) => {
16
+ const options = (args[0] ?? {}) as Record<string, unknown>;
17
+ await forward(["lint", ...(options.json === true ? ["--json"] : [])]);
18
+ });
19
+ okfCmd.command("sweep").description("Add missing type fields without bumping updated").option("--json", "JSON output").action(async (...args: unknown[]) => {
20
+ const options = (args[0] ?? {}) as Record<string, unknown>;
21
+ await forward(["sweep", ...(options.json === true ? ["--json"] : [])]);
22
+ });
23
+ }
package/src/cli.ts CHANGED
@@ -15,6 +15,7 @@ import { utcDayRange } from "./transcript.js";
15
15
  import { padEndDisplay, truncateGraphemeSafe } from "./whitespace.js";
16
16
  import { runWearablesCliCommand } from "./wearables/cli.js";
17
17
  import { registerMeetingsCommands } from "./cli/meetings-commands.js";
18
+ import { registerOkfCommands } from "./cli/okf-commands.js";
18
19
  import { registerResearchStatusCommands } from "./cli/research-status-commands.js";
19
20
  import { registerCreationLedgerCommands } from "./cli/creation-ledger-commands.js";
20
21
  import type {
@@ -6227,7 +6228,7 @@ export function registerCli(
6227
6228
 
6228
6229
  registerResearchStatusCommands(cmd, orchestrator);
6229
6230
 
6230
- registerCreationLedgerCommands(cmd, orchestrator); registerMeetingsCommands(cmd, orchestrator);
6231
+ registerCreationLedgerCommands(cmd, orchestrator); registerMeetingsCommands(cmd, orchestrator); registerOkfCommands(cmd, orchestrator);
6231
6232
 
6232
6233
  cmd
6233
6234
  .command("trust-zone-promote")
package/src/config.ts CHANGED
@@ -61,9 +61,9 @@ import {
61
61
  resolveNamespaceCatalogEnabled,
62
62
  } from "./emit-legacy-tools.js";
63
63
  import { parseWearablesConfig } from "./wearables/config.js";
64
- import { parseMeetingsConfig } from "./meetings/config.js";
65
- import { parseActivityConfig } from "./activity/config.js";
66
- import { parseProvenanceConfig } from "./provenance.js";
64
+ import { parseCaptureCompanionConfigs } from "./location/parse-companions.js";
65
+ import { parseLocationConfig } from "./location/config.js";
66
+ import { parseOkfConfig } from "./okf/config.js";
67
67
  import { parseBoundedJsonlStateConfig } from "./bounded-jsonl-state.js";
68
68
  import { parseCodingKnowledgeConfig } from "./coding/coding-knowledge-config.js";
69
69
  import { parseChatConfig } from "./chat/chat-config.js";
@@ -516,7 +516,6 @@ function normalizeMemoryRelativeDir(raw: unknown, fallback: string): string {
516
516
  return normalized.length > 0 ? normalized : fallback;
517
517
  }
518
518
 
519
-
520
519
  function parseSemanticChunkingConfig(
521
520
  raw: unknown,
522
521
  ): Partial<SemanticChunkingConfigShape> {
@@ -1159,9 +1158,8 @@ export function parseConfig(
1159
1158
  recallMaxProcedures,
1160
1159
  };
1161
1160
  const wearables = parseWearablesConfig(cfg.wearables);
1162
- const activity = parseActivityConfig(cfg.activity);
1163
- const meetings = parseMeetingsConfig(cfg.meetings);
1164
- const provenance = parseProvenanceConfig(cfg.provenance);
1161
+ const { activity, meetings, provenance } = parseCaptureCompanionConfigs(cfg);
1162
+ const location = parseLocationConfig(cfg.location);
1165
1163
  // Coding-agent project/branch scoping (issue #569)
1166
1164
  const rawCodingMode =
1167
1165
  cfg.codingMode && typeof cfg.codingMode === "object" && !Array.isArray(cfg.codingMode)
@@ -2322,7 +2320,9 @@ export function parseConfig(
2322
2320
  converge: parseConvergeConfig(cfg.converge),
2323
2321
  wearables,
2324
2322
  meetings,
2323
+ okf: parseOkfConfig(cfg.okf),
2325
2324
  activity,
2325
+ location,
2326
2326
  provenance,
2327
2327
  // At-rest encryption (#690): coerceBool handles CLI string "true" (#36).
2328
2328
  secureStoreEnabled: coerceBool(cfg.secureStoreEnabled) === true,
package/src/index.ts CHANGED
@@ -499,6 +499,8 @@ export type {
499
499
  RecallXrayServedBy,
500
500
  RecallFilterTrace,
501
501
  } from "./recall-xray.js";
502
+ export * from "./who-knows.js";
503
+ export * from "./who-knows-cli.js";
502
504
 
503
505
  // ChatGPT Apps-compatible memory inspector demo.
504
506
  export {
@@ -1215,6 +1217,7 @@ export { runAuditMemoryCliCommand, runBulkImportCliCommand, type BulkImportCliCo
1215
1217
  export * from "./wearables/index.js";
1216
1218
  export * from "./activity/index.js";
1217
1219
  export * from "./meetings/index.js";
1220
+ export * from "./okf/cli.js";
1218
1221
 
1219
1222
  // ---------------------------------------------------------------------------
1220
1223
  // Shared importer base (issue #568)
@@ -0,0 +1,163 @@
1
+ /**
2
+ * Location surface helpers (issue #2044): status, provider health checks, and
3
+ * multi-day sync. Pure `@remnic/core` — no optional packages, no host CLI
4
+ * wiring; a host adapter (or the core CLI, in a later slice) renders these
5
+ * structured results into its own command surface.
6
+ */
7
+
8
+ import { getLocationProvider } from "./registry.js";
9
+ import { isValidLocationDate, localDayKey } from "./intervals.js";
10
+ import { listLocationDayDates, loadLocationSyncState, parseLocationDaySummary, readLocationDay } from "./store.js";
11
+ import { syncLocationDay, type LocationDaySyncOptions, type LocationSourceSyncResult } from "./pipeline.js";
12
+ import type { LocationConfig, LocationProvider } from "./types.js";
13
+
14
+ export interface LocationSourceStatus {
15
+ id: string;
16
+ enabled: boolean;
17
+ providerRegistered: boolean;
18
+ lastSyncedAtUtc?: string;
19
+ trackedDays: number;
20
+ }
21
+
22
+ export interface LocationDayStatus {
23
+ date: string;
24
+ sources: string[];
25
+ observationCount: number;
26
+ }
27
+
28
+ export interface LocationStatusReport {
29
+ enabled: boolean;
30
+ timezone: string;
31
+ sources: LocationSourceStatus[];
32
+ /** Stored day documents, newest first (at most `maxDays`). */
33
+ recentDays: LocationDayStatus[];
34
+ }
35
+
36
+ export interface LocationStatusOptions {
37
+ /** Provider lookup seam (defaults to the registry); tests inject doubles. */
38
+ getProvider?: (id: string) => LocationProvider | undefined;
39
+ /** Cap on day documents listed; defaults to 7. */
40
+ maxDays?: number;
41
+ now?: () => Date;
42
+ }
43
+
44
+ export async function locationStatus(
45
+ config: LocationConfig,
46
+ memoryDir: string,
47
+ options: LocationStatusOptions = {},
48
+ ): Promise<LocationStatusReport> {
49
+ const resolveProvider = options.getProvider ?? getLocationProvider;
50
+ const state = await loadLocationSyncState(memoryDir);
51
+ const sources: LocationSourceStatus[] = config.sources.map((source) => {
52
+ const sourceState = state.sources[source.id];
53
+ return {
54
+ id: source.id,
55
+ enabled: source.enabled,
56
+ providerRegistered: resolveProvider(source.id) !== undefined,
57
+ ...(sourceState?.lastSyncedAtUtc === undefined ? {} : { lastSyncedAtUtc: sourceState.lastSyncedAtUtc }),
58
+ trackedDays: Object.keys(sourceState?.days ?? {}).length,
59
+ };
60
+ });
61
+
62
+ const maxDays = options.maxDays ?? 7;
63
+ const recentDays: LocationDayStatus[] = [];
64
+ for (const date of (await listLocationDayDates(memoryDir)).slice(0, Math.max(0, maxDays))) {
65
+ const raw = await readLocationDay(memoryDir, date);
66
+ const summary = raw === null ? null : parseLocationDaySummary(raw);
67
+ recentDays.push({
68
+ date,
69
+ sources: summary?.sources ?? [],
70
+ observationCount: summary?.observationCount ?? 0,
71
+ });
72
+ }
73
+ return { enabled: config.enabled, timezone: config.timezone, sources, recentDays };
74
+ }
75
+
76
+ export interface LocationSourceCheckResult {
77
+ id: string;
78
+ ok: boolean;
79
+ detail?: string;
80
+ skipped?: "location-disabled" | "source-disabled" | "provider-not-registered";
81
+ }
82
+
83
+ export interface LocationCheckOptions {
84
+ signal?: AbortSignal;
85
+ getProvider?: (id: string) => LocationProvider | undefined;
86
+ }
87
+
88
+ /** Probe every configured provider's health. The master gate short-circuits. */
89
+ export async function checkLocationSources(
90
+ config: LocationConfig,
91
+ options: LocationCheckOptions = {},
92
+ ): Promise<LocationSourceCheckResult[]> {
93
+ if (!config.enabled) {
94
+ return config.sources.map((source) => ({ id: source.id, ok: false, skipped: "location-disabled" as const }));
95
+ }
96
+ const resolveProvider = options.getProvider ?? getLocationProvider;
97
+ const results: LocationSourceCheckResult[] = [];
98
+ for (const source of config.sources) {
99
+ if (!source.enabled) {
100
+ results.push({ id: source.id, ok: false, skipped: "source-disabled" });
101
+ continue;
102
+ }
103
+ const provider = resolveProvider(source.id);
104
+ if (provider === undefined) {
105
+ results.push({ id: source.id, ok: false, skipped: "provider-not-registered" });
106
+ continue;
107
+ }
108
+ try {
109
+ const check = await provider.verify(options.signal);
110
+ results.push({
111
+ id: source.id,
112
+ ok: check.ok,
113
+ ...(check.detail === undefined || check.detail.length === 0 ? {} : { detail: check.detail }),
114
+ });
115
+ } catch (error) {
116
+ results.push({ id: source.id, ok: false, detail: error instanceof Error ? error.name : "provider error" });
117
+ }
118
+ }
119
+ return results;
120
+ }
121
+
122
+ function shiftIsoDate(date: string, days: number): string {
123
+ const parsed = new Date(`${date}T00:00:00Z`);
124
+ parsed.setUTCDate(parsed.getUTCDate() + days);
125
+ return parsed.toISOString().slice(0, 10);
126
+ }
127
+
128
+ export interface LocationSyncRunOptions
129
+ extends Omit<LocationDaySyncOptions, "config" | "date" | "memoryDir"> {
130
+ config: LocationConfig;
131
+ memoryDir: string;
132
+ /** Exclusive end date (local YYYY-MM-DD); defaults to today in config.timezone. */
133
+ endDate?: string;
134
+ /** Number of days to sync ending at endDate; defaults to config.syncDays. */
135
+ days?: number;
136
+ now?: () => Date;
137
+ }
138
+ /**
139
+ * Sync the trailing `days` local days ending AT `endDate` (inclusive).
140
+ * `endDate` defaults to yesterday in config.timezone (today is incomplete);
141
+ * days run oldest-first so a failure stops before newer days, matching the
142
+ * incremental-sync intent of `syncDays`.
143
+ */
144
+ export async function syncLocation(
145
+ options: LocationSyncRunOptions,
146
+ ): Promise<Array<{ date: string; results: LocationSourceSyncResult[] }>> {
147
+ const { config, memoryDir, endDate, days, ...rest } = options;
148
+ if (endDate !== undefined && !isValidLocationDate(endDate)) {
149
+ throw new RangeError(`Invalid location endDate "${endDate}"; expected a real YYYY-MM-DD day.`);
150
+ }
151
+ const now = rest.now ?? (() => new Date());
152
+ const end = endDate ?? shiftIsoDate(localDayKey(now().toISOString(), config.timezone), -1);
153
+ const count = days ?? config.syncDays;
154
+ if (!Number.isInteger(count) || count < 1 || count > 90) {
155
+ throw new RangeError("location sync days must be an integer from 1 to 90");
156
+ }
157
+ const runs: Array<{ date: string; results: LocationSourceSyncResult[] }> = [];
158
+ for (let offset = count; offset >= 1; offset -= 1) {
159
+ const date = shiftIsoDate(end, -(offset - 1));
160
+ runs.push({ date, results: await syncLocationDay({ ...rest, config, memoryDir, date, now }) });
161
+ }
162
+ return runs;
163
+ }
@@ -0,0 +1,75 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+
4
+ import { defaultLocationConfig, parseLocationConfig } from "./config.js";
5
+
6
+ test("parseLocationConfig defaults to an inert configuration", () => {
7
+ assert.deepEqual(defaultLocationConfig(), {
8
+ enabled: false,
9
+ timezone: "UTC",
10
+ syncDays: 1,
11
+ retainCoordinates: false,
12
+ sources: [],
13
+ });
14
+ assert.deepEqual(parseLocationConfig(undefined), defaultLocationConfig());
15
+ assert.deepEqual(parseLocationConfig(null), defaultLocationConfig());
16
+ });
17
+
18
+ test("parseLocationConfig treats string false gates as disabled", () => {
19
+ assert.equal(parseLocationConfig({ enabled: "false", sources: [{ id: "reitti" }] }).enabled, false);
20
+ assert.equal(
21
+ parseLocationConfig({
22
+ enabled: true,
23
+ retainCoordinates: "0",
24
+ sources: [{ id: "reitti", enabled: "false" }],
25
+ }).retainCoordinates,
26
+ false,
27
+ );
28
+ });
29
+
30
+ test("parseLocationConfig rejects unrecognized gate values instead of defaulting", () => {
31
+ assert.throws(() => parseLocationConfig({ enabled: "maybe" }), TypeError);
32
+ assert.throws(() => parseLocationConfig({ retainCoordinates: 42 }), TypeError);
33
+ assert.throws(() => parseLocationConfig({ sources: [{ id: "reitti", enabled: "nope" }] }), TypeError);
34
+ });
35
+
36
+ test("parseLocationConfig validates the timezone at parse time", () => {
37
+ assert.throws(() => parseLocationConfig({ timezone: "Mars/Olympus" }), RangeError);
38
+ assert.equal(parseLocationConfig({ timezone: "America/Chicago" }).timezone, "America/Chicago");
39
+ assert.throws(() => parseLocationConfig({ timezone: "" }), TypeError);
40
+ });
41
+
42
+ test("parseLocationConfig enforces the syncDays integer range", () => {
43
+ assert.equal(parseLocationConfig({ syncDays: "3" }).syncDays, 3);
44
+ assert.throws(() => parseLocationConfig({ syncDays: 0 }), RangeError);
45
+ assert.throws(() => parseLocationConfig({ syncDays: 1.5 }), RangeError);
46
+ assert.throws(() => parseLocationConfig({ syncDays: 91 }), RangeError);
47
+ assert.throws(() => parseLocationConfig({ syncDays: "abc" }), TypeError);
48
+ });
49
+
50
+ test("parseLocationConfig requires a source when enabled", () => {
51
+ assert.throws(() => parseLocationConfig({ enabled: true }), RangeError);
52
+ assert.throws(() => parseLocationConfig({ enabled: true, sources: "reitti" }), TypeError);
53
+ const parsed = parseLocationConfig({ enabled: true, sources: [{ id: "reitti" }] });
54
+ assert.deepEqual(parsed.sources, [{ id: "reitti", enabled: true }]);
55
+ });
56
+
57
+ test("parseLocationConfig rejects malformed source entries", () => {
58
+ assert.throws(() => parseLocationConfig({ sources: [{ id: "" }] }), TypeError);
59
+ assert.throws(() => parseLocationConfig({ sources: [{}] }), TypeError);
60
+ assert.throws(() => parseLocationConfig({ sources: [{ id: "Bad_Id" }] }), RangeError);
61
+ assert.throws(() => parseLocationConfig({ sources: [{ id: "../escape" }] }), RangeError);
62
+ assert.throws(() => parseLocationConfig({ sources: ["reitti"] }), TypeError);
63
+ });
64
+
65
+ test("parseLocationConfig rejects duplicate source ids", () => {
66
+ assert.throws(
67
+ () => parseLocationConfig({ enabled: true, sources: [{ id: "reitti" }, { id: "reitti", enabled: false }] }),
68
+ RangeError,
69
+ );
70
+ });
71
+
72
+ test("parseLocationConfig rejects non-object blocks", () => {
73
+ assert.throws(() => parseLocationConfig("nope"), TypeError);
74
+ assert.throws(() => parseLocationConfig([1, 2]), TypeError);
75
+ });
@@ -0,0 +1,105 @@
1
+ import { coerceBooleanLike, coerceNumber } from "../connectors/coerce.js";
2
+ import { assertValidTimezone } from "../activity/digest.js";
3
+ import type { LocationConfig, LocationSourceConfig } from "./types.js";
4
+
5
+ const PROVIDER_ID_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
6
+
7
+ /** The inert default: disabled, UTC days, one day per run, no sources, no coordinates. */
8
+ export function defaultLocationConfig(): LocationConfig {
9
+ return {
10
+ enabled: false,
11
+ timezone: "UTC",
12
+ syncDays: 1,
13
+ retainCoordinates: false,
14
+ sources: [],
15
+ };
16
+ }
17
+
18
+ function asRecord(value: unknown, name: string): Record<string, unknown> {
19
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
20
+ throw new TypeError(`${name} must be an object`);
21
+ }
22
+ return value as Record<string, unknown>;
23
+ }
24
+
25
+ function optionalNonEmptyString(value: unknown, name: string): string | undefined {
26
+ if (value === undefined) return undefined;
27
+ if (typeof value !== "string" || value.length === 0) throw new TypeError(`${name} must be a non-empty string`);
28
+ return value;
29
+ }
30
+
31
+ function parseLocationSource(value: unknown): LocationSourceConfig {
32
+ const raw = asRecord(value, "location source");
33
+ const id = optionalNonEmptyString(raw.id, "location source id");
34
+ if (id === undefined) {
35
+ throw new TypeError("location source requires id");
36
+ }
37
+ if (!PROVIDER_ID_PATTERN.test(id)) {
38
+ throw new RangeError(
39
+ `location source id must be a lowercase kebab string (a-z, 0-9, hyphens): got "${id}"`,
40
+ );
41
+ }
42
+ const enabledValue = coerceBooleanLike(raw.enabled, "location source enabled");
43
+ if (raw.enabled !== undefined && enabledValue === undefined) {
44
+ throw new TypeError(`location source '${id}' enabled must be a boolean`);
45
+ }
46
+ return { id, enabled: enabledValue ?? true };
47
+ }
48
+
49
+ /**
50
+ * Parse the unified `location.*` block. `enabled` gates everything and
51
+ * requires at least one source; a source's own `enabled` gates that source
52
+ * only. `retainCoordinates` defaults to `false` — coordinates are privacy
53
+ * data and are dropped everywhere unless explicitly retained.
54
+ */
55
+ export function parseLocationConfig(raw: unknown): LocationConfig {
56
+ const defaults = defaultLocationConfig();
57
+ if (raw === undefined || raw === null) {
58
+ return { ...defaults };
59
+ }
60
+ const config = asRecord(raw, "location");
61
+ const enabledValue = coerceBooleanLike(config.enabled, "location.enabled");
62
+ if (config.enabled !== undefined && enabledValue === undefined) {
63
+ throw new TypeError("location.enabled must be a boolean");
64
+ }
65
+ const enabled = enabledValue ?? false;
66
+
67
+ const timezone = optionalNonEmptyString(config.timezone, "location.timezone") ?? "UTC";
68
+ // Validate the IANA zone at parse so a typo fails at config load, not
69
+ // mid-sync after some sources may already have advanced their state.
70
+ assertValidTimezone(timezone);
71
+
72
+ const syncDaysValue = coerceNumber(config.syncDays, "location.syncDays");
73
+ if (config.syncDays !== undefined && syncDaysValue === undefined) {
74
+ throw new TypeError("location.syncDays must be a finite number");
75
+ }
76
+ const syncDays = syncDaysValue ?? 1;
77
+ if (!Number.isInteger(syncDays) || syncDays < 1 || syncDays > 90) {
78
+ throw new RangeError("location.syncDays must be an integer from 1 to 90");
79
+ }
80
+
81
+ const retainCoordinatesValue = coerceBooleanLike(config.retainCoordinates, "location.retainCoordinates");
82
+ if (config.retainCoordinates !== undefined && retainCoordinatesValue === undefined) {
83
+ throw new TypeError("location.retainCoordinates must be a boolean");
84
+ }
85
+ const retainCoordinates = retainCoordinatesValue ?? false;
86
+
87
+ if (config.sources !== undefined && !Array.isArray(config.sources)) {
88
+ throw new TypeError("location.sources must be an array");
89
+ }
90
+ const sources = (config.sources ?? []).map(parseLocationSource);
91
+ // Day payloads and sync state are keyed on source id; two sources sharing
92
+ // an id would overwrite each other's state. Reject the collision at parse.
93
+ const ids = new Set<string>();
94
+ for (const source of sources) {
95
+ if (ids.has(source.id)) {
96
+ throw new RangeError(`location source id must be unique: ${source.id}`);
97
+ }
98
+ ids.add(source.id);
99
+ }
100
+ if (enabled && sources.length === 0) {
101
+ throw new RangeError("location.enabled requires at least one source");
102
+ }
103
+
104
+ return { enabled, timezone, syncDays, retainCoordinates, sources };
105
+ }