@openclaw/discord 2026.9.1 → 2026.9.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/{activities-api-E-segZn6.js → activities-api-CTcGq3Hf.js} +4 -4
- package/dist/activities-api.js +1 -1
- package/dist/{allow-list-C2JuH-R0.js → allow-list-DBTtR2dz.js} +3 -29
- package/dist/api.js +12 -12
- package/dist/{approval-handler.runtime-CW5k3mSa.js → approval-handler.runtime-DUSe5fyH.js} +5 -5
- package/dist/{audit-B9rydv5a.js → audit-DpPfwoJM.js} +4 -4
- package/dist/{channel-D93LnbTE.js → channel-BHajPgwR.js} +16 -16
- package/dist/{channel-actions.runtime-DMFv4doE.js → channel-actions.runtime-DS8pXo0S.js} +29 -32
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-DTL7kPOM.js → channel.setup-BWmMe1tT.js} +3 -3
- package/dist/command-owners-D78sAoOz.js +10 -0
- package/dist/{components-DmXYIQ26.js → components-BimX47Mq.js} +1 -1
- package/dist/{conversation-binding-route-24afmvEC.js → conversation-binding-route-DuR5NGIx.js} +1 -1
- package/dist/{directory-config-BD4YL7wT.js → directory-config-CD2v2Szs.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-BrFVc1Ds.js → directory-live-DaJzWJ2N.js} +2 -2
- package/dist/{doctor-BUB41_lr.js → doctor-D4HH1inA.js} +6 -3
- package/dist/doctor-contract-api.js +28 -26
- package/dist/{handle-action.guild-admin-B0egstYq.js → handle-action.guild-admin-4We6wWQU.js} +6 -3
- package/dist/index.js +1 -1
- package/dist/{ingress-identity-BCzfPPYM.js → ingress-identity-XNmW-mZS.js} +1 -1
- package/dist/{message-handler-Qdw9c0j4.js → message-handler-DhgBabyU.js} +52 -65
- package/dist/{message-handler.preflight-Dxi2yBfR.js → message-handler.preflight-oZ7dQCd0.js} +12 -12
- package/dist/{message-handler.process-BYDjtxZJ.js → message-handler.process-BzCYf1pa.js} +14 -14
- package/dist/{message-text-BRVqYm-t.js → message-text-DK4NnBg-.js} +1 -1
- package/dist/{outbound-adapter-DEhthWTk.js → outbound-adapter-CtggmGh9.js} +6 -6
- package/dist/{outbound-components-DehyxvA4.js → outbound-components-Dn8SJWMS.js} +3 -3
- package/dist/{outbound-session-route-BFGRF9fE.js → outbound-session-route-Q_HEusBQ.js} +5 -6
- package/dist/{owner-access-yc1sX7Gx.js → owner-access-Cp8r6Ipf.js} +3 -2
- package/dist/{pluralkit-XmmAHoV6.js → pluralkit-BY75YcK0.js} +1 -1
- package/dist/{provider-session.runtime-BA2BPyZ4.js → provider-session.runtime-BL2lHBH7.js} +3 -3
- package/dist/{provider-DuDtKbF8.js → provider-uKmmrDM4.js} +28 -28
- package/dist/provider.runtime-C-IkWF2w.js +2 -0
- package/dist/{realtime-session.runtime-DgSbX6ay.js → realtime-session.runtime-CGYm1t_0.js} +705 -295
- package/dist/{resolve-allowlist-common-BJ5UZNNT.js → resolve-allowlist-common-sKIKy-cF.js} +1 -1
- package/dist/{resolve-channels-CYseD5Uw.js → resolve-channels-CoiMlWy0.js} +3 -3
- package/dist/{resolve-users-DrmhDrqm.js → resolve-users-DJpiokfW.js} +2 -2
- package/dist/{retry-BNCxiyyR.js → retry-DQt1zDgH.js} +238 -184
- package/dist/{runtime-DB7Fb6AU.js → runtime-BHsdEdr5.js} +1 -1
- package/dist/{runtime-BbWNtfyq.js → runtime-Ghtfh5ZA.js} +32 -24
- package/dist/runtime-api.js +18 -18
- package/dist/{send-BnTEIeLE.js → send-CZeWKUiA.js} +3 -3
- package/dist/{send.components-BWVEcjRP.js → send.components-BG5IDABj.js} +4 -4
- package/dist/{send.outbound-b5xwHTlL.js → send.outbound-DHuFUL6W.js} +10 -44
- package/dist/{send.shared-5vxBTagO.js → send.shared-B0n_fWzu.js} +62 -141
- package/dist/{sender-identity-Dt0imZyY.js → sender-identity-B8Ncfi63.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-BSJWHEMA.js → shared-C3dKun_X.js} +6 -3
- package/dist/{subagent-hooks-IzQKX4RQ.js → subagent-hooks-ZoQXEI1E.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-BOiDS8b3.js → system-events-DFF_awl7.js} +2 -2
- package/dist/{target-resolver-BVI8xSSC.js → target-resolver-DLtHDwMK.js} +2 -2
- package/dist/targets-BObRyaKX.js +3 -0
- package/dist/{thread-bindings-D7mcaXQC.js → thread-bindings-DKvsNjQR.js} +5 -5
- package/dist/{thread-bindings.manager-B1oySiVc.js → thread-bindings.manager-pbbRT5gb.js} +5 -5
- package/dist/{thread-bindings.session-updates-CC7HoQvt.js → thread-bindings.session-updates-t6jeFB1-.js} +1 -1
- package/dist/{thread-bindings.state-D8OMdk4O.js → thread-bindings.state-DtgOqsbX.js} +34 -1
- package/dist/{threading-OQnL-0Zx.js → threading-BCx49X-6.js} +3 -3
- package/dist/{transcripts-source-D8lH7AkN.js → transcripts-source-Dc6Nnli5.js} +48 -5
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-C9q0AQMb.js → typing-CuopV-Hi.js} +1 -1
- package/dist/{voice-runtime-Dfhjh1tV.js → voice-runtime-BQnILUbG.js} +82 -35
- package/node_modules/@discordjs/voice/node_modules/@types/node/README.md +1 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/buffer.buffer.d.ts +5 -5
- package/node_modules/@discordjs/voice/node_modules/@types/node/crypto.d.ts +2 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/http.d.ts +16 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/http2.d.ts +10 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/package.json +2 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/process.d.ts +52 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/quic.d.ts +210 -28
- package/node_modules/@discordjs/voice/node_modules/@types/node/sqlite.d.ts +6 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/test.d.ts +36 -0
- package/node_modules/typebox/build/format/json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer.mjs +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/system/memory/assign.mjs +2 -1
- package/node_modules/typebox/build/system/memory/create.mjs +3 -4
- package/node_modules/typebox/build/system/memory/discard.mjs +2 -2
- package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
- package/node_modules/typebox/build/system/memory/update.mjs +3 -2
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/undici/docs/docs/api/Client.md +4 -0
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
- package/node_modules/undici/docs/docs/api/EventSource.md +4 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
- package/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
- package/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/undici/lib/dispatcher/agent.js +7 -2
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
- package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +43 -3
- package/node_modules/undici/lib/dispatcher/client.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
- package/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +10 -3
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
- package/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +91 -21
- package/node_modules/undici/lib/handler/cache-handler.js +29 -5
- package/node_modules/undici/lib/handler/decorator-handler.js +7 -1
- package/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
- package/node_modules/undici/lib/handler/redirect-handler.js +21 -4
- package/node_modules/undici/lib/handler/retry-handler.js +148 -30
- package/node_modules/undici/lib/interceptor/cache.js +65 -12
- package/node_modules/undici/lib/interceptor/decompress.js +115 -13
- package/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/undici/lib/interceptor/dns.js +7 -0
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/mock/mock-agent.js +13 -1
- package/node_modules/undici/lib/mock/mock-utils.js +11 -10
- package/node_modules/undici/lib/util/cache.js +45 -3
- package/node_modules/undici/lib/web/cookies/parse.js +150 -147
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
- package/node_modules/undici/lib/web/fetch/index.js +6 -0
- package/node_modules/undici/lib/web/fetch/request.js +2 -3
- package/node_modules/undici/lib/web/fetch/util.js +6 -1
- package/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/client.d.ts +10 -0
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/node_modules/undici/types/mock-agent.d.ts +11 -10
- package/node_modules/undici/types/socks5-proxy-agent.d.ts +2 -0
- package/openclaw.plugin.json +1 -2
- package/package.json +6 -6
- package/dist/provider.runtime-Db8YwZBv.js +0 -2
- package/dist/targets-DbxVbq8k.js +0 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { t as handleDiscordAction } from "./runtime-Ghtfh5ZA.js";
|
|
2
2
|
export { handleDiscordAction };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { y as resolveDiscordChannelId$1 } from "./retry-
|
|
2
|
-
import { S as parseDiscordActivityCustomId, i as buildDiscordPresentationComponents } from "./components-
|
|
1
|
+
import { y as resolveDiscordChannelId$1 } from "./retry-DQt1zDgH.js";
|
|
2
|
+
import { S as parseDiscordActivityCustomId, i as buildDiscordPresentationComponents } from "./components-BimX47Mq.js";
|
|
3
3
|
import { c as resolveDiscordAccount } from "./accounts-CwJQoLjM.js";
|
|
4
|
-
import { r as sendDiscordComponentMessage } from "./send.components-
|
|
5
|
-
import { r as setDiscordActivitiesRuntime, t as DiscordActivitiesRuntime } from "./runtime-
|
|
4
|
+
import { r as sendDiscordComponentMessage } from "./send.components-BG5IDABj.js";
|
|
5
|
+
import { r as setDiscordActivitiesRuntime, t as DiscordActivitiesRuntime } from "./runtime-BHsdEdr5.js";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
import { logError } from "openclaw/plugin-sdk/logging-core";
|
|
8
8
|
import { resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
|
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-CTcGq3Hf.js";
|
|
2
2
|
export { registerDiscordActivities };
|
|
@@ -181,38 +181,12 @@ function resolveDiscordOwnerAllowFrom(params) {
|
|
|
181
181
|
return [match.matchKey];
|
|
182
182
|
}
|
|
183
183
|
function resolveDiscordOwnerAccess(params) {
|
|
184
|
-
const
|
|
185
|
-
const ownerAllowList = normalizeDiscordAllowList(ownerAllowFrom && ownerAllowFrom.length > 0 ? ownerAllowFrom : void 0, DISCORD_OWNER_ALLOWLIST_PREFIXES);
|
|
184
|
+
const ownerAllowList = normalizeDiscordAllowList(params.allowFrom?.filter((entry) => (normalizeOptionalString(entry) ?? "") !== "*"), DISCORD_OWNER_ALLOWLIST_PREFIXES);
|
|
186
185
|
return {
|
|
187
186
|
ownerAllowList,
|
|
188
|
-
ownerAllowed: ownerAllowList
|
|
189
|
-
id: params.sender.id,
|
|
190
|
-
name: params.sender.name,
|
|
191
|
-
tag: params.sender.tag
|
|
192
|
-
}, { allowNameMatching: params.allowNameMatching }) : false
|
|
187
|
+
ownerAllowed: ownerAllowList !== null && allowListMatches(ownerAllowList, params.sender, { allowNameMatching: params.allowNameMatching })
|
|
193
188
|
};
|
|
194
189
|
}
|
|
195
|
-
function resolveDiscordCommandOwnerAllowFrom(cfg) {
|
|
196
|
-
const raw = cfg.commands?.ownerAllowFrom;
|
|
197
|
-
if (!Array.isArray(raw) || raw.length === 0) return;
|
|
198
|
-
const entries = [];
|
|
199
|
-
for (const entry of raw) {
|
|
200
|
-
const trimmed = normalizeOptionalString(String(entry ?? "")) ?? "";
|
|
201
|
-
if (!trimmed) continue;
|
|
202
|
-
const separatorIndex = trimmed.indexOf(":");
|
|
203
|
-
if (separatorIndex > 0) {
|
|
204
|
-
const prefix = trimmed.slice(0, separatorIndex).toLowerCase();
|
|
205
|
-
if (prefix === "discord") {
|
|
206
|
-
const remainder = normalizeOptionalString(trimmed.slice(separatorIndex + 1)) ?? "";
|
|
207
|
-
if (remainder) entries.push(remainder);
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
if (prefix !== "user" && prefix !== "pk") continue;
|
|
211
|
-
}
|
|
212
|
-
entries.push(trimmed);
|
|
213
|
-
}
|
|
214
|
-
return entries.length > 0 ? entries : void 0;
|
|
215
|
-
}
|
|
216
190
|
function resolveDiscordCommandAuthorized(params) {
|
|
217
191
|
if (!params.isDirectMessage) return true;
|
|
218
192
|
const allowList = normalizeDiscordAllowList(params.allowFrom, [
|
|
@@ -386,4 +360,4 @@ function shouldEmitDiscordReactionNotification(params) {
|
|
|
386
360
|
return false;
|
|
387
361
|
}
|
|
388
362
|
//#endregion
|
|
389
|
-
export { resolveTimestampMs as
|
|
363
|
+
export { resolveTimestampMs as S, resolveGroupDmAllow as _, normalizeDiscordSlug as a, formatDiscordUserTag as b, resolveDiscordChannelConfigWithFallback as c, resolveDiscordGuildEntry as d, resolveDiscordMemberAccessState as f, resolveDiscordShouldRequireMention as g, resolveDiscordOwnerAllowFrom as h, normalizeDiscordDisplaySlug as i, resolveDiscordChannelPolicyCommandAuthorizer as l, resolveDiscordOwnerAccess as m, isDiscordGroupAllowedByPolicy as n, resolveDiscordAllowListMatch as o, resolveDiscordMemberAllowed as p, normalizeDiscordAllowList as r, resolveDiscordChannelConfig as s, allowListMatches as t, resolveDiscordCommandAuthorized as u, shouldEmitDiscordReactionNotification as v, resolveDiscordSystemLocation as x, formatDiscordReactionEmoji as y };
|
package/dist/api.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { _ as normalizeDiscordOutboundTarget, g as normalizeDiscordMessagingTarget, h as looksLikeDiscordTargetId, v as parseDiscordTarget, y as resolveDiscordChannelId } from "./retry-
|
|
2
|
-
import { D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, T as parseDiscordComponentCustomIdForInteraction, _ as DISCORD_COMPONENT_CUSTOM_ID_KEY, b as buildDiscordComponentCustomId, d as buildDiscordComponentMessage, f as buildDiscordComponentMessageFlags, g as resolveDiscordComponentAttachmentName, h as readDiscordComponentSpec, l as DiscordFormModal, n as formatDiscordComponentEventText, p as DISCORD_COMPONENT_ATTACHMENT_PREFIX, r as buildDiscordInteractiveComponents, u as createDiscordFormModal, v as DISCORD_MODAL_CUSTOM_ID_KEY, w as parseDiscordComponentCustomId, x as buildDiscordModalCustomId } from "./components-
|
|
1
|
+
import { _ as normalizeDiscordOutboundTarget, g as normalizeDiscordMessagingTarget, h as looksLikeDiscordTargetId, v as parseDiscordTarget, y as resolveDiscordChannelId } from "./retry-DQt1zDgH.js";
|
|
2
|
+
import { D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, T as parseDiscordComponentCustomIdForInteraction, _ as DISCORD_COMPONENT_CUSTOM_ID_KEY, b as buildDiscordComponentCustomId, d as buildDiscordComponentMessage, f as buildDiscordComponentMessageFlags, g as resolveDiscordComponentAttachmentName, h as readDiscordComponentSpec, l as DiscordFormModal, n as formatDiscordComponentEventText, p as DISCORD_COMPONENT_ATTACHMENT_PREFIX, r as buildDiscordInteractiveComponents, u as createDiscordFormModal, v as DISCORD_MODAL_CUSTOM_ID_KEY, w as parseDiscordComponentCustomId, x as buildDiscordModalCustomId } from "./components-BimX47Mq.js";
|
|
3
3
|
import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount, o as mergeDiscordAccountConfig, p as resolveDiscordMaxLinesPerMessage, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId, t as createDiscordActionGate, u as resolveDiscordAccountConfig } from "./accounts-CwJQoLjM.js";
|
|
4
4
|
import { i as requestDiscord, n as DiscordApiError, r as fetchDiscord } from "./api-BfmEP6wp.js";
|
|
5
|
-
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-
|
|
5
|
+
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-DLtHDwMK.js";
|
|
6
6
|
import { t as inspectDiscordAccount } from "./account-inspect-BY-ve3yH.js";
|
|
7
7
|
import { i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-D86uWLt_.js";
|
|
8
|
-
import "./targets-
|
|
9
|
-
import { C as shouldSuppressLocalDiscordExecApprovalPrompt, S as isDiscordExecApprovalClientEnabled, b as getDiscordExecApprovalApprovers, x as isDiscordExecApprovalApprover } from "./outbound-session-route-
|
|
10
|
-
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-
|
|
8
|
+
import "./targets-BObRyaKX.js";
|
|
9
|
+
import { C as shouldSuppressLocalDiscordExecApprovalPrompt, S as isDiscordExecApprovalClientEnabled, b as getDiscordExecApprovalApprovers, x as isDiscordExecApprovalApprover } from "./outbound-session-route-Q_HEusBQ.js";
|
|
10
|
+
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-BHajPgwR.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, 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-
|
|
12
|
+
import { t as discordSetupPlugin } from "./channel.setup-BWmMe1tT.js";
|
|
13
|
+
import { n as handleDiscordSubagentEnded, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-ZoQXEI1E.js";
|
|
14
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-4We6wWQU.js";
|
|
15
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-CD2v2Szs.js";
|
|
16
|
+
import { t as fetchPluralKitMessageInfo } from "./pluralkit-BY75YcK0.js";
|
|
17
17
|
import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-3ovFAp3b.js";
|
|
18
18
|
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-DKfK-iPY.js";
|
|
19
19
|
import { resolveOpenProviderRuntimeGroupPolicy as resolveDiscordRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
20
20
|
//#region extensions/discord/api.ts
|
|
21
|
-
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-
|
|
21
|
+
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-DS8pXo0S.js")).handleDiscordMessageAction(...args);
|
|
22
22
|
/**
|
|
23
23
|
* @deprecated Shipped `@openclaw/discord/api` compatibility only. Use native
|
|
24
24
|
* `AbortSignal.any` after filtering optional signals. Removal with the next
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { At as editChannelMessage, J as serializePayload, Ot as deleteChannelMessage, Tt as createChannelMessage, bt as createUserDmChannel, dt as Separator, lt as Row, pt as TextDisplay, rt as Container, tt as Button, vt as stripUndefinedFields } from "./retry-
|
|
2
|
-
import { s as buildExecApprovalCustomId } from "./components-
|
|
3
|
-
import { N as createDiscordClient, O as createDiscordMessageNonce } from "./send.shared-
|
|
4
|
-
import { S as isDiscordExecApprovalClientEnabled, n as DISCORD_APPROVAL_ALLOWED_MENTIONS, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-
|
|
5
|
-
import { a as shouldHandleDiscordApprovalRequest } from "./channel-
|
|
1
|
+
import { At as editChannelMessage, J as serializePayload, Ot as deleteChannelMessage, Tt as createChannelMessage, bt as createUserDmChannel, dt as Separator, lt as Row, pt as TextDisplay, rt as Container, tt as Button, vt as stripUndefinedFields } from "./retry-DQt1zDgH.js";
|
|
2
|
+
import { s as buildExecApprovalCustomId } from "./components-BimX47Mq.js";
|
|
3
|
+
import { N as createDiscordClient, O as createDiscordMessageNonce } from "./send.shared-B0n_fWzu.js";
|
|
4
|
+
import { S as isDiscordExecApprovalClientEnabled, n as DISCORD_APPROVAL_ALLOWED_MENTIONS, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-Q_HEusBQ.js";
|
|
5
|
+
import { a as shouldHandleDiscordApprovalRequest } from "./channel-BHajPgwR.js";
|
|
6
6
|
import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
|
|
7
7
|
import { ButtonStyle } from "discord-api-types/v10";
|
|
8
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { sn as __exportAll } from "./retry-
|
|
2
|
-
import { x as fetchChannelPermissionsDiscord } from "./send.shared-
|
|
1
|
+
import { sn as __exportAll } from "./retry-DQt1zDgH.js";
|
|
2
|
+
import { x as fetchChannelPermissionsDiscord } from "./send.shared-B0n_fWzu.js";
|
|
3
3
|
import { t as inspectDiscordAccount } from "./account-inspect-BY-ve3yH.js";
|
|
4
|
-
import "./send-
|
|
5
|
-
import { _ as auditDiscordChannelPermissionsWithFetcher, v as collectDiscordAuditChannelIdsForAccount } from "./outbound-session-route-
|
|
4
|
+
import "./send-CZeWKUiA.js";
|
|
5
|
+
import { _ as auditDiscordChannelPermissionsWithFetcher, v as collectDiscordAuditChannelIdsForAccount } from "./outbound-session-route-Q_HEusBQ.js";
|
|
6
6
|
//#region extensions/discord/src/audit.ts
|
|
7
7
|
var audit_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
auditDiscordChannelPermissions: () => auditDiscordChannelPermissions,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { g as normalizeDiscordMessagingTarget, h as looksLikeDiscordTargetId, v as parseDiscordTarget } from "./retry-
|
|
1
|
+
import { g as normalizeDiscordMessagingTarget, h as looksLikeDiscordTargetId, v as parseDiscordTarget } from "./retry-DQt1zDgH.js";
|
|
2
2
|
import { c as resolveDiscordAccount, i as listDiscordStartupAccountIds, l as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.js";
|
|
3
3
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
4
4
|
import { u as withAbortTimeout } from "./timeouts-D86uWLt_.js";
|
|
5
|
-
import { C as shouldSuppressLocalDiscordExecApprovalPrompt, D as isChannelExecApprovalClientEnabledFromConfig, E as createChannelNativeOriginTargetResolver, O as matchesApprovalRequestFilters, S as isDiscordExecApprovalClientEnabled, T as createChannelApproverDmTargetResolver, b as getDiscordExecApprovalApprovers, d as resolveDiscordCurrentConversationIdentity, f as resolveDiscordRuntimeBindingConversationId, p as discordMessageActions, s as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, w as createApproverRestrictedNativeApprovalCapability, x as isDiscordExecApprovalApprover, y as resolveRequiredDiscordChannelPermissions } from "./outbound-session-route-
|
|
6
|
-
import { a as discordSecurityAdapter, c as buildTokenChannelStatusSummary, i as discordSetupContract, l as projectCredentialSnapshotFields, n as discordConfigAdapter, o as DEFAULT_ACCOUNT_ID, s as PAIRING_APPROVED_MESSAGE, t as createDiscordPluginBase, u as resolveConfiguredFromCredentialStatuses } from "./shared-
|
|
5
|
+
import { C as shouldSuppressLocalDiscordExecApprovalPrompt, D as isChannelExecApprovalClientEnabledFromConfig, E as createChannelNativeOriginTargetResolver, O as matchesApprovalRequestFilters, S as isDiscordExecApprovalClientEnabled, T as createChannelApproverDmTargetResolver, b as getDiscordExecApprovalApprovers, d as resolveDiscordCurrentConversationIdentity, f as resolveDiscordRuntimeBindingConversationId, p as discordMessageActions, s as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, w as createApproverRestrictedNativeApprovalCapability, x as isDiscordExecApprovalApprover, y as resolveRequiredDiscordChannelPermissions } from "./outbound-session-route-Q_HEusBQ.js";
|
|
6
|
+
import { a as discordSecurityAdapter, c as buildTokenChannelStatusSummary, i as discordSetupContract, l as projectCredentialSnapshotFields, n as discordConfigAdapter, o as DEFAULT_ACCOUNT_ID, s as PAIRING_APPROVED_MESSAGE, t as createDiscordPluginBase, u as resolveConfiguredFromCredentialStatuses } from "./shared-C3dKun_X.js";
|
|
7
7
|
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.js";
|
|
8
|
-
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-
|
|
9
|
-
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-
|
|
10
|
-
import { n as discordOutbound } from "./outbound-adapter-
|
|
8
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-DuR5NGIx.js";
|
|
9
|
+
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-t6jeFB1-.js";
|
|
10
|
+
import { n as discordOutbound } from "./outbound-adapter-CtggmGh9.js";
|
|
11
11
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
12
12
|
import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.js";
|
|
13
13
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -196,7 +196,7 @@ function createDiscordApprovalCapability(configOverride) {
|
|
|
196
196
|
request,
|
|
197
197
|
configOverride
|
|
198
198
|
}),
|
|
199
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
199
|
+
load: async () => (await import("./approval-handler.runtime-DUSe5fyH.js")).discordApprovalNativeRuntime
|
|
200
200
|
})
|
|
201
201
|
});
|
|
202
202
|
}
|
|
@@ -303,12 +303,12 @@ function resolveDiscordInboundConversation(params) {
|
|
|
303
303
|
}
|
|
304
304
|
//#endregion
|
|
305
305
|
//#region extensions/discord/src/channel.loaders.ts
|
|
306
|
-
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
307
|
-
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
308
|
-
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
309
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
310
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
311
|
-
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-
|
|
306
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-CD2v2Szs.js").then((n) => n.t));
|
|
307
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-CoiMlWy0.js").then((n) => n.n));
|
|
308
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-DJpiokfW.js").then((n) => n.n));
|
|
309
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-pbbRT5gb.js").then((n) => n.i));
|
|
310
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-DLtHDwMK.js").then((n) => n.r));
|
|
311
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-C-IkWF2w.js"));
|
|
312
312
|
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-BckHn3cJ.js"));
|
|
313
313
|
async function probeDiscordStatusAccount(params) {
|
|
314
314
|
const startedAtMs = Date.now();
|
|
@@ -316,9 +316,9 @@ async function probeDiscordStatusAccount(params) {
|
|
|
316
316
|
const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
|
|
317
317
|
return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
|
|
318
318
|
}
|
|
319
|
-
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-
|
|
320
|
-
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-
|
|
321
|
-
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
319
|
+
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-DpPfwoJM.js").then((n) => n.n));
|
|
320
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-CZeWKUiA.js").then((n) => n.t));
|
|
321
|
+
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-DaJzWJ2N.js").then((n) => n.t));
|
|
322
322
|
//#endregion
|
|
323
323
|
//#region extensions/discord/src/conversation-route-owner.ts
|
|
324
324
|
function inspectDiscordConversationRouteOwner(params) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { v as parseDiscordTarget, y as resolveDiscordChannelId } from "./retry-
|
|
2
|
-
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-
|
|
3
|
-
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-
|
|
4
|
-
import "./targets-
|
|
1
|
+
import { v as parseDiscordTarget, y as resolveDiscordChannelId } from "./retry-DQt1zDgH.js";
|
|
2
|
+
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-BimX47Mq.js";
|
|
3
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-Ghtfh5ZA.js";
|
|
4
|
+
import "./targets-BObRyaKX.js";
|
|
5
5
|
import "./action-runtime-api.js";
|
|
6
|
-
import { h as discordInboundEventDelivery } from "./outbound-session-route-
|
|
7
|
-
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-
|
|
8
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
6
|
+
import { h as discordInboundEventDelivery } from "./outbound-session-route-Q_HEusBQ.js";
|
|
7
|
+
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-Dn8SJWMS.js";
|
|
8
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-4We6wWQU.js";
|
|
9
9
|
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-fmHl1HNd.js";
|
|
10
10
|
import { normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
11
|
import { adaptMessagePresentationForChannel, normalizeLegacyInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
@@ -87,7 +87,10 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
87
87
|
const to = readSendTarget();
|
|
88
88
|
const asVoice = readBooleanParam(params, "asVoice") === true;
|
|
89
89
|
const mediaUrl = readStringParam$1(params, "media", { trim: false }) ?? readStringParam$1(params, "path", { trim: false }) ?? readStringParam$1(params, "filePath", { trim: false });
|
|
90
|
-
const
|
|
90
|
+
const content = readStringParam$1(params, "message", {
|
|
91
|
+
allowEmpty: true,
|
|
92
|
+
trim: false
|
|
93
|
+
});
|
|
91
94
|
const explicitComponents = coerceDiscordComponentParam(params.components);
|
|
92
95
|
const presentation = explicitComponents == null ? normalizeMessagePresentation(params.presentation) : void 0;
|
|
93
96
|
const adaptedPresentation = presentation ? adaptMessagePresentationForChannel({
|
|
@@ -97,19 +100,14 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
97
100
|
const generatedPresentationComponents = buildDiscordPresentationComponents(adaptedPresentation);
|
|
98
101
|
const presentationComponents = generatedPresentationComponents && isDiscordComponentSpecWithinMessageLimit({
|
|
99
102
|
spec: generatedPresentationComponents,
|
|
100
|
-
fallbackText:
|
|
103
|
+
fallbackText: content,
|
|
101
104
|
includesMedia: Boolean(mediaUrl)
|
|
102
105
|
}) ? generatedPresentationComponents : void 0;
|
|
103
106
|
const presentationFellBack = Boolean(generatedPresentationComponents && !presentationComponents);
|
|
104
107
|
const rawComponents = presentationFellBack ? void 0 : explicitComponents ?? presentationComponents ?? buildDiscordInteractiveComponents(normalizeLegacyInteractiveReply(params.interactive));
|
|
105
|
-
const
|
|
106
|
-
const components = hasComponents ? rawComponents : void 0;
|
|
108
|
+
const components = Boolean(rawComponents) && (typeof rawComponents === "function" || typeof rawComponents === "object") ? rawComponents : void 0;
|
|
107
109
|
const rawEmbeds = params.embeds;
|
|
108
110
|
const embeds = Array.isArray(rawEmbeds) ? rawEmbeds : void 0;
|
|
109
|
-
const content = readStringParam$1(params, "message", {
|
|
110
|
-
required: !asVoice && !hasComponents && !embeds?.length && !mediaUrl && !presentationFellBack,
|
|
111
|
-
allowEmpty: true
|
|
112
|
-
});
|
|
113
111
|
const deliveryContent = presentationFellBack && presentation ? renderMessagePresentationFallbackText({
|
|
114
112
|
text: content,
|
|
115
113
|
presentation
|
|
@@ -125,7 +123,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
125
123
|
action: "sendMessage",
|
|
126
124
|
accountId: accountId ?? void 0,
|
|
127
125
|
to,
|
|
128
|
-
content: deliveryContent
|
|
126
|
+
content: deliveryContent,
|
|
129
127
|
...threadName ? { threadName } : {},
|
|
130
128
|
mediaUrl: mediaUrl ?? void 0,
|
|
131
129
|
filename: filename ?? void 0,
|
|
@@ -148,7 +146,16 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
148
146
|
if (readStringParam$1(params, "buffer", { trim: false })) throw new Error("Use action: \"send\" for base64 buffer attachments; upload-file requires filePath, path, or media.");
|
|
149
147
|
throw new Error("upload-file requires filePath, path, or media.");
|
|
150
148
|
}
|
|
151
|
-
const content = readStringParam$1(params, "message", {
|
|
149
|
+
const content = readStringParam$1(params, "message", {
|
|
150
|
+
allowEmpty: true,
|
|
151
|
+
trim: false
|
|
152
|
+
}) ?? readStringParam$1(params, "content", {
|
|
153
|
+
allowEmpty: true,
|
|
154
|
+
trim: false
|
|
155
|
+
}) ?? readStringParam$1(params, "caption", {
|
|
156
|
+
allowEmpty: true,
|
|
157
|
+
trim: false
|
|
158
|
+
});
|
|
152
159
|
const filename = readStringParam$1(params, "filename");
|
|
153
160
|
const replyTo = readStringParam$1(params, "replyTo");
|
|
154
161
|
const silent = readBooleanParam(params, "silent") === true;
|
|
@@ -212,24 +219,14 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
212
219
|
around: readStringParam$1(params, "around")
|
|
213
220
|
}, cfg, actionOptions);
|
|
214
221
|
}
|
|
215
|
-
if (action === "edit") {
|
|
222
|
+
if (action === "edit" || action === "delete") {
|
|
216
223
|
const messageId = readStringParam$1(params, "messageId", { required: true });
|
|
217
|
-
const content = readStringParam$1(params, "message", { required: true });
|
|
218
224
|
return await handleDiscordAction({
|
|
219
|
-
action: "editMessage",
|
|
225
|
+
action: action === "edit" ? "editMessage" : "deleteMessage",
|
|
220
226
|
accountId: accountId ?? void 0,
|
|
221
227
|
channelId: resolveChannelId(),
|
|
222
228
|
messageId,
|
|
223
|
-
content
|
|
224
|
-
}, cfg, actionOptions);
|
|
225
|
-
}
|
|
226
|
-
if (action === "delete") {
|
|
227
|
-
const messageId = readStringParam$1(params, "messageId", { required: true });
|
|
228
|
-
return await handleDiscordAction({
|
|
229
|
-
action: "deleteMessage",
|
|
230
|
-
accountId: accountId ?? void 0,
|
|
231
|
-
channelId: resolveChannelId(),
|
|
232
|
-
messageId
|
|
229
|
+
...action === "edit" ? { content: params.message } : {}
|
|
233
230
|
}, cfg, actionOptions);
|
|
234
231
|
}
|
|
235
232
|
if (action === "pin" || action === "unpin" || action === "list-pins") {
|
|
@@ -249,7 +246,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
249
246
|
if (action === "thread-create") {
|
|
250
247
|
const name = readStringParam$1(params, "threadName", { required: true });
|
|
251
248
|
const messageId = readStringParam$1(params, "messageId");
|
|
252
|
-
const content = readStringParam$1(params, "message");
|
|
249
|
+
const content = readStringParam$1(params, "message", { trim: false });
|
|
253
250
|
const autoArchiveMinutes = readDiscordAutoArchiveDurationParam(params, "autoArchiveMin");
|
|
254
251
|
const appliedTags = readStringArrayParam$1(params, "appliedTags");
|
|
255
252
|
const result = await handleDiscordAction({
|
|
@@ -287,7 +284,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
287
284
|
accountId: accountId ?? void 0,
|
|
288
285
|
to,
|
|
289
286
|
stickerIds,
|
|
290
|
-
content: readStringParam$1(params, "message"),
|
|
287
|
+
content: readStringParam$1(params, "message", { trim: false }),
|
|
291
288
|
...readBooleanParam(params, "silent") === true ? { silent: true } : {}
|
|
292
289
|
}, cfg, actionOptions);
|
|
293
290
|
notifyVisibleOutbound(result, to);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordPlugin } from "./channel-
|
|
1
|
+
import { t as discordPlugin } from "./channel-BHajPgwR.js";
|
|
2
2
|
export { discordPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as inspectDiscordAccountTokenState, h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-CwJQoLjM.js";
|
|
2
|
-
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-
|
|
3
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
4
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
2
|
+
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-C3dKun_X.js";
|
|
3
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-CoiMlWy0.js";
|
|
4
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-DJpiokfW.js";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region extensions/discord/src/command-owners.ts
|
|
2
|
+
function resolveDiscordCommandOwnerEntries(cfg) {
|
|
3
|
+
const entries = (cfg.commands?.ownerAllowFrom ?? []).map((entry) => String(entry).trim()).filter((entry) => entry && (/^(discord|user|pk):/i.test(entry) || !entry.includes(":")));
|
|
4
|
+
return entries.length > 0 ? entries.filter((entry) => !/^discord:user:/i.test(entry)) : void 0;
|
|
5
|
+
}
|
|
6
|
+
function resolveDiscordCommandOwnerAllowFrom(cfg) {
|
|
7
|
+
return resolveDiscordCommandOwnerEntries(cfg)?.map((entry) => entry.replace(/^discord:/i, "").trim()).filter(Boolean);
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { resolveDiscordCommandOwnerEntries as n, resolveDiscordCommandOwnerAllowFrom as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as RadioGroup, Q as Modal, X as CheckboxGroup, Z as Label, _t as parseCustomId, at as LinkButton, ct as RoleSelectMenu, dt as Separator, et as TextInput, ft as StringSelectMenu, ht as UserSelectMenu, it as File, lt as Row, mt as Thumbnail, nt as ChannelSelectMenu, ot as MediaGallery, pt as TextDisplay, rt as Container, sn as __exportAll, st as MentionableSelectMenu, tt as Button, ut as Section } from "./retry-
|
|
1
|
+
import { $ as RadioGroup, Q as Modal, X as CheckboxGroup, Z as Label, _t as parseCustomId, at as LinkButton, ct as RoleSelectMenu, dt as Separator, et as TextInput, ft as StringSelectMenu, ht as UserSelectMenu, it as File, lt as Row, mt as Thumbnail, nt as ChannelSelectMenu, ot as MediaGallery, pt as TextDisplay, rt as Container, sn as __exportAll, st as MentionableSelectMenu, tt as Button, ut as Section } from "./retry-DQt1zDgH.js";
|
|
2
2
|
import { ButtonStyle, MessageFlags, TextInputStyle } from "discord-api-types/v10";
|
|
3
3
|
import crypto from "node:crypto";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
package/dist/{conversation-binding-route-24afmvEC.js → conversation-binding-route-DuR5NGIx.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-
|
|
1
|
+
import { l as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-Q_HEusBQ.js";
|
|
2
2
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
3
3
|
import { resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-binding-runtime";
|
|
4
4
|
//#region extensions/discord/src/monitor/conversation-binding-route.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sn as __exportAll } from "./retry-
|
|
1
|
+
import { sn as __exportAll } from "./retry-DQt1zDgH.js";
|
|
2
2
|
import { l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.js";
|
|
3
3
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
4
4
|
import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-
|
|
1
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-CD2v2Szs.js";
|
|
2
2
|
//#region extensions/discord/directory-contract-api.ts
|
|
3
3
|
const discordDirectoryContractPlugin = {
|
|
4
4
|
id: "discord",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { sn as __exportAll } from "./retry-
|
|
1
|
+
import { sn as __exportAll } from "./retry-DQt1zDgH.js";
|
|
2
2
|
import { c as resolveDiscordAccount, m as normalizeDiscordToken } from "./accounts-CwJQoLjM.js";
|
|
3
3
|
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BfmEP6wp.js";
|
|
4
|
-
import { a as normalizeDiscordSlug } from "./allow-list-
|
|
4
|
+
import { a as normalizeDiscordSlug } from "./allow-list-DBTtR2dz.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,7 +1,7 @@
|
|
|
1
1
|
import { s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.js";
|
|
2
|
-
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
2
|
+
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-Dc6Nnli5.js";
|
|
3
3
|
import { t as inspectDiscordAccount } from "./account-inspect-BY-ve3yH.js";
|
|
4
|
-
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-
|
|
4
|
+
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-C3dKun_X.js";
|
|
5
5
|
import { n as normalizeCompatibilityConfig } from "./doctor-contract-Co5vRCZ6.js";
|
|
6
6
|
import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.js";
|
|
7
7
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
@@ -175,7 +175,10 @@ function collectDiscordTranscriptsAutoStartWarnings(cfg) {
|
|
|
175
175
|
if (providerId !== discordVoiceTranscriptsSourceProvider.id && !discordVoiceTranscriptsSourceProvider.aliases?.includes(providerId ?? "") || normalizeOptionalString(entry.accountId)) return [];
|
|
176
176
|
const resolution = ownership.resolveAccountId({
|
|
177
177
|
cfg,
|
|
178
|
-
source:
|
|
178
|
+
source: {
|
|
179
|
+
providerId: entry.providerId,
|
|
180
|
+
accountId: entry.accountId
|
|
181
|
+
}
|
|
179
182
|
});
|
|
180
183
|
if (resolution.ok) return [];
|
|
181
184
|
const path = `transcripts.autoStart[${index}]`;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { n as DISCORD_COMMAND_DEPLOY_HASH_NAMESPACE, t as DISCORD_COMMAND_DEPLOY_HASH_MAX_ENTRIES } from "./command-deploy-store-DFkBTViB.js";
|
|
2
|
-
import { a as THREAD_BINDINGS_MAX_ENTRIES, d as normalizePersistedBinding, k as toBindingRecordKey, o as THREAD_BINDINGS_NAMESPACE } from "./thread-bindings.state-D8OMdk4O.js";
|
|
3
2
|
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-Co5vRCZ6.js";
|
|
4
3
|
import { i as sanitizeRecentModels, r as preferenceTimestampMs, t as buildPreferenceModelKey } from "./model-picker-preference-primitives-BHT1LkR_.js";
|
|
5
4
|
import { MAX_DATE_TIMESTAMP_MS, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -62,7 +61,7 @@ function upgradeLegacyThreadBindingShape(rawEntry) {
|
|
|
62
61
|
}
|
|
63
62
|
return entry;
|
|
64
63
|
}
|
|
65
|
-
const detectDiscordLegacyStateMigrations = ({ stateDir }) => {
|
|
64
|
+
const detectDiscordLegacyStateMigrations = async ({ stateDir }) => {
|
|
66
65
|
const plans = [];
|
|
67
66
|
const commandDeployCacheSourcePath = path.join(stateDir, "discord", "command-deploy-cache.json");
|
|
68
67
|
if (fileExists(commandDeployCacheSourcePath)) plans.push({
|
|
@@ -110,31 +109,34 @@ const detectDiscordLegacyStateMigrations = ({ stateDir }) => {
|
|
|
110
109
|
}
|
|
111
110
|
});
|
|
112
111
|
const threadBindingsSourcePath = path.join(stateDir, "discord", "thread-bindings.json");
|
|
113
|
-
if (fileExists(threadBindingsSourcePath))
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
112
|
+
if (fileExists(threadBindingsSourcePath)) {
|
|
113
|
+
const { normalizePersistedBinding, THREAD_BINDINGS_MAX_ENTRIES, THREAD_BINDINGS_NAMESPACE, toBindingRecordKey } = await import("./thread-bindings.state-DtgOqsbX.js").then((n) => n.E);
|
|
114
|
+
plans.push({
|
|
115
|
+
kind: "plugin-state-import",
|
|
116
|
+
label: "Discord thread bindings",
|
|
117
|
+
sourcePath: threadBindingsSourcePath,
|
|
118
|
+
targetPath: `plugin state:${THREAD_BINDINGS_NAMESPACE}`,
|
|
119
|
+
pluginId: "discord",
|
|
120
|
+
namespace: THREAD_BINDINGS_NAMESPACE,
|
|
121
|
+
maxEntries: THREAD_BINDINGS_MAX_ENTRIES,
|
|
122
|
+
scopeKey: "",
|
|
123
|
+
cleanupSource: "rename",
|
|
124
|
+
cleanupWhenEmpty: true,
|
|
125
|
+
readEntries: () => {
|
|
126
|
+
const store = readLegacyThreadBindingsStore(threadBindingsSourcePath);
|
|
127
|
+
if (store?.version !== 1 || !store.bindings || typeof store.bindings !== "object") throw new Error("legacy Discord thread bindings store must have version 1 bindings");
|
|
128
|
+
const out = [];
|
|
129
|
+
for (const [rawKey, rawEntry] of Object.entries(store.bindings)) {
|
|
130
|
+
const normalized = normalizePersistedBinding(rawKey, upgradeLegacyThreadBindingShape(rawEntry));
|
|
131
|
+
if (normalized) out.push({
|
|
132
|
+
key: toBindingRecordKey(normalized),
|
|
133
|
+
value: normalized
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return out;
|
|
134
137
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
});
|
|
138
|
+
});
|
|
139
|
+
}
|
|
138
140
|
return plans;
|
|
139
141
|
};
|
|
140
142
|
//#endregion
|
package/dist/{handle-action.guild-admin-B0egstYq.js → handle-action.guild-admin-4We6wWQU.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as readDiscordChannelMoveParams, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { c as readDiscordChannelMoveParams, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-Ghtfh5ZA.js";
|
|
2
2
|
import "./action-runtime-api.js";
|
|
3
|
-
import { m as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-
|
|
3
|
+
import { m as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-Q_HEusBQ.js";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
6
6
|
import { readNonNegativeIntegerParam, readPositiveIntegerParam, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/agent-runtime";
|
|
@@ -276,7 +276,10 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
276
276
|
}, cfg, readPolicyOptions);
|
|
277
277
|
}
|
|
278
278
|
if (action === "thread-reply") {
|
|
279
|
-
const content = readStringParam(actionParams, "message", {
|
|
279
|
+
const content = readStringParam(actionParams, "message", {
|
|
280
|
+
required: true,
|
|
281
|
+
trim: false
|
|
282
|
+
});
|
|
280
283
|
const mediaUrl = readStringParam(actionParams, "media", { trim: false }) ?? readStringParam(actionParams, "path", { trim: false }) ?? readStringParam(actionParams, "filePath", { trim: false });
|
|
281
284
|
const replyTo = readStringParam(actionParams, "replyTo");
|
|
282
285
|
const channelId = readStringParam(actionParams, "threadId") ?? resolveChannelId();
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as registerDiscordActivities } from "./activities-api-
|
|
1
|
+
import { t as registerDiscordActivities } from "./activities-api-CTcGq3Hf.js";
|
|
2
2
|
import { registerDiscordSubagentHooks } from "./subagent-hooks-api.js";
|
|
3
3
|
import { registerDiscordTranscriptSourceProvider } from "./transcripts-source-api.js";
|
|
4
4
|
import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as normalizeDiscordAllowList } from "./allow-list-
|
|
1
|
+
import { r as normalizeDiscordAllowList } from "./allow-list-DBTtR2dz.js";
|
|
2
2
|
import { defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
3
3
|
//#region extensions/discord/src/monitor/ingress-identity.ts
|
|
4
4
|
const DISCORD_ALLOW_LIST_PREFIXES = [
|