@openclaw/discord 2026.8.1-beta.3 → 2026.9.1-beta.1

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 (268) hide show
  1. package/dist/{account-inspect-D5xmUpnj.js → account-inspect-BDfKyuvL.js} +1 -1
  2. package/dist/account-inspect-api.js +1 -1
  3. package/dist/{accounts-DNl-oCEw.js → accounts-CfQ-vSyf.js} +5 -124
  4. package/dist/action-runtime-api.js +1 -1
  5. package/dist/{activities-api-KCBAmWxD.js → activities-api-q-9PaaHH.js} +5 -4
  6. package/dist/activities-api.js +1 -1
  7. package/dist/api.js +15 -15
  8. package/dist/{approval-handler.runtime-B12RCYr8.js → approval-handler.runtime-B7qhK3fR.js} +28 -105
  9. package/dist/{audit-Yc7eZDd6.js → audit-CBEv_ERu.js} +5 -5
  10. package/dist/{channel-cXYzGc4L.js → channel-Dx1tMTfx.js} +18 -20
  11. package/dist/{channel-actions.runtime-CODTvo7c.js → channel-actions.runtime-CLWWu9nC.js} +56 -56
  12. package/dist/channel-config-api.js +1 -1
  13. package/dist/channel-plugin-api.js +1 -1
  14. package/dist/channel-type-CVLZyGYS.js +7 -0
  15. package/dist/{channel.setup-CSiwnMgs.js → channel.setup-DOzXS2Pk.js} +5 -5
  16. package/dist/{components-ezGKo_Yh.js → components-B9V5o361.js} +6 -22
  17. package/dist/{conversation-binding-route-D6rCQ5S0.js → conversation-binding-route-DJYrY2TQ.js} +1 -1
  18. package/dist/{directory-config-XyCfoqLg.js → directory-config-BK6eqekJ.js} +2 -2
  19. package/dist/directory-contract-api.js +1 -1
  20. package/dist/{directory-live-Df0NbFJB.js → directory-live-DSAJSrJk.js} +2 -2
  21. package/dist/{doctor-DYY31GrO.js → doctor-Cm7Y1pJ2.js} +4 -4
  22. package/dist/doctor-contract-api.js +1 -1
  23. package/dist/{handle-action.guild-admin-6Tvvinsa.js → handle-action.guild-admin-BdwCRHmm.js} +9 -5
  24. package/dist/index.js +1 -1
  25. package/dist/{message-handler-B61q5MOF.js → message-handler-BXpWZyni.js} +5 -5
  26. package/dist/{message-handler.preflight-Bzg_Hawz.js → message-handler.preflight-Ba5LAY_X.js} +13 -15
  27. package/dist/{message-handler.process--4_712Ec.js → message-handler.process-3HEzmemS.js} +59 -65
  28. package/dist/{message-utils-BXLLnFl6.js → message-text-aiwO5R2F.js} +32 -30
  29. package/dist/{outbound-adapter-DxHTOqiN.js → outbound-adapter-BE4jSq2d.js} +53 -58
  30. package/dist/{outbound-components-B2PL0ooH.js → outbound-components-oLpg8Qzb.js} +3 -3
  31. package/dist/outbound-session-route-Cg15ZFJd.js +625 -0
  32. package/dist/{owner-access-Bg41VzAf.js → owner-access-UlYi9t0M.js} +1 -1
  33. package/dist/{pluralkit-dUl4v1X3.js → pluralkit-Tiyl70dx.js} +1 -1
  34. package/dist/{probe-BTdtVRwU.js → probe-n6ZXxK8V.js} +1 -1
  35. package/dist/{probe.runtime-Dq5-PRKT.js → probe.runtime-CN4bdPfZ.js} +1 -1
  36. package/dist/{provider-DlK_ynqt.js → provider-B11xwilq.js} +244 -238
  37. package/dist/{provider-session.runtime-CvvphHvs.js → provider-session.runtime-B9xe-Qaf.js} +3 -3
  38. package/dist/provider.runtime-DiYaHvOz.js +2 -0
  39. package/dist/{realtime-session.runtime-ysbMG8v7.js → realtime-session.runtime-CU8IQUS-.js} +74 -86
  40. package/dist/{resolve-allowlist-common-DIVXbD1P.js → resolve-allowlist-common-BLoYaxEG.js} +1 -1
  41. package/dist/{resolve-channels-CGeUoIqb.js → resolve-channels-C2sT_n67.js} +4 -3
  42. package/dist/{resolve-users-BtKxLUZv.js → resolve-users-CzpjLwjy.js} +2 -2
  43. package/dist/{retry-DNsVTeTo.js → retry-Cv4jCU5Z.js} +144 -5
  44. package/dist/{runtime-D71_VFLr.js → runtime-BHrTlFkf.js} +72 -55
  45. package/dist/{runtime-CQovMsH3.js → runtime-CY4PRMF-.js} +2 -2
  46. package/dist/runtime-api.js +16 -23
  47. package/dist/{sdk-runtime-37OU6_Yh.js → sdk-runtime-4geQHtXc.js} +55 -86
  48. package/dist/{send-rQIffSYu.js → send-C49MFF9j.js} +78 -15
  49. package/dist/{send.components-ChK1wS7w.js → send.components-DKKAw5VX.js} +14 -21
  50. package/dist/{send.outbound-HIkgji_7.js → send.outbound-zam0TrZx.js} +58 -69
  51. package/dist/{send.shared-B3fpaLWJ.js → send.shared-JjljcV4O.js} +35 -20
  52. package/dist/setup-plugin-api.js +1 -1
  53. package/dist/{shared-CaAaoksy.js → shared-_5EcP4jW.js} +27 -8
  54. package/dist/{subagent-hooks-CNT2ZJTJ.js → subagent-hooks-DQzvOptn.js} +2 -2
  55. package/dist/subagent-hooks-api.js +1 -6
  56. package/dist/{system-events-Nuwoq_au.js → system-events-C7yxaHWP.js} +1 -1
  57. package/dist/{target-resolver-DIXShHaZ.js → target-resolver-vxIh6O3-.js} +3 -3
  58. package/dist/targets-CtTKvntJ.js +3 -0
  59. package/dist/{thread-bindings-VlymUnbz.js → thread-bindings-DW5F9vat.js} +3 -4
  60. package/dist/{thread-bindings.manager-CngsgErq.js → thread-bindings.manager-ByOtwjo_.js} +6 -10
  61. package/dist/{threading-DU6pgeGm.js → threading-agH1T_6s.js} +47 -25
  62. package/dist/{transcripts-source-DeIMNbRh.js → transcripts-source-BR11iHA4.js} +3 -3
  63. package/dist/transcripts-source-api.js +1 -1
  64. package/dist/{typing-oLiS5Z13.js → typing-Dc_YMY2e.js} +1 -1
  65. package/dist/{voice-runtime-CjNFaynA.js → voice-runtime-DIeaa8fJ.js} +56 -64
  66. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/README.md +19 -19
  67. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v1.js +7 -3
  68. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v7.js +5 -2
  69. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v1.js +7 -3
  70. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v7.js +5 -2
  71. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/package.json +4 -3
  72. package/node_modules/@discordjs/voice/node_modules/@types/node/README.md +1 -1
  73. package/node_modules/@discordjs/voice/node_modules/@types/node/child_process.d.ts +0 -1
  74. package/node_modules/@discordjs/voice/node_modules/@types/node/crypto.d.ts +6 -6
  75. package/node_modules/@discordjs/voice/node_modules/@types/node/dns/promises.d.ts +5 -5
  76. package/node_modules/@discordjs/voice/node_modules/@types/node/dns.d.ts +5 -5
  77. package/node_modules/@discordjs/voice/node_modules/@types/node/fs.d.ts +7 -0
  78. package/node_modules/@discordjs/voice/node_modules/@types/node/http.d.ts +30 -0
  79. package/node_modules/@discordjs/voice/node_modules/@types/node/http2.d.ts +4 -4
  80. package/node_modules/@discordjs/voice/node_modules/@types/node/os.d.ts +30 -30
  81. package/node_modules/@discordjs/voice/node_modules/@types/node/package.json +2 -2
  82. package/node_modules/@discordjs/voice/node_modules/@types/node/perf_hooks.d.ts +2 -1
  83. package/node_modules/@discordjs/voice/node_modules/@types/node/process.d.ts +42 -43
  84. package/node_modules/@discordjs/voice/node_modules/@types/node/quic.d.ts +1049 -84
  85. package/node_modules/@discordjs/voice/node_modules/@types/node/sqlite.d.ts +14 -1
  86. package/node_modules/@discordjs/voice/node_modules/@types/node/stream/iter.d.ts +3 -2
  87. package/node_modules/@discordjs/voice/node_modules/@types/node/test.d.ts +61 -0
  88. package/node_modules/@discordjs/voice/node_modules/@types/node/v8.d.ts +20 -23
  89. package/node_modules/discord-api-types/CHANGELOG.md +8 -0
  90. package/node_modules/discord-api-types/package.json +4 -4
  91. package/node_modules/discord-api-types/payloads/v10/channel.d.ts +2 -2
  92. package/node_modules/discord-api-types/payloads/v10/channel.d.ts.map +1 -1
  93. package/node_modules/discord-api-types/payloads/v10/gateway.d.ts +4 -0
  94. package/node_modules/discord-api-types/payloads/v10/gateway.d.ts.map +1 -1
  95. package/node_modules/discord-api-types/payloads/v10/gateway.js.map +1 -1
  96. package/node_modules/discord-api-types/payloads/v10/message.d.ts +4 -1
  97. package/node_modules/discord-api-types/payloads/v10/message.d.ts.map +1 -1
  98. package/node_modules/discord-api-types/payloads/v10/message.js +1 -0
  99. package/node_modules/discord-api-types/payloads/v10/message.js.map +1 -1
  100. package/node_modules/discord-api-types/payloads/v9/channel.d.ts +2 -2
  101. package/node_modules/discord-api-types/payloads/v9/channel.d.ts.map +1 -1
  102. package/node_modules/discord-api-types/payloads/v9/gateway.d.ts +4 -0
  103. package/node_modules/discord-api-types/payloads/v9/gateway.d.ts.map +1 -1
  104. package/node_modules/discord-api-types/payloads/v9/gateway.js.map +1 -1
  105. package/node_modules/discord-api-types/payloads/v9/message.d.ts +4 -1
  106. package/node_modules/discord-api-types/payloads/v9/message.d.ts.map +1 -1
  107. package/node_modules/discord-api-types/payloads/v9/message.js +1 -0
  108. package/node_modules/discord-api-types/payloads/v9/message.js.map +1 -1
  109. package/node_modules/typebox/build/format/date.d.mts +1 -1
  110. package/node_modules/typebox/build/format/date.mjs +1 -1
  111. package/node_modules/typebox/build/format/date_time.d.mts +2 -2
  112. package/node_modules/typebox/build/format/date_time.mjs +3 -3
  113. package/node_modules/typebox/build/format/email.d.mts +1 -1
  114. package/node_modules/typebox/build/format/email.mjs +2 -2
  115. package/node_modules/typebox/build/format/hostname.mjs +2 -10
  116. package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
  117. package/node_modules/typebox/build/format/idn_email.mjs +3 -3
  118. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
  119. package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
  120. package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
  121. package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
  122. package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
  123. package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
  124. package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
  125. package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
  126. package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
  127. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
  128. package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
  129. package/node_modules/typebox/build/format/idna/index.mjs +2 -0
  130. package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
  131. package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
  132. package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
  133. package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
  134. package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
  135. package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
  136. package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
  137. package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
  138. package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
  139. package/node_modules/typebox/build/format/ipv4.mjs +2 -32
  140. package/node_modules/typebox/build/format/ipv6.mjs +2 -61
  141. package/node_modules/typebox/build/format/iri.d.mts +2 -2
  142. package/node_modules/typebox/build/format/iri.mjs +26 -8
  143. package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
  144. package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
  145. package/node_modules/typebox/build/format/regex.d.mts +1 -2
  146. package/node_modules/typebox/build/format/regex.mjs +2 -6
  147. package/node_modules/typebox/build/format/time.d.mts +2 -2
  148. package/node_modules/typebox/build/format/time.mjs +19 -14
  149. package/node_modules/typebox/build/format/uri.d.mts +1 -1
  150. package/node_modules/typebox/build/format/uri.mjs +3 -130
  151. package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
  152. package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
  153. package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
  154. package/node_modules/typebox/build/format/uri_template.mjs +4 -5
  155. package/node_modules/typebox/build/format/url.d.mts +3 -3
  156. package/node_modules/typebox/build/format/url.mjs +4 -5
  157. package/node_modules/typebox/build/guard/emit.d.mts +3 -1
  158. package/node_modules/typebox/build/guard/emit.mjs +12 -5
  159. package/node_modules/typebox/build/guard/guard.d.mts +8 -2
  160. package/node_modules/typebox/build/guard/guard.mjs +25 -4
  161. package/node_modules/typebox/build/guard/string.d.mts +2 -2
  162. package/node_modules/typebox/build/guard/string.mjs +7 -7
  163. package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
  164. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
  165. package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
  166. package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
  167. package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
  168. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
  169. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
  170. package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
  171. package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
  172. package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
  173. package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
  174. package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
  175. package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
  176. package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
  177. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
  178. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
  179. package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
  180. package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
  181. package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
  182. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
  183. package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
  184. package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
  185. package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
  186. package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
  187. package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
  188. package/node_modules/typebox/build/schema/types/index.mjs +0 -2
  189. package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
  190. package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
  191. package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
  192. package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
  193. package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
  194. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
  195. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
  196. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
  197. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
  198. package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
  199. package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
  200. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
  201. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
  202. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
  203. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
  204. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
  205. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
  206. package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
  207. package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
  208. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
  209. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
  210. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
  211. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
  212. package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
  213. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
  214. package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
  215. package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
  216. package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
  217. package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
  218. package/node_modules/typebox/build/type/script/parser.mjs +27 -23
  219. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  220. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  221. package/node_modules/typebox/package.json +27 -27
  222. package/node_modules/typebox/readme.md +79 -82
  223. package/node_modules/undici/docs/docs/api/Client.md +21 -8
  224. package/node_modules/undici/lib/api/readable.js +33 -43
  225. package/node_modules/undici/lib/core/connect.js +16 -2
  226. package/node_modules/undici/lib/core/symbols.js +1 -0
  227. package/node_modules/undici/lib/dispatcher/client-h1.js +3 -3
  228. package/node_modules/undici/lib/dispatcher/client-h2.js +179 -10
  229. package/node_modules/undici/lib/dispatcher/client.js +74 -29
  230. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +28 -6
  231. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +15 -1
  232. package/node_modules/undici/lib/handler/retry-handler.js +7 -2
  233. package/node_modules/undici/lib/interceptor/cache.js +5 -2
  234. package/node_modules/undici/lib/interceptor/deduplicate.js +1 -1
  235. package/node_modules/undici/lib/mock/mock-utils.js +213 -24
  236. package/node_modules/undici/lib/util/cache.js +2 -4
  237. package/node_modules/undici/lib/web/websocket/websocket.js +22 -0
  238. package/node_modules/undici/package.json +1 -1
  239. package/node_modules/undici/types/client.d.ts +40 -0
  240. package/node_modules/ws/lib/permessage-deflate.js +3 -1
  241. package/node_modules/ws/package.json +1 -1
  242. package/package.json +8 -8
  243. package/dist/approval-message-safety-XGFPbDoI.js +0 -226
  244. package/dist/audit-core-BCX8UeFH.js +0 -105
  245. package/dist/channel-actions-Dr2QI8Bf.js +0 -212
  246. package/dist/inbound-event-delivery-De2qxTrP.js +0 -39
  247. package/dist/provider.runtime-CzKGRiAF.js +0 -2
  248. package/dist/runtime-api.actions.js +0 -3
  249. package/dist/runtime-api.lookup.js +0 -7
  250. package/dist/runtime-api.monitor-CzeTYF32.js +0 -6
  251. package/dist/runtime-api.monitor.js +0 -9
  252. package/dist/runtime-api.send.js +0 -7
  253. package/dist/runtime-api.threads.js +0 -5
  254. package/dist/send.reactions-gmJ6yFPo.js +0 -78
  255. package/dist/send.receipt-Cnhoautb.js +0 -76
  256. package/dist/subagent-progress-FPLqBY1s.js +0 -110
  257. package/dist/targets-B2pf49zc.js +0 -3
  258. package/node_modules/typebox/build/format/_idna.d.mts +0 -2
  259. package/node_modules/typebox/build/format/_idna.mjs +0 -246
  260. package/node_modules/typebox/build/format/_puny.d.mts +0 -1
  261. package/node_modules/typebox/build/format/_puny.mjs +0 -77
  262. package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
  263. package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
  264. package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
  265. package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
  266. package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
  267. package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
  268. package/dist/{config-schema-DC5kDtQ5.js → config-schema-BR13IAx6.js} +2 -2
@@ -1,22 +1,20 @@
1
- import { Ct as editChannelMessage, a as chunkDiscordTextWithMode, p as discord_exports, vt as createChannelMessage, xt as deleteChannelMessage } from "./retry-DNsVTeTo.js";
2
- import { A as resolveDiscordChannelId, p as resolveDiscordMaxLinesPerMessage } from "./accounts-DNl-oCEw.js";
1
+ import { Dt as deleteChannelMessage, a as chunkDiscordTextWithMode, kt as editChannelMessage, v as resolveDiscordChannelId, wt as createChannelMessage, y as discord_exports } from "./retry-Cv4jCU5Z.js";
2
+ import { p as resolveDiscordMaxLinesPerMessage } from "./accounts-CfQ-vSyf.js";
3
3
  import { C as resolveTimestampMs, a as normalizeDiscordSlug, r as normalizeDiscordAllowList } from "./allow-list-BDMimASD.js";
4
- import { A as resolveDiscordMessageFlags, F as createDiscordRestClient, I as createDiscordRuntimeAccountContext, d as resolveDiscordTargetChannelId } from "./send.shared-B3fpaLWJ.js";
5
- import { i as discordTextHasBroadcastMention } from "./send.outbound-HIkgji_7.js";
6
- import { c as editMessageDiscord } from "./send-rQIffSYu.js";
4
+ import { F as createDiscordRuntimeAccountContext, P as createDiscordRestClient, d as resolveDiscordTargetChannelId, k as resolveDiscordMessageFlags } from "./send.shared-JjljcV4O.js";
5
+ import { i as discordTextHasBroadcastMention } from "./send.outbound-zam0TrZx.js";
6
+ import { a as removeReactionDiscord, f as editMessageDiscord, r as reactMessageDiscord } from "./send-C49MFF9j.js";
7
7
  import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-B9cy6RvQ.js";
8
- import { i as removeReactionDiscord, n as reactMessageDiscord } from "./send.reactions-gmJ6yFPo.js";
9
- import "./targets-B2pf49zc.js";
10
- import { i as buildDiscordRoutePeer, l as resolveDiscordConversationIdentity } from "./approval-message-safety-XGFPbDoI.js";
11
- import { t as discordInboundEventDelivery } from "./inbound-event-delivery-De2qxTrP.js";
12
- import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-DxHTOqiN.js";
13
- import { a as sanitizeDiscordFrontChannelReplyPayloads, c as resolveReplyContext, h as createDiscordSupplementalContextAccessChecker, i as formatDiscordReplySkip, m as buildDiscordInboundAccessContext, n as deliverDiscordReply, o as buildDirectLabel, r as formatDiscordReplyDeliveryFailure, s as buildGuildLabel } from "./provider-DlK_ynqt.js";
14
- import { a as formatDiscordMediaText, c as resolveReferencedReplyMediaList, d as resolveDiscordMessageStickers, i as resolveDiscordMessageText } from "./message-utils-BXLLnFl6.js";
15
- import { a as resolveDiscordThreadStarter, n as resolveDiscordAutoThreadReplyPlan } from "./threading-DU6pgeGm.js";
8
+ import "./targets-CtTKvntJ.js";
9
+ import { a as buildDiscordRoutePeer, h as discordInboundEventDelivery, u as resolveDiscordConversationIdentity } from "./outbound-session-route-Cg15ZFJd.js";
10
+ import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-BE4jSq2d.js";
11
+ import { a as sanitizeDiscordFrontChannelReplyPayloads, c as resolveReplyContext, h as createDiscordSupplementalContextAccessChecker, i as formatDiscordReplySkip, m as buildDiscordInboundAccessContext, n as deliverDiscordReply, o as buildDirectLabel, r as formatDiscordReplyDeliveryFailure, s as buildGuildLabel } from "./provider-B11xwilq.js";
12
+ import { a as formatDiscordMediaText, c as resolveReferencedReplyMediaList, i as resolveDiscordMessageText, u as resolveDiscordMessageStickers } from "./message-text-aiwO5R2F.js";
13
+ import { a as resolveDiscordThreadStarter, n as resolveDiscordAutoThreadReplyPlan } from "./threading-agH1T_6s.js";
16
14
  import { n as resolveDiscordWebhookId } from "./sender-identity-BJtfyise.js";
17
15
  import { t as beginDiscordActiveTurnThreadRoute } from "./active-turn-thread-route-fmHl1HNd.js";
18
16
  import { n as filterDiscordHistoryEntriesForContext, t as createDiscordHistorySenderProvenance } from "./message-handler.history-CJOsN9w5.js";
19
- import { t as sendTyping } from "./typing-oLiS5Z13.js";
17
+ import { t as sendTyping } from "./typing-Dc_YMY2e.js";
20
18
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
21
19
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
22
20
  import { buildAgentSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
@@ -25,7 +23,7 @@ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
25
23
  import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
26
24
  import { resolveChunkMode } from "openclaw/plugin-sdk/reply-chunking";
27
25
  import { convertMarkdownTables, stripInlineDirectiveTagsForDelivery, stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
28
- import { bindIngressLifecycleToReplyOptions, buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelMessageReplyPipeline, createChannelProgressDraftCompositor, createFinalizableDraftLifecycle, createTypingCallbacks, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, resolveChannelDraftStreamingChunking, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelPreviewStreamMode, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewCommandText, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingProgressNarration, resolveChannelStreamingSuppressDefaultToolProgressMessages, resolveTranscriptBackedChannelFinalText } from "openclaw/plugin-sdk/channel-outbound";
26
+ import { bindIngressLifecycleToReplyOptions, buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelMessageReplyPipeline, createChannelProgressDraftCompositor, createFinalizableDraftStreamControlsForState, createTypingCallbacks, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, resolveChannelDraftStreamingChunking, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelPreviewStreamMode, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewCommandText, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingProgressNarration, resolveChannelStreamingSuppressDefaultToolProgressMessages, resolveTranscriptBackedChannelFinalText } from "openclaw/plugin-sdk/channel-outbound";
29
27
  import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-runtime";
30
28
  import { getReplyPayloadTtsSupplement, isReplyPayloadNonTerminalToolErrorWarning, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
31
29
  import { evaluateSupplementalContextVisibility } from "openclaw/plugin-sdk/security-runtime";
@@ -199,6 +197,7 @@ async function buildDiscordMessageProcessContext(params) {
199
197
  const starter = await resolveDiscordThreadStarter({
200
198
  channel: threadChannel,
201
199
  client,
200
+ accountId,
202
201
  parentId: threadParentId,
203
202
  parentType: threadParentType,
204
203
  resolveTimestampMs
@@ -792,7 +791,7 @@ function createDiscordDraftStream(params) {
792
791
  let streamGeneration = 0;
793
792
  let activeCreateGeneration;
794
793
  let discardActiveCreate = false;
795
- let retargetedCleanup = [];
794
+ let pendingCleanupMessages = [];
796
795
  const sendOrEditStreamMessage = async (text) => {
797
796
  const generation = streamGeneration;
798
797
  if (streamState.stopped && !streamState.final) return false;
@@ -833,11 +832,11 @@ function createDiscordDraftStream(params) {
833
832
  activeCreateGeneration = void 0;
834
833
  discardActiveCreate = false;
835
834
  if (generation !== streamGeneration) {
836
- if (shouldDiscardStaleCreate && typeof sentMessageId === "string" && sentMessageId) try {
837
- await deleteChannelMessage(rest, channelId, sentMessageId);
838
- } catch (err) {
839
- params.warn?.(`discord stale stream preview cleanup failed: ${formatErrorMessage(err)}`);
840
- }
835
+ if (shouldDiscardStaleCreate && typeof sentMessageId === "string" && sentMessageId) await deleteCleanupMessage({
836
+ channelId,
837
+ messageId: sentMessageId,
838
+ warnPrefix: "discord stale stream preview cleanup failed"
839
+ });
841
840
  return true;
842
841
  }
843
842
  if (typeof sentMessageId !== "string" || !sentMessageId) {
@@ -858,24 +857,10 @@ function createDiscordDraftStream(params) {
858
857
  return false;
859
858
  }
860
859
  };
861
- const readMessageId = () => streamMessageId;
862
- const clearMessageId = () => {
863
- streamMessageId = void 0;
864
- };
865
- const isValidStreamMessageId = (value) => typeof value === "string";
866
- const deleteStreamMessage = async (messageId) => {
867
- await deleteChannelMessage(rest, channelId, messageId);
868
- };
869
- const { loop, update, stop, clear, discardPending, seal } = createFinalizableDraftLifecycle({
860
+ const { loop, update, stop, discardPending, seal } = createFinalizableDraftStreamControlsForState({
870
861
  throttleMs,
871
862
  state: streamState,
872
- sendOrEditStreamMessage,
873
- readMessageId,
874
- clearMessageId,
875
- isValidMessageId: isValidStreamMessageId,
876
- deleteMessage: deleteStreamMessage,
877
- warn: params.warn,
878
- warnPrefix: "discord stream preview cleanup failed"
863
+ sendOrEditStreamMessage
879
864
  });
880
865
  const forceNewMessage = (mode = "preserve") => {
881
866
  if (mode === "discard" && activeCreateGeneration !== void 0) discardActiveCreate = true;
@@ -887,16 +872,19 @@ function createDiscordDraftStream(params) {
887
872
  loop.resetPending();
888
873
  loop.resetThrottleWindow();
889
874
  };
890
- const cleanupRetargeted = async () => {
891
- const pending = retargetedCleanup;
892
- retargetedCleanup = [];
893
- for (const stale of pending) try {
894
- await deleteChannelMessage(rest, stale.channelId, stale.messageId);
875
+ const deleteCleanupMessage = async (message) => {
876
+ try {
877
+ await deleteChannelMessage(rest, message.channelId, message.messageId);
895
878
  } catch (err) {
896
- retargetedCleanup.push(stale);
897
- params.warn?.(`discord stream preview retarget cleanup failed: ${formatErrorMessage(err)}`);
879
+ pendingCleanupMessages.push(message);
880
+ params.warn?.(`${message.warnPrefix}: ${formatErrorMessage(err)}`);
898
881
  }
899
882
  };
883
+ const cleanupPendingMessages = async () => {
884
+ const pending = pendingCleanupMessages;
885
+ pendingCleanupMessages = [];
886
+ for (const message of pending) await deleteCleanupMessage(message);
887
+ };
900
888
  const retarget = async (nextChannelId) => {
901
889
  const normalized = nextChannelId.trim();
902
890
  if (!normalized || normalized === channelId) return;
@@ -919,33 +907,33 @@ function createDiscordDraftStream(params) {
919
907
  if (previousMessageId) {
920
908
  const stale = {
921
909
  channelId: previousChannelId,
922
- messageId: previousMessageId
910
+ messageId: previousMessageId,
911
+ warnPrefix: "discord stream preview retarget cleanup failed"
923
912
  };
924
913
  if (!streamMessageId) {
925
- retargetedCleanup.push(stale);
914
+ pendingCleanupMessages.push(stale);
926
915
  throw new Error("discord stream preview retarget replacement failed");
927
916
  }
928
- try {
929
- await deleteChannelMessage(rest, previousChannelId, previousMessageId);
930
- } catch (err) {
931
- retargetedCleanup.push(stale);
932
- params.warn?.(`discord stream preview retarget cleanup failed: ${formatErrorMessage(err)}`);
933
- }
917
+ await deleteCleanupMessage(stale);
934
918
  }
935
919
  };
936
920
  const deleteCurrentMessage = async () => {
937
921
  loop.resetPending();
938
922
  await loop.waitForInFlight();
939
- const messageId = streamMessageId;
923
+ const currentMessage = streamMessageId ? {
924
+ channelId,
925
+ messageId: streamMessageId,
926
+ warnPrefix: "discord stream preview cleanup failed"
927
+ } : void 0;
940
928
  streamMessageId = void 0;
941
929
  lastSentText = "";
942
930
  loop.resetThrottleWindow();
943
- if (!isValidStreamMessageId(messageId)) return;
944
- try {
945
- await deleteStreamMessage(messageId);
946
- } catch (err) {
947
- params.warn?.(`discord stream preview cleanup failed: ${formatErrorMessage(err)}`);
948
- }
931
+ if (!currentMessage) return;
932
+ await deleteCleanupMessage(currentMessage);
933
+ };
934
+ const clear = async () => {
935
+ await discardPending();
936
+ await deleteCurrentMessage();
949
937
  };
950
938
  params.log?.(`discord stream preview ready (maxChars=${maxChars}, throttleMs=${throttleMs})`);
951
939
  return {
@@ -958,7 +946,7 @@ function createDiscordDraftStream(params) {
958
946
  seal,
959
947
  stop,
960
948
  retarget,
961
- cleanupRetargeted,
949
+ cleanupPendingMessages,
962
950
  forceNewMessage
963
951
  };
964
952
  }
@@ -1232,7 +1220,7 @@ function createDiscordDraftPreviewController(params) {
1232
1220
  progressDraft.cancel();
1233
1221
  if (finalReplyError !== false) await draftStream?.discardPending();
1234
1222
  if (finalReplyError !== true && !finalizedViaPreviewMessage && draftStream?.messageId()) await draftStream.clear();
1235
- await draftStream?.cleanupRetargeted();
1223
+ await draftStream?.cleanupPendingMessages();
1236
1224
  } catch (err) {
1237
1225
  params.log(`discord: draft cleanup failed: ${String(err)}`);
1238
1226
  }
@@ -1609,7 +1597,8 @@ async function processDiscordMessageInner(ctx, observer) {
1609
1597
  threadBindings,
1610
1598
  mediaLocalRoots,
1611
1599
  kind: "block",
1612
- bindPendingFinalDelivery: info.bindPendingFinalDelivery
1600
+ bindPendingFinalDelivery: info.bindPendingFinalDelivery,
1601
+ onPlatformSendDispatch: info.onPlatformSendDispatch
1613
1602
  });
1614
1603
  if (result.visibleReplySent) replyReference.markSent();
1615
1604
  return result;
@@ -1708,7 +1697,8 @@ async function processDiscordMessageInner(ctx, observer) {
1708
1697
  mediaLocalRoots,
1709
1698
  allowedMentions,
1710
1699
  kind: info.kind,
1711
- bindPendingFinalDelivery: info.bindPendingFinalDelivery
1700
+ bindPendingFinalDelivery: info.bindPendingFinalDelivery,
1701
+ onPlatformSendDispatch: info.onPlatformSendDispatch
1712
1702
  })).visibleReplySent;
1713
1703
  },
1714
1704
  onNormalDelivered: () => {
@@ -1746,7 +1736,8 @@ async function processDiscordMessageInner(ctx, observer) {
1746
1736
  threadBindings,
1747
1737
  mediaLocalRoots,
1748
1738
  kind: info.kind,
1749
- bindPendingFinalDelivery: info.bindPendingFinalDelivery
1739
+ bindPendingFinalDelivery: info.bindPendingFinalDelivery,
1740
+ onPlatformSendDispatch: info.onPlatformSendDispatch
1750
1741
  });
1751
1742
  if (!result.visibleReplySent) return result;
1752
1743
  replyReference.markSent();
@@ -1864,7 +1855,10 @@ async function processDiscordMessageInner(ctx, observer) {
1864
1855
  return;
1865
1856
  }
1866
1857
  dispatchError = true;
1867
- if (await completeDiscordSessionConflict(err, deliverDiscordPayload, onDiscordDeliveryError)) return;
1858
+ if (await completeDiscordSessionConflict(err, (payload, info) => deliverDiscordPayload(payload, {
1859
+ ...info,
1860
+ onPlatformSendDispatch: () => Promise.resolve()
1861
+ }), onDiscordDeliveryError)) return;
1868
1862
  throw err;
1869
1863
  } finally {
1870
1864
  activeThreadRoute.end();
@@ -1,4 +1,4 @@
1
- import { c as resolveDiscordChannelInfoSafe } from "./thread-bindings.manager-CngsgErq.js";
1
+ import { c as resolveDiscordChannelInfoSafe } from "./thread-bindings.manager-ByOtwjo_.js";
2
2
  import { ComponentType, StickerFormatType } from "discord-api-types/v10";
3
3
  import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
4
4
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -68,6 +68,34 @@ async function resolveDiscordChannelInfo(client, channelId) {
68
68
  }
69
69
  }
70
70
  //#endregion
71
+ //#region extensions/discord/src/monitor/media-ssrf-policy.ts
72
+ const DISCORD_MEDIA_SSRF_POLICY = {
73
+ hostnameAllowlist: [
74
+ "cdn.discordapp.com",
75
+ "media.discordapp.net",
76
+ "*.discordapp.com",
77
+ "*.discordapp.net"
78
+ ],
79
+ allowRfc2544BenchmarkRange: true
80
+ };
81
+ function mergeHostnameList(...lists) {
82
+ const merged = lists.flatMap((list) => list ?? []).map((value) => value.trim()).filter((value) => value.length > 0);
83
+ return merged.length > 0 ? uniqueStrings(merged) : void 0;
84
+ }
85
+ /** Merges caller network policy with the Discord-owned CDN allowlist. */
86
+ function resolveDiscordCdnPolicy(policy) {
87
+ if (!policy) return DISCORD_MEDIA_SSRF_POLICY;
88
+ const hostnameAllowlist = mergeHostnameList(DISCORD_MEDIA_SSRF_POLICY.hostnameAllowlist, policy.hostnameAllowlist);
89
+ const allowedHostnames = mergeHostnameList(DISCORD_MEDIA_SSRF_POLICY.allowedHostnames, policy.allowedHostnames);
90
+ return {
91
+ ...DISCORD_MEDIA_SSRF_POLICY,
92
+ ...policy,
93
+ ...allowedHostnames ? { allowedHostnames } : {},
94
+ ...hostnameAllowlist ? { hostnameAllowlist } : {},
95
+ allowRfc2544BenchmarkRange: Boolean(DISCORD_MEDIA_SSRF_POLICY.allowRfc2544BenchmarkRange) || Boolean(policy.allowRfc2544BenchmarkRange)
96
+ };
97
+ }
98
+ //#endregion
71
99
  //#region extensions/discord/src/monitor/message-forwarded.ts
72
100
  const FORWARD_MESSAGE_REFERENCE_TYPE = 1;
73
101
  function normalizeDiscordStickerItems(value) {
@@ -115,34 +143,6 @@ function formatDiscordSnapshotAuthor(author) {
115
143
  if (author.id) return `@${author.id}`;
116
144
  }
117
145
  //#endregion
118
- //#region extensions/discord/src/monitor/media-ssrf-policy.ts
119
- const DISCORD_MEDIA_SSRF_POLICY = {
120
- hostnameAllowlist: [
121
- "cdn.discordapp.com",
122
- "media.discordapp.net",
123
- "*.discordapp.com",
124
- "*.discordapp.net"
125
- ],
126
- allowRfc2544BenchmarkRange: true
127
- };
128
- function mergeHostnameList(...lists) {
129
- const merged = lists.flatMap((list) => list ?? []).map((value) => value.trim()).filter((value) => value.length > 0);
130
- return merged.length > 0 ? uniqueStrings(merged) : void 0;
131
- }
132
- /** Merges caller network policy with the Discord-owned CDN allowlist. */
133
- function resolveDiscordCdnPolicy(policy) {
134
- if (!policy) return DISCORD_MEDIA_SSRF_POLICY;
135
- const hostnameAllowlist = mergeHostnameList(DISCORD_MEDIA_SSRF_POLICY.hostnameAllowlist, policy.hostnameAllowlist);
136
- const allowedHostnames = mergeHostnameList(DISCORD_MEDIA_SSRF_POLICY.allowedHostnames, policy.allowedHostnames);
137
- return {
138
- ...DISCORD_MEDIA_SSRF_POLICY,
139
- ...policy,
140
- ...allowedHostnames ? { allowedHostnames } : {},
141
- ...hostnameAllowlist ? { hostnameAllowlist } : {},
142
- allowRfc2544BenchmarkRange: Boolean(DISCORD_MEDIA_SSRF_POLICY.allowRfc2544BenchmarkRange) || Boolean(policy.allowRfc2544BenchmarkRange)
143
- };
144
- }
145
- //#endregion
146
146
  //#region extensions/discord/src/monitor/message-media.ts
147
147
  const AUDIO_ATTACHMENT_EXTENSIONS = /* @__PURE__ */ new Set([
148
148
  ".aac",
@@ -366,6 +366,7 @@ async function appendResolvedMediaFromAttachments(params) {
366
366
  });
367
367
  params.out.push({
368
368
  path: saved.path,
369
+ fileName: attachment.filename,
369
370
  ...classification
370
371
  });
371
372
  } catch (err) {
@@ -436,6 +437,7 @@ async function appendResolvedMediaFromStickers(params) {
436
437
  params.out.push({
437
438
  path: saved.path,
438
439
  contentType: saved.contentType,
440
+ fileName: candidate.fileName,
439
441
  kind: "sticker"
440
442
  });
441
443
  lastError = null;
@@ -561,4 +563,4 @@ function resolveDiscordSnapshotMessageText(snapshot) {
561
563
  return [content || embedText || componentText, attachmentText].filter(Boolean).join("\n");
562
564
  }
563
565
  //#endregion
564
- export { formatDiscordMediaText as a, resolveReferencedReplyMediaList as c, resolveDiscordMessageStickers as d, resolveDiscordChannelInfo as f, resolveDiscordMessageText as i, resolveDiscordCdnPolicy as l, resolveDiscordForwardedMessagesTextFromSnapshots as n, resolveForwardedMediaList as o, resolveDiscordMessageChannelId as p, resolveDiscordMessageHistoryText as r, resolveMediaList as s, resolveDiscordEmbedText as t, hasDiscordMessageStickers as u };
566
+ export { formatDiscordMediaText as a, resolveReferencedReplyMediaList as c, resolveDiscordCdnPolicy as d, resolveDiscordChannelInfo as f, resolveDiscordMessageText as i, hasDiscordMessageStickers as l, resolveDiscordForwardedMessagesTextFromSnapshots as n, resolveForwardedMediaList as o, resolveDiscordMessageChannelId as p, resolveDiscordMessageHistoryText as r, resolveMediaList as s, resolveDiscordEmbedText as t, resolveDiscordMessageStickers as u };
@@ -1,9 +1,7 @@
1
- import { a as chunkDiscordTextWithMode, c as resolveDiscordReplyReference, f as normalizeDiscordOutboundTarget, r as hasDiscordMessageCreateAmbiguity } from "./retry-DNsVTeTo.js";
2
- import { t as createDiscordActionGate } from "./accounts-DNl-oCEw.js";
3
- import { i as toDiscordOutboundDeliveryResult, n as createDiscordSendReceiptFromResults, t as createDiscordSendReceipt } from "./send.receipt-Cnhoautb.js";
4
- import { n as formatDiscordApprovalDisplayValue } from "./approval-message-safety-XGFPbDoI.js";
5
- import { n as notifyDiscordInboundEventOutboundPayloadSuccess, t as discordInboundEventDelivery } from "./inbound-event-delivery-De2qxTrP.js";
6
- import { a as sendDiscordComponentMessageLazy, i as resolveDiscordComponentSpec, n as buildDiscordPresentationPayload, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-B2PL0ooH.js";
1
+ import { a as chunkDiscordTextWithMode, f as resolveDiscordReplyReference, g as normalizeDiscordOutboundTarget, l as toDiscordOutboundDeliveryResult, o as createDiscordSendReceipt, r as hasDiscordMessageCreateAmbiguity, s as createDiscordSendReceiptFromResults } from "./retry-Cv4jCU5Z.js";
2
+ import { t as createDiscordActionGate } from "./accounts-CfQ-vSyf.js";
3
+ import { g as notifyDiscordInboundEventOutboundPayloadSuccess, h as discordInboundEventDelivery, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-Cg15ZFJd.js";
4
+ import { a as sendDiscordComponentMessageLazy, i as resolveDiscordComponentSpec, n as buildDiscordPresentationPayload, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-oLpg8Qzb.js";
7
5
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
8
6
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
9
7
  import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
@@ -61,7 +59,7 @@ function normalizeDiscordApprovalPayload(payload) {
61
59
  }
62
60
  //#endregion
63
61
  //#region extensions/discord/src/outbound-send-context.ts
64
- const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-rQIffSYu.js").then((n) => n.t));
62
+ const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-C49MFF9j.js").then((n) => n.t));
65
63
  function resolveDiscordOutboundTarget(params) {
66
64
  if (params.threadId == null) return params.to;
67
65
  const threadId = normalizeOptionalStringifiedId(params.threadId) ?? "";
@@ -98,11 +96,6 @@ async function createDiscordPayloadSendContext(ctx) {
98
96
  //#endregion
99
97
  //#region extensions/discord/src/outbound-payload.ts
100
98
  const log$1 = createSubsystemLogger("discord/outbound");
101
- function resolveDiscordDeliveryProgress(ctx) {
102
- return ctx.onDeliveryResult ? async (result) => {
103
- await ctx.onDeliveryResult?.(attachChannelToResult("discord", toDiscordOutboundDeliveryResult(result)));
104
- } : void 0;
105
- }
106
99
  function createDiscordUnknownPayloadResult(target) {
107
100
  return {
108
101
  messageId: "",
@@ -146,6 +139,35 @@ async function sendDiscordOutboundPayload(params) {
146
139
  });
147
140
  const mediaUrls = resolvePayloadMediaUrls(payload);
148
141
  const sendContext = await createDiscordPayloadSendContext(ctx);
142
+ const payloadContext = {
143
+ ...ctx,
144
+ payload
145
+ };
146
+ const deliveredResults = [];
147
+ let createdThreadId;
148
+ payloadContext.onDeliveryResult = async (result) => {
149
+ await ctx.onDeliveryResult?.(result);
150
+ const threadId = result.receipt?.threadId;
151
+ if (threadId && payloadContext.threadId == null) {
152
+ payloadContext.threadId = threadId;
153
+ sendContext.target = `channel:${threadId}`;
154
+ createdThreadId = threadId;
155
+ }
156
+ if (createdThreadId && result.target?.kind === "channel" && result.receipt) deliveredResults.push({
157
+ messageId: result.messageId,
158
+ channelId: result.target.id,
159
+ receipt: result.receipt
160
+ });
161
+ };
162
+ const completeResult = (result) => createdThreadId ? {
163
+ ...result,
164
+ receipt: createDiscordSendReceiptFromResults({
165
+ results: deliveredResults,
166
+ threadId: createdThreadId
167
+ })
168
+ } : result;
169
+ const completeDelivery = (result) => attachChannelToResult("discord", toDiscordOutboundDeliveryResult(completeResult(result)));
170
+ const onDeliveryResult = async (result) => await payloadContext.onDeliveryResult?.(attachChannelToResult("discord", toDiscordOutboundDeliveryResult(result)));
149
171
  if (payload.audioAsVoice && mediaUrls.length > 0) {
150
172
  const voiceReply = sendContext.resolveReply();
151
173
  let voiceFailure;
@@ -169,30 +191,30 @@ async function sendDiscordOutboundPayload(params) {
169
191
  if (fallbackText) await sendContext.send(sendContext.target, fallbackText, {
170
192
  verbose: false,
171
193
  ...resolveDiscordFormattedDeliveryOptions(ctx, sendContext, voiceReply),
172
- onDeliveryResult: resolveDiscordDeliveryProgress(ctx)
194
+ onDeliveryResult
173
195
  });
174
196
  voiceFailure = { error: err };
175
197
  }
176
198
  if (!voiceFailure) {
177
- await ctx.onDeliveryResult?.(attachChannelToResult("discord", toDiscordOutboundDeliveryResult(lastResult)));
199
+ await payloadContext.onDeliveryResult?.(attachChannelToResult("discord", toDiscordOutboundDeliveryResult(lastResult)));
178
200
  if (payload.text?.trim()) lastResult = await sendContext.send(sendContext.target, payload.text, {
179
201
  verbose: false,
180
202
  ...resolveDiscordFormattedDeliveryOptions(ctx, sendContext),
181
- onDeliveryResult: resolveDiscordDeliveryProgress(ctx)
203
+ onDeliveryResult
182
204
  });
183
205
  }
184
206
  for (const mediaUrl of mediaUrls.slice(1)) try {
185
207
  lastResult = await sendContext.send(sendContext.target, "", {
186
208
  verbose: false,
187
209
  ...resolveDiscordMediaDeliveryOptions(ctx, sendContext, mediaUrl),
188
- onDeliveryResult: resolveDiscordDeliveryProgress(ctx)
210
+ onDeliveryResult
189
211
  });
190
212
  } catch (err) {
191
213
  if (!voiceFailure) throw err;
192
214
  log$1.warn("discord remaining media send failed after voice failure", { error: err });
193
215
  }
194
216
  if (voiceFailure) throw voiceFailure.error;
195
- return attachChannelToResult("discord", toDiscordOutboundDeliveryResult(lastResult));
217
+ return completeDelivery(lastResult);
196
218
  }
197
219
  const componentSpec = await resolveDiscordComponentSpec(payload);
198
220
  if (!componentSpec) {
@@ -200,7 +222,7 @@ async function sendDiscordOutboundPayload(params) {
200
222
  const nativeComponents = Array.isArray(discordData.components) ? discordData.components : void 0;
201
223
  const embeds = Array.isArray(discordData.embeds) ? discordData.embeds : void 0;
202
224
  const filename = normalizeOptionalString(discordData.filename);
203
- if (nativeComponents || embeds?.length || filename) return attachChannelToResult("discord", toDiscordOutboundDeliveryResult(await sendPayloadMediaSequenceOrFallback({
225
+ if (nativeComponents || embeds?.length || filename) return completeDelivery(await sendPayloadMediaSequenceOrFallback({
204
226
  text: payload.text ?? "",
205
227
  mediaUrls,
206
228
  fallbackResult: createDiscordUnknownPayloadResult(sendContext.target),
@@ -210,7 +232,7 @@ async function sendDiscordOutboundPayload(params) {
210
232
  embeds,
211
233
  filename,
212
234
  ...resolveDiscordFormattedDeliveryOptions(ctx, sendContext),
213
- onDeliveryResult: resolveDiscordDeliveryProgress(ctx)
235
+ onDeliveryResult
214
236
  }),
215
237
  send: async ({ text, mediaUrl, isFirst }) => await sendContext.send(sendContext.target, text, {
216
238
  verbose: false,
@@ -218,70 +240,44 @@ async function sendDiscordOutboundPayload(params) {
218
240
  components: isFirst ? nativeComponents : void 0,
219
241
  embeds: isFirst ? embeds : void 0,
220
242
  filename: isFirst ? filename : void 0,
221
- onDeliveryResult: resolveDiscordDeliveryProgress(ctx)
243
+ onDeliveryResult
222
244
  })
223
- })));
224
- const payloadContext = {
225
- ...ctx,
226
- payload
227
- };
228
- const deliveredResults = [];
229
- let createdThreadId;
230
- payloadContext.onDeliveryResult = async (result) => {
231
- await ctx.onDeliveryResult?.(result);
232
- const threadId = result.receipt?.threadId;
233
- if (threadId && payloadContext.threadId == null) {
234
- payloadContext.threadId = threadId;
235
- createdThreadId = threadId;
236
- }
237
- if (createdThreadId && result.target?.kind === "channel" && result.receipt) deliveredResults.push({
238
- messageId: result.messageId,
239
- channelId: result.target.id,
240
- receipt: result.receipt
241
- });
242
- };
243
- const result = await sendTextMediaPayload({
245
+ }));
246
+ return completeResult(await sendTextMediaPayload({
244
247
  channel: "discord",
245
248
  ctx: payloadContext,
246
249
  adapter: params.fallbackAdapter
247
- });
248
- return createdThreadId ? {
249
- ...result,
250
- receipt: createDiscordSendReceiptFromResults({
251
- results: deliveredResults,
252
- threadId: createdThreadId
253
- })
254
- } : result;
250
+ }));
255
251
  }
256
- return attachChannelToResult("discord", toDiscordOutboundDeliveryResult(await sendPayloadMediaSequenceOrFallback({
252
+ return completeDelivery(await sendPayloadMediaSequenceOrFallback({
257
253
  text: payload.text ?? "",
258
254
  mediaUrls,
259
255
  fallbackResult: createDiscordUnknownPayloadResult(sendContext.target),
260
256
  sendNoMedia: async () => {
261
257
  return await sendDiscordComponentMessageLazy(sendContext.target, componentSpec, {
262
258
  ...resolveDiscordFormattedDeliveryOptions(ctx, sendContext),
263
- onDeliveryResult: resolveDiscordDeliveryProgress(ctx)
259
+ onDeliveryResult
264
260
  });
265
261
  },
266
262
  send: async ({ text, mediaUrl, isFirst }) => {
267
263
  if (isFirst) return await sendDiscordComponentMessageLazy(sendContext.target, componentSpec, {
268
264
  ...resolveDiscordMediaDeliveryOptions(ctx, sendContext, mediaUrl),
269
- onDeliveryResult: resolveDiscordDeliveryProgress(ctx)
265
+ onDeliveryResult
270
266
  });
271
267
  return await sendContext.send(sendContext.target, text, {
272
268
  verbose: false,
273
269
  ...resolveDiscordMediaDeliveryOptions(ctx, sendContext, mediaUrl),
274
- onDeliveryResult: resolveDiscordDeliveryProgress(ctx)
270
+ onDeliveryResult
275
271
  });
276
272
  }
277
- })));
273
+ }));
278
274
  }
279
275
  //#endregion
280
276
  //#region extensions/discord/src/outbound-adapter.ts
281
277
  const DISCORD_TEXT_CHUNK_LIMIT = 2e3;
282
278
  const log = createSubsystemLogger("discord/outbound");
283
- const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-VlymUnbz.js").then((n) => n.t));
284
- const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-ChK1wS7w.js").then((n) => n.i));
279
+ const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-DW5F9vat.js").then((n) => n.t));
280
+ const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-DKKAw5VX.js").then((n) => n.i));
285
281
  function resolveDiscordWebhookIdentity(params) {
286
282
  const usernameRaw = normalizeOptionalString(params.identity?.name);
287
283
  const fallbackUsername = normalizeOptionalString(params.binding.label) ?? params.binding.agentId;
@@ -427,9 +423,8 @@ const discordOutbound = {
427
423
  reply: options.reply?.scope === "all" ? options.reply : void 0
428
424
  });
429
425
  const threadId = captionResult.receipt?.threadId;
430
- if (!threadId) return toDiscordOutboundDeliveryResult(mediaResult);
431
426
  return toDiscordOutboundDeliveryResult({
432
- ...captionResult,
427
+ ...threadId ? captionResult : mediaResult,
433
428
  receipt: createDiscordSendReceiptFromResults({
434
429
  results: [captionResult, mediaResult],
435
430
  threadId
@@ -1,4 +1,4 @@
1
- import { m as readDiscordComponentSpec } from "./components-ezGKo_Yh.js";
1
+ import { m as readDiscordComponentSpec } from "./components-B9V5o361.js";
2
2
  import { createLazyRuntimeModule, createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
3
3
  //#region extensions/discord/src/outbound-components.ts
4
4
  const DISCORD_MESSAGE_COMPONENT_LIMIT = 40;
@@ -30,11 +30,11 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
30
30
  }
31
31
  }
32
32
  };
33
- const loadDiscordComponentSend = createLazyRuntimeNamedExport(() => import("./send.components-ChK1wS7w.js").then((n) => n.i), "sendDiscordComponentMessage");
33
+ const loadDiscordComponentSend = createLazyRuntimeNamedExport(() => import("./send.components-DKKAw5VX.js").then((n) => n.i), "sendDiscordComponentMessage");
34
34
  async function sendDiscordComponentMessageLazy(...args) {
35
35
  return await (await loadDiscordComponentSend())(...args);
36
36
  }
37
- const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-ezGKo_Yh.js").then((n) => n.a));
37
+ const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-B9V5o361.js").then((n) => n.a));
38
38
  function addPayloadTextFallback(spec, payload) {
39
39
  return spec.text ? spec : {
40
40
  ...spec,