@openclaw/discord 2026.11.7 → 2026.11.9
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-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-bB4eKcGl.mjs} +9 -10
- package/dist/.setup/{approval-message-updates-DKsCfxSW.mjs → approval-message-updates-DqOXxPss.mjs} +3 -4
- package/dist/.setup/{audit-BL6EoUun.mjs → audit-D1UISAXW.mjs} +6 -7
- package/dist/.setup/{channel-access-9cyzozUP.mjs → channel-access-DhJhVrdZ.mjs} +1 -2
- package/dist/.setup/{channel-DdI2l55_.mjs → channel-i4V5w1Nh.mjs} +35 -41
- package/dist/.setup/{channel.setup-kNWMxlgu.mjs → channel.setup-BrGEJ0Ia.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-DeCLO9w0.mjs} +10 -16
- package/dist/.setup/{components.base-CiS0h_XP.mjs → components.base-C5sAPHe4.mjs} +1 -2
- package/dist/.setup/{config-schema-BNKN1cu5.mjs → config-schema-GX2yDgIH.mjs} +3 -5
- package/dist/.setup/{conversation-binding-route-K_jFbvi5.mjs → conversation-binding-route-CHCfhsCl.mjs} +2 -3
- package/dist/.setup/{directory-config-Ble81PWH.mjs → directory-config-BXJuh9-J.mjs} +3 -4
- package/dist/.setup/{directory-live-CY2-qrHI.mjs → directory-live-dzJ14-DT.mjs} +9 -64
- package/dist/.setup/{discord-BRVFhk09.mjs → discord-BGkLzt2b.mjs} +93 -72
- package/dist/.setup/{doctor-RqH-6JB0.mjs → doctor-DBBXoP9w.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-Dx2N-4A6.mjs} +11 -11
- package/dist/.setup/{handle-action.guild-admin-CqBx_3mG.mjs → handle-action.guild-admin-CGzsE3bM.mjs} +7 -5
- package/dist/.setup/{listeners-DnHLrLIN.mjs → listeners-DHjDOlXW.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-OqhwO2Il.mjs} +11 -15
- package/dist/.setup/{message-handler.preflight-83tpEdBG.mjs → message-handler.preflight-DaqozzfW.mjs} +20 -43
- package/dist/.setup/{message-handler.preflight-pluralkit-Dhcx7Ifz.mjs → message-handler.preflight-pluralkit-CPWdqrEU.mjs} +10 -14
- package/dist/.setup/{message-handler.process-BC-wNZwK.mjs → message-handler.process-C6ETXKq2.mjs} +26 -34
- package/dist/.setup/{outbound-payload-CK3_bDvK.mjs → outbound-payload-DOFjmMNE.mjs} +9 -11
- package/dist/.setup/{outbound-session-route-Ay_DnOOl.mjs → outbound-session-route-CzL157kC.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-BcSZ6vqo.mjs} +110 -186
- package/dist/.setup/{provider-session.runtime-3cZpps3H.mjs → provider-session.runtime-CxGNqH7Q.mjs} +3 -3
- package/dist/.setup/provider.runtime-DPhNybGw.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-Carw2Z1J.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-BMgTyuwg.mjs → runtime-B-PgPsGR.mjs} +4 -6
- package/dist/.setup/{runtime--HZ9r3tF.mjs → runtime-BJxDx_zr.mjs} +49 -47
- 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-BQtMCED2.mjs} +19 -28
- package/dist/.setup/{send.components-CtLtE0yD.mjs → send.components-BTjOU5BX.mjs} +11 -14
- package/dist/.setup/{send.outbound-D58xXPgs.mjs → send.outbound-izfb48w-.mjs} +10 -16
- package/dist/.setup/{send.receipt-DLOV4qx6.mjs → send.receipt-D0vpuJMr.mjs} +64 -17
- package/dist/.setup/{send.shared-B_KKRrD7.mjs → send.shared-BVJkIe93.mjs} +15 -20
- 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-DCiNtEra.mjs +2 -0
- package/dist/.setup/{shared-Dv2DamaK.mjs → shared-djlPz0hY.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-BTmMGFYh.mjs} +3 -4
- package/dist/.setup/{system-events-Dlzp9Jcj.mjs → system-events-LN3PXCia.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-C98DQ-sp.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-ESkVljSW.mjs} +7 -10
- package/dist/.setup/{thread-bindings.manager-CWJKirn1.mjs → thread-bindings.manager-BG7MMT7H.mjs} +15 -20
- package/dist/.setup/{thread-bindings.session-updates-DzJrXc4w.mjs → thread-bindings.session-updates-Ddn14oJa.mjs} +6 -10
- package/dist/.setup/{threading-BbsPuT5G.mjs → threading-BzxVQcv8.mjs} +5 -7
- package/dist/.setup/{timeouts-cIxzatmv.mjs → timeouts-CT9hnmo4.mjs} +1 -2
- package/dist/.setup/{transcripts-source-DIW1fU_P.mjs → transcripts-source-a1btN-pC.mjs} +20 -33
- package/dist/.setup/{typing-CNlSKY5S.mjs → typing-DAv4S2fI.mjs} +2 -3
- package/dist/.setup/{voice-runtime-oJ6BZs5D.mjs → voice-runtime-BI76hQQH.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 +9 -13
- package/dist/api.js +21 -22
- 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 +5 -7
- package/dist/index.js +1 -2
- 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 +2 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +8 -14
- 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/package.json +4 -4
- package/dist/.setup/provider.runtime-tmkt3QOg.mjs +0 -1
- package/dist/.setup/setup-plugin-api-ty5RJrMy.mjs +0 -2
package/dist/.setup/{provider-session.runtime-3cZpps3H.mjs → provider-session.runtime-CxGNqH7Q.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as createNoopThreadBindingManager, t as createThreadBindingManager } from "./thread-bindings.manager-
|
|
2
|
-
import { l as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-
|
|
3
|
-
import { t as createDiscordMessageHandler } from "./message-handler-
|
|
1
|
+
import { i as createNoopThreadBindingManager, t as createThreadBindingManager } from "./thread-bindings.manager-BG7MMT7H.mjs";
|
|
2
|
+
import { l as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-ESkVljSW.mjs";
|
|
3
|
+
import { t as createDiscordMessageHandler } from "./message-handler-OqhwO2Il.mjs";
|
|
4
4
|
import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
|
|
5
5
|
import { getAcpSessionManager, isAcpRuntimeError, rethrowIncognitoSessionError } from "openclaw/plugin-sdk/acp-runtime";
|
|
6
6
|
export { createDiscordMessageHandler, createNoopThreadBindingManager, createThreadBindingManager, getAcpSessionManager, isAcpRuntimeError, reconcileAcpThreadBindingsOnStartup, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled, rethrowIncognitoSessionError };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as monitorDiscordProvider } from "./provider-BcSZ6vqo.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { danger } from "openclaw/plugin-sdk/runtime-env";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { makeProxyFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
4
|
-
|
|
4
|
+
// extensions/discord/src/proxy-fetch.ts
|
|
5
5
|
function resolveDiscordProxyFetchForAccount(account, cfg) {
|
|
6
6
|
return withValidatedDiscordProxy(normalizeOptionalString(account.config.proxy) ?? normalizeOptionalString(cfg?.channels?.discord?.proxy), void 0, makeProxyFetch);
|
|
7
7
|
}
|
|
@@ -26,5 +26,4 @@ function validateDiscordProxyUrl(proxyUrl) {
|
|
|
26
26
|
if (!["http:", "https:"].includes(parsed.protocol)) throw new Error("Proxy URL must use http or https");
|
|
27
27
|
return proxyUrl;
|
|
28
28
|
}
|
|
29
|
-
//#endregion
|
|
30
29
|
export { validateDiscordProxyUrl as n, withValidatedDiscordProxy as r, resolveDiscordProxyFetchForAccount as t };
|
package/dist/.setup/{realtime-session.runtime-BRYpjS9P.mjs → realtime-session.runtime-Carw2Z1J.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as setDiscordAudioOutputStatus, h as restoreDiscordAudioError, l as createDiscordPcmToRealtimeConverter, m as getDiscordAudioOutputStatus, p as DiscordAudioOutputStatus } from "./receive-recovery-
|
|
2
|
-
import { t as resolveDiscordOutputAudioDelta } from "./output-activity-
|
|
3
|
-
import { n as discordRealtimeVoiceSecretOwnerId } from "./secret-config-contract-
|
|
4
|
-
import { y as logVoiceVerbose } from "./provider-
|
|
5
|
-
import { a as maybeControlDiscordVoiceAgentRun, i as logDiscordVoiceAgentControlResult, n as formatVoiceIngressPrompt, r as handleDiscordVoiceAgentControlToolCall, t as DiscordRealtimeRecording } from "./voice-runtime-
|
|
1
|
+
import { _ as setDiscordAudioOutputStatus, h as restoreDiscordAudioError, l as createDiscordPcmToRealtimeConverter, m as getDiscordAudioOutputStatus, p as DiscordAudioOutputStatus } from "./receive-recovery-DV_v5ROf.mjs";
|
|
2
|
+
import { t as resolveDiscordOutputAudioDelta } from "./output-activity-CDgs2s3O.mjs";
|
|
3
|
+
import { n as discordRealtimeVoiceSecretOwnerId } from "./secret-config-contract-CP6teHec.mjs";
|
|
4
|
+
import { y as logVoiceVerbose } from "./provider-BcSZ6vqo.mjs";
|
|
5
|
+
import { a as maybeControlDiscordVoiceAgentRun, i as logDiscordVoiceAgentControlResult, n as formatVoiceIngressPrompt, r as handleDiscordVoiceAgentControlToolCall, t as DiscordRealtimeRecording } from "./voice-runtime-BI76hQQH.mjs";
|
|
6
6
|
import { MessageChannel } from "node:worker_threads";
|
|
7
7
|
import { formatErrorMessage, readErrorName, toErrorObject, toStringifiedError } from "openclaw/plugin-sdk/error-runtime";
|
|
8
8
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -13,7 +13,7 @@ import { sliceUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
13
13
|
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
14
14
|
import { REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME, REALTIME_VOICE_AGENT_CONTROL_TOOL, REALTIME_VOICE_AGENT_CONTROL_TOOL_NAME, REALTIME_VOICE_AUDIO_FORMAT_PCM16_24KHZ, buildRealtimeVoiceAgentErrorProviderResult, buildRealtimeVoiceSessionInstructions, buildRealtimeVoiceSpeakExactMessage, canonicalizeRealtimeVoiceProviderId, classifyRealtimeVoiceConsultToolCall, classifySkippableRealtimeVoiceConsultTranscript, createRealtimeVoiceAgentTalkbackQueue, createRealtimeVoiceOutputActivityTracker, createRealtimeVoiceSessionHarness, isRealtimeVoiceAudioAudible, isRealtimeVoiceWakeNameRequired, matchRealtimeVoiceActivationName, matchRealtimeVoiceConsultQuestions, projectInternalRealtimeVoicePublicConfig, realtimeVoiceAudioDurationMs, registerRealtimeVoiceSelection, resolveConfiguredRealtimeVoiceProviderAsync, resolveRealtimeVoiceAgentConsultTools, resolveRealtimeVoiceBargeIn, resolveRealtimeVoiceInterruptResponseOnInputAudio, resolveRealtimeVoiceMinBargeInAudioEndMs, resolveRealtimeVoiceSessionPolicy } from "openclaw/plugin-sdk/realtime-voice";
|
|
15
15
|
import { assertSecretOwnerAvailable, isSecretOwnerAvailable } from "openclaw/plugin-sdk/channel-secret-owner-runtime";
|
|
16
|
-
|
|
16
|
+
// extensions/discord/src/voice/realtime-player.ts
|
|
17
17
|
/** Room-level policy stays on main; the worker owns the physical player and FIFO. */
|
|
18
18
|
var DiscordRealtimePlayer = class {
|
|
19
19
|
constructor(audio) {
|
|
@@ -77,8 +77,7 @@ var DiscordRealtimePlayer = class {
|
|
|
77
77
|
this.audio.send({ type: "output-shutdown" });
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
-
|
|
81
|
-
//#region extensions/discord/src/voice/realtime-speaker-config.ts
|
|
80
|
+
// extensions/discord/src/voice/realtime-speaker-config.ts
|
|
82
81
|
/** Prepare shared provider credentials once before any speaker starts capturing audio. */
|
|
83
82
|
async function prepareDiscordRealtimeProvider(params) {
|
|
84
83
|
const { realtimeConfig, isAgentProxy } = params;
|
|
@@ -179,8 +178,7 @@ function resolveDiscordRealtimeSpeakerConfig(params) {
|
|
|
179
178
|
resolvedVoice: normalizeOptionalString(resolved.providerConfig.voice)
|
|
180
179
|
};
|
|
181
180
|
}
|
|
182
|
-
|
|
183
|
-
//#region extensions/discord/src/voice/log-preview.ts
|
|
181
|
+
// extensions/discord/src/voice/log-preview.ts
|
|
184
182
|
const DISCORD_REALTIME_INTERRUPTION_MESSAGES = /* @__PURE__ */ new Map([
|
|
185
183
|
["client:response.cancel", "interrupt requested"],
|
|
186
184
|
["client:conversation.item.truncate.skipped", "interrupt ignored"],
|
|
@@ -195,8 +193,7 @@ function formatRealtimeInfoLog(event) {
|
|
|
195
193
|
const detail = event.detail ? ` ${event.detail}` : "";
|
|
196
194
|
return `discord voice: realtime lifecycle ${event.direction}:${event.type}${detail}`;
|
|
197
195
|
}
|
|
198
|
-
|
|
199
|
-
//#region extensions/discord/src/voice/realtime-transcript.ts
|
|
196
|
+
// extensions/discord/src/voice/realtime-transcript.ts
|
|
200
197
|
const PARTIAL_TRANSCRIPT_MAX_CHARS = 240;
|
|
201
198
|
function mergeRealtimePartialTranscript(previous, next) {
|
|
202
199
|
const trimmed = next.trim();
|
|
@@ -204,8 +201,7 @@ function mergeRealtimePartialTranscript(previous, next) {
|
|
|
204
201
|
const merged = trimmed.startsWith(previous) ? trimmed : `${previous}${next}`;
|
|
205
202
|
return sliceUtf16Safe(merged, 0, PARTIAL_TRANSCRIPT_MAX_CHARS);
|
|
206
203
|
}
|
|
207
|
-
|
|
208
|
-
//#region extensions/discord/src/voice/realtime-turns.ts
|
|
204
|
+
// extensions/discord/src/voice/realtime-turns.ts
|
|
209
205
|
const logger$4 = createSubsystemLogger("discord/voice");
|
|
210
206
|
const DISCORD_REALTIME_WAKE_NAME_FOLLOWUP_TTL_MS = 1e4;
|
|
211
207
|
const REALTIME_PCM16_BYTES_PER_SAMPLE = 2;
|
|
@@ -392,8 +388,7 @@ var DiscordRealtimeTurns = class {
|
|
|
392
388
|
function isDiscordRealtimeSpeakerContext(value) {
|
|
393
389
|
return Boolean(value) && typeof value === "object" && typeof value.userId === "string" && typeof value.senderIsOwner === "boolean" && typeof value.speakerLabel === "string";
|
|
394
390
|
}
|
|
395
|
-
|
|
396
|
-
//#region extensions/discord/src/voice/realtime-consults.ts
|
|
391
|
+
// extensions/discord/src/voice/realtime-consults.ts
|
|
397
392
|
const logger$3 = createSubsystemLogger("discord/voice");
|
|
398
393
|
const DISCORD_REALTIME_TALKBACK_DEBOUNCE_MS = 350;
|
|
399
394
|
const DISCORD_REALTIME_FALLBACK_TEXT = "I hit an error while checking that. Please try again.";
|
|
@@ -750,8 +745,7 @@ var DiscordRealtimeConsults = class {
|
|
|
750
745
|
this.params.harness.forcedConsults.clear();
|
|
751
746
|
}
|
|
752
747
|
};
|
|
753
|
-
|
|
754
|
-
//#region extensions/discord/src/voice/realtime-output.ts
|
|
748
|
+
// extensions/discord/src/voice/realtime-output.ts
|
|
755
749
|
/** Main retains provider item identity; physical output state belongs to the worker. */
|
|
756
750
|
var DiscordRealtimeOutput = class {
|
|
757
751
|
constructor(params) {
|
|
@@ -890,8 +884,7 @@ var DiscordRealtimeOutput = class {
|
|
|
890
884
|
this.params.onClose(this, reason);
|
|
891
885
|
}
|
|
892
886
|
};
|
|
893
|
-
|
|
894
|
-
//#region extensions/discord/src/voice/realtime-playback.ts
|
|
887
|
+
// extensions/discord/src/voice/realtime-playback.ts
|
|
895
888
|
const logger$2 = createSubsystemLogger("discord/voice");
|
|
896
889
|
const DISCORD_REALTIME_CONTROL_SPEECH_DEDUPE_MS = 5e3;
|
|
897
890
|
const DISCORD_REALTIME_MAX_RETAINED_RESPONSES = 32;
|
|
@@ -1295,8 +1288,7 @@ var DiscordRealtimePlayback = class {
|
|
|
1295
1288
|
this.drainQueuedExactSpeechMessages();
|
|
1296
1289
|
}
|
|
1297
1290
|
};
|
|
1298
|
-
|
|
1299
|
-
//#region extensions/discord/src/voice/realtime-speaker-session.ts
|
|
1291
|
+
// extensions/discord/src/voice/realtime-speaker-session.ts
|
|
1300
1292
|
const logger$1 = createSubsystemLogger("discord/voice");
|
|
1301
1293
|
const DISCORD_REALTIME_DUPLICATE_ERROR_SUPPRESS_MS = 6e4;
|
|
1302
1294
|
const discordRealtimeTalkPayload = () => ({});
|
|
@@ -1722,8 +1714,7 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1722
1714
|
this.lastRealtimeError.suppressed = 0;
|
|
1723
1715
|
}
|
|
1724
1716
|
};
|
|
1725
|
-
|
|
1726
|
-
//#region extensions/discord/src/voice/realtime-session.runtime.ts
|
|
1717
|
+
// extensions/discord/src/voice/realtime-session.runtime.ts
|
|
1727
1718
|
const logger = createSubsystemLogger("discord/voice");
|
|
1728
1719
|
const MAX_REALTIME_SPEAKERS = 8;
|
|
1729
1720
|
const REALTIME_SPEAKER_IDLE_MS = 6e4;
|
|
@@ -2060,5 +2051,4 @@ var DiscordRealtimeVoiceSession = class {
|
|
|
2060
2051
|
logger.info(`discord voice: realtime speaker retired user=${speaker.userId} reason=${reason}${reason === "input-timeout" ? "; idle speaker input expired; speak again to reconnect" : ""}`);
|
|
2061
2052
|
}
|
|
2062
2053
|
};
|
|
2063
|
-
//#endregion
|
|
2064
2054
|
export { DiscordRealtimeVoiceSession };
|
|
@@ -7,7 +7,7 @@ import { resolveFfmpegBin } from "openclaw/plugin-sdk/media-runtime";
|
|
|
7
7
|
import { createStreamingPcmResampler } from "openclaw/plugin-sdk/realtime-voice-provider";
|
|
8
8
|
import { logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
9
9
|
import { resolvePreferredOpenClawTmpDir, tempWorkspace } from "openclaw/plugin-sdk/temp-path";
|
|
10
|
-
|
|
10
|
+
// extensions/discord/src/voice/audio-worker-protocol.ts
|
|
11
11
|
const DISCORD_AUDIO_OUTPUT_STATUS = 1;
|
|
12
12
|
const DiscordAudioOutputStatus = {
|
|
13
13
|
Buffering: 0n,
|
|
@@ -41,8 +41,7 @@ function serializeDiscordAudioError(error) {
|
|
|
41
41
|
function restoreDiscordAudioError(error) {
|
|
42
42
|
return Object.assign(new Error(error.message), error);
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
//#region extensions/discord/src/voice/audio.ts
|
|
44
|
+
// extensions/discord/src/voice/audio.ts
|
|
46
45
|
const SAMPLE_RATE = 48e3;
|
|
47
46
|
const CHANNELS = 2;
|
|
48
47
|
const BIT_DEPTH = 16;
|
|
@@ -379,8 +378,7 @@ async function writeVoiceWavFile(chunks) {
|
|
|
379
378
|
throw error;
|
|
380
379
|
}
|
|
381
380
|
}
|
|
382
|
-
|
|
383
|
-
//#region extensions/discord/src/voice/receive-recovery.ts
|
|
381
|
+
// extensions/discord/src/voice/receive-recovery.ts
|
|
384
382
|
const DECRYPT_FAILURE_WINDOW_MS = 3e4;
|
|
385
383
|
const DECRYPT_FAILURE_RECONNECT_THRESHOLD = 3;
|
|
386
384
|
const DECRYPT_FAILURE_MARKER = "DecryptionFailed(";
|
|
@@ -462,5 +460,4 @@ function enableDaveReceivePassthrough(params) {
|
|
|
462
460
|
onWarn(`discord voice: failed to enable DAVE passthrough guild=${target.guildId} channel=${target.channelId} reason=${reason}`);
|
|
463
461
|
}
|
|
464
462
|
}
|
|
465
|
-
//#endregion
|
|
466
463
|
export { setDiscordAudioOutputStatus as _, recoverDaveZeroTransition as a, createDiscordOpusPlaybackStream as c, decodeOpusStreamChunks as d, writeVoiceWavFile as f, serializeDiscordAudioError as g, restoreDiscordAudioError as h, noteVoiceDecryptFailure as i, createDiscordPcmToRealtimeConverter as l, getDiscordAudioOutputStatus as m, analyzeVoiceReceiveError as n, resetVoiceReceiveRecoveryState as o, DiscordAudioOutputStatus as p, enableDaveReceivePassthrough as r, DiscordOpusEncodeStream as s, DECRYPT_FAILURE_WINDOW_MS as t, createRealtimePcmToDiscordConverter as u };
|
package/dist/.setup/{resolve-allowlist-common-B-S0wRIw.mjs → resolve-allowlist-common-CYdqBUgV.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h as normalizeDiscordToken } from "./accounts-
|
|
2
|
-
import { o as normalizeDiscordSlug } from "./allow-list-
|
|
3
|
-
|
|
1
|
+
import { h as normalizeDiscordToken } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { o as normalizeDiscordSlug } from "./allow-list-CkqpzPvP.mjs";
|
|
3
|
+
// extensions/discord/src/resolve-allowlist-common.ts
|
|
4
4
|
function resolveDiscordAllowlistToken(token) {
|
|
5
5
|
return normalizeDiscordToken(token, "channels.discord.token");
|
|
6
6
|
}
|
|
@@ -52,5 +52,4 @@ function parseDiscordAllowlistInput(raw, kind) {
|
|
|
52
52
|
guildOnly: true
|
|
53
53
|
} : { name: trimmed.replace(/^@/, "") };
|
|
54
54
|
}
|
|
55
|
-
//#endregion
|
|
56
55
|
export { parseDiscordAllowlistInput as n, resolveDiscordAllowlistToken as r, filterDiscordGuilds as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { a as normalizeDiscordDisplaySlug, o as normalizeDiscordSlug, w as isDiscordThreadChannelType } from "./allow-list-
|
|
3
|
-
import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
4
|
-
import { n as listGuilds, t as listDiscordGuildChannels } from "./guilds-
|
|
5
|
-
import { n as parseDiscordAllowlistInput, r as resolveDiscordAllowlistToken, t as filterDiscordGuilds } from "./resolve-allowlist-common-
|
|
6
|
-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { a as normalizeDiscordDisplaySlug, o as normalizeDiscordSlug, w as isDiscordThreadChannelType } from "./allow-list-CkqpzPvP.mjs";
|
|
3
|
+
import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-C4j_kC-2.mjs";
|
|
4
|
+
import { n as listGuilds, t as listDiscordGuildChannels } from "./guilds-DYBhgnfq.mjs";
|
|
5
|
+
import { n as parseDiscordAllowlistInput, r as resolveDiscordAllowlistToken, t as filterDiscordGuilds } from "./resolve-allowlist-common-CYdqBUgV.mjs";
|
|
6
|
+
// extensions/discord/src/resolve-channels.ts
|
|
7
7
|
var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveDiscordChannelAllowlist: () => resolveDiscordChannelAllowlist });
|
|
8
8
|
async function listGuildChannels(token, fetcher, guildId) {
|
|
9
9
|
return (await listDiscordGuildChannels(token, fetcher, guildId)).map((channel) => {
|
|
@@ -172,5 +172,4 @@ async function resolveDiscordChannelAllowlist(params) {
|
|
|
172
172
|
for (const input of params.entries) results.push(await resolveEntry(input));
|
|
173
173
|
return results;
|
|
174
174
|
}
|
|
175
|
-
//#endregion
|
|
176
175
|
export { resolve_channels_exports as n, resolveDiscordChannelAllowlist as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
3
|
-
import { n as listGuilds, r as searchDiscordGuildMembers } from "./guilds-
|
|
4
|
-
import { n as parseDiscordAllowlistInput, r as resolveDiscordAllowlistToken, t as filterDiscordGuilds } from "./resolve-allowlist-common-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-C4j_kC-2.mjs";
|
|
3
|
+
import { n as listGuilds, r as searchDiscordGuildMembers } from "./guilds-DYBhgnfq.mjs";
|
|
4
|
+
import { n as parseDiscordAllowlistInput, r as resolveDiscordAllowlistToken, t as filterDiscordGuilds } from "./resolve-allowlist-common-CYdqBUgV.mjs";
|
|
5
5
|
import { normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
|
-
|
|
6
|
+
// extensions/discord/src/resolve-users.ts
|
|
7
7
|
var resolve_users_exports = /* @__PURE__ */ __exportAll({ resolveDiscordUserAllowlist: () => resolveDiscordUserAllowlist });
|
|
8
8
|
function scoreDiscordMember(member, query) {
|
|
9
9
|
const q = query.toLowerCase();
|
|
@@ -82,5 +82,4 @@ async function resolveDiscordUserAllowlist(params) {
|
|
|
82
82
|
}
|
|
83
83
|
return results;
|
|
84
84
|
}
|
|
85
|
-
//#endregion
|
|
86
85
|
export { resolve_users_exports as n, resolveDiscordUserAllowlist as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -24,5 +24,4 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
24
24
|
return to;
|
|
25
25
|
};
|
|
26
26
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
27
|
-
//#endregion
|
|
28
27
|
export { __reExport as n, __exportAll as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as selectDiscordActivitiesRuntimeConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, r as isDiscordAccountEnabledForRuntime } from "./accounts-
|
|
2
|
-
import { t as resolveDiscordProxyFetchForAccount } from "./proxy-fetch-
|
|
1
|
+
import { _ as selectDiscordActivitiesRuntimeConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, r as isDiscordAccountEnabledForRuntime } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { t as resolveDiscordProxyFetchForAccount } from "./proxy-fetch-B8cK6FLQ.mjs";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
-
|
|
4
|
+
// extensions/discord/src/activities/config.ts
|
|
5
5
|
function resolveDiscordActivitiesConfig(account, env = process.env) {
|
|
6
6
|
if (!account.activities) return {
|
|
7
7
|
enabled: false,
|
|
@@ -19,8 +19,7 @@ function resolveDiscordActivitiesConfig(account, env = process.env) {
|
|
|
19
19
|
...applicationId ? { applicationId } : {}
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
//#region extensions/discord/src/activities/runtime.ts
|
|
22
|
+
// extensions/discord/src/activities/runtime.ts
|
|
24
23
|
var DiscordActivitiesRuntime = class {
|
|
25
24
|
constructor(store, getCurrentConfig, env = process.env) {
|
|
26
25
|
this.store = store;
|
|
@@ -73,5 +72,4 @@ function setDiscordActivitiesRuntime(runtime) {
|
|
|
73
72
|
function getDiscordActivitiesRuntime() {
|
|
74
73
|
return activeRuntime;
|
|
75
74
|
}
|
|
76
|
-
//#endregion
|
|
77
75
|
export { getDiscordActivitiesRuntime as n, setDiscordActivitiesRuntime as r, DiscordActivitiesRuntime as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { c as resolveDefaultDiscordAccountId, s as mergeDiscordAccountConfig, t as createDiscordActionGate } from "./accounts-
|
|
2
|
-
import { C as hasAnyChannelPermissionDiscord, P as createDiscordRuntimeAccountContext, R as getGateway, _ as canManageGuildMemberRoleDiscord, b as fetchChannelPermissionsDiscord, n as buildDiscordTextChunks, u as resolveDiscordTargetChannelId, v as canManageGuildRoleDiscord, w as hasAnyGuildPermissionDiscord, y as canViewDiscordGuildChannel } from "./send.shared-
|
|
3
|
-
import { l as resolveDiscordChannelConfigWithFallback, n as hasConfiguredDiscordChannels, o as normalizeDiscordSlug, r as isDiscordGroupAllowedByPolicy, w as isDiscordThreadChannelType, y as resolveGroupDmAllow } from "./allow-list-
|
|
4
|
-
import {
|
|
5
|
-
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-
|
|
6
|
-
import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, l as DiscordThreadInitialMessageError, m as listPinsDiscord, n as fetchReactionsDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchGuildInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-
|
|
7
|
-
import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
8
|
-
import { n as getPresence } from "./presence-cache-
|
|
9
|
-
import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-
|
|
10
|
-
import { r as sendDiscordComponentMessage } from "./send.components-
|
|
1
|
+
import { c as resolveDefaultDiscordAccountId, s as mergeDiscordAccountConfig, t as createDiscordActionGate } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { C as hasAnyChannelPermissionDiscord, P as createDiscordRuntimeAccountContext, R as getGateway, _ as canManageGuildMemberRoleDiscord, b as fetchChannelPermissionsDiscord, n as buildDiscordTextChunks, u as resolveDiscordTargetChannelId, v as canManageGuildRoleDiscord, w as hasAnyGuildPermissionDiscord, y as canViewDiscordGuildChannel } from "./send.shared-BVJkIe93.mjs";
|
|
3
|
+
import { l as resolveDiscordChannelConfigWithFallback, n as hasConfiguredDiscordChannels, o as normalizeDiscordSlug, r as isDiscordGroupAllowedByPolicy, w as isDiscordThreadChannelType, y as resolveGroupDmAllow } from "./allow-list-CkqpzPvP.mjs";
|
|
4
|
+
import { g as resolveDiscordReplyReference, m as createReusableDiscordReplyReference } from "./send.receipt-D0vpuJMr.mjs";
|
|
5
|
+
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-BiuhcK9Q.mjs";
|
|
6
|
+
import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, l as DiscordThreadInitialMessageError, m as listPinsDiscord, n as fetchReactionsDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchGuildInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-BQtMCED2.mjs";
|
|
7
|
+
import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-izfb48w-.mjs";
|
|
8
|
+
import { n as getPresence } from "./presence-cache-B3xj3b0l.mjs";
|
|
9
|
+
import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-DeCLO9w0.mjs";
|
|
10
|
+
import { r as sendDiscordComponentMessage } from "./send.components-BTjOU5BX.mjs";
|
|
11
11
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
12
12
|
import { asBoolean, asOptionalRecord, isRecord, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
13
13
|
import { assertMediaNotDataUrl, jsonResult, parseAvailableTags, readNonNegativeIntegerParam, readPositiveIntegerParam, readReactionParams, readStringArrayParam, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -16,7 +16,7 @@ import { createChannelProgressDraftCompositor } from "openclaw/plugin-sdk/channe
|
|
|
16
16
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
17
17
|
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
18
18
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
19
|
-
|
|
19
|
+
// extensions/discord/src/actions/runtime.messaging.thread-list.ts
|
|
20
20
|
function readDiscordChannelStringField(value, ...keys) {
|
|
21
21
|
if (!value || typeof value !== "object") return;
|
|
22
22
|
const record = value;
|
|
@@ -74,8 +74,7 @@ function filterDiscordActiveThreadList(params) {
|
|
|
74
74
|
})
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
//#region extensions/discord/src/actions/runtime.shared.ts
|
|
77
|
+
// extensions/discord/src/actions/runtime.shared.ts
|
|
79
78
|
/** Discord REST auto_archive_duration allowlist (minutes). */
|
|
80
79
|
const DISCORD_AUTO_ARCHIVE_MINUTES = /* @__PURE__ */ new Set([
|
|
81
80
|
60,
|
|
@@ -141,8 +140,7 @@ function readDiscordChannelMoveParams(params) {
|
|
|
141
140
|
position: readNonNegativeIntegerParam(params, "position")
|
|
142
141
|
};
|
|
143
142
|
}
|
|
144
|
-
|
|
145
|
-
//#region extensions/discord/src/actions/runtime.messaging.shared.ts
|
|
143
|
+
// extensions/discord/src/actions/runtime.messaging.shared.ts
|
|
146
144
|
function allowsAllDiscordGuildChannels(channels) {
|
|
147
145
|
const wildcard = channels?.["*"];
|
|
148
146
|
if (!wildcard || wildcard.enabled === false) return false;
|
|
@@ -297,7 +295,10 @@ function createDiscordMessagingActionContext(params) {
|
|
|
297
295
|
const withOpts = (extra) => createDiscordActionOptions({
|
|
298
296
|
cfg: params.cfg,
|
|
299
297
|
accountId,
|
|
300
|
-
extra
|
|
298
|
+
extra: {
|
|
299
|
+
...params.options?.callerSignal ? { callerSignal: params.options.callerSignal } : {},
|
|
300
|
+
...extra
|
|
301
|
+
}
|
|
301
302
|
});
|
|
302
303
|
const resolvedReactionAccountId = accountId ?? resolveDefaultDiscordAccountId(params.cfg);
|
|
303
304
|
const isCurrentReadTarget = (channelId) => {
|
|
@@ -483,13 +484,15 @@ function createDiscordMessagingActionContext(params) {
|
|
|
483
484
|
} catch {
|
|
484
485
|
return (await resolveDiscordTargetChannelId(target, {
|
|
485
486
|
cfg: params.cfg,
|
|
486
|
-
accountId: resolvedReactionAccountId
|
|
487
|
+
accountId: resolvedReactionAccountId,
|
|
488
|
+
...params.options?.callerSignal ? { callerSignal: params.options.callerSignal } : {}
|
|
487
489
|
})).channelId;
|
|
488
490
|
}
|
|
489
491
|
},
|
|
490
492
|
withOpts,
|
|
491
493
|
withReactionRuntimeOptions: (extra) => ({
|
|
492
494
|
...reactionRuntimeOptions,
|
|
495
|
+
...params.options?.callerSignal ? { callerSignal: params.options.callerSignal } : {},
|
|
493
496
|
...extra
|
|
494
497
|
}),
|
|
495
498
|
normalizeMessage: (message) => {
|
|
@@ -498,8 +501,15 @@ function createDiscordMessagingActionContext(params) {
|
|
|
498
501
|
}
|
|
499
502
|
};
|
|
500
503
|
}
|
|
501
|
-
|
|
502
|
-
|
|
504
|
+
// extensions/discord/src/actions/runtime.guild.ts
|
|
505
|
+
/** Options for permission and metadata lookups that run before an action's own send options. */
|
|
506
|
+
function guildActionOptions(params) {
|
|
507
|
+
return createDiscordActionOptions({
|
|
508
|
+
cfg: params.cfg,
|
|
509
|
+
accountId: params.accountId,
|
|
510
|
+
...params.callerSignal ? { extra: { callerSignal: params.callerSignal } } : {}
|
|
511
|
+
});
|
|
512
|
+
}
|
|
503
513
|
const expressionPermissions = [PermissionFlagsBits.ManageGuildExpressions, PermissionFlagsBits.CreateGuildExpressions];
|
|
504
514
|
const channelGuard = {
|
|
505
515
|
gate: "channels",
|
|
@@ -567,20 +577,14 @@ async function resolveGuildIdForGuildAdminAction(params) {
|
|
|
567
577
|
if (guildId) return guildId;
|
|
568
578
|
const channelLikeId = readStringParam(params.values, "channelId") ?? readStringParam(params.values, "categoryId");
|
|
569
579
|
if (!channelLikeId) return;
|
|
570
|
-
const channel = await fetchChannelInfoDiscord(channelLikeId,
|
|
571
|
-
cfg: params.cfg,
|
|
572
|
-
accountId: params.accountId
|
|
573
|
-
}));
|
|
580
|
+
const channel = await fetchChannelInfoDiscord(channelLikeId, guildActionOptions(params));
|
|
574
581
|
return "guild_id" in channel ? channel.guild_id : void 0;
|
|
575
582
|
}
|
|
576
583
|
async function resolveGuildAdminActionPermissions(params) {
|
|
577
584
|
if (params.action !== "channelEdit") return params.guard.permissions;
|
|
578
585
|
const channelId = readStringParam(params.values, "channelId");
|
|
579
586
|
if (!channelId) return params.guard.permissions;
|
|
580
|
-
const channel = await fetchChannelInfoDiscord(channelId,
|
|
581
|
-
cfg: params.cfg,
|
|
582
|
-
accountId: params.accountId
|
|
583
|
-
}));
|
|
587
|
+
const channel = await fetchChannelInfoDiscord(channelId, guildActionOptions(params));
|
|
584
588
|
const channelType = "type" in channel ? channel.type : void 0;
|
|
585
589
|
if (!isDiscordThreadChannelType(channelType)) return params.guard.permissions;
|
|
586
590
|
const edit = readDiscordChannelEditParams(params.values);
|
|
@@ -596,10 +600,7 @@ async function verifySenderGuildAdminPermission(params) {
|
|
|
596
600
|
});
|
|
597
601
|
const guildId = await resolveGuildIdForGuildAdminAction(params);
|
|
598
602
|
if (!guildId) throw new Error(`Guild id required to authorize Discord guild action: ${params.action}`);
|
|
599
|
-
const actionOptions =
|
|
600
|
-
cfg: params.cfg,
|
|
601
|
-
accountId: params.accountId
|
|
602
|
-
});
|
|
603
|
+
const actionOptions = guildActionOptions(params);
|
|
603
604
|
const targetChannelId = guard?.permissionScope === "channel" || params.action === "eventCreate" ? readStringParam(params.values, params.action === "categoryEdit" || params.action === "categoryDelete" ? "categoryId" : "channelId") : void 0;
|
|
604
605
|
const hasPermission = targetChannelId ? await hasAnyChannelPermissionDiscord(guildId, targetChannelId, senderUserId, requiredPermissions, actionOptions) : await hasAnyGuildPermissionDiscord(guildId, senderUserId, requiredPermissions, actionOptions);
|
|
605
606
|
const requiresCurrentThreadAccess = params.action === "channelEdit" && requiredPermissions.includes(PermissionFlagsBits.SendMessages);
|
|
@@ -628,7 +629,8 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
628
629
|
action,
|
|
629
630
|
values: params,
|
|
630
631
|
accountId,
|
|
631
|
-
cfg
|
|
632
|
+
cfg,
|
|
633
|
+
...options?.callerSignal ? { callerSignal: options.callerSignal } : {}
|
|
632
634
|
});
|
|
633
635
|
const readTargetGate = createDiscordMessagingActionContext({
|
|
634
636
|
action,
|
|
@@ -639,12 +641,14 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
639
641
|
});
|
|
640
642
|
const withOpts = () => createDiscordActionOptions({
|
|
641
643
|
cfg,
|
|
642
|
-
accountId
|
|
644
|
+
accountId,
|
|
645
|
+
...options?.callerSignal ? { extra: { callerSignal: options.callerSignal } } : {}
|
|
643
646
|
});
|
|
644
647
|
const mediaPolicyOptions = {
|
|
645
648
|
mediaAccess: options?.mediaAccess,
|
|
646
649
|
mediaLocalRoots: options?.mediaLocalRoots,
|
|
647
|
-
mediaReadFile: options?.mediaReadFile
|
|
650
|
+
mediaReadFile: options?.mediaReadFile,
|
|
651
|
+
...options?.callerSignal ? { callerSignal: options.callerSignal } : {}
|
|
648
652
|
};
|
|
649
653
|
const readRequiredString = (key) => readStringParam(params, key, { required: true });
|
|
650
654
|
const readMetadataGuildId = async (guildId = readRequiredString("guildId")) => {
|
|
@@ -670,9 +674,10 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
670
674
|
});
|
|
671
675
|
}
|
|
672
676
|
const effectiveAccountId = accountId ?? resolveDefaultDiscordAccountId(cfg);
|
|
673
|
-
const member = await fetchMemberInfoDiscord(guildId, userId,
|
|
677
|
+
const member = await fetchMemberInfoDiscord(guildId, userId, guildActionOptions({
|
|
674
678
|
cfg,
|
|
675
|
-
accountId: effectiveAccountId
|
|
679
|
+
accountId: effectiveAccountId,
|
|
680
|
+
...options?.callerSignal ? { callerSignal: options.callerSignal } : {}
|
|
676
681
|
}));
|
|
677
682
|
const presence = getPresence(effectiveAccountId, userId);
|
|
678
683
|
const activities = presence?.activities;
|
|
@@ -702,7 +707,8 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
702
707
|
const guildId = await resolveGuildIdForGuildAdminAction({
|
|
703
708
|
values: params,
|
|
704
709
|
accountId,
|
|
705
|
-
cfg
|
|
710
|
+
cfg,
|
|
711
|
+
...options?.callerSignal ? { callerSignal: options.callerSignal } : {}
|
|
706
712
|
});
|
|
707
713
|
if (!guildId) throw new Error("Discord emoji listing requires guildId or a server channel.");
|
|
708
714
|
await readMetadataGuildId(guildId);
|
|
@@ -876,8 +882,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
876
882
|
default: throw new Error(`Unknown action: ${action}`);
|
|
877
883
|
}
|
|
878
884
|
}
|
|
879
|
-
|
|
880
|
-
//#region extensions/discord/src/actions/runtime.messaging.messages.ts
|
|
885
|
+
// extensions/discord/src/actions/runtime.messaging.messages.ts
|
|
881
886
|
function parseDiscordMessageLink(link) {
|
|
882
887
|
const match = link.trim().match(/^(?:https?:\/\/)?(?:ptb\.|canary\.)?discord(?:app)?\.com\/channels\/(\d+)\/(\d+)\/(\d+)(?:\/?|\?.*)$/i);
|
|
883
888
|
if (!match) throw new Error("Invalid Discord message link. Expected https://discord.com/channels/<guildId>/<channelId>/<messageId>.");
|
|
@@ -1030,8 +1035,7 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1030
1035
|
default: return;
|
|
1031
1036
|
}
|
|
1032
1037
|
}
|
|
1033
|
-
|
|
1034
|
-
//#region extensions/discord/src/actions/runtime.messaging.send.ts
|
|
1038
|
+
// extensions/discord/src/actions/runtime.messaging.send.ts
|
|
1035
1039
|
function resolveActionReplyReference(ctx, replyToId) {
|
|
1036
1040
|
const reply = ctx.options?.reply;
|
|
1037
1041
|
return reply ? resolveDiscordReplyReference({
|
|
@@ -1276,8 +1280,7 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1276
1280
|
default: return;
|
|
1277
1281
|
}
|
|
1278
1282
|
}
|
|
1279
|
-
|
|
1280
|
-
//#region extensions/discord/src/actions/runtime.moderation-shared.ts
|
|
1283
|
+
// extensions/discord/src/actions/runtime.moderation-shared.ts
|
|
1281
1284
|
const moderationPermissions = {
|
|
1282
1285
|
timeout: PermissionFlagsBits.ModerateMembers,
|
|
1283
1286
|
kick: PermissionFlagsBits.KickMembers,
|
|
@@ -1304,8 +1307,7 @@ function readDiscordModerationCommand(action, params) {
|
|
|
1304
1307
|
})
|
|
1305
1308
|
};
|
|
1306
1309
|
}
|
|
1307
|
-
|
|
1308
|
-
//#region extensions/discord/src/actions/runtime.ts
|
|
1310
|
+
// extensions/discord/src/actions/runtime.ts
|
|
1309
1311
|
const ACTIVITY_TYPE_MAP = /* @__PURE__ */ new Map([
|
|
1310
1312
|
["playing", 0],
|
|
1311
1313
|
["streaming", 1],
|
|
@@ -1387,7 +1389,8 @@ async function handleDiscordAction(params, cfg, options) {
|
|
|
1387
1389
|
const senderUserId = readStringParam(params, "senderUserId");
|
|
1388
1390
|
const withOpts = () => createDiscordActionOptions({
|
|
1389
1391
|
cfg,
|
|
1390
|
-
accountId
|
|
1392
|
+
accountId,
|
|
1393
|
+
...options?.callerSignal ? { extra: { callerSignal: options.callerSignal } } : {}
|
|
1391
1394
|
});
|
|
1392
1395
|
if (!await (senderUserId ? hasAnyGuildPermissionDiscord(command.guildId, senderUserId, [requiredGuildPermissionForModerationAction(command.action)], withOpts()) : true)) throw new Error("Sender does not have required permissions for this moderation action.");
|
|
1393
1396
|
const target = {
|
|
@@ -1457,5 +1460,4 @@ async function handleDiscordAction(params, cfg, options) {
|
|
|
1457
1460
|
}
|
|
1458
1461
|
throw new Error(`Unknown action: ${action}`);
|
|
1459
1462
|
}
|
|
1460
|
-
//#endregion
|
|
1461
1463
|
export { readDiscordAutoArchiveDurationParam as a, readDiscordChannelMoveParams as c, requiredGuildPermissionForModerationAction as i, readDiscordParentIdParam as l, isDiscordModerationAction as n, readDiscordChannelCreateParams as o, readDiscordModerationCommand as r, readDiscordChannelEditParams as s, handleDiscordAction as t };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
2
|
-
|
|
2
|
+
// extensions/discord/src/runtime.ts
|
|
3
3
|
const { setRuntime: setDiscordRuntime, tryGetRuntime: getOptionalDiscordRuntime, getRuntime: getDiscordRuntime } = createPluginRuntimeStore({
|
|
4
4
|
pluginId: "discord",
|
|
5
5
|
errorMessage: "Discord runtime not initialized"
|
|
6
6
|
});
|
|
7
|
-
//#endregion
|
|
8
7
|
export { getOptionalDiscordRuntime as n, setDiscordRuntime as r, getDiscordRuntime as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
|
|
1
|
+
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
// packages/normalization-core/src/record-coerce.ts
|
|
3
3
|
/** Type guard for non-array object records at browser-safe boundaries. */
|
|
4
4
|
function isRecord(value) {
|
|
5
5
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -8,8 +8,7 @@ function isRecord(value) {
|
|
|
8
8
|
function asNullableRecord(value) {
|
|
9
9
|
return isRecord(value) ? value : null;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
//#region src/config/channel-config-normalization.ts
|
|
11
|
+
// src/config/channel-config-normalization.ts
|
|
13
12
|
/** Applies one channel-specific doctor migration to every object-shaped account. */
|
|
14
13
|
function normalizeChannelAccounts(params) {
|
|
15
14
|
const rawAccounts = asNullableRecord(params.entry.accounts);
|
|
@@ -85,8 +84,7 @@ function normalizeChannelConfigEntries(params) {
|
|
|
85
84
|
changes
|
|
86
85
|
};
|
|
87
86
|
}
|
|
88
|
-
|
|
89
|
-
//#region src/plugin-sdk/legacy-webhook-listener-migration.ts
|
|
87
|
+
// src/plugin-sdk/legacy-webhook-listener-migration.ts
|
|
90
88
|
/** Preserve explicitly configured webhook listeners while moving ingress onto Gateway routes. */
|
|
91
89
|
function createLegacyWebhookListenerDoctorContract(params) {
|
|
92
90
|
const portKey = params.portKey ?? "webhookPort";
|
|
@@ -156,10 +154,8 @@ function createLegacyWebhookListenerDoctorContract(params) {
|
|
|
156
154
|
}
|
|
157
155
|
};
|
|
158
156
|
}
|
|
159
|
-
|
|
160
|
-
//#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
|
|
157
|
+
// \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
|
|
161
158
|
var runtime_doctor_migrations_exports = /* @__PURE__ */ __exportAll({ createLegacyWebhookListenerDoctorContract: () => createLegacyWebhookListenerDoctorContract });
|
|
162
159
|
import * as import_openclaw_plugin_sdk_runtime_doctor_migrations from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
163
160
|
__reExport(runtime_doctor_migrations_exports, import_openclaw_plugin_sdk_runtime_doctor_migrations);
|
|
164
|
-
//#endregion
|
|
165
161
|
export { runtime_doctor_migrations_exports as t };
|
package/dist/.setup/{secret-config-contract-B1kE4sDv.mjs → secret-config-contract-CP6teHec.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
2
2
|
import { collectNestedChannelFieldAssignments, collectSimpleChannelFieldAssignments, createChannelSecretTargetRegistryEntries, getChannelRecord, hasConfiguredSecretInputValue, isBaseFieldActiveForChannelSurface, isEnabledFlag, isRecord, resolveChannelAccountSurface } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
3
3
|
import { collectNestedChannelTtsAssignments } from "openclaw/plugin-sdk/channel-secret-tts-runtime";
|
|
4
|
-
|
|
4
|
+
// extensions/discord/src/secret-config-contract.ts
|
|
5
5
|
function discordRealtimeVoiceSecretOwnerId(accountId, providerId) {
|
|
6
6
|
return `discord:voice:realtime:${normalizeAccountId(accountId)}:${providerId}`;
|
|
7
7
|
}
|
|
@@ -69,5 +69,4 @@ function collectRuntimeConfigAssignments(params) {
|
|
|
69
69
|
accountInactiveReason: "Discord account is disabled, voice is disabled, or voice mode is stt-tts for this account."
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
//#endregion
|
|
73
72
|
export { discordRealtimeVoiceSecretOwnerId as n, secretTargetRegistryEntries as r, collectRuntimeConfigAssignments as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { t as isDiscordMutableAllowEntry } from "./security-doctor-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { t as isDiscordMutableAllowEntry } from "./security-doctor-4s7omTZd.mjs";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { readChannelAllowFromStore } from "openclaw/plugin-sdk/conversation-runtime";
|
|
5
5
|
import { coerceNativeSetting, normalizeAllowFromList } from "openclaw/plugin-sdk/channel-policy";
|
|
6
6
|
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
7
7
|
import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "openclaw/plugin-sdk/native-command-config-runtime";
|
|
8
|
-
|
|
8
|
+
// extensions/discord/src/security-audit.ts
|
|
9
9
|
var security_audit_exports = /* @__PURE__ */ __exportAll({ collectDiscordSecurityAuditFindings: () => collectDiscordSecurityAuditFindings });
|
|
10
10
|
function isWildcardEntry(value) {
|
|
11
11
|
return String(value).trim() === "*";
|
|
@@ -116,5 +116,4 @@ async function collectDiscordSecurityAuditFindings(params) {
|
|
|
116
116
|
});
|
|
117
117
|
return findings;
|
|
118
118
|
}
|
|
119
|
-
//#endregion
|
|
120
119
|
export { security_audit_exports as n, collectDiscordSecurityAuditFindings as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
|
|
2
|
+
// extensions/discord/src/security-contract.ts
|
|
3
3
|
const unsupportedSecretRefSurfacePatterns = ["channels.discord.threadBindings.webhookToken", "channels.discord.accounts.*.threadBindings.webhookToken"];
|
|
4
4
|
function collectUnsupportedSecretRefConfigCandidates(raw) {
|
|
5
5
|
if (!isRecord(raw) || !isRecord(raw.channels) || !isRecord(raw.channels.discord)) return [];
|
|
@@ -15,5 +15,4 @@ function collectUnsupportedSecretRefConfigCandidates(raw) {
|
|
|
15
15
|
for (const [accountId, account] of Object.entries(isRecord(discord.accounts) ? discord.accounts : {})) addCandidate(account, `channels.discord.accounts.${accountId}`);
|
|
16
16
|
return candidates;
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { unsupportedSecretRefSurfacePatterns as n, collectUnsupportedSecretRefConfigCandidates as t };
|