@remnic/core 1.1.1 → 1.1.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 (497) hide show
  1. package/dist/abort-error.js +1 -0
  2. package/dist/abstraction-nodes.js +1 -0
  3. package/dist/access-audit.js +1 -0
  4. package/dist/access-cli.js +76 -51
  5. package/dist/access-cli.js.map +1 -1
  6. package/dist/access-http.d.ts +50 -5
  7. package/dist/access-http.js +38 -16
  8. package/dist/access-idempotency.js +1 -0
  9. package/dist/access-mcp.d.ts +10 -5
  10. package/dist/access-mcp.js +37 -14
  11. package/dist/access-schema.d.ts +133 -13
  12. package/dist/access-schema.js +20 -1
  13. package/dist/access-service-_AEUMVyX.d.ts +1981 -0
  14. package/dist/access-service.d.ts +11 -6
  15. package/dist/access-service.js +39 -14
  16. package/dist/active-memory-bridge.js +1 -0
  17. package/dist/active-recall.js +1 -0
  18. package/dist/active-recall.js.map +1 -1
  19. package/dist/behavior-learner.js +1 -0
  20. package/dist/behavior-learner.js.map +1 -1
  21. package/dist/behavior-signals.js +1 -0
  22. package/dist/bootstrap.d.ts +6 -4
  23. package/dist/bootstrap.js +1 -0
  24. package/dist/boxes.js +1 -0
  25. package/dist/briefing.d.ts +9 -5
  26. package/dist/briefing.js +10 -6
  27. package/dist/buffer-surprise-report.js +1 -0
  28. package/dist/buffer-surprise.js +1 -0
  29. package/dist/buffer.d.ts +1 -1
  30. package/dist/buffer.js +1 -0
  31. package/dist/calibration.d.ts +8 -1
  32. package/dist/calibration.js +10 -2
  33. package/dist/calibration.js.map +1 -1
  34. package/dist/capsule-cli.d.ts +137 -0
  35. package/dist/capsule-cli.js +34 -0
  36. package/dist/capsule-crypto-5CYAGVC5.js +18 -0
  37. package/dist/capsule-export-NZQPOTQ4.js +17 -0
  38. package/dist/capsule-export-NZQPOTQ4.js.map +1 -0
  39. package/dist/capsule-import-SDCUXLEV.js +16 -0
  40. package/dist/capsule-import-SDCUXLEV.js.map +1 -0
  41. package/dist/capsule-merge-DI7PNQ2H.js +189 -0
  42. package/dist/capsule-merge-DI7PNQ2H.js.map +1 -0
  43. package/dist/causal-behavior.js +1 -0
  44. package/dist/causal-behavior.js.map +1 -1
  45. package/dist/causal-chain.js +1 -0
  46. package/dist/causal-consolidation.js +12 -9
  47. package/dist/causal-consolidation.js.map +1 -1
  48. package/dist/causal-retrieval.js +2 -1
  49. package/dist/causal-retrieval.js.map +1 -1
  50. package/dist/causal-trajectory-graph.js +4 -1
  51. package/dist/causal-trajectory-graph.js.map +1 -1
  52. package/dist/causal-trajectory.js +2 -1
  53. package/dist/chunk-2LSZVONP.js +67 -0
  54. package/dist/chunk-2LSZVONP.js.map +1 -0
  55. package/dist/chunk-32KD5IHZ.js +245 -0
  56. package/dist/chunk-32KD5IHZ.js.map +1 -0
  57. package/dist/{chunk-VDX363PS.js → chunk-34F3PLWZ.js} +10 -3
  58. package/dist/chunk-34F3PLWZ.js.map +1 -0
  59. package/dist/chunk-3KIS4VGT.js +228 -0
  60. package/dist/chunk-3KIS4VGT.js.map +1 -0
  61. package/dist/chunk-3LCWFNVS.js +350 -0
  62. package/dist/chunk-3LCWFNVS.js.map +1 -0
  63. package/dist/chunk-43EKP2UK.js +26 -0
  64. package/dist/chunk-43EKP2UK.js.map +1 -0
  65. package/dist/chunk-457A4P3L.js +119 -0
  66. package/dist/chunk-457A4P3L.js.map +1 -0
  67. package/dist/{chunk-KUB6JU6H.js → chunk-47WOM4YW.js} +2 -2
  68. package/dist/{chunk-HK3FGIEW.js → chunk-4PLGJRBV.js} +656 -20
  69. package/dist/chunk-4PLGJRBV.js.map +1 -0
  70. package/dist/{chunk-BGJGXLZ7.js → chunk-55FXRRSJ.js} +11 -8
  71. package/dist/chunk-55FXRRSJ.js.map +1 -0
  72. package/dist/{chunk-ULYOGL6R.js → chunk-5HRY2WRF.js} +7 -3
  73. package/dist/chunk-5HRY2WRF.js.map +1 -0
  74. package/dist/chunk-6TBWYBJ3.js +236 -0
  75. package/dist/chunk-6TBWYBJ3.js.map +1 -0
  76. package/dist/chunk-74EMIVE4.js +329 -0
  77. package/dist/chunk-74EMIVE4.js.map +1 -0
  78. package/dist/chunk-74WWN7ZW.js +82 -0
  79. package/dist/chunk-74WWN7ZW.js.map +1 -0
  80. package/dist/{chunk-B5WXLVDY.js → chunk-7GCMLT7J.js} +245 -25
  81. package/dist/chunk-7GCMLT7J.js.map +1 -0
  82. package/dist/chunk-A6XUJE5D.js +126 -0
  83. package/dist/chunk-A6XUJE5D.js.map +1 -0
  84. package/dist/chunk-AJA46VX5.js +393 -0
  85. package/dist/chunk-AJA46VX5.js.map +1 -0
  86. package/dist/{chunk-DFTTJYSO.js → chunk-AKUCB2OG.js} +525 -24
  87. package/dist/chunk-AKUCB2OG.js.map +1 -0
  88. package/dist/chunk-ASIQZXYO.js +277 -0
  89. package/dist/chunk-ASIQZXYO.js.map +1 -0
  90. package/dist/{chunk-ZEM3OK2K.js → chunk-B2TL6GA2.js} +3 -3
  91. package/dist/chunk-BJMBJZ2Y.js +290 -0
  92. package/dist/chunk-BJMBJZ2Y.js.map +1 -0
  93. package/dist/chunk-BT7NVCML.js +79 -0
  94. package/dist/chunk-BT7NVCML.js.map +1 -0
  95. package/dist/chunk-CK5NTM2S.js +454 -0
  96. package/dist/chunk-CK5NTM2S.js.map +1 -0
  97. package/dist/{chunk-3GXCSUXR.js → chunk-CRU27Q4J.js} +2 -2
  98. package/dist/{chunk-F5VP6YCB.js → chunk-DCE6SQLA.js} +572 -155
  99. package/dist/chunk-DCE6SQLA.js.map +1 -0
  100. package/dist/{chunk-CUPFXL3J.js → chunk-DHRQHX36.js} +4 -4
  101. package/dist/chunk-DHRQHX36.js.map +1 -0
  102. package/dist/{chunk-GKFXUTJ2.js → chunk-DR7MCMPS.js} +981 -61
  103. package/dist/chunk-DR7MCMPS.js.map +1 -0
  104. package/dist/chunk-FP2373TW.js +149 -0
  105. package/dist/chunk-FP2373TW.js.map +1 -0
  106. package/dist/{chunk-RBBWYEFJ.js → chunk-G2WADRQ3.js} +1 -1
  107. package/dist/chunk-G7D6GZ5J.js +48 -0
  108. package/dist/chunk-G7D6GZ5J.js.map +1 -0
  109. package/dist/chunk-H7XKCNR6.js +60 -0
  110. package/dist/chunk-H7XKCNR6.js.map +1 -0
  111. package/dist/{chunk-VYM3VWOF.js → chunk-IM3JSE73.js} +966 -329
  112. package/dist/chunk-IM3JSE73.js.map +1 -0
  113. package/dist/chunk-IXEJRKCZ.js +18 -0
  114. package/dist/chunk-IXEJRKCZ.js.map +1 -0
  115. package/dist/chunk-IYY4MCPG.js +275 -0
  116. package/dist/chunk-IYY4MCPG.js.map +1 -0
  117. package/dist/{chunk-BK2EFTE2.js → chunk-JWSENLQI.js} +508 -28
  118. package/dist/chunk-JWSENLQI.js.map +1 -0
  119. package/dist/chunk-KNKUID7G.js +183 -0
  120. package/dist/chunk-KNKUID7G.js.map +1 -0
  121. package/dist/chunk-L2IO2QPY.js +2036 -0
  122. package/dist/chunk-L2IO2QPY.js.map +1 -0
  123. package/dist/{chunk-SPI27QT6.js → chunk-L5IIGA5V.js} +9 -4
  124. package/dist/chunk-L5IIGA5V.js.map +1 -0
  125. package/dist/{chunk-RGLL5SPU.js → chunk-LVYGDT5V.js} +56 -82
  126. package/dist/chunk-LVYGDT5V.js.map +1 -0
  127. package/dist/{chunk-ZAIM4TUE.js → chunk-LW2NMHDW.js} +46 -1
  128. package/dist/chunk-LW2NMHDW.js.map +1 -0
  129. package/dist/{chunk-3OGMS3PE.js → chunk-LZRYQK6L.js} +3 -2
  130. package/dist/chunk-LZRYQK6L.js.map +1 -0
  131. package/dist/chunk-MDYG7VI7.js +48 -0
  132. package/dist/chunk-MDYG7VI7.js.map +1 -0
  133. package/dist/chunk-MXC3AP5I.js +74 -0
  134. package/dist/chunk-MXC3AP5I.js.map +1 -0
  135. package/dist/{chunk-S3EEFKNY.js → chunk-N7X62G74.js} +26 -11
  136. package/dist/chunk-N7X62G74.js.map +1 -0
  137. package/dist/chunk-NN3TS5BM.js +147 -0
  138. package/dist/chunk-NN3TS5BM.js.map +1 -0
  139. package/dist/chunk-OA3L7BFR.js +183 -0
  140. package/dist/chunk-OA3L7BFR.js.map +1 -0
  141. package/dist/{chunk-LK6SGL53.js → chunk-OR64ZGRZ.js} +3 -2
  142. package/dist/chunk-OR64ZGRZ.js.map +1 -0
  143. package/dist/chunk-OZHRDTDX.js +240 -0
  144. package/dist/chunk-OZHRDTDX.js.map +1 -0
  145. package/dist/chunk-PCUKNJAZ.js +165 -0
  146. package/dist/chunk-PCUKNJAZ.js.map +1 -0
  147. package/dist/{chunk-6PFRXT4K.js → chunk-PFV5C235.js} +11 -6
  148. package/dist/chunk-PFV5C235.js.map +1 -0
  149. package/dist/chunk-PZ5AY32C.js +10 -0
  150. package/dist/chunk-PZ5AY32C.js.map +1 -0
  151. package/dist/{chunk-XZ2TIKGC.js → chunk-Q7FJ5ZHM.js} +30 -10
  152. package/dist/chunk-Q7FJ5ZHM.js.map +1 -0
  153. package/dist/{chunk-7I7FKFZH.js → chunk-R2L7SUX2.js} +6 -6
  154. package/dist/{chunk-JL2PU6AI.js → chunk-R2XRID2N.js} +2 -2
  155. package/dist/{chunk-WCLICCGB.js → chunk-RILIVK4O.js} +91 -4
  156. package/dist/chunk-RILIVK4O.js.map +1 -0
  157. package/dist/{chunk-C2EFFULQ.js → chunk-RK2Y4XOM.js} +163 -20
  158. package/dist/chunk-RK2Y4XOM.js.map +1 -0
  159. package/dist/{chunk-TP4FZJIZ.js → chunk-RULE4VG5.js} +5 -1
  160. package/dist/chunk-RULE4VG5.js.map +1 -0
  161. package/dist/{chunk-PVPWZSSI.js → chunk-SMA4IMHV.js} +19 -3
  162. package/dist/chunk-SMA4IMHV.js.map +1 -0
  163. package/dist/{chunk-WVVA7F5A.js → chunk-SS253RXF.js} +30 -16
  164. package/dist/chunk-SS253RXF.js.map +1 -0
  165. package/dist/chunk-TUFG6VXY.js +875 -0
  166. package/dist/chunk-TUFG6VXY.js.map +1 -0
  167. package/dist/chunk-TYEOAFH3.js +251 -0
  168. package/dist/chunk-TYEOAFH3.js.map +1 -0
  169. package/dist/chunk-UKJAGEXH.js +260 -0
  170. package/dist/chunk-UKJAGEXH.js.map +1 -0
  171. package/dist/{chunk-KVBLZUKV.js → chunk-USFPPRAF.js} +93 -3
  172. package/dist/chunk-USFPPRAF.js.map +1 -0
  173. package/dist/{chunk-EPQJM2GC.js → chunk-VTJVUHRK.js} +22 -36
  174. package/dist/chunk-VTJVUHRK.js.map +1 -0
  175. package/dist/{chunk-O5ETUNBT.js → chunk-VTU2B4VF.js} +7 -3
  176. package/dist/chunk-VTU2B4VF.js.map +1 -0
  177. package/dist/chunk-WIICJPET.js +45 -0
  178. package/dist/chunk-WIICJPET.js.map +1 -0
  179. package/dist/{chunk-VBVG2M5G.js → chunk-WPGJYVUH.js} +6 -2
  180. package/dist/chunk-WPGJYVUH.js.map +1 -0
  181. package/dist/{chunk-YNQKWQT4.js → chunk-WSZIHQBK.js} +31 -11
  182. package/dist/{chunk-YNQKWQT4.js.map → chunk-WSZIHQBK.js.map} +1 -1
  183. package/dist/{chunk-NZLQTHS5.js → chunk-WW3QQF4H.js} +4 -1
  184. package/dist/chunk-WW3QQF4H.js.map +1 -0
  185. package/dist/{chunk-FVA6TGI3.js → chunk-Y3WQ4ZWK.js} +42 -2
  186. package/dist/chunk-Y3WQ4ZWK.js.map +1 -0
  187. package/dist/chunk-YNJHCGDT.js +309 -0
  188. package/dist/chunk-YNJHCGDT.js.map +1 -0
  189. package/dist/{chunk-ALXMCZEU.js → chunk-Z2E7VW55.js} +6 -3
  190. package/dist/chunk-Z2E7VW55.js.map +1 -0
  191. package/dist/{chunk-INXV5JBT.js → chunk-ZGXSCMQN.js} +1992 -410
  192. package/dist/chunk-ZGXSCMQN.js.map +1 -0
  193. package/dist/{chunk-W6SL7OFG.js → chunk-ZTSE2ZJ6.js} +12 -2
  194. package/dist/{chunk-W6SL7OFG.js.map → chunk-ZTSE2ZJ6.js.map} +1 -1
  195. package/dist/chunking.js +1 -0
  196. package/dist/cipher-GVE2GQ5H.js +28 -0
  197. package/dist/cipher-GVE2GQ5H.js.map +1 -0
  198. package/dist/citations.js +1 -0
  199. package/dist/{cli-BkeRaYfk.d.ts → cli-x2APT9a6.d.ts} +26 -7
  200. package/dist/cli.d.ts +11 -6
  201. package/dist/cli.js +68 -34
  202. package/dist/codex-thread-key.js +1 -0
  203. package/dist/commitment-ledger.js +1 -0
  204. package/dist/compression-optimizer.js +1 -0
  205. package/dist/config.d.ts +2 -1
  206. package/dist/config.js +5 -2
  207. package/dist/connectors-cli-DFGtY2DB.d.ts +257 -0
  208. package/dist/connectors-cli.d.ts +2 -0
  209. package/dist/connectors-cli.js +22 -0
  210. package/dist/connectors-cli.js.map +1 -0
  211. package/dist/consolidation-operator.d.ts +65 -5
  212. package/dist/consolidation-operator.js +6 -1
  213. package/dist/consolidation-provenance-check.d.ts +1 -1
  214. package/dist/consolidation-provenance-check.js +3 -2
  215. package/dist/consolidation-undo.d.ts +1 -1
  216. package/dist/consolidation-undo.js +1 -0
  217. package/dist/consolidation-undo.js.map +1 -1
  218. package/dist/{contradiction-review-WIUBAR52.js → contradiction-review-5LTTVDQV.js} +2 -1
  219. package/dist/contradiction-review-5LTTVDQV.js.map +1 -0
  220. package/dist/{contradiction-scan-E3GJTI4F.js → contradiction-scan-3Z6YW7YA.js} +2 -1
  221. package/dist/{contradiction-scan-E3GJTI4F.js.map → contradiction-scan-3Z6YW7YA.js.map} +1 -1
  222. package/dist/cross-namespace-budget.js +1 -0
  223. package/dist/cue-anchors.js +1 -0
  224. package/dist/dashboard-runtime.js +1 -0
  225. package/dist/day-summary.js +1 -0
  226. package/dist/delinearize.js +1 -0
  227. package/dist/direct-answer-wiring.js +1 -0
  228. package/dist/direct-answer.js +1 -0
  229. package/dist/dreams-ledger-LR2NBAZE.js +286 -0
  230. package/dist/dreams-ledger-LR2NBAZE.js.map +1 -0
  231. package/dist/embedding-fallback.js +3 -1
  232. package/dist/{engine-F3GOXGE5.js → engine-ICC2DSQF.js} +10 -7
  233. package/dist/engine-ICC2DSQF.js.map +1 -0
  234. package/dist/entity-retrieval.d.ts +1 -1
  235. package/dist/entity-retrieval.js +9 -6
  236. package/dist/entity-schema.js +1 -0
  237. package/dist/evals.js +1 -0
  238. package/dist/evidence-pack.d.ts +16 -0
  239. package/dist/evidence-pack.js +8 -0
  240. package/dist/evidence-pack.js.map +1 -0
  241. package/dist/explicit-capture.d.ts +6 -4
  242. package/dist/explicit-capture.js +1 -0
  243. package/dist/extraction-judge-telemetry.js +1 -0
  244. package/dist/extraction-judge-training.js +1 -0
  245. package/dist/extraction-judge.js +1 -0
  246. package/dist/extraction.js +9 -8
  247. package/dist/fallback-llm.js +3 -2
  248. package/dist/first-start-migration-4MHQEOSD.js +263 -0
  249. package/dist/first-start-migration-4MHQEOSD.js.map +1 -0
  250. package/dist/forget-PLR6J5DN.js +69 -0
  251. package/dist/forget-PLR6J5DN.js.map +1 -0
  252. package/dist/framework-CyHYDcri.d.ts +153 -0
  253. package/dist/fs-utils-IRVUFB6G.js +30 -0
  254. package/dist/fs-utils-IRVUFB6G.js.map +1 -0
  255. package/dist/graph-dashboard-diff.js +1 -0
  256. package/dist/graph-dashboard-key.js +1 -0
  257. package/dist/graph-dashboard-parser.js +1 -0
  258. package/dist/graph-edge-decay-PWB63GRE.js +207 -0
  259. package/dist/graph-edge-decay-PWB63GRE.js.map +1 -0
  260. package/dist/graph-edge-reinforcement.d.ts +81 -0
  261. package/dist/graph-edge-reinforcement.js +24 -0
  262. package/dist/graph-edge-reinforcement.js.map +1 -0
  263. package/dist/graph-events.d.ts +87 -0
  264. package/dist/graph-events.js +14 -0
  265. package/dist/graph-events.js.map +1 -0
  266. package/dist/graph-recall.js +1 -0
  267. package/dist/graph-retrieval.js +1 -0
  268. package/dist/graph-snapshot.d.ts +112 -0
  269. package/dist/graph-snapshot.js +19 -0
  270. package/dist/graph-snapshot.js.map +1 -0
  271. package/dist/graph.d.ts +105 -7
  272. package/dist/graph.js +20 -3
  273. package/dist/harmonic-retrieval.js +1 -0
  274. package/dist/himem.js +1 -0
  275. package/dist/hygiene.js +1 -0
  276. package/dist/identity-continuity.js +1 -0
  277. package/dist/importance.js +1 -0
  278. package/dist/index.d.ts +562 -13
  279. package/dist/index.js +365 -96
  280. package/dist/index.js.map +1 -1
  281. package/dist/intent.js +1 -0
  282. package/dist/json-extract.js +1 -0
  283. package/dist/json-store.js +1 -0
  284. package/dist/kdf-7S6RWKLZ.js +26 -0
  285. package/dist/kdf-7S6RWKLZ.js.map +1 -0
  286. package/dist/legacy-hook-compat.js +1 -0
  287. package/dist/legacy-hook-compat.js.map +1 -1
  288. package/dist/lifecycle.js +1 -0
  289. package/dist/live-connectors-runner.d.ts +48 -0
  290. package/dist/live-connectors-runner.js +17 -0
  291. package/dist/live-connectors-runner.js.map +1 -0
  292. package/dist/local-llm.js +3 -2
  293. package/dist/logger.js +1 -0
  294. package/dist/memory-action-policy.js +1 -0
  295. package/dist/memory-cache.d.ts +2 -1
  296. package/dist/memory-cache.js +4 -1
  297. package/dist/memory-governance-KG52RITE.js +37 -0
  298. package/dist/memory-governance-KG52RITE.js.map +1 -0
  299. package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
  300. package/dist/memory-lifecycle-ledger-utils.js +4 -1
  301. package/dist/memory-projection-format.js +1 -0
  302. package/dist/{memory-projection-store-DeSXPh1j.d.ts → memory-projection-store-D3vBHS4J.d.ts} +1 -0
  303. package/dist/memory-projection-store.d.ts +1 -1
  304. package/dist/memory-projection-store.js +1 -0
  305. package/dist/memory-worth-bench.js +1 -0
  306. package/dist/memory-worth-bench.js.map +1 -1
  307. package/dist/memory-worth-filter.js +1 -0
  308. package/dist/memory-worth-outcomes.d.ts +1 -1
  309. package/dist/memory-worth-outcomes.js +1 -0
  310. package/dist/memory-worth.js +1 -0
  311. package/dist/metadata-FC3XPDRQ.js +21 -0
  312. package/dist/metadata-FC3XPDRQ.js.map +1 -0
  313. package/dist/migrate-from-identity-anchor-TTEDEJGX.js +8 -0
  314. package/dist/migrate-from-identity-anchor-TTEDEJGX.js.map +1 -0
  315. package/dist/model-registry.js +1 -0
  316. package/dist/models-json.js +1 -0
  317. package/dist/native-knowledge.js +1 -0
  318. package/dist/negative.js +1 -0
  319. package/dist/objective-state-writers.js +1 -0
  320. package/dist/objective-state-writers.js.map +1 -1
  321. package/dist/objective-state.js +1 -0
  322. package/dist/openai-chat-compat.js +1 -0
  323. package/dist/operator-toolkit.d.ts +46 -2
  324. package/dist/operator-toolkit.js +29 -17
  325. package/dist/opik-exporter.js +1 -0
  326. package/dist/opik-exporter.js.map +1 -1
  327. package/dist/{orchestrator-CmJ-NTdJ.d.ts → orchestrator-ChkesB8U.d.ts} +177 -13
  328. package/dist/orchestrator.d.ts +6 -4
  329. package/dist/orchestrator.js +58 -42
  330. package/dist/page-versioning.js +1 -0
  331. package/dist/path-RMTY5Y5A.js +9 -0
  332. package/dist/path-RMTY5Y5A.js.map +1 -0
  333. package/dist/patterns-cli.d.ts +160 -0
  334. package/dist/patterns-cli.js +29 -0
  335. package/dist/patterns-cli.js.map +1 -0
  336. package/dist/peers-6OSQ3NK6.js +44 -0
  337. package/dist/peers-6OSQ3NK6.js.map +1 -0
  338. package/dist/plugin-id.js +1 -0
  339. package/dist/policy-runtime.js +1 -0
  340. package/dist/{port-BADbLZU5.d.ts → port-hqGnoStS.d.ts} +6 -0
  341. package/dist/profiling.js +1 -0
  342. package/dist/purge-6ATBGT77.js +205 -0
  343. package/dist/purge-6ATBGT77.js.map +1 -0
  344. package/dist/qmd-recall-cache.d.ts +1 -1
  345. package/dist/qmd-recall-cache.js +1 -0
  346. package/dist/qmd.d.ts +2 -1
  347. package/dist/qmd.js +4 -3
  348. package/dist/reasoning-trace-recall.js +1 -0
  349. package/dist/reasoning-trace-types.js +1 -0
  350. package/dist/recall-audit-anomaly.js +1 -0
  351. package/dist/recall-audit.js +1 -0
  352. package/dist/recall-disclosure-escalation.d.ts +84 -0
  353. package/dist/recall-disclosure-escalation.js +14 -0
  354. package/dist/recall-disclosure-escalation.js.map +1 -0
  355. package/dist/recall-explain-renderer.js +4 -1
  356. package/dist/recall-mmr.js +1 -0
  357. package/dist/recall-qos.js +1 -0
  358. package/dist/recall-query-policy.js +1 -0
  359. package/dist/recall-state.d.ts +7 -0
  360. package/dist/recall-state.js +2 -1
  361. package/dist/recall-tag-filter.d.ts +56 -0
  362. package/dist/recall-tag-filter.js +14 -0
  363. package/dist/recall-tag-filter.js.map +1 -0
  364. package/dist/recall-tokenization.js +1 -0
  365. package/dist/recall-xray-cli.d.ts +9 -2
  366. package/dist/recall-xray-cli.js +9 -4
  367. package/dist/recall-xray-renderer.js +4 -1
  368. package/dist/recall-xray.d.ts +116 -2
  369. package/dist/recall-xray.js +9 -3
  370. package/dist/reconstruct.js +1 -0
  371. package/dist/release-changelog.js +2 -0
  372. package/dist/release-changelog.js.map +1 -1
  373. package/dist/relevance.js +1 -0
  374. package/dist/rerank.js +1 -0
  375. package/dist/{resolution-QBTDHTG7.js → resolution-YGIBORXI.js} +2 -1
  376. package/dist/{resolution-QBTDHTG7.js.map → resolution-YGIBORXI.js.map} +1 -1
  377. package/dist/resolve-auth-token.d.ts +51 -0
  378. package/dist/resolve-auth-token.js +12 -0
  379. package/dist/resolve-auth-token.js.map +1 -0
  380. package/dist/resolve-provider-secret.d.ts +13 -1
  381. package/dist/resolve-provider-secret.js +6 -1
  382. package/dist/resume-bundles.js +5 -4
  383. package/dist/retrieval-agents.d.ts +1 -1
  384. package/dist/retrieval-agents.js +1 -0
  385. package/dist/retrieval-tiers.js +1 -0
  386. package/dist/retrieval.js +1 -0
  387. package/dist/sanitize.js +1 -0
  388. package/dist/schemas.d.ts +15 -2
  389. package/dist/schemas.js +2 -1
  390. package/dist/sdk-compat.js +1 -0
  391. package/dist/sdk-compat.js.map +1 -1
  392. package/dist/secure-store-4R2GSO7S.js +156 -0
  393. package/dist/secure-store-4R2GSO7S.js.map +1 -0
  394. package/dist/semantic-chunking.js +1 -0
  395. package/dist/{semantic-consolidation-CxJU6MJk.d.ts → semantic-consolidation-ByBXb-sf.d.ts} +3 -3
  396. package/dist/semantic-consolidation.d.ts +2 -2
  397. package/dist/semantic-consolidation.js +12 -6
  398. package/dist/semantic-rule-promotion.d.ts +1 -1
  399. package/dist/semantic-rule-promotion.js +9 -6
  400. package/dist/semantic-rule-verifier.d.ts +1 -1
  401. package/dist/semantic-rule-verifier.js +9 -6
  402. package/dist/session-integrity.js +1 -0
  403. package/dist/session-observer-bands.js +1 -0
  404. package/dist/session-observer-state.js +1 -0
  405. package/dist/session-toggles.js +2 -0
  406. package/dist/session-toggles.js.map +1 -1
  407. package/dist/signal.js +1 -0
  408. package/dist/skills-registry.js +2 -0
  409. package/dist/skills-registry.js.map +1 -1
  410. package/dist/source-attribution.js +1 -0
  411. package/dist/state-NCHQ4TRG.js +8 -0
  412. package/dist/state-NCHQ4TRG.js.map +1 -0
  413. package/dist/state-store-3EH7HYIN.js +16 -0
  414. package/dist/state-store-3EH7HYIN.js.map +1 -0
  415. package/dist/storage.d.ts +76 -2
  416. package/dist/storage.js +8 -5
  417. package/dist/store-contract.js +1 -0
  418. package/dist/summarizer.js +6 -5
  419. package/dist/summary-snapshot.js +1 -0
  420. package/dist/temporal-index.js +1 -0
  421. package/dist/temporal-supersession.d.ts +1 -1
  422. package/dist/temporal-supersession.js +2 -1
  423. package/dist/temporal-validity.d.ts +52 -0
  424. package/dist/temporal-validity.js +14 -0
  425. package/dist/temporal-validity.js.map +1 -0
  426. package/dist/threading.js +1 -0
  427. package/dist/tier-migration.d.ts +2 -2
  428. package/dist/tier-migration.js +1 -0
  429. package/dist/tier-routing.js +1 -0
  430. package/dist/tier-stats-62ZVDFKS.js +152 -0
  431. package/dist/tier-stats-62ZVDFKS.js.map +1 -0
  432. package/dist/tmt.js +1 -0
  433. package/dist/tokens.js +3 -1
  434. package/dist/topics.js +1 -0
  435. package/dist/trace-C5ETWBEF.js +290 -0
  436. package/dist/trace-C5ETWBEF.js.map +1 -0
  437. package/dist/transcript.js +1 -0
  438. package/dist/trust-zones.js +1 -0
  439. package/dist/tui-RI7P6PBS.js +13 -0
  440. package/dist/tui-RI7P6PBS.js.map +1 -0
  441. package/dist/types-V3FJ26TF.js +30 -0
  442. package/dist/types-V3FJ26TF.js.map +1 -0
  443. package/dist/types.d.ts +634 -9
  444. package/dist/types.js +10 -3
  445. package/dist/utility-learner.js +1 -0
  446. package/dist/utility-runtime.js +1 -0
  447. package/dist/utility-telemetry.js +1 -0
  448. package/dist/verified-recall.js +9 -6
  449. package/dist/version-utils.js +1 -0
  450. package/dist/whitespace.js +1 -0
  451. package/dist/work-product-ledger.js +1 -0
  452. package/package.json +2 -1
  453. package/dist/access-service-Br8ZydTK.d.ts +0 -827
  454. package/dist/chunk-3OGMS3PE.js.map +0 -1
  455. package/dist/chunk-6PFRXT4K.js.map +0 -1
  456. package/dist/chunk-ALXMCZEU.js.map +0 -1
  457. package/dist/chunk-B5WXLVDY.js.map +0 -1
  458. package/dist/chunk-BGJGXLZ7.js.map +0 -1
  459. package/dist/chunk-BK2EFTE2.js.map +0 -1
  460. package/dist/chunk-C2EFFULQ.js.map +0 -1
  461. package/dist/chunk-CUPFXL3J.js.map +0 -1
  462. package/dist/chunk-DFTTJYSO.js.map +0 -1
  463. package/dist/chunk-EPQJM2GC.js.map +0 -1
  464. package/dist/chunk-F5VP6YCB.js.map +0 -1
  465. package/dist/chunk-FVA6TGI3.js.map +0 -1
  466. package/dist/chunk-GKFXUTJ2.js.map +0 -1
  467. package/dist/chunk-HK3FGIEW.js.map +0 -1
  468. package/dist/chunk-INXV5JBT.js.map +0 -1
  469. package/dist/chunk-KVBLZUKV.js.map +0 -1
  470. package/dist/chunk-LK6SGL53.js.map +0 -1
  471. package/dist/chunk-LTCGGW2D.js +0 -14
  472. package/dist/chunk-LTCGGW2D.js.map +0 -1
  473. package/dist/chunk-NZLQTHS5.js.map +0 -1
  474. package/dist/chunk-O5ETUNBT.js.map +0 -1
  475. package/dist/chunk-PVPWZSSI.js.map +0 -1
  476. package/dist/chunk-RGLL5SPU.js.map +0 -1
  477. package/dist/chunk-S3EEFKNY.js.map +0 -1
  478. package/dist/chunk-SPI27QT6.js.map +0 -1
  479. package/dist/chunk-TP4FZJIZ.js.map +0 -1
  480. package/dist/chunk-ULYOGL6R.js.map +0 -1
  481. package/dist/chunk-VBVG2M5G.js.map +0 -1
  482. package/dist/chunk-VDX363PS.js.map +0 -1
  483. package/dist/chunk-VYM3VWOF.js.map +0 -1
  484. package/dist/chunk-WCLICCGB.js.map +0 -1
  485. package/dist/chunk-WVVA7F5A.js.map +0 -1
  486. package/dist/chunk-X6GF3FX2.js +0 -26
  487. package/dist/chunk-X6GF3FX2.js.map +0 -1
  488. package/dist/chunk-XZ2TIKGC.js.map +0 -1
  489. package/dist/chunk-ZAIM4TUE.js.map +0 -1
  490. /package/dist/{contradiction-review-WIUBAR52.js.map → capsule-cli.js.map} +0 -0
  491. /package/dist/{engine-F3GOXGE5.js.map → capsule-crypto-5CYAGVC5.js.map} +0 -0
  492. /package/dist/{chunk-KUB6JU6H.js.map → chunk-47WOM4YW.js.map} +0 -0
  493. /package/dist/{chunk-ZEM3OK2K.js.map → chunk-B2TL6GA2.js.map} +0 -0
  494. /package/dist/{chunk-3GXCSUXR.js.map → chunk-CRU27Q4J.js.map} +0 -0
  495. /package/dist/{chunk-RBBWYEFJ.js.map → chunk-G2WADRQ3.js.map} +0 -0
  496. /package/dist/{chunk-7I7FKFZH.js.map → chunk-R2L7SUX2.js.map} +0 -0
  497. /package/dist/{chunk-JL2PU6AI.js.map → chunk-R2XRID2N.js.map} +0 -0
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  cloneDefaultSessionObserverBands
3
3
  } from "./chunk-Z5LAYHGJ.js";
4
+ import {
5
+ normalizeEntitySchemas
6
+ } from "./chunk-4DJQYKMN.js";
4
7
  import {
5
8
  readEnvVar,
6
9
  resolveHomeDir
7
10
  } from "./chunk-MARWOCVP.js";
8
- import {
9
- normalizeEntitySchemas
10
- } from "./chunk-4DJQYKMN.js";
11
11
  import {
12
12
  log
13
13
  } from "./chunk-2ODBA7MQ.js";
@@ -54,6 +54,46 @@ var DEFAULT_WORKSPACE_DIR = path.join(
54
54
  ".openclaw",
55
55
  "workspace"
56
56
  );
57
+ function coerceBooleanLike(value) {
58
+ if (typeof value === "boolean") return value;
59
+ if (typeof value === "number") {
60
+ if (value === 1) return true;
61
+ if (value === 0) return false;
62
+ return void 0;
63
+ }
64
+ if (typeof value === "string") {
65
+ const normalized = value.trim().toLowerCase();
66
+ if (normalized === "true" || normalized === "1" || normalized === "yes" || normalized === "on") {
67
+ return true;
68
+ }
69
+ if (normalized === "false" || normalized === "0" || normalized === "no" || normalized === "off") {
70
+ return false;
71
+ }
72
+ }
73
+ return void 0;
74
+ }
75
+ function isSecretRefShape(value) {
76
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
77
+ const obj = value;
78
+ return typeof obj.source === "string" && obj.source.trim().length > 0;
79
+ }
80
+ function parseAgentAccessAuthToken(raw) {
81
+ if (raw === void 0 || raw === null) {
82
+ return readEnvVar("OPENCLAW_REMNIC_ACCESS_TOKEN") ?? readEnvVar("OPENCLAW_ENGRAM_ACCESS_TOKEN");
83
+ }
84
+ if (typeof raw === "string") {
85
+ if (raw.trim().length === 0) {
86
+ return readEnvVar("OPENCLAW_REMNIC_ACCESS_TOKEN") ?? readEnvVar("OPENCLAW_ENGRAM_ACCESS_TOKEN");
87
+ }
88
+ return resolveEnvVars(raw);
89
+ }
90
+ if (isSecretRefShape(raw)) {
91
+ return raw;
92
+ }
93
+ throw new Error(
94
+ "unsupported SecretRef shape for agentAccessHttp.authToken \u2014 expected a string or an object with a non-empty `source` field (see https://github.com/joshuaswarren/remnic/issues/757)"
95
+ );
96
+ }
57
97
  function resolveEnvVars(value) {
58
98
  const resolved = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_, envVar) => {
59
99
  const envValue = readEnvVar(envVar);
@@ -137,6 +177,7 @@ function parseSemanticChunkingConfig(raw) {
137
177
  if (typeof src.fallbackToRecursive === "boolean") out.fallbackToRecursive = src.fallbackToRecursive;
138
178
  return out;
139
179
  }
180
+ var DEFAULT_REASONING_MODEL = "gpt-5.2";
140
181
  var VALID_EFFORTS = ["none", "low", "medium", "high"];
141
182
  var VALID_TRIGGERS = ["smart", "every_n", "time_based"];
142
183
  var VALID_IDENTITY_INJECTION_MODES = ["recovery_only", "minimal", "full"];
@@ -303,9 +344,9 @@ function parseConfig(raw) {
303
344
  if (typeof cfg.openaiApiKey === "string" && cfg.openaiApiKey.length > 0) {
304
345
  apiKey = resolveEnvVars(cfg.openaiApiKey);
305
346
  } else {
306
- apiKey = process.env.OPENAI_API_KEY;
347
+ apiKey = readEnvVar("OPENAI_API_KEY");
307
348
  }
308
- const model = typeof cfg.model === "string" && cfg.model.length > 0 ? cfg.model : "gpt-5.2";
349
+ const model = typeof cfg.model === "string" && cfg.model.length > 0 ? cfg.model : DEFAULT_REASONING_MODEL;
309
350
  const captureMode = cfg.captureMode === "explicit" || cfg.captureMode === "hybrid" ? cfg.captureMode : "implicit";
310
351
  const rawEffort = cfg.reasoningEffort;
311
352
  const reasoningEffort = rawEffort && VALID_EFFORTS.includes(rawEffort) ? rawEffort : "low";
@@ -329,6 +370,58 @@ function parseConfig(raw) {
329
370
  narrativePromptStyle: rawDreaming.narrativePromptStyle === "diary" || rawDreaming.narrativePromptStyle === "analytical" ? rawDreaming.narrativePromptStyle : "reflective",
330
371
  watchFile: rawDreaming.watchFile !== false
331
372
  };
373
+ const rawDreamsBlock = cfg.dreams && typeof cfg.dreams === "object" && !Array.isArray(cfg.dreams) ? cfg.dreams : {};
374
+ const rawDreamsPhases = rawDreamsBlock.phases && typeof rawDreamsBlock.phases === "object" && !Array.isArray(rawDreamsBlock.phases) ? rawDreamsBlock.phases : {};
375
+ const rawDreamsLightSleep = rawDreamsPhases.lightSleep && typeof rawDreamsPhases.lightSleep === "object" && !Array.isArray(rawDreamsPhases.lightSleep) ? rawDreamsPhases.lightSleep : {};
376
+ const rawDreamsRem = rawDreamsPhases.rem && typeof rawDreamsPhases.rem === "object" && !Array.isArray(rawDreamsPhases.rem) ? rawDreamsPhases.rem : {};
377
+ const rawDreamsDeepSleep = rawDreamsPhases.deepSleep && typeof rawDreamsPhases.deepSleep === "object" && !Array.isArray(rawDreamsPhases.deepSleep) ? rawDreamsPhases.deepSleep : {};
378
+ const legacyLifecyclePolicyEnabled = coerceBooleanLike(cfg.lifecyclePolicyEnabled) ?? true;
379
+ const legacyLifecyclePromoteHeatThreshold = typeof cfg.lifecyclePromoteHeatThreshold === "number" ? Math.min(1, Math.max(0, cfg.lifecyclePromoteHeatThreshold)) : 0.55;
380
+ const legacyLifecycleStaleDecayThreshold = typeof cfg.lifecycleStaleDecayThreshold === "number" ? Math.min(1, Math.max(0, cfg.lifecycleStaleDecayThreshold)) : 0.65;
381
+ const legacyLifecycleArchiveDecayThreshold = typeof cfg.lifecycleArchiveDecayThreshold === "number" ? Math.min(1, Math.max(0, cfg.lifecycleArchiveDecayThreshold)) : 0.85;
382
+ const legacySemanticConsolidationEnabled = cfg.semanticConsolidationEnabled === true;
383
+ const legacySemanticConsolidationIntervalHours = typeof cfg.semanticConsolidationIntervalHours === "number" ? Math.max(1, Math.floor(cfg.semanticConsolidationIntervalHours)) : 168;
384
+ const legacySemanticConsolidationThreshold = typeof cfg.semanticConsolidationThreshold === "number" ? cfg.semanticConsolidationThreshold : 0.8;
385
+ const legacySemanticConsolidationMinClusterSize = typeof cfg.semanticConsolidationMinClusterSize === "number" ? Math.max(2, Math.floor(cfg.semanticConsolidationMinClusterSize)) : 3;
386
+ const legacySemanticConsolidationMaxPerRun = typeof cfg.semanticConsolidationMaxPerRun === "number" ? Math.max(0, Math.floor(cfg.semanticConsolidationMaxPerRun)) : 100;
387
+ const legacyConsolidationMinIntervalMs = typeof cfg.consolidationMinIntervalMs === "number" ? cfg.consolidationMinIntervalMs : 10 * 6e4;
388
+ const legacyVersioningEnabled = cfg.versioningEnabled === true;
389
+ const legacyVersioningMaxPerPage = typeof cfg.versioningMaxPerPage === "number" ? Math.max(0, Math.floor(cfg.versioningMaxPerPage)) : 50;
390
+ const legacyDeepSleepEnabled = cfg.nightlyGovernanceCronAutoRegister === true || cfg.qmdTierMigrationEnabled === true || legacyVersioningEnabled;
391
+ const dreamsLightSleepEnabledRaw = coerceBooleanLike(rawDreamsLightSleep.enabled);
392
+ const dreamsLightSleep = {
393
+ // new key wins; fall back to resolved legacy default
394
+ enabled: dreamsLightSleepEnabledRaw !== void 0 ? dreamsLightSleepEnabledRaw : legacyLifecyclePolicyEnabled,
395
+ cadenceMs: typeof rawDreamsLightSleep.cadenceMs === "number" ? Math.max(0, Math.floor(rawDreamsLightSleep.cadenceMs)) : 0,
396
+ // 0 = no override; orchestrator uses its own internal cadence
397
+ promoteHeatThreshold: typeof rawDreamsLightSleep.promoteHeatThreshold === "number" ? Math.min(1, Math.max(0, rawDreamsLightSleep.promoteHeatThreshold)) : legacyLifecyclePromoteHeatThreshold,
398
+ staleDecayThreshold: typeof rawDreamsLightSleep.staleDecayThreshold === "number" ? Math.min(1, Math.max(0, rawDreamsLightSleep.staleDecayThreshold)) : legacyLifecycleStaleDecayThreshold,
399
+ archiveDecayThreshold: typeof rawDreamsLightSleep.archiveDecayThreshold === "number" ? Math.min(1, Math.max(0, rawDreamsLightSleep.archiveDecayThreshold)) : legacyLifecycleArchiveDecayThreshold,
400
+ filterStaleEnabled: rawDreamsLightSleep.filterStaleEnabled !== void 0 ? coerceBooleanLike(rawDreamsLightSleep.filterStaleEnabled) === true : cfg.lifecycleFilterStaleEnabled === true
401
+ };
402
+ const dreamsRemEnabledRaw = coerceBooleanLike(rawDreamsRem.enabled);
403
+ const dreamsRem = {
404
+ enabled: dreamsRemEnabledRaw !== void 0 ? dreamsRemEnabledRaw : legacySemanticConsolidationEnabled,
405
+ cadenceMs: typeof rawDreamsRem.cadenceMs === "number" ? Math.max(0, Math.floor(rawDreamsRem.cadenceMs)) : legacySemanticConsolidationIntervalHours * 36e5,
406
+ similarityThreshold: typeof rawDreamsRem.similarityThreshold === "number" ? Math.min(1, Math.max(0, rawDreamsRem.similarityThreshold)) : legacySemanticConsolidationThreshold,
407
+ minClusterSize: typeof rawDreamsRem.minClusterSize === "number" ? Math.max(2, Math.floor(rawDreamsRem.minClusterSize)) : legacySemanticConsolidationMinClusterSize,
408
+ maxPerRun: typeof rawDreamsRem.maxPerRun === "number" ? Math.max(0, Math.floor(rawDreamsRem.maxPerRun)) : legacySemanticConsolidationMaxPerRun,
409
+ minIntervalMs: typeof rawDreamsRem.minIntervalMs === "number" ? Math.max(0, Math.floor(rawDreamsRem.minIntervalMs)) : legacyConsolidationMinIntervalMs
410
+ };
411
+ const dreamsDeepSleepEnabledRaw = coerceBooleanLike(rawDreamsDeepSleep.enabled);
412
+ const dreamsDeepSleep = {
413
+ enabled: dreamsDeepSleepEnabledRaw !== void 0 ? dreamsDeepSleepEnabledRaw : legacyDeepSleepEnabled,
414
+ enabledExplicitlySet: dreamsDeepSleepEnabledRaw !== void 0,
415
+ cadenceMs: typeof rawDreamsDeepSleep.cadenceMs === "number" ? Math.max(0, Math.floor(rawDreamsDeepSleep.cadenceMs)) : 24 * 36e5,
416
+ // default: 24 h (mirrors nightly governance cron)
417
+ versioningEnabled: rawDreamsDeepSleep.versioningEnabled !== void 0 ? coerceBooleanLike(rawDreamsDeepSleep.versioningEnabled) === true : legacyVersioningEnabled,
418
+ versioningMaxPerPage: typeof rawDreamsDeepSleep.versioningMaxPerPage === "number" ? Math.max(0, Math.floor(rawDreamsDeepSleep.versioningMaxPerPage)) : legacyVersioningMaxPerPage
419
+ };
420
+ const dreamsPhases = {
421
+ lightSleep: dreamsLightSleep,
422
+ rem: dreamsRem,
423
+ deepSleep: dreamsDeepSleep
424
+ };
332
425
  const rawHeartbeat = cfg.heartbeat && typeof cfg.heartbeat === "object" && !Array.isArray(cfg.heartbeat) ? cfg.heartbeat : {};
333
426
  const heartbeat = {
334
427
  enabled: rawHeartbeat.enabled === true,
@@ -390,9 +483,13 @@ function parseConfig(raw) {
390
483
  const rawCodingMode = cfg.codingMode && typeof cfg.codingMode === "object" && !Array.isArray(cfg.codingMode) ? cfg.codingMode : {};
391
484
  const codingProjectScopeRaw = coerceBool(rawCodingMode.projectScope);
392
485
  const codingBranchScopeRaw = coerceBool(rawCodingMode.branchScope);
486
+ const codingGlobalFallbackRaw = coerceBool(rawCodingMode.globalFallback);
393
487
  const codingMode = {
394
488
  projectScope: codingProjectScopeRaw === void 0 ? true : codingProjectScopeRaw,
395
- branchScope: codingBranchScopeRaw === true
489
+ branchScope: codingBranchScopeRaw === true,
490
+ // Default true — project-scoped sessions include the root namespace in
491
+ // read fallbacks so globally useful memories remain visible. CLAUDE.md #30.
492
+ globalFallback: codingGlobalFallbackRaw === void 0 ? true : codingGlobalFallbackRaw
396
493
  };
397
494
  const memoryDir = typeof cfg.memoryDir === "string" && cfg.memoryDir.length > 0 ? cfg.memoryDir : DEFAULT_MEMORY_DIR;
398
495
  const rawIdentityInjectionMode = cfg.identityInjectionMode;
@@ -480,15 +577,15 @@ function parseConfig(raw) {
480
577
  enabled: rawAgentAccessHttp?.enabled === true,
481
578
  host: typeof rawAgentAccessHttp?.host === "string" && rawAgentAccessHttp.host.trim().length > 0 ? rawAgentAccessHttp.host.trim() : "127.0.0.1",
482
579
  port: typeof rawAgentAccessHttp?.port === "number" ? Math.max(0, Math.floor(rawAgentAccessHttp.port)) : 4318,
483
- authToken: typeof rawAgentAccessHttp?.authToken === "string" && rawAgentAccessHttp.authToken.trim().length > 0 ? resolveEnvVars(rawAgentAccessHttp.authToken) : process.env.OPENCLAW_REMNIC_ACCESS_TOKEN ?? process.env.OPENCLAW_ENGRAM_ACCESS_TOKEN,
484
- principal: typeof rawAgentAccessHttp?.principal === "string" && rawAgentAccessHttp.principal.trim().length > 0 ? resolveEnvVars(rawAgentAccessHttp.principal) : process.env.OPENCLAW_ENGRAM_ACCESS_PRINCIPAL?.trim() || void 0,
580
+ authToken: parseAgentAccessAuthToken(rawAgentAccessHttp?.authToken),
581
+ principal: typeof rawAgentAccessHttp?.principal === "string" && rawAgentAccessHttp.principal.trim().length > 0 ? resolveEnvVars(rawAgentAccessHttp.principal) : readEnvVar("OPENCLAW_ENGRAM_ACCESS_PRINCIPAL")?.trim() || void 0,
485
582
  maxBodyBytes: typeof rawAgentAccessHttp?.maxBodyBytes === "number" ? Math.max(1, Math.floor(rawAgentAccessHttp.maxBodyBytes)) : 131072
486
583
  };
487
584
  let baseUrl;
488
585
  if (typeof cfg.openaiBaseUrl === "string" && cfg.openaiBaseUrl.length > 0) {
489
586
  baseUrl = normalizeOpenaiBaseUrl(resolveEnvVars(cfg.openaiBaseUrl), "config");
490
587
  } else {
491
- baseUrl = normalizeOpenaiBaseUrl(process.env.OPENAI_BASE_URL, "env");
588
+ baseUrl = normalizeOpenaiBaseUrl(readEnvVar("OPENAI_BASE_URL"), "env");
492
589
  }
493
590
  const sharedCrossSignalSemanticEnabled = cfg.sharedCrossSignalSemanticEnabled === true || cfg.crossSignalsSemanticEnabled === true;
494
591
  const sharedCrossSignalSemanticTimeoutMs = typeof cfg.sharedCrossSignalSemanticTimeoutMs === "number" ? Math.max(1, Math.floor(cfg.sharedCrossSignalSemanticTimeoutMs)) : typeof cfg.crossSignalsSemanticTimeoutMs === "number" ? Math.max(1, Math.floor(cfg.crossSignalsSemanticTimeoutMs)) : 4e3;
@@ -541,7 +638,10 @@ function parseConfig(raw) {
541
638
  qmdColdTierEnabled: cfg.qmdColdTierEnabled === true,
542
639
  qmdColdCollection: typeof cfg.qmdColdCollection === "string" && cfg.qmdColdCollection.length > 0 ? cfg.qmdColdCollection : "openclaw-engram-cold",
543
640
  qmdColdMaxResults: typeof cfg.qmdColdMaxResults === "number" ? cfg.qmdColdMaxResults : 8,
544
- qmdTierMigrationEnabled: cfg.qmdTierMigrationEnabled === true,
641
+ // Issue #678 PR 2/4: gate hot/cold tier migration (a deep-sleep activity)
642
+ // on dreams.phases.deepSleep.enabled. When deep sleep is disabled,
643
+ // tier migration is forced off regardless of legacy flag.
644
+ qmdTierMigrationEnabled: dreamsDeepSleep.enabled && cfg.qmdTierMigrationEnabled === true,
545
645
  qmdTierDemotionMinAgeDays: typeof cfg.qmdTierDemotionMinAgeDays === "number" ? Math.max(0, Math.floor(cfg.qmdTierDemotionMinAgeDays)) : 14,
546
646
  qmdTierDemotionValueThreshold: typeof cfg.qmdTierDemotionValueThreshold === "number" ? Math.max(0, Math.min(1, cfg.qmdTierDemotionValueThreshold)) : 0.35,
547
647
  qmdTierPromotionValueThreshold: typeof cfg.qmdTierPromotionValueThreshold === "number" ? Math.max(0, Math.min(1, cfg.qmdTierPromotionValueThreshold)) : 0.7,
@@ -619,6 +719,22 @@ function parseConfig(raw) {
619
719
  // QMD path. Operators can opt out with
620
720
  // recallDirectAnswerEnabled=false.
621
721
  recallDirectAnswerEnabled: coerceBool(cfg.recallDirectAnswerEnabled) ?? true,
722
+ // Disclosure auto-escalation (issue #677 PR 4/4). Default `manual`
723
+ // so pre-#677 callers see unchanged behavior. Reject anything
724
+ // outside the allow-list rather than silently defaulting (CLAUDE.md
725
+ // rule 51).
726
+ recallDisclosureEscalation: (() => {
727
+ const raw2 = cfg.recallDisclosureEscalation;
728
+ if (raw2 === void 0 || raw2 === null) return "manual";
729
+ if (raw2 === "manual" || raw2 === "auto") return raw2;
730
+ throw new Error(
731
+ `recallDisclosureEscalation must be "manual" or "auto" (got ${JSON.stringify(raw2)}).`
732
+ );
733
+ })(),
734
+ recallDisclosureEscalationThreshold: (() => {
735
+ const n = coerceNumber(cfg.recallDisclosureEscalationThreshold);
736
+ return n !== void 0 && n >= 0 && n <= 1 ? n : 0.5;
737
+ })(),
622
738
  // Graph-based retrieval tier (issue #559 PR 4). Default `false` —
623
739
  // the tier ships off pending the `retrieval-graph` bench in PR 5.
624
740
  recallGraphEnabled: coerceBool(cfg.recallGraphEnabled) ?? false,
@@ -819,7 +935,14 @@ function parseConfig(raw) {
819
935
  activeRecallAttachRecallExplain: cfg.activeRecallAttachRecallExplain === true,
820
936
  activeRecallAllowChainedActiveMemory: cfg.activeRecallAllowChainedActiveMemory === true,
821
937
  dreaming,
938
+ dreamsPhases,
822
939
  procedural,
940
+ // At-rest encryption (issue #690 PR 3/4)
941
+ // coerceBool handles CLI string inputs: `--config secureStoreEnabled=true`
942
+ // arrives as the string "true" which `=== true` would reject (CLAUDE.md #36).
943
+ secureStoreEnabled: coerceBool(cfg.secureStoreEnabled) === true,
944
+ secureStoreEncryptOnWrite: coerceBool(cfg.secureStoreEncryptOnWrite) !== false,
945
+ // default: true
823
946
  codingMode,
824
947
  heartbeat,
825
948
  slotBehavior,
@@ -830,7 +953,12 @@ function parseConfig(raw) {
830
953
  daySummaryEnabled: cfg.daySummaryEnabled !== false,
831
954
  // default: true
832
955
  hourlySummaryCronAutoRegister: cfg.hourlySummaryCronAutoRegister === true,
833
- nightlyGovernanceCronAutoRegister: cfg.nightlyGovernanceCronAutoRegister === true,
956
+ // Codex P1 on PR 763 round 2: gate the nightly-governance cron
957
+ // (deep-sleep's primary scheduled execution path) on
958
+ // dreams.phases.deepSleep.enabled. When the phase is disabled the
959
+ // cron must NOT auto-register, otherwise `deepSleep.enabled=false`
960
+ // is a contract lie — deep-sleep keeps running.
961
+ nightlyGovernanceCronAutoRegister: dreamsDeepSleep.enabled && cfg.nightlyGovernanceCronAutoRegister === true,
834
962
  summaryRecallHours: typeof cfg.summaryRecallHours === "number" ? cfg.summaryRecallHours : 24,
835
963
  maxSummaryCount: typeof cfg.maxSummaryCount === "number" ? cfg.maxSummaryCount : 6,
836
964
  summaryModel: typeof cfg.summaryModel === "string" && cfg.summaryModel.length > 0 ? cfg.summaryModel : model,
@@ -884,15 +1012,25 @@ function parseConfig(raw) {
884
1012
  verifiedRecallEnabled: cfg.verifiedRecallEnabled === true,
885
1013
  semanticRulePromotionEnabled: cfg.semanticRulePromotionEnabled === true,
886
1014
  semanticRuleVerificationEnabled: cfg.semanticRuleVerificationEnabled === true,
887
- semanticConsolidationEnabled: cfg.semanticConsolidationEnabled === true,
1015
+ // Issue #678 PR 2/4: when `dreams.phases.rem.*` is set, the resolved
1016
+ // dreamsPhases value WINS over the legacy top-level key. The runtime
1017
+ // gates (orchestrator's `runSemanticConsolidation`) read these legacy
1018
+ // fields, so we must propagate the precedence here, not just in the
1019
+ // `dreamsPhases` object.
1020
+ semanticConsolidationEnabled: dreamsRem.enabled && dreamsRem.cadenceMs > 0,
888
1021
  semanticConsolidationModel: typeof cfg.semanticConsolidationModel === "string" && cfg.semanticConsolidationModel.length > 0 ? cfg.semanticConsolidationModel : "auto",
889
- semanticConsolidationThreshold: typeof cfg.semanticConsolidationThreshold === "number" ? cfg.semanticConsolidationThreshold : 0.8,
890
- semanticConsolidationMinClusterSize: typeof cfg.semanticConsolidationMinClusterSize === "number" ? Math.max(2, Math.floor(cfg.semanticConsolidationMinClusterSize)) : 3,
1022
+ semanticConsolidationThreshold: dreamsRem.similarityThreshold,
1023
+ semanticConsolidationMinClusterSize: dreamsRem.minClusterSize,
891
1024
  semanticConsolidationExcludeCategories: Array.isArray(cfg.semanticConsolidationExcludeCategories) ? cfg.semanticConsolidationExcludeCategories.filter(
892
1025
  (c) => typeof c === "string" && c.length > 0
893
1026
  ) : ["correction", "commitment", "procedure"],
894
- semanticConsolidationIntervalHours: typeof cfg.semanticConsolidationIntervalHours === "number" ? Math.max(1, Math.floor(cfg.semanticConsolidationIntervalHours)) : 168,
895
- semanticConsolidationMaxPerRun: typeof cfg.semanticConsolidationMaxPerRun === "number" ? Math.max(0, Math.floor(cfg.semanticConsolidationMaxPerRun)) : 100,
1027
+ // semanticConsolidationIntervalHours is derived from dreamsRem.cadenceMs
1028
+ // when an override is set (rounded up to the nearest hour). Preserve
1029
+ // explicit zero so legacy schedulers see the same disable-by-zero signal
1030
+ // as the dreams.phases.rem config; the runtime enabled flag is also
1031
+ // disabled above so zero does not mean "run every maintenance cycle".
1032
+ semanticConsolidationIntervalHours: rawDreamsRem.cadenceMs !== void 0 ? Math.max(0, Math.ceil(dreamsRem.cadenceMs / 36e5)) : legacySemanticConsolidationIntervalHours,
1033
+ semanticConsolidationMaxPerRun: dreamsRem.maxPerRun,
896
1034
  // Operator-aware consolidation prompt (issue #561 PR 3). Defaults
897
1035
  // to `false` to match sibling `*Enabled` flags' least-privileged
898
1036
  // convention. Operators opt in by setting `true` (or truthy
@@ -904,6 +1042,90 @@ function parseConfig(raw) {
904
1042
  // heuristic (chooseConsolidationOperator) so PR 2's provenance
905
1043
  // wiring keeps working without operator-aware prompts.
906
1044
  operatorAwareConsolidationEnabled: coerceBool(cfg.operatorAwareConsolidationEnabled) ?? false,
1045
+ // Pattern reinforcement (issue #687 PR 2/4). Defaults: off, weekly
1046
+ // cadence, min cluster size 3, target categories preference / fact
1047
+ // / decision. All bounds clamped at parse time so invalid inputs
1048
+ // (negative numbers, non-arrays, non-strings) fail safe to defaults
1049
+ // rather than crash the job.
1050
+ patternReinforcementEnabled: coerceBool(cfg.patternReinforcementEnabled) ?? false,
1051
+ patternReinforcementCadenceMs: (() => {
1052
+ const raw2 = coerceNumber(cfg.patternReinforcementCadenceMs);
1053
+ if (raw2 === void 0 || !Number.isFinite(raw2)) {
1054
+ return 7 * 24 * 60 * 60 * 1e3;
1055
+ }
1056
+ return Math.max(0, Math.floor(raw2));
1057
+ })(),
1058
+ patternReinforcementMinCount: (() => {
1059
+ const raw2 = coerceNumber(cfg.patternReinforcementMinCount);
1060
+ if (raw2 === void 0 || !Number.isFinite(raw2)) return 3;
1061
+ return Math.min(1e3, Math.max(2, Math.floor(raw2)));
1062
+ })(),
1063
+ patternReinforcementCategories: Array.isArray(cfg.patternReinforcementCategories) ? cfg.patternReinforcementCategories.filter((v) => typeof v === "string").map((v) => v.trim()).filter((v) => v.length > 0) : ["preference", "fact", "decision"],
1064
+ // issue #687 PR 3/4: reinforcement recall boost config.
1065
+ reinforcementRecallBoostEnabled: coerceBool(cfg.reinforcementRecallBoostEnabled) ?? false,
1066
+ reinforcementRecallBoostWeight: (() => {
1067
+ if (cfg.reinforcementRecallBoostWeight === void 0) return 0.05;
1068
+ const n = coerceNumber(cfg.reinforcementRecallBoostWeight);
1069
+ if (n === void 0 || !Number.isFinite(n) || n < 0 || n > 1) {
1070
+ throw new Error(
1071
+ `reinforcementRecallBoostWeight must be a number in [0, 1] (got ${JSON.stringify(cfg.reinforcementRecallBoostWeight)}).`
1072
+ );
1073
+ }
1074
+ return n;
1075
+ })(),
1076
+ reinforcementRecallBoostMax: (() => {
1077
+ if (cfg.reinforcementRecallBoostMax === void 0) return 0.3;
1078
+ const n = coerceNumber(cfg.reinforcementRecallBoostMax);
1079
+ if (n === void 0 || !Number.isFinite(n) || n < 0 || n > 1) {
1080
+ throw new Error(
1081
+ `reinforcementRecallBoostMax must be a number in [0, 1] (got ${JSON.stringify(cfg.reinforcementRecallBoostMax)}).`
1082
+ );
1083
+ }
1084
+ return n;
1085
+ })(),
1086
+ // Async peer profile reasoner (issue #679 PR 2/5). Defaults to
1087
+ // `false` (opt-in) per Gotchas #30/#48 — least-privileged default.
1088
+ // `coerceBool` handles "true"/"1"/"yes"/"on" CLI strings (Gotcha
1089
+ // #36). Numeric thresholds clamp at zero (Gotcha #28 + #45 — 0
1090
+ // is a documented disable value for both, so the schema minimum
1091
+ // matches and we do NOT silently bump to 1).
1092
+ peerProfileReasonerEnabled: coerceBool(cfg.peerProfileReasonerEnabled) ?? false,
1093
+ // Cursor M on PR #736: use the routing alias `"auto"` rather than
1094
+ // a hardcoded model identifier. Matches the convention established
1095
+ // by sibling `semanticConsolidationModel`. Operators can still
1096
+ // override via config; the value is logged for telemetry only.
1097
+ peerProfileReasonerModel: typeof cfg.peerProfileReasonerModel === "string" && cfg.peerProfileReasonerModel.trim().length > 0 ? cfg.peerProfileReasonerModel.trim() : "auto",
1098
+ // Cursor L on PR #736: numeric config keys must coerce string CLI
1099
+ // values (Gotcha #28 — `--config peerProfileReasonerMaxFieldsPerRun=2`
1100
+ // arrives as the string "2"). Pre-fix `typeof === "number"`
1101
+ // rejected string inputs and silently fell back to defaults. The
1102
+ // shared `coerceNonNegativeInt` helper accepts both forms, throws
1103
+ // on invalid input (Gotcha #51 — reject rather than silently
1104
+ // default), and falls back to the documented default when the
1105
+ // key is absent. 0 is a valid documented disable value here, so
1106
+ // the helper does NOT bump to 1.
1107
+ peerProfileReasonerMinInteractions: coerceNonNegativeInt(
1108
+ cfg.peerProfileReasonerMinInteractions,
1109
+ 5,
1110
+ "peerProfileReasonerMinInteractions"
1111
+ ),
1112
+ peerProfileReasonerMaxFieldsPerRun: coerceNonNegativeInt(
1113
+ cfg.peerProfileReasonerMaxFieldsPerRun,
1114
+ 8,
1115
+ "peerProfileReasonerMaxFieldsPerRun"
1116
+ ),
1117
+ // Peer profile recall injection (issue #679 PR 3/5). Default-off
1118
+ // per Gotcha #30/#48 (least-privileged default, new feature gate).
1119
+ // `coerceBool` handles CLI string forms "true"/"1"/"yes"/"on"
1120
+ // (Gotcha #36). `coerceNonNegativeInt` handles string CLI values
1121
+ // (Gotcha #28) and documents 0 as the disable value (Gotcha #45 —
1122
+ // schema minimum must also be 0 so they stay consistent).
1123
+ peerProfileRecallEnabled: coerceBool(cfg.peerProfileRecallEnabled) ?? false,
1124
+ peerProfileRecallMaxFields: coerceNonNegativeInt(
1125
+ cfg.peerProfileRecallMaxFields,
1126
+ 5,
1127
+ "peerProfileRecallMaxFields"
1128
+ ),
907
1129
  creationMemoryEnabled: cfg.creationMemoryEnabled === true,
908
1130
  memoryUtilityLearningEnabled: cfg.memoryUtilityLearningEnabled === true,
909
1131
  promotionByOutcomeEnabled: cfg.promotionByOutcomeEnabled === true,
@@ -972,6 +1194,10 @@ function parseConfig(raw) {
972
1194
  }
973
1195
  return "low";
974
1196
  })(),
1197
+ // Extraction scope classification. When enabled, the extraction prompt
1198
+ // asks the LLM to classify each fact as "project" or "global". Global
1199
+ // facts are promoted to the shared namespace. Default true (rule 30 gate).
1200
+ extractionScopeClassificationEnabled: coerceBool(cfg.extractionScopeClassificationEnabled) !== false,
975
1201
  // Extraction judge (issue #376). Opt-in LLM-as-judge fact-worthiness gate.
976
1202
  extractionJudgeEnabled: cfg.extractionJudgeEnabled === true,
977
1203
  extractionJudgeModel: typeof cfg.extractionJudgeModel === "string" ? cfg.extractionJudgeModel : "",
@@ -997,7 +1223,8 @@ function parseConfig(raw) {
997
1223
  inlineSourceAttributionEnabled: cfg.inlineSourceAttributionEnabled === true,
998
1224
  inlineSourceAttributionFormat: typeof cfg.inlineSourceAttributionFormat === "string" && cfg.inlineSourceAttributionFormat.trim().length > 0 ? cfg.inlineSourceAttributionFormat : "[Source: agent={agent}, session={sessionId}, ts={ts}]",
999
1225
  consolidationRequireNonZeroExtraction: cfg.consolidationRequireNonZeroExtraction !== false,
1000
- consolidationMinIntervalMs: typeof cfg.consolidationMinIntervalMs === "number" ? cfg.consolidationMinIntervalMs : 10 * 6e4,
1226
+ // Issue #678 PR 2/4: dreams.phases.rem.minIntervalMs WINS when set.
1227
+ consolidationMinIntervalMs: dreamsRem.minIntervalMs,
1001
1228
  // QMD maintenance (debounced singleflight)
1002
1229
  qmdMaintenanceEnabled: cfg.qmdMaintenanceEnabled !== false,
1003
1230
  qmdMaintenanceDebounceMs: typeof cfg.qmdMaintenanceDebounceMs === "number" ? cfg.qmdMaintenanceDebounceMs : 3e4,
@@ -1185,16 +1412,36 @@ function parseConfig(raw) {
1185
1412
  factArchivalMaxImportance: typeof cfg.factArchivalMaxImportance === "number" ? cfg.factArchivalMaxImportance : 0.3,
1186
1413
  factArchivalMaxAccessCount: typeof cfg.factArchivalMaxAccessCount === "number" ? cfg.factArchivalMaxAccessCount : 2,
1187
1414
  factArchivalProtectedCategories: Array.isArray(cfg.factArchivalProtectedCategories) ? cfg.factArchivalProtectedCategories.filter((c) => typeof c === "string") : ["commitment", "preference", "decision", "principle", "procedure"],
1188
- // v8.3 lifecycle policy engine (default off)
1189
- lifecyclePolicyEnabled: cfg.lifecyclePolicyEnabled === true,
1190
- lifecycleFilterStaleEnabled: cfg.lifecycleFilterStaleEnabled === true,
1191
- lifecyclePromoteHeatThreshold: typeof cfg.lifecyclePromoteHeatThreshold === "number" ? Math.min(1, Math.max(0, cfg.lifecyclePromoteHeatThreshold)) : 0.55,
1192
- lifecycleStaleDecayThreshold: typeof cfg.lifecycleStaleDecayThreshold === "number" ? Math.min(1, Math.max(0, cfg.lifecycleStaleDecayThreshold)) : 0.65,
1193
- lifecycleArchiveDecayThreshold: typeof cfg.lifecycleArchiveDecayThreshold === "number" ? Math.min(1, Math.max(0, cfg.lifecycleArchiveDecayThreshold)) : 0.85,
1415
+ // Lifecycle policy engine (issue #686 PR 3/6 — flipped default to
1416
+ // `true`). Tier infrastructure (`tier-routing.ts`,
1417
+ // `tier-migration.ts`, separate cold QMD collection) has shipped
1418
+ // for several releases. Default-on lets the year-2 retention
1419
+ // story land for every install instead of staying gated behind
1420
+ // an opt-in flag the typical operator never reaches. Operators
1421
+ // who need pre-#686 behavior (no automatic hot↔cold migration,
1422
+ // no recall-time stale filtering) can set
1423
+ // `lifecyclePolicyEnabled: false` explicitly. Coerce string/number
1424
+ // boolean-likes (e.g. CLI `--config lifecyclePolicyEnabled=false`)
1425
+ // before applying the default — otherwise an explicit false-ish
1426
+ // input falls through and silently re-enables the policy.
1427
+ // Issue #678 PR 2/4: dreams.phases.lightSleep.* WINS over legacy keys.
1428
+ // The runtime gate (orchestrator's `runLifecyclePolicyPass`) reads
1429
+ // these legacy fields, so propagate the precedence here.
1430
+ lifecyclePolicyEnabled: dreamsLightSleep.enabled,
1431
+ lifecycleFilterStaleEnabled: dreamsLightSleep.filterStaleEnabled,
1432
+ lifecyclePromoteHeatThreshold: dreamsLightSleep.promoteHeatThreshold,
1433
+ lifecycleStaleDecayThreshold: dreamsLightSleep.staleDecayThreshold,
1434
+ lifecycleArchiveDecayThreshold: dreamsLightSleep.archiveDecayThreshold,
1194
1435
  lifecycleProtectedCategories: Array.isArray(cfg.lifecycleProtectedCategories) ? cfg.lifecycleProtectedCategories.filter(
1195
1436
  (c) => typeof c === "string" && VALID_MEMORY_CATEGORIES.has(c)
1196
1437
  ) : ["decision", "principle", "commitment", "preference", "procedure"],
1197
- lifecycleMetricsEnabled: typeof cfg.lifecycleMetricsEnabled === "boolean" ? cfg.lifecycleMetricsEnabled : cfg.lifecyclePolicyEnabled === true,
1438
+ // Mirror the *resolved* lifecyclePolicyEnabled default (not the
1439
+ // raw input) — otherwise omitting both flags returns `false` for
1440
+ // metrics even though the policy is enabled by default since
1441
+ // #686 PR 3/6.
1442
+ // Issue #678 PR 2/4: mirror the resolved dreams light-sleep enabled flag
1443
+ // (which already incorporates dreams.phases precedence + legacy fallback).
1444
+ lifecycleMetricsEnabled: coerceBooleanLike(cfg.lifecycleMetricsEnabled) ?? dreamsLightSleep.enabled,
1198
1445
  // v8.3 proactive + policy learning (default off)
1199
1446
  proactiveExtractionEnabled: cfg.proactiveExtractionEnabled === true,
1200
1447
  contextCompressionActionsEnabled: cfg.contextCompressionActionsEnabled === true,
@@ -1314,6 +1561,20 @@ function parseConfig(raw) {
1314
1561
  graphLateralInhibitionEnabled: cfg.graphLateralInhibitionEnabled !== false,
1315
1562
  graphLateralInhibitionBeta: typeof cfg.graphLateralInhibitionBeta === "number" ? Math.max(0, Math.min(1, cfg.graphLateralInhibitionBeta)) : 0.15,
1316
1563
  graphLateralInhibitionTopM: typeof cfg.graphLateralInhibitionTopM === "number" ? Math.max(0, Math.round(cfg.graphLateralInhibitionTopM)) : 7,
1564
+ // Issue #681 PR 2/3 — graph-edge confidence decay maintenance.
1565
+ // Boolean coerced via shared helper (gotcha #36: string "false" is truthy).
1566
+ graphEdgeDecayEnabled: coerceBooleanLike(cfg.graphEdgeDecayEnabled) ?? false,
1567
+ graphEdgeDecayCadenceMs: typeof cfg.graphEdgeDecayCadenceMs === "number" && Number.isFinite(cfg.graphEdgeDecayCadenceMs) ? Math.max(6e4, Math.floor(cfg.graphEdgeDecayCadenceMs)) : 7 * 24 * 60 * 60 * 1e3,
1568
+ graphEdgeDecayWindowMs: typeof cfg.graphEdgeDecayWindowMs === "number" && Number.isFinite(cfg.graphEdgeDecayWindowMs) ? Math.max(6e4, Math.floor(cfg.graphEdgeDecayWindowMs)) : 90 * 24 * 60 * 60 * 1e3,
1569
+ graphEdgeDecayPerWindow: typeof cfg.graphEdgeDecayPerWindow === "number" && Number.isFinite(cfg.graphEdgeDecayPerWindow) ? Math.max(0, Math.min(1, cfg.graphEdgeDecayPerWindow)) : 0.1,
1570
+ graphEdgeDecayFloor: typeof cfg.graphEdgeDecayFloor === "number" && Number.isFinite(cfg.graphEdgeDecayFloor) ? Math.max(0, Math.min(1, cfg.graphEdgeDecayFloor)) : 0.1,
1571
+ graphEdgeDecayVisibilityThreshold: typeof cfg.graphEdgeDecayVisibilityThreshold === "number" && Number.isFinite(cfg.graphEdgeDecayVisibilityThreshold) ? Math.max(0, Math.min(1, cfg.graphEdgeDecayVisibilityThreshold)) : 0.2,
1572
+ // Issue #681 PR 3/3 — confidence-aware traversal & PageRank refinement.
1573
+ // Floor clamps to [0, 1] so misconfigured input cannot accept negative
1574
+ // confidences or reject every edge. Iterations floors at 0 so a
1575
+ // documented 0 disables PageRank refinement and BFS scores pass through.
1576
+ graphTraversalConfidenceFloor: typeof cfg.graphTraversalConfidenceFloor === "number" && Number.isFinite(cfg.graphTraversalConfidenceFloor) ? Math.min(1, Math.max(0, cfg.graphTraversalConfidenceFloor)) : 0.2,
1577
+ graphTraversalPageRankIterations: typeof cfg.graphTraversalPageRankIterations === "number" && Number.isFinite(cfg.graphTraversalPageRankIterations) && cfg.graphTraversalPageRankIterations >= 0 ? Math.floor(cfg.graphTraversalPageRankIterations) : 8,
1317
1578
  // v8.2: Temporal Memory Tree
1318
1579
  temporalMemoryTreeEnabled: cfg.temporalMemoryTreeEnabled === true,
1319
1580
  tmtHourlyMinMemories: typeof cfg.tmtHourlyMinMemories === "number" ? cfg.tmtHourlyMinMemories : 3,
@@ -1346,6 +1607,212 @@ function parseConfig(raw) {
1346
1607
  const codexHome = typeof raw2.codexHome === "string" && raw2.codexHome.trim().length > 0 ? raw2.codexHome.trim() : null;
1347
1608
  return { installExtension, codexHome };
1348
1609
  })(),
1610
+ // Live connectors (issue #683 PR 2/N).
1611
+ //
1612
+ // Per CLAUDE.md gotcha #30 and #48, every concrete connector ships
1613
+ // disabled-by-default and the parser MUST reject malformed top-level
1614
+ // shapes loudly (gotcha #51) rather than silently producing an empty
1615
+ // object.
1616
+ //
1617
+ // We do NOT validate credential strings here — the connector module
1618
+ // re-validates on every sync pass via `validateGoogleDriveConfig`.
1619
+ // That keeps secret-store-driven values (which may legitimately be
1620
+ // empty until the operator runs setup) round-trippable through the
1621
+ // config layer without crashing the orchestrator at boot.
1622
+ connectors: (() => {
1623
+ if (cfg.connectors !== void 0 && (cfg.connectors === null || typeof cfg.connectors !== "object" || Array.isArray(cfg.connectors))) {
1624
+ throw new Error(
1625
+ `connectors must be an object (got ${JSON.stringify(cfg.connectors)}). Use connectors: {} to opt out of every live connector.`
1626
+ );
1627
+ }
1628
+ const rawConnectors = cfg.connectors && typeof cfg.connectors === "object" && !Array.isArray(cfg.connectors) ? cfg.connectors : {};
1629
+ if (rawConnectors.googleDrive !== void 0 && (rawConnectors.googleDrive === null || typeof rawConnectors.googleDrive !== "object" || Array.isArray(rawConnectors.googleDrive))) {
1630
+ throw new Error(
1631
+ `connectors.googleDrive must be an object (got ${JSON.stringify(rawConnectors.googleDrive)}).`
1632
+ );
1633
+ }
1634
+ const rawDrive = rawConnectors.googleDrive && typeof rawConnectors.googleDrive === "object" && !Array.isArray(rawConnectors.googleDrive) ? rawConnectors.googleDrive : {};
1635
+ const driveEnabled = coerceBool(rawDrive.enabled) === true;
1636
+ const driveClientId = typeof rawDrive.clientId === "string" ? rawDrive.clientId : "";
1637
+ const driveClientSecret = typeof rawDrive.clientSecret === "string" ? rawDrive.clientSecret : "";
1638
+ const driveRefreshToken = typeof rawDrive.refreshToken === "string" ? rawDrive.refreshToken : "";
1639
+ const drivePollCoerced = coerceNumber(rawDrive.pollIntervalMs);
1640
+ let drivePollIntervalMs = 3e5;
1641
+ if (drivePollCoerced !== void 0) {
1642
+ if (!Number.isFinite(drivePollCoerced) || !Number.isInteger(drivePollCoerced) || drivePollCoerced < 1e3 || drivePollCoerced > 864e5) {
1643
+ throw new Error(
1644
+ `connectors.googleDrive.pollIntervalMs must be an integer in [1000, 86400000] ms (got ${JSON.stringify(rawDrive.pollIntervalMs)})`
1645
+ );
1646
+ }
1647
+ drivePollIntervalMs = drivePollCoerced;
1648
+ }
1649
+ let driveFolderIds = [];
1650
+ if (rawDrive.folderIds !== void 0) {
1651
+ if (!Array.isArray(rawDrive.folderIds)) {
1652
+ throw new Error(
1653
+ `connectors.googleDrive.folderIds must be an array of strings (got ${typeof rawDrive.folderIds})`
1654
+ );
1655
+ }
1656
+ const seen = /* @__PURE__ */ new Set();
1657
+ for (const value of rawDrive.folderIds) {
1658
+ if (typeof value !== "string") {
1659
+ throw new Error(
1660
+ `connectors.googleDrive.folderIds entries must be strings; found ${typeof value}`
1661
+ );
1662
+ }
1663
+ const trimmed = value.trim();
1664
+ if (trimmed.length === 0) continue;
1665
+ if (seen.has(trimmed)) continue;
1666
+ seen.add(trimmed);
1667
+ driveFolderIds.push(trimmed);
1668
+ }
1669
+ }
1670
+ if (rawConnectors.notion !== void 0 && (rawConnectors.notion === null || typeof rawConnectors.notion !== "object" || Array.isArray(rawConnectors.notion))) {
1671
+ throw new Error(
1672
+ `connectors.notion must be an object (got ${JSON.stringify(rawConnectors.notion)}).`
1673
+ );
1674
+ }
1675
+ const rawNotion = rawConnectors.notion && typeof rawConnectors.notion === "object" && !Array.isArray(rawConnectors.notion) ? rawConnectors.notion : {};
1676
+ const notionEnabled = coerceBool(rawNotion.enabled) === true;
1677
+ const notionToken = typeof rawNotion.token === "string" ? rawNotion.token : "";
1678
+ const notionPollCoerced = coerceNumber(rawNotion.pollIntervalMs);
1679
+ let notionPollIntervalMs = 3e5;
1680
+ if (notionPollCoerced !== void 0) {
1681
+ if (!Number.isFinite(notionPollCoerced) || !Number.isInteger(notionPollCoerced) || notionPollCoerced < 1e3 || notionPollCoerced > 864e5) {
1682
+ throw new Error(
1683
+ `connectors.notion.pollIntervalMs must be an integer in [1000, 86400000] ms (got ${JSON.stringify(rawNotion.pollIntervalMs)})`
1684
+ );
1685
+ }
1686
+ notionPollIntervalMs = notionPollCoerced;
1687
+ }
1688
+ let notionDatabaseIds = [];
1689
+ if (rawNotion.databaseIds !== void 0) {
1690
+ if (!Array.isArray(rawNotion.databaseIds)) {
1691
+ throw new Error(
1692
+ `connectors.notion.databaseIds must be an array of strings (got ${typeof rawNotion.databaseIds})`
1693
+ );
1694
+ }
1695
+ const seen = /* @__PURE__ */ new Set();
1696
+ for (const value of rawNotion.databaseIds) {
1697
+ if (typeof value !== "string") {
1698
+ throw new Error(
1699
+ `connectors.notion.databaseIds entries must be strings; found ${typeof value}`
1700
+ );
1701
+ }
1702
+ const trimmed = value.trim();
1703
+ if (trimmed.length === 0) continue;
1704
+ if (seen.has(trimmed)) continue;
1705
+ seen.add(trimmed);
1706
+ notionDatabaseIds.push(trimmed);
1707
+ }
1708
+ }
1709
+ if (rawConnectors.gmail !== void 0 && (rawConnectors.gmail === null || typeof rawConnectors.gmail !== "object" || Array.isArray(rawConnectors.gmail))) {
1710
+ throw new Error(
1711
+ `connectors.gmail must be an object (got ${JSON.stringify(rawConnectors.gmail)}).`
1712
+ );
1713
+ }
1714
+ const rawGmail = rawConnectors.gmail && typeof rawConnectors.gmail === "object" && !Array.isArray(rawConnectors.gmail) ? rawConnectors.gmail : {};
1715
+ const gmailEnabled = coerceBool(rawGmail.enabled) === true;
1716
+ const gmailClientId = typeof rawGmail.clientId === "string" ? rawGmail.clientId : "";
1717
+ const gmailClientSecret = typeof rawGmail.clientSecret === "string" ? rawGmail.clientSecret : "";
1718
+ const gmailRefreshToken = typeof rawGmail.refreshToken === "string" ? rawGmail.refreshToken : "";
1719
+ const gmailUserId = typeof rawGmail.userId === "string" && rawGmail.userId.trim().length > 0 ? rawGmail.userId.trim() : "me";
1720
+ const gmailQuery = typeof rawGmail.query === "string" ? rawGmail.query : "in:inbox";
1721
+ const gmailPollCoerced = coerceNumber(rawGmail.pollIntervalMs);
1722
+ let gmailPollIntervalMs = 3e5;
1723
+ if (rawGmail.pollIntervalMs !== void 0) {
1724
+ if (gmailPollCoerced === void 0) {
1725
+ throw new Error(
1726
+ `connectors.gmail.pollIntervalMs must be a finite number; got ${JSON.stringify(rawGmail.pollIntervalMs)}`
1727
+ );
1728
+ }
1729
+ if (gmailPollCoerced <= 0) {
1730
+ throw new Error(
1731
+ `connectors.gmail.pollIntervalMs must be positive; got ${JSON.stringify(rawGmail.pollIntervalMs)}`
1732
+ );
1733
+ }
1734
+ if (!Number.isInteger(gmailPollCoerced) || gmailPollCoerced < 1e3 || gmailPollCoerced > 864e5) {
1735
+ throw new Error(
1736
+ `connectors.gmail.pollIntervalMs must be an integer in [1000, 86400000] ms (got ${JSON.stringify(rawGmail.pollIntervalMs)})`
1737
+ );
1738
+ }
1739
+ gmailPollIntervalMs = gmailPollCoerced;
1740
+ }
1741
+ if (rawConnectors.github !== void 0 && (rawConnectors.github === null || typeof rawConnectors.github !== "object" || Array.isArray(rawConnectors.github))) {
1742
+ throw new Error(
1743
+ `connectors.github must be an object (got ${JSON.stringify(rawConnectors.github)}).`
1744
+ );
1745
+ }
1746
+ const rawGitHub = rawConnectors.github && typeof rawConnectors.github === "object" && !Array.isArray(rawConnectors.github) ? rawConnectors.github : {};
1747
+ const githubEnabled = coerceBool(rawGitHub.enabled) === true;
1748
+ const githubToken = typeof rawGitHub.token === "string" ? rawGitHub.token : "";
1749
+ const githubUserLogin = typeof rawGitHub.userLogin === "string" ? rawGitHub.userLogin : "";
1750
+ const githubPollCoerced = coerceNumber(rawGitHub.pollIntervalMs);
1751
+ let githubPollIntervalMs = 3e5;
1752
+ if (githubPollCoerced !== void 0) {
1753
+ if (!Number.isFinite(githubPollCoerced) || !Number.isInteger(githubPollCoerced) || githubPollCoerced < 1e3 || githubPollCoerced > 864e5) {
1754
+ throw new Error(
1755
+ `connectors.github.pollIntervalMs must be an integer in [1000, 86400000] ms (got ${JSON.stringify(rawGitHub.pollIntervalMs)})`
1756
+ );
1757
+ }
1758
+ githubPollIntervalMs = githubPollCoerced;
1759
+ }
1760
+ let githubRepos = [];
1761
+ if (rawGitHub.repos !== void 0) {
1762
+ if (!Array.isArray(rawGitHub.repos)) {
1763
+ throw new Error(
1764
+ `connectors.github.repos must be an array of strings (got ${typeof rawGitHub.repos})`
1765
+ );
1766
+ }
1767
+ const seen = /* @__PURE__ */ new Set();
1768
+ for (const value of rawGitHub.repos) {
1769
+ if (typeof value !== "string") {
1770
+ throw new Error(
1771
+ `connectors.github.repos entries must be strings; found ${typeof value}`
1772
+ );
1773
+ }
1774
+ const trimmed = value.trim();
1775
+ if (trimmed.length === 0) continue;
1776
+ if (seen.has(trimmed)) continue;
1777
+ seen.add(trimmed);
1778
+ githubRepos.push(trimmed);
1779
+ }
1780
+ }
1781
+ const githubIncludeDiscussions = coerceBool(rawGitHub.includeDiscussions) === true;
1782
+ return {
1783
+ googleDrive: {
1784
+ enabled: driveEnabled,
1785
+ clientId: driveClientId,
1786
+ clientSecret: driveClientSecret,
1787
+ refreshToken: driveRefreshToken,
1788
+ pollIntervalMs: drivePollIntervalMs,
1789
+ folderIds: driveFolderIds
1790
+ },
1791
+ notion: {
1792
+ enabled: notionEnabled,
1793
+ token: notionToken,
1794
+ databaseIds: notionDatabaseIds,
1795
+ pollIntervalMs: notionPollIntervalMs
1796
+ },
1797
+ gmail: {
1798
+ enabled: gmailEnabled,
1799
+ clientId: gmailClientId,
1800
+ clientSecret: gmailClientSecret,
1801
+ refreshToken: gmailRefreshToken,
1802
+ userId: gmailUserId,
1803
+ query: gmailQuery,
1804
+ pollIntervalMs: gmailPollIntervalMs
1805
+ },
1806
+ github: {
1807
+ enabled: githubEnabled,
1808
+ token: githubToken,
1809
+ userLogin: githubUserLogin,
1810
+ repos: githubRepos,
1811
+ pollIntervalMs: githubPollIntervalMs,
1812
+ includeDiscussions: githubIncludeDiscussions
1813
+ }
1814
+ };
1815
+ })(),
1349
1816
  // MECE Taxonomy (#366)
1350
1817
  // Coerce string booleans from CLI (e.g. --config taxonomyEnabled=true) — gotcha #36
1351
1818
  taxonomyEnabled: coerceBool(cfg.taxonomyEnabled) ?? false,
@@ -1360,9 +1827,10 @@ function parseConfig(raw) {
1360
1827
  // Codex CLI — marketplace integration (#418)
1361
1828
  codexMarketplaceEnabled: cfg.codexMarketplaceEnabled !== false,
1362
1829
  // default: true
1363
- // Page-level versioning (issue #371)
1364
- versioningEnabled: cfg.versioningEnabled === true,
1365
- versioningMaxPerPage: typeof cfg.versioningMaxPerPage === "number" ? Math.max(0, Math.floor(cfg.versioningMaxPerPage)) : 50,
1830
+ // Page-level versioning (issue #371). Issue #678 PR 2/4:
1831
+ // dreams.phases.deepSleep.* WINS over legacy keys.
1832
+ versioningEnabled: dreamsDeepSleep.enabled && dreamsDeepSleep.versioningEnabled,
1833
+ versioningMaxPerPage: dreamsDeepSleep.versioningMaxPerPage,
1366
1834
  versioningSidecarDir: typeof cfg.versioningSidecarDir === "string" && cfg.versioningSidecarDir.trim().length > 0 ? cfg.versioningSidecarDir.trim() : ".versions",
1367
1835
  // Binary file lifecycle management (#367)
1368
1836
  binaryLifecycleEnabled: cfg.binaryLifecycleEnabled === true,
@@ -1408,6 +1876,17 @@ function clampNonNegativeNumber(value) {
1408
1876
  if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
1409
1877
  return Math.max(0, Math.floor(value));
1410
1878
  }
1879
+ function coerceNonNegativeInt(value, fallback, keyName) {
1880
+ if (value === void 0 || value === null) return fallback;
1881
+ const coerced = coerceNumber(value);
1882
+ if (coerced === void 0 || coerced < 0) {
1883
+ const label = keyName ? ` (${keyName})` : "";
1884
+ throw new Error(
1885
+ `config value${label} must be a non-negative finite number; got ${JSON.stringify(value)}`
1886
+ );
1887
+ }
1888
+ return Math.floor(coerced);
1889
+ }
1411
1890
  function clampSurpriseThreshold(value, fallback) {
1412
1891
  if (value === void 0) return fallback;
1413
1892
  return Math.min(1, Math.max(0, value));
@@ -1603,7 +2082,8 @@ function buildRecallPipelineConfig(cfg) {
1603
2082
 
1604
2083
  export {
1605
2084
  coerceInstallExtension,
2085
+ DEFAULT_REASONING_MODEL,
1606
2086
  VALID_MEMORY_CATEGORIES,
1607
2087
  parseConfig
1608
2088
  };
1609
- //# sourceMappingURL=chunk-BK2EFTE2.js.map
2089
+ //# sourceMappingURL=chunk-JWSENLQI.js.map