@openclaw/discord 2026.5.27 → 2026.5.28-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-runtime-api.js +1 -1
- package/dist/{api-Kq7vtaSO.js → api-ChQJ1kfZ.js} +2 -5
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-BDxD97LJ.js → approval-handler.runtime-CIZiiFBd.js} +5 -18
- package/dist/{audit-BdUjE2tr.js → audit-D6BXQsYY.js} +3 -3
- package/dist/{channel-9YoMy5Jf.js → channel--B_psO5e.js} +16 -16
- package/dist/{channel-actions-DZfkB0nd.js → channel-actions-BOH34yJ5.js} +2 -2
- package/dist/{channel-actions.runtime-suaDJHH0.js → channel-actions.runtime-B1RCm1JP.js} +10 -13
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-B-kHacpx.js → channel.setup-COYdCbY_.js} +3 -3
- package/dist/{components-Dlc81IU5.js → components-DX5Baphr.js} +61 -20
- package/dist/{config-schema-CTzLsQlB.js → config-schema-3tZYNVTM.js} +13 -1
- package/dist/contract-api.js +2 -2
- package/dist/{conversation-identity-DAEgiGDV.js → conversation-identity-Dugx5WfH.js} +2 -2
- package/dist/{directory-config-Cgp0csDd.js → directory-config-CcjUkNgK.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-C-ECRrM8.js → directory-live-NOtxlJZ3.js} +2 -2
- package/dist/{doctor-Q80i7GdG.js → doctor-Dy7sI1sL.js} +1 -1
- package/dist/{handle-action.guild-admin-DWFTAcfd.js → handle-action.guild-admin-wC9VaAdl.js} +11 -8
- package/dist/index.js +1 -1
- package/dist/{manager.runtime-D6V2SPKr.js → manager.runtime-Bwgq6hJW.js} +4 -5
- package/dist/{message-handler-B5-UG_oD.js → message-handler-DhqxKFLP.js} +9 -9
- package/dist/{message-handler.preflight-Ddww-wnF.js → message-handler.preflight-BC8QmsWW.js} +10 -10
- package/dist/{message-handler.process-HWGh2NOP.js → message-handler.process-DE1an2G4.js} +85 -17
- package/dist/{message-utils-4w0_DPFE.js → message-utils-BlvuUPP4.js} +1 -1
- package/dist/{outbound-adapter-DYUYRaBd.js → outbound-adapter-BGrOFkR8.js} +9 -7
- package/dist/{pluralkit-BS1MuvYs.js → pluralkit-Cq_PUr06.js} +1 -1
- package/dist/{probe-DfIM7zSY.js → probe-CSBPZIYV.js} +1 -1
- package/dist/{probe.runtime-DoXDN3rt.js → probe.runtime-BhWW0223.js} +1 -1
- package/dist/{provider-CO6pih5z.js → provider-DIVQuJTw.js} +99 -44
- package/dist/{provider-session.runtime-BD5XLPI8.js → provider-session.runtime-C7jT_K-7.js} +3 -3
- package/dist/provider.runtime-BtnupyG-.js +2 -0
- package/dist/{resolve-allowlist-common-QzX-w4-_.js → resolve-allowlist-common-CzfIcLSO.js} +1 -1
- package/dist/{resolve-channels-pD06YNCU.js → resolve-channels-CQ13aBCV.js} +3 -3
- package/dist/{resolve-users-BiWLqNNO.js → resolve-users-Bj4Y4uWR.js} +3 -3
- package/dist/retry-after-CSukypPP.js +21 -0
- package/dist/{runtime-xSazIM0F.js → runtime-DA70ebm-.js} +26 -23
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +19 -19
- package/dist/runtime-api.lookup.js +5 -5
- package/dist/runtime-api.monitor-P-emTjcx.js +5 -0
- package/dist/runtime-api.monitor.js +4 -4
- package/dist/runtime-api.send.js +5 -5
- package/dist/runtime-api.threads.js +3 -3
- package/dist/{send-BzXZ8iUI.js → send-3r8QQkTY.js} +7 -7
- package/dist/{send.components-AK8K4TwB.js → send.components-2qRLUwBn.js} +6 -6
- package/dist/{send.outbound-ZrMnBa8C.js → send.outbound-LjX_KYiO.js} +3 -3
- package/dist/{send.receipt-BzfsP3Bb.js → send.receipt-Bo_43DQZ.js} +64 -35
- package/dist/{send.shared-ehnDGwXx.js → send.shared-CXctTF1I.js} +2 -2
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-ToNRC7ax.js → shared-D3NkInmq.js} +2 -2
- package/dist/{subagent-hooks-Di_2iXU8.js → subagent-hooks-DoWTMQyQ.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-DbqKnNPF.js → system-events-DV85gUxb.js} +1 -1
- package/dist/{target-resolver-DXPvq5-L.js → target-resolver-DVpZI7ZL.js} +2 -2
- package/dist/targets-0WHF7kV0.js +3 -0
- package/dist/{thread-bindings-Bw40FTRZ.js → thread-bindings-Cm3GqlNC.js} +4 -4
- package/dist/{thread-bindings.discord-api-irWYI8YX.js → thread-bindings.discord-api-JrJXT7L0.js} +4 -4
- package/dist/{thread-bindings.manager-LoYZzlss.js → thread-bindings.manager-DqJuGG-r.js} +3 -3
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{transcripts-source-CwahHAYt.js → transcripts-source-lEfSvSRD.js} +1 -1
- package/dist/{typing-Cv09OhaY.js → typing-DlT_14RX.js} +1 -1
- package/npm-shrinkwrap.json +3 -49
- package/openclaw.plugin.json +35 -1
- package/package.json +5 -7
- package/dist/inbound-context-B5EsqsSr.js +0 -48
- package/dist/provider.runtime-pUGk7VR5.js +0 -2
- package/dist/runtime-api.monitor-BjgSsR6H.js +0 -5
- package/dist/targets-BBVHRaeO.js +0 -3
- package/dist/test-api.js +0 -45
- package/node_modules/agent-base/LICENSE +0 -22
- package/node_modules/agent-base/README.md +0 -69
- package/node_modules/agent-base/dist/helpers.d.ts +0 -10
- package/node_modules/agent-base/dist/helpers.d.ts.map +0 -1
- package/node_modules/agent-base/dist/helpers.js +0 -37
- package/node_modules/agent-base/dist/helpers.js.map +0 -1
- package/node_modules/agent-base/dist/index.d.ts +0 -37
- package/node_modules/agent-base/dist/index.d.ts.map +0 -1
- package/node_modules/agent-base/dist/index.js +0 -146
- package/node_modules/agent-base/dist/index.js.map +0 -1
- package/node_modules/agent-base/package.json +0 -46
- package/node_modules/debug/LICENSE +0 -20
- package/node_modules/debug/README.md +0 -481
- package/node_modules/debug/package.json +0 -64
- package/node_modules/debug/src/browser.js +0 -272
- package/node_modules/debug/src/common.js +0 -292
- package/node_modules/debug/src/index.js +0 -10
- package/node_modules/debug/src/node.js +0 -263
- package/node_modules/https-proxy-agent/LICENSE +0 -22
- package/node_modules/https-proxy-agent/README.md +0 -70
- package/node_modules/https-proxy-agent/dist/index.d.ts +0 -43
- package/node_modules/https-proxy-agent/dist/index.d.ts.map +0 -1
- package/node_modules/https-proxy-agent/dist/index.js +0 -150
- package/node_modules/https-proxy-agent/dist/index.js.map +0 -1
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +0 -12
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts.map +0 -1
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js +0 -94
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +0 -1
- package/node_modules/https-proxy-agent/package.json +0 -50
- package/node_modules/ms/index.js +0 -162
- package/node_modules/ms/license.md +0 -21
- package/node_modules/ms/package.json +0 -38
- package/node_modules/ms/readme.md +0 -59
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { t as handleDiscordAction } from "./runtime-DA70ebm-.js";
|
|
2
2
|
export { handleDiscordAction };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as parseRetryAfterHeaderSeconds } from "./retry-after-CSukypPP.js";
|
|
1
2
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
2
3
|
import { resolveRetryConfig, retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
3
4
|
//#region extensions/discord/src/error-body.ts
|
|
@@ -41,11 +42,7 @@ function parseRetryAfterSeconds(text, response) {
|
|
|
41
42
|
if (retryAfter !== void 0) return retryAfter;
|
|
42
43
|
const header = response.headers.get("Retry-After");
|
|
43
44
|
if (!header) return;
|
|
44
|
-
|
|
45
|
-
if (Number.isFinite(parsed) && parsed >= 0) return parsed;
|
|
46
|
-
const retryAt = Date.parse(header);
|
|
47
|
-
if (!Number.isFinite(retryAt)) return;
|
|
48
|
-
return Math.max(0, (retryAt - Date.now()) / 1e3);
|
|
45
|
+
return parseRetryAfterHeaderSeconds(header);
|
|
49
46
|
}
|
|
50
47
|
function formatRetryAfterSeconds(value) {
|
|
51
48
|
if (value === void 0 || !Number.isFinite(value) || value < 0) return;
|
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-
|
|
1
|
+
import { Ht as parseDiscordTarget, Ut as resolveDiscordChannelId, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId, o as normalizeDiscordOutboundTarget } from "./send.receipt-Bo_43DQZ.js";
|
|
2
2
|
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-dXTfmnSZ.js";
|
|
3
3
|
import { t as inspectDiscordAccount } from "./account-inspect-C4sJZNbI.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-
|
|
5
|
-
import { n as fetchDiscord, r as requestDiscord, t as DiscordApiError } from "./api-
|
|
6
|
-
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-
|
|
7
|
-
import "./targets-
|
|
8
|
-
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, o as isDiscordExecApprovalApprover, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-
|
|
9
|
-
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel
|
|
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-DX5Baphr.js";
|
|
5
|
+
import { n as fetchDiscord, r as requestDiscord, t as DiscordApiError } from "./api-ChQJ1kfZ.js";
|
|
6
|
+
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-DVpZI7ZL.js";
|
|
7
|
+
import "./targets-0WHF7kV0.js";
|
|
8
|
+
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, o as isDiscordExecApprovalApprover, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-Dugx5WfH.js";
|
|
9
|
+
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel--B_psO5e.js";
|
|
10
10
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
11
|
-
import { t as discordSetupPlugin } from "./channel.setup-
|
|
12
|
-
import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-
|
|
13
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
14
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-
|
|
15
|
-
import { t as fetchPluralKitMessageInfo } from "./pluralkit-
|
|
16
|
-
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
11
|
+
import { t as discordSetupPlugin } from "./channel.setup-COYdCbY_.js";
|
|
12
|
+
import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-DoWTMQyQ.js";
|
|
13
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-wC9VaAdl.js";
|
|
14
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-CcjUkNgK.js";
|
|
15
|
+
import { t as fetchPluralKitMessageInfo } from "./pluralkit-Cq_PUr06.js";
|
|
16
|
+
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-CSBPZIYV.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-l_PsHQvX.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-
|
|
21
|
+
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-B1RCm1JP.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-
|
|
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-Bo_43DQZ.js";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-C4sJZNbI.js";
|
|
3
|
-
import { F as createDiscordClient, b as stripUndefinedFields } from "./send.shared-
|
|
4
|
-
import { i as shouldHandleDiscordApprovalRequest, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-
|
|
3
|
+
import { F as createDiscordClient, b as stripUndefinedFields } from "./send.shared-CXctTF1I.js";
|
|
4
|
+
import { i as shouldHandleDiscordApprovalRequest, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-Dugx5WfH.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";
|
|
@@ -41,9 +41,6 @@ var approval_handler_runtime_exports = /* @__PURE__ */ __exportAll({
|
|
|
41
41
|
buildExecApprovalCustomId: () => buildExecApprovalCustomId,
|
|
42
42
|
discordApprovalNativeRuntime: () => discordApprovalNativeRuntime
|
|
43
43
|
});
|
|
44
|
-
function isDecisionApprovalAction(action) {
|
|
45
|
-
return action.kind === "decision" && (action.decision === "allow-once" || action.decision === "allow-always" || action.decision === "deny");
|
|
46
|
-
}
|
|
47
44
|
function resolveHandlerContext(params) {
|
|
48
45
|
const context = params.context;
|
|
49
46
|
const accountId = normalizeOptionalString(params.accountId) ?? "";
|
|
@@ -97,21 +94,11 @@ var ExecApprovalActionRow = class extends Row {
|
|
|
97
94
|
}
|
|
98
95
|
};
|
|
99
96
|
function createApprovalActionRow(view) {
|
|
100
|
-
const actions = view.actions.filter(isDecisionApprovalAction);
|
|
101
|
-
if (actions.length === 0) return;
|
|
102
97
|
return new ExecApprovalActionRow({
|
|
103
98
|
approvalId: view.approvalId,
|
|
104
|
-
actions
|
|
99
|
+
actions: view.actions
|
|
105
100
|
});
|
|
106
101
|
}
|
|
107
|
-
function isCommandOnlyApprovalAction(action) {
|
|
108
|
-
return action.kind === "command" && typeof action.command === "string" && action.command.trim().length > 0;
|
|
109
|
-
}
|
|
110
|
-
function buildPluginCommandActionLines(actions) {
|
|
111
|
-
const commandActions = actions.filter(isCommandOnlyApprovalAction);
|
|
112
|
-
if (commandActions.length === 0) return [];
|
|
113
|
-
return ["### Actions", ...commandActions.map((action) => `- ${action.label}: \`${formatCommandPreview(action.command.trim(), 240)}\``)];
|
|
114
|
-
}
|
|
115
102
|
function buildApprovalMetadataLines(metadata) {
|
|
116
103
|
return metadata.map((item) => `- ${item.label}: ${item.value}`);
|
|
117
104
|
}
|
|
@@ -158,7 +145,7 @@ function createPluginApprovalRequestContainer(params) {
|
|
|
158
145
|
description: "A plugin action needs your approval.",
|
|
159
146
|
commandPreview: formatCommandPreview(params.view.title, 700),
|
|
160
147
|
commandSecondaryPreview: formatOptionalCommandPreview(params.view.description, 1e3),
|
|
161
|
-
metadataLines:
|
|
148
|
+
metadataLines: buildApprovalMetadataLines(params.view.metadata),
|
|
162
149
|
actionRow: params.actionRow,
|
|
163
150
|
footer: `Expires <t:${expiresAtSeconds}:R> · ID: ${params.view.approvalId}`,
|
|
164
151
|
accentColor
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-Bo_43DQZ.js";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-C4sJZNbI.js";
|
|
3
|
-
import { O as fetchChannelPermissionsDiscord } from "./send.shared-
|
|
4
|
-
import "./send-
|
|
3
|
+
import { O as fetchChannelPermissionsDiscord } from "./send.shared-CXctTF1I.js";
|
|
4
|
+
import "./send-3r8QQkTY.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-
|
|
1
|
+
import { Ht as parseDiscordTarget, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId } from "./send.receipt-Bo_43DQZ.js";
|
|
2
2
|
import { c as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.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-
|
|
4
|
+
import { x as resolveDiscordOutboundSessionRoute } from "./components-DX5Baphr.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-
|
|
6
|
+
import { c as shouldSuppressLocalDiscordExecApprovalPrompt, n as resolveDiscordCurrentConversationIdentity, r as getDiscordApprovalCapability } from "./conversation-identity-Dugx5WfH.js";
|
|
7
7
|
import { r as resolveRequiredDiscordChannelPermissions } from "./audit-core-xwjIczO0.js";
|
|
8
|
-
import { t as discordMessageActions$1 } from "./channel-actions-
|
|
8
|
+
import { t as discordMessageActions$1 } from "./channel-actions-BOH34yJ5.js";
|
|
9
9
|
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-D5gY2ZTE.js";
|
|
10
|
-
import { n as discordOutbound } from "./outbound-adapter-
|
|
11
|
-
import { a as discordSecurityAdapter, i as discordSetupAdapter, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-
|
|
10
|
+
import { n as discordOutbound } from "./outbound-adapter-BGrOFkR8.js";
|
|
11
|
+
import { a as discordSecurityAdapter, i as discordSetupAdapter, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-D3NkInmq.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";
|
|
@@ -114,29 +114,29 @@ let discordProbeRuntimePromise;
|
|
|
114
114
|
let discordAuditModulePromise;
|
|
115
115
|
let discordSendModulePromise;
|
|
116
116
|
let discordDirectoryLiveModulePromise;
|
|
117
|
-
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
118
|
-
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
119
|
-
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
120
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
121
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
117
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-CcjUkNgK.js").then((n) => n.t));
|
|
118
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-CQ13aBCV.js").then((n) => n.n));
|
|
119
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-Bj4Y4uWR.js").then((n) => n.n));
|
|
120
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-DqJuGG-r.js").then((n) => n.a));
|
|
121
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-DVpZI7ZL.js").then((n) => n.r));
|
|
122
122
|
async function loadDiscordProviderRuntime() {
|
|
123
|
-
discordProviderRuntimePromise ??= import("./provider.runtime-
|
|
123
|
+
discordProviderRuntimePromise ??= import("./provider.runtime-BtnupyG-.js");
|
|
124
124
|
return await discordProviderRuntimePromise;
|
|
125
125
|
}
|
|
126
126
|
async function loadDiscordProbeRuntime() {
|
|
127
|
-
discordProbeRuntimePromise ??= import("./probe.runtime-
|
|
127
|
+
discordProbeRuntimePromise ??= import("./probe.runtime-BhWW0223.js");
|
|
128
128
|
return await discordProbeRuntimePromise;
|
|
129
129
|
}
|
|
130
130
|
async function loadDiscordAuditModule() {
|
|
131
|
-
discordAuditModulePromise ??= import("./audit-
|
|
131
|
+
discordAuditModulePromise ??= import("./audit-D6BXQsYY.js").then((n) => n.n);
|
|
132
132
|
return await discordAuditModulePromise;
|
|
133
133
|
}
|
|
134
134
|
async function loadDiscordSendModule() {
|
|
135
|
-
discordSendModulePromise ??= import("./send-
|
|
135
|
+
discordSendModulePromise ??= import("./send-3r8QQkTY.js").then((n) => n.t);
|
|
136
136
|
return await discordSendModulePromise;
|
|
137
137
|
}
|
|
138
138
|
async function loadDiscordDirectoryLiveModule() {
|
|
139
|
-
discordDirectoryLiveModulePromise ??= import("./directory-live-
|
|
139
|
+
discordDirectoryLiveModulePromise ??= import("./directory-live-NOtxlJZ3.js").then((n) => n.t);
|
|
140
140
|
return await discordDirectoryLiveModulePromise;
|
|
141
141
|
}
|
|
142
142
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-dXTfmnSZ.js";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-C4sJZNbI.js";
|
|
3
|
-
import { d as readDiscordComponentSpec } from "./components-
|
|
3
|
+
import { d as readDiscordComponentSpec } from "./components-DX5Baphr.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";
|
|
@@ -22,7 +22,7 @@ const trustedRequesterGuildAdminActions = new Set([
|
|
|
22
22
|
]);
|
|
23
23
|
let discordChannelActionsRuntimePromise;
|
|
24
24
|
async function loadDiscordChannelActionsRuntime() {
|
|
25
|
-
discordChannelActionsRuntimePromise ??= import("./channel-actions.runtime-
|
|
25
|
+
discordChannelActionsRuntimePromise ??= import("./channel-actions.runtime-B1RCm1JP.js");
|
|
26
26
|
return await discordChannelActionsRuntimePromise;
|
|
27
27
|
}
|
|
28
28
|
function listDiscoverableDiscordAccounts(cfg) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Ut as resolveDiscordChannelId } from "./send.receipt-
|
|
2
|
-
import { i as buildDiscordPresentationComponents, r as buildDiscordInteractiveComponents } from "./components-
|
|
3
|
-
import { t as handleDiscordAction } from "./runtime-
|
|
4
|
-
import "./targets-
|
|
1
|
+
import { Ut as resolveDiscordChannelId } from "./send.receipt-Bo_43DQZ.js";
|
|
2
|
+
import { i as buildDiscordPresentationComponents, r as buildDiscordInteractiveComponents } from "./components-DX5Baphr.js";
|
|
3
|
+
import { t as handleDiscordAction } from "./runtime-DA70ebm-.js";
|
|
4
|
+
import "./targets-0WHF7kV0.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-
|
|
7
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-wC9VaAdl.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";
|
|
11
11
|
import { normalizeInteractiveReply, normalizeMessagePresentation } from "openclaw/plugin-sdk/interactive-runtime";
|
|
12
|
-
import {
|
|
12
|
+
import { readPositiveIntegerParam, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/agent-runtime";
|
|
13
13
|
//#region extensions/discord/src/actions/handle-action.ts
|
|
14
14
|
const providerId = "discord";
|
|
15
15
|
function readCurrentDiscordTarget(toolContext) {
|
|
@@ -114,10 +114,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
114
114
|
const question = readStringParam(params, "pollQuestion", { required: true });
|
|
115
115
|
const answers = readStringArrayParam(params, "pollOption", { required: true });
|
|
116
116
|
const allowMultiselect = readBooleanParam(params, "pollMulti");
|
|
117
|
-
const durationHours =
|
|
118
|
-
integer: true,
|
|
119
|
-
strict: true
|
|
120
|
-
});
|
|
117
|
+
const durationHours = readPositiveIntegerParam(params, "pollDurationHours");
|
|
121
118
|
const result = await handleDiscordAction({
|
|
122
119
|
action: "poll",
|
|
123
120
|
accountId: accountId ?? void 0,
|
|
@@ -150,7 +147,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
150
147
|
}
|
|
151
148
|
if (action === "reactions") {
|
|
152
149
|
const messageId = readStringParam(params, "messageId", { required: true });
|
|
153
|
-
const limit =
|
|
150
|
+
const limit = readPositiveIntegerParam(params, "limit");
|
|
154
151
|
return await handleDiscordAction({
|
|
155
152
|
action: "reactions",
|
|
156
153
|
accountId: accountId ?? void 0,
|
|
@@ -160,7 +157,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
160
157
|
}, cfg, actionOptions);
|
|
161
158
|
}
|
|
162
159
|
if (action === "read") {
|
|
163
|
-
const limit =
|
|
160
|
+
const limit = readPositiveIntegerParam(params, "limit");
|
|
164
161
|
return await handleDiscordAction({
|
|
165
162
|
action: "readMessages",
|
|
166
163
|
accountId: accountId ?? void 0,
|
|
@@ -209,7 +206,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
209
206
|
const name = readStringParam(params, "threadName", { required: true });
|
|
210
207
|
const messageId = readStringParam(params, "messageId");
|
|
211
208
|
const content = readStringParam(params, "message");
|
|
212
|
-
const autoArchiveMinutes =
|
|
209
|
+
const autoArchiveMinutes = readPositiveIntegerParam(params, "autoArchiveMin");
|
|
213
210
|
const appliedTags = readStringArrayParam(params, "appliedTags");
|
|
214
211
|
const result = await handleDiscordAction({
|
|
215
212
|
action: "threadCreate",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DiscordChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as DiscordChannelConfigSchema } from "./config-schema-3tZYNVTM.js";
|
|
2
2
|
export { DiscordChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordPlugin } from "./channel
|
|
1
|
+
import { t as discordPlugin } from "./channel--B_psO5e.js";
|
|
2
2
|
export { discordPlugin };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, l as resolveDiscordAccountConfig, m as resolveDiscordToken, o as resolveDefaultDiscordAccountId } from "./accounts-dXTfmnSZ.js";
|
|
2
2
|
import "./channel-api-CAJ0wMoV.js";
|
|
3
|
-
import { i as discordSetupAdapter, t as createDiscordPluginBase } from "./shared-
|
|
4
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
5
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
3
|
+
import { i as discordSetupAdapter, t as createDiscordPluginBase } from "./shared-D3NkInmq.js";
|
|
4
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-CQ13aBCV.js";
|
|
5
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-Bj4Y4uWR.js";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
7
|
import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
8
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-Bo_43DQZ.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";
|
|
@@ -48,19 +48,38 @@ function resolveDiscordOutboundTargetKindHint(params) {
|
|
|
48
48
|
//#region extensions/discord/src/component-custom-id.ts
|
|
49
49
|
const DISCORD_COMPONENT_CUSTOM_ID_KEY = "occomp";
|
|
50
50
|
const DISCORD_MODAL_CUSTOM_ID_KEY = "ocmodal";
|
|
51
|
+
const ENCODED_CUSTOM_ID_VERSION = "1";
|
|
52
|
+
function encodeCustomIdValue(value) {
|
|
53
|
+
return value.replace(/%/g, "%25").replace(/;/g, "%3B");
|
|
54
|
+
}
|
|
55
|
+
function needsCustomIdEncoding(value) {
|
|
56
|
+
return /[%;]/.test(value);
|
|
57
|
+
}
|
|
58
|
+
function decodeCustomIdValue(value) {
|
|
59
|
+
return value.replace(/%(25|3B)/gi, (match) => match.toLowerCase() === "%25" ? "%" : ";");
|
|
60
|
+
}
|
|
61
|
+
function decodeParsedCustomIdData(data) {
|
|
62
|
+
if (data.e !== ENCODED_CUSTOM_ID_VERSION) return data;
|
|
63
|
+
return Object.fromEntries(Object.entries(data).map(([key, value]) => [key, typeof value === "string" ? decodeCustomIdValue(value) : value]));
|
|
64
|
+
}
|
|
51
65
|
function buildDiscordComponentCustomId(params) {
|
|
52
|
-
const
|
|
53
|
-
|
|
66
|
+
const encoded = needsCustomIdEncoding(params.componentId) || needsCustomIdEncoding(params.modalId ?? "");
|
|
67
|
+
const componentId = encoded ? encodeCustomIdValue(params.componentId) : params.componentId;
|
|
68
|
+
const base = encoded ? `${DISCORD_COMPONENT_CUSTOM_ID_KEY}:e=${ENCODED_CUSTOM_ID_VERSION};cid=${componentId}` : `${DISCORD_COMPONENT_CUSTOM_ID_KEY}:cid=${componentId}`;
|
|
69
|
+
const modalId = params.modalId;
|
|
70
|
+
if (!modalId) return base;
|
|
71
|
+
return `${base};mid=${encoded ? encodeCustomIdValue(modalId) : modalId}`;
|
|
54
72
|
}
|
|
55
73
|
function buildDiscordModalCustomId(modalId) {
|
|
56
|
-
return `${DISCORD_MODAL_CUSTOM_ID_KEY}:mid=${modalId}`;
|
|
74
|
+
return needsCustomIdEncoding(modalId) ? `${DISCORD_MODAL_CUSTOM_ID_KEY}:e=${ENCODED_CUSTOM_ID_VERSION};mid=${encodeCustomIdValue(modalId)}` : `${DISCORD_MODAL_CUSTOM_ID_KEY}:mid=${modalId}`;
|
|
57
75
|
}
|
|
58
76
|
function parseDiscordComponentCustomId(id) {
|
|
59
77
|
const parsed = parseCustomId(id);
|
|
60
78
|
if (parsed.key !== "occomp") return null;
|
|
61
|
-
const
|
|
79
|
+
const data = decodeParsedCustomIdData(parsed.data);
|
|
80
|
+
const componentId = data.cid;
|
|
62
81
|
if (typeof componentId !== "string" || !componentId.trim()) return null;
|
|
63
|
-
const modalId =
|
|
82
|
+
const modalId = data.mid;
|
|
64
83
|
return {
|
|
65
84
|
componentId,
|
|
66
85
|
modalId: typeof modalId === "string" && modalId.trim() ? modalId : void 0
|
|
@@ -69,7 +88,7 @@ function parseDiscordComponentCustomId(id) {
|
|
|
69
88
|
function parseDiscordModalCustomId(id) {
|
|
70
89
|
const parsed = parseCustomId(id);
|
|
71
90
|
if (parsed.key !== "ocmodal") return null;
|
|
72
|
-
const modalId = parsed.data.mid;
|
|
91
|
+
const modalId = decodeParsedCustomIdData(parsed.data).mid;
|
|
73
92
|
if (typeof modalId !== "string" || !modalId.trim()) return null;
|
|
74
93
|
return modalId;
|
|
75
94
|
}
|
|
@@ -85,7 +104,7 @@ function parseDiscordComponentCustomIdForInteraction(id) {
|
|
|
85
104
|
if (parsed.key !== "occomp") return parsed;
|
|
86
105
|
return {
|
|
87
106
|
key: "*",
|
|
88
|
-
data: parsed.data
|
|
107
|
+
data: decodeParsedCustomIdData(parsed.data)
|
|
89
108
|
};
|
|
90
109
|
}
|
|
91
110
|
function parseDiscordModalCustomIdForInteraction(id) {
|
|
@@ -97,7 +116,7 @@ function parseDiscordModalCustomIdForInteraction(id) {
|
|
|
97
116
|
if (parsed.key !== "ocmodal") return parsed;
|
|
98
117
|
return {
|
|
99
118
|
key: "*",
|
|
100
|
-
data: parsed.data
|
|
119
|
+
data: decodeParsedCustomIdData(parsed.data)
|
|
101
120
|
};
|
|
102
121
|
}
|
|
103
122
|
//#endregion
|
|
@@ -125,8 +144,11 @@ function readOptionalStringArray(value, label) {
|
|
|
125
144
|
if (value.length === 0) return;
|
|
126
145
|
return value.map((entry, index) => readString(entry, `${label}[${index}]`));
|
|
127
146
|
}
|
|
128
|
-
function
|
|
129
|
-
if (
|
|
147
|
+
function readOptionalInteger(value, label, bounds) {
|
|
148
|
+
if (value == null) return;
|
|
149
|
+
if (typeof value !== "number" || !Number.isFinite(value) || !Number.isInteger(value)) throw new Error(`${label} must be an integer`);
|
|
150
|
+
if (bounds?.min !== void 0 && value < bounds.min) throw new Error(`${label} must be at least ${bounds.min}`);
|
|
151
|
+
if (bounds?.max !== void 0 && value > bounds.max) throw new Error(`${label} must be at most ${bounds.max}`);
|
|
130
152
|
return value;
|
|
131
153
|
}
|
|
132
154
|
function readOptionalEmoji(value, label) {
|
|
@@ -217,8 +239,14 @@ function parseSelectSpec(raw, label) {
|
|
|
217
239
|
type,
|
|
218
240
|
callbackData: readOptionalString(obj.callbackData),
|
|
219
241
|
placeholder: readOptionalString(obj.placeholder),
|
|
220
|
-
minValues:
|
|
221
|
-
|
|
242
|
+
minValues: readOptionalInteger(obj.minValues, `${label}.minValues`, {
|
|
243
|
+
min: 0,
|
|
244
|
+
max: 25
|
|
245
|
+
}),
|
|
246
|
+
maxValues: readOptionalInteger(obj.maxValues, `${label}.maxValues`, {
|
|
247
|
+
min: 1,
|
|
248
|
+
max: 25
|
|
249
|
+
}),
|
|
222
250
|
options: parseSelectOptions(obj.options, `${label}.options`),
|
|
223
251
|
allowedUsers: readOptionalStringArray(obj.allowedUsers, `${label}.allowedUsers`)
|
|
224
252
|
};
|
|
@@ -241,18 +269,33 @@ function parseModalField(raw, label, index) {
|
|
|
241
269
|
"radio",
|
|
242
270
|
"select"
|
|
243
271
|
].includes(type) && (!options || options.length === 0)) throw new Error(`${label}.options is required for ${type} fields`);
|
|
272
|
+
if (type === "radio" && (obj.minValues != null || obj.maxValues != null)) throw new Error(`${label}.minValues/maxValues are not supported for radio fields`);
|
|
273
|
+
const required = typeof obj.required === "boolean" ? obj.required : void 0;
|
|
274
|
+
const maxValues = type === "checkbox" ? 10 : 25;
|
|
244
275
|
return {
|
|
245
276
|
type,
|
|
246
277
|
name: normalizeModalFieldName(readOptionalString(obj.name), index),
|
|
247
278
|
label: readString(obj.label, `${label}.label`),
|
|
248
279
|
description: readOptionalString(obj.description),
|
|
249
280
|
placeholder: readOptionalString(obj.placeholder),
|
|
250
|
-
required
|
|
281
|
+
required,
|
|
251
282
|
options,
|
|
252
|
-
minValues:
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
283
|
+
minValues: readOptionalInteger(obj.minValues, `${label}.minValues`, {
|
|
284
|
+
min: required === false ? 0 : 1,
|
|
285
|
+
max: maxValues
|
|
286
|
+
}),
|
|
287
|
+
maxValues: readOptionalInteger(obj.maxValues, `${label}.maxValues`, {
|
|
288
|
+
min: 1,
|
|
289
|
+
max: maxValues
|
|
290
|
+
}),
|
|
291
|
+
minLength: readOptionalInteger(obj.minLength, `${label}.minLength`, {
|
|
292
|
+
min: 0,
|
|
293
|
+
max: 4e3
|
|
294
|
+
}),
|
|
295
|
+
maxLength: readOptionalInteger(obj.maxLength, `${label}.maxLength`, {
|
|
296
|
+
min: 1,
|
|
297
|
+
max: 4e3
|
|
298
|
+
}),
|
|
256
299
|
style: readOptionalString(obj.style)
|
|
257
300
|
};
|
|
258
301
|
}
|
|
@@ -734,8 +777,6 @@ function createModalFieldComponent(field) {
|
|
|
734
777
|
this.customId = field.id;
|
|
735
778
|
this.options = options;
|
|
736
779
|
this.required = field.required;
|
|
737
|
-
this.minValues = field.minValues;
|
|
738
|
-
this.maxValues = field.maxValues;
|
|
739
780
|
}
|
|
740
781
|
}
|
|
741
782
|
return new DynamicRadioGroup();
|
|
@@ -90,6 +90,10 @@ const DiscordChannelConfigSchema = buildChannelConfigSchema(DiscordConfigSchema,
|
|
|
90
90
|
label: "Discord Progress Tool Lines",
|
|
91
91
|
help: "Show compact tool/progress lines in progress draft mode (default: true). Set false to keep only the label until final delivery."
|
|
92
92
|
},
|
|
93
|
+
"streaming.progress.commentary": {
|
|
94
|
+
label: "Discord Progress Commentary",
|
|
95
|
+
help: "Show assistant commentary/preamble text in the temporary progress draft. Final answer delivery is unchanged."
|
|
96
|
+
},
|
|
93
97
|
"streaming.progress.commandText": {
|
|
94
98
|
label: "Discord Progress Command Text",
|
|
95
99
|
help: "Command/exec detail in progress draft lines: \"raw\" preserves released behavior; \"status\" shows only the tool label."
|
|
@@ -222,9 +226,17 @@ const DiscordChannelConfigSchema = buildChannelConfigSchema(DiscordConfigSchema,
|
|
|
222
226
|
label: "Discord Realtime Model",
|
|
223
227
|
help: "Provider realtime session model, such as gpt-realtime-2. This is separate from voice.model, which remains the OpenClaw agent brain model."
|
|
224
228
|
},
|
|
229
|
+
"voice.realtime.speakerVoice": {
|
|
230
|
+
label: "Discord Realtime Speaker Voice",
|
|
231
|
+
help: "Provider realtime output voice name, such as cedar."
|
|
232
|
+
},
|
|
233
|
+
"voice.realtime.speakerVoiceId": {
|
|
234
|
+
label: "Discord Realtime Speaker Voice ID",
|
|
235
|
+
help: "Provider realtime output voice id."
|
|
236
|
+
},
|
|
225
237
|
"voice.realtime.voice": {
|
|
226
238
|
label: "Discord Realtime Voice",
|
|
227
|
-
help: "
|
|
239
|
+
help: "Deprecated provider realtime output voice. Use voice.realtime.speakerVoice."
|
|
228
240
|
},
|
|
229
241
|
"voice.realtime.toolPolicy": {
|
|
230
242
|
label: "Discord Realtime Tool Policy",
|
package/dist/contract-api.js
CHANGED
|
@@ -2,7 +2,7 @@ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doc
|
|
|
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-
|
|
6
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-
|
|
5
|
+
import { i as testing, n as createThreadBindingManager } from "./thread-bindings.manager-DqJuGG-r.js";
|
|
6
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-CcjUkNgK.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-
|
|
1
|
+
import { Ht as parseDiscordTarget } from "./send.receipt-Bo_43DQZ.js";
|
|
2
2
|
import { r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.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";
|
|
@@ -229,7 +229,7 @@ function createDiscordApprovalCapability(configOverride) {
|
|
|
229
229
|
request,
|
|
230
230
|
configOverride
|
|
231
231
|
}),
|
|
232
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
232
|
+
load: async () => (await import("./approval-handler.runtime-CIZiiFBd.js").then((n) => n.t)).discordApprovalNativeRuntime
|
|
233
233
|
})
|
|
234
234
|
});
|
|
235
235
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-Bo_43DQZ.js";
|
|
2
2
|
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, o as resolveDefaultDiscordAccountId } from "./accounts-dXTfmnSZ.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-
|
|
1
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-CcjUkNgK.js";
|
|
2
2
|
export { listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-Bo_43DQZ.js";
|
|
2
2
|
import { p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.js";
|
|
3
|
-
import { n as fetchDiscord } from "./api-
|
|
3
|
+
import { n as fetchDiscord } from "./api-ChQJ1kfZ.js";
|
|
4
4
|
import { a as normalizeDiscordSlug } from "./allow-list-BnkWtVpA.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";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as resolveDefaultDiscordAccountId } from "./accounts-dXTfmnSZ.js";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-C4sJZNbI.js";
|
|
3
|
-
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-
|
|
3
|
+
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-D3NkInmq.js";
|
|
4
4
|
import { n as normalizeCompatibilityConfig } from "./doctor-contract-8-Ia3d_X.js";
|
|
5
5
|
import { t as isDiscordMutableAllowEntry } from "./security-doctor-uUo8hTD5.js";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
package/dist/{handle-action.guild-admin-DWFTAcfd.js → handle-action.guild-admin-wC9VaAdl.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as readDiscordChannelCreateParams, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { a as readDiscordChannelCreateParams, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-DA70ebm-.js";
|
|
2
2
|
import "./action-runtime-api.js";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
-
import {
|
|
4
|
+
import { readNonNegativeIntegerParam, readPositiveIntegerParam, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/agent-runtime";
|
|
5
5
|
//#region extensions/discord/src/actions/handle-action.guild-admin.ts
|
|
6
6
|
function readDiscordRequesterSenderId(ctx) {
|
|
7
7
|
return ctx.toolContext?.currentChannelProvider?.trim().toLowerCase() === "discord" ? normalizeOptionalString(ctx.requesterSenderId) : void 0;
|
|
@@ -157,7 +157,7 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
157
157
|
if (action === "category-create") {
|
|
158
158
|
const guildId = readStringParam(actionParams, "guildId", { required: true });
|
|
159
159
|
const name = readStringParam(actionParams, "name", { required: true });
|
|
160
|
-
const position =
|
|
160
|
+
const position = readNonNegativeIntegerParam(actionParams, "position");
|
|
161
161
|
return await handleDiscordAction({
|
|
162
162
|
action: "categoryCreate",
|
|
163
163
|
accountId: accountId ?? void 0,
|
|
@@ -170,7 +170,7 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
170
170
|
if (action === "category-edit") {
|
|
171
171
|
const categoryId = readStringParam(actionParams, "categoryId", { required: true });
|
|
172
172
|
const name = readStringParam(actionParams, "name");
|
|
173
|
-
const position =
|
|
173
|
+
const position = readNonNegativeIntegerParam(actionParams, "position");
|
|
174
174
|
return await handleDiscordAction({
|
|
175
175
|
action: "categoryEdit",
|
|
176
176
|
accountId: accountId ?? void 0,
|
|
@@ -235,8 +235,11 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
235
235
|
if (isDiscordModerationAction(action)) {
|
|
236
236
|
const moderation = readDiscordModerationCommand(action, {
|
|
237
237
|
...actionParams,
|
|
238
|
-
durationMinutes:
|
|
239
|
-
deleteMessageDays:
|
|
238
|
+
durationMinutes: readNonNegativeIntegerParam(actionParams, "durationMin"),
|
|
239
|
+
deleteMessageDays: readNonNegativeIntegerParam(actionParams, "deleteDays", {
|
|
240
|
+
max: 7,
|
|
241
|
+
message: "deleteDays must be an integer from 0 to 7"
|
|
242
|
+
})
|
|
240
243
|
});
|
|
241
244
|
const senderUserId = normalizeOptionalString(ctx.requesterSenderId);
|
|
242
245
|
return await handleDiscordAction({
|
|
@@ -256,7 +259,7 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
256
259
|
const channelId = readStringParam(actionParams, "channelId");
|
|
257
260
|
const includeArchived = typeof actionParams.includeArchived === "boolean" ? actionParams.includeArchived : void 0;
|
|
258
261
|
const before = readStringParam(actionParams, "before");
|
|
259
|
-
const limit =
|
|
262
|
+
const limit = readPositiveIntegerParam(actionParams, "limit");
|
|
260
263
|
return await handleDiscordAction({
|
|
261
264
|
action: "threadList",
|
|
262
265
|
accountId: accountId ?? void 0,
|
|
@@ -296,7 +299,7 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
296
299
|
channelIds: readStringArrayParam(actionParams, "channelIds"),
|
|
297
300
|
authorId: readStringParam(actionParams, "authorId"),
|
|
298
301
|
authorIds: readStringArrayParam(actionParams, "authorIds"),
|
|
299
|
-
limit:
|
|
302
|
+
limit: readPositiveIntegerParam(actionParams, "limit")
|
|
300
303
|
}, cfg);
|
|
301
304
|
}
|
|
302
305
|
}
|
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-
|
|
2
|
+
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-lEfSvSRD.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
|