@openclaw/discord 2026.9.1-beta.1 → 2026.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-inspect-BY-ve3yH.js +45 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-CfQ-vSyf.js → accounts-CwJQoLjM.js} +89 -45
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-q-9PaaHH.js → activities-api-CTcGq3Hf.js} +30 -17
- package/dist/activities-api.js +1 -1
- package/dist/{allow-list-BDMimASD.js → allow-list-DBTtR2dz.js} +13 -35
- package/dist/{api-DNVbJyEy.js → api-BfmEP6wp.js} +6 -5
- package/dist/api.js +18 -18
- package/dist/{approval-handler.runtime-B7qhK3fR.js → approval-handler.runtime-DUSe5fyH.js} +19 -12
- package/dist/{audit-CBEv_ERu.js → audit-DpPfwoJM.js} +8 -7
- package/dist/{channel-Dx1tMTfx.js → channel-BHajPgwR.js} +29 -23
- package/dist/{channel-actions.runtime-CLWWu9nC.js → channel-actions.runtime-DS8pXo0S.js} +38 -38
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-DOzXS2Pk.js → channel.setup-BWmMe1tT.js} +18 -18
- package/dist/command-owners-D78sAoOz.js +10 -0
- package/dist/{components-B9V5o361.js → components-BimX47Mq.js} +111 -149
- package/dist/{config-schema-BR13IAx6.js → config-schema-B797-Spt.js} +19 -12
- package/dist/{conversation-binding-route-DJYrY2TQ.js → conversation-binding-route-DuR5NGIx.js} +1 -1
- package/dist/{directory-config-BK6eqekJ.js → directory-config-CD2v2Szs.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-DSAJSrJk.js → directory-live-DaJzWJ2N.js} +4 -4
- package/dist/{doctor-Cm7Y1pJ2.js → doctor-D4HH1inA.js} +9 -6
- package/dist/{doctor-contract-DsWvKIXF.js → doctor-contract-Co5vRCZ6.js} +9 -6
- package/dist/doctor-contract-api.js +31 -28
- package/dist/{handle-action.guild-admin-BdwCRHmm.js → handle-action.guild-admin-4We6wWQU.js} +6 -3
- package/dist/index.js +1 -1
- package/dist/ingress-identity-XNmW-mZS.js +60 -0
- package/dist/{message-handler-BXpWZyni.js → message-handler-DhgBabyU.js} +61 -70
- package/dist/{message-handler.preflight-Ba5LAY_X.js → message-handler.preflight-oZ7dQCd0.js} +41 -101
- package/dist/{message-handler.process-3HEzmemS.js → message-handler.process-BzCYf1pa.js} +82 -108
- package/dist/{message-text-aiwO5R2F.js → message-text-DK4NnBg-.js} +11 -6
- package/dist/{outbound-adapter-BE4jSq2d.js → outbound-adapter-CtggmGh9.js} +52 -67
- package/dist/{outbound-components-oLpg8Qzb.js → outbound-components-Dn8SJWMS.js} +5 -4
- package/dist/{outbound-session-route-Cg15ZFJd.js → outbound-session-route-Q_HEusBQ.js} +57 -15
- package/dist/{owner-access-UlYi9t0M.js → owner-access-Cp8r6Ipf.js} +9 -7
- package/dist/{pluralkit-Tiyl70dx.js → pluralkit-BY75YcK0.js} +2 -2
- package/dist/{probe-n6ZXxK8V.js → probe-3ovFAp3b.js} +3 -3
- package/dist/{probe.runtime-CN4bdPfZ.js → probe.runtime-BckHn3cJ.js} +1 -1
- package/dist/{provider-session.runtime-B9xe-Qaf.js → provider-session.runtime-BL2lHBH7.js} +3 -3
- package/dist/{provider-B11xwilq.js → provider-uKmmrDM4.js} +299 -136
- package/dist/provider.runtime-C-IkWF2w.js +2 -0
- package/dist/{realtime-session.runtime-CU8IQUS-.js → realtime-session.runtime-CGYm1t_0.js} +798 -448
- package/dist/{resolve-allowlist-common-BLoYaxEG.js → resolve-allowlist-common-sKIKy-cF.js} +3 -3
- package/dist/{resolve-channels-C2sT_n67.js → resolve-channels-CoiMlWy0.js} +4 -4
- package/dist/{resolve-users-CzpjLwjy.js → resolve-users-DJpiokfW.js} +5 -4
- package/dist/{retry-Cv4jCU5Z.js → retry-DQt1zDgH.js} +356 -214
- package/dist/{retry-after-DdLPmPoa.js → retry-after-BrLjLUJi.js} +2 -1
- package/dist/{runtime-CY4PRMF-.js → runtime-BHsdEdr5.js} +2 -2
- package/dist/{runtime-BHrTlFkf.js → runtime-Ghtfh5ZA.js} +151 -109
- package/dist/runtime-api.js +20 -20
- package/dist/{secret-config-contract-B3i6WxV5.js → secret-config-contract-DFu9hfU8.js} +14 -6
- package/dist/secret-contract-api.js +1 -1
- package/dist/{security-audit-BfJhAXZp.js → security-audit-DKfK-iPY.js} +10 -11
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/{security-audit.runtime-BVKF9VtY.js → security-audit.runtime-sKZyKgpx.js} +1 -1
- package/dist/{send-C49MFF9j.js → send-CZeWKUiA.js} +132 -100
- package/dist/{send.components-DKKAw5VX.js → send.components-BG5IDABj.js} +21 -15
- package/dist/{send.outbound-zam0TrZx.js → send.outbound-DHuFUL6W.js} +42 -63
- package/dist/{send.shared-JjljcV4O.js → send.shared-B0n_fWzu.js} +77 -149
- package/dist/{sender-identity-BJtfyise.js → sender-identity-B8Ncfi63.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-_5EcP4jW.js → shared-C3dKun_X.js} +24 -15
- package/dist/{subagent-hooks-DQzvOptn.js → subagent-hooks-ZoQXEI1E.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-C7yxaHWP.js → system-events-DFF_awl7.js} +2 -2
- package/dist/{target-resolver-vxIh6O3-.js → target-resolver-DLtHDwMK.js} +6 -5
- package/dist/targets-BObRyaKX.js +3 -0
- package/dist/{thread-bindings-DW5F9vat.js → thread-bindings-DKvsNjQR.js} +7 -6
- package/dist/{thread-bindings.manager-ByOtwjo_.js → thread-bindings.manager-pbbRT5gb.js} +38 -29
- package/dist/{thread-bindings.session-updates-CJb-BpPL.js → thread-bindings.session-updates-t6jeFB1-.js} +3 -2
- package/dist/{thread-bindings.state-D8OMdk4O.js → thread-bindings.state-DtgOqsbX.js} +34 -1
- package/dist/{threading-agH1T_6s.js → threading-BCx49X-6.js} +8 -6
- package/dist/{timeouts-B9cy6RvQ.js → timeouts-D86uWLt_.js} +1 -1
- package/dist/{transcripts-source-BR11iHA4.js → transcripts-source-Dc6Nnli5.js} +55 -7
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-Dc_YMY2e.js → typing-CuopV-Hi.js} +2 -2
- package/dist/{voice-runtime-DIeaa8fJ.js → voice-runtime-BQnILUbG.js} +492 -105
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/README.md +1 -1
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/conforms.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/package.json +3 -3
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubArray.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubObject.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubString.d.ts +2 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/README.md +1 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/buffer.buffer.d.ts +5 -5
- package/node_modules/@discordjs/voice/node_modules/@types/node/crypto.d.ts +2 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/http.d.ts +16 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/http2.d.ts +10 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/package.json +2 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/process.d.ts +52 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/quic.d.ts +210 -28
- package/node_modules/@discordjs/voice/node_modules/@types/node/sqlite.d.ts +6 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/test.d.ts +36 -0
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/node_modules/typebox/build/format/json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer.mjs +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/system/memory/assign.mjs +2 -1
- package/node_modules/typebox/build/system/memory/create.mjs +3 -4
- package/node_modules/typebox/build/system/memory/discard.mjs +2 -2
- package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
- package/node_modules/typebox/build/system/memory/update.mjs +3 -2
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/undici/docs/docs/api/Client.md +4 -0
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
- package/node_modules/undici/docs/docs/api/EventSource.md +4 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
- package/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
- package/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/undici/lib/dispatcher/agent.js +7 -2
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
- package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +43 -3
- package/node_modules/undici/lib/dispatcher/client.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
- package/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +10 -3
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
- package/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +91 -21
- package/node_modules/undici/lib/handler/cache-handler.js +29 -5
- package/node_modules/undici/lib/handler/decorator-handler.js +7 -1
- package/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
- package/node_modules/undici/lib/handler/redirect-handler.js +21 -4
- package/node_modules/undici/lib/handler/retry-handler.js +148 -30
- package/node_modules/undici/lib/interceptor/cache.js +65 -12
- package/node_modules/undici/lib/interceptor/decompress.js +115 -13
- package/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/undici/lib/interceptor/dns.js +7 -0
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/mock/mock-agent.js +13 -1
- package/node_modules/undici/lib/mock/mock-utils.js +11 -10
- package/node_modules/undici/lib/util/cache.js +45 -3
- package/node_modules/undici/lib/web/cookies/parse.js +150 -147
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
- package/node_modules/undici/lib/web/fetch/index.js +6 -0
- package/node_modules/undici/lib/web/fetch/request.js +2 -3
- package/node_modules/undici/lib/web/fetch/util.js +6 -1
- package/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/client.d.ts +10 -0
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/node_modules/undici/types/mock-agent.d.ts +11 -10
- package/node_modules/undici/types/socks5-proxy-agent.d.ts +2 -0
- package/openclaw.plugin.json +15 -8
- package/package.json +7 -6
- package/skills/discord/SKILL.md +1 -1
- package/dist/account-inspect-BDfKyuvL.js +0 -89
- package/dist/provider.runtime-DiYaHvOz.js +0 -2
- package/dist/sdk-runtime-4geQHtXc.js +0 -338
- package/dist/targets-CtTKvntJ.js +0 -3
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as createDiscordActionGate } from "./accounts-
|
|
3
|
-
import { g as notifyDiscordInboundEventOutboundPayloadSuccess, h as discordInboundEventDelivery, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-
|
|
4
|
-
import { a as sendDiscordComponentMessageLazy, i as resolveDiscordComponentSpec, n as buildDiscordPresentationPayload, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-
|
|
1
|
+
import { _ as normalizeDiscordOutboundTarget, c as createDiscordSendReceiptFromResults, i as hasDiscordMessageCreateAmbiguity, o as chunkDiscordTextWithMode, p as resolveDiscordReplyReference, s as createDiscordSendReceipt, t as canFallbackDiscordWebhookSend, u as toDiscordOutboundDeliveryResult } from "./retry-DQt1zDgH.js";
|
|
2
|
+
import { t as createDiscordActionGate } from "./accounts-CwJQoLjM.js";
|
|
3
|
+
import { g as notifyDiscordInboundEventOutboundPayloadSuccess, h as discordInboundEventDelivery, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-Q_HEusBQ.js";
|
|
4
|
+
import { a as sendDiscordComponentMessageLazy, i as resolveDiscordComponentSpec, n as buildDiscordPresentationPayload, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-Dn8SJWMS.js";
|
|
5
5
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
|
+
import { getReplyPayloadTtsSupplement, resolvePayloadMediaUrls, sendPayloadMediaSequenceOrFallback, sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
7
8
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
8
9
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
9
10
|
import { createReplyToFanout, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
10
11
|
import { attachChannelToResult, createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
|
|
11
|
-
import { getReplyPayloadTtsSupplement, resolvePayloadMediaUrls, sendPayloadMediaSequenceOrFallback, sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
12
12
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
13
13
|
import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
14
14
|
//#region extensions/discord/src/media-detection.ts
|
|
@@ -33,7 +33,8 @@ function normalizeMediaPathForExtension(mediaUrl) {
|
|
|
33
33
|
}
|
|
34
34
|
} catch {
|
|
35
35
|
const withoutHash = trimmed.split("#", 1)[0] ?? trimmed;
|
|
36
|
-
|
|
36
|
+
const withoutQuery = withoutHash.split("?", 1)[0] ?? withoutHash;
|
|
37
|
+
return normalizeLowercaseStringOrEmpty(withoutQuery);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
function isLikelyDiscordVideoMedia(mediaUrl) {
|
|
@@ -59,7 +60,7 @@ function normalizeDiscordApprovalPayload(payload) {
|
|
|
59
60
|
}
|
|
60
61
|
//#endregion
|
|
61
62
|
//#region extensions/discord/src/outbound-send-context.ts
|
|
62
|
-
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
63
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-CZeWKUiA.js").then((n) => n.t));
|
|
63
64
|
function resolveDiscordOutboundTarget(params) {
|
|
64
65
|
if (params.threadId == null) return params.to;
|
|
65
66
|
const threadId = normalizeOptionalStringifiedId(params.threadId) ?? "";
|
|
@@ -107,18 +108,19 @@ function createDiscordUnknownPayloadResult(target) {
|
|
|
107
108
|
})
|
|
108
109
|
};
|
|
109
110
|
}
|
|
110
|
-
function resolveDiscordDeliveryOptions(ctx, sendContext, reply = sendContext.resolveReply()) {
|
|
111
|
+
function resolveDiscordDeliveryOptions$1(ctx, sendContext, reply = sendContext.resolveReply()) {
|
|
111
112
|
return {
|
|
112
113
|
reply,
|
|
113
114
|
accountId: ctx.accountId ?? void 0,
|
|
114
115
|
silent: ctx.silent ?? void 0,
|
|
115
116
|
cfg: ctx.cfg,
|
|
116
|
-
onPlatformSendDispatch: ctx.onPlatformSendDispatch
|
|
117
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch,
|
|
118
|
+
assertPlatformSendAuthorized: ctx.assertDirectAdapterHandoff
|
|
117
119
|
};
|
|
118
120
|
}
|
|
119
121
|
function resolveDiscordFormattedDeliveryOptions(ctx, sendContext, reply = sendContext.resolveReply()) {
|
|
120
122
|
return {
|
|
121
|
-
...resolveDiscordDeliveryOptions(ctx, sendContext, reply),
|
|
123
|
+
...resolveDiscordDeliveryOptions$1(ctx, sendContext, reply),
|
|
122
124
|
...sendContext.formatting
|
|
123
125
|
};
|
|
124
126
|
}
|
|
@@ -175,7 +177,7 @@ async function sendDiscordOutboundPayload(params) {
|
|
|
175
177
|
try {
|
|
176
178
|
const voiceUrl = expectDefined(mediaUrls.at(0), "non-empty Discord voice media URLs");
|
|
177
179
|
lastResult = await sendContext.sendVoice(sendContext.target, voiceUrl, {
|
|
178
|
-
...resolveDiscordDeliveryOptions(ctx, sendContext, voiceReply),
|
|
180
|
+
...resolveDiscordDeliveryOptions$1(ctx, sendContext, voiceReply),
|
|
179
181
|
mediaAccess: ctx.mediaAccess,
|
|
180
182
|
mediaLocalRoots: ctx.mediaLocalRoots,
|
|
181
183
|
mediaReadFile: ctx.mediaReadFile
|
|
@@ -216,12 +218,12 @@ async function sendDiscordOutboundPayload(params) {
|
|
|
216
218
|
if (voiceFailure) throw voiceFailure.error;
|
|
217
219
|
return completeDelivery(lastResult);
|
|
218
220
|
}
|
|
221
|
+
const discordData = payload.channelData?.discord && typeof payload.channelData.discord === "object" && !Array.isArray(payload.channelData.discord) ? payload.channelData.discord : {};
|
|
222
|
+
const filename = normalizeOptionalString(discordData.filename);
|
|
219
223
|
const componentSpec = await resolveDiscordComponentSpec(payload);
|
|
220
224
|
if (!componentSpec) {
|
|
221
|
-
const discordData = payload.channelData?.discord && typeof payload.channelData.discord === "object" && !Array.isArray(payload.channelData.discord) ? payload.channelData.discord : {};
|
|
222
225
|
const nativeComponents = Array.isArray(discordData.components) ? discordData.components : void 0;
|
|
223
226
|
const embeds = Array.isArray(discordData.embeds) ? discordData.embeds : void 0;
|
|
224
|
-
const filename = normalizeOptionalString(discordData.filename);
|
|
225
227
|
if (nativeComponents || embeds?.length || filename) return completeDelivery(await sendPayloadMediaSequenceOrFallback({
|
|
226
228
|
text: payload.text ?? "",
|
|
227
229
|
mediaUrls,
|
|
@@ -256,12 +258,14 @@ async function sendDiscordOutboundPayload(params) {
|
|
|
256
258
|
sendNoMedia: async () => {
|
|
257
259
|
return await sendDiscordComponentMessageLazy(sendContext.target, componentSpec, {
|
|
258
260
|
...resolveDiscordFormattedDeliveryOptions(ctx, sendContext),
|
|
261
|
+
filename,
|
|
259
262
|
onDeliveryResult
|
|
260
263
|
});
|
|
261
264
|
},
|
|
262
265
|
send: async ({ text, mediaUrl, isFirst }) => {
|
|
263
266
|
if (isFirst) return await sendDiscordComponentMessageLazy(sendContext.target, componentSpec, {
|
|
264
267
|
...resolveDiscordMediaDeliveryOptions(ctx, sendContext, mediaUrl),
|
|
268
|
+
filename,
|
|
265
269
|
onDeliveryResult
|
|
266
270
|
});
|
|
267
271
|
return await sendContext.send(sendContext.target, text, {
|
|
@@ -276,29 +280,22 @@ async function sendDiscordOutboundPayload(params) {
|
|
|
276
280
|
//#region extensions/discord/src/outbound-adapter.ts
|
|
277
281
|
const DISCORD_TEXT_CHUNK_LIMIT = 2e3;
|
|
278
282
|
const log = createSubsystemLogger("discord/outbound");
|
|
279
|
-
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-
|
|
280
|
-
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-
|
|
281
|
-
function
|
|
282
|
-
const usernameRaw = normalizeOptionalString(params.identity?.name);
|
|
283
|
-
const fallbackUsername = normalizeOptionalString(params.binding.label) ?? params.binding.agentId;
|
|
283
|
+
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-DKvsNjQR.js").then((n) => n.t));
|
|
284
|
+
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-BG5IDABj.js").then((n) => n.i));
|
|
285
|
+
function resolveDiscordDeliveryOptions(params) {
|
|
284
286
|
return {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
+
onPlatformSendDispatch: params.onPlatformSendDispatch,
|
|
288
|
+
assertPlatformSendAuthorized: params.assertDirectAdapterHandoff,
|
|
289
|
+
onDeliveryResult: params.onDeliveryResult ? async (result) => params.onDeliveryResult?.(attachChannelToResult("discord", toDiscordOutboundDeliveryResult(result))) : void 0
|
|
287
290
|
};
|
|
288
291
|
}
|
|
289
292
|
async function maybeSendDiscordWebhookText(params) {
|
|
290
|
-
if (params.threadId == null) return null;
|
|
291
293
|
const threadId = normalizeOptionalStringifiedId(params.threadId) ?? "";
|
|
292
294
|
if (!threadId) return null;
|
|
293
295
|
const { getThreadBindingManager } = await loadDiscordThreadBindings();
|
|
294
|
-
const
|
|
295
|
-
if (!manager) return null;
|
|
296
|
-
const binding = manager.getByThreadId(threadId);
|
|
296
|
+
const binding = getThreadBindingManager(params.accountId ?? void 0)?.getByThreadId(threadId);
|
|
297
297
|
if (!binding?.webhookId || !binding?.webhookToken) return null;
|
|
298
|
-
const
|
|
299
|
-
identity: params.identity,
|
|
300
|
-
binding
|
|
301
|
-
});
|
|
298
|
+
const username = normalizeOptionalString(params.identity?.name) || normalizeOptionalString(binding.label) || binding.agentId || "";
|
|
302
299
|
const { sendWebhookMessageDiscord } = await loadDiscordSendRuntime();
|
|
303
300
|
return await sendWebhookMessageDiscord(params.text, {
|
|
304
301
|
webhookId: binding.webhookId,
|
|
@@ -307,9 +304,9 @@ async function maybeSendDiscordWebhookText(params) {
|
|
|
307
304
|
threadId: binding.threadId,
|
|
308
305
|
cfg: params.cfg,
|
|
309
306
|
replyTo: params.replyToId ?? void 0,
|
|
310
|
-
username:
|
|
311
|
-
avatarUrl:
|
|
312
|
-
|
|
307
|
+
username: truncateUtf16Safe(username, 80) || void 0,
|
|
308
|
+
avatarUrl: normalizeOptionalString(params.identity?.avatarUrl),
|
|
309
|
+
...resolveDiscordDeliveryOptions(params)
|
|
313
310
|
});
|
|
314
311
|
}
|
|
315
312
|
async function resolveDiscordOutboundMessageSend(params) {
|
|
@@ -332,10 +329,7 @@ async function resolveDiscordOutboundMessageSend(params) {
|
|
|
332
329
|
silent: params.silent ?? void 0,
|
|
333
330
|
cfg: params.cfg,
|
|
334
331
|
...resolveDiscordFormattingOptions({ formatting: params.formatting }),
|
|
335
|
-
|
|
336
|
-
await params.onDeliveryResult?.(attachChannelToResult("discord", toDiscordOutboundDeliveryResult(result)));
|
|
337
|
-
} : void 0,
|
|
338
|
-
onPlatformSendDispatch: params.onPlatformSendDispatch
|
|
332
|
+
...resolveDiscordDeliveryOptions(params)
|
|
339
333
|
}
|
|
340
334
|
};
|
|
341
335
|
}
|
|
@@ -373,42 +367,32 @@ const discordOutbound = {
|
|
|
373
367
|
...createAttachedChannelResultAdapter({
|
|
374
368
|
channel: "discord",
|
|
375
369
|
sendText: async (ctx) => {
|
|
376
|
-
if (!ctx.silent) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
threadId: ctx.threadId,
|
|
383
|
-
accountId: ctx.accountId,
|
|
384
|
-
identity: ctx.identity,
|
|
385
|
-
replyToId: ctx.replyToId,
|
|
386
|
-
onPlatformSendDispatch: ctx.onPlatformSendDispatch ? async () => {
|
|
387
|
-
webhookSelected = true;
|
|
388
|
-
await ctx.onPlatformSendDispatch?.();
|
|
389
|
-
} : void 0
|
|
390
|
-
});
|
|
391
|
-
if (webhookResult) return toDiscordOutboundDeliveryResult(webhookResult);
|
|
392
|
-
} catch (error) {
|
|
393
|
-
if (webhookSelected) throw error;
|
|
394
|
-
log.warn("discord webhook persona send failed; falling back to bot send", { error });
|
|
395
|
-
}
|
|
370
|
+
if (!ctx.silent) try {
|
|
371
|
+
const webhookResult = await maybeSendDiscordWebhookText(ctx);
|
|
372
|
+
if (webhookResult) return toDiscordOutboundDeliveryResult(webhookResult);
|
|
373
|
+
} catch (error) {
|
|
374
|
+
if (!canFallbackDiscordWebhookSend(error)) throw error;
|
|
375
|
+
log.warn("discord webhook persona send failed; falling back to bot send", { error });
|
|
396
376
|
}
|
|
397
377
|
const { send, target, options } = await resolveDiscordOutboundMessageSend(ctx);
|
|
398
378
|
return toDiscordOutboundDeliveryResult(await send(target, ctx.text, options));
|
|
399
379
|
},
|
|
400
380
|
sendMedia: async (ctx) => {
|
|
401
381
|
const { send, target, options } = await resolveDiscordOutboundMessageSend(ctx);
|
|
402
|
-
if (ctx.audioAsVoice && ctx.mediaUrl)
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
382
|
+
if (ctx.audioAsVoice && ctx.mediaUrl) {
|
|
383
|
+
const sendVoice = resolveOutboundSendDep(ctx.deps, "discordVoice") ?? (await loadDiscordSendRuntime()).sendVoiceMessageDiscord;
|
|
384
|
+
return toDiscordOutboundDeliveryResult(await sendVoice(target, ctx.mediaUrl, {
|
|
385
|
+
cfg: ctx.cfg,
|
|
386
|
+
reply: options.reply,
|
|
387
|
+
accountId: ctx.accountId ?? void 0,
|
|
388
|
+
silent: ctx.silent ?? void 0,
|
|
389
|
+
mediaAccess: ctx.mediaAccess,
|
|
390
|
+
mediaLocalRoots: ctx.mediaLocalRoots,
|
|
391
|
+
mediaReadFile: ctx.mediaReadFile,
|
|
392
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch,
|
|
393
|
+
assertPlatformSendAuthorized: ctx.assertDirectAdapterHandoff
|
|
394
|
+
}));
|
|
395
|
+
}
|
|
412
396
|
const mediaOptions = {
|
|
413
397
|
...options,
|
|
414
398
|
mediaUrl: ctx.mediaUrl,
|
|
@@ -433,7 +417,7 @@ const discordOutbound = {
|
|
|
433
417
|
}
|
|
434
418
|
return toDiscordOutboundDeliveryResult(await send(target, ctx.text, mediaOptions));
|
|
435
419
|
},
|
|
436
|
-
sendPoll: async ({ cfg, to, poll, content, accountId, threadId, silent, sessionKey, inboundEventKind, onPlatformSendDispatch }) => {
|
|
420
|
+
sendPoll: async ({ cfg, to, poll, content, accountId, threadId, silent, sessionKey, inboundEventKind, onPlatformSendDispatch, assertDirectAdapterHandoff }) => {
|
|
437
421
|
if (!createDiscordActionGate({
|
|
438
422
|
cfg,
|
|
439
423
|
accountId
|
|
@@ -448,7 +432,8 @@ const discordOutbound = {
|
|
|
448
432
|
threadId: threadId ?? void 0,
|
|
449
433
|
silent: silent ?? void 0,
|
|
450
434
|
cfg,
|
|
451
|
-
onPlatformSendDispatch
|
|
435
|
+
onPlatformSendDispatch,
|
|
436
|
+
assertPlatformSendAuthorized: assertDirectAdapterHandoff
|
|
452
437
|
});
|
|
453
438
|
discordInboundEventDelivery.notify({
|
|
454
439
|
sessionKey,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as readDiscordComponentSpec } from "./components-BimX47Mq.js";
|
|
2
|
+
import { resolveAskUserQuestionOptionIndices } from "openclaw/plugin-sdk/reply-payload";
|
|
2
3
|
import { createLazyRuntimeModule, createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
3
4
|
//#region extensions/discord/src/outbound-components.ts
|
|
4
5
|
const DISCORD_MESSAGE_COMPONENT_LIMIT = 40;
|
|
@@ -30,11 +31,11 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
|
-
const loadDiscordComponentSend = createLazyRuntimeNamedExport(() => import("./send.components-
|
|
34
|
+
const loadDiscordComponentSend = createLazyRuntimeNamedExport(() => import("./send.components-BG5IDABj.js").then((n) => n.i), "sendDiscordComponentMessage");
|
|
34
35
|
async function sendDiscordComponentMessageLazy(...args) {
|
|
35
36
|
return await (await loadDiscordComponentSend())(...args);
|
|
36
37
|
}
|
|
37
|
-
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-
|
|
38
|
+
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-BimX47Mq.js").then((n) => n.a));
|
|
38
39
|
function addPayloadTextFallback(spec, payload) {
|
|
39
40
|
return spec.text ? spec : {
|
|
40
41
|
...spec,
|
|
@@ -68,7 +69,7 @@ function isDiscordComponentSpecWithinMessageLimit(params) {
|
|
|
68
69
|
}) <= DISCORD_MESSAGE_COMPONENT_LIMIT;
|
|
69
70
|
}
|
|
70
71
|
async function buildDiscordPresentationPayload(params) {
|
|
71
|
-
const componentSpec = (await loadDiscordSharedInteractive()).buildDiscordPresentationComponents(params.presentation);
|
|
72
|
+
const componentSpec = (await loadDiscordSharedInteractive()).buildDiscordPresentationComponents(params.presentation, { questionOptionIndices: resolveAskUserQuestionOptionIndices(params.payload) });
|
|
72
73
|
if (!componentSpec) return null;
|
|
73
74
|
const includesMedia = Boolean(params.payload.mediaUrl || params.payload.mediaUrls?.some((mediaUrl) => mediaUrl));
|
|
74
75
|
if (!isDiscordComponentSpecWithinMessageLimit({
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { c as resolveDiscordAccount, r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-
|
|
4
|
-
import {
|
|
1
|
+
import { g as normalizeDiscordMessagingTarget, v as parseDiscordTarget } from "./retry-DQt1zDgH.js";
|
|
2
|
+
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-BimX47Mq.js";
|
|
3
|
+
import { c as resolveDiscordAccount, r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-CwJQoLjM.js";
|
|
4
|
+
import { n as resolveDiscordCommandOwnerEntries } from "./command-owners-D78sAoOz.js";
|
|
5
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BY-ve3yH.js";
|
|
5
6
|
import { ChannelType } from "discord-api-types/v10";
|
|
6
7
|
import { Type } from "typebox";
|
|
7
8
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -29,10 +30,8 @@ function normalizeDiscordApproverId(value) {
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
function resolveDiscordOwnerApprovers(cfg) {
|
|
32
|
-
const ownerAllowFrom = cfg.commands?.ownerAllowFrom;
|
|
33
|
-
if (!Array.isArray(ownerAllowFrom) || ownerAllowFrom.length === 0) return [];
|
|
34
33
|
return resolveApprovalApprovers({
|
|
35
|
-
explicit:
|
|
34
|
+
explicit: resolveDiscordCommandOwnerEntries(cfg),
|
|
36
35
|
normalizeApprover: (value) => normalizeDiscordApproverId(String(value))
|
|
37
36
|
});
|
|
38
37
|
}
|
|
@@ -43,8 +42,9 @@ function getDiscordExecApprovalApprovers(params) {
|
|
|
43
42
|
});
|
|
44
43
|
}
|
|
45
44
|
function isDiscordExecApprovalClientEnabled(params) {
|
|
45
|
+
const config = params.configOverride ?? resolveDiscordAccount(params).config.execApprovals;
|
|
46
46
|
return isChannelExecApprovalClientEnabledFromConfig({
|
|
47
|
-
enabled:
|
|
47
|
+
enabled: config?.enabled,
|
|
48
48
|
approverCount: getDiscordExecApprovalApprovers({
|
|
49
49
|
cfg: params.cfg,
|
|
50
50
|
accountId: params.accountId,
|
|
@@ -201,7 +201,9 @@ function withDiscordInboundEventDeliveryMetadata(payload, params) {
|
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
203
|
function notifyDiscordInboundEventOutboundPayloadSuccess(params) {
|
|
204
|
-
const
|
|
204
|
+
const channelData = asOptionalRecord(params.payload.channelData);
|
|
205
|
+
const discordData = asOptionalRecord(channelData?.discord);
|
|
206
|
+
const metadata = asOptionalRecord(discordData?.[DISCORD_INBOUND_EVENT_DELIVERY_KEY]);
|
|
205
207
|
if (!metadata) return;
|
|
206
208
|
discordInboundEventDelivery.notify({
|
|
207
209
|
sessionKey: normalizeOptionalString(metadata.sessionKey),
|
|
@@ -247,7 +249,22 @@ const localExecutionActions = /* @__PURE__ */ new Set([
|
|
|
247
249
|
function resolveDiscordActionExecutionMode({ action }) {
|
|
248
250
|
return localExecutionActions.has(action) ? "local" : "gateway";
|
|
249
251
|
}
|
|
250
|
-
|
|
252
|
+
function resolveDiscordThreadReplyDeliveryAlias(args) {
|
|
253
|
+
if (normalizeOptionalString(args.target) || normalizeOptionalString(args.to) || normalizeOptionalString(args.channelId)) return;
|
|
254
|
+
const threadId = normalizeOptionalString(args.threadId);
|
|
255
|
+
return threadId ? normalizeDiscordMessagingTarget(`channel:${threadId}`) : void 0;
|
|
256
|
+
}
|
|
257
|
+
function resolveDiscordThreadReplyTarget(args) {
|
|
258
|
+
const threadId = normalizeOptionalString(args.threadId);
|
|
259
|
+
const target = threadId !== void 0 ? `channel:${threadId}` : normalizeOptionalString(args.channelId) ?? normalizeOptionalString(args.to) ?? normalizeOptionalString(args.target);
|
|
260
|
+
return target ? normalizeDiscordMessagingTarget(target) : void 0;
|
|
261
|
+
}
|
|
262
|
+
function matchesCurrentDiscordThread(params) {
|
|
263
|
+
const requestedTarget = resolveDiscordThreadReplyTarget(params.args);
|
|
264
|
+
if (!requestedTarget) return false;
|
|
265
|
+
return [params.toolContext.currentChannelId, params.toolContext.currentMessagingTarget].some((currentTarget) => currentTarget !== void 0 && normalizeDiscordMessagingTarget(currentTarget) === requestedTarget);
|
|
266
|
+
}
|
|
267
|
+
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./channel-actions.runtime-DS8pXo0S.js"));
|
|
251
268
|
function listDiscoverableDiscordAccounts(cfg) {
|
|
252
269
|
return listDiscordAccountIds(cfg).map((accountId) => inspectDiscordAccount({
|
|
253
270
|
cfg,
|
|
@@ -344,13 +361,29 @@ function describeDiscordMessageTool({ cfg, accountId }) {
|
|
|
344
361
|
actions.add("ban");
|
|
345
362
|
}
|
|
346
363
|
if (discovery.isEnabled("presence", false)) actions.add("set-presence");
|
|
364
|
+
const schema = [];
|
|
365
|
+
if (actions.has("react")) schema.push({
|
|
366
|
+
actions: ["react", "reactions"],
|
|
367
|
+
properties: { emoji: Type.Optional(Type.String({ description: `Unicode emoji or custom name:id (also <:name:id> / <a:name:id>).${actions.has("emoji-list") ? " Use action:\"emoji-list\" for server emojis." : ""}` })) }
|
|
368
|
+
});
|
|
369
|
+
if (actions.has("send")) schema.push({
|
|
370
|
+
actions: ["send"],
|
|
371
|
+
visibility: "all-configured",
|
|
372
|
+
properties: { components: Type.Optional(Type.Object({
|
|
373
|
+
blocks: Type.Optional(Type.Array(Type.Unknown(), { description: "Discord Components V2 blocks such as text, buttons, selects, media, containers, and separators." })),
|
|
374
|
+
modal: Type.Optional(Type.Object({}, {
|
|
375
|
+
additionalProperties: true,
|
|
376
|
+
description: "Optional Discord modal triggered by generated components."
|
|
377
|
+
}))
|
|
378
|
+
}, {
|
|
379
|
+
additionalProperties: true,
|
|
380
|
+
description: "Discord Components V2 payload for send actions. Accepts the same object consumed by the Discord components adapter."
|
|
381
|
+
})) }
|
|
382
|
+
});
|
|
347
383
|
return {
|
|
348
384
|
actions: Array.from(actions),
|
|
349
385
|
capabilities: ["presentation"],
|
|
350
|
-
|
|
351
|
-
properties: { emoji: Type.Optional(Type.String({ description: `Unicode emoji or custom name:id (also <:name:id> / <a:name:id>).${actions.has("emoji-list") ? " Use action:\"emoji-list\" for server emojis." : ""}` })) },
|
|
352
|
-
actions: ["react", "reactions"]
|
|
353
|
-
} } : {}
|
|
386
|
+
schema
|
|
354
387
|
};
|
|
355
388
|
}
|
|
356
389
|
const discordMessageActions = {
|
|
@@ -358,6 +391,15 @@ const discordMessageActions = {
|
|
|
358
391
|
resolveExecutionMode: resolveDiscordActionExecutionMode,
|
|
359
392
|
describeMessageTool: describeDiscordMessageTool,
|
|
360
393
|
supportsAction: ({ action }) => action !== "poll",
|
|
394
|
+
messageActionTargetAliases: { "thread-reply": {
|
|
395
|
+
aliases: ["threadId"],
|
|
396
|
+
deliveryTargetAliases: ["threadId"],
|
|
397
|
+
resolveDeliveryTarget: ({ args }) => resolveDiscordThreadReplyDeliveryAlias(args),
|
|
398
|
+
matchesCurrentConversation: ({ args, toolContext }) => matchesCurrentDiscordThread({
|
|
399
|
+
args,
|
|
400
|
+
toolContext
|
|
401
|
+
})
|
|
402
|
+
} },
|
|
361
403
|
requiresTrustedRequesterSender: ({ action, toolContext }) => Boolean(toolContext) && isTrustedRequesterGuildAdminAction(action),
|
|
362
404
|
extractToolSend: ({ args }) => {
|
|
363
405
|
const action = normalizeOptionalString(args.action) ?? "";
|
|
@@ -374,7 +416,7 @@ const discordMessageActions = {
|
|
|
374
416
|
sessionKey: ctx.sessionKey,
|
|
375
417
|
inboundEventKind: ctx.inboundEventKind
|
|
376
418
|
});
|
|
377
|
-
const rawComponents = ctx.params.components;
|
|
419
|
+
const rawComponents = coerceDiscordComponentParam(ctx.params.components);
|
|
378
420
|
if (typeof rawComponents === "function") return null;
|
|
379
421
|
const componentSpec = rawComponents && typeof rawComponents === "object" && !Array.isArray(rawComponents) ? readDiscordComponentSpec(rawComponents) : void 0;
|
|
380
422
|
const nativeComponents = Array.isArray(rawComponents) ? rawComponents : void 0;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { l as resolveDiscordAccountAllowFrom } from "./accounts-
|
|
2
|
-
import { c as resolveDiscordChannelConfigWithFallback, d as
|
|
1
|
+
import { l as resolveDiscordAccountAllowFrom } from "./accounts-CwJQoLjM.js";
|
|
2
|
+
import { c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordGuildEntry, f as resolveDiscordMemberAccessState, n as isDiscordGroupAllowedByPolicy, r as normalizeDiscordAllowList, t as allowListMatches } from "./allow-list-DBTtR2dz.js";
|
|
3
|
+
import { t as resolveDiscordCommandOwnerAllowFrom } from "./command-owners-D78sAoOz.js";
|
|
3
4
|
import { resolveCommandAuthorizedFromAuthorizers } from "openclaw/plugin-sdk/command-auth-native";
|
|
4
5
|
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
5
6
|
//#region extensions/discord/src/voice/access.ts
|
|
@@ -9,11 +10,12 @@ async function authorizeDiscordVoiceIngress(params) {
|
|
|
9
10
|
groupPolicy: params.discordConfig.groupPolicy,
|
|
10
11
|
defaultGroupPolicy: params.cfg.channels?.defaults?.groupPolicy
|
|
11
12
|
}).groupPolicy;
|
|
13
|
+
const guild = params.guild ?? {
|
|
14
|
+
id: params.guildId,
|
|
15
|
+
...params.guildName ? { name: params.guildName } : {}
|
|
16
|
+
};
|
|
12
17
|
const guildInfo = resolveDiscordGuildEntry({
|
|
13
|
-
guild
|
|
14
|
-
id: params.guildId,
|
|
15
|
-
...params.guildName ? { name: params.guildName } : {}
|
|
16
|
-
},
|
|
18
|
+
guild,
|
|
17
19
|
guildId: params.guildId,
|
|
18
20
|
guildEntries: params.discordConfig.guilds
|
|
19
21
|
});
|
|
@@ -53,7 +55,7 @@ async function authorizeDiscordVoiceIngress(params) {
|
|
|
53
55
|
sender: params.sender,
|
|
54
56
|
allowNameMatching: false
|
|
55
57
|
});
|
|
56
|
-
const admissionAllowList = normalizeDiscordAllowList(params.admissionAllowFrom ?? params.discordConfig.allowFrom
|
|
58
|
+
const admissionAllowList = normalizeDiscordAllowList(params.admissionAllowFrom ?? params.discordConfig.allowFrom, [
|
|
57
59
|
"discord:",
|
|
58
60
|
"user:",
|
|
59
61
|
"pk:"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sn as __exportAll } from "./retry-DQt1zDgH.js";
|
|
2
2
|
import { readProviderJsonObjectResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
3
3
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
4
4
|
import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
5
5
|
//#region extensions/discord/src/pluralkit.ts
|
|
6
6
|
var pluralkit_exports = /* @__PURE__ */ __exportAll({ fetchPluralKitMessageInfo: () => fetchPluralKitMessageInfo });
|
|
7
7
|
const PLURALKIT_API_BASE = "https://api.pluralkit.me/v2";
|
|
8
|
-
const PLURALKIT_ERROR_BODY_LIMIT_BYTES =
|
|
8
|
+
const PLURALKIT_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
9
9
|
const PLURALKIT_LOOKUP_TIMEOUT_MS = 1e4;
|
|
10
10
|
async function fetchPluralKitMessageInfo(params) {
|
|
11
11
|
if (!params.config?.enabled) return null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { m as normalizeDiscordToken } from "./accounts-
|
|
2
|
-
import { n as DiscordApiError, r as fetchDiscord } from "./api-
|
|
1
|
+
import { m as normalizeDiscordToken } from "./accounts-CwJQoLjM.js";
|
|
2
|
+
import { n as DiscordApiError, r as fetchDiscord } from "./api-BfmEP6wp.js";
|
|
3
3
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
5
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
@@ -7,7 +7,7 @@ import { fetchWithTimeout, runChannelProbe } from "openclaw/plugin-sdk/text-util
|
|
|
7
7
|
//#region extensions/discord/src/probe.ts
|
|
8
8
|
const DISCORD_API_BASE = "https://discord.com/api/v10";
|
|
9
9
|
const DISCORD_PROBE_GET_ME_LABEL = "discord.probe.getMe";
|
|
10
|
-
const DISCORD_PROBE_JSON_MAX_BYTES =
|
|
10
|
+
const DISCORD_PROBE_JSON_MAX_BYTES = 16777216;
|
|
11
11
|
const DISCORD_PROBE_COMPLETION_RESERVE_MAX_MS = 25;
|
|
12
12
|
const DISCORD_APP_FLAG_GATEWAY_PRESENCE = 4096;
|
|
13
13
|
const DISCORD_APP_FLAG_GATEWAY_PRESENCE_LIMITED = 8192;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as probeDiscordApplicationId, i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
1
|
+
import { a as probeDiscordApplicationId, i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-3ovFAp3b.js";
|
|
2
2
|
export { fetchDiscordApplicationId, fetchDiscordApplicationSummary, parseApplicationIdFromToken, probeDiscord, probeDiscordApplicationId, resolveDiscordPrivilegedIntentsFromFlags };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-
|
|
2
|
-
import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-
|
|
3
|
-
import { t as createDiscordMessageHandler } from "./message-handler-
|
|
1
|
+
import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-pbbRT5gb.js";
|
|
2
|
+
import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-DKvsNjQR.js";
|
|
3
|
+
import { t as createDiscordMessageHandler } from "./message-handler-DhgBabyU.js";
|
|
4
4
|
import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
|
|
5
5
|
import { getAcpSessionManager, isAcpRuntimeError } from "openclaw/plugin-sdk/acp-runtime";
|
|
6
6
|
export { createDiscordMessageHandler, createNoopThreadBindingManager, createThreadBindingManager, getAcpSessionManager, isAcpRuntimeError, reconcileAcpThreadBindingsOnStartup, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled };
|