@openclaw/discord 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 (421) hide show
  1. package/dist/.setup/{activities-api-DBwRt5ES.mjs → activities-api-COU4-0nR.mjs} +4 -4
  2. package/dist/.setup/{approval-handler.runtime-Du3n5ypX.mjs → approval-handler.runtime-CbBktBb4.mjs} +5 -5
  3. package/dist/.setup/{approval-message-updates-BN7JtScm.mjs → approval-message-updates-jf9zMaIC.mjs} +1 -1
  4. package/dist/.setup/{audit-C8uaKoa9.mjs → audit-vKbh-LFR.mjs} +3 -3
  5. package/dist/.setup/{channel-ChKdlBgH.mjs → channel-Dv4e3Jpc.mjs} +19 -16
  6. package/dist/.setup/{channel-actions.runtime-CJmiFfps.mjs → channel-actions.runtime-leZuw01r.mjs} +13 -7
  7. package/dist/.setup/{channel.setup-BlC3-Kzz.mjs → channel.setup-0NX6FFwi.mjs} +1 -1
  8. package/dist/.setup/{components-MqMWUWnE.mjs → components-yBEb75bB.mjs} +1 -2
  9. package/dist/.setup/{conversation-binding-route-_rz33QHO.mjs → conversation-binding-route-B7qImK_b.mjs} +6 -3
  10. package/dist/.setup/{doctor-DxcdkXzz.mjs → doctor-D1R-uFIu.mjs} +2 -2
  11. package/dist/.setup/{handle-action.guild-admin-DAFyh_yV.mjs → handle-action.guild-admin-DcFa8NwA.mjs} +3 -3
  12. package/dist/.setup/{message-handler-DnUrDpaU.mjs → message-handler-X6ejmbtY.mjs} +6 -5
  13. package/dist/.setup/{message-handler.preflight-CtqaF_fb.mjs → message-handler.preflight-DE_POxFc.mjs} +14 -117
  14. package/dist/.setup/message-handler.preflight-pluralkit-8Xji34AF.mjs +143 -0
  15. package/dist/.setup/{message-handler.process-Dz1xvuQU.mjs → message-handler.process-CCmIVnxy.mjs} +387 -317
  16. package/dist/.setup/{outbound-adapter-C8v79z9Z.mjs → outbound-adapter-ClIgmu4F.mjs} +5 -5
  17. package/dist/.setup/{outbound-session-route-CqWbuMOm.mjs → outbound-session-route-VulUE0yV.mjs} +7 -6
  18. package/dist/.setup/{preflight-audio-DrnqFA8U.mjs → preflight-audio-DHGIHEpv.mjs} +2 -1
  19. package/dist/.setup/{provider-72zIvN-i.mjs → provider-iOf73HW-.mjs} +425 -286
  20. package/dist/.setup/{provider-session.runtime-BW7QrF5C.mjs → provider-session.runtime-DrGAYnZv.mjs} +3 -3
  21. package/dist/.setup/provider.runtime-BmjW_pIw.mjs +2 -0
  22. package/dist/.setup/{realtime-session.runtime-DTccTgTM.mjs → realtime-session.runtime-Dz8uVutq.mjs} +338 -297
  23. package/dist/.setup/receive-recovery-DHst8WRx.mjs +517 -0
  24. package/dist/.setup/{retry-DBfcEgmO.mjs → retry-BEYkDy0P.mjs} +78 -13
  25. package/dist/.setup/{runtime-SchNfUsQ.mjs → runtime-B8lJfyrA.mjs} +30 -11
  26. package/dist/.setup/{runtime-BVoa7hhx.mjs → runtime-DisDbixd.mjs} +1 -1
  27. package/dist/.setup/{send-CKDczUNL.mjs → send-CIBzvXjS.mjs} +23 -9
  28. package/dist/.setup/{send.components-DWQjXhPV.mjs → send.components-ChY21qr-.mjs} +4 -4
  29. package/dist/.setup/{send.outbound-D0hQ7s50.mjs → send.outbound-QTyuFupn.mjs} +15 -16
  30. package/dist/.setup/{send.shared-Zwx6BxQ5.mjs → send.shared-VNvWfX2T.mjs} +2 -2
  31. package/dist/.setup/setup-plugin-api-Dvr41dyx.mjs +3 -0
  32. package/dist/.setup/{shared-CaA3Vv4n.mjs → shared-DHPDaMSx.mjs} +1 -1
  33. package/dist/.setup/{subagent-hooks-Bired9q6.mjs → subagent-hooks-CjW7r8Pe.mjs} +1 -1
  34. package/dist/.setup/{target-resolver-B6MrxbYv.mjs → target-resolver-BXpy6VT8.mjs} +1 -1
  35. package/dist/.setup/targets-CvemhN3i.mjs +3 -0
  36. package/dist/.setup/{thread-bindings-CK5272V3.mjs → thread-bindings-CEh2dhqP.mjs} +3 -3
  37. package/dist/.setup/{thread-bindings.manager-eexkKyrG.mjs → thread-bindings.manager-ve-i6oqt.mjs} +94 -45
  38. package/dist/.setup/{transcripts-source-CuWYgayu.mjs → transcripts-source-DVegW0WI.mjs} +61 -7
  39. package/dist/.setup/{voice-runtime-DHVQ2mFz.mjs → voice-runtime-elTtjEIG.mjs} +553 -901
  40. package/dist/action-runtime-api.js +1 -1
  41. package/dist/activities-api.js +1 -1
  42. package/dist/api.js +10 -10
  43. package/dist/channel-plugin-api.js +1 -1
  44. package/dist/index.js +1 -1
  45. package/dist/runtime-api.js +12 -12
  46. package/dist/setup-entry.js +1 -1
  47. package/dist/setup-plugin-api.js +1 -1
  48. package/dist/src/voice/audio-worker.runtime.js +1065 -0
  49. package/dist/subagent-hooks-api.js +1 -1
  50. package/dist/transcripts-source-api.js +1 -1
  51. package/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.cjs +8 -4
  52. package/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.js +8 -4
  53. package/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs +1 -1
  54. package/node_modules/@napi-rs/wasm-runtime/dist/fs.js +770 -695
  55. package/node_modules/@napi-rs/wasm-runtime/fs-proxy.js +3 -2
  56. package/node_modules/@napi-rs/wasm-runtime/package.json +1 -1
  57. package/node_modules/@tybys/wasm-util/LICENSE +21 -0
  58. package/node_modules/@tybys/wasm-util/package.json +1 -1
  59. package/node_modules/@types/node/README.md +1 -1
  60. package/node_modules/@types/node/package.json +2 -2
  61. package/node_modules/@types/node/web-globals/streams.d.ts +4 -0
  62. package/node_modules/zod/README.md +2 -2
  63. package/node_modules/zod/compile.cjs +19 -0
  64. package/node_modules/zod/index.cjs +19 -0
  65. package/node_modules/zod/locales/index.cjs +19 -0
  66. package/node_modules/zod/mini/index.cjs +19 -0
  67. package/node_modules/zod/package.json +8 -7
  68. package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
  69. package/node_modules/zod/src/v4/classic/external.ts +2 -0
  70. package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
  71. package/node_modules/zod/src/v4/classic/schemas.ts +243 -168
  72. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +60 -9
  73. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
  74. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
  75. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +265 -0
  76. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
  77. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
  78. package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
  79. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
  80. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  81. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +40 -2
  82. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
  83. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
  84. package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
  85. package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
  86. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
  87. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
  88. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  89. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
  90. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
  91. package/node_modules/zod/src/v4/classic/tests/string.test.ts +95 -1
  92. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
  93. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +234 -38
  94. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
  95. package/node_modules/zod/src/v4/core/api.ts +44 -28
  96. package/node_modules/zod/src/v4/core/checks.ts +62 -102
  97. package/node_modules/zod/src/v4/core/compile.ts +218 -93
  98. package/node_modules/zod/src/v4/core/core.ts +1 -3
  99. package/node_modules/zod/src/v4/core/doc.ts +6 -2
  100. package/node_modules/zod/src/v4/core/errors.ts +3 -6
  101. package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
  102. package/node_modules/zod/src/v4/core/json-schema-processors.ts +185 -81
  103. package/node_modules/zod/src/v4/core/memoizer.ts +75 -28
  104. package/node_modules/zod/src/v4/core/parse.ts +37 -16
  105. package/node_modules/zod/src/v4/core/regexes.ts +14 -4
  106. package/node_modules/zod/src/v4/core/schemas.ts +296 -132
  107. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  108. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
  109. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  110. package/node_modules/zod/src/v4/core/tests/compile.test.ts +399 -2
  111. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  112. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  113. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  114. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
  115. package/node_modules/zod/src/v4/core/to-json-schema.ts +9 -7
  116. package/node_modules/zod/src/v4/core/util.ts +218 -147
  117. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  118. package/node_modules/zod/src/v4/locales/ar.ts +2 -0
  119. package/node_modules/zod/src/v4/locales/az.ts +2 -0
  120. package/node_modules/zod/src/v4/locales/be.ts +2 -0
  121. package/node_modules/zod/src/v4/locales/bg.ts +2 -0
  122. package/node_modules/zod/src/v4/locales/bn.ts +2 -0
  123. package/node_modules/zod/src/v4/locales/ca.ts +2 -0
  124. package/node_modules/zod/src/v4/locales/ckb.ts +2 -0
  125. package/node_modules/zod/src/v4/locales/cs.ts +2 -0
  126. package/node_modules/zod/src/v4/locales/da.ts +2 -0
  127. package/node_modules/zod/src/v4/locales/de.ts +2 -0
  128. package/node_modules/zod/src/v4/locales/el.ts +2 -0
  129. package/node_modules/zod/src/v4/locales/en.ts +2 -0
  130. package/node_modules/zod/src/v4/locales/eo.ts +2 -0
  131. package/node_modules/zod/src/v4/locales/es.ts +2 -0
  132. package/node_modules/zod/src/v4/locales/fa.ts +2 -0
  133. package/node_modules/zod/src/v4/locales/fi.ts +2 -0
  134. package/node_modules/zod/src/v4/locales/fr-CA.ts +2 -0
  135. package/node_modules/zod/src/v4/locales/fr.ts +2 -0
  136. package/node_modules/zod/src/v4/locales/gu.ts +2 -0
  137. package/node_modules/zod/src/v4/locales/he.ts +2 -0
  138. package/node_modules/zod/src/v4/locales/hi.ts +2 -0
  139. package/node_modules/zod/src/v4/locales/hr.ts +2 -0
  140. package/node_modules/zod/src/v4/locales/hu.ts +2 -0
  141. package/node_modules/zod/src/v4/locales/hy.ts +2 -0
  142. package/node_modules/zod/src/v4/locales/id.ts +2 -0
  143. package/node_modules/zod/src/v4/locales/index.ts +1 -0
  144. package/node_modules/zod/src/v4/locales/is.ts +2 -0
  145. package/node_modules/zod/src/v4/locales/it.ts +2 -0
  146. package/node_modules/zod/src/v4/locales/ja.ts +2 -0
  147. package/node_modules/zod/src/v4/locales/ka.ts +2 -0
  148. package/node_modules/zod/src/v4/locales/km.ts +2 -0
  149. package/node_modules/zod/src/v4/locales/kn.ts +2 -0
  150. package/node_modules/zod/src/v4/locales/ko.ts +2 -0
  151. package/node_modules/zod/src/v4/locales/lt.ts +2 -0
  152. package/node_modules/zod/src/v4/locales/mk.ts +2 -0
  153. package/node_modules/zod/src/v4/locales/ms.ts +2 -0
  154. package/node_modules/zod/src/v4/locales/ne.ts +2 -0
  155. package/node_modules/zod/src/v4/locales/nl.ts +2 -0
  156. package/node_modules/zod/src/v4/locales/nn.ts +2 -0
  157. package/node_modules/zod/src/v4/locales/no.ts +2 -0
  158. package/node_modules/zod/src/v4/locales/ota.ts +2 -0
  159. package/node_modules/zod/src/v4/locales/pl.ts +2 -0
  160. package/node_modules/zod/src/v4/locales/ps.ts +2 -0
  161. package/node_modules/zod/src/v4/locales/pt-BR.ts +2 -0
  162. package/node_modules/zod/src/v4/locales/pt.ts +2 -0
  163. package/node_modules/zod/src/v4/locales/ro.ts +2 -0
  164. package/node_modules/zod/src/v4/locales/ru.ts +2 -0
  165. package/node_modules/zod/src/v4/locales/sk.ts +2 -0
  166. package/node_modules/zod/src/v4/locales/sl.ts +2 -0
  167. package/node_modules/zod/src/v4/locales/sv.ts +2 -0
  168. package/node_modules/zod/src/v4/locales/ta.ts +2 -0
  169. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  170. package/node_modules/zod/src/v4/locales/th.ts +2 -0
  171. package/node_modules/zod/src/v4/locales/tk.ts +2 -0
  172. package/node_modules/zod/src/v4/locales/tr.ts +2 -0
  173. package/node_modules/zod/src/v4/locales/uk.ts +2 -0
  174. package/node_modules/zod/src/v4/locales/ur.ts +2 -0
  175. package/node_modules/zod/src/v4/locales/uz.ts +2 -0
  176. package/node_modules/zod/src/v4/locales/vi.ts +2 -0
  177. package/node_modules/zod/src/v4/locales/yo.ts +2 -0
  178. package/node_modules/zod/src/v4/locales/zh-CN.ts +2 -0
  179. package/node_modules/zod/src/v4/locales/zh-TW.ts +2 -0
  180. package/node_modules/zod/src/v4/mini/external.ts +2 -0
  181. package/node_modules/zod/src/v4/mini/schemas.ts +32 -7
  182. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
  183. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
  184. package/node_modules/zod/src/v4/mini/tests/index.test.ts +86 -0
  185. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
  186. package/node_modules/zod/src/v4/mini/tests/string.test.ts +23 -0
  187. package/node_modules/zod/v3/ZodError.cjs +19 -0
  188. package/node_modules/zod/v3/errors.cjs +19 -0
  189. package/node_modules/zod/v3/external.cjs +19 -0
  190. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  191. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  192. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  193. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  194. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  195. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  196. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  197. package/node_modules/zod/v3/index.cjs +19 -0
  198. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  199. package/node_modules/zod/v3/types.cjs +19 -0
  200. package/node_modules/zod/v4/classic/checks.cjs +19 -0
  201. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  202. package/node_modules/zod/v4/classic/compat.cjs +19 -0
  203. package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
  204. package/node_modules/zod/v4/classic/errors.cjs +19 -0
  205. package/node_modules/zod/v4/classic/external.cjs +22 -1
  206. package/node_modules/zod/v4/classic/external.d.cts +1 -1
  207. package/node_modules/zod/v4/classic/external.d.ts +1 -1
  208. package/node_modules/zod/v4/classic/external.js +1 -1
  209. package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
  210. package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
  211. package/node_modules/zod/v4/classic/in-out.cjs +19 -0
  212. package/node_modules/zod/v4/classic/index.cjs +19 -0
  213. package/node_modules/zod/v4/classic/iso.cjs +19 -0
  214. package/node_modules/zod/v4/classic/parse.cjs +19 -0
  215. package/node_modules/zod/v4/classic/schemas.cjs +100 -35
  216. package/node_modules/zod/v4/classic/schemas.d.cts +15 -1
  217. package/node_modules/zod/v4/classic/schemas.d.ts +15 -1
  218. package/node_modules/zod/v4/classic/schemas.js +77 -33
  219. package/node_modules/zod/v4/core/api.cjs +45 -22
  220. package/node_modules/zod/v4/core/api.d.cts +12 -6
  221. package/node_modules/zod/v4/core/api.d.ts +12 -6
  222. package/node_modules/zod/v4/core/api.js +25 -22
  223. package/node_modules/zod/v4/core/checks.cjs +51 -97
  224. package/node_modules/zod/v4/core/checks.d.cts +17 -1
  225. package/node_modules/zod/v4/core/checks.d.ts +17 -1
  226. package/node_modules/zod/v4/core/checks.js +31 -96
  227. package/node_modules/zod/v4/core/compile.cjs +173 -78
  228. package/node_modules/zod/v4/core/compile.d.cts +18 -4
  229. package/node_modules/zod/v4/core/compile.d.ts +18 -4
  230. package/node_modules/zod/v4/core/compile.js +154 -79
  231. package/node_modules/zod/v4/core/core.cjs +20 -1
  232. package/node_modules/zod/v4/core/core.js +1 -1
  233. package/node_modules/zod/v4/core/doc.cjs +26 -2
  234. package/node_modules/zod/v4/core/doc.js +7 -2
  235. package/node_modules/zod/v4/core/errors.cjs +21 -5
  236. package/node_modules/zod/v4/core/errors.js +2 -5
  237. package/node_modules/zod/v4/core/index.cjs +19 -0
  238. package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
  239. package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
  240. package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
  241. package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
  242. package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
  243. package/node_modules/zod/v4/core/json-schema-processors.js +170 -74
  244. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  245. package/node_modules/zod/v4/core/memoizer.cjs +111 -23
  246. package/node_modules/zod/v4/core/memoizer.js +69 -23
  247. package/node_modules/zod/v4/core/parse.cjs +56 -16
  248. package/node_modules/zod/v4/core/parse.js +37 -16
  249. package/node_modules/zod/v4/core/regexes.cjs +31 -6
  250. package/node_modules/zod/v4/core/regexes.d.cts +3 -0
  251. package/node_modules/zod/v4/core/regexes.d.ts +3 -0
  252. package/node_modules/zod/v4/core/regexes.js +10 -4
  253. package/node_modules/zod/v4/core/registries.cjs +19 -0
  254. package/node_modules/zod/v4/core/schemas.cjs +302 -114
  255. package/node_modules/zod/v4/core/schemas.d.cts +28 -8
  256. package/node_modules/zod/v4/core/schemas.d.ts +28 -8
  257. package/node_modules/zod/v4/core/schemas.js +279 -113
  258. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  259. package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
  260. package/node_modules/zod/v4/core/to-json-schema.d.cts +4 -3
  261. package/node_modules/zod/v4/core/to-json-schema.d.ts +4 -3
  262. package/node_modules/zod/v4/core/to-json-schema.js +7 -6
  263. package/node_modules/zod/v4/core/util.cjs +177 -143
  264. package/node_modules/zod/v4/core/util.d.cts +25 -4
  265. package/node_modules/zod/v4/core/util.d.ts +25 -4
  266. package/node_modules/zod/v4/core/util.js +156 -143
  267. package/node_modules/zod/v4/core/versions.cjs +21 -2
  268. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  269. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  270. package/node_modules/zod/v4/core/versions.js +2 -2
  271. package/node_modules/zod/v4/core/visit.cjs +19 -0
  272. package/node_modules/zod/v4/index.cjs +19 -0
  273. package/node_modules/zod/v4/locales/ar.cjs +2 -0
  274. package/node_modules/zod/v4/locales/ar.js +2 -0
  275. package/node_modules/zod/v4/locales/az.cjs +2 -0
  276. package/node_modules/zod/v4/locales/az.js +2 -0
  277. package/node_modules/zod/v4/locales/be.cjs +2 -0
  278. package/node_modules/zod/v4/locales/be.js +2 -0
  279. package/node_modules/zod/v4/locales/bg.cjs +2 -0
  280. package/node_modules/zod/v4/locales/bg.js +2 -0
  281. package/node_modules/zod/v4/locales/bn.cjs +2 -0
  282. package/node_modules/zod/v4/locales/bn.js +2 -0
  283. package/node_modules/zod/v4/locales/ca.cjs +2 -0
  284. package/node_modules/zod/v4/locales/ca.js +2 -0
  285. package/node_modules/zod/v4/locales/ckb.cjs +2 -0
  286. package/node_modules/zod/v4/locales/ckb.js +2 -0
  287. package/node_modules/zod/v4/locales/cs.cjs +2 -0
  288. package/node_modules/zod/v4/locales/cs.js +2 -0
  289. package/node_modules/zod/v4/locales/da.cjs +2 -0
  290. package/node_modules/zod/v4/locales/da.js +2 -0
  291. package/node_modules/zod/v4/locales/de.cjs +2 -0
  292. package/node_modules/zod/v4/locales/de.js +2 -0
  293. package/node_modules/zod/v4/locales/el.cjs +2 -0
  294. package/node_modules/zod/v4/locales/el.js +2 -0
  295. package/node_modules/zod/v4/locales/en.cjs +2 -0
  296. package/node_modules/zod/v4/locales/en.js +2 -0
  297. package/node_modules/zod/v4/locales/eo.cjs +2 -0
  298. package/node_modules/zod/v4/locales/eo.js +2 -0
  299. package/node_modules/zod/v4/locales/es.cjs +2 -0
  300. package/node_modules/zod/v4/locales/es.js +2 -0
  301. package/node_modules/zod/v4/locales/fa.cjs +2 -0
  302. package/node_modules/zod/v4/locales/fa.js +2 -0
  303. package/node_modules/zod/v4/locales/fi.cjs +2 -0
  304. package/node_modules/zod/v4/locales/fi.js +2 -0
  305. package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
  306. package/node_modules/zod/v4/locales/fr-CA.js +2 -0
  307. package/node_modules/zod/v4/locales/fr.cjs +2 -0
  308. package/node_modules/zod/v4/locales/fr.js +2 -0
  309. package/node_modules/zod/v4/locales/gu.cjs +2 -0
  310. package/node_modules/zod/v4/locales/gu.js +2 -0
  311. package/node_modules/zod/v4/locales/he.cjs +2 -0
  312. package/node_modules/zod/v4/locales/he.js +2 -0
  313. package/node_modules/zod/v4/locales/hi.cjs +2 -0
  314. package/node_modules/zod/v4/locales/hi.js +2 -0
  315. package/node_modules/zod/v4/locales/hr.cjs +2 -0
  316. package/node_modules/zod/v4/locales/hr.js +2 -0
  317. package/node_modules/zod/v4/locales/hu.cjs +2 -0
  318. package/node_modules/zod/v4/locales/hu.js +2 -0
  319. package/node_modules/zod/v4/locales/hy.cjs +2 -0
  320. package/node_modules/zod/v4/locales/hy.js +2 -0
  321. package/node_modules/zod/v4/locales/id.cjs +2 -0
  322. package/node_modules/zod/v4/locales/id.js +2 -0
  323. package/node_modules/zod/v4/locales/index.cjs +22 -1
  324. package/node_modules/zod/v4/locales/index.d.cts +1 -0
  325. package/node_modules/zod/v4/locales/index.d.ts +1 -0
  326. package/node_modules/zod/v4/locales/index.js +1 -0
  327. package/node_modules/zod/v4/locales/is.cjs +2 -0
  328. package/node_modules/zod/v4/locales/is.js +2 -0
  329. package/node_modules/zod/v4/locales/it.cjs +2 -0
  330. package/node_modules/zod/v4/locales/it.js +2 -0
  331. package/node_modules/zod/v4/locales/ja.cjs +2 -0
  332. package/node_modules/zod/v4/locales/ja.js +2 -0
  333. package/node_modules/zod/v4/locales/ka.cjs +2 -0
  334. package/node_modules/zod/v4/locales/ka.js +2 -0
  335. package/node_modules/zod/v4/locales/km.cjs +2 -0
  336. package/node_modules/zod/v4/locales/km.js +2 -0
  337. package/node_modules/zod/v4/locales/kn.cjs +2 -0
  338. package/node_modules/zod/v4/locales/kn.js +2 -0
  339. package/node_modules/zod/v4/locales/ko.cjs +2 -0
  340. package/node_modules/zod/v4/locales/ko.js +2 -0
  341. package/node_modules/zod/v4/locales/lt.cjs +2 -0
  342. package/node_modules/zod/v4/locales/lt.js +2 -0
  343. package/node_modules/zod/v4/locales/mk.cjs +2 -0
  344. package/node_modules/zod/v4/locales/mk.js +2 -0
  345. package/node_modules/zod/v4/locales/ms.cjs +2 -0
  346. package/node_modules/zod/v4/locales/ms.js +2 -0
  347. package/node_modules/zod/v4/locales/ne.cjs +2 -0
  348. package/node_modules/zod/v4/locales/ne.js +2 -0
  349. package/node_modules/zod/v4/locales/nl.cjs +2 -0
  350. package/node_modules/zod/v4/locales/nl.js +2 -0
  351. package/node_modules/zod/v4/locales/nn.cjs +2 -0
  352. package/node_modules/zod/v4/locales/nn.js +2 -0
  353. package/node_modules/zod/v4/locales/no.cjs +2 -0
  354. package/node_modules/zod/v4/locales/no.js +2 -0
  355. package/node_modules/zod/v4/locales/ota.cjs +2 -0
  356. package/node_modules/zod/v4/locales/ota.js +2 -0
  357. package/node_modules/zod/v4/locales/pl.cjs +2 -0
  358. package/node_modules/zod/v4/locales/pl.js +2 -0
  359. package/node_modules/zod/v4/locales/ps.cjs +2 -0
  360. package/node_modules/zod/v4/locales/ps.js +2 -0
  361. package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
  362. package/node_modules/zod/v4/locales/pt-BR.js +2 -0
  363. package/node_modules/zod/v4/locales/pt.cjs +2 -0
  364. package/node_modules/zod/v4/locales/pt.js +2 -0
  365. package/node_modules/zod/v4/locales/ro.cjs +2 -0
  366. package/node_modules/zod/v4/locales/ro.js +2 -0
  367. package/node_modules/zod/v4/locales/ru.cjs +2 -0
  368. package/node_modules/zod/v4/locales/ru.js +2 -0
  369. package/node_modules/zod/v4/locales/sk.cjs +2 -0
  370. package/node_modules/zod/v4/locales/sk.js +2 -0
  371. package/node_modules/zod/v4/locales/sl.cjs +2 -0
  372. package/node_modules/zod/v4/locales/sl.js +2 -0
  373. package/node_modules/zod/v4/locales/sv.cjs +2 -0
  374. package/node_modules/zod/v4/locales/sv.js +2 -0
  375. package/node_modules/zod/v4/locales/ta.cjs +2 -0
  376. package/node_modules/zod/v4/locales/ta.js +2 -0
  377. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  378. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  379. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  380. package/node_modules/zod/v4/locales/tg.js +117 -0
  381. package/node_modules/zod/v4/locales/th.cjs +2 -0
  382. package/node_modules/zod/v4/locales/th.js +2 -0
  383. package/node_modules/zod/v4/locales/tk.cjs +2 -0
  384. package/node_modules/zod/v4/locales/tk.js +2 -0
  385. package/node_modules/zod/v4/locales/tr.cjs +2 -0
  386. package/node_modules/zod/v4/locales/tr.js +2 -0
  387. package/node_modules/zod/v4/locales/uk.cjs +2 -0
  388. package/node_modules/zod/v4/locales/uk.js +2 -0
  389. package/node_modules/zod/v4/locales/ur.cjs +2 -0
  390. package/node_modules/zod/v4/locales/ur.js +2 -0
  391. package/node_modules/zod/v4/locales/uz.cjs +2 -0
  392. package/node_modules/zod/v4/locales/uz.js +2 -0
  393. package/node_modules/zod/v4/locales/vi.cjs +2 -0
  394. package/node_modules/zod/v4/locales/vi.js +2 -0
  395. package/node_modules/zod/v4/locales/yo.cjs +2 -0
  396. package/node_modules/zod/v4/locales/yo.js +2 -0
  397. package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
  398. package/node_modules/zod/v4/locales/zh-CN.js +2 -0
  399. package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
  400. package/node_modules/zod/v4/locales/zh-TW.js +2 -0
  401. package/node_modules/zod/v4/mini/checks.cjs +19 -0
  402. package/node_modules/zod/v4/mini/coerce.cjs +19 -0
  403. package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
  404. package/node_modules/zod/v4/mini/external.cjs +22 -1
  405. package/node_modules/zod/v4/mini/external.d.cts +1 -1
  406. package/node_modules/zod/v4/mini/external.d.ts +1 -1
  407. package/node_modules/zod/v4/mini/external.js +1 -1
  408. package/node_modules/zod/v4/mini/in-out.cjs +19 -0
  409. package/node_modules/zod/v4/mini/index.cjs +19 -0
  410. package/node_modules/zod/v4/mini/iso.cjs +19 -0
  411. package/node_modules/zod/v4/mini/parse.cjs +19 -0
  412. package/node_modules/zod/v4/mini/schemas.cjs +44 -8
  413. package/node_modules/zod/v4/mini/schemas.d.cts +6 -1
  414. package/node_modules/zod/v4/mini/schemas.d.ts +6 -1
  415. package/node_modules/zod/v4/mini/schemas.js +21 -6
  416. package/node_modules/zod/v4-mini/index.cjs +19 -0
  417. package/package.json +8 -5
  418. package/dist/.setup/message-handler.history-CJOsN9w5.mjs +0 -28
  419. package/dist/.setup/provider.runtime-DuhmKdDU.mjs +0 -2
  420. package/dist/.setup/setup-plugin-api-CINIEBLa.mjs +0 -3
  421. package/dist/.setup/targets-D1mAB5yO.mjs +0 -3
@@ -1,36 +1,36 @@
1
1
  import { D as Message, E as Guild, G as Row, J as StringSelectMenu, L as Button, O as User, P as Modal, Q as BaseMessageInteractiveComponent, T as CommandWithSubcommands, Y as TextDisplay, a as MessageCreateListener, c as PresenceUpdateListener, d as ThreadDeleteListener, f as ThreadUpdateListener, h as Plugin, i as InteractionCreateListener, k as hasDiscordV2Components, l as ReadyListener, m as Client, n as GuildCreateListener, o as MessageReactionAddListener, q as Separator, r as GuildDeleteListener, s as MessageReactionRemoveListener, t as discord_exports, v as RateLimitError, w as Command, z as Container } from "./discord-BXpHW-cu.mjs";
2
- import { C as parseDiscordActivityCustomIdForInteraction, D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, O as decodeCustomIdComponent, T as parseDiscordComponentCustomIdForInteraction, c as parseExecApprovalData, d as buildDiscordComponentMessage, k as encodeCustomIdComponent, o as parseDiscordQuestionData, w as parseDiscordComponentCustomId, y as buildDiscordActivityCustomId } from "./components-MqMWUWnE.mjs";
2
+ import { C as parseDiscordActivityCustomIdForInteraction, D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, O as decodeCustomIdComponent, T as parseDiscordComponentCustomIdForInteraction, c as parseExecApprovalData, d as buildDiscordComponentMessage, k as encodeCustomIdComponent, o as parseDiscordQuestionData, w as parseDiscordComponentCustomId, y as buildDiscordActivityCustomId } from "./components-yBEb75bB.mjs";
3
3
  import { C as resolveTimestampMs, E as getDiscordEndpointRuntime, T as assertDiscordEndpointGatewayUrl, a as normalizeDiscordDisplaySlug, b as formatDiscordReactionEmoji, c as resolveDiscordChannelConfig, f as resolveDiscordGuildEntry, g as resolveDiscordOwnerAllowFrom, h as resolveDiscordOwnerAccess, i as normalizeDiscordAllowList, l as resolveDiscordChannelConfigWithFallback, m as resolveDiscordMemberAllowed, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState, r as isDiscordGroupAllowedByPolicy, s as resolveDiscordAllowListMatch, t as isDiscordThreadChannelType, u as resolveDiscordChannelPolicyCommandAuthorizer, v as resolveGroupDmAllow, x as formatDiscordUserTag, y as shouldEmitDiscordReactionNotification } from "./channel-type-DKnjV1XW.mjs";
4
4
  import { c as resolveDiscordAccount, f as resolveDiscordAccountDmPolicy, h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, m as normalizeDiscordToken, o as mergeDiscordAccountConfig, p as resolveDiscordMaxLinesPerMessage } from "./accounts-CwJQoLjM.mjs";
5
- import { a as registerDiscordComponentEntries, o as resolveDiscordComponentEntryWithPersistence, s as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-DWQjXhPV.mjs";
5
+ import { a as registerDiscordComponentEntries, o as resolveDiscordComponentEntryWithPersistence, s as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-ChY21qr-.mjs";
6
6
  import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
7
7
  import { a as isDiscordRateLimitResponseBody, o as summarizeDiscordResponseBody } from "./api-CBK9zcq5.mjs";
8
- import { o as chunkDiscordTextWithMode } from "./retry-DBfcEgmO.mjs";
9
- import { B as validateDiscordProxyUrl, G as unregisterGateway, P as createDiscordRestClient, R as DISCORD_REST_TIMEOUT_MS, V as withValidatedDiscordProxy, W as registerGateway, b as canViewDiscordGuildChannel, w as hasAnyChannelPermissionDiscord } from "./send.shared-Zwx6BxQ5.mjs";
10
- import { o as formatMention, t as sendMessageDiscord } from "./send.outbound-D0hQ7s50.mjs";
11
- import { n as getDiscordActivitiesRuntime } from "./runtime-BVoa7hhx.mjs";
8
+ import { o as chunkDiscordTextWithMode } from "./retry-BEYkDy0P.mjs";
9
+ import { B as validateDiscordProxyUrl, G as unregisterGateway, P as createDiscordRestClient, R as DISCORD_REST_TIMEOUT_MS, V as withValidatedDiscordProxy, W as registerGateway, b as canViewDiscordGuildChannel, w as hasAnyChannelPermissionDiscord } from "./send.shared-VNvWfX2T.mjs";
10
+ import { o as formatMention, t as sendMessageDiscord } from "./send.outbound-QTyuFupn.mjs";
11
+ import { n as getDiscordActivitiesRuntime } from "./runtime-DisDbixd.mjs";
12
12
  import { t as resolveDiscordCommandOwnerAllowFrom } from "./command-owners-D78sAoOz.mjs";
13
13
  import { n as resolveDiscordChannelInfoSafe, o as resolveDiscordChannelTopicSafe, r as resolveDiscordChannelNameSafe } from "./channel-access-C12aDZ0p.mjs";
14
- import { D as resolveDiscordMessageStickers, c as resolveDiscordVoiceAccess, d as resolveFetchedDiscordThreadLikeChannelContext, o as resolveDiscordVoiceEnabled, r as setDiscordTranscriptsVoiceManager, s as authorizeDiscordVoiceIngress, u as resolveDiscordThreadLikeChannelContext } from "./transcripts-source-CuWYgayu.mjs";
14
+ import { O as resolveDiscordMessageStickers, c as authorizeDiscordVoiceIngress, d as resolveDiscordThreadLikeChannelContext, f as resolveFetchedDiscordThreadLikeChannelContext, i as setDiscordTranscriptsVoiceManager, l as resolveDiscordVoiceAccess, s as resolveDiscordVoiceEnabled } from "./transcripts-source-DVegW0WI.mjs";
15
15
  import { i as setPresence, t as clearPresences } from "./presence-cache-dYSHPWMx.mjs";
16
- import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-CKDczUNL.mjs";
16
+ import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-CIBzvXjS.mjs";
17
17
  import { c as raceWithTimeout, u as withAbortTimeout } from "./timeouts-D86uWLt_.mjs";
18
- import { D as isDiscordExecApprovalClientEnabled, T as getDiscordExecApprovalApprovers, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, d as resolveDiscordBoundConversationRoute, h as resolveDiscordConversationIdentity, l as buildDiscordConversationRouteContext, n as DISCORD_PRESENTATION_CAPABILITIES, p as resolveDiscordEffectiveRoute, r as buildDiscordPresentationPayload, s as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./outbound-session-route-CqWbuMOm.mjs";
18
+ import { D as isDiscordExecApprovalClientEnabled, T as getDiscordExecApprovalApprovers, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, d as resolveDiscordBoundConversationRoute, h as resolveDiscordConversationIdentity, l as buildDiscordConversationRouteContext, n as DISCORD_PRESENTATION_CAPABILITIES, p as resolveDiscordEffectiveRoute, r as buildDiscordPresentationPayload, s as DISCORD_APPROVAL_ALLOWED_MENTIONS, u as buildDiscordRoutePeer } from "./outbound-session-route-VulUE0yV.mjs";
19
19
  import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-eKQ-PLdy.mjs";
20
20
  import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-BbvsLQOZ.mjs";
21
21
  import { t as resolveDiscordUserAllowlist } from "./resolve-users-ByFlR7LQ.mjs";
22
- import { i as getThreadBindingManager, o as isThreadArchived, u as formatThreadBindingDurationLabel } from "./thread-bindings.manager-eexkKyrG.mjs";
22
+ import { o as isThreadArchived, r as getThreadBindingManager, u as formatThreadBindingDurationLabel } from "./thread-bindings.manager-ve-i6oqt.mjs";
23
23
  import { a as probeDiscordApplicationId, r as parseApplicationIdFromToken } from "./probe-CupW4we4.mjs";
24
24
  import { i as sanitizeRecentModels, n as normalizeModelRef, r as preferenceTimestampMs, t as buildPreferenceModelKey } from "./model-picker-preference-primitives-BHT1LkR_.mjs";
25
25
  import { t as resolveDiscordSenderIdentity } from "./sender-identity-0Ymgvmaj.mjs";
26
- import { n as hasDiscordApprovalControl, t as discordApprovalMessageUpdates } from "./approval-message-updates-BN7JtScm.mjs";
26
+ import { n as hasDiscordApprovalControl, t as discordApprovalMessageUpdates } from "./approval-message-updates-jf9zMaIC.mjs";
27
27
  import { createRequire } from "node:module";
28
28
  import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
29
29
  import { ApplicationCommandOptionType, ButtonStyle, ChannelType, ComponentType, GatewayCloseCodes, GatewayCloseCodes as GatewayCloseCodes$1, GatewayDispatchEvents, GatewayIntentBits, GatewayOpcodes, PermissionFlagsBits } from "discord-api-types/v10";
30
30
  import { Type } from "typebox";
31
31
  import { Check, Errors } from "typebox/value";
32
32
  import { createHash, randomUUID } from "node:crypto";
33
- import { MAX_DATE_TIMESTAMP_MS, MAX_TIMER_TIMEOUT_MS, asDateTimestampMs, asSafeIntegerInRange, parseFiniteNumber, parseStrictInteger, parseStrictPositiveInteger, resolveDateTimestampMs, resolveTimestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
33
+ import { MAX_DATE_TIMESTAMP_MS, MAX_TIMER_TIMEOUT_MS, asDateTimestampMs, asSafeIntegerInRange, parseFiniteNumber, parseStrictInteger, parseStrictPositiveInteger, resolveDateTimestampMs, resolvePromptHistoryLimit, resolveTimestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
34
34
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
35
35
  import { inspect } from "node:util";
36
36
  import { createHttp1EnvHttpProxyAgent, createHttp1ProxyAgent, createNodeProxyAgent, resolveEnvHttpProxyAgentOptions, wrapFetchWithAbortSignal } from "openclaw/plugin-sdk/fetch-runtime";
@@ -53,24 +53,23 @@ import { buildOutboundSessionContext, listMessageReceiptPlatformIds, resolveChan
53
53
  import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-runtime";
54
54
  import { loadWebMedia } from "openclaw/plugin-sdk/web-media";
55
55
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
56
- import { buildCommandTextFromArgs, findCommandByNativeName, formatCommandArgMenuTitle, listChatCommands, listNativeCommandSpecsForConfig, listSkillCommandsForAgents, resolveCommandAuthorizedFromAuthorizers, resolveEffectiveAgentRuntime, resolveNativeCommandSessionTargets, resolveStoredModelOverride, serializeCommandArgs } from "openclaw/plugin-sdk/command-auth-native";
56
+ import { buildCommandTextFromArgs, findCommandByNativeName, formatCommandArgMenuTitle, listChatCommands, listNativeCommandSpecsForConfig, listSkillCommandsForAgents, resolveCommandAuthorization, resolveCommandAuthorizedFromAuthorizers, resolveEffectiveAgentRuntime, resolveNativeCommandSessionTargets, resolveStoredModelOverride, serializeCommandArgs } from "openclaw/plugin-sdk/command-auth-native";
57
57
  import { GROUP_POLICY_BLOCKED_LABEL, resolveDefaultGroupPolicy, resolveOpenProviderRuntimeGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
58
58
  import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
59
- import { finalizeInboundContext } from "openclaw/plugin-sdk/reply-dispatch-runtime";
60
- import { createChannelPartialDeliveryError, createCommandTurnContext, dispatchChannelInboundTurn, formatInboundEnvelope, hasVisibleInboundReplyDispatch, isChannelPartialDeliveryError, resolveEnvelopeFormatOptions, resolveInboundSupplementalSenderAllowed, runChannelInboundEvent } from "openclaw/plugin-sdk/channel-inbound";
59
+ import { buildChannelInboundEventContext, createChannelPartialDeliveryError, createCommandTurnContext, dispatchChannelInboundTurn, formatInboundEnvelope, hasVisibleInboundReplyDispatch, isChannelPartialDeliveryError, resolveEnvelopeFormatOptions, resolveInboundSupplementalSenderAllowed, runChannelInboundEvent } from "openclaw/plugin-sdk/channel-inbound";
61
60
  import path from "node:path";
62
61
  import { resolvePinnedMainDmOwnerFromAllowlist as resolvePinnedMainDmOwnerFromAllowlist$1 } from "openclaw/plugin-sdk/security-runtime";
63
62
  import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
64
63
  import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
65
64
  import { buildPairingReply, upsertChannelPairingRequest, upsertChannelPairingRequest as upsertChannelPairingRequest$1 } from "openclaw/plugin-sdk/conversation-runtime";
66
- import * as conversationRuntime from "openclaw/plugin-sdk/conversation-binding-runtime";
65
+ import { ensureConfiguredBindingRouteReady, resolveConfiguredBindingRoute } from "openclaw/plugin-sdk/conversation-binding-runtime";
67
66
  import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
68
- import { createChannelIngressResolver, readChannelIngressStoreAllowFromForDmPolicy } from "openclaw/plugin-sdk/channel-ingress-runtime";
69
- import { clearExpiredCooldowns, ensureAuthProfileStore, formatReasoningMessage, getPreparedModelCatalogSnapshot, isProfileInCooldown, listAgentIds, loadPreparedModelCatalog, resolveAgentAvatar, resolveAgentDir, resolveDefaultModelForAgent, resolveHumanDelayConfig, resolveProfilesUnavailableReason } from "openclaw/plugin-sdk/agent-runtime";
67
+ import { readChannelIngressStoreAllowFromForDmPolicy } from "openclaw/plugin-sdk/channel-ingress-runtime";
70
68
  import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
71
69
  import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "openclaw/plugin-sdk/native-command-config-runtime";
72
70
  import { requestHeartbeat } from "openclaw/plugin-sdk/heartbeat-runtime";
73
71
  import { enqueueRoutedSystemEvent, enqueueRoutedSystemEvent as enqueueRoutedSystemEvent$1 } from "openclaw/plugin-sdk/system-event-runtime";
72
+ import { clearExpiredCooldowns, ensureAuthProfileStore, formatReasoningMessage, getPreparedModelCatalogSnapshot, isProfileInCooldown, listAgentIds, loadPreparedModelCatalog, resolveAgentAvatar, resolveAgentDir, resolveDefaultModelForAgent, resolveHumanDelayConfig, resolveProfilesUnavailableReason } from "openclaw/plugin-sdk/agent-runtime";
74
73
  import { deleteSessionEntry, getSessionEntry, listSessionEntries, readSessionUpdatedAt as readSessionUpdatedAt$1, resolveStorePath, resolveStorePath as resolveStorePath$1 } from "openclaw/plugin-sdk/session-store-runtime";
75
74
  import { captureHttpExchange, captureWsEvent, resolveDebugProxySettings, resolveEffectiveDebugProxyUrl } from "openclaw/plugin-sdk/proxy-capture";
76
75
  import { resolveRequestUrl } from "openclaw/plugin-sdk/request-url";
@@ -382,7 +381,7 @@ function createDiscordDynamicAccessGroupResolver(params) {
382
381
  };
383
382
  }
384
383
  function createDiscordIngressResolver(params) {
385
- return createChannelIngressResolver({
384
+ return getDiscordRuntime().channel.inbound.ingress.createResolver({
386
385
  channelId: DISCORD_CHANNEL_ID,
387
386
  accountId: params.accountId,
388
387
  identity: discordIngressIdentity,
@@ -1973,7 +1972,7 @@ async function deliverDiscordInteractionReply(params) {
1973
1972
  }
1974
1973
  //#endregion
1975
1974
  //#region extensions/discord/src/monitor/native-command-route.ts
1976
- async function resolveDiscordNativeInteractionRouteState(params) {
1975
+ function resolveDiscordNativeInteractionRouteState(params) {
1977
1976
  const route = resolveDiscordBoundConversationRoute({
1978
1977
  cfg: params.cfg,
1979
1978
  accountId: params.accountId,
@@ -1985,7 +1984,7 @@ async function resolveDiscordNativeInteractionRouteState(params) {
1985
1984
  conversationId: params.conversationId,
1986
1985
  parentConversationId: params.parentConversationId
1987
1986
  });
1988
- const configuredRoute = params.threadBinding == null ? conversationRuntime.resolveConfiguredBindingRoute({
1987
+ const configuredRoute = params.threadBinding == null ? resolveConfiguredBindingRoute({
1989
1988
  cfg: params.cfg,
1990
1989
  route,
1991
1990
  conversation: {
@@ -2008,17 +2007,14 @@ async function resolveDiscordNativeInteractionRouteState(params) {
2008
2007
  }),
2009
2008
  boundSessionKey,
2010
2009
  configuredRoute,
2011
- configuredBinding,
2012
- bindingReadiness: params.enforceConfiguredBindingReadiness && configuredBinding ? await conversationRuntime.ensureConfiguredBindingRouteReady({
2013
- cfg: params.cfg,
2014
- bindingResolution: configuredBinding
2015
- }) : null
2010
+ configuredBinding
2016
2011
  };
2017
2012
  }
2018
2013
  //#endregion
2019
2014
  //#region extensions/discord/src/monitor/native-command.runtime.ts
2020
2015
  const nativeCommandRuntime = {
2021
2016
  dispatchChannelInboundTurn,
2017
+ ensureConfiguredBindingRouteReady,
2022
2018
  resolveDirectStatusReplyForSession,
2023
2019
  resolveDiscordNativeInteractionRouteState,
2024
2020
  getSessionEntry
@@ -2194,6 +2190,7 @@ async function handleDiscordCommandArgInteraction(params) {
2194
2190
  preferFollowUp: true,
2195
2191
  threadBindings: ctx.threadBindings,
2196
2192
  responseEphemeral: resolveDiscordSlashCommandConfig(ctx.discordConfig?.slashCommand).ephemeral,
2193
+ buildContext: ctx.buildContext,
2197
2194
  dispatchReplyFromConfig: ctx.dispatchReplyFromConfig,
2198
2195
  pluginCommandDispatch: { kind: "non-plugin" }
2199
2196
  });
@@ -2263,6 +2260,200 @@ function createDiscordCommandArgFallbackButton$1(params) {
2263
2260
  return new DiscordCommandArgFallbackButton(params);
2264
2261
  }
2265
2262
  //#endregion
2263
+ //#region extensions/discord/src/monitor/inbound-context.ts
2264
+ function createDiscordSupplementalContextAccessChecker(params) {
2265
+ const userAllowList = params.channelConfig?.users ?? params.guildInfo?.users ?? [];
2266
+ const roleAllowList = params.channelConfig?.roles ?? params.guildInfo?.roles ?? [];
2267
+ const allowFrom = [...userAllowList, ...roleAllowList];
2268
+ return (sender) => {
2269
+ return resolveInboundSupplementalSenderAllowed({
2270
+ isGroup: params.isGuild,
2271
+ groupPolicy: allowFrom.length === 0 ? "open" : "allowlist",
2272
+ allowFrom,
2273
+ isSenderAllowed: () => resolveDiscordMemberAllowed({
2274
+ userAllowList,
2275
+ roleAllowList,
2276
+ memberRoleIds: [...sender.memberRoleIds ?? []],
2277
+ userId: sender.id ?? "",
2278
+ userName: sender.name,
2279
+ userTag: sender.tag,
2280
+ allowNameMatching: params.allowNameMatching
2281
+ })
2282
+ });
2283
+ };
2284
+ }
2285
+ function buildDiscordGroupSystemPrompt(channelConfig) {
2286
+ return channelConfig?.systemPrompt?.trim() || void 0;
2287
+ }
2288
+ function buildDiscordChannelStructuredContext(params) {
2289
+ if (!params.isGuild) return;
2290
+ const entries = [];
2291
+ if (typeof params.channelTopic === "string" && params.channelTopic.trim().length > 0) entries.push({
2292
+ label: "Discord channel metadata",
2293
+ source: "discord",
2294
+ type: "channel_metadata",
2295
+ payload: { topic: params.channelTopic.trim() }
2296
+ });
2297
+ return entries.length > 0 ? entries : void 0;
2298
+ }
2299
+ function buildDiscordInboundAccessContext(params) {
2300
+ return {
2301
+ groupSystemPrompt: params.isGuild ? buildDiscordGroupSystemPrompt(params.channelConfig) : void 0,
2302
+ channelStructuredContext: buildDiscordChannelStructuredContext({
2303
+ isGuild: params.isGuild,
2304
+ channelTopic: params.channelTopic
2305
+ }),
2306
+ ownerAllowFrom: resolveDiscordOwnerAllowFrom({
2307
+ channelConfig: params.channelConfig,
2308
+ guildInfo: params.guildInfo,
2309
+ sender: params.sender,
2310
+ allowNameMatching: params.allowNameMatching
2311
+ })
2312
+ };
2313
+ }
2314
+ //#endregion
2315
+ //#region extensions/discord/src/monitor/native-command-context.ts
2316
+ async function buildDiscordNativeCommandContext(params) {
2317
+ const conversationLabel = params.isDirectMessage ? params.user.globalName ?? params.user.username : params.channelId;
2318
+ const { groupSystemPrompt, ownerAllowFrom, channelStructuredContext } = buildDiscordInboundAccessContext({
2319
+ channelConfig: params.channelConfig,
2320
+ guildInfo: params.guildInfo,
2321
+ sender: params.sender,
2322
+ allowNameMatching: params.allowNameMatching,
2323
+ isGuild: params.isGuild,
2324
+ channelTopic: params.channelTopic
2325
+ });
2326
+ const conversation = {
2327
+ kind: params.isDirectMessage ? "direct" : params.isGroupDm ? "group" : "channel",
2328
+ id: params.channelId,
2329
+ parentId: params.isThreadChannel ? params.threadParentId : void 0,
2330
+ threadId: params.isThreadChannel ? params.channelId : void 0
2331
+ };
2332
+ const allowFrom = params.commandAuthorized ? [`user:${params.user.id}`] : [];
2333
+ const channelIngress = await getDiscordRuntime().channel.inbound.ingress.createResolver({
2334
+ channelId: "discord",
2335
+ accountId: params.accountId,
2336
+ identity: discordIngressIdentity,
2337
+ useDefaultPairingStore: false
2338
+ }).command({
2339
+ subject: {
2340
+ stableId: params.user.id,
2341
+ aliases: { participantKind: "user" }
2342
+ },
2343
+ conversation,
2344
+ contextBinding: {
2345
+ agentId: params.agentId,
2346
+ sessionKey: params.sessionKey,
2347
+ nativeChannelId: params.channelId,
2348
+ messageId: params.interactionId,
2349
+ inboundEventKind: "user_request"
2350
+ },
2351
+ event: {
2352
+ kind: "native-command",
2353
+ mayPair: false
2354
+ },
2355
+ dmPolicy: "allowlist",
2356
+ groupPolicy: "allowlist",
2357
+ allowFrom,
2358
+ groupAllowFrom: allowFrom,
2359
+ command: { modeWhenAccessGroupsOff: "configured" }
2360
+ });
2361
+ return await (params.buildContext ?? buildChannelInboundEventContext)({
2362
+ channel: "discord",
2363
+ channelIngress,
2364
+ accountId: params.accountId,
2365
+ messageId: params.interactionId,
2366
+ timestamp: params.timestampMs ?? Date.now(),
2367
+ from: params.isDirectMessage ? `discord:${params.user.id}` : params.isGroupDm ? `discord:group:${params.channelId}` : `discord:channel:${params.channelId}`,
2368
+ sender: {
2369
+ id: params.user.id,
2370
+ name: params.user.globalName ?? params.user.username,
2371
+ username: params.user.username,
2372
+ tag: params.sender.tag,
2373
+ roles: params.memberRoleIds
2374
+ },
2375
+ conversation: {
2376
+ ...conversation,
2377
+ nativeChannelId: params.channelId,
2378
+ routePeer: buildDiscordRoutePeer({
2379
+ isDirectMessage: params.isDirectMessage,
2380
+ isGroupDm: params.isGroupDm,
2381
+ directUserId: params.user.id,
2382
+ conversationId: params.channelId
2383
+ }),
2384
+ label: conversationLabel,
2385
+ spaceId: params.isGuild ? params.guildInfo?.id ?? params.guildInfo?.slug ?? params.guildId : void 0
2386
+ },
2387
+ route: {
2388
+ agentId: params.agentId,
2389
+ accountId: params.accountId,
2390
+ routeSessionKey: params.commandTargetSessionKey,
2391
+ dispatchSessionKey: params.sessionKey
2392
+ },
2393
+ reply: {
2394
+ to: `slash:${params.user.id}`,
2395
+ originatingTo: resolveDiscordConversationIdentity({
2396
+ isDirectMessage: params.isDirectMessage,
2397
+ userId: params.user.id,
2398
+ channelId: params.channelId
2399
+ }) ?? (params.isDirectMessage ? `user:${params.user.id}` : `channel:${params.channelId}`)
2400
+ },
2401
+ message: { rawBody: params.prompt },
2402
+ access: {
2403
+ mentions: {
2404
+ canDetectMention: true,
2405
+ wasMentioned: true
2406
+ },
2407
+ commands: { authorized: params.commandAuthorized }
2408
+ },
2409
+ commandTurn: {
2410
+ kind: "native",
2411
+ source: "native",
2412
+ authorized: params.commandAuthorized,
2413
+ body: params.prompt
2414
+ },
2415
+ supplemental: { groupSystemPrompt },
2416
+ extra: {
2417
+ CommandArgs: params.commandArgs,
2418
+ CommandTargetSessionKey: params.commandTargetSessionKey,
2419
+ CommandSource: "native",
2420
+ GroupSubject: params.isGuild ? params.guildName : void 0,
2421
+ ChannelStructuredContext: channelStructuredContext,
2422
+ OwnerAllowFrom: ownerAllowFrom
2423
+ }
2424
+ });
2425
+ }
2426
+ async function buildDiscordNativeInteractionContext(params) {
2427
+ const { interaction, route, boundSessionKey, sessionPrefix, channelContext, ...context } = params;
2428
+ const targets = resolveNativeCommandSessionTargets({
2429
+ agentId: route.agentId,
2430
+ sessionPrefix,
2431
+ userId: context.user.id,
2432
+ targetSessionKey: route.sessionKey,
2433
+ boundSessionKey
2434
+ });
2435
+ return {
2436
+ ctxPayload: await buildDiscordNativeCommandContext({
2437
+ ...context,
2438
+ ...targets,
2439
+ agentId: route.agentId,
2440
+ accountId: route.accountId,
2441
+ interactionId: interaction.rawData.id,
2442
+ channelId: channelContext.rawChannelId || "unknown",
2443
+ threadParentId: channelContext.threadParentId,
2444
+ memberRoleIds: Array.isArray(interaction.rawData.member?.roles) ? interaction.rawData.member.roles : [],
2445
+ guildId: interaction.guild?.id,
2446
+ guildName: interaction.guild?.name,
2447
+ channelTopic: resolveDiscordChannelTopicSafe(interaction.channel),
2448
+ isGuild: Boolean(interaction.guild),
2449
+ isDirectMessage: channelContext.isDirectMessage,
2450
+ isGroupDm: channelContext.isGroupDm,
2451
+ isThreadChannel: channelContext.isThreadChannel
2452
+ }),
2453
+ ...targets
2454
+ };
2455
+ }
2456
+ //#endregion
2266
2457
  //#region extensions/discord/src/monitor/native-interaction-channel-context.ts
2267
2458
  async function resolveDiscordNativeInteractionChannelContext(params) {
2268
2459
  const channelContext = await resolveDiscordThreadLikeChannelContext({
@@ -2286,6 +2477,62 @@ async function resolveDiscordNativeInteractionChannelContext(params) {
2286
2477
  }
2287
2478
  //#endregion
2288
2479
  //#region extensions/discord/src/monitor/native-command-auth.ts
2480
+ function resolveDiscordNativePolicyReader(params) {
2481
+ return params.readPolicy ?? createDiscordLivePolicyReader({
2482
+ ...params,
2483
+ readConfig: () => getRuntimeConfigSnapshot() ?? params.cfg,
2484
+ resolvedAllowlist: {
2485
+ guildEntries: params.discordConfig?.guilds,
2486
+ allowFrom: params.discordConfig?.allowFrom ?? resolveDiscordAccountAllowFrom(params)
2487
+ }
2488
+ });
2489
+ }
2490
+ function createDiscordNativeCommandAuthority(params) {
2491
+ const assertAdmittedOwner = resolveCommandAuthorization(params).assertOwnerCurrent;
2492
+ const readAuthorization = () => {
2493
+ const cfg = getRuntimeConfigSnapshot() ?? params.cfg;
2494
+ const owners = resolveDiscordCommandOwnerAllowFrom(cfg);
2495
+ const senderIsOwner = params.isPolicyCurrent?.() !== false && (resolveDiscordOwnerAccess({
2496
+ allowFrom: owners,
2497
+ sender: params.sender,
2498
+ allowNameMatching: params.allowNameMatching
2499
+ }).ownerAllowed || resolveCommandAuthorization({
2500
+ ...params,
2501
+ cfg
2502
+ }).senderIsOwner);
2503
+ const commands = resolveDiscordNativeCommandAllowlistAccess({
2504
+ cfg,
2505
+ accountId: params.accountId,
2506
+ sender: params.sender,
2507
+ chatType: params.ctx.ChatType === "direct" ? "direct" : "channel",
2508
+ guildId: params.guildId
2509
+ });
2510
+ return {
2511
+ senderIsOwner,
2512
+ allowed: (!commands.configured || commands.allowed) && (!owners || owners.includes("*") || senderIsOwner || commands.allowed || params.commandName === "status" || params.pluginCommand)
2513
+ };
2514
+ };
2515
+ const assertActive = () => {
2516
+ assertAdmittedOwner?.();
2517
+ if (params.isPolicyCurrent?.() === false || !readAuthorization().allowed) throw new Error("Discord command authority changed; send a new request.");
2518
+ };
2519
+ return {
2520
+ assertActive,
2521
+ assertOwnerCurrent: () => {
2522
+ assertActive();
2523
+ if (!readAuthorization().senderIsOwner) throw new Error("Discord owner authority changed; send a new request.");
2524
+ },
2525
+ senderIsOwner: () => readAuthorization().senderIsOwner,
2526
+ isAllowed: () => {
2527
+ try {
2528
+ assertActive();
2529
+ return true;
2530
+ } catch {
2531
+ return false;
2532
+ }
2533
+ }
2534
+ };
2535
+ }
2289
2536
  function resolveDiscordNativeCommandAllowlistAccess(params) {
2290
2537
  const commandsAllowFrom = params.cfg.commands?.allowFrom;
2291
2538
  if (!commandsAllowFrom || typeof commandsAllowFrom !== "object") return {
@@ -2425,12 +2672,13 @@ async function resolveDiscordNativeAutocompleteAuthorized(params) {
2425
2672
  author: user,
2426
2673
  pluralkitInfo: null
2427
2674
  });
2428
- const { isDirectMessage, isGroupDm, isThreadChannel, channelName, channelSlug, rawChannelId, threadParentId, threadParentName, threadParentSlug } = await resolveDiscordNativeInteractionChannelContext({
2675
+ const channelContext = await resolveDiscordNativeInteractionChannelContext({
2429
2676
  channel: interaction.channel,
2430
2677
  client: interaction.client,
2431
2678
  hasGuild: Boolean(interaction.guild),
2432
2679
  channelIdFallback: interaction.rawData.channel_id ?? ""
2433
2680
  });
2681
+ const { isDirectMessage, isGroupDm, isThreadChannel, channelName, channelSlug, rawChannelId, threadParentId, threadParentName, threadParentSlug } = channelContext;
2434
2682
  if (params.isPolicyCurrent?.() === false) return false;
2435
2683
  const memberRoleIds = Array.isArray(interaction.rawData.member?.roles) ? interaction.rawData.member.roles.map((roleId) => roleId) : [];
2436
2684
  const allowNameMatching = isDangerousNameMatchingEnabled(discordConfig);
@@ -2507,162 +2755,75 @@ async function resolveDiscordNativeAutocompleteAuthorized(params) {
2507
2755
  channelName,
2508
2756
  channelSlug
2509
2757
  }).allowed) return false;
2510
- if (params.skipCommandOwnerAllowFrom !== true) {
2511
- const commandOwnerAllowFrom = resolveDiscordCommandOwnerAllowFrom(cfg);
2512
- const { ownerAllowed: commandOwnerOk } = resolveDiscordOwnerAccess({
2513
- allowFrom: commandOwnerAllowFrom,
2514
- sender: {
2515
- id: sender.id,
2516
- name: sender.name,
2517
- tag: sender.tag
2518
- },
2519
- allowNameMatching
2520
- });
2521
- const commandOwnerAllowAll = commandOwnerAllowFrom?.includes("*") === true;
2522
- if (commandOwnerAllowFrom && !(commandOwnerOk || commandOwnerAllowAll) && !commandsAllowFromAccess.allowed) return false;
2758
+ if (!isDirectMessage) {
2759
+ if (!await resolveDiscordGuildNativeCommandAuthorized({
2760
+ cfg,
2761
+ accountId,
2762
+ discordConfig,
2763
+ useAccessGroups,
2764
+ commandsAllowFromAccess,
2765
+ guildInfo,
2766
+ channelConfig,
2767
+ memberRoleIds,
2768
+ sender,
2769
+ allowNameMatching,
2770
+ ownerAllowListConfigured: ownerAllowList != null,
2771
+ ownerAllowed: ownerOk
2772
+ })) return false;
2523
2773
  }
2524
- if (!isDirectMessage) return await resolveDiscordGuildNativeCommandAuthorized({
2525
- cfg,
2526
- accountId,
2527
- discordConfig,
2528
- useAccessGroups,
2529
- commandsAllowFromAccess,
2530
- guildInfo,
2531
- channelConfig,
2532
- memberRoleIds,
2774
+ const commandOwnerAllowFrom = resolveDiscordCommandOwnerAllowFrom(cfg);
2775
+ if (params.skipCommandOwnerAllowFrom !== true && commandOwnerAllowFrom && !commandOwnerAllowFrom.includes("*") && !commandsAllowFromAccess.allowed && !resolveDiscordOwnerAccess({
2776
+ allowFrom: commandOwnerAllowFrom,
2533
2777
  sender,
2534
- allowNameMatching,
2535
- ownerAllowListConfigured: ownerAllowList != null,
2536
- ownerAllowed: ownerOk
2537
- }) && params.isPolicyCurrent?.() !== false;
2778
+ allowNameMatching
2779
+ }).ownerAllowed) {
2780
+ const routeState = resolveDiscordNativeInteractionRouteState({
2781
+ cfg,
2782
+ accountId,
2783
+ guildId: interaction.guild?.id,
2784
+ memberRoleIds,
2785
+ isDirectMessage,
2786
+ isGroupDm,
2787
+ directUserId: user.id,
2788
+ conversationId: rawChannelId,
2789
+ parentConversationId: threadParentId,
2790
+ threadBinding: isThreadChannel ? params.threadBindings?.getByThreadId(rawChannelId) : void 0
2791
+ });
2792
+ const { ctxPayload } = await buildDiscordNativeInteractionContext({
2793
+ buildContext: params.buildContext,
2794
+ interaction,
2795
+ channelContext,
2796
+ route: routeState.effectiveRoute,
2797
+ boundSessionKey: routeState.boundSessionKey,
2798
+ sessionPrefix: params.sessionPrefix ?? "discord:slash",
2799
+ channelConfig,
2800
+ guildInfo,
2801
+ allowNameMatching,
2802
+ commandAuthorized: true,
2803
+ user,
2804
+ sender,
2805
+ prompt: "",
2806
+ commandArgs: {}
2807
+ });
2808
+ if (!resolveCommandAuthorization({
2809
+ ctx: ctxPayload,
2810
+ cfg,
2811
+ commandAuthorized: true
2812
+ }).senderIsOwner) return false;
2813
+ }
2538
2814
  return params.isPolicyCurrent?.() !== false;
2539
2815
  }
2540
2816
  //#endregion
2541
2817
  //#region extensions/discord/src/monitor/native-command-bypass.ts
2542
2818
  function shouldBypassConfiguredAcpEnsure(commandName) {
2543
- return commandName.trim().toLowerCase() === "acp";
2819
+ const command = commandName.trim().toLowerCase();
2820
+ return command === "acp" || command === "status";
2544
2821
  }
2545
2822
  function shouldBypassConfiguredAcpGuildGuards(commandName) {
2546
2823
  const command = commandName.trim().toLowerCase();
2547
2824
  return command === "new" || command === "reset";
2548
2825
  }
2549
2826
  //#endregion
2550
- //#region extensions/discord/src/monitor/inbound-context.ts
2551
- function createDiscordSupplementalContextAccessChecker(params) {
2552
- const userAllowList = params.channelConfig?.users ?? params.guildInfo?.users ?? [];
2553
- const roleAllowList = params.channelConfig?.roles ?? params.guildInfo?.roles ?? [];
2554
- const allowFrom = [...userAllowList, ...roleAllowList];
2555
- return (sender) => {
2556
- return resolveInboundSupplementalSenderAllowed({
2557
- isGroup: params.isGuild,
2558
- groupPolicy: allowFrom.length === 0 ? "open" : "allowlist",
2559
- allowFrom,
2560
- isSenderAllowed: () => resolveDiscordMemberAllowed({
2561
- userAllowList,
2562
- roleAllowList,
2563
- memberRoleIds: [...sender.memberRoleIds ?? []],
2564
- userId: sender.id ?? "",
2565
- userName: sender.name,
2566
- userTag: sender.tag,
2567
- allowNameMatching: params.allowNameMatching
2568
- })
2569
- });
2570
- };
2571
- }
2572
- function buildDiscordGroupSystemPrompt(channelConfig) {
2573
- return channelConfig?.systemPrompt?.trim() || void 0;
2574
- }
2575
- function buildDiscordChannelStructuredContext(params) {
2576
- if (!params.isGuild) return;
2577
- const entries = [];
2578
- if (typeof params.channelTopic === "string" && params.channelTopic.trim().length > 0) entries.push({
2579
- label: "Discord channel metadata",
2580
- source: "discord",
2581
- type: "channel_metadata",
2582
- payload: { topic: params.channelTopic.trim() }
2583
- });
2584
- return entries.length > 0 ? entries : void 0;
2585
- }
2586
- function buildDiscordInboundAccessContext(params) {
2587
- return {
2588
- groupSystemPrompt: params.isGuild ? buildDiscordGroupSystemPrompt(params.channelConfig) : void 0,
2589
- channelStructuredContext: buildDiscordChannelStructuredContext({
2590
- isGuild: params.isGuild,
2591
- channelTopic: params.channelTopic
2592
- }),
2593
- ownerAllowFrom: resolveDiscordOwnerAllowFrom({
2594
- channelConfig: params.channelConfig,
2595
- guildInfo: params.guildInfo,
2596
- sender: params.sender,
2597
- allowNameMatching: params.allowNameMatching
2598
- })
2599
- };
2600
- }
2601
- //#endregion
2602
- //#region extensions/discord/src/monitor/native-command-context.ts
2603
- function buildDiscordNativeCommandContext(params) {
2604
- const conversationLabel = params.isDirectMessage ? params.user.globalName ?? params.user.username : params.channelId;
2605
- const { groupSystemPrompt, ownerAllowFrom, channelStructuredContext } = buildDiscordInboundAccessContext({
2606
- channelConfig: params.channelConfig,
2607
- guildInfo: params.guildInfo,
2608
- sender: params.sender,
2609
- allowNameMatching: params.allowNameMatching,
2610
- isGuild: params.isGuild,
2611
- channelTopic: params.channelTopic
2612
- });
2613
- return finalizeInboundContext({
2614
- Body: params.prompt,
2615
- BodyForAgent: params.prompt,
2616
- RawBody: params.prompt,
2617
- CommandBody: params.prompt,
2618
- CommandArgs: params.commandArgs,
2619
- From: params.isDirectMessage ? `discord:${params.user.id}` : params.isGroupDm ? `discord:group:${params.channelId}` : `discord:channel:${params.channelId}`,
2620
- To: `slash:${params.user.id}`,
2621
- SessionKey: params.sessionKey,
2622
- CommandTargetSessionKey: params.commandTargetSessionKey,
2623
- AccountId: params.accountId ?? void 0,
2624
- ChatType: params.isDirectMessage ? "direct" : params.isGroupDm ? "group" : "channel",
2625
- ...buildDiscordConversationRouteContext({
2626
- isDirectMessage: params.isDirectMessage,
2627
- isGroupDm: params.isGroupDm,
2628
- directUserId: params.user.id,
2629
- conversationId: params.channelId,
2630
- isThread: params.isThreadChannel,
2631
- parentConversationId: params.threadParentId
2632
- }),
2633
- ConversationLabel: conversationLabel,
2634
- GroupSubject: params.isGuild ? params.guildName : void 0,
2635
- GroupSpace: params.isGuild ? params.guildInfo?.id ?? params.guildInfo?.slug ?? params.guildId : void 0,
2636
- MemberRoleIds: params.memberRoleIds,
2637
- GroupSystemPrompt: groupSystemPrompt,
2638
- ChannelStructuredContext: channelStructuredContext,
2639
- OwnerAllowFrom: ownerAllowFrom,
2640
- SenderName: params.user.globalName ?? params.user.username,
2641
- SenderId: params.user.id,
2642
- SenderUsername: params.user.username,
2643
- SenderTag: params.sender.tag,
2644
- Provider: "discord",
2645
- Surface: "discord",
2646
- WasMentioned: true,
2647
- MessageSid: params.interactionId,
2648
- Timestamp: params.timestampMs ?? Date.now(),
2649
- CommandAuthorized: params.commandAuthorized,
2650
- CommandTurn: {
2651
- kind: "native",
2652
- source: "native",
2653
- authorized: params.commandAuthorized,
2654
- body: params.prompt
2655
- },
2656
- CommandSource: "native",
2657
- OriginatingChannel: "discord",
2658
- OriginatingTo: resolveDiscordConversationIdentity({
2659
- isDirectMessage: params.isDirectMessage,
2660
- userId: params.user.id,
2661
- channelId: params.channelId
2662
- }) ?? (params.isDirectMessage ? `user:${params.user.id}` : `channel:${params.channelId}`)
2663
- });
2664
- }
2665
- //#endregion
2666
2827
  //#region extensions/discord/src/monitor/model-picker-preferences.ts
2667
2828
  const DEFAULT_RECENT_LIMIT = 5;
2668
2829
  const PREFERENCE_MAX_ENTRIES = 2e3;
@@ -3662,6 +3823,7 @@ async function applyDiscordModelPickerSelection(params) {
3662
3823
  preferFollowUp: true,
3663
3824
  threadBindings: params.threadBindings,
3664
3825
  suppressReplies: true,
3826
+ buildContext: params.buildContext,
3665
3827
  dispatchReplyFromConfig: params.dispatchReplyFromConfig,
3666
3828
  pluginCommandDispatch: { kind: "non-plugin" }
3667
3829
  }), 12e3);
@@ -3756,7 +3918,7 @@ async function resolveDiscordModelPickerRouteState(params) {
3756
3918
  });
3757
3919
  const memberRoleIds = Array.isArray(interaction.rawData.member?.roles) ? interaction.rawData.member.roles.map((roleId) => roleId) : [];
3758
3920
  const threadBinding = isThreadChannel ? params.threadBindings.getByThreadId(rawChannelId) : void 0;
3759
- return await resolveDiscordNativeInteractionRouteState({
3921
+ return resolveDiscordNativeInteractionRouteState({
3760
3922
  cfg,
3761
3923
  accountId,
3762
3924
  guildId: interaction.guild?.id ?? void 0,
@@ -3766,8 +3928,7 @@ async function resolveDiscordModelPickerRouteState(params) {
3766
3928
  directUserId: interaction.user?.id ?? rawChannelId,
3767
3929
  conversationId: rawChannelId,
3768
3930
  parentConversationId: threadParentId,
3769
- threadBinding,
3770
- enforceConfiguredBindingReadiness: params.enforceConfiguredBindingReadiness
3931
+ threadBinding
3771
3932
  });
3772
3933
  }
3773
3934
  async function resolveDiscordModelPickerRoute(params) {
@@ -3775,15 +3936,7 @@ async function resolveDiscordModelPickerRoute(params) {
3775
3936
  }
3776
3937
  async function resolveDiscordNativeChoiceContext(params) {
3777
3938
  try {
3778
- const resolved = await resolveDiscordModelPickerRouteState({
3779
- interaction: params.interaction,
3780
- cfg: params.cfg,
3781
- accountId: params.accountId,
3782
- threadBindings: params.threadBindings,
3783
- enforceConfiguredBindingReadiness: true
3784
- });
3785
- if (resolved.bindingReadiness && !resolved.bindingReadiness.ok) return null;
3786
- const route = resolved.effectiveRoute;
3939
+ const route = params.route ?? await resolveDiscordModelPickerRoute(params);
3787
3940
  const fallback = resolveDefaultModelForAgent({
3788
3941
  cfg: params.cfg,
3789
3942
  agentId: route.agentId
@@ -4364,16 +4517,11 @@ async function handleDiscordModelPickerInteraction(params) {
4364
4517
  return;
4365
4518
  }
4366
4519
  const applyResult = await applyDiscordModelPickerSelection({
4520
+ ...ctx,
4367
4521
  interaction,
4368
4522
  selectionCommand,
4369
4523
  dispatchCommandInteraction: params.dispatchCommandInteraction,
4370
4524
  cfg,
4371
- discordConfig: ctx.discordConfig,
4372
- readPolicy: ctx.readPolicy,
4373
- accountId: ctx.accountId,
4374
- sessionPrefix: ctx.sessionPrefix,
4375
- threadBindings: ctx.threadBindings,
4376
- dispatchReplyFromConfig: ctx.dispatchReplyFromConfig,
4377
4525
  route,
4378
4526
  resolvedModelRef,
4379
4527
  selectedRuntime,
@@ -4597,18 +4745,8 @@ function buildDiscordCommandOptions(params) {
4597
4745
  //#region extensions/discord/src/monitor/native-command.ts
4598
4746
  const log = createSubsystemLogger("discord/native-command");
4599
4747
  const NON_PLUGIN_COMMAND_DISPATCH = Object.freeze({ kind: "non-plugin" });
4600
- function resolveDiscordNativePolicyReader(params) {
4601
- return params.readPolicy ?? createDiscordLivePolicyReader({
4602
- ...params,
4603
- readConfig: () => getRuntimeConfigSnapshot() ?? params.cfg,
4604
- resolvedAllowlist: {
4605
- guildEntries: params.discordConfig?.guilds,
4606
- allowFrom: params.discordConfig?.allowFrom ?? resolveDiscordAccountAllowFrom(params)
4607
- }
4608
- });
4609
- }
4610
4748
  function createDiscordNativeCommand(params) {
4611
- const { command, cfg, discordConfig, accountId, sessionPrefix, ephemeralDefault, threadBindings, dispatchReplyFromConfig } = params;
4749
+ const { command, cfg, discordConfig, accountId, sessionPrefix, ephemeralDefault, threadBindings, buildContext, dispatchReplyFromConfig } = params;
4612
4750
  const fallbackCommandDefinition = createNativeCommandDefinition(command);
4613
4751
  const pluginCommandCandidate = "prepareDispatch" in command ? command : void 0;
4614
4752
  const commandDefinition = pluginCommandCandidate ? fallbackCommandDefinition : findCommandByNativeName$1(command.name, "discord", { includeBundledChannelFallback: false }) ?? fallbackCommandDefinition;
@@ -4627,6 +4765,9 @@ function createDiscordNativeCommand(params) {
4627
4765
  ...policy,
4628
4766
  isPolicyCurrent: policy.isCurrent,
4629
4767
  accountId,
4768
+ sessionPrefix,
4769
+ threadBindings,
4770
+ buildContext,
4630
4771
  skipCommandOwnerAllowFrom: pluginCommandCandidate !== void 0
4631
4772
  });
4632
4773
  },
@@ -4681,6 +4822,7 @@ function createDiscordNativeCommand(params) {
4681
4822
  preferFollowUp: true,
4682
4823
  threadBindings,
4683
4824
  responseEphemeral: ephemeralDefault,
4825
+ buildContext,
4684
4826
  dispatchReplyFromConfig,
4685
4827
  pluginCommandDispatch: preparedPluginCommand ?? NON_PLUGIN_COMMAND_DISPATCH
4686
4828
  });
@@ -4688,7 +4830,7 @@ function createDiscordNativeCommand(params) {
4688
4830
  }();
4689
4831
  }
4690
4832
  async function dispatchDiscordCommandInteraction(params) {
4691
- const { interaction, prompt, command, commandArgs, cfg: inputConfig, discordConfig: inputDiscordConfig, accountId, sessionPrefix, preferFollowUp, threadBindings, responseEphemeral, suppressReplies, dispatchReplyFromConfig } = params;
4833
+ const { interaction, prompt, command, commandArgs, cfg: inputConfig, discordConfig: inputDiscordConfig, accountId, sessionPrefix, preferFollowUp, threadBindings, responseEphemeral, suppressReplies, buildContext, dispatchReplyFromConfig } = params;
4692
4834
  const policy = await params.readPolicy?.();
4693
4835
  const cfg = policy?.cfg ?? getRuntimeConfigSnapshot() ?? inputConfig;
4694
4836
  const discordConfig = policy?.discordConfig ?? inputDiscordConfig;
@@ -4715,12 +4857,13 @@ async function dispatchDiscordCommandInteraction(params) {
4715
4857
  pluralkitInfo: null
4716
4858
  });
4717
4859
  const channel = interaction.channel;
4718
- const { isDirectMessage, isGroupDm, isThreadChannel, channelName, channelSlug, rawChannelId, threadParentId, threadParentName, threadParentSlug } = await resolveDiscordNativeInteractionChannelContext({
4860
+ const channelContext = await resolveDiscordNativeInteractionChannelContext({
4719
4861
  channel,
4720
4862
  client: interaction.client,
4721
4863
  hasGuild: Boolean(interaction.guild),
4722
4864
  channelIdFallback: interaction.rawData.channel_id ?? ""
4723
4865
  });
4866
+ const { isDirectMessage, isGroupDm, isThreadChannel, channelName, channelSlug, rawChannelId, threadParentId, threadParentName, threadParentSlug } = channelContext;
4724
4867
  if (policy?.isCurrent() === false) {
4725
4868
  await respond("Access policy changed. Try this interaction again.", { ephemeral: true });
4726
4869
  return { accepted: false };
@@ -4731,7 +4874,6 @@ async function dispatchDiscordCommandInteraction(params) {
4731
4874
  cfg,
4732
4875
  accountId
4733
4876
  }) ?? [];
4734
- const commandOwnerAllowFrom = resolveDiscordCommandOwnerAllowFrom(cfg);
4735
4877
  const { ownerAllowList: discordOwnerAllowList, ownerAllowed: discordOwnerOk } = resolveDiscordOwnerAccess({
4736
4878
  allowFrom: configuredDmAllowFrom,
4737
4879
  sender: {
@@ -4741,18 +4883,6 @@ async function dispatchDiscordCommandInteraction(params) {
4741
4883
  },
4742
4884
  allowNameMatching
4743
4885
  });
4744
- const { ownerAllowed: commandOwnerOk } = resolveDiscordOwnerAccess({
4745
- allowFrom: commandOwnerAllowFrom,
4746
- sender: {
4747
- id: sender.id,
4748
- name: sender.name,
4749
- tag: sender.tag
4750
- },
4751
- allowNameMatching
4752
- });
4753
- const commandOwnerAllowAll = commandOwnerAllowFrom?.includes("*") === true;
4754
- const senderIsCommandOwner = commandOwnerOk;
4755
- const commandOwnerAccessAllowed = senderIsCommandOwner || commandOwnerAllowAll;
4756
4886
  const ownerAllowListConfigured = discordOwnerAllowList != null;
4757
4887
  const ownerOk = discordOwnerOk;
4758
4888
  const { commandsAllowFromAccess, guildInfo, channelConfig } = resolveDiscordNativeCommandChannelAccessContext({
@@ -4770,8 +4900,8 @@ async function dispatchDiscordCommandInteraction(params) {
4770
4900
  threadParentName,
4771
4901
  threadParentSlug
4772
4902
  });
4773
- let nativeRouteStatePromise;
4774
- const getNativeRouteState = () => nativeRouteStatePromise ??= nativeCommandRuntime.resolveDiscordNativeInteractionRouteState({
4903
+ let nativeRouteState;
4904
+ const getNativeRouteState = () => nativeRouteState ??= nativeCommandRuntime.resolveDiscordNativeInteractionRouteState({
4775
4905
  cfg,
4776
4906
  accountId,
4777
4907
  guildId: interaction.guild?.id ?? void 0,
@@ -4781,19 +4911,18 @@ async function dispatchDiscordCommandInteraction(params) {
4781
4911
  directUserId: user.id,
4782
4912
  conversationId: rawChannelId || "unknown",
4783
4913
  parentConversationId: threadParentId,
4784
- threadBinding: isThreadChannel ? threadBindings.getByThreadId(rawChannelId) : void 0,
4785
- enforceConfiguredBindingReadiness: !shouldBypassConfiguredAcpEnsure(commandName)
4914
+ threadBinding: isThreadChannel ? threadBindings.getByThreadId(rawChannelId) : void 0
4786
4915
  });
4787
- const canBypassConfiguredAcpGuildGuards = async () => {
4916
+ const canBypassConfiguredAcpGuildGuards = () => {
4788
4917
  if (!interaction.guild || !shouldBypassConfiguredAcpGuildGuards(commandName)) return false;
4789
- const routeState = await getNativeRouteState();
4790
- return routeState.effectiveRoute.matchedBy === "binding.channel" || routeState.boundSessionKey != null || routeState.configuredBinding != null || routeState.configuredRoute != null;
4918
+ const routeState = getNativeRouteState();
4919
+ return routeState.effectiveRoute.matchedBy === "binding.channel" || routeState.boundSessionKey != null || routeState.configuredBinding != null;
4791
4920
  };
4792
- if (channelConfig?.enabled === false && !await canBypassConfiguredAcpGuildGuards()) {
4921
+ if (channelConfig?.enabled === false && !canBypassConfiguredAcpGuildGuards()) {
4793
4922
  await respond("This channel is disabled.");
4794
4923
  return { accepted: false };
4795
4924
  }
4796
- if (interaction.guild && channelConfig?.allowed === false && !await canBypassConfiguredAcpGuildGuards()) {
4925
+ if (interaction.guild && channelConfig?.allowed === false && !canBypassConfiguredAcpGuildGuards()) {
4797
4926
  await respond("This channel is not allowed.");
4798
4927
  return { accepted: false };
4799
4928
  }
@@ -4807,7 +4936,7 @@ async function dispatchDiscordCommandInteraction(params) {
4807
4936
  groupPolicy,
4808
4937
  guildInfo,
4809
4938
  channelConfig
4810
- }).allowed && !await canBypassConfiguredAcpGuildGuards()) {
4939
+ }).allowed && !canBypassConfiguredAcpGuildGuards()) {
4811
4940
  await respond("This channel is not allowed.");
4812
4941
  return { accepted: false };
4813
4942
  }
@@ -4895,7 +5024,7 @@ async function dispatchDiscordCommandInteraction(params) {
4895
5024
  ownerAllowListConfigured,
4896
5025
  ownerAllowed: ownerOk
4897
5026
  });
4898
- if (!commandAuthorized && !await canBypassConfiguredAcpGuildGuards()) {
5027
+ if (!commandAuthorized && !canBypassConfiguredAcpGuildGuards()) {
4899
5028
  await respond("You are not authorized to use this command.", { ephemeral: true });
4900
5029
  return { accepted: false };
4901
5030
  }
@@ -4904,18 +5033,63 @@ async function dispatchDiscordCommandInteraction(params) {
4904
5033
  await respond("Access policy changed. Try this interaction again.", { ephemeral: true });
4905
5034
  return { accepted: false };
4906
5035
  }
4907
- if (commandOwnerAllowFrom && !commandOwnerAccessAllowed && !commandsAllowFromAccess.allowed && commandName !== "status" && params.pluginCommandDispatch.kind !== "plugin") {
5036
+ const routeState = getNativeRouteState();
5037
+ const effectiveRoute = routeState.effectiveRoute;
5038
+ const { ctxPayload, sessionKey, commandTargetSessionKey } = await buildDiscordNativeInteractionContext({
5039
+ buildContext,
5040
+ interaction,
5041
+ channelContext,
5042
+ route: effectiveRoute,
5043
+ boundSessionKey: routeState.boundSessionKey,
5044
+ sessionPrefix,
5045
+ prompt,
5046
+ commandArgs: commandArgs ?? {},
5047
+ channelConfig,
5048
+ guildInfo,
5049
+ allowNameMatching,
5050
+ commandAuthorized,
5051
+ user,
5052
+ sender
5053
+ });
5054
+ const mediaLocalRoots = getAgentScopedMediaLocalRoots(cfg, effectiveRoute.agentId);
5055
+ if (policy?.isCurrent() === false) {
5056
+ await respond("Access policy changed. Try this interaction again.", { ephemeral: true });
5057
+ return { accepted: false };
5058
+ }
5059
+ const authority = createDiscordNativeCommandAuthority({
5060
+ cfg,
5061
+ ctx: ctxPayload,
5062
+ commandAuthorized,
5063
+ sender,
5064
+ allowNameMatching,
5065
+ isPolicyCurrent: policy?.isCurrent,
5066
+ accountId,
5067
+ guildId: interaction.guild?.id,
5068
+ commandName,
5069
+ pluginCommand: params.pluginCommandDispatch.kind === "plugin"
5070
+ });
5071
+ if (!authority.isAllowed()) {
5072
+ await respond("You are not authorized to use this command.", { ephemeral: true });
5073
+ return { accepted: false };
5074
+ }
5075
+ const bindingReadiness = routeState.configuredBinding && !shouldBypassConfiguredAcpEnsure(commandName) ? await nativeCommandRuntime.ensureConfiguredBindingRouteReady({
5076
+ cfg,
5077
+ bindingResolution: routeState.configuredBinding,
5078
+ assertActive: authority.assertActive
5079
+ }) : null;
5080
+ if (!authority.isAllowed()) {
4908
5081
  await respond("You are not authorized to use this command.", { ephemeral: true });
4909
5082
  return { accepted: false };
4910
5083
  }
4911
5084
  const isGuild = Boolean(interaction.guild);
4912
5085
  const channelId = rawChannelId || "unknown";
4913
5086
  const menuNeedsModelContext = !(commandArgs?.raw && !commandArgs.values) && command.args?.some((arg) => typeof arg.choices === "function" && commandArgs?.values?.[arg.name] == null);
4914
- const menuModelContext = menuNeedsModelContext ? await resolveDiscordNativeChoiceContext({
5087
+ const menuModelContext = menuNeedsModelContext && bindingReadiness?.ok !== false ? await resolveDiscordNativeChoiceContext({
4915
5088
  interaction,
4916
5089
  cfg,
4917
5090
  accountId,
4918
- threadBindings
5091
+ threadBindings,
5092
+ route: effectiveRoute
4919
5093
  }) : null;
4920
5094
  const menuModelCatalog = command.key === "think" && menuNeedsModelContext ? await loadPreparedModelCatalog({
4921
5095
  config: cfg,
@@ -4925,17 +5099,20 @@ async function dispatchDiscordCommandInteraction(params) {
4925
5099
  } : {},
4926
5100
  readOnly: true
4927
5101
  }) : void 0;
4928
- const menuRouteState = command.key === "verbose" ? await getNativeRouteState() : void 0;
4929
- const menu = menuRouteState?.bindingReadiness?.ok === false ? null : resolveCommandArgMenu({
5102
+ const menu = command.key === "verbose" && bindingReadiness?.ok === false ? null : resolveCommandArgMenu({
4930
5103
  command,
4931
5104
  args: commandArgs,
4932
5105
  cfg,
4933
- session: menuRouteState?.effectiveRoute,
5106
+ session: command.key === "verbose" ? effectiveRoute : void 0,
4934
5107
  provider: menuModelContext?.provider,
4935
5108
  model: menuModelContext?.model,
4936
5109
  agentRuntime: menuModelContext?.agentRuntime,
4937
5110
  catalog: menuModelCatalog
4938
5111
  });
5112
+ if (policy?.isCurrent() === false) {
5113
+ await respond("Access policy changed. Try this interaction again.", { ephemeral: true });
5114
+ return { accepted: false };
5115
+ }
4939
5116
  if (menu) {
4940
5117
  const menuPayload = buildDiscordCommandArgMenu({
4941
5118
  command,
@@ -4947,6 +5124,7 @@ async function dispatchDiscordCommandInteraction(params) {
4947
5124
  accountId,
4948
5125
  sessionPrefix,
4949
5126
  threadBindings,
5127
+ buildContext,
4950
5128
  dispatchReplyFromConfig
4951
5129
  },
4952
5130
  safeInteractionCall: safeDiscordInteractionCall,
@@ -4974,19 +5152,20 @@ async function dispatchDiscordCommandInteraction(params) {
4974
5152
  }
4975
5153
  const messageThreadId = !isDirectMessage && isThreadChannel ? channelId : void 0;
4976
5154
  const pluginThreadParentId = !isDirectMessage && isThreadChannel ? threadParentId : void 0;
4977
- const routeState = await getNativeRouteState();
4978
- const { effectiveRoute } = routeState;
4979
5155
  const pluginCommandAgentId = (isThreadChannel ? threadBindings.getByThreadId(rawChannelId)?.agentId : void 0) || routeState.configuredBinding?.statefulTarget.agentId || effectiveRoute.agentId;
4980
5156
  const targetSessionEntry = nativeCommandRuntime.getSessionEntry({
4981
5157
  agentId: pluginCommandAgentId,
4982
5158
  sessionKey: effectiveRoute.sessionKey
4983
5159
  });
5160
+ authority.assertActive();
5161
+ const senderIsOwner = authority.senderIsOwner();
4984
5162
  const pluginReply = await params.pluginCommandDispatch.execute({
4985
5163
  senderId: sender.id,
4986
5164
  channel: "discord",
4987
5165
  channelId,
4988
5166
  isAuthorizedSender: commandAuthorized,
4989
- senderIsOwner: senderIsCommandOwner,
5167
+ senderIsOwner,
5168
+ ...senderIsOwner ? { assertOwnerCurrent: authority.assertOwnerCurrent } : {},
4990
5169
  agentId: pluginCommandAgentId,
4991
5170
  sessionKey: effectiveRoute.sessionKey,
4992
5171
  authProfileId: targetSessionEntry?.authProfileOverride,
@@ -5047,58 +5226,14 @@ async function dispatchDiscordCommandInteraction(params) {
5047
5226
  });
5048
5227
  return { accepted: true };
5049
5228
  }
5050
- const interactionId = interaction.rawData.id;
5051
- const routeState = await getNativeRouteState();
5052
- if (routeState.bindingReadiness && !routeState.bindingReadiness.ok) {
5229
+ if (bindingReadiness && !bindingReadiness.ok) {
5053
5230
  const configuredBinding = routeState.configuredBinding;
5054
5231
  if (configuredBinding) {
5055
- logVerbose(`discord native command: configured ACP binding unavailable for channel ${configuredBinding.record.conversation.conversationId}: ${routeState.bindingReadiness.error}`);
5232
+ logVerbose(`discord native command: configured ACP binding unavailable for channel ${configuredBinding.record.conversation.conversationId}: ${bindingReadiness.error}`);
5056
5233
  await respond("Configured ACP binding is unavailable right now. Please try again.");
5057
5234
  return { accepted: false };
5058
5235
  }
5059
5236
  }
5060
- const boundSessionKey = routeState.boundSessionKey;
5061
- const effectiveRoute = routeState.effectiveRoute;
5062
- const { sessionKey, commandTargetSessionKey } = resolveNativeCommandSessionTargets({
5063
- agentId: effectiveRoute.agentId,
5064
- sessionPrefix,
5065
- userId: user.id,
5066
- targetSessionKey: effectiveRoute.sessionKey,
5067
- boundSessionKey
5068
- });
5069
- const mediaLocalRoots = getAgentScopedMediaLocalRoots(cfg, effectiveRoute.agentId);
5070
- const ctxPayload = buildDiscordNativeCommandContext({
5071
- prompt,
5072
- commandArgs: commandArgs ?? {},
5073
- sessionKey,
5074
- commandTargetSessionKey,
5075
- accountId: effectiveRoute.accountId,
5076
- interactionId,
5077
- channelId,
5078
- threadParentId,
5079
- memberRoleIds,
5080
- guildId: interaction.guild?.id,
5081
- guildName: interaction.guild?.name,
5082
- channelTopic: resolveDiscordChannelTopicSafe(channel),
5083
- channelConfig,
5084
- guildInfo,
5085
- allowNameMatching,
5086
- commandAuthorized,
5087
- isDirectMessage,
5088
- isGroupDm,
5089
- isGuild,
5090
- isThreadChannel,
5091
- user: {
5092
- id: user.id,
5093
- username: user.username,
5094
- globalName: user.globalName
5095
- },
5096
- sender: {
5097
- id: sender.id,
5098
- name: sender.name,
5099
- tag: sender.tag
5100
- }
5101
- });
5102
5237
  const directStatusResult = await maybeDeliverDiscordDirectStatus({
5103
5238
  commandName,
5104
5239
  suppressReplies,
@@ -5110,7 +5245,7 @@ async function dispatchDiscordCommandInteraction(params) {
5110
5245
  commandTargetSessionKey,
5111
5246
  channel: "discord",
5112
5247
  senderId: sender.id,
5113
- senderIsOwner: senderIsCommandOwner,
5248
+ senderIsOwner: authority.senderIsOwner(),
5114
5249
  isAuthorizedSender: commandAuthorized,
5115
5250
  isGroup: isGuild || isGroupDm,
5116
5251
  defaultGroupActivation: () => !isGuild ? "always" : channelConfig?.requireMention === false ? "always" : "mention",
@@ -7096,7 +7231,7 @@ async function runDiscordGatewayLifecycle(params) {
7096
7231
  let discordVoiceRuntimePromise;
7097
7232
  let discordProviderSessionRuntimePromise;
7098
7233
  async function loadDiscordVoiceRuntime() {
7099
- const promise = discordVoiceRuntimePromise ?? import("./voice-runtime-DHVQ2mFz.mjs").then((n) => n.t);
7234
+ const promise = discordVoiceRuntimePromise ?? import("./voice-runtime-elTtjEIG.mjs").then((n) => n.t);
7100
7235
  discordVoiceRuntimePromise = promise;
7101
7236
  try {
7102
7237
  return await promise;
@@ -7106,7 +7241,7 @@ async function loadDiscordVoiceRuntime() {
7106
7241
  }
7107
7242
  }
7108
7243
  async function loadDiscordProviderSessionRuntime() {
7109
- const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-BW7QrF5C.mjs");
7244
+ const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-DrGAYnZv.mjs");
7110
7245
  discordProviderSessionRuntimePromise = promise;
7111
7246
  try {
7112
7247
  return await promise;
@@ -9157,7 +9292,7 @@ async function dispatchPluginDiscordInteractiveEvent(params) {
9157
9292
  }
9158
9293
  //#endregion
9159
9294
  //#region extensions/discord/src/monitor/agent-components.handlers.ts
9160
- const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-MqMWUWnE.mjs").then((n) => n.t));
9295
+ const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-yBEb75bB.mjs").then((n) => n.t));
9161
9296
  async function handleDiscordComponentEvent(params) {
9162
9297
  const parsed = parseDiscordComponentData(params.data, resolveInteractionCustomId(params.interaction));
9163
9298
  if (!parsed) {
@@ -9874,6 +10009,7 @@ function createDiscordProviderInteractionSurface(params) {
9874
10009
  sessionPrefix: params.sessionPrefix,
9875
10010
  ephemeralDefault: params.ephemeralDefault,
9876
10011
  threadBindings: params.threadBindings,
10012
+ buildContext: params.channelRuntime?.inbound.buildContext,
9877
10013
  dispatchReplyFromConfig: params.channelRuntime?.reply?.dispatchReplyFromConfig
9878
10014
  });
9879
10015
  });
@@ -9922,6 +10058,7 @@ function createDiscordProviderInteractionSurface(params) {
9922
10058
  accountId: params.accountId,
9923
10059
  sessionPrefix: params.sessionPrefix,
9924
10060
  threadBindings: params.threadBindings,
10061
+ buildContext: params.channelRuntime?.inbound.buildContext,
9925
10062
  dispatchReplyFromConfig: params.channelRuntime?.reply?.dispatchReplyFromConfig
9926
10063
  }),
9927
10064
  createDiscordModelPickerFallbackButton({
@@ -9931,6 +10068,7 @@ function createDiscordProviderInteractionSurface(params) {
9931
10068
  accountId: params.accountId,
9932
10069
  sessionPrefix: params.sessionPrefix,
9933
10070
  threadBindings: params.threadBindings,
10071
+ buildContext: params.channelRuntime?.inbound.buildContext,
9934
10072
  dispatchReplyFromConfig: params.channelRuntime?.reply?.dispatchReplyFromConfig
9935
10073
  }),
9936
10074
  createDiscordModelPickerFallbackSelect({
@@ -9940,6 +10078,7 @@ function createDiscordProviderInteractionSurface(params) {
9940
10078
  accountId: params.accountId,
9941
10079
  sessionPrefix: params.sessionPrefix,
9942
10080
  threadBindings: params.threadBindings,
10081
+ buildContext: params.channelRuntime?.inbound.buildContext,
9943
10082
  dispatchReplyFromConfig: params.channelRuntime?.reply?.dispatchReplyFromConfig
9944
10083
  })
9945
10084
  ];
@@ -10015,7 +10154,7 @@ var VoicePlugin = class extends Plugin {
10015
10154
  }
10016
10155
  },
10017
10156
  destroy: () => {
10018
- this.adapters.delete(guildId);
10157
+ if (this.adapters.get(guildId) === methods) this.adapters.delete(guildId);
10019
10158
  }
10020
10159
  };
10021
10160
  };
@@ -10456,7 +10595,7 @@ async function monitorDiscordProvider(opts = {}) {
10456
10595
  let allowFrom = configuredDmAllowFrom ?? [];
10457
10596
  const mediaMaxBytes = (opts.mediaMaxMb ?? discordCfg.mediaMaxMb ?? DEFAULT_DISCORD_MEDIA_MAX_MB) * 1024 * 1024;
10458
10597
  const textLimit = resolveTextChunkLimit(cfg, "discord", account.accountId, { fallbackLimit: 2e3 });
10459
- const historyLimit = Math.max(0, opts.historyLimit ?? discordCfg.historyLimit ?? cfg.messages?.groupChat?.historyLimit ?? 20);
10598
+ const historyLimit = resolvePromptHistoryLimit(opts.historyLimit ?? discordCfg.historyLimit ?? cfg.messages?.groupChat?.historyLimit, 20);
10460
10599
  const replyToMode = opts.replyToMode ?? discordCfg.replyToMode ?? "off";
10461
10600
  const dmEnabled = dmConfig?.enabled ?? true;
10462
10601
  const dmPolicy = resolveDiscordAccountDmPolicy({