@openclaw/discord 2026.11.5-beta.1 → 2026.11.5-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/.setup/{account-inspect-CSz5Qodj.mjs → account-inspect-DGkdWwix.mjs} +3 -2
- package/dist/.setup/{accounts-DtjvhJUj.mjs → accounts-C_25wyxC.mjs} +8 -4
- package/dist/.setup/{active-turn-thread-route-DkPnk2x8.mjs → active-turn-thread-route-KvRTAVE3.mjs} +2 -1
- package/dist/.setup/{allow-list-DahA0Jxh.mjs → allow-list-BXrS8-R9.mjs} +8 -4
- package/dist/.setup/{api-Bp0HI4q3.mjs → api-BlBD4ism.mjs} +6 -4
- package/dist/.setup/{approval-handler.runtime-Cy53ugTf.mjs → approval-handler.runtime-BGYjX1t9.mjs} +10 -9
- package/dist/.setup/{approval-message-updates-DqOXxPss.mjs → approval-message-updates-DKsCfxSW.mjs} +4 -3
- package/dist/.setup/{audit-DoPKOfQE.mjs → audit-5b-FXj9R.mjs} +7 -6
- package/dist/.setup/{channel-Ds6iuNdy.mjs → channel-CWwTHWFo.mjs} +39 -32
- package/dist/.setup/{channel-access-DhJhVrdZ.mjs → channel-access-9cyzozUP.mjs} +2 -1
- package/dist/.setup/{channel.setup-BLt9dkIG.mjs → channel.setup-B3MtmBQG.mjs} +10 -7
- package/dist/.setup/{command-deploy-store-DPWiBMks.mjs → command-deploy-store-DFkBTViB.mjs} +2 -1
- package/dist/.setup/{command-owners-BzlhNBxA.mjs → command-owners-C7rUdqUX.mjs} +2 -1
- package/dist/.setup/{components-WTfUxead.mjs → components-YCvQ6YLS.mjs} +16 -10
- package/dist/.setup/{components.base-C5sAPHe4.mjs → components.base-CiS0h_XP.mjs} +2 -1
- package/dist/.setup/{config-schema-GX2yDgIH.mjs → config-schema-BNKN1cu5.mjs} +5 -3
- package/dist/.setup/{conversation-binding-route-CZdm-X5A.mjs → conversation-binding-route-kCTw8cij.mjs} +3 -2
- package/dist/.setup/{directory-config-BXJuh9-J.mjs → directory-config-Ble81PWH.mjs} +4 -3
- package/dist/.setup/{directory-live-CEopeb8Q.mjs → directory-live-DH3tpS3x.mjs} +11 -8
- package/dist/.setup/{discord-r79VFjJp.mjs → discord-DGVSguhx.mjs} +52 -28
- package/dist/.setup/{doctor-contract-Dstl3cMg.mjs → doctor-contract-Bwv8EuQ_.mjs} +3 -2
- package/dist/.setup/{doctor-UfLW8nye.mjs → doctor-eujgbnpZ.mjs} +8 -7
- package/dist/.setup/{endpoint-runtime-BM3x-m6O.mjs → endpoint-runtime-lf4DeLas.mjs} +2 -1
- package/dist/.setup/{guilds-DQucP5Tn.mjs → guilds-eDq22iSM.mjs} +4 -3
- package/dist/.setup/{handle-action-BarHOi-v.mjs → handle-action-CktwmzMz.mjs} +11 -10
- package/dist/.setup/{handle-action.guild-admin-oRUb8p_O.mjs → handle-action.guild-admin-WLQ7fRqI.mjs} +4 -3
- package/dist/.setup/{listeners-CHgTENFu.mjs → listeners-Df8lx3vK.mjs} +3 -2
- package/dist/.setup/{live-policy-config-EKp4O6zx.mjs → live-policy-config-DiBVuaU6.mjs} +5 -3
- package/dist/.setup/{message-handler-DUeT8Asf.mjs → message-handler-hhNSioxo.mjs} +15 -11
- package/dist/.setup/{message-handler.preflight-C6TNtKW0.mjs → message-handler.preflight-BZcZE1o-.mjs} +26 -19
- package/dist/.setup/{message-handler.preflight-pluralkit-6E9TFmmN.mjs → message-handler.preflight-pluralkit-CYZfXXb6.mjs} +14 -10
- package/dist/.setup/{message-handler.process-D8_oQ5Cp.mjs → message-handler.process-B0n-mQ99.mjs} +34 -26
- package/dist/.setup/{outbound-payload-DUsrFICb.mjs → outbound-payload-BaZmjewa.mjs} +11 -9
- package/dist/.setup/{outbound-session-route-Cb8cv4Oi.mjs → outbound-session-route-Cgx4i9cS.mjs} +34 -22
- package/dist/.setup/{output-activity-CDgs2s3O.mjs → output-activity-uBpMSX75.mjs} +2 -1
- package/dist/.setup/{pluralkit-DcXbHTpQ.mjs → pluralkit-B64dfq_j.mjs} +3 -2
- package/dist/.setup/{preflight-audio-r4BbaJxh.mjs → preflight-audio-C6QtD6HX.mjs} +2 -1
- package/dist/.setup/{presence-cache-B3xj3b0l.mjs → presence-cache-Dq-3nH7R.mjs} +2 -1
- package/dist/.setup/{probe-BUmJyH35.mjs → probe-DezB-6xz.mjs} +6 -5
- package/dist/.setup/{provider-Dm2ERSxe.mjs → provider-BN2bCIUp.mjs} +185 -109
- package/dist/.setup/{provider-session.runtime-DCIqDsIg.mjs → provider-session.runtime-Dr_5X43t.mjs} +3 -3
- package/dist/.setup/provider.runtime-BuJpl0Pv.mjs +1 -0
- package/dist/.setup/{proxy-fetch-B8cK6FLQ.mjs → proxy-fetch-BzXwBAXt.mjs} +2 -1
- package/dist/.setup/{realtime-session.runtime-WJL6NdwK.mjs → realtime-session.runtime-BTDWsV4d.mjs} +25 -15
- package/dist/.setup/{receive-recovery-DV_v5ROf.mjs → receive-recovery-C3Ks4wAQ.mjs} +6 -3
- package/dist/.setup/{resolve-allowlist-common-C37fgnYG.mjs → resolve-allowlist-common-Bk8Fj6Ik.mjs} +4 -3
- package/dist/.setup/{resolve-channels-CwpnQ7C2.mjs → resolve-channels-Bp8frXvc.mjs} +7 -6
- package/dist/.setup/{resolve-users-D6jSwe8R.mjs → resolve-users-Cvcj22sG.mjs} +6 -5
- package/dist/.setup/{rolldown-runtime-nwUcYXjP.mjs → rolldown-runtime-B4FMCO8f.mjs} +2 -1
- package/dist/.setup/{runtime-DhOMlnYS.mjs → runtime-BJaCvlmq.mjs} +26 -18
- package/dist/.setup/{runtime-B-PgPsGR.mjs → runtime-BMgTyuwg.mjs} +6 -4
- package/dist/.setup/{runtime-DcBvHOm1.mjs → runtime-DgnVQ7zW.mjs} +2 -1
- package/dist/.setup/{runtime-doctor-migrations-BpV1jKk0.mjs → runtime-doctor-migrations-BPV-R4G9.mjs} +9 -5
- package/dist/.setup/{secret-config-contract-CP6teHec.mjs → secret-config-contract-B1kE4sDv.mjs} +2 -1
- package/dist/.setup/{security-audit-CTwisG7c.mjs → security-audit-BFT84Uny.mjs} +4 -3
- package/dist/.setup/{security-contract-D-o0iWDk.mjs → security-contract-DNyyjTZZ.mjs} +2 -1
- package/dist/.setup/{security-doctor-4s7omTZd.mjs → security-doctor-nGgPm65L.mjs} +2 -1
- package/dist/.setup/{send-DnLL6XoO.mjs → send-CVW7V-VZ.mjs} +28 -19
- package/dist/.setup/{send.components-xB43CksK.mjs → send.components-C8YXdnO_.mjs} +14 -11
- package/dist/.setup/{send.outbound-B11X6TOE.mjs → send.outbound-Uzcmh3Yd.mjs} +16 -11
- package/dist/.setup/{send.receipt-CMteCIZS.mjs → send.receipt-NZDOTZBU.mjs} +16 -9
- package/dist/.setup/{send.shared-BcLLZBul.mjs → send.shared-a_6Oeyg1.mjs} +18 -12
- package/dist/.setup/{sender-identity-CGNpdJmb.mjs → sender-identity-76HFb8eK.mjs} +3 -2
- package/dist/.setup/{session-contract-Bq71MS78.mjs → session-contract-BO5tlIdl.mjs} +2 -1
- package/dist/.setup/{session-key-normalization-Cfvze5hd.mjs → session-key-normalization-CCHGNSQw.mjs} +2 -1
- package/dist/.setup/setup-plugin-api-BExhGEhL.mjs +2 -0
- package/dist/.setup/{shared-interactive-DKBw4SNV.mjs → shared-interactive-DmzaoKOM.mjs} +12 -7
- package/dist/.setup/{shared-BEYw16he.mjs → shared-yDUSExm2.mjs} +17 -14
- package/dist/.setup/{subagent-hooks-DlYElpXa.mjs → subagent-hooks-CDkdHQyy.mjs} +4 -3
- package/dist/.setup/{system-events--Pk6y9aP.mjs → system-events-yfWz150v.mjs} +4 -3
- package/dist/.setup/{target-parsing-BiuhcK9Q.mjs → target-parsing-C-HyNxcE.mjs} +2 -1
- package/dist/.setup/{target-resolver-Bo9EpGp_.mjs → target-resolver-BOOzqxxM.mjs} +7 -6
- package/dist/.setup/{thread-binding-api-Drd4Zu-5.mjs → thread-binding-api-BDZJD4na.mjs} +2 -1
- package/dist/.setup/{thread-bindings-BF-hr-bg.mjs → thread-bindings-zce4cpu_.mjs} +10 -7
- package/dist/.setup/{thread-bindings.manager-CQCkha5r.mjs → thread-bindings.manager-NywKzUtc.mjs} +20 -15
- package/dist/.setup/{thread-bindings.session-updates-C2gJAj_I.mjs → thread-bindings.session-updates-D0j7oh8S.mjs} +10 -6
- package/dist/.setup/{threading-HA9C2wYR.mjs → threading-DodLYDt-.mjs} +7 -5
- package/dist/.setup/{timeouts-CT9hnmo4.mjs → timeouts-cIxzatmv.mjs} +2 -1
- package/dist/.setup/{transcripts-source-DzpzETZR.mjs → transcripts-source-ie9GBWaU.mjs} +33 -20
- package/dist/.setup/{typing-DAv4S2fI.mjs → typing-CNlSKY5S.mjs} +3 -2
- package/dist/.setup/{voice-runtime-Bo_nsVvX.mjs → voice-runtime-B7V_LTdX.mjs} +46 -28
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
- package/dist/account-inspect-api.js +3 -2
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +13 -9
- package/dist/api.js +22 -21
- package/dist/assets/embedded-app-sdk.mjs +1 -1
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/directory-contract-api.js +3 -2
- package/dist/doctor-contract-api.js +7 -5
- package/dist/index.js +2 -1
- package/dist/runtime-api.js +22 -22
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-entry.js +3 -2
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +14 -8
- package/dist/subagent-hooks-api.js +3 -2
- package/dist/thread-binding-api.js +1 -1
- package/dist/transcripts-source-api.js +3 -2
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.cjs +3 -2
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.mjs +3 -2
- package/package.json +4 -4
- package/dist/.setup/provider.runtime-DmxPGoUg.mjs +0 -1
- package/dist/.setup/setup-plugin-api-C6AMx3hu.mjs +0 -2
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { h as normalizeDiscordToken, l as resolveDiscordAccount } from "./accounts-
|
|
3
|
-
import { o as normalizeDiscordSlug } from "./allow-list-
|
|
4
|
-
import { t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
5
|
-
import { n as listGuilds, r as searchDiscordGuildMembers, t as listDiscordGuildChannels } from "./guilds-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { h as normalizeDiscordToken, l as resolveDiscordAccount } from "./accounts-C_25wyxC.mjs";
|
|
3
|
+
import { o as normalizeDiscordSlug } from "./allow-list-BXrS8-R9.mjs";
|
|
4
|
+
import { t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BlBD4ism.mjs";
|
|
5
|
+
import { n as listGuilds, r as searchDiscordGuildMembers, t as listDiscordGuildChannels } from "./guilds-eDq22iSM.mjs";
|
|
6
6
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
7
7
|
import { normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
9
|
-
|
|
9
|
+
//#region extensions/discord/src/directory-cache-state.ts
|
|
10
10
|
const discordDirectoryCacheState = { handlesByAccount: /* @__PURE__ */ new Map() };
|
|
11
|
-
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region extensions/discord/src/directory-cache.ts
|
|
12
13
|
const DISCORD_DIRECTORY_CACHE_MAX_ENTRIES = 4e3;
|
|
13
14
|
const DISCORD_DISCRIMINATOR_SUFFIX = /#\d{4}$/;
|
|
14
15
|
function normalizeDiscordSnowflake(value) {
|
|
@@ -57,7 +58,8 @@ function resolveDiscordDirectoryUserId(params) {
|
|
|
57
58
|
if (!handle) return;
|
|
58
59
|
return cache.get(handle) ?? void 0;
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region extensions/discord/src/directory-live.ts
|
|
61
63
|
var directory_live_exports = /* @__PURE__ */ __exportAll({
|
|
62
64
|
listDiscordDirectoryGroupsLive: () => listDiscordDirectoryGroupsLive,
|
|
63
65
|
listDiscordDirectoryPeersLive: () => listDiscordDirectoryPeersLive
|
|
@@ -138,4 +140,5 @@ function listDiscordDirectoryGroupsLive(params) {
|
|
|
138
140
|
function listDiscordDirectoryPeersLive(params) {
|
|
139
141
|
return listDiscordDirectoryLive(params, "user");
|
|
140
142
|
}
|
|
143
|
+
//#endregion
|
|
141
144
|
export { normalizeDiscordSnowflake as a, normalizeDiscordHandleKey as i, listDiscordDirectoryGroupsLive as n, rememberDiscordDirectoryUser as o, listDiscordDirectoryPeersLive as r, resolveDiscordDirectoryUserId as s, directory_live_exports as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-
|
|
3
|
-
import { n as getDiscordEndpointRuntime } from "./endpoint-runtime-
|
|
4
|
-
import { i as parseCustomId, n as BaseModalComponent, t as BaseMessageInteractiveComponent } from "./components.base-
|
|
1
|
+
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-BXrS8-R9.mjs";
|
|
3
|
+
import { n as getDiscordEndpointRuntime } from "./endpoint-runtime-lf4DeLas.mjs";
|
|
4
|
+
import { i as parseCustomId, n as BaseModalComponent, t as BaseMessageInteractiveComponent } from "./components.base-CiS0h_XP.mjs";
|
|
5
5
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
6
6
|
import { asOptionalObjectRecord, asRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { ApplicationCommandOptionType, ApplicationCommandType, ComponentType, GatewayDispatchEvents, InteractionContextType, InteractionResponseType, InteractionType, MessageFlags, Routes, TextInputStyle } from "discord-api-types/v10";
|
|
@@ -17,11 +17,12 @@ import { Type } from "typebox";
|
|
|
17
17
|
import { Check } from "typebox/value";
|
|
18
18
|
import { createHash } from "node:crypto";
|
|
19
19
|
import { createPermitPool } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
20
|
-
|
|
20
|
+
//#region extensions/discord/src/internal/undefined-fields.ts
|
|
21
21
|
function stripUndefinedFields(value) {
|
|
22
22
|
return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== void 0));
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region extensions/discord/src/internal/request-authority.ts
|
|
25
26
|
const requestAuthority = resolveGlobalSingleton(Symbol.for("openclaw.discord.requestAuthority"), () => new AsyncLocalStorage());
|
|
26
27
|
/** Carry the host's existing assertion without changing its lifetime or ownership. */
|
|
27
28
|
function withDiscordRequestAuthority(assertCurrent, run) {
|
|
@@ -35,7 +36,8 @@ function withDiscordRequestAuthority(assertCurrent, run) {
|
|
|
35
36
|
function captureDiscordRequestAuthority() {
|
|
36
37
|
return requestAuthority.getStore();
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region extensions/discord/src/internal/rest-body.ts
|
|
39
41
|
function fileBlob(file) {
|
|
40
42
|
return file.data instanceof Blob ? file.data : new Blob([file.data], { type: typeof file.contentType === "string" ? file.contentType : void 0 });
|
|
41
43
|
}
|
|
@@ -93,7 +95,8 @@ function serializeRequestBody(data, headers) {
|
|
|
93
95
|
headers.set("Content-Type", "application/json");
|
|
94
96
|
return JSON.stringify(data.body);
|
|
95
97
|
}
|
|
96
|
-
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region extensions/discord/src/internal/rest-errors.ts
|
|
97
100
|
const DISCORD_UNKNOWN_MESSAGE = 10008;
|
|
98
101
|
const DISCORD_UNKNOWN_VOICE_STATE = 10065;
|
|
99
102
|
const DISCORD_ERROR_BODY_MAX_DEPTH = 64;
|
|
@@ -225,7 +228,8 @@ var RateLimitError = class extends DiscordError {
|
|
|
225
228
|
this.scope = body.global ? "global" : readDiscordRateLimitScope(response);
|
|
226
229
|
}
|
|
227
230
|
};
|
|
228
|
-
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region extensions/discord/src/internal/rest-routes.ts
|
|
229
233
|
const RATE_LIMIT_HEADER_NUMBER_RE = /^\d+(?:\.\d+)?$/;
|
|
230
234
|
const DISCORD_ROUTE_IDENTIFIER_HASH_LENGTH = 32;
|
|
231
235
|
function redactWebhookTokenInPath(path) {
|
|
@@ -275,7 +279,8 @@ function appendQuery(path, query) {
|
|
|
275
279
|
for (const [key, value] of Object.entries(query)) search.set(key, String(value));
|
|
276
280
|
return `${path}?${search.toString()}`;
|
|
277
281
|
}
|
|
278
|
-
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region extensions/discord/src/internal/rest-scheduler.ts
|
|
279
284
|
const MAX_QUEUE_SIZE = 1e3;
|
|
280
285
|
const MAX_CONCURRENT_WORKERS = 4;
|
|
281
286
|
const MAX_RATE_LIMIT_RETRIES = 3;
|
|
@@ -473,7 +478,8 @@ var RestScheduler = class {
|
|
|
473
478
|
function isGlobalRateLimit(parsed) {
|
|
474
479
|
return parsed && typeof parsed === "object" && "global" in parsed ? Boolean(parsed.global) : false;
|
|
475
480
|
}
|
|
476
|
-
|
|
481
|
+
//#endregion
|
|
482
|
+
//#region extensions/discord/src/internal/schemas.ts
|
|
477
483
|
const discordInteractionPayloadSchema = Type.Object({
|
|
478
484
|
id: Type.String({ minLength: 1 }),
|
|
479
485
|
token: Type.String({ minLength: 1 }),
|
|
@@ -491,7 +497,8 @@ function assertDiscordInteractionPayload(value) {
|
|
|
491
497
|
function isDiscordRateLimitBody(value) {
|
|
492
498
|
return Check(discordRateLimitBodySchema, value);
|
|
493
499
|
}
|
|
494
|
-
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region extensions/discord/src/internal/rest.ts
|
|
495
502
|
const DISCORD_REST_TIMEOUT_MS = 15e3;
|
|
496
503
|
const defaultOptions = {
|
|
497
504
|
baseUrl: "https://discord.com/api",
|
|
@@ -653,7 +660,8 @@ function getRequestPriority(method, path) {
|
|
|
653
660
|
if (/^\/interactions\/\d+\/[^/]+\/callback$/.test(normalizedPath)) return "critical";
|
|
654
661
|
return normalizedMethod === "GET" ? "background" : "standard";
|
|
655
662
|
}
|
|
656
|
-
|
|
663
|
+
//#endregion
|
|
664
|
+
//#region extensions/discord/src/internal/api.guild.ts
|
|
657
665
|
const discordGuildEmojiListSchema = Type.Array(Type.Object({
|
|
658
666
|
id: Type.Union([Type.String(), Type.Null()]),
|
|
659
667
|
name: Type.Union([Type.String(), Type.Null()]),
|
|
@@ -672,7 +680,8 @@ async function listGuildEmojis(rest, guildId) {
|
|
|
672
680
|
if (!Check(discordGuildEmojiListSchema, emojis)) throw new Error("Invalid Discord guild emoji response.");
|
|
673
681
|
return emojis;
|
|
674
682
|
}
|
|
675
|
-
|
|
683
|
+
//#endregion
|
|
684
|
+
//#region extensions/discord/src/internal/api.messages.ts
|
|
676
685
|
function normalizeDiscordMessageId(messageId) {
|
|
677
686
|
const normalized = messageId.trim();
|
|
678
687
|
if (!/^[0-9]+$/u.test(normalized)) throw new Error("Invalid Discord message ID. Expected decimal digits.");
|
|
@@ -705,7 +714,8 @@ async function createThread(rest, channelId, data, messageId) {
|
|
|
705
714
|
const route = messageId === void 0 ? Routes.threads(channelId) : Routes.threads(channelId, normalizeDiscordMessageId(messageId));
|
|
706
715
|
return await rest.post(route, data);
|
|
707
716
|
}
|
|
708
|
-
|
|
717
|
+
//#endregion
|
|
718
|
+
//#region extensions/discord/src/internal/api.reactions.ts
|
|
709
719
|
function ownReactionMutation(method) {
|
|
710
720
|
return async (rest, channelId, messageId, encodedEmoji) => {
|
|
711
721
|
await rest[method](Routes.channelMessageOwnReaction(channelId, normalizeDiscordMessageId(messageId), encodedEmoji));
|
|
@@ -716,7 +726,8 @@ const deleteOwnMessageReaction = ownReactionMutation("delete");
|
|
|
716
726
|
async function listMessageReactionUsers(rest, channelId, messageId, encodedEmoji, query) {
|
|
717
727
|
return await rest.get(Routes.channelMessageReaction(channelId, normalizeDiscordMessageId(messageId), encodedEmoji), query);
|
|
718
728
|
}
|
|
719
|
-
|
|
729
|
+
//#endregion
|
|
730
|
+
//#region extensions/discord/src/internal/api.users.ts
|
|
720
731
|
async function getCurrentUser(rest) {
|
|
721
732
|
return await rest.get(Routes.user("@me"));
|
|
722
733
|
}
|
|
@@ -726,7 +737,8 @@ async function getUser(rest, userId) {
|
|
|
726
737
|
async function createUserDmChannel(rest, recipientId) {
|
|
727
738
|
return await rest.post(Routes.userChannels(), { body: { recipient_id: recipientId } });
|
|
728
739
|
}
|
|
729
|
-
|
|
740
|
+
//#endregion
|
|
741
|
+
//#region extensions/discord/src/internal/commands.ts
|
|
730
742
|
async function deferCommandInteractionIfNeeded(command, interaction) {
|
|
731
743
|
if (!command.defer) return;
|
|
732
744
|
await interaction.defer({ ephemeral: command.ephemeral });
|
|
@@ -814,7 +826,8 @@ var CommandWithSubcommands = class extends BaseCommand {
|
|
|
814
826
|
}));
|
|
815
827
|
}
|
|
816
828
|
};
|
|
817
|
-
|
|
829
|
+
//#endregion
|
|
830
|
+
//#region extensions/discord/src/internal/structures.ts
|
|
818
831
|
var Base = class {
|
|
819
832
|
constructor(client) {
|
|
820
833
|
this.client = client;
|
|
@@ -968,7 +981,8 @@ function channelFactory(clientForTest, channelData) {
|
|
|
968
981
|
ownerId: "owner_id" in channelData ? channelData.owner_id : void 0
|
|
969
982
|
};
|
|
970
983
|
}
|
|
971
|
-
|
|
984
|
+
//#endregion
|
|
985
|
+
//#region extensions/discord/src/internal/interaction-options.ts
|
|
972
986
|
function findOption(options, matches) {
|
|
973
987
|
for (const option of options ?? []) {
|
|
974
988
|
if (matches(option)) return option;
|
|
@@ -1011,7 +1025,8 @@ var OptionsHandler = class {
|
|
|
1011
1025
|
return findOption(this.rawOptions, (option) => "focused" in option && Boolean(option.focused));
|
|
1012
1026
|
}
|
|
1013
1027
|
};
|
|
1014
|
-
|
|
1028
|
+
//#endregion
|
|
1029
|
+
//#region extensions/discord/src/internal/modal-fields.ts
|
|
1015
1030
|
function extractModalFields(components) {
|
|
1016
1031
|
const out = {};
|
|
1017
1032
|
for (const component of flattenModalComponents(components)) {
|
|
@@ -1070,7 +1085,8 @@ var ModalFields = class {
|
|
|
1070
1085
|
});
|
|
1071
1086
|
}
|
|
1072
1087
|
};
|
|
1073
|
-
|
|
1088
|
+
//#endregion
|
|
1089
|
+
//#region extensions/discord/src/internal/embeds.ts
|
|
1074
1090
|
var Embed = class {
|
|
1075
1091
|
constructor(embed) {
|
|
1076
1092
|
Object.assign(this, embed);
|
|
@@ -1090,7 +1106,8 @@ var Embed = class {
|
|
|
1090
1106
|
});
|
|
1091
1107
|
}
|
|
1092
1108
|
};
|
|
1093
|
-
|
|
1109
|
+
//#endregion
|
|
1110
|
+
//#region extensions/discord/src/internal/payload.ts
|
|
1094
1111
|
function asSerializableComponent(component) {
|
|
1095
1112
|
return {
|
|
1096
1113
|
isV2: component.type !== ComponentType.ActionRow,
|
|
@@ -1121,7 +1138,8 @@ function serializePayload(payload) {
|
|
|
1121
1138
|
sticker_ids: payload.stickers
|
|
1122
1139
|
});
|
|
1123
1140
|
}
|
|
1124
|
-
|
|
1141
|
+
//#endregion
|
|
1142
|
+
//#region extensions/discord/src/internal/interactions.ts
|
|
1125
1143
|
function needsComponentsV2Query(body) {
|
|
1126
1144
|
return "flags" in body && ((body.flags ?? 0) & MessageFlags.IsComponentsV2) !== 0;
|
|
1127
1145
|
}
|
|
@@ -1274,7 +1292,8 @@ function createInteraction(client, rawData) {
|
|
|
1274
1292
|
if (rawData.type === InteractionType.MessageComponent) return new BaseComponentInteraction(client, rawData);
|
|
1275
1293
|
return new BaseInteraction(client, rawData);
|
|
1276
1294
|
}
|
|
1277
|
-
|
|
1295
|
+
//#endregion
|
|
1296
|
+
//#region extensions/discord/src/internal/interaction-dispatch.ts
|
|
1278
1297
|
async function dispatchInteraction(client, rawData) {
|
|
1279
1298
|
const interaction = createInteraction(client, rawData);
|
|
1280
1299
|
if (rawData.type === InteractionType.ApplicationCommandAutocomplete) {
|
|
@@ -1341,7 +1360,8 @@ async function deferComponentInteractionIfNeeded(component, interaction) {
|
|
|
1341
1360
|
}
|
|
1342
1361
|
await interaction.acknowledge();
|
|
1343
1362
|
}
|
|
1344
|
-
|
|
1363
|
+
//#endregion
|
|
1364
|
+
//#region extensions/discord/src/internal/client.ts
|
|
1345
1365
|
const DEFAULT_REST_CACHE_TTL_MS = 3e4;
|
|
1346
1366
|
const DEFAULT_MAX_ENTRIES = 5e3;
|
|
1347
1367
|
const DEFAULT_SWEEP_INTERVAL_MS = 3e4;
|
|
@@ -1630,7 +1650,8 @@ var Client = class {
|
|
|
1630
1650
|
}));
|
|
1631
1651
|
}
|
|
1632
1652
|
};
|
|
1633
|
-
|
|
1653
|
+
//#endregion
|
|
1654
|
+
//#region extensions/discord/src/internal/components.modal.ts
|
|
1634
1655
|
var TextInput = class extends BaseModalComponent {
|
|
1635
1656
|
constructor(..._args) {
|
|
1636
1657
|
super(..._args);
|
|
@@ -1708,7 +1729,8 @@ var Modal = class {
|
|
|
1708
1729
|
};
|
|
1709
1730
|
}
|
|
1710
1731
|
};
|
|
1711
|
-
|
|
1732
|
+
//#endregion
|
|
1733
|
+
//#region extensions/discord/src/internal/listeners.ts
|
|
1712
1734
|
var BaseListener = class {};
|
|
1713
1735
|
var ReadyListener = class extends BaseListener {
|
|
1714
1736
|
constructor(..._args) {
|
|
@@ -1722,7 +1744,8 @@ var GuildCreateListener = class extends BaseListener {
|
|
|
1722
1744
|
this.type = GatewayDispatchEvents.GuildCreate;
|
|
1723
1745
|
}
|
|
1724
1746
|
};
|
|
1725
|
-
|
|
1747
|
+
//#endregion
|
|
1748
|
+
//#region extensions/discord/src/internal/discord.ts
|
|
1726
1749
|
var discord_exports = /* @__PURE__ */ __exportAll({
|
|
1727
1750
|
AutocompleteInteraction: () => AutocompleteInteraction,
|
|
1728
1751
|
BaseCommand: () => BaseCommand,
|
|
@@ -1777,4 +1800,5 @@ var discord_exports = /* @__PURE__ */ __exportAll({
|
|
|
1777
1800
|
});
|
|
1778
1801
|
import * as import_discord_api_types_v10 from "discord-api-types/v10";
|
|
1779
1802
|
__reExport(discord_exports, import_discord_api_types_v10);
|
|
1803
|
+
//#endregion
|
|
1780
1804
|
export { getThreadMember as A, RateLimitError as B, listMessageReactionUsers as C, editChannelMessage as D, deleteChannelMessage as E, getGuildVoiceState as F, readRetryAfter as G, isUnknownDiscordVoiceStateError as H, listGuildEmojis as I, stripUndefinedFields as J, captureDiscordRequestAuthority as K, DISCORD_REST_TIMEOUT_MS as L, unpinChannelMessage as M, getGuild as N, getChannel as O, getGuildMember as P, RequestClient as R, deleteOwnMessageReaction as S, createThread as T, readDiscordCode as U, isUnknownDiscordMessageError as V, readDiscordMessage as W, Command as _, Label as a, getCurrentUser as b, TextInput as c, hasDiscordV2Components as d, serializePayload as f, User as g, Message as h, CheckboxGroup as i, pinChannelMessage as j, getChannelMessage as k, Client as l, Guild as m, GuildCreateListener as n, Modal as o, Embed as p, withDiscordRequestAuthority as q, ReadyListener as r, RadioGroup as s, discord_exports as t, asSerializableComponent as u, CommandWithSubcommands as v, createChannelMessage as w, createOwnMessageReaction as x, createUserDmChannel as y, DiscordError as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-
|
|
1
|
+
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-BPV-R4G9.mjs";
|
|
2
2
|
import { isSupportedRealtimeVoiceActivationName, normalizeRealtimeVoiceActivationNamePrefix } from "openclaw/plugin-sdk/realtime-voice-activation";
|
|
3
|
-
|
|
3
|
+
//#region extensions/discord/src/doctor-contract.ts
|
|
4
4
|
const RETIRED_TUNING_KEYS = /* @__PURE__ */ new Set([
|
|
5
5
|
"gatewayInfoTimeoutMs",
|
|
6
6
|
"gatewayReadyTimeoutMs",
|
|
@@ -124,4 +124,5 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
124
124
|
changes
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
+
//#endregion
|
|
127
128
|
export { normalizeCompatibilityConfig as n, legacyConfigRules as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as resolveDefaultDiscordAccountId } from "./accounts-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-
|
|
4
|
-
import { n as normalizeCompatibilityConfig } from "./doctor-contract-
|
|
5
|
-
import { t as isDiscordMutableAllowEntry } from "./security-doctor-
|
|
6
|
-
import { n as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
1
|
+
import { c as resolveDefaultDiscordAccountId } from "./accounts-C_25wyxC.mjs";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-DGkdWwix.mjs";
|
|
3
|
+
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-BPV-R4G9.mjs";
|
|
4
|
+
import { n as normalizeCompatibilityConfig } from "./doctor-contract-Bwv8EuQ_.mjs";
|
|
5
|
+
import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.mjs";
|
|
6
|
+
import { n as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-ie9GBWaU.mjs";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
9
|
-
|
|
9
|
+
//#region extensions/discord/src/doctor.ts
|
|
10
10
|
function sanitizeForLog(value) {
|
|
11
11
|
return value.replace(/\p{Cc}+/gu, " ").trim();
|
|
12
12
|
}
|
|
@@ -182,4 +182,5 @@ const discordDoctor = {
|
|
|
182
182
|
collectMutableAllowlistWarnings: ({ cfg }) => collectDiscordMutableAllowlistWarnings(cfg),
|
|
183
183
|
repairConfig: ({ cfg, doctorFixCommand }) => maybeRepairDiscordNumericIds(cfg, doctorFixCommand)
|
|
184
184
|
};
|
|
185
|
+
//#endregion
|
|
185
186
|
export { collectDiscordMissingEnvTokenWarnings, collectDiscordNumericIdWarnings, discordDoctor, maybeRepairDiscordNumericIds, scanDiscordNumericIdEntries };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
2
2
|
import { fetchWithSsrFGuard, isBlockedHostnameOrIp, isLoopbackHost } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
3
|
-
|
|
3
|
+
//#region extensions/discord/src/endpoint-runtime.ts
|
|
4
4
|
const DISCORD_ENDPOINT_RESPONSE_MAX_BYTES = 8388608;
|
|
5
5
|
const DISCORD_API_URL_ENV = "DISCORD_API_URL";
|
|
6
6
|
function parseHttpAnchor(value, label) {
|
|
@@ -135,4 +135,5 @@ function assertDiscordEndpointGatewayUrl(url, gatewayOrigin) {
|
|
|
135
135
|
}
|
|
136
136
|
if (parsed.origin !== gatewayOrigin || parsed.username || parsed.password || parsed.hash) throw new Error("Discord endpoint Gateway URL is outside the configured WebSocket origin");
|
|
137
137
|
}
|
|
138
|
+
//#endregion
|
|
138
139
|
export { resolveDiscordEndpointMediaGuard as i, getDiscordEndpointRuntime as n, resolveDiscordEndpointAttachmentGuard as r, assertDiscordEndpointGatewayUrl as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as normalizeDiscordSlug } from "./allow-list-
|
|
2
|
-
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
3
|
-
|
|
1
|
+
import { o as normalizeDiscordSlug } from "./allow-list-BXrS8-R9.mjs";
|
|
2
|
+
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BlBD4ism.mjs";
|
|
3
|
+
//#region extensions/discord/src/guilds.ts
|
|
4
4
|
function listDiscordGuildChannels(token, fetcher, guildId) {
|
|
5
5
|
return fetchDiscord(`/guilds/${guildId}/channels`, token, fetcher, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS });
|
|
6
6
|
}
|
|
@@ -18,4 +18,5 @@ async function listGuilds(token, fetcher, options) {
|
|
|
18
18
|
slug: normalizeDiscordSlug(guild.name)
|
|
19
19
|
}] : []);
|
|
20
20
|
}
|
|
21
|
+
//#endregion
|
|
21
22
|
export { listGuilds as n, searchDiscordGuildMembers as r, listDiscordGuildChannels as t };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { q as withDiscordRequestAuthority } from "./discord-
|
|
2
|
-
import { s as matchesDiscordToolContextTarget } from "./send.receipt-
|
|
3
|
-
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-
|
|
4
|
-
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-
|
|
5
|
-
import { n as buildDiscordPresentationComponents, t as buildDiscordInteractiveComponents } from "./shared-interactive-
|
|
6
|
-
import { c as coerceDiscordComponentParam } from "./components-
|
|
1
|
+
import { q as withDiscordRequestAuthority } from "./discord-DGVSguhx.mjs";
|
|
2
|
+
import { s as matchesDiscordToolContextTarget } from "./send.receipt-NZDOTZBU.mjs";
|
|
3
|
+
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
4
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-BJaCvlmq.mjs";
|
|
5
|
+
import { n as buildDiscordPresentationComponents, t as buildDiscordInteractiveComponents } from "./shared-interactive-DmzaoKOM.mjs";
|
|
6
|
+
import { c as coerceDiscordComponentParam } from "./components-YCvQ6YLS.mjs";
|
|
7
7
|
import "../action-runtime-api.js";
|
|
8
|
-
import { S as discordInboundEventDelivery, i as isDiscordComponentSpecWithinMessageLimit, n as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-session-route-
|
|
9
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
10
|
-
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-
|
|
8
|
+
import { S as discordInboundEventDelivery, i as isDiscordComponentSpecWithinMessageLimit, n as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-session-route-Cgx4i9cS.mjs";
|
|
9
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-WLQ7fRqI.mjs";
|
|
10
|
+
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-KvRTAVE3.mjs";
|
|
11
11
|
import { asOptionalRecord, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
12
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
13
13
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
14
14
|
import { adaptMessagePresentationForChannel, normalizeLegacyInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
15
15
|
import { readPositiveIntegerParam as readPositiveIntegerParam$1, readStringArrayParam as readStringArrayParam$1, readStringParam as readStringParam$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
16
|
-
|
|
16
|
+
//#region extensions/discord/src/actions/handle-action.ts
|
|
17
17
|
const providerId = "discord";
|
|
18
18
|
function readCurrentDiscordTarget(toolContext) {
|
|
19
19
|
const provider = toolContext?.currentChannelProvider?.trim().toLowerCase();
|
|
@@ -277,4 +277,5 @@ async function dispatchDiscordMessageAction(ctx) {
|
|
|
277
277
|
}
|
|
278
278
|
throw new Error(`Action ${action} is not supported for provider ${providerId}.`);
|
|
279
279
|
}
|
|
280
|
+
//#endregion
|
|
280
281
|
export { handleDiscordMessageAction };
|
|
@@ -1,10 +1,10 @@
|
|
|
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-BJaCvlmq.mjs";
|
|
2
2
|
import "../action-runtime-api.js";
|
|
3
|
-
import { x as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-
|
|
3
|
+
import { x as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-Cgx4i9cS.mjs";
|
|
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/param-readers";
|
|
7
|
-
|
|
7
|
+
//#region extensions/discord/src/actions/handle-action.guild-admin.ts
|
|
8
8
|
const guildMetadataReads = {
|
|
9
9
|
"member-info": {
|
|
10
10
|
action: "memberInfo",
|
|
@@ -191,4 +191,5 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
191
191
|
}, readPolicyOptions);
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
+
//#endregion
|
|
194
195
|
export { tryHandleDiscordMessageActionGuildAdmin as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as discord_exports } from "./discord-
|
|
1
|
+
import { t as discord_exports } from "./discord-DGVSguhx.mjs";
|
|
2
2
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
3
3
|
import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
4
|
-
|
|
4
|
+
//#region extensions/discord/src/voice/listeners.ts
|
|
5
5
|
const logger = createSubsystemLogger("discord/voice");
|
|
6
6
|
function startAutoJoin(operation, context = "") {
|
|
7
7
|
operation().catch((err) => logger.warn(`discord voice: autoJoin${context} failed: ${formatErrorMessage(err)}`));
|
|
@@ -43,4 +43,5 @@ var DiscordVoiceStateUpdateListener = class {
|
|
|
43
43
|
await this.manager.handleVoiceStateUpdate(data, transition ? transition.previous ?? null : void 0);
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
+
//#endregion
|
|
46
47
|
export { DiscordVoiceGuildCreateListener, DiscordVoiceReadyListener, DiscordVoiceResumedListener, DiscordVoiceStateUpdateListener };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as normalizeDiscordAllowList } from "./allow-list-
|
|
1
|
+
import { i as normalizeDiscordAllowList } from "./allow-list-BXrS8-R9.mjs";
|
|
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 = [
|
|
5
5
|
"discord:",
|
|
6
6
|
"user:",
|
|
@@ -54,7 +54,8 @@ const discordIngressIdentity = defineStableChannelIngressIdentity({
|
|
|
54
54
|
sensitivity: "pii"
|
|
55
55
|
}))
|
|
56
56
|
});
|
|
57
|
-
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region extensions/discord/src/live-policy-config.ts
|
|
58
59
|
/** Account policy consumed at inbound admission, without replacing the transport. */
|
|
59
60
|
function selectDiscordLivePolicyConfig(config) {
|
|
60
61
|
return {
|
|
@@ -67,4 +68,5 @@ function selectDiscordLivePolicyConfig(config) {
|
|
|
67
68
|
dangerouslyAllowNameMatching: config.dangerouslyAllowNameMatching
|
|
68
69
|
};
|
|
69
70
|
}
|
|
71
|
+
//#endregion
|
|
70
72
|
export { discordIngressIdentity as n, selectDiscordLivePolicyConfig as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { q as withDiscordRequestAuthority } from "./discord-
|
|
2
|
-
import { i as resolveDiscordEndpointMediaGuard, n as getDiscordEndpointRuntime } from "./endpoint-runtime-
|
|
3
|
-
import { t as getDiscordRuntime } from "./runtime-
|
|
4
|
-
import { D as createMessageDispatchData, E as createDiscordLivePolicyReader } from "./provider-
|
|
5
|
-
import { E as hasDiscordMessageStickers, T as resolveDiscordCdnPolicy, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, k as resolveDiscordReferencedReplyMessageId } from "./transcripts-source-
|
|
1
|
+
import { q as withDiscordRequestAuthority } from "./discord-DGVSguhx.mjs";
|
|
2
|
+
import { i as resolveDiscordEndpointMediaGuard, n as getDiscordEndpointRuntime } from "./endpoint-runtime-lf4DeLas.mjs";
|
|
3
|
+
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
4
|
+
import { D as createMessageDispatchData, E as createDiscordLivePolicyReader } from "./provider-BN2bCIUp.mjs";
|
|
5
|
+
import { E as hasDiscordMessageStickers, T as resolveDiscordCdnPolicy, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, k as resolveDiscordReferencedReplyMessageId } from "./transcripts-source-ie9GBWaU.mjs";
|
|
6
6
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
7
7
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
8
8
|
import { danger } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -17,7 +17,7 @@ import { DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, createChannelIngressError, createCh
|
|
|
17
17
|
import { racePromiseWithAbortSignal } from "openclaw/plugin-sdk/time-runtime";
|
|
18
18
|
import { fanInChannelIngressLifecycles, prepareChannelIngressEvent } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
19
19
|
import { createChannelInboundDebouncer, resolveInboundDebounceMs, shouldDebounceTextInbound } from "openclaw/plugin-sdk/channel-inbound";
|
|
20
|
-
|
|
20
|
+
//#region extensions/discord/src/monitor/ingress.ts
|
|
21
21
|
const DISCORD_INGRESS_PAYLOAD_VERSION = 1;
|
|
22
22
|
const DISCORD_INGRESS_DRAIN_INTERVAL_MS = 1e3;
|
|
23
23
|
const DiscordIngressPayloadError = createChannelIngressError("DiscordIngressPayloadError");
|
|
@@ -139,7 +139,8 @@ function createDiscordIngressMonitor(params) {
|
|
|
139
139
|
stop: monitor.stop
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region extensions/discord/src/monitor/message-avatar.ts
|
|
143
144
|
const DISCORD_AVATAR_MAX_BYTES = 262144;
|
|
144
145
|
const DISCORD_AVATAR_CACHE_MAX_ENTRIES = 128;
|
|
145
146
|
const DISCORD_GUILD_ICON_TTL_MS = 3e5;
|
|
@@ -214,9 +215,10 @@ function createDiscordAvatarResolver() {
|
|
|
214
215
|
return guildIcon?.hash ? resolveSavedAvatar(`${params.conversationId}\0${guildIcon.hash}`, discordAvatarUrl("icons", params.guildId, guildIcon.hash), endpointRuntime) : void 0;
|
|
215
216
|
} };
|
|
216
217
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
const
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region extensions/discord/src/monitor/message-dispatcher.ts
|
|
220
|
+
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-BZcZE1o-.mjs"));
|
|
221
|
+
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-B0n-mQ99.mjs"));
|
|
220
222
|
function createDiscordMessageDispatcher(params) {
|
|
221
223
|
const readPolicy = params.readPolicy ?? createDiscordLivePolicyReader({
|
|
222
224
|
...params,
|
|
@@ -493,7 +495,8 @@ function createDiscordMessageDispatcher(params) {
|
|
|
493
495
|
};
|
|
494
496
|
return handler;
|
|
495
497
|
}
|
|
496
|
-
|
|
498
|
+
//#endregion
|
|
499
|
+
//#region extensions/discord/src/monitor/message-handler.ts
|
|
497
500
|
function createDiscordMessageHandler(params) {
|
|
498
501
|
const dispatcher = createDiscordMessageDispatcher(params);
|
|
499
502
|
const ingress = createDiscordIngressMonitor({
|
|
@@ -525,4 +528,5 @@ function createDiscordMessageHandler(params) {
|
|
|
525
528
|
};
|
|
526
529
|
return handler;
|
|
527
530
|
}
|
|
531
|
+
//#endregion
|
|
528
532
|
export { createDiscordMessageHandler as t };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { c as resolveDefaultDiscordAccountId } from "./accounts-
|
|
2
|
-
import { h as Message, k as getChannelMessage, t as discord_exports } from "./discord-
|
|
3
|
-
import { S as formatDiscordUserTag, a as normalizeDiscordDisplaySlug, f as resolveDiscordGuildEntry, h as resolveDiscordMentionPolicy, l as resolveDiscordChannelConfigWithFallback, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState } from "./allow-list-
|
|
4
|
-
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-
|
|
5
|
-
import { _ as resolveDiscordConversationIdentity, h as resolveDiscordEffectiveRoute, m as resolveDiscordConversationRoute, p as buildDiscordRoutePeer, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-
|
|
6
|
-
import { n as resolveDiscordConversationBindingRouteAsync } from "./conversation-binding-route-
|
|
7
|
-
import { n as resolveDiscordChannelNameSafe } from "./channel-access-
|
|
8
|
-
import { A as resolveDiscordTextCommandAccess, T as handleDiscordDmCommandDecision, k as resolveDiscordDmCommandAccess, n as resolveDiscordPreflightChannelAccess } from "./provider-
|
|
9
|
-
import { A as resolveDiscordChannelInfo, C as resolveMediaList, D as resolveDiscordMessageStickers, O as resolveDiscordReferencedReplyMessage, S as resolveForwardedMediaList, _ as resolveDiscordMessageBatch, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, v as resolveDiscordMessageHistoryText, y as resolveDiscordMessageMentionDocuments } from "./transcripts-source-
|
|
10
|
-
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-
|
|
11
|
-
import { a as createDiscordHistorySenderProvenance, c as hasRawDiscordUserMention, d as matchesActiveDiscordMentionPatterns, f as resolveDiscordMentionState, i as loadSystemEventsRuntime, l as isBoundThreadBotSystemMessage, n as loadDiscordThreadingRuntime, p as shouldIgnoreBoundThreadWebhookMessage, r as loadPreflightAudioRuntime, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo, u as isDiscordThreadChannelMessage } from "./message-handler.preflight-pluralkit-
|
|
1
|
+
import { c as resolveDefaultDiscordAccountId } from "./accounts-C_25wyxC.mjs";
|
|
2
|
+
import { h as Message, k as getChannelMessage, t as discord_exports } from "./discord-DGVSguhx.mjs";
|
|
3
|
+
import { S as formatDiscordUserTag, a as normalizeDiscordDisplaySlug, f as resolveDiscordGuildEntry, h as resolveDiscordMentionPolicy, l as resolveDiscordChannelConfigWithFallback, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState } from "./allow-list-BXrS8-R9.mjs";
|
|
4
|
+
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-cIxzatmv.mjs";
|
|
5
|
+
import { _ as resolveDiscordConversationIdentity, h as resolveDiscordEffectiveRoute, m as resolveDiscordConversationRoute, p as buildDiscordRoutePeer, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-Cgx4i9cS.mjs";
|
|
6
|
+
import { n as resolveDiscordConversationBindingRouteAsync } from "./conversation-binding-route-kCTw8cij.mjs";
|
|
7
|
+
import { n as resolveDiscordChannelNameSafe } from "./channel-access-9cyzozUP.mjs";
|
|
8
|
+
import { A as resolveDiscordTextCommandAccess, T as handleDiscordDmCommandDecision, k as resolveDiscordDmCommandAccess, n as resolveDiscordPreflightChannelAccess } from "./provider-BN2bCIUp.mjs";
|
|
9
|
+
import { A as resolveDiscordChannelInfo, C as resolveMediaList, D as resolveDiscordMessageStickers, O as resolveDiscordReferencedReplyMessage, S as resolveForwardedMediaList, _ as resolveDiscordMessageBatch, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, v as resolveDiscordMessageHistoryText, y as resolveDiscordMessageMentionDocuments } from "./transcripts-source-ie9GBWaU.mjs";
|
|
10
|
+
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-76HFb8eK.mjs";
|
|
11
|
+
import { a as createDiscordHistorySenderProvenance, c as hasRawDiscordUserMention, d as matchesActiveDiscordMentionPatterns, f as resolveDiscordMentionState, i as loadSystemEventsRuntime, l as isBoundThreadBotSystemMessage, n as loadDiscordThreadingRuntime, p as shouldIgnoreBoundThreadWebhookMessage, r as loadPreflightAudioRuntime, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo, u as isDiscordThreadChannelMessage } from "./message-handler.preflight-pluralkit-CYZfXXb6.mjs";
|
|
12
12
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
13
13
|
import { getChildLogger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
14
14
|
import { MessageReferenceType, MessageType } from "discord-api-types/v10";
|
|
@@ -24,9 +24,9 @@ import { hasControlCommand } from "openclaw/plugin-sdk/command-detection";
|
|
|
24
24
|
import { isAbortRequestText } from "openclaw/plugin-sdk/command-primitives-runtime";
|
|
25
25
|
import { shouldHandleTextCommands } from "openclaw/plugin-sdk/command-surface";
|
|
26
26
|
import { createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
27
|
-
|
|
27
|
+
//#region extensions/discord/src/monitor/message-handler.dm-preflight.ts
|
|
28
28
|
const loadConversationRuntime$1 = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/conversation-binding-runtime"));
|
|
29
|
-
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
29
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-CVW7V-VZ.mjs").then((n) => n.t));
|
|
30
30
|
async function resolveDiscordDmPreflightAccess(params) {
|
|
31
31
|
if (params.dmPolicy === "disabled") {
|
|
32
32
|
logVerbose("discord: drop dm (dmPolicy: disabled)");
|
|
@@ -108,7 +108,8 @@ async function resolveDiscordDmPreflightAccess(params) {
|
|
|
108
108
|
});
|
|
109
109
|
return null;
|
|
110
110
|
}
|
|
111
|
-
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region extensions/discord/src/monitor/message-handler.hydration.ts
|
|
112
113
|
function shouldHydrateDiscordMessagePayload(message) {
|
|
113
114
|
let currentText;
|
|
114
115
|
try {
|
|
@@ -179,7 +180,8 @@ async function hydrateDiscordMessageIfNeeded(params) {
|
|
|
179
180
|
})
|
|
180
181
|
};
|
|
181
182
|
}
|
|
182
|
-
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region extensions/discord/src/monitor/message-handler.preflight-channel-context.ts
|
|
183
185
|
function resolveDiscordPreflightChannelContext(params) {
|
|
184
186
|
const threadName = params.threadChannel?.name;
|
|
185
187
|
const displayChannelName = threadName ?? params.channelName;
|
|
@@ -202,7 +204,8 @@ function resolveDiscordPreflightChannelContext(params) {
|
|
|
202
204
|
}) : null
|
|
203
205
|
};
|
|
204
206
|
}
|
|
205
|
-
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region extensions/discord/src/monitor/message-handler.preflight-history.ts
|
|
206
209
|
function buildDiscordPreflightHistoryEntry(params) {
|
|
207
210
|
const textForHistory = resolveDiscordMessageHistoryText(params.message, { includeForwarded: true });
|
|
208
211
|
return params.isGuildMessage && params.historyLimit > 0 && textForHistory ? {
|
|
@@ -214,7 +217,8 @@ function buildDiscordPreflightHistoryEntry(params) {
|
|
|
214
217
|
senderProvenance: createDiscordHistorySenderProvenance(params)
|
|
215
218
|
} : void 0;
|
|
216
219
|
}
|
|
217
|
-
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region extensions/discord/src/monitor/message-handler.preflight-thread.ts
|
|
218
222
|
async function resolveDiscordPreflightThreadContext(params) {
|
|
219
223
|
const { resolveDiscordThreadChannel, resolveDiscordThreadParentInfo } = await loadDiscordThreadingRuntime();
|
|
220
224
|
const earlyThreadChannel = resolveDiscordThreadChannel(params);
|
|
@@ -232,7 +236,8 @@ async function resolveDiscordPreflightThreadContext(params) {
|
|
|
232
236
|
earlyThreadParentType: parentInfo.type
|
|
233
237
|
};
|
|
234
238
|
}
|
|
235
|
-
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region extensions/discord/src/monitor/message-handler.routing-preflight.ts
|
|
236
241
|
const loadConversationRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/conversation-binding-runtime"));
|
|
237
242
|
async function resolveDiscordPreflightRoute(params) {
|
|
238
243
|
const conversationRuntime = await loadConversationRuntime();
|
|
@@ -282,7 +287,8 @@ async function resolveDiscordPreflightRoute(params) {
|
|
|
282
287
|
baseSessionKey: effectiveRoute.sessionKey
|
|
283
288
|
};
|
|
284
289
|
}
|
|
285
|
-
|
|
290
|
+
//#endregion
|
|
291
|
+
//#region extensions/discord/src/monitor/message-handler.preflight.ts
|
|
286
292
|
const DISCORD_HISTORY_MEDIA_MAX_ATTACHMENTS = 4;
|
|
287
293
|
const DISCORD_HISTORY_MEDIA_MAX_BYTES = 10485760;
|
|
288
294
|
const DISCORD_HISTORY_MEDIA_IDLE_TIMEOUT_MS = 1e3;
|
|
@@ -811,4 +817,5 @@ async function preflightDiscordMessage(params) {
|
|
|
811
817
|
canDetectMention
|
|
812
818
|
};
|
|
813
819
|
}
|
|
820
|
+
//#endregion
|
|
814
821
|
export { preflightDiscordMessage };
|