@openclaw/matrix 2026.9.5 → 2026.9.6

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 (423) hide show
  1. package/dist/.setup/{account-selection-5koohRSQ.mjs → account-selection-BHkfU1eC.mjs} +10 -1
  2. package/dist/.setup/{accounts-BF5hyc-1.mjs → accounts-iThMol10.mjs} +38 -37
  3. package/dist/.setup/{approval-handler.runtime-CoZCYGUH.mjs → approval-handler.runtime-9W7R2ZMq.mjs} +6 -6
  4. package/dist/.setup/{approval-ids-CZOcdJ-5.mjs → approval-ids-j08q8LEG.mjs} +1 -1
  5. package/dist/.setup/{approval-reaction-auth-B51E4ZDa.mjs → approval-reaction-auth-DMVE7VSp.mjs} +7 -3
  6. package/dist/.setup/{channel-q6TBKEiG.mjs → channel-ConuJfxT.mjs} +43 -30
  7. package/dist/.setup/{channel.runtime-DcDBdxe6.mjs → channel.runtime-CnxR2JUK.mjs} +6 -6
  8. package/dist/.setup/{channel.setup-DZQ5rf9k.mjs → channel.setup-C6KvBV8l.mjs} +3 -3
  9. package/dist/.setup/{cli-Cx_cNaXN.mjs → cli-O196sg8g.mjs} +11 -11
  10. package/dist/.setup/{cli-metadata-DHU1H-Vr.mjs → cli-metadata-DFHQj5XR.mjs} +1 -1
  11. package/dist/.setup/{client-By2B3Wz4.mjs → client-C2yVkVdw.mjs} +2 -2
  12. package/dist/.setup/{client-DsJUnWlV.mjs → client-ChrXpxos.mjs} +84 -25
  13. package/dist/.setup/{client-bootstrap-DGX0f-4x.mjs → client-bootstrap-BSnUAoz1.mjs} +1 -1
  14. package/dist/.setup/{create-client-DQXAZjTw.mjs → create-client-CHxcron_.mjs} +13 -7
  15. package/dist/.setup/{credentials-CeRipapZ.mjs → credentials-BGKfiaJW.mjs} +1 -1
  16. package/dist/.setup/{credentials-read-Dp7BoEdm.mjs → credentials-read-Q5sHkkHv.mjs} +9 -1
  17. package/dist/.setup/{credentials-write.runtime-M_bUf3rL.mjs → credentials-write.runtime-DxbXh-pK.mjs} +1 -1
  18. package/dist/.setup/{crypto-runtime-9oxuU30y.mjs → crypto-runtime-D9qn_Pbj.mjs} +3 -3
  19. package/dist/.setup/{crypto-snapshot-doctor.runtime-DXpLbQ7y.mjs → crypto-snapshot-doctor.runtime-CMWa1d9Y.mjs} +2 -2
  20. package/dist/.setup/{directory-live-CatwztQc.mjs → directory-live-CxqkcYbT.mjs} +2 -2
  21. package/dist/.setup/{draft-stream-DIFZDNrb.mjs → draft-stream-y0Vq5f38.mjs} +21 -5
  22. package/dist/.setup/{encryption-guidance-DYEbeYj-.mjs → encryption-guidance-CMWXiBzJ.mjs} +1 -1
  23. package/dist/.setup/file-sync-store-CsalA4yI.mjs +213 -0
  24. package/dist/.setup/{http-client-BJjo-iw5.mjs → http-client-Bi6uKmzh.mjs} +17 -2
  25. package/dist/.setup/{idb-persistence-CIfFUjP3.mjs → idb-persistence-c8uxcofH.mjs} +1 -1
  26. package/dist/.setup/{messages-SW0NPYnR.mjs → messages-COuAcrz-.mjs} +10 -3
  27. package/dist/.setup/{monitor-DQfYX5rA.mjs → monitor-CzE3myC_.mjs} +127 -233
  28. package/dist/.setup/{outbound-DRWtSUe-.mjs → outbound-B508VPBM.mjs} +1 -1
  29. package/dist/.setup/probe.runtime-C-NMeYk2.mjs +2 -0
  30. package/dist/.setup/{profile-update-DPttQz3-.mjs → profile-update-DrblJttE.mjs} +1 -1
  31. package/dist/.setup/{reaction-events-CdAk_rh_.mjs → reaction-events-BvZmhjLC.mjs} +4 -3
  32. package/dist/.setup/{resolve-targets-drjgAdIe.mjs → resolve-targets-BLz748lX.mjs} +1 -1
  33. package/dist/.setup/{resolver.runtime-Ci6ddcPh.mjs → resolver.runtime-CuLQ2uHe.mjs} +1 -1
  34. package/dist/.setup/{room-info-DHd1j3qM.mjs → room-info-DTyP1k5g.mjs} +3 -3
  35. package/dist/.setup/{sdk-BkKE4ANj.mjs → sdk-rqFjgltR.mjs} +6 -225
  36. package/dist/.setup/{send-h0gZ_-qk.mjs → send-aVdC5NJO.mjs} +23 -26
  37. package/dist/.setup/{setup-bootstrap-BYgBD504.mjs → setup-bootstrap-A_WGFq1Y.mjs} +2 -2
  38. package/dist/.setup/{setup-core-BUcDAM7q.mjs → setup-core-D2hMbIi3.mjs} +3 -3
  39. package/dist/.setup/{setup-plugin-api-DoTm4v2q.mjs → setup-plugin-api-JiRgm8s6.mjs} +1 -1
  40. package/dist/.setup/{setup-surface-V_Q-enq-.mjs → setup-surface-BL3ha1l-.mjs} +6 -6
  41. package/dist/.setup/{startup-verification-Bq5qeEGn.mjs → startup-verification-Cp1Gf7pM.mjs} +7 -7
  42. package/dist/.setup/{storage-DJ-oUgmX.mjs → storage-BXaFc0S4.mjs} +75 -86
  43. package/dist/.setup/{storage-metadata-BQJjHC_i.mjs → storage-metadata-fHN6Df2m.mjs} +29 -45
  44. package/dist/.setup/{sync-cache-state-CFiZIPhA.mjs → sync-cache-state-BMtGMxU1.mjs} +30 -43
  45. package/dist/.setup/{thread-bindings-Hy96ujd3.mjs → thread-bindings-JlnLDfPM.mjs} +5 -5
  46. package/dist/.setup/{tool-actions.runtime-Dckttu43.mjs → tool-actions.runtime-REzYTNxm.mjs} +16 -8
  47. package/dist/.setup/{verification-CKqBZ9mI.mjs → verification-0o8MOW9T.mjs} +2 -2
  48. package/dist/api.js +5 -5
  49. package/dist/channel-plugin-api.js +1 -1
  50. package/dist/cli-metadata.js +1 -1
  51. package/dist/contract-api.js +2 -2
  52. package/dist/doctor-contract-api.js +6 -6
  53. package/dist/helper-api.js +2 -2
  54. package/dist/index.js +1 -1
  55. package/dist/plugin-entry.handlers.runtime.js +1 -1
  56. package/dist/runtime-api.js +1 -1
  57. package/dist/session-binding-contract-api.js +1 -1
  58. package/dist/setup-entry.js +1 -1
  59. package/dist/setup-plugin-api.js +1 -1
  60. package/node_modules/markdown-it/node_modules/argparse/lib/argparse.js +18 -2
  61. package/node_modules/markdown-it/node_modules/argparse/package.json +1 -1
  62. package/node_modules/matrix-js-sdk/node_modules/@babel/runtime/package.json +1 -1
  63. package/node_modules/music-metadata/node_modules/file-type/package.json +3 -2
  64. package/node_modules/music-metadata/node_modules/file-type/readme.md +3 -0
  65. package/node_modules/music-metadata/node_modules/file-type/source/index.js +28 -1
  66. package/node_modules/music-metadata/node_modules/file-type/source/supported.js +2 -0
  67. package/node_modules/zod/README.md +2 -2
  68. package/node_modules/zod/compile.cjs +19 -0
  69. package/node_modules/zod/index.cjs +19 -0
  70. package/node_modules/zod/locales/index.cjs +19 -0
  71. package/node_modules/zod/mini/index.cjs +19 -0
  72. package/node_modules/zod/package.json +8 -7
  73. package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
  74. package/node_modules/zod/src/v4/classic/external.ts +2 -0
  75. package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
  76. package/node_modules/zod/src/v4/classic/schemas.ts +243 -168
  77. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +60 -9
  78. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
  79. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
  80. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +265 -0
  81. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
  82. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
  83. package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
  84. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
  85. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  86. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +40 -2
  87. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
  88. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
  89. package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
  90. package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
  91. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
  92. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
  93. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  94. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
  95. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
  96. package/node_modules/zod/src/v4/classic/tests/string.test.ts +95 -1
  97. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
  98. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +234 -38
  99. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
  100. package/node_modules/zod/src/v4/core/api.ts +44 -28
  101. package/node_modules/zod/src/v4/core/checks.ts +62 -102
  102. package/node_modules/zod/src/v4/core/compile.ts +218 -93
  103. package/node_modules/zod/src/v4/core/core.ts +1 -3
  104. package/node_modules/zod/src/v4/core/doc.ts +6 -2
  105. package/node_modules/zod/src/v4/core/errors.ts +3 -6
  106. package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
  107. package/node_modules/zod/src/v4/core/json-schema-processors.ts +185 -81
  108. package/node_modules/zod/src/v4/core/memoizer.ts +75 -28
  109. package/node_modules/zod/src/v4/core/parse.ts +37 -16
  110. package/node_modules/zod/src/v4/core/regexes.ts +14 -4
  111. package/node_modules/zod/src/v4/core/schemas.ts +296 -132
  112. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  113. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
  114. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  115. package/node_modules/zod/src/v4/core/tests/compile.test.ts +399 -2
  116. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  117. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  118. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  119. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
  120. package/node_modules/zod/src/v4/core/to-json-schema.ts +9 -7
  121. package/node_modules/zod/src/v4/core/util.ts +218 -147
  122. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  123. package/node_modules/zod/src/v4/locales/ar.ts +2 -0
  124. package/node_modules/zod/src/v4/locales/az.ts +2 -0
  125. package/node_modules/zod/src/v4/locales/be.ts +2 -0
  126. package/node_modules/zod/src/v4/locales/bg.ts +2 -0
  127. package/node_modules/zod/src/v4/locales/bn.ts +2 -0
  128. package/node_modules/zod/src/v4/locales/ca.ts +2 -0
  129. package/node_modules/zod/src/v4/locales/ckb.ts +2 -0
  130. package/node_modules/zod/src/v4/locales/cs.ts +2 -0
  131. package/node_modules/zod/src/v4/locales/da.ts +2 -0
  132. package/node_modules/zod/src/v4/locales/de.ts +2 -0
  133. package/node_modules/zod/src/v4/locales/el.ts +2 -0
  134. package/node_modules/zod/src/v4/locales/en.ts +2 -0
  135. package/node_modules/zod/src/v4/locales/eo.ts +2 -0
  136. package/node_modules/zod/src/v4/locales/es.ts +2 -0
  137. package/node_modules/zod/src/v4/locales/fa.ts +2 -0
  138. package/node_modules/zod/src/v4/locales/fi.ts +2 -0
  139. package/node_modules/zod/src/v4/locales/fr-CA.ts +2 -0
  140. package/node_modules/zod/src/v4/locales/fr.ts +2 -0
  141. package/node_modules/zod/src/v4/locales/gu.ts +2 -0
  142. package/node_modules/zod/src/v4/locales/he.ts +2 -0
  143. package/node_modules/zod/src/v4/locales/hi.ts +2 -0
  144. package/node_modules/zod/src/v4/locales/hr.ts +2 -0
  145. package/node_modules/zod/src/v4/locales/hu.ts +2 -0
  146. package/node_modules/zod/src/v4/locales/hy.ts +2 -0
  147. package/node_modules/zod/src/v4/locales/id.ts +2 -0
  148. package/node_modules/zod/src/v4/locales/index.ts +1 -0
  149. package/node_modules/zod/src/v4/locales/is.ts +2 -0
  150. package/node_modules/zod/src/v4/locales/it.ts +2 -0
  151. package/node_modules/zod/src/v4/locales/ja.ts +2 -0
  152. package/node_modules/zod/src/v4/locales/ka.ts +2 -0
  153. package/node_modules/zod/src/v4/locales/km.ts +2 -0
  154. package/node_modules/zod/src/v4/locales/kn.ts +2 -0
  155. package/node_modules/zod/src/v4/locales/ko.ts +2 -0
  156. package/node_modules/zod/src/v4/locales/lt.ts +2 -0
  157. package/node_modules/zod/src/v4/locales/mk.ts +2 -0
  158. package/node_modules/zod/src/v4/locales/ms.ts +2 -0
  159. package/node_modules/zod/src/v4/locales/ne.ts +2 -0
  160. package/node_modules/zod/src/v4/locales/nl.ts +2 -0
  161. package/node_modules/zod/src/v4/locales/nn.ts +2 -0
  162. package/node_modules/zod/src/v4/locales/no.ts +2 -0
  163. package/node_modules/zod/src/v4/locales/ota.ts +2 -0
  164. package/node_modules/zod/src/v4/locales/pl.ts +2 -0
  165. package/node_modules/zod/src/v4/locales/ps.ts +2 -0
  166. package/node_modules/zod/src/v4/locales/pt-BR.ts +2 -0
  167. package/node_modules/zod/src/v4/locales/pt.ts +2 -0
  168. package/node_modules/zod/src/v4/locales/ro.ts +2 -0
  169. package/node_modules/zod/src/v4/locales/ru.ts +2 -0
  170. package/node_modules/zod/src/v4/locales/sk.ts +2 -0
  171. package/node_modules/zod/src/v4/locales/sl.ts +2 -0
  172. package/node_modules/zod/src/v4/locales/sv.ts +2 -0
  173. package/node_modules/zod/src/v4/locales/ta.ts +2 -0
  174. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  175. package/node_modules/zod/src/v4/locales/th.ts +2 -0
  176. package/node_modules/zod/src/v4/locales/tk.ts +2 -0
  177. package/node_modules/zod/src/v4/locales/tr.ts +2 -0
  178. package/node_modules/zod/src/v4/locales/uk.ts +2 -0
  179. package/node_modules/zod/src/v4/locales/ur.ts +2 -0
  180. package/node_modules/zod/src/v4/locales/uz.ts +2 -0
  181. package/node_modules/zod/src/v4/locales/vi.ts +2 -0
  182. package/node_modules/zod/src/v4/locales/yo.ts +2 -0
  183. package/node_modules/zod/src/v4/locales/zh-CN.ts +2 -0
  184. package/node_modules/zod/src/v4/locales/zh-TW.ts +2 -0
  185. package/node_modules/zod/src/v4/mini/external.ts +2 -0
  186. package/node_modules/zod/src/v4/mini/schemas.ts +32 -7
  187. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
  188. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
  189. package/node_modules/zod/src/v4/mini/tests/index.test.ts +86 -0
  190. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
  191. package/node_modules/zod/src/v4/mini/tests/string.test.ts +23 -0
  192. package/node_modules/zod/v3/ZodError.cjs +19 -0
  193. package/node_modules/zod/v3/errors.cjs +19 -0
  194. package/node_modules/zod/v3/external.cjs +19 -0
  195. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  196. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  197. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  198. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  199. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  200. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  201. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  202. package/node_modules/zod/v3/index.cjs +19 -0
  203. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  204. package/node_modules/zod/v3/types.cjs +19 -0
  205. package/node_modules/zod/v4/classic/checks.cjs +19 -0
  206. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  207. package/node_modules/zod/v4/classic/compat.cjs +19 -0
  208. package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
  209. package/node_modules/zod/v4/classic/errors.cjs +19 -0
  210. package/node_modules/zod/v4/classic/external.cjs +22 -1
  211. package/node_modules/zod/v4/classic/external.d.cts +1 -1
  212. package/node_modules/zod/v4/classic/external.d.ts +1 -1
  213. package/node_modules/zod/v4/classic/external.js +1 -1
  214. package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
  215. package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
  216. package/node_modules/zod/v4/classic/in-out.cjs +19 -0
  217. package/node_modules/zod/v4/classic/index.cjs +19 -0
  218. package/node_modules/zod/v4/classic/iso.cjs +19 -0
  219. package/node_modules/zod/v4/classic/parse.cjs +19 -0
  220. package/node_modules/zod/v4/classic/schemas.cjs +100 -35
  221. package/node_modules/zod/v4/classic/schemas.d.cts +15 -1
  222. package/node_modules/zod/v4/classic/schemas.d.ts +15 -1
  223. package/node_modules/zod/v4/classic/schemas.js +77 -33
  224. package/node_modules/zod/v4/core/api.cjs +45 -22
  225. package/node_modules/zod/v4/core/api.d.cts +12 -6
  226. package/node_modules/zod/v4/core/api.d.ts +12 -6
  227. package/node_modules/zod/v4/core/api.js +25 -22
  228. package/node_modules/zod/v4/core/checks.cjs +51 -97
  229. package/node_modules/zod/v4/core/checks.d.cts +17 -1
  230. package/node_modules/zod/v4/core/checks.d.ts +17 -1
  231. package/node_modules/zod/v4/core/checks.js +31 -96
  232. package/node_modules/zod/v4/core/compile.cjs +173 -78
  233. package/node_modules/zod/v4/core/compile.d.cts +18 -4
  234. package/node_modules/zod/v4/core/compile.d.ts +18 -4
  235. package/node_modules/zod/v4/core/compile.js +154 -79
  236. package/node_modules/zod/v4/core/core.cjs +20 -1
  237. package/node_modules/zod/v4/core/core.js +1 -1
  238. package/node_modules/zod/v4/core/doc.cjs +26 -2
  239. package/node_modules/zod/v4/core/doc.js +7 -2
  240. package/node_modules/zod/v4/core/errors.cjs +21 -5
  241. package/node_modules/zod/v4/core/errors.js +2 -5
  242. package/node_modules/zod/v4/core/index.cjs +19 -0
  243. package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
  244. package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
  245. package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
  246. package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
  247. package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
  248. package/node_modules/zod/v4/core/json-schema-processors.js +170 -74
  249. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  250. package/node_modules/zod/v4/core/memoizer.cjs +111 -23
  251. package/node_modules/zod/v4/core/memoizer.js +69 -23
  252. package/node_modules/zod/v4/core/parse.cjs +56 -16
  253. package/node_modules/zod/v4/core/parse.js +37 -16
  254. package/node_modules/zod/v4/core/regexes.cjs +31 -6
  255. package/node_modules/zod/v4/core/regexes.d.cts +3 -0
  256. package/node_modules/zod/v4/core/regexes.d.ts +3 -0
  257. package/node_modules/zod/v4/core/regexes.js +10 -4
  258. package/node_modules/zod/v4/core/registries.cjs +19 -0
  259. package/node_modules/zod/v4/core/schemas.cjs +302 -114
  260. package/node_modules/zod/v4/core/schemas.d.cts +28 -8
  261. package/node_modules/zod/v4/core/schemas.d.ts +28 -8
  262. package/node_modules/zod/v4/core/schemas.js +279 -113
  263. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  264. package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
  265. package/node_modules/zod/v4/core/to-json-schema.d.cts +4 -3
  266. package/node_modules/zod/v4/core/to-json-schema.d.ts +4 -3
  267. package/node_modules/zod/v4/core/to-json-schema.js +7 -6
  268. package/node_modules/zod/v4/core/util.cjs +177 -143
  269. package/node_modules/zod/v4/core/util.d.cts +25 -4
  270. package/node_modules/zod/v4/core/util.d.ts +25 -4
  271. package/node_modules/zod/v4/core/util.js +156 -143
  272. package/node_modules/zod/v4/core/versions.cjs +21 -2
  273. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  274. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  275. package/node_modules/zod/v4/core/versions.js +2 -2
  276. package/node_modules/zod/v4/core/visit.cjs +19 -0
  277. package/node_modules/zod/v4/index.cjs +19 -0
  278. package/node_modules/zod/v4/locales/ar.cjs +2 -0
  279. package/node_modules/zod/v4/locales/ar.js +2 -0
  280. package/node_modules/zod/v4/locales/az.cjs +2 -0
  281. package/node_modules/zod/v4/locales/az.js +2 -0
  282. package/node_modules/zod/v4/locales/be.cjs +2 -0
  283. package/node_modules/zod/v4/locales/be.js +2 -0
  284. package/node_modules/zod/v4/locales/bg.cjs +2 -0
  285. package/node_modules/zod/v4/locales/bg.js +2 -0
  286. package/node_modules/zod/v4/locales/bn.cjs +2 -0
  287. package/node_modules/zod/v4/locales/bn.js +2 -0
  288. package/node_modules/zod/v4/locales/ca.cjs +2 -0
  289. package/node_modules/zod/v4/locales/ca.js +2 -0
  290. package/node_modules/zod/v4/locales/ckb.cjs +2 -0
  291. package/node_modules/zod/v4/locales/ckb.js +2 -0
  292. package/node_modules/zod/v4/locales/cs.cjs +2 -0
  293. package/node_modules/zod/v4/locales/cs.js +2 -0
  294. package/node_modules/zod/v4/locales/da.cjs +2 -0
  295. package/node_modules/zod/v4/locales/da.js +2 -0
  296. package/node_modules/zod/v4/locales/de.cjs +2 -0
  297. package/node_modules/zod/v4/locales/de.js +2 -0
  298. package/node_modules/zod/v4/locales/el.cjs +2 -0
  299. package/node_modules/zod/v4/locales/el.js +2 -0
  300. package/node_modules/zod/v4/locales/en.cjs +2 -0
  301. package/node_modules/zod/v4/locales/en.js +2 -0
  302. package/node_modules/zod/v4/locales/eo.cjs +2 -0
  303. package/node_modules/zod/v4/locales/eo.js +2 -0
  304. package/node_modules/zod/v4/locales/es.cjs +2 -0
  305. package/node_modules/zod/v4/locales/es.js +2 -0
  306. package/node_modules/zod/v4/locales/fa.cjs +2 -0
  307. package/node_modules/zod/v4/locales/fa.js +2 -0
  308. package/node_modules/zod/v4/locales/fi.cjs +2 -0
  309. package/node_modules/zod/v4/locales/fi.js +2 -0
  310. package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
  311. package/node_modules/zod/v4/locales/fr-CA.js +2 -0
  312. package/node_modules/zod/v4/locales/fr.cjs +2 -0
  313. package/node_modules/zod/v4/locales/fr.js +2 -0
  314. package/node_modules/zod/v4/locales/gu.cjs +2 -0
  315. package/node_modules/zod/v4/locales/gu.js +2 -0
  316. package/node_modules/zod/v4/locales/he.cjs +2 -0
  317. package/node_modules/zod/v4/locales/he.js +2 -0
  318. package/node_modules/zod/v4/locales/hi.cjs +2 -0
  319. package/node_modules/zod/v4/locales/hi.js +2 -0
  320. package/node_modules/zod/v4/locales/hr.cjs +2 -0
  321. package/node_modules/zod/v4/locales/hr.js +2 -0
  322. package/node_modules/zod/v4/locales/hu.cjs +2 -0
  323. package/node_modules/zod/v4/locales/hu.js +2 -0
  324. package/node_modules/zod/v4/locales/hy.cjs +2 -0
  325. package/node_modules/zod/v4/locales/hy.js +2 -0
  326. package/node_modules/zod/v4/locales/id.cjs +2 -0
  327. package/node_modules/zod/v4/locales/id.js +2 -0
  328. package/node_modules/zod/v4/locales/index.cjs +22 -1
  329. package/node_modules/zod/v4/locales/index.d.cts +1 -0
  330. package/node_modules/zod/v4/locales/index.d.ts +1 -0
  331. package/node_modules/zod/v4/locales/index.js +1 -0
  332. package/node_modules/zod/v4/locales/is.cjs +2 -0
  333. package/node_modules/zod/v4/locales/is.js +2 -0
  334. package/node_modules/zod/v4/locales/it.cjs +2 -0
  335. package/node_modules/zod/v4/locales/it.js +2 -0
  336. package/node_modules/zod/v4/locales/ja.cjs +2 -0
  337. package/node_modules/zod/v4/locales/ja.js +2 -0
  338. package/node_modules/zod/v4/locales/ka.cjs +2 -0
  339. package/node_modules/zod/v4/locales/ka.js +2 -0
  340. package/node_modules/zod/v4/locales/km.cjs +2 -0
  341. package/node_modules/zod/v4/locales/km.js +2 -0
  342. package/node_modules/zod/v4/locales/kn.cjs +2 -0
  343. package/node_modules/zod/v4/locales/kn.js +2 -0
  344. package/node_modules/zod/v4/locales/ko.cjs +2 -0
  345. package/node_modules/zod/v4/locales/ko.js +2 -0
  346. package/node_modules/zod/v4/locales/lt.cjs +2 -0
  347. package/node_modules/zod/v4/locales/lt.js +2 -0
  348. package/node_modules/zod/v4/locales/mk.cjs +2 -0
  349. package/node_modules/zod/v4/locales/mk.js +2 -0
  350. package/node_modules/zod/v4/locales/ms.cjs +2 -0
  351. package/node_modules/zod/v4/locales/ms.js +2 -0
  352. package/node_modules/zod/v4/locales/ne.cjs +2 -0
  353. package/node_modules/zod/v4/locales/ne.js +2 -0
  354. package/node_modules/zod/v4/locales/nl.cjs +2 -0
  355. package/node_modules/zod/v4/locales/nl.js +2 -0
  356. package/node_modules/zod/v4/locales/nn.cjs +2 -0
  357. package/node_modules/zod/v4/locales/nn.js +2 -0
  358. package/node_modules/zod/v4/locales/no.cjs +2 -0
  359. package/node_modules/zod/v4/locales/no.js +2 -0
  360. package/node_modules/zod/v4/locales/ota.cjs +2 -0
  361. package/node_modules/zod/v4/locales/ota.js +2 -0
  362. package/node_modules/zod/v4/locales/pl.cjs +2 -0
  363. package/node_modules/zod/v4/locales/pl.js +2 -0
  364. package/node_modules/zod/v4/locales/ps.cjs +2 -0
  365. package/node_modules/zod/v4/locales/ps.js +2 -0
  366. package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
  367. package/node_modules/zod/v4/locales/pt-BR.js +2 -0
  368. package/node_modules/zod/v4/locales/pt.cjs +2 -0
  369. package/node_modules/zod/v4/locales/pt.js +2 -0
  370. package/node_modules/zod/v4/locales/ro.cjs +2 -0
  371. package/node_modules/zod/v4/locales/ro.js +2 -0
  372. package/node_modules/zod/v4/locales/ru.cjs +2 -0
  373. package/node_modules/zod/v4/locales/ru.js +2 -0
  374. package/node_modules/zod/v4/locales/sk.cjs +2 -0
  375. package/node_modules/zod/v4/locales/sk.js +2 -0
  376. package/node_modules/zod/v4/locales/sl.cjs +2 -0
  377. package/node_modules/zod/v4/locales/sl.js +2 -0
  378. package/node_modules/zod/v4/locales/sv.cjs +2 -0
  379. package/node_modules/zod/v4/locales/sv.js +2 -0
  380. package/node_modules/zod/v4/locales/ta.cjs +2 -0
  381. package/node_modules/zod/v4/locales/ta.js +2 -0
  382. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  383. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  384. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  385. package/node_modules/zod/v4/locales/tg.js +117 -0
  386. package/node_modules/zod/v4/locales/th.cjs +2 -0
  387. package/node_modules/zod/v4/locales/th.js +2 -0
  388. package/node_modules/zod/v4/locales/tk.cjs +2 -0
  389. package/node_modules/zod/v4/locales/tk.js +2 -0
  390. package/node_modules/zod/v4/locales/tr.cjs +2 -0
  391. package/node_modules/zod/v4/locales/tr.js +2 -0
  392. package/node_modules/zod/v4/locales/uk.cjs +2 -0
  393. package/node_modules/zod/v4/locales/uk.js +2 -0
  394. package/node_modules/zod/v4/locales/ur.cjs +2 -0
  395. package/node_modules/zod/v4/locales/ur.js +2 -0
  396. package/node_modules/zod/v4/locales/uz.cjs +2 -0
  397. package/node_modules/zod/v4/locales/uz.js +2 -0
  398. package/node_modules/zod/v4/locales/vi.cjs +2 -0
  399. package/node_modules/zod/v4/locales/vi.js +2 -0
  400. package/node_modules/zod/v4/locales/yo.cjs +2 -0
  401. package/node_modules/zod/v4/locales/yo.js +2 -0
  402. package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
  403. package/node_modules/zod/v4/locales/zh-CN.js +2 -0
  404. package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
  405. package/node_modules/zod/v4/locales/zh-TW.js +2 -0
  406. package/node_modules/zod/v4/mini/checks.cjs +19 -0
  407. package/node_modules/zod/v4/mini/coerce.cjs +19 -0
  408. package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
  409. package/node_modules/zod/v4/mini/external.cjs +22 -1
  410. package/node_modules/zod/v4/mini/external.d.cts +1 -1
  411. package/node_modules/zod/v4/mini/external.d.ts +1 -1
  412. package/node_modules/zod/v4/mini/external.js +1 -1
  413. package/node_modules/zod/v4/mini/in-out.cjs +19 -0
  414. package/node_modules/zod/v4/mini/index.cjs +19 -0
  415. package/node_modules/zod/v4/mini/iso.cjs +19 -0
  416. package/node_modules/zod/v4/mini/parse.cjs +19 -0
  417. package/node_modules/zod/v4/mini/schemas.cjs +44 -8
  418. package/node_modules/zod/v4/mini/schemas.d.cts +6 -1
  419. package/node_modules/zod/v4/mini/schemas.d.ts +6 -1
  420. package/node_modules/zod/v4/mini/schemas.js +21 -6
  421. package/node_modules/zod/v4-mini/index.cjs +19 -0
  422. package/package.json +7 -6
  423. package/dist/.setup/probe.runtime-qPRZE3Yf.mjs +0 -2
@@ -1,29 +1,29 @@
1
1
  import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
2
2
  import { a as resolveMatrixAccountConfig, i as resolveMatrixAccountAllowlistConfig } from "./account-config-CRsKoMqJ.mjs";
3
- import { n as resolveConfiguredMatrixBotUserIds } from "./accounts-BF5hyc-1.mjs";
4
- import { _ as toLocationContext, a as resolveMatrixRoomConfig, c as canonicalizeAllowlistWithResolvedIds, d as formatLocationText, f as getAgentScopedMediaLocalRoots, g as summarizeMapping, h as patchAllowlistUsersInConfigEntries, i as resolveMatrixThreadRouting, l as createReplyPrefixOptions, m as logTypingFailure, n as resolveMatrixStoredSessionMeta, o as addAllowlistUserEntriesFromConfigEntry, p as logInboundDrop, r as resolveMatrixInboundRoute, s as buildAllowlistResolutionSummary, u as createTypingCallbacks } from "./channel-q6TBKEiG.mjs";
5
- import { a as normalizeMatrixUserId, i as normalizeMatrixAllowList, o as resolveMatrixAllowListMatch } from "./channel.setup-DZQ5rf9k.mjs";
3
+ import { n as resolveConfiguredMatrixBotUserIds } from "./accounts-iThMol10.mjs";
4
+ import { _ as toLocationContext, a as resolveMatrixRoomConfig, c as canonicalizeAllowlistWithResolvedIds, d as formatLocationText, f as getAgentScopedMediaLocalRoots, g as summarizeMapping, h as patchAllowlistUsersInConfigEntries, i as resolveMatrixThreadRouting, l as createReplyPrefixOptions, m as logTypingFailure, n as resolveMatrixStoredSessionMeta, o as addAllowlistUserEntriesFromConfigEntry, p as logInboundDrop, r as resolveMatrixInboundRoute, s as buildAllowlistResolutionSummary, u as createTypingCallbacks } from "./channel-ConuJfxT.mjs";
5
+ import { a as normalizeMatrixUserId, i as normalizeMatrixAllowList, o as resolveMatrixAllowListMatch } from "./channel.setup-C6KvBV8l.mjs";
6
6
  import { n as isMatrixRoomId, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.mjs";
7
7
  import { a as MATRIX_REACTION_EVENT_TYPE } from "./send-currentness-BrGXL7b8.mjs";
8
8
  import { c as isStrictDirectMembership, f as resolveMatrixReplyToEventId, h as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY, i as promoteMatrixDirectRoomCandidate, p as resolveMatrixThreadRootId, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers } from "./direct-management-B2Bno2xL.mjs";
9
- import { S as parsePollStartContent, _ as formatPollAsText, b as isPollStartType, c as formatMatrixMediaTooLargeText, d as isLikelyBareFilename, l as formatMatrixMediaUnavailableText, p as resolveMatrixReplacementContent, r as sendMessageMatrix, u as formatMatrixMessageText, y as isPollEventType } from "./send-h0gZ_-qk.mjs";
10
- import { t as createMatrixThreadBindingManager } from "./thread-bindings-Hy96ujd3.mjs";
11
- import { l as fetchMatrixPollSnapshot, r as readMatrixMessages } from "./messages-SW0NPYnR.mjs";
12
- import { c as createMatrixMonitorTaskRunner, d as resolveMatrixAuthContext, l as backfillMatrixAuthDeviceIdAfterStartup, o as isMatrixStartupAbortError, r as acquireSharedMatrixClient, s as throwIfMatrixStartupAborted, u as resolveMatrixAuth } from "./client-DsJUnWlV.mjs";
13
- import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-BJjo-iw5.mjs";
14
- import { n as prepareMatrixReplyPayload, r as resolveMatrixExtraContent } from "./outbound-DRWtSUe-.mjs";
15
- import { t as resolveMatrixTargets } from "./resolve-targets-drjgAdIe.mjs";
16
- import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-DYEbeYj-.mjs";
9
+ import { S as parsePollStartContent, _ as formatPollAsText, b as isPollStartType, c as formatMatrixMediaTooLargeText, d as isLikelyBareFilename, l as formatMatrixMediaUnavailableText, p as resolveMatrixReplacementContent, r as sendMessageMatrix, u as formatMatrixMessageText, y as isPollEventType } from "./send-aVdC5NJO.mjs";
10
+ import { t as createMatrixThreadBindingManager } from "./thread-bindings-JlnLDfPM.mjs";
11
+ import { i as readMatrixMessages, u as fetchMatrixPollSnapshot } from "./messages-COuAcrz-.mjs";
12
+ import { c as createMatrixMonitorTaskRunner, d as resolveMatrixAuth, f as resolveMatrixAuthContext, l as getMatrixMonitorTaskSignal, o as isMatrixStartupAbortError, r as acquireSharedMatrixClient, s as throwIfMatrixStartupAborted, u as backfillMatrixAuthDeviceIdAfterStartup } from "./client-ChrXpxos.mjs";
13
+ import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-Bi6uKmzh.mjs";
14
+ import { n as prepareMatrixReplyPayload, r as resolveMatrixExtraContent } from "./outbound-B508VPBM.mjs";
15
+ import { t as resolveMatrixTargets } from "./resolve-targets-BLz748lX.mjs";
16
+ import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-CMWXiBzJ.mjs";
17
17
  import { createMatrixInboundEventDeduper } from "./inbound-dedupe-BSlv35xl.mjs";
18
18
  import { a as isMatrixAccessTokenInvalidatedError, d as isMatrixDisconnectedSyncState, f as isMatrixReadySyncState, p as isMatrixTerminalSyncState } from "./client-support-Bn9Bk0-H.mjs";
19
- import { i as setBoundedMap, r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-DHd1j3qM.mjs";
19
+ import { i as setBoundedMap, r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-DTyP1k5g.mjs";
20
20
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
21
- import { createChannelProgressDraftCompositor, createPreviewMessageReceipt, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, resolveChannelStreamingBlockEnabled, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
21
+ import { createChannelProgressDraftCompositor, createLivePreviewLifecycle, createPreviewMessageReceipt, resolveChannelStreamingBlockEnabled, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
22
22
  import { normalizeLowercaseStringOrEmpty, normalizeNullableString, normalizeOptionalString, normalizeStringifiedEntries, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
23
23
  import { stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
24
24
  import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
25
25
  import { extractErrorCode, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
26
- import { isFutureDateTimestampMs, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, resolveOptionalIntegerOption } from "openclaw/plugin-sdk/number-runtime";
26
+ import { isFutureDateTimestampMs, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, resolveOptionalIntegerOption, resolvePromptHistoryLimit } from "openclaw/plugin-sdk/number-runtime";
27
27
  import { resolveAgentRoute, resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
28
28
  import { createAcceptedChannelDeliveryResult, createChannelInboundEnvelopeBuilder, createChannelPartialDeliveryError, hasFinalInboundReplyDispatch, isChannelPartialDeliveryError, resolveInboundMentionDecision, resolveInboundReplyDispatchCounts, toInboundMediaFactsWithMetadata } from "openclaw/plugin-sdk/channel-inbound";
29
29
  import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
@@ -37,7 +37,7 @@ import { GROUP_POLICY_BLOCKED_LABEL, resolveAllowlistProviderRuntimeGroupPolicy,
37
37
  import { resolveThreadBindingIdleTimeoutMsForChannel, resolveThreadBindingMaxAgeMsForChannel } from "openclaw/plugin-sdk/thread-bindings-runtime";
38
38
  import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
39
39
  import { reportChannelRoomJoin } from "openclaw/plugin-sdk/channel-join-intro-runtime";
40
- import { createChannelIngressResolver, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
40
+ import { defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
41
41
  import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
42
42
  import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
43
43
  import { evaluateSupplementalContextVisibility, resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
@@ -738,7 +738,7 @@ async function resolveMatrixMonitorAccessState(params) {
738
738
  });
739
739
  const accountId = params.accountId ?? "default";
740
740
  const eventKind = params.eventKind ?? "message";
741
- const ingress = createChannelIngressResolver({
741
+ const ingress = getMatrixRuntime().channel.inbound.ingress.createResolver({
742
742
  channelId: "matrix",
743
743
  accountId,
744
744
  identity: matrixIngressIdentity,
@@ -775,7 +775,7 @@ async function resolveMatrixMonitorAccessState(params) {
775
775
  async function resolveMatrixMonitorCommandAccess(state, params) {
776
776
  const commandAllowFrom = state.isRoom ? [] : state.messageIngress.senderAccess.effectiveAllowFrom;
777
777
  const commandGroupAllowFrom = state.effectiveRoomUsers.length > 0 ? state.effectiveRoomUsers : state.effectiveGroupAllowFrom;
778
- return (await createChannelIngressResolver({
778
+ return (await getMatrixRuntime().channel.inbound.ingress.createResolver({
779
779
  channelId: "matrix",
780
780
  accountId: state.accountId,
781
781
  identity: matrixIngressIdentity
@@ -1648,17 +1648,14 @@ function formatMatrixToolProgressMarkdownCode(text) {
1648
1648
  }
1649
1649
  //#endregion
1650
1650
  //#region extensions/matrix/src/matrix/monitor/handler-runtime.ts
1651
- async function redactMatrixDraftEvent(client, roomId, draftEventId) {
1652
- return await client.redactEvent(roomId, draftEventId).then(() => true, () => false);
1653
- }
1654
1651
  function buildMatrixFinalizedPreviewContent() {
1655
1652
  return { [MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY]: true };
1656
1653
  }
1657
- const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-h0gZ_-qk.mjs").then((n) => n.s));
1654
+ const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-aVdC5NJO.mjs").then((n) => n.s));
1658
1655
  const loadAcpBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/acp-binding-runtime"));
1659
1656
  const loadSessionBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/session-binding-runtime"));
1660
- const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-CdAk_rh_.mjs"));
1661
- const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-DIFZDNrb.mjs"));
1657
+ const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-BvZmhjLC.mjs"));
1658
+ const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-y0Vq5f38.mjs"));
1662
1659
  async function matrixTextWouldActivateMentions(client, text) {
1663
1660
  const { resolveMatrixMentionsForBody } = await loadMatrixSendModule();
1664
1661
  const mentions = await resolveMatrixMentionsForBody({
@@ -1863,6 +1860,7 @@ async function resolveMatrixInboundContext(config) {
1863
1860
  const channelIngress = await resolveMessageIngress({
1864
1861
  agentId: _route.agentId,
1865
1862
  sessionKey: _route.sessionKey,
1863
+ nativeChannelId: roomId,
1866
1864
  messageId,
1867
1865
  inboundEventKind: "user_request"
1868
1866
  }, {
@@ -1910,9 +1908,7 @@ async function resolveMatrixInboundContext(config) {
1910
1908
  threadId: threadTarget
1911
1909
  },
1912
1910
  route: {
1913
- agentId: _route.agentId,
1914
- dmScope: _route.dmScope,
1915
- accountId: _route.accountId,
1911
+ ..._route,
1916
1912
  routeSessionKey: _route.sessionKey,
1917
1913
  parentSessionKey: threadTarget && _route.matchedBy !== "binding.channel" ? _route.mainSessionKey : void 0
1918
1914
  },
@@ -1986,7 +1982,6 @@ async function resolveMatrixInboundContext(config) {
1986
1982
  //#region extensions/matrix/src/matrix/monitor/handler-draft-controller.ts
1987
1983
  async function createMatrixDraftController(params) {
1988
1984
  const { streaming, previewToolProgressEnabled, replyToMode, messageId, threadTarget, accountConfig, cfg, accountId, roomId, client, logVerboseMessage } = params;
1989
- let draftDisposition = "active";
1990
1985
  const draftStreamingEnabled = streaming !== "off";
1991
1986
  const quietDraftStreaming = streaming === "quiet" || streaming === "progress";
1992
1987
  const progressDraftStreaming = streaming === "progress";
@@ -2012,6 +2007,7 @@ async function createMatrixDraftController(params) {
2012
2007
  const progressConfigEntry = accountConfig ?? cfg.channels?.matrix;
2013
2008
  const progressSeed = `${accountId}:${roomId}`;
2014
2009
  const progressDraft = createChannelProgressDraftCompositor({
2010
+ preparedItems: true,
2015
2011
  entry: progressConfigEntry,
2016
2012
  mode: streaming === "quiet" ? "partial" : streaming,
2017
2013
  active: Boolean(draftStream),
@@ -2026,10 +2022,25 @@ async function createMatrixDraftController(params) {
2026
2022
  },
2027
2023
  deleteCurrent: () => draftStream?.deleteCurrentMessage()
2028
2024
  });
2025
+ const previewLifecycle = createLivePreviewLifecycle({
2026
+ draft: draftStream ? {
2027
+ flush: draftStream.flush,
2028
+ id: draftStream.eventId,
2029
+ seal: draftStream.seal,
2030
+ discardPending: draftStream.discardPending,
2031
+ clear: draftStream.clear
2032
+ } : void 0,
2033
+ cleanupUndelivered: true,
2034
+ onFinalStarted: () => progressDraft.markFinalReplyStarted(),
2035
+ onFinalDelivered: () => progressDraft.markFinalReplyDelivered(),
2036
+ onCleanupFailure: (err) => logVerboseMessage(`matrix draft preview cleanup failed: ${String(err)}`)
2037
+ });
2029
2038
  const buildPreviewToolProgressReplyOptions = () => {
2030
2039
  if (!shouldSuppressDefaultToolProgressMessages) return {};
2031
2040
  return {
2032
2041
  suppressDefaultToolProgressMessages: true,
2042
+ progressPreambleEnabled: true,
2043
+ commentaryProgressEnabled: progressDraft.commentaryProgressEnabled,
2033
2044
  onToolStart: async (payload) => {
2034
2045
  return await progressDraft.pushToolEvent(payload);
2035
2046
  },
@@ -2045,12 +2056,6 @@ async function createMatrixDraftController(params) {
2045
2056
  },
2046
2057
  onApprovalEvent: async (payload) => {
2047
2058
  return await progressDraft.pushApprovalEvent(payload);
2048
- },
2049
- onCommandOutput: async (payload) => {
2050
- return await progressDraft.pushCommandOutputEvent(payload);
2051
- },
2052
- onPatchSummary: async (payload) => {
2053
- return await progressDraft.pushPatchEvent(payload);
2054
2059
  }
2055
2060
  };
2056
2061
  };
@@ -2090,7 +2095,7 @@ async function createMatrixDraftController(params) {
2090
2095
  const resetDraftDeliveryState = async () => {
2091
2096
  await draftStream?.discardPending();
2092
2097
  draftStream?.reset();
2093
- draftDisposition = "active";
2098
+ previewLifecycle.reset();
2094
2099
  currentDraftMessageGeneration = 0;
2095
2100
  currentDraftBlockOffset = 0;
2096
2101
  latestDraftFullText = "";
@@ -2101,6 +2106,7 @@ async function createMatrixDraftController(params) {
2101
2106
  };
2102
2107
  return {
2103
2108
  draftStream,
2109
+ previewLifecycle,
2104
2110
  cancelProgressDraft: () => progressDraft.cancel(),
2105
2111
  buildPreviewToolProgressReplyOptions,
2106
2112
  queueDraftBlockBoundary,
@@ -2109,16 +2115,9 @@ async function createMatrixDraftController(params) {
2109
2115
  beginAssistantMessage: () => progressDraft.beginAssistantMessage(),
2110
2116
  resetDraftDeliveryState,
2111
2117
  updateDraftFromLatestFullText,
2112
- draftDisposition: () => draftDisposition,
2113
2118
  beginDraftGeneration: () => {
2114
- draftDisposition = "active";
2115
- progressDraft.resetActivity();
2116
- },
2117
- markDraftConsumed: () => {
2118
- draftDisposition = "consumed";
2119
- },
2120
- markDraftRetained: () => {
2121
- draftDisposition = "retained";
2119
+ previewLifecycle.reset();
2120
+ progressDraft.beginNewTurn({ force: true });
2122
2121
  },
2123
2122
  currentReplyToId: () => currentDraftReplyToId,
2124
2123
  setCurrentReplyToId: (replyToId) => {
@@ -3146,6 +3145,8 @@ function joinMatrixVisibleContent(contents) {
3146
3145
  return contents.filter((content) => Boolean(content)).join("\n");
3147
3146
  }
3148
3147
  function mergeMatrixReplyDeliveryResults(results) {
3148
+ const single = results.length === 1 ? results[0] : void 0;
3149
+ if (single?.visibleReplySent) return single;
3149
3150
  const visibleResults = results.filter((result) => result.visibleReplySent);
3150
3151
  if (visibleResults.length === 0) return {
3151
3152
  visibleReplySent: false,
@@ -3275,7 +3276,7 @@ function createMatrixReplyDispatcher(config) {
3275
3276
  accountId,
3276
3277
  mediaLocalRoots
3277
3278
  });
3278
- let finalReplyDeliveryFailed = false;
3279
+ const { previewLifecycle } = draftController;
3279
3280
  let nonFinalReplyDeliveryFailed = false;
3280
3281
  const beginNextBlockDraft = () => {
3281
3282
  draftController.beginDraftGeneration();
@@ -3309,187 +3310,75 @@ function createMatrixReplyDispatcher(config) {
3309
3310
  content
3310
3311
  };
3311
3312
  };
3312
- const settleDraftReplacement = async (params) => {
3313
- const draftDelivery = createDraftDeliveryResult(params.draftEventId, params.draftContent);
3314
- let replacement;
3315
- try {
3316
- replacement = await params.deliver();
3317
- } catch (error) {
3318
- draftController.markDraftRetained();
3319
- throw toMatrixPartialDeliveryError(error, [draftDelivery]);
3320
- }
3321
- if (!replacement.visibleReplySent) {
3322
- draftController.markDraftRetained();
3323
- return draftDelivery;
3324
- }
3325
- if (!await redactMatrixDraftEvent(client, roomId, params.draftEventId)) {
3326
- draftController.markDraftRetained();
3327
- return mergeMatrixReplyDeliveryResults([draftDelivery, replacement]);
3328
- }
3329
- draftController.markDraftConsumed();
3330
- return replacement;
3331
- };
3332
- if (draftStream && info.kind !== "tool" && !payload.isCompactionNotice) {
3333
- const { hasMedia } = resolveSendableOutboundReplyParts(payload);
3334
- const ttsSupplement = getReplyPayloadTtsSupplement(payload);
3335
- const fallbackPayload = ttsSupplement && ttsSupplement.visibleTextAlreadyDelivered !== true && !payload.text?.trim() ? {
3336
- ...payload,
3337
- text: ttsSupplement.spokenText
3338
- } : payload;
3339
- if (draftController.draftDisposition() !== "active") {
3340
- await draftStream.discardPending();
3341
- return await completeDelivery(await deliverPayload(fallbackPayload));
3342
- }
3343
- const deliverFallback = async () => await deliverPayload(fallbackPayload);
3344
- const payloadReplyMismatch = (!threadTarget && replyToMode !== "off" || payload.replyToTag || payload.replyToCurrent) && normalizeOptionalString(payload.replyToId) !== draftController.currentReplyToId();
3345
- let mustDeliverFinalNormally = draftStream.mustDeliverFinalNormally();
3346
- if (Boolean(payload.text?.trim()) && !payload.isError && !payloadReplyMismatch && !mustDeliverFinalNormally) {
3347
- await draftStream.stop();
3348
- mustDeliverFinalNormally = draftStream.mustDeliverFinalNormally();
3349
- } else await draftStream.discardPending();
3350
- const draftEventId = draftStream.eventId();
3351
- const draftFinalTextNeedsNormalMentionDelivery = Boolean(draftEventId) && typeof payload.text === "string" && Boolean(payload.text.trim()) && !payload.isError && !payloadReplyMismatch && !mustDeliverFinalNormally && await matrixTextWouldActivateMentions(client, payload.text);
3352
- if (draftEventId && payload.text && !payload.isError && !hasMedia && !payloadReplyMismatch && !mustDeliverFinalNormally && !draftFinalTextNeedsNormalMentionDelivery) {
3353
- const finalPreviewText = payload.text;
3354
- const { prepareMatrixSingleText } = await loadMatrixSendModule();
3355
- const preparedFinalPreviewContent = prepareMatrixSingleText(finalPreviewText, {
3356
- cfg,
3357
- accountId,
3358
- preserveWhitespace: true
3359
- }).convertedText;
3360
- let finalizedDraftContent = draftStream.content() ?? preparedFinalPreviewContent;
3361
- let fallbackResult;
3362
- const previewResult = await deliverWithFinalizableLivePreviewAdapter({
3363
- kind: "final",
3364
- payload,
3365
- adapter: defineFinalizableLivePreviewAdapter({
3366
- draft: {
3367
- flush: async () => {},
3368
- clear: async () => {},
3369
- discardPending: async () => {},
3370
- id: () => draftEventId
3371
- },
3372
- buildFinalEdit: () => {
3373
- const presentationContent = resolveMatrixExtraContent(payload);
3374
- const extraContent = {
3375
- ...quietDraftStreaming ? buildMatrixFinalizedPreviewContent() : {},
3376
- ...presentationContent
3377
- };
3378
- return {
3379
- text: finalPreviewText,
3380
- finalizeLive: !(quietDraftStreaming || Boolean(presentationContent) || !draftStream.matchesPreparedText(finalPreviewText)),
3381
- ...Object.keys(extraContent).length > 0 ? { extraContent } : {}
3382
- };
3383
- },
3384
- editFinal: async (_draftEventId, edit) => {
3385
- if (edit.finalizeLive) {
3386
- if (!await draftStream.finalizeLive()) throw new Error("Matrix draft live finalize failed");
3387
- finalizedDraftContent = draftStream.content() ?? preparedFinalPreviewContent;
3388
- return;
3389
- }
3390
- const { editMessageMatrix } = await loadMatrixSendModule();
3391
- await editMessageMatrix(roomId, _draftEventId, edit.text, {
3392
- client,
3393
- cfg,
3394
- threadId: threadTarget,
3395
- accountId,
3396
- extraContent: edit.extraContent
3397
- });
3398
- finalizedDraftContent = prepareMatrixSingleText(edit.text, {
3399
- cfg,
3400
- accountId,
3401
- preserveWhitespace: true
3402
- }).convertedText;
3403
- },
3404
- createPreviewReceipt: createDraftReceipt,
3405
- logPreviewEditFailure: (err) => {
3406
- logVerboseMessage(`matrix: preview final edit failed: ${String(err)}`);
3407
- }
3408
- }),
3409
- deliverNormally: async () => {
3410
- fallbackResult = await settleDraftReplacement({
3411
- draftEventId,
3412
- draftContent: draftStream.content() ?? preparedFinalPreviewContent,
3413
- deliver: deliverFallback
3313
+ const settlesPreview = Boolean(draftStream) && info.kind !== "tool" && !payload.isCompactionNotice;
3314
+ const ttsSupplement = getReplyPayloadTtsSupplement(payload);
3315
+ const fallbackPayload = settlesPreview && ttsSupplement && ttsSupplement.visibleTextAlreadyDelivered !== true && !payload.text?.trim() ? {
3316
+ ...payload,
3317
+ text: ttsSupplement.spokenText
3318
+ } : payload;
3319
+ const { hasMedia } = resolveSendableOutboundReplyParts(payload);
3320
+ const payloadText = payload.text ?? ttsSupplement?.spokenText;
3321
+ const payloadReplyMismatch = (!threadTarget && replyToMode !== "off" || payload.replyToTag || payload.replyToCurrent) && normalizeOptionalString(payload.replyToId) !== draftController.currentReplyToId();
3322
+ let retainedDraftDelivery;
3323
+ let deliveryResult;
3324
+ try {
3325
+ deliveryResult = (await previewLifecycle.deliver({
3326
+ kind: payload.isCompactionNotice ? "tool" : info.kind === "block" ? "final" : info.kind,
3327
+ payload,
3328
+ isError: payload.isError,
3329
+ adapter: draftStream ? {
3330
+ buildFinalEdit: () => payloadText?.trim() && !payload.isError && !payloadReplyMismatch && !draftStream.mustDeliverFinalNormally() ? { text: payloadText } : void 0,
3331
+ editFinal: async (draftEventId, edit) => {
3332
+ if (draftStream.mustDeliverFinalNormally() || await matrixTextWouldActivateMentions(client, edit.text)) return { visibleReplySent: false };
3333
+ const { editMessageMatrix, prepareMatrixSingleText } = await loadMatrixSendModule();
3334
+ const presentationContent = hasMedia ? void 0 : resolveMatrixExtraContent(payload);
3335
+ const extraContent = {
3336
+ ...quietDraftStreaming ? buildMatrixFinalizedPreviewContent() : {},
3337
+ ...presentationContent
3338
+ };
3339
+ if (!quietDraftStreaming && !presentationContent && draftStream.matchesPreparedText(edit.text)) {
3340
+ if (!await draftStream.finalizeLive()) return { visibleReplySent: false };
3341
+ } else await editMessageMatrix(roomId, draftEventId, edit.text, {
3342
+ client,
3343
+ cfg,
3344
+ threadId: threadTarget,
3345
+ accountId,
3346
+ ...Object.keys(extraContent).length > 0 ? { extraContent } : {}
3414
3347
  });
3415
- return fallbackResult.visibleReplySent;
3416
- }
3417
- });
3418
- if (previewResult.kind === "preview-finalized") draftController.markDraftConsumed();
3419
- return await completeDelivery(previewResult.kind === "preview-finalized" && previewResult.liveState?.receipt ? createDraftDeliveryResult(draftEventId, finalizedDraftContent ?? preparedFinalPreviewContent) : fallbackResult ?? mergeMatrixReplyDeliveryResults([]));
3420
- } else if (draftEventId && hasMedia && !payloadReplyMismatch) {
3421
- let textEditOk = !mustDeliverFinalNormally;
3422
- const payloadText = payload.text ?? ttsSupplement?.spokenText;
3423
- const preparedPayloadContent = typeof payloadText === "string" ? (await loadMatrixSendModule()).prepareMatrixSingleText(payloadText, {
3424
- cfg,
3425
- accountId,
3426
- preserveWhitespace: true
3427
- }).convertedText : void 0;
3428
- let finalizedDraftContent = draftStream.content() ?? preparedPayloadContent;
3429
- const payloadTextMatchesDraft = typeof payloadText === "string" && draftStream.matchesPreparedText(payloadText);
3430
- const reusesDraftTextUnchanged = typeof payloadText === "string" && Boolean(payloadText.trim()) && payloadTextMatchesDraft;
3431
- const mediaTextNeedsNormalMentionDelivery = typeof payloadText === "string" && Boolean(payloadText.trim()) && await matrixTextWouldActivateMentions(client, payloadText);
3432
- const requiresFinalTextEdit = quietDraftStreaming || typeof payloadText === "string" && !payloadTextMatchesDraft;
3433
- if (textEditOk && mediaTextNeedsNormalMentionDelivery) textEditOk = false;
3434
- else if (textEditOk && payloadText && requiresFinalTextEdit) {
3435
- const { editMessageMatrix, prepareMatrixSingleText } = await loadMatrixSendModule();
3436
- textEditOk = await editMessageMatrix(roomId, draftEventId, payloadText, {
3437
- client,
3438
- cfg,
3439
- threadId: threadTarget,
3440
- accountId,
3441
- extraContent: quietDraftStreaming ? buildMatrixFinalizedPreviewContent() : void 0
3442
- }).then(() => {
3443
- finalizedDraftContent = prepareMatrixSingleText(payloadText, {
3348
+ return createDraftDeliveryResult(draftEventId, prepareMatrixSingleText(edit.text, {
3444
3349
  cfg,
3445
3350
  accountId,
3446
3351
  preserveWhitespace: true
3447
- }).convertedText;
3448
- return true;
3449
- }, () => false);
3450
- } else if (textEditOk && reusesDraftTextUnchanged) {
3451
- textEditOk = await draftStream.finalizeLive();
3452
- finalizedDraftContent = draftStream.content();
3453
- }
3454
- const reusesDraftAsFinalText = Boolean(payloadText?.trim()) && textEditOk;
3455
- const draftContent = draftStream.content();
3456
- const mediaPayload = ttsSupplement && reusesDraftAsFinalText ? buildTtsSupplementMediaPayload(payload) : {
3457
- ...payload,
3458
- text: reusesDraftAsFinalText ? void 0 : payload.text ?? (ttsSupplement?.visibleTextAlreadyDelivered === true ? void 0 : ttsSupplement?.spokenText)
3459
- };
3460
- const providerDraftContent = finalizedDraftContent ?? preparedPayloadContent;
3461
- const previewDelivery = reusesDraftAsFinalText && providerDraftContent ? createDraftDeliveryResult(draftEventId, providerDraftContent) : draftContent ? createDraftDeliveryResult(draftEventId, draftContent) : mergeMatrixReplyDeliveryResults([]);
3462
- const deliverMedia = async () => await deliverPayload(mediaPayload);
3463
- if (reusesDraftAsFinalText) {
3464
- draftController.markDraftConsumed();
3465
- let mediaDelivery;
3466
- try {
3467
- mediaDelivery = await deliverMedia();
3468
- } catch (error) {
3469
- throw toMatrixPartialDeliveryError(error, [previewDelivery]);
3352
+ }).convertedText);
3353
+ },
3354
+ createPreviewReceipt: createDraftReceipt,
3355
+ buildSupplementalPayload: () => hasMedia ? ttsSupplement ? buildTtsSupplementMediaPayload(payload) : {
3356
+ ...payload,
3357
+ text: void 0
3358
+ } : void 0,
3359
+ deliverSupplemental: deliverPayload,
3360
+ logPreviewEditFailure: (err) => {
3361
+ logVerboseMessage(`matrix: preview final edit failed: ${String(err)}`);
3470
3362
  }
3471
- return await completeDelivery(mergeMatrixReplyDeliveryResults([previewDelivery, mediaDelivery]));
3363
+ } : void 0,
3364
+ deliverNormally: async (normalPayload) => {
3365
+ if (settlesPreview && !previewLifecycle.previewFinalized && (hasMedia || payloadText?.trim() || payload.isError || payloadReplyMismatch || draftStream?.mustDeliverFinalNormally())) {
3366
+ const id = draftStream?.eventId();
3367
+ const content = draftStream?.content();
3368
+ if (id && content) retainedDraftDelivery = createDraftDeliveryResult(id, content);
3369
+ }
3370
+ return await deliverPayload(normalPayload === payload ? fallbackPayload : normalPayload);
3472
3371
  }
3473
- if (draftContent) return await completeDelivery(await settleDraftReplacement({
3474
- draftEventId,
3475
- draftContent,
3476
- deliver: deliverMedia
3477
- }));
3478
- return await completeDelivery(await deliverMedia());
3479
- }
3480
- const shouldRedactDraft = Boolean(draftEventId) && (payload.isError || payloadReplyMismatch || mustDeliverFinalNormally || draftFinalTextNeedsNormalMentionDelivery);
3481
- const draftContent = draftStream.content();
3482
- if (shouldRedactDraft && draftEventId && draftContent) return await completeDelivery(await settleDraftReplacement({
3483
- draftEventId,
3484
- draftContent,
3485
- deliver: deliverFallback
3486
- }));
3487
- return await completeDelivery(await deliverFallback());
3372
+ })).deliveryResult;
3373
+ } catch (error) {
3374
+ if (retainedDraftDelivery) previewLifecycle.retainPreview();
3375
+ throw toMatrixPartialDeliveryError(error, retainedDraftDelivery ? [retainedDraftDelivery] : []);
3488
3376
  }
3489
- return await completeDelivery(await deliverPayload(payload));
3377
+ if (retainedDraftDelivery && !deliveryResult?.visibleReplySent) previewLifecycle.retainPreview();
3378
+ return await completeDelivery(mergeMatrixReplyDeliveryResults([retainedDraftDelivery?.messageIds?.includes(draftStream?.eventId() ?? "") ? retainedDraftDelivery : void 0, deliveryResult].filter((result) => result !== void 0)));
3490
3379
  },
3491
3380
  onError: (err, info) => {
3492
- if (info.kind === "final") finalReplyDeliveryFailed = true;
3381
+ if (info.kind === "final") previewLifecycle.observeFailure();
3493
3382
  else nonFinalReplyDeliveryFailed = true;
3494
3383
  if (info.kind === "block") beginNextBlockDraft();
3495
3384
  runtime.error?.(`matrix ${info.kind} reply failed: ${String(err)}`);
@@ -3501,7 +3390,6 @@ function createMatrixReplyDispatcher(config) {
3501
3390
  deliverReply,
3502
3391
  onReplyError,
3503
3392
  turnDispatcherOptions,
3504
- finalReplyDeliveryFailed: () => finalReplyDeliveryFailed,
3505
3393
  nonFinalReplyDeliveryFailed: () => nonFinalReplyDeliveryFailed
3506
3394
  };
3507
3395
  }
@@ -3932,6 +3820,7 @@ function createMatrixRoomMessageHandler(params) {
3932
3820
  } : void 0,
3933
3821
  onQueuedFollowupAdmitted: draftStream ? draftController.resetDraftDeliveryState : void 0,
3934
3822
  ...draftController.buildPreviewToolProgressReplyOptions(),
3823
+ onObservedReplyDelivery: draftStream ? () => draftController.previewLifecycle.observeDelivery({ visibleReplySent: true }) : void 0,
3935
3824
  onModelSelected
3936
3825
  }
3937
3826
  })
@@ -3968,7 +3857,7 @@ function createMatrixRoomMessageHandler(params) {
3968
3857
  }
3969
3858
  const { dispatchResult } = turnResult;
3970
3859
  const { queuedFinal } = dispatchResult;
3971
- if (replyDispatcher.finalReplyDeliveryFailed()) {
3860
+ if (draftController.previewLifecycle.finalFailed) {
3972
3861
  logVerboseMessage(`matrix: final reply delivery failed room=${roomId} id=${messageId}; keeping replay committed`);
3973
3862
  await commitInboundEventIfClaimed();
3974
3863
  return;
@@ -3988,13 +3877,14 @@ function createMatrixRoomMessageHandler(params) {
3988
3877
  await commitInboundEventIfClaimed();
3989
3878
  } catch (err) {
3990
3879
  const draftController = draftControllerRef;
3991
- if (draftController?.draftStream?.eventId() && draftController.draftDisposition() === "active") draftController.markDraftRetained();
3880
+ if (draftController?.draftStream?.eventId()) draftController.previewLifecycle.retainPreview();
3992
3881
  runtime.error?.(`matrix handler failed: ${String(err)}`);
3993
3882
  } finally {
3994
3883
  const draftStream = draftControllerRef?.draftStream;
3995
3884
  if (draftStream) {
3996
- const draftEventId = await draftStream.stop().catch(() => void 0);
3997
- if (draftEventId && draftControllerRef?.draftDisposition() === "active") await redactMatrixDraftEvent(client, roomId, draftEventId);
3885
+ await draftStream.stop().catch(() => void 0);
3886
+ await draftControllerRef?.previewLifecycle.cleanup();
3887
+ await draftStream.cleanupPending();
3998
3888
  }
3999
3889
  inboundReplayClaim?.release();
4000
3890
  }
@@ -4018,7 +3908,7 @@ const loadMatrixStartupMaintenanceDeps = createLazyRuntimeModule(() => Promise.a
4018
3908
  import("./config-update-B_4qZ5bV.mjs").then((n) => n.t),
4019
3909
  import("./device-health-CWOuIirq.mjs").then((n) => n.t),
4020
3910
  import("./profile-ClrB3IgR.mjs").then((n) => n.n),
4021
- import("./startup-verification-Bq5qeEGn.mjs")
3911
+ import("./startup-verification-Cp1Gf7pM.mjs")
4022
3912
  ]).then(([configUpdateModule, deviceHealthModule, profileModule, startupVerificationModule]) => ({
4023
3913
  updateMatrixAccountConfig: configUpdateModule.updateMatrixAccountConfig,
4024
3914
  summarizeMatrixDeviceHealth: deviceHealthModule.summarizeMatrixDeviceHealth,
@@ -4291,10 +4181,6 @@ async function monitorMatrixProvider(opts = {}) {
4291
4181
  let needsRoomAliasesForConfig = false;
4292
4182
  const initialAllowFrom = (accountConfig.dm?.allowFrom ?? []).map(String);
4293
4183
  const initialGroupAllowFrom = (accountConfig.groupAllowFrom ?? []).map(String);
4294
- const configuredBotUserIds = resolveConfiguredMatrixBotUserIds({
4295
- cfg,
4296
- accountId: effectiveAccountId
4297
- });
4298
4184
  const { allowFrom, allowFromResolvedEntries, groupAllowFrom, groupAllowFromResolvedEntries, roomsConfig: resolvedRoomsConfig } = await resolveMatrixMonitorConfig({
4299
4185
  cfg,
4300
4186
  accountId: effectiveAccountId,
@@ -4324,6 +4210,13 @@ async function monitorMatrixProvider(opts = {}) {
4324
4210
  cfg,
4325
4211
  accountId: effectiveAccountId
4326
4212
  });
4213
+ if (opts.abortSignal?.aborted) return;
4214
+ const configuredBotUserIds = await resolveConfiguredMatrixBotUserIds({
4215
+ cfg,
4216
+ accountId: effectiveAccountId,
4217
+ abortSignal: opts.abortSignal
4218
+ });
4219
+ if (opts.abortSignal?.aborted) return;
4327
4220
  const resolvedInitialSyncLimit = resolveOptionalIntegerOption(opts.initialSyncLimit, { min: 0 }) ?? auth.initialSyncLimit;
4328
4221
  const authWithLimit = resolvedInitialSyncLimit === auth.initialSyncLimit ? auth : {
4329
4222
  ...auth,
@@ -4393,7 +4286,7 @@ async function monitorMatrixProvider(opts = {}) {
4393
4286
  const dmPolicy = allowlistOnly && dmPolicyRaw !== "disabled" ? "allowlist" : dmPolicyRaw;
4394
4287
  const dmSessionScope = dmConfig?.sessionScope ?? "per-user";
4395
4288
  const globalGroupChatHistoryLimit = cfg.messages?.groupChat?.historyLimit;
4396
- const historyLimit = Math.max(0, accountConfig.historyLimit ?? globalGroupChatHistoryLimit ?? 0);
4289
+ const historyLimit = resolvePromptHistoryLimit(accountConfig.historyLimit ?? globalGroupChatHistoryLimit, 0);
4397
4290
  const mediaMaxMb = opts.mediaMaxMb ?? accountConfig.mediaMaxMb ?? DEFAULT_MEDIA_MAX_MB;
4398
4291
  const mediaMaxBytes = Math.max(1, mediaMaxMb) * 1024 * 1024;
4399
4292
  const streaming = resolveMatrixStreamingMode(accountConfig.streaming);
@@ -4585,12 +4478,13 @@ async function monitorMatrixProvider(opts = {}) {
4585
4478
  }
4586
4479
  logVerboseMessage("matrix: client started");
4587
4480
  logger.info(`matrix: logged in as ${auth.userId}`);
4588
- backfillMatrixAuthDeviceIdAfterStartup({
4589
- auth,
4590
- env: process.env,
4591
- abortSignal: monitorLifecycleSignal
4592
- }).catch((err) => {
4593
- logVerboseMessage(`matrix: failed to backfill deviceId after startup (${String(err)})`);
4481
+ monitorTaskRunner.runDetachedTask("deviceId backfill", async () => {
4482
+ const taskSignal = getMatrixMonitorTaskSignal();
4483
+ await backfillMatrixAuthDeviceIdAfterStartup({
4484
+ auth,
4485
+ env: process.env,
4486
+ abortSignal: taskSignal && monitorLifecycleSignal ? AbortSignal.any([taskSignal, monitorLifecycleSignal]) : taskSignal ?? monitorLifecycleSignal
4487
+ });
4594
4488
  });
4595
4489
  registerChannelRuntimeContext({
4596
4490
  channelRuntime: opts.channelRuntime,
@@ -1,4 +1,4 @@
1
- import { i as sendPollMatrix, r as sendMessageMatrix } from "./send-h0gZ_-qk.mjs";
1
+ import { i as sendPollMatrix, r as sendMessageMatrix } from "./send-aVdC5NJO.mjs";
2
2
  import { createMessageReceiptFromOutboundResults, createReplyToFanout, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
3
3
  import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
@@ -0,0 +1,2 @@
1
+ import { n as createMatrixClient } from "./client-ChrXpxos.mjs";
2
+ export { createMatrixClient };
@@ -1,7 +1,7 @@
1
1
  import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
2
2
  import { n as resolveMatrixConfigPath, r as updateMatrixAccountConfig } from "./config-update-B_4qZ5bV.mjs";
3
3
  import { r as syncMatrixOwnProfile } from "./profile-ClrB3IgR.mjs";
4
- import { n as withResolvedActionClient } from "./client-By2B3Wz4.mjs";
4
+ import { n as withResolvedActionClient } from "./client-C2yVkVdw.mjs";
5
5
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
6
6
  //#region extensions/matrix/src/matrix/actions/profile.ts
7
7
  async function updateMatrixOwnProfile(opts = {}) {
@@ -1,5 +1,5 @@
1
1
  import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
2
- import { i as resolveMatrixThreadRouting, r as resolveMatrixInboundRoute } from "./channel-q6TBKEiG.mjs";
2
+ import { i as resolveMatrixThreadRouting, r as resolveMatrixInboundRoute } from "./channel-ConuJfxT.mjs";
3
3
  import { c as extractMatrixReactionAnnotation } from "./send-currentness-BrGXL7b8.mjs";
4
4
  import { p as resolveMatrixThreadRootId } from "./direct-management-B2Bno2xL.mjs";
5
5
  import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-B0hfA6qz.mjs";
@@ -8,9 +8,9 @@ import { isApprovalNotFoundError } from "openclaw/plugin-sdk/error-runtime";
8
8
  import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
9
9
  import { getSessionBindingService } from "openclaw/plugin-sdk/session-binding-runtime";
10
10
  //#region extensions/matrix/src/matrix/monitor/reaction-events.ts
11
- const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./approval-reaction-auth-B51E4ZDa.mjs"));
11
+ const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./approval-reaction-auth-DMVE7VSp.mjs"));
12
12
  const loadExecApprovalResolver = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/approval-gateway-runtime"));
13
- const loadMatrixSend = createLazyRuntimeModule(() => import("./send-h0gZ_-qk.mjs").then((n) => n.s));
13
+ const loadMatrixSend = createLazyRuntimeModule(() => import("./send-aVdC5NJO.mjs").then((n) => n.s));
14
14
  function buildMatrixApprovalTerminalText(result) {
15
15
  const approval = result.approval;
16
16
  const terminalLabel = approval.status === "allowed" ? approval.decision === "allow-always" ? "Allowed always" : "Allowed once" : approval.status === "denied" ? "Denied" : approval.status === "expired" ? "Expired" : "Cancelled";
@@ -159,6 +159,7 @@ async function handleInboundMatrixReaction(params) {
159
159
  const text = `Matrix reaction added: ${reaction.key} by ${params.senderLabel} on msg ${reaction.eventId}`;
160
160
  params.core.system.enqueueSystemEvent(text, {
161
161
  sessionKey: route.sessionKey,
162
+ agentId: route.agentId,
162
163
  contextKey: `matrix:reaction:add:${params.roomId}:${reaction.eventId}:${params.senderId}:${reaction.key}`
163
164
  });
164
165
  params.logVerboseMessage(`matrix: reaction event enqueued room=${params.roomId} target=${reaction.eventId} sender=${params.senderId} emoji=${reaction.key}`);
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
2
2
  import { r as normalizeMatrixMessagingTarget, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.mjs";
3
- import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-CatwztQc.mjs";
3
+ import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-CxqkcYbT.mjs";
4
4
  import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  //#region extensions/matrix/src/resolve-targets.ts
6
6
  var resolve_targets_exports = /* @__PURE__ */ __exportAll({ resolveMatrixTargets: () => resolveMatrixTargets });
@@ -1,4 +1,4 @@
1
- import { t as resolveMatrixTargets } from "./resolve-targets-drjgAdIe.mjs";
1
+ import { t as resolveMatrixTargets } from "./resolve-targets-BLz748lX.mjs";
2
2
  //#region extensions/matrix/src/resolver.runtime.ts
3
3
  const matrixResolverRuntime = { resolveMatrixTargets };
4
4
  //#endregion