@openclaw/discord 2026.8.1-beta.2 → 2026.8.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 (289) hide show
  1. package/dist/{account-inspect-CqzrH14k.js → account-inspect-BDfKyuvL.js} +1 -1
  2. package/dist/account-inspect-api.js +1 -1
  3. package/dist/{accounts-DJTf1LtA.js → accounts-CfQ-vSyf.js} +34 -1
  4. package/dist/action-runtime-api.js +1 -1
  5. package/dist/{activities-api-DS7vpdtp.js → activities-api-Dl-TOyOX.js} +134 -175
  6. package/dist/activities-api.js +1 -1
  7. package/dist/api.js +17 -17
  8. package/dist/{approval-handler.runtime-B6yEV79q.js → approval-handler.runtime-q4Zqo44V.js} +29 -106
  9. package/dist/{audit-Db-rlntl.js → audit-DgrvFPGt.js} +5 -5
  10. package/dist/{channel-CnnbJSt5.js → channel-BsQUalPw.js} +72 -50
  11. package/dist/{channel-actions.runtime-CLKrx6tr.js → channel-actions.runtime-UMGGIfSy.js} +31 -45
  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-BFAO-V1P.js → channel.setup-rPs4dsk_.js} +5 -5
  16. package/dist/{outbound-session-route-DxLkrgKQ.js → components-Dk35LTf_.js} +34 -76
  17. package/dist/{config-schema-BgEskFAs.js → config-schema-CxPqtVI1.js} +46 -14
  18. package/dist/conversation-binding-route-BjvX4e35.js +43 -0
  19. package/dist/{directory-config-BVX7Cflc.js → directory-config-B7DY_pNG.js} +2 -2
  20. package/dist/directory-contract-api.js +1 -1
  21. package/dist/{directory-live-DGIGxpIo.js → directory-live-DuAXKkan.js} +3 -3
  22. package/dist/doctor-contract-api.js +2 -2
  23. package/dist/{doctor-BzC-TLnB.js → doctor-zQTtn6hm.js} +33 -12
  24. package/dist/{handle-action.guild-admin-BNVTUISF.js → handle-action.guild-admin-DZewwLr1.js} +9 -5
  25. package/dist/index.js +3 -4
  26. package/dist/ingress-identity-CzZKcPK8.js +60 -0
  27. package/dist/{message-handler-Unk_f10F.js → message-handler-C5By3yl5.js} +82 -6
  28. package/dist/{message-handler.preflight-C9zecxR9.js → message-handler.preflight-DrszWuHw.js} +44 -118
  29. package/dist/{message-handler.process-DWQ6UHHu.js → message-handler.process-DyFPDLCt.js} +205 -235
  30. package/dist/{message-utils-BSCPVgy0.js → message-text-Ca8M6TU8.js} +43 -42
  31. package/dist/{outbound-adapter-D9nRivT1.js → outbound-adapter-Dif8p481.js} +118 -91
  32. package/dist/{outbound-components-cTzwBJ60.js → outbound-components-wjv7yyAj.js} +5 -4
  33. package/dist/outbound-session-route-Bn4uXaoE.js +665 -0
  34. package/dist/owner-access-UlYi9t0M.js +107 -0
  35. package/dist/{pluralkit-DdiJ9KMK.js → pluralkit-9EuEN4UD.js} +1 -1
  36. package/dist/{probe-Bl-k5_Ku.js → probe-n6ZXxK8V.js} +1 -1
  37. package/dist/{probe.runtime-M9fREKvp.js → probe.runtime-CN4bdPfZ.js} +1 -1
  38. package/dist/{provider-DvSNb-2v.js → provider-LXiOcJrH.js} +887 -1350
  39. package/dist/{provider-session.runtime-BUEqD0rA.js → provider-session.runtime-DSNe7r2W.js} +3 -3
  40. package/dist/provider.runtime-DiInaDXO.js +2 -0
  41. package/dist/{realtime-session.runtime-C7wen-aF.js → realtime-session.runtime-DOViOIjY.js} +129 -134
  42. package/dist/{resolve-allowlist-common-D04lpEzb.js → resolve-allowlist-common-BLoYaxEG.js} +2 -2
  43. package/dist/{resolve-channels-Dm7jEeg6.js → resolve-channels-D2yl_2CN.js} +5 -4
  44. package/dist/{resolve-users-bktrCUUU.js → resolve-users-BLxfqajZ.js} +2 -2
  45. package/dist/{retry-CLpJcXXf.js → retry-DqHCW6PV.js} +187 -19
  46. package/dist/{runtime-DGsSyDTS.js → runtime-BYamRVPN.js} +89 -86
  47. package/dist/{runtime-DoHjckYm.js → runtime-DrxVBTtp.js} +9 -10
  48. package/dist/runtime-api.js +19 -25
  49. package/dist/{sdk-runtime-QpY8PvCh.js → sdk-runtime-6tfgYDjY.js} +57 -89
  50. package/dist/{secret-config-contract-B1akrlyY.js → secret-config-contract-B3i6WxV5.js} +53 -25
  51. package/dist/secret-contract-api.js +1 -1
  52. package/dist/{security-audit-jGnJF__m.js → security-audit-DKfK-iPY.js} +11 -12
  53. package/dist/security-audit-contract-api.js +1 -1
  54. package/dist/{security-audit.runtime-CPN0xFYz.js → security-audit.runtime-sKZyKgpx.js} +1 -1
  55. package/dist/{send-B7Q6Oc1I.js → send-UJHiAm4C.js} +82 -19
  56. package/dist/{send.components-iJyFXw9L.js → send.components-CrBJpGT_.js} +22 -39
  57. package/dist/{send.outbound-DS5tHwfR.js → send.outbound-D7JYmfm9.js} +77 -78
  58. package/dist/{send.shared-BmwFjW6T.js → send.shared-DZJ1akvQ.js} +136 -121
  59. package/dist/{sender-identity-QtalnCYv.js → sender-identity-BJtfyise.js} +1 -1
  60. package/dist/setup-plugin-api.js +1 -1
  61. package/dist/{shared-BIXIX6uJ.js → shared-Dii2HTn7.js} +41 -14
  62. package/dist/subagent-hooks-JyGrtQIl.js +49 -0
  63. package/dist/subagent-hooks-api.js +1 -6
  64. package/dist/{system-events-CTqDf6_s.js → system-events-BEmcj4xJ.js} +2 -2
  65. package/dist/{target-resolver-maOKSqO0.js → target-resolver-V-IYae6s.js} +3 -3
  66. package/dist/targets-CQp53cGj.js +3 -0
  67. package/dist/{thread-bindings-3L8p82GV.js → thread-bindings-DvYP79fy.js} +28 -26
  68. package/dist/{thread-bindings.manager-DCIH6WDC.js → thread-bindings.manager-Clm77DBM.js} +11 -14
  69. package/dist/{thread-bindings.session-updates-bJ2KQFY6.js → thread-bindings.session-updates-CJb-BpPL.js} +1 -1
  70. package/dist/{thread-bindings.state-aeV8HNgV.js → thread-bindings.state-D8OMdk4O.js} +1 -1
  71. package/dist/threading-CXuu_7o9.js +478 -0
  72. package/dist/transcripts-source-BLEMH_yi.js +270 -0
  73. package/dist/transcripts-source-api.js +7 -2
  74. package/dist/{typing-CS-nNVoe.js → typing-B9snnwMe.js} +1 -1
  75. package/dist/{voice-runtime-BEdqNcST.js → voice-runtime-DY6_o73o.js} +250 -150
  76. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/README.md +19 -19
  77. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v1.js +7 -3
  78. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v7.js +5 -2
  79. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v1.js +7 -3
  80. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v7.js +5 -2
  81. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/package.json +4 -3
  82. package/node_modules/@discordjs/voice/node_modules/@types/node/README.md +1 -1
  83. package/node_modules/@discordjs/voice/node_modules/@types/node/child_process.d.ts +0 -1
  84. package/node_modules/@discordjs/voice/node_modules/@types/node/crypto.d.ts +6 -6
  85. package/node_modules/@discordjs/voice/node_modules/@types/node/dns/promises.d.ts +5 -5
  86. package/node_modules/@discordjs/voice/node_modules/@types/node/dns.d.ts +5 -5
  87. package/node_modules/@discordjs/voice/node_modules/@types/node/fs.d.ts +7 -0
  88. package/node_modules/@discordjs/voice/node_modules/@types/node/http.d.ts +30 -0
  89. package/node_modules/@discordjs/voice/node_modules/@types/node/http2.d.ts +4 -4
  90. package/node_modules/@discordjs/voice/node_modules/@types/node/os.d.ts +30 -30
  91. package/node_modules/@discordjs/voice/node_modules/@types/node/package.json +2 -2
  92. package/node_modules/@discordjs/voice/node_modules/@types/node/perf_hooks.d.ts +2 -1
  93. package/node_modules/@discordjs/voice/node_modules/@types/node/process.d.ts +42 -43
  94. package/node_modules/@discordjs/voice/node_modules/@types/node/quic.d.ts +1049 -84
  95. package/node_modules/@discordjs/voice/node_modules/@types/node/sqlite.d.ts +14 -1
  96. package/node_modules/@discordjs/voice/node_modules/@types/node/stream/iter.d.ts +3 -2
  97. package/node_modules/@discordjs/voice/node_modules/@types/node/test.d.ts +61 -0
  98. package/node_modules/@discordjs/voice/node_modules/@types/node/v8.d.ts +20 -23
  99. package/node_modules/discord-api-types/CHANGELOG.md +8 -0
  100. package/node_modules/discord-api-types/package.json +4 -4
  101. package/node_modules/discord-api-types/payloads/v10/channel.d.ts +2 -2
  102. package/node_modules/discord-api-types/payloads/v10/channel.d.ts.map +1 -1
  103. package/node_modules/discord-api-types/payloads/v10/gateway.d.ts +4 -0
  104. package/node_modules/discord-api-types/payloads/v10/gateway.d.ts.map +1 -1
  105. package/node_modules/discord-api-types/payloads/v10/gateway.js.map +1 -1
  106. package/node_modules/discord-api-types/payloads/v10/message.d.ts +4 -1
  107. package/node_modules/discord-api-types/payloads/v10/message.d.ts.map +1 -1
  108. package/node_modules/discord-api-types/payloads/v10/message.js +1 -0
  109. package/node_modules/discord-api-types/payloads/v10/message.js.map +1 -1
  110. package/node_modules/discord-api-types/payloads/v9/channel.d.ts +2 -2
  111. package/node_modules/discord-api-types/payloads/v9/channel.d.ts.map +1 -1
  112. package/node_modules/discord-api-types/payloads/v9/gateway.d.ts +4 -0
  113. package/node_modules/discord-api-types/payloads/v9/gateway.d.ts.map +1 -1
  114. package/node_modules/discord-api-types/payloads/v9/gateway.js.map +1 -1
  115. package/node_modules/discord-api-types/payloads/v9/message.d.ts +4 -1
  116. package/node_modules/discord-api-types/payloads/v9/message.d.ts.map +1 -1
  117. package/node_modules/discord-api-types/payloads/v9/message.js +1 -0
  118. package/node_modules/discord-api-types/payloads/v9/message.js.map +1 -1
  119. package/node_modules/typebox/build/format/date.d.mts +1 -1
  120. package/node_modules/typebox/build/format/date.mjs +1 -1
  121. package/node_modules/typebox/build/format/date_time.d.mts +2 -2
  122. package/node_modules/typebox/build/format/date_time.mjs +3 -3
  123. package/node_modules/typebox/build/format/email.d.mts +1 -1
  124. package/node_modules/typebox/build/format/email.mjs +2 -2
  125. package/node_modules/typebox/build/format/hostname.mjs +2 -10
  126. package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
  127. package/node_modules/typebox/build/format/idn_email.mjs +3 -3
  128. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
  129. package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
  130. package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
  131. package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
  132. package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
  133. package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
  134. package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
  135. package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
  136. package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
  137. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
  138. package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
  139. package/node_modules/typebox/build/format/idna/index.mjs +2 -0
  140. package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
  141. package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
  142. package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
  143. package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
  144. package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
  145. package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
  146. package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
  147. package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
  148. package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
  149. package/node_modules/typebox/build/format/ipv4.mjs +2 -32
  150. package/node_modules/typebox/build/format/ipv6.mjs +2 -61
  151. package/node_modules/typebox/build/format/iri.d.mts +2 -2
  152. package/node_modules/typebox/build/format/iri.mjs +26 -8
  153. package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
  154. package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
  155. package/node_modules/typebox/build/format/regex.d.mts +1 -2
  156. package/node_modules/typebox/build/format/regex.mjs +2 -6
  157. package/node_modules/typebox/build/format/time.d.mts +2 -2
  158. package/node_modules/typebox/build/format/time.mjs +19 -14
  159. package/node_modules/typebox/build/format/uri.d.mts +1 -1
  160. package/node_modules/typebox/build/format/uri.mjs +3 -130
  161. package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
  162. package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
  163. package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
  164. package/node_modules/typebox/build/format/uri_template.mjs +4 -5
  165. package/node_modules/typebox/build/format/url.d.mts +3 -3
  166. package/node_modules/typebox/build/format/url.mjs +4 -5
  167. package/node_modules/typebox/build/guard/emit.d.mts +3 -1
  168. package/node_modules/typebox/build/guard/emit.mjs +12 -5
  169. package/node_modules/typebox/build/guard/guard.d.mts +8 -2
  170. package/node_modules/typebox/build/guard/guard.mjs +25 -4
  171. package/node_modules/typebox/build/guard/string.d.mts +2 -2
  172. package/node_modules/typebox/build/guard/string.mjs +7 -7
  173. package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
  174. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
  175. package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
  176. package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
  177. package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
  178. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
  179. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
  180. package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
  181. package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
  182. package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
  183. package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
  184. package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
  185. package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
  186. package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
  187. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
  188. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
  189. package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
  190. package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
  191. package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
  192. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
  193. package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
  194. package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
  195. package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
  196. package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
  197. package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
  198. package/node_modules/typebox/build/schema/types/index.mjs +0 -2
  199. package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
  200. package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
  201. package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
  202. package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
  203. package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
  204. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
  205. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
  206. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
  207. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
  208. package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
  209. package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
  210. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
  211. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
  212. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
  213. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
  214. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
  215. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
  216. package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
  217. package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
  218. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
  219. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
  220. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
  221. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
  222. package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
  223. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
  224. package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
  225. package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
  226. package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
  227. package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
  228. package/node_modules/typebox/build/type/script/parser.mjs +27 -23
  229. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  230. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  231. package/node_modules/typebox/package.json +27 -27
  232. package/node_modules/typebox/readme.md +79 -82
  233. package/node_modules/undici/docs/docs/api/Client.md +21 -8
  234. package/node_modules/undici/lib/api/readable.js +33 -43
  235. package/node_modules/undici/lib/core/connect.js +16 -2
  236. package/node_modules/undici/lib/core/symbols.js +1 -0
  237. package/node_modules/undici/lib/dispatcher/client-h1.js +3 -3
  238. package/node_modules/undici/lib/dispatcher/client-h2.js +179 -10
  239. package/node_modules/undici/lib/dispatcher/client.js +74 -29
  240. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +28 -6
  241. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +15 -1
  242. package/node_modules/undici/lib/handler/retry-handler.js +7 -2
  243. package/node_modules/undici/lib/interceptor/cache.js +5 -2
  244. package/node_modules/undici/lib/interceptor/deduplicate.js +1 -1
  245. package/node_modules/undici/lib/mock/mock-utils.js +213 -24
  246. package/node_modules/undici/lib/util/cache.js +2 -4
  247. package/node_modules/undici/lib/web/websocket/websocket.js +22 -0
  248. package/node_modules/undici/package.json +1 -1
  249. package/node_modules/undici/types/client.d.ts +40 -0
  250. package/node_modules/ws/lib/permessage-deflate.js +3 -1
  251. package/node_modules/ws/package.json +1 -1
  252. package/openclaw.plugin.json +24 -10
  253. package/package.json +8 -10
  254. package/skills/discord/SKILL.md +1 -1
  255. package/dist/approval-message-safety-AcIxvrf3.js +0 -140
  256. package/dist/audit-core-xwjIczO0.js +0 -105
  257. package/dist/channel-actions-5s_hjYKd.js +0 -208
  258. package/dist/channel-api-CAJ0wMoV.js +0 -21
  259. package/dist/inbound-event-delivery-De2qxTrP.js +0 -39
  260. package/dist/provider.runtime-C9PnJZbZ.js +0 -2
  261. package/dist/runtime-api.actions.js +0 -3
  262. package/dist/runtime-api.lookup.js +0 -7
  263. package/dist/runtime-api.monitor-CHxrFPnW.js +0 -5
  264. package/dist/runtime-api.monitor.js +0 -8
  265. package/dist/runtime-api.send.js +0 -7
  266. package/dist/runtime-api.threads.js +0 -5
  267. package/dist/send.reactions-BAn0iiVQ.js +0 -78
  268. package/dist/send.receipt-IPI1p-SP.js +0 -66
  269. package/dist/subagent-hooks-CTt5KCJr.js +0 -120
  270. package/dist/subagent-progress-DhaE_h8a.js +0 -109
  271. package/dist/targets-yUFTHoAx.js +0 -3
  272. package/dist/transcripts-source-CfFMexGt.js +0 -123
  273. package/node_modules/p-map/index.d.ts +0 -155
  274. package/node_modules/p-map/index.js +0 -285
  275. package/node_modules/p-map/license +0 -9
  276. package/node_modules/p-map/package.json +0 -57
  277. package/node_modules/p-map/readme.md +0 -190
  278. package/node_modules/typebox/build/format/_idna.d.mts +0 -2
  279. package/node_modules/typebox/build/format/_idna.mjs +0 -246
  280. package/node_modules/typebox/build/format/_puny.d.mts +0 -1
  281. package/node_modules/typebox/build/format/_puny.mjs +0 -77
  282. package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
  283. package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
  284. package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
  285. package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
  286. package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
  287. package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
  288. package/dist/{allow-list-DnxIlPP2.js → allow-list-BDMimASD.js} +1 -1
  289. package/dist/{doctor-contract-DLa-BTiU.js → doctor-contract-DsWvKIXF.js} +1 -1
@@ -1,30 +1,17 @@
1
- import { H as serializePayload, ft as stripUndefinedFields, tn as __exportAll, wt as editChannelMessage, yt as createChannelMessage } from "./retry-CLpJcXXf.js";
2
- import { s as resolveDiscordAccount } from "./accounts-DJTf1LtA.js";
3
- import { f as buildDiscordComponentMessage, g as resolveDiscordComponentAttachmentName, p as buildDiscordComponentMessageFlags } from "./outbound-session-route-DxLkrgKQ.js";
4
- import { P as createDiscordClient, W as parseAndResolveChannelRecipient, g as createDiscordMessageNonce, l as resolveChannelId, m as SUPPRESS_NOTIFICATIONS_FLAG, t as buildDiscordSendError, u as resolveDiscordChannel } from "./send.shared-BmwFjW6T.js";
1
+ import { c as createDiscordSendResult, kt as editChannelMessage, on as __exportAll, q as serializePayload, wt as createChannelMessage } from "./retry-DqHCW6PV.js";
2
+ import { d as buildDiscordComponentMessage, f as buildDiscordComponentMessageFlags, g as resolveDiscordComponentAttachmentName } from "./components-Dk35LTf_.js";
5
3
  import { n as getOptionalDiscordRuntime } from "./runtime-DgnVQ7zW.js";
6
- import "./config-schema-BgEskFAs.js";
7
- import "./channel-api-CAJ0wMoV.js";
8
- import { t as sendMessageDiscord } from "./send.outbound-DS5tHwfR.js";
9
- import { r as createDiscordSendResult } from "./send.receipt-IPI1p-SP.js";
10
- import "openclaw/plugin-sdk/account-helpers";
11
- import "openclaw/plugin-sdk/account-id";
12
- import "openclaw/plugin-sdk/channel-config-helpers";
13
- import "openclaw/plugin-sdk/routing";
14
- import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
15
- import "openclaw/plugin-sdk/secret-input";
4
+ import { E as SUPPRESS_NOTIFICATIONS_FLAG, K as parseAndResolveChannelRecipient, N as createDiscordClient, O as createDiscordMessageNonce, l as resolveChannelId, t as buildDiscordSendError, u as resolveDiscordChannel } from "./send.shared-DZJ1akvQ.js";
5
+ import { t as sendMessageDiscord } from "./send.outbound-D7JYmfm9.js";
16
6
  import { ChannelType } from "discord-api-types/v10";
17
7
  import { asDateTimestampMs, isFutureDateTimestampMs, resolveDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
18
- import { assertMediaNotDataUrl, jsonResult as jsonResult$1, parseAvailableTags, readNonNegativeIntegerParam, readPositiveIntegerParam, readReactionParams, readStringArrayParam, readStringParam as readStringParam$1, resolvePollMaxSelections, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
8
+ import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
19
9
  import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
10
+ import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
11
+ import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
20
12
  import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
21
13
  import { createPluginStateErrorReporter } from "openclaw/plugin-sdk/plugin-state-runtime";
22
14
  import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
23
- import "openclaw/plugin-sdk/channel-status";
24
- import "openclaw/plugin-sdk/channel-config-schema";
25
- import { readBooleanParam as readBooleanParam$1 } from "openclaw/plugin-sdk/boolean-param";
26
- import "openclaw/plugin-sdk/channel-plugin-common";
27
- import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
28
15
  //#region extensions/discord/src/components-registry-state.ts
29
16
  const discordComponentRegistryState = resolveGlobalSingleton(Symbol.for("openclaw.discord.componentRegistryState"), () => ({
30
17
  componentEntries: /* @__PURE__ */ new Map(),
@@ -374,7 +361,9 @@ async function buildDiscordComponentPayload(params) {
374
361
  mediaLocalRoots: params.opts.mediaLocalRoots,
375
362
  mediaReadFile: params.opts.mediaReadFile
376
363
  });
377
- resolvedFileName = params.opts.filename?.trim() || media.fileName || "upload";
364
+ const filenameOverride = params.opts.filename?.trim();
365
+ const explicitAttachmentName = extractComponentAttachmentNames(spec)[0];
366
+ resolvedFileName = filenameOverride || explicitAttachmentName || media.fileName || `upload${extensionForMime(media.contentType) ?? ""}`;
378
367
  spec = withImplicitComponentAttachmentBlock(spec, resolvedFileName);
379
368
  files = [{
380
369
  data: media.buffer,
@@ -396,7 +385,7 @@ async function buildDiscordComponentPayload(params) {
396
385
  const flags = buildDiscordComponentMessageFlags(buildResult.components);
397
386
  const finalFlags = params.opts.silent ? (flags ?? 0) | SUPPRESS_NOTIFICATIONS_FLAG : flags ?? void 0;
398
387
  return {
399
- body: stripUndefinedFields({
388
+ body: {
400
389
  ...serializePayload({
401
390
  components: buildResult.components,
402
391
  allowed_mentions: params.opts.allowedMentions,
@@ -404,7 +393,7 @@ async function buildDiscordComponentPayload(params) {
404
393
  ...files ? { files } : {}
405
394
  }),
406
395
  ...messageReference ? { message_reference: messageReference } : {}
407
- }),
396
+ },
408
397
  buildResult
409
398
  };
410
399
  }
@@ -416,7 +405,7 @@ async function sendDiscordComponentMessage(to, spec, opts) {
416
405
  token: opts.token,
417
406
  rest: opts.rest,
418
407
  mediaUrl: opts.mediaUrl,
419
- filename: opts.filename,
408
+ filename: opts.filename?.trim() || extractComponentAttachmentNames(spec)[0],
420
409
  mediaLocalRoots: opts.mediaLocalRoots,
421
410
  mediaReadFile: opts.mediaReadFile,
422
411
  mediaAccess: opts.mediaAccess,
@@ -431,15 +420,11 @@ async function sendDiscordComponentMessage(to, spec, opts) {
431
420
  ...opts.suppressEmbeds === void 0 ? {} : { suppressEmbeds: opts.suppressEmbeds }
432
421
  });
433
422
  const cfg = requireRuntimeConfig(opts.cfg, "Discord component send");
434
- const accountInfo = resolveDiscordAccount({
435
- cfg,
436
- accountId: opts.accountId
437
- });
438
- const { token, rest, request } = createDiscordClient({
423
+ const { token, rest, request, account: accountInfo } = createDiscordClient({
439
424
  ...opts,
440
425
  cfg
441
426
  });
442
- const { channelId } = await resolveChannelId(rest, await parseAndResolveChannelRecipient(to, cfg, opts.accountId), request);
427
+ const { channelId } = await resolveChannelId(rest, await parseAndResolveChannelRecipient(to, cfg, accountInfo.accountId), request);
443
428
  const channel = await resolveDiscordChannel(rest, channelId);
444
429
  if (channel && DISCORD_FORUM_LIKE_TYPES.has(channel.type)) throw new Error("Discord components are not supported in forum-style channels");
445
430
  const { body: componentBody, buildResult } = await buildDiscordComponentPayload({
@@ -454,8 +439,10 @@ async function sendDiscordComponentMessage(to, spec, opts) {
454
439
  };
455
440
  let result;
456
441
  try {
457
- await opts.onPlatformSendDispatch?.();
458
- result = await request(() => createChannelMessage(rest, channelId, { body }), "components", { safety: "nonce-protected-create" });
442
+ result = await request(async () => {
443
+ await opts.onPlatformSendDispatch?.();
444
+ return createChannelMessage(rest, channelId, { body });
445
+ }, "components", { safety: "nonce-protected-create" });
459
446
  } catch (err) {
460
447
  throw await buildDiscordSendError(err, {
461
448
  channelId,
@@ -486,15 +473,11 @@ async function sendDiscordComponentMessage(to, spec, opts) {
486
473
  }
487
474
  async function editDiscordComponentMessage(to, messageId, spec, opts) {
488
475
  const cfg = requireRuntimeConfig(opts.cfg, "Discord component edit");
489
- const accountInfo = resolveDiscordAccount({
490
- cfg,
491
- accountId: opts.accountId
492
- });
493
- const { token, rest, request } = createDiscordClient({
476
+ const { token, rest, request, account: accountInfo } = createDiscordClient({
494
477
  ...opts,
495
478
  cfg
496
479
  });
497
- const { channelId } = await resolveChannelId(rest, await parseAndResolveChannelRecipient(to, cfg, opts.accountId), request);
480
+ const { channelId } = await resolveChannelId(rest, await parseAndResolveChannelRecipient(to, cfg, accountInfo.accountId), request);
498
481
  const { body, buildResult } = await buildDiscordComponentPayload({
499
482
  spec,
500
483
  opts,
@@ -533,4 +516,4 @@ async function editDiscordComponentMessage(to, messageId, spec, opts) {
533
516
  });
534
517
  }
535
518
  //#endregion
536
- export { resolveDiscordModalEntryWithPersistence as _, assertMediaNotDataUrl as a, readBooleanParam$1 as c, readReactionParams as d, readStringArrayParam as f, resolveDiscordComponentEntryWithPersistence as g, withNormalizedTimestamp as h, send_components_exports as i, readNonNegativeIntegerParam as l, resolvePollMaxSelections as m, registerBuiltDiscordComponentMessage as n, jsonResult$1 as o, readStringParam$1 as p, sendDiscordComponentMessage as r, parseAvailableTags as s, editDiscordComponentMessage as t, readPositiveIntegerParam as u };
519
+ export { resolveDiscordComponentEntryWithPersistence as a, send_components_exports as i, registerBuiltDiscordComponentMessage as n, resolveDiscordModalEntryWithPersistence as o, sendDiscordComponentMessage as r, editDiscordComponentMessage as t };
@@ -1,14 +1,12 @@
1
- import { bt as createThread, o as createReusableDiscordReplyReference, yt as createChannelMessage } from "./retry-CLpJcXXf.js";
2
- import { s as resolveDiscordAccount } from "./accounts-DJTf1LtA.js";
3
- import { P as createDiscordClient, W as parseAndResolveChannelRecipient, _ as resolveDiscordMessageFlags, a as normalizeDiscordPollInput, b as resolveDiscordSuppressEmbeds, c as normalizeStickerIds, f as sendDiscordMedia, g as createDiscordMessageNonce, h as buildDiscordMessageRequest, l as resolveChannelId, n as buildDiscordTextChunks, p as sendDiscordText, t as buildDiscordSendError, u as resolveDiscordChannel, v as resolveDiscordSendComponents, y as resolveDiscordSendEmbeds } from "./send.shared-BmwFjW6T.js";
4
- import { i as normalizeDiscordHandleKey, o as resolveDiscordDirectoryUserId } from "./directory-live-DGIGxpIo.js";
5
- import { n as createDiscordSendReceiptFromResults, r as createDiscordSendResult } from "./send.receipt-IPI1p-SP.js";
6
- import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
1
+ import { Tt as createThread, c as createDiscordSendResult, s as createDiscordSendReceiptFromResults, u as createReusableDiscordReplyReference, wt as createChannelMessage } from "./retry-DqHCW6PV.js";
2
+ import { i as normalizeDiscordHandleKey, o as resolveDiscordDirectoryUserId } from "./directory-live-DuAXKkan.js";
3
+ import { A as resolveDiscordSendComponents, D as buildDiscordMessageRequest, K as parseAndResolveChannelRecipient, M as resolveDiscordSuppressEmbeds, N as createDiscordClient, O as createDiscordMessageNonce, a as normalizeDiscordPollInput, c as normalizeStickerIds, f as sendDiscordMedia, j as resolveDiscordSendEmbeds, k as resolveDiscordMessageFlags, l as resolveChannelId, n as buildDiscordTextChunks, p as sendDiscordText, t as buildDiscordSendError, u as resolveDiscordChannel } from "./send.shared-DZJ1akvQ.js";
7
4
  import { ChannelType } from "discord-api-types/v10";
8
5
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
9
- import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
6
+ import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
10
7
  import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
11
8
  import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
9
+ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
12
10
  import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
13
11
  import { resolveChunkMode } from "openclaw/plugin-sdk/reply-chunking";
14
12
  import { fromMarkdown } from "mdast-util-from-markdown";
@@ -377,23 +375,14 @@ function findFenceEnd(text, startIndex, runLength) {
377
375
  return text.length;
378
376
  }
379
377
  function findNextMarkdownCodeSegment(text, startIndex) {
380
- let searchIndex = startIndex;
381
- while (searchIndex < text.length) {
382
- const segmentStart = text.indexOf("`", searchIndex);
383
- if (segmentStart === -1) return null;
384
- const runLength = countBacktickRun(text, segmentStart);
385
- const inlineEndIndex = findSameLineBacktickRun(text, segmentStart + runLength, runLength);
386
- if (inlineEndIndex !== null) return {
387
- startIndex: segmentStart,
388
- endIndex: inlineEndIndex
389
- };
390
- if (runLength >= 3) return {
391
- startIndex: segmentStart,
392
- endIndex: findFenceEnd(text, segmentStart, runLength)
393
- };
394
- searchIndex = segmentStart + runLength;
395
- }
396
- return null;
378
+ const segmentOffset = text.slice(startIndex).search(/(?<=(?:^|[^\\])(?:\\\\)*)`/);
379
+ if (segmentOffset === -1) return null;
380
+ const segmentStart = startIndex + segmentOffset;
381
+ const runLength = countBacktickRun(text, segmentStart);
382
+ return {
383
+ startIndex: segmentStart,
384
+ endIndex: findSameLineBacktickRun(text, segmentStart + runLength, runLength) ?? (runLength >= 3 ? findFenceEnd(text, segmentStart, runLength) : text.length)
385
+ };
397
386
  }
398
387
  function rewriteDiscordKnownMentions(text, params) {
399
388
  if (!text.includes("@")) return text;
@@ -456,22 +445,23 @@ function toDiscordSendResult(result, fallbackChannelId, params = {}) {
456
445
  }
457
446
  async function resolveDiscordSendTarget(to, opts) {
458
447
  const cfg = requireRuntimeConfig(opts.cfg, "Discord send target resolution");
459
- const { rest, request } = createDiscordClient({
448
+ const { rest, request, account } = createDiscordClient({
460
449
  ...opts,
461
450
  cfg
462
451
  });
463
- const { channelId } = await resolveChannelId(rest, await parseAndResolveChannelRecipient(to, cfg, opts.accountId), request);
452
+ const { channelId } = await resolveChannelId(rest, await parseAndResolveChannelRecipient(to, cfg, account.accountId), request);
464
453
  return {
465
454
  rest,
466
455
  request,
467
- channelId
456
+ channelId,
457
+ account
468
458
  };
469
459
  }
470
460
  async function sendMessageDiscord(to, text, opts) {
471
461
  const cfg = requireRuntimeConfig(opts.cfg, "Discord send");
472
- const accountInfo = resolveDiscordAccount({
473
- cfg,
474
- accountId: opts.accountId
462
+ const { token, rest, request, account: accountInfo } = createDiscordClient({
463
+ ...opts,
464
+ cfg
475
465
  });
476
466
  const tableMode = resolveMarkdownTableMode({
477
467
  cfg,
@@ -492,12 +482,19 @@ async function sendMessageDiscord(to, text, opts) {
492
482
  accountId: accountInfo.accountId,
493
483
  mentionAliases: accountInfo.config.mentionAliases
494
484
  });
495
- const { token, rest, request } = createDiscordClient({
496
- ...opts,
497
- cfg
498
- });
499
- const { channelId } = await resolveChannelId(rest, await parseAndResolveChannelRecipient(to, cfg, opts.accountId), request);
485
+ const { channelId } = await resolveChannelId(rest, await parseAndResolveChannelRecipient(to, cfg, accountInfo.accountId), request);
500
486
  const channel = await resolveDiscordChannel(rest, channelId);
487
+ const deliveredResults = [];
488
+ let deliveryThreadId;
489
+ const reportResult = async (progressResult, kind, replyToId) => {
490
+ const deliveredResult = toDiscordSendResult(progressResult, deliveryThreadId ?? channelId, {
491
+ kind,
492
+ threadId: deliveryThreadId,
493
+ reply: createReusableDiscordReplyReference(replyToId)
494
+ });
495
+ deliveredResults.push(deliveredResult);
496
+ await opts.onDeliveryResult?.(deliveredResult);
497
+ };
501
498
  if (isForumLikeChannel(channel)) {
502
499
  if (((channel.flags ?? 0) & DISCORD_FORUM_REQUIRE_TAG_FLAG) !== 0) throw new Error(`Discord forum channel ${channelId} requires an applied tag; use thread-create with appliedTags, then send to the created thread.`);
503
500
  const threadName = deriveForumThreadName(renderedText);
@@ -529,12 +526,14 @@ async function sendMessageDiscord(to, text, opts) {
529
526
  });
530
527
  let threadRes;
531
528
  try {
532
- await opts.onPlatformSendDispatch?.();
533
- threadRes = await request(() => createThread(rest, channelId, { body: {
534
- name: threadName,
535
- ...channel.default_auto_archive_duration === void 0 ? {} : { auto_archive_duration: channel.default_auto_archive_duration },
536
- message: starterBody
537
- } }), "forum-thread", { safety: "non-idempotent-create" });
529
+ threadRes = await request(async () => {
530
+ await opts.onPlatformSendDispatch?.();
531
+ return createThread(rest, channelId, { body: {
532
+ name: threadName,
533
+ ...channel.default_auto_archive_duration === void 0 ? {} : { auto_archive_duration: channel.default_auto_archive_duration },
534
+ message: starterBody
535
+ } });
536
+ }, "forum-thread", { safety: "non-idempotent-create" });
538
537
  } catch (err) {
539
538
  throw await buildDiscordSendError(err, {
540
539
  channelId,
@@ -545,6 +544,7 @@ async function sendMessageDiscord(to, text, opts) {
545
544
  });
546
545
  }
547
546
  const threadId = threadRes.id;
547
+ deliveryThreadId = threadId;
548
548
  const messageId = threadRes.message?.id ?? threadId;
549
549
  const resultChannelId = threadRes.message?.channel_id ?? threadId;
550
550
  const remainingChunks = chunks.slice(1);
@@ -555,16 +555,8 @@ async function sendMessageDiscord(to, text, opts) {
555
555
  kind: "text",
556
556
  threadId
557
557
  });
558
- const deliveredResults = [starterResult];
558
+ deliveredResults.push(starterResult);
559
559
  await opts.onDeliveryResult?.(starterResult);
560
- const reportThreadResult = async (result, kind) => {
561
- const deliveredResult = toDiscordSendResult(result, threadId, {
562
- kind,
563
- threadId
564
- });
565
- deliveredResults.push(deliveredResult);
566
- await opts.onDeliveryResult?.(deliveredResult);
567
- };
568
560
  try {
569
561
  if (opts.mediaUrl) {
570
562
  const [mediaCaption, ...afterMediaChunks] = remainingChunks;
@@ -585,7 +577,7 @@ async function sendMessageDiscord(to, text, opts) {
585
577
  suppressEmbeds,
586
578
  allowedMentions: opts.allowedMentions,
587
579
  maxChars: textLimit,
588
- onResult: reportThreadResult,
580
+ onResult: reportResult,
589
581
  onPlatformSendDispatch: opts.onPlatformSendDispatch
590
582
  });
591
583
  await sendDiscordThreadTextChunks({
@@ -599,7 +591,7 @@ async function sendMessageDiscord(to, text, opts) {
599
591
  silent: opts.silent,
600
592
  suppressEmbeds,
601
593
  allowedMentions: opts.allowedMentions,
602
- onResult: reportThreadResult,
594
+ onResult: reportResult,
603
595
  onPlatformSendDispatch: opts.onPlatformSendDispatch
604
596
  });
605
597
  } else await sendDiscordThreadTextChunks({
@@ -613,7 +605,7 @@ async function sendMessageDiscord(to, text, opts) {
613
605
  silent: opts.silent,
614
606
  suppressEmbeds,
615
607
  allowedMentions: opts.allowedMentions,
616
- onResult: reportThreadResult,
608
+ onResult: reportResult,
617
609
  onPlatformSendDispatch: opts.onPlatformSendDispatch
618
610
  });
619
611
  } catch (err) {
@@ -639,12 +631,6 @@ async function sendMessageDiscord(to, text, opts) {
639
631
  };
640
632
  }
641
633
  let result;
642
- const reportResult = async (progressResult, kind, replyToId) => {
643
- await opts.onDeliveryResult?.(toDiscordSendResult(progressResult, channelId, {
644
- kind,
645
- reply: createReusableDiscordReplyReference(replyToId)
646
- }));
647
- };
648
634
  try {
649
635
  if (opts.mediaUrl) result = await sendDiscordMedia({
650
636
  rest,
@@ -700,15 +686,20 @@ async function sendMessageDiscord(to, text, opts) {
700
686
  accountId: accountInfo.accountId,
701
687
  direction: "outbound"
702
688
  });
703
- return toDiscordSendResult(result, channelId, {
704
- kind: opts.mediaUrl ? "media" : opts.components || opts.embeds ? "card" : "text",
705
- reply: opts.reply
706
- });
689
+ return {
690
+ messageId: result.id || "unknown",
691
+ channelId: result.channel_id ?? channelId,
692
+ receipt: createDiscordSendReceiptFromResults({ results: deliveredResults })
693
+ };
707
694
  }
708
695
  async function sendStickerDiscord(to, stickerIds, opts) {
709
- const { rest, request, channelId, rewrittenContent, suppressEmbeds } = await resolveDiscordStructuredSendContext(to, opts);
696
+ const context = await resolveDiscordStructuredSendContext(to, opts);
697
+ const { rewrittenContent, suppressEmbeds } = context;
710
698
  const stickers = normalizeStickerIds(stickerIds);
711
- const flags = resolveDiscordMessageFlags({ suppressEmbeds });
699
+ const flags = resolveDiscordMessageFlags({
700
+ silent: opts.silent,
701
+ suppressEmbeds
702
+ });
712
703
  const body = {
713
704
  content: rewrittenContent || void 0,
714
705
  sticker_ids: stickers,
@@ -716,11 +707,11 @@ async function sendStickerDiscord(to, stickerIds, opts) {
716
707
  enforce_nonce: true,
717
708
  ...flags ? { flags } : {}
718
709
  };
719
- await opts.onPlatformSendDispatch?.();
720
- return toDiscordSendResult(await request(() => createChannelMessage(rest, channelId, { body }), "sticker", { safety: "nonce-protected-create" }), channelId, { kind: "card" });
710
+ return context.send("sticker", body);
721
711
  }
722
712
  async function sendPollDiscord(to, poll, opts) {
723
- const { rest, request, channelId, rewrittenContent, suppressEmbeds } = await resolveDiscordStructuredSendContext(to, opts);
713
+ const context = await resolveDiscordStructuredSendContext(to, opts);
714
+ const { rewrittenContent, suppressEmbeds } = context;
724
715
  if (poll.durationSeconds !== void 0) throw new Error("Discord polls do not support durationSeconds; use durationHours");
725
716
  const payload = normalizeDiscordPollInput(poll);
726
717
  const flags = resolveDiscordMessageFlags({
@@ -734,20 +725,28 @@ async function sendPollDiscord(to, poll, opts) {
734
725
  enforce_nonce: true,
735
726
  ...flags ? { flags } : {}
736
727
  };
737
- await opts.onPlatformSendDispatch?.();
738
- return toDiscordSendResult(await request(() => createChannelMessage(rest, channelId, { body }), "poll", { safety: "nonce-protected-create" }), channelId, { kind: "card" });
728
+ return context.send("poll", body);
739
729
  }
740
730
  async function resolveDiscordStructuredSendContext(to, opts) {
741
- const accountInfo = resolveDiscordAccount({
742
- cfg: requireRuntimeConfig(opts.cfg, "Discord structured send"),
743
- accountId: opts.accountId
744
- });
745
- const { rest, request, channelId } = await resolveDiscordSendTarget(to, opts);
731
+ requireRuntimeConfig(opts.cfg, "Discord structured send");
732
+ const { rest, request, channelId, account: accountInfo } = await resolveDiscordSendTarget(to, opts);
746
733
  const content = opts.content?.trim();
747
734
  return {
748
- rest,
749
- request,
750
- channelId,
735
+ send: async (kind, body) => {
736
+ const result = await request(async () => {
737
+ await opts.onPlatformSendDispatch?.();
738
+ return createChannelMessage(rest, channelId, { body });
739
+ }, kind, { safety: "nonce-protected-create" });
740
+ recordChannelActivity({
741
+ channel: "discord",
742
+ accountId: accountInfo.accountId,
743
+ direction: "outbound"
744
+ });
745
+ return toDiscordSendResult(result, channelId, {
746
+ kind: kind === "poll" ? "poll" : "card",
747
+ threadId: kind === "poll" ? opts.threadId : void 0
748
+ });
749
+ },
751
750
  rewrittenContent: content ? rewriteDiscordKnownMentions(content, {
752
751
  accountId: accountInfo.accountId,
753
752
  mentionAliases: accountInfo.config.mentionAliases