@openclaw/mattermost 2026.9.3 → 2026.9.5

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 (532) hide show
  1. package/assets/activity.svg +40 -0
  2. package/assets/icon.png +0 -0
  3. package/dist/.setup/channel-plugin-api-CKz3b0dp.mjs +40 -0
  4. package/dist/.setup/channel-plugin-api-N-mnrhds.mjs +3 -0
  5. package/dist/{channel-plugin-runtime-C4u91PKh.js → .setup/channel-plugin-runtime-Ca4cZHq2.mjs} +15 -30
  6. package/dist/{channel.runtime-CGEfnc2y.js → .setup/channel.runtime-C074p7wv.mjs} +377 -115
  7. package/dist/{client-Dt7Q-j5B.js → .setup/client-Cx71KZ1x.mjs} +27 -15
  8. package/dist/{interactions-DF1FH27_.js → .setup/interactions-BG-CQbVD.mjs} +3 -3
  9. package/dist/{monitor-auth-C6RGYyn-.js → .setup/monitor-auth-DBoM2Bja.mjs} +16 -3
  10. package/dist/{normalize-R-ATEEHC.js → .setup/normalize-BQzx2u8S.mjs} +47 -7
  11. package/dist/.setup/secret-contract-api-Drab0Nqx.mjs +3 -0
  12. package/dist/{slash-state-BjBTvP7u.js → .setup/slash-state-CmyIYDIc.mjs} +59 -15
  13. package/dist/api.js +2 -2
  14. package/dist/channel-plugin-api.js +2 -39
  15. package/dist/channel-plugin-runtime.js +1 -1
  16. package/dist/doctor-contract-api.js +1 -1
  17. package/dist/gateway-auth-api.js +1 -1
  18. package/dist/policy-api.js +1 -1
  19. package/dist/runtime-api.js +1 -1
  20. package/dist/secret-contract-api.js +1 -1
  21. package/dist/setup-entry.js +3 -2
  22. package/dist/slash-route-api.js +1 -1
  23. package/node_modules/zod/README.md +27 -0
  24. package/node_modules/zod/compile.cjs +77 -0
  25. package/node_modules/zod/compile.d.cts +1 -0
  26. package/node_modules/zod/compile.d.ts +1 -0
  27. package/node_modules/zod/compile.js +52 -0
  28. package/node_modules/zod/index.cjs +2 -2
  29. package/node_modules/zod/index.d.cts +1 -2
  30. package/node_modules/zod/index.d.ts +1 -2
  31. package/node_modules/zod/index.js +5 -2
  32. package/node_modules/zod/package.json +13 -2
  33. package/node_modules/zod/src/compile.ts +56 -0
  34. package/node_modules/zod/src/index.ts +5 -2
  35. package/node_modules/zod/src/v3/ZodError.ts +22 -12
  36. package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
  37. package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
  38. package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
  39. package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
  40. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
  41. package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
  42. package/node_modules/zod/src/v3/types.ts +5 -5
  43. package/node_modules/zod/src/v4/classic/checks.ts +1 -0
  44. package/node_modules/zod/src/v4/classic/compat.ts +26 -18
  45. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  46. package/node_modules/zod/src/v4/classic/errors.ts +59 -44
  47. package/node_modules/zod/src/v4/classic/external.ts +12 -9
  48. package/node_modules/zod/src/v4/classic/from-json-schema.ts +140 -78
  49. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  50. package/node_modules/zod/src/v4/classic/index.ts +2 -2
  51. package/node_modules/zod/src/v4/classic/iso.ts +2 -72
  52. package/node_modules/zod/src/v4/classic/parse.ts +10 -4
  53. package/node_modules/zod/src/v4/classic/schemas.ts +452 -262
  54. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
  55. package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
  56. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +135 -0
  57. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +30 -1
  58. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
  59. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
  60. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
  61. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
  62. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  63. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +720 -0
  64. package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
  65. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
  66. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  67. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  68. package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
  69. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
  70. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +155 -13
  71. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +11 -0
  72. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
  73. package/node_modules/zod/src/v4/classic/tests/error.test.ts +274 -6
  74. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +425 -10
  75. package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
  76. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
  77. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
  78. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  79. package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
  80. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +281 -0
  81. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +47 -0
  82. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
  83. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +183 -0
  84. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
  85. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
  86. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
  87. package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
  88. package/node_modules/zod/src/v4/classic/tests/number.test.ts +46 -9
  89. package/node_modules/zod/src/v4/classic/tests/object.test.ts +245 -12
  90. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +234 -0
  91. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
  92. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
  93. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
  94. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
  95. package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
  96. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +33 -2
  97. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  98. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
  99. package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
  100. package/node_modules/zod/src/v4/classic/tests/string.test.ts +127 -5
  101. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
  102. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +11 -2
  103. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1585 -173
  104. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
  105. package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
  106. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +76 -0
  107. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
  108. package/node_modules/zod/src/v4/core/api.ts +48 -12
  109. package/node_modules/zod/src/v4/core/checks.ts +57 -44
  110. package/node_modules/zod/src/v4/core/compile.ts +2188 -0
  111. package/node_modules/zod/src/v4/core/core.ts +98 -19
  112. package/node_modules/zod/src/v4/core/doc.ts +11 -7
  113. package/node_modules/zod/src/v4/core/errors.ts +115 -24
  114. package/node_modules/zod/src/v4/core/index.ts +3 -0
  115. package/node_modules/zod/src/v4/core/json-schema-generator.ts +6 -1
  116. package/node_modules/zod/src/v4/core/json-schema-processors.ts +257 -93
  117. package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
  118. package/node_modules/zod/src/v4/core/memoizer.ts +284 -0
  119. package/node_modules/zod/src/v4/core/parse.ts +131 -38
  120. package/node_modules/zod/src/v4/core/regexes.ts +30 -13
  121. package/node_modules/zod/src/v4/core/registries.ts +2 -2
  122. package/node_modules/zod/src/v4/core/schemas.ts +759 -461
  123. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +969 -0
  124. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  125. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  126. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  127. package/node_modules/zod/src/v4/core/tests/compile.test.ts +1639 -0
  128. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
  129. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
  130. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
  131. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  132. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  133. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  134. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +31 -0
  135. package/node_modules/zod/src/v4/core/to-json-schema.ts +275 -42
  136. package/node_modules/zod/src/v4/core/util.ts +268 -42
  137. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  138. package/node_modules/zod/src/v4/core/visit.ts +193 -0
  139. package/node_modules/zod/src/v4/index.ts +3 -3
  140. package/node_modules/zod/src/v4/locales/ar.ts +3 -0
  141. package/node_modules/zod/src/v4/locales/az.ts +3 -0
  142. package/node_modules/zod/src/v4/locales/be.ts +10 -0
  143. package/node_modules/zod/src/v4/locales/bg.ts +3 -0
  144. package/node_modules/zod/src/v4/locales/bn.ts +121 -0
  145. package/node_modules/zod/src/v4/locales/ca.ts +3 -0
  146. package/node_modules/zod/src/v4/locales/ckb.ts +138 -0
  147. package/node_modules/zod/src/v4/locales/cs.ts +3 -0
  148. package/node_modules/zod/src/v4/locales/da.ts +5 -2
  149. package/node_modules/zod/src/v4/locales/de.ts +3 -0
  150. package/node_modules/zod/src/v4/locales/el.ts +1 -0
  151. package/node_modules/zod/src/v4/locales/en.ts +15 -4
  152. package/node_modules/zod/src/v4/locales/eo.ts +3 -0
  153. package/node_modules/zod/src/v4/locales/es.ts +2 -0
  154. package/node_modules/zod/src/v4/locales/fa.ts +3 -0
  155. package/node_modules/zod/src/v4/locales/fi.ts +3 -0
  156. package/node_modules/zod/src/v4/locales/fr-CA.ts +3 -0
  157. package/node_modules/zod/src/v4/locales/fr.ts +19 -14
  158. package/node_modules/zod/src/v4/locales/gu.ts +121 -0
  159. package/node_modules/zod/src/v4/locales/he.ts +6 -1
  160. package/node_modules/zod/src/v4/locales/hi.ts +124 -0
  161. package/node_modules/zod/src/v4/locales/hr.ts +2 -0
  162. package/node_modules/zod/src/v4/locales/hu.ts +3 -0
  163. package/node_modules/zod/src/v4/locales/hy.ts +9 -0
  164. package/node_modules/zod/src/v4/locales/id.ts +3 -0
  165. package/node_modules/zod/src/v4/locales/index.ts +10 -0
  166. package/node_modules/zod/src/v4/locales/is.ts +3 -0
  167. package/node_modules/zod/src/v4/locales/it.ts +3 -0
  168. package/node_modules/zod/src/v4/locales/ja.ts +3 -0
  169. package/node_modules/zod/src/v4/locales/ka.ts +3 -0
  170. package/node_modules/zod/src/v4/locales/km.ts +3 -0
  171. package/node_modules/zod/src/v4/locales/kn.ts +124 -0
  172. package/node_modules/zod/src/v4/locales/ko.ts +3 -0
  173. package/node_modules/zod/src/v4/locales/lt.ts +2 -0
  174. package/node_modules/zod/src/v4/locales/mk.ts +3 -0
  175. package/node_modules/zod/src/v4/locales/ms.ts +3 -0
  176. package/node_modules/zod/src/v4/locales/ne.ts +126 -0
  177. package/node_modules/zod/src/v4/locales/nl.ts +3 -0
  178. package/node_modules/zod/src/v4/locales/nn.ts +119 -0
  179. package/node_modules/zod/src/v4/locales/no.ts +5 -2
  180. package/node_modules/zod/src/v4/locales/ota.ts +3 -0
  181. package/node_modules/zod/src/v4/locales/pl.ts +3 -0
  182. package/node_modules/zod/src/v4/locales/ps.ts +3 -0
  183. package/node_modules/zod/src/v4/locales/pt-BR.ts +159 -0
  184. package/node_modules/zod/src/v4/locales/pt.ts +99 -58
  185. package/node_modules/zod/src/v4/locales/ro.ts +1 -0
  186. package/node_modules/zod/src/v4/locales/ru.ts +10 -0
  187. package/node_modules/zod/src/v4/locales/sk.ts +121 -0
  188. package/node_modules/zod/src/v4/locales/sl.ts +3 -0
  189. package/node_modules/zod/src/v4/locales/sv.ts +5 -2
  190. package/node_modules/zod/src/v4/locales/ta.ts +3 -0
  191. package/node_modules/zod/src/v4/locales/th.ts +3 -0
  192. package/node_modules/zod/src/v4/locales/tk.ts +111 -0
  193. package/node_modules/zod/src/v4/locales/tr.ts +3 -0
  194. package/node_modules/zod/src/v4/locales/uk.ts +3 -0
  195. package/node_modules/zod/src/v4/locales/ur.ts +3 -0
  196. package/node_modules/zod/src/v4/locales/uz.ts +1 -0
  197. package/node_modules/zod/src/v4/locales/vi.ts +3 -0
  198. package/node_modules/zod/src/v4/locales/yo.ts +3 -0
  199. package/node_modules/zod/src/v4/locales/zh-CN.ts +3 -0
  200. package/node_modules/zod/src/v4/locales/zh-TW.ts +3 -0
  201. package/node_modules/zod/src/v4/mini/checks.ts +1 -0
  202. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  203. package/node_modules/zod/src/v4/mini/external.ts +10 -1
  204. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  205. package/node_modules/zod/src/v4/mini/parse.ts +2 -0
  206. package/node_modules/zod/src/v4/mini/schemas.ts +135 -56
  207. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
  208. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
  209. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
  210. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
  211. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  212. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  213. package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
  214. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
  215. package/node_modules/zod/src/v4/mini/tests/index.test.ts +72 -5
  216. package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
  217. package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
  218. package/node_modules/zod/src/v4/mini/tests/string.test.ts +21 -0
  219. package/node_modules/zod/v3/ZodError.cjs +22 -12
  220. package/node_modules/zod/v3/ZodError.d.cts +1 -1
  221. package/node_modules/zod/v3/ZodError.d.ts +1 -1
  222. package/node_modules/zod/v3/ZodError.js +22 -12
  223. package/node_modules/zod/v3/types.cjs +7 -5
  224. package/node_modules/zod/v3/types.js +7 -5
  225. package/node_modules/zod/v4/classic/checks.cjs +2 -1
  226. package/node_modules/zod/v4/classic/checks.d.cts +1 -1
  227. package/node_modules/zod/v4/classic/checks.d.ts +1 -1
  228. package/node_modules/zod/v4/classic/checks.js +1 -1
  229. package/node_modules/zod/v4/classic/compat.d.cts +9 -11
  230. package/node_modules/zod/v4/classic/compat.d.ts +9 -11
  231. package/node_modules/zod/v4/classic/deep-partial.cjs +39 -0
  232. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  233. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  234. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  235. package/node_modules/zod/v4/classic/errors.cjs +43 -34
  236. package/node_modules/zod/v4/classic/errors.d.cts +3 -4
  237. package/node_modules/zod/v4/classic/errors.d.ts +3 -4
  238. package/node_modules/zod/v4/classic/errors.js +43 -34
  239. package/node_modules/zod/v4/classic/external.cjs +30 -27
  240. package/node_modules/zod/v4/classic/external.d.cts +5 -2
  241. package/node_modules/zod/v4/classic/external.d.ts +5 -2
  242. package/node_modules/zod/v4/classic/external.js +5 -8
  243. package/node_modules/zod/v4/classic/from-json-schema.cjs +136 -75
  244. package/node_modules/zod/v4/classic/from-json-schema.js +136 -75
  245. package/node_modules/zod/v4/classic/in-out.cjs +63 -0
  246. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  247. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  248. package/node_modules/zod/v4/classic/in-out.js +36 -0
  249. package/node_modules/zod/v4/classic/index.cjs +2 -2
  250. package/node_modules/zod/v4/classic/index.d.cts +1 -2
  251. package/node_modules/zod/v4/classic/index.d.ts +1 -2
  252. package/node_modules/zod/v4/classic/index.js +2 -2
  253. package/node_modules/zod/v4/classic/iso.cjs +11 -22
  254. package/node_modules/zod/v4/classic/iso.d.cts +2 -17
  255. package/node_modules/zod/v4/classic/iso.d.ts +2 -17
  256. package/node_modules/zod/v4/classic/iso.js +2 -17
  257. package/node_modules/zod/v4/classic/parse.cjs +4 -1
  258. package/node_modules/zod/v4/classic/parse.d.cts +17 -4
  259. package/node_modules/zod/v4/classic/parse.d.ts +17 -4
  260. package/node_modules/zod/v4/classic/parse.js +1 -0
  261. package/node_modules/zod/v4/classic/schemas.cjs +498 -398
  262. package/node_modules/zod/v4/classic/schemas.d.cts +53 -18
  263. package/node_modules/zod/v4/classic/schemas.d.ts +53 -18
  264. package/node_modules/zod/v4/classic/schemas.js +492 -396
  265. package/node_modules/zod/v4/core/api.cjs +23 -4
  266. package/node_modules/zod/v4/core/api.d.cts +13 -9
  267. package/node_modules/zod/v4/core/api.d.ts +13 -9
  268. package/node_modules/zod/v4/core/api.js +21 -4
  269. package/node_modules/zod/v4/core/checks.cjs +37 -31
  270. package/node_modules/zod/v4/core/checks.d.cts +13 -13
  271. package/node_modules/zod/v4/core/checks.d.ts +13 -13
  272. package/node_modules/zod/v4/core/checks.js +37 -31
  273. package/node_modules/zod/v4/core/compile.cjs +1813 -0
  274. package/node_modules/zod/v4/core/compile.d.cts +51 -0
  275. package/node_modules/zod/v4/core/compile.d.ts +51 -0
  276. package/node_modules/zod/v4/core/compile.js +1783 -0
  277. package/node_modules/zod/v4/core/core.cjs +81 -18
  278. package/node_modules/zod/v4/core/core.d.cts +16 -4
  279. package/node_modules/zod/v4/core/core.d.ts +16 -4
  280. package/node_modules/zod/v4/core/core.js +82 -19
  281. package/node_modules/zod/v4/core/doc.cjs +5 -7
  282. package/node_modules/zod/v4/core/doc.d.cts +3 -1
  283. package/node_modules/zod/v4/core/doc.d.ts +3 -1
  284. package/node_modules/zod/v4/core/doc.js +5 -7
  285. package/node_modules/zod/v4/core/errors.cjs +110 -25
  286. package/node_modules/zod/v4/core/errors.d.cts +4 -0
  287. package/node_modules/zod/v4/core/errors.d.ts +4 -0
  288. package/node_modules/zod/v4/core/errors.js +110 -25
  289. package/node_modules/zod/v4/core/index.cjs +5 -1
  290. package/node_modules/zod/v4/core/index.d.cts +3 -0
  291. package/node_modules/zod/v4/core/index.d.ts +3 -0
  292. package/node_modules/zod/v4/core/index.js +3 -0
  293. package/node_modules/zod/v4/core/json-schema-generator.cjs +4 -0
  294. package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
  295. package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
  296. package/node_modules/zod/v4/core/json-schema-generator.js +4 -0
  297. package/node_modules/zod/v4/core/json-schema-processors.cjs +264 -95
  298. package/node_modules/zod/v4/core/json-schema-processors.js +243 -97
  299. package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
  300. package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
  301. package/node_modules/zod/v4/core/memoizer.cjs +272 -0
  302. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  303. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  304. package/node_modules/zod/v4/core/memoizer.js +265 -0
  305. package/node_modules/zod/v4/core/parse.cjs +96 -34
  306. package/node_modules/zod/v4/core/parse.d.cts +14 -11
  307. package/node_modules/zod/v4/core/parse.d.ts +14 -11
  308. package/node_modules/zod/v4/core/parse.js +94 -33
  309. package/node_modules/zod/v4/core/regexes.cjs +27 -15
  310. package/node_modules/zod/v4/core/regexes.d.cts +2 -0
  311. package/node_modules/zod/v4/core/regexes.d.ts +2 -0
  312. package/node_modules/zod/v4/core/regexes.js +24 -13
  313. package/node_modules/zod/v4/core/registries.js +2 -2
  314. package/node_modules/zod/v4/core/schemas.cjs +537 -326
  315. package/node_modules/zod/v4/core/schemas.d.cts +100 -31
  316. package/node_modules/zod/v4/core/schemas.d.ts +100 -31
  317. package/node_modules/zod/v4/core/schemas.js +526 -325
  318. package/node_modules/zod/v4/core/to-json-schema.cjs +242 -39
  319. package/node_modules/zod/v4/core/to-json-schema.d.cts +42 -3
  320. package/node_modules/zod/v4/core/to-json-schema.d.ts +42 -3
  321. package/node_modules/zod/v4/core/to-json-schema.js +241 -39
  322. package/node_modules/zod/v4/core/util.cjs +212 -31
  323. package/node_modules/zod/v4/core/util.d.cts +58 -1
  324. package/node_modules/zod/v4/core/util.d.ts +58 -1
  325. package/node_modules/zod/v4/core/util.js +202 -30
  326. package/node_modules/zod/v4/core/versions.cjs +2 -2
  327. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  328. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  329. package/node_modules/zod/v4/core/versions.js +2 -2
  330. package/node_modules/zod/v4/core/visit.cjs +195 -0
  331. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  332. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  333. package/node_modules/zod/v4/core/visit.js +169 -0
  334. package/node_modules/zod/v4/index.cjs +15 -5
  335. package/node_modules/zod/v4/index.d.cts +2 -2
  336. package/node_modules/zod/v4/index.d.ts +2 -2
  337. package/node_modules/zod/v4/index.js +3 -2
  338. package/node_modules/zod/v4/locales/ar.cjs +3 -0
  339. package/node_modules/zod/v4/locales/ar.js +3 -0
  340. package/node_modules/zod/v4/locales/az.cjs +3 -0
  341. package/node_modules/zod/v4/locales/az.js +3 -0
  342. package/node_modules/zod/v4/locales/be.cjs +10 -0
  343. package/node_modules/zod/v4/locales/be.js +10 -0
  344. package/node_modules/zod/v4/locales/bg.cjs +3 -0
  345. package/node_modules/zod/v4/locales/bg.js +3 -0
  346. package/node_modules/zod/v4/locales/bn.cjs +138 -0
  347. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  348. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  349. package/node_modules/zod/v4/locales/bn.js +111 -0
  350. package/node_modules/zod/v4/locales/ca.cjs +3 -0
  351. package/node_modules/zod/v4/locales/ca.js +3 -0
  352. package/node_modules/zod/v4/locales/ckb.cjs +158 -0
  353. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  354. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  355. package/node_modules/zod/v4/locales/ckb.js +131 -0
  356. package/node_modules/zod/v4/locales/cs.cjs +3 -0
  357. package/node_modules/zod/v4/locales/cs.js +3 -0
  358. package/node_modules/zod/v4/locales/da.cjs +5 -2
  359. package/node_modules/zod/v4/locales/da.js +5 -2
  360. package/node_modules/zod/v4/locales/de.cjs +3 -0
  361. package/node_modules/zod/v4/locales/de.js +3 -0
  362. package/node_modules/zod/v4/locales/el.cjs +1 -0
  363. package/node_modules/zod/v4/locales/el.js +1 -0
  364. package/node_modules/zod/v4/locales/en.cjs +14 -4
  365. package/node_modules/zod/v4/locales/en.js +14 -4
  366. package/node_modules/zod/v4/locales/eo.cjs +3 -0
  367. package/node_modules/zod/v4/locales/eo.js +3 -0
  368. package/node_modules/zod/v4/locales/es.cjs +2 -0
  369. package/node_modules/zod/v4/locales/es.js +2 -0
  370. package/node_modules/zod/v4/locales/fa.cjs +3 -0
  371. package/node_modules/zod/v4/locales/fa.js +3 -0
  372. package/node_modules/zod/v4/locales/fi.cjs +3 -0
  373. package/node_modules/zod/v4/locales/fi.js +3 -0
  374. package/node_modules/zod/v4/locales/fr-CA.cjs +3 -0
  375. package/node_modules/zod/v4/locales/fr-CA.js +3 -0
  376. package/node_modules/zod/v4/locales/fr.cjs +16 -14
  377. package/node_modules/zod/v4/locales/fr.js +16 -14
  378. package/node_modules/zod/v4/locales/gu.cjs +138 -0
  379. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  380. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  381. package/node_modules/zod/v4/locales/gu.js +111 -0
  382. package/node_modules/zod/v4/locales/he.cjs +5 -0
  383. package/node_modules/zod/v4/locales/he.js +5 -0
  384. package/node_modules/zod/v4/locales/hi.cjs +136 -0
  385. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  386. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  387. package/node_modules/zod/v4/locales/hi.js +109 -0
  388. package/node_modules/zod/v4/locales/hr.cjs +2 -0
  389. package/node_modules/zod/v4/locales/hr.js +2 -0
  390. package/node_modules/zod/v4/locales/hu.cjs +3 -0
  391. package/node_modules/zod/v4/locales/hu.js +3 -0
  392. package/node_modules/zod/v4/locales/hy.cjs +9 -0
  393. package/node_modules/zod/v4/locales/hy.js +9 -0
  394. package/node_modules/zod/v4/locales/id.cjs +3 -0
  395. package/node_modules/zod/v4/locales/id.js +3 -0
  396. package/node_modules/zod/v4/locales/index.cjs +22 -2
  397. package/node_modules/zod/v4/locales/index.d.cts +10 -0
  398. package/node_modules/zod/v4/locales/index.d.ts +10 -0
  399. package/node_modules/zod/v4/locales/index.js +10 -0
  400. package/node_modules/zod/v4/locales/is.cjs +3 -0
  401. package/node_modules/zod/v4/locales/is.js +3 -0
  402. package/node_modules/zod/v4/locales/it.cjs +3 -0
  403. package/node_modules/zod/v4/locales/it.js +3 -0
  404. package/node_modules/zod/v4/locales/ja.cjs +3 -0
  405. package/node_modules/zod/v4/locales/ja.js +3 -0
  406. package/node_modules/zod/v4/locales/ka.cjs +3 -0
  407. package/node_modules/zod/v4/locales/ka.js +3 -0
  408. package/node_modules/zod/v4/locales/km.cjs +3 -0
  409. package/node_modules/zod/v4/locales/km.js +3 -0
  410. package/node_modules/zod/v4/locales/kn.cjs +141 -0
  411. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  412. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  413. package/node_modules/zod/v4/locales/kn.js +114 -0
  414. package/node_modules/zod/v4/locales/ko.cjs +3 -0
  415. package/node_modules/zod/v4/locales/ko.js +3 -0
  416. package/node_modules/zod/v4/locales/lt.cjs +2 -0
  417. package/node_modules/zod/v4/locales/lt.js +2 -0
  418. package/node_modules/zod/v4/locales/mk.cjs +3 -0
  419. package/node_modules/zod/v4/locales/mk.js +3 -0
  420. package/node_modules/zod/v4/locales/ms.cjs +3 -0
  421. package/node_modules/zod/v4/locales/ms.js +3 -0
  422. package/node_modules/zod/v4/locales/ne.cjs +136 -0
  423. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  424. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  425. package/node_modules/zod/v4/locales/ne.js +109 -0
  426. package/node_modules/zod/v4/locales/nl.cjs +3 -0
  427. package/node_modules/zod/v4/locales/nl.js +3 -0
  428. package/node_modules/zod/v4/locales/nn.cjs +138 -0
  429. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  430. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  431. package/node_modules/zod/v4/locales/nn.js +111 -0
  432. package/node_modules/zod/v4/locales/no.cjs +5 -2
  433. package/node_modules/zod/v4/locales/no.js +5 -2
  434. package/node_modules/zod/v4/locales/ota.cjs +3 -0
  435. package/node_modules/zod/v4/locales/ota.js +3 -0
  436. package/node_modules/zod/v4/locales/pl.cjs +3 -0
  437. package/node_modules/zod/v4/locales/pl.js +3 -0
  438. package/node_modules/zod/v4/locales/ps.cjs +3 -0
  439. package/node_modules/zod/v4/locales/ps.js +3 -0
  440. package/node_modules/zod/v4/locales/pt-BR.cjs +168 -0
  441. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  442. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  443. package/node_modules/zod/v4/locales/pt-BR.js +141 -0
  444. package/node_modules/zod/v4/locales/pt.cjs +87 -55
  445. package/node_modules/zod/v4/locales/pt.js +87 -55
  446. package/node_modules/zod/v4/locales/ro.cjs +1 -0
  447. package/node_modules/zod/v4/locales/ro.js +1 -0
  448. package/node_modules/zod/v4/locales/ru.cjs +10 -0
  449. package/node_modules/zod/v4/locales/ru.js +10 -0
  450. package/node_modules/zod/v4/locales/sk.cjs +141 -0
  451. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  452. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  453. package/node_modules/zod/v4/locales/sk.js +114 -0
  454. package/node_modules/zod/v4/locales/sl.cjs +3 -0
  455. package/node_modules/zod/v4/locales/sl.js +3 -0
  456. package/node_modules/zod/v4/locales/sv.cjs +5 -2
  457. package/node_modules/zod/v4/locales/sv.js +5 -2
  458. package/node_modules/zod/v4/locales/ta.cjs +3 -0
  459. package/node_modules/zod/v4/locales/ta.js +3 -0
  460. package/node_modules/zod/v4/locales/th.cjs +3 -0
  461. package/node_modules/zod/v4/locales/th.js +3 -0
  462. package/node_modules/zod/v4/locales/tk.cjs +132 -0
  463. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  464. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  465. package/node_modules/zod/v4/locales/tk.js +105 -0
  466. package/node_modules/zod/v4/locales/tr.cjs +3 -0
  467. package/node_modules/zod/v4/locales/tr.js +3 -0
  468. package/node_modules/zod/v4/locales/uk.cjs +3 -0
  469. package/node_modules/zod/v4/locales/uk.js +3 -0
  470. package/node_modules/zod/v4/locales/ur.cjs +3 -0
  471. package/node_modules/zod/v4/locales/ur.js +3 -0
  472. package/node_modules/zod/v4/locales/uz.cjs +1 -0
  473. package/node_modules/zod/v4/locales/uz.js +1 -0
  474. package/node_modules/zod/v4/locales/vi.cjs +3 -0
  475. package/node_modules/zod/v4/locales/vi.js +3 -0
  476. package/node_modules/zod/v4/locales/yo.cjs +3 -0
  477. package/node_modules/zod/v4/locales/yo.js +3 -0
  478. package/node_modules/zod/v4/locales/zh-CN.cjs +3 -0
  479. package/node_modules/zod/v4/locales/zh-CN.js +3 -0
  480. package/node_modules/zod/v4/locales/zh-TW.cjs +3 -0
  481. package/node_modules/zod/v4/locales/zh-TW.js +3 -0
  482. package/node_modules/zod/v4/mini/checks.cjs +2 -1
  483. package/node_modules/zod/v4/mini/checks.d.cts +1 -1
  484. package/node_modules/zod/v4/mini/checks.d.ts +1 -1
  485. package/node_modules/zod/v4/mini/checks.js +1 -1
  486. package/node_modules/zod/v4/mini/deep-partial.cjs +39 -0
  487. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  488. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  489. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  490. package/node_modules/zod/v4/mini/external.cjs +12 -1
  491. package/node_modules/zod/v4/mini/external.d.cts +5 -2
  492. package/node_modules/zod/v4/mini/external.d.ts +5 -2
  493. package/node_modules/zod/v4/mini/external.js +3 -1
  494. package/node_modules/zod/v4/mini/in-out.cjs +63 -0
  495. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  496. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  497. package/node_modules/zod/v4/mini/in-out.js +36 -0
  498. package/node_modules/zod/v4/mini/parse.cjs +3 -1
  499. package/node_modules/zod/v4/mini/parse.d.cts +1 -1
  500. package/node_modules/zod/v4/mini/parse.d.ts +1 -1
  501. package/node_modules/zod/v4/mini/parse.js +1 -1
  502. package/node_modules/zod/v4/mini/schemas.cjs +75 -47
  503. package/node_modules/zod/v4/mini/schemas.d.cts +43 -13
  504. package/node_modules/zod/v4/mini/schemas.d.ts +43 -13
  505. package/node_modules/zod/v4/mini/schemas.js +71 -45
  506. package/openclaw.plugin.json +16 -29
  507. package/package.json +8 -8
  508. package/node_modules/ws/LICENSE +0 -20
  509. package/node_modules/ws/README.md +0 -548
  510. package/node_modules/ws/browser.js +0 -8
  511. package/node_modules/ws/index.js +0 -22
  512. package/node_modules/ws/lib/buffer-util.js +0 -131
  513. package/node_modules/ws/lib/constants.js +0 -19
  514. package/node_modules/ws/lib/event-target.js +0 -292
  515. package/node_modules/ws/lib/extension.js +0 -203
  516. package/node_modules/ws/lib/limiter.js +0 -55
  517. package/node_modules/ws/lib/permessage-deflate.js +0 -530
  518. package/node_modules/ws/lib/receiver.js +0 -743
  519. package/node_modules/ws/lib/sender.js +0 -607
  520. package/node_modules/ws/lib/stream.js +0 -161
  521. package/node_modules/ws/lib/subprotocol.js +0 -62
  522. package/node_modules/ws/lib/validation.js +0 -152
  523. package/node_modules/ws/lib/websocket-server.js +0 -562
  524. package/node_modules/ws/lib/websocket.js +0 -1407
  525. package/node_modules/ws/package.json +0 -74
  526. package/node_modules/ws/wrapper.mjs +0 -21
  527. package/node_modules/zod/src/v4/core/config.ts +0 -15
  528. /package/dist/{doctor-contract-mvORF4f6.js → .setup/doctor-contract-mvORF4f6.mjs} +0 -0
  529. /package/dist/{gateway-auth-bypass-B93t91oq.js → .setup/gateway-auth-bypass-B93t91oq.mjs} +0 -0
  530. /package/dist/{ingress-identity-DNl4yQSc.js → .setup/ingress-identity-DNl4yQSc.mjs} +0 -0
  531. /package/dist/{runtime-CNB4YGqJ.js → .setup/runtime-CNB4YGqJ.mjs} +0 -0
  532. /package/dist/{secret-contract-qg3NXRlS.js → .setup/secret-contract-qg3NXRlS.mjs} +0 -0
@@ -3,10 +3,10 @@ import { bufferToBlobPart } from "openclaw/plugin-sdk/blob-runtime";
3
3
  import { createChannelPartialDeliveryError } from "openclaw/plugin-sdk/channel-inbound";
4
4
  import { collectErrorGraphCandidates } from "openclaw/plugin-sdk/error-runtime";
5
5
  import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
6
- import { responseWithRelease } from "openclaw/plugin-sdk/fetch-runtime";
6
+ import { captureChannelReadAuthority, responseWithRelease } from "openclaw/plugin-sdk/fetch-runtime";
7
7
  import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
8
- import { readProviderJsonResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
9
- import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
8
+ import { readProviderJsonResponse, redactProviderResponseErrorText } from "openclaw/plugin-sdk/provider-http";
9
+ import { readResponseTextPrefix, readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
10
10
  import { retryAsync } from "openclaw/plugin-sdk/retry-runtime";
11
11
  import { fetchWithSsrFGuard, ssrfPolicyFromPrivateNetworkOptIn } from "openclaw/plugin-sdk/ssrf-runtime";
12
12
  import { z } from "zod";
@@ -63,17 +63,18 @@ async function readMattermostSuccessText(res, path) {
63
63
  const bytes = await readResponseWithLimit(res, MATTERMOST_TEXT_RESPONSE_LIMIT_BYTES, { onOverflow: ({ maxBytes }) => /* @__PURE__ */ new Error(`Mattermost API ${path}: text response exceeds ${maxBytes} bytes`) });
64
64
  return new TextDecoder().decode(bytes);
65
65
  }
66
- async function readMattermostError(res) {
66
+ async function readMattermostError(res, requestHeaders) {
67
67
  const contentType = res.headers.get("content-type") ?? "";
68
- const text = await readResponseTextLimited(res, MATTERMOST_ERROR_BODY_LIMIT_BYTES);
68
+ const { text, truncated } = await readResponseTextPrefix(res, MATTERMOST_ERROR_BODY_LIMIT_BYTES, {
69
+ chunkTimeoutMs: 1e4,
70
+ onIdleTimeout: ({ chunkTimeoutMs }) => /* @__PURE__ */ new Error(`error body read stalled for ${chunkTimeoutMs}ms`)
71
+ });
72
+ let detail = text;
69
73
  if (contentType.includes("application/json")) try {
70
74
  const data = JSON.parse(text);
71
- if (data?.message) return data.message;
72
- return JSON.stringify(data);
73
- } catch {
74
- return text;
75
- }
76
- return text;
75
+ detail = data !== null && typeof data === "object" && "message" in data && typeof data.message === "string" && data.message ? data.message : JSON.stringify(data);
76
+ } catch {}
77
+ return redactProviderResponseErrorText(detail, requestHeaders, { sourceTruncated: truncated });
77
78
  }
78
79
  function createMattermostClient(params) {
79
80
  const baseUrl = normalizeMattermostBaseUrl(params.baseUrl);
@@ -83,12 +84,15 @@ function createMattermostClient(params) {
83
84
  const requestTimeoutMs = resolveTimerTimeoutMs(params.timeoutMs, MATTERMOST_REQUEST_TIMEOUT_MS);
84
85
  const externalFetchImpl = params.fetchImpl;
85
86
  const guardedFetchImpl = async (input, init) => {
87
+ const assertReadAuthority = captureChannelReadAuthority();
88
+ assertReadAuthority?.();
86
89
  const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
87
90
  const { timeoutMs: initTimeoutMs, ...requestInit } = init ?? {};
88
91
  const timeoutMs = resolveTimerTimeoutMs(initTimeoutMs, requestTimeoutMs);
89
92
  const { response, release } = await fetchWithSsrFGuard({
90
93
  url,
91
94
  init: requestInit,
95
+ beforeRequest: assertReadAuthority,
92
96
  auditContext: "mattermost-api",
93
97
  policy: ssrfPolicyFromPrivateNetworkOptIn(params.allowPrivateNetwork),
94
98
  signal: requestInit.signal ?? void 0,
@@ -97,6 +101,7 @@ function createMattermostClient(params) {
97
101
  return responseWithRelease(response, release);
98
102
  };
99
103
  const fetchImpl = (externalFetchImpl ? async (input, init) => {
104
+ captureChannelReadAuthority()?.();
100
105
  const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
101
106
  const { timeoutMs: initTimeoutMs, ...requestInit } = init ?? {};
102
107
  const timeoutMs = resolveTimerTimeoutMs(initTimeoutMs, requestTimeoutMs);
@@ -128,10 +133,16 @@ function createMattermostClient(params) {
128
133
  headers
129
134
  });
130
135
  if (!res.ok) {
131
- const detail = await readMattermostError(res);
136
+ const detail = await readMattermostError(res, headers);
132
137
  throw new Error(`Mattermost API ${res.status} ${res.statusText}: ${detail || "unknown error"}`);
133
138
  }
134
139
  if (res.status === 204) return;
140
+ if (path === "/reactions" && init?.method?.toUpperCase() === "POST") {
141
+ try {
142
+ await res.body?.cancel();
143
+ } catch {}
144
+ return;
145
+ }
135
146
  try {
136
147
  if ((res.headers.get("content-type") ?? "").includes("application/json")) return await readProviderJsonResponse(res, `Mattermost API ${path}`);
137
148
  return await readMattermostSuccessText(res, path);
@@ -357,13 +368,14 @@ async function uploadMattermostFile(client, params) {
357
368
  const blob = new Blob([bufferToBlobPart(params.buffer)], { type: params.contentType });
358
369
  form.append("files", blob, fileName);
359
370
  form.append("channel_id", params.channelId);
371
+ const headers = { Authorization: `Bearer ${client.token}` };
360
372
  const res = await client.fetchImpl(`${client.apiBaseUrl}/files`, {
361
373
  method: "POST",
362
- headers: { Authorization: `Bearer ${client.token}` },
374
+ headers,
363
375
  body: form
364
376
  });
365
377
  if (!res.ok) {
366
- const detail = await readMattermostError(res);
378
+ const detail = await readMattermostError(res, headers);
367
379
  throw new Error(`Mattermost API ${res.status} ${res.statusText}: ${detail || "unknown error"}`);
368
380
  }
369
381
  const info = (await readProviderJsonResponse(res, "Mattermost API /files")).file_infos?.[0];
@@ -371,4 +383,4 @@ async function uploadMattermostFile(client, params) {
371
383
  return info;
372
384
  }
373
385
  //#endregion
374
- export { sendMattermostTyping as _, createMattermostPost as a, fetchMattermostChannelByName as c, fetchMattermostUser as d, fetchMattermostUserByUsername as f, readMattermostError as g, parseMattermostApiStatus as h, createMattermostDirectChannelWithRetry as i, fetchMattermostChannelPosts as l, normalizeMattermostBaseUrl as m, buildMattermostApiUrl as n, deleteMattermostPost as o, fetchMattermostUserTeams as p, createMattermostClient as r, fetchMattermostChannel as s, MattermostPostSchema as t, fetchMattermostMe as u, updateMattermostPost as v, uploadMattermostFile as y };
386
+ export { readMattermostError as _, createMattermostPost as a, uploadMattermostFile as b, fetchMattermostChannelByName as c, fetchMattermostUser as d, fetchMattermostUserByUsername as f, parseMattermostApiStatus as g, normalizeMattermostBaseUrl as h, createMattermostDirectChannelWithRetry as i, fetchMattermostChannelPosts as l, isRetryableError as m, buildMattermostApiUrl as n, deleteMattermostPost as o, fetchMattermostUserTeams as p, createMattermostClient as r, fetchMattermostChannel as s, MattermostPostSchema as t, fetchMattermostMe as u, sendMattermostTyping as v, updateMattermostPost as y };
@@ -1,6 +1,6 @@
1
- import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.js";
2
- import { v as updateMattermostPost } from "./client-Dt7Q-j5B.js";
3
- import { S as resolveClientIp, f as isRequestBodyLimitError, p as isTrustedProxyAddress, v as readRequestBodyWithLimit, w as sendHttpRequestRejection } from "./monitor-auth-C6RGYyn-.js";
1
+ import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.mjs";
2
+ import { y as updateMattermostPost } from "./client-Cx71KZ1x.mjs";
3
+ import { D as sendHttpRequestRejection, T as resolveClientIp, g as isTrustedProxyAddress, h as isRequestBodyLimitError, x as readRequestBodyWithLimit } from "./monitor-auth-DBoM2Bja.mjs";
4
4
  import { createHmac } from "node:crypto";
5
5
  import { resolveGatewayPort } from "openclaw/plugin-sdk/gateway-config-runtime";
6
6
  import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
@@ -1,4 +1,4 @@
1
- import { n as normalizeMattermostAllowEntry, t as mattermostIngressIdentity } from "./ingress-identity-DNl4yQSc.js";
1
+ import { n as normalizeMattermostAllowEntry, t as mattermostIngressIdentity } from "./ingress-identity-DNl4yQSc.mjs";
2
2
  import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { logInboundDrop } from "openclaw/plugin-sdk/channel-inbound";
4
4
  import { resolveAllowlistMatchSimple } from "openclaw/plugin-sdk/allow-from";
@@ -14,9 +14,10 @@ import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
14
14
  import { DEFAULT_GROUP_HISTORY_LIMIT, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
15
15
  import { registerPluginHttpRoute } from "openclaw/plugin-sdk/webhook-targets";
16
16
  import { isRequestBodyLimitError } from "openclaw/plugin-sdk/webhook-ingress";
17
- import { readRequestBodyWithLimit, sendHttpRequestRejection } from "openclaw/plugin-sdk/webhook-request-guards";
17
+ import { createWebhookInFlightLimiter, readRequestBodyWithLimit, sendHttpRequestRejection } from "openclaw/plugin-sdk/webhook-request-guards";
18
18
  import { isTrustedProxyAddress, resolveClientIp } from "openclaw/plugin-sdk/core";
19
19
  import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
20
+ import { resolveChannelContextVisibilityMode, shouldIncludeSupplementalContext } from "openclaw/plugin-sdk/context-visibility-runtime";
20
21
  //#region extensions/mattermost/src/mattermost/monitor-auth.ts
21
22
  function normalizeMattermostAllowList(entries) {
22
23
  const normalized = entries.map((entry) => normalizeMattermostAllowEntry(String(entry))).filter(Boolean);
@@ -89,6 +90,18 @@ async function resolveMattermostMonitorInboundAccess(params) {
89
90
  }
90
91
  });
91
92
  }
93
+ /** Live and recovered history share the same trigger-versus-visibility policy. */
94
+ function shouldRetainMattermostSenderHistory(params) {
95
+ return params.ingress.decision === "allow" || params.kind !== "direct" && params.ingress.reasonCode === "group_policy_not_allowlisted" && shouldIncludeSupplementalContext({
96
+ mode: resolveChannelContextVisibilityMode({
97
+ cfg: params.cfg,
98
+ channel: "mattermost",
99
+ accountId: params.accountId
100
+ }),
101
+ kind: "history",
102
+ senderAllowed: false
103
+ });
104
+ }
92
105
  function resolveMattermostCommandDenyReason(params) {
93
106
  if (params.decision.decision === "allow") return null;
94
107
  if (params.kind === "direct") {
@@ -162,4 +175,4 @@ async function authorizeMattermostCommandInvocation(params) {
162
175
  };
163
176
  }
164
177
  //#endregion
165
- export { resolveDefaultGroupPolicy as C, resolveClientIp as S, warnMissingProviderGroupPolicyFallbackOnce as T, logTypingFailure as _, resolveMattermostMonitorInboundAccess as a, resolveAllowlistProviderRuntimeGroupPolicy$1 as b, buildPreparedModelsProviderData as c, createChannelPairingController as d, isRequestBodyLimitError as f, logInboundDrop as g, loadOutboundMediaFromUrl as h, normalizeMattermostAllowList as i, createChannelHistoryWindow as l, listSkillCommandsForAgents as m, formatMattermostDirectMessageDropLog as n, resolveMattermostTrustedChatKind as o, isTrustedProxyAddress as p, isMattermostSenderAllowed as r, DEFAULT_GROUP_HISTORY_LIMIT as s, authorizeMattermostCommandInvocation as t, createChannelMessageReplyPipeline as u, readRequestBodyWithLimit as v, sendHttpRequestRejection as w, resolveChannelMediaMaxBytes$1 as x, registerPluginHttpRoute as y };
178
+ export { resolveAllowlistProviderRuntimeGroupPolicy$1 as C, sendHttpRequestRejection as D, resolveDefaultGroupPolicy as E, warnMissingProviderGroupPolicyFallbackOnce as O, registerPluginHttpRoute as S, resolveClientIp as T, listSkillCommandsForAgents as _, resolveMattermostMonitorInboundAccess as a, logTypingFailure as b, DEFAULT_GROUP_HISTORY_LIMIT as c, createChannelMessageReplyPipeline as d, createChannelPairingController as f, isTrustedProxyAddress as g, isRequestBodyLimitError as h, normalizeMattermostAllowList as i, buildPreparedModelsProviderData as l, isDangerousNameMatchingEnabled as m, formatMattermostDirectMessageDropLog as n, resolveMattermostTrustedChatKind as o, createWebhookInFlightLimiter as p, isMattermostSenderAllowed as r, shouldRetainMattermostSenderHistory as s, authorizeMattermostCommandInvocation as t, createChannelHistoryWindow as u, loadOutboundMediaFromUrl as v, resolveChannelMediaMaxBytes$1 as w, readRequestBodyWithLimit as x, logInboundDrop as y };
@@ -1,8 +1,9 @@
1
- import { m as normalizeMattermostBaseUrl } from "./client-Dt7Q-j5B.js";
1
+ import { h as normalizeMattermostBaseUrl } from "./client-Cx71KZ1x.mjs";
2
2
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { resolveChannelPreviewStreamMode, resolveChannelStreamingBlockCoalesce, resolveChannelStreamingBlockEnabled, resolveChannelStreamingChunkMode } from "openclaw/plugin-sdk/channel-outbound";
4
4
  import { createAccountListHelpers, hasConfiguredAccountValue } from "openclaw/plugin-sdk/account-helpers";
5
5
  import { normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveMessagePresentationControlValue } from "openclaw/plugin-sdk/interactive-runtime";
6
+ import { resolveAskUserQuestionOptionIndex, resolveAskUserQuestionOptionIndices } from "openclaw/plugin-sdk/reply-payload";
6
7
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
7
8
  import { buildSecretInputSchema, hasConfiguredSecretInput, resolveSecretInputString } from "openclaw/plugin-sdk/secret-input";
8
9
  //#region extensions/mattermost/src/mattermost/accounts.ts
@@ -93,15 +94,54 @@ function resolveMattermostReplyToMode(account, kind) {
93
94
  }
94
95
  //#endregion
95
96
  //#region extensions/mattermost/src/normalize.ts
97
+ /** Marks a button context as one this plugin answers through the question Gateway. */
98
+ const MATTERMOST_QUESTION_CONTEXT_KEY = "oc_question";
99
+ /**
100
+ * Read a question selection back out of a verified interaction context.
101
+ *
102
+ * The context is HMAC-signed on the way out and verified before this runs, so
103
+ * the ids here are the ones this Gateway wrote, not the clicker's input.
104
+ */
105
+ function parseMattermostQuestionContext(context) {
106
+ if (context[MATTERMOST_QUESTION_CONTEXT_KEY] !== true) return null;
107
+ const questionId = context.question_id;
108
+ const optionIndex = context.option_index;
109
+ if (typeof questionId !== "string" || !questionId || typeof optionIndex !== "number") return null;
110
+ return Number.isInteger(optionIndex) && optionIndex >= 0 ? {
111
+ questionId,
112
+ optionIndex
113
+ } : null;
114
+ }
96
115
  function resolveMattermostPresentation(params) {
97
116
  const presentation = normalizeMessagePresentation(params.presentation);
117
+ const text = !presentation || params.presentationTextMode === "fallback" && params.text !== void 0 ? params.text ?? "" : renderMessagePresentationFallbackText({
118
+ text: params.text,
119
+ presentation
120
+ });
121
+ const questionOptionIndices = resolveAskUserQuestionOptionIndices({ channelData: params.channelData });
98
122
  return {
99
- text: !presentation || params.presentationTextMode === "fallback" && params.text !== void 0 ? params.text ?? "" : renderMessagePresentationFallbackText({
100
- text: params.text,
101
- presentation
102
- }),
123
+ text,
103
124
  buttons: presentation ? presentation.blocks.filter((block) => block.type === "buttons").map((block) => block.buttons.flatMap((button) => {
104
- if (button.action) return [];
125
+ const action = button.action;
126
+ if (action?.type === "question") {
127
+ if ("intent" in action) return [];
128
+ const optionIndex = resolveAskUserQuestionOptionIndex({
129
+ questionOptionIndices,
130
+ questionId: action.questionId,
131
+ optionValue: action.optionValue
132
+ });
133
+ return optionIndex === void 0 ? [] : [{
134
+ id: `question-${optionIndex}`,
135
+ text: button.label,
136
+ context: {
137
+ [MATTERMOST_QUESTION_CONTEXT_KEY]: true,
138
+ question_id: action.questionId,
139
+ option_index: optionIndex
140
+ },
141
+ style: button.style
142
+ }];
143
+ }
144
+ if (action) return [];
105
145
  const value = resolveMessagePresentationControlValue(button);
106
146
  return value ? [{
107
147
  id: value,
@@ -156,4 +196,4 @@ function looksLikeMattermostTargetId(raw, _normalized) {
156
196
  return /^[a-z0-9]{26}$/i.test(trimmed) || /^[a-z0-9]{26}__[a-z0-9]{26}$/i.test(trimmed);
157
197
  }
158
198
  //#endregion
159
- export { inspectMattermostAccount as a, resolveDefaultMattermostAccountId as c, buildSecretInputSchema as d, hasConfiguredSecretInput as f, resolveMattermostPresentation as i, resolveMattermostAccount as l, normalizeMattermostMessagingTarget as n, isMattermostConfigured as o, requiresMattermostMediaUpload as r, listMattermostAccountIds as s, looksLikeMattermostTargetId as t, resolveMattermostReplyToMode as u };
199
+ export { resolveMattermostPresentation as a, listMattermostAccountIds as c, resolveMattermostReplyToMode as d, buildSecretInputSchema as f, requiresMattermostMediaUpload as i, resolveDefaultMattermostAccountId as l, normalizeMattermostMessagingTarget as n, inspectMattermostAccount as o, hasConfiguredSecretInput as p, parseMattermostQuestionContext as r, isMattermostConfigured as s, looksLikeMattermostTargetId as t, resolveMattermostAccount as u };
@@ -0,0 +1,3 @@
1
+ import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-qg3NXRlS.mjs";
2
+ import "../secret-contract-api.js";
3
+ export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
@@ -1,8 +1,8 @@
1
- import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.js";
2
- import { c as setInteractionSecret, l as isWildcardBindHost, n as buildButtonProps, o as resolveInteractionCallbackUrl } from "./interactions-DF1FH27_.js";
3
- import { _ as sendMattermostTyping, a as createMattermostPost, c as fetchMattermostChannelByName, d as fetchMattermostUser, f as fetchMattermostUserByUsername, h as parseMattermostApiStatus, i as createMattermostDirectChannelWithRetry, m as normalizeMattermostBaseUrl, p as fetchMattermostUserTeams, r as createMattermostClient, s as fetchMattermostChannel, u as fetchMattermostMe, y as uploadMattermostFile } from "./client-Dt7Q-j5B.js";
4
- import { _ as logTypingFailure, c as buildPreparedModelsProviderData, f as isRequestBodyLimitError, h as loadOutboundMediaFromUrl, i as normalizeMattermostAllowList, o as resolveMattermostTrustedChatKind, t as authorizeMattermostCommandInvocation, v as readRequestBodyWithLimit, w as sendHttpRequestRejection } from "./monitor-auth-C6RGYyn-.js";
5
- import { i as resolveMattermostPresentation, l as resolveMattermostAccount, r as requiresMattermostMediaUpload } from "./normalize-R-ATEEHC.js";
1
+ import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.mjs";
2
+ import { c as setInteractionSecret, l as isWildcardBindHost, n as buildButtonProps, o as resolveInteractionCallbackUrl } from "./interactions-BG-CQbVD.mjs";
3
+ import { a as createMattermostPost, b as uploadMattermostFile, c as fetchMattermostChannelByName, d as fetchMattermostUser, f as fetchMattermostUserByUsername, g as parseMattermostApiStatus, h as normalizeMattermostBaseUrl, i as createMattermostDirectChannelWithRetry, p as fetchMattermostUserTeams, r as createMattermostClient, s as fetchMattermostChannel, u as fetchMattermostMe, v as sendMattermostTyping } from "./client-Cx71KZ1x.mjs";
4
+ import { D as sendHttpRequestRejection, b as logTypingFailure, h as isRequestBodyLimitError, i as normalizeMattermostAllowList, l as buildPreparedModelsProviderData, o as resolveMattermostTrustedChatKind, p as createWebhookInFlightLimiter, t as authorizeMattermostCommandInvocation, v as loadOutboundMediaFromUrl, x as readRequestBodyWithLimit } from "./monitor-auth-DBoM2Bja.mjs";
5
+ import { a as resolveMattermostPresentation, i as requiresMattermostMediaUpload, u as resolveMattermostAccount } from "./normalize-BQzx2u8S.mjs";
6
6
  import { createHash } from "node:crypto";
7
7
  import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
8
8
  import { asFiniteNumber, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringifiedOptionalString, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -1423,7 +1423,7 @@ async function authorizeSlashInvocation(params) {
1423
1423
  */
1424
1424
  function createSlashCommandHttpHandler(params) {
1425
1425
  const { account, cfg, runtime, registeredCommands, triggerMap, log, bodyTimeoutMs } = params;
1426
- return async (req, res, bufferedBody) => {
1426
+ return async (req, res, bufferedBody, onRequestAuthenticated) => {
1427
1427
  if (req.method !== "POST") {
1428
1428
  res.statusCode = 405;
1429
1429
  res.setHeader("Allow", "POST");
@@ -1454,7 +1454,7 @@ function createSlashCommandHttpHandler(params) {
1454
1454
  registeredCommands,
1455
1455
  payload
1456
1456
  });
1457
- if (registeredCommands.length === 0 || !registeredCommand || !safeEqualSecret(payload.token, registeredCommand.token)) {
1457
+ if (!registeredCommand || !safeEqualSecret(payload.token, registeredCommand.token)) {
1458
1458
  sendJsonResponse(res, 401, {
1459
1459
  response_type: "ephemeral",
1460
1460
  text: "Unauthorized: invalid command token."
@@ -1479,6 +1479,7 @@ function createSlashCommandHttpHandler(params) {
1479
1479
  });
1480
1480
  return;
1481
1481
  }
1482
+ onRequestAuthenticated?.();
1482
1483
  const trigger = normalizeSlashCommandTrigger(payload.command);
1483
1484
  const commandText = resolveCommandText(trigger, payload.text, triggerMap);
1484
1485
  const channelId = payload.channel_id;
@@ -1554,9 +1555,14 @@ async function handleSlashCommandAsync(params) {
1554
1555
  const to = kind === "direct" ? `user:${senderId}` : `channel:${channelId}`;
1555
1556
  const pickerEntry = resolveMattermostModelPickerEntry(commandText);
1556
1557
  if (pickerEntry) {
1557
- const data = await buildPreparedModelsProviderData(cfg, route.agentId);
1558
+ const sessionEntry = getSessionEntry({
1559
+ storePath: resolveStorePath(cfg.session?.store, { agentId: route.agentId }),
1560
+ sessionKey: route.sessionKey,
1561
+ readConsistency: "latest"
1562
+ });
1563
+ const data = await buildPreparedModelsProviderData(cfg, route.agentId, { sessionEntry });
1558
1564
  if (data.providers.length === 0) {
1559
- await sendMessageMattermost(`channel:${channelId}`, "No models available.", {
1565
+ await sendMessageMattermost(`channel:${channelId}`, [data.refreshWarning, "No models available."].filter(Boolean).join("\n\n"), {
1560
1566
  cfg,
1561
1567
  accountId: account.accountId
1562
1568
  });
@@ -1581,7 +1587,7 @@ async function handleSlashCommandAsync(params) {
1581
1587
  page: 1,
1582
1588
  currentModel
1583
1589
  });
1584
- await sendMessageMattermost(`channel:${channelId}`, view.text, {
1590
+ await sendMessageMattermost(`channel:${channelId}`, [data.refreshWarning, view.text].filter(Boolean).join("\n\n"), {
1585
1591
  cfg,
1586
1592
  accountId: account.accountId,
1587
1593
  buttons: view.buttons
@@ -1623,7 +1629,6 @@ async function handleSlashCommandAsync(params) {
1623
1629
  channel: "mattermost",
1624
1630
  accountId: account.accountId
1625
1631
  });
1626
- const humanDelay = resolveHumanDelayConfig(cfg, route.agentId);
1627
1632
  await core.channel.inbound.dispatch({
1628
1633
  cfg,
1629
1634
  channel: "mattermost",
@@ -1666,14 +1671,28 @@ async function handleSlashCommandAsync(params) {
1666
1671
  });
1667
1672
  }
1668
1673
  } },
1669
- dispatcherOptions: { humanDelay },
1674
+ dispatcherOptions: { humanDelay: resolveHumanDelayConfig(cfg, route.agentId) },
1670
1675
  replyOptions: { disableBlockStreaming: typeof account.blockStreaming === "boolean" ? !account.blockStreaming : void 0 }
1671
1676
  });
1672
1677
  }
1673
1678
  //#endregion
1674
1679
  //#region extensions/mattermost/src/mattermost/slash-state.ts
1680
+ /**
1681
+ * Shared state for Mattermost slash commands.
1682
+ *
1683
+ * Bridges the plugin registration phase (HTTP route) with the monitor phase
1684
+ * (command registration with MM API). The HTTP handler needs to know which
1685
+ * tokens are known for fast-path routing, and the monitor needs to store
1686
+ * registered command IDs.
1687
+ *
1688
+ * State is kept per-account so that multi-account deployments don't
1689
+ * overwrite each other's tokens, registered commands, or handlers.
1690
+ */
1675
1691
  const MULTI_ACCOUNT_BODY_MAX_BYTES = 65536;
1676
1692
  const MULTI_ACCOUNT_BODY_TIMEOUT_MS = 5e3;
1693
+ const slashRouteInFlightLimiter = createWebhookInFlightLimiter();
1694
+ const SLASH_ROUTE_IN_FLIGHT_KEY = "mattermost:slash";
1695
+ const SLASH_AUTHENTICATED_IN_FLIGHT_KEY = `${SLASH_ROUTE_IN_FLIGHT_KEY}:authenticated`;
1677
1696
  /**
1678
1697
  * Map from accountId → per-account slash command state.
1679
1698
  *
@@ -1693,6 +1712,13 @@ function getSlashAccountStates() {
1693
1712
  return accountStates;
1694
1713
  }
1695
1714
  const accountStates = getSlashAccountStates();
1715
+ function resolveSlashRouteInFlightKey(authorization) {
1716
+ const token = authorization?.match(/^Token ([^,\s]+)$/iu)?.[1];
1717
+ if (!token) return SLASH_ROUTE_IN_FLIGHT_KEY;
1718
+ let matched = false;
1719
+ for (const state of accountStates.values()) for (const commandToken of state.commandTokens) matched = safeEqualSecret(token, commandToken) || matched;
1720
+ return matched ? `${SLASH_AUTHENTICATED_IN_FLIGHT_KEY}:${createHash("sha256").update(`${SLASH_AUTHENTICATED_IN_FLIGHT_KEY}:${token}`).digest("hex")}` : SLASH_ROUTE_IN_FLIGHT_KEY;
1721
+ }
1696
1722
  function resolveSlashHandlerForToken(token) {
1697
1723
  const matches = [];
1698
1724
  for (const [accountId, state] of accountStates) if (state.commandTokens.has(token) && state.handler) matches.push({
@@ -1822,7 +1848,7 @@ function registerSlashCommandRoute(api) {
1822
1848
  const accountCommandsRaw = accountsRaw[accountId]?.commands;
1823
1849
  addCallbackPaths(accountCommandsRaw);
1824
1850
  }
1825
- const routeHandler = async (req, res) => {
1851
+ const dispatchRoute = async (req, res, onRequestAuthenticated) => {
1826
1852
  if (accountStates.size === 0) {
1827
1853
  res.statusCode = 503;
1828
1854
  res.setHeader("Content-Type", "application/json; charset=utf-8");
@@ -1843,7 +1869,7 @@ function registerSlashCommandRoute(api) {
1843
1869
  }));
1844
1870
  return;
1845
1871
  }
1846
- await state.handler(req, res);
1872
+ await state.handler(req, res, void 0, onRequestAuthenticated);
1847
1873
  return;
1848
1874
  }
1849
1875
  let bodyStr;
@@ -1895,7 +1921,25 @@ function registerSlashCommandRoute(api) {
1895
1921
  }));
1896
1922
  return;
1897
1923
  }
1898
- await match.handler(req, res, bodyStr);
1924
+ await match.handler(req, res, bodyStr, onRequestAuthenticated);
1925
+ };
1926
+ const routeHandler = async (req, res) => {
1927
+ const inFlightKey = resolveSlashRouteInFlightKey(req.headers.authorization);
1928
+ if (!slashRouteInFlightLimiter.tryAcquire(inFlightKey)) {
1929
+ await sendHttpRequestRejection(req, res, 429, "Too Many Requests");
1930
+ return;
1931
+ }
1932
+ let released = false;
1933
+ const release = () => {
1934
+ if (released) return;
1935
+ released = true;
1936
+ slashRouteInFlightLimiter.release(inFlightKey);
1937
+ };
1938
+ try {
1939
+ await dispatchRoute(req, res, release);
1940
+ } finally {
1941
+ release();
1942
+ }
1899
1943
  };
1900
1944
  for (const callbackPath of callbackPaths) api.registerHttpRoute({
1901
1945
  path: callbackPath,
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as buildButtonAttachments } from "./interactions-DF1FH27_.js";
2
- import { r as isMattermostSenderAllowed } from "./monitor-auth-C6RGYyn-.js";
1
+ import { t as buildButtonAttachments } from "./.setup/interactions-BG-CQbVD.mjs";
2
+ import { r as isMattermostSenderAllowed } from "./.setup/monitor-auth-DBoM2Bja.mjs";
3
3
  export { buildButtonAttachments, isMattermostSenderAllowed };
@@ -1,40 +1,3 @@
1
- import { o as isMattermostConfigured } from "./normalize-R-ATEEHC.js";
2
- import { a as describeMattermostAccount, i as MattermostChannelConfigSchema, n as mattermostSetupWizard, o as mattermostConfigAdapter, r as mattermostSetupContract, s as mattermostMeta, t as mattermostPlugin } from "./channel-plugin-runtime-C4u91PKh.js";
3
- import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-B93t91oq.js";
4
- //#region extensions/mattermost/src/channel.setup.ts
5
- const mattermostSetupPlugin = {
6
- id: "mattermost",
7
- meta: { ...mattermostMeta },
8
- capabilities: {
9
- chatTypes: [
10
- "direct",
11
- "channel",
12
- "group",
13
- "thread"
14
- ],
15
- reactions: true,
16
- threads: true,
17
- media: true,
18
- nativeCommands: true
19
- },
20
- reload: {
21
- configPrefixes: ["channels.mattermost"],
22
- noopPrefixes: ["messages.inbound"],
23
- /**
24
- * accounts.default is promoted; named resolution merges only channel-wide fields
25
- * plus the selected account. Runtime monitor, debounce, and ingress use accountId.
26
- */
27
- accountScopedRestart: true
28
- },
29
- configSchema: MattermostChannelConfigSchema,
30
- config: {
31
- ...mattermostConfigAdapter,
32
- isConfigured: isMattermostConfigured,
33
- describeAccount: describeMattermostAccount
34
- },
35
- gateway: { resolveGatewayAuthBypassPaths: resolveMattermostGatewayAuthBypassPaths },
36
- setupContract: mattermostSetupContract,
37
- setupWizard: mattermostSetupWizard
38
- };
39
- //#endregion
1
+ import { t as mattermostPlugin } from "./.setup/channel-plugin-runtime-Ca4cZHq2.mjs";
2
+ import { t as mattermostSetupPlugin } from "./.setup/channel-plugin-api-CKz3b0dp.mjs";
40
3
  export { mattermostPlugin, mattermostSetupPlugin };
@@ -1,2 +1,2 @@
1
- import { t as mattermostPlugin } from "./channel-plugin-runtime-C4u91PKh.js";
1
+ import { t as mattermostPlugin } from "./.setup/channel-plugin-runtime-Ca4cZHq2.mjs";
2
2
  export { mattermostPlugin };
@@ -1,2 +1,2 @@
1
- import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-mvORF4f6.js";
1
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./.setup/doctor-contract-mvORF4f6.mjs";
2
2
  export { legacyConfigRules, normalizeCompatibilityConfig };
@@ -1,2 +1,2 @@
1
- import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-B93t91oq.js";
1
+ import { t as resolveMattermostGatewayAuthBypassPaths } from "./.setup/gateway-auth-bypass-B93t91oq.mjs";
2
2
  export { resolveMattermostGatewayAuthBypassPaths as resolveGatewayAuthBypassPaths };
@@ -1,2 +1,2 @@
1
- import { r as isMattermostSenderAllowed } from "./monitor-auth-C6RGYyn-.js";
1
+ import { r as isMattermostSenderAllowed } from "./.setup/monitor-auth-DBoM2Bja.mjs";
2
2
  export { isMattermostSenderAllowed };
@@ -1,4 +1,4 @@
1
- import { r as setMattermostRuntime } from "./runtime-CNB4YGqJ.js";
1
+ import { r as setMattermostRuntime } from "./.setup/runtime-CNB4YGqJ.mjs";
2
2
  import { formatInboundFromLabel, logInboundDrop } from "openclaw/plugin-sdk/channel-inbound";
3
3
  import { resolveAllowlistMatchSimple } from "openclaw/plugin-sdk/allow-from";
4
4
  import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
@@ -1,2 +1,2 @@
1
- import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-qg3NXRlS.js";
1
+ import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./.setup/secret-contract-qg3NXRlS.mjs";
2
2
  export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
@@ -1,13 +1,14 @@
1
1
  import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
2
+ import { fileURLToPath } from "node:url";
2
3
  //#region extensions/mattermost/setup-entry.ts
3
4
  var setup_entry_default = defineBundledChannelSetupEntry({
4
5
  importMetaUrl: import.meta.url,
5
6
  plugin: {
6
- specifier: "./channel-plugin-api.js",
7
+ specifier: fileURLToPath(new URL(".setup/channel-plugin-api-N-mnrhds.mjs", import.meta.url).href),
7
8
  exportName: "mattermostSetupPlugin"
8
9
  },
9
10
  secrets: {
10
- specifier: "./secret-contract-api.js",
11
+ specifier: fileURLToPath(new URL(".setup/secret-contract-api-Drab0Nqx.mjs", import.meta.url).href),
11
12
  exportName: "channelSecrets"
12
13
  }
13
14
  });
@@ -1,2 +1,2 @@
1
- import { i as registerSlashCommandRoute } from "./slash-state-BjBTvP7u.js";
1
+ import { i as registerSlashCommandRoute } from "./.setup/slash-state-CmyIYDIc.mjs";
2
2
  export { registerSlashCommandRoute };
@@ -113,6 +113,33 @@ await schema.parseAsync("hello");
113
113
  // => "hello"
114
114
  ```
115
115
 
116
+ ### AOT compilation
117
+
118
+ For hot validation paths, `z.compile(schema)` returns a schema clone with an ahead-of-time compiled fast path. Valid inputs take the compiled path; invalid inputs fall back to the regular parser so error reporting stays identical.
119
+
120
+ Across a 55-schema benchmark the median speedup is **2.4x**, and it scales with how much work the schema does per parse: a large array of objects is ~9x, a 20-key object ~9x, a nested object ~4.5x, while a bare `z.string()` gains nothing — compilation removes per-node dispatch and allocation, and a single `typeof` has none to remove.
121
+
122
+ ```ts
123
+ const CompiledPlayer = z.compile(Player);
124
+
125
+ CompiledPlayer.parse({ username: "billie", xp: 100 });
126
+ ```
127
+
128
+ To enable compilation globally for schemas constructed after import:
129
+
130
+ ```ts
131
+ import "zod/compile"; // place before modules that define schemas
132
+ ```
133
+
134
+ Things to know:
135
+
136
+ - Compilation uses `new Function`. Global mode is automatically disabled when `z.config({ jitless: true })` is set (e.g. CSP environments); calling `z.compile()` directly is an explicit opt-in.
137
+ - Schemas with async refinements or transforms can't be compiled, and neither can a few other constructs. That is not an error: `z.compile()` hands the schema back unchanged and it keeps using the regular parser, exactly as global mode leaves it. Pass `{ strict: true }` to throw `ZodCompileAsyncError` / `ZodCompileUnsupportedError` instead.
138
+ - On invalid input, refinements and transforms may run twice (fast path, then fallback).
139
+ - Deriving a new schema from a compiled one (`.refine()`, `.extend()`, etc.) returns an uncompiled schema — compile the final schema.
140
+
141
+ See [`compile` docs](https://zod.dev/compile) for details.
142
+
116
143
  ### Handling errors
117
144
 
118
145
  When validation fails, the `.parse()` method will throw a `ZodError` instance with granular information about the validation issues.
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ // Side-effect-only: installs the post-processor on `globalConfig`. Listed in `package.json`'s `sideEffects`, and nothing else references it, so apps that never import it drop the compiler.
3
+ //
4
+ // Usage:
5
+ //
6
+ // import "zod/compile";
7
+ // import * as z from "zod";
8
+ // // every schema constructed below this is compiled on first parse
9
+ //
10
+ // Module evaluation order matters: schemas constructed in modules that evaluate before this import will not be compiled. Place this import in the app entry point, before any module that constructs schemas at top level.
11
+ //
12
+ // Failure handling: if the compiler refuses a schema (async refinement, unsupported feature, etc.) the shim permanently restores the runtime `_zod.run` for that schema. The schema continues to work via the regular runtime parser — no observable difference to the caller.
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ const compile_js_1 = require("./v4/core/compile.cjs");
38
+ const core = __importStar(require("./v4/core/index.cjs"));
39
+ let compiling = false;
40
+ core.globalConfig.postProcessor = (inst) => {
41
+ if (compiling)
42
+ return;
43
+ const originalRun = inst._zod?.run;
44
+ if (typeof originalRun !== "function")
45
+ return;
46
+ const shim = (payload, ctx) => {
47
+ // Bypass the fast path for any non-forward / non-sync / check-skipping call. The runtime owns those contracts.
48
+ if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks) {
49
+ return originalRun(payload, ctx);
50
+ }
51
+ compiling = true;
52
+ try {
53
+ // Respect the jitless config: it exists precisely so CSP/no-eval environments never reach `new Function`. Global mode must not bypass it (explicit z.compile calls remain an explicit opt-in).
54
+ if (core.globalConfig.jitless) {
55
+ inst._zod.run = originalRun;
56
+ return originalRun(payload, ctx);
57
+ }
58
+ // Strict: the shim owns its own fallback below, and a non-strict compile would hand back `inst` — whose run is this shim — and reinstall it on itself.
59
+ const compiled = (0, compile_js_1.compile)(inst, { strict: true });
60
+ // Only the run wrapper. Copying the compiled parse/safeParse closures would make their fallback re-enter this instance and run user callbacks a third time.
61
+ inst._zod.run = compiled._zod.run;
62
+ inst._zod.bag.fallbackRun = compiled._zod.bag.fallbackRun;
63
+ inst._zod.bag.validator = compiled._zod.bag.validator;
64
+ }
65
+ catch {
66
+ // Permanent fallback for unsupported schemas.
67
+ inst._zod.run = originalRun;
68
+ }
69
+ finally {
70
+ compiling = false;
71
+ }
72
+ return inst._zod.run(payload, ctx);
73
+ };
74
+ // Expose the pre-shim runtime so `compile()` invoked elsewhere can unwrap past the shim and capture the source-of-truth runtime. Without this, a user calling `z.compile(s)` after global mode is enabled would capture the shim itself, which would feed the wrapper into itself on fallback.
75
+ shim.__originalRun = originalRun;
76
+ inst._zod.run = shim;
77
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};