@openclaw/discord 2026.5.27 → 2026.5.28-beta.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 (104) hide show
  1. package/dist/action-runtime-api.js +1 -1
  2. package/dist/{api-Kq7vtaSO.js → api-ChQJ1kfZ.js} +2 -5
  3. package/dist/api.js +14 -14
  4. package/dist/{approval-handler.runtime-BDxD97LJ.js → approval-handler.runtime-CIZiiFBd.js} +5 -18
  5. package/dist/{audit-BdUjE2tr.js → audit-D6BXQsYY.js} +3 -3
  6. package/dist/{channel-9YoMy5Jf.js → channel--B_psO5e.js} +16 -16
  7. package/dist/{channel-actions-DZfkB0nd.js → channel-actions-BOH34yJ5.js} +2 -2
  8. package/dist/{channel-actions.runtime-suaDJHH0.js → channel-actions.runtime-B1RCm1JP.js} +10 -13
  9. package/dist/channel-config-api.js +1 -1
  10. package/dist/channel-plugin-api.js +1 -1
  11. package/dist/{channel.setup-B-kHacpx.js → channel.setup-COYdCbY_.js} +3 -3
  12. package/dist/{components-Dlc81IU5.js → components-DX5Baphr.js} +61 -20
  13. package/dist/{config-schema-CTzLsQlB.js → config-schema-3tZYNVTM.js} +13 -1
  14. package/dist/contract-api.js +2 -2
  15. package/dist/{conversation-identity-DAEgiGDV.js → conversation-identity-Dugx5WfH.js} +2 -2
  16. package/dist/{directory-config-Cgp0csDd.js → directory-config-CcjUkNgK.js} +1 -1
  17. package/dist/directory-contract-api.js +1 -1
  18. package/dist/{directory-live-C-ECRrM8.js → directory-live-NOtxlJZ3.js} +2 -2
  19. package/dist/{doctor-Q80i7GdG.js → doctor-Dy7sI1sL.js} +1 -1
  20. package/dist/{handle-action.guild-admin-DWFTAcfd.js → handle-action.guild-admin-wC9VaAdl.js} +11 -8
  21. package/dist/index.js +1 -1
  22. package/dist/{manager.runtime-D6V2SPKr.js → manager.runtime-Bwgq6hJW.js} +4 -5
  23. package/dist/{message-handler-B5-UG_oD.js → message-handler-DhqxKFLP.js} +9 -9
  24. package/dist/{message-handler.preflight-Ddww-wnF.js → message-handler.preflight-BC8QmsWW.js} +10 -10
  25. package/dist/{message-handler.process-HWGh2NOP.js → message-handler.process-DE1an2G4.js} +85 -17
  26. package/dist/{message-utils-4w0_DPFE.js → message-utils-BlvuUPP4.js} +1 -1
  27. package/dist/{outbound-adapter-DYUYRaBd.js → outbound-adapter-BGrOFkR8.js} +9 -7
  28. package/dist/{pluralkit-BS1MuvYs.js → pluralkit-Cq_PUr06.js} +1 -1
  29. package/dist/{probe-DfIM7zSY.js → probe-CSBPZIYV.js} +1 -1
  30. package/dist/{probe.runtime-DoXDN3rt.js → probe.runtime-BhWW0223.js} +1 -1
  31. package/dist/{provider-CO6pih5z.js → provider-DIVQuJTw.js} +99 -44
  32. package/dist/{provider-session.runtime-BD5XLPI8.js → provider-session.runtime-C7jT_K-7.js} +3 -3
  33. package/dist/provider.runtime-BtnupyG-.js +2 -0
  34. package/dist/{resolve-allowlist-common-QzX-w4-_.js → resolve-allowlist-common-CzfIcLSO.js} +1 -1
  35. package/dist/{resolve-channels-pD06YNCU.js → resolve-channels-CQ13aBCV.js} +3 -3
  36. package/dist/{resolve-users-BiWLqNNO.js → resolve-users-Bj4Y4uWR.js} +3 -3
  37. package/dist/retry-after-CSukypPP.js +21 -0
  38. package/dist/{runtime-xSazIM0F.js → runtime-DA70ebm-.js} +26 -23
  39. package/dist/runtime-api.actions.js +2 -2
  40. package/dist/runtime-api.js +19 -19
  41. package/dist/runtime-api.lookup.js +5 -5
  42. package/dist/runtime-api.monitor-P-emTjcx.js +5 -0
  43. package/dist/runtime-api.monitor.js +4 -4
  44. package/dist/runtime-api.send.js +5 -5
  45. package/dist/runtime-api.threads.js +3 -3
  46. package/dist/{send-BzXZ8iUI.js → send-3r8QQkTY.js} +7 -7
  47. package/dist/{send.components-AK8K4TwB.js → send.components-2qRLUwBn.js} +6 -6
  48. package/dist/{send.outbound-ZrMnBa8C.js → send.outbound-LjX_KYiO.js} +3 -3
  49. package/dist/{send.receipt-BzfsP3Bb.js → send.receipt-Bo_43DQZ.js} +64 -35
  50. package/dist/{send.shared-ehnDGwXx.js → send.shared-CXctTF1I.js} +2 -2
  51. package/dist/setup-plugin-api.js +1 -1
  52. package/dist/{shared-ToNRC7ax.js → shared-D3NkInmq.js} +2 -2
  53. package/dist/{subagent-hooks-Di_2iXU8.js → subagent-hooks-DoWTMQyQ.js} +2 -2
  54. package/dist/subagent-hooks-api.js +1 -1
  55. package/dist/{system-events-DbqKnNPF.js → system-events-DV85gUxb.js} +1 -1
  56. package/dist/{target-resolver-DXPvq5-L.js → target-resolver-DVpZI7ZL.js} +2 -2
  57. package/dist/targets-0WHF7kV0.js +3 -0
  58. package/dist/{thread-bindings-Bw40FTRZ.js → thread-bindings-Cm3GqlNC.js} +4 -4
  59. package/dist/{thread-bindings.discord-api-irWYI8YX.js → thread-bindings.discord-api-JrJXT7L0.js} +4 -4
  60. package/dist/{thread-bindings.manager-LoYZzlss.js → thread-bindings.manager-DqJuGG-r.js} +3 -3
  61. package/dist/transcripts-source-api.js +1 -1
  62. package/dist/{transcripts-source-CwahHAYt.js → transcripts-source-lEfSvSRD.js} +1 -1
  63. package/dist/{typing-Cv09OhaY.js → typing-DlT_14RX.js} +1 -1
  64. package/npm-shrinkwrap.json +3 -49
  65. package/openclaw.plugin.json +35 -1
  66. package/package.json +5 -7
  67. package/dist/inbound-context-B5EsqsSr.js +0 -48
  68. package/dist/provider.runtime-pUGk7VR5.js +0 -2
  69. package/dist/runtime-api.monitor-BjgSsR6H.js +0 -5
  70. package/dist/targets-BBVHRaeO.js +0 -3
  71. package/dist/test-api.js +0 -45
  72. package/node_modules/agent-base/LICENSE +0 -22
  73. package/node_modules/agent-base/README.md +0 -69
  74. package/node_modules/agent-base/dist/helpers.d.ts +0 -10
  75. package/node_modules/agent-base/dist/helpers.d.ts.map +0 -1
  76. package/node_modules/agent-base/dist/helpers.js +0 -37
  77. package/node_modules/agent-base/dist/helpers.js.map +0 -1
  78. package/node_modules/agent-base/dist/index.d.ts +0 -37
  79. package/node_modules/agent-base/dist/index.d.ts.map +0 -1
  80. package/node_modules/agent-base/dist/index.js +0 -146
  81. package/node_modules/agent-base/dist/index.js.map +0 -1
  82. package/node_modules/agent-base/package.json +0 -46
  83. package/node_modules/debug/LICENSE +0 -20
  84. package/node_modules/debug/README.md +0 -481
  85. package/node_modules/debug/package.json +0 -64
  86. package/node_modules/debug/src/browser.js +0 -272
  87. package/node_modules/debug/src/common.js +0 -292
  88. package/node_modules/debug/src/index.js +0 -10
  89. package/node_modules/debug/src/node.js +0 -263
  90. package/node_modules/https-proxy-agent/LICENSE +0 -22
  91. package/node_modules/https-proxy-agent/README.md +0 -70
  92. package/node_modules/https-proxy-agent/dist/index.d.ts +0 -43
  93. package/node_modules/https-proxy-agent/dist/index.d.ts.map +0 -1
  94. package/node_modules/https-proxy-agent/dist/index.js +0 -150
  95. package/node_modules/https-proxy-agent/dist/index.js.map +0 -1
  96. package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +0 -12
  97. package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts.map +0 -1
  98. package/node_modules/https-proxy-agent/dist/parse-proxy-response.js +0 -94
  99. package/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +0 -1
  100. package/node_modules/https-proxy-agent/package.json +0 -50
  101. package/node_modules/ms/index.js +0 -162
  102. package/node_modules/ms/license.md +0 -21
  103. package/node_modules/ms/package.json +0 -38
  104. package/node_modules/ms/readme.md +0 -59
@@ -1,8 +1,8 @@
1
1
  import { a as clearPresences, c as setPresence, i as unregisterGateway, n as getGateway, o as getPresence, r as registerGateway, s as presenceCacheSize, t as clearGateways } from "./gateway-registry-DPxmW0Db.js";
2
2
  import { _ as resolveGroupDmAllow, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordGuildEntry, g as resolveDiscordShouldRequireMention, n as isDiscordGroupAllowedByPolicy, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, t as allowListMatches, u as resolveDiscordCommandAuthorized, v as shouldEmitDiscordReactionNotification } from "./allow-list-BnkWtVpA.js";
3
3
  import { a as mergeAbortSignals, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-l_PsHQvX.js";
4
- import { S as sanitizeDiscordThreadName, _ as registerDiscordListener, b as resolveDiscordReplyTarget, c as resolveDiscordGatewayIntents, d as createDiscordNativeCommand, l as waitForDiscordGatewayPluginRegistration, s as createDiscordGatewayPlugin, t as monitorDiscordProvider } from "./provider-CO6pih5z.js";
5
- import { i as buildDiscordMediaPayload } from "./message-utils-4w0_DPFE.js";
6
- import { t as createDiscordMessageHandler } from "./message-handler-B5-UG_oD.js";
7
- import "./runtime-api.monitor-BjgSsR6H.js";
4
+ import { C as resolveDiscordReplyTarget, T as sanitizeDiscordThreadName, b as registerDiscordListener, c as resolveDiscordGatewayIntents, d as createDiscordNativeCommand, l as waitForDiscordGatewayPluginRegistration, s as createDiscordGatewayPlugin, t as monitorDiscordProvider } from "./provider-DIVQuJTw.js";
5
+ import { i as buildDiscordMediaPayload } from "./message-utils-BlvuUPP4.js";
6
+ import { t as createDiscordMessageHandler } from "./message-handler-DhqxKFLP.js";
7
+ import "./runtime-api.monitor-P-emTjcx.js";
8
8
  export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, allowListMatches, buildDiscordMediaPayload, clearGateways, clearPresences, createDiscordGatewayPlugin, createDiscordMessageHandler, createDiscordNativeCommand, getGateway, getPresence, isDiscordGroupAllowedByPolicy, mergeAbortSignals, monitorDiscordProvider, normalizeDiscordAllowList, normalizeDiscordSlug, presenceCacheSize, registerDiscordListener, registerGateway, resolveDiscordChannelConfig, resolveDiscordChannelConfigWithFallback, resolveDiscordCommandAuthorized, resolveDiscordGatewayIntents, resolveDiscordGuildEntry, resolveDiscordReplyTarget, resolveDiscordShouldRequireMention, resolveGroupDmAllow, sanitizeDiscordThreadName, setPresence, shouldEmitDiscordReactionNotification, unregisterGateway, waitForDiscordGatewayPluginRegistration };
@@ -1,6 +1,6 @@
1
- import { x as resolveDiscordOutboundSessionRoute } from "./components-Dlc81IU5.js";
2
- import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-AK8K4TwB.js";
3
- import { A as hasAllGuildPermissionsDiscord, M as hasAnyGuildPermissionDiscord, O as fetchChannelPermissionsDiscord, k as fetchMemberGuildPermissionsDiscord, w as DiscordSendError } from "./send.shared-ehnDGwXx.js";
4
- import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, c as sendWebhookMessageDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-BzXZ8iUI.js";
5
- import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-ZrMnBa8C.js";
1
+ import { x as resolveDiscordOutboundSessionRoute } from "./components-DX5Baphr.js";
2
+ import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-2qRLUwBn.js";
3
+ import { A as hasAllGuildPermissionsDiscord, M as hasAnyGuildPermissionDiscord, O as fetchChannelPermissionsDiscord, k as fetchMemberGuildPermissionsDiscord, w as DiscordSendError } from "./send.shared-CXctTF1I.js";
4
+ import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, c as sendWebhookMessageDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-3r8QQkTY.js";
5
+ import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-LjX_KYiO.js";
6
6
  export { DiscordSendError, addRoleDiscord, banMemberDiscord, createChannelDiscord, createScheduledEventDiscord, createThreadDiscord, deleteChannelDiscord, deleteMessageDiscord, editChannelDiscord, editDiscordComponentMessage, editMessageDiscord, fetchChannelInfoDiscord, fetchChannelPermissionsDiscord, fetchMemberGuildPermissionsDiscord, fetchMemberInfoDiscord, fetchMessageDiscord, fetchReactionsDiscord, fetchRoleInfoDiscord, fetchVoiceStatusDiscord, hasAllGuildPermissionsDiscord, hasAnyGuildPermissionDiscord, kickMemberDiscord, listGuildChannelsDiscord, listGuildEmojisDiscord, listPinsDiscord, listScheduledEventsDiscord, listThreadsDiscord, moveChannelDiscord, pinMessageDiscord, reactMessageDiscord, readMessagesDiscord, registerBuiltDiscordComponentMessage, removeChannelPermissionDiscord, removeOwnReactionsDiscord, removeReactionDiscord, removeRoleDiscord, resolveDiscordOutboundSessionRoute, resolveEventCoverImage, searchMessagesDiscord, sendDiscordComponentMessage, sendMessageDiscord, sendPollDiscord, sendStickerDiscord, sendTypingDiscord, sendVoiceMessageDiscord, sendWebhookMessageDiscord, setChannelPermissionDiscord, timeoutMemberDiscord, unpinMessageDiscord, uploadEmojiDiscord, uploadStickerDiscord };
@@ -1,6 +1,6 @@
1
1
  import { C as resolveThreadBindingMaxAgeMs, S as resolveThreadBindingMaxAgeExpiresAt, b as resolveThreadBindingIdleTimeoutMs, l as isRecentlyUnboundThreadWebhookMessage, x as resolveThreadBindingInactivityExpiresAt } from "./thread-bindings.state-BsOnj5NX.js";
2
2
  import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-D5gY2ZTE.js";
3
- import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-irWYI8YX.js";
4
- import { a as reconcileAcpThreadBindingsOnStartup, c as resolveDiscordThreadBindingMaxAgeMs, i as listThreadBindingsForAccount, l as resolveThreadBindingsEnabled, n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey, s as resolveDiscordThreadBindingIdleTimeoutMs } from "./thread-bindings-Bw40FTRZ.js";
5
- import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-LoYZzlss.js";
3
+ import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-JrJXT7L0.js";
4
+ import { a as reconcileAcpThreadBindingsOnStartup, c as resolveDiscordThreadBindingMaxAgeMs, i as listThreadBindingsForAccount, l as resolveThreadBindingsEnabled, n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey, s as resolveDiscordThreadBindingIdleTimeoutMs } from "./thread-bindings-Cm3GqlNC.js";
5
+ import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-DqJuGG-r.js";
6
6
  export { testing as __testing, testing, autoBindSpawnedDiscordSubagent, createNoopThreadBindingManager, createThreadBindingManager, formatThreadBindingDurationLabel, getThreadBindingManager, isRecentlyUnboundThreadWebhookMessage, listThreadBindingsBySessionKey, listThreadBindingsForAccount, reconcileAcpThreadBindingsOnStartup, resolveDiscordThreadBindingIdleTimeoutMs, resolveDiscordThreadBindingMaxAgeMs, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingInactivityExpiresAt, resolveThreadBindingIntroText, resolveThreadBindingMaxAgeExpiresAt, resolveThreadBindingMaxAgeMs, resolveThreadBindingPersona, resolveThreadBindingPersonaFromRecord, resolveThreadBindingThreadName, resolveThreadBindingsEnabled, setThreadBindingIdleTimeoutBySessionKey, setThreadBindingMaxAgeBySessionKey, unbindThreadBindingsBySessionKey };
@@ -1,12 +1,13 @@
1
- import { At as getGuildMember, Bt as removeGuildMemberRole, C as readDiscordCode, Ct as createGuildBan, Dt as createGuildSticker, Et as createGuildScheduledEvent, Ft as listGuildRoles, It as listGuildScheduledEvents, Lt as moveGuildChannels, Mt as listGuildActiveThreads, Nt as listGuildChannels, Ot as deleteChannelPermission, Pt as listGuildEmojis, Rt as putChannelPermission, S as RateLimitError, St as addGuildMemberRole, T as readRetryAfter, Tt as createGuildEmoji, Vt as timeoutGuildMember, Wt as __exportAll, _t as listChannelPins, at as deleteOwnMessageReaction, bt as sendChannelTyping, ct as createThread, dt as editChannel, ft as editChannelMessage, gt as listChannelMessages, ht as listChannelArchivedThreads, it as createOwnMessageReaction, jt as getGuildVoiceState, kt as getGuild, lt as deleteChannel, mt as getChannelMessage, n as createDiscordSendResult, ot as listMessageReactionUsers, pt as getChannel, st as createChannelMessage, ut as deleteChannelMessage, vt as pinChannelMessage, w as readDiscordMessage, wt as createGuildChannel, x as DiscordError, xt as unpinChannelMessage, yt as searchGuildMessages, zt as removeGuildMember } from "./send.receipt-BzfsP3Bb.js";
1
+ import { At as getGuildMember, Bt as removeGuildMemberRole, C as readDiscordCode, Ct as createGuildBan, Dt as createGuildSticker, Et as createGuildScheduledEvent, Ft as listGuildRoles, It as listGuildScheduledEvents, Lt as moveGuildChannels, Mt as listGuildActiveThreads, Nt as listGuildChannels, Ot as deleteChannelPermission, Pt as listGuildEmojis, Rt as putChannelPermission, S as RateLimitError, St as addGuildMemberRole, T as readRetryAfter, Tt as createGuildEmoji, Vt as timeoutGuildMember, Wt as __exportAll, _t as listChannelPins, at as deleteOwnMessageReaction, bt as sendChannelTyping, ct as createThread, dt as editChannel, ft as editChannelMessage, gt as listChannelMessages, ht as listChannelArchivedThreads, it as createOwnMessageReaction, jt as getGuildVoiceState, kt as getGuild, lt as deleteChannel, mt as getChannelMessage, n as createDiscordSendResult, ot as listMessageReactionUsers, pt as getChannel, st as createChannelMessage, ut as deleteChannelMessage, vt as pinChannelMessage, w as readDiscordMessage, wt as createGuildChannel, x as DiscordError, xt as unpinChannelMessage, yt as searchGuildMessages, zt as removeGuildMember } from "./send.receipt-Bo_43DQZ.js";
2
2
  import { s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.js";
3
- import { A as hasAllGuildPermissionsDiscord, C as DISCORD_MAX_STICKER_BYTES, D as canViewDiscordGuildChannel, E as canManageGuildRoleDiscord, F as createDiscordClient, M as hasAnyGuildPermissionDiscord, O as fetchChannelPermissionsDiscord, P as parseAndResolveChannelRecipient, R as resolveDiscordClientAccountContext, S as DISCORD_MAX_EVENT_COVER_BYTES, T as canManageGuildMemberRoleDiscord, i as formatReactionEmoji, j as hasAnyChannelPermissionDiscord, k as fetchMemberGuildPermissionsDiscord, l as resolveChannelId, o as normalizeEmojiName, r as buildReactionIdentifier, s as normalizeReactionEmoji, t as buildDiscordSendError, w as DiscordSendError, x as DISCORD_MAX_EMOJI_BYTES, z as resolveDiscordRest } from "./send.shared-ehnDGwXx.js";
4
- import { a as rewriteDiscordKnownMentions, n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-ZrMnBa8C.js";
3
+ import { A as hasAllGuildPermissionsDiscord, C as DISCORD_MAX_STICKER_BYTES, D as canViewDiscordGuildChannel, E as canManageGuildRoleDiscord, F as createDiscordClient, M as hasAnyGuildPermissionDiscord, O as fetchChannelPermissionsDiscord, P as parseAndResolveChannelRecipient, R as resolveDiscordClientAccountContext, S as DISCORD_MAX_EVENT_COVER_BYTES, T as canManageGuildMemberRoleDiscord, i as formatReactionEmoji, j as hasAnyChannelPermissionDiscord, k as fetchMemberGuildPermissionsDiscord, l as resolveChannelId, o as normalizeEmojiName, r as buildReactionIdentifier, s as normalizeReactionEmoji, t as buildDiscordSendError, w as DiscordSendError, x as DISCORD_MAX_EMOJI_BYTES, z as resolveDiscordRest } from "./send.shared-CXctTF1I.js";
4
+ import { a as rewriteDiscordKnownMentions, n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-LjX_KYiO.js";
5
5
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { ChannelType } from "discord-api-types/v10";
7
7
  import crypto from "node:crypto";
8
8
  import path from "node:path";
9
9
  import { writeExternalFileWithinRoot } from "openclaw/plugin-sdk/security-runtime";
10
+ import { parseStrictFiniteNumber } from "openclaw/plugin-sdk/number-runtime";
10
11
  import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, extensionForMime, maxBytesForKind, parseFfprobeCodecAndSampleRate, runFfmpeg, runFfprobe, unlinkIfExists } from "openclaw/plugin-sdk/media-runtime";
11
12
  import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
12
13
  import { loadWebMediaRaw } from "openclaw/plugin-sdk/web-media";
@@ -405,7 +406,7 @@ function createRateLimitError(response, body, request) {
405
406
  */
406
407
  async function getAudioDuration(filePath) {
407
408
  try {
408
- const stdout = await runFfprobe([
409
+ const duration = parseStrictFiniteNumber(await runFfprobe([
409
410
  "-v",
410
411
  "error",
411
412
  "-show_entries",
@@ -413,9 +414,8 @@ async function getAudioDuration(filePath) {
413
414
  "-of",
414
415
  "csv=p=0",
415
416
  filePath
416
- ]);
417
- const duration = Number.parseFloat(stdout.trim());
418
- if (Number.isNaN(duration)) throw new Error("Could not parse duration");
417
+ ]));
418
+ if (duration === void 0) throw new Error("Could not parse duration");
419
419
  return Math.round(duration * 100) / 100;
420
420
  } catch (err) {
421
421
  const errMessage = formatErrorMessage(err);
@@ -1,10 +1,10 @@
1
- import { Wt as __exportAll, ft as editChannelMessage, j as serializePayload, n as createDiscordSendResult, st as createChannelMessage } from "./send.receipt-BzfsP3Bb.js";
1
+ import { Wt as __exportAll, ft as editChannelMessage, j as serializePayload, n as createDiscordSendResult, st as createChannelMessage } from "./send.receipt-Bo_43DQZ.js";
2
2
  import { s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.js";
3
3
  import "./config-api-JiPdJeb0.js";
4
4
  import "./channel-api-CAJ0wMoV.js";
5
- import { c as buildDiscordComponentMessage, f as resolveDiscordComponentAttachmentName, l as buildDiscordComponentMessageFlags } from "./components-Dlc81IU5.js";
6
- import { F as createDiscordClient, P as parseAndResolveChannelRecipient, b as stripUndefinedFields, h as SUPPRESS_NOTIFICATIONS_FLAG, l as resolveChannelId, m as toDiscordFileBlob, t as buildDiscordSendError, u as resolveDiscordChannelType } from "./send.shared-ehnDGwXx.js";
7
- import { t as sendMessageDiscord } from "./send.outbound-ZrMnBa8C.js";
5
+ import { c as buildDiscordComponentMessage, f as resolveDiscordComponentAttachmentName, l as buildDiscordComponentMessageFlags } from "./components-DX5Baphr.js";
6
+ import { F as createDiscordClient, P as parseAndResolveChannelRecipient, b as stripUndefinedFields, h as SUPPRESS_NOTIFICATIONS_FLAG, l as resolveChannelId, m as toDiscordFileBlob, t as buildDiscordSendError, u as resolveDiscordChannelType } from "./send.shared-CXctTF1I.js";
7
+ import { t as sendMessageDiscord } from "./send.outbound-LjX_KYiO.js";
8
8
  import { n as getOptionalDiscordRuntime } from "./runtime-DgnVQ7zW.js";
9
9
  import "openclaw/plugin-sdk/account-id";
10
10
  import "openclaw/plugin-sdk/secret-input";
@@ -13,7 +13,7 @@ import "openclaw/plugin-sdk/account-helpers";
13
13
  import "openclaw/plugin-sdk/channel-config-helpers";
14
14
  import "openclaw/plugin-sdk/routing";
15
15
  import "openclaw/plugin-sdk/channel-status";
16
- import { assertMediaNotDataUrl, jsonResult, parseAvailableTags, readNumberParam, readReactionParams, readStringArrayParam, readStringParam, resolvePollMaxSelections, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
16
+ import { assertMediaNotDataUrl, jsonResult, parseAvailableTags, readNonNegativeIntegerParam, readPositiveIntegerParam, readReactionParams, readStringArrayParam, readStringParam, resolvePollMaxSelections, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
17
17
  import { readBooleanParam as readBooleanParam$1 } from "openclaw/plugin-sdk/boolean-param";
18
18
  import "openclaw/plugin-sdk/channel-plugin-common";
19
19
  import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
@@ -505,4 +505,4 @@ async function editDiscordComponentMessage(to, messageId, spec, opts) {
505
505
  });
506
506
  }
507
507
  //#endregion
508
- export { resolveDiscordComponentEntryWithPersistence as a, jsonResult as c, readNumberParam as d, readReactionParams as f, withNormalizedTimestamp as g, resolvePollMaxSelections as h, send_components_exports as i, parseAvailableTags as l, readStringParam as m, registerBuiltDiscordComponentMessage as n, resolveDiscordModalEntryWithPersistence as o, readStringArrayParam as p, sendDiscordComponentMessage as r, assertMediaNotDataUrl as s, editDiscordComponentMessage as t, readBooleanParam$1 as u };
508
+ export { withNormalizedTimestamp as _, resolveDiscordComponentEntryWithPersistence as a, jsonResult as c, readNonNegativeIntegerParam as d, readPositiveIntegerParam as f, resolvePollMaxSelections as g, readStringParam as h, send_components_exports as i, parseAvailableTags as l, readStringArrayParam as m, registerBuiltDiscordComponentMessage as n, resolveDiscordModalEntryWithPersistence as o, readReactionParams as p, sendDiscordComponentMessage as r, assertMediaNotDataUrl as s, editDiscordComponentMessage as t, readBooleanParam$1 as u };
@@ -1,7 +1,7 @@
1
- import { ct as createThread, n as createDiscordSendResult, st as createChannelMessage } from "./send.receipt-BzfsP3Bb.js";
1
+ import { ct as createThread, n as createDiscordSendResult, st as createChannelMessage } from "./send.receipt-Bo_43DQZ.js";
2
2
  import { s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.js";
3
- import { F as createDiscordClient, P as parseAndResolveChannelRecipient, _ as resolveDiscordMessageFlags, a as normalizeDiscordPollInput, c as normalizeStickerIds, f as sendDiscordMedia, g as buildDiscordMessageRequest, l as resolveChannelId, n as buildDiscordTextChunks, p as sendDiscordText, t as buildDiscordSendError, u as resolveDiscordChannelType, v as resolveDiscordSendComponents, y as resolveDiscordSendEmbeds } from "./send.shared-ehnDGwXx.js";
4
- import { a as resolveDiscordDirectoryUserId } from "./directory-live-C-ECRrM8.js";
3
+ import { F as createDiscordClient, P as parseAndResolveChannelRecipient, _ as resolveDiscordMessageFlags, a as normalizeDiscordPollInput, c as normalizeStickerIds, f as sendDiscordMedia, g as buildDiscordMessageRequest, l as resolveChannelId, n as buildDiscordTextChunks, p as sendDiscordText, t as buildDiscordSendError, u as resolveDiscordChannelType, v as resolveDiscordSendComponents, y as resolveDiscordSendEmbeds } from "./send.shared-CXctTF1I.js";
4
+ import { a as resolveDiscordDirectoryUserId } from "./directory-live-NOtxlJZ3.js";
5
5
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { ChannelType } from "discord-api-types/v10";
7
7
  import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
@@ -1,3 +1,4 @@
1
+ import { n as parseRetryAfterHeaderSeconds, t as parseDiscordRetryAfterBodySeconds } from "./retry-after-CSukypPP.js";
1
2
  import "node:module";
2
3
  import { buildMessagingTarget, parseMentionPrefixOrAtUserTarget, requireTargetKind } from "openclaw/plugin-sdk/channel-targets";
3
4
  import { ApplicationCommandOptionType, ApplicationCommandType, ButtonStyle, ComponentType, GatewayDispatchEvents, InteractionContextType, InteractionResponseType, InteractionType, MessageFlags, Routes, TextInputStyle } from "discord-api-types/v10";
@@ -7,6 +8,7 @@ import { privateFileStore } from "openclaw/plugin-sdk/security-runtime";
7
8
  import { Type } from "typebox";
8
9
  import { Check } from "typebox/value";
9
10
  import { inspect } from "node:util";
11
+ import { parseFiniteNumber, resolveIntegerOption } from "openclaw/plugin-sdk/number-runtime";
10
12
  import { chunkMarkdownTextWithMode } from "openclaw/plugin-sdk/reply-chunking";
11
13
  import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
12
14
  //#region \0rolldown/runtime.js
@@ -1865,20 +1867,8 @@ function readDiscordMessage(body, fallback) {
1865
1867
  const value = body && typeof body === "object" && "message" in body ? body.message : void 0;
1866
1868
  return typeof value === "string" && value.trim() ? value : fallback;
1867
1869
  }
1868
- function readRetryAfterHeader(value, now = Date.now()) {
1869
- if (!value) return;
1870
- const seconds = Number(value);
1871
- if (Number.isFinite(seconds)) return seconds;
1872
- const retryAt = Date.parse(value);
1873
- return Number.isFinite(retryAt) ? (retryAt - now) / 1e3 : void 0;
1874
- }
1875
- function coerceRetryAfterSeconds(value) {
1876
- if (typeof value !== "number" && typeof value !== "string") return;
1877
- const seconds = typeof value === "number" ? value : Number(value);
1878
- return Number.isFinite(seconds) && seconds >= 0 ? Math.max(0, seconds) : void 0;
1879
- }
1880
1870
  function readRetryAfter(body, response, fallbackSeconds = 0) {
1881
- return coerceRetryAfterSeconds(body && typeof body === "object" && "retry_after" in body ? body.retry_after : void 0) ?? coerceRetryAfterSeconds(readRetryAfterHeader(response.headers.get("Retry-After"))) ?? fallbackSeconds;
1871
+ return parseDiscordRetryAfterBodySeconds(body && typeof body === "object" && "retry_after" in body ? body.retry_after : void 0) ?? parseRetryAfterHeaderSeconds(response.headers.get("Retry-After")) ?? fallbackSeconds;
1882
1872
  }
1883
1873
  var DiscordError = class extends Error {
1884
1874
  constructor(response, body) {
@@ -1902,6 +1892,7 @@ var RateLimitError = class extends DiscordError {
1902
1892
  };
1903
1893
  //#endregion
1904
1894
  //#region extensions/discord/src/internal/rest-routes.ts
1895
+ const RATE_LIMIT_HEADER_NUMBER_RE = /^\d+(?:\.\d+)?$/;
1905
1896
  function createRouteKey(method, path) {
1906
1897
  return `${method.toUpperCase()} ${path.split("?")[0] ?? path}`;
1907
1898
  }
@@ -1918,7 +1909,9 @@ function createBucketKey(bucket, path) {
1918
1909
  function readHeaderNumber(headers, name) {
1919
1910
  const value = headers.get(name);
1920
1911
  if (!value) return;
1921
- const parsed = Number(value);
1912
+ const trimmed = value.trim();
1913
+ if (!RATE_LIMIT_HEADER_NUMBER_RE.test(trimmed)) return;
1914
+ const parsed = Number(trimmed);
1922
1915
  return Number.isFinite(parsed) ? parsed : void 0;
1923
1916
  }
1924
1917
  function readResetAt(response) {
@@ -1941,6 +1934,25 @@ const requestPriorities = [
1941
1934
  "standard",
1942
1935
  "background"
1943
1936
  ];
1937
+ function normalizeRestSchedulerOptions(options) {
1938
+ return {
1939
+ lanes: {
1940
+ critical: normalizeLaneOptions(options.lanes.critical),
1941
+ standard: normalizeLaneOptions(options.lanes.standard),
1942
+ background: normalizeLaneOptions(options.lanes.background)
1943
+ },
1944
+ maxConcurrency: resolveIntegerOption(options.maxConcurrency, 1, { min: 1 }),
1945
+ maxQueueSize: resolveIntegerOption(options.maxQueueSize, 1, { min: 1 }),
1946
+ maxRateLimitRetries: resolveIntegerOption(options.maxRateLimitRetries, 0, { min: 0 })
1947
+ };
1948
+ }
1949
+ function normalizeLaneOptions(options) {
1950
+ return {
1951
+ maxQueueSize: resolveIntegerOption(options.maxQueueSize, 1, { min: 1 }),
1952
+ ...options.staleAfterMs === void 0 ? {} : { staleAfterMs: resolveIntegerOption(options.staleAfterMs, 0, { min: 0 }) },
1953
+ weight: resolveIntegerOption(options.weight, 1, { min: 1 })
1954
+ };
1955
+ }
1944
1956
  function createLaneQueues() {
1945
1957
  return {
1946
1958
  critical: [],
@@ -1953,7 +1965,6 @@ function countPending(bucket) {
1953
1965
  }
1954
1966
  var RestScheduler = class {
1955
1967
  constructor(options, executor) {
1956
- this.options = options;
1957
1968
  this.executor = executor;
1958
1969
  this.activeWorkers = 0;
1959
1970
  this.buckets = /* @__PURE__ */ new Map();
@@ -1973,7 +1984,8 @@ var RestScheduler = class {
1973
1984
  this.queueGeneration = 0;
1974
1985
  this.queuedRequests = 0;
1975
1986
  this.routeBuckets = /* @__PURE__ */ new Map();
1976
- this.laneSchedule = this.buildLaneSchedule(options.lanes);
1987
+ this.options = normalizeRestSchedulerOptions(options);
1988
+ this.laneSchedule = this.buildLaneSchedule(this.options.lanes);
1977
1989
  }
1978
1990
  enqueue(params) {
1979
1991
  if (this.queuedRequests >= this.options.maxQueueSize) throw new Error("Discord request queue is full");
@@ -2050,10 +2062,10 @@ var RestScheduler = class {
2050
2062
  };
2051
2063
  }
2052
2064
  get maxConcurrentWorkers() {
2053
- return Math.max(1, Math.floor(this.options.maxConcurrency));
2065
+ return this.options.maxConcurrency;
2054
2066
  }
2055
2067
  get maxRateLimitRetries() {
2056
- return Math.max(0, Math.floor(this.options.maxRateLimitRetries));
2068
+ return this.options.maxRateLimitRetries;
2057
2069
  }
2058
2070
  getBucket(key) {
2059
2071
  const existing = this.buckets.get(key);
@@ -2265,7 +2277,7 @@ var RestScheduler = class {
2265
2277
  buildLaneSchedule(lanes) {
2266
2278
  const schedule = [];
2267
2279
  for (const lane of requestPriorities) {
2268
- const weight = Math.max(1, Math.floor(lanes[lane].weight));
2280
+ const weight = lanes[lane].weight;
2269
2281
  for (let i = 0; i < weight; i += 1) schedule.push(lane);
2270
2282
  }
2271
2283
  return schedule.length > 0 ? schedule : [...requestPriorities];
@@ -2351,15 +2363,12 @@ var RequestClient = class {
2351
2363
  this.requestControllers = /* @__PURE__ */ new Set();
2352
2364
  this.token = token.replace(/^Bot\s+/i, "");
2353
2365
  this.customFetch = options?.fetch;
2354
- this.options = {
2355
- ...defaultOptions,
2356
- ...options
2357
- };
2366
+ this.options = normalizeRequestClientOptions(options);
2358
2367
  this.scheduler = new RestScheduler({
2359
- lanes: normalizeSchedulerLanes(this.options.maxQueueSize ?? defaultOptions.maxQueueSize, this.options.scheduler?.lanes),
2360
- maxConcurrency: this.options.scheduler?.maxConcurrency ?? DEFAULT_MAX_CONCURRENT_WORKERS,
2361
- maxQueueSize: this.options.maxQueueSize ?? defaultOptions.maxQueueSize,
2362
- maxRateLimitRetries: this.options.scheduler?.maxRateLimitRetries ?? 3
2368
+ lanes: normalizeSchedulerLanes(this.options.maxQueueSize, this.options.scheduler?.lanes),
2369
+ maxConcurrency: normalizeIntegerOption(this.options.scheduler?.maxConcurrency, DEFAULT_MAX_CONCURRENT_WORKERS, { min: 1 }),
2370
+ maxQueueSize: this.options.maxQueueSize,
2371
+ maxRateLimitRetries: normalizeIntegerOption(this.options.scheduler?.maxRateLimitRetries, 3, { min: 0 })
2363
2372
  }, async (request) => await this.executeRequest(request.method, request.path, {
2364
2373
  data: request.data,
2365
2374
  query: request.query
@@ -2456,8 +2465,24 @@ var RequestClient = class {
2456
2465
  this.requestControllers.clear();
2457
2466
  }
2458
2467
  };
2468
+ function normalizeIntegerOption(value, fallback, params) {
2469
+ const candidate = parseFiniteNumber(value) ?? fallback;
2470
+ return Math.max(params.min, Math.floor(candidate));
2471
+ }
2472
+ function normalizeRequestClientOptions(options) {
2473
+ const merged = {
2474
+ ...defaultOptions,
2475
+ ...options
2476
+ };
2477
+ return {
2478
+ ...merged,
2479
+ apiVersion: normalizeIntegerOption(merged.apiVersion, defaultOptions.apiVersion, { min: 1 }),
2480
+ timeout: normalizeIntegerOption(merged.timeout, defaultOptions.timeout, { min: 1 }),
2481
+ maxQueueSize: normalizeIntegerOption(merged.maxQueueSize, defaultOptions.maxQueueSize, { min: 1 })
2482
+ };
2483
+ }
2459
2484
  function normalizeSchedulerLanes(maxQueueSize, lanes) {
2460
- const fallbackMaxQueueSize = Math.max(1, Math.floor(maxQueueSize));
2485
+ const fallbackMaxQueueSize = normalizeIntegerOption(maxQueueSize, defaultOptions.maxQueueSize, { min: 1 });
2461
2486
  return {
2462
2487
  critical: normalizeSchedulerLane("critical", fallbackMaxQueueSize, lanes?.critical),
2463
2488
  standard: normalizeSchedulerLane("standard", fallbackMaxQueueSize, lanes?.standard),
@@ -2466,10 +2491,11 @@ function normalizeSchedulerLanes(maxQueueSize, lanes) {
2466
2491
  }
2467
2492
  function normalizeSchedulerLane(lane, maxQueueSize, options) {
2468
2493
  const defaults = defaultLaneOptions[lane];
2494
+ const staleAfterMs = options?.staleAfterMs !== void 0 ? normalizeIntegerOption(options.staleAfterMs, defaults.staleAfterMs ?? 0, { min: 0 }) : defaults.staleAfterMs;
2469
2495
  return {
2470
- maxQueueSize: options?.maxQueueSize !== void 0 ? Math.max(1, Math.floor(options.maxQueueSize)) : maxQueueSize,
2471
- staleAfterMs: options?.staleAfterMs !== void 0 ? Math.max(0, Math.floor(options.staleAfterMs)) : defaults.staleAfterMs,
2472
- weight: options?.weight !== void 0 ? Math.max(1, Math.floor(options.weight)) : defaults.weight
2496
+ maxQueueSize: options?.maxQueueSize !== void 0 ? normalizeIntegerOption(options.maxQueueSize, maxQueueSize, { min: 1 }) : maxQueueSize,
2497
+ ...staleAfterMs !== void 0 ? { staleAfterMs } : {},
2498
+ weight: options?.weight !== void 0 ? normalizeIntegerOption(options.weight, defaults.weight, { min: 1 }) : defaults.weight
2473
2499
  };
2474
2500
  }
2475
2501
  function getRequestPriority(method, path) {
@@ -2855,6 +2881,9 @@ const DEFAULT_MAX_CHARS = 2e3;
2855
2881
  const DEFAULT_MAX_LINES = 17;
2856
2882
  const FENCE_RE = /^( {0,3})(`{3,}|~{3,})(.*)$/;
2857
2883
  const CJK_PUNCTUATION_BREAK_AFTER_RE = /[、。,.!?;:)]}〉》」』】〕〗〙]/u;
2884
+ function resolveDiscordChunkLimit(value, fallback) {
2885
+ return resolveIntegerOption(value, fallback, { min: 1 });
2886
+ }
2858
2887
  function countLines(text) {
2859
2888
  if (!text) return 0;
2860
2889
  return text.split("\n").length;
@@ -2909,7 +2938,7 @@ function findCjkPunctuationBreak(window) {
2909
2938
  return -1;
2910
2939
  }
2911
2940
  function splitLongLine(line, maxChars, opts) {
2912
- const limit = Math.max(1, Math.floor(maxChars));
2941
+ const limit = resolveDiscordChunkLimit(maxChars, DEFAULT_MAX_CHARS);
2913
2942
  if (line.length <= limit) return [line];
2914
2943
  const out = [];
2915
2944
  let remaining = line;
@@ -2935,8 +2964,8 @@ function splitLongLine(line, maxChars, opts) {
2935
2964
  * while keeping fenced code blocks balanced across chunks.
2936
2965
  */
2937
2966
  function chunkDiscordText(text, opts = {}) {
2938
- const maxChars = Math.max(1, Math.floor(opts.maxChars ?? DEFAULT_MAX_CHARS));
2939
- const maxLines = Math.max(1, Math.floor(opts.maxLines ?? DEFAULT_MAX_LINES));
2967
+ const maxChars = resolveDiscordChunkLimit(opts.maxChars, DEFAULT_MAX_CHARS);
2968
+ const maxLines = resolveDiscordChunkLimit(opts.maxLines, DEFAULT_MAX_LINES);
2940
2969
  const body = text ?? "";
2941
2970
  if (!body) return [];
2942
2971
  if (body.length <= maxChars && countLines(body) <= maxLines) return [body];
@@ -2997,7 +3026,7 @@ function chunkDiscordText(text, opts = {}) {
2997
3026
  }
2998
3027
  function chunkDiscordTextWithMode(text, opts) {
2999
3028
  if ((opts.chunkMode ?? "length") !== "newline") return chunkDiscordText(text, opts);
3000
- const lineChunks = chunkMarkdownTextWithMode(text, Math.max(1, Math.floor(opts.maxChars ?? DEFAULT_MAX_CHARS)), "newline");
3029
+ const lineChunks = chunkMarkdownTextWithMode(text, resolveDiscordChunkLimit(opts.maxChars, DEFAULT_MAX_CHARS), "newline");
3001
3030
  const chunks = [];
3002
3031
  for (const line of lineChunks) {
3003
3032
  const nested = chunkDiscordText(line, opts);
@@ -1,6 +1,6 @@
1
- import { At as getGuildMember, M as Embed, S as RateLimitError, b as RequestClient, j as serializePayload, kt as getGuild, nt as createUserDmChannel, pt as getChannel, rt as getCurrentUser, s as chunkDiscordTextWithMode, st as createChannelMessage } from "./send.receipt-BzfsP3Bb.js";
1
+ import { At as getGuildMember, M as Embed, S as RateLimitError, b as RequestClient, j as serializePayload, kt as getGuild, nt as createUserDmChannel, pt as getChannel, rt as getCurrentUser, s as chunkDiscordTextWithMode, st as createChannelMessage } from "./send.receipt-Bo_43DQZ.js";
2
2
  import { a as mergeDiscordAccountConfig, p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.js";
3
- import { t as parseAndResolveDiscordTarget } from "./target-resolver-DXPvq5-L.js";
3
+ import { t as parseAndResolveDiscordTarget } from "./target-resolver-DVpZI7ZL.js";
4
4
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
6
6
  import { ChannelType, MessageFlags, PermissionFlagsBits } from "discord-api-types/v10";
@@ -1,2 +1,2 @@
1
- import { t as discordSetupPlugin } from "./channel.setup-B-kHacpx.js";
1
+ import { t as discordSetupPlugin } from "./channel.setup-COYdCbY_.js";
2
2
  export { discordSetupPlugin };
@@ -1,7 +1,7 @@
1
1
  import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, d as resolveDiscordAccountDmPolicy, n as isDiscordAccountEnabledForRuntime, o as resolveDefaultDiscordAccountId, r as listDiscordAccountIds, s as resolveDiscordAccount, u as resolveDiscordAccountDisabledReason } from "./accounts-dXTfmnSZ.js";
2
2
  import { t as inspectDiscordAccount } from "./account-inspect-C4sJZNbI.js";
3
3
  import { i as getChatChannelMeta, o as resolveConfiguredFromCredentialStatuses } from "./channel-api-CAJ0wMoV.js";
4
- import { t as DiscordChannelConfigSchema } from "./config-schema-CTzLsQlB.js";
4
+ import { t as DiscordChannelConfigSchema } from "./config-schema-3tZYNVTM.js";
5
5
  import { n as normalizeCompatibilityConfig } from "./doctor-contract-8-Ia3d_X.js";
6
6
  import { n as secretTargetRegistryEntries, t as collectRuntimeConfigAssignments } from "./secret-config-contract-BjM-1hr9.js";
7
7
  import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-DSHk7I2w.js";
@@ -71,7 +71,7 @@ const DISCORD_LEGACY_CONFIG_RULES = [];
71
71
  const DISCORD_CHANNEL = "discord";
72
72
  let discordDoctorModulePromise;
73
73
  async function loadDiscordDoctorModule() {
74
- discordDoctorModulePromise ??= import("./doctor-Q80i7GdG.js");
74
+ discordDoctorModulePromise ??= import("./doctor-Dy7sI1sL.js");
75
75
  return await discordDoctorModulePromise;
76
76
  }
77
77
  const discordDoctor = {
@@ -1,6 +1,6 @@
1
- import { Wt as __exportAll } from "./send.receipt-BzfsP3Bb.js";
1
+ import { Wt as __exportAll } from "./send.receipt-Bo_43DQZ.js";
2
2
  import { s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.js";
3
- import { n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey } from "./thread-bindings-Bw40FTRZ.js";
3
+ import { n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey } from "./thread-bindings-Cm3GqlNC.js";
4
4
  import { normalizeOptionalLowercaseString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { formatThreadBindingDisabledError, formatThreadBindingSpawnDisabledError, resolveThreadBindingSpawnPolicy } from "openclaw/plugin-sdk/conversation-runtime";
6
6
  //#region extensions/discord/src/subagent-hooks.ts
@@ -1,7 +1,7 @@
1
1
  //#region extensions/discord/subagent-hooks-api.ts
2
2
  let discordSubagentHooksPromise = null;
3
3
  function loadDiscordSubagentHooksModule() {
4
- discordSubagentHooksPromise ??= import("./subagent-hooks-Di_2iXU8.js").then((n) => n.i);
4
+ discordSubagentHooksPromise ??= import("./subagent-hooks-DoWTMQyQ.js").then((n) => n.i);
5
5
  return discordSubagentHooksPromise;
6
6
  }
7
7
  function registerDiscordSubagentHooks(api) {
@@ -1,4 +1,4 @@
1
- import { c as discord_exports } from "./send.receipt-BzfsP3Bb.js";
1
+ import { c as discord_exports } from "./send.receipt-Bo_43DQZ.js";
2
2
  import { b as formatDiscordUserTag } from "./allow-list-BnkWtVpA.js";
3
3
  //#region extensions/discord/src/monitor/system-events.ts
4
4
  function resolveDiscordSystemEvent(message, location) {
@@ -1,6 +1,6 @@
1
- import { Ht as parseDiscordTarget, Wt as __exportAll, r as allowFromContainsDiscordUserId } from "./send.receipt-BzfsP3Bb.js";
1
+ import { Ht as parseDiscordTarget, Wt as __exportAll, r as allowFromContainsDiscordUserId } from "./send.receipt-Bo_43DQZ.js";
2
2
  import { c as resolveDiscordAccountAllowFrom, s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.js";
3
- import { i as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-C-ECRrM8.js";
3
+ import { i as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-NOtxlJZ3.js";
4
4
  import { buildMessagingTarget } from "openclaw/plugin-sdk/channel-targets";
5
5
  //#region extensions/discord/src/send-target-parsing.ts
6
6
  const parseDiscordSendTarget = (raw, options = {}) => parseDiscordTarget(raw, options);
@@ -0,0 +1,3 @@
1
+ import "./send.receipt-Bo_43DQZ.js";
2
+ import "./target-resolver-DVpZI7ZL.js";
3
+ export {};
@@ -1,9 +1,9 @@
1
- import { Ht as parseDiscordTarget, Wt as __exportAll } from "./send.receipt-BzfsP3Bb.js";
2
- import "./targets-BBVHRaeO.js";
1
+ import { Ht as parseDiscordTarget, Wt as __exportAll } from "./send.receipt-Bo_43DQZ.js";
2
+ import "./targets-0WHF7kV0.js";
3
3
  import { C as resolveThreadBindingMaxAgeMs$1, O as shouldPersistBindingMutations, S as resolveThreadBindingMaxAgeExpiresAt, T as saveBindingsToDisk, b as resolveThreadBindingIdleTimeoutMs$1, c as getThreadBindingToken, f as normalizeThreadId, g as removeBindingRecord, l as isRecentlyUnboundThreadWebhookMessage, n as MANAGERS_BY_ACCOUNT_ID, p as rememberRecentUnboundWebhookEcho, t as BINDINGS_BY_THREAD_ID, x as resolveThreadBindingInactivityExpiresAt } from "./thread-bindings.state-BsOnj5NX.js";
4
4
  import { n as setThreadBindingMaxAgeBySessionKey, r as resolveBindingIdsForTargetSession, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-D5gY2ZTE.js";
5
- import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, s as resolveChannelIdForBinding, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-irWYI8YX.js";
6
- import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-LoYZzlss.js";
5
+ import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, s as resolveChannelIdForBinding, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-JrJXT7L0.js";
6
+ import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-DqJuGG-r.js";
7
7
  import { normalizeOptionalLowercaseString, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
8
8
  import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
9
9
  import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
@@ -1,7 +1,7 @@
1
- import { Ut as resolveDiscordChannelId, pt as getChannel, tt as createChannelWebhook } from "./send.receipt-BzfsP3Bb.js";
2
- import { I as createDiscordRestClient } from "./send.shared-ehnDGwXx.js";
3
- import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-BzXZ8iUI.js";
4
- import { t as sendMessageDiscord } from "./send.outbound-ZrMnBa8C.js";
1
+ import { Ut as resolveDiscordChannelId, pt as getChannel, tt as createChannelWebhook } from "./send.receipt-Bo_43DQZ.js";
2
+ import { I as createDiscordRestClient } from "./send.shared-CXctTF1I.js";
3
+ import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-3r8QQkTY.js";
4
+ import { t as sendMessageDiscord } from "./send.outbound-LjX_KYiO.js";
5
5
  import { i as REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL, k as toReusableWebhookKey, m as rememberReusableWebhook, t as BINDINGS_BY_THREAD_ID } from "./thread-bindings.state-BsOnj5NX.js";
6
6
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import { ChannelType } from "discord-api-types/v10";
@@ -1,7 +1,7 @@
1
- import { Ut as resolveDiscordChannelId, Wt as __exportAll, pt as getChannel } from "./send.receipt-BzfsP3Bb.js";
2
- import { I as createDiscordRestClient } from "./send.shared-ehnDGwXx.js";
1
+ import { Ut as resolveDiscordChannelId, Wt as __exportAll, pt as getChannel } from "./send.receipt-Bo_43DQZ.js";
2
+ import { I as createDiscordRestClient } from "./send.shared-CXctTF1I.js";
3
3
  import { A as DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS, C as resolveThreadBindingMaxAgeMs$1, D as shouldDefaultPersist, E as setBindingRecord, M as THREAD_BINDINGS_SWEEP_INTERVAL_MS, S as resolveThreadBindingMaxAgeExpiresAt, T as saveBindingsToDisk, _ as resetThreadBindingsForTests, a as THREAD_BINDING_TOUCH_PERSIST_MIN_INTERVAL_MS, b as resolveThreadBindingIdleTimeoutMs$1, c as getThreadBindingToken, d as normalizeThreadBindingDurationMs, f as normalizeThreadId, g as removeBindingRecord, h as rememberThreadBindingToken, n as MANAGERS_BY_ACCOUNT_ID, o as ensureBindingsLoaded, p as rememberRecentUnboundWebhookEcho, r as PERSIST_BY_ACCOUNT_ID, s as forgetThreadBindingToken, t as BINDINGS_BY_THREAD_ID, u as normalizeTargetKind, v as resolveBindingIdsForSession, w as resolveThreadBindingsPath, x as resolveThreadBindingInactivityExpiresAt, y as resolveBindingRecordKey } from "./thread-bindings.state-BsOnj5NX.js";
4
- import { a as isThreadArchived, b as resolveThreadBindingThreadName, c as summarizeDiscordError, i as isDiscordThreadGoneError, n as createWebhookForChannel, o as maybeSendBindingMessage, r as findReusableWebhook, s as resolveChannelIdForBinding, t as createThreadForBinding, v as resolveThreadBindingFarewellText } from "./thread-bindings.discord-api-irWYI8YX.js";
4
+ import { a as isThreadArchived, b as resolveThreadBindingThreadName, c as summarizeDiscordError, i as isDiscordThreadGoneError, n as createWebhookForChannel, o as maybeSendBindingMessage, r as findReusableWebhook, s as resolveChannelIdForBinding, t as createThreadForBinding, v as resolveThreadBindingFarewellText } from "./thread-bindings.discord-api-JrJXT7L0.js";
5
5
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { normalizeAccountId, resolveAgentIdFromSessionKey } from "openclaw/plugin-sdk/routing";
7
7
  import { getRuntimeConfigSnapshot } from "openclaw/plugin-sdk/runtime-config-snapshot";
@@ -1,2 +1,2 @@
1
- import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-CwahHAYt.js";
1
+ import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-lEfSvSRD.js";
2
2
  export { discordVoiceTranscriptsSourceProvider };
@@ -1,4 +1,4 @@
1
- import { Wt as __exportAll } from "./send.receipt-BzfsP3Bb.js";
1
+ import { Wt as __exportAll } from "./send.receipt-Bo_43DQZ.js";
2
2
  //#region extensions/discord/src/voice/transcripts-source.ts
3
3
  var transcripts_source_exports = /* @__PURE__ */ __exportAll({
4
4
  discordVoiceTranscriptsSourceProvider: () => discordVoiceTranscriptsSourceProvider,
@@ -1,4 +1,4 @@
1
- import { Wt as __exportAll, bt as sendChannelTyping } from "./send.receipt-BzfsP3Bb.js";
1
+ import { Wt as __exportAll, bt as sendChannelTyping } from "./send.receipt-Bo_43DQZ.js";
2
2
  import { o as raceWithTimeout } from "./timeouts-l_PsHQvX.js";
3
3
  //#region extensions/discord/src/monitor/typing.ts
4
4
  var typing_exports = /* @__PURE__ */ __exportAll({ sendTyping: () => sendTyping });
@@ -1,23 +1,22 @@
1
1
  {
2
2
  "name": "@openclaw/discord",
3
- "version": "2026.5.27",
3
+ "version": "2026.5.28-beta.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/discord",
9
- "version": "2026.5.27",
9
+ "version": "2026.5.28-beta.2",
10
10
  "dependencies": {
11
11
  "@discordjs/voice": "0.19.2",
12
12
  "discord-api-types": "0.38.48",
13
- "https-proxy-agent": "9.0.0",
14
13
  "libopus-wasm": "0.1.0",
15
14
  "typebox": "1.1.38",
16
15
  "undici": "8.3.0",
17
16
  "ws": "8.21.0"
18
17
  },
19
18
  "peerDependencies": {
20
- "openclaw": ">=2026.5.27"
19
+ "openclaw": ">=2026.5.28-beta.2"
21
20
  },
22
21
  "peerDependenciesMeta": {
23
22
  "openclaw": {
@@ -374,32 +373,6 @@
374
373
  "@types/node": "*"
375
374
  }
376
375
  },
377
- "node_modules/agent-base": {
378
- "version": "9.0.0",
379
- "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-9.0.0.tgz",
380
- "integrity": "sha512-TQf59BsZnytt8GdJKLPfUZ54g/iaUL2OWDSFCCvMOhsHduDQxO8xC4PNeyIkVcA5KwL2phPSv0douC0fgWzmnA==",
381
- "license": "MIT",
382
- "engines": {
383
- "node": ">= 20"
384
- }
385
- },
386
- "node_modules/debug": {
387
- "version": "4.4.3",
388
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
389
- "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
390
- "license": "MIT",
391
- "dependencies": {
392
- "ms": "^2.1.3"
393
- },
394
- "engines": {
395
- "node": ">=6.0"
396
- },
397
- "peerDependenciesMeta": {
398
- "supports-color": {
399
- "optional": true
400
- }
401
- }
402
- },
403
376
  "node_modules/discord-api-types": {
404
377
  "version": "0.38.48",
405
378
  "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.38.48.tgz",
@@ -409,19 +382,6 @@
409
382
  "scripts/actions/documentation"
410
383
  ]
411
384
  },
412
- "node_modules/https-proxy-agent": {
413
- "version": "9.0.0",
414
- "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-9.0.0.tgz",
415
- "integrity": "sha512-/MVmHp58WkOypgFhCLk4fzpPcFQvTJ/e6LBI7irpIO2HfxUbpmYoHF+KzipzJpxxzJu7aJNWQ0xojJ/dzV2G5g==",
416
- "license": "MIT",
417
- "dependencies": {
418
- "agent-base": "9.0.0",
419
- "debug": "^4.3.4"
420
- },
421
- "engines": {
422
- "node": ">= 20"
423
- }
424
- },
425
385
  "node_modules/libopus-wasm": {
426
386
  "version": "0.1.0",
427
387
  "resolved": "https://registry.npmjs.org/libopus-wasm/-/libopus-wasm-0.1.0.tgz",
@@ -431,12 +391,6 @@
431
391
  "node": ">=20"
432
392
  }
433
393
  },
434
- "node_modules/ms": {
435
- "version": "2.1.3",
436
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
437
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
438
- "license": "MIT"
439
- },
440
394
  "node_modules/prism-media": {
441
395
  "version": "1.3.5",
442
396
  "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.5.tgz",