@openclaw/discord 2026.11.5-beta.1 → 2026.11.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.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,13 +1,13 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { C as hasAnyChannelPermissionDiscord, D as createDiscordMessageNonce, F as resolveDiscordClientAccountContext, I as resolveDiscordRest, M as createDiscordClient, O as resolveDiscordMessageFlags, S as hasAllGuildPermissionsDiscord, _ as canManageGuildMemberRoleDiscord, a as normalizeEmojiName, b as fetchChannelPermissionsDiscord, c as resolveChannelId, d as sendDiscordChunks, g as DiscordSendError, h as DISCORD_MAX_STICKER_BYTES, j as resolveDiscordSuppressEmbeds, m as DISCORD_MAX_EVENT_COVER_BYTES, n as buildDiscordTextChunks, o as normalizeReactionEmoji, p as DISCORD_MAX_EMOJI_BYTES, r as buildReactionIdentifier, t as buildDiscordSendError, v as canManageGuildRoleDiscord, w as hasAnyGuildPermissionDiscord, x as fetchMemberGuildPermissionsDiscord, y as canViewDiscordGuildChannel } from "./send.shared-
|
|
3
|
-
import { B as RateLimitError, C as listMessageReactionUsers, D as editChannelMessage, E as deleteChannelMessage, F as getGuildVoiceState, G as readRetryAfter, H as isUnknownDiscordVoiceStateError, I as listGuildEmojis, J as stripUndefinedFields, L as DISCORD_REST_TIMEOUT_MS, M as unpinChannelMessage, N as getGuild, O as getChannel, P as getGuildMember, S as deleteOwnMessageReaction, T as createThread, U as readDiscordCode, V as isUnknownDiscordMessageError, W as readDiscordMessage, j as pinChannelMessage, k as getChannelMessage, q as withDiscordRequestAuthority, w as createChannelMessage, x as createOwnMessageReaction, z as DiscordError } from "./discord-
|
|
4
|
-
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-
|
|
5
|
-
import { _ as recordDiscordMessageCreateAmbiguity, h as createDiscordRetryRunner, m as classifyDiscordDeliveryFailure, n as createDiscordSendReceiptFromResults, r as createDiscordSendResult, v as chunkDiscordTextWithMode } from "./send.receipt-
|
|
6
|
-
import { n as getDiscordEndpointRuntime, r as resolveDiscordEndpointAttachmentGuard } from "./endpoint-runtime-
|
|
7
|
-
import { o as parseDiscordHttpErrorBody } from "./api-
|
|
8
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-
|
|
9
|
-
import { a as prepareDiscordOutboundText, n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
10
|
-
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS } from "./timeouts-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { C as hasAnyChannelPermissionDiscord, D as createDiscordMessageNonce, F as resolveDiscordClientAccountContext, I as resolveDiscordRest, M as createDiscordClient, O as resolveDiscordMessageFlags, S as hasAllGuildPermissionsDiscord, _ as canManageGuildMemberRoleDiscord, a as normalizeEmojiName, b as fetchChannelPermissionsDiscord, c as resolveChannelId, d as sendDiscordChunks, g as DiscordSendError, h as DISCORD_MAX_STICKER_BYTES, j as resolveDiscordSuppressEmbeds, m as DISCORD_MAX_EVENT_COVER_BYTES, n as buildDiscordTextChunks, o as normalizeReactionEmoji, p as DISCORD_MAX_EMOJI_BYTES, r as buildReactionIdentifier, t as buildDiscordSendError, v as canManageGuildRoleDiscord, w as hasAnyGuildPermissionDiscord, x as fetchMemberGuildPermissionsDiscord, y as canViewDiscordGuildChannel } from "./send.shared-a_6Oeyg1.mjs";
|
|
3
|
+
import { B as RateLimitError, C as listMessageReactionUsers, D as editChannelMessage, E as deleteChannelMessage, F as getGuildVoiceState, G as readRetryAfter, H as isUnknownDiscordVoiceStateError, I as listGuildEmojis, J as stripUndefinedFields, L as DISCORD_REST_TIMEOUT_MS, M as unpinChannelMessage, N as getGuild, O as getChannel, P as getGuildMember, S as deleteOwnMessageReaction, T as createThread, U as readDiscordCode, V as isUnknownDiscordMessageError, W as readDiscordMessage, j as pinChannelMessage, k as getChannelMessage, q as withDiscordRequestAuthority, w as createChannelMessage, x as createOwnMessageReaction, z as DiscordError } from "./discord-DGVSguhx.mjs";
|
|
4
|
+
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-BXrS8-R9.mjs";
|
|
5
|
+
import { _ as recordDiscordMessageCreateAmbiguity, h as createDiscordRetryRunner, m as classifyDiscordDeliveryFailure, n as createDiscordSendReceiptFromResults, r as createDiscordSendResult, v as chunkDiscordTextWithMode } from "./send.receipt-NZDOTZBU.mjs";
|
|
6
|
+
import { n as getDiscordEndpointRuntime, r as resolveDiscordEndpointAttachmentGuard } from "./endpoint-runtime-lf4DeLas.mjs";
|
|
7
|
+
import { o as parseDiscordHttpErrorBody } from "./api-BlBD4ism.mjs";
|
|
8
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-BOOzqxxM.mjs";
|
|
9
|
+
import { a as prepareDiscordOutboundText, n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-Uzcmh3Yd.mjs";
|
|
10
|
+
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS } from "./timeouts-cIxzatmv.mjs";
|
|
11
11
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
12
12
|
import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
|
|
13
13
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -26,7 +26,7 @@ import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
|
26
26
|
import fs from "node:fs/promises";
|
|
27
27
|
import path from "node:path";
|
|
28
28
|
import { writeExternalFileWithinRoot } from "openclaw/plugin-sdk/security-runtime";
|
|
29
|
-
|
|
29
|
+
//#region extensions/discord/src/send.channels.ts
|
|
30
30
|
async function createChannelDiscord(payload, opts) {
|
|
31
31
|
const rest = resolveDiscordRest(opts);
|
|
32
32
|
const body = stripUndefinedFields({
|
|
@@ -86,7 +86,8 @@ async function removeChannelPermissionDiscord(channelId, targetId, opts) {
|
|
|
86
86
|
await resolveDiscordRest(opts).delete(Routes.channelPermission(channelId, targetId));
|
|
87
87
|
return { ok: true };
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region extensions/discord/src/send.emojis-stickers.ts
|
|
90
91
|
const DISCORD_IMAGE_UPLOAD_TYPES = [
|
|
91
92
|
"image/png",
|
|
92
93
|
"image/jpeg",
|
|
@@ -144,7 +145,8 @@ async function uploadStickerDiscord(payload, opts) {
|
|
|
144
145
|
}
|
|
145
146
|
});
|
|
146
147
|
}
|
|
147
|
-
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region extensions/discord/src/send.guild.ts
|
|
148
150
|
function readDiscordResource(read) {
|
|
149
151
|
return async (id, opts) => await read(resolveDiscordRest(opts), id);
|
|
150
152
|
}
|
|
@@ -223,7 +225,8 @@ async function banMemberDiscord(payload, opts) {
|
|
|
223
225
|
});
|
|
224
226
|
return { ok: true };
|
|
225
227
|
}
|
|
226
|
-
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region extensions/discord/src/send.messages.ts
|
|
227
230
|
const DISCORD_THREAD_TRANSPORT_ONLY_MAX_LINES = Number.MAX_SAFE_INTEGER;
|
|
228
231
|
function resolveDiscordThreadStarterMessageId(thread) {
|
|
229
232
|
const starterMessage = "message" in thread ? thread.message : void 0;
|
|
@@ -425,7 +428,8 @@ async function searchMessagesDiscord(query, opts) {
|
|
|
425
428
|
assertDiscordSearchResponse(result);
|
|
426
429
|
return result;
|
|
427
430
|
}
|
|
428
|
-
|
|
431
|
+
//#endregion
|
|
432
|
+
//#region extensions/discord/src/send.webhook.ts
|
|
429
433
|
const DISCORD_WEBHOOK_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
430
434
|
const DISCORD_WEBHOOK_TIMEOUT_MS = DISCORD_REST_TIMEOUT_MS;
|
|
431
435
|
function throwIfWebhookDeadlineExpired(signal) {
|
|
@@ -543,7 +547,8 @@ async function sendWebhookMessageDiscord(text, opts) {
|
|
|
543
547
|
deadline.cleanup();
|
|
544
548
|
}
|
|
545
549
|
}
|
|
546
|
-
|
|
550
|
+
//#endregion
|
|
551
|
+
//#region extensions/discord/src/send.voice.ts
|
|
547
552
|
const WAVEFORM_SAMPLES = 256;
|
|
548
553
|
const DISCORD_OPUS_SAMPLE_RATE_HZ = 48e3;
|
|
549
554
|
const DISCORD_VOICE_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
@@ -855,7 +860,8 @@ async function sendVoiceMessageDiscord(to, audioPath, opts) {
|
|
|
855
860
|
});
|
|
856
861
|
});
|
|
857
862
|
}
|
|
858
|
-
|
|
863
|
+
//#endregion
|
|
864
|
+
//#region extensions/discord/src/send.typing.ts
|
|
859
865
|
async function sendTypingDiscord(channelId, opts) {
|
|
860
866
|
await resolveDiscordRest(opts).post(Routes.channelTyping(channelId));
|
|
861
867
|
return {
|
|
@@ -863,7 +869,8 @@ async function sendTypingDiscord(channelId, opts) {
|
|
|
863
869
|
channelId
|
|
864
870
|
};
|
|
865
871
|
}
|
|
866
|
-
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region extensions/discord/src/send.reactions.ts
|
|
867
874
|
function reactionMutation(operation, label) {
|
|
868
875
|
return async (channelId, messageId, emoji, opts) => {
|
|
869
876
|
const { rest, request } = createDiscordClient(opts);
|
|
@@ -919,7 +926,8 @@ async function fetchReactionsDiscord(channelId, messageId, opts) {
|
|
|
919
926
|
}
|
|
920
927
|
return summaries;
|
|
921
928
|
}
|
|
922
|
-
|
|
929
|
+
//#endregion
|
|
930
|
+
//#region extensions/discord/src/send.ts
|
|
923
931
|
var send_exports = /* @__PURE__ */ __exportAll({
|
|
924
932
|
DiscordSendError: () => DiscordSendError,
|
|
925
933
|
DiscordThreadInitialMessageError: () => DiscordThreadInitialMessageError,
|
|
@@ -975,4 +983,5 @@ var send_exports = /* @__PURE__ */ __exportAll({
|
|
|
975
983
|
uploadEmojiDiscord: () => uploadEmojiDiscord,
|
|
976
984
|
uploadStickerDiscord: () => uploadStickerDiscord
|
|
977
985
|
});
|
|
986
|
+
//#endregion
|
|
978
987
|
export { listScheduledEventsDiscord as A, moveChannelDiscord as B, fetchChannelInfoDiscord as C, fetchVoiceStatusDiscord as D, fetchRoleInfoDiscord as E, uploadEmojiDiscord as F, setChannelPermissionDiscord as H, uploadStickerDiscord as I, createChannelDiscord as L, resolveEventCoverImage as M, timeoutMemberDiscord as N, kickMemberDiscord as O, listGuildEmojisDiscord as P, deleteChannelDiscord as R, createScheduledEventDiscord as S, fetchMemberInfoDiscord as T, removeChannelPermissionDiscord as V, readMessagesDiscord as _, removeReactionDiscord as a, addRoleDiscord as b, sendWebhookMessageDiscord as c, deleteMessageDiscord as d, editMessageDiscord as f, pinMessageDiscord as g, listThreadsDiscord as h, removeOwnReactionsDiscord as i, removeRoleDiscord as j, listGuildChannelsDiscord as k, DiscordThreadInitialMessageError as l, listPinsDiscord as m, fetchReactionsDiscord as n, sendTypingDiscord as o, fetchMessageDiscord as p, reactMessageDiscord as r, sendVoiceMessageDiscord as s, send_exports as t, createThreadDiscord as u, searchMessagesDiscord as v, fetchGuildInfoDiscord as w, banMemberDiscord as x, unpinMessageDiscord as y, editChannelDiscord as z };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { D as createDiscordMessageNonce, M as createDiscordClient, T as SUPPRESS_NOTIFICATIONS_FLAG, c as resolveChannelId, l as resolveDiscordChannel, t as buildDiscordSendError } from "./send.shared-
|
|
3
|
-
import { D as editChannelMessage, f as serializePayload, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-
|
|
4
|
-
import { r as createDiscordSendResult } from "./send.receipt-
|
|
5
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-
|
|
6
|
-
import { t as sendMessageDiscord } from "./send.outbound-
|
|
7
|
-
import { a as buildDiscordComponentMessage, u as resolveDiscordComponentAttachmentName } from "./components-
|
|
8
|
-
import { n as getOptionalDiscordRuntime } from "./runtime-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { D as createDiscordMessageNonce, M as createDiscordClient, T as SUPPRESS_NOTIFICATIONS_FLAG, c as resolveChannelId, l as resolveDiscordChannel, t as buildDiscordSendError } from "./send.shared-a_6Oeyg1.mjs";
|
|
3
|
+
import { D as editChannelMessage, f as serializePayload, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-DGVSguhx.mjs";
|
|
4
|
+
import { r as createDiscordSendResult } from "./send.receipt-NZDOTZBU.mjs";
|
|
5
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-BOOzqxxM.mjs";
|
|
6
|
+
import { t as sendMessageDiscord } from "./send.outbound-Uzcmh3Yd.mjs";
|
|
7
|
+
import { a as buildDiscordComponentMessage, u as resolveDiscordComponentAttachmentName } from "./components-YCvQ6YLS.mjs";
|
|
8
|
+
import { n as getOptionalDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
9
9
|
import { hasNonEmptyString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
10
|
import { ChannelType } from "discord-api-types/v10";
|
|
11
11
|
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
@@ -16,7 +16,7 @@ import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runt
|
|
|
16
16
|
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
|
17
17
|
import { createPluginStateErrorReporter } from "openclaw/plugin-sdk/plugin-state-runtime";
|
|
18
18
|
import { createAsyncLock } from "openclaw/plugin-sdk/async-lock-runtime";
|
|
19
|
-
|
|
19
|
+
//#region extensions/discord/src/components-registry-state.ts
|
|
20
20
|
const discordComponentRegistryState = resolveGlobalSingleton(Symbol.for("openclaw.discord.componentRegistryState"), () => ({
|
|
21
21
|
withRegistryLock: createAsyncLock(),
|
|
22
22
|
componentEntries: /* @__PURE__ */ new Map(),
|
|
@@ -31,7 +31,8 @@ const discordComponentRegistryState = resolveGlobalSingleton(Symbol.for("opencla
|
|
|
31
31
|
state.persistentModalStore = void 0;
|
|
32
32
|
state.persistentRegistryDisabled = false;
|
|
33
33
|
}));
|
|
34
|
-
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region extensions/discord/src/components-registry.ts
|
|
35
36
|
const DEFAULT_COMPONENT_TTL_MS = 18e5;
|
|
36
37
|
const PERSISTENT_COMPONENT_NAMESPACE = "discord.components";
|
|
37
38
|
const PERSISTENT_MODAL_NAMESPACE = "discord.modals";
|
|
@@ -226,7 +227,8 @@ async function resolveDiscordModalEntryWithPersistence(params) {
|
|
|
226
227
|
});
|
|
227
228
|
});
|
|
228
229
|
}
|
|
229
|
-
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region extensions/discord/src/send.components.ts
|
|
230
232
|
var send_components_exports = /* @__PURE__ */ __exportAll({
|
|
231
233
|
editDiscordComponentMessage: () => editDiscordComponentMessage,
|
|
232
234
|
registerBuiltDiscordComponentMessage: () => registerBuiltDiscordComponentMessage,
|
|
@@ -392,4 +394,5 @@ async function writeDiscordComponentMessage(to, spec, opts, messageId) {
|
|
|
392
394
|
});
|
|
393
395
|
return deliveryResult ?? toDeliveryResult();
|
|
394
396
|
}
|
|
397
|
+
//#endregion
|
|
395
398
|
export { registerDiscordComponentEntries as a, send_components_exports as i, registerBuiltDiscordComponentMessage as n, resolveDiscordComponentEntryWithPersistence as o, sendDiscordComponentMessage as r, resolveDiscordModalEntryWithPersistence as s, editDiscordComponentMessage as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { A as resolveDiscordSendEmbeds, D as createDiscordMessageNonce, E as buildDiscordMessageRequest, M as createDiscordClient, O as resolveDiscordMessageFlags, c as resolveChannelId, d as sendDiscordChunks, f as sendDiscordMedia, i as normalizeDiscordPollInput, j as resolveDiscordSuppressEmbeds, k as resolveDiscordSendComponents, l as resolveDiscordChannel, n as buildDiscordTextChunks, s as normalizeStickerIds, t as buildDiscordSendError } from "./send.shared-
|
|
3
|
-
import { T as createThread, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-
|
|
4
|
-
import { n as createDiscordSendReceiptFromResults, r as createDiscordSendResult, u as createReusableDiscordReplyReference } from "./send.receipt-
|
|
5
|
-
import { a as normalizeDiscordSnowflake, i as normalizeDiscordHandleKey, s as resolveDiscordDirectoryUserId } from "./directory-live-
|
|
6
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { A as resolveDiscordSendEmbeds, D as createDiscordMessageNonce, E as buildDiscordMessageRequest, M as createDiscordClient, O as resolveDiscordMessageFlags, c as resolveChannelId, d as sendDiscordChunks, f as sendDiscordMedia, i as normalizeDiscordPollInput, j as resolveDiscordSuppressEmbeds, k as resolveDiscordSendComponents, l as resolveDiscordChannel, n as buildDiscordTextChunks, s as normalizeStickerIds, t as buildDiscordSendError } from "./send.shared-a_6Oeyg1.mjs";
|
|
3
|
+
import { T as createThread, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-DGVSguhx.mjs";
|
|
4
|
+
import { n as createDiscordSendReceiptFromResults, r as createDiscordSendResult, u as createReusableDiscordReplyReference } from "./send.receipt-NZDOTZBU.mjs";
|
|
5
|
+
import { a as normalizeDiscordSnowflake, i as normalizeDiscordHandleKey, s as resolveDiscordDirectoryUserId } from "./directory-live-DH3tpS3x.mjs";
|
|
6
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-BOOzqxxM.mjs";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { ChannelType } from "discord-api-types/v10";
|
|
9
9
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
@@ -14,7 +14,7 @@ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
14
14
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
15
15
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
16
16
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
17
|
-
|
|
17
|
+
//#region extensions/discord/src/url-ranges.ts
|
|
18
18
|
const DISCORD_URL_START_RE = /(?:[A-Za-z][A-Za-z0-9+.-]*:\/\/|www\.|\/\/|mailto:)/giu;
|
|
19
19
|
function findDiscordUrlRanges(markdown) {
|
|
20
20
|
const ranges = [];
|
|
@@ -42,7 +42,8 @@ function findDiscordUrlRanges(markdown) {
|
|
|
42
42
|
}
|
|
43
43
|
return ranges;
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region extensions/discord/src/mentions.ts
|
|
46
47
|
const MENTION_CANDIDATE_PATTERN = /(^|[\s([{"'.,;:!?])@([a-z0-9_.-]{2,32}(?:#[0-9]{4})?)/gi;
|
|
47
48
|
const DISCORD_RESERVED_MENTIONS = /* @__PURE__ */ new Set(["everyone", "here"]);
|
|
48
49
|
const DISCORD_DISCRIMINATOR_SUFFIX = /#\d{4}$/;
|
|
@@ -137,7 +138,8 @@ function rewriteDiscordKnownMentions(text, params) {
|
|
|
137
138
|
function discordTextHasBroadcastMention(text) {
|
|
138
139
|
return DISCORD_BROADCAST_MENTION_PATTERN.test(text);
|
|
139
140
|
}
|
|
140
|
-
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region extensions/discord/src/markdown.ts
|
|
141
143
|
const DISCORD_NATIVE_TOKEN_RE = /<a?:[A-Za-z0-9_]+:\d+>|<\/[^>]+:\d+>/giu;
|
|
142
144
|
function normalizeDiscordBold(markdown) {
|
|
143
145
|
if (!markdown.includes("__")) return markdown;
|
|
@@ -286,7 +288,8 @@ function normalizeDiscordBold(markdown) {
|
|
|
286
288
|
function renderDiscordMarkdown(markdown, tableMode) {
|
|
287
289
|
return normalizeDiscordBold(convertMarkdownTables(markdown, tableMode));
|
|
288
290
|
}
|
|
289
|
-
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region extensions/discord/src/outbound-text.ts
|
|
290
293
|
function prepareDiscordOutboundText(text, params) {
|
|
291
294
|
const { account } = params;
|
|
292
295
|
const renderedText = renderDiscordMarkdown(text, params.tableMode ?? resolveMarkdownTableMode({
|
|
@@ -303,7 +306,8 @@ function prepareDiscordOutboundText(text, params) {
|
|
|
303
306
|
})
|
|
304
307
|
};
|
|
305
308
|
}
|
|
306
|
-
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region extensions/discord/src/send.outbound.ts
|
|
307
311
|
var send_outbound_exports = /* @__PURE__ */ __exportAll({
|
|
308
312
|
sendMessageDiscord: () => sendMessageDiscord,
|
|
309
313
|
sendPollDiscord: () => sendPollDiscord,
|
|
@@ -570,4 +574,5 @@ async function sendDiscordStructuredMessage(to, opts, kind, buildPayload) {
|
|
|
570
574
|
});
|
|
571
575
|
});
|
|
572
576
|
}
|
|
577
|
+
//#endregion
|
|
573
578
|
export { prepareDiscordOutboundText as a, send_outbound_exports as i, sendPollDiscord as n, discordTextHasBroadcastMention as o, sendStickerDiscord as r, formatMention as s, sendMessageDiscord as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as RateLimitError } from "./discord-
|
|
2
|
-
import { t as parseDiscordTarget } from "./target-parsing-
|
|
1
|
+
import { B as RateLimitError } from "./discord-DGVSguhx.mjs";
|
|
2
|
+
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
3
3
|
import { collectErrorGraphCandidates, extractErrorCode, formatErrorMessage, readErrorName } from "openclaw/plugin-sdk/error-runtime";
|
|
4
4
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
5
5
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
@@ -10,7 +10,7 @@ import { classifyTransientNetworkErrorCode, createChannelApiRetryRunner, resolve
|
|
|
10
10
|
import { isSingleUseReplyToMode } from "openclaw/plugin-sdk/reply-reference";
|
|
11
11
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
12
12
|
import { attachChannelToResults } from "openclaw/plugin-sdk/channel-send-result";
|
|
13
|
-
|
|
13
|
+
//#region packages/normalization-core/src/utf16-slice.ts
|
|
14
14
|
function isHighSurrogate(codeUnit) {
|
|
15
15
|
return codeUnit >= 55296 && codeUnit <= 56319;
|
|
16
16
|
}
|
|
@@ -23,7 +23,8 @@ function avoidTrailingHighSurrogateBreak(text, start, end) {
|
|
|
23
23
|
const adjusted = end - 1;
|
|
24
24
|
return adjusted > start ? adjusted : end + 1;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region packages/normalization-core/src/grapheme.ts
|
|
27
28
|
let graphemeSegmenter;
|
|
28
29
|
function getGraphemeSegmenter() {
|
|
29
30
|
graphemeSegmenter ??= new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
@@ -47,7 +48,8 @@ function findGraphemeChunkEnd(text, start, maxEnd, preferredEnd = maxEnd, allowP
|
|
|
47
48
|
if (end <= start && preferred < hardEnd) end = hardEnd === text.length ? hardEnd : segments.containing(hardEnd)?.index ?? hardEnd;
|
|
48
49
|
return end > start ? end : allowPartial ? avoidTrailingHighSurrogateBreak(text, start, hardEnd) : start;
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region extensions/discord/src/chunk.ts
|
|
51
53
|
const DEFAULT_MAX_CHARS = 2e3;
|
|
52
54
|
const DEFAULT_MAX_LINES = 17;
|
|
53
55
|
const REASONING_ITALICS_MARKER_CHARS = 2;
|
|
@@ -362,7 +364,8 @@ function createDiscordRanges(source, maxChars, maxLines) {
|
|
|
362
364
|
cutBoundary
|
|
363
365
|
};
|
|
364
366
|
}
|
|
365
|
-
|
|
367
|
+
//#endregion
|
|
368
|
+
//#region extensions/discord/src/retry.ts
|
|
366
369
|
const DISCORD_RETRY_DEFAULTS = {
|
|
367
370
|
attempts: 3,
|
|
368
371
|
minDelayMs: 500,
|
|
@@ -456,7 +459,8 @@ function createDiscordRetryRunner(params) {
|
|
|
456
459
|
})(runRequest, label);
|
|
457
460
|
};
|
|
458
461
|
}
|
|
459
|
-
|
|
462
|
+
//#endregion
|
|
463
|
+
//#region extensions/discord/src/reply-reference.ts
|
|
460
464
|
function resolveDiscordReplyReference(params) {
|
|
461
465
|
if (!params.replyToId) return;
|
|
462
466
|
const singleUse = params.replyToIdSource !== "explicit" && params.replyToMode !== void 0 && isSingleUseReplyToMode(params.replyToMode);
|
|
@@ -474,7 +478,8 @@ function createReusableDiscordReplyReference(messageId) {
|
|
|
474
478
|
function resolveDiscordReplyMessageId(reply, isFirst) {
|
|
475
479
|
return reply && (isFirst || reply.scope === "all") ? reply.messageId : void 0;
|
|
476
480
|
}
|
|
477
|
-
|
|
481
|
+
//#endregion
|
|
482
|
+
//#region extensions/discord/src/normalize.ts
|
|
478
483
|
function normalizeDiscordMessagingTarget(raw) {
|
|
479
484
|
return parseDiscordTarget(raw, { defaultKind: "channel" })?.normalized;
|
|
480
485
|
}
|
|
@@ -519,7 +524,8 @@ function looksLikeDiscordTargetId(raw) {
|
|
|
519
524
|
const trimmed = raw.trim();
|
|
520
525
|
return /^<@!?\d+>$/.test(trimmed) || /^(?:(?:user|channel|discord):\d+|discord:(?:user|channel):\d+)$/i.test(trimmed) || /^\d{6,}$/.test(trimmed);
|
|
521
526
|
}
|
|
522
|
-
|
|
527
|
+
//#endregion
|
|
528
|
+
//#region extensions/discord/src/send.receipt.ts
|
|
523
529
|
function toDiscordOutboundDeliveryResult(result) {
|
|
524
530
|
const { channelId, ...delivery } = result;
|
|
525
531
|
return {
|
|
@@ -582,4 +588,5 @@ function createDiscordSendResult(params) {
|
|
|
582
588
|
})
|
|
583
589
|
};
|
|
584
590
|
}
|
|
591
|
+
//#endregion
|
|
585
592
|
export { recordDiscordMessageCreateAmbiguity as _, allowFromContainsDiscordUserId as a, normalizeDiscordMessagingTarget as c, resolveDiscordReplyMessageId as d, resolveDiscordReplyReference as f, hasDiscordMessageCreateAmbiguity as g, createDiscordRetryRunner as h, toDiscordOutboundDeliveryResult as i, normalizeDiscordOutboundTarget as l, classifyDiscordDeliveryFailure as m, createDiscordSendReceiptFromResults as n, looksLikeDiscordTargetId as o, canFallbackDiscordWebhookSend as p, createDiscordSendResult as r, matchesDiscordToolContextTarget as s, createDiscordSendReceipt as t, createReusableDiscordReplyReference as u, chunkDiscordTextWithMode as v, findGraphemeChunkEnd as y };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { h as normalizeDiscordToken, l as resolveDiscordAccount, s as mergeDiscordAccountConfig } from "./accounts-
|
|
2
|
-
import { A as getThreadMember, N as getGuild, O as getChannel, P as getGuildMember, R as RequestClient, b as getCurrentUser, d as hasDiscordV2Components, f as serializePayload, p as Embed, w as createChannelMessage, y as createUserDmChannel, z as DiscordError } from "./discord-
|
|
3
|
-
import { w as isDiscordThreadChannelType } from "./allow-list-
|
|
4
|
-
import { d as resolveDiscordReplyMessageId, h as createDiscordRetryRunner, v as chunkDiscordTextWithMode } from "./send.receipt-
|
|
5
|
-
import { t as resolveDiscordProxyFetchForAccount } from "./proxy-fetch-
|
|
6
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-
|
|
1
|
+
import { h as normalizeDiscordToken, l as resolveDiscordAccount, s as mergeDiscordAccountConfig } from "./accounts-C_25wyxC.mjs";
|
|
2
|
+
import { A as getThreadMember, N as getGuild, O as getChannel, P as getGuildMember, R as RequestClient, b as getCurrentUser, d as hasDiscordV2Components, f as serializePayload, p as Embed, w as createChannelMessage, y as createUserDmChannel, z as DiscordError } from "./discord-DGVSguhx.mjs";
|
|
3
|
+
import { w as isDiscordThreadChannelType } from "./allow-list-BXrS8-R9.mjs";
|
|
4
|
+
import { d as resolveDiscordReplyMessageId, h as createDiscordRetryRunner, v as chunkDiscordTextWithMode } from "./send.receipt-NZDOTZBU.mjs";
|
|
5
|
+
import { t as resolveDiscordProxyFetchForAccount } from "./proxy-fetch-BzXwBAXt.mjs";
|
|
6
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-BOOzqxxM.mjs";
|
|
7
7
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
8
8
|
import { normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { ChannelType, MessageFlags, PermissionFlagsBits } from "discord-api-types/v10";
|
|
@@ -13,7 +13,7 @@ import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
|
13
13
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
14
14
|
import { resolveTextChunksWithFallback } from "openclaw/plugin-sdk/reply-payload";
|
|
15
15
|
import { randomBytes } from "node:crypto";
|
|
16
|
-
|
|
16
|
+
//#region extensions/discord/src/monitor/gateway-registry.ts
|
|
17
17
|
/**
|
|
18
18
|
* Module-level registry of active Discord GatewayPlugin instances.
|
|
19
19
|
* Bridges the gap between agent tool handlers (which only have REST access)
|
|
@@ -34,7 +34,8 @@ function getGateway(accountId) {
|
|
|
34
34
|
function clearGateways() {
|
|
35
35
|
gatewayRegistry.clear();
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region extensions/discord/src/client.ts
|
|
38
39
|
function createDiscordRuntimeAccountContext(params) {
|
|
39
40
|
return {
|
|
40
41
|
cfg: params.cfg,
|
|
@@ -118,7 +119,8 @@ function createDiscordClient(opts) {
|
|
|
118
119
|
function resolveDiscordRest(opts) {
|
|
119
120
|
return createDiscordRestClient(opts).rest;
|
|
120
121
|
}
|
|
121
|
-
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region extensions/discord/src/send.message-request.ts
|
|
122
124
|
const SUPPRESS_EMBEDS_FLAG = MessageFlags.SuppressEmbeds;
|
|
123
125
|
const SUPPRESS_NOTIFICATIONS_FLAG = MessageFlags.SuppressNotifications;
|
|
124
126
|
function createDiscordMessageNonce() {
|
|
@@ -160,7 +162,8 @@ function buildDiscordMessageRequest(params) {
|
|
|
160
162
|
...nonce ? { enforce_nonce: true } : {}
|
|
161
163
|
};
|
|
162
164
|
}
|
|
163
|
-
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region extensions/discord/src/send.permissions.ts
|
|
164
167
|
const PERMISSION_ENTRIES = Object.entries(PermissionFlagsBits).filter(([, value]) => typeof value === "bigint");
|
|
165
168
|
const ALL_PERMISSIONS = PERMISSION_ENTRIES.reduce((acc, [, value]) => acc | value, 0n);
|
|
166
169
|
const ADMINISTRATOR_BIT = PermissionFlagsBits.Administrator;
|
|
@@ -377,7 +380,8 @@ async function fetchChannelPermissionsDiscord(channelId, opts) {
|
|
|
377
380
|
channelType
|
|
378
381
|
};
|
|
379
382
|
}
|
|
380
|
-
|
|
383
|
+
//#endregion
|
|
384
|
+
//#region extensions/discord/src/send.types.ts
|
|
381
385
|
var DiscordSendError = class extends Error {
|
|
382
386
|
constructor(message, opts) {
|
|
383
387
|
super(message);
|
|
@@ -391,7 +395,8 @@ var DiscordSendError = class extends Error {
|
|
|
391
395
|
const DISCORD_MAX_EMOJI_BYTES = 262144;
|
|
392
396
|
const DISCORD_MAX_STICKER_BYTES = 524288;
|
|
393
397
|
const DISCORD_MAX_EVENT_COVER_BYTES = 8388608;
|
|
394
|
-
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region extensions/discord/src/send.shared.ts
|
|
395
400
|
const DISCORD_TEXT_LIMIT = 2e3;
|
|
396
401
|
const DISCORD_MAX_STICKERS = 3;
|
|
397
402
|
const DISCORD_POLL_MAX_ANSWERS = 10;
|
|
@@ -580,4 +585,5 @@ function buildReactionIdentifier(emoji) {
|
|
|
580
585
|
if (emoji.id && emoji.name) return `${emoji.name}:${emoji.id}`;
|
|
581
586
|
return emoji.name ?? "";
|
|
582
587
|
}
|
|
588
|
+
//#endregion
|
|
583
589
|
export { resolveDiscordSendEmbeds as A, unregisterGateway as B, hasAnyChannelPermissionDiscord as C, createDiscordMessageNonce as D, buildDiscordMessageRequest as E, resolveDiscordClientAccountContext as F, resolveDiscordRest as I, clearGateways as L, createDiscordClient as M, createDiscordRestClient as N, resolveDiscordMessageFlags as O, createDiscordRuntimeAccountContext as P, getGateway as R, hasAllGuildPermissionsDiscord as S, SUPPRESS_NOTIFICATIONS_FLAG as T, canManageGuildMemberRoleDiscord as _, normalizeEmojiName as a, fetchChannelPermissionsDiscord as b, resolveChannelId as c, sendDiscordChunks as d, sendDiscordMedia as f, DiscordSendError as g, DISCORD_MAX_STICKER_BYTES as h, normalizeDiscordPollInput as i, resolveDiscordSuppressEmbeds as j, resolveDiscordSendComponents as k, resolveDiscordChannel as l, DISCORD_MAX_EVENT_COVER_BYTES as m, buildDiscordTextChunks as n, normalizeReactionEmoji as o, DISCORD_MAX_EMOJI_BYTES as p, buildReactionIdentifier as r, normalizeStickerIds as s, buildDiscordSendError as t, resolveDiscordTargetChannelId as u, canManageGuildRoleDiscord as v, hasAnyGuildPermissionDiscord as w, fetchMemberGuildPermissionsDiscord as x, canViewDiscordGuildChannel as y, registerGateway as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as formatDiscordUserTag } from "./allow-list-
|
|
1
|
+
import { S as formatDiscordUserTag } from "./allow-list-BXrS8-R9.mjs";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
-
|
|
3
|
+
//#region extensions/discord/src/monitor/sender-identity.ts
|
|
4
4
|
function resolveDiscordWebhookId(message) {
|
|
5
5
|
return normalizeOptionalString(message.webhookId ?? message.webhook_id) ?? null;
|
|
6
6
|
}
|
|
@@ -32,4 +32,5 @@ function resolveDiscordSenderIdentity(params) {
|
|
|
32
32
|
isPluralKit: false
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
+
//#endregion
|
|
35
36
|
export { resolveDiscordWebhookId as n, resolveDiscordSenderIdentity as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
//#region extensions/discord/src/session-contract.ts
|
|
2
2
|
function deriveLegacySessionChatType(sessionKey) {
|
|
3
3
|
return /^discord:(?:[^:]+:)?guild-[^:]+:channel-[^:]+$/.test(sessionKey) ? "channel" : void 0;
|
|
4
4
|
}
|
|
5
|
+
//#endregion
|
|
5
6
|
export { deriveLegacySessionChatType as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
|
|
2
|
+
//#region extensions/discord/src/session-key-normalization.ts
|
|
3
3
|
function normalizeExplicitDiscordSessionKey(sessionKey, ctx) {
|
|
4
4
|
let normalized = normalizeLowercaseStringOrEmpty(sessionKey);
|
|
5
5
|
const chatType = normalizeLowercaseStringOrEmpty(ctx.ChatType);
|
|
@@ -13,4 +13,5 @@ function normalizeExplicitDiscordSessionKey(sessionKey, ctx) {
|
|
|
13
13
|
const directId = senderId || fromDiscordId;
|
|
14
14
|
return directId && directId === match[2] ? `${match[1]}discord:direct:${match[2]}` : normalized;
|
|
15
15
|
}
|
|
16
|
+
//#endregion
|
|
16
17
|
export { normalizeExplicitDiscordSessionKey as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { i as parseCustomId } from "./components.base-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { i as parseCustomId } from "./components.base-CiS0h_XP.mjs";
|
|
3
3
|
import { readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { resolveAskUserQuestionOptionIndex } from "openclaw/plugin-sdk/reply-payload";
|
|
5
5
|
import { legacyInteractiveReplyToPresentation, resolveMessagePresentationActionValue, resolveMessagePresentationButtonAction, resolveMessagePresentationOptionAction } from "openclaw/plugin-sdk/interactive-runtime";
|
|
6
6
|
import { buildApprovalResolutionRef } from "openclaw/plugin-sdk/approval-reference-runtime";
|
|
7
|
-
|
|
7
|
+
//#region extensions/discord/src/custom-id-codec.ts
|
|
8
8
|
/**
|
|
9
9
|
* URI-component codec for values embedded in `k=v;` custom-id grammars
|
|
10
10
|
* (exec approvals, model picker, command args, agent components).
|
|
@@ -34,7 +34,8 @@ function needsCustomIdFieldEscaping(value) {
|
|
|
34
34
|
function unescapeCustomIdFieldValue(value) {
|
|
35
35
|
return value.replace(/%(25|3B)/gi, (match) => match.toLowerCase() === "%25" ? "%" : ";");
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region extensions/discord/src/component-custom-id.ts
|
|
38
39
|
const DISCORD_COMPONENT_CUSTOM_ID_KEY = "occomp";
|
|
39
40
|
const DISCORD_MODAL_CUSTOM_ID_KEY = "ocmodal";
|
|
40
41
|
const DISCORD_ACTIVITY_CUSTOM_ID_KEY = "ocactivity";
|
|
@@ -114,7 +115,8 @@ function parseDiscordComponentCustomIdForInteraction(id) {
|
|
|
114
115
|
function parseDiscordModalCustomIdForInteraction(id) {
|
|
115
116
|
return parseDiscordCustomIdForInteraction(id, DISCORD_MODAL_CUSTOM_ID_KEY);
|
|
116
117
|
}
|
|
117
|
-
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region extensions/discord/src/approval-custom-id.ts
|
|
118
120
|
const DISCORD_APPROVAL_DECISIONS = {
|
|
119
121
|
"allow-once": {
|
|
120
122
|
label: "Allowed (once)",
|
|
@@ -177,7 +179,8 @@ function parseExecApprovalData(data) {
|
|
|
177
179
|
action: rawAction
|
|
178
180
|
};
|
|
179
181
|
}
|
|
180
|
-
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region extensions/discord/src/question-custom-id.ts
|
|
181
184
|
const QUESTION_RECORD_ID_PATTERN = /^ask_[a-f0-9]{32}$/u;
|
|
182
185
|
function buildDiscordQuestionCustomId(callback) {
|
|
183
186
|
if (!QUESTION_RECORD_ID_PATTERN.test(callback.questionId) || !Number.isInteger(callback.optionIndex) || callback.optionIndex < 0 || callback.optionIndex > 3) return;
|
|
@@ -192,7 +195,8 @@ function parseDiscordQuestionData(data) {
|
|
|
192
195
|
optionIndex: Number(rawIndex)
|
|
193
196
|
};
|
|
194
197
|
}
|
|
195
|
-
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region extensions/discord/src/shared-interactive.ts
|
|
196
200
|
var shared_interactive_exports = /* @__PURE__ */ __exportAll({
|
|
197
201
|
buildDiscordInteractiveComponents: () => buildDiscordInteractiveComponents,
|
|
198
202
|
buildDiscordPresentationComponents: () => buildDiscordPresentationComponents
|
|
@@ -308,4 +312,5 @@ function buildDiscordPresentationComponents(presentation, options = {}) {
|
|
|
308
312
|
}
|
|
309
313
|
return blocks.length ? { blocks } : void 0;
|
|
310
314
|
}
|
|
315
|
+
//#endregion
|
|
311
316
|
export { parseDiscordModalCustomId as _, DISCORD_APPROVAL_DECISIONS as a, encodeCustomIdComponent as b, DISCORD_COMPONENT_CUSTOM_ID_KEY as c, buildDiscordComponentCustomId as d, buildDiscordModalCustomId as f, parseDiscordComponentCustomIdForInteraction as g, parseDiscordComponentCustomId as h, parseDiscordQuestionData as i, DISCORD_MODAL_CUSTOM_ID_KEY as l, parseDiscordActivityCustomIdForInteraction as m, buildDiscordPresentationComponents as n, buildExecApprovalCustomId as o, parseDiscordActivityCustomId as p, shared_interactive_exports as r, parseExecApprovalData as s, buildDiscordInteractiveComponents as t, buildDiscordActivityCustomId as u, parseDiscordModalCustomIdForInteraction as v, decodeCustomIdComponent as y };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as resolveDefaultDiscordAccountId, f as resolveDiscordAccountDisabledReason, i as listDiscordAccountIds, l as resolveDiscordAccount, p as resolveDiscordAccountDmPolicy, r as isDiscordAccountEnabledForRuntime, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import { t as parseDiscordTarget } from "./target-parsing-
|
|
4
|
-
import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-
|
|
5
|
-
import { t as DiscordChannelConfigSchema } from "./config-schema-
|
|
6
|
-
import { n as normalizeCompatibilityConfig } from "./doctor-contract-
|
|
7
|
-
import { r as secretTargetRegistryEntries, t as collectRuntimeConfigAssignments } from "./secret-config-contract-
|
|
8
|
-
import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-
|
|
9
|
-
import { t as deriveLegacySessionChatType } from "./session-contract-
|
|
1
|
+
import { c as resolveDefaultDiscordAccountId, f as resolveDiscordAccountDisabledReason, i as listDiscordAccountIds, l as resolveDiscordAccount, p as resolveDiscordAccountDmPolicy, r as isDiscordAccountEnabledForRuntime, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-C_25wyxC.mjs";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-DGkdWwix.mjs";
|
|
3
|
+
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
4
|
+
import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-DiBVuaU6.mjs";
|
|
5
|
+
import { t as DiscordChannelConfigSchema } from "./config-schema-BNKN1cu5.mjs";
|
|
6
|
+
import { n as normalizeCompatibilityConfig } from "./doctor-contract-Bwv8EuQ_.mjs";
|
|
7
|
+
import { r as secretTargetRegistryEntries, t as collectRuntimeConfigAssignments } from "./secret-config-contract-B1kE4sDv.mjs";
|
|
8
|
+
import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-DNyyjTZZ.mjs";
|
|
9
|
+
import { t as deriveLegacySessionChatType } from "./session-contract-BO5tlIdl.mjs";
|
|
10
10
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
11
11
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
12
12
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
@@ -17,7 +17,7 @@ import { createConditionalWarningCollector, createOpenProviderConfiguredRouteWar
|
|
|
17
17
|
import { identityEntryAuthenticationClassifier } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
18
18
|
import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
|
|
19
19
|
import { createEnvPatchedAccountSetupAdapter } from "openclaw/plugin-sdk/setup-runtime";
|
|
20
|
-
|
|
20
|
+
//#region extensions/discord/src/security.ts
|
|
21
21
|
const resolveDiscordDmPolicy = createScopedDmSecurityResolver({
|
|
22
22
|
channelKey: "discord",
|
|
23
23
|
resolvePolicy: (account) => account.config.dmPolicy,
|
|
@@ -60,9 +60,10 @@ const discordSecurityAdapter = {
|
|
|
60
60
|
severity: "warn",
|
|
61
61
|
title: "Discord security warning"
|
|
62
62
|
}),
|
|
63
|
-
collectAuditFindings: async (params) => (await import("./security-audit-
|
|
63
|
+
collectAuditFindings: async (params) => (await import("./security-audit-BFT84Uny.mjs").then((n) => n.n)).collectDiscordSecurityAuditFindings(params)
|
|
64
64
|
};
|
|
65
|
-
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region extensions/discord/src/setup-adapter.ts
|
|
66
67
|
const discordSetupAdapter = createEnvPatchedAccountSetupAdapter({
|
|
67
68
|
channelKey: "discord",
|
|
68
69
|
defaultAccountOnlyEnvError: "DISCORD_BOT_TOKEN can only be used for the default account.",
|
|
@@ -92,10 +93,11 @@ const discordSetupContract = defineChannelSetupContract({
|
|
|
92
93
|
},
|
|
93
94
|
legacyAdapter: discordSetupAdapter
|
|
94
95
|
});
|
|
95
|
-
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region extensions/discord/src/shared.ts
|
|
96
98
|
const DISCORD_CHANNEL = "discord";
|
|
97
99
|
const livePolicyConfigPrefixes = Object.keys(selectDiscordLivePolicyConfig({})).flatMap((key) => [`channels.discord.${key}`, `channels.discord.accounts.*.${key}`]);
|
|
98
|
-
const loadDiscordDoctorModule = createLazyRuntimeModule(() => import("./doctor-
|
|
100
|
+
const loadDiscordDoctorModule = createLazyRuntimeModule(() => import("./doctor-eujgbnpZ.mjs"));
|
|
99
101
|
const discordDoctor = {
|
|
100
102
|
dmAllowFromMode: "topOnly",
|
|
101
103
|
groupModel: "route",
|
|
@@ -221,4 +223,5 @@ function createDiscordPluginBase(params) {
|
|
|
221
223
|
}
|
|
222
224
|
};
|
|
223
225
|
}
|
|
226
|
+
//#endregion
|
|
224
227
|
export { discordSecurityAdapter as i, discordConfigAdapter as n, discordSetupContract as r, createDiscordPluginBase as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { d as unbindThreadBindingsBySessionKeyAsync, o as listThreadBindingsBySessionKey, s as listThreadBindingsBySessionKeyAsync } from "./thread-bindings-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { d as unbindThreadBindingsBySessionKeyAsync, o as listThreadBindingsBySessionKey, s as listThreadBindingsBySessionKeyAsync } from "./thread-bindings-zce4cpu_.mjs";
|
|
3
3
|
import { normalizeOptionalLowercaseString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { warnPluginSdkDeprecation } from "openclaw/plugin-sdk/thread-bindings-session-runtime";
|
|
5
|
-
|
|
5
|
+
//#region extensions/discord/src/subagent-hooks.ts
|
|
6
6
|
var subagent_hooks_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
handleDiscordSubagentDeliveryTarget: () => handleDiscordSubagentDeliveryTarget,
|
|
8
8
|
handleDiscordSubagentDeliveryTargetAsync: () => handleDiscordSubagentDeliveryTargetAsync,
|
|
@@ -55,4 +55,5 @@ function resolveDiscordDeliveryTarget(event, bindings) {
|
|
|
55
55
|
threadId: binding.threadId
|
|
56
56
|
} };
|
|
57
57
|
}
|
|
58
|
+
//#endregion
|
|
58
59
|
export { subagent_hooks_exports as i, handleDiscordSubagentDeliveryTargetAsync as n, handleDiscordSubagentEnded as r, handleDiscordSubagentDeliveryTarget as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as discord_exports } from "./discord-
|
|
2
|
-
import { S as formatDiscordUserTag } from "./allow-list-
|
|
3
|
-
|
|
1
|
+
import { t as discord_exports } from "./discord-DGVSguhx.mjs";
|
|
2
|
+
import { S as formatDiscordUserTag } from "./allow-list-BXrS8-R9.mjs";
|
|
3
|
+
//#region extensions/discord/src/monitor/system-events.ts
|
|
4
4
|
const SYSTEM_EVENT_ACTIONS = /* @__PURE__ */ new Map([
|
|
5
5
|
[discord_exports.MessageType.ChannelPinnedMessage, "pinned a message"],
|
|
6
6
|
[discord_exports.MessageType.RecipientAdd, "added a recipient"],
|
|
@@ -29,4 +29,5 @@ function resolveDiscordSystemEvent(message, location) {
|
|
|
29
29
|
const authorLabel = message.author ? formatDiscordUserTag(message.author) : "";
|
|
30
30
|
return `Discord system: ${authorLabel ? `${authorLabel} ` : ""}${action} in ${location}`;
|
|
31
31
|
}
|
|
32
|
+
//#endregion
|
|
32
33
|
export { resolveDiscordSystemEvent };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { buildMessagingTarget, parseMentionPrefixOrAtUserTarget, requireTargetKind } from "openclaw/plugin-sdk/channel-targets";
|
|
2
|
-
|
|
2
|
+
//#region extensions/discord/src/target-parsing.ts
|
|
3
3
|
function parseDiscordTarget(raw, options = {}) {
|
|
4
4
|
const trimmed = raw.trim();
|
|
5
5
|
if (!trimmed) return;
|
|
@@ -44,4 +44,5 @@ function resolveDiscordChannelId(raw) {
|
|
|
44
44
|
kind: "channel"
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
+
//#endregion
|
|
47
48
|
export { resolveDiscordChannelId as n, parseDiscordTarget as t };
|