@remnic/core 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/access-cli.d.ts +13 -3
  4. package/dist/access-cli.js +90 -75
  5. package/dist/access-cli.js.map +1 -1
  6. package/dist/access-http.d.ts +10 -3
  7. package/dist/access-http.js +25 -18
  8. package/dist/access-mcp.d.ts +30 -3
  9. package/dist/access-mcp.js +16 -1
  10. package/dist/access-schema.d.ts +12 -12
  11. package/dist/access-schema.js +1 -1
  12. package/dist/access-service.d.ts +65 -4
  13. package/dist/access-service.js +21 -15
  14. package/dist/active-memory-bridge.d.ts +66 -0
  15. package/dist/active-memory-bridge.js +11 -0
  16. package/dist/active-recall.d.ts +96 -0
  17. package/dist/active-recall.js +308 -0
  18. package/dist/active-recall.js.map +1 -0
  19. package/dist/behavior-learner.js +1 -1
  20. package/dist/bootstrap.d.ts +6 -3
  21. package/dist/bootstrap.js +2 -2
  22. package/dist/boxes.js +2 -2
  23. package/dist/briefing.d.ts +169 -0
  24. package/dist/briefing.js +52 -0
  25. package/dist/briefing.js.map +1 -0
  26. package/dist/buffer.d.ts +19 -5
  27. package/dist/buffer.js +2 -2
  28. package/dist/calibration.js +6 -6
  29. package/dist/causal-behavior.js +5 -5
  30. package/dist/causal-chain.js +3 -3
  31. package/dist/causal-consolidation.d.ts +22 -2
  32. package/dist/causal-consolidation.js +36 -9
  33. package/dist/causal-consolidation.js.map +1 -1
  34. package/dist/causal-retrieval.js +6 -6
  35. package/dist/causal-trajectory-graph.js +1 -1
  36. package/dist/causal-trajectory.d.ts +14 -1
  37. package/dist/causal-trajectory.js +5 -1
  38. package/dist/{chunk-KWBU5S5U.js → chunk-2ODBA7MQ.js} +9 -3
  39. package/dist/chunk-2ODBA7MQ.js.map +1 -0
  40. package/dist/{chunk-6UJQNRIO.js → chunk-2VFW5K5U.js} +93 -36
  41. package/dist/chunk-2VFW5K5U.js.map +1 -0
  42. package/dist/chunk-3PG3H5TD.js +7 -0
  43. package/dist/chunk-3PG3H5TD.js.map +1 -0
  44. package/dist/{chunk-NTTLPF7F.js → chunk-3QFQGRHO.js} +5 -5
  45. package/dist/chunk-4DJQYKMN.js +187 -0
  46. package/dist/chunk-4DJQYKMN.js.map +1 -0
  47. package/dist/chunk-4KAN3GZ3.js +225 -0
  48. package/dist/chunk-4KAN3GZ3.js.map +1 -0
  49. package/dist/{chunk-ORZMT74A.js → chunk-4NRAJUDS.js} +11 -1
  50. package/dist/chunk-4NRAJUDS.js.map +1 -0
  51. package/dist/{chunk-B7LOFDVE.js → chunk-4WMCPJWX.js} +8 -3
  52. package/dist/chunk-4WMCPJWX.js.map +1 -0
  53. package/dist/{chunk-G3AG3KZN.js → chunk-5IZL4DCV.js} +2 -2
  54. package/dist/{chunk-BRK4ODMI.js → chunk-5NPGSAVB.js} +2 -2
  55. package/dist/chunk-6MKAMLQL.js +16 -0
  56. package/dist/chunk-6MKAMLQL.js.map +1 -0
  57. package/dist/{chunk-ESSMF2FR.js → chunk-6PFRXT4K.js} +15 -6
  58. package/dist/chunk-6PFRXT4K.js.map +1 -0
  59. package/dist/chunk-6ZH4TU6I.js +245 -0
  60. package/dist/chunk-6ZH4TU6I.js.map +1 -0
  61. package/dist/{chunk-V4YC4LUK.js → chunk-74JR4N5J.js} +175 -63
  62. package/dist/chunk-74JR4N5J.js.map +1 -0
  63. package/dist/{chunk-L5RPWGFK.js → chunk-7DHTMOND.js} +2 -2
  64. package/dist/{chunk-TVVVQQAK.js → chunk-7PA4OZEU.js} +53 -11
  65. package/dist/chunk-7PA4OZEU.js.map +1 -0
  66. package/dist/{chunk-Q6FETXJA.js → chunk-7SEAZFFB.js} +2 -2
  67. package/dist/chunk-ALXMCZEU.js +332 -0
  68. package/dist/chunk-ALXMCZEU.js.map +1 -0
  69. package/dist/{chunk-QANCTXQF.js → chunk-AYPYCLR7.js} +3 -3
  70. package/dist/{chunk-WWIQTB2Y.js → chunk-BKQJBXXX.js} +9 -2
  71. package/dist/chunk-BKQJBXXX.js.map +1 -0
  72. package/dist/{chunk-LP47L3ZX.js → chunk-BTY5RRRF.js} +7 -7
  73. package/dist/{chunk-SCHEKPYH.js → chunk-C2EFFULQ.js} +1 -1
  74. package/dist/{chunk-GJR6D6KC.js → chunk-D654IBA6.js} +2 -2
  75. package/dist/{chunk-UV2FO7J4.js → chunk-E6K4NIEU.js} +2 -2
  76. package/dist/{chunk-T4WRIV2C.js → chunk-EABGC2TL.js} +2 -2
  77. package/dist/chunk-ECKDIK5F.js +813 -0
  78. package/dist/chunk-ECKDIK5F.js.map +1 -0
  79. package/dist/chunk-EJI5XIBB.js +232 -0
  80. package/dist/chunk-EJI5XIBB.js.map +1 -0
  81. package/dist/{chunk-ONRU4L2N.js → chunk-FEMOX5AD.js} +2 -2
  82. package/dist/{chunk-IFFFR3MR.js → chunk-FSFEQI74.js} +3 -3
  83. package/dist/chunk-G4SK7DSQ.js +121 -0
  84. package/dist/chunk-G4SK7DSQ.js.map +1 -0
  85. package/dist/{chunk-UIYZ5T3I.js → chunk-GJQPH5G3.js} +8 -8
  86. package/dist/{chunk-2PO5ZRKV.js → chunk-GZCUW5IC.js} +16 -3
  87. package/dist/chunk-GZCUW5IC.js.map +1 -0
  88. package/dist/{chunk-IZME7KW2.js → chunk-HITJFT7E.js} +24 -10
  89. package/dist/{chunk-IZME7KW2.js.map → chunk-HITJFT7E.js.map} +1 -1
  90. package/dist/chunk-IQT3XTKW.js +121 -0
  91. package/dist/chunk-IQT3XTKW.js.map +1 -0
  92. package/dist/{chunk-BDFZXRSO.js → chunk-J4IYOZZ5.js} +15 -2
  93. package/dist/chunk-J4IYOZZ5.js.map +1 -0
  94. package/dist/{chunk-ZKYI7UVO.js → chunk-JR4ZC3G4.js} +2 -2
  95. package/dist/{chunk-UCYSTFZR.js → chunk-JRNQ3RNA.js} +2 -2
  96. package/dist/{chunk-UYSKNO6E.js → chunk-JROGC36Y.js} +15 -4
  97. package/dist/chunk-JROGC36Y.js.map +1 -0
  98. package/dist/{chunk-GPGBSNKM.js → chunk-K4FLSOR5.js} +2 -2
  99. package/dist/{chunk-M5ZBBBJI.js → chunk-KEG4GNGI.js} +2 -2
  100. package/dist/chunk-KVE7R4CG.js +320 -0
  101. package/dist/chunk-KVE7R4CG.js.map +1 -0
  102. package/dist/{chunk-L7WO3MZ4.js → chunk-KWP7T3DP.js} +2 -2
  103. package/dist/chunk-LAYN4LDC.js +267 -0
  104. package/dist/chunk-LAYN4LDC.js.map +1 -0
  105. package/dist/{chunk-PGK3VUHN.js → chunk-MTLYEMJB.js} +3 -2
  106. package/dist/chunk-MTLYEMJB.js.map +1 -0
  107. package/dist/{chunk-J47FNDR7.js → chunk-MYQWXITD.js} +7 -7
  108. package/dist/{chunk-YNI4S5WT.js → chunk-N53K2EXC.js} +2 -2
  109. package/dist/{chunk-763GUIOU.js → chunk-NBNN5GOB.js} +2 -2
  110. package/dist/{chunk-CXWFUJR2.js → chunk-NSB3WSYS.js} +125 -6
  111. package/dist/chunk-NSB3WSYS.js.map +1 -0
  112. package/dist/{chunk-KL4CP4SB.js → chunk-O5ETUNBT.js} +17 -5
  113. package/dist/chunk-O5ETUNBT.js.map +1 -0
  114. package/dist/{chunk-OOSWAUYB.js → chunk-ODWDQNRE.js} +2 -2
  115. package/dist/{chunk-ISY75RLM.js → chunk-OJFGVJS6.js} +288 -7
  116. package/dist/chunk-OJFGVJS6.js.map +1 -0
  117. package/dist/{chunk-HLBYLYRD.js → chunk-PAORGQRI.js} +70 -13
  118. package/dist/chunk-PAORGQRI.js.map +1 -0
  119. package/dist/{chunk-ZJLY4QSU.js → chunk-PMB3WGDL.js} +69 -6
  120. package/dist/chunk-PMB3WGDL.js.map +1 -0
  121. package/dist/{chunk-J3BT33K7.js → chunk-POBPGDWI.js} +5 -5
  122. package/dist/{chunk-QWUUMMIK.js → chunk-POMSFKTB.js} +1351 -76
  123. package/dist/chunk-POMSFKTB.js.map +1 -0
  124. package/dist/{chunk-OTAVQCSF.js → chunk-PYXS46O7.js} +2 -2
  125. package/dist/chunk-QDW3E4RD.js +108 -0
  126. package/dist/chunk-QDW3E4RD.js.map +1 -0
  127. package/dist/{chunk-YNCQ7E4M.js → chunk-QDYXG4CS.js} +4 -3
  128. package/dist/chunk-QDYXG4CS.js.map +1 -0
  129. package/dist/{chunk-XUHI52HK.js → chunk-QKAH5B6E.js} +4 -4
  130. package/dist/{chunk-HLXVTBF3.js → chunk-QNJMBKFK.js} +3 -2
  131. package/dist/chunk-QNJMBKFK.js.map +1 -0
  132. package/dist/chunk-RCICHSHL.js +789 -0
  133. package/dist/chunk-RCICHSHL.js.map +1 -0
  134. package/dist/{chunk-HG2NKWR2.js → chunk-S4LX5EBI.js} +2 -2
  135. package/dist/{chunk-4A24LIM2.js → chunk-S75M5ZRK.js} +2 -2
  136. package/dist/{chunk-QCCCQT3O.js → chunk-TBBDFYXW.js} +2 -2
  137. package/dist/chunk-TBBDFYXW.js.map +1 -0
  138. package/dist/{chunk-U4PV25RD.js → chunk-U2IQTSBY.js} +1 -1
  139. package/dist/chunk-U2IQTSBY.js.map +1 -0
  140. package/dist/chunk-U66YHYC7.js +31 -0
  141. package/dist/chunk-U66YHYC7.js.map +1 -0
  142. package/dist/{chunk-MWGVGUIS.js → chunk-UEYA6UC7.js} +36 -4
  143. package/dist/chunk-UEYA6UC7.js.map +1 -0
  144. package/dist/{chunk-MDDAA2AO.js → chunk-UPMD5XND.js} +2 -2
  145. package/dist/{chunk-M5KEYE5E.js → chunk-URB2WSKZ.js} +2 -2
  146. package/dist/chunk-UVJFDP7P.js +202 -0
  147. package/dist/chunk-UVJFDP7P.js.map +1 -0
  148. package/dist/{chunk-QY2BHY5O.js → chunk-V7XCAHIB.js} +265 -25
  149. package/dist/chunk-V7XCAHIB.js.map +1 -0
  150. package/dist/chunk-W6SL7OFG.js +180 -0
  151. package/dist/chunk-W6SL7OFG.js.map +1 -0
  152. package/dist/{chunk-QDOSNLB4.js → chunk-X4WESCKA.js} +17 -15
  153. package/dist/chunk-X4WESCKA.js.map +1 -0
  154. package/dist/{chunk-OTFNI3OO.js → chunk-XMGSSBFX.js} +1738 -383
  155. package/dist/chunk-XMGSSBFX.js.map +1 -0
  156. package/dist/chunk-YDBIWGNI.js +298 -0
  157. package/dist/chunk-YDBIWGNI.js.map +1 -0
  158. package/dist/chunk-YFYL2SIJ.js +7857 -0
  159. package/dist/chunk-YFYL2SIJ.js.map +1 -0
  160. package/dist/chunking.js +1 -1
  161. package/dist/citations.d.ts +67 -0
  162. package/dist/citations.js +13 -0
  163. package/dist/citations.js.map +1 -0
  164. package/dist/cli-DwIBnp2g.d.ts +1240 -0
  165. package/dist/cli.d.ts +31 -1147
  166. package/dist/cli.js +149 -7092
  167. package/dist/cli.js.map +1 -1
  168. package/dist/codex-materialize-CQlLTzke.d.ts +139 -0
  169. package/dist/codex-thread-key.d.ts +3 -0
  170. package/dist/codex-thread-key.js +7 -0
  171. package/dist/codex-thread-key.js.map +1 -0
  172. package/dist/config.js +3 -2
  173. package/dist/connectors/codex/instructions.md +160 -0
  174. package/dist/connectors/codex/resources/namespace-cheatsheet.md +48 -0
  175. package/dist/day-summary.d.ts +7 -2
  176. package/dist/day-summary.js +5 -2
  177. package/dist/embedding-fallback.d.ts +96 -2
  178. package/dist/embedding-fallback.js +6 -4
  179. package/dist/{engine-2A6J4XEX.js → engine-X7X3AAG3.js} +10 -7
  180. package/dist/engine-X7X3AAG3.js.map +1 -0
  181. package/dist/entity-retrieval.d.ts +3 -2
  182. package/dist/entity-retrieval.js +10 -7
  183. package/dist/entity-schema.d.ts +11 -0
  184. package/dist/entity-schema.js +19 -0
  185. package/dist/entity-schema.js.map +1 -0
  186. package/dist/explicit-capture.d.ts +6 -3
  187. package/dist/explicit-capture.js +2 -2
  188. package/dist/extraction-judge.d.ts +66 -0
  189. package/dist/extraction-judge.js +18 -0
  190. package/dist/extraction-judge.js.map +1 -0
  191. package/dist/extraction.d.ts +1 -0
  192. package/dist/extraction.js +12 -10
  193. package/dist/fallback-llm.js +4 -4
  194. package/dist/graph.js +1 -1
  195. package/dist/importance.d.ts +11 -1
  196. package/dist/importance.js +3 -1
  197. package/dist/index.d.ts +1140 -8
  198. package/dist/index.js +3350 -333
  199. package/dist/index.js.map +1 -1
  200. package/dist/intent.d.ts +2 -1
  201. package/dist/intent.js +3 -1
  202. package/dist/lifecycle.js +1 -1
  203. package/dist/local-llm.js +2 -2
  204. package/dist/logger.d.ts +1 -1
  205. package/dist/logger.js +1 -1
  206. package/dist/memory-cache.d.ts +2 -2
  207. package/dist/memory-cache.js +1 -1
  208. package/dist/{memory-projection-store-NxMkbocT.d.ts → memory-projection-store-DeSXPh1j.d.ts} +1 -1
  209. package/dist/memory-projection-store.d.ts +1 -1
  210. package/dist/model-registry.js +2 -2
  211. package/dist/models-json.js +2 -2
  212. package/dist/native-knowledge.js +2 -2
  213. package/dist/negative.js +2 -2
  214. package/dist/operator-toolkit.js +20 -16
  215. package/dist/{orchestrator-zTa-Qo-1.d.ts → orchestrator-B9kwlCep.d.ts} +252 -7
  216. package/dist/orchestrator.d.ts +6 -3
  217. package/dist/orchestrator.js +70 -58
  218. package/dist/page-versioning.d.ts +77 -0
  219. package/dist/page-versioning.js +15 -0
  220. package/dist/page-versioning.js.map +1 -0
  221. package/dist/plugin-id.d.ts +37 -0
  222. package/dist/plugin-id.js +11 -0
  223. package/dist/plugin-id.js.map +1 -0
  224. package/dist/policy-runtime.js +2 -2
  225. package/dist/profiling.js +2 -2
  226. package/dist/qmd.d.ts +5 -2
  227. package/dist/qmd.js +3 -3
  228. package/dist/recall-audit.d.ts +20 -0
  229. package/dist/recall-audit.js +50 -0
  230. package/dist/recall-audit.js.map +1 -0
  231. package/dist/recall-mmr.d.ts +152 -0
  232. package/dist/recall-mmr.js +17 -0
  233. package/dist/recall-mmr.js.map +1 -0
  234. package/dist/recall-qos.js +2 -2
  235. package/dist/recall-state.js +2 -2
  236. package/dist/relevance.js +2 -2
  237. package/dist/resolve-provider-secret.js +2 -2
  238. package/dist/resume-bundles.js +5 -4
  239. package/dist/retrieval-agents.js +2 -2
  240. package/dist/retrieval.js +2 -2
  241. package/dist/schemas.d.ts +398 -40
  242. package/dist/schemas.js +3 -1
  243. package/dist/sdk-compat.d.ts +2 -0
  244. package/dist/sdk-compat.js +6 -3
  245. package/dist/sdk-compat.js.map +1 -1
  246. package/dist/semantic-chunking.d.ts +87 -0
  247. package/dist/semantic-chunking.js +20 -0
  248. package/dist/semantic-chunking.js.map +1 -0
  249. package/dist/semantic-consolidation-DrvSYRdB.d.ts +119 -0
  250. package/dist/semantic-consolidation.d.ts +4 -42
  251. package/dist/semantic-consolidation.js +23 -2
  252. package/dist/semantic-rule-promotion.js +9 -6
  253. package/dist/semantic-rule-verifier.js +10 -7
  254. package/dist/session-observer-state.js +2 -2
  255. package/dist/session-toggles.d.ts +22 -0
  256. package/dist/session-toggles.js +116 -0
  257. package/dist/session-toggles.js.map +1 -0
  258. package/dist/skills-registry.d.ts +47 -0
  259. package/dist/skills-registry.js +48 -0
  260. package/dist/skills-registry.js.map +1 -0
  261. package/dist/source-attribution.d.ts +169 -0
  262. package/dist/source-attribution.js +27 -0
  263. package/dist/source-attribution.js.map +1 -0
  264. package/dist/storage.d.ts +171 -10
  265. package/dist/storage.js +16 -5
  266. package/dist/summarizer.js +7 -7
  267. package/dist/temporal-supersession.d.ts +127 -0
  268. package/dist/temporal-supersession.js +20 -0
  269. package/dist/temporal-supersession.js.map +1 -0
  270. package/dist/threading.js +2 -2
  271. package/dist/tier-migration.d.ts +2 -1
  272. package/dist/tier-routing.js +2 -2
  273. package/dist/tokens.d.ts +21 -1
  274. package/dist/tokens.js +5 -1
  275. package/dist/transcript.js +2 -2
  276. package/dist/types.d.ts +497 -3
  277. package/dist/types.js +1 -1
  278. package/dist/utility-learner.js +2 -2
  279. package/dist/utility-runtime.js +3 -3
  280. package/dist/verified-recall.js +11 -8
  281. package/dist/whitespace.d.ts +4 -0
  282. package/dist/whitespace.js +9 -0
  283. package/dist/whitespace.js.map +1 -0
  284. package/package.json +14 -8
  285. package/dist/chunk-2CJCWDMR.js +0 -87
  286. package/dist/chunk-2CJCWDMR.js.map +0 -1
  287. package/dist/chunk-2PO5ZRKV.js.map +0 -1
  288. package/dist/chunk-6UJQNRIO.js.map +0 -1
  289. package/dist/chunk-B7LOFDVE.js.map +0 -1
  290. package/dist/chunk-BDFZXRSO.js.map +0 -1
  291. package/dist/chunk-CXWFUJR2.js.map +0 -1
  292. package/dist/chunk-DORBM6OB.js +0 -81
  293. package/dist/chunk-DORBM6OB.js.map +0 -1
  294. package/dist/chunk-ESSMF2FR.js.map +0 -1
  295. package/dist/chunk-HLBYLYRD.js.map +0 -1
  296. package/dist/chunk-HLXVTBF3.js.map +0 -1
  297. package/dist/chunk-ISY75RLM.js.map +0 -1
  298. package/dist/chunk-KL4CP4SB.js.map +0 -1
  299. package/dist/chunk-KWBU5S5U.js.map +0 -1
  300. package/dist/chunk-MWGVGUIS.js.map +0 -1
  301. package/dist/chunk-ORZMT74A.js.map +0 -1
  302. package/dist/chunk-OTFNI3OO.js.map +0 -1
  303. package/dist/chunk-PGK3VUHN.js.map +0 -1
  304. package/dist/chunk-QCCCQT3O.js.map +0 -1
  305. package/dist/chunk-QDOSNLB4.js.map +0 -1
  306. package/dist/chunk-QPKFPHOO.js +0 -178
  307. package/dist/chunk-QPKFPHOO.js.map +0 -1
  308. package/dist/chunk-QWUUMMIK.js.map +0 -1
  309. package/dist/chunk-QY2BHY5O.js.map +0 -1
  310. package/dist/chunk-TVVVQQAK.js.map +0 -1
  311. package/dist/chunk-U4PV25RD.js.map +0 -1
  312. package/dist/chunk-UYSKNO6E.js.map +0 -1
  313. package/dist/chunk-V4YC4LUK.js.map +0 -1
  314. package/dist/chunk-WWIQTB2Y.js.map +0 -1
  315. package/dist/chunk-YNCQ7E4M.js.map +0 -1
  316. package/dist/chunk-ZJLY4QSU.js.map +0 -1
  317. /package/dist/{engine-2A6J4XEX.js.map → active-memory-bridge.js.map} +0 -0
  318. /package/dist/{chunk-NTTLPF7F.js.map → chunk-3QFQGRHO.js.map} +0 -0
  319. /package/dist/{chunk-G3AG3KZN.js.map → chunk-5IZL4DCV.js.map} +0 -0
  320. /package/dist/{chunk-BRK4ODMI.js.map → chunk-5NPGSAVB.js.map} +0 -0
  321. /package/dist/{chunk-L5RPWGFK.js.map → chunk-7DHTMOND.js.map} +0 -0
  322. /package/dist/{chunk-Q6FETXJA.js.map → chunk-7SEAZFFB.js.map} +0 -0
  323. /package/dist/{chunk-QANCTXQF.js.map → chunk-AYPYCLR7.js.map} +0 -0
  324. /package/dist/{chunk-LP47L3ZX.js.map → chunk-BTY5RRRF.js.map} +0 -0
  325. /package/dist/{chunk-SCHEKPYH.js.map → chunk-C2EFFULQ.js.map} +0 -0
  326. /package/dist/{chunk-GJR6D6KC.js.map → chunk-D654IBA6.js.map} +0 -0
  327. /package/dist/{chunk-UV2FO7J4.js.map → chunk-E6K4NIEU.js.map} +0 -0
  328. /package/dist/{chunk-T4WRIV2C.js.map → chunk-EABGC2TL.js.map} +0 -0
  329. /package/dist/{chunk-ONRU4L2N.js.map → chunk-FEMOX5AD.js.map} +0 -0
  330. /package/dist/{chunk-IFFFR3MR.js.map → chunk-FSFEQI74.js.map} +0 -0
  331. /package/dist/{chunk-UIYZ5T3I.js.map → chunk-GJQPH5G3.js.map} +0 -0
  332. /package/dist/{chunk-ZKYI7UVO.js.map → chunk-JR4ZC3G4.js.map} +0 -0
  333. /package/dist/{chunk-UCYSTFZR.js.map → chunk-JRNQ3RNA.js.map} +0 -0
  334. /package/dist/{chunk-GPGBSNKM.js.map → chunk-K4FLSOR5.js.map} +0 -0
  335. /package/dist/{chunk-M5ZBBBJI.js.map → chunk-KEG4GNGI.js.map} +0 -0
  336. /package/dist/{chunk-L7WO3MZ4.js.map → chunk-KWP7T3DP.js.map} +0 -0
  337. /package/dist/{chunk-J47FNDR7.js.map → chunk-MYQWXITD.js.map} +0 -0
  338. /package/dist/{chunk-YNI4S5WT.js.map → chunk-N53K2EXC.js.map} +0 -0
  339. /package/dist/{chunk-763GUIOU.js.map → chunk-NBNN5GOB.js.map} +0 -0
  340. /package/dist/{chunk-OOSWAUYB.js.map → chunk-ODWDQNRE.js.map} +0 -0
  341. /package/dist/{chunk-J3BT33K7.js.map → chunk-POBPGDWI.js.map} +0 -0
  342. /package/dist/{chunk-OTAVQCSF.js.map → chunk-PYXS46O7.js.map} +0 -0
  343. /package/dist/{chunk-XUHI52HK.js.map → chunk-QKAH5B6E.js.map} +0 -0
  344. /package/dist/{chunk-HG2NKWR2.js.map → chunk-S4LX5EBI.js.map} +0 -0
  345. /package/dist/{chunk-4A24LIM2.js.map → chunk-S75M5ZRK.js.map} +0 -0
  346. /package/dist/{chunk-MDDAA2AO.js.map → chunk-UPMD5XND.js.map} +0 -0
  347. /package/dist/{chunk-M5KEYE5E.js.map → chunk-URB2WSKZ.js.map} +0 -0
@@ -1,8 +1,3 @@
1
- import {
2
- canReadNamespace,
3
- canWriteNamespace,
4
- resolvePrincipal
5
- } from "./chunk-N5AKDXAI.js";
6
1
  import {
7
2
  getTrustZoneStoreStatus,
8
3
  isTrustZoneName,
@@ -19,13 +14,36 @@ import {
19
14
  listMemoryGovernanceRuns,
20
15
  readMemoryGovernanceRunArtifact,
21
16
  runMemoryGovernance
22
- } from "./chunk-J3BT33K7.js";
17
+ } from "./chunk-POBPGDWI.js";
18
+ import {
19
+ persistExplicitCapture,
20
+ queueExplicitCaptureForReview,
21
+ validateExplicitCaptureInput
22
+ } from "./chunk-QDYXG4CS.js";
23
23
  import {
24
24
  wrapWorkLayerContext
25
25
  } from "./chunk-EEQLFRUM.js";
26
+ import {
27
+ buildProcedurePersistBody,
28
+ normalizeProcedureSteps
29
+ } from "./chunk-QDW3E4RD.js";
30
+ import {
31
+ filterTrajectoriesByLookbackDays,
32
+ readCausalTrajectoryRecords
33
+ } from "./chunk-4NRAJUDS.js";
34
+ import {
35
+ AccessIdempotencyStore,
36
+ hashAccessIdempotencyPayload
37
+ } from "./chunk-XKECPATV.js";
38
+ import {
39
+ FileCalendarSource,
40
+ buildBriefing,
41
+ parseBriefingFocus,
42
+ parseBriefingWindow
43
+ } from "./chunk-ECKDIK5F.js";
26
44
  import {
27
45
  parseEntityFile
28
- } from "./chunk-QWUUMMIK.js";
46
+ } from "./chunk-POMSFKTB.js";
29
47
  import {
30
48
  inferMemoryStatus,
31
49
  toMemoryPathRel
@@ -37,18 +55,14 @@ import {
37
55
  import {
38
56
  getMemoryProjectionPath
39
57
  } from "./chunk-BOUYNNYD.js";
40
- import {
41
- persistExplicitCapture,
42
- queueExplicitCaptureForReview,
43
- validateExplicitCaptureInput
44
- } from "./chunk-YNCQ7E4M.js";
45
58
  import {
46
59
  log
47
- } from "./chunk-KWBU5S5U.js";
60
+ } from "./chunk-2ODBA7MQ.js";
48
61
  import {
49
- AccessIdempotencyStore,
50
- hashAccessIdempotencyPayload
51
- } from "./chunk-XKECPATV.js";
62
+ canReadNamespace,
63
+ canWriteNamespace,
64
+ resolvePrincipal
65
+ } from "./chunk-N5AKDXAI.js";
52
66
 
53
67
  // src/access-service.ts
54
68
  import { stat } from "fs/promises";
@@ -662,6 +676,98 @@ async function importWorkBoardSnapshot(options) {
662
676
  return { created, updated };
663
677
  }
664
678
 
679
+ // src/procedural/procedure-miner.ts
680
+ function clusterKey(record) {
681
+ const goal = record.goal.trim().toLowerCase().replace(/\s+/g, " ").slice(0, 120);
682
+ const refs = [...record.entityRefs ?? []].map((r) => r.trim().toLowerCase()).sort();
683
+ return `${goal}|${refs.join(",")}`;
684
+ }
685
+ function successRate(group) {
686
+ if (group.length === 0) return 0;
687
+ const ok = group.filter((g) => g.outcomeKind === "success" || g.outcomeKind === "partial").length;
688
+ return ok / group.length;
689
+ }
690
+ function pseudoStepsFromCluster(group) {
691
+ const sentences = [];
692
+ const pushUnique = (raw) => {
693
+ const t = raw.trim();
694
+ if (t.length < 8) return;
695
+ if (!sentences.includes(t)) sentences.push(t);
696
+ };
697
+ for (const g of group) {
698
+ const parts = [g.actionSummary, g.observationSummary, g.outcomeSummary].join(" ").split(/[.!?]\s+|;|\n+/).map((s) => s.trim()).filter((s) => s.length > 12);
699
+ for (const p of parts) pushUnique(p);
700
+ if (sentences.length >= 5) break;
701
+ }
702
+ if (sentences.length < 2 && group[0]) {
703
+ pushUnique(`${group[0].goal.trim()} \u2014 confirm prerequisites and context.`);
704
+ pushUnique("Execute the planned actions, then record the outcome.");
705
+ }
706
+ return sentences.slice(0, 6).map((intent, i) => ({
707
+ order: i + 1,
708
+ intent
709
+ }));
710
+ }
711
+ async function hasExistingClusterWrite(storage, cluster) {
712
+ const memories = await storage.readAllMemories();
713
+ for (const m of memories) {
714
+ if (m.frontmatter.category !== "procedure") continue;
715
+ const c = m.frontmatter.structuredAttributes?.procedure_cluster;
716
+ if (c === cluster) return true;
717
+ }
718
+ return false;
719
+ }
720
+ async function runProcedureMining(options) {
721
+ const cfg = options.config.procedural;
722
+ if (!cfg?.enabled) {
723
+ return { clustersProcessed: 0, proceduresWritten: 0, skippedReason: "procedural_disabled" };
724
+ }
725
+ if (cfg.minOccurrences <= 0) {
726
+ return { clustersProcessed: 0, proceduresWritten: 0, skippedReason: "minOccurrences_zero" };
727
+ }
728
+ const { trajectories } = await readCausalTrajectoryRecords({
729
+ memoryDir: options.memoryDir
730
+ });
731
+ const recent = filterTrajectoriesByLookbackDays(trajectories, cfg.lookbackDays);
732
+ const clusters = /* @__PURE__ */ new Map();
733
+ for (const t of recent) {
734
+ const key = clusterKey(t);
735
+ const arr = clusters.get(key) ?? [];
736
+ arr.push(t);
737
+ clusters.set(key, arr);
738
+ }
739
+ let clustersProcessed = 0;
740
+ let proceduresWritten = 0;
741
+ for (const [key, group] of clusters) {
742
+ if (group.length < cfg.minOccurrences) continue;
743
+ const rate = successRate(group);
744
+ if (rate < cfg.successFloor) continue;
745
+ clustersProcessed += 1;
746
+ if (await hasExistingClusterWrite(options.storage, key)) {
747
+ log.debug(`procedure-miner: skip duplicate cluster key=${key.slice(0, 40)}\u2026`);
748
+ continue;
749
+ }
750
+ const steps = normalizeProcedureSteps(pseudoStepsFromCluster(group));
751
+ if (steps.length < 2) continue;
752
+ const title = `When you work on goals like: ${group[0].goal.trim().slice(0, 140)}`;
753
+ const body = buildProcedurePersistBody(title, steps);
754
+ const promote = cfg.autoPromoteEnabled === true && group.length >= cfg.autoPromoteOccurrences && rate >= cfg.successFloor;
755
+ await options.storage.writeMemory("procedure", body, {
756
+ source: "procedure-miner",
757
+ status: promote ? "active" : "pending_review",
758
+ tags: ["procedure-miner", "causal-trajectory"],
759
+ structuredAttributes: {
760
+ procedure_cluster: key.slice(0, 500),
761
+ trajectory_ids: group.map((g) => g.trajectoryId).join(",").slice(0, 1900),
762
+ trajectory_count: String(group.length),
763
+ success_rate: rate.toFixed(4)
764
+ }
765
+ });
766
+ proceduresWritten += 1;
767
+ }
768
+ return { clustersProcessed, proceduresWritten };
769
+ }
770
+
665
771
  // src/access-service.ts
666
772
  var EngramAccessInputError = class extends Error {
667
773
  };
@@ -785,6 +891,9 @@ var EngramAccessService = class {
785
891
  orchestrator;
786
892
  idempotency;
787
893
  idempotencyLocks = /* @__PURE__ */ new Map();
894
+ get briefingEnabled() {
895
+ return this.orchestrator.config.briefing?.enabled === true;
896
+ }
788
897
  resolveNamespace(namespace) {
789
898
  const requested = namespace?.trim();
790
899
  if (!requested) return this.orchestrator.config.defaultNamespace;
@@ -825,7 +934,16 @@ var EngramAccessService = class {
825
934
  }
826
935
  resolveReadableNamespace(namespace, principal) {
827
936
  const resolved = this.resolveNamespace(namespace);
828
- if (principal && !canReadNamespace(principal, resolved, this.orchestrator.config)) {
937
+ const namespacesEnabled = this.orchestrator.config.namespacesEnabled;
938
+ if (!namespacesEnabled) {
939
+ return resolved;
940
+ }
941
+ if (!principal) {
942
+ throw new EngramAccessInputError(
943
+ "authentication required: namespaces are enabled and no principal was supplied"
944
+ );
945
+ }
946
+ if (!canReadNamespace(principal, resolved, this.orchestrator.config)) {
829
947
  throw new EngramAccessInputError(`namespace is not readable: ${resolved}`);
830
948
  }
831
949
  return resolved;
@@ -969,6 +1087,62 @@ var EngramAccessService = class {
969
1087
  }
970
1088
  return this.orchestrator.generateDaySummary(memories);
971
1089
  }
1090
+ /**
1091
+ * Build a daily context briefing. Gracefully degrades when the OpenAI key
1092
+ * or Responses API is unavailable — never throws for LLM-related problems.
1093
+ */
1094
+ async briefing(request) {
1095
+ const config = this.orchestrator.config;
1096
+ if (!config.briefing.enabled) {
1097
+ throw new EngramAccessInputError("briefing is disabled");
1098
+ }
1099
+ const namespace = this.resolveReadableNamespace(request.namespace, request.principal);
1100
+ const storage = await this.orchestrator.getStorage(namespace);
1101
+ const token = typeof request.since === "string" && request.since.trim().length > 0 ? request.since.trim() : config.briefing.defaultWindow;
1102
+ const window = parseBriefingWindow(token);
1103
+ if (!window) {
1104
+ throw new EngramAccessInputError(`invalid briefing window: ${token}`);
1105
+ }
1106
+ const rawFocus = typeof request.focus === "string" ? request.focus.trim() : "";
1107
+ let focus = null;
1108
+ if (rawFocus.length > 0) {
1109
+ focus = parseBriefingFocus(rawFocus);
1110
+ if (!focus) {
1111
+ throw new EngramAccessInputError(
1112
+ `invalid briefing focus filter: ${request.focus}`
1113
+ );
1114
+ }
1115
+ }
1116
+ const SUPPORTED_FORMATS = ["markdown", "json"];
1117
+ if (typeof request.format === "string" && !SUPPORTED_FORMATS.includes(request.format)) {
1118
+ throw new EngramAccessInputError(
1119
+ `unsupported briefing format: "${request.format}". Accepted: ${SUPPORTED_FORMATS.join(", ")}.`
1120
+ );
1121
+ }
1122
+ const format = request.format === "json" ? "json" : request.format === "markdown" ? "markdown" : config.briefing.defaultFormat;
1123
+ const maxFollowups = typeof request.maxFollowups === "number" && Number.isFinite(request.maxFollowups) ? Math.max(0, Math.min(10, Math.floor(request.maxFollowups))) : config.briefing.maxFollowups;
1124
+ const calendarSource = config.briefing.calendarSource ? new FileCalendarSource(config.briefing.calendarSource) : void 0;
1125
+ const result = await buildBriefing({
1126
+ storage,
1127
+ namespace,
1128
+ window,
1129
+ focus,
1130
+ calendarSource,
1131
+ maxFollowups,
1132
+ allowLlm: config.briefing.llmFollowups,
1133
+ openaiApiKey: config.openaiApiKey,
1134
+ openaiBaseUrl: config.openaiBaseUrl,
1135
+ model: config.model
1136
+ });
1137
+ return {
1138
+ format,
1139
+ window: result.window,
1140
+ namespace,
1141
+ markdown: result.markdown,
1142
+ json: result.json,
1143
+ followupsUnavailableReason: result.followupsUnavailableReason
1144
+ };
1145
+ }
972
1146
  async recall(request) {
973
1147
  const query = request.query.trim();
974
1148
  if (query.length === 0) {
@@ -1320,14 +1494,15 @@ var EngramAccessService = class {
1320
1494
  for (const name of names) {
1321
1495
  const raw = await storage.readEntity(name);
1322
1496
  if (!raw) continue;
1323
- const entity = parseEntityFile(raw);
1497
+ const entity = parseEntityFile(raw, this.orchestrator.config.entitySchemas);
1324
1498
  if (query) {
1325
1499
  const haystack = [
1326
1500
  entity.name,
1327
1501
  entity.type,
1328
- entity.summary ?? "",
1502
+ entity.synthesis || entity.summary || "",
1329
1503
  ...entity.aliases,
1330
- ...entity.facts
1504
+ ...entity.facts,
1505
+ ...(entity.structuredSections ?? []).flatMap((section) => [section.title, ...section.facts])
1331
1506
  ].join("\n").toLowerCase();
1332
1507
  if (!haystack.includes(query)) continue;
1333
1508
  }
@@ -1335,7 +1510,7 @@ var EngramAccessService = class {
1335
1510
  name: entity.name,
1336
1511
  type: entity.type,
1337
1512
  updated: entity.updated,
1338
- summary: entity.summary,
1513
+ summary: entity.synthesis || entity.summary,
1339
1514
  aliases: entity.aliases
1340
1515
  });
1341
1516
  }
@@ -1358,7 +1533,7 @@ var EngramAccessService = class {
1358
1533
  return {
1359
1534
  found: true,
1360
1535
  namespace: resolvedNamespace,
1361
- entity: parseEntityFile(raw)
1536
+ entity: parseEntityFile(raw, this.orchestrator.config.entitySchemas)
1362
1537
  };
1363
1538
  }
1364
1539
  async reviewQueue(runId, namespace, principal) {
@@ -1502,13 +1677,25 @@ var EngramAccessService = class {
1502
1677
  request.authenticatedPrincipal ?? principal
1503
1678
  );
1504
1679
  const storage = await this.orchestrator.getStorage(resolvedNamespace);
1680
+ const mode = request.mode === "apply" ? "apply" : "shadow";
1681
+ const boundedBatchSize = typeof request.batchSize === "number" && Number.isFinite(request.batchSize) ? Math.max(1, Math.floor(request.batchSize)) : void 0;
1505
1682
  const result = await runMemoryGovernance({
1506
1683
  memoryDir: storage.dir,
1507
- mode: request.mode === "apply" ? "apply" : "shadow",
1684
+ mode,
1508
1685
  recentDays: typeof request.recentDays === "number" && Number.isFinite(request.recentDays) ? Math.max(1, Math.floor(request.recentDays)) : void 0,
1509
1686
  maxMemories: typeof request.maxMemories === "number" && Number.isFinite(request.maxMemories) ? Math.max(1, Math.floor(request.maxMemories)) : void 0,
1510
- batchSize: typeof request.batchSize === "number" && Number.isFinite(request.batchSize) ? Math.max(1, Math.floor(request.batchSize)) : void 0
1687
+ batchSize: boundedBatchSize
1511
1688
  });
1689
+ if (mode === "apply") {
1690
+ try {
1691
+ await this.orchestrator.processEntitySynthesisQueue(
1692
+ resolvedNamespace,
1693
+ Math.min(boundedBatchSize ?? 5, 5)
1694
+ );
1695
+ } catch (error) {
1696
+ log.debug(`governanceRun: entity synthesis refresh failed after governance apply: ${error}`);
1697
+ }
1698
+ }
1512
1699
  return {
1513
1700
  namespace: resolvedNamespace,
1514
1701
  runId: result.runId,
@@ -1521,6 +1708,25 @@ var EngramAccessService = class {
1521
1708
  reportPath: result.reportPath
1522
1709
  };
1523
1710
  }
1711
+ async procedureMiningRun(request, principal) {
1712
+ const resolvedNamespace = this.resolveWritableNamespace(
1713
+ request.namespace,
1714
+ void 0,
1715
+ request.authenticatedPrincipal ?? principal
1716
+ );
1717
+ const storage = await this.orchestrator.getStorage(resolvedNamespace);
1718
+ const result = await runProcedureMining({
1719
+ memoryDir: storage.dir,
1720
+ storage,
1721
+ config: this.orchestrator.config
1722
+ });
1723
+ return {
1724
+ namespace: resolvedNamespace,
1725
+ clustersProcessed: result.clustersProcessed,
1726
+ proceduresWritten: result.proceduresWritten,
1727
+ skippedReason: result.skippedReason
1728
+ };
1729
+ }
1524
1730
  async trustZoneStatus(namespace, principal) {
1525
1731
  const resolvedNamespace = this.resolveReadableNamespace(namespace, principal);
1526
1732
  const storage = await this.orchestrator.getStorage(resolvedNamespace);
@@ -2367,6 +2573,40 @@ ${next}`);
2367
2573
  }
2368
2574
  };
2369
2575
  }
2576
+ /**
2577
+ * Record citation usage from an observed oai-mem-citation block.
2578
+ * For each citation entry, extract the memory ID from the path and
2579
+ * increment its access tracking via the orchestrator. Returns the
2580
+ * count of submitted IDs and the count of IDs that matched real memories.
2581
+ */
2582
+ async recordCitationUsage(request) {
2583
+ if (request.entries.length === 0) return { submitted: 0, matched: 0 };
2584
+ const resolvedNamespace = this.resolveWritableNamespace(
2585
+ request.namespace,
2586
+ request.sessionId,
2587
+ request.authenticatedPrincipal
2588
+ );
2589
+ const memoryIds = [];
2590
+ for (const entry of request.entries) {
2591
+ const basename = entry.path.split("/").pop() ?? entry.path;
2592
+ const id = basename.endsWith(".md") ? basename.slice(0, -3) : basename;
2593
+ if (id.length > 0) {
2594
+ memoryIds.push(id);
2595
+ }
2596
+ }
2597
+ if (memoryIds.length === 0) return { submitted: 0, matched: 0 };
2598
+ const storage = await this.orchestrator.getStorage(resolvedNamespace);
2599
+ const existingIds = await storage.filterExistingMemoryIds(memoryIds);
2600
+ const matchedIds = memoryIds.filter((id) => existingIds.has(id));
2601
+ if (matchedIds.length > 0) {
2602
+ try {
2603
+ this.orchestrator.trackMemoryAccess(matchedIds);
2604
+ } catch {
2605
+ log.debug("citation usage tracking: failed to record access for cited memories");
2606
+ }
2607
+ }
2608
+ return { submitted: memoryIds.length, matched: matchedIds.length };
2609
+ }
2370
2610
  };
2371
2611
 
2372
2612
  export {
@@ -2375,4 +2615,4 @@ export {
2375
2615
  ENGRAM_ACCESS_WRITE_SCHEMA_VERSION,
2376
2616
  EngramAccessService
2377
2617
  };
2378
- //# sourceMappingURL=chunk-QY2BHY5O.js.map
2618
+ //# sourceMappingURL=chunk-V7XCAHIB.js.map