@openclaw/discord 2026.10.10-beta.5 → 2026.11.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 (163) hide show
  1. package/dist/.setup/{account-inspect-8cCu6uPG.mjs → account-inspect-X_Xlr42B.mjs} +2 -3
  2. package/dist/.setup/{accounts-ljrzXBJi.mjs → accounts-C18HNgge.mjs} +4 -8
  3. package/dist/.setup/{active-turn-thread-route-C4tp9noA.mjs → active-turn-thread-route-BAc_Xik-.mjs} +1 -2
  4. package/dist/.setup/{allow-list-B_ToXtew.mjs → allow-list-D1ZGfhXh.mjs} +5 -10
  5. package/dist/.setup/{api-CtmE1OUN.mjs → api-Bth1wKF9.mjs} +3 -5
  6. package/dist/.setup/{approval-handler.runtime-Db06VTbO.mjs → approval-handler.runtime-krznjTz9.mjs} +8 -9
  7. package/dist/.setup/{approval-message-updates-wbUqLtLI.mjs → approval-message-updates-Cks-MSCJ.mjs} +3 -4
  8. package/dist/.setup/{audit-BXOSwPCj.mjs → audit-Dw_rAZIz.mjs} +6 -7
  9. package/dist/.setup/{channel-D2pO9g6n.mjs → channel-DwvRHJL0.mjs} +33 -41
  10. package/dist/.setup/{channel-access-DasWY_OV.mjs → channel-access-BPrWoEXM.mjs} +1 -2
  11. package/dist/.setup/{channel.setup-5fHTqcKz.mjs → channel.setup-BHjvtK1U.mjs} +8 -12
  12. package/dist/.setup/{command-deploy-store-DFkBTViB.mjs → command-deploy-store-DPWiBMks.mjs} +1 -2
  13. package/dist/.setup/{command-owners-C7rUdqUX.mjs → command-owners-BzlhNBxA.mjs} +1 -2
  14. package/dist/.setup/{components-C_cuoW1q.mjs → components-BvOWSPxr.mjs} +11 -20
  15. package/dist/.setup/{config-schema-_uBILpQf.mjs → config-schema-Coyq5wOr.mjs} +3 -5
  16. package/dist/.setup/{conversation-binding-route-Dcqrf96n.mjs → conversation-binding-route-DOPUZNYo.mjs} +2 -3
  17. package/dist/.setup/{directory-config-3iVub-3m.mjs → directory-config-CIqVnQtn.mjs} +3 -4
  18. package/dist/.setup/{directory-live-DLygQVtW.mjs → directory-live-DUuPEWub.mjs} +7 -10
  19. package/dist/.setup/{discord-Cl2OPTZ6.mjs → discord-eFlHX1Gn.mjs} +35 -68
  20. package/dist/.setup/{doctor-t9tc4fim.mjs → doctor-Cg_N6ZOI.mjs} +8 -9
  21. package/dist/.setup/{doctor-contract-Bwv8EuQ_.mjs → doctor-contract-Dstl3cMg.mjs} +2 -3
  22. package/dist/.setup/{handle-action-CRH5-aLm.mjs → handle-action-DXY91jF-.mjs} +10 -11
  23. package/dist/.setup/{handle-action.guild-admin-BCWdfNPn.mjs → handle-action.guild-admin-BvBCfhXF.mjs} +3 -4
  24. package/dist/.setup/{live-policy-config-BPoB3eQi.mjs → live-policy-config-DO1Fk2hp.mjs} +3 -5
  25. package/dist/.setup/{message-handler-BvzZOXLT.mjs → message-handler-TR7l1P3P.mjs} +15 -19
  26. package/dist/.setup/{message-handler.preflight-DD0kun2e.mjs → message-handler.preflight-DxGb4zsm.mjs} +20 -28
  27. package/dist/.setup/{message-handler.preflight-pluralkit-DQygfoVJ.mjs → message-handler.preflight-pluralkit-BTE5JebL.mjs} +10 -14
  28. package/dist/.setup/{message-handler.process-1dRMGRR1.mjs → message-handler.process-DVHZKc2e.mjs} +33 -47
  29. package/dist/.setup/{outbound-adapter-gpo_85fY.mjs → outbound-adapter-DWyAWBFh.mjs} +13 -19
  30. package/dist/.setup/{outbound-session-route-D-qWvLfS.mjs → outbound-session-route-TFBPPkoz.mjs} +21 -32
  31. package/dist/.setup/{output-activity-uBpMSX75.mjs → output-activity-CDgs2s3O.mjs} +1 -2
  32. package/dist/.setup/{pluralkit-B64dfq_j.mjs → pluralkit-DcXbHTpQ.mjs} +2 -3
  33. package/dist/.setup/{preflight-audio-wWgsZG5F.mjs → preflight-audio-CwtPIsvk.mjs} +1 -2
  34. package/dist/.setup/{presence-cache-DCeTsL73.mjs → presence-cache-CgutE4NN.mjs} +1 -2
  35. package/dist/.setup/{probe-D3P1x4aN.mjs → probe-DNge7OEP.mjs} +5 -6
  36. package/dist/.setup/{provider-D2gXZbGd.mjs → provider-C61K7HHq.mjs} +119 -209
  37. package/dist/.setup/{provider-session.runtime-3bl84wqI.mjs → provider-session.runtime-D87e36ut.mjs} +3 -3
  38. package/dist/.setup/provider.runtime-xk5CVdoI.mjs +1 -0
  39. package/dist/.setup/{realtime-session.runtime-Cw2Nz11j.mjs → realtime-session.runtime-D1YHKwbc.mjs} +14 -23
  40. package/dist/.setup/{receive-recovery-CKvaG2Hf.mjs → receive-recovery-C77CVdGM.mjs} +3 -6
  41. package/dist/.setup/{resolve-allowlist-common-DNSsUQRF.mjs → resolve-allowlist-common-CI77288n.mjs} +5 -7
  42. package/dist/.setup/{resolve-channels-UdT38DzU.mjs → resolve-channels-DYc6-xgV.mjs} +5 -6
  43. package/dist/.setup/{resolve-users-DnCsrXZ_.mjs → resolve-users-BQT7XWF2.mjs} +4 -5
  44. package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
  45. package/dist/.setup/{runtime-By-vo8b-.mjs → runtime-CI0UJqeS.mjs} +23 -35
  46. package/dist/.setup/{runtime-BRsj76Px.mjs → runtime-CcijhTJT.mjs} +4 -6
  47. package/dist/.setup/{runtime-DgnVQ7zW.mjs → runtime-DcBvHOm1.mjs} +1 -2
  48. package/dist/.setup/{runtime-doctor-migrations-BPV-R4G9.mjs → runtime-doctor-migrations-BpV1jKk0.mjs} +5 -9
  49. package/dist/.setup/{secret-config-contract-CIsH7R3B.mjs → secret-config-contract-B7UlqVYr.mjs} +2 -3
  50. package/dist/.setup/{security-audit-BFT84Uny.mjs → security-audit-CTwisG7c.mjs} +3 -4
  51. package/dist/.setup/{security-contract-DNyyjTZZ.mjs → security-contract-D-o0iWDk.mjs} +1 -2
  52. package/dist/.setup/{security-doctor-nGgPm65L.mjs → security-doctor-4s7omTZd.mjs} +1 -2
  53. package/dist/.setup/{send-Ca810XtV.mjs → send-Cbq-IVsS.mjs} +18 -28
  54. package/dist/.setup/{send.components-DxpLdHrr.mjs → send.components-BV6ucNpJ.mjs} +10 -13
  55. package/dist/.setup/{send.outbound-ByYCrfta.mjs → send.outbound-CGhBhzjQ.mjs} +9 -13
  56. package/dist/.setup/{send.receipt-DkwJ1h9E.mjs → send.receipt-Dw-_r5Bx.mjs} +9 -16
  57. package/dist/.setup/{send.shared-C2J1g_uJ.mjs → send.shared-D4MioxW_.mjs} +14 -23
  58. package/dist/.setup/{sender-identity-BNBvGt1l.mjs → sender-identity-DrN5c4ec.mjs} +2 -3
  59. package/dist/.setup/{session-contract-BO5tlIdl.mjs → session-contract-Bq71MS78.mjs} +1 -2
  60. package/dist/.setup/{session-key-normalization-CCHGNSQw.mjs → session-key-normalization-Cfvze5hd.mjs} +1 -2
  61. package/dist/.setup/setup-plugin-api-DGfQO4Ec.mjs +2 -0
  62. package/dist/.setup/{shared-DbNfsfcr.mjs → shared-_o59Fvrr.mjs} +15 -19
  63. package/dist/.setup/{subagent-hooks-BhV5ZVej.mjs → subagent-hooks-mQbDkvuD.mjs} +3 -4
  64. package/dist/.setup/{system-events-DGsxf-l9.mjs → system-events-2zc2eGfF.mjs} +3 -4
  65. package/dist/.setup/{target-parsing-C-HyNxcE.mjs → target-parsing-BiuhcK9Q.mjs} +1 -2
  66. package/dist/.setup/{target-resolver-BxRZHPL3.mjs → target-resolver-CAHeVfmZ.mjs} +6 -7
  67. package/dist/.setup/targets-BaklhOqq.mjs +3 -0
  68. package/dist/.setup/{thread-binding-api-BDZJD4na.mjs → thread-binding-api-Drd4Zu-5.mjs} +1 -2
  69. package/dist/.setup/{thread-bindings-c0WwzyHH.mjs → thread-bindings-Dg7X_ZXP.mjs} +8 -11
  70. package/dist/.setup/{thread-bindings.manager-B7HFHXrI.mjs → thread-bindings.manager-DCDYksah.mjs} +15 -20
  71. package/dist/.setup/{thread-bindings.session-updates-BMdJeJMc.mjs → thread-bindings.session-updates-C76plLS3.mjs} +5 -9
  72. package/dist/.setup/{threading-DJjzMR2f.mjs → threading-BKn_OF3K.mjs} +6 -9
  73. package/dist/.setup/{timeouts-CuNARfyw.mjs → timeouts-DTrUsJ_W.mjs} +1 -2
  74. package/dist/.setup/{transcripts-source-MRAZocrc.mjs → transcripts-source-BSorJ4AS.mjs} +25 -39
  75. package/dist/.setup/{typing-CNlSKY5S.mjs → typing-DAv4S2fI.mjs} +2 -3
  76. package/dist/.setup/{voice-runtime-_LfZ3Za7.mjs → voice-runtime-B5m2Ryg8.mjs} +33 -55
  77. package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
  78. package/dist/account-inspect-api.js +2 -3
  79. package/dist/action-runtime-api.js +1 -1
  80. package/dist/activities-api.js +13 -20
  81. package/dist/api.js +21 -22
  82. package/dist/channel-config-api.js +1 -1
  83. package/dist/channel-plugin-api.js +1 -1
  84. package/dist/contract-api.js +1 -1
  85. package/dist/directory-contract-api.js +2 -3
  86. package/dist/doctor-contract-api.js +5 -7
  87. package/dist/index.js +1 -2
  88. package/dist/runtime-api.js +22 -22
  89. package/dist/runtime-setter-api.js +1 -1
  90. package/dist/secret-contract-api.js +1 -1
  91. package/dist/security-audit-contract-api.js +1 -1
  92. package/dist/security-contract-api.js +1 -1
  93. package/dist/session-key-api.js +1 -1
  94. package/dist/setup-entry.js +2 -3
  95. package/dist/setup-plugin-api.js +1 -1
  96. package/dist/src/voice/audio-worker.runtime.js +8 -14
  97. package/dist/subagent-hooks-api.js +2 -3
  98. package/dist/thread-binding-api.js +1 -1
  99. package/dist/transcripts-source-api.js +2 -3
  100. package/node_modules/undici/README.md +25 -3
  101. package/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
  102. package/node_modules/undici/docs/docs/api/Client.md +11 -6
  103. package/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
  104. package/node_modules/undici/docs/docs/api/Errors.md +76 -1
  105. package/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
  106. package/node_modules/undici/docs/docs/api/Interceptors.md +13 -6
  107. package/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
  108. package/node_modules/undici/docs/docs/index.md +12 -12
  109. package/node_modules/undici/docs/docs/type-map.json +66 -66
  110. package/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
  111. package/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
  112. package/node_modules/undici/lib/core/connect.js +10 -4
  113. package/node_modules/undici/lib/core/constants.js +12 -1
  114. package/node_modules/undici/lib/core/errors.js +38 -1
  115. package/node_modules/undici/lib/core/request.js +16 -1
  116. package/node_modules/undici/lib/core/symbols.js +2 -0
  117. package/node_modules/undici/lib/core/util.js +26 -1
  118. package/node_modules/undici/lib/dispatcher/agent.js +6 -2
  119. package/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
  120. package/node_modules/undici/lib/dispatcher/client-h2.js +46 -14
  121. package/node_modules/undici/lib/dispatcher/client.js +4 -1
  122. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
  123. package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
  124. package/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
  125. package/node_modules/undici/lib/dispatcher/pool-base.js +65 -28
  126. package/node_modules/undici/lib/dispatcher/pool.js +11 -8
  127. package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
  128. package/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
  129. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
  130. package/node_modules/undici/lib/handler/cache-handler.js +153 -15
  131. package/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
  132. package/node_modules/undici/lib/handler/redirect-handler.js +28 -8
  133. package/node_modules/undici/lib/handler/retry-handler.js +44 -11
  134. package/node_modules/undici/lib/interceptor/cache.js +11 -3
  135. package/node_modules/undici/lib/interceptor/decompress.js +22 -9
  136. package/node_modules/undici/lib/interceptor/dns.js +11 -0
  137. package/node_modules/undici/lib/interceptor/response-error.js +72 -28
  138. package/node_modules/undici/lib/milo/LICENSE.md +7 -0
  139. package/node_modules/undici/lib/milo/no-simd.js +1002 -0
  140. package/node_modules/undici/lib/milo/simd.js +1002 -0
  141. package/node_modules/undici/lib/mock/mock-agent.js +11 -0
  142. package/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
  143. package/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
  144. package/node_modules/undici/lib/util/cache.js +11 -5
  145. package/node_modules/undici/lib/web/cookies/util.js +19 -2
  146. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
  147. package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
  148. package/node_modules/undici/lib/web/fetch/body.js +47 -38
  149. package/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
  150. package/node_modules/undici/lib/web/fetch/headers.js +2 -2
  151. package/node_modules/undici/lib/web/fetch/index.js +8 -4
  152. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  153. package/node_modules/undici/lib/web/websocket/receiver.js +25 -4
  154. package/node_modules/undici/package.json +7 -5
  155. package/node_modules/undici/types/cache-interceptor.d.ts +10 -0
  156. package/node_modules/undici/types/client.d.ts +10 -4
  157. package/node_modules/undici/types/errors.d.ts +16 -1
  158. package/node_modules/undici/types/h2c-client.d.ts +1 -1
  159. package/node_modules/undici/types/interceptors.d.ts +6 -1
  160. package/package.json +5 -5
  161. package/dist/.setup/provider.runtime-BI_CV9tI.mjs +0 -1
  162. package/dist/.setup/setup-plugin-api-D5VV8xTN.mjs +0 -2
  163. package/dist/.setup/targets-C0qD28Sz.mjs +0 -3
@@ -1,28 +1,28 @@
1
- import { g as resolveDiscordToken, h as normalizeDiscordToken, l as resolveDiscordAccount, m as resolveDiscordMaxLinesPerMessage, p as resolveDiscordAccountDmPolicy, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-ljrzXBJi.mjs";
2
- import { A as isDiscordThreadChannelType, D as getDiscordEndpointRuntime, E as assertDiscordEndpointGatewayUrl, S as formatDiscordUserTag, _ as resolveDiscordOwnerAllowFrom, a as normalizeDiscordDisplaySlug, b as shouldEmitDiscordReactionNotification, c as resolveDiscordChannelConfig, f as resolveDiscordGuildEntry, g as resolveDiscordOwnerAccess, i as normalizeDiscordAllowList, l as resolveDiscordChannelConfigWithFallback, m as resolveDiscordMemberAllowed, n as hasConfiguredDiscordChannels, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState, r as isDiscordGroupAllowedByPolicy, s as resolveDiscordAllowListMatch, u as resolveDiscordChannelPolicyCommandAuthorizer, w as resolveTimestampMs, x as formatDiscordReactionEmoji, y as resolveGroupDmAllow } from "./allow-list-B_ToXtew.mjs";
3
- import { B as validateDiscordProxyUrl, C as hasAnyChannelPermissionDiscord, G as unregisterGateway, P as createDiscordRestClient, R as DISCORD_REST_TIMEOUT_MS, V as withValidatedDiscordProxy, W as registerGateway, y as canViewDiscordGuildChannel } from "./send.shared-C2J1g_uJ.mjs";
4
- import { i as setPresence, t as clearPresences } from "./presence-cache-DCeTsL73.mjs";
5
- import { $ as User, A as StringSelectMenu, D as Row, F as Plugin, K as hasDiscordV2Components, P as Client, Q as Message, R as RateLimitError, X as CommandWithSubcommands, Y as Command, Z as Guild, a as MessageCreateListener, c as PresenceUpdateListener, d as ThreadUpdateListener, et as BaseMessageInteractiveComponent, h as Modal, i as InteractionCreateListener, j as TextDisplay, k as Separator, l as ReadyListener, n as GuildCreateListener, o as MessageReactionAddListener, r as GuildDeleteListener, s as MessageReactionRemoveListener, t as discord_exports, u as ThreadDeleteListener, x as Container, y as Button } from "./discord-Cl2OPTZ6.mjs";
6
- import { v as chunkDiscordTextWithMode } from "./send.receipt-DkwJ1h9E.mjs";
7
- import { a as isDiscordRateLimitResponseBody, s as summarizeDiscordResponseBody } from "./api-CtmE1OUN.mjs";
8
- import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-Ca810XtV.mjs";
9
- import { s as formatMention, t as sendMessageDiscord } from "./send.outbound-ByYCrfta.mjs";
10
- import { l as withAbortTimeout } from "./timeouts-CuNARfyw.mjs";
11
- import { C as parseDiscordActivityCustomIdForInteraction, D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, O as decodeCustomIdComponent, T as parseDiscordComponentCustomIdForInteraction, c as parseExecApprovalData, d as buildDiscordComponentMessage, k as encodeCustomIdComponent, o as parseDiscordQuestionData, w as parseDiscordComponentCustomId, y as buildDiscordActivityCustomId } from "./components-C_cuoW1q.mjs";
12
- import { a as registerDiscordComponentEntries, o as resolveDiscordComponentEntryWithPersistence, s as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-DxpLdHrr.mjs";
13
- import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
14
- import { n as getDiscordActivitiesRuntime } from "./runtime-BRsj76Px.mjs";
15
- import { t as resolveDiscordCommandOwnerAllowFrom } from "./command-owners-C7rUdqUX.mjs";
16
- import { A as isDiscordExecApprovalClientEnabled, O as getDiscordExecApprovalApprovers, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, d as setDiscordChannelPolicyBindings, f as buildDiscordConversationRouteContext, g as resolveDiscordEffectiveRoute, m as resolveDiscordBoundConversationRoute, n as DISCORD_PRESENTATION_CAPABILITIES, p as buildDiscordRoutePeer, r as buildDiscordPresentationPayload, s as DISCORD_APPROVAL_ALLOWED_MENTIONS, v as resolveDiscordConversationIdentity } from "./outbound-session-route-D-qWvLfS.mjs";
17
- import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-BPoB3eQi.mjs";
18
- import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-UdT38DzU.mjs";
19
- import { t as resolveDiscordUserAllowlist } from "./resolve-users-DnCsrXZ_.mjs";
20
- import { a as isThreadArchived, n as getThreadBindingManager } from "./thread-bindings.manager-B7HFHXrI.mjs";
21
- import { n as resolveDiscordChannelInfoSafe, o as resolveDiscordChannelTopicSafe, r as resolveDiscordChannelNameSafe } from "./channel-access-DasWY_OV.mjs";
22
- import { a as probeDiscordApplicationId, r as parseApplicationIdFromToken } from "./probe-D3P1x4aN.mjs";
23
- import { O as resolveDiscordReferencedReplyMessage, a as authorizeDiscordVoiceIngress, c as resolveDiscordVoiceEnabled, i as setDiscordTranscriptsVoiceManager, k as resolveDiscordReferencedReplyMessageId, l as resolveDiscordThreadLikeChannelContext, o as resolveDiscordVoiceAccess, u as resolveFetchedDiscordThreadLikeChannelContext } from "./transcripts-source-MRAZocrc.mjs";
24
- import { t as resolveDiscordSenderIdentity } from "./sender-identity-BNBvGt1l.mjs";
25
- import { n as hasDiscordApprovalControl, t as discordApprovalMessageUpdates } from "./approval-message-updates-wbUqLtLI.mjs";
1
+ import { g as resolveDiscordToken, h as normalizeDiscordToken, l as resolveDiscordAccount, m as resolveDiscordMaxLinesPerMessage, p as resolveDiscordAccountDmPolicy, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-C18HNgge.mjs";
2
+ import { A as isDiscordThreadChannelType, D as getDiscordEndpointRuntime, E as assertDiscordEndpointGatewayUrl, S as formatDiscordUserTag, _ as resolveDiscordOwnerAllowFrom, a as normalizeDiscordDisplaySlug, b as shouldEmitDiscordReactionNotification, c as resolveDiscordChannelConfig, f as resolveDiscordGuildEntry, g as resolveDiscordOwnerAccess, i as normalizeDiscordAllowList, l as resolveDiscordChannelConfigWithFallback, m as resolveDiscordMemberAllowed, n as hasConfiguredDiscordChannels, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState, r as isDiscordGroupAllowedByPolicy, s as resolveDiscordAllowListMatch, u as resolveDiscordChannelPolicyCommandAuthorizer, w as resolveTimestampMs, x as formatDiscordReactionEmoji, y as resolveGroupDmAllow } from "./allow-list-D1ZGfhXh.mjs";
3
+ import { B as validateDiscordProxyUrl, C as hasAnyChannelPermissionDiscord, G as unregisterGateway, P as createDiscordRestClient, R as DISCORD_REST_TIMEOUT_MS, V as withValidatedDiscordProxy, W as registerGateway, y as canViewDiscordGuildChannel } from "./send.shared-D4MioxW_.mjs";
4
+ import { i as setPresence, t as clearPresences } from "./presence-cache-CgutE4NN.mjs";
5
+ import { $ as User, A as StringSelectMenu, D as Row, F as Plugin, K as hasDiscordV2Components, P as Client, Q as Message, R as RateLimitError, X as CommandWithSubcommands, Y as Command, Z as Guild, a as MessageCreateListener, c as PresenceUpdateListener, d as ThreadUpdateListener, et as BaseMessageInteractiveComponent, h as Modal, i as InteractionCreateListener, j as TextDisplay, k as Separator, l as ReadyListener, n as GuildCreateListener, o as MessageReactionAddListener, r as GuildDeleteListener, s as MessageReactionRemoveListener, t as discord_exports, u as ThreadDeleteListener, x as Container, y as Button } from "./discord-eFlHX1Gn.mjs";
6
+ import { v as chunkDiscordTextWithMode } from "./send.receipt-Dw-_r5Bx.mjs";
7
+ import { a as isDiscordRateLimitResponseBody, s as summarizeDiscordResponseBody } from "./api-Bth1wKF9.mjs";
8
+ import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-Cbq-IVsS.mjs";
9
+ import { s as formatMention, t as sendMessageDiscord } from "./send.outbound-CGhBhzjQ.mjs";
10
+ import { l as withAbortTimeout } from "./timeouts-DTrUsJ_W.mjs";
11
+ import { C as parseDiscordActivityCustomIdForInteraction, D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, O as decodeCustomIdComponent, T as parseDiscordComponentCustomIdForInteraction, c as parseExecApprovalData, d as buildDiscordComponentMessage, k as encodeCustomIdComponent, o as parseDiscordQuestionData, w as parseDiscordComponentCustomId, y as buildDiscordActivityCustomId } from "./components-BvOWSPxr.mjs";
12
+ import { a as registerDiscordComponentEntries, o as resolveDiscordComponentEntryWithPersistence, s as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-BV6ucNpJ.mjs";
13
+ import { t as getDiscordRuntime } from "./runtime-DcBvHOm1.mjs";
14
+ import { n as getDiscordActivitiesRuntime } from "./runtime-CcijhTJT.mjs";
15
+ import { t as resolveDiscordCommandOwnerAllowFrom } from "./command-owners-BzlhNBxA.mjs";
16
+ import { A as isDiscordExecApprovalClientEnabled, O as getDiscordExecApprovalApprovers, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, d as setDiscordChannelPolicyBindings, f as buildDiscordConversationRouteContext, g as resolveDiscordEffectiveRoute, m as resolveDiscordBoundConversationRoute, n as DISCORD_PRESENTATION_CAPABILITIES, p as buildDiscordRoutePeer, r as buildDiscordPresentationPayload, s as DISCORD_APPROVAL_ALLOWED_MENTIONS, v as resolveDiscordConversationIdentity } from "./outbound-session-route-TFBPPkoz.mjs";
17
+ import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-DO1Fk2hp.mjs";
18
+ import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-DYc6-xgV.mjs";
19
+ import { t as resolveDiscordUserAllowlist } from "./resolve-users-BQT7XWF2.mjs";
20
+ import { a as isThreadArchived, n as getThreadBindingManager } from "./thread-bindings.manager-DCDYksah.mjs";
21
+ import { n as resolveDiscordChannelInfoSafe, o as resolveDiscordChannelTopicSafe, r as resolveDiscordChannelNameSafe } from "./channel-access-BPrWoEXM.mjs";
22
+ import { a as probeDiscordApplicationId, r as parseApplicationIdFromToken } from "./probe-DNge7OEP.mjs";
23
+ import { O as resolveDiscordReferencedReplyMessage, a as authorizeDiscordVoiceIngress, c as resolveDiscordVoiceEnabled, i as setDiscordTranscriptsVoiceManager, k as resolveDiscordReferencedReplyMessageId, l as resolveDiscordThreadLikeChannelContext, o as resolveDiscordVoiceAccess, u as resolveFetchedDiscordThreadLikeChannelContext } from "./transcripts-source-BSorJ4AS.mjs";
24
+ import { t as resolveDiscordSenderIdentity } from "./sender-identity-DrN5c4ec.mjs";
25
+ import { n as hasDiscordApprovalControl, t as discordApprovalMessageUpdates } from "./approval-message-updates-Cks-MSCJ.mjs";
26
26
  import { createRequire } from "node:module";
27
27
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
28
28
  import { PlatformMessageNotDispatchedError, formatErrorMessage, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
@@ -90,7 +90,7 @@ import { createChannelInteractiveDispatcher } from "openclaw/plugin-sdk/plugin-r
90
90
  import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway-runtime";
91
91
  import { Agent } from "node:https";
92
92
  import { reportChannelRoomJoin } from "openclaw/plugin-sdk/channel-join-intro-runtime";
93
- //#region extensions/discord/src/monitor/listeners.queue.ts
93
+ // extensions/discord/src/monitor/listeners.queue.ts
94
94
  const DISCORD_SLOW_LISTENER_THRESHOLD_MS = 3e4;
95
95
  const discordEventQueueLog = createSubsystemLogger("discord/event-queue");
96
96
  function formatListenerContextValue(value) {
@@ -144,8 +144,7 @@ async function runDiscordListenerWithSlowLog(params) {
144
144
  });
145
145
  }
146
146
  }
147
- //#endregion
148
- //#region extensions/discord/src/monitor/presence-events.ts
147
+ // extensions/discord/src/monitor/presence-events.ts
149
148
  const DISCORD_PRESENCE_GREETING_COOLDOWN_MS = 288e5;
150
149
  function isDiscordOnlineStatus(status) {
151
150
  return status === "online" || status === "idle" || status === "dnd";
@@ -172,8 +171,7 @@ function resolveDiscordOnlinePresenceEvent(params) {
172
171
  text: lines.join("\n")
173
172
  };
174
173
  }
175
- //#endregion
176
- //#region extensions/discord/src/monitor/presence-cooldown-store.ts
174
+ // extensions/discord/src/monitor/presence-cooldown-store.ts
177
175
  const DISCORD_PRESENCE_COOLDOWN_MAX_ENTRIES = 25e3;
178
176
  function openDiscordPresenceCooldownStore() {
179
177
  return getDiscordRuntime().state.openKeyedStore({
@@ -183,8 +181,7 @@ function openDiscordPresenceCooldownStore() {
183
181
  defaultTtlMs: DISCORD_PRESENCE_GREETING_COOLDOWN_MS
184
182
  });
185
183
  }
186
- //#endregion
187
- //#region extensions/discord/src/monitor/presence-emission-gate.ts
184
+ // extensions/discord/src/monitor/presence-emission-gate.ts
188
185
  const DISCORD_PRESENCE_RECONNECT_SUPPRESS_MS = 3e5;
189
186
  const DISCORD_PRESENCE_BURST_LIMIT = 8;
190
187
  const DISCORD_PRESENCE_BURST_WINDOW_MS = 6e4;
@@ -262,8 +259,7 @@ var DiscordPresenceEmissionGate = class {
262
259
  if (state.reservations.length === 0 && !state.logged) this.burstByGuild.delete(guildId);
263
260
  }
264
261
  };
265
- //#endregion
266
- //#region extensions/discord/src/monitor/presence-transition-cache.ts
262
+ // extensions/discord/src/monitor/presence-transition-cache.ts
267
263
  const DEFAULT_PRESENCE_BASELINE_MAX_ENTRIES = 75e3;
268
264
  var DiscordPresenceBaselineCache = class {
269
265
  constructor(maxEntries = DEFAULT_PRESENCE_BASELINE_MAX_ENTRIES) {
@@ -308,8 +304,7 @@ var DiscordPresenceBaselineCache = class {
308
304
  return evictedScope;
309
305
  }
310
306
  };
311
- //#endregion
312
- //#region extensions/discord/src/monitor/thread-session-close.ts
307
+ // extensions/discord/src/monitor/thread-session-close.ts
313
308
  /**
314
309
  * Closes every session entry in the store whose key contains {@link threadId}.
315
310
  * The explicit lifecycle deletion archives the old transcript and guarantees
@@ -339,8 +334,7 @@ async function closeDiscordThreadSessions(params) {
339
334
  }
340
335
  return resetCount;
341
336
  }
342
- //#endregion
343
- //#region extensions/discord/src/monitor/dm-command-auth.ts
337
+ // extensions/discord/src/monitor/dm-command-auth.ts
344
338
  const DISCORD_CHANNEL_ID = "discord";
345
339
  function createDiscordDmIngressSubject(sender) {
346
340
  return {
@@ -447,8 +441,7 @@ async function resolveDiscordTextCommandAccess(params) {
447
441
  }
448
442
  });
449
443
  }
450
- //#endregion
451
- //#region extensions/discord/src/monitor/listeners.reactions.ts
444
+ // extensions/discord/src/monitor/listeners.reactions.ts
452
445
  var DiscordReactionListener = class extends MessageReactionAddListener {
453
446
  constructor(params) {
454
447
  super();
@@ -715,8 +708,7 @@ async function handleDiscordReactionEvent(params) {
715
708
  params.logger.error(danger(`discord reaction handler failed: ${String(err)}`));
716
709
  }
717
710
  }
718
- //#endregion
719
- //#region extensions/discord/src/monitor/listeners.ts
711
+ // extensions/discord/src/monitor/listeners.ts
720
712
  function registerDiscordListener(listeners, listener) {
721
713
  if (listeners.some((existing) => existing.constructor === listener.constructor)) return false;
722
714
  listeners.push(listener);
@@ -1113,8 +1105,7 @@ var DiscordThreadDeleteListener = class extends ThreadDeleteListener {
1113
1105
  });
1114
1106
  }
1115
1107
  };
1116
- //#endregion
1117
- //#region extensions/discord/src/internal/gateway-dispatch.ts
1108
+ // extensions/discord/src/internal/gateway-dispatch.ts
1118
1109
  function dispatchVoiceGatewayEvent(client, payload) {
1119
1110
  const guildId = readGuildId(payload.d);
1120
1111
  if (!guildId) return;
@@ -1164,8 +1155,7 @@ function createReactionDispatchData(client, data) {
1164
1155
  function readGuildId(data) {
1165
1156
  return data && typeof data === "object" && typeof data.guild_id === "string" ? data.guild_id : void 0;
1166
1157
  }
1167
- //#endregion
1168
- //#region extensions/discord/src/monitor/provider.allowlist.ts
1158
+ // extensions/discord/src/monitor/provider.allowlist.ts
1169
1159
  function formatResolutionLogDetails(base, details) {
1170
1160
  const nonEmpty = details.map((value) => value?.trim()).filter((value) => Boolean(value));
1171
1161
  return nonEmpty.length > 0 ? `${base} (${nonEmpty.join("; ")})` : base;
@@ -1388,8 +1378,7 @@ async function resolveDiscordAllowlistConfig(params) {
1388
1378
  allowFrom
1389
1379
  };
1390
1380
  }
1391
- //#endregion
1392
- //#region extensions/discord/src/network-config.ts
1381
+ // extensions/discord/src/network-config.ts
1393
1382
  const DISCORD_DNS_HOSTS = [
1394
1383
  "discord.com",
1395
1384
  "discord.gg",
@@ -1443,8 +1432,7 @@ function createDiscordEndpointDnsLookup(endpointHostname) {
1443
1432
  });
1444
1433
  };
1445
1434
  }
1446
- //#endregion
1447
- //#region extensions/discord/src/monitor/rest-fetch.ts
1435
+ // extensions/discord/src/monitor/rest-fetch.ts
1448
1436
  const discordDnsLookup$1 = createDiscordDnsLookup();
1449
1437
  function createEnvProxyDiscordRestDispatcher(runtime) {
1450
1438
  const envProxyOptions = resolveEnvHttpProxyAgentOptions();
@@ -1486,8 +1474,7 @@ function resolveDiscordRestFetch(proxyUrl, runtime) {
1486
1474
  }
1487
1475
  return createDiscordRestFetchWithDispatcher(createEnvProxyDiscordRestDispatcher(runtime) ?? createHttp1Agent({ connect: { lookup: discordDnsLookup$1 } }));
1488
1476
  }
1489
- //#endregion
1490
- //#region extensions/discord/src/monitor/live-policy.ts
1477
+ // extensions/discord/src/monitor/live-policy.ts
1491
1478
  /** One reader belongs to one admitted account; transport and lifetime remain its startup owners. */
1492
1479
  function createDiscordLivePolicyReader(params) {
1493
1480
  const readConfig = params.readConfig ?? createRuntimeConfigReader(params.cfg);
@@ -1585,8 +1572,7 @@ function createDiscordLivePolicyReader(params) {
1585
1572
  }
1586
1573
  };
1587
1574
  }
1588
- //#endregion
1589
- //#region extensions/discord/src/monitor/dm-command-decision.ts
1575
+ // extensions/discord/src/monitor/dm-command-decision.ts
1590
1576
  async function handleDiscordDmCommandDecision(params) {
1591
1577
  if (params.senderAccess.decision === "allow") return true;
1592
1578
  if (params.senderAccess.decision === "pairing") {
@@ -1615,8 +1601,7 @@ async function handleDiscordDmCommandDecision(params) {
1615
1601
  await params.onUnauthorized();
1616
1602
  return false;
1617
1603
  }
1618
- //#endregion
1619
- //#region extensions/discord/src/monitor/live-policy-interaction.ts
1604
+ // extensions/discord/src/monitor/live-policy-interaction.ts
1620
1605
  const INTERACTION_POLICY_WAIT_MS = 1e3;
1621
1606
  async function readDiscordInteractionPolicy(readPolicy) {
1622
1607
  const timeout = /* @__PURE__ */ new Error("Discord interaction access policy resolution timed out");
@@ -1627,8 +1612,7 @@ async function readDiscordInteractionPolicy(readPolicy) {
1627
1612
  return null;
1628
1613
  }
1629
1614
  }
1630
- //#endregion
1631
- //#region extensions/discord/src/monitor/native-command-reply.ts
1615
+ // extensions/discord/src/monitor/native-command-reply.ts
1632
1616
  const DISCORD_EMPTY_VISIBLE_REPLY_WARNING = "⚠️ Command produced no visible reply.";
1633
1617
  /** Retain visible component text, not interaction IDs or option values. */
1634
1618
  function formatDiscordCommandComponents(components) {
@@ -1769,8 +1753,7 @@ async function deliverDiscordInteractionReply(params) {
1769
1753
  if (payloadDelivered && params.onDelivered) await params.onDelivered(deliveredText?.filter(Boolean).join("\n") ?? "");
1770
1754
  return payloadDelivered;
1771
1755
  }
1772
- //#endregion
1773
- //#region extensions/discord/src/monitor/native-command-agent-reply.ts
1756
+ // extensions/discord/src/monitor/native-command-agent-reply.ts
1774
1757
  async function dispatchDiscordNativeAgentReply(params) {
1775
1758
  const blockStreamingEnabled = resolveChannelStreamingBlockEnabled(params.discordConfig);
1776
1759
  let didReply = false;
@@ -1846,13 +1829,11 @@ async function dispatchDiscordNativeAgentReply(params) {
1846
1829
  }));
1847
1830
  return dispatchResult;
1848
1831
  }
1849
- //#endregion
1850
- //#region extensions/discord/src/monitor/commands.ts
1832
+ // extensions/discord/src/monitor/commands.ts
1851
1833
  function resolveDiscordSlashCommandConfig(raw) {
1852
1834
  return { ephemeral: raw?.ephemeral !== false };
1853
1835
  }
1854
- //#endregion
1855
- //#region extensions/discord/src/monitor/native-command-arg-ui.ts
1836
+ // extensions/discord/src/monitor/native-command-arg-ui.ts
1856
1837
  const DISCORD_COMMAND_ARG_CUSTOM_ID_KEY = "cmdarg";
1857
1838
  function buildDiscordCommandArgCustomId(params) {
1858
1839
  return [
@@ -1964,8 +1945,7 @@ function createDiscordCommandArgFallbackButton$1(params) {
1964
1945
  style: ButtonStyle.Primary
1965
1946
  });
1966
1947
  }
1967
- //#endregion
1968
- //#region extensions/discord/src/monitor/inbound-context.ts
1948
+ // extensions/discord/src/monitor/inbound-context.ts
1969
1949
  function createDiscordSupplementalContextAccessChecker(params) {
1970
1950
  const userAllowList = params.channelConfig?.users ?? params.guildInfo?.users ?? [];
1971
1951
  const roleAllowList = params.channelConfig?.roles ?? params.guildInfo?.roles ?? [];
@@ -2004,8 +1984,7 @@ function buildDiscordInboundAccessContext(params) {
2004
1984
  ownerAllowFrom: resolveDiscordOwnerAllowFrom(params)
2005
1985
  };
2006
1986
  }
2007
- //#endregion
2008
- //#region extensions/discord/src/monitor/native-command-context.ts
1987
+ // extensions/discord/src/monitor/native-command-context.ts
2009
1988
  async function buildDiscordNativeCommandContext(params) {
2010
1989
  const conversationLabel = params.isDirectMessage ? params.user.globalName ?? params.user.username : params.channelId;
2011
1990
  const { groupSystemPrompt, ownerAllowFrom, channelStructuredContext } = buildDiscordInboundAccessContext(params);
@@ -2139,8 +2118,7 @@ async function buildDiscordNativeInteractionContext(params) {
2139
2118
  ...targets
2140
2119
  };
2141
2120
  }
2142
- //#endregion
2143
- //#region extensions/discord/src/monitor/native-command-route.ts
2121
+ // extensions/discord/src/monitor/native-command-route.ts
2144
2122
  function resolveDiscordNativeInteractionRouteState(params) {
2145
2123
  const route = resolveDiscordBoundConversationRoute(params);
2146
2124
  const configuredRoute = params.threadBinding == null ? resolveConfiguredBindingRoute({
@@ -2167,8 +2145,7 @@ function resolveDiscordNativeInteractionRouteState(params) {
2167
2145
  configuredBinding
2168
2146
  };
2169
2147
  }
2170
- //#endregion
2171
- //#region extensions/discord/src/monitor/native-interaction-channel-context.ts
2148
+ // extensions/discord/src/monitor/native-interaction-channel-context.ts
2172
2149
  async function resolveDiscordNativeInteractionChannelContext(interaction, channelIdFallback) {
2173
2150
  const { channel, client, guild, rawData } = interaction;
2174
2151
  const hasGuild = Boolean(guild);
@@ -2191,8 +2168,7 @@ async function resolveDiscordNativeInteractionChannelContext(interaction, channe
2191
2168
  threadParentSlug: hasGuild ? channelContext.threadParentSlug : ""
2192
2169
  };
2193
2170
  }
2194
- //#endregion
2195
- //#region extensions/discord/src/monitor/native-command-auth.ts
2171
+ // extensions/discord/src/monitor/native-command-auth.ts
2196
2172
  function resolveDiscordNativePolicyReader(params) {
2197
2173
  return params.readPolicy ?? createDiscordLivePolicyReader({
2198
2174
  ...params,
@@ -2478,8 +2454,7 @@ async function resolveDiscordNativeAutocompleteAuthorized(params) {
2478
2454
  }
2479
2455
  return params.isPolicyCurrent?.() !== false;
2480
2456
  }
2481
- //#endregion
2482
- //#region extensions/discord/src/monitor/native-command-bypass.ts
2457
+ // extensions/discord/src/monitor/native-command-bypass.ts
2483
2458
  function shouldBypassConfiguredAcpEnsure(commandName) {
2484
2459
  const command = commandName.trim().toLowerCase();
2485
2460
  return command === "acp" || command === "status";
@@ -2488,8 +2463,7 @@ function shouldBypassConfiguredAcpGuildGuards(commandName) {
2488
2463
  const command = commandName.trim().toLowerCase();
2489
2464
  return command === "new" || command === "reset";
2490
2465
  }
2491
- //#endregion
2492
- //#region extensions/discord/src/monitor/model-picker-preference-primitives.ts
2466
+ // extensions/discord/src/monitor/model-picker-preference-primitives.ts
2493
2467
  function splitDiscordModelRef(modelRef) {
2494
2468
  const trimmed = modelRef.trim();
2495
2469
  const slashIndex = trimmed.indexOf("/");
@@ -2530,8 +2504,7 @@ function preferenceTimestampMs(value) {
2530
2504
  const parsed = typeof value === "string" ? Date.parse(value) : NaN;
2531
2505
  return Number.isFinite(parsed) ? parsed : 0;
2532
2506
  }
2533
- //#endregion
2534
- //#region extensions/discord/src/monitor/model-picker-preferences.ts
2507
+ // extensions/discord/src/monitor/model-picker-preferences.ts
2535
2508
  const DEFAULT_RECENT_LIMIT = 5;
2536
2509
  const PREFERENCE_MAX_ENTRIES = 2e3;
2537
2510
  let lastPreferenceTimestampMs = 0;
@@ -2613,8 +2586,7 @@ async function recordDiscordModelPickerRecentModel(params) {
2613
2586
  await Promise.all(scopedEntries.slice(limit).map((entry) => store.delete(entry.key)));
2614
2587
  } catch {}
2615
2588
  }
2616
- //#endregion
2617
- //#region extensions/discord/src/monitor/model-picker.state.ts
2589
+ // extensions/discord/src/monitor/model-picker.state.ts
2618
2590
  const DISCORD_MODEL_PICKER_CUSTOM_ID_KEY = "mdlpk";
2619
2591
  const DISCORD_CUSTOM_ID_MAX_CHARS = 100;
2620
2592
  const DISCORD_COMPONENT_MAX_SELECT_OPTIONS = 25;
@@ -2864,8 +2836,7 @@ function getDiscordModelPickerRecentModelRefs(data, quickModels) {
2864
2836
  const defaultModelRef = `${data.resolvedDefault.provider}/${data.resolvedDefault.model}`;
2865
2837
  return [defaultModelRef, ...quickModels.filter((modelRef) => modelRef !== defaultModelRef)];
2866
2838
  }
2867
- //#endregion
2868
- //#region extensions/discord/src/monitor/model-picker.view.ts
2839
+ // extensions/discord/src/monitor/model-picker.view.ts
2869
2840
  const DISCORD_MODEL_PICKER_PAGE_INDICATOR_CUSTOM_ID = "mdlpk:nav-indicator";
2870
2841
  function parseCurrentModelRef(raw) {
2871
2842
  const match = raw?.trim().match(/^([^/]+)\/(.+)$/u);
@@ -3234,8 +3205,7 @@ function renderDiscordModelPickerRecentsView(params) {
3234
3205
  trailingRows: [backRow]
3235
3206
  });
3236
3207
  }
3237
- //#endregion
3238
- //#region extensions/discord/src/monitor/native-command-model-picker-apply.ts
3208
+ // extensions/discord/src/monitor/native-command-model-picker-apply.ts
3239
3209
  async function applyDiscordModelPickerSelection(params) {
3240
3210
  const failureNotice = `❌ Failed to apply ${params.resolvedModelRef}. Try /model ${params.resolvedModelRef} directly.`;
3241
3211
  try {
@@ -3295,8 +3265,7 @@ async function applyDiscordModelPickerSelection(params) {
3295
3265
  };
3296
3266
  }
3297
3267
  }
3298
- //#endregion
3299
- //#region extensions/discord/src/monitor/native-command-model-picker-ui.ts
3268
+ // extensions/discord/src/monitor/native-command-model-picker-ui.ts
3300
3269
  function createDiscordModelPickerSessionReader(params, readConsistency) {
3301
3270
  const storePath = resolveStorePath(params.cfg.session?.store, { agentId: params.route.agentId });
3302
3271
  return (sessionKey = params.route.sessionKey) => getSessionEntryAsync({
@@ -3460,8 +3429,7 @@ async function replyWithDiscordModelPickerProviders(params) {
3460
3429
  replyText: formatDiscordCommandComponents(rendered.components)
3461
3430
  });
3462
3431
  }
3463
- //#endregion
3464
- //#region extensions/discord/src/monitor/native-command-model-picker-interaction.ts
3432
+ // extensions/discord/src/monitor/native-command-model-picker-interaction.ts
3465
3433
  function resolveModelPickerSelectionValue(interaction) {
3466
3434
  return normalizeOptionalString(interaction.values?.[0]) ?? null;
3467
3435
  }
@@ -3822,8 +3790,7 @@ function createDiscordModelPickerFallbackSelect$1(params) {
3822
3790
  }
3823
3791
  }();
3824
3792
  }
3825
- //#endregion
3826
- //#region extensions/discord/src/monitor/native-command-status.ts
3793
+ // extensions/discord/src/monitor/native-command-status.ts
3827
3794
  async function maybeDeliverDiscordDirectStatus(params) {
3828
3795
  if (params.suppressReplies || params.commandName !== "status") return null;
3829
3796
  const statusReply = await params.resolveDirectStatusReplyForSession({
@@ -3862,8 +3829,7 @@ async function maybeDeliverDiscordDirectStatus(params) {
3862
3829
  effectiveRoute: params.effectiveRoute
3863
3830
  };
3864
3831
  }
3865
- //#endregion
3866
- //#region extensions/discord/src/monitor/native-command.args.ts
3832
+ // extensions/discord/src/monitor/native-command.args.ts
3867
3833
  function readDiscordCommandArgs(interaction, definitions) {
3868
3834
  if (!definitions || definitions.length === 0) return;
3869
3835
  const values = {};
@@ -3886,8 +3852,7 @@ function createNativeCommandDefinition(command) {
3886
3852
  scope: "native"
3887
3853
  };
3888
3854
  }
3889
- //#endregion
3890
- //#region extensions/discord/src/monitor/native-command.options.ts
3855
+ // extensions/discord/src/monitor/native-command.options.ts
3891
3856
  const log$1 = createSubsystemLogger("discord/native-command");
3892
3857
  const DISCORD_COMMAND_DESCRIPTION_MAX = 100;
3893
3858
  function truncateDiscordCommandDescription(params) {
@@ -3964,8 +3929,7 @@ function buildDiscordCommandOptions(params) {
3964
3929
  });
3965
3930
  });
3966
3931
  }
3967
- //#endregion
3968
- //#region extensions/discord/src/monitor/native-command.ts
3932
+ // extensions/discord/src/monitor/native-command.ts
3969
3933
  const log = createSubsystemLogger("discord/native-command");
3970
3934
  const NON_PLUGIN_COMMAND_DISPATCH = Object.freeze({ kind: "non-plugin" });
3971
3935
  function createDiscordNativeCommand(params) {
@@ -4417,8 +4381,7 @@ function bindDiscordCommandControl(createControl) {
4417
4381
  const createDiscordCommandArgFallbackButton = bindDiscordCommandControl(createDiscordCommandArgFallbackButton$1);
4418
4382
  const createDiscordModelPickerFallbackButton = bindDiscordCommandControl(createDiscordModelPickerFallbackButton$1);
4419
4383
  const createDiscordModelPickerFallbackSelect = bindDiscordCommandControl(createDiscordModelPickerFallbackSelect$1);
4420
- //#endregion
4421
- //#region extensions/discord/src/internal/gateway-close-codes.ts
4384
+ // extensions/discord/src/internal/gateway-close-codes.ts
4422
4385
  const fatalGatewayCloseCodes = /* @__PURE__ */ new Set([
4423
4386
  GatewayCloseCodes.AuthenticationFailed,
4424
4387
  GatewayCloseCodes.InvalidShard,
@@ -4439,8 +4402,7 @@ function isFatalGatewayCloseCode(code) {
4439
4402
  function canResumeAfterGatewayClose(code) {
4440
4403
  return !nonResumableGatewayCloseCodes.has(code);
4441
4404
  }
4442
- //#endregion
4443
- //#region extensions/discord/src/internal/gateway-identify-limiter.ts
4405
+ // extensions/discord/src/internal/gateway-identify-limiter.ts
4444
4406
  const IDENTIFY_WINDOW_MS = 5e3;
4445
4407
  var GatewayIdentifyLimiter = class {
4446
4408
  async wait() {
@@ -4457,8 +4419,7 @@ var GatewayIdentifyLimiter = class {
4457
4419
  }
4458
4420
  };
4459
4421
  const sharedGatewayIdentifyLimiter = new GatewayIdentifyLimiter();
4460
- //#endregion
4461
- //#region extensions/discord/src/internal/gateway-lifecycle.ts
4422
+ // extensions/discord/src/internal/gateway-lifecycle.ts
4462
4423
  var GatewayHeartbeatTimers = class {
4463
4424
  start(params) {
4464
4425
  this.stop();
@@ -4508,8 +4469,7 @@ var GatewayReconnectTimer = class {
4508
4469
  this.timeout.unref?.();
4509
4470
  }
4510
4471
  };
4511
- //#endregion
4512
- //#region extensions/discord/src/internal/gateway-payload.ts
4472
+ // extensions/discord/src/internal/gateway-payload.ts
4513
4473
  function ensureGatewayParams(url) {
4514
4474
  const parsed = new URL(url);
4515
4475
  parsed.searchParams.set("v", parsed.searchParams.get("v") ?? "10");
@@ -4524,8 +4484,7 @@ function decodeGatewayMessage(incoming) {
4524
4484
  return null;
4525
4485
  }
4526
4486
  }
4527
- //#endregion
4528
- //#region extensions/discord/src/internal/gateway-rate-limit.ts
4487
+ // extensions/discord/src/internal/gateway-rate-limit.ts
4529
4488
  const GATEWAY_SEND_LIMIT = 120;
4530
4489
  const GATEWAY_SEND_WINDOW_MS = 6e4;
4531
4490
  const GATEWAY_SEND_QUEUE_LIMIT = GATEWAY_SEND_LIMIT;
@@ -4623,8 +4582,7 @@ var GatewaySendLimiter = class {
4623
4582
  this.scheduleFlush();
4624
4583
  }
4625
4584
  };
4626
- //#endregion
4627
- //#region extensions/discord/src/internal/gateway-voice-state-cache.ts
4585
+ // extensions/discord/src/internal/gateway-voice-state-cache.ts
4628
4586
  var DiscordGatewayVoiceStateCache = class {
4629
4587
  constructor() {
4630
4588
  this.statesByGuild = /* @__PURE__ */ new Map();
@@ -4700,12 +4658,10 @@ var DiscordGatewayVoiceStateCache = class {
4700
4658
  }
4701
4659
  }
4702
4660
  };
4703
- //#endregion
4704
- //#region extensions/discord/src/internal/ws-runtime.ts
4661
+ // extensions/discord/src/internal/ws-runtime.ts
4705
4662
  const require = createRequire(import.meta.url);
4706
4663
  const WebSocket = require(path.join(path.dirname(require.resolve("ws/package.json")), "index.js"));
4707
- //#endregion
4708
- //#region extensions/discord/src/internal/gateway.ts
4664
+ // extensions/discord/src/internal/gateway.ts
4709
4665
  const GatewayIntents = GatewayIntentBits;
4710
4666
  const READY_STATE_OPEN = 1;
4711
4667
  const DEFAULT_GATEWAY_URL = "wss://gateway.discord.gg/";
@@ -5009,8 +4965,7 @@ var GatewayPlugin = class extends Plugin {
5009
4965
  return this.outboundLimiter.getStatus();
5010
4966
  }
5011
4967
  };
5012
- //#endregion
5013
- //#region extensions/discord/src/monitor/gateway-supervisor.ts
4968
+ // extensions/discord/src/monitor/gateway-supervisor.ts
5014
4969
  var DiscordGatewayLifecycleError = class extends Error {
5015
4970
  constructor(event) {
5016
4971
  super(`discord gateway ${event.type}: ${event.message}`, { cause: event.err instanceof Error ? event.err : void 0 });
@@ -5127,8 +5082,7 @@ function createDiscordGatewaySupervisor(params) {
5127
5082
  }
5128
5083
  };
5129
5084
  }
5130
- //#endregion
5131
- //#region extensions/discord/src/gateway-logging.ts
5085
+ // extensions/discord/src/gateway-logging.ts
5132
5086
  const INFO_DEBUG_MARKERS = [
5133
5087
  "Gateway websocket closed",
5134
5088
  "Gateway reconnect scheduled in",
@@ -5167,8 +5121,7 @@ function attachDiscordGatewayLogging(params) {
5167
5121
  emitter.removeListener("metrics", onGatewayMetrics);
5168
5122
  };
5169
5123
  }
5170
- //#endregion
5171
- //#region extensions/discord/src/monitor.gateway.ts
5124
+ // extensions/discord/src/monitor.gateway.ts
5172
5125
  async function waitForDiscordGatewayStop(params) {
5173
5126
  const { gateway, abortSignal } = params;
5174
5127
  return await new Promise((resolve, reject) => {
@@ -5202,11 +5155,9 @@ async function waitForDiscordGatewayStop(params) {
5202
5155
  params.registerForceStop?.(finishReject);
5203
5156
  });
5204
5157
  }
5205
- //#endregion
5206
- //#region extensions/discord/src/monitor/gateway-handle.ts
5158
+ // extensions/discord/src/monitor/gateway-handle.ts
5207
5159
  const DISCORD_GATEWAY_TRANSPORT_ACTIVITY_EVENT = "openclaw:discord-gateway-transport-activity";
5208
- //#endregion
5209
- //#region extensions/discord/src/monitor/status.ts
5160
+ // extensions/discord/src/monitor/status.ts
5210
5161
  /** READY proves a prior terminal failure was repaired, so the account is restartable again. */
5211
5162
  function createDiscordReadyStatusPatch(at = Date.now()) {
5212
5163
  return channelReadyPatch({
@@ -5215,8 +5166,7 @@ function createDiscordReadyStatusPatch(at = Date.now()) {
5215
5166
  lastDisconnect: null
5216
5167
  });
5217
5168
  }
5218
- //#endregion
5219
- //#region extensions/discord/src/monitor/provider.lifecycle.ts
5169
+ // extensions/discord/src/monitor/provider.lifecycle.ts
5220
5170
  const DEFAULT_DISCORD_GATEWAY_READY_TIMEOUT_MS = 15e3;
5221
5171
  const DEFAULT_DISCORD_GATEWAY_RUNTIME_READY_TIMEOUT_MS = 3e4;
5222
5172
  const MAX_DISCORD_GATEWAY_READY_TIMEOUT_MS = 12e4;
@@ -5555,14 +5505,13 @@ async function runDiscordGatewayLifecycle(params) {
5555
5505
  }
5556
5506
  }
5557
5507
  }
5558
- //#endregion
5559
- //#region extensions/discord/src/monitor/provider-runtime.ts
5508
+ // extensions/discord/src/monitor/provider-runtime.ts
5560
5509
  const discordProviderRuntime = {
5561
5510
  probeDiscordApplicationId,
5562
5511
  createDiscordNativeCommand,
5563
5512
  runDiscordGatewayLifecycle,
5564
- loadDiscordVoiceRuntime: () => import("./voice-runtime-_LfZ3Za7.mjs").then((n) => n.t),
5565
- loadDiscordProviderSessionRuntime: () => import("./provider-session.runtime-3bl84wqI.mjs"),
5513
+ loadDiscordVoiceRuntime: () => import("./voice-runtime-B5m2Ryg8.mjs").then((n) => n.t),
5514
+ loadDiscordProviderSessionRuntime: () => import("./provider-session.runtime-D87e36ut.mjs"),
5566
5515
  createClient: (...args) => new Client(...args),
5567
5516
  resolveDiscordAccount,
5568
5517
  resolveNativeCommandsEnabled,
@@ -5572,8 +5521,7 @@ const discordProviderRuntime = {
5572
5521
  isVerbose,
5573
5522
  shouldLogVerbose
5574
5523
  };
5575
- //#endregion
5576
- //#region extensions/discord/src/monitor/provider.acp.ts
5524
+ // extensions/discord/src/monitor/provider.acp.ts
5577
5525
  const DISCORD_ACP_STATUS_PROBE_TIMEOUT_MS = 8e3;
5578
5526
  const DISCORD_ACP_STALE_RUNNING_ACTIVITY_MS = 12e4;
5579
5527
  function classifyAcpStatusProbeError(params) {
@@ -5646,8 +5594,7 @@ async function probeDiscordAcpBindingHealth(params) {
5646
5594
  };
5647
5595
  return { status: "healthy" };
5648
5596
  }
5649
- //#endregion
5650
- //#region extensions/discord/src/monitor/provider.cleanup.ts
5597
+ // extensions/discord/src/monitor/provider.cleanup.ts
5651
5598
  async function cleanupDiscordProviderStartup(params) {
5652
5599
  try {
5653
5600
  const listenersStopped = params.stopMonitorListeners?.();
@@ -5669,8 +5616,7 @@ async function cleanupDiscordProviderStartup(params) {
5669
5616
  if (!params.lifecycleStarted) await params.threadBindings.stop();
5670
5617
  }
5671
5618
  }
5672
- //#endregion
5673
- //#region extensions/discord/src/voice/session.ts
5619
+ // extensions/discord/src/voice/session.ts
5674
5620
  const MIN_SEGMENT_SECONDS = .35;
5675
5621
  const CAPTURE_FINALIZE_GRACE_MS = 2e3;
5676
5622
  const VOICE_CONNECT_READY_TIMEOUT_MS = 3e4;
@@ -5693,8 +5639,7 @@ function logVoiceVerbose(message) {
5693
5639
  function isVoiceChannel(type) {
5694
5640
  return type === discord_exports.ChannelType.GuildVoice || type === discord_exports.ChannelType.GuildStageVoice;
5695
5641
  }
5696
- //#endregion
5697
- //#region extensions/discord/src/voice/command.ts
5642
+ // extensions/discord/src/voice/command.ts
5698
5643
  const VOICE_CHANNEL_TYPES = [ChannelType.GuildVoice, ChannelType.GuildStageVoice];
5699
5644
  const DISCORD_VOICE_COMMAND_SPEC = {
5700
5645
  name: "vc",
@@ -5859,8 +5804,7 @@ function createDiscordVoiceCommand(startupParams) {
5859
5804
  }
5860
5805
  }();
5861
5806
  }
5862
- //#endregion
5863
- //#region extensions/discord/src/monitor/provider.commands.ts
5807
+ // extensions/discord/src/monitor/provider.commands.ts
5864
5808
  const loadPluginCommandRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/plugin-command-runtime"));
5865
5809
  async function resolveDiscordProviderCommandSpecs(params) {
5866
5810
  const listSkillCommands = params.prepareSkillCommandsForAgents ?? prepareSkillCommandsForAgents;
@@ -5912,8 +5856,7 @@ async function resolveDiscordProviderCommandSpecs(params) {
5912
5856
  commandSpecs
5913
5857
  };
5914
5858
  }
5915
- //#endregion
5916
- //#region extensions/discord/src/monitor/provider.deploy-errors.ts
5859
+ // extensions/discord/src/monitor/provider.deploy-errors.ts
5917
5860
  const DISCORD_DEPLOY_REJECTED_ENTRY_LIMIT = 3;
5918
5861
  function attachDiscordDeployRequestBody(err, body) {
5919
5862
  if (!err || typeof err !== "object" || body === void 0) return;
@@ -6061,8 +6004,7 @@ function isDiscordDeployDailyCreateLimit(err) {
6061
6004
  const rawCode = parseStrictNonNegativeInteger(readDiscordDeployObjectField(deployErr.rawBody, "code"));
6062
6005
  return (discordCode === 30034 || rawCode === 30034) && /daily application command creates/i.test(formatErrorMessage$1(err));
6063
6006
  }
6064
- //#endregion
6065
- //#region extensions/discord/src/monitor/provider.startup-log.ts
6007
+ // extensions/discord/src/monitor/provider.startup-log.ts
6066
6008
  function formatDiscordStartupGatewayState(gateway) {
6067
6009
  if (!gateway) return "gateway=missing";
6068
6010
  const reconnectAttempts = gateway.reconnectAttempts;
@@ -6074,8 +6016,7 @@ function logDiscordStartupPhase(params) {
6074
6016
  const suffix = [params.details, formatDiscordStartupGatewayState(params.gateway)].filter((value) => Boolean(value)).join(" ");
6075
6017
  params.runtime.log?.(`discord startup [${params.accountId}] ${params.phase} ${elapsedMs}ms${suffix ? ` ${suffix}` : ""}`);
6076
6018
  }
6077
- //#endregion
6078
- //#region extensions/discord/src/monitor/provider.deploy.ts
6019
+ // extensions/discord/src/monitor/provider.deploy.ts
6079
6020
  function readDeployRequestBody(data) {
6080
6021
  return data && typeof data === "object" && "body" in data ? data.body : void 0;
6081
6022
  }
@@ -6185,8 +6126,7 @@ function runDiscordCommandDeployInBackground(params) {
6185
6126
  params.runtime.log?.(warn(`[${params.accountId}] slash command deploy failed in background (message send/receive unaffected): ${formatErrorMessage$1(err)}`));
6186
6127
  });
6187
6128
  }
6188
- //#endregion
6189
- //#region extensions/discord/src/monitor/agent-components-reply.ts
6129
+ // extensions/discord/src/monitor/agent-components-reply.ts
6190
6130
  async function replySilently(interaction, params, onError) {
6191
6131
  try {
6192
6132
  await interaction.reply(params);
@@ -6194,8 +6134,7 @@ async function replySilently(interaction, params, onError) {
6194
6134
  onError?.(error);
6195
6135
  }
6196
6136
  }
6197
- //#endregion
6198
- //#region extensions/discord/src/activities/interaction.ts
6137
+ // extensions/discord/src/activities/interaction.ts
6199
6138
  const REGISTRATION_WIDGET_ID = "AAAAAAAAAAAAAAAAAAAAAA";
6200
6139
  const PENDING_LAUNCH_WRITE_BUDGET_MS = 250;
6201
6140
  var DiscordActivityButton = class extends Button {
@@ -6247,8 +6186,7 @@ function createDiscordActivityButton(ctx, applicationId) {
6247
6186
  if (!runtime.resolveAccount(ctx.accountId, ctx.cfg)) return null;
6248
6187
  return new DiscordActivityButton(ctx);
6249
6188
  }
6250
- //#endregion
6251
- //#region extensions/discord/src/monitor/agent-components-context.ts
6189
+ // extensions/discord/src/monitor/agent-components-context.ts
6252
6190
  function resolveAgentComponentRoute(params) {
6253
6191
  return resolveAgentRoute({
6254
6192
  cfg: params.ctx.cfg,
@@ -6329,8 +6267,7 @@ async function resolveComponentInteractionContext(params) {
6329
6267
  memberRoleIds: Array.isArray(interaction.rawData.member?.roles) ? interaction.rawData.member.roles.slice() : []
6330
6268
  };
6331
6269
  }
6332
- //#endregion
6333
- //#region extensions/discord/src/monitor/agent-components-data.ts
6270
+ // extensions/discord/src/monitor/agent-components-data.ts
6334
6271
  function readParsedId(data, key) {
6335
6272
  if (!data || typeof data !== "object") return;
6336
6273
  return key in data ? data[key] : data[key === "cid" ? "componentId" : "modalId"];
@@ -6423,8 +6360,7 @@ function formatModalSubmissionText(entry, interaction) {
6423
6360
  });
6424
6361
  return [title, ...lines.length > 0 ? lines : ["- (no values)"]].join("\n");
6425
6362
  }
6426
- //#endregion
6427
- //#region extensions/discord/src/monitor/agent-components-live-policy.ts
6363
+ // extensions/discord/src/monitor/agent-components-live-policy.ts
6428
6364
  async function resolveAgentComponentPolicyContext(params) {
6429
6365
  if (!params.ctx.readPolicy) return params.ctx;
6430
6366
  try {
@@ -6444,8 +6380,7 @@ async function resolveAgentComponentPolicyContext(params) {
6444
6380
  throw error;
6445
6381
  }
6446
6382
  }
6447
- //#endregion
6448
- //#region extensions/discord/src/monitor/agent-components-dm-auth.ts
6383
+ // extensions/discord/src/monitor/agent-components-dm-auth.ts
6449
6384
  async function ensureDmComponentAuthorized(params) {
6450
6385
  const { ctx, interaction, user, componentLabel } = params;
6451
6386
  const dmPolicy = ctx.dmPolicy ?? "pairing";
@@ -6546,8 +6481,7 @@ async function resolveInteractionContextWithDmAuth(params) {
6546
6481
  })) return null;
6547
6482
  return interactionCtx;
6548
6483
  }
6549
- //#endregion
6550
- //#region extensions/discord/src/monitor/agent-components-guild-auth.ts
6484
+ // extensions/discord/src/monitor/agent-components-guild-auth.ts
6551
6485
  function resolveComponentGuildContext(params) {
6552
6486
  const guildInfo = resolveDiscordGuildEntry({
6553
6487
  guild: params.interaction.guild ?? void 0,
@@ -6719,8 +6653,7 @@ async function resolveComponentCommandAuthorized(params) {
6719
6653
  modeWhenAccessGroupsOff: "configured"
6720
6654
  });
6721
6655
  }
6722
- //#endregion
6723
- //#region extensions/discord/src/monitor/reply-context.ts
6656
+ // extensions/discord/src/monitor/reply-context.ts
6724
6657
  function resolveReplyContext(message, resolveDiscordMessageText) {
6725
6658
  const id = resolveDiscordReferencedReplyMessageId(message);
6726
6659
  if (!id) return null;
@@ -6757,8 +6690,7 @@ function buildGuildLabel(params) {
6757
6690
  const { guild, channelName, channelId } = params;
6758
6691
  return `${guild?.name ?? "Guild"} #${channelName} channel id:${channelId}`;
6759
6692
  }
6760
- //#endregion
6761
- //#region extensions/discord/src/monitor/reply-safety.ts
6693
+ // extensions/discord/src/monitor/reply-safety.ts
6762
6694
  const DISCORD_INTERNAL_CHANNEL_LINE_RE = /^(?:>\s*)?(?:analysis|commentary|thinking|reasoning)\s*[:=]/i;
6763
6695
  function hasNonEmptyRecord(value) {
6764
6696
  return Boolean(value && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length > 0);
@@ -6808,8 +6740,7 @@ function sanitizeDiscordFrontChannelReplyPayloads(payloads, options = {}) {
6808
6740
  }
6809
6741
  return safePayloads;
6810
6742
  }
6811
- //#endregion
6812
- //#region extensions/discord/src/monitor/reply-delivery.ts
6743
+ // extensions/discord/src/monitor/reply-delivery.ts
6813
6744
  function formatDiscordReplyContext(target, sessionKey) {
6814
6745
  return `target=${target}${sessionKey ? ` session=${sessionKey}` : ""}`;
6815
6746
  }
@@ -6919,10 +6850,9 @@ async function deliverDiscordReply(params) {
6919
6850
  if (send.status === "partial_failed") throw createChannelPartialDeliveryError(send.error, deliveryResult);
6920
6851
  return deliveryResult;
6921
6852
  }
6922
- //#endregion
6923
- //#region extensions/discord/src/monitor/agent-components.dispatch.ts
6853
+ // extensions/discord/src/monitor/agent-components.dispatch.ts
6924
6854
  const loadReplyRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/reply-runtime"));
6925
- const loadTypingRuntime = createLazyRuntimeModule(() => import("./typing-CNlSKY5S.mjs").then((n) => n.n));
6855
+ const loadTypingRuntime = createLazyRuntimeModule(() => import("./typing-DAv4S2fI.mjs").then((n) => n.n));
6926
6856
  function buildDiscordComponentConversationLabel(params) {
6927
6857
  if (params.interactionCtx.isDirectMessage) return buildDirectLabel(params.interactionCtx.user);
6928
6858
  if (params.interactionCtx.isGroupDm) return `Group DM #${params.channelCtx.channelName ?? params.interactionCtx.channelId} channel id:${params.interactionCtx.channelId}`;
@@ -7166,8 +7096,7 @@ async function dispatchDiscordComponentEvent(params) {
7166
7096
  }
7167
7097
  });
7168
7098
  }
7169
- //#endregion
7170
- //#region extensions/discord/src/interactive-dispatch.ts
7099
+ // extensions/discord/src/interactive-dispatch.ts
7171
7100
  const dispatchDiscordInteractive = createChannelInteractiveDispatcher({
7172
7101
  channel: "discord",
7173
7102
  interactiveKey: "interaction"
@@ -7178,8 +7107,7 @@ async function dispatchDiscordPluginInteractiveHandler(params) {
7178
7107
  dedupeId: params.interactionId
7179
7108
  });
7180
7109
  }
7181
- //#endregion
7182
- //#region extensions/discord/src/monitor/agent-components.plugin-interactive.ts
7110
+ // extensions/discord/src/monitor/agent-components.plugin-interactive.ts
7183
7111
  const loadConversationRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/conversation-runtime"));
7184
7112
  async function dispatchPluginDiscordInteractiveEvent(params) {
7185
7113
  const normalizedConversationId = params.interactionCtx.rawGuildId || params.channelCtx.channelType === ChannelType.GroupDM ? `channel:${params.interactionCtx.channelId}` : `user:${params.interactionCtx.userId}`;
@@ -7291,9 +7219,8 @@ async function dispatchPluginDiscordInteractiveEvent(params) {
7291
7219
  }
7292
7220
  return "unmatched";
7293
7221
  }
7294
- //#endregion
7295
- //#region extensions/discord/src/monitor/agent-components.handlers.ts
7296
- const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-C_cuoW1q.mjs").then((n) => n.t));
7222
+ // extensions/discord/src/monitor/agent-components.handlers.ts
7223
+ const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-BvOWSPxr.mjs").then((n) => n.t));
7297
7224
  async function resolveAuthorizedComponentEntry(params) {
7298
7225
  const entry = params.entry ?? await params.resolve(false);
7299
7226
  if (!entry) {
@@ -7485,8 +7412,7 @@ function createDiscordComponentModal(ctx) {
7485
7412
  }
7486
7413
  }();
7487
7414
  }
7488
- //#endregion
7489
- //#region extensions/discord/src/monitor/agent-components.system-controls.ts
7415
+ // extensions/discord/src/monitor/agent-components.system-controls.ts
7490
7416
  const AGENT_BUTTON_KEY = "agent";
7491
7417
  const AGENT_SELECT_KEY = "agentsel";
7492
7418
  async function runAgentSystemControlInteraction(params) {
@@ -7572,8 +7498,7 @@ function createAgentSelectMenu(ctx) {
7572
7498
  }
7573
7499
  }();
7574
7500
  }
7575
- //#endregion
7576
- //#region extensions/discord/src/monitor/agent-components.wildcard-controls.ts
7501
+ // extensions/discord/src/monitor/agent-components.wildcard-controls.ts
7577
7502
  const SELECT_CONTROLS = [
7578
7503
  {
7579
7504
  type: ComponentType.StringSelect,
@@ -7655,12 +7580,10 @@ function createDiscordComponentButton(ctx, handlers) {
7655
7580
  }();
7656
7581
  }
7657
7582
  const discordComponentControlFactories = [createDiscordComponentButton, ...SELECT_CONTROLS.map((spec) => (ctx, handlers) => createDiscordComponentSelectControl(spec, ctx, handlers))];
7658
- //#endregion
7659
- //#region extensions/discord/src/monitor/agent-components.ts
7583
+ // extensions/discord/src/monitor/agent-components.ts
7660
7584
  const createAgentComponentControls = [createAgentComponentButton, createAgentSelectMenu];
7661
7585
  const createDiscordComponentControls = discordComponentControlFactories.map((createControl) => (ctx) => createControl(ctx, discordComponentControlHandlers));
7662
- //#endregion
7663
- //#region extensions/discord/src/monitor/exec-approvals.ts
7586
+ // extensions/discord/src/monitor/exec-approvals.ts
7664
7587
  function resolveTerminalLabel(approval) {
7665
7588
  if (approval.status === "allowed") return approval.decision === "allow-always" ? "Allowed always" : "Allowed once";
7666
7589
  if (approval.status === "denied") return "Denied";
@@ -7783,8 +7706,7 @@ function createDiscordExecApprovalButtonContext(params) {
7783
7706
  }
7784
7707
  };
7785
7708
  }
7786
- //#endregion
7787
- //#region extensions/discord/src/monitor/questions.ts
7709
+ // extensions/discord/src/monitor/questions.ts
7788
7710
  var QuestionButton = class extends Button {
7789
7711
  constructor(ctx) {
7790
7712
  super();
@@ -7845,8 +7767,7 @@ function createDiscordQuestionButton(params) {
7845
7767
  })))
7846
7768
  });
7847
7769
  }
7848
- //#endregion
7849
- //#region extensions/discord/src/monitor/provider.interactions.ts
7770
+ // extensions/discord/src/monitor/provider.interactions.ts
7850
7771
  function createDiscordProviderInteractionSurface(params) {
7851
7772
  const createNativeCommand = params.createNativeCommand ?? createDiscordNativeCommand;
7852
7773
  const accountContext = {
@@ -7933,8 +7854,7 @@ function createDiscordProviderInteractionSurface(params) {
7933
7854
  modals
7934
7855
  };
7935
7856
  }
7936
- //#endregion
7937
- //#region extensions/discord/src/internal/voice.ts
7857
+ // extensions/discord/src/internal/voice.ts
7938
7858
  var VoicePlugin = class extends Plugin {
7939
7859
  constructor(..._args) {
7940
7860
  super(..._args);
@@ -7969,8 +7889,7 @@ var VoicePlugin = class extends Plugin {
7969
7889
  };
7970
7890
  }
7971
7891
  };
7972
- //#endregion
7973
- //#region extensions/discord/src/monitor/presence.ts
7892
+ // extensions/discord/src/monitor/presence.ts
7974
7893
  const DEFAULT_CUSTOM_ACTIVITY_TYPE = 4;
7975
7894
  const CUSTOM_STATUS_NAME = "Custom Status";
7976
7895
  function resolveDiscordPresenceUpdate(config) {
@@ -7999,8 +7918,7 @@ function resolveDiscordPresenceUpdate(config) {
7999
7918
  afk: false
8000
7919
  };
8001
7920
  }
8002
- //#endregion
8003
- //#region extensions/discord/src/monitor/auto-presence.ts
7921
+ // extensions/discord/src/monitor/auto-presence.ts
8004
7922
  const DEFAULT_INTERVAL_MS = 3e4;
8005
7923
  const DEFAULT_MIN_UPDATE_INTERVAL_MS = 15e3;
8006
7924
  const MIN_INTERVAL_MS = 5e3;
@@ -8119,8 +8037,7 @@ function createDiscordAutoPresenceController(params) {
8119
8037
  stop: () => scheduler.stop()
8120
8038
  };
8121
8039
  }
8122
- //#endregion
8123
- //#region extensions/discord/src/monitor/gateway-metadata.ts
8040
+ // extensions/discord/src/monitor/gateway-metadata.ts
8124
8041
  const DISCORD_GATEWAY_BOT_URL = "https://discord.com/api/v10/gateway/bot";
8125
8042
  const DISCORD_API_HOST = "discord.com";
8126
8043
  const DEFAULT_DISCORD_GATEWAY_URL = "wss://gateway.discord.gg/";
@@ -8288,8 +8205,7 @@ async function fetchDiscordGatewayMetadataGuarded(input, init, options) {
8288
8205
  }).catch(() => {});
8289
8206
  return response;
8290
8207
  }
8291
- //#endregion
8292
- //#region extensions/discord/src/monitor/gateway-plugin.ts
8208
+ // extensions/discord/src/monitor/gateway-plugin.ts
8293
8209
  const DISCORD_GATEWAY_POLICY_VIOLATION_CLOSE_CODE = 1008;
8294
8210
  const DISCORD_GATEWAY_WS_RECEIVER_LIMIT_CODE = "WS_ERR_TOO_MANY_BUFFERED_PARTS";
8295
8211
  const DISCORD_GATEWAY_CLOSE_REASON_LOG_MAX_CHARS = 240;
@@ -8519,8 +8435,7 @@ function createDiscordGatewayPlugin(params) {
8519
8435
  ...wsAgent ? { wsAgent } : {}
8520
8436
  });
8521
8437
  }
8522
- //#endregion
8523
- //#region extensions/discord/src/monitor/message-handler.preflight-channel-access.ts
8438
+ // extensions/discord/src/monitor/message-handler.preflight-channel-access.ts
8524
8439
  function resolveDiscordPreflightChannelAccess(params) {
8525
8440
  if (params.isGuildMessage && params.channelConfig?.enabled === false) {
8526
8441
  logDebug(`[discord-preflight] drop: channel disabled`);
@@ -8565,8 +8480,7 @@ function resolveDiscordPreflightChannelAccess(params) {
8565
8480
  }
8566
8481
  return true;
8567
8482
  }
8568
- //#endregion
8569
- //#region extensions/discord/src/monitor/listeners.guild-join.ts
8483
+ // extensions/discord/src/monitor/listeners.guild-join.ts
8570
8484
  const DISCORD_GUILD_JOIN_INTRO_MAX_AGE_MS = 3e5;
8571
8485
  var DiscordGuildJoinIntroductionListener = class extends GuildCreateListener {
8572
8486
  constructor(params) {
@@ -8690,8 +8604,7 @@ var DiscordGuildJoinIntroductionListener = class extends GuildCreateListener {
8690
8604
  await Promise.allSettled(this.pendingReports);
8691
8605
  }
8692
8606
  };
8693
- //#endregion
8694
- //#region extensions/discord/src/monitor/provider.startup.ts
8607
+ // extensions/discord/src/monitor/provider.startup.ts
8695
8608
  async function createDiscordMonitorClient(params) {
8696
8609
  let autoPresenceController = null;
8697
8610
  const constructorPlugins = [createDiscordGatewayPlugin(params)];
@@ -8846,15 +8759,13 @@ function registerDiscordMonitorListeners(params) {
8846
8759
  }
8847
8760
  };
8848
8761
  }
8849
- //#endregion
8850
- //#region extensions/discord/src/monitor/startup-status.ts
8762
+ // extensions/discord/src/monitor/startup-status.ts
8851
8763
  function formatDiscordStartupStatusMessage(params) {
8852
8764
  const identitySuffix = params.botIdentity ? ` as ${params.botIdentity}` : "";
8853
8765
  if (params.gatewayReady) return `logged in to discord${identitySuffix}`;
8854
8766
  return `discord client initialized${identitySuffix}; awaiting gateway readiness`;
8855
8767
  }
8856
- //#endregion
8857
- //#region extensions/discord/src/monitor/provider.ts
8768
+ // extensions/discord/src/monitor/provider.ts
8858
8769
  const DEFAULT_DISCORD_MEDIA_MAX_MB = 100;
8859
8770
  const DISCORD_DISALLOWED_INTENTS_CODE = GatewayCloseCodes$1.DisallowedIntents;
8860
8771
  function formatThreadBindingDurationForConfigLabel(durationMs) {
@@ -9234,5 +9145,4 @@ async function monitorDiscordProvider(opts) {
9234
9145
  });
9235
9146
  }
9236
9147
  }
9237
- //#endregion
9238
9148
  export { resolveDiscordDmCommandAccess as A, buildDiscordGroupSystemPrompt as C, createDiscordLivePolicyReader as D, handleDiscordDmCommandDecision as E, mapGatewayDispatchData as O, createDiscordNativeCommand as S, createDiscordSupplementalContextAccessChecker as T, isDiscordRealtimeVoiceMode as _, waitForDiscordGatewayPluginRegistration as a, resolveDiscordVoiceMode as b, formatDiscordReplySkip as c, buildGuildLabel as d, resolveReplyContext as f, VOICE_RECONNECT_GRACE_MS as g, VOICE_CONNECT_READY_TIMEOUT_MS as h, resolveDiscordGatewayIntents as i, resolveDiscordTextCommandAccess as j, registerDiscordListener as k, sanitizeDiscordFrontChannelReplyPayloads as l, MIN_SEGMENT_SECONDS as m, resolveDiscordPreflightChannelAccess as n, deliverDiscordReply as o, CAPTURE_FINALIZE_GRACE_MS as p, createDiscordGatewayPlugin as r, formatDiscordReplyDeliveryFailure as s, monitorDiscordProvider as t, buildDirectLabel as u, isVoiceChannel as v, buildDiscordInboundAccessContext as w, resolveVoiceTimeoutMs as x, logVoiceVerbose as y };