@openclaw/discord 2026.11.1 → 2026.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-inspect-X_Xlr42B.mjs → account-inspect-8cCu6uPG.mjs} +3 -2
- package/dist/.setup/{accounts-C18HNgge.mjs → accounts-ljrzXBJi.mjs} +8 -4
- package/dist/.setup/{active-turn-thread-route-BAc_Xik-.mjs → active-turn-thread-route-C4tp9noA.mjs} +2 -1
- package/dist/.setup/{allow-list-D1ZGfhXh.mjs → allow-list-BKqOldGy.mjs} +11 -6
- package/dist/.setup/{api-Bth1wKF9.mjs → api-DqmMUZau.mjs} +5 -3
- package/dist/.setup/{approval-handler.runtime-krznjTz9.mjs → approval-handler.runtime-D0qu1um7.mjs} +9 -8
- package/dist/.setup/{approval-message-updates-Cks-MSCJ.mjs → approval-message-updates-CdurC9Ej.mjs} +4 -3
- package/dist/.setup/{audit-Dw_rAZIz.mjs → audit-ChorIwio.mjs} +7 -6
- package/dist/.setup/{channel-DwvRHJL0.mjs → channel-ZilgdF5e.mjs} +41 -33
- package/dist/.setup/{channel-access-BPrWoEXM.mjs → channel-access-DasWY_OV.mjs} +2 -1
- package/dist/.setup/{channel.setup-BHjvtK1U.mjs → channel.setup-DaDQdctj.mjs} +12 -8
- package/dist/.setup/{command-deploy-store-DPWiBMks.mjs → command-deploy-store-DFkBTViB.mjs} +2 -1
- package/dist/.setup/{command-owners-BzlhNBxA.mjs → command-owners-C7rUdqUX.mjs} +2 -1
- package/dist/.setup/{components-BvOWSPxr.mjs → components-Du9NhD8h.mjs} +20 -11
- package/dist/.setup/{config-schema-Coyq5wOr.mjs → config-schema-_uBILpQf.mjs} +5 -3
- package/dist/.setup/{conversation-binding-route-DOPUZNYo.mjs → conversation-binding-route-8Ul1KpGF.mjs} +3 -2
- package/dist/.setup/{directory-config-CIqVnQtn.mjs → directory-config-3iVub-3m.mjs} +4 -3
- package/dist/.setup/{directory-live-DUuPEWub.mjs → directory-live-BDVl2DoC.mjs} +15 -14
- package/dist/.setup/{discord-eFlHX1Gn.mjs → discord-BMD-JiVS.mjs} +68 -35
- package/dist/.setup/{doctor-contract-Dstl3cMg.mjs → doctor-contract-Bwv8EuQ_.mjs} +3 -2
- package/dist/.setup/{doctor-Cg_N6ZOI.mjs → doctor-hQKbkNKq.mjs} +9 -8
- package/dist/.setup/{handle-action-DXY91jF-.mjs → handle-action-B1lmt4ms.mjs} +11 -10
- package/dist/.setup/{handle-action.guild-admin-BvBCfhXF.mjs → handle-action.guild-admin-B6g31cwt.mjs} +4 -3
- package/dist/.setup/{live-policy-config-DO1Fk2hp.mjs → live-policy-config-C_Q966Wh.mjs} +5 -3
- package/dist/.setup/{message-handler-TR7l1P3P.mjs → message-handler-CkI3yMjL.mjs} +16 -11
- package/dist/.setup/{message-handler.preflight-DxGb4zsm.mjs → message-handler.preflight-CEfkFV9U.mjs} +28 -20
- package/dist/.setup/{message-handler.preflight-pluralkit-BTE5JebL.mjs → message-handler.preflight-pluralkit-D5si80_L.mjs} +14 -10
- package/dist/.setup/{message-handler.process-DVHZKc2e.mjs → message-handler.process-DsMtetRf.mjs} +47 -33
- package/dist/.setup/{outbound-adapter-DWyAWBFh.mjs → outbound-adapter-DfAanoCO.mjs} +19 -13
- package/dist/.setup/{outbound-session-route-TFBPPkoz.mjs → outbound-session-route-BtUpGBTb.mjs} +32 -21
- package/dist/.setup/{output-activity-CDgs2s3O.mjs → output-activity-uBpMSX75.mjs} +2 -1
- package/dist/.setup/{pluralkit-DcXbHTpQ.mjs → pluralkit-B64dfq_j.mjs} +3 -2
- package/dist/.setup/{preflight-audio-CwtPIsvk.mjs → preflight-audio-wWgsZG5F.mjs} +2 -1
- package/dist/.setup/{presence-cache-CgutE4NN.mjs → presence-cache-DCeTsL73.mjs} +2 -1
- package/dist/.setup/{probe-DNge7OEP.mjs → probe-CBaoCs-c.mjs} +6 -5
- package/dist/.setup/{provider-C61K7HHq.mjs → provider-CI_OLfvz.mjs} +209 -119
- package/dist/.setup/{provider-session.runtime-D87e36ut.mjs → provider-session.runtime-TWOo_JZx.mjs} +3 -3
- package/dist/.setup/provider.runtime-DnionCyo.mjs +2 -0
- package/dist/.setup/{realtime-session.runtime-D1YHKwbc.mjs → realtime-session.runtime-DvfS4vJj.mjs} +23 -14
- package/dist/.setup/{receive-recovery-C77CVdGM.mjs → receive-recovery-CKvaG2Hf.mjs} +6 -3
- package/dist/.setup/{resolve-allowlist-common-CI77288n.mjs → resolve-allowlist-common-cIjtqh2F.mjs} +7 -5
- package/dist/.setup/{resolve-channels-DYc6-xgV.mjs → resolve-channels-Cj5i7hzj.mjs} +10 -7
- package/dist/.setup/{resolve-users-BQT7XWF2.mjs → resolve-users-BQLbysRB.mjs} +5 -4
- package/dist/.setup/{rolldown-runtime-nwUcYXjP.mjs → rolldown-runtime-B4FMCO8f.mjs} +2 -1
- package/dist/.setup/{runtime-DcBvHOm1.mjs → runtime-DgnVQ7zW.mjs} +2 -1
- package/dist/.setup/{runtime-CI0UJqeS.mjs → runtime-RWnuJgWB.mjs} +35 -23
- package/dist/.setup/{runtime-doctor-migrations-BpV1jKk0.mjs → runtime-doctor-migrations-BPV-R4G9.mjs} +9 -5
- package/dist/.setup/{runtime-CcijhTJT.mjs → runtime-plifsKg9.mjs} +6 -4
- package/dist/.setup/{secret-config-contract-B7UlqVYr.mjs → secret-config-contract-z6FhbT8E.mjs} +2 -1
- package/dist/.setup/{security-audit-CTwisG7c.mjs → security-audit-BFT84Uny.mjs} +4 -3
- package/dist/.setup/{security-contract-D-o0iWDk.mjs → security-contract-DNyyjTZZ.mjs} +2 -1
- package/dist/.setup/{security-doctor-4s7omTZd.mjs → security-doctor-nGgPm65L.mjs} +2 -1
- package/dist/.setup/{send-Cbq-IVsS.mjs → send-da6ENJ9f.mjs} +28 -18
- package/dist/.setup/{send.components-BV6ucNpJ.mjs → send.components-CWZUuGvA.mjs} +15 -10
- package/dist/.setup/{send.outbound-CGhBhzjQ.mjs → send.outbound-qZ3iK3Vq.mjs} +13 -9
- package/dist/.setup/{send.receipt-Dw-_r5Bx.mjs → send.receipt-C18khRYH.mjs} +16 -9
- package/dist/.setup/{send.shared-D4MioxW_.mjs → send.shared-CnlMgoqQ.mjs} +23 -14
- package/dist/.setup/{sender-identity-DrN5c4ec.mjs → sender-identity-DgbJykq0.mjs} +3 -2
- package/dist/.setup/{session-contract-Bq71MS78.mjs → session-contract-BO5tlIdl.mjs} +2 -1
- package/dist/.setup/{session-key-normalization-Cfvze5hd.mjs → session-key-normalization-CCHGNSQw.mjs} +2 -1
- package/dist/.setup/setup-plugin-api-D1QuM187.mjs +3 -0
- package/dist/.setup/{shared-_o59Fvrr.mjs → shared-CY5vJM48.mjs} +19 -15
- package/dist/.setup/{subagent-hooks-mQbDkvuD.mjs → subagent-hooks-CIu2TFz3.mjs} +4 -3
- package/dist/.setup/{system-events-2zc2eGfF.mjs → system-events-DCOLXkwS.mjs} +4 -3
- package/dist/.setup/{target-parsing-BiuhcK9Q.mjs → target-parsing-C-HyNxcE.mjs} +2 -1
- package/dist/.setup/{target-resolver-CAHeVfmZ.mjs → target-resolver-CApivu3G.mjs} +7 -6
- package/dist/.setup/targets-UWWZ6gF7.mjs +3 -0
- package/dist/.setup/{thread-binding-api-Drd4Zu-5.mjs → thread-binding-api-BDZJD4na.mjs} +2 -1
- package/dist/.setup/{thread-bindings-Dg7X_ZXP.mjs → thread-bindings-DcvT_JgI.mjs} +11 -8
- package/dist/.setup/{thread-bindings.manager-DCDYksah.mjs → thread-bindings.manager-5Sh7yedN.mjs} +20 -15
- package/dist/.setup/{thread-bindings.session-updates-C76plLS3.mjs → thread-bindings.session-updates-BMdJeJMc.mjs} +9 -5
- package/dist/.setup/{threading-BKn_OF3K.mjs → threading-CzjFeUSe.mjs} +9 -6
- package/dist/.setup/{timeouts-DTrUsJ_W.mjs → timeouts-CuNARfyw.mjs} +2 -1
- package/dist/.setup/{transcripts-source-BSorJ4AS.mjs → transcripts-source-8RDQrSVb.mjs} +32 -19
- package/dist/.setup/{typing-DAv4S2fI.mjs → typing-CNlSKY5S.mjs} +3 -2
- package/dist/.setup/{voice-runtime-B5m2Ryg8.mjs → voice-runtime-BsDILmAv.mjs} +55 -33
- package/dist/account-inspect-api.js +3 -2
- package/dist/action-runtime-api.js +2 -1
- package/dist/activities-api.js +20 -13
- package/dist/api.js +22 -21
- package/dist/channel-config-api.js +2 -1
- package/dist/channel-plugin-api.js +2 -1
- package/dist/contract-api.js +2 -1
- package/dist/directory-contract-api.js +3 -2
- package/dist/doctor-contract-api.js +7 -5
- package/dist/index.js +2 -1
- package/dist/runtime-api.js +22 -22
- package/dist/runtime-setter-api.js +2 -1
- package/dist/secret-contract-api.js +2 -1
- package/dist/security-audit-contract-api.js +2 -1
- package/dist/security-contract-api.js +2 -1
- package/dist/session-key-api.js +2 -1
- package/dist/setup-entry.js +3 -2
- package/dist/setup-plugin-api.js +2 -1
- package/dist/src/voice/audio-worker.runtime.js +14 -8
- package/dist/subagent-hooks-api.js +3 -2
- package/dist/thread-binding-api.js +2 -1
- package/dist/transcripts-source-api.js +3 -2
- package/package.json +4 -4
- package/dist/.setup/provider.runtime-xk5CVdoI.mjs +0 -1
- package/dist/.setup/setup-plugin-api-DGfQO4Ec.mjs +0 -2
- package/dist/.setup/targets-BaklhOqq.mjs +0 -3
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +0 -1
package/dist/.setup/{provider-session.runtime-D87e36ut.mjs → provider-session.runtime-TWOo_JZx.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-5Sh7yedN.mjs";
|
|
2
|
+
import { l as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-DcvT_JgI.mjs";
|
|
3
|
+
import { t as createDiscordMessageHandler } from "./message-handler-CkI3yMjL.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 };
|
package/dist/.setup/{realtime-session.runtime-D1YHKwbc.mjs → realtime-session.runtime-DvfS4vJj.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 logDiscordVoiceAgentControlResult, c as formatVoiceLogPreview, i as handleDiscordVoiceAgentControlToolCall, l as shouldLogRealtimeVerboseEvent, n as DiscordRealtimeRecording, o as maybeControlDiscordVoiceAgentRun, r as formatVoiceIngressPrompt, s as formatRealtimeInfoLog } from "./voice-runtime-
|
|
1
|
+
import { _ as setDiscordAudioOutputStatus, h as restoreDiscordAudioError, l as createDiscordPcmToRealtimeConverter, m as getDiscordAudioOutputStatus, p as DiscordAudioOutputStatus } from "./receive-recovery-CKvaG2Hf.mjs";
|
|
2
|
+
import { t as resolveDiscordOutputAudioDelta } from "./output-activity-uBpMSX75.mjs";
|
|
3
|
+
import { n as discordRealtimeVoiceSecretOwnerId } from "./secret-config-contract-z6FhbT8E.mjs";
|
|
4
|
+
import { y as logVoiceVerbose } from "./provider-CI_OLfvz.mjs";
|
|
5
|
+
import { a as logDiscordVoiceAgentControlResult, c as formatVoiceLogPreview, i as handleDiscordVoiceAgentControlToolCall, l as shouldLogRealtimeVerboseEvent, n as DiscordRealtimeRecording, o as maybeControlDiscordVoiceAgentRun, r as formatVoiceIngressPrompt, s as formatRealtimeInfoLog } from "./voice-runtime-BsDILmAv.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
|
+
//#region 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,7 +77,8 @@ var DiscordRealtimePlayer = class {
|
|
|
77
77
|
this.audio.send({ type: "output-shutdown" });
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
-
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region extensions/discord/src/voice/realtime-speaker-config.ts
|
|
81
82
|
/** Prepare shared provider credentials once before any speaker starts capturing audio. */
|
|
82
83
|
async function prepareDiscordRealtimeProvider(params) {
|
|
83
84
|
const { realtimeConfig, isAgentProxy } = params;
|
|
@@ -178,7 +179,8 @@ function resolveDiscordRealtimeSpeakerConfig(params) {
|
|
|
178
179
|
resolvedVoice: normalizeOptionalString(resolved.providerConfig.voice)
|
|
179
180
|
};
|
|
180
181
|
}
|
|
181
|
-
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region extensions/discord/src/voice/realtime-transcript.ts
|
|
182
184
|
const PARTIAL_TRANSCRIPT_MAX_CHARS = 240;
|
|
183
185
|
function mergeRealtimePartialTranscript(previous, next) {
|
|
184
186
|
const trimmed = next.trim();
|
|
@@ -186,7 +188,8 @@ function mergeRealtimePartialTranscript(previous, next) {
|
|
|
186
188
|
const merged = trimmed.startsWith(previous) ? trimmed : `${previous}${next}`;
|
|
187
189
|
return sliceUtf16Safe(merged, 0, PARTIAL_TRANSCRIPT_MAX_CHARS);
|
|
188
190
|
}
|
|
189
|
-
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region extensions/discord/src/voice/realtime-turns.ts
|
|
190
193
|
const logger$4 = createSubsystemLogger("discord/voice");
|
|
191
194
|
const DISCORD_REALTIME_WAKE_NAME_FOLLOWUP_TTL_MS = 1e4;
|
|
192
195
|
const REALTIME_PCM16_BYTES_PER_SAMPLE = 2;
|
|
@@ -403,7 +406,8 @@ var DiscordRealtimeTurns = class {
|
|
|
403
406
|
function isDiscordRealtimeSpeakerContext(value) {
|
|
404
407
|
return Boolean(value) && typeof value === "object" && typeof value.userId === "string" && typeof value.senderIsOwner === "boolean" && typeof value.speakerLabel === "string";
|
|
405
408
|
}
|
|
406
|
-
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region extensions/discord/src/voice/realtime-consults.ts
|
|
407
411
|
const logger$3 = createSubsystemLogger("discord/voice");
|
|
408
412
|
const DISCORD_REALTIME_TALKBACK_DEBOUNCE_MS = 350;
|
|
409
413
|
const DISCORD_REALTIME_FALLBACK_TEXT = "I hit an error while checking that. Please try again.";
|
|
@@ -769,7 +773,8 @@ var DiscordRealtimeConsults = class {
|
|
|
769
773
|
this.params.harness.forcedConsults.clear();
|
|
770
774
|
}
|
|
771
775
|
};
|
|
772
|
-
|
|
776
|
+
//#endregion
|
|
777
|
+
//#region extensions/discord/src/voice/realtime-output.ts
|
|
773
778
|
/** Main retains provider item identity; physical output state belongs to the worker. */
|
|
774
779
|
var DiscordRealtimeOutput = class {
|
|
775
780
|
constructor(params) {
|
|
@@ -908,7 +913,8 @@ var DiscordRealtimeOutput = class {
|
|
|
908
913
|
this.params.onClose(this, reason);
|
|
909
914
|
}
|
|
910
915
|
};
|
|
911
|
-
|
|
916
|
+
//#endregion
|
|
917
|
+
//#region extensions/discord/src/voice/realtime-playback.ts
|
|
912
918
|
const logger$2 = createSubsystemLogger("discord/voice");
|
|
913
919
|
const DISCORD_REALTIME_CONTROL_SPEECH_DEDUPE_MS = 5e3;
|
|
914
920
|
const DISCORD_REALTIME_MAX_RETAINED_RESPONSES = 32;
|
|
@@ -1320,7 +1326,8 @@ var DiscordRealtimePlayback = class {
|
|
|
1320
1326
|
this.drainQueuedExactSpeechMessages(reason);
|
|
1321
1327
|
}
|
|
1322
1328
|
};
|
|
1323
|
-
|
|
1329
|
+
//#endregion
|
|
1330
|
+
//#region extensions/discord/src/voice/realtime-speaker-session.ts
|
|
1324
1331
|
const logger$1 = createSubsystemLogger("discord/voice");
|
|
1325
1332
|
const DISCORD_REALTIME_DUPLICATE_ERROR_SUPPRESS_MS = 6e4;
|
|
1326
1333
|
const discordRealtimeTalkPayload = () => ({});
|
|
@@ -1750,7 +1757,8 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1750
1757
|
this.lastRealtimeError.suppressed = 0;
|
|
1751
1758
|
}
|
|
1752
1759
|
};
|
|
1753
|
-
|
|
1760
|
+
//#endregion
|
|
1761
|
+
//#region extensions/discord/src/voice/realtime-session.runtime.ts
|
|
1754
1762
|
const logger = createSubsystemLogger("discord/voice");
|
|
1755
1763
|
const MAX_REALTIME_SPEAKERS = 8;
|
|
1756
1764
|
const REALTIME_SPEAKER_IDLE_MS = 6e4;
|
|
@@ -2087,4 +2095,5 @@ var DiscordRealtimeVoiceSession = class {
|
|
|
2087
2095
|
logger.info(`discord voice: realtime speaker retired user=${speaker.userId} reason=${reason}${reason === "input-timeout" ? "; idle speaker input expired; speak again to reconnect" : ""}`);
|
|
2088
2096
|
}
|
|
2089
2097
|
};
|
|
2098
|
+
//#endregion
|
|
2090
2099
|
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
|
+
//#region 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,7 +41,8 @@ function serializeDiscordAudioError(error) {
|
|
|
41
41
|
function restoreDiscordAudioError(error) {
|
|
42
42
|
return Object.assign(new Error(error.message), error);
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region extensions/discord/src/voice/audio.ts
|
|
45
46
|
const SAMPLE_RATE = 48e3;
|
|
46
47
|
const CHANNELS = 2;
|
|
47
48
|
const BIT_DEPTH = 16;
|
|
@@ -390,7 +391,8 @@ async function writeVoiceWavFile(chunks) {
|
|
|
390
391
|
throw error;
|
|
391
392
|
}
|
|
392
393
|
}
|
|
393
|
-
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region extensions/discord/src/voice/receive-recovery.ts
|
|
394
396
|
const DECRYPT_FAILURE_WINDOW_MS = 3e4;
|
|
395
397
|
const DECRYPT_FAILURE_RECONNECT_THRESHOLD = 3;
|
|
396
398
|
const DECRYPT_FAILURE_MARKER = "DecryptionFailed(";
|
|
@@ -474,4 +476,5 @@ function enableDaveReceivePassthrough(params) {
|
|
|
474
476
|
return false;
|
|
475
477
|
}
|
|
476
478
|
}
|
|
479
|
+
//#endregion
|
|
477
480
|
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-CI77288n.mjs → resolve-allowlist-common-cIjtqh2F.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { h as normalizeDiscordToken } from "./accounts-
|
|
2
|
-
import { o as normalizeDiscordSlug } from "./allow-list-
|
|
3
|
-
import { r as fetchDiscord } from "./api-
|
|
4
|
-
|
|
1
|
+
import { h as normalizeDiscordToken } from "./accounts-ljrzXBJi.mjs";
|
|
2
|
+
import { o as normalizeDiscordSlug } from "./allow-list-BKqOldGy.mjs";
|
|
3
|
+
import { r as fetchDiscord } from "./api-DqmMUZau.mjs";
|
|
4
|
+
//#region extensions/discord/src/guilds.ts
|
|
5
5
|
async function listGuilds(token, fetcher, options) {
|
|
6
6
|
return (await fetchDiscord("/users/@me/guilds", token, fetcher, options)).flatMap((guild) => typeof guild.id === "string" && typeof guild.name === "string" ? [{
|
|
7
7
|
id: guild.id,
|
|
@@ -9,7 +9,8 @@ async function listGuilds(token, fetcher, options) {
|
|
|
9
9
|
slug: normalizeDiscordSlug(guild.name)
|
|
10
10
|
}] : []);
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region extensions/discord/src/resolve-allowlist-common.ts
|
|
13
14
|
function resolveDiscordAllowlistToken(token) {
|
|
14
15
|
return normalizeDiscordToken(token, "channels.discord.token");
|
|
15
16
|
}
|
|
@@ -61,4 +62,5 @@ function parseDiscordAllowlistInput(raw, kind) {
|
|
|
61
62
|
guildOnly: true
|
|
62
63
|
} : { name: trimmed.replace(/^@/, "") };
|
|
63
64
|
}
|
|
65
|
+
//#endregion
|
|
64
66
|
export { listGuilds as i, parseDiscordAllowlistInput as n, resolveDiscordAllowlistToken as r, filterDiscordGuilds as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { A as isDiscordThreadChannelType, o as normalizeDiscordSlug } from "./allow-list-
|
|
3
|
-
import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
4
|
-
import { i as listGuilds, n as parseDiscordAllowlistInput, r as resolveDiscordAllowlistToken, t as filterDiscordGuilds } from "./resolve-allowlist-common-
|
|
5
|
-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { A as isDiscordThreadChannelType, a as normalizeDiscordDisplaySlug, o as normalizeDiscordSlug } from "./allow-list-BKqOldGy.mjs";
|
|
3
|
+
import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-DqmMUZau.mjs";
|
|
4
|
+
import { i as listGuilds, n as parseDiscordAllowlistInput, r as resolveDiscordAllowlistToken, t as filterDiscordGuilds } from "./resolve-allowlist-common-cIjtqh2F.mjs";
|
|
5
|
+
//#region extensions/discord/src/resolve-channels.ts
|
|
6
6
|
var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveDiscordChannelAllowlist: () => resolveDiscordChannelAllowlist });
|
|
7
7
|
async function listGuildChannels(token, fetcher, guildId) {
|
|
8
8
|
return (await fetchDiscord(`/guilds/${guildId}/channels`, token, fetcher, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS })).map((channel) => {
|
|
@@ -80,8 +80,10 @@ async function resolveDiscordChannelAllowlist(params) {
|
|
|
80
80
|
const ids = channels.filter((channel) => channel.id === query);
|
|
81
81
|
if (ids.length) return ids;
|
|
82
82
|
}
|
|
83
|
-
const slug =
|
|
84
|
-
|
|
83
|
+
const slug = normalizeDiscordDisplaySlug(query);
|
|
84
|
+
if (!slug) return [];
|
|
85
|
+
const matchSlug = normalizeDiscordSlug(query) === slug ? normalizeDiscordSlug : normalizeDiscordDisplaySlug;
|
|
86
|
+
return channels.filter((channel) => matchSlug(channel.name) === slug);
|
|
85
87
|
}
|
|
86
88
|
const resolveEntry = async (input) => {
|
|
87
89
|
const parsed = parseDiscordAllowlistInput(input, "channel");
|
|
@@ -169,4 +171,5 @@ async function resolveDiscordChannelAllowlist(params) {
|
|
|
169
171
|
for (const input of params.entries) results.push(await resolveEntry(input));
|
|
170
172
|
return results;
|
|
171
173
|
}
|
|
174
|
+
//#endregion
|
|
172
175
|
export { resolve_channels_exports as n, resolveDiscordChannelAllowlist as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
3
|
-
import { i as listGuilds, n as parseDiscordAllowlistInput, r as resolveDiscordAllowlistToken, t as filterDiscordGuilds } from "./resolve-allowlist-common-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-DqmMUZau.mjs";
|
|
3
|
+
import { i as listGuilds, n as parseDiscordAllowlistInput, r as resolveDiscordAllowlistToken, t as filterDiscordGuilds } from "./resolve-allowlist-common-cIjtqh2F.mjs";
|
|
4
4
|
import { normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
|
|
5
|
+
//#region extensions/discord/src/resolve-users.ts
|
|
6
6
|
var resolve_users_exports = /* @__PURE__ */ __exportAll({ resolveDiscordUserAllowlist: () => resolveDiscordUserAllowlist });
|
|
7
7
|
function scoreDiscordMember(member, query) {
|
|
8
8
|
const q = query.toLowerCase();
|
|
@@ -85,4 +85,5 @@ async function resolveDiscordUserAllowlist(params) {
|
|
|
85
85
|
}
|
|
86
86
|
return results;
|
|
87
87
|
}
|
|
88
|
+
//#endregion
|
|
88
89
|
export { resolve_users_exports as n, resolveDiscordUserAllowlist as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -24,4 +24,5 @@ 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
|
|
27
28
|
export { __reExport as n, __exportAll as t };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
2
|
-
|
|
2
|
+
//#region 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
|
|
7
8
|
export { getOptionalDiscordRuntime as n, setDiscordRuntime as r, getDiscordRuntime as t };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { c as resolveDefaultDiscordAccountId, s as mergeDiscordAccountConfig, t as createDiscordActionGate } from "./accounts-
|
|
2
|
-
import { A as isDiscordThreadChannelType, l as resolveDiscordChannelConfigWithFallback, n as hasConfiguredDiscordChannels, o as normalizeDiscordSlug, r as isDiscordGroupAllowedByPolicy, y as resolveGroupDmAllow } from "./allow-list-
|
|
3
|
-
import { C as hasAnyChannelPermissionDiscord, F as createDiscordRuntimeAccountContext, U 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-
|
|
4
|
-
import { n as getPresence } from "./presence-cache-
|
|
5
|
-
import { a as createReusableDiscordReplyReference, s as resolveDiscordReplyReference } from "./send.receipt-
|
|
6
|
-
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-
|
|
7
|
-
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-
|
|
8
|
-
import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
9
|
-
import "./targets-
|
|
10
|
-
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-
|
|
11
|
-
import { r as sendDiscordComponentMessage } from "./send.components-
|
|
1
|
+
import { c as resolveDefaultDiscordAccountId, s as mergeDiscordAccountConfig, t as createDiscordActionGate } from "./accounts-ljrzXBJi.mjs";
|
|
2
|
+
import { A as isDiscordThreadChannelType, l as resolveDiscordChannelConfigWithFallback, n as hasConfiguredDiscordChannels, o as normalizeDiscordSlug, r as isDiscordGroupAllowedByPolicy, y as resolveGroupDmAllow } from "./allow-list-BKqOldGy.mjs";
|
|
3
|
+
import { C as hasAnyChannelPermissionDiscord, F as createDiscordRuntimeAccountContext, U 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-CnlMgoqQ.mjs";
|
|
4
|
+
import { n as getPresence } from "./presence-cache-DCeTsL73.mjs";
|
|
5
|
+
import { a as createReusableDiscordReplyReference, s as resolveDiscordReplyReference } from "./send.receipt-C18khRYH.mjs";
|
|
6
|
+
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
7
|
+
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-da6ENJ9f.mjs";
|
|
8
|
+
import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-qZ3iK3Vq.mjs";
|
|
9
|
+
import "./targets-UWWZ6gF7.mjs";
|
|
10
|
+
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-Du9NhD8h.mjs";
|
|
11
|
+
import { r as sendDiscordComponentMessage } from "./send.components-CWZUuGvA.mjs";
|
|
12
12
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
13
13
|
import { asBoolean, asOptionalRecord, isRecord, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
14
14
|
import { assertMediaNotDataUrl, jsonResult, parseAvailableTags, readNonNegativeIntegerParam, readPositiveIntegerParam, readReactionParams, readStringArrayParam, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -17,7 +17,7 @@ import { createChannelProgressDraftCompositor } from "openclaw/plugin-sdk/channe
|
|
|
17
17
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
18
18
|
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
19
19
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
20
|
-
|
|
20
|
+
//#region extensions/discord/src/actions/runtime.messaging.thread-list.ts
|
|
21
21
|
function readDiscordChannelStringField(value, ...keys) {
|
|
22
22
|
if (!value || typeof value !== "object") return;
|
|
23
23
|
const record = value;
|
|
@@ -75,7 +75,8 @@ function filterDiscordActiveThreadList(params) {
|
|
|
75
75
|
})
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region extensions/discord/src/actions/runtime.shared.ts
|
|
79
80
|
/** Discord REST auto_archive_duration allowlist (minutes). */
|
|
80
81
|
const DISCORD_AUTO_ARCHIVE_MINUTES = /* @__PURE__ */ new Set([
|
|
81
82
|
60,
|
|
@@ -139,7 +140,8 @@ function readDiscordChannelMoveParams(params) {
|
|
|
139
140
|
position: readNonNegativeIntegerParam(params, "position")
|
|
140
141
|
};
|
|
141
142
|
}
|
|
142
|
-
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region extensions/discord/src/actions/runtime.messaging.shared.ts
|
|
143
145
|
function allowsAllDiscordGuildChannels(channels) {
|
|
144
146
|
const wildcard = channels?.["*"];
|
|
145
147
|
if (!wildcard || wildcard.enabled === false) return false;
|
|
@@ -494,7 +496,8 @@ function createDiscordMessagingActionContext(params) {
|
|
|
494
496
|
}
|
|
495
497
|
};
|
|
496
498
|
}
|
|
497
|
-
|
|
499
|
+
//#endregion
|
|
500
|
+
//#region extensions/discord/src/actions/runtime.guild.ts
|
|
498
501
|
const expressionPermissions = [PermissionFlagsBits.ManageGuildExpressions, PermissionFlagsBits.CreateGuildExpressions];
|
|
499
502
|
const channelGuard = {
|
|
500
503
|
gate: "channels",
|
|
@@ -872,7 +875,8 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
872
875
|
default: throw new Error(`Unknown action: ${action}`);
|
|
873
876
|
}
|
|
874
877
|
}
|
|
875
|
-
|
|
878
|
+
//#endregion
|
|
879
|
+
//#region extensions/discord/src/actions/runtime.messaging.messages.ts
|
|
876
880
|
function parseDiscordMessageLink(link) {
|
|
877
881
|
const match = link.trim().match(/^(?:https?:\/\/)?(?:ptb\.|canary\.)?discord(?:app)?\.com\/channels\/(\d+)\/(\d+)\/(\d+)(?:\/?|\?.*)$/i);
|
|
878
882
|
if (!match) throw new Error("Invalid Discord message link. Expected https://discord.com/channels/<guildId>/<channelId>/<messageId>.");
|
|
@@ -1026,7 +1030,8 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1026
1030
|
default: return;
|
|
1027
1031
|
}
|
|
1028
1032
|
}
|
|
1029
|
-
|
|
1033
|
+
//#endregion
|
|
1034
|
+
//#region extensions/discord/src/actions/runtime.messaging.reactions.ts
|
|
1030
1035
|
async function handleDiscordReactionMessagingAction(ctx) {
|
|
1031
1036
|
const action = ctx.action;
|
|
1032
1037
|
if (action !== "react" && action !== "reactions") return;
|
|
@@ -1057,7 +1062,8 @@ async function handleDiscordReactionMessagingAction(ctx) {
|
|
|
1057
1062
|
[remove ? "removed" : "added"]: emoji
|
|
1058
1063
|
});
|
|
1059
1064
|
}
|
|
1060
|
-
|
|
1065
|
+
//#endregion
|
|
1066
|
+
//#region extensions/discord/src/actions/runtime.messaging.send.ts
|
|
1061
1067
|
function resolveActionReplyReference(ctx, replyToId) {
|
|
1062
1068
|
const reply = ctx.options?.reply;
|
|
1063
1069
|
return reply ? resolveDiscordReplyReference({
|
|
@@ -1315,7 +1321,8 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1315
1321
|
default: return;
|
|
1316
1322
|
}
|
|
1317
1323
|
}
|
|
1318
|
-
|
|
1324
|
+
//#endregion
|
|
1325
|
+
//#region extensions/discord/src/actions/runtime.messaging.ts
|
|
1319
1326
|
async function handleDiscordMessagingAction(action, params, isActionEnabled, cfg, options) {
|
|
1320
1327
|
if (!cfg) throw new Error("Discord messaging actions require a resolved runtime config.");
|
|
1321
1328
|
const ctx = createDiscordMessagingActionContext({
|
|
@@ -1329,7 +1336,8 @@ async function handleDiscordMessagingAction(action, params, isActionEnabled, cfg
|
|
|
1329
1336
|
if (result == null) throw new Error(`Unknown action: ${action}`);
|
|
1330
1337
|
return result;
|
|
1331
1338
|
}
|
|
1332
|
-
|
|
1339
|
+
//#endregion
|
|
1340
|
+
//#region extensions/discord/src/actions/runtime.moderation-shared.ts
|
|
1333
1341
|
const moderationPermissions = {
|
|
1334
1342
|
timeout: PermissionFlagsBits.ModerateMembers,
|
|
1335
1343
|
kick: PermissionFlagsBits.KickMembers,
|
|
@@ -1356,7 +1364,8 @@ function readDiscordModerationCommand(action, params) {
|
|
|
1356
1364
|
})
|
|
1357
1365
|
};
|
|
1358
1366
|
}
|
|
1359
|
-
|
|
1367
|
+
//#endregion
|
|
1368
|
+
//#region extensions/discord/src/actions/runtime.moderation.ts
|
|
1360
1369
|
async function handleDiscordModerationAction(action, params, isActionEnabled, cfg) {
|
|
1361
1370
|
if (!isDiscordModerationAction(action)) throw new Error(`Unknown action: ${action}`);
|
|
1362
1371
|
if (!isActionEnabled("moderation", false)) throw new Error("Discord moderation is disabled.");
|
|
@@ -1395,7 +1404,8 @@ async function handleDiscordModerationAction(action, params, isActionEnabled, cf
|
|
|
1395
1404
|
}, withOpts());
|
|
1396
1405
|
return jsonResult({ ok: true });
|
|
1397
1406
|
}
|
|
1398
|
-
|
|
1407
|
+
//#endregion
|
|
1408
|
+
//#region extensions/discord/src/actions/runtime.presence.ts
|
|
1399
1409
|
const ACTIVITY_TYPE_MAP = /* @__PURE__ */ new Map([
|
|
1400
1410
|
["playing", 0],
|
|
1401
1411
|
["streaming", 1],
|
|
@@ -1454,7 +1464,8 @@ async function handleDiscordPresenceAction(action, params, isActionEnabled, cfg)
|
|
|
1454
1464
|
}, a.url ? { url: a.url } : {}, a.state ? { state: a.state } : {}))
|
|
1455
1465
|
});
|
|
1456
1466
|
}
|
|
1457
|
-
|
|
1467
|
+
//#endregion
|
|
1468
|
+
//#region extensions/discord/src/actions/runtime.ts
|
|
1458
1469
|
const messagingActions = /* @__PURE__ */ new Set([
|
|
1459
1470
|
"react",
|
|
1460
1471
|
"reactions",
|
|
@@ -1487,4 +1498,5 @@ async function handleDiscordAction(params, cfg, options) {
|
|
|
1487
1498
|
if (action === "setPresence") return await handleDiscordPresenceAction(action, params, isActionEnabled, cfg);
|
|
1488
1499
|
throw new Error(`Unknown action: ${action}`);
|
|
1489
1500
|
}
|
|
1501
|
+
//#endregion
|
|
1490
1502
|
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,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-B4FMCO8f.mjs";
|
|
2
|
+
//#region 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,7 +8,8 @@ function isRecord(value) {
|
|
|
8
8
|
function asNullableRecord(value) {
|
|
9
9
|
return isRecord(value) ? value : null;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/config/channel-config-normalization.ts
|
|
12
13
|
/** Applies one channel-specific doctor migration to every object-shaped account. */
|
|
13
14
|
function normalizeChannelAccounts(params) {
|
|
14
15
|
const rawAccounts = asNullableRecord(params.entry.accounts);
|
|
@@ -84,7 +85,8 @@ function normalizeChannelConfigEntries(params) {
|
|
|
84
85
|
changes
|
|
85
86
|
};
|
|
86
87
|
}
|
|
87
|
-
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/plugin-sdk/legacy-webhook-listener-migration.ts
|
|
88
90
|
/** Preserve explicitly configured webhook listeners while moving ingress onto Gateway routes. */
|
|
89
91
|
function createLegacyWebhookListenerDoctorContract(params) {
|
|
90
92
|
const portKey = params.portKey ?? "webhookPort";
|
|
@@ -154,8 +156,10 @@ function createLegacyWebhookListenerDoctorContract(params) {
|
|
|
154
156
|
}
|
|
155
157
|
};
|
|
156
158
|
}
|
|
157
|
-
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
|
|
158
161
|
var runtime_doctor_migrations_exports = /* @__PURE__ */ __exportAll({ createLegacyWebhookListenerDoctorContract: () => createLegacyWebhookListenerDoctorContract });
|
|
159
162
|
import * as import_openclaw_plugin_sdk_runtime_doctor_migrations from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
160
163
|
__reExport(runtime_doctor_migrations_exports, import_openclaw_plugin_sdk_runtime_doctor_migrations);
|
|
164
|
+
//#endregion
|
|
161
165
|
export { runtime_doctor_migrations_exports as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as selectDiscordActivitiesRuntimeConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, r as isDiscordAccountEnabledForRuntime } from "./accounts-
|
|
2
|
-
import { z as resolveDiscordProxyFetchForAccount } from "./send.shared-
|
|
1
|
+
import { _ as selectDiscordActivitiesRuntimeConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, r as isDiscordAccountEnabledForRuntime } from "./accounts-ljrzXBJi.mjs";
|
|
2
|
+
import { z as resolveDiscordProxyFetchForAccount } from "./send.shared-CnlMgoqQ.mjs";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
-
|
|
4
|
+
//#region 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,7 +19,8 @@ function resolveDiscordActivitiesConfig(account, env = process.env) {
|
|
|
19
19
|
...applicationId ? { applicationId } : {}
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region extensions/discord/src/activities/runtime.ts
|
|
23
24
|
var DiscordActivitiesRuntime = class {
|
|
24
25
|
constructor(store, startupConfig, getCurrentConfig, env = process.env) {
|
|
25
26
|
this.store = store;
|
|
@@ -72,4 +73,5 @@ function setDiscordActivitiesRuntime(runtime) {
|
|
|
72
73
|
function getDiscordActivitiesRuntime() {
|
|
73
74
|
return activeRuntime;
|
|
74
75
|
}
|
|
76
|
+
//#endregion
|
|
75
77
|
export { getDiscordActivitiesRuntime as n, setDiscordActivitiesRuntime as r, DiscordActivitiesRuntime as t };
|
package/dist/.setup/{secret-config-contract-B7UlqVYr.mjs → secret-config-contract-z6FhbT8E.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
2
2
|
import { collectNestedChannelFieldAssignments, collectSimpleChannelFieldAssignments, createChannelSecretTargetRegistryEntries, getChannelSurface, hasConfiguredSecretInputValue, isBaseFieldActiveForChannelSurface, isEnabledFlag, isRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
3
3
|
import { collectNestedChannelTtsAssignments } from "openclaw/plugin-sdk/channel-secret-tts-runtime";
|
|
4
|
-
|
|
4
|
+
//#region extensions/discord/src/secret-config-contract.ts
|
|
5
5
|
function discordRealtimeVoiceSecretOwnerId(accountId, providerId) {
|
|
6
6
|
return `discord:voice:realtime:${normalizeAccountId(accountId)}:${providerId}`;
|
|
7
7
|
}
|
|
@@ -74,4 +74,5 @@ function collectRuntimeConfigAssignments(params) {
|
|
|
74
74
|
accountInactiveReason: "Discord account is disabled, voice is disabled, or voice mode is stt-tts for this account."
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
+
//#endregion
|
|
77
78
|
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-B4FMCO8f.mjs";
|
|
2
|
+
import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.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
|
+
//#region 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,4 +116,5 @@ async function collectDiscordSecurityAuditFindings(params) {
|
|
|
116
116
|
});
|
|
117
117
|
return findings;
|
|
118
118
|
}
|
|
119
|
+
//#endregion
|
|
119
120
|
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
|
+
//#region 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,4 +15,5 @@ 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
|
|
18
19
|
export { unsupportedSecretRefSurfacePatterns as n, collectUnsupportedSecretRefConfigCandidates as t };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildMutableAllowEntryDetector } from "openclaw/plugin-sdk/channel-policy";
|
|
2
|
-
|
|
2
|
+
//#region extensions/discord/src/security-doctor.ts
|
|
3
3
|
const isDiscordMutableAllowEntry = buildMutableAllowEntryDetector({ stableIdPattern: /^(?:\d+|<@!?\d+>|(?:discord|user|pk):.+)$/ });
|
|
4
|
+
//#endregion
|
|
4
5
|
export { isDiscordMutableAllowEntry as t };
|