@openclaw/discord 2026.5.31-beta.2 → 2026.5.31-beta.4

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 (69) hide show
  1. package/dist/action-runtime-api.js +1 -1
  2. package/dist/{allow-list-BnkWtVpA.js → allow-list-C-MqM-B_.js} +1 -1
  3. package/dist/api.js +12 -12
  4. package/dist/{approval-handler.runtime-DSFfzXpo.js → approval-handler.runtime-DQiJ1Z0k.js} +3 -3
  5. package/dist/{audit-kgIklCyI.js → audit-eI8e8RpG.js} +3 -3
  6. package/dist/{channel-D0gX0yj6.js → channel-W1HBHzdw.js} +20 -20
  7. package/dist/{channel-actions-DDoc4V7x.js → channel-actions-BaPDAWN_.js} +2 -2
  8. package/dist/{channel-actions.runtime-CqZfnMaA.js → channel-actions.runtime-BEMDJjP1.js} +5 -5
  9. package/dist/channel-plugin-api.js +1 -1
  10. package/dist/{channel.setup-BNZm3eed.js → channel.setup-BX7g7pL-.js} +3 -3
  11. package/dist/{components-DcLQ2JkV.js → components-CCbYVuVr.js} +66 -27
  12. package/dist/contract-api.js +3 -3
  13. package/dist/{conversation-identity-BURFgcfI.js → conversation-identity-CEP1KbK0.js} +2 -2
  14. package/dist/{directory-config-B9Jw1Q2R.js → directory-config-j1bfTue_.js} +1 -1
  15. package/dist/directory-contract-api.js +1 -1
  16. package/dist/{directory-live-CDWUg-nA.js → directory-live-BjBs64RV.js} +2 -2
  17. package/dist/{doctor-BUhqxLb9.js → doctor-D3ngpo-Y.js} +2 -2
  18. package/dist/{doctor-contract-BAu3WLvd.js → doctor-contract-CU7lnZTF.js} +2 -2
  19. package/dist/doctor-contract-api.js +1 -1
  20. package/dist/{handle-action.guild-admin-Dpa-kUzu.js → handle-action.guild-admin-CqUsOA2L.js} +3 -3
  21. package/dist/index.js +1 -1
  22. package/dist/legacy-state-migrations-api.js +39 -6
  23. package/dist/{manager.runtime-BWBENHRA.js → manager.runtime-CVB9_dwq.js} +51 -45
  24. package/dist/{message-handler-HO8BbZmQ.js → message-handler-CQGpWQ0f.js} +6 -6
  25. package/dist/{message-handler.preflight-DxHBPQvD.js → message-handler.preflight-B9aZ9jQD.js} +14 -14
  26. package/dist/{message-handler.process-Cq3j7A9k.js → message-handler.process-DrLZOgzG.js} +18 -17
  27. package/dist/{message-utils-D_3KTxh_.js → message-utils-ZTGvA2L8.js} +1 -3
  28. package/dist/{outbound-adapter-BkPkILpq.js → outbound-adapter-Bt6-9M13.js} +6 -6
  29. package/dist/{pluralkit-Ds9aZAM4.js → pluralkit-BEEldePl.js} +1 -1
  30. package/dist/{provider-BK8hjk_y.js → provider-BTp6enEl.js} +53 -96
  31. package/dist/{provider-session.runtime-CYMFlLg9.js → provider-session.runtime-CC2f_W1j.js} +3 -3
  32. package/dist/provider.runtime-DUQJvWin.js +2 -0
  33. package/dist/{resolve-allowlist-common-BIf3417N.js → resolve-allowlist-common-B3p7cT8F.js} +1 -1
  34. package/dist/{resolve-channels-DK-3f_aA.js → resolve-channels-DLNfxFQP.js} +3 -3
  35. package/dist/{resolve-users-DUDPsfWt.js → resolve-users-QTyD8qgI.js} +2 -2
  36. package/dist/{runtime-Blf_d9E7.js → runtime-Dds0Ww1n.js} +8 -8
  37. package/dist/runtime-api.actions.js +2 -2
  38. package/dist/runtime-api.js +21 -21
  39. package/dist/runtime-api.lookup.js +4 -4
  40. package/dist/runtime-api.monitor-BkA-vJZA.js +6 -0
  41. package/dist/runtime-api.monitor.js +5 -5
  42. package/dist/runtime-api.send.js +5 -5
  43. package/dist/runtime-api.threads.js +5 -5
  44. package/dist/{send-BHkA8a-k.js → send-CyyRF1yd.js} +3 -3
  45. package/dist/{send.components-CUHzDapa.js → send.components-a9JQeeH5.js} +4 -4
  46. package/dist/{send.outbound-DSKZbjML.js → send.outbound-DhMLobqR.js} +3 -3
  47. package/dist/{send.receipt-CjsWpitW.js → send.receipt-Z8V6yMOY.js} +38 -11
  48. package/dist/{send.shared-Cluujl6W.js → send.shared-B3QxPnR3.js} +5 -5
  49. package/dist/{sender-identity-BFp5w0F8.js → sender-identity-CEsfDF0L.js} +1 -1
  50. package/dist/setup-plugin-api.js +1 -1
  51. package/dist/{shared-BMGLQw74.js → shared-D11J9bXI.js} +2 -2
  52. package/dist/subagent-hooks-api.js +1 -1
  53. package/dist/{subagent-hooks-7jAn9HT5.js → subagent-hooks-nBcp0iGm.js} +2 -2
  54. package/dist/{system-events-BjuNA9Zs.js → system-events-NnSID6Q5.js} +2 -2
  55. package/dist/{target-resolver-BYuWNVQp.js → target-resolver-BKGK0ftO.js} +2 -2
  56. package/dist/targets-Cv797U29.js +3 -0
  57. package/dist/{thread-bindings-CKruJE91.js → thread-bindings-Tfr_vFxk.js} +6 -6
  58. package/dist/{thread-bindings.discord-api-BjLUwwSP.js → thread-bindings.discord-api-CfDs1lWu.js} +5 -5
  59. package/dist/{thread-bindings.manager-Dji7SZHG.js → thread-bindings.manager-CRc4hYr1.js} +20 -21
  60. package/dist/{thread-bindings.session-updates-DoDFvU_h.js → thread-bindings.session-updates-DeMxmcXB.js} +1 -1
  61. package/dist/{thread-bindings.state-DYp4FVEB.js → thread-bindings.state-CVLF7gJH.js} +48 -22
  62. package/dist/{transcripts-source-O73_YIDs.js → transcripts-source-Cegx0wdw.js} +1 -1
  63. package/dist/transcripts-source-api.js +1 -1
  64. package/dist/{typing-CKW0i8du.js → typing-C7RXECnL.js} +1 -1
  65. package/npm-shrinkwrap.json +3 -3
  66. package/package.json +4 -4
  67. package/dist/provider.runtime-RfQSSM_v.js +0 -2
  68. package/dist/runtime-api.monitor-LVbgPRHA.js +0 -6
  69. package/dist/targets-BNDUOdvI.js +0 -3
@@ -1,2 +1,2 @@
1
- import { t as handleDiscordAction } from "./runtime-Blf_d9E7.js";
1
+ import { t as handleDiscordAction } from "./runtime-Dds0Ww1n.js";
2
2
  export { handleDiscordAction };
@@ -43,7 +43,7 @@ function normalizeDiscordAllowList(raw, prefixes) {
43
43
  ids.add(maybeId);
44
44
  continue;
45
45
  }
46
- const prefix = prefixes.find((entry) => text.startsWith(entry));
46
+ const prefix = prefixes.find((entryLocal) => text.startsWith(entryLocal));
47
47
  if (prefix) {
48
48
  const candidate = text.slice(prefix.length);
49
49
  if (candidate) ids.add(candidate);
package/dist/api.js CHANGED
@@ -1,23 +1,23 @@
1
- import { Ht as parseDiscordTarget, Ut as resolveDiscordChannelId, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId, o as normalizeDiscordOutboundTarget } from "./send.receipt-CjsWpitW.js";
1
+ import { Ht as parseDiscordTarget, Ut as resolveDiscordChannelId, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId, o as normalizeDiscordOutboundTarget } from "./send.receipt-Z8V6yMOY.js";
2
2
  import { t as inspectDiscordAccount } from "./account-inspect-DDZtT5C8.js";
3
3
  import { a as mergeDiscordAccountConfig, f as resolveDiscordMaxLinesPerMessage, i as listEnabledDiscordAccounts, l as resolveDiscordAccountConfig, o as resolveDefaultDiscordAccountId, r as listDiscordAccountIds, s as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-P19jm1lf.js";
4
- import { _ as parseDiscordComponentCustomId, b as parseDiscordModalCustomIdForInteraction, c as buildDiscordComponentMessage, d as readDiscordComponentSpec, f as resolveDiscordComponentAttachmentName, g as buildDiscordModalCustomId, h as buildDiscordComponentCustomId, l as buildDiscordComponentMessageFlags, m as DISCORD_MODAL_CUSTOM_ID_KEY, n as formatDiscordComponentEventText, o as DiscordFormModal, p as DISCORD_COMPONENT_CUSTOM_ID_KEY, r as buildDiscordInteractiveComponents, s as createDiscordFormModal, u as DISCORD_COMPONENT_ATTACHMENT_PREFIX, v as parseDiscordComponentCustomIdForInteraction, y as parseDiscordModalCustomId } from "./components-DcLQ2JkV.js";
4
+ import { _ as parseDiscordComponentCustomId, b as parseDiscordModalCustomIdForInteraction, c as buildDiscordComponentMessage, d as readDiscordComponentSpec, f as resolveDiscordComponentAttachmentName, g as buildDiscordModalCustomId, h as buildDiscordComponentCustomId, l as buildDiscordComponentMessageFlags, m as DISCORD_MODAL_CUSTOM_ID_KEY, n as formatDiscordComponentEventText, o as DiscordFormModal, p as DISCORD_COMPONENT_CUSTOM_ID_KEY, r as buildDiscordInteractiveComponents, s as createDiscordFormModal, u as DISCORD_COMPONENT_ATTACHMENT_PREFIX, v as parseDiscordComponentCustomIdForInteraction, y as parseDiscordModalCustomId } from "./components-CCbYVuVr.js";
5
5
  import { n as fetchDiscord, r as requestDiscord, t as DiscordApiError } from "./api-BmXlcjYW.js";
6
- import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-BYuWNVQp.js";
7
- import "./targets-BNDUOdvI.js";
8
- import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, o as isDiscordExecApprovalApprover, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-BURFgcfI.js";
9
- import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-D0gX0yj6.js";
6
+ import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-BKGK0ftO.js";
7
+ import "./targets-Cv797U29.js";
8
+ import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, o as isDiscordExecApprovalApprover, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-CEP1KbK0.js";
9
+ import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-W1HBHzdw.js";
10
10
  import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
11
- import { t as discordSetupPlugin } from "./channel.setup-BNZm3eed.js";
12
- import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-7jAn9HT5.js";
13
- import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-Dpa-kUzu.js";
14
- import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-B9Jw1Q2R.js";
15
- import { t as fetchPluralKitMessageInfo } from "./pluralkit-Ds9aZAM4.js";
11
+ import { t as discordSetupPlugin } from "./channel.setup-BX7g7pL-.js";
12
+ import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-nBcp0iGm.js";
13
+ import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-CqUsOA2L.js";
14
+ import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-j1bfTue_.js";
15
+ import { t as fetchPluralKitMessageInfo } from "./pluralkit-BEEldePl.js";
16
16
  import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-2MdGjUAf.js";
17
17
  import { t as collectDiscordSecurityAuditFindings } from "./security-audit-Bh_65L5C.js";
18
18
  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-CEJ3--Uw.js";
19
19
  import { resolveOpenProviderRuntimeGroupPolicy as resolveDiscordRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
20
20
  //#region extensions/discord/api.ts
21
- const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-CqZfnMaA.js")).handleDiscordMessageAction(...args);
21
+ const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-BEMDJjP1.js")).handleDiscordMessageAction(...args);
22
22
  //#endregion
23
23
  export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_COMPONENT_ATTACHMENT_PREFIX, DISCORD_COMPONENT_CUSTOM_ID_KEY, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, DISCORD_MODAL_CUSTOM_ID_KEY, DiscordApiError, DiscordFormModal, buildDiscordComponentCustomId, buildDiscordComponentMessage, buildDiscordComponentMessageFlags, buildDiscordInteractiveComponents, buildDiscordModalCustomId, collectDiscordSecurityAuditFindings, collectDiscordStatusIssues, createDiscordActionGate, createDiscordFormModal, discordPlugin, discordSetupPlugin, fetchDiscord, fetchDiscordApplicationId, fetchDiscordApplicationSummary, fetchPluralKitMessageInfo, formatDiscordComponentEventText, getDiscordExecApprovalApprovers, handleDiscordMessageAction, handleDiscordSubagentDeliveryTarget, handleDiscordSubagentEnded, handleDiscordSubagentSpawning, inspectDiscordAccount, isDiscordExecApprovalApprover, isDiscordExecApprovalClientEnabled, listDiscordAccountIds, listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig, listEnabledDiscordAccounts, looksLikeDiscordTargetId, mergeAbortSignals, mergeDiscordAccountConfig, normalizeDiscordMessagingTarget, normalizeDiscordOutboundTarget, normalizeExplicitDiscordSessionKey, parseApplicationIdFromToken, parseDiscordComponentCustomId, parseDiscordComponentCustomIdForInteraction as parseDiscordComponentCustomIdForCarbon, parseDiscordComponentCustomIdForInteraction, parseDiscordModalCustomId, parseDiscordModalCustomIdForInteraction as parseDiscordModalCustomIdForCarbon, parseDiscordModalCustomIdForInteraction, parseDiscordSendTarget, parseDiscordTarget, probeDiscord, readDiscordComponentSpec, requestDiscord, resolveDefaultDiscordAccountId, resolveDiscordAccount, resolveDiscordAccountConfig, resolveDiscordChannelId, resolveDiscordComponentAttachmentName, resolveDiscordGroupRequireMention, resolveDiscordGroupToolPolicy, resolveDiscordMaxLinesPerMessage, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordRuntimeGroupPolicy, resolveDiscordTarget, shouldSuppressLocalDiscordExecApprovalPrompt, tryHandleDiscordMessageActionGuildAdmin };
@@ -1,7 +1,7 @@
1
- import { B as Container, J as Separator, K as Row, R as Button, Wt as __exportAll, X as TextDisplay, ft as editChannelMessage, j as serializePayload, nt as createUserDmChannel, st as createChannelMessage, ut as deleteChannelMessage } from "./send.receipt-CjsWpitW.js";
1
+ import { B as Container, J as Separator, K as Row, R as Button, Wt as __exportAll, X as TextDisplay, ft as editChannelMessage, j as serializePayload, nt as createUserDmChannel, st as createChannelMessage, ut as deleteChannelMessage } from "./send.receipt-Z8V6yMOY.js";
2
2
  import { t as inspectDiscordAccount } from "./account-inspect-DDZtT5C8.js";
3
- import { F as createDiscordClient, b as stripUndefinedFields } from "./send.shared-Cluujl6W.js";
4
- import { i as shouldHandleDiscordApprovalRequest, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-BURFgcfI.js";
3
+ import { F as createDiscordClient, b as stripUndefinedFields } from "./send.shared-B3QxPnR3.js";
4
+ import { i as shouldHandleDiscordApprovalRequest, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-CEP1KbK0.js";
5
5
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { ButtonStyle } from "discord-api-types/v10";
7
7
  import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
@@ -1,7 +1,7 @@
1
- import { Wt as __exportAll } from "./send.receipt-CjsWpitW.js";
1
+ import { Wt as __exportAll } from "./send.receipt-Z8V6yMOY.js";
2
2
  import { t as inspectDiscordAccount } from "./account-inspect-DDZtT5C8.js";
3
- import { O as fetchChannelPermissionsDiscord } from "./send.shared-Cluujl6W.js";
4
- import "./send-BHkA8a-k.js";
3
+ import { O as fetchChannelPermissionsDiscord } from "./send.shared-B3QxPnR3.js";
4
+ import "./send-CyyRF1yd.js";
5
5
  import { n as collectDiscordAuditChannelIdsForAccount, t as auditDiscordChannelPermissionsWithFetcher } from "./audit-core-xwjIczO0.js";
6
6
  //#region extensions/discord/src/audit.ts
7
7
  var audit_exports = /* @__PURE__ */ __exportAll({
@@ -1,14 +1,14 @@
1
- import { Ht as parseDiscordTarget, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId } from "./send.receipt-CjsWpitW.js";
1
+ import { Ht as parseDiscordTarget, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId } from "./send.receipt-Z8V6yMOY.js";
2
2
  import { c as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
3
3
  import { a as projectCredentialSnapshotFields, n as PAIRING_APPROVED_MESSAGE, o as resolveConfiguredFromCredentialStatuses, r as buildTokenChannelStatusSummary, t as DEFAULT_ACCOUNT_ID } from "./channel-api-CAJ0wMoV.js";
4
- import { x as resolveDiscordOutboundSessionRoute } from "./components-DcLQ2JkV.js";
4
+ import { x as resolveDiscordOutboundSessionRoute } from "./components-CCbYVuVr.js";
5
5
  import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
6
- import { c as shouldSuppressLocalDiscordExecApprovalPrompt, n as resolveDiscordCurrentConversationIdentity, r as getDiscordApprovalCapability } from "./conversation-identity-BURFgcfI.js";
6
+ import { c as shouldSuppressLocalDiscordExecApprovalPrompt, n as resolveDiscordCurrentConversationIdentity, r as getDiscordApprovalCapability } from "./conversation-identity-CEP1KbK0.js";
7
7
  import { r as resolveRequiredDiscordChannelPermissions } from "./audit-core-xwjIczO0.js";
8
- import { t as discordMessageActions$1 } from "./channel-actions-DDoc4V7x.js";
9
- import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DoDFvU_h.js";
10
- import { n as discordOutbound } from "./outbound-adapter-BkPkILpq.js";
11
- import { a as discordSecurityAdapter, i as discordSetupAdapter, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-BMGLQw74.js";
8
+ import { t as discordMessageActions$1 } from "./channel-actions-BaPDAWN_.js";
9
+ import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DeMxmcXB.js";
10
+ import { n as discordOutbound } from "./outbound-adapter-Bt6-9M13.js";
11
+ import { a as discordSecurityAdapter, i as discordSetupAdapter, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-D11J9bXI.js";
12
12
  import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
13
13
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
14
14
  import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
@@ -125,13 +125,13 @@ let discordProbeRuntimePromise;
125
125
  let discordAuditModulePromise;
126
126
  let discordSendModulePromise;
127
127
  let discordDirectoryLiveModulePromise;
128
- const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-B9Jw1Q2R.js").then((n) => n.t));
129
- const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-DK-3f_aA.js").then((n) => n.n));
130
- const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-DUDPsfWt.js").then((n) => n.n));
131
- const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-Dji7SZHG.js").then((n) => n.a));
132
- const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-BYuWNVQp.js").then((n) => n.r));
128
+ const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-j1bfTue_.js").then((n) => n.t));
129
+ const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-DLNfxFQP.js").then((n) => n.n));
130
+ const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-QTyD8qgI.js").then((n) => n.n));
131
+ const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-CRc4hYr1.js").then((n) => n.a));
132
+ const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-BKGK0ftO.js").then((n) => n.r));
133
133
  async function loadDiscordProviderRuntime() {
134
- discordProviderRuntimePromise ??= import("./provider.runtime-RfQSSM_v.js");
134
+ discordProviderRuntimePromise ??= import("./provider.runtime-DUQJvWin.js");
135
135
  return await discordProviderRuntimePromise;
136
136
  }
137
137
  async function loadDiscordProbeRuntime() {
@@ -139,15 +139,15 @@ async function loadDiscordProbeRuntime() {
139
139
  return await discordProbeRuntimePromise;
140
140
  }
141
141
  async function loadDiscordAuditModule() {
142
- discordAuditModulePromise ??= import("./audit-kgIklCyI.js").then((n) => n.n);
142
+ discordAuditModulePromise ??= import("./audit-eI8e8RpG.js").then((n) => n.n);
143
143
  return await discordAuditModulePromise;
144
144
  }
145
145
  async function loadDiscordSendModule() {
146
- discordSendModulePromise ??= import("./send-BHkA8a-k.js").then((n) => n.t);
146
+ discordSendModulePromise ??= import("./send-CyyRF1yd.js").then((n) => n.t);
147
147
  return await discordSendModulePromise;
148
148
  }
149
149
  async function loadDiscordDirectoryLiveModule() {
150
- discordDirectoryLiveModulePromise ??= import("./directory-live-CDWUg-nA.js").then((n) => n.t);
150
+ discordDirectoryLiveModulePromise ??= import("./directory-live-BjBs64RV.js").then((n) => n.t);
151
151
  return await discordDirectoryLiveModulePromise;
152
152
  }
153
153
  //#endregion
@@ -512,9 +512,9 @@ const discordPlugin = createChatChannelPlugin({
512
512
  token: account.token,
513
513
  inputs,
514
514
  missingTokenNote: "missing Discord token",
515
- resolveWithToken: async ({ token, inputs }) => (await loadDiscordResolveChannelsModule()).resolveDiscordChannelAllowlist({
515
+ resolveWithToken: async ({ token, inputs: inputsValue }) => (await loadDiscordResolveChannelsModule()).resolveDiscordChannelAllowlist({
516
516
  token,
517
- entries: inputs
517
+ entries: inputsValue
518
518
  }),
519
519
  mapResolved: (entry) => ({
520
520
  input: entry.input,
@@ -528,9 +528,9 @@ const discordPlugin = createChatChannelPlugin({
528
528
  token: account.token,
529
529
  inputs,
530
530
  missingTokenNote: "missing Discord token",
531
- resolveWithToken: async ({ token, inputs }) => (await loadDiscordResolveUsersModule()).resolveDiscordUserAllowlist({
531
+ resolveWithToken: async ({ token, inputs: inputsLocal }) => (await loadDiscordResolveUsersModule()).resolveDiscordUserAllowlist({
532
532
  token,
533
- entries: inputs
533
+ entries: inputsLocal
534
534
  }),
535
535
  mapResolved: (entry) => ({
536
536
  input: entry.input,
@@ -1,6 +1,6 @@
1
1
  import { t as inspectDiscordAccount } from "./account-inspect-DDZtT5C8.js";
2
2
  import { r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-P19jm1lf.js";
3
- import { d as readDiscordComponentSpec } from "./components-DcLQ2JkV.js";
3
+ import { d as readDiscordComponentSpec } from "./components-CCbYVuVr.js";
4
4
  import { i as withDiscordInboundEventDeliveryMetadata } from "./inbound-event-delivery-CEPlt2uz.js";
5
5
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { createUnionActionGate } from "openclaw/plugin-sdk/channel-actions";
@@ -34,7 +34,7 @@ function resolveDiscordActionExecutionMode({ action }) {
34
34
  }
35
35
  let discordChannelActionsRuntimePromise;
36
36
  async function loadDiscordChannelActionsRuntime() {
37
- discordChannelActionsRuntimePromise ??= import("./channel-actions.runtime-CqZfnMaA.js");
37
+ discordChannelActionsRuntimePromise ??= import("./channel-actions.runtime-BEMDJjP1.js");
38
38
  return await discordChannelActionsRuntimePromise;
39
39
  }
40
40
  function listDiscoverableDiscordAccounts(cfg) {
@@ -1,10 +1,10 @@
1
- import { Ut as resolveDiscordChannelId } from "./send.receipt-CjsWpitW.js";
2
- import { i as buildDiscordPresentationComponents, r as buildDiscordInteractiveComponents } from "./components-DcLQ2JkV.js";
3
- import { t as handleDiscordAction } from "./runtime-Blf_d9E7.js";
4
- import "./targets-BNDUOdvI.js";
1
+ import { Ut as resolveDiscordChannelId } from "./send.receipt-Z8V6yMOY.js";
2
+ import { i as buildDiscordPresentationComponents, r as buildDiscordInteractiveComponents } from "./components-CCbYVuVr.js";
3
+ import { t as handleDiscordAction } from "./runtime-Dds0Ww1n.js";
4
+ import "./targets-Cv797U29.js";
5
5
  import "./action-runtime-api.js";
6
6
  import { r as notifyDiscordInboundEventOutboundSuccess } from "./inbound-event-delivery-CEPlt2uz.js";
7
- import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-Dpa-kUzu.js";
7
+ import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-CqUsOA2L.js";
8
8
  import { normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
9
9
  import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
10
10
  import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
@@ -1,2 +1,2 @@
1
- import { t as discordPlugin } from "./channel-D0gX0yj6.js";
1
+ import { t as discordPlugin } from "./channel-W1HBHzdw.js";
2
2
  export { discordPlugin };
@@ -1,8 +1,8 @@
1
1
  import { n as inspectDiscordConfiguredToken } from "./account-inspect-DDZtT5C8.js";
2
2
  import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, l as resolveDiscordAccountConfig, m as resolveDiscordToken, o as resolveDefaultDiscordAccountId } from "./accounts-P19jm1lf.js";
3
- import { i as discordSetupAdapter, t as createDiscordPluginBase } from "./shared-BMGLQw74.js";
4
- import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-DK-3f_aA.js";
5
- import { t as resolveDiscordUserAllowlist } from "./resolve-users-DUDPsfWt.js";
3
+ import { i as discordSetupAdapter, t as createDiscordPluginBase } from "./shared-D11J9bXI.js";
4
+ import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-DLNfxFQP.js";
5
+ import { t as resolveDiscordUserAllowlist } from "./resolve-users-QTyD8qgI.js";
6
6
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
7
7
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
8
8
  import { createAccountScopedAllowFromSection, createAccountScopedGroupAccessSection, createLegacyCompatChannelDmPolicy, createSetupTranslator, createStandardChannelSetupStatus, parseMentionOrPrefixedId, patchChannelConfigForAccount, promptLegacyChannelAllowFromForAccount, resolveEntriesWithOptionalToken, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup-runtime";
@@ -1,10 +1,10 @@
1
- import { B as Container, F as Modal, G as RoleSelectMenu, H as LinkButton, Ht as parseDiscordTarget, I as RadioGroup, J as Separator, K as Row, L as TextInput, N as CheckboxGroup, P as Label, Q as UserSelectMenu, R as Button, U as MediaGallery, V as File, W as MentionableSelectMenu, Wt as __exportAll, X as TextDisplay, Y as StringSelectMenu, Z as Thumbnail, et as parseCustomId, q as Section, z as ChannelSelectMenu } from "./send.receipt-CjsWpitW.js";
1
+ import { B as Container, F as Modal, G as RoleSelectMenu, H as LinkButton, Ht as parseDiscordTarget, I as RadioGroup, J as Separator, K as Row, L as TextInput, N as CheckboxGroup, P as Label, Q as UserSelectMenu, R as Button, U as MediaGallery, V as File, W as MentionableSelectMenu, Wt as __exportAll, X as TextDisplay, Y as StringSelectMenu, Z as Thumbnail, et as parseCustomId, q as Section, z as ChannelSelectMenu } from "./send.receipt-Z8V6yMOY.js";
2
2
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { buildOutboundBaseSessionKey } from "openclaw/plugin-sdk/routing";
4
4
  import { buildThreadAwareOutboundSessionRoute } from "openclaw/plugin-sdk/channel-core";
5
5
  import { ButtonStyle, MessageFlags, TextInputStyle } from "discord-api-types/v10";
6
6
  import crypto from "node:crypto";
7
- import { reduceInteractiveReply } from "openclaw/plugin-sdk/interactive-runtime";
7
+ import { reduceInteractiveReply, resolveMessagePresentationControlValue } from "openclaw/plugin-sdk/interactive-runtime";
8
8
  //#region extensions/discord/src/outbound-session-route.ts
9
9
  function resolveDiscordOutboundSessionRoute(params) {
10
10
  const parsed = parseDiscordTarget(params.target, { defaultKind: resolveDiscordOutboundTargetKindHint(params) });
@@ -138,6 +138,12 @@ function readOptionalString(value) {
138
138
  const trimmed = value.trim();
139
139
  return trimmed ? trimmed : void 0;
140
140
  }
141
+ function readOptionalCallbackDataKind(value, label) {
142
+ const kind = readOptionalString(value);
143
+ if (kind === void 0) return;
144
+ if (kind === "command" || kind === "callback") return kind;
145
+ throw new Error(`${label} must be one of command, callback`);
146
+ }
141
147
  function readOptionalStringArray(value, label) {
142
148
  if (value === void 0) return;
143
149
  if (!Array.isArray(value)) throw new Error(`${label} must be an array`);
@@ -219,6 +225,7 @@ function parseButtonSpec(raw, label) {
219
225
  style,
220
226
  url,
221
227
  callbackData: readOptionalString(obj.callbackData),
228
+ callbackDataKind: readOptionalCallbackDataKind(obj.callbackDataKind, `${label}.callbackDataKind`),
222
229
  emoji: readOptionalEmoji(obj.emoji, `${label}.emoji`),
223
230
  disabled: typeof obj.disabled === "boolean" ? obj.disabled : void 0,
224
231
  allowedUsers: readOptionalStringArray(obj.allowedUsers, `${label}.allowedUsers`)
@@ -238,6 +245,7 @@ function parseSelectSpec(raw, label) {
238
245
  return {
239
246
  type,
240
247
  callbackData: readOptionalString(obj.callbackData),
248
+ callbackDataKind: readOptionalCallbackDataKind(obj.callbackDataKind, `${label}.callbackDataKind`),
241
249
  placeholder: readOptionalString(obj.placeholder),
242
250
  minValues: readOptionalInteger(obj.minValues, `${label}.minValues`, {
243
251
  min: 0,
@@ -463,6 +471,7 @@ function createButtonComponent(params) {
463
471
  kind: params.modalId ? "modal-trigger" : "button",
464
472
  label: params.spec.label,
465
473
  ...params.spec.callbackData !== void 0 ? { callbackData: params.spec.callbackData } : {},
474
+ ...params.spec.callbackDataKind !== void 0 ? { callbackDataKind: params.spec.callbackDataKind } : {},
466
475
  ...params.modalId !== void 0 ? { modalId: params.modalId } : {},
467
476
  ...params.spec.reusable !== void 0 ? { reusable: params.spec.reusable } : {},
468
477
  ...params.spec.allowedUsers !== void 0 ? { allowedUsers: params.spec.allowedUsers } : {}
@@ -478,6 +487,7 @@ function createSelectComponent(params) {
478
487
  kind: "select",
479
488
  label,
480
489
  ...params.spec.callbackData !== void 0 ? { callbackData: params.spec.callbackData } : {},
490
+ ...params.spec.callbackDataKind !== void 0 ? { callbackDataKind: params.spec.callbackDataKind } : {},
481
491
  selectType,
482
492
  ...options ? { options } : {},
483
493
  ...params.spec.allowedUsers !== void 0 ? { allowedUsers: params.spec.allowedUsers } : {}
@@ -679,7 +689,7 @@ function buildDiscordComponentMessage(params) {
679
689
  const lastChild = containerChildren.at(-1);
680
690
  if (lastChild instanceof Row) {
681
691
  const row = lastChild;
682
- const hasSelect = row.components.some((entry) => isSelectComponent(entry));
692
+ const hasSelect = row.components.some((entryLocal) => isSelectComponent(entryLocal));
683
693
  if (row.components.length < 5 && !hasSelect) row.addComponent(component);
684
694
  else containerChildren.push(new Row([component]));
685
695
  } else containerChildren.push(new Row([component]));
@@ -822,6 +832,21 @@ var shared_interactive_exports = /* @__PURE__ */ __exportAll({
822
832
  function resolveDiscordInteractiveButtonStyle(style) {
823
833
  return style ?? "secondary";
824
834
  }
835
+ function applyDiscordButtonCallback(spec, button) {
836
+ const callbackData = resolveMessagePresentationControlValue(button);
837
+ if (!callbackData) return;
838
+ spec.callbackData = callbackData;
839
+ if (button.action?.type === "command" || button.action?.type === "callback") spec.callbackDataKind = button.action.type;
840
+ }
841
+ function resolveDiscordSelectOptionValue(option) {
842
+ return resolveMessagePresentationControlValue(option);
843
+ }
844
+ function resolveDiscordSelectCallbackDataKind(options) {
845
+ const renderableOptions = options.filter((option) => resolveDiscordSelectOptionValue(option));
846
+ if (renderableOptions.length > 0 && renderableOptions.every((option) => option.action?.type === "command")) return "command";
847
+ if (renderableOptions.length > 0 && renderableOptions.every((option) => option.action?.type === "callback")) return "callback";
848
+ if (renderableOptions.some((option) => option.action)) return "mixed";
849
+ }
825
850
  const DISCORD_INTERACTIVE_BUTTON_ROW_SIZE = 5;
826
851
  /**
827
852
  * @deprecated Use buildDiscordPresentationComponents with MessagePresentation.
@@ -845,7 +870,7 @@ function buildDiscordInteractiveComponents(interactive) {
845
870
  label: button.label,
846
871
  style: button.url ? "link" : resolveDiscordInteractiveButtonStyle(button.style)
847
872
  };
848
- if (button.value) spec.callbackData = button.value;
873
+ applyDiscordButtonCallback(spec, button);
849
874
  if (button.url) spec.url = button.url;
850
875
  if (button.disabled === true) spec.disabled = true;
851
876
  if (button.reusable === true) spec.reusable = true;
@@ -854,17 +879,24 @@ function buildDiscordInteractiveComponents(interactive) {
854
879
  });
855
880
  return state;
856
881
  }
857
- if (block.type === "select" && block.options.length > 0) state.push({
858
- type: "actions",
859
- select: {
860
- type: "string",
861
- placeholder: block.placeholder,
862
- options: block.options.map((option) => ({
863
- label: option.label,
864
- value: option.value
865
- }))
866
- }
867
- });
882
+ if (block.type === "select" && block.options.length > 0) {
883
+ const options = block.options.map((option) => ({
884
+ label: option.label,
885
+ value: resolveDiscordSelectOptionValue(option)
886
+ })).filter((option) => Boolean(option.value));
887
+ if (options.length === 0) return state;
888
+ const callbackDataKind = resolveDiscordSelectCallbackDataKind(block.options);
889
+ if (callbackDataKind === "mixed") return state;
890
+ state.push({
891
+ type: "actions",
892
+ select: {
893
+ type: "string",
894
+ placeholder: block.placeholder,
895
+ options,
896
+ callbackDataKind
897
+ }
898
+ });
899
+ }
868
900
  return state;
869
901
  });
870
902
  return blocks.length > 0 ? { blocks } : void 0;
@@ -895,17 +927,24 @@ function buildDiscordPresentationComponents(presentation) {
895
927
  appendDiscordPresentationButtonBlocks(spec, block.buttons);
896
928
  continue;
897
929
  }
898
- if (block.type === "select" && block.options.length > 0) spec.blocks?.push({
899
- type: "actions",
900
- select: {
901
- type: "string",
902
- placeholder: block.placeholder,
903
- options: block.options.map((option) => ({
904
- label: option.label,
905
- value: option.value
906
- }))
907
- }
908
- });
930
+ if (block.type === "select" && block.options.length > 0) {
931
+ const options = block.options.map((option) => ({
932
+ label: option.label,
933
+ value: resolveDiscordSelectOptionValue(option)
934
+ })).filter((option) => Boolean(option.value));
935
+ if (options.length === 0) continue;
936
+ const callbackDataKind = resolveDiscordSelectCallbackDataKind(block.options);
937
+ if (callbackDataKind === "mixed") continue;
938
+ spec.blocks?.push({
939
+ type: "actions",
940
+ select: {
941
+ type: "string",
942
+ placeholder: block.placeholder,
943
+ options,
944
+ callbackDataKind
945
+ }
946
+ });
947
+ }
909
948
  }
910
949
  return spec.blocks?.length ? spec : void 0;
911
950
  }
@@ -918,7 +957,7 @@ function appendDiscordPresentationButtonBlocks(spec, buttons) {
918
957
  label: button.label,
919
958
  style: button.url ? "link" : resolveDiscordInteractiveButtonStyle(button.style)
920
959
  };
921
- if (button.value) component.callbackData = button.value;
960
+ applyDiscordButtonCallback(component, button);
922
961
  if (button.url) component.url = button.url;
923
962
  if (button.disabled === true) component.disabled = true;
924
963
  if (button.reusable === true) component.reusable = true;
@@ -1,8 +1,8 @@
1
- import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BAu3WLvd.js";
1
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-CU7lnZTF.js";
2
2
  import { n as secretTargetRegistryEntries, t as collectRuntimeConfigAssignments } from "./secret-config-contract-BjM-1hr9.js";
3
3
  import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-DSHk7I2w.js";
4
4
  import { t as deriveLegacySessionChatType } from "./session-contract-BO5tlIdl.js";
5
- import { i as testing, n as createThreadBindingManager } from "./thread-bindings.manager-Dji7SZHG.js";
6
- import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-B9Jw1Q2R.js";
5
+ import { i as testing, n as createThreadBindingManager } from "./thread-bindings.manager-CRc4hYr1.js";
6
+ import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-j1bfTue_.js";
7
7
  import { t as collectDiscordSecurityAuditFindings } from "./security-audit-Bh_65L5C.js";
8
8
  export { collectDiscordSecurityAuditFindings, collectRuntimeConfigAssignments, collectUnsupportedSecretRefConfigCandidates, createThreadBindingManager, deriveLegacySessionChatType, testing as discordThreadBindingTesting, legacyConfigRules, listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig, normalizeCompatibilityConfig, secretTargetRegistryEntries, unsupportedSecretRefSurfacePatterns };
@@ -1,4 +1,4 @@
1
- import { Ht as parseDiscordTarget } from "./send.receipt-CjsWpitW.js";
1
+ import { Ht as parseDiscordTarget } from "./send.receipt-Z8V6yMOY.js";
2
2
  import { r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
3
3
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
@@ -231,7 +231,7 @@ function createDiscordApprovalCapability(configOverride) {
231
231
  request,
232
232
  configOverride
233
233
  }),
234
- load: async () => (await import("./approval-handler.runtime-DSFfzXpo.js").then((n) => n.t)).discordApprovalNativeRuntime
234
+ load: async () => (await import("./approval-handler.runtime-DQiJ1Z0k.js").then((n) => n.t)).discordApprovalNativeRuntime
235
235
  })
236
236
  });
237
237
  }
@@ -1,4 +1,4 @@
1
- import { Wt as __exportAll } from "./send.receipt-CjsWpitW.js";
1
+ import { Wt as __exportAll } from "./send.receipt-Z8V6yMOY.js";
2
2
  import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, o as resolveDefaultDiscordAccountId } from "./accounts-P19jm1lf.js";
3
3
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
4
4
  import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
@@ -1,2 +1,2 @@
1
- import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-B9Jw1Q2R.js";
1
+ import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-j1bfTue_.js";
2
2
  export { listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig };
@@ -1,7 +1,7 @@
1
- import { Wt as __exportAll } from "./send.receipt-CjsWpitW.js";
1
+ import { Wt as __exportAll } from "./send.receipt-Z8V6yMOY.js";
2
2
  import { p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
3
3
  import { n as fetchDiscord } from "./api-BmXlcjYW.js";
4
- import { a as normalizeDiscordSlug } from "./allow-list-BnkWtVpA.js";
4
+ import { a as normalizeDiscordSlug } from "./allow-list-C-MqM-B_.js";
5
5
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/routing";
7
7
  //#region extensions/discord/src/directory-cache.ts
@@ -1,7 +1,7 @@
1
1
  import { t as inspectDiscordAccount } from "./account-inspect-DDZtT5C8.js";
2
2
  import { o as resolveDefaultDiscordAccountId } from "./accounts-P19jm1lf.js";
3
- import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-BMGLQw74.js";
4
- import { n as normalizeCompatibilityConfig } from "./doctor-contract-BAu3WLvd.js";
3
+ import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-D11J9bXI.js";
4
+ import { n as normalizeCompatibilityConfig } from "./doctor-contract-CU7lnZTF.js";
5
5
  import { t as isDiscordMutableAllowEntry } from "./security-doctor-uUo8hTD5.js";
6
6
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import { collectProviderDangerousNameMatchingScopes } from "openclaw/plugin-sdk/runtime-doctor";
@@ -358,8 +358,8 @@ function normalizeCompatibilityConfig({ cfg }) {
358
358
  changes: []
359
359
  };
360
360
  const changes = [];
361
- let updated = rawEntry;
362
- let changed = false;
361
+ let updated;
362
+ let changed;
363
363
  const bindingsToAdd = [];
364
364
  const aliases = normalizeLegacyChannelAliases({
365
365
  entry: rawEntry,
@@ -1,2 +1,2 @@
1
- import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BAu3WLvd.js";
1
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-CU7lnZTF.js";
2
2
  export { legacyConfigRules, normalizeCompatibilityConfig };
@@ -1,4 +1,4 @@
1
- import { a as readDiscordChannelCreateParams, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-Blf_d9E7.js";
1
+ import { a as readDiscordChannelCreateParams, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-Dds0Ww1n.js";
2
2
  import "./action-runtime-api.js";
3
3
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { readNonNegativeIntegerParam, readPositiveIntegerParam, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/agent-runtime";
@@ -241,7 +241,7 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
241
241
  message: "deleteDays must be an integer from 0 to 7"
242
242
  })
243
243
  });
244
- const senderUserId = normalizeOptionalString(ctx.requesterSenderId);
244
+ const senderUserIdLocal = normalizeOptionalString(ctx.requesterSenderId);
245
245
  return await handleDiscordAction({
246
246
  action: moderation.action,
247
247
  accountId: accountId ?? void 0,
@@ -251,7 +251,7 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
251
251
  until: moderation.until,
252
252
  reason: moderation.reason,
253
253
  deleteMessageDays: moderation.deleteMessageDays,
254
- senderUserId
254
+ senderUserId: senderUserIdLocal
255
255
  }, cfg);
256
256
  }
257
257
  if (action === "thread-list") {
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { registerDiscordSubagentHooks } from "./subagent-hooks-api.js";
2
- import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-O73_YIDs.js";
2
+ import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-Cegx0wdw.js";
3
3
  import "./transcripts-source-api.js";
4
4
  import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
5
5
  //#region extensions/discord/index.ts
@@ -1,3 +1,4 @@
1
+ import { a as THREAD_BINDINGS_MAX_ENTRIES, f as normalizePersistedBinding, j as toBindingRecordKey, o as THREAD_BINDINGS_NAMESPACE } from "./thread-bindings.state-CVLF7gJH.js";
1
2
  import { MAX_DATE_TIMESTAMP_MS, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
2
3
  import { createHash } from "node:crypto";
3
4
  import path from "node:path";
@@ -22,6 +23,11 @@ function readLegacyStore(filePath) {
22
23
  return null;
23
24
  }
24
25
  }
26
+ function readLegacyThreadBindingsStore(filePath) {
27
+ const parsed = JSON.parse(fs.readFileSync(filePath, "utf8"));
28
+ if (!parsed || typeof parsed !== "object") throw new Error("legacy Discord thread bindings store must be an object");
29
+ return parsed;
30
+ }
25
31
  function normalizeLegacyPreferenceKey(key) {
26
32
  const trimmed = key.trim();
27
33
  if (!trimmed || textEncoder.encode(trimmed).length > MAX_PLUGIN_STATE_KEY_BYTES) return;
@@ -64,12 +70,12 @@ function legacyUpdatedAtForIndex(updatedAt, index, total) {
64
70
  return timestampMsToIsoString(Math.min(baseMs + Math.max(0, total), MAX_DATE_TIMESTAMP_MS) - Math.max(0, index)) ?? timestampMsToIsoString(baseMs) ?? timestampMsToIsoString(Math.max(0, total - index)) ?? "1970-01-01T00:00:00.000Z";
65
71
  }
66
72
  const detectDiscordLegacyStateMigrations = ({ stateDir }) => {
67
- const sourcePath = path.join(stateDir, "discord", "model-picker-preferences.json");
68
- if (!fileExists(sourcePath)) return [];
69
- return [{
73
+ const plans = [];
74
+ const modelPickerSourcePath = path.join(stateDir, "discord", "model-picker-preferences.json");
75
+ if (fileExists(modelPickerSourcePath)) plans.push({
70
76
  kind: "plugin-state-import",
71
77
  label: "Discord model picker preferences",
72
- sourcePath,
78
+ sourcePath: modelPickerSourcePath,
73
79
  targetPath: "plugin state:model-picker-preferences",
74
80
  pluginId: "discord",
75
81
  namespace: "model-picker-preferences",
@@ -77,7 +83,7 @@ const detectDiscordLegacyStateMigrations = ({ stateDir }) => {
77
83
  scopeKey: "",
78
84
  cleanupSource: "rename",
79
85
  readEntries: () => {
80
- const store = readLegacyStore(sourcePath);
86
+ const store = readLegacyStore(modelPickerSourcePath);
81
87
  if (!store || !store.entries || typeof store.entries !== "object") return [];
82
88
  const out = [];
83
89
  for (const [rawKey, rawEntry] of Object.entries(store.entries)) {
@@ -95,7 +101,34 @@ const detectDiscordLegacyStateMigrations = ({ stateDir }) => {
95
101
  }
96
102
  return out;
97
103
  }
98
- }];
104
+ });
105
+ const threadBindingsSourcePath = path.join(stateDir, "discord", "thread-bindings.json");
106
+ if (fileExists(threadBindingsSourcePath)) plans.push({
107
+ kind: "plugin-state-import",
108
+ label: "Discord thread bindings",
109
+ sourcePath: threadBindingsSourcePath,
110
+ targetPath: `plugin state:${THREAD_BINDINGS_NAMESPACE}`,
111
+ pluginId: "discord",
112
+ namespace: THREAD_BINDINGS_NAMESPACE,
113
+ maxEntries: THREAD_BINDINGS_MAX_ENTRIES,
114
+ scopeKey: "",
115
+ cleanupSource: "rename",
116
+ cleanupWhenEmpty: true,
117
+ readEntries: () => {
118
+ const store = readLegacyThreadBindingsStore(threadBindingsSourcePath);
119
+ if (store?.version !== 1 || !store.bindings || typeof store.bindings !== "object") throw new Error("legacy Discord thread bindings store must have version 1 bindings");
120
+ const out = [];
121
+ for (const [rawKey, rawEntry] of Object.entries(store.bindings)) {
122
+ const normalized = normalizePersistedBinding(rawKey, rawEntry);
123
+ if (normalized) out.push({
124
+ key: toBindingRecordKey(normalized),
125
+ value: normalized
126
+ });
127
+ }
128
+ return out;
129
+ }
130
+ });
131
+ return plans;
99
132
  };
100
133
  //#endregion
101
134
  export { detectDiscordLegacyStateMigrations };