@openclaw/discord 2026.8.1-beta.3 → 2026.8.2

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 (290) hide show
  1. package/dist/account-inspect-BY-ve3yH.js +45 -0
  2. package/dist/account-inspect-api.js +1 -1
  3. package/dist/{accounts-DNl-oCEw.js → accounts-CwJQoLjM.js} +87 -162
  4. package/dist/action-runtime-api.js +1 -1
  5. package/dist/{activities-api-KCBAmWxD.js → activities-api-CkKcHUB6.js} +14 -12
  6. package/dist/activities-api.js +1 -1
  7. package/dist/{allow-list-BDMimASD.js → allow-list-C2JuH-R0.js} +10 -6
  8. package/dist/{api-DNVbJyEy.js → api-BfmEP6wp.js} +6 -5
  9. package/dist/api.js +18 -18
  10. package/dist/{approval-handler.runtime-B12RCYr8.js → approval-handler.runtime-DZM6Kt1Z.js} +30 -106
  11. package/dist/{audit-Yc7eZDd6.js → audit-DIbQA4VT.js} +8 -7
  12. package/dist/{channel-cXYzGc4L.js → channel-CarzU3bg.js} +25 -25
  13. package/dist/{channel-actions.runtime-CODTvo7c.js → channel-actions.runtime-B2wMqeVK.js} +60 -57
  14. package/dist/channel-config-api.js +1 -1
  15. package/dist/channel-plugin-api.js +1 -1
  16. package/dist/channel-type-CVLZyGYS.js +7 -0
  17. package/dist/{channel.setup-CSiwnMgs.js → channel.setup-z_ewMVa9.js} +18 -18
  18. package/dist/{components-ezGKo_Yh.js → components-gvRA0oaI.js} +33 -29
  19. package/dist/{config-schema-DC5kDtQ5.js → config-schema-B797-Spt.js} +21 -14
  20. package/dist/{conversation-binding-route-D6rCQ5S0.js → conversation-binding-route-DPpBRpYI.js} +1 -1
  21. package/dist/{directory-config-XyCfoqLg.js → directory-config-AA8wQx0D.js} +2 -2
  22. package/dist/directory-contract-api.js +1 -1
  23. package/dist/{directory-live-Df0NbFJB.js → directory-live-D_kFz_Fj.js} +4 -4
  24. package/dist/{doctor-DYY31GrO.js → doctor-QQTOkBfW.js} +5 -5
  25. package/dist/{doctor-contract-DsWvKIXF.js → doctor-contract-Co5vRCZ6.js} +9 -6
  26. package/dist/doctor-contract-api.js +4 -3
  27. package/dist/{handle-action.guild-admin-6Tvvinsa.js → handle-action.guild-admin-Cc88ZGon.js} +9 -5
  28. package/dist/index.js +1 -1
  29. package/dist/ingress-identity-BCzfPPYM.js +60 -0
  30. package/dist/{message-handler-B61q5MOF.js → message-handler-CAeEpqWo.js} +14 -10
  31. package/dist/{message-handler.preflight-Bzg_Hawz.js → message-handler.preflight-CoKoE3dY.js} +32 -91
  32. package/dist/{message-handler.process--4_712Ec.js → message-handler.process-cdIJ_fDT.js} +99 -123
  33. package/dist/{message-utils-BXLLnFl6.js → message-text-C0K4-fkg.js} +41 -34
  34. package/dist/{outbound-adapter-DxHTOqiN.js → outbound-adapter-Ch0At5Ra.js} +85 -78
  35. package/dist/{outbound-components-B2PL0ooH.js → outbound-components-Bnt_7x7r.js} +5 -4
  36. package/dist/outbound-session-route-CzzerX2K.js +668 -0
  37. package/dist/{owner-access-Bg41VzAf.js → owner-access-yc1sX7Gx.js} +7 -6
  38. package/dist/{pluralkit-dUl4v1X3.js → pluralkit-B3cUVI7i.js} +2 -2
  39. package/dist/{probe-BTdtVRwU.js → probe-3ovFAp3b.js} +3 -3
  40. package/dist/{probe.runtime-Dq5-PRKT.js → probe.runtime-BckHn3cJ.js} +1 -1
  41. package/dist/{provider-DlK_ynqt.js → provider-CjI8BSzS.js} +511 -342
  42. package/dist/{provider-session.runtime-CvvphHvs.js → provider-session.runtime-DdKRMcE9.js} +3 -3
  43. package/dist/provider.runtime-Bo1WbLLr.js +2 -0
  44. package/dist/{realtime-session.runtime-ysbMG8v7.js → realtime-session.runtime-37IC-p5K.js} +110 -126
  45. package/dist/{resolve-allowlist-common-DIVXbD1P.js → resolve-allowlist-common-BJ5UZNNT.js} +3 -3
  46. package/dist/{resolve-channels-CGeUoIqb.js → resolve-channels-BexR2eUn.js} +6 -5
  47. package/dist/{resolve-users-BtKxLUZv.js → resolve-users-BtXBCH5W.js} +5 -4
  48. package/dist/{retry-after-DdLPmPoa.js → retry-after-BrLjLUJi.js} +2 -1
  49. package/dist/{retry-DNsVTeTo.js → retry-t5RcEsPk.js} +237 -15
  50. package/dist/{runtime-CQovMsH3.js → runtime-BNlDfLwS.js} +2 -2
  51. package/dist/{runtime-D71_VFLr.js → runtime-DydyfxST.js} +182 -131
  52. package/dist/runtime-api.js +19 -26
  53. package/dist/{secret-config-contract-B3i6WxV5.js → secret-config-contract-DFu9hfU8.js} +14 -6
  54. package/dist/secret-contract-api.js +1 -1
  55. package/dist/{security-audit-BfJhAXZp.js → security-audit-DKfK-iPY.js} +10 -11
  56. package/dist/security-audit-contract-api.js +1 -1
  57. package/dist/{security-audit.runtime-BVKF9VtY.js → security-audit.runtime-sKZyKgpx.js} +1 -1
  58. package/dist/{send-rQIffSYu.js → send-mTKSBdmZ.js} +149 -58
  59. package/dist/{send.components-ChK1wS7w.js → send.components-nsPnc7kK.js} +29 -30
  60. package/dist/{send.outbound-HIkgji_7.js → send.outbound-CaOs9Zy1.js} +87 -84
  61. package/dist/{send.shared-B3fpaLWJ.js → send.shared-BJHt0Vyf.js} +55 -33
  62. package/dist/{sender-identity-BJtfyise.js → sender-identity-Dt0imZyY.js} +1 -1
  63. package/dist/setup-plugin-api.js +1 -1
  64. package/dist/{shared-CaAaoksy.js → shared-BNesVA4P.js} +43 -18
  65. package/dist/{subagent-hooks-CNT2ZJTJ.js → subagent-hooks-IeZVPLGj.js} +2 -2
  66. package/dist/subagent-hooks-api.js +1 -6
  67. package/dist/{system-events-Nuwoq_au.js → system-events-Be5EJI3b.js} +2 -2
  68. package/dist/{target-resolver-DIXShHaZ.js → target-resolver-C0MnwEki.js} +6 -5
  69. package/dist/targets-DQSye1Rv.js +3 -0
  70. package/dist/{thread-bindings-VlymUnbz.js → thread-bindings-wECUSIIG.js} +6 -6
  71. package/dist/{thread-bindings.manager-CngsgErq.js → thread-bindings.manager-B-3UHCc1.js} +31 -32
  72. package/dist/{thread-bindings.session-updates-CJb-BpPL.js → thread-bindings.session-updates-CC7HoQvt.js} +2 -1
  73. package/dist/{threading-DU6pgeGm.js → threading-te5ADPQI.js} +51 -27
  74. package/dist/{timeouts-B9cy6RvQ.js → timeouts-D86uWLt_.js} +1 -1
  75. package/dist/{transcripts-source-DeIMNbRh.js → transcripts-source-DkUhR7YK.js} +9 -4
  76. package/dist/transcripts-source-api.js +1 -1
  77. package/dist/{typing-oLiS5Z13.js → typing-DAwJF5VT.js} +2 -2
  78. package/dist/{voice-runtime-CjNFaynA.js → voice-runtime-COyYYTDD.js} +418 -74
  79. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/README.md +1 -1
  80. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/conforms.d.ts +2 -0
  81. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/package.json +3 -3
  82. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubArray.d.ts +2 -0
  83. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubObject.d.ts +2 -0
  84. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubString.d.ts +2 -0
  85. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/README.md +19 -19
  86. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v1.js +7 -3
  87. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v7.js +5 -2
  88. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v1.js +7 -3
  89. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v7.js +5 -2
  90. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/package.json +4 -3
  91. package/node_modules/@discordjs/voice/node_modules/@types/node/README.md +1 -1
  92. package/node_modules/@discordjs/voice/node_modules/@types/node/child_process.d.ts +0 -1
  93. package/node_modules/@discordjs/voice/node_modules/@types/node/crypto.d.ts +6 -6
  94. package/node_modules/@discordjs/voice/node_modules/@types/node/dns/promises.d.ts +5 -5
  95. package/node_modules/@discordjs/voice/node_modules/@types/node/dns.d.ts +5 -5
  96. package/node_modules/@discordjs/voice/node_modules/@types/node/fs.d.ts +7 -0
  97. package/node_modules/@discordjs/voice/node_modules/@types/node/http.d.ts +30 -0
  98. package/node_modules/@discordjs/voice/node_modules/@types/node/http2.d.ts +4 -4
  99. package/node_modules/@discordjs/voice/node_modules/@types/node/os.d.ts +30 -30
  100. package/node_modules/@discordjs/voice/node_modules/@types/node/package.json +2 -2
  101. package/node_modules/@discordjs/voice/node_modules/@types/node/perf_hooks.d.ts +2 -1
  102. package/node_modules/@discordjs/voice/node_modules/@types/node/process.d.ts +42 -43
  103. package/node_modules/@discordjs/voice/node_modules/@types/node/quic.d.ts +1049 -84
  104. package/node_modules/@discordjs/voice/node_modules/@types/node/sqlite.d.ts +14 -1
  105. package/node_modules/@discordjs/voice/node_modules/@types/node/stream/iter.d.ts +3 -2
  106. package/node_modules/@discordjs/voice/node_modules/@types/node/test.d.ts +61 -0
  107. package/node_modules/@discordjs/voice/node_modules/@types/node/v8.d.ts +20 -23
  108. package/node_modules/discord-api-types/CHANGELOG.md +8 -0
  109. package/node_modules/discord-api-types/package.json +4 -4
  110. package/node_modules/discord-api-types/payloads/v10/channel.d.ts +2 -2
  111. package/node_modules/discord-api-types/payloads/v10/channel.d.ts.map +1 -1
  112. package/node_modules/discord-api-types/payloads/v10/gateway.d.ts +4 -0
  113. package/node_modules/discord-api-types/payloads/v10/gateway.d.ts.map +1 -1
  114. package/node_modules/discord-api-types/payloads/v10/gateway.js.map +1 -1
  115. package/node_modules/discord-api-types/payloads/v10/message.d.ts +4 -1
  116. package/node_modules/discord-api-types/payloads/v10/message.d.ts.map +1 -1
  117. package/node_modules/discord-api-types/payloads/v10/message.js +1 -0
  118. package/node_modules/discord-api-types/payloads/v10/message.js.map +1 -1
  119. package/node_modules/discord-api-types/payloads/v9/channel.d.ts +2 -2
  120. package/node_modules/discord-api-types/payloads/v9/channel.d.ts.map +1 -1
  121. package/node_modules/discord-api-types/payloads/v9/gateway.d.ts +4 -0
  122. package/node_modules/discord-api-types/payloads/v9/gateway.d.ts.map +1 -1
  123. package/node_modules/discord-api-types/payloads/v9/gateway.js.map +1 -1
  124. package/node_modules/discord-api-types/payloads/v9/message.d.ts +4 -1
  125. package/node_modules/discord-api-types/payloads/v9/message.d.ts.map +1 -1
  126. package/node_modules/discord-api-types/payloads/v9/message.js +1 -0
  127. package/node_modules/discord-api-types/payloads/v9/message.js.map +1 -1
  128. package/node_modules/typebox/build/format/date.d.mts +1 -1
  129. package/node_modules/typebox/build/format/date.mjs +1 -1
  130. package/node_modules/typebox/build/format/date_time.d.mts +2 -2
  131. package/node_modules/typebox/build/format/date_time.mjs +3 -3
  132. package/node_modules/typebox/build/format/email.d.mts +1 -1
  133. package/node_modules/typebox/build/format/email.mjs +2 -2
  134. package/node_modules/typebox/build/format/hostname.mjs +2 -10
  135. package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
  136. package/node_modules/typebox/build/format/idn_email.mjs +3 -3
  137. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
  138. package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
  139. package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
  140. package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
  141. package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
  142. package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
  143. package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
  144. package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
  145. package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
  146. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +41 -0
  147. package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
  148. package/node_modules/typebox/build/format/idna/index.mjs +2 -0
  149. package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
  150. package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
  151. package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
  152. package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
  153. package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
  154. package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
  155. package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
  156. package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
  157. package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
  158. package/node_modules/typebox/build/format/ipv4.mjs +2 -32
  159. package/node_modules/typebox/build/format/ipv6.mjs +2 -61
  160. package/node_modules/typebox/build/format/iri.d.mts +2 -2
  161. package/node_modules/typebox/build/format/iri.mjs +26 -8
  162. package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
  163. package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
  164. package/node_modules/typebox/build/format/regex.d.mts +1 -2
  165. package/node_modules/typebox/build/format/regex.mjs +2 -6
  166. package/node_modules/typebox/build/format/time.d.mts +2 -2
  167. package/node_modules/typebox/build/format/time.mjs +19 -14
  168. package/node_modules/typebox/build/format/uri.d.mts +1 -1
  169. package/node_modules/typebox/build/format/uri.mjs +3 -130
  170. package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
  171. package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
  172. package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
  173. package/node_modules/typebox/build/format/uri_template.mjs +4 -5
  174. package/node_modules/typebox/build/format/url.d.mts +3 -3
  175. package/node_modules/typebox/build/format/url.mjs +4 -5
  176. package/node_modules/typebox/build/guard/emit.d.mts +3 -1
  177. package/node_modules/typebox/build/guard/emit.mjs +12 -5
  178. package/node_modules/typebox/build/guard/guard.d.mts +8 -2
  179. package/node_modules/typebox/build/guard/guard.mjs +25 -4
  180. package/node_modules/typebox/build/guard/string.d.mts +2 -2
  181. package/node_modules/typebox/build/guard/string.mjs +7 -7
  182. package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
  183. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
  184. package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
  185. package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
  186. package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
  187. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
  188. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
  189. package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
  190. package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
  191. package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
  192. package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
  193. package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
  194. package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
  195. package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
  196. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
  197. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
  198. package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
  199. package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
  200. package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
  201. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
  202. package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
  203. package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
  204. package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
  205. package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
  206. package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
  207. package/node_modules/typebox/build/schema/types/index.mjs +0 -2
  208. package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
  209. package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
  210. package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
  211. package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
  212. package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
  213. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
  214. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
  215. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
  216. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
  217. package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
  218. package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
  219. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
  220. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
  221. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
  222. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
  223. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
  224. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
  225. package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
  226. package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
  227. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
  228. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
  229. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
  230. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
  231. package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
  232. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
  233. package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
  234. package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
  235. package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
  236. package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
  237. package/node_modules/typebox/build/type/script/parser.mjs +27 -23
  238. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  239. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  240. package/node_modules/typebox/package.json +27 -27
  241. package/node_modules/typebox/readme.md +79 -82
  242. package/node_modules/undici/docs/docs/api/Client.md +21 -8
  243. package/node_modules/undici/lib/api/readable.js +33 -43
  244. package/node_modules/undici/lib/core/connect.js +16 -2
  245. package/node_modules/undici/lib/core/symbols.js +1 -0
  246. package/node_modules/undici/lib/dispatcher/client-h1.js +3 -3
  247. package/node_modules/undici/lib/dispatcher/client-h2.js +179 -10
  248. package/node_modules/undici/lib/dispatcher/client.js +74 -29
  249. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +28 -6
  250. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +15 -1
  251. package/node_modules/undici/lib/handler/retry-handler.js +7 -2
  252. package/node_modules/undici/lib/interceptor/cache.js +5 -2
  253. package/node_modules/undici/lib/interceptor/deduplicate.js +1 -1
  254. package/node_modules/undici/lib/mock/mock-utils.js +213 -24
  255. package/node_modules/undici/lib/util/cache.js +2 -4
  256. package/node_modules/undici/lib/web/websocket/websocket.js +22 -0
  257. package/node_modules/undici/package.json +1 -1
  258. package/node_modules/undici/types/client.d.ts +40 -0
  259. package/node_modules/ws/lib/permessage-deflate.js +3 -1
  260. package/node_modules/ws/package.json +1 -1
  261. package/openclaw.plugin.json +14 -6
  262. package/package.json +8 -8
  263. package/skills/discord/SKILL.md +1 -1
  264. package/dist/account-inspect-D5xmUpnj.js +0 -89
  265. package/dist/approval-message-safety-XGFPbDoI.js +0 -226
  266. package/dist/audit-core-BCX8UeFH.js +0 -105
  267. package/dist/channel-actions-Dr2QI8Bf.js +0 -212
  268. package/dist/inbound-event-delivery-De2qxTrP.js +0 -39
  269. package/dist/provider.runtime-CzKGRiAF.js +0 -2
  270. package/dist/runtime-api.actions.js +0 -3
  271. package/dist/runtime-api.lookup.js +0 -7
  272. package/dist/runtime-api.monitor-CzeTYF32.js +0 -6
  273. package/dist/runtime-api.monitor.js +0 -9
  274. package/dist/runtime-api.send.js +0 -7
  275. package/dist/runtime-api.threads.js +0 -5
  276. package/dist/sdk-runtime-37OU6_Yh.js +0 -369
  277. package/dist/send.reactions-gmJ6yFPo.js +0 -78
  278. package/dist/send.receipt-Cnhoautb.js +0 -76
  279. package/dist/subagent-progress-FPLqBY1s.js +0 -110
  280. package/dist/targets-B2pf49zc.js +0 -3
  281. package/node_modules/typebox/build/format/_idna.d.mts +0 -2
  282. package/node_modules/typebox/build/format/_idna.mjs +0 -246
  283. package/node_modules/typebox/build/format/_puny.d.mts +0 -1
  284. package/node_modules/typebox/build/format/_puny.mjs +0 -77
  285. package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
  286. package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
  287. package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
  288. package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
  289. package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
  290. package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
@@ -1,13 +1,14 @@
1
- import { R as Message, Tt as getChannelMessage, p as discord_exports } from "./retry-DNsVTeTo.js";
2
- import { s as resolveDefaultDiscordAccountId } from "./accounts-DNl-oCEw.js";
3
- import { C as resolveTimestampMs, S as resolveDiscordSystemLocation, _ as resolveDiscordShouldRequireMention, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, f as resolveDiscordGuildEntry, i as normalizeDiscordDisplaySlug, n as isDiscordGroupAllowedByPolicy, p as resolveDiscordMemberAccessState, v as resolveGroupDmAllow, x as formatDiscordUserTag } from "./allow-list-BDMimASD.js";
4
- import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-B9cy6RvQ.js";
5
- import { d as resolveDiscordRuntimeBindingConversationId, i as buildDiscordRoutePeer, l as resolveDiscordConversationIdentity, o as resolveDiscordConversationRoute, s as resolveDiscordEffectiveRoute } from "./approval-message-safety-XGFPbDoI.js";
6
- import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-D6rCQ5S0.js";
7
- import { c as resolveDiscordChannelInfoSafe, l as resolveDiscordChannelNameSafe } from "./thread-bindings.manager-CngsgErq.js";
8
- import { b as resolveDiscordDmCommandAccess, g as handleDiscordDmCommandDecision, x as resolveDiscordTextCommandAccess } from "./provider-DlK_ynqt.js";
9
- import { d as resolveDiscordMessageStickers, f as resolveDiscordChannelInfo, i as resolveDiscordMessageText, o as resolveForwardedMediaList, p as resolveDiscordMessageChannelId, r as resolveDiscordMessageHistoryText, s as resolveMediaList } from "./message-utils-BXLLnFl6.js";
10
- import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-BJtfyise.js";
1
+ import { W as Message, jt as getChannelMessage, y as discord_exports } from "./retry-t5RcEsPk.js";
2
+ import { s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.js";
3
+ import { C as resolveTimestampMs, S as resolveDiscordSystemLocation, _ as resolveDiscordShouldRequireMention, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, f as resolveDiscordGuildEntry, i as normalizeDiscordDisplaySlug, p as resolveDiscordMemberAccessState, x as formatDiscordUserTag } from "./allow-list-C2JuH-R0.js";
4
+ import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
5
+ import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-D86uWLt_.js";
6
+ import { a as buildDiscordRoutePeer, c as resolveDiscordEffectiveRoute, f as resolveDiscordRuntimeBindingConversationId, s as resolveDiscordConversationRoute, u as resolveDiscordConversationIdentity } from "./outbound-session-route-CzzerX2K.js";
7
+ import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-DPpBRpYI.js";
8
+ import { c as resolveDiscordChannelInfoSafe, l as resolveDiscordChannelNameSafe } from "./thread-bindings.manager-B-3UHCc1.js";
9
+ import { S as resolveDiscordTextCommandAccess, _ as handleDiscordDmCommandDecision, n as resolveDiscordPreflightChannelAccess, x as resolveDiscordDmCommandAccess } from "./provider-CjI8BSzS.js";
10
+ import { d as resolveDiscordReferencedReplyMessage, h as resolveDiscordMessageChannelId, i as resolveDiscordMessageText, m as resolveDiscordChannelInfo, o as resolveForwardedMediaList, r as resolveDiscordMessageHistoryText, s as resolveMediaList, u as resolveDiscordMessageStickers } from "./message-text-C0K4-fkg.js";
11
+ import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-Dt0imZyY.js";
11
12
  import { t as createDiscordHistorySenderProvenance } from "./message-handler.history-CJOsN9w5.js";
12
13
  import { logDebug } from "openclaw/plugin-sdk/logging-core";
13
14
  import { MessageReferenceType, MessageType } from "discord-api-types/v10";
@@ -28,7 +29,7 @@ import { shouldHandleTextCommands } from "openclaw/plugin-sdk/command-surface";
28
29
  import { createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
29
30
  //#region extensions/discord/src/monitor/message-handler.dm-preflight.ts
30
31
  const loadConversationRuntime$1 = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/conversation-binding-runtime"));
31
- const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-rQIffSYu.js").then((n) => n.t));
32
+ const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-mTKSBdmZ.js").then((n) => n.t));
32
33
  function resolveDiscordDmPairingSenderId(sender) {
33
34
  return sender.isPluralKit ? `pk:${sender.id}` : sender.id;
34
35
  }
@@ -53,7 +54,9 @@ async function resolveDiscordDmPreflightAccess(params) {
53
54
  sender: {
54
55
  id: params.sender.id,
55
56
  name: params.sender.name,
56
- tag: params.sender.tag
57
+ tag: params.sender.tag,
58
+ isPluralKit: params.sender.isPluralKit,
59
+ authorKind: params.author.bot ? "bot" : "user"
57
60
  },
58
61
  allowNameMatching: params.allowNameMatching,
59
62
  cfg: params.preflight.cfg,
@@ -267,72 +270,6 @@ async function hydrateDiscordMessageIfNeeded(params) {
267
270
  };
268
271
  }
269
272
  //#endregion
270
- //#region extensions/discord/src/monitor/message-handler.preflight-channel-access.ts
271
- function resolveDiscordPreflightChannelAccess(params) {
272
- if (params.isGuildMessage && params.channelConfig?.enabled === false) {
273
- logDebug(`[discord-preflight] drop: channel disabled`);
274
- logVerbose(`Blocked discord channel ${params.messageChannelId} (channel disabled, ${params.channelMatchMeta})`);
275
- return {
276
- allowed: false,
277
- channelAllowlistConfigured: false,
278
- channelAllowed: false
279
- };
280
- }
281
- const groupDmAllowed = params.isGroupDm && resolveGroupDmAllow({
282
- channels: params.groupDmChannels,
283
- channelId: params.messageChannelId,
284
- channelName: params.displayChannelName,
285
- channelSlug: params.displayChannelSlug
286
- });
287
- if (params.isGroupDm && !groupDmAllowed) return {
288
- allowed: false,
289
- channelAllowlistConfigured: false,
290
- channelAllowed: false
291
- };
292
- const channelAllowlistConfigured = Boolean(params.guildInfo?.channels) && Object.keys(params.guildInfo?.channels ?? {}).length > 0;
293
- const channelAllowed = params.channelConfig?.allowed !== false;
294
- if (params.isGuildMessage && !isDiscordGroupAllowedByPolicy({
295
- groupPolicy: params.groupPolicy,
296
- guildAllowlisted: Boolean(params.guildInfo),
297
- channelAllowlistConfigured,
298
- channelAllowed
299
- })) {
300
- if (params.groupPolicy === "disabled") {
301
- logDebug(`[discord-preflight] drop: groupPolicy disabled`);
302
- logVerbose(`discord: drop guild message (groupPolicy: disabled, ${params.channelMatchMeta})`);
303
- } else if (!channelAllowlistConfigured) {
304
- logDebug(`[discord-preflight] drop: groupPolicy allowlist, no channel allowlist configured`);
305
- logVerbose(`discord: drop guild message (groupPolicy: allowlist, no channel allowlist, ${params.channelMatchMeta})`);
306
- } else {
307
- logDebug(`[discord] Ignored message from channel ${params.messageChannelId} (not in guild allowlist). Add to guilds.<guildId>.channels to enable.`);
308
- logVerbose(`Blocked discord channel ${params.messageChannelId} not in guild channel allowlist (groupPolicy: allowlist, ${params.channelMatchMeta})`);
309
- }
310
- return {
311
- allowed: false,
312
- channelAllowlistConfigured,
313
- channelAllowed
314
- };
315
- }
316
- if (params.isGuildMessage && params.channelConfig?.allowed === false) {
317
- logDebug(`[discord-preflight] drop: channelConfig.allowed===false`);
318
- logVerbose(`Blocked discord channel ${params.messageChannelId} not in guild channel allowlist (${params.channelMatchMeta})`);
319
- return {
320
- allowed: false,
321
- channelAllowlistConfigured,
322
- channelAllowed
323
- };
324
- }
325
- if (params.isGuildMessage) {
326
- logDebug(`[discord-preflight] pass: channel allowed`);
327
- logVerbose(`discord: allow channel ${params.messageChannelId} (${params.channelMatchMeta})`);
328
- }
329
- return {
330
- allowed: true,
331
- channelAllowlistConfigured,
332
- channelAllowed
333
- };
334
- }
335
- //#endregion
336
273
  //#region extensions/discord/src/monitor/message-handler.preflight-channel-context.ts
337
274
  function resolveDiscordPreflightChannelContext(params) {
338
275
  const threadName = params.threadChannel?.name;
@@ -401,9 +338,6 @@ function isBoundThreadBotSystemMessage(params) {
401
338
  if (!text) return false;
402
339
  return DISCORD_BOUND_THREAD_SYSTEM_PREFIXES.some((prefix) => text.startsWith(prefix));
403
340
  }
404
- function isDiscordThreadChannelType(type) {
405
- return type === discord_exports.ChannelType.PublicThread || type === discord_exports.ChannelType.PrivateThread || type === discord_exports.ChannelType.AnnouncementThread;
406
- }
407
341
  function isDiscordThreadChannelMessage(params) {
408
342
  if (!params.isGuildMessage) return false;
409
343
  const channel = "channel" in params.message ? params.message.channel : void 0;
@@ -481,7 +415,8 @@ function buildDiscordPreflightHistoryEntry(params) {
481
415
  //#region extensions/discord/src/monitor/message-handler.preflight-logging.ts
482
416
  function logDiscordPreflightChannelConfig(params) {
483
417
  if (!shouldLogVerbose()) return;
484
- logDebug(`[discord-preflight] channelConfig=${params.channelConfig ? `allowed=${params.channelConfig.allowed} enabled=${params.channelConfig.enabled ?? "unset"} requireMention=${params.channelConfig.requireMention ?? "unset"} ignoreOtherMentions=${params.channelConfig.ignoreOtherMentions ?? "unset"} matchKey=${params.channelConfig.matchKey ?? "none"} matchSource=${params.channelConfig.matchSource ?? "none"} users=${params.channelConfig.users?.length ?? 0} roles=${params.channelConfig.roles?.length ?? 0} skills=${params.channelConfig.skills?.length ?? 0}` : "none"} channelMatchMeta=${params.channelMatchMeta} channelId=${params.channelId}`);
418
+ const channelConfigSummary = params.channelConfig ? `allowed=${params.channelConfig.allowed} enabled=${params.channelConfig.enabled ?? "unset"} requireMention=${params.channelConfig.requireMention ?? "unset"} ignoreOtherMentions=${params.channelConfig.ignoreOtherMentions ?? "unset"} matchKey=${params.channelConfig.matchKey ?? "none"} matchSource=${params.channelConfig.matchSource ?? "none"} users=${params.channelConfig.users?.length ?? 0} roles=${params.channelConfig.roles?.length ?? 0} skills=${params.channelConfig.skills?.length ?? 0}` : "none";
419
+ logDebug(`[discord-preflight] channelConfig=${channelConfigSummary} channelMatchMeta=${params.channelMatchMeta} channelId=${params.channelId}`);
485
420
  }
486
421
  function logDiscordPreflightInboundSummary(params) {
487
422
  if (!shouldLogVerbose()) return;
@@ -489,10 +424,10 @@ function logDiscordPreflightInboundSummary(params) {
489
424
  }
490
425
  //#endregion
491
426
  //#region extensions/discord/src/monitor/message-handler.preflight-runtime.ts
492
- const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-dUl4v1X3.js").then((n) => n.n));
427
+ const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-B3cUVI7i.js").then((n) => n.n));
493
428
  const loadPreflightAudioRuntime = createLazyRuntimeModule(() => import("./preflight-audio-DrnqFA8U.js"));
494
- const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-Nuwoq_au.js"));
495
- const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./threading-DU6pgeGm.js").then((n) => n.t));
429
+ const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-Be5EJI3b.js"));
430
+ const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./threading-te5ADPQI.js").then((n) => n.t));
496
431
  function isPreflightAborted(abortSignal) {
497
432
  return Boolean(abortSignal?.aborted);
498
433
  }
@@ -592,7 +527,7 @@ async function resolveDiscordPreflightRoute(params) {
592
527
  //#endregion
593
528
  //#region extensions/discord/src/monitor/message-handler.preflight.ts
594
529
  const DISCORD_HISTORY_MEDIA_MAX_ATTACHMENTS = 4;
595
- const DISCORD_HISTORY_MEDIA_MAX_BYTES = 10 * 1024 * 1024;
530
+ const DISCORD_HISTORY_MEDIA_MAX_BYTES = 10485760;
596
531
  const DISCORD_HISTORY_MEDIA_IDLE_TIMEOUT_MS = 1e3;
597
532
  const DISCORD_HISTORY_MEDIA_TOTAL_TIMEOUT_MS = 3e3;
598
533
  function resolveDiscordPreflightConversationKind(params) {
@@ -707,7 +642,7 @@ async function preflightDiscordMessage(params) {
707
642
  channelType: channelInfo?.type
708
643
  });
709
644
  const messageText = resolveDiscordMessageText(message, { includeForwarded: true });
710
- const injectedBoundThreadBinding = !isDirectMessage && !isGroupDm ? resolveInjectedBoundThreadLookupRecord({
645
+ const injectedBoundThreadBinding = !isDirectMessage && !isGroupDm && (webhookId || author.bot) ? resolveInjectedBoundThreadLookupRecord({
711
646
  threadBindings: params.threadBindings,
712
647
  threadId: messageChannelId
713
648
  }) : void 0;
@@ -967,7 +902,9 @@ async function preflightDiscordMessage(params) {
967
902
  sender: {
968
903
  id: sender.id,
969
904
  name: sender.name,
970
- tag: sender.tag
905
+ tag: sender.tag,
906
+ isPluralKit: sender.isPluralKit,
907
+ authorKind: author.bot ? "bot" : "user"
971
908
  },
972
909
  memberAccessConfigured: hasAccessRestrictions,
973
910
  memberAllowed,
@@ -1046,9 +983,13 @@ async function preflightDiscordMessage(params) {
1046
983
  }
1047
984
  }
1048
985
  const ignoreOtherMentions = channelConfig?.ignoreOtherMentions ?? guildInfo?.ignoreOtherMentions ?? false;
1049
- if (isGuildMessage && ignoreOtherMentions && hasUserOrRoleMention && !wasMentioned && !mentionDecision.implicitMention) {
1050
- logDebug(`[discord-preflight] drop: other-mention`);
1051
- logVerbose(`discord: drop guild message (another user/role mentioned, ignoreOtherMentions=true, botId=${botId})`);
986
+ const referencedReply = resolveDiscordReferencedReplyMessage(message);
987
+ const referencedWebhookId = referencedReply ? resolveDiscordWebhookId(referencedReply) : null;
988
+ const referencedAuthor = referencedReply?.author;
989
+ const replyTargetsOtherBot = Boolean(botId) && Boolean(referencedAuthor?.bot) && referencedAuthor?.id !== botId && !referencedWebhookId;
990
+ if (isGuildMessage && ignoreOtherMentions && (hasUserOrRoleMention || replyTargetsOtherBot) && !wasMentioned && !mentionDecision.implicitMention) {
991
+ logDebug(`[discord-preflight] drop: addressed-to-other`);
992
+ logVerbose(`discord: drop guild message (addressed to another identity, ignoreOtherMentions=true, botId=${botId})`);
1052
993
  await recordDiscordPendingHistoryEntry({
1053
994
  preflight: params,
1054
995
  historyKey: messageChannelId,
@@ -1,33 +1,31 @@
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";
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";
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";
16
- import { n as resolveDiscordWebhookId } from "./sender-identity-BJtfyise.js";
1
+ import { Dt as deleteChannelMessage, a as chunkDiscordTextWithMode, kt as editChannelMessage, v as resolveDiscordChannelId, wt as createChannelMessage, y as discord_exports } from "./retry-t5RcEsPk.js";
2
+ import { p as resolveDiscordMaxLinesPerMessage } from "./accounts-CwJQoLjM.js";
3
+ import { C as resolveTimestampMs, a as normalizeDiscordSlug, r as normalizeDiscordAllowList } from "./allow-list-C2JuH-R0.js";
4
+ import { F as createDiscordRuntimeAccountContext, P as createDiscordRestClient, d as resolveDiscordTargetChannelId, k as resolveDiscordMessageFlags } from "./send.shared-BJHt0Vyf.js";
5
+ import { i as discordTextHasBroadcastMention } from "./send.outbound-CaOs9Zy1.js";
6
+ import { a as removeReactionDiscord, f as editMessageDiscord, r as reactMessageDiscord } from "./send-mTKSBdmZ.js";
7
+ import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-D86uWLt_.js";
8
+ import "./targets-DQSye1Rv.js";
9
+ import { a as buildDiscordRoutePeer, h as discordInboundEventDelivery, u as resolveDiscordConversationIdentity } from "./outbound-session-route-CzzerX2K.js";
10
+ import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-Ch0At5Ra.js";
11
+ import { a as formatDiscordReplySkip, c as buildGuildLabel, g as createDiscordSupplementalContextAccessChecker, h as buildDiscordInboundAccessContext, i as formatDiscordReplyDeliveryFailure, l as resolveReplyContext, o as sanitizeDiscordFrontChannelReplyPayloads, r as deliverDiscordReply, s as buildDirectLabel } from "./provider-CjI8BSzS.js";
12
+ import { a as formatDiscordMediaText, c as resolveReferencedReplyMediaList, i as resolveDiscordMessageText, u as resolveDiscordMessageStickers } from "./message-text-C0K4-fkg.js";
13
+ import { a as resolveDiscordThreadStarter, n as resolveDiscordAutoThreadReplyPlan } from "./threading-te5ADPQI.js";
14
+ import { n as resolveDiscordWebhookId } from "./sender-identity-Dt0imZyY.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-DAwJF5VT.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";
21
+ import { getReplyPayloadTtsSupplement, isReplyPayloadNonTerminalToolErrorWarning, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
23
22
  import { danger, logVerbose, shouldLogVerbose, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
24
23
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
25
24
  import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
26
25
  import { resolveChunkMode } from "openclaw/plugin-sdk/reply-chunking";
27
26
  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";
27
+ import { bindIngressLifecycleToReplyOptions, createChannelMessageReplyPipeline, createChannelProgressDraftCompositor, createFinalizableDraftStreamControlsForState, createTypingCallbacks, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, resolveChannelDraftStreamingChunking, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelPreviewStreamMode, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewCommandText, resolveChannelStreamingProgressNarration, resolveTranscriptBackedChannelFinalText } from "openclaw/plugin-sdk/channel-outbound";
29
28
  import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-runtime";
30
- import { getReplyPayloadTtsSupplement, isReplyPayloadNonTerminalToolErrorWarning, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
31
29
  import { evaluateSupplementalContextVisibility } from "openclaw/plugin-sdk/security-runtime";
32
30
  import { resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/conversation-runtime";
33
31
  import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
@@ -39,7 +37,7 @@ import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
39
37
  import { buildHistoryContextFromEntries, buildInboundHistoryFromEntries, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
40
38
  import { resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
41
39
  import { formatAudioTranscriptForAgent } from "openclaw/plugin-sdk/media-understanding-runtime";
42
- import { DEFAULT_TIMING, createStatusReactionController, logAckFailure, logTypingFailure, shouldAckReaction } from "openclaw/plugin-sdk/channel-feedback";
40
+ import { createStatusReactionController, logAckFailure, logTypingFailure, shouldAckReaction } from "openclaw/plugin-sdk/channel-feedback";
43
41
  import { readLatestAssistantTextByIdentity } from "openclaw/plugin-sdk/session-transcript-runtime";
44
42
  //#region extensions/discord/src/monitor/message-handler.retry.ts
45
43
  const REPLY_SESSION_INIT_CONFLICT_MESSAGE_RE = /^reply session initialization conflicted for \S+$/u;
@@ -118,10 +116,11 @@ async function buildDiscordMessageProcessContext(params) {
118
116
  channel: "discord",
119
117
  accountId
120
118
  });
119
+ const allowNameMatching = isDangerousNameMatchingEnabled(discordConfig);
121
120
  const isSupplementalContextSenderAllowed = createDiscordSupplementalContextAccessChecker({
122
121
  channelConfig,
123
122
  guildInfo,
124
- allowNameMatching: isDangerousNameMatchingEnabled(discordConfig),
123
+ allowNameMatching,
125
124
  isGuild: isGuildMessage
126
125
  });
127
126
  const storePath = resolveStorePath(cfg.session?.store, { agentId: route.agentId });
@@ -199,21 +198,24 @@ async function buildDiscordMessageProcessContext(params) {
199
198
  const starter = await resolveDiscordThreadStarter({
200
199
  channel: threadChannel,
201
200
  client,
201
+ accountId,
202
202
  parentId: threadParentId,
203
203
  parentType: threadParentType,
204
204
  resolveTimestampMs
205
205
  });
206
- if (starter?.text) if (evaluateSupplementalContextVisibility({
207
- mode: contextVisibilityMode,
208
- kind: "thread",
209
- senderAllowed: isSupplementalContextSenderAllowed({
210
- id: starter.authorId,
211
- name: starter.authorName ?? starter.author,
212
- tag: starter.authorTag,
213
- memberRoleIds: starter.memberRoleIds
214
- })
215
- }).include) threadStarterBody = starter.text;
216
- else logVerbose(`discord: drop thread starter context (mode=${contextVisibilityMode})`);
206
+ if (starter?.text) {
207
+ if (evaluateSupplementalContextVisibility({
208
+ mode: contextVisibilityMode,
209
+ kind: "thread",
210
+ senderAllowed: isSupplementalContextSenderAllowed({
211
+ id: starter.authorId,
212
+ name: starter.authorName ?? starter.author,
213
+ tag: starter.authorTag,
214
+ memberRoleIds: starter.memberRoleIds
215
+ })
216
+ }).include) threadStarterBody = starter.text;
217
+ else logVerbose(`discord: drop thread starter context (mode=${contextVisibilityMode})`);
218
+ }
217
219
  }
218
220
  const parentName = threadParentName ?? "parent";
219
221
  threadLabel = threadName ? `Discord thread #${normalizeDiscordSlug(parentName)} › ${threadName}` : `Discord thread #${normalizeDiscordSlug(parentName)}`;
@@ -651,15 +653,13 @@ function createDiscordMessageReactionRuntime(params) {
651
653
  messageId: message.id,
652
654
  reactionContext: ackReactionContext
653
655
  });
654
- const statusReactionTiming = DEFAULT_TIMING;
655
656
  let statusReactionTarget = `${messageChannelId}/${message.id}`;
656
657
  let statusReactionsActive = statusReactionsEnabled;
657
658
  let statusReactions = createStatusReactionController({
658
659
  enabled: statusReactionsEnabled,
659
660
  adapter: discordAdapter,
660
661
  initialEmoji: ackReaction,
661
- emojis: void 0,
662
- timing: statusReactionTiming,
662
+ presentation: "acknowledgement",
663
663
  onError: (err) => {
664
664
  logAckFailure({
665
665
  log: logVerbose,
@@ -712,8 +712,7 @@ function createDiscordMessageReactionRuntime(params) {
712
712
  reactionContext: ackReactionContext
713
713
  }),
714
714
  initialEmoji: emoji,
715
- emojis: void 0,
716
- timing: statusReactionTiming,
715
+ presentation: "acknowledgement",
717
716
  onError: (err) => {
718
717
  logAckFailure({
719
718
  log: logVerbose,
@@ -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,11 @@ 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,
862
+ coalesceInFlight: true,
871
863
  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"
864
+ sendOrEditStreamMessage
879
865
  });
880
866
  const forceNewMessage = (mode = "preserve") => {
881
867
  if (mode === "discard" && activeCreateGeneration !== void 0) discardActiveCreate = true;
@@ -887,16 +873,19 @@ function createDiscordDraftStream(params) {
887
873
  loop.resetPending();
888
874
  loop.resetThrottleWindow();
889
875
  };
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);
876
+ const deleteCleanupMessage = async (message) => {
877
+ try {
878
+ await deleteChannelMessage(rest, message.channelId, message.messageId);
895
879
  } catch (err) {
896
- retargetedCleanup.push(stale);
897
- params.warn?.(`discord stream preview retarget cleanup failed: ${formatErrorMessage(err)}`);
880
+ pendingCleanupMessages.push(message);
881
+ params.warn?.(`${message.warnPrefix}: ${formatErrorMessage(err)}`);
898
882
  }
899
883
  };
884
+ const cleanupPendingMessages = async () => {
885
+ const pending = pendingCleanupMessages;
886
+ pendingCleanupMessages = [];
887
+ for (const message of pending) await deleteCleanupMessage(message);
888
+ };
900
889
  const retarget = async (nextChannelId) => {
901
890
  const normalized = nextChannelId.trim();
902
891
  if (!normalized || normalized === channelId) return;
@@ -919,33 +908,33 @@ function createDiscordDraftStream(params) {
919
908
  if (previousMessageId) {
920
909
  const stale = {
921
910
  channelId: previousChannelId,
922
- messageId: previousMessageId
911
+ messageId: previousMessageId,
912
+ warnPrefix: "discord stream preview retarget cleanup failed"
923
913
  };
924
914
  if (!streamMessageId) {
925
- retargetedCleanup.push(stale);
915
+ pendingCleanupMessages.push(stale);
926
916
  throw new Error("discord stream preview retarget replacement failed");
927
917
  }
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
- }
918
+ await deleteCleanupMessage(stale);
934
919
  }
935
920
  };
936
921
  const deleteCurrentMessage = async () => {
937
922
  loop.resetPending();
938
923
  await loop.waitForInFlight();
939
- const messageId = streamMessageId;
924
+ const currentMessage = streamMessageId ? {
925
+ channelId,
926
+ messageId: streamMessageId,
927
+ warnPrefix: "discord stream preview cleanup failed"
928
+ } : void 0;
940
929
  streamMessageId = void 0;
941
930
  lastSentText = "";
942
931
  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
- }
932
+ if (!currentMessage) return;
933
+ await deleteCleanupMessage(currentMessage);
934
+ };
935
+ const clear = async () => {
936
+ await discardPending();
937
+ await deleteCurrentMessage();
949
938
  };
950
939
  params.log?.(`discord stream preview ready (maxChars=${maxChars}, throttleMs=${throttleMs})`);
951
940
  return {
@@ -958,7 +947,7 @@ function createDiscordDraftStream(params) {
958
947
  seal,
959
948
  stop,
960
949
  retarget,
961
- cleanupRetargeted,
950
+ cleanupPendingMessages,
962
951
  forceNewMessage
963
952
  };
964
953
  }
@@ -1002,24 +991,17 @@ function createDiscordDraftPreviewController(params) {
1002
991
  let progressDraftStartedBeforeFinal = false;
1003
992
  let progressDraftCollapsed = false;
1004
993
  let progressNarratorLifecycle;
1005
- const previewToolProgressEnabled = Boolean(draftStream) && resolveChannelStreamingPreviewToolProgress(params.discordConfig, true, discordStreamMode);
1006
994
  const narrationProgressEnabled = Boolean(draftStream) && discordStreamMode === "progress" && resolveChannelStreamingProgressNarration(params.discordConfig);
1007
995
  const narrationHideCommandText = narrationProgressEnabled && resolveChannelStreamingPreviewCommandText(params.discordConfig) === "status";
1008
- const suppressDefaultToolProgressMessages = Boolean(draftStream) && resolveChannelStreamingSuppressDefaultToolProgressMessages(params.discordConfig, {
1009
- draftStreamActive: true,
1010
- previewToolProgressEnabled
1011
- });
1012
996
  const progressSeed = `${params.accountId}:${params.deliverChannelId}`;
1013
997
  const progressDraft = createChannelProgressDraftCompositor({
998
+ presentation: discordStreamMode === "progress" ? "summary" : void 0,
1014
999
  entry: params.discordConfig,
1015
1000
  mode: discordStreamMode,
1016
1001
  active: Boolean(draftStream),
1017
1002
  seed: progressSeed,
1018
1003
  reasoningLinePrefix: "🧠 ",
1019
- commentaryLinePrefix: "💬 ",
1020
- reasoningGate: previewToolProgressEnabled,
1021
1004
  commentaryItalics: false,
1022
- buildProgressEventLine: (input, options) => input.event === "tool" || input.event === "item" || input.event === "command-output" ? buildChannelProgressDraftLineForEntry(params.discordConfig, input, options) : buildChannelProgressDraftLine(input, options),
1023
1005
  update: async (previewText, options) => {
1024
1006
  if (!draftStream) return false;
1025
1007
  lastPartialText = previewText;
@@ -1052,10 +1034,6 @@ function createDiscordDraftPreviewController(params) {
1052
1034
  }
1053
1035
  resetProgressState();
1054
1036
  };
1055
- const pushPreambleHeadline = async (text, options) => {
1056
- if (discordStreamMode === "progress") return await progressDraft.pushPreambleHeadline(text, options);
1057
- return false;
1058
- };
1059
1037
  const beginNewProgressTurn = (options) => {
1060
1038
  const beganNewTurn = progressDraft.beginNewTurn(options);
1061
1039
  if (beganNewTurn) {
@@ -1072,11 +1050,10 @@ function createDiscordDraftPreviewController(params) {
1072
1050
  };
1073
1051
  return {
1074
1052
  draftStream,
1075
- previewToolProgressEnabled,
1076
1053
  narrationProgressEnabled,
1077
1054
  narrationHideCommandText,
1078
1055
  commentaryProgressEnabled: progressDraft.commentaryProgressEnabled,
1079
- suppressDefaultToolProgressMessages,
1056
+ suppressDefaultToolProgressMessages: progressDraft.suppressDefaultToolProgressMessages,
1080
1057
  get isProgressMode() {
1081
1058
  return discordStreamMode === "progress";
1082
1059
  },
@@ -1127,31 +1104,18 @@ function createDiscordDraftPreviewController(params) {
1127
1104
  disableBlockStreamingForDraft: draftStream ? true : void 0,
1128
1105
  pushToolEvent: progressDraft.pushToolEvent,
1129
1106
  pushItemEvent: progressDraft.pushItemEvent,
1130
- pushApprovalEvent: progressDraft.pushApprovalEvent,
1107
+ pushApprovalEvent: progressDraft.pushApprovalEvent.bind(progressDraft),
1131
1108
  pushCommandOutputEvent: progressDraft.pushCommandOutputEvent,
1132
1109
  pushPatchEvent: progressDraft.pushPatchEvent,
1133
- async pushToolProgress(line, options) {
1134
- return await progressDraft.pushToolProgress(line, options);
1135
- },
1136
- async pushPlanProgress(steps, options) {
1137
- return await progressDraft.pushPlanProgress(steps, options);
1138
- },
1139
- async pushReasoningProgress(text, options) {
1140
- return await progressDraft.pushReasoningProgress(text, options);
1141
- },
1142
- async pushNarrationProgress(text) {
1143
- return await progressDraft.pushNarrationProgress(text);
1144
- },
1145
- pushPreambleHeadline,
1110
+ pushPlanProgress: progressDraft.pushPlanProgress.bind(progressDraft),
1111
+ pushReasoningProgress: progressDraft.pushReasoningProgress.bind(progressDraft),
1112
+ pushNarrationProgress: progressDraft.pushNarrationProgress.bind(progressDraft),
1146
1113
  async pushPreambleItemEvent(payload) {
1147
- const headlineAccepted = await pushPreambleHeadline(payload.progressText, { itemId: payload.itemId });
1114
+ const headlineAccepted = await progressDraft.pushPreambleHeadline(payload.progressText, { itemId: payload.itemId });
1148
1115
  if (!progressDraft.commentaryProgressEnabled) return headlineAccepted;
1149
1116
  const commentaryAccepted = await progressDraft.pushCommentaryProgress(payload.progressText, { itemId: payload.itemId });
1150
1117
  return headlineAccepted || commentaryAccepted;
1151
1118
  },
1152
- async pushCommentaryProgress(text, options) {
1153
- return await progressDraft.pushCommentaryProgress(text, options);
1154
- },
1155
1119
  resolvePreviewFinalText(text) {
1156
1120
  if (typeof text !== "string") return;
1157
1121
  const formatted = convertMarkdownTables(stripInlineDirectiveTagsForDelivery(text).text, params.tableMode);
@@ -1232,7 +1196,7 @@ function createDiscordDraftPreviewController(params) {
1232
1196
  progressDraft.cancel();
1233
1197
  if (finalReplyError !== false) await draftStream?.discardPending();
1234
1198
  if (finalReplyError !== true && !finalizedViaPreviewMessage && draftStream?.messageId()) await draftStream.clear();
1235
- await draftStream?.cleanupRetargeted();
1199
+ await draftStream?.cleanupPendingMessages();
1236
1200
  } catch (err) {
1237
1201
  params.log(`discord: draft cleanup failed: ${String(err)}`);
1238
1202
  }
@@ -1248,7 +1212,7 @@ function shouldStartDiscordProgressDraftNow(line) {
1248
1212
  }
1249
1213
  //#endregion
1250
1214
  //#region extensions/discord/src/monitor/reply-typing-feedback.ts
1251
- const DISCORD_REPLY_TYPING_MAX_DURATION_MS = 20 * 6e4;
1215
+ const DISCORD_REPLY_TYPING_MAX_DURATION_MS = 12e5;
1252
1216
  function createDiscordReplyTypingFeedback(params) {
1253
1217
  const rest = params.rest ?? createDiscordRestClient({
1254
1218
  cfg: params.cfg,
@@ -1581,8 +1545,9 @@ async function processDiscordMessageInner(ctx, observer) {
1581
1545
  const raw = (payload.text ?? "").trim();
1582
1546
  const body = raw.startsWith("Reasoning:\n") ? raw.slice(11).trim() : raw;
1583
1547
  if (!body) return { visibleReplySent: false };
1548
+ const chunkLimit = Math.max(256, Math.min(textLimit, 2e3) - 8);
1584
1549
  const chunks = chunkDiscordTextWithMode(body, {
1585
- maxChars: Math.max(256, Math.min(textLimit, 2e3) - 8),
1550
+ maxChars: chunkLimit,
1586
1551
  maxLines: maxLinesPerMessage,
1587
1552
  chunkMode
1588
1553
  });
@@ -1609,7 +1574,9 @@ async function processDiscordMessageInner(ctx, observer) {
1609
1574
  threadBindings,
1610
1575
  mediaLocalRoots,
1611
1576
  kind: "block",
1612
- bindPendingFinalDelivery: info.bindPendingFinalDelivery
1577
+ bindPendingFinalDelivery: info.bindPendingFinalDelivery,
1578
+ onPlatformSendDispatch: info.onPlatformSendDispatch,
1579
+ assertPlatformSendAuthorized: info.assertPlatformSendAuthorized
1613
1580
  });
1614
1581
  if (result.visibleReplySent) replyReference.markSent();
1615
1582
  return result;
@@ -1626,10 +1593,11 @@ async function processDiscordMessageInner(ctx, observer) {
1626
1593
  finalText: payload.text,
1627
1594
  resolveCandidateText: resolveCurrentTurnTranscriptFinalText
1628
1595
  }) : payload.text;
1629
- const [deliverablePayload] = sanitizeDiscordFrontChannelReplyPayloads([finalText !== payload.text ? {
1596
+ const effectivePayload = finalText !== payload.text ? {
1630
1597
  ...payload,
1631
1598
  text: finalText
1632
- } : payload], { kind: info.kind });
1599
+ } : payload;
1600
+ const [deliverablePayload] = sanitizeDiscordFrontChannelReplyPayloads([effectivePayload], { kind: info.kind });
1633
1601
  if (!deliverablePayload) {
1634
1602
  logVerbose(formatDiscordReplySkip({
1635
1603
  kind: info.kind,
@@ -1708,7 +1676,9 @@ async function processDiscordMessageInner(ctx, observer) {
1708
1676
  mediaLocalRoots,
1709
1677
  allowedMentions,
1710
1678
  kind: info.kind,
1711
- bindPendingFinalDelivery: info.bindPendingFinalDelivery
1679
+ bindPendingFinalDelivery: info.bindPendingFinalDelivery,
1680
+ onPlatformSendDispatch: info.onPlatformSendDispatch,
1681
+ assertPlatformSendAuthorized: info.assertPlatformSendAuthorized
1712
1682
  })).visibleReplySent;
1713
1683
  },
1714
1684
  onNormalDelivered: () => {
@@ -1746,7 +1716,9 @@ async function processDiscordMessageInner(ctx, observer) {
1746
1716
  threadBindings,
1747
1717
  mediaLocalRoots,
1748
1718
  kind: info.kind,
1749
- bindPendingFinalDelivery: info.bindPendingFinalDelivery
1719
+ bindPendingFinalDelivery: info.bindPendingFinalDelivery,
1720
+ onPlatformSendDispatch: info.onPlatformSendDispatch,
1721
+ assertPlatformSendAuthorized: info.assertPlatformSendAuthorized
1750
1722
  });
1751
1723
  if (!result.visibleReplySent) return result;
1752
1724
  replyReference.markSent();
@@ -1864,7 +1836,11 @@ async function processDiscordMessageInner(ctx, observer) {
1864
1836
  return;
1865
1837
  }
1866
1838
  dispatchError = true;
1867
- if (await completeDiscordSessionConflict(err, deliverDiscordPayload, onDiscordDeliveryError)) return;
1839
+ if (await completeDiscordSessionConflict(err, (payload, info) => deliverDiscordPayload(payload, {
1840
+ ...info,
1841
+ onPlatformSendDispatch: () => Promise.resolve(),
1842
+ assertPlatformSendAuthorized: () => void 0
1843
+ }), onDiscordDeliveryError)) return;
1868
1844
  throw err;
1869
1845
  } finally {
1870
1846
  activeThreadRoute.end();