@openclaw/discord 2026.7.2-beta.2 → 2026.7.2-beta.3
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/{activities-api-D0D_87n3.js → activities-api-DS1L7KRY.js} +15 -42
- package/dist/activities-api.js +1 -1
- package/dist/{allow-list-B7qOH5xu.js → allow-list-DzKrtfah.js} +18 -7
- package/dist/{api-B88T4rFN.js → api-C43z8vUm.js} +3 -1
- package/dist/api.js +25 -16
- package/dist/{approval-handler.runtime-B7E1-x5q.js → approval-handler.runtime-BbkfPoGc.js} +5 -6
- package/dist/{conversation-identity-BPcbhCAH.js → approval-message-safety-DrLlgIPz.js} +48 -2
- package/dist/{audit-CjpnY1yb.js → audit-BC6bgPMX.js} +3 -3
- package/dist/{channel-BDfKr14H.js → channel-5MfaC2IE.js} +18 -18
- package/dist/{channel-actions-BQct-o4T.js → channel-actions-DicWTbYH.js} +2 -2
- package/dist/{channel-actions.runtime-CC4QwYVO.js → channel-actions.runtime-D9Qadn-l.js} +8 -8
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-BS4gd8sc.js → channel.setup-CJXfFclP.js} +3 -3
- package/dist/{chunk-CHpY_lsO.js → chunk-CWzmeWf_.js} +9 -49
- package/dist/{config-schema-CoDck1GW.js → config-schema-BxrgfSMD.js} +4 -0
- package/dist/{directory-config-G1QwBIdi.js → directory-config-CmukHSms.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-nfvekMil.js → directory-live-BYlCRO__.js} +3 -3
- package/dist/{doctor-Bq4pJAQk.js → doctor-Ci7USQAW.js} +1 -1
- package/dist/{handle-action.guild-admin-LYY75_Oa.js → handle-action.guild-admin-Bsk2YBPs.js} +2 -2
- package/dist/index.js +2 -2
- package/dist/{manager.runtime-w6VVYQMl.js → manager.runtime-Cc8vS-M7.js} +98 -145
- package/dist/message-handler-CWJ-mQvH.js +590 -0
- package/dist/{message-handler.preflight-DnAH04Ss.js → message-handler.preflight-DK46_qbS.js} +16 -15
- package/dist/{message-handler.process-ClgKz8I5.js → message-handler.process-BK0mjFJH.js} +37 -61
- package/dist/{message-utils-BU3gc01v.js → message-utils-Cfe6CZ6N.js} +1 -1
- package/dist/{outbound-adapter-ByoXsR-V.js → outbound-adapter-B2_oa-zV.js} +36 -5
- package/dist/{outbound-components-7wAolLuS.js → outbound-components-BGhk6HI3.js} +3 -3
- package/dist/{outbound-session-route-D4QqePZN.js → outbound-session-route-M2bEY9tI.js} +36 -6
- package/dist/{pluralkit-r4wiI2yy.js → pluralkit-CT0VRsZd.js} +1 -1
- package/dist/{probe-WKeTYyJX.js → probe-C3SCKyYU.js} +1 -1
- package/dist/{probe.runtime-CRY-qUke.js → probe.runtime-D55QqC9u.js} +1 -1
- package/dist/{provider-PRlF_lZm.js → provider-HW0G-2l6.js} +868 -794
- package/dist/{provider-session.runtime-BZPUZRjn.js → provider-session.runtime-cCfGMsF_.js} +3 -3
- package/dist/provider.runtime-BWCRsVoT.js +2 -0
- package/dist/{resolve-allowlist-common-QN7VMZaC.js → resolve-allowlist-common-CJlqw_nC.js} +2 -2
- package/dist/{resolve-channels-BO9NUPlS.js → resolve-channels-9KcG3mLg.js} +4 -4
- package/dist/{resolve-users-CU3oG5-m.js → resolve-users-GCGf3oV0.js} +3 -3
- package/dist/{runtime-CCf5nkV3.js → runtime-CD5MRZkD.js} +1 -2
- package/dist/{runtime-BsefAQ9q.js → runtime-Z2qkKakn.js} +9 -8
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +23 -22
- package/dist/runtime-api.lookup.js +5 -5
- package/dist/runtime-api.monitor-C3EDYJqk.js +6 -0
- package/dist/runtime-api.monitor.js +8 -8
- package/dist/runtime-api.send.js +6 -5
- package/dist/runtime-api.threads.js +3 -3
- package/dist/{secret-config-contract-BDNrRWvd.js → secret-config-contract-B1akrlyY.js} +1 -0
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/{security-audit.runtime-K0nkzjzJ.js → security-audit.runtime-DEEywczv.js} +1 -1
- package/dist/{send-JJzVo_sK.js → send-CSRxNNgq.js} +7 -86
- package/dist/{send.components-CCRW54gK.js → send.components-DLqzOEPJ.js} +5 -4
- package/dist/{send.outbound-Cvulb-k_.js → send.outbound-C1SfX20w.js} +4 -3
- package/dist/send.reactions-Cj4ugX3F.js +85 -0
- package/dist/send.receipt-CuwRrpFz.js +48 -0
- package/dist/{send.shared-XuOTO1dW.js → send.shared-Dber6X57.js} +2 -2
- package/dist/{sender-identity-C62lBe18.js → sender-identity-mG_zsdox.js} +1 -1
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-Bngr0I-v.js → shared-BEhmAdMY.js} +5 -5
- package/dist/{subagent-hooks-mSxRv4AE.js → subagent-hooks-Wrk61DwY.js} +2 -2
- package/dist/subagent-hooks-api.js +10 -1
- package/dist/subagent-progress-B2fpHe3m.js +662 -0
- package/dist/{system-events-BANBRAe3.js → system-events-AhfcKRRb.js} +2 -2
- package/dist/{target-resolver-BaEmTxeK.js → target-resolver-vqLA450R.js} +2 -2
- package/dist/targets-BjEMIe8t.js +3 -0
- package/dist/{thread-bindings-4MV-u8vU.js → thread-bindings-CJQoXuWY.js} +4 -4
- package/dist/{thread-bindings.discord-api-DXfXsHGZ.js → thread-bindings.discord-api-mNCWlgvM.js} +4 -4
- package/dist/{thread-bindings.manager-DJ4cO5Eu.js → thread-bindings.manager-D1z8mK4b.js} +3 -3
- package/dist/{timeouts-D5lWili0.js → timeouts-B9cy6RvQ.js} +1 -6
- package/dist/{transcripts-source-TDZcMriu.js → transcripts-source-DjDbt14x.js} +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-CKd2NMWG.js → typing-wxtm1NlF.js} +2 -2
- package/npm-shrinkwrap.json +3 -3
- package/openclaw.plugin.json +10 -0
- package/package.json +4 -4
- package/dist/approval-message-safety-C-8BL6Kv.js +0 -47
- package/dist/message-handler-DExaghWK.js +0 -331
- package/dist/provider.runtime-BX8GcCYx.js +0 -2
- package/dist/runtime-api.monitor-DCS_ETft.js +0 -6
- package/dist/targets-fjJt3PYG.js +0 -3
- package/dist/{security-audit-aLbWmUjl.js → security-audit-DtT0SIns.js} +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { t as handleDiscordAction } from "./runtime-Z2qkKakn.js";
|
|
2
2
|
export { handleDiscordAction };
|
|
@@ -1,38 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { u as resolveDiscordChannelId$1 } from "./chunk-CWzmeWf_.js";
|
|
2
2
|
import { n as isDiscordAccountEnabledForRuntime, r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-CMd4nzLB.js";
|
|
3
|
-
import { i as resolveDiscordActivitiesConfig, r as setDiscordActivitiesRuntime, t as DiscordActivitiesRuntime } from "./runtime-
|
|
4
|
-
import {
|
|
5
|
-
import { r as
|
|
6
|
-
import { r as sendDiscordComponentMessage } from "./send.components-CCRW54gK.js";
|
|
3
|
+
import { i as resolveDiscordActivitiesConfig, r as setDiscordActivitiesRuntime, t as DiscordActivitiesRuntime } from "./runtime-CD5MRZkD.js";
|
|
4
|
+
import { S as parseDiscordActivityCustomId, a as buildDiscordPresentationComponents } from "./outbound-session-route-M2bEY9tI.js";
|
|
5
|
+
import { r as sendDiscordComponentMessage } from "./send.components-DLqzOEPJ.js";
|
|
7
6
|
import fs from "node:fs/promises";
|
|
8
7
|
import { logError } from "openclaw/plugin-sdk/logging-core";
|
|
9
8
|
import { resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
|
|
10
9
|
import { randomBytes } from "node:crypto";
|
|
11
10
|
import { Type } from "typebox";
|
|
12
|
-
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
13
11
|
import { readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
|
|
14
12
|
import { fetchWithSsrFGuard as fetchWithSsrFGuard$1 } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
15
13
|
import { jsonResult, readStringParam } from "openclaw/plugin-sdk/channel-actions";
|
|
16
14
|
import { escapeHtml } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
17
15
|
import { WidgetHtmlInputError, assertWidgetHtmlSize, isCompleteHtmlDocument } from "openclaw/plugin-sdk/widget-html";
|
|
18
|
-
//#region extensions/discord/src/activities/allowlist.ts
|
|
19
|
-
const ACTIVITY_ALLOWLIST_PREFIXES = [
|
|
20
|
-
"discord:",
|
|
21
|
-
"user:",
|
|
22
|
-
"pk:"
|
|
23
|
-
];
|
|
24
|
-
function resolveActivityUserAuthorized(account, user) {
|
|
25
|
-
const allowList = normalizeDiscordAllowList([...account.allowFrom ?? [], ...account.dm?.allowFrom ?? []], ACTIVITY_ALLOWLIST_PREFIXES);
|
|
26
|
-
if (!allowList) return (account.dmPolicy ?? account.dm?.policy) === "open";
|
|
27
|
-
const discriminator = user.discriminator?.trim();
|
|
28
|
-
const tag = user.username && discriminator && discriminator !== "0" ? `${user.username}#${discriminator}` : user.username;
|
|
29
|
-
return allowListMatches(allowList, {
|
|
30
|
-
id: user.id,
|
|
31
|
-
name: user.username,
|
|
32
|
-
tag
|
|
33
|
-
}, { allowNameMatching: isDangerousNameMatchingEnabled(account) });
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
16
|
//#region extensions/discord/src/activities/discord-api.ts
|
|
37
17
|
const DISCORD_TOKEN_URL = "https://discord.com/api/oauth2/token";
|
|
38
18
|
const DISCORD_USER_URL = "https://discord.com/api/v10/users/@me";
|
|
@@ -62,10 +42,13 @@ async function fetchDiscordJson(params) {
|
|
|
62
42
|
timeoutMs: 15e3
|
|
63
43
|
});
|
|
64
44
|
try {
|
|
65
|
-
if (!response.ok)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
45
|
+
if (!response.ok) {
|
|
46
|
+
await response.body?.cancel().catch(() => void 0);
|
|
47
|
+
return {
|
|
48
|
+
ok: false,
|
|
49
|
+
status: response.status
|
|
50
|
+
};
|
|
51
|
+
}
|
|
69
52
|
return {
|
|
70
53
|
ok: true,
|
|
71
54
|
status: response.status,
|
|
@@ -225,9 +208,7 @@ async function run() {
|
|
|
225
208
|
app.append(bar, frame);
|
|
226
209
|
}
|
|
227
210
|
run().catch((error) => {
|
|
228
|
-
if (error?.status ===
|
|
229
|
-
show("Not authorized", "This Discord account is not allowed to open this widget.");
|
|
230
|
-
} else if (error?.status === 404) {
|
|
211
|
+
if (error?.status === 404) {
|
|
231
212
|
show("Widget unavailable", "No widget could be resolved for this channel.");
|
|
232
213
|
} else {
|
|
233
214
|
show("Gateway offline", "The OpenClaw gateway could not load this widget. Try again shortly.");
|
|
@@ -356,18 +337,10 @@ function createDiscordActivityHttpHandler(deps) {
|
|
|
356
337
|
} catch {
|
|
357
338
|
return respondJson(res, 503, { error: "Discord user lookup unavailable" });
|
|
358
339
|
}
|
|
359
|
-
const
|
|
360
|
-
|
|
361
|
-
username: typeof userResponse.body?.username === "string" ? userResponse.body.username : void 0,
|
|
362
|
-
discriminator: typeof userResponse.body?.discriminator === "string" ? userResponse.body.discriminator : void 0
|
|
363
|
-
};
|
|
364
|
-
if (!userResponse.ok || !user.id) return respondJson(res, 401, { error: "Discord user lookup failed" });
|
|
365
|
-
if (!resolveActivityUserAuthorized(account.config, {
|
|
366
|
-
...user,
|
|
367
|
-
id: user.id
|
|
368
|
-
})) return respondJson(res, 403, { error: "Discord user is not allowlisted" });
|
|
340
|
+
const discordUserId = typeof userResponse.body?.id === "string" ? userResponse.body.id : void 0;
|
|
341
|
+
if (!userResponse.ok || !discordUserId) return respondJson(res, 401, { error: "Discord user lookup failed" });
|
|
369
342
|
const minted = await deps.runtime.store.createSession({
|
|
370
|
-
discordUserId
|
|
343
|
+
discordUserId,
|
|
371
344
|
accountId: account.accountId
|
|
372
345
|
});
|
|
373
346
|
completed = true;
|
package/dist/activities-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as registerDiscordActivities } from "./activities-api-
|
|
1
|
+
import { t as registerDiscordActivities } from "./activities-api-DS1L7KRY.js";
|
|
2
2
|
export { registerDiscordActivities };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
2
|
import { buildChannelKeyCandidates, resolveChannelEntryMatchWithFallback, resolveChannelMatchConfig } from "openclaw/plugin-sdk/channel-targets";
|
|
3
|
+
import { resolveAllowlistMatchByCandidates } from "openclaw/plugin-sdk/allow-from";
|
|
3
4
|
//#region extensions/discord/src/monitor/format.ts
|
|
4
5
|
function resolveDiscordSystemLocation(params) {
|
|
5
6
|
const { isDirectMessage, isGroupDm, guild, channelName } = params;
|
|
@@ -342,13 +343,23 @@ function resolveDiscordChannelPolicyCommandAuthorizer(params) {
|
|
|
342
343
|
function resolveGroupDmAllow(params) {
|
|
343
344
|
const { channels, channelId, channelName, channelSlug } = params;
|
|
344
345
|
if (!channels || channels.length === 0) return true;
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
346
|
+
return resolveAllowlistMatchByCandidates({
|
|
347
|
+
allowList: channels.map((entry) => normalizeDiscordSlug(entry)),
|
|
348
|
+
candidates: [
|
|
349
|
+
{
|
|
350
|
+
value: normalizeDiscordSlug(channelId),
|
|
351
|
+
source: "id"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
value: channelSlug,
|
|
355
|
+
source: "slug"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
value: channelName ? normalizeDiscordSlug(channelName) : void 0,
|
|
359
|
+
source: "name"
|
|
360
|
+
}
|
|
361
|
+
]
|
|
362
|
+
}).allowed;
|
|
352
363
|
}
|
|
353
364
|
function shouldEmitDiscordReactionNotification(params) {
|
|
354
365
|
const mode = params.mode ?? "own";
|
|
@@ -4,6 +4,7 @@ import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtim
|
|
|
4
4
|
import { parseRetryAfterHeaderSeconds, resolveRetryConfig, retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
5
5
|
import { readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
6
6
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
7
|
+
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
7
8
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
8
9
|
//#region extensions/discord/src/error-body.ts
|
|
9
10
|
const DISCORD_RESPONSE_BODY_SUMMARY_MAX_CHARS = 240;
|
|
@@ -139,7 +140,8 @@ async function requestDiscord(path, token, options) {
|
|
|
139
140
|
...retryConfig,
|
|
140
141
|
label: options?.label ?? path,
|
|
141
142
|
shouldRetry: (err) => err instanceof DiscordApiError && err.status === 429,
|
|
142
|
-
retryAfterMs: (err) => getDiscordApiRetryAfterMs(err, retryConfig)
|
|
143
|
+
retryAfterMs: (err) => getDiscordApiRetryAfterMs(err, retryConfig),
|
|
144
|
+
sleep: (ms) => sleepWithAbort(ms, options?.signal)
|
|
143
145
|
});
|
|
144
146
|
}
|
|
145
147
|
async function fetchDiscord(path, token, fetcher = fetch, options) {
|
package/dist/api.js
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as normalizeDiscordOutboundTarget, l as parseDiscordTarget, o as looksLikeDiscordTargetId, s as normalizeDiscordMessagingTarget, u as resolveDiscordChannelId } from "./chunk-CWzmeWf_.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-CMd4nzLB.js";
|
|
3
|
-
import {
|
|
4
|
-
import { i as requestDiscord, n as DiscordApiError, r as fetchDiscord } from "./api-
|
|
5
|
-
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-
|
|
3
|
+
import { D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, T as parseDiscordComponentCustomIdForInteraction, _ as DISCORD_COMPONENT_CUSTOM_ID_KEY, b as buildDiscordComponentCustomId, d as createDiscordFormModal, f as buildDiscordComponentMessage, g as resolveDiscordComponentAttachmentName, h as readDiscordComponentSpec, i as buildDiscordInteractiveComponents, m as DISCORD_COMPONENT_ATTACHMENT_PREFIX, p as buildDiscordComponentMessageFlags, r as formatDiscordComponentEventText, u as DiscordFormModal, v as DISCORD_MODAL_CUSTOM_ID_KEY, w as parseDiscordComponentCustomId, x as buildDiscordModalCustomId } from "./outbound-session-route-M2bEY9tI.js";
|
|
4
|
+
import { i as requestDiscord, n as DiscordApiError, r as fetchDiscord } from "./api-C43z8vUm.js";
|
|
5
|
+
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-vqLA450R.js";
|
|
6
6
|
import { t as inspectDiscordAccount } from "./account-inspect-dFV0JrnR.js";
|
|
7
|
-
import { i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS,
|
|
8
|
-
import "./targets-
|
|
9
|
-
import { a as
|
|
10
|
-
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-
|
|
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-B9cy6RvQ.js";
|
|
8
|
+
import "./targets-BjEMIe8t.js";
|
|
9
|
+
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, o as isDiscordExecApprovalApprover, s as isDiscordExecApprovalClientEnabled } from "./approval-message-safety-DrLlgIPz.js";
|
|
10
|
+
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-5MfaC2IE.js";
|
|
11
11
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
12
|
-
import { t as discordSetupPlugin } from "./channel.setup-
|
|
13
|
-
import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-
|
|
14
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
15
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-
|
|
16
|
-
import { t as fetchPluralKitMessageInfo } from "./pluralkit-
|
|
17
|
-
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
18
|
-
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-
|
|
12
|
+
import { t as discordSetupPlugin } from "./channel.setup-CJXfFclP.js";
|
|
13
|
+
import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-Wrk61DwY.js";
|
|
14
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-Bsk2YBPs.js";
|
|
15
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-CmukHSms.js";
|
|
16
|
+
import { t as fetchPluralKitMessageInfo } from "./pluralkit-CT0VRsZd.js";
|
|
17
|
+
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-C3SCKyYU.js";
|
|
18
|
+
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-DtT0SIns.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-D9Qadn-l.js")).handleDiscordMessageAction(...args);
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Shipped `@openclaw/discord/api` compatibility only. Use native
|
|
24
|
+
* `AbortSignal.any` after filtering optional signals. Removal with the next
|
|
25
|
+
* plugin-SDK major.
|
|
26
|
+
*/
|
|
27
|
+
function mergeAbortSignals(signals) {
|
|
28
|
+
const activeSignals = signals.filter((signal) => Boolean(signal));
|
|
29
|
+
return activeSignals.length > 1 ? AbortSignal.any(activeSignals) : activeSignals[0];
|
|
30
|
+
}
|
|
22
31
|
//#endregion
|
|
23
32
|
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,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { P as createDiscordClient, b as stripUndefinedFields, g as createDiscordMessageNonce } from "./send.shared-
|
|
1
|
+
import { K as Container, L as serializePayload, Q as Row, W as Button, ct as createUserDmChannel, et as Separator, gt as deleteChannelMessage, nt as TextDisplay, pt as createChannelMessage, vt as editChannelMessage } from "./chunk-CWzmeWf_.js";
|
|
2
|
+
import { c as buildExecApprovalCustomId } from "./outbound-session-route-M2bEY9tI.js";
|
|
3
|
+
import { P as createDiscordClient, b as stripUndefinedFields, g as createDiscordMessageNonce } from "./send.shared-Dber6X57.js";
|
|
4
4
|
import { t as inspectDiscordAccount } from "./account-inspect-dFV0JrnR.js";
|
|
5
|
-
import {
|
|
6
|
-
import { a as shouldHandleDiscordApprovalRequest } from "./channel-
|
|
7
|
-
import { n as formatDiscordApprovalDisplayValue, t as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./approval-message-safety-C-8BL6Kv.js";
|
|
5
|
+
import { n as formatDiscordApprovalDisplayValue, s as isDiscordExecApprovalClientEnabled, t as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./approval-message-safety-DrLlgIPz.js";
|
|
6
|
+
import { a as shouldHandleDiscordApprovalRequest } from "./channel-5MfaC2IE.js";
|
|
8
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
8
|
import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
|
|
10
9
|
import { ButtonStyle } from "discord-api-types/v10";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as parseDiscordTarget } from "./chunk-CWzmeWf_.js";
|
|
2
2
|
import { s as resolveDiscordAccount } from "./accounts-CMd4nzLB.js";
|
|
3
3
|
import { normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { createChannelApproverDmTargetResolver, createChannelNativeOriginTargetResolver } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
@@ -91,4 +91,50 @@ function resolveDiscordCurrentConversationIdentity(params) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
//#endregion
|
|
94
|
-
|
|
94
|
+
//#region extensions/discord/src/approval-message-safety.ts
|
|
95
|
+
const DISCORD_APPROVAL_ALLOWED_MENTIONS = { parse: [] };
|
|
96
|
+
const DISCORD_MARKDOWN_META_CHARACTERS = /* @__PURE__ */ new Set([
|
|
97
|
+
"\\",
|
|
98
|
+
"`",
|
|
99
|
+
"*",
|
|
100
|
+
"_",
|
|
101
|
+
"{",
|
|
102
|
+
"}",
|
|
103
|
+
"[",
|
|
104
|
+
"]",
|
|
105
|
+
"(",
|
|
106
|
+
")",
|
|
107
|
+
"<",
|
|
108
|
+
">",
|
|
109
|
+
"#",
|
|
110
|
+
"+",
|
|
111
|
+
"-",
|
|
112
|
+
".",
|
|
113
|
+
"!",
|
|
114
|
+
"|",
|
|
115
|
+
"~"
|
|
116
|
+
]);
|
|
117
|
+
function escapeDiscordApprovalDisplayCharacter(character) {
|
|
118
|
+
if (character === "\n") return "\\n";
|
|
119
|
+
if (character === "\r") return "\\r";
|
|
120
|
+
if (character === " ") return "\\t";
|
|
121
|
+
const codePoint = character.codePointAt(0) ?? 0;
|
|
122
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159 || codePoint === 8232 || codePoint === 8233) return `\\u{${codePoint.toString(16).padStart(4, "0")}}`;
|
|
123
|
+
return DISCORD_MARKDOWN_META_CHARACTERS.has(character) ? `\\${character}` : character;
|
|
124
|
+
}
|
|
125
|
+
/** Keep opaque approval metadata bounded, single-line, and inert in Discord Markdown. */
|
|
126
|
+
function formatDiscordApprovalDisplayValue(value, maxChars = 200) {
|
|
127
|
+
const limit = Number.isFinite(maxChars) ? Math.max(0, Math.trunc(maxChars)) : 200;
|
|
128
|
+
const escapedParts = Array.from(value, escapeDiscordApprovalDisplayCharacter);
|
|
129
|
+
const escaped = escapedParts.join("");
|
|
130
|
+
if (escaped.length <= limit) return escaped;
|
|
131
|
+
if (limit <= 3) return ".".repeat(limit);
|
|
132
|
+
let bounded = "";
|
|
133
|
+
for (const part of escapedParts) {
|
|
134
|
+
if (bounded.length + part.length > limit - 3) break;
|
|
135
|
+
bounded += part;
|
|
136
|
+
}
|
|
137
|
+
return `${bounded}...`;
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
140
|
+
export { getDiscordExecApprovalApprovers as a, shouldSuppressLocalDiscordExecApprovalPrompt as c, createChannelNativeOriginTargetResolver as d, isChannelExecApprovalClientEnabledFromConfig as f, resolveDiscordCurrentConversationIdentity as i, createApproverRestrictedNativeApprovalCapability as l, formatDiscordApprovalDisplayValue as n, isDiscordExecApprovalApprover as o, matchesApprovalRequestFilters as p, resolveDiscordConversationIdentity as r, isDiscordExecApprovalClientEnabled as s, DISCORD_APPROVAL_ALLOWED_MENTIONS as t, createChannelApproverDmTargetResolver as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { O as fetchChannelPermissionsDiscord } from "./send.shared-
|
|
1
|
+
import { Yt as __exportAll } from "./chunk-CWzmeWf_.js";
|
|
2
|
+
import { O as fetchChannelPermissionsDiscord } from "./send.shared-Dber6X57.js";
|
|
3
3
|
import { t as inspectDiscordAccount } from "./account-inspect-dFV0JrnR.js";
|
|
4
|
-
import "./send-
|
|
4
|
+
import "./send-CSRxNNgq.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,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as parseDiscordTarget, o as looksLikeDiscordTargetId, s as normalizeDiscordMessagingTarget } from "./chunk-CWzmeWf_.js";
|
|
2
2
|
import { c as resolveDiscordAccountAllowFrom, i as listEnabledDiscordAccounts, o as resolveDefaultDiscordAccountId, r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-CMd4nzLB.js";
|
|
3
|
-
import { t as resolveDiscordOutboundSessionRoute } from "./outbound-session-route-
|
|
3
|
+
import { t as resolveDiscordOutboundSessionRoute } from "./outbound-session-route-M2bEY9tI.js";
|
|
4
4
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
5
5
|
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";
|
|
6
|
-
import {
|
|
7
|
-
import { a as
|
|
6
|
+
import { u as withAbortTimeout } from "./timeouts-B9cy6RvQ.js";
|
|
7
|
+
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, d as createChannelNativeOriginTargetResolver, f as isChannelExecApprovalClientEnabledFromConfig, i as resolveDiscordCurrentConversationIdentity, l as createApproverRestrictedNativeApprovalCapability, o as isDiscordExecApprovalApprover, p as matchesApprovalRequestFilters, s as isDiscordExecApprovalClientEnabled, u as createChannelApproverDmTargetResolver } from "./approval-message-safety-DrLlgIPz.js";
|
|
8
8
|
import { r as resolveRequiredDiscordChannelPermissions } from "./audit-core-xwjIczO0.js";
|
|
9
|
-
import { t as discordMessageActions$1 } from "./channel-actions-
|
|
9
|
+
import { t as discordMessageActions$1 } from "./channel-actions-DicWTbYH.js";
|
|
10
10
|
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.js";
|
|
11
11
|
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DnTpkroM.js";
|
|
12
|
-
import { n as discordOutbound } from "./outbound-adapter-
|
|
13
|
-
import { a as discordSecurityAdapter, i as discordSetupAdapter, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-
|
|
12
|
+
import { n as discordOutbound } from "./outbound-adapter-B2_oa-zV.js";
|
|
13
|
+
import { a as discordSecurityAdapter, i as discordSetupAdapter, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-BEhmAdMY.js";
|
|
14
14
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
15
15
|
import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.js";
|
|
16
16
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -195,7 +195,7 @@ function createDiscordApprovalCapability(configOverride) {
|
|
|
195
195
|
request,
|
|
196
196
|
configOverride
|
|
197
197
|
}),
|
|
198
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
198
|
+
load: async () => (await import("./approval-handler.runtime-BbkfPoGc.js")).discordApprovalNativeRuntime
|
|
199
199
|
})
|
|
200
200
|
});
|
|
201
201
|
}
|
|
@@ -302,22 +302,22 @@ function resolveDiscordInboundConversation(params) {
|
|
|
302
302
|
}
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region extensions/discord/src/channel.loaders.ts
|
|
305
|
-
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
306
|
-
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
307
|
-
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
308
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
309
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
310
|
-
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-
|
|
311
|
-
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-
|
|
305
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-CmukHSms.js").then((n) => n.t));
|
|
306
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-9KcG3mLg.js").then((n) => n.n));
|
|
307
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-GCGf3oV0.js").then((n) => n.n));
|
|
308
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-D1z8mK4b.js").then((n) => n.a));
|
|
309
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-vqLA450R.js").then((n) => n.r));
|
|
310
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-BWCRsVoT.js"));
|
|
311
|
+
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-D55QqC9u.js"));
|
|
312
312
|
async function probeDiscordStatusAccount(params) {
|
|
313
313
|
const startedAtMs = Date.now();
|
|
314
314
|
const runtime = await loadDiscordProbeRuntime();
|
|
315
315
|
const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
|
|
316
316
|
return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
|
|
317
317
|
}
|
|
318
|
-
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-
|
|
319
|
-
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-
|
|
320
|
-
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
318
|
+
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-BC6bgPMX.js").then((n) => n.n));
|
|
319
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-CSRxNNgq.js").then((n) => n.t));
|
|
320
|
+
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-BYlCRO__.js").then((n) => n.t));
|
|
321
321
|
//#endregion
|
|
322
322
|
//#region extensions/discord/src/group-policy.ts
|
|
323
323
|
function normalizeDiscordSlug(value) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-CMd4nzLB.js";
|
|
2
|
-
import {
|
|
2
|
+
import { h as readDiscordComponentSpec } from "./outbound-session-route-M2bEY9tI.js";
|
|
3
3
|
import { t as inspectDiscordAccount } from "./account-inspect-dFV0JrnR.js";
|
|
4
4
|
import { i as withDiscordInboundEventDeliveryMetadata } from "./inbound-event-delivery-CEPlt2uz.js";
|
|
5
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -41,7 +41,7 @@ const localExecutionActions = /* @__PURE__ */ new Set([
|
|
|
41
41
|
function resolveDiscordActionExecutionMode({ action }) {
|
|
42
42
|
return localExecutionActions.has(action) ? "local" : "gateway";
|
|
43
43
|
}
|
|
44
|
-
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./channel-actions.runtime-
|
|
44
|
+
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./channel-actions.runtime-D9Qadn-l.js"));
|
|
45
45
|
function listDiscoverableDiscordAccounts(cfg) {
|
|
46
46
|
return listDiscordAccountIds(cfg).map((accountId) => inspectDiscordAccount({
|
|
47
47
|
cfg,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as buildDiscordPresentationComponents, i as buildDiscordInteractiveComponents } from "./outbound-session-route-
|
|
3
|
-
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-
|
|
4
|
-
import "./targets-
|
|
1
|
+
import { u as resolveDiscordChannelId } from "./chunk-CWzmeWf_.js";
|
|
2
|
+
import { a as buildDiscordPresentationComponents, i as buildDiscordInteractiveComponents } from "./outbound-session-route-M2bEY9tI.js";
|
|
3
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-Z2qkKakn.js";
|
|
4
|
+
import "./targets-BjEMIe8t.js";
|
|
5
5
|
import "./action-runtime-api.js";
|
|
6
6
|
import { r as notifyDiscordInboundEventOutboundSuccess } from "./inbound-event-delivery-CEPlt2uz.js";
|
|
7
|
-
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-
|
|
8
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
7
|
+
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-BGhk6HI3.js";
|
|
8
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-Bsk2YBPs.js";
|
|
9
9
|
import { normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
10
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
11
|
-
import { adaptMessagePresentationForChannel,
|
|
11
|
+
import { adaptMessagePresentationForChannel, normalizeLegacyInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
12
12
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
13
13
|
import { readPositiveIntegerParam, readStringArrayParam, readStringParam as readStringParam$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
14
14
|
//#region extensions/discord/src/actions/handle-action.ts
|
|
@@ -70,7 +70,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
70
70
|
includesMedia: Boolean(mediaUrl)
|
|
71
71
|
}) ? generatedPresentationComponents : void 0;
|
|
72
72
|
const presentationFellBack = Boolean(generatedPresentationComponents && !presentationComponents);
|
|
73
|
-
const rawComponents = presentationFellBack ? void 0 : params.components ?? presentationComponents ?? buildDiscordInteractiveComponents(
|
|
73
|
+
const rawComponents = presentationFellBack ? void 0 : params.components ?? presentationComponents ?? buildDiscordInteractiveComponents(normalizeLegacyInteractiveReply(params.interactive));
|
|
74
74
|
const hasComponents = Boolean(rawComponents) && (typeof rawComponents === "function" || typeof rawComponents === "object");
|
|
75
75
|
const components = hasComponents ? rawComponents : void 0;
|
|
76
76
|
const content = readStringParam$1(params, "message", {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DiscordChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as DiscordChannelConfigSchema } from "./config-schema-BxrgfSMD.js";
|
|
2
2
|
export { DiscordChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordPlugin } from "./channel-
|
|
1
|
+
import { t as discordPlugin } from "./channel-5MfaC2IE.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-CMd4nzLB.js";
|
|
2
2
|
import { n as inspectDiscordConfiguredToken } from "./account-inspect-dFV0JrnR.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-BEhmAdMY.js";
|
|
4
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-9KcG3mLg.js";
|
|
5
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-GCGf3oV0.js";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { createAccountScopedAllowFromSection, createAccountScopedGroupAccessSection, createLegacyCompatChannelDmPolicy, createSetupTranslator, createStandardChannelSetupStatus, defineTokenCredential, parseMentionOrPrefixedId, patchChannelConfigForAccount, promptLegacyChannelAllowFromForAccount, resolveEntriesWithOptionalToken, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup-runtime";
|
|
@@ -12,9 +12,9 @@ import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtim
|
|
|
12
12
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
13
13
|
import { parseRetryAfterHeaderSeconds } from "openclaw/plugin-sdk/retry-runtime";
|
|
14
14
|
import { buildMessagingTarget, parseMentionPrefixOrAtUserTarget, requireTargetKind } from "openclaw/plugin-sdk/channel-targets";
|
|
15
|
+
import { resolveAllowlistMatchByCandidates } from "openclaw/plugin-sdk/allow-from";
|
|
15
16
|
import { chunkMarkdownTextWithMode } from "openclaw/plugin-sdk/reply-chunking";
|
|
16
17
|
import { isSingleUseReplyToMode } from "openclaw/plugin-sdk/reply-reference";
|
|
17
|
-
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
18
18
|
//#region \0rolldown/runtime.js
|
|
19
19
|
var __defProp = Object.defineProperty;
|
|
20
20
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -2939,7 +2939,13 @@ function normalizeDiscordOutboundTarget(to, allowFrom) {
|
|
|
2939
2939
|
function allowFromContainsDiscordUserId(allowFrom, userId) {
|
|
2940
2940
|
const normalizedUserId = userId.trim();
|
|
2941
2941
|
if (!normalizedUserId) return false;
|
|
2942
|
-
return (
|
|
2942
|
+
return resolveAllowlistMatchByCandidates({
|
|
2943
|
+
allowList: (allowFrom ?? []).map(normalizeAllowFromDiscordUserId).filter((entry) => Boolean(entry)),
|
|
2944
|
+
candidates: [{
|
|
2945
|
+
value: normalizedUserId,
|
|
2946
|
+
source: "id"
|
|
2947
|
+
}]
|
|
2948
|
+
}).allowed;
|
|
2943
2949
|
}
|
|
2944
2950
|
function normalizeAllowFromDiscordUserId(entry) {
|
|
2945
2951
|
const trimmed = entry.trim().toLowerCase();
|
|
@@ -2980,52 +2986,6 @@ function resolveDiscordReplyMessageId(reply, isFirst) {
|
|
|
2980
2986
|
return reply && (isFirst || reply.scope === "all") ? reply.messageId : void 0;
|
|
2981
2987
|
}
|
|
2982
2988
|
//#endregion
|
|
2983
|
-
//#region extensions/discord/src/send.receipt.ts
|
|
2984
|
-
function createDiscordSendReceipt(params) {
|
|
2985
|
-
return createMessageReceiptFromOutboundResults({
|
|
2986
|
-
results: params.platformMessageIds.map((messageId) => messageId.trim()).filter((messageId) => messageId && messageId !== "unknown").map((messageId, index) => {
|
|
2987
|
-
const result = {
|
|
2988
|
-
channel: "discord",
|
|
2989
|
-
messageId
|
|
2990
|
-
};
|
|
2991
|
-
if (params.channelId) result.channelId = params.channelId;
|
|
2992
|
-
if (params.reply?.scope === "first" && index === 0) {
|
|
2993
|
-
const rawResult = {
|
|
2994
|
-
channel: "discord",
|
|
2995
|
-
messageId
|
|
2996
|
-
};
|
|
2997
|
-
if (params.channelId) rawResult.channelId = params.channelId;
|
|
2998
|
-
result.receipt = createMessageReceiptFromOutboundResults({
|
|
2999
|
-
results: [rawResult],
|
|
3000
|
-
kind: params.kind,
|
|
3001
|
-
threadId: params.threadId,
|
|
3002
|
-
replyToId: params.reply.messageId
|
|
3003
|
-
});
|
|
3004
|
-
}
|
|
3005
|
-
return result;
|
|
3006
|
-
}),
|
|
3007
|
-
kind: params.kind,
|
|
3008
|
-
threadId: params.threadId,
|
|
3009
|
-
replyToId: params.reply?.scope === "all" ? params.reply.messageId : void 0
|
|
3010
|
-
});
|
|
3011
|
-
}
|
|
3012
|
-
function createDiscordSendResult(params) {
|
|
3013
|
-
const messageId = params.result.id || "unknown";
|
|
3014
|
-
const channelId = params.result.channel_id ?? params.fallbackChannelId;
|
|
3015
|
-
const receiptParams = {
|
|
3016
|
-
platformMessageIds: params.result.platformMessageIds?.length ? params.result.platformMessageIds : [messageId],
|
|
3017
|
-
channelId,
|
|
3018
|
-
kind: params.kind
|
|
3019
|
-
};
|
|
3020
|
-
if (params.threadId != null) receiptParams.threadId = String(params.threadId);
|
|
3021
|
-
if (params.reply) receiptParams.reply = params.reply;
|
|
3022
|
-
return {
|
|
3023
|
-
messageId,
|
|
3024
|
-
channelId,
|
|
3025
|
-
receipt: createDiscordSendReceipt(receiptParams)
|
|
3026
|
-
};
|
|
3027
|
-
}
|
|
3028
|
-
//#endregion
|
|
3029
2989
|
//#region extensions/discord/src/chunk.ts
|
|
3030
2990
|
const DEFAULT_MAX_CHARS = 2e3;
|
|
3031
2991
|
const DEFAULT_MAX_LINES = 17;
|
|
@@ -3207,4 +3167,4 @@ function rebalanceReasoningItalics(source, chunks) {
|
|
|
3207
3167
|
return adjusted;
|
|
3208
3168
|
}
|
|
3209
3169
|
//#endregion
|
|
3210
|
-
export {
|
|
3170
|
+
export { Section as $, readDiscordMessage as A, createGuildBan as At, Label as B, listGuildChannels as Bt, Client as C, listChannelMessages as Ct, RateLimitError as D, sendChannelTyping as Dt, DiscordError as E, searchGuildMessages as Et, Message as F, deleteChannelPermission as Ft, ChannelSelectMenu as G, putChannelPermission as Gt, RadioGroup as H, listGuildRoles as Ht, User as I, getGuild as It, LinkButton as J, timeoutGuildMember as Jt, Container as K, removeGuildMember as Kt, serializePayload as L, getGuildMember as Lt, Command as M, createGuildEmoji as Mt, CommandWithSubcommands as N, createGuildScheduledEvent as Nt, isUnknownDiscordVoiceStateError as O, unpinChannelMessage as Ot, Guild as P, createGuildSticker as Pt, Row as Q, Embed as R, getGuildVoiceState as Rt, VoiceStateUpdateListener as S, listChannelArchivedThreads as St, RequestClient as T, pinChannelMessage as Tt, TextInput as U, listGuildScheduledEvents as Ut, Modal as V, listGuildEmojis as Vt, Button as W, moveGuildChannels as Wt, MentionableSelectMenu as X, MediaGallery as Y, __exportAll as Yt, RoleSelectMenu as Z, MessageReactionRemoveListener as _, editChannel as _t, allowFromContainsDiscordUserId as a, BaseMessageInteractiveComponent as at, ResumedListener as b, getChannelMessage as bt, normalizeDiscordOutboundTarget as c, createUserDmChannel as ct, discord_exports as d, deleteOwnMessageReaction as dt, Separator as et, GuildCreateListener as f, listMessageReactionUsers as ft, MessageReactionAddListener as g, deleteChannelMessage as gt, MessageCreateListener as h, deleteChannel as ht, resolveDiscordReplyReference as i, UserSelectMenu as it, readRetryAfter as j, createGuildChannel as jt, readDiscordCode as k, addGuildMemberRole as kt, parseDiscordTarget as l, getCurrentUser as lt, InteractionCreateListener as m, createThread as mt, createReusableDiscordReplyReference as n, TextDisplay as nt, looksLikeDiscordTargetId as o, parseCustomId as ot, GuildDeleteListener as p, createChannelMessage as pt, File as q, removeGuildMemberRole as qt, resolveDiscordReplyMessageId as r, Thumbnail as rt, normalizeDiscordMessagingTarget as s, createChannelWebhook as st, chunkDiscordTextWithMode as t, StringSelectMenu as tt, resolveDiscordChannelId as u, createOwnMessageReaction as ut, PresenceUpdateListener as v, editChannelMessage as vt, Plugin as w, listChannelPins as wt, ThreadUpdateListener as x, getThreadMember as xt, ReadyListener as y, getChannel as yt, CheckboxGroup as z, listGuildActiveThreads as zt };
|
|
@@ -118,6 +118,10 @@ const DiscordChannelConfigSchema = buildChannelConfigSchema(DiscordConfigSchema,
|
|
|
118
118
|
label: "Discord Thread Spawn Context",
|
|
119
119
|
help: "Default native subagent context for thread-bound spawns. \"fork\" starts from the requester transcript; \"isolated\" starts clean. Default: \"fork\"."
|
|
120
120
|
},
|
|
121
|
+
subagentProgress: {
|
|
122
|
+
label: "Discord Subagent Progress",
|
|
123
|
+
help: "Show active subagent count reactions and typing on the source message. Default: false."
|
|
124
|
+
},
|
|
121
125
|
"ui.components.accentColor": {
|
|
122
126
|
label: "Discord Component Accent Color",
|
|
123
127
|
help: "Accent color for Discord component containers (hex). Set per account via channels.discord.accounts.<id>.ui.components.accentColor."
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Yt as __exportAll } from "./chunk-CWzmeWf_.js";
|
|
2
2
|
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, o as resolveDefaultDiscordAccountId } from "./accounts-CMd4nzLB.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-
|
|
1
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-CmukHSms.js";
|
|
2
2
|
//#region extensions/discord/directory-contract-api.ts
|
|
3
3
|
const discordDirectoryContractPlugin = {
|
|
4
4
|
id: "discord",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Yt as __exportAll } from "./chunk-CWzmeWf_.js";
|
|
2
2
|
import { p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-CMd4nzLB.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-C43z8vUm.js";
|
|
4
|
+
import { a as normalizeDiscordSlug } from "./allow-list-DzKrtfah.js";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
//#region extensions/discord/src/directory-cache-state.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as resolveDefaultDiscordAccountId } from "./accounts-CMd4nzLB.js";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-dFV0JrnR.js";
|
|
3
|
-
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-
|
|
3
|
+
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-BEhmAdMY.js";
|
|
4
4
|
import { n as normalizeCompatibilityConfig } from "./doctor-contract-wId6pV41.js";
|
|
5
5
|
import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.js";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|