@openclaw/discord 2026.8.2 → 2026.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/action-runtime-api.js +1 -1
  2. package/dist/{activities-api-CkKcHUB6.js → activities-api-E-segZn6.js} +20 -8
  3. package/dist/activities-api.js +1 -1
  4. package/dist/api.js +12 -12
  5. package/dist/{approval-handler.runtime-DZM6Kt1Z.js → approval-handler.runtime-CW5k3mSa.js} +16 -10
  6. package/dist/{audit-DIbQA4VT.js → audit-B9rydv5a.js} +4 -4
  7. package/dist/{channel-CarzU3bg.js → channel-D93LnbTE.js} +20 -16
  8. package/dist/{channel-actions.runtime-B2wMqeVK.js → channel-actions.runtime-DMFv4doE.js} +7 -7
  9. package/dist/channel-plugin-api.js +1 -1
  10. package/dist/{channel.setup-z_ewMVa9.js → channel.setup-DTL7kPOM.js} +3 -3
  11. package/dist/{components-gvRA0oaI.js → components-DmXYIQ26.js} +83 -141
  12. package/dist/{conversation-binding-route-DPpBRpYI.js → conversation-binding-route-24afmvEC.js} +1 -1
  13. package/dist/{directory-config-AA8wQx0D.js → directory-config-BD4YL7wT.js} +1 -1
  14. package/dist/directory-contract-api.js +1 -1
  15. package/dist/{directory-live-D_kFz_Fj.js → directory-live-BrFVc1Ds.js} +1 -1
  16. package/dist/{doctor-QQTOkBfW.js → doctor-BUB41_lr.js} +2 -2
  17. package/dist/{handle-action.guild-admin-Cc88ZGon.js → handle-action.guild-admin-B0egstYq.js} +2 -2
  18. package/dist/index.js +1 -1
  19. package/dist/{message-handler-CAeEpqWo.js → message-handler-Qdw9c0j4.js} +5 -5
  20. package/dist/{message-handler.preflight-CoKoE3dY.js → message-handler.preflight-Dxi2yBfR.js} +21 -24
  21. package/dist/{message-handler.process-cdIJ_fDT.js → message-handler.process-BYDjtxZJ.js} +37 -45
  22. package/dist/{message-text-C0K4-fkg.js → message-text-BRVqYm-t.js} +1 -1
  23. package/dist/{outbound-adapter-Ch0At5Ra.js → outbound-adapter-DEhthWTk.js} +25 -52
  24. package/dist/{outbound-components-Bnt_7x7r.js → outbound-components-DehyxvA4.js} +3 -3
  25. package/dist/{outbound-session-route-CzzerX2K.js → outbound-session-route-BFGRF9fE.js} +3 -3
  26. package/dist/{pluralkit-B3cUVI7i.js → pluralkit-XmmAHoV6.js} +1 -1
  27. package/dist/{provider-CjI8BSzS.js → provider-DuDtKbF8.js} +21 -21
  28. package/dist/{provider-session.runtime-DdKRMcE9.js → provider-session.runtime-BA2BPyZ4.js} +3 -3
  29. package/dist/provider.runtime-Db8YwZBv.js +2 -0
  30. package/dist/{realtime-session.runtime-37IC-p5K.js → realtime-session.runtime-DgSbX6ay.js} +66 -122
  31. package/dist/{resolve-channels-BexR2eUn.js → resolve-channels-CYseD5Uw.js} +1 -1
  32. package/dist/{resolve-users-BtXBCH5W.js → resolve-users-DrmhDrqm.js} +1 -1
  33. package/dist/{retry-t5RcEsPk.js → retry-BNCxiyyR.js} +8 -3
  34. package/dist/{runtime-DydyfxST.js → runtime-BbWNtfyq.js} +7 -7
  35. package/dist/{runtime-BNlDfLwS.js → runtime-DB7Fb6AU.js} +1 -1
  36. package/dist/runtime-api.js +15 -15
  37. package/dist/{send-mTKSBdmZ.js → send-BnTEIeLE.js} +60 -56
  38. package/dist/{send.components-nsPnc7kK.js → send.components-BWVEcjRP.js} +4 -4
  39. package/dist/{send.outbound-CaOs9Zy1.js → send.outbound-b5xwHTlL.js} +4 -5
  40. package/dist/{send.shared-BJHt0Vyf.js → send.shared-5vxBTagO.js} +2 -2
  41. package/dist/setup-plugin-api.js +1 -1
  42. package/dist/{shared-BNesVA4P.js → shared-BSJWHEMA.js} +1 -1
  43. package/dist/{subagent-hooks-IeZVPLGj.js → subagent-hooks-IzQKX4RQ.js} +2 -2
  44. package/dist/subagent-hooks-api.js +1 -1
  45. package/dist/{system-events-Be5EJI3b.js → system-events-BOiDS8b3.js} +1 -1
  46. package/dist/{target-resolver-C0MnwEki.js → target-resolver-BVI8xSSC.js} +2 -2
  47. package/dist/targets-DbxVbq8k.js +3 -0
  48. package/dist/{thread-bindings-wECUSIIG.js → thread-bindings-D7mcaXQC.js} +3 -3
  49. package/dist/{thread-bindings.manager-B-3UHCc1.js → thread-bindings.manager-B1oySiVc.js} +12 -6
  50. package/dist/{threading-te5ADPQI.js → threading-OQnL-0Zx.js} +3 -3
  51. package/dist/{transcripts-source-DkUhR7YK.js → transcripts-source-D8lH7AkN.js} +1 -1
  52. package/dist/transcripts-source-api.js +1 -1
  53. package/dist/{typing-DAwJF5VT.js → typing-C9q0AQMb.js} +1 -1
  54. package/dist/{voice-runtime-COyYYTDD.js → voice-runtime-Dfhjh1tV.js} +75 -87
  55. package/package.json +5 -4
  56. package/dist/provider.runtime-Bo1WbLLr.js +0 -2
  57. package/dist/targets-DQSye1Rv.js +0 -3
@@ -1,2 +1,2 @@
1
- import { t as handleDiscordAction } from "./runtime-DydyfxST.js";
1
+ import { t as handleDiscordAction } from "./runtime-BbWNtfyq.js";
2
2
  export { handleDiscordAction };
@@ -1,12 +1,12 @@
1
- import { v as resolveDiscordChannelId$1 } from "./retry-t5RcEsPk.js";
2
- import { S as parseDiscordActivityCustomId, i as buildDiscordPresentationComponents } from "./components-gvRA0oaI.js";
1
+ import { y as resolveDiscordChannelId$1 } from "./retry-BNCxiyyR.js";
2
+ import { S as parseDiscordActivityCustomId, i as buildDiscordPresentationComponents } from "./components-DmXYIQ26.js";
3
3
  import { c as resolveDiscordAccount } from "./accounts-CwJQoLjM.js";
4
- import { r as sendDiscordComponentMessage } from "./send.components-nsPnc7kK.js";
5
- import { r as setDiscordActivitiesRuntime, t as DiscordActivitiesRuntime } from "./runtime-BNlDfLwS.js";
4
+ import { r as sendDiscordComponentMessage } from "./send.components-BWVEcjRP.js";
5
+ import { r as setDiscordActivitiesRuntime, t as DiscordActivitiesRuntime } from "./runtime-DB7Fb6AU.js";
6
6
  import fs from "node:fs/promises";
7
7
  import { logError } from "openclaw/plugin-sdk/logging-core";
8
8
  import { resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
9
- import { WEBHOOK_BODY_READ_DEFAULTS, readJsonBodyWithLimit } from "openclaw/plugin-sdk/webhook-request-guards";
9
+ import { WEBHOOK_BODY_READ_DEFAULTS, readJsonBodyWithLimit, sendHttpRequestRejection } from "openclaw/plugin-sdk/webhook-request-guards";
10
10
  import { randomBytes } from "node:crypto";
11
11
  import { readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
12
12
  import { fetchWithSsrFGuard as fetchWithSsrFGuard$1 } from "openclaw/plugin-sdk/ssrf-runtime";
@@ -244,6 +244,7 @@ run().catch((error) => {
244
244
  //#endregion
245
245
  //#region extensions/discord/src/activities/http.ts
246
246
  const BODY_MAX_BYTES = 8192;
247
+ const JSON_CONTENT_TYPE = "application/json; charset=utf-8";
247
248
  const WIDGET_ID_PATTERN = /^[A-Za-z0-9_-]{22}$/;
248
249
  const DOC_TOKEN_PATTERN = /^[A-Za-z0-9_-]{43}$/;
249
250
  const DISCORD_ACTIVITY_WIDGET_CSP = "sandbox allow-scripts; default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data: blob:; font-src data:; connect-src 'none'; frame-ancestors *";
@@ -260,8 +261,11 @@ function respond(res, statusCode, body, contentType, headers) {
260
261
  res.end(body);
261
262
  return true;
262
263
  }
264
+ function jsonBody(body) {
265
+ return `${JSON.stringify(body)}\n`;
266
+ }
263
267
  function respondJson(res, statusCode, body) {
264
- return respond(res, statusCode, `${JSON.stringify(body)}\n`, "application/json; charset=utf-8");
268
+ return respond(res, statusCode, jsonBody(body), JSON_CONTENT_TYPE);
265
269
  }
266
270
  function notFound(res, widgetDocument = false) {
267
271
  return respond(res, 404, "not found", "text/plain; charset=utf-8", widgetDocument ? { "Content-Security-Policy": DISCORD_ACTIVITY_WIDGET_CSP } : void 0);
@@ -309,9 +313,17 @@ function createDiscordActivityHttpHandler(deps) {
309
313
  const bodyResult = await readJsonBodyWithLimit(req, {
310
314
  maxBytes: BODY_MAX_BYTES,
311
315
  timeoutMs: bodyTimeoutMs,
312
- emptyObjectOnEmpty: true
316
+ emptyObjectOnEmpty: true,
317
+ destroyOnLimit: false
313
318
  });
314
- if (!bodyResult.ok && bodyResult.code === "REQUEST_BODY_TIMEOUT") return respondJson(res, 408, { error: "request body timeout" });
319
+ if (!bodyResult.ok && bodyResult.code === "REQUEST_BODY_TIMEOUT") {
320
+ await sendHttpRequestRejection(req, res, 408, jsonBody({ error: "request body timeout" }), JSON_CONTENT_TYPE);
321
+ return true;
322
+ }
323
+ if (!bodyResult.ok && bodyResult.code === "PAYLOAD_TOO_LARGE") {
324
+ await sendHttpRequestRejection(req, res, 413, jsonBody({ error: "request body too large" }), JSON_CONTENT_TYPE);
325
+ return true;
326
+ }
315
327
  const body = bodyResult.ok && bodyResult.value && typeof bodyResult.value === "object" && !Array.isArray(bodyResult.value) ? bodyResult.value : null;
316
328
  const code = typeof body?.code === "string" ? body.code.trim() : "";
317
329
  if (!code) return respondJson(res, 401, { error: "invalid authorization code" });
@@ -1,2 +1,2 @@
1
- import { t as registerDiscordActivities } from "./activities-api-CkKcHUB6.js";
1
+ import { t as registerDiscordActivities } from "./activities-api-E-segZn6.js";
2
2
  export { registerDiscordActivities };
package/dist/api.js CHANGED
@@ -1,24 +1,24 @@
1
- import { _ as parseDiscordTarget, g as normalizeDiscordOutboundTarget, h as normalizeDiscordMessagingTarget, m as looksLikeDiscordTargetId, v as resolveDiscordChannelId } from "./retry-t5RcEsPk.js";
2
- import { D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, T as parseDiscordComponentCustomIdForInteraction, _ as DISCORD_COMPONENT_CUSTOM_ID_KEY, b as buildDiscordComponentCustomId, d as buildDiscordComponentMessage, f as buildDiscordComponentMessageFlags, g as resolveDiscordComponentAttachmentName, h as readDiscordComponentSpec, l as DiscordFormModal, n as formatDiscordComponentEventText, p as DISCORD_COMPONENT_ATTACHMENT_PREFIX, r as buildDiscordInteractiveComponents, u as createDiscordFormModal, v as DISCORD_MODAL_CUSTOM_ID_KEY, w as parseDiscordComponentCustomId, x as buildDiscordModalCustomId } from "./components-gvRA0oaI.js";
1
+ import { _ as normalizeDiscordOutboundTarget, g as normalizeDiscordMessagingTarget, h as looksLikeDiscordTargetId, v as parseDiscordTarget, y as resolveDiscordChannelId } from "./retry-BNCxiyyR.js";
2
+ import { D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, T as parseDiscordComponentCustomIdForInteraction, _ as DISCORD_COMPONENT_CUSTOM_ID_KEY, b as buildDiscordComponentCustomId, d as buildDiscordComponentMessage, f as buildDiscordComponentMessageFlags, g as resolveDiscordComponentAttachmentName, h as readDiscordComponentSpec, l as DiscordFormModal, n as formatDiscordComponentEventText, p as DISCORD_COMPONENT_ATTACHMENT_PREFIX, r as buildDiscordInteractiveComponents, u as createDiscordFormModal, v as DISCORD_MODAL_CUSTOM_ID_KEY, w as parseDiscordComponentCustomId, x as buildDiscordModalCustomId } from "./components-DmXYIQ26.js";
3
3
  import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount, o as mergeDiscordAccountConfig, p as resolveDiscordMaxLinesPerMessage, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId, t as createDiscordActionGate, u as resolveDiscordAccountConfig } from "./accounts-CwJQoLjM.js";
4
4
  import { i as requestDiscord, n as DiscordApiError, r as fetchDiscord } from "./api-BfmEP6wp.js";
5
- import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-C0MnwEki.js";
5
+ import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-BVI8xSSC.js";
6
6
  import { t as inspectDiscordAccount } from "./account-inspect-BY-ve3yH.js";
7
7
  import { 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-D86uWLt_.js";
8
- import "./targets-DQSye1Rv.js";
9
- import { C as shouldSuppressLocalDiscordExecApprovalPrompt, S as isDiscordExecApprovalClientEnabled, b as getDiscordExecApprovalApprovers, x as isDiscordExecApprovalApprover } from "./outbound-session-route-CzzerX2K.js";
10
- import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-CarzU3bg.js";
8
+ import "./targets-DbxVbq8k.js";
9
+ import { C as shouldSuppressLocalDiscordExecApprovalPrompt, S as isDiscordExecApprovalClientEnabled, b as getDiscordExecApprovalApprovers, x as isDiscordExecApprovalApprover } from "./outbound-session-route-BFGRF9fE.js";
10
+ import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-D93LnbTE.js";
11
11
  import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
12
- import { t as discordSetupPlugin } from "./channel.setup-z_ewMVa9.js";
13
- import { n as handleDiscordSubagentEnded, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-IeZVPLGj.js";
14
- import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-Cc88ZGon.js";
15
- import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-AA8wQx0D.js";
16
- import { t as fetchPluralKitMessageInfo } from "./pluralkit-B3cUVI7i.js";
12
+ import { t as discordSetupPlugin } from "./channel.setup-DTL7kPOM.js";
13
+ import { n as handleDiscordSubagentEnded, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-IzQKX4RQ.js";
14
+ import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-B0egstYq.js";
15
+ import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-BD4YL7wT.js";
16
+ import { t as fetchPluralKitMessageInfo } from "./pluralkit-XmmAHoV6.js";
17
17
  import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-3ovFAp3b.js";
18
18
  import { t as collectDiscordSecurityAuditFindings } from "./security-audit-DKfK-iPY.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-B2wMqeVK.js")).handleDiscordMessageAction(...args);
21
+ const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-DMFv4doE.js")).handleDiscordMessageAction(...args);
22
22
  /**
23
23
  * @deprecated Shipped `@openclaw/discord/api` compatibility only. Use native
24
24
  * `AbortSignal.any` after filtering optional signals. Removal with the next
@@ -1,8 +1,8 @@
1
- import { Dt as deleteChannelMessage, _t as stripUndefinedFields, ct as Row, et as Button, ft as TextDisplay, kt as editChannelMessage, nt as Container, q as serializePayload, ut as Separator, wt as createChannelMessage, yt as createUserDmChannel } from "./retry-t5RcEsPk.js";
2
- import { s as buildExecApprovalCustomId } from "./components-gvRA0oaI.js";
3
- import { N as createDiscordClient, O as createDiscordMessageNonce } from "./send.shared-BJHt0Vyf.js";
4
- import { S as isDiscordExecApprovalClientEnabled, n as DISCORD_APPROVAL_ALLOWED_MENTIONS, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-CzzerX2K.js";
5
- import { a as shouldHandleDiscordApprovalRequest } from "./channel-CarzU3bg.js";
1
+ import { At as editChannelMessage, J as serializePayload, Ot as deleteChannelMessage, Tt as createChannelMessage, bt as createUserDmChannel, dt as Separator, lt as Row, pt as TextDisplay, rt as Container, tt as Button, vt as stripUndefinedFields } from "./retry-BNCxiyyR.js";
2
+ import { s as buildExecApprovalCustomId } from "./components-DmXYIQ26.js";
3
+ import { N as createDiscordClient, O as createDiscordMessageNonce } from "./send.shared-5vxBTagO.js";
4
+ import { S as isDiscordExecApprovalClientEnabled, n as DISCORD_APPROVAL_ALLOWED_MENTIONS, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-BFGRF9fE.js";
5
+ import { a as shouldHandleDiscordApprovalRequest } from "./channel-D93LnbTE.js";
6
6
  import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
7
7
  import { ButtonStyle } from "discord-api-types/v10";
8
8
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -52,7 +52,7 @@ var ExecApprovalContainer = class extends DiscordUiContainer {
52
52
  divider: true,
53
53
  spacing: "small"
54
54
  }));
55
- components.push(new TextDisplay(`### Command\n\`\`\`\n${params.commandPreview}\n\`\`\``));
55
+ components.push(new TextDisplay(`### ${params.commandLabel ?? "Command"}\n\`\`\`\n${params.commandPreview}\n\`\`\``));
56
56
  if (params.commandSecondaryPreview) components.push(new TextDisplay(`### Shell Preview\n\`\`\`\n${params.commandSecondaryPreview}\n\`\`\``));
57
57
  if (params.metadataLines?.length) components.push(new TextDisplay(params.metadataLines.join("\n")));
58
58
  if (params.actionRow) components.push(params.actionRow);
@@ -140,15 +140,16 @@ function resolveCommandPreviews(commandText, commandPreview, maxChars, secondary
140
140
  function createApprovalContainer(params) {
141
141
  const { view } = params;
142
142
  const plugin = view.approvalKind === "plugin";
143
+ const systemAgent = view.approvalKind === "system-agent";
143
144
  const pending = view.phase === "pending";
144
- const approvalLabel = plugin ? "Plugin" : "Exec";
145
+ const approvalLabel = plugin ? "Plugin" : systemAgent ? "OpenClaw Change" : "Exec";
145
146
  const { commandPreview, commandSecondaryPreview } = plugin ? {
146
147
  commandPreview: formatCommandPreview(view.title, 700),
147
148
  commandSecondaryPreview: formatOptionalCommandPreview(view.description, 1e3)
148
149
  } : resolveCommandPreviews(view.commandText, view.commandPreview, pending ? 1e3 : 500, pending ? 500 : 300);
149
- const decisionLabel = view.phase !== "resolved" ? void 0 : view.decision === "allow-once" ? "Allowed (once)" : view.decision === "allow-always" ? "Allowed (always)" : "Denied";
150
+ const decisionLabel = view.phase !== "resolved" ? void 0 : systemAgent && view.terminalStatus === "cancelled" ? "Cancelled" : systemAgent && view.applicationStatus === "applied" ? "Applied" : systemAgent && view.applicationStatus === "not-applied" ? "Not applied" : view.decision === "allow-once" ? "Allowed (once)" : view.decision === "allow-always" ? "Allowed (always)" : "Denied";
150
151
  const title = pending ? `${approvalLabel} Approval Required` : `${approvalLabel} Approval: ${view.phase === "expired" ? "Expired" : decisionLabel}`;
151
- const description = pending ? plugin ? "A plugin action needs your approval." : "A command needs your approval." : view.phase === "expired" ? "This approval request has expired." : view.resolvedBy ? `Resolved by ${formatDiscordApprovalDisplayValue(view.resolvedBy)}` : "Resolved";
152
+ const description = pending ? plugin ? "A plugin action needs your approval." : systemAgent ? "An OpenClaw change needs your approval." : "A command needs your approval." : view.phase === "expired" ? "This approval request has expired." : view.resolvedBy ? `Resolved by ${formatDiscordApprovalDisplayValue(view.resolvedBy)}` : "Resolved";
152
153
  const accentColor = view.phase === "expired" ? "#99AAB5" : view.phase === "resolved" ? view.decision === "deny" ? "#ED4245" : view.decision === "allow-always" ? "#5865F2" : "#57F287" : plugin ? view.severity === "critical" ? "#ED4245" : view.severity === "info" ? "#5865F2" : "#FAA61A" : "#FFA500";
153
154
  const approvalId = formatDiscordApprovalDisplayValue(view.approvalId);
154
155
  const footer = pending ? `Expires <t:${Math.max(0, Math.floor(view.expiresAtMs / 1e3))}:R> · ID: ${approvalId}` : `ID: ${approvalId}`;
@@ -157,6 +158,7 @@ function createApprovalContainer(params) {
157
158
  accountId: params.accountId,
158
159
  title,
159
160
  description,
161
+ commandLabel: systemAgent ? "Change" : "Command",
160
162
  commandPreview,
161
163
  commandSecondaryPreview,
162
164
  metadataLines: buildApprovalMetadataLines(view.metadata),
@@ -196,7 +198,11 @@ async function finalizeMessage(params) {
196
198
  }
197
199
  }
198
200
  const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
199
- eventKinds: ["exec", "plugin"],
201
+ eventKinds: [
202
+ "exec",
203
+ "plugin",
204
+ "system-agent"
205
+ ],
200
206
  availability: {
201
207
  isConfigured: (params) => {
202
208
  const resolved = resolveHandlerContext(params);
@@ -1,8 +1,8 @@
1
- import { on as __exportAll } from "./retry-t5RcEsPk.js";
2
- import { x as fetchChannelPermissionsDiscord } from "./send.shared-BJHt0Vyf.js";
1
+ import { sn as __exportAll } from "./retry-BNCxiyyR.js";
2
+ import { x as fetchChannelPermissionsDiscord } from "./send.shared-5vxBTagO.js";
3
3
  import { t as inspectDiscordAccount } from "./account-inspect-BY-ve3yH.js";
4
- import "./send-mTKSBdmZ.js";
5
- import { _ as auditDiscordChannelPermissionsWithFetcher, v as collectDiscordAuditChannelIdsForAccount } from "./outbound-session-route-CzzerX2K.js";
4
+ import "./send-BnTEIeLE.js";
5
+ import { _ as auditDiscordChannelPermissionsWithFetcher, v as collectDiscordAuditChannelIdsForAccount } from "./outbound-session-route-BFGRF9fE.js";
6
6
  //#region extensions/discord/src/audit.ts
7
7
  var audit_exports = /* @__PURE__ */ __exportAll({
8
8
  auditDiscordChannelPermissions: () => auditDiscordChannelPermissions,
@@ -1,13 +1,13 @@
1
- import { _ as parseDiscordTarget, h as normalizeDiscordMessagingTarget, m as looksLikeDiscordTargetId } from "./retry-t5RcEsPk.js";
1
+ import { g as normalizeDiscordMessagingTarget, h as looksLikeDiscordTargetId, v as parseDiscordTarget } from "./retry-BNCxiyyR.js";
2
2
  import { c as resolveDiscordAccount, i as listDiscordStartupAccountIds, l as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.js";
3
3
  import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
4
4
  import { u as withAbortTimeout } from "./timeouts-D86uWLt_.js";
5
- import { C as shouldSuppressLocalDiscordExecApprovalPrompt, D as isChannelExecApprovalClientEnabledFromConfig, E as createChannelNativeOriginTargetResolver, O as matchesApprovalRequestFilters, S as isDiscordExecApprovalClientEnabled, T as createChannelApproverDmTargetResolver, b as getDiscordExecApprovalApprovers, d as resolveDiscordCurrentConversationIdentity, f as resolveDiscordRuntimeBindingConversationId, p as discordMessageActions, s as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, w as createApproverRestrictedNativeApprovalCapability, x as isDiscordExecApprovalApprover, y as resolveRequiredDiscordChannelPermissions } from "./outbound-session-route-CzzerX2K.js";
6
- import { a as discordSecurityAdapter, c as buildTokenChannelStatusSummary, i as discordSetupContract, l as projectCredentialSnapshotFields, n as discordConfigAdapter, o as DEFAULT_ACCOUNT_ID, s as PAIRING_APPROVED_MESSAGE, t as createDiscordPluginBase, u as resolveConfiguredFromCredentialStatuses } from "./shared-BNesVA4P.js";
5
+ import { C as shouldSuppressLocalDiscordExecApprovalPrompt, D as isChannelExecApprovalClientEnabledFromConfig, E as createChannelNativeOriginTargetResolver, O as matchesApprovalRequestFilters, S as isDiscordExecApprovalClientEnabled, T as createChannelApproverDmTargetResolver, b as getDiscordExecApprovalApprovers, d as resolveDiscordCurrentConversationIdentity, f as resolveDiscordRuntimeBindingConversationId, p as discordMessageActions, s as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, w as createApproverRestrictedNativeApprovalCapability, x as isDiscordExecApprovalApprover, y as resolveRequiredDiscordChannelPermissions } from "./outbound-session-route-BFGRF9fE.js";
6
+ import { a as discordSecurityAdapter, c as buildTokenChannelStatusSummary, i as discordSetupContract, l as projectCredentialSnapshotFields, n as discordConfigAdapter, o as DEFAULT_ACCOUNT_ID, s as PAIRING_APPROVED_MESSAGE, t as createDiscordPluginBase, u as resolveConfiguredFromCredentialStatuses } from "./shared-BSJWHEMA.js";
7
7
  import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.js";
8
- import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-DPpBRpYI.js";
8
+ import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-24afmvEC.js";
9
9
  import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-CC7HoQvt.js";
10
- import { n as discordOutbound } from "./outbound-adapter-Ch0At5Ra.js";
10
+ import { n as discordOutbound } from "./outbound-adapter-DEhthWTk.js";
11
11
  import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
12
12
  import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.js";
13
13
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
@@ -180,7 +180,11 @@ function createDiscordApprovalCapability(configOverride) {
180
180
  resolveApproverDmTargets: createDiscordApproverDmTargetResolver(configOverride),
181
181
  notifyOriginWhenDmOnly: true,
182
182
  nativeRuntime: createLazyChannelApprovalNativeRuntimeAdapter({
183
- eventKinds: ["exec", "plugin"],
183
+ eventKinds: [
184
+ "exec",
185
+ "plugin",
186
+ "system-agent"
187
+ ],
184
188
  isConfigured: ({ cfg, accountId }) => isDiscordExecApprovalClientEnabled({
185
189
  cfg,
186
190
  accountId,
@@ -192,7 +196,7 @@ function createDiscordApprovalCapability(configOverride) {
192
196
  request,
193
197
  configOverride
194
198
  }),
195
- load: async () => (await import("./approval-handler.runtime-DZM6Kt1Z.js")).discordApprovalNativeRuntime
199
+ load: async () => (await import("./approval-handler.runtime-CW5k3mSa.js")).discordApprovalNativeRuntime
196
200
  })
197
201
  });
198
202
  }
@@ -299,12 +303,12 @@ function resolveDiscordInboundConversation(params) {
299
303
  }
300
304
  //#endregion
301
305
  //#region extensions/discord/src/channel.loaders.ts
302
- const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-AA8wQx0D.js").then((n) => n.t));
303
- const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-BexR2eUn.js").then((n) => n.n));
304
- const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-BtXBCH5W.js").then((n) => n.n));
305
- const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-B-3UHCc1.js").then((n) => n.i));
306
- const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-C0MnwEki.js").then((n) => n.r));
307
- const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-Bo1WbLLr.js"));
306
+ const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-BD4YL7wT.js").then((n) => n.t));
307
+ const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-CYseD5Uw.js").then((n) => n.n));
308
+ const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-DrmhDrqm.js").then((n) => n.n));
309
+ const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-B1oySiVc.js").then((n) => n.i));
310
+ const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-BVI8xSSC.js").then((n) => n.r));
311
+ const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-Db8YwZBv.js"));
308
312
  const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-BckHn3cJ.js"));
309
313
  async function probeDiscordStatusAccount(params) {
310
314
  const startedAtMs = Date.now();
@@ -312,9 +316,9 @@ async function probeDiscordStatusAccount(params) {
312
316
  const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
313
317
  return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
314
318
  }
315
- const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-DIbQA4VT.js").then((n) => n.n));
316
- const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-mTKSBdmZ.js").then((n) => n.t));
317
- const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-D_kFz_Fj.js").then((n) => n.t));
319
+ const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-B9rydv5a.js").then((n) => n.n));
320
+ const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-BnTEIeLE.js").then((n) => n.t));
321
+ const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-BrFVc1Ds.js").then((n) => n.t));
318
322
  //#endregion
319
323
  //#region extensions/discord/src/conversation-route-owner.ts
320
324
  function inspectDiscordConversationRouteOwner(params) {
@@ -1,11 +1,11 @@
1
- import { _ as parseDiscordTarget, v as resolveDiscordChannelId } from "./retry-t5RcEsPk.js";
2
- import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-gvRA0oaI.js";
3
- import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-DydyfxST.js";
4
- import "./targets-DQSye1Rv.js";
1
+ import { v as parseDiscordTarget, y as resolveDiscordChannelId } from "./retry-BNCxiyyR.js";
2
+ import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-DmXYIQ26.js";
3
+ import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-BbWNtfyq.js";
4
+ import "./targets-DbxVbq8k.js";
5
5
  import "./action-runtime-api.js";
6
- import { h as discordInboundEventDelivery } from "./outbound-session-route-CzzerX2K.js";
7
- import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-Bnt_7x7r.js";
8
- import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-Cc88ZGon.js";
6
+ import { h as discordInboundEventDelivery } from "./outbound-session-route-BFGRF9fE.js";
7
+ import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-DehyxvA4.js";
8
+ import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-B0egstYq.js";
9
9
  import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-fmHl1HNd.js";
10
10
  import { normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
11
11
  import { adaptMessagePresentationForChannel, normalizeLegacyInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
@@ -1,2 +1,2 @@
1
- import { t as discordPlugin } from "./channel-CarzU3bg.js";
1
+ import { t as discordPlugin } from "./channel-D93LnbTE.js";
2
2
  export { discordPlugin };
@@ -1,7 +1,7 @@
1
1
  import { _ as inspectDiscordAccountTokenState, h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-CwJQoLjM.js";
2
- import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-BNesVA4P.js";
3
- import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-BexR2eUn.js";
4
- import { t as resolveDiscordUserAllowlist } from "./resolve-users-BtXBCH5W.js";
2
+ import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-BSJWHEMA.js";
3
+ import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-CYseD5Uw.js";
4
+ import { t as resolveDiscordUserAllowlist } from "./resolve-users-DrmhDrqm.js";
5
5
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
6
6
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
@@ -1,4 +1,4 @@
1
- import { $ as TextInput, Q as RadioGroup, X as Label, Y as CheckboxGroup, Z as Modal, at as MediaGallery, ct as Row, dt as StringSelectMenu, et as Button, ft as TextDisplay, gt as parseCustomId, it as LinkButton, lt as Section, mt as UserSelectMenu, nt as Container, on as __exportAll, ot as MentionableSelectMenu, pt as Thumbnail, rt as File, st as RoleSelectMenu, tt as ChannelSelectMenu, ut as Separator } from "./retry-t5RcEsPk.js";
1
+ import { $ as RadioGroup, Q as Modal, X as CheckboxGroup, Z as Label, _t as parseCustomId, at as LinkButton, ct as RoleSelectMenu, dt as Separator, et as TextInput, ft as StringSelectMenu, ht as UserSelectMenu, it as File, lt as Row, mt as Thumbnail, nt as ChannelSelectMenu, ot as MediaGallery, pt as TextDisplay, rt as Container, sn as __exportAll, st as MentionableSelectMenu, tt as Button, ut as Section } from "./retry-BNCxiyyR.js";
2
2
  import { ButtonStyle, MessageFlags, TextInputStyle } from "discord-api-types/v10";
3
3
  import crypto from "node:crypto";
4
4
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -438,6 +438,46 @@ function readDiscordComponentSpec(raw) {
438
438
  function createShortId(prefix) {
439
439
  return `${prefix}${crypto.randomBytes(6).toString("base64url")}`;
440
440
  }
441
+ const selectMenuConstructors = {
442
+ string: class extends StringSelectMenu {
443
+ constructor(..._args) {
444
+ super(..._args);
445
+ this.customId = "";
446
+ this.options = [];
447
+ }
448
+ },
449
+ user: class extends UserSelectMenu {
450
+ constructor(..._args2) {
451
+ super(..._args2);
452
+ this.customId = "";
453
+ }
454
+ },
455
+ role: class extends RoleSelectMenu {
456
+ constructor(..._args3) {
457
+ super(..._args3);
458
+ this.customId = "";
459
+ }
460
+ },
461
+ mentionable: class extends MentionableSelectMenu {
462
+ constructor(..._args4) {
463
+ super(..._args4);
464
+ this.customId = "";
465
+ }
466
+ },
467
+ channel: class extends ChannelSelectMenu {
468
+ constructor(..._args5) {
469
+ super(..._args5);
470
+ this.customId = "";
471
+ }
472
+ }
473
+ };
474
+ function createDiscordSelectMenu(type, customId, options) {
475
+ const SelectMenu = selectMenuConstructors[type];
476
+ const select = new SelectMenu();
477
+ select.customId = customId;
478
+ if (select instanceof StringSelectMenu) select.options = options ?? [];
479
+ return select;
480
+ }
441
481
  function buildTextDisplays(text, texts) {
442
482
  if (texts && texts.length > 0) return texts.map((entry) => new TextDisplay(entry));
443
483
  if (text) return [new TextDisplay(text)];
@@ -449,8 +489,8 @@ function createButtonComponent(params) {
449
489
  if (!params.spec.url) throw new Error("Link buttons require a url");
450
490
  const linkUrl = params.spec.url;
451
491
  class DynamicLinkButton extends LinkButton {
452
- constructor(..._args) {
453
- super(..._args);
492
+ constructor(..._args6) {
493
+ super(..._args6);
454
494
  this.label = params.spec.label;
455
495
  this.url = linkUrl;
456
496
  this.disabled = params.spec.disabled ?? false;
@@ -465,8 +505,8 @@ function createButtonComponent(params) {
465
505
  modalId: params.modalId
466
506
  });
467
507
  class DynamicButton extends Button {
468
- constructor(..._args2) {
469
- super(..._args2);
508
+ constructor(..._args7) {
509
+ super(..._args7);
470
510
  this.label = params.spec.label;
471
511
  this.customId = customId;
472
512
  this.style = style;
@@ -493,99 +533,34 @@ function createSelectComponent(params) {
493
533
  const type = normalizeLowercaseStringOrEmpty(params.spec.type ?? "string");
494
534
  const componentId = params.componentId ?? createShortId("sel_");
495
535
  const customId = buildDiscordComponentCustomId({ componentId });
496
- const createEntry = (selectType, label, options) => ({
497
- id: componentId,
498
- kind: "select",
499
- label,
500
- ...params.spec.callbackData !== void 0 ? { callbackData: params.spec.callbackData } : {},
501
- ...params.spec.callbackDataKind !== void 0 ? { callbackDataKind: params.spec.callbackDataKind } : {},
502
- selectType,
503
- ...options ? { options } : {},
504
- ...params.spec.allowedUsers !== void 0 ? { allowedUsers: params.spec.allowedUsers } : {}
505
- });
506
- if (type === "string") {
507
- const options = params.spec.options ?? [];
508
- if (options.length === 0) throw new Error("String select menus require options");
509
- class DynamicStringSelect extends StringSelectMenu {
510
- constructor(..._args3) {
511
- super(..._args3);
512
- this.customId = customId;
513
- this.options = options;
514
- this.minValues = params.spec.minValues;
515
- this.maxValues = params.spec.maxValues;
516
- this.placeholder = params.spec.placeholder;
517
- this.disabled = false;
518
- }
519
- }
520
- return {
521
- component: new DynamicStringSelect(),
522
- entry: createEntry("string", params.spec.placeholder ?? "select", options.map((option) => ({
536
+ const options = params.spec.options ?? [];
537
+ if (type === "string" && options.length === 0) throw new Error("String select menus require options");
538
+ const select = createDiscordSelectMenu(type, customId, options);
539
+ select.minValues = params.spec.minValues;
540
+ select.maxValues = params.spec.maxValues;
541
+ select.placeholder = params.spec.placeholder;
542
+ select.disabled = false;
543
+ return {
544
+ component: select,
545
+ entry: {
546
+ id: componentId,
547
+ kind: "select",
548
+ label: params.spec.placeholder ?? {
549
+ string: "select",
550
+ user: "user select",
551
+ role: "role select",
552
+ mentionable: "mentionable select",
553
+ channel: "channel select"
554
+ }[type],
555
+ ...params.spec.callbackData !== void 0 ? { callbackData: params.spec.callbackData } : {},
556
+ ...params.spec.callbackDataKind !== void 0 ? { callbackDataKind: params.spec.callbackDataKind } : {},
557
+ selectType: type,
558
+ ...type === "string" ? { options: options.map((option) => ({
523
559
  value: option.value,
524
560
  label: option.label
525
- })))
526
- };
527
- }
528
- if (type === "user") {
529
- class DynamicUserSelect extends UserSelectMenu {
530
- constructor(..._args4) {
531
- super(..._args4);
532
- this.customId = customId;
533
- this.minValues = params.spec.minValues;
534
- this.maxValues = params.spec.maxValues;
535
- this.placeholder = params.spec.placeholder;
536
- this.disabled = false;
537
- }
538
- }
539
- return {
540
- component: new DynamicUserSelect(),
541
- entry: createEntry("user", params.spec.placeholder ?? "user select")
542
- };
543
- }
544
- if (type === "role") {
545
- class DynamicRoleSelect extends RoleSelectMenu {
546
- constructor(..._args5) {
547
- super(..._args5);
548
- this.customId = customId;
549
- this.minValues = params.spec.minValues;
550
- this.maxValues = params.spec.maxValues;
551
- this.placeholder = params.spec.placeholder;
552
- this.disabled = false;
553
- }
554
- }
555
- return {
556
- component: new DynamicRoleSelect(),
557
- entry: createEntry("role", params.spec.placeholder ?? "role select")
558
- };
559
- }
560
- if (type === "mentionable") {
561
- class DynamicMentionableSelect extends MentionableSelectMenu {
562
- constructor(..._args6) {
563
- super(..._args6);
564
- this.customId = customId;
565
- this.minValues = params.spec.minValues;
566
- this.maxValues = params.spec.maxValues;
567
- this.placeholder = params.spec.placeholder;
568
- this.disabled = false;
569
- }
570
- }
571
- return {
572
- component: new DynamicMentionableSelect(),
573
- entry: createEntry("mentionable", params.spec.placeholder ?? "mentionable select")
574
- };
575
- }
576
- class DynamicChannelSelect extends ChannelSelectMenu {
577
- constructor(..._args7) {
578
- super(..._args7);
579
- this.customId = customId;
580
- this.minValues = params.spec.minValues;
581
- this.maxValues = params.spec.maxValues;
582
- this.placeholder = params.spec.placeholder;
583
- this.disabled = false;
561
+ })) } : {},
562
+ ...params.spec.allowedUsers !== void 0 ? { allowedUsers: params.spec.allowedUsers } : {}
584
563
  }
585
- }
586
- return {
587
- component: new DynamicChannelSelect(),
588
- entry: createEntry("channel", params.spec.placeholder ?? "channel select")
589
564
  };
590
565
  }
591
566
  function isSelectComponent(component) {
@@ -737,52 +712,19 @@ function createModalFieldComponent(field) {
737
712
  }
738
713
  return new DynamicTextInput();
739
714
  }
740
- if (field.type === "select") {
741
- const options = field.options ?? [];
742
- class DynamicModalSelect extends StringSelectMenu {
743
- constructor(..._args2) {
744
- super(..._args2);
745
- this.customId = field.id;
746
- this.options = options;
747
- this.required = field.required;
748
- this.minValues = field.minValues;
749
- this.maxValues = field.maxValues;
750
- this.placeholder = field.placeholder;
751
- }
752
- }
753
- return new DynamicModalSelect();
754
- }
755
- if (field.type === "role-select") {
756
- class DynamicModalRoleSelect extends RoleSelectMenu {
757
- constructor(..._args3) {
758
- super(..._args3);
759
- this.customId = field.id;
760
- this.required = field.required;
761
- this.minValues = field.minValues;
762
- this.maxValues = field.maxValues;
763
- this.placeholder = field.placeholder;
764
- }
765
- }
766
- return new DynamicModalRoleSelect();
767
- }
768
- if (field.type === "user-select") {
769
- class DynamicModalUserSelect extends UserSelectMenu {
770
- constructor(..._args4) {
771
- super(..._args4);
772
- this.customId = field.id;
773
- this.required = field.required;
774
- this.minValues = field.minValues;
775
- this.maxValues = field.maxValues;
776
- this.placeholder = field.placeholder;
777
- }
778
- }
779
- return new DynamicModalUserSelect();
715
+ if (field.type === "select" || field.type === "role-select" || field.type === "user-select") {
716
+ const select = createDiscordSelectMenu(field.type === "select" ? "string" : field.type === "role-select" ? "role" : "user", field.id, field.options);
717
+ select.required = field.required;
718
+ select.minValues = field.minValues;
719
+ select.maxValues = field.maxValues;
720
+ select.placeholder = field.placeholder;
721
+ return select;
780
722
  }
781
723
  if (field.type === "checkbox") {
782
724
  const options = field.options ?? [];
783
725
  class DynamicCheckboxGroup extends CheckboxGroup {
784
- constructor(..._args5) {
785
- super(..._args5);
726
+ constructor(..._args2) {
727
+ super(..._args2);
786
728
  this.customId = field.id;
787
729
  this.options = options;
788
730
  this.required = field.required;
@@ -794,8 +736,8 @@ function createModalFieldComponent(field) {
794
736
  }
795
737
  const options = field.options ?? [];
796
738
  class DynamicRadioGroup extends RadioGroup {
797
- constructor(..._args6) {
798
- super(..._args6);
739
+ constructor(..._args3) {
740
+ super(..._args3);
799
741
  this.customId = field.id;
800
742
  this.options = options;
801
743
  this.required = field.required;
@@ -812,8 +754,8 @@ var DiscordFormModal = class extends ModalBase {
812
754
  this.components = params.fields.map((field) => {
813
755
  const component = createModalFieldComponent(field);
814
756
  class DynamicLabel extends Label {
815
- constructor(..._args7) {
816
- super(..._args7);
757
+ constructor(..._args4) {
758
+ super(..._args4);
817
759
  this.label = field.label;
818
760
  this.description = field.description;
819
761
  this.component = component;
@@ -1,4 +1,4 @@
1
- import { l as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-CzzerX2K.js";
1
+ import { l as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-BFGRF9fE.js";
2
2
  import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
3
3
  import { resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-binding-runtime";
4
4
  //#region extensions/discord/src/monitor/conversation-binding-route.ts
@@ -1,4 +1,4 @@
1
- import { on as __exportAll } from "./retry-t5RcEsPk.js";
1
+ import { sn as __exportAll } from "./retry-BNCxiyyR.js";
2
2
  import { l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.js";
3
3
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
4
4
  import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
@@ -1,4 +1,4 @@
1
- import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-AA8wQx0D.js";
1
+ import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-BD4YL7wT.js";
2
2
  //#region extensions/discord/directory-contract-api.ts
3
3
  const discordDirectoryContractPlugin = {
4
4
  id: "discord",
@@ -1,4 +1,4 @@
1
- import { on as __exportAll } from "./retry-t5RcEsPk.js";
1
+ import { sn as __exportAll } from "./retry-BNCxiyyR.js";
2
2
  import { c as resolveDiscordAccount, m as normalizeDiscordToken } from "./accounts-CwJQoLjM.js";
3
3
  import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BfmEP6wp.js";
4
4
  import { a as normalizeDiscordSlug } from "./allow-list-C2JuH-R0.js";