@remnic/core 1.0.1 → 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 +48 -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 +46 -46
  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-CIvLFHx3.d.ts → orchestrator-B9kwlCep.d.ts} +254 -9
  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 +422 -64
  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
@@ -5,6 +5,7 @@ import { randomBytes } from "crypto";
5
5
  var TOKEN_PREFIXES = {
6
6
  "openclaw": "remnic_oc_",
7
7
  "claude-code": "remnic_cc_",
8
+ "codex-cli": "remnic_cx_",
8
9
  "codex": "remnic_cx_",
9
10
  "hermes": "remnic_hm_",
10
11
  "replit": "remnic_rl_",
@@ -71,16 +72,25 @@ function saveTokenStore(store, tokensPath) {
71
72
  } catch {
72
73
  }
73
74
  }
74
- function generateToken(connector, tokensPath) {
75
- const store = loadTokenStore(tokensPath);
76
- store.tokens = store.tokens.filter((t) => t.connector !== connector);
75
+ function buildTokenEntry(connector) {
77
76
  const prefix = TOKEN_PREFIXES[connector] ?? "remnic_xx_";
78
77
  const token = prefix + randomBytes(24).toString("hex");
79
- const entry = {
78
+ return {
80
79
  token,
81
80
  connector,
82
81
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
83
82
  };
83
+ }
84
+ function commitTokenEntry(entry, tokensPath) {
85
+ const store = loadTokenStore(tokensPath);
86
+ store.tokens = store.tokens.filter((t) => t.connector !== entry.connector);
87
+ store.tokens.push(entry);
88
+ saveTokenStore(store, tokensPath);
89
+ }
90
+ function generateToken(connector, tokensPath) {
91
+ const store = loadTokenStore(tokensPath);
92
+ store.tokens = store.tokens.filter((t) => t.connector !== connector);
93
+ const entry = buildTokenEntry(connector);
84
94
  store.tokens.push(entry);
85
95
  saveTokenStore(store, tokensPath);
86
96
  return entry;
@@ -120,6 +130,8 @@ function resolveConnectorFromToken(token, tokensPath) {
120
130
  export {
121
131
  loadTokenStore,
122
132
  saveTokenStore,
133
+ buildTokenEntry,
134
+ commitTokenEntry,
123
135
  generateToken,
124
136
  listTokens,
125
137
  revokeToken,
@@ -127,4 +139,4 @@ export {
127
139
  getAllValidTokensCached,
128
140
  resolveConnectorFromToken
129
141
  };
130
- //# sourceMappingURL=chunk-KL4CP4SB.js.map
142
+ //# sourceMappingURL=chunk-O5ETUNBT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tokens.ts"],"sourcesContent":["/**\n * Token management for Remnic multi-connector auth.\n *\n * Manages per-connector tokens in ~/.remnic/tokens.json.\n * Each connector gets a unique token with a recognizable prefix.\n */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { randomBytes } from \"node:crypto\";\n\nexport interface TokenEntry {\n token: string;\n connector: string;\n createdAt: string;\n}\n\nexport interface TokenStore {\n tokens: TokenEntry[];\n}\n\nconst TOKEN_PREFIXES: Record<string, string> = {\n \"openclaw\": \"remnic_oc_\",\n \"claude-code\": \"remnic_cc_\",\n \"codex-cli\": \"remnic_cx_\",\n \"codex\": \"remnic_cx_\",\n \"hermes\": \"remnic_hm_\",\n \"replit\": \"remnic_rl_\",\n \"cursor\": \"remnic_cu_\",\n \"cline\": \"remnic_cl_\",\n \"github-copilot\": \"remnic_gh_\",\n \"roo-code\": \"remnic_rc_\",\n \"windsurf\": \"remnic_ws_\",\n \"amp\": \"remnic_am_\",\n \"generic-mcp\": \"remnic_gm_\",\n};\n\nfunction defaultTokensPath(): string {\n return path.join(process.env.HOME ?? \"~\", \".remnic\", \"tokens.json\");\n}\n\nfunction legacyTokensPath(): string {\n return path.join(process.env.HOME ?? \"~\", \".engram\", \"tokens.json\");\n}\n\nfunction resolveReadPath(tokensPath?: string): string {\n const primary = tokensPath ?? defaultTokensPath();\n if (tokensPath) return primary;\n if (fs.existsSync(primary)) return primary;\n const legacy = legacyTokensPath();\n return fs.existsSync(legacy) ? legacy : primary;\n}\n\nfunction ensureDir(filePath: string): void {\n const dir = path.dirname(filePath);\n fs.mkdirSync(dir, { recursive: true });\n}\n\nexport function loadTokenStore(tokensPath?: string): TokenStore {\n const p = resolveReadPath(tokensPath);\n try {\n const raw = JSON.parse(fs.readFileSync(p, \"utf8\"));\n if (Array.isArray(raw.tokens)) {\n return { tokens: raw.tokens };\n }\n // Migrate legacy flat-map format: { \"connector\": \"token_value\", ... }\n if (typeof raw === \"object\" && raw !== null && !Array.isArray(raw)) {\n const migrated: TokenEntry[] = [];\n for (const [key, value] of Object.entries(raw)) {\n if (key === \"tokens\") continue; // skip if tokens key exists but isn't array\n if (typeof value === \"string\" && value.length > 0) {\n migrated.push({ token: value, connector: key, createdAt: new Date().toISOString() });\n }\n }\n if (migrated.length > 0) {\n const store: TokenStore = { tokens: migrated };\n // Auto-migrate: rewrite in new format (best-effort, don't lose tokens on write failure)\n try {\n saveTokenStore(store, tokensPath);\n } catch {\n // Migration write failed (e.g., read-only fs) — still return parsed tokens\n }\n return store;\n }\n }\n return { tokens: [] };\n } catch {\n return { tokens: [] };\n }\n}\n\nexport function saveTokenStore(store: TokenStore, tokensPath?: string): void {\n const p = tokensPath ?? defaultTokensPath();\n ensureDir(p);\n fs.writeFileSync(p, JSON.stringify(store, null, 2) + \"\\n\", { mode: 0o600 });\n // Tighten permissions on pre-existing files (writeFileSync mode only applies to new files)\n try { fs.chmodSync(p, 0o600); } catch { /* ignore on platforms without chmod */ }\n}\n\n/**\n * Build a TokenEntry candidate WITHOUT saving it to the store.\n * Callers use this when they need to defer the save until after a\n * dependent write (e.g. Hermes config.yaml) succeeds — see\n * commitTokenEntry() to persist the candidate.\n */\nexport function buildTokenEntry(connector: string): TokenEntry {\n const prefix = TOKEN_PREFIXES[connector] ?? \"remnic_xx_\";\n const token = prefix + randomBytes(24).toString(\"hex\");\n return {\n token,\n connector,\n createdAt: new Date().toISOString(),\n };\n}\n\n/**\n * Persist a pre-built TokenEntry into the store, replacing any existing\n * entry for the same connector. Used together with buildTokenEntry() when\n * the caller wants to defer the save until after a dependent write succeeds.\n *\n * For transactional rollback, callers should snapshot the full store via\n * loadTokenStore() BEFORE calling commitTokenEntry() and restore it with\n * saveTokenStore() on failure. A full-store snapshot handles partial writes\n * of tokens.json atomically — single-entry restore via the return value is\n * insufficient because if this function throws during saveTokenStore, the\n * return statement never executes (UXJI/UXJT fix).\n */\nexport function commitTokenEntry(entry: TokenEntry, tokensPath?: string): void {\n const store = loadTokenStore(tokensPath);\n store.tokens = store.tokens.filter((t) => t.connector !== entry.connector);\n store.tokens.push(entry);\n saveTokenStore(store, tokensPath);\n}\n\nexport function generateToken(connector: string, tokensPath?: string): TokenEntry {\n const store = loadTokenStore(tokensPath);\n\n // Remove existing token for this connector\n store.tokens = store.tokens.filter((t) => t.connector !== connector);\n\n const entry = buildTokenEntry(connector);\n store.tokens.push(entry);\n saveTokenStore(store, tokensPath);\n return entry;\n}\n\nexport function listTokens(tokensPath?: string): TokenEntry[] {\n return loadTokenStore(tokensPath).tokens;\n}\n\nexport function revokeToken(connector: string, tokensPath?: string): boolean {\n const store = loadTokenStore(tokensPath);\n const before = store.tokens.length;\n store.tokens = store.tokens.filter((t) => t.connector !== connector);\n if (store.tokens.length < before) {\n saveTokenStore(store, tokensPath);\n return true;\n }\n return false;\n}\n\nexport function getAllValidTokens(tokensPath?: string): string[] {\n return loadTokenStore(tokensPath).tokens.map((t) => t.token);\n}\n\n// Cached token loader to avoid synchronous disk I/O on every HTTP request.\n// Re-reads tokens.json at most once per TTL interval (default 5s).\nconst TOKEN_CACHE_TTL_MS = 5_000;\nlet _cachedTokens: string[] = [];\nlet _cachedAt = 0;\nlet _cachedPath: string | undefined;\n\nexport function getAllValidTokensCached(tokensPath?: string): string[] {\n const now = Date.now();\n if (now - _cachedAt < TOKEN_CACHE_TTL_MS && tokensPath === _cachedPath) return _cachedTokens;\n _cachedTokens = getAllValidTokens(tokensPath);\n _cachedAt = now;\n _cachedPath = tokensPath;\n return _cachedTokens;\n}\n\nexport function resolveConnectorFromToken(token: string, tokensPath?: string): string | undefined {\n return loadTokenStore(tokensPath).tokens.find((t) => t.token === token)?.connector;\n}\n"],"mappings":"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","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  log
3
- } from "./chunk-KWBU5S5U.js";
3
+ } from "./chunk-2ODBA7MQ.js";
4
4
 
5
5
  // src/models-json.ts
6
6
  import { readFileSync } from "fs";
@@ -44,4 +44,4 @@ export {
44
44
  clearModelsJsonCache,
45
45
  __setModelsJsonForTest
46
46
  };
47
- //# sourceMappingURL=chunk-OOSWAUYB.js.map
47
+ //# sourceMappingURL=chunk-ODWDQNRE.js.map
@@ -5,12 +5,43 @@ import {
5
5
  readEnvVar,
6
6
  resolveHomeDir
7
7
  } from "./chunk-MARWOCVP.js";
8
+ import {
9
+ normalizeEntitySchemas
10
+ } from "./chunk-4DJQYKMN.js";
8
11
  import {
9
12
  log
10
- } from "./chunk-KWBU5S5U.js";
13
+ } from "./chunk-2ODBA7MQ.js";
11
14
 
12
15
  // src/config.ts
13
16
  import path from "path";
17
+
18
+ // src/connectors/coerce.ts
19
+ function coerceBool(value) {
20
+ if (typeof value === "boolean") return value;
21
+ if (typeof value === "string") {
22
+ const v = value.trim().toLowerCase();
23
+ if (["false", "0", "no", "off"].includes(v)) return false;
24
+ if (["true", "1", "yes", "on"].includes(v)) return true;
25
+ }
26
+ return void 0;
27
+ }
28
+ function coerceInstallExtension(value) {
29
+ return coerceBool(value);
30
+ }
31
+ function coerceNumber(value) {
32
+ if (typeof value === "number") {
33
+ return Number.isFinite(value) ? value : void 0;
34
+ }
35
+ if (typeof value === "string") {
36
+ const trimmed = value.trim();
37
+ if (trimmed.length === 0) return void 0;
38
+ const n = Number(trimmed);
39
+ return Number.isFinite(n) ? n : void 0;
40
+ }
41
+ return void 0;
42
+ }
43
+
44
+ // src/config.ts
14
45
  var DEFAULT_MEMORY_DIR = path.join(
15
46
  resolveHomeDir(),
16
47
  ".openclaw",
@@ -68,6 +99,19 @@ function normalizeMemoryRelativeDir(raw, fallback) {
68
99
  const normalized = trimmed.replace(/\\/g, "/").split("/").filter((segment) => segment.length > 0 && segment !== "." && segment !== "..").join("/");
69
100
  return normalized.length > 0 ? normalized : fallback;
70
101
  }
102
+ function parseSemanticChunkingConfig(raw) {
103
+ if (!raw || typeof raw !== "object") return {};
104
+ const src = raw;
105
+ const out = {};
106
+ if (typeof src.targetTokens === "number") out.targetTokens = src.targetTokens;
107
+ if (typeof src.minTokens === "number") out.minTokens = src.minTokens;
108
+ if (typeof src.maxTokens === "number") out.maxTokens = src.maxTokens;
109
+ if (typeof src.smoothingWindowSize === "number") out.smoothingWindowSize = src.smoothingWindowSize;
110
+ if (typeof src.boundaryThresholdStdDevs === "number") out.boundaryThresholdStdDevs = src.boundaryThresholdStdDevs;
111
+ if (typeof src.embeddingBatchSize === "number") out.embeddingBatchSize = src.embeddingBatchSize;
112
+ if (typeof src.fallbackToRecursive === "boolean") out.fallbackToRecursive = src.fallbackToRecursive;
113
+ return out;
114
+ }
71
115
  var VALID_EFFORTS = ["none", "low", "medium", "high"];
72
116
  var VALID_TRIGGERS = ["smart", "every_n", "time_based"];
73
117
  var VALID_IDENTITY_INJECTION_MODES = ["recovery_only", "minimal", "full"];
@@ -77,6 +121,8 @@ var VALID_MEMORY_OS_PRESETS = [
77
121
  "research-max",
78
122
  "local-llm-heavy"
79
123
  ];
124
+ var VALID_SLOT_MISMATCH_MODES = ["error", "warn", "silent"];
125
+ var VALID_CODEX_COMPACTION_FLUSH_MODES = ["signal", "heuristic", "auto"];
80
126
  var VALID_MEMORY_CATEGORIES = /* @__PURE__ */ new Set([
81
127
  "fact",
82
128
  "preference",
@@ -88,7 +134,8 @@ var VALID_MEMORY_CATEGORIES = /* @__PURE__ */ new Set([
88
134
  "commitment",
89
135
  "moment",
90
136
  "skill",
91
- "rule"
137
+ "rule",
138
+ "procedure"
92
139
  ]);
93
140
  var DEFAULT_BEHAVIOR_LOOP_PROTECTED_PARAMS = [
94
141
  "maxMemoryTokens",
@@ -219,6 +266,55 @@ function parseConfig(raw) {
219
266
  const reasoningEffort = rawEffort && VALID_EFFORTS.includes(rawEffort) ? rawEffort : "low";
220
267
  const rawTrigger = cfg.triggerMode;
221
268
  const triggerMode = rawTrigger && VALID_TRIGGERS.includes(rawTrigger) ? rawTrigger : "smart";
269
+ const rawSlotBehavior = cfg.slotBehavior && typeof cfg.slotBehavior === "object" && !Array.isArray(cfg.slotBehavior) ? cfg.slotBehavior : {};
270
+ const slotBehavior = {
271
+ requireExclusiveMemorySlot: rawSlotBehavior.requireExclusiveMemorySlot !== false,
272
+ onSlotMismatch: typeof rawSlotBehavior.onSlotMismatch === "string" && VALID_SLOT_MISMATCH_MODES.includes(
273
+ rawSlotBehavior.onSlotMismatch
274
+ ) ? rawSlotBehavior.onSlotMismatch : "error"
275
+ };
276
+ const rawDreaming = cfg.dreaming && typeof cfg.dreaming === "object" && !Array.isArray(cfg.dreaming) ? cfg.dreaming : {};
277
+ const dreaming = {
278
+ enabled: rawDreaming.enabled === true,
279
+ journalPath: typeof rawDreaming.journalPath === "string" && rawDreaming.journalPath.trim().length > 0 ? rawDreaming.journalPath.trim() : "DREAMS.md",
280
+ maxEntries: typeof rawDreaming.maxEntries === "number" ? rawDreaming.maxEntries === 0 ? 0 : rawDreaming.maxEntries < 0 ? 500 : rawDreaming.maxEntries < 10 ? 500 : Math.min(1e4, Math.floor(rawDreaming.maxEntries)) : 500,
281
+ injectRecentCount: typeof rawDreaming.injectRecentCount === "number" ? Math.min(20, Math.max(0, Math.floor(rawDreaming.injectRecentCount))) : 3,
282
+ minIntervalMinutes: typeof rawDreaming.minIntervalMinutes === "number" ? Math.max(1, Math.floor(rawDreaming.minIntervalMinutes)) : 120,
283
+ narrativeModel: typeof rawDreaming.narrativeModel === "string" && rawDreaming.narrativeModel.trim().length > 0 ? rawDreaming.narrativeModel.trim() : null,
284
+ narrativePromptStyle: rawDreaming.narrativePromptStyle === "diary" || rawDreaming.narrativePromptStyle === "analytical" ? rawDreaming.narrativePromptStyle : "reflective",
285
+ watchFile: rawDreaming.watchFile !== false
286
+ };
287
+ const rawHeartbeat = cfg.heartbeat && typeof cfg.heartbeat === "object" && !Array.isArray(cfg.heartbeat) ? cfg.heartbeat : {};
288
+ const heartbeat = {
289
+ enabled: rawHeartbeat.enabled === true,
290
+ journalPath: typeof rawHeartbeat.journalPath === "string" && rawHeartbeat.journalPath.trim().length > 0 ? rawHeartbeat.journalPath.trim() : "HEARTBEAT.md",
291
+ maxPreviousRuns: typeof rawHeartbeat.maxPreviousRuns === "number" ? Math.min(20, Math.max(0, Math.floor(rawHeartbeat.maxPreviousRuns))) : 5,
292
+ watchFile: rawHeartbeat.watchFile !== false,
293
+ detectionMode: rawHeartbeat.detectionMode === "runtime-signal" || rawHeartbeat.detectionMode === "heuristic" ? rawHeartbeat.detectionMode : "auto",
294
+ gateExtractionDuringHeartbeat: rawHeartbeat.gateExtractionDuringHeartbeat !== false
295
+ };
296
+ const rawCodexCompat = cfg.codexCompat && typeof cfg.codexCompat === "object" && !Array.isArray(cfg.codexCompat) ? cfg.codexCompat : {};
297
+ const codexCompat = {
298
+ enabled: rawCodexCompat.enabled === true,
299
+ threadIdBufferKeying: rawCodexCompat.threadIdBufferKeying !== false,
300
+ compactionFlushMode: typeof rawCodexCompat.compactionFlushMode === "string" && VALID_CODEX_COMPACTION_FLUSH_MODES.includes(
301
+ rawCodexCompat.compactionFlushMode
302
+ ) ? rawCodexCompat.compactionFlushMode : "auto",
303
+ fingerprintDedup: rawCodexCompat.fingerprintDedup !== false
304
+ };
305
+ const rawProcedural = cfg.procedural && typeof cfg.procedural === "object" && !Array.isArray(cfg.procedural) ? cfg.procedural : {};
306
+ const proceduralMinRaw = typeof rawProcedural.minOccurrences === "number" && Number.isFinite(rawProcedural.minOccurrences) ? Math.floor(rawProcedural.minOccurrences) : 3;
307
+ const procedural = {
308
+ enabled: coerceBool(rawProcedural.enabled) === true,
309
+ /** 0 disables miner emission threshold (no clusters qualify). */
310
+ minOccurrences: Math.min(1e3, Math.max(0, proceduralMinRaw)),
311
+ successFloor: typeof rawProcedural.successFloor === "number" && Number.isFinite(rawProcedural.successFloor) && rawProcedural.successFloor >= 0 && rawProcedural.successFloor <= 1 ? rawProcedural.successFloor : 0.7,
312
+ autoPromoteOccurrences: typeof rawProcedural.autoPromoteOccurrences === "number" && Number.isFinite(rawProcedural.autoPromoteOccurrences) ? rawProcedural.autoPromoteOccurrences <= 0 ? 0 : Math.min(1e4, Math.max(1, Math.floor(rawProcedural.autoPromoteOccurrences))) : 8,
313
+ autoPromoteEnabled: coerceBool(rawProcedural.autoPromoteEnabled) === true,
314
+ lookbackDays: typeof rawProcedural.lookbackDays === "number" && Number.isFinite(rawProcedural.lookbackDays) ? Math.min(3650, Math.max(1, Math.floor(rawProcedural.lookbackDays))) : 30,
315
+ proceduralMiningCronAutoRegister: coerceBool(rawProcedural.proceduralMiningCronAutoRegister) === true,
316
+ recallMaxProcedures: typeof rawProcedural.recallMaxProcedures === "number" && Number.isFinite(rawProcedural.recallMaxProcedures) ? Math.min(10, Math.max(1, Math.floor(rawProcedural.recallMaxProcedures))) : 3
317
+ };
222
318
  const memoryDir = typeof cfg.memoryDir === "string" && cfg.memoryDir.length > 0 ? cfg.memoryDir : DEFAULT_MEMORY_DIR;
223
319
  const rawIdentityInjectionMode = cfg.identityInjectionMode;
224
320
  const identityInjectionMode = rawIdentityInjectionMode && VALID_IDENTITY_INJECTION_MODES.includes(rawIdentityInjectionMode) ? rawIdentityInjectionMode : "recovery_only";
@@ -232,6 +328,7 @@ function parseConfig(raw) {
232
328
  match: typeof r?.match === "string" ? r.match : "",
233
329
  principal: typeof r?.principal === "string" ? r.principal : ""
234
330
  })).filter((r) => r.match.length > 0 && r.principal.length > 0) : [];
331
+ const entitySchemas = normalizeEntitySchemas(cfg.entitySchemas);
235
332
  const rawHygiene = cfg.fileHygiene && typeof cfg.fileHygiene === "object" && !Array.isArray(cfg.fileHygiene) ? cfg.fileHygiene : void 0;
236
333
  const hygieneEnabled = rawHygiene?.enabled === true;
237
334
  const fileHygiene = hygieneEnabled ? {
@@ -391,12 +488,39 @@ function parseConfig(raw) {
391
488
  chunkingTargetTokens: typeof cfg.chunkingTargetTokens === "number" ? cfg.chunkingTargetTokens : 200,
392
489
  chunkingMinTokens: typeof cfg.chunkingMinTokens === "number" ? cfg.chunkingMinTokens : 150,
393
490
  chunkingOverlapSentences: typeof cfg.chunkingOverlapSentences === "number" ? cfg.chunkingOverlapSentences : 2,
491
+ // Semantic Chunking (Issue #368)
492
+ semanticChunkingEnabled: cfg.semanticChunkingEnabled === true,
493
+ semanticChunkingConfig: parseSemanticChunkingConfig(cfg.semanticChunkingConfig),
394
494
  // Contradiction Detection (Phase 2B)
395
495
  contradictionDetectionEnabled: cfg.contradictionDetectionEnabled === true,
396
496
  // Off by default initially
397
497
  contradictionSimilarityThreshold: typeof cfg.contradictionSimilarityThreshold === "number" ? cfg.contradictionSimilarityThreshold : 0.7,
398
498
  contradictionMinConfidence: typeof cfg.contradictionMinConfidence === "number" ? cfg.contradictionMinConfidence : 0.9,
399
499
  contradictionAutoResolve: cfg.contradictionAutoResolve !== false,
500
+ // Temporal Supersession (issue #375)
501
+ temporalSupersessionEnabled: cfg.temporalSupersessionEnabled !== false,
502
+ // On by default
503
+ temporalSupersessionIncludeInRecall: cfg.temporalSupersessionIncludeInRecall === true,
504
+ // Off by default
505
+ // Direct-answer retrieval tier (issue #518)
506
+ recallDirectAnswerEnabled: coerceBool(cfg.recallDirectAnswerEnabled) ?? false,
507
+ recallDirectAnswerTokenOverlapFloor: (() => {
508
+ const n = coerceNumber(cfg.recallDirectAnswerTokenOverlapFloor);
509
+ return n !== void 0 && n >= 0 && n <= 1 ? n : 0.55;
510
+ })(),
511
+ recallDirectAnswerImportanceFloor: (() => {
512
+ const n = coerceNumber(cfg.recallDirectAnswerImportanceFloor);
513
+ return n !== void 0 && n >= 0 && n <= 1 ? n : 0.7;
514
+ })(),
515
+ recallDirectAnswerAmbiguityMargin: (() => {
516
+ const n = coerceNumber(cfg.recallDirectAnswerAmbiguityMargin);
517
+ return n !== void 0 && n >= 0 && n <= 1 ? n : 0.15;
518
+ })(),
519
+ recallDirectAnswerEligibleTaxonomyBuckets: Array.isArray(
520
+ cfg.recallDirectAnswerEligibleTaxonomyBuckets
521
+ ) ? cfg.recallDirectAnswerEligibleTaxonomyBuckets.filter(
522
+ (v) => typeof v === "string" && v.length > 0
523
+ ) : ["decisions", "principles", "conventions", "runbooks", "entities"],
400
524
  // Memory Linking (Phase 3A)
401
525
  memoryLinkingEnabled: cfg.memoryLinkingEnabled === true,
402
526
  // Off by default initially
@@ -432,6 +556,50 @@ function parseConfig(raw) {
432
556
  checkpointTurns: typeof cfg.checkpointTurns === "number" ? cfg.checkpointTurns : 15,
433
557
  // Compaction reset (opt-in, default: false)
434
558
  compactionResetEnabled: cfg.compactionResetEnabled === true,
559
+ beforeResetTimeoutMs: typeof cfg.beforeResetTimeoutMs === "number" ? Math.min(3e4, Math.max(100, Math.floor(cfg.beforeResetTimeoutMs))) : 2e3,
560
+ flushOnResetEnabled: cfg.flushOnResetEnabled !== false,
561
+ commandsListEnabled: cfg.commandsListEnabled !== false,
562
+ openclawToolsEnabled: cfg.openclawToolsEnabled !== false,
563
+ openclawToolSnippetMaxChars: typeof cfg.openclawToolSnippetMaxChars === "number" ? Math.min(4e3, Math.max(80, Math.floor(cfg.openclawToolSnippetMaxChars))) : 600,
564
+ sessionTogglesEnabled: cfg.sessionTogglesEnabled !== false,
565
+ verboseRecallVisibility: cfg.verboseRecallVisibility !== false,
566
+ recallTranscriptsEnabled: cfg.recallTranscriptsEnabled === true,
567
+ recallTranscriptRetentionDays: typeof cfg.recallTranscriptRetentionDays === "number" ? Math.min(365, Math.max(1, Math.floor(cfg.recallTranscriptRetentionDays))) : 30,
568
+ respectBundledActiveMemoryToggle: cfg.respectBundledActiveMemoryToggle !== false,
569
+ activeRecallEnabled: cfg.activeRecallEnabled === true,
570
+ activeRecallAgents: Array.isArray(cfg.activeRecallAgents) && cfg.activeRecallAgents.length > 0 ? cfg.activeRecallAgents.filter((value) => typeof value === "string" && value.trim().length > 0).map((value) => value.trim()) : null,
571
+ activeRecallAllowedChatTypes: Array.isArray(cfg.activeRecallAllowedChatTypes) && cfg.activeRecallAllowedChatTypes.length > 0 ? cfg.activeRecallAllowedChatTypes.filter(
572
+ (value) => value === "direct" || value === "group" || value === "channel"
573
+ ) : ["direct", "group", "channel"],
574
+ activeRecallQueryMode: cfg.activeRecallQueryMode === "message" || cfg.activeRecallQueryMode === "full" ? cfg.activeRecallQueryMode : "recent",
575
+ activeRecallPromptStyle: cfg.activeRecallPromptStyle === "strict" || cfg.activeRecallPromptStyle === "contextual" || cfg.activeRecallPromptStyle === "recall-heavy" || cfg.activeRecallPromptStyle === "precision-heavy" || cfg.activeRecallPromptStyle === "preference-only" ? cfg.activeRecallPromptStyle : "balanced",
576
+ activeRecallPromptOverride: typeof cfg.activeRecallPromptOverride === "string" && cfg.activeRecallPromptOverride.trim().length > 0 ? cfg.activeRecallPromptOverride.trim() : null,
577
+ activeRecallPromptAppend: typeof cfg.activeRecallPromptAppend === "string" && cfg.activeRecallPromptAppend.trim().length > 0 ? cfg.activeRecallPromptAppend.trim() : null,
578
+ activeRecallMaxSummaryChars: typeof cfg.activeRecallMaxSummaryChars === "number" ? Math.min(1e3, Math.max(40, Math.floor(cfg.activeRecallMaxSummaryChars))) : 220,
579
+ activeRecallRecentUserTurns: typeof cfg.activeRecallRecentUserTurns === "number" ? Math.min(4, Math.max(0, Math.floor(cfg.activeRecallRecentUserTurns))) : 2,
580
+ activeRecallRecentAssistantTurns: typeof cfg.activeRecallRecentAssistantTurns === "number" ? Math.min(3, Math.max(0, Math.floor(cfg.activeRecallRecentAssistantTurns))) : 1,
581
+ activeRecallRecentUserChars: typeof cfg.activeRecallRecentUserChars === "number" ? Math.min(1e3, Math.max(40, Math.floor(cfg.activeRecallRecentUserChars))) : 600,
582
+ activeRecallRecentAssistantChars: typeof cfg.activeRecallRecentAssistantChars === "number" ? Math.min(1e3, Math.max(40, Math.floor(cfg.activeRecallRecentAssistantChars))) : 400,
583
+ activeRecallThinking: cfg.activeRecallThinking === "low" || cfg.activeRecallThinking === "off" || cfg.activeRecallThinking === "minimal" || cfg.activeRecallThinking === "medium" || cfg.activeRecallThinking === "high" || cfg.activeRecallThinking === "xhigh" || cfg.activeRecallThinking === "adaptive" ? cfg.activeRecallThinking : "low",
584
+ activeRecallTimeoutMs: typeof cfg.activeRecallTimeoutMs === "number" ? Math.max(250, Math.floor(cfg.activeRecallTimeoutMs)) : 15e3,
585
+ activeRecallCacheTtlMs: typeof cfg.activeRecallCacheTtlMs === "number" ? cfg.activeRecallCacheTtlMs === 0 ? 0 : cfg.activeRecallCacheTtlMs < 0 ? 15e3 : Math.min(
586
+ 12e4,
587
+ Math.max(1, Math.floor(cfg.activeRecallCacheTtlMs))
588
+ ) : 15e3,
589
+ activeRecallModel: typeof cfg.activeRecallModel === "string" && cfg.activeRecallModel.trim().length > 0 ? cfg.activeRecallModel.trim() : null,
590
+ activeRecallModelFallbackPolicy: cfg.activeRecallModelFallbackPolicy === "resolved-only" ? "resolved-only" : "default-remote",
591
+ activeRecallPersistTranscripts: cfg.activeRecallPersistTranscripts === true,
592
+ activeRecallTranscriptDir: typeof cfg.activeRecallTranscriptDir === "string" && cfg.activeRecallTranscriptDir.trim().length > 0 ? cfg.activeRecallTranscriptDir.trim() : "active-recall",
593
+ activeRecallEntityGraphDepth: typeof cfg.activeRecallEntityGraphDepth === "number" ? Math.min(3, Math.max(0, Math.floor(cfg.activeRecallEntityGraphDepth))) : 1,
594
+ activeRecallIncludeCausalTrajectories: cfg.activeRecallIncludeCausalTrajectories === true,
595
+ activeRecallIncludeDaySummary: cfg.activeRecallIncludeDaySummary === true,
596
+ activeRecallAttachRecallExplain: cfg.activeRecallAttachRecallExplain === true,
597
+ activeRecallAllowChainedActiveMemory: cfg.activeRecallAllowChainedActiveMemory === true,
598
+ dreaming,
599
+ procedural,
600
+ heartbeat,
601
+ slotBehavior,
602
+ codexCompat,
435
603
  // Hourly summaries
436
604
  hourlySummariesEnabled: cfg.hourlySummariesEnabled !== false,
437
605
  // default: true
@@ -498,7 +666,7 @@ function parseConfig(raw) {
498
666
  semanticConsolidationMinClusterSize: typeof cfg.semanticConsolidationMinClusterSize === "number" ? Math.max(2, Math.floor(cfg.semanticConsolidationMinClusterSize)) : 3,
499
667
  semanticConsolidationExcludeCategories: Array.isArray(cfg.semanticConsolidationExcludeCategories) ? cfg.semanticConsolidationExcludeCategories.filter(
500
668
  (c) => typeof c === "string" && c.length > 0
501
- ) : ["correction", "commitment"],
669
+ ) : ["correction", "commitment", "procedure"],
502
670
  semanticConsolidationIntervalHours: typeof cfg.semanticConsolidationIntervalHours === "number" ? Math.max(1, Math.floor(cfg.semanticConsolidationIntervalHours)) : 168,
503
671
  semanticConsolidationMaxPerRun: typeof cfg.semanticConsolidationMaxPerRun === "number" ? Math.max(0, Math.floor(cfg.semanticConsolidationMaxPerRun)) : 100,
504
672
  creationMemoryEnabled: cfg.creationMemoryEnabled === true,
@@ -559,6 +727,25 @@ function parseConfig(raw) {
559
727
  extractionMaxEntitiesPerRun: typeof cfg.extractionMaxEntitiesPerRun === "number" ? cfg.extractionMaxEntitiesPerRun : 6,
560
728
  extractionMaxQuestionsPerRun: typeof cfg.extractionMaxQuestionsPerRun === "number" ? cfg.extractionMaxQuestionsPerRun : 3,
561
729
  extractionMaxProfileUpdatesPerRun: typeof cfg.extractionMaxProfileUpdatesPerRun === "number" ? cfg.extractionMaxProfileUpdatesPerRun : 4,
730
+ // Importance write-gate for trivial extracted content (issue #372).
731
+ // Default "low" drops only "trivial" facts (greetings, single-word replies,
732
+ // heartbeat pings); set to "normal" or higher to make the gate stricter.
733
+ extractionMinImportanceLevel: (() => {
734
+ const raw2 = cfg.extractionMinImportanceLevel;
735
+ if (raw2 === "trivial" || raw2 === "low" || raw2 === "normal" || raw2 === "high" || raw2 === "critical") {
736
+ return raw2;
737
+ }
738
+ return "low";
739
+ })(),
740
+ // Extraction judge (issue #376). Opt-in LLM-as-judge fact-worthiness gate.
741
+ extractionJudgeEnabled: cfg.extractionJudgeEnabled === true,
742
+ extractionJudgeModel: typeof cfg.extractionJudgeModel === "string" ? cfg.extractionJudgeModel : "",
743
+ extractionJudgeBatchSize: typeof cfg.extractionJudgeBatchSize === "number" && Number.isFinite(cfg.extractionJudgeBatchSize) ? Math.max(1, Math.round(cfg.extractionJudgeBatchSize)) : 20,
744
+ extractionJudgeShadow: cfg.extractionJudgeShadow === true,
745
+ // Inline source attribution (issue #369). Opt-in to preserve
746
+ // backwards compatibility with existing downstream consumers.
747
+ inlineSourceAttributionEnabled: cfg.inlineSourceAttributionEnabled === true,
748
+ inlineSourceAttributionFormat: typeof cfg.inlineSourceAttributionFormat === "string" && cfg.inlineSourceAttributionFormat.trim().length > 0 ? cfg.inlineSourceAttributionFormat : "[Source: agent={agent}, session={sessionId}, ts={ts}]",
562
749
  consolidationRequireNonZeroExtraction: cfg.consolidationRequireNonZeroExtraction !== false,
563
750
  consolidationMinIntervalMs: typeof cfg.consolidationMinIntervalMs === "number" ? cfg.consolidationMinIntervalMs : 10 * 6e4,
564
751
  // QMD maintenance (debounced singleflight)
@@ -661,11 +848,15 @@ function parseConfig(raw) {
661
848
  entityRetrievalMaxSupportingFacts: typeof cfg.entityRetrievalMaxSupportingFacts === "number" ? cfg.entityRetrievalMaxSupportingFacts : 6,
662
849
  entityRetrievalMaxRelatedEntities: typeof cfg.entityRetrievalMaxRelatedEntities === "number" ? cfg.entityRetrievalMaxRelatedEntities : 3,
663
850
  entityRetrievalRecentTurns: typeof cfg.entityRetrievalRecentTurns === "number" ? cfg.entityRetrievalRecentTurns : 6,
851
+ entitySchemas,
664
852
  recallBudgetChars: recallPipelineConfig.recallBudgetChars,
665
853
  recallOuterTimeoutMs: typeof cfg.recallOuterTimeoutMs === "number" ? Math.max(0, Math.floor(cfg.recallOuterTimeoutMs)) : 75e3,
666
854
  recallCoreDeadlineMs: typeof cfg.recallCoreDeadlineMs === "number" ? Math.max(0, Math.floor(cfg.recallCoreDeadlineMs)) : 75e3,
667
855
  recallEnrichmentDeadlineMs: typeof cfg.recallEnrichmentDeadlineMs === "number" ? Math.max(0, Math.floor(cfg.recallEnrichmentDeadlineMs)) : 25e3,
668
856
  recallPipeline: recallPipelineConfig.pipeline,
857
+ recallMmrEnabled: cfg.recallMmrEnabled !== false,
858
+ recallMmrLambda: typeof cfg.recallMmrLambda === "number" && Number.isFinite(cfg.recallMmrLambda) ? Math.min(1, Math.max(0, cfg.recallMmrLambda)) : 0.7,
859
+ recallMmrTopN: typeof cfg.recallMmrTopN === "number" && Number.isFinite(cfg.recallMmrTopN) ? Math.max(0, Math.floor(cfg.recallMmrTopN)) : 40,
669
860
  qmdRecallCacheTtlMs: typeof cfg.qmdRecallCacheTtlMs === "number" ? Math.max(0, Math.floor(cfg.qmdRecallCacheTtlMs)) : 6e4,
670
861
  qmdRecallCacheStaleTtlMs: typeof cfg.qmdRecallCacheStaleTtlMs === "number" ? Math.max(0, Math.floor(cfg.qmdRecallCacheStaleTtlMs)) : 10 * 6e4,
671
862
  qmdRecallCacheMaxEntries: typeof cfg.qmdRecallCacheMaxEntries === "number" ? Math.max(0, Math.floor(cfg.qmdRecallCacheMaxEntries)) : 128,
@@ -674,6 +865,10 @@ function parseConfig(raw) {
674
865
  entityActivityLogMaxEntries: typeof cfg.entityActivityLogMaxEntries === "number" ? cfg.entityActivityLogMaxEntries : 20,
675
866
  entityAliasesEnabled: cfg.entityAliasesEnabled !== false,
676
867
  entitySummaryEnabled: cfg.entitySummaryEnabled !== false,
868
+ entitySynthesisMaxTokens: typeof cfg.entitySynthesisMaxTokens === "number" && Number.isFinite(cfg.entitySynthesisMaxTokens) ? (() => {
869
+ const tokens = Math.max(0, Math.floor(cfg.entitySynthesisMaxTokens));
870
+ return tokens === 0 ? 0 : Math.max(10, tokens);
871
+ })() : 500,
677
872
  // Search backend abstraction
678
873
  searchBackend: ["qmd", "remote", "noop", "lancedb", "meilisearch", "orama"].includes(cfg.searchBackend) ? cfg.searchBackend : "qmd",
679
874
  remoteSearchBaseUrl: typeof cfg.remoteSearchBaseUrl === "string" ? cfg.remoteSearchBaseUrl : void 0,
@@ -701,11 +896,27 @@ function parseConfig(raw) {
701
896
  qmdExplainEnabled: cfg.qmdExplainEnabled === true,
702
897
  // v6.0 Fact deduplication & archival
703
898
  factDeduplicationEnabled: cfg.factDeduplicationEnabled !== false,
899
+ // Issue #373 — write-time semantic similarity guard
900
+ semanticDedupEnabled: cfg.semanticDedupEnabled !== false,
901
+ // Guard against NaN / Infinity — Number.isFinite rejects both and falls
902
+ // back to the documented default so the semantic dedup guard cannot be
903
+ // silently disabled by a malformed config value.
904
+ semanticDedupThreshold: typeof cfg.semanticDedupThreshold === "number" && Number.isFinite(cfg.semanticDedupThreshold) ? Math.min(1, Math.max(0, cfg.semanticDedupThreshold)) : 0.92,
905
+ // Zero is a valid "disable candidate lookup" signal and must be preserved.
906
+ // Only negative or non-finite values fall back to the default of 5.
907
+ // Fractional values in (0, 1) floor to 0, which would silently disable
908
+ // semantic dedup despite a clearly non-zero operator intent — clamp to 1.
909
+ semanticDedupCandidates: (() => {
910
+ const raw2 = cfg.semanticDedupCandidates;
911
+ if (typeof raw2 !== "number" || !Number.isFinite(raw2) || raw2 < 0) return 5;
912
+ const n = Math.floor(raw2);
913
+ return raw2 > 0 && n === 0 ? 1 : n;
914
+ })(),
704
915
  factArchivalEnabled: cfg.factArchivalEnabled === true,
705
916
  factArchivalAgeDays: typeof cfg.factArchivalAgeDays === "number" ? cfg.factArchivalAgeDays : 90,
706
917
  factArchivalMaxImportance: typeof cfg.factArchivalMaxImportance === "number" ? cfg.factArchivalMaxImportance : 0.3,
707
918
  factArchivalMaxAccessCount: typeof cfg.factArchivalMaxAccessCount === "number" ? cfg.factArchivalMaxAccessCount : 2,
708
- factArchivalProtectedCategories: Array.isArray(cfg.factArchivalProtectedCategories) ? cfg.factArchivalProtectedCategories.filter((c) => typeof c === "string") : ["commitment", "preference", "decision", "principle"],
919
+ factArchivalProtectedCategories: Array.isArray(cfg.factArchivalProtectedCategories) ? cfg.factArchivalProtectedCategories.filter((c) => typeof c === "string") : ["commitment", "preference", "decision", "principle", "procedure"],
709
920
  // v8.3 lifecycle policy engine (default off)
710
921
  lifecyclePolicyEnabled: cfg.lifecyclePolicyEnabled === true,
711
922
  lifecycleFilterStaleEnabled: cfg.lifecycleFilterStaleEnabled === true,
@@ -714,7 +925,7 @@ function parseConfig(raw) {
714
925
  lifecycleArchiveDecayThreshold: typeof cfg.lifecycleArchiveDecayThreshold === "number" ? Math.min(1, Math.max(0, cfg.lifecycleArchiveDecayThreshold)) : 0.85,
715
926
  lifecycleProtectedCategories: Array.isArray(cfg.lifecycleProtectedCategories) ? cfg.lifecycleProtectedCategories.filter(
716
927
  (c) => typeof c === "string" && VALID_MEMORY_CATEGORIES.has(c)
717
- ) : ["decision", "principle", "commitment", "preference"],
928
+ ) : ["decision", "principle", "commitment", "preference", "procedure"],
718
929
  lifecycleMetricsEnabled: typeof cfg.lifecycleMetricsEnabled === "boolean" ? cfg.lifecycleMetricsEnabled : cfg.lifecyclePolicyEnabled === true,
719
930
  // v8.3 proactive + policy learning (default off)
720
931
  proactiveExtractionEnabled: cfg.proactiveExtractionEnabled === true,
@@ -858,7 +1069,71 @@ function parseConfig(raw) {
858
1069
  temporal: typeof w?.temporal === "number" ? Math.max(0, w.temporal) : 0.85
859
1070
  };
860
1071
  })(),
861
- parallelMaxResultsPerAgent: typeof cfg.parallelMaxResultsPerAgent === "number" ? Math.max(0, Math.floor(cfg.parallelMaxResultsPerAgent)) : 20
1072
+ parallelMaxResultsPerAgent: typeof cfg.parallelMaxResultsPerAgent === "number" ? Math.max(0, Math.floor(cfg.parallelMaxResultsPerAgent)) : 20,
1073
+ briefing: parseBriefingConfig(cfg.briefing),
1074
+ // Codex CLI connector settings (install-time)
1075
+ codex: (() => {
1076
+ const raw2 = cfg.codex && typeof cfg.codex === "object" && !Array.isArray(cfg.codex) ? cfg.codex : {};
1077
+ const installExtension = coerceInstallExtension(raw2.installExtension) ?? true;
1078
+ const codexHome = typeof raw2.codexHome === "string" && raw2.codexHome.trim().length > 0 ? raw2.codexHome.trim() : null;
1079
+ return { installExtension, codexHome };
1080
+ })(),
1081
+ // MECE Taxonomy (#366)
1082
+ // Coerce string booleans from CLI (e.g. --config taxonomyEnabled=true) — gotcha #36
1083
+ taxonomyEnabled: coerceBool(cfg.taxonomyEnabled) ?? false,
1084
+ taxonomyAutoGenResolver: coerceBool(cfg.taxonomyAutoGenResolver) ?? true,
1085
+ // Codex CLI — native memory materialization (#378)
1086
+ codexMaterializeMemories: cfg.codexMaterializeMemories !== false,
1087
+ codexMaterializeNamespace: typeof cfg.codexMaterializeNamespace === "string" && cfg.codexMaterializeNamespace.trim().length > 0 ? cfg.codexMaterializeNamespace.trim() : "auto",
1088
+ codexMaterializeMaxSummaryTokens: typeof cfg.codexMaterializeMaxSummaryTokens === "number" ? Math.max(0, Math.floor(cfg.codexMaterializeMaxSummaryTokens)) : 4500,
1089
+ codexMaterializeRolloutRetentionDays: typeof cfg.codexMaterializeRolloutRetentionDays === "number" ? Math.max(0, Math.floor(cfg.codexMaterializeRolloutRetentionDays)) : 30,
1090
+ codexMaterializeOnConsolidation: cfg.codexMaterializeOnConsolidation !== false,
1091
+ codexMaterializeOnSessionEnd: cfg.codexMaterializeOnSessionEnd !== false,
1092
+ // Codex CLI — marketplace integration (#418)
1093
+ codexMarketplaceEnabled: cfg.codexMarketplaceEnabled !== false,
1094
+ // default: true
1095
+ // Page-level versioning (issue #371)
1096
+ versioningEnabled: cfg.versioningEnabled === true,
1097
+ versioningMaxPerPage: typeof cfg.versioningMaxPerPage === "number" ? Math.max(0, Math.floor(cfg.versioningMaxPerPage)) : 50,
1098
+ versioningSidecarDir: typeof cfg.versioningSidecarDir === "string" && cfg.versioningSidecarDir.trim().length > 0 ? cfg.versioningSidecarDir.trim() : ".versions",
1099
+ // Binary file lifecycle management (#367)
1100
+ binaryLifecycleEnabled: cfg.binaryLifecycleEnabled === true,
1101
+ binaryLifecycleGracePeriodDays: typeof cfg.binaryLifecycleGracePeriodDays === "number" ? Math.max(0, Math.floor(cfg.binaryLifecycleGracePeriodDays)) : 7,
1102
+ binaryLifecycleBackendType: (() => {
1103
+ const valid = ["filesystem", "s3", "none"];
1104
+ const raw2 = cfg.binaryLifecycleBackendType;
1105
+ if (typeof raw2 === "string" && valid.includes(raw2)) {
1106
+ return raw2;
1107
+ }
1108
+ return "none";
1109
+ })(),
1110
+ binaryLifecycleBackendPath: typeof cfg.binaryLifecycleBackendPath === "string" ? cfg.binaryLifecycleBackendPath.trim() : "",
1111
+ // Codex citation parity (issue #379)
1112
+ citationsEnabled: cfg.citationsEnabled === true,
1113
+ citationsAutoDetect: cfg.citationsAutoDetect !== false,
1114
+ // External enrichment pipeline (issue #365)
1115
+ enrichmentEnabled: cfg.enrichmentEnabled === true,
1116
+ enrichmentAutoOnCreate: cfg.enrichmentAutoOnCreate === true,
1117
+ enrichmentMaxCandidatesPerEntity: typeof cfg.enrichmentMaxCandidatesPerEntity === "number" ? Math.max(0, Math.floor(cfg.enrichmentMaxCandidatesPerEntity)) : 20,
1118
+ // Memory extensions discovery (#382)
1119
+ memoryExtensionsEnabled: cfg.memoryExtensionsEnabled !== false,
1120
+ memoryExtensionsRoot: typeof cfg.memoryExtensionsRoot === "string" && cfg.memoryExtensionsRoot.trim().length > 0 ? cfg.memoryExtensionsRoot.trim() : ""
1121
+ };
1122
+ }
1123
+ function parseBriefingConfig(raw) {
1124
+ const entry = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
1125
+ const defaultFormat = entry.defaultFormat === "json" || entry.defaultFormat === "markdown" ? entry.defaultFormat : "markdown";
1126
+ const maxFollowupsRaw = typeof entry.maxFollowups === "number" && Number.isFinite(entry.maxFollowups) ? Math.floor(entry.maxFollowups) : 5;
1127
+ const maxFollowups = Math.max(0, Math.min(10, maxFollowupsRaw));
1128
+ return {
1129
+ enabled: entry.enabled !== false,
1130
+ defaultWindow: typeof entry.defaultWindow === "string" && entry.defaultWindow.trim().length > 0 ? entry.defaultWindow.trim() : "yesterday",
1131
+ defaultFormat,
1132
+ maxFollowups,
1133
+ calendarSource: typeof entry.calendarSource === "string" && entry.calendarSource.trim().length > 0 ? entry.calendarSource.trim() : null,
1134
+ saveByDefault: entry.saveByDefault === true,
1135
+ saveDir: typeof entry.saveDir === "string" && entry.saveDir.trim().length > 0 ? entry.saveDir.trim() : null,
1136
+ llmFollowups: entry.llmFollowups !== false
862
1137
  };
863
1138
  }
864
1139
  function clampNonNegativeNumber(value) {
@@ -922,6 +1197,11 @@ function buildDefaultRecallPipeline(cfg) {
922
1197
  maxEntities: typeof cfg.knowledgeIndexMaxEntities === "number" ? Math.max(0, Math.floor(cfg.knowledgeIndexMaxEntities)) : 40
923
1198
  },
924
1199
  { id: "verbatim-artifacts", enabled: cfg.verbatimArtifactsEnabled === true },
1200
+ {
1201
+ id: "procedure-recall",
1202
+ enabled: typeof cfg.procedural === "object" && cfg.procedural !== null && !Array.isArray(cfg.procedural) && cfg.procedural.enabled === true,
1203
+ maxChars: 2400
1204
+ },
925
1205
  { id: "memory-boxes", enabled: cfg.memoryBoxesEnabled === true },
926
1206
  { id: "temporal-memory-tree", enabled: cfg.temporalMemoryTreeEnabled === true },
927
1207
  { id: "lcm-compressed-history", enabled: cfg.lcmEnabled === true },
@@ -1021,7 +1301,8 @@ function buildRecallPipelineConfig(cfg) {
1021
1301
  }
1022
1302
 
1023
1303
  export {
1304
+ coerceInstallExtension,
1024
1305
  VALID_MEMORY_CATEGORIES,
1025
1306
  parseConfig
1026
1307
  };
1027
- //# sourceMappingURL=chunk-ISY75RLM.js.map
1308
+ //# sourceMappingURL=chunk-OJFGVJS6.js.map