@openclaw/discord 2026.11.7 → 2026.11.10-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/README.md +37 -0
- package/dist/.setup/{account-inspect-DGkdWwix.mjs → account-inspect-CSz5Qodj.mjs} +2 -3
- package/dist/.setup/{accounts-C_25wyxC.mjs → accounts-DtjvhJUj.mjs} +4 -8
- package/dist/.setup/{active-turn-thread-route-KvRTAVE3.mjs → active-turn-thread-route-DkPnk2x8.mjs} +1 -2
- package/dist/.setup/{allow-list-C3j0qLDp.mjs → allow-list-CkqpzPvP.mjs} +4 -8
- package/dist/.setup/{api-DYRggUgK.mjs → api-C4j_kC-2.mjs} +4 -6
- package/dist/.setup/{approval-handler.runtime-BN4W1r0o.mjs → approval-handler.runtime-DXzPFNvC.mjs} +10 -10
- package/dist/.setup/{approval-message-updates-DKsCfxSW.mjs → approval-message-updates-DqOXxPss.mjs} +3 -4
- package/dist/.setup/{audit-BL6EoUun.mjs → audit-B9vk3V2z.mjs} +6 -7
- package/dist/.setup/{channel-DdI2l55_.mjs → channel-CKffiPiV.mjs} +38 -41
- package/dist/.setup/{channel-access-9cyzozUP.mjs → channel-access-DhJhVrdZ.mjs} +1 -2
- package/dist/.setup/{channel.setup-kNWMxlgu.mjs → channel.setup-DmGdG9BH.mjs} +7 -10
- package/dist/.setup/{command-deploy-store-DFkBTViB.mjs → command-deploy-store-DPWiBMks.mjs} +1 -2
- package/dist/.setup/{command-owners-C7rUdqUX.mjs → command-owners-BzlhNBxA.mjs} +1 -2
- package/dist/.setup/{components-C1Phe3uw.mjs → components-GePlato3.mjs} +10 -16
- package/dist/.setup/{components.base-CiS0h_XP.mjs → components.base-C5sAPHe4.mjs} +1 -2
- package/dist/.setup/config-DDwcUaxT.mjs +20 -0
- package/dist/.setup/{config-schema-BNKN1cu5.mjs → config-schema-D3M1livr.mjs} +5 -7
- package/dist/.setup/{conversation-binding-route-K_jFbvi5.mjs → conversation-binding-route-CAaWWJdQ.mjs} +2 -3
- package/dist/.setup/conversation-fork-B6PiUuln.mjs +197 -0
- package/dist/.setup/{directory-config-Ble81PWH.mjs → directory-config-BXJuh9-J.mjs} +3 -4
- package/dist/.setup/{directory-live-CY2-qrHI.mjs → directory-live-B9UoQG9g.mjs} +9 -64
- package/dist/.setup/{discord-BRVFhk09.mjs → discord-cXPUdHQi.mjs} +98 -77
- package/dist/.setup/{doctor-RqH-6JB0.mjs → doctor-MTAWTgRa.mjs} +7 -8
- package/dist/.setup/{doctor-contract-Bwv8EuQ_.mjs → doctor-contract-Dstl3cMg.mjs} +2 -3
- package/dist/.setup/{endpoint-runtime-lf4DeLas.mjs → endpoint-runtime-BM3x-m6O.mjs} +1 -2
- package/dist/.setup/{guilds-BSnrns-F.mjs → guilds-DYBhgnfq.mjs} +3 -4
- package/dist/.setup/{handle-action-uD87h2FK.mjs → handle-action-El1ok7Ak.mjs} +13 -12
- package/dist/.setup/{handle-action.guild-admin-CqBx_3mG.mjs → handle-action.guild-admin-CxYfg02j.mjs} +7 -5
- package/dist/.setup/identity-link-B7KOBo_l.mjs +74 -0
- package/dist/.setup/{listeners-DnHLrLIN.mjs → listeners-DIyynRvV.mjs} +2 -3
- package/dist/.setup/{live-policy-config-y0Qy36X3.mjs → live-policy-config-DjIHWFla.mjs} +3 -5
- package/dist/.setup/{message-handler-CWL_u0X8.mjs → message-handler-DP3cAQCZ.mjs} +18 -17
- package/dist/.setup/{message-handler.preflight-83tpEdBG.mjs → message-handler.preflight-S5yc9UdR.mjs} +20 -27
- package/dist/.setup/{message-handler.preflight-pluralkit-Dhcx7Ifz.mjs → message-handler.preflight-pluralkit-BFntgVKc.mjs} +10 -14
- package/dist/.setup/{message-handler.process-BC-wNZwK.mjs → message-handler.process-bXE_4sq5.mjs} +56 -67
- package/dist/.setup/oauth-http-DdVyzSbo.mjs +40 -0
- package/dist/.setup/{outbound-payload-CK3_bDvK.mjs → outbound-payload-Dh6xCO6z.mjs} +18 -13
- package/dist/.setup/{outbound-session-route-Ay_DnOOl.mjs → outbound-session-route-G_fK5RAh.mjs} +22 -34
- package/dist/.setup/{output-activity-uBpMSX75.mjs → output-activity-CDgs2s3O.mjs} +1 -2
- package/dist/.setup/{pluralkit-B64dfq_j.mjs → pluralkit-DcXbHTpQ.mjs} +2 -3
- package/dist/.setup/{preflight-audio-C6QtD6HX.mjs → preflight-audio-r4BbaJxh.mjs} +1 -2
- package/dist/.setup/{presence-cache-Dq-3nH7R.mjs → presence-cache-B3xj3b0l.mjs} +1 -2
- package/dist/.setup/{probe-CbDJojNV.mjs → probe-CfGMZwFD.mjs} +5 -6
- package/dist/.setup/{provider-CRb3Myky.mjs → provider-BA4ysXXm.mjs} +200 -249
- package/dist/.setup/{provider-session.runtime-3cZpps3H.mjs → provider-session.runtime-Cr2oPicL.mjs} +3 -3
- package/dist/.setup/provider.runtime-D4BlQKDq.mjs +1 -0
- package/dist/.setup/{proxy-fetch-BzXwBAXt.mjs → proxy-fetch-B8cK6FLQ.mjs} +1 -2
- package/dist/.setup/{realtime-session.runtime-BRYpjS9P.mjs → realtime-session.runtime-DQvAKxj9.mjs} +15 -25
- package/dist/.setup/{receive-recovery-C3Ks4wAQ.mjs → receive-recovery-DV_v5ROf.mjs} +3 -6
- package/dist/.setup/{resolve-allowlist-common-B-S0wRIw.mjs → resolve-allowlist-common-CYdqBUgV.mjs} +3 -4
- package/dist/.setup/{resolve-channels-g16NM6Ho.mjs → resolve-channels-BNnyfCR8.mjs} +6 -7
- package/dist/.setup/{resolve-users-DAfOOXdy.mjs → resolve-users-CDMAGrzv.mjs} +5 -6
- package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
- package/dist/.setup/{runtime--HZ9r3tF.mjs → runtime-CkeNX7ic.mjs} +59 -50
- package/dist/.setup/{runtime-BMgTyuwg.mjs → runtime-DSaHEGJd.mjs} +4 -24
- package/dist/.setup/{runtime-DgnVQ7zW.mjs → runtime-DcBvHOm1.mjs} +1 -2
- package/dist/.setup/{runtime-doctor-migrations-BPV-R4G9.mjs → runtime-doctor-migrations-BpV1jKk0.mjs} +5 -9
- package/dist/.setup/{secret-config-contract-B1kE4sDv.mjs → secret-config-contract-CP6teHec.mjs} +1 -2
- package/dist/.setup/{security-audit-BFT84Uny.mjs → security-audit-CTwisG7c.mjs} +3 -4
- package/dist/.setup/{security-contract-DNyyjTZZ.mjs → security-contract-D-o0iWDk.mjs} +1 -2
- package/dist/.setup/{security-doctor-nGgPm65L.mjs → security-doctor-4s7omTZd.mjs} +1 -2
- package/dist/.setup/{send-CtvwfZQ2.mjs → send-DKzwsZkm.mjs} +26 -31
- package/dist/.setup/{send.components-CtLtE0yD.mjs → send.components-CIZALYDP.mjs} +12 -14
- package/dist/.setup/{send.outbound-D58xXPgs.mjs → send.outbound-cQ4Ohmsc.mjs} +11 -16
- package/dist/.setup/send.permissions-BvH_Dr8p.mjs +369 -0
- package/dist/.setup/{send.receipt-DLOV4qx6.mjs → send.receipt-CZ7ks6g7.mjs} +64 -17
- package/dist/.setup/send.shared-D2lh737v.mjs +259 -0
- package/dist/.setup/{sender-identity-BbA7FNbr.mjs → sender-identity-Dt5ELjRN.mjs} +2 -3
- package/dist/.setup/{session-contract-BO5tlIdl.mjs → session-contract-Bq71MS78.mjs} +1 -2
- package/dist/.setup/{session-key-normalization-CCHGNSQw.mjs → session-key-normalization-Cfvze5hd.mjs} +1 -2
- package/dist/.setup/setup-plugin-api-BJt8tAAC.mjs +2 -0
- package/dist/.setup/{shared-Dv2DamaK.mjs → shared-Bf7ifHlc.mjs} +14 -17
- package/dist/.setup/{shared-interactive-DmzaoKOM.mjs → shared-interactive-DKBw4SNV.mjs} +7 -12
- package/dist/.setup/{subagent-hooks-yT45eTyz.mjs → subagent-hooks-CVmIOrAR.mjs} +4 -5
- package/dist/.setup/{system-events-Dlzp9Jcj.mjs → system-events-DB6p2H4l.mjs} +3 -4
- package/dist/.setup/{target-parsing-C-HyNxcE.mjs → target-parsing-BiuhcK9Q.mjs} +1 -2
- package/dist/.setup/{target-resolver-BzaZPBm9.mjs → target-resolver-48znkzky.mjs} +6 -7
- package/dist/.setup/{thread-binding-api-BDZJD4na.mjs → thread-binding-api-Drd4Zu-5.mjs} +1 -2
- package/dist/.setup/{thread-bindings-DRWhgKCc.mjs → thread-bindings-DTHVdmvF.mjs} +7 -10
- package/dist/.setup/{thread-bindings.manager-CWJKirn1.mjs → thread-bindings.manager-6EnH3YZh.mjs} +45 -30
- package/dist/.setup/{thread-bindings.session-updates-DzJrXc4w.mjs → thread-bindings.session-updates-BPO6pPzd.mjs} +9 -12
- package/dist/.setup/{threading-BbsPuT5G.mjs → threading-PC3IIaHd.mjs} +5 -7
- package/dist/.setup/{timeouts-cIxzatmv.mjs → timeouts-CT9hnmo4.mjs} +1 -2
- package/dist/.setup/{transcripts-source-DIW1fU_P.mjs → transcripts-source-C3F_ErM1.mjs} +20 -33
- package/dist/.setup/{typing-CNlSKY5S.mjs → typing-DAv4S2fI.mjs} +2 -3
- package/dist/.setup/{voice-runtime-oJ6BZs5D.mjs → voice-runtime-CZGbraKC.mjs} +28 -46
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
- package/dist/account-inspect-api.js +2 -3
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +10 -50
- package/dist/api.js +21 -22
- 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 +2 -3
- package/dist/doctor-contract-api.js +7 -8
- package/dist/index.js +1 -2
- package/dist/runtime-api.js +23 -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 +2 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +14 -26
- package/dist/subagent-hooks-api.js +2 -3
- package/dist/thread-binding-api.js +1 -1
- package/dist/transcripts-source-api.js +2 -3
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.cjs +2 -3
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.mjs +2 -3
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/zlib.d.ts +752 -0
- package/node_modules/typebox/build/format/date_time.d.mts +2 -1
- package/node_modules/typebox/build/format/date_time.mjs +12 -3
- package/node_modules/typebox/package.json +1 -1
- package/openclaw.plugin.json +7 -2
- package/package.json +5 -5
- package/dist/.setup/provider.runtime-tmkt3QOg.mjs +0 -1
- package/dist/.setup/send.shared-B_KKRrD7.mjs +0 -589
- package/dist/.setup/setup-plugin-api-ty5RJrMy.mjs +0 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { n as getDiscordEndpointRuntime } from "./endpoint-runtime-BM3x-m6O.mjs";
|
|
2
|
+
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
3
|
+
import { readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
|
|
4
|
+
// extensions/discord/src/oauth-http.ts
|
|
5
|
+
const DISCORD_HOST = "discord.com";
|
|
6
|
+
const DISCORD_OAUTH_REQUEST_TIMEOUT_MS = 15e3;
|
|
7
|
+
const JSON_MAX_BYTES = 65536;
|
|
8
|
+
async function fetchDiscordJson(params) {
|
|
9
|
+
const endpoint = Object.hasOwn(params, "endpointRuntime") ? params.endpointRuntime : getDiscordEndpointRuntime();
|
|
10
|
+
const liveUrl = new URL(params.url);
|
|
11
|
+
const endpointPath = liveUrl.pathname === "/api/oauth2/token" ? "/oauth2/token" : liveUrl.pathname.startsWith("/api/v10/") ? liveUrl.pathname.slice(8) : void 0;
|
|
12
|
+
if (endpoint && !endpointPath) throw new Error("Discord request is outside the configured endpoint routes");
|
|
13
|
+
const { response, release } = endpoint ? {
|
|
14
|
+
response: await endpoint.fetch(`${endpoint.descriptor.restApiBaseUrl}${endpointPath}${liveUrl.search}`, {
|
|
15
|
+
...params.init,
|
|
16
|
+
signal: params.init.signal ? AbortSignal.any([params.init.signal, AbortSignal.timeout(DISCORD_OAUTH_REQUEST_TIMEOUT_MS)]) : AbortSignal.timeout(DISCORD_OAUTH_REQUEST_TIMEOUT_MS)
|
|
17
|
+
}),
|
|
18
|
+
release: async () => {}
|
|
19
|
+
} : await fetchWithSsrFGuard({
|
|
20
|
+
url: params.url,
|
|
21
|
+
fetchImpl: params.fetchImpl,
|
|
22
|
+
init: params.init,
|
|
23
|
+
policy: { allowedHostnames: [DISCORD_HOST] },
|
|
24
|
+
auditContext: params.auditContext,
|
|
25
|
+
timeoutMs: DISCORD_OAUTH_REQUEST_TIMEOUT_MS
|
|
26
|
+
});
|
|
27
|
+
try {
|
|
28
|
+
if (!response.ok) {
|
|
29
|
+
await response.body?.cancel().catch(() => void 0);
|
|
30
|
+
return { ok: false };
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
ok: true,
|
|
34
|
+
body: await readProviderJsonResponse(response, "Discord OAuth", { maxBytes: JSON_MAX_BYTES })
|
|
35
|
+
};
|
|
36
|
+
} finally {
|
|
37
|
+
await release();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export { fetchDiscordJson as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as createDiscordActionGate } from "./accounts-
|
|
2
|
-
import {
|
|
3
|
-
import { t as parseDiscordTarget } from "./target-parsing-
|
|
4
|
-
import { C as notifyDiscordInboundEventOutboundPayloadSuccess, S as discordInboundEventDelivery, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, n as DISCORD_PRESENTATION_CAPABILITIES, o as sendDiscordComponentMessageLazy, r as buildDiscordPresentationPayload, v as resolveDiscordCurrentConversationIdentity } from "./outbound-session-route-
|
|
1
|
+
import { t as createDiscordActionGate } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { S as chunkDiscordTextWithMode, _ as canFallbackDiscordWebhookSend, b as hasDiscordMessageCreateAmbiguity, c as normalizeDiscordMessagingTarget, g as resolveDiscordReplyReference, i as toDiscordOutboundDeliveryResult, l as normalizeDiscordOutboundTarget, n as createDiscordSendReceiptFromResults, t as createDiscordSendReceipt } from "./send.receipt-CZ7ks6g7.mjs";
|
|
3
|
+
import { t as parseDiscordTarget } from "./target-parsing-BiuhcK9Q.mjs";
|
|
4
|
+
import { C as notifyDiscordInboundEventOutboundPayloadSuccess, S as discordInboundEventDelivery, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, n as DISCORD_PRESENTATION_CAPABILITIES, o as sendDiscordComponentMessageLazy, r as buildDiscordPresentationPayload, v as resolveDiscordCurrentConversationIdentity } from "./outbound-session-route-G_fK5RAh.mjs";
|
|
5
5
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
6
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
7
7
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -11,7 +11,7 @@ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
11
11
|
import { createReplyToFanout, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
12
12
|
import { attachChannelToResult, createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
|
|
13
13
|
import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
14
|
-
|
|
14
|
+
// extensions/discord/src/channel.conversation.ts
|
|
15
15
|
function resolveDiscordAttachedOutboundTarget(params) {
|
|
16
16
|
if (params.threadId == null) return params.to;
|
|
17
17
|
const threadId = normalizeOptionalStringifiedId(params.threadId) ?? "";
|
|
@@ -72,9 +72,8 @@ function resolveDiscordInboundConversation(params) {
|
|
|
72
72
|
});
|
|
73
73
|
return conversationId ? { conversationId } : null;
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-CtvwfZQ2.mjs").then((n) => n.t));
|
|
75
|
+
// extensions/discord/src/outbound-payload.ts
|
|
76
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-DKzwsZkm.mjs").then((n) => n.t));
|
|
78
77
|
function resolveDiscordDeliveryOptions(ctx) {
|
|
79
78
|
return {
|
|
80
79
|
onPlatformSendDispatch: ctx.onPlatformSendDispatch,
|
|
@@ -162,8 +161,8 @@ const DISCORD_VIDEO_MEDIA_EXTENSIONS = [
|
|
|
162
161
|
".webm"
|
|
163
162
|
];
|
|
164
163
|
const log = createSubsystemLogger("discord/outbound");
|
|
165
|
-
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-
|
|
166
|
-
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-
|
|
164
|
+
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-DTHVdmvF.mjs").then((n) => n.i));
|
|
165
|
+
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-CIZALYDP.mjs").then((n) => n.i));
|
|
167
166
|
const discordOutbound = {
|
|
168
167
|
deliveryMode: "direct",
|
|
169
168
|
chunker: (text, limit, ctx) => chunkDiscordTextWithMode(text, {
|
|
@@ -253,11 +252,16 @@ const discordOutbound = {
|
|
|
253
252
|
return completeDelivery(lastResult);
|
|
254
253
|
}
|
|
255
254
|
const discordData = asOptionalRecord(payload.channelData?.discord) ?? {};
|
|
255
|
+
const literalText = discordData.literalText === true;
|
|
256
|
+
const literalOptions = literalText ? {
|
|
257
|
+
suppressEmbeds: true,
|
|
258
|
+
allowedMentions: { parse: [] }
|
|
259
|
+
} : {};
|
|
256
260
|
const filename = normalizeOptionalString(discordData.filename);
|
|
257
261
|
const componentSpec = await resolveDiscordComponentSpec(payload);
|
|
258
262
|
const nativeComponents = !componentSpec && Array.isArray(discordData.components) ? discordData.components : void 0;
|
|
259
263
|
const embeds = !componentSpec && Array.isArray(discordData.embeds) ? discordData.embeds : void 0;
|
|
260
|
-
if (!componentSpec && !nativeComponents && !embeds?.length && !filename) return completeResult(await sendTextMediaPayload({
|
|
264
|
+
if (!literalText && !componentSpec && !nativeComponents && !embeds?.length && !filename) return completeResult(await sendTextMediaPayload({
|
|
261
265
|
channel: "discord",
|
|
262
266
|
ctx: payloadContext,
|
|
263
267
|
adapter: discordOutbound
|
|
@@ -273,7 +277,8 @@ const discordOutbound = {
|
|
|
273
277
|
components: nativeComponents,
|
|
274
278
|
embeds,
|
|
275
279
|
filename,
|
|
276
|
-
...sendContext.options()
|
|
280
|
+
...sendContext.options(),
|
|
281
|
+
...literalOptions
|
|
277
282
|
}),
|
|
278
283
|
send: async ({ text, mediaUrl, isFirst }) => {
|
|
279
284
|
if (componentSpec && isFirst) return await sendDiscordComponentMessageLazy(sendContext.target, componentSpec, {
|
|
@@ -282,6 +287,7 @@ const discordOutbound = {
|
|
|
282
287
|
});
|
|
283
288
|
return await sendContext.send(sendContext.target, text, {
|
|
284
289
|
...sendContext.mediaOptions(mediaUrl),
|
|
290
|
+
...literalOptions,
|
|
285
291
|
...!componentSpec ? {
|
|
286
292
|
components: isFirst ? nativeComponents : void 0,
|
|
287
293
|
embeds: isFirst ? embeds : void 0,
|
|
@@ -443,5 +449,4 @@ const discordOutbound = {
|
|
|
443
449
|
await manager.touchThread({ threadId });
|
|
444
450
|
}
|
|
445
451
|
};
|
|
446
|
-
//#endregion
|
|
447
452
|
export { resolveDiscordInboundConversation as a, resolveDiscordCommandConversation as i, discordOutbound as n, resolveDiscordAttachedOutboundTarget as r, DISCORD_TEXT_CHUNK_LIMIT as t };
|
package/dist/.setup/{outbound-session-route-Ay_DnOOl.mjs → outbound-session-route-G_fK5RAh.mjs}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import { w as isDiscordThreadChannelType } from "./allow-list-
|
|
4
|
-
import { c as normalizeDiscordMessagingTarget, s as matchesDiscordToolContextTarget } from "./send.receipt-
|
|
5
|
-
import { t as parseDiscordTarget } from "./target-parsing-
|
|
6
|
-
import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-
|
|
7
|
-
import { n as resolveDiscordCommandOwnerEntries } from "./command-owners-
|
|
1
|
+
import { d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-CSz5Qodj.mjs";
|
|
3
|
+
import { w as isDiscordThreadChannelType } from "./allow-list-CkqpzPvP.mjs";
|
|
4
|
+
import { c as normalizeDiscordMessagingTarget, s as matchesDiscordToolContextTarget } from "./send.receipt-CZ7ks6g7.mjs";
|
|
5
|
+
import { t as parseDiscordTarget } from "./target-parsing-BiuhcK9Q.mjs";
|
|
6
|
+
import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-GePlato3.mjs";
|
|
7
|
+
import { n as resolveDiscordCommandOwnerEntries } from "./command-owners-BzlhNBxA.mjs";
|
|
8
8
|
import { createLazyRuntimeMethod, createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
9
9
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
10
10
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
@@ -22,7 +22,7 @@ import { resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runt
|
|
|
22
22
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
23
23
|
import { createInboundEventDeliveryCorrelation } from "openclaw/plugin-sdk/inbound-event-delivery";
|
|
24
24
|
import { resolveScopeRequireMention, resolveScopeToolsPolicy } from "openclaw/plugin-sdk/channel-policy";
|
|
25
|
-
|
|
25
|
+
// extensions/discord/src/exec-approvals.ts
|
|
26
26
|
function normalizeDiscordApproverId(value) {
|
|
27
27
|
const trimmed = String(value).trim();
|
|
28
28
|
if (!trimmed) return;
|
|
@@ -67,8 +67,7 @@ function shouldSuppressLocalDiscordExecApprovalPrompt(params) {
|
|
|
67
67
|
sessionFilter: config?.sessionFilter
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
//#region extensions/discord/src/audit-core.ts
|
|
70
|
+
// extensions/discord/src/audit-core.ts
|
|
72
71
|
const REQUIRED_TEXT_CHANNEL_PERMISSIONS = ["ViewChannel", "SendMessages"];
|
|
73
72
|
const REQUIRED_THREAD_CHANNEL_PERMISSIONS = ["ViewChannel", "SendMessagesInThreads"];
|
|
74
73
|
const REQUIRED_VOICE_CHANNEL_PERMISSIONS = [
|
|
@@ -143,8 +142,7 @@ async function auditDiscordChannelPermissionsWithFetcher(params) {
|
|
|
143
142
|
elapsedMs: Date.now() - started
|
|
144
143
|
};
|
|
145
144
|
}
|
|
146
|
-
|
|
147
|
-
//#region extensions/discord/src/inbound-event-delivery.ts
|
|
145
|
+
// extensions/discord/src/inbound-event-delivery.ts
|
|
148
146
|
const DISCORD_INBOUND_EVENT_DELIVERY_KEY = "__openclawInboundEventDelivery";
|
|
149
147
|
function normalizeDiscordDeliveryTarget(value) {
|
|
150
148
|
return value.trim().replace(/^discord:/iu, "").replace(/^channel:/iu, "").toLowerCase();
|
|
@@ -181,8 +179,7 @@ function notifyDiscordInboundEventOutboundPayloadSuccess(params) {
|
|
|
181
179
|
accountId: params.accountId
|
|
182
180
|
});
|
|
183
181
|
}
|
|
184
|
-
|
|
185
|
-
//#region extensions/discord/src/trusted-requester-actions.ts
|
|
182
|
+
// extensions/discord/src/trusted-requester-actions.ts
|
|
186
183
|
const trustedRequesterGuildAdminActions = /* @__PURE__ */ new Set([
|
|
187
184
|
"emoji-upload",
|
|
188
185
|
"sticker-upload",
|
|
@@ -203,8 +200,7 @@ const trustedRequesterGuildAdminActions = /* @__PURE__ */ new Set([
|
|
|
203
200
|
function isTrustedRequesterGuildAdminAction(action) {
|
|
204
201
|
return trustedRequesterGuildAdminActions.has(action);
|
|
205
202
|
}
|
|
206
|
-
|
|
207
|
-
//#region extensions/discord/src/channel-actions.ts
|
|
203
|
+
// extensions/discord/src/channel-actions.ts
|
|
208
204
|
const localExecutionActions = /* @__PURE__ */ new Set([
|
|
209
205
|
"send",
|
|
210
206
|
"poll",
|
|
@@ -215,7 +211,7 @@ const localExecutionActions = /* @__PURE__ */ new Set([
|
|
|
215
211
|
"sticker-upload",
|
|
216
212
|
"event-create"
|
|
217
213
|
]);
|
|
218
|
-
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-
|
|
214
|
+
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-El1ok7Ak.mjs"));
|
|
219
215
|
const discordActionGroups = [
|
|
220
216
|
{
|
|
221
217
|
gate: "polls",
|
|
@@ -455,8 +451,7 @@ const discordMessageActions = {
|
|
|
455
451
|
...sessionKey ? { sessionKey } : {}
|
|
456
452
|
})
|
|
457
453
|
};
|
|
458
|
-
|
|
459
|
-
//#region extensions/discord/src/conversation-identity.ts
|
|
454
|
+
// extensions/discord/src/conversation-identity.ts
|
|
460
455
|
function normalizeDiscordTarget(raw, defaultKind) {
|
|
461
456
|
return parseDiscordTarget(raw ?? "", { defaultKind })?.normalized;
|
|
462
457
|
}
|
|
@@ -485,8 +480,7 @@ function resolveDiscordCurrentConversationIdentity(params) {
|
|
|
485
480
|
if (target) return target;
|
|
486
481
|
}
|
|
487
482
|
}
|
|
488
|
-
|
|
489
|
-
//#region extensions/discord/src/monitor/route-resolution.ts
|
|
483
|
+
// extensions/discord/src/monitor/route-resolution.ts
|
|
490
484
|
function buildDiscordRoutePeer(params) {
|
|
491
485
|
return {
|
|
492
486
|
kind: params.isGroupDm ? "group" : params.isDirectMessage ? "direct" : "channel",
|
|
@@ -556,8 +550,7 @@ function shouldIgnoreStaleDiscordRouteBinding(params) {
|
|
|
556
550
|
if (!bound || !routed || bound.rest !== routed.rest) return false;
|
|
557
551
|
return bound.agentId !== params.route.agentId;
|
|
558
552
|
}
|
|
559
|
-
|
|
560
|
-
//#region extensions/discord/src/channel-policy-state.ts
|
|
553
|
+
// extensions/discord/src/channel-policy-state.ts
|
|
561
554
|
const policyBindings = resolveGlobalMap(Symbol.for("openclaw.discord.policy-bindings"), "close-and-restart");
|
|
562
555
|
function setDiscordPolicyBindings(accountId, bindings, guilds = /* @__PURE__ */ new Map()) {
|
|
563
556
|
policyBindings.set(normalizeAccountId(accountId), {
|
|
@@ -574,8 +567,7 @@ function getDiscordChannelPolicyBinding(accountId, guildKey, channelKey) {
|
|
|
574
567
|
function findDiscordChannelPolicyKey(accountId, guildKey, channelId) {
|
|
575
568
|
return policyBindings.get(normalizeAccountId(accountId))?.channels.find((binding) => binding.guildKey === guildKey && binding.channelId === channelId)?.channelKey;
|
|
576
569
|
}
|
|
577
|
-
|
|
578
|
-
//#region extensions/discord/src/group-policy.ts
|
|
570
|
+
// extensions/discord/src/group-policy.ts
|
|
579
571
|
function resolveDiscordGuildKey(guilds, groupSpace, accountId) {
|
|
580
572
|
if (!guilds || Object.keys(guilds).length === 0) return;
|
|
581
573
|
const space = normalizeOptionalString(groupSpace) ?? "";
|
|
@@ -637,8 +629,7 @@ function resolveDiscordGroupToolPolicy(params) {
|
|
|
637
629
|
senderE164: params.senderE164
|
|
638
630
|
});
|
|
639
631
|
}
|
|
640
|
-
|
|
641
|
-
//#region extensions/discord/src/approval-message-safety.ts
|
|
632
|
+
// extensions/discord/src/approval-message-safety.ts
|
|
642
633
|
const DISCORD_APPROVAL_ALLOWED_MENTIONS = { parse: [] };
|
|
643
634
|
const DISCORD_MARKDOWN_META_CHARACTERS = /* @__PURE__ */ new Set([
|
|
644
635
|
"\\",
|
|
@@ -681,8 +672,7 @@ function formatDiscordApprovalDisplayValue(value) {
|
|
|
681
672
|
}
|
|
682
673
|
return escaped;
|
|
683
674
|
}
|
|
684
|
-
|
|
685
|
-
//#region extensions/discord/src/outbound-components.ts
|
|
675
|
+
// extensions/discord/src/outbound-components.ts
|
|
686
676
|
const DISCORD_MESSAGE_COMPONENT_LIMIT = 40;
|
|
687
677
|
const DISCORD_TEXT_DISPLAY_LIMIT = 2e3;
|
|
688
678
|
const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
@@ -712,8 +702,8 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
|
712
702
|
}
|
|
713
703
|
}
|
|
714
704
|
};
|
|
715
|
-
const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-
|
|
716
|
-
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./shared-interactive-
|
|
705
|
+
const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-CIZALYDP.mjs").then((n) => n.i)), (runtime) => runtime.sendDiscordComponentMessage);
|
|
706
|
+
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./shared-interactive-DKBw4SNV.mjs").then((n) => n.r));
|
|
717
707
|
function addPayloadTextFallback(spec, payload) {
|
|
718
708
|
return spec.text ? spec : {
|
|
719
709
|
...spec,
|
|
@@ -768,8 +758,7 @@ async function resolveDiscordComponentSpec(payload) {
|
|
|
768
758
|
const interactiveSpec = (await loadDiscordSharedInteractive()).buildDiscordInteractiveComponents(payload.interactive);
|
|
769
759
|
return interactiveSpec ? addPayloadTextFallback(interactiveSpec, payload) : void 0;
|
|
770
760
|
}
|
|
771
|
-
|
|
772
|
-
//#region extensions/discord/src/outbound-session-route.ts
|
|
761
|
+
// extensions/discord/src/outbound-session-route.ts
|
|
773
762
|
function resolveDiscordOutboundSessionRoute(params) {
|
|
774
763
|
const parsed = parseDiscordTarget(params.target, { defaultKind: resolveDiscordOutboundTargetKindHint(params) });
|
|
775
764
|
if (!parsed) return null;
|
|
@@ -809,5 +798,4 @@ function resolveDiscordOutboundTargetKindHint(params) {
|
|
|
809
798
|
if (resolvedKind === "group" || resolvedKind === "channel") return "channel";
|
|
810
799
|
return /^(user:|discord:|@|<@!?)/i.test(params.target.trim()) ? "user" : "channel";
|
|
811
800
|
}
|
|
812
|
-
//#endregion
|
|
813
801
|
export { shouldSuppressLocalDiscordExecApprovalPrompt as A, notifyDiscordInboundEventOutboundPayloadSuccess as C, getDiscordExecApprovalApprovers as D, resolveRequiredDiscordChannelPermissions as E, isDiscordExecApprovalApprover as O, discordInboundEventDelivery as S, collectDiscordAuditChannelIdsForAccount as T, resolveDiscordConversationIdentity as _, resolveDiscordComponentSpec as a, discordMessageActions as b, formatDiscordApprovalDisplayValue as c, setDiscordPolicyBindings as d, buildDiscordConversationRouteContext as f, shouldIgnoreStaleDiscordRouteBinding as g, resolveDiscordEffectiveRoute as h, isDiscordComponentSpecWithinMessageLimit as i, isDiscordExecApprovalClientEnabled as k, resolveDiscordGroupRequireMention as l, resolveDiscordConversationRoute as m, DISCORD_PRESENTATION_CAPABILITIES as n, sendDiscordComponentMessageLazy as o, buildDiscordRoutePeer as p, buildDiscordPresentationPayload as r, DISCORD_APPROVAL_ALLOWED_MENTIONS as s, resolveDiscordOutboundSessionRoute as t, resolveDiscordGroupToolPolicy as u, resolveDiscordCurrentConversationIdentity as v, auditDiscordChannelPermissionsWithFetcher as w, isTrustedRequesterGuildAdminAction as x, resolveDiscordRuntimeBindingConversationId as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// extensions/discord/src/voice/output-activity.ts
|
|
2
2
|
function resolveDiscordOutputAudioDelta(previous, sourceAudioBytes) {
|
|
3
3
|
const sinkAudioBytes = Math.floor((previous.sourceAudioBytes + sourceAudioBytes) / 2) * 8 - previous.sinkAudioBytes;
|
|
4
4
|
return {
|
|
@@ -7,5 +7,4 @@ function resolveDiscordOutputAudioDelta(previous, sourceAudioBytes) {
|
|
|
7
7
|
sinkAudioBytes
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { resolveDiscordOutputAudioDelta as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
2
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
3
3
|
import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
4
4
|
import { readProviderJsonObjectResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
5
5
|
import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
6
|
-
|
|
6
|
+
// extensions/discord/src/pluralkit.ts
|
|
7
7
|
var pluralkit_exports = /* @__PURE__ */ __exportAll({ fetchPluralKitMessageInfo: () => fetchPluralKitMessageInfo });
|
|
8
8
|
const PLURALKIT_API_BASE = "https://api.pluralkit.me/v2";
|
|
9
9
|
const PLURALKIT_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
@@ -41,5 +41,4 @@ async function fetchPluralKitMessageInfo(params) {
|
|
|
41
41
|
timeout.cleanup();
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
//#endregion
|
|
45
44
|
export { pluralkit_exports as n, fetchPluralKitMessageInfo as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
2
|
import { getFileExtension } from "openclaw/plugin-sdk/media-mime";
|
|
3
3
|
import { createChannelPreflightAudio } from "openclaw/plugin-sdk/media-understanding-runtime";
|
|
4
|
-
|
|
4
|
+
// extensions/discord/src/monitor/preflight-audio.ts
|
|
5
5
|
const AUDIO_ATTACHMENT_MIME_BY_EXT = /* @__PURE__ */ new Map([
|
|
6
6
|
[".aac", "audio/aac"],
|
|
7
7
|
[".caf", "audio/x-caf"],
|
|
@@ -55,5 +55,4 @@ async function resolveDiscordPreflightAudioMentionContext(params) {
|
|
|
55
55
|
transcript
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
//#endregion
|
|
59
58
|
export { resolveDiscordPreflightAudioMentionContext };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
2
|
-
|
|
2
|
+
// extensions/discord/src/monitor/presence-cache.ts
|
|
3
3
|
/**
|
|
4
4
|
* In-memory cache of Discord user presence data.
|
|
5
5
|
* Populated by GUILD_CREATE snapshots and PRESENCE_UPDATE when GuildPresences is enabled.
|
|
@@ -27,5 +27,4 @@ function clearPresences(accountId) {
|
|
|
27
27
|
}
|
|
28
28
|
presenceCache.clear();
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export { getPresence as n, setPresence as r, clearPresences as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { h as normalizeDiscordToken } from "./accounts-
|
|
3
|
-
import { n as getDiscordEndpointRuntime } from "./endpoint-runtime-
|
|
4
|
-
import { n as DiscordApiError, r as fetchDiscord } from "./api-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { h as normalizeDiscordToken } from "./accounts-DtjvhJUj.mjs";
|
|
3
|
+
import { n as getDiscordEndpointRuntime } from "./endpoint-runtime-BM3x-m6O.mjs";
|
|
4
|
+
import { n as DiscordApiError, r as fetchDiscord } from "./api-C4j_kC-2.mjs";
|
|
5
5
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
6
6
|
import { ApplicationFlags } from "discord-api-types/v10";
|
|
7
7
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
8
8
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
9
9
|
import { fetchWithTimeout, runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
10
|
-
|
|
10
|
+
// extensions/discord/src/probe.ts
|
|
11
11
|
var probe_exports = /* @__PURE__ */ __exportAll({
|
|
12
12
|
fetchDiscordApplicationId: () => fetchDiscordApplicationId,
|
|
13
13
|
fetchDiscordApplicationSummary: () => fetchDiscordApplicationSummary,
|
|
@@ -167,5 +167,4 @@ async function fetchDiscordApplicationId(token, timeoutMs, fetcher = fetch) {
|
|
|
167
167
|
if (result.kind === "resolved") return result.applicationId;
|
|
168
168
|
if (result.kind === "unavailable" && result.status === 429) throw result.error;
|
|
169
169
|
}
|
|
170
|
-
//#endregion
|
|
171
170
|
export { probeDiscordApplicationId as a, probeDiscord as i, fetchDiscordApplicationSummary as n, probe_exports as o, parseApplicationIdFromToken as r, resolveDiscordPrivilegedIntentsFromFlags as s, fetchDiscordApplicationId as t };
|