@openclaw/discord 2026.9.1 → 2026.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-E-segZn6.js → activities-api-CTcGq3Hf.js} +4 -4
- package/dist/activities-api.js +1 -1
- package/dist/{allow-list-C2JuH-R0.js → allow-list-DBTtR2dz.js} +3 -29
- package/dist/api.js +12 -12
- package/dist/{approval-handler.runtime-CW5k3mSa.js → approval-handler.runtime-DUSe5fyH.js} +5 -5
- package/dist/{audit-B9rydv5a.js → audit-DpPfwoJM.js} +4 -4
- package/dist/{channel-D93LnbTE.js → channel-BHajPgwR.js} +16 -16
- package/dist/{channel-actions.runtime-DMFv4doE.js → channel-actions.runtime-DS8pXo0S.js} +29 -32
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-DTL7kPOM.js → channel.setup-BWmMe1tT.js} +3 -3
- package/dist/command-owners-D78sAoOz.js +10 -0
- package/dist/{components-DmXYIQ26.js → components-BimX47Mq.js} +1 -1
- package/dist/{conversation-binding-route-24afmvEC.js → conversation-binding-route-DuR5NGIx.js} +1 -1
- package/dist/{directory-config-BD4YL7wT.js → directory-config-CD2v2Szs.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-BrFVc1Ds.js → directory-live-DaJzWJ2N.js} +2 -2
- package/dist/{doctor-BUB41_lr.js → doctor-D4HH1inA.js} +6 -3
- package/dist/doctor-contract-api.js +28 -26
- package/dist/{handle-action.guild-admin-B0egstYq.js → handle-action.guild-admin-4We6wWQU.js} +6 -3
- package/dist/index.js +1 -1
- package/dist/{ingress-identity-BCzfPPYM.js → ingress-identity-XNmW-mZS.js} +1 -1
- package/dist/{message-handler-Qdw9c0j4.js → message-handler-DhgBabyU.js} +52 -65
- package/dist/{message-handler.preflight-Dxi2yBfR.js → message-handler.preflight-oZ7dQCd0.js} +12 -12
- package/dist/{message-handler.process-BYDjtxZJ.js → message-handler.process-BzCYf1pa.js} +14 -14
- package/dist/{message-text-BRVqYm-t.js → message-text-DK4NnBg-.js} +1 -1
- package/dist/{outbound-adapter-DEhthWTk.js → outbound-adapter-CtggmGh9.js} +6 -6
- package/dist/{outbound-components-DehyxvA4.js → outbound-components-Dn8SJWMS.js} +3 -3
- package/dist/{outbound-session-route-BFGRF9fE.js → outbound-session-route-Q_HEusBQ.js} +5 -6
- package/dist/{owner-access-yc1sX7Gx.js → owner-access-Cp8r6Ipf.js} +3 -2
- package/dist/{pluralkit-XmmAHoV6.js → pluralkit-BY75YcK0.js} +1 -1
- package/dist/{provider-session.runtime-BA2BPyZ4.js → provider-session.runtime-BL2lHBH7.js} +3 -3
- package/dist/{provider-DuDtKbF8.js → provider-uKmmrDM4.js} +28 -28
- package/dist/provider.runtime-C-IkWF2w.js +2 -0
- package/dist/{realtime-session.runtime-DgSbX6ay.js → realtime-session.runtime-CGYm1t_0.js} +705 -295
- package/dist/{resolve-allowlist-common-BJ5UZNNT.js → resolve-allowlist-common-sKIKy-cF.js} +1 -1
- package/dist/{resolve-channels-CYseD5Uw.js → resolve-channels-CoiMlWy0.js} +3 -3
- package/dist/{resolve-users-DrmhDrqm.js → resolve-users-DJpiokfW.js} +2 -2
- package/dist/{retry-BNCxiyyR.js → retry-DQt1zDgH.js} +238 -184
- package/dist/{runtime-DB7Fb6AU.js → runtime-BHsdEdr5.js} +1 -1
- package/dist/{runtime-BbWNtfyq.js → runtime-Ghtfh5ZA.js} +32 -24
- package/dist/runtime-api.js +18 -18
- package/dist/{send-BnTEIeLE.js → send-CZeWKUiA.js} +3 -3
- package/dist/{send.components-BWVEcjRP.js → send.components-BG5IDABj.js} +4 -4
- package/dist/{send.outbound-b5xwHTlL.js → send.outbound-DHuFUL6W.js} +10 -44
- package/dist/{send.shared-5vxBTagO.js → send.shared-B0n_fWzu.js} +62 -141
- package/dist/{sender-identity-Dt0imZyY.js → sender-identity-B8Ncfi63.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-BSJWHEMA.js → shared-C3dKun_X.js} +6 -3
- package/dist/{subagent-hooks-IzQKX4RQ.js → subagent-hooks-ZoQXEI1E.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-BOiDS8b3.js → system-events-DFF_awl7.js} +2 -2
- package/dist/{target-resolver-BVI8xSSC.js → target-resolver-DLtHDwMK.js} +2 -2
- package/dist/targets-BObRyaKX.js +3 -0
- package/dist/{thread-bindings-D7mcaXQC.js → thread-bindings-DKvsNjQR.js} +5 -5
- package/dist/{thread-bindings.manager-B1oySiVc.js → thread-bindings.manager-pbbRT5gb.js} +5 -5
- package/dist/{thread-bindings.session-updates-CC7HoQvt.js → thread-bindings.session-updates-t6jeFB1-.js} +1 -1
- package/dist/{thread-bindings.state-D8OMdk4O.js → thread-bindings.state-DtgOqsbX.js} +34 -1
- package/dist/{threading-OQnL-0Zx.js → threading-BCx49X-6.js} +3 -3
- package/dist/{transcripts-source-D8lH7AkN.js → transcripts-source-Dc6Nnli5.js} +48 -5
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-C9q0AQMb.js → typing-CuopV-Hi.js} +1 -1
- package/dist/{voice-runtime-Dfhjh1tV.js → voice-runtime-BQnILUbG.js} +82 -35
- package/node_modules/@discordjs/voice/node_modules/@types/node/README.md +1 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/buffer.buffer.d.ts +5 -5
- package/node_modules/@discordjs/voice/node_modules/@types/node/crypto.d.ts +2 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/http.d.ts +16 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/http2.d.ts +10 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/package.json +2 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/process.d.ts +52 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/quic.d.ts +210 -28
- package/node_modules/@discordjs/voice/node_modules/@types/node/sqlite.d.ts +6 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/test.d.ts +36 -0
- package/node_modules/typebox/build/format/json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer.mjs +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/system/memory/assign.mjs +2 -1
- package/node_modules/typebox/build/system/memory/create.mjs +3 -4
- package/node_modules/typebox/build/system/memory/discard.mjs +2 -2
- package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
- package/node_modules/typebox/build/system/memory/update.mjs +3 -2
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/undici/docs/docs/api/Client.md +4 -0
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
- package/node_modules/undici/docs/docs/api/EventSource.md +4 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
- package/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
- package/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/undici/lib/dispatcher/agent.js +7 -2
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
- package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +43 -3
- package/node_modules/undici/lib/dispatcher/client.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
- package/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +10 -3
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
- package/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +91 -21
- package/node_modules/undici/lib/handler/cache-handler.js +29 -5
- package/node_modules/undici/lib/handler/decorator-handler.js +7 -1
- package/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
- package/node_modules/undici/lib/handler/redirect-handler.js +21 -4
- package/node_modules/undici/lib/handler/retry-handler.js +148 -30
- package/node_modules/undici/lib/interceptor/cache.js +65 -12
- package/node_modules/undici/lib/interceptor/decompress.js +115 -13
- package/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/undici/lib/interceptor/dns.js +7 -0
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/mock/mock-agent.js +13 -1
- package/node_modules/undici/lib/mock/mock-utils.js +11 -10
- package/node_modules/undici/lib/util/cache.js +45 -3
- package/node_modules/undici/lib/web/cookies/parse.js +150 -147
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
- package/node_modules/undici/lib/web/fetch/index.js +6 -0
- package/node_modules/undici/lib/web/fetch/request.js +2 -3
- package/node_modules/undici/lib/web/fetch/util.js +6 -1
- package/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/client.d.ts +10 -0
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/node_modules/undici/types/mock-agent.d.ts +11 -10
- package/node_modules/undici/types/socks5-proxy-agent.d.ts +2 -0
- package/openclaw.plugin.json +1 -2
- package/package.json +6 -6
- package/dist/provider.runtime-Db8YwZBv.js +0 -2
- package/dist/targets-DbxVbq8k.js +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Et as createThread, I as DiscordError, Mt as getChannelMessage, b as discord_exports, kt as editChannel, sn as __exportAll } from "./retry-
|
|
1
|
+
import { Et as createThread, I as DiscordError, Mt as getChannelMessage, b as discord_exports, kt as editChannel, sn as __exportAll } from "./retry-DQt1zDgH.js";
|
|
2
2
|
import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
|
|
3
|
-
import { d as resolveDiscordChannelParentSafe, l as resolveDiscordChannelNameSafe, s as resolveDiscordChannelIdSafe, u as resolveDiscordChannelParentIdSafe } from "./thread-bindings.manager-
|
|
4
|
-
import { a as formatDiscordMediaText, h as resolveDiscordMessageChannelId, m as resolveDiscordChannelInfo, n as resolveDiscordForwardedMessagesTextFromSnapshots, t as resolveDiscordEmbedText } from "./message-text-
|
|
3
|
+
import { d as resolveDiscordChannelParentSafe, l as resolveDiscordChannelNameSafe, s as resolveDiscordChannelIdSafe, u as resolveDiscordChannelParentIdSafe } from "./thread-bindings.manager-pbbRT5gb.js";
|
|
4
|
+
import { a as formatDiscordMediaText, h as resolveDiscordMessageChannelId, m as resolveDiscordChannelInfo, n as resolveDiscordForwardedMessagesTextFromSnapshots, t as resolveDiscordEmbedText } from "./message-text-DK4NnBg-.js";
|
|
5
5
|
import { buildAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { sn as __exportAll } from "./retry-
|
|
1
|
+
import { sn as __exportAll } from "./retry-DQt1zDgH.js";
|
|
2
2
|
import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount } from "./accounts-CwJQoLjM.js";
|
|
3
|
-
import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-
|
|
3
|
+
import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-Cp8r6Ipf.js";
|
|
4
4
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
5
5
|
import { summarizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -77,7 +77,7 @@ const resolveDiscordTranscriptsAccountId = ({ cfg, source }) => {
|
|
|
77
77
|
async function waitForManager(request) {
|
|
78
78
|
const accountResolution = resolveDiscordTranscriptsAccountId({
|
|
79
79
|
cfg: request.cfg,
|
|
80
|
-
source: request.
|
|
80
|
+
source: request.source
|
|
81
81
|
});
|
|
82
82
|
if (!accountResolution.ok) return accountResolution;
|
|
83
83
|
const accountId = accountResolution.value;
|
|
@@ -182,7 +182,7 @@ const discordVoiceTranscriptsSourceProvider = {
|
|
|
182
182
|
},
|
|
183
183
|
name: "Discord Voice",
|
|
184
184
|
sourceKinds: ["live-audio"],
|
|
185
|
-
async
|
|
185
|
+
async watchOccupancy(request) {
|
|
186
186
|
const managerResolution = await waitForManager(request);
|
|
187
187
|
if (!managerResolution.ok) return managerResolution;
|
|
188
188
|
const manager = managerResolution.value;
|
|
@@ -190,6 +190,45 @@ const discordVoiceTranscriptsSourceProvider = {
|
|
|
190
190
|
ok: false,
|
|
191
191
|
error: "Discord voice manager is not available."
|
|
192
192
|
};
|
|
193
|
+
if (request.abortSignal?.aborted) return {
|
|
194
|
+
ok: false,
|
|
195
|
+
error: "Discord transcripts occupancy watch aborted."
|
|
196
|
+
};
|
|
197
|
+
const guildId = request.source.guildId?.trim();
|
|
198
|
+
const channelId = request.source.channelId?.trim();
|
|
199
|
+
if (!guildId || !channelId) return {
|
|
200
|
+
ok: false,
|
|
201
|
+
error: "Discord transcripts require guildId and channelId."
|
|
202
|
+
};
|
|
203
|
+
const unsubscribe = manager.watchChannelOccupancy({
|
|
204
|
+
guildId,
|
|
205
|
+
channelId
|
|
206
|
+
}, ({ occupied }) => {
|
|
207
|
+
if (occupied) request.onOccupied();
|
|
208
|
+
else request.onEmpty();
|
|
209
|
+
});
|
|
210
|
+
const stop = () => {
|
|
211
|
+
unsubscribe();
|
|
212
|
+
request.abortSignal?.removeEventListener("abort", stop);
|
|
213
|
+
};
|
|
214
|
+
request.abortSignal?.addEventListener("abort", stop, { once: true });
|
|
215
|
+
if (request.abortSignal?.aborted) stop();
|
|
216
|
+
return {
|
|
217
|
+
ok: true,
|
|
218
|
+
value: { stop }
|
|
219
|
+
};
|
|
220
|
+
},
|
|
221
|
+
async start(request) {
|
|
222
|
+
const managerResolution = await waitForManager({
|
|
223
|
+
...request,
|
|
224
|
+
source: request.session.source
|
|
225
|
+
});
|
|
226
|
+
if (!managerResolution.ok) return managerResolution;
|
|
227
|
+
const manager = managerResolution.value;
|
|
228
|
+
if (!manager) return {
|
|
229
|
+
ok: false,
|
|
230
|
+
error: "Discord voice manager is not available."
|
|
231
|
+
};
|
|
193
232
|
if (request.abortSignal?.aborted) return {
|
|
194
233
|
ok: false,
|
|
195
234
|
error: "Discord transcripts start aborted."
|
|
@@ -216,9 +255,13 @@ const discordVoiceTranscriptsSourceProvider = {
|
|
|
216
255
|
ok: false,
|
|
217
256
|
error: joined.message
|
|
218
257
|
};
|
|
258
|
+
const title = joined.channelName?.trim();
|
|
219
259
|
return {
|
|
220
260
|
ok: true,
|
|
221
|
-
session: request.session
|
|
261
|
+
session: !request.session.title && title ? {
|
|
262
|
+
...request.session,
|
|
263
|
+
title
|
|
264
|
+
} : request.session
|
|
222
265
|
};
|
|
223
266
|
},
|
|
224
267
|
async stop(request) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
1
|
+
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-Dc6Nnli5.js";
|
|
2
2
|
//#region extensions/discord/transcripts-source-api.ts
|
|
3
3
|
function registerDiscordTranscriptSourceProvider(api) {
|
|
4
4
|
api.registerTranscriptSourceProvider(discordVoiceTranscriptsSourceProvider);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sn as __exportAll, zt as sendChannelTyping } from "./retry-
|
|
1
|
+
import { sn as __exportAll, zt as sendChannelTyping } from "./retry-DQt1zDgH.js";
|
|
2
2
|
import { c as raceWithTimeout } from "./timeouts-D86uWLt_.js";
|
|
3
3
|
//#region extensions/discord/src/monitor/typing.ts
|
|
4
4
|
var typing_exports = /* @__PURE__ */ __exportAll({ sendTyping: () => sendTyping });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { M as VoiceStateUpdateListener, O as ReadyListener, R as isUnknownDiscordVoiceStateError, Xt as getGuildVoiceState, b as discord_exports, k as ResumedListener, sn as __exportAll, v as parseDiscordTarget } from "./retry-
|
|
1
|
+
import { M as VoiceStateUpdateListener, O as ReadyListener, R as isUnknownDiscordVoiceStateError, Xt as getGuildVoiceState, b as discord_exports, k as ResumedListener, sn as __exportAll, v as parseDiscordTarget } from "./retry-DQt1zDgH.js";
|
|
2
2
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
3
|
-
import { a as normalizeDiscordSlug,
|
|
4
|
-
import { a as formatMention } from "./send.outbound-
|
|
5
|
-
import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-
|
|
6
|
-
import { b as resolveFetchedDiscordThreadLikeChannelContext, m as buildDiscordGroupSystemPrompt } from "./provider-
|
|
3
|
+
import { a as normalizeDiscordSlug, b as formatDiscordUserTag, m as resolveDiscordOwnerAccess } from "./allow-list-DBTtR2dz.js";
|
|
4
|
+
import { a as formatMention } from "./send.outbound-DHuFUL6W.js";
|
|
5
|
+
import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-Cp8r6Ipf.js";
|
|
6
|
+
import { b as resolveFetchedDiscordThreadLikeChannelContext, m as buildDiscordGroupSystemPrompt } from "./provider-uKmmrDM4.js";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -25,6 +25,14 @@ import { Readable, Transform } from "node:stream";
|
|
|
25
25
|
import { StringDecoder } from "node:string_decoder";
|
|
26
26
|
import { Application, OpusError, createDecoder, createEncoder } from "libopus-wasm";
|
|
27
27
|
import { resolveRealtimeBootstrapContextInstructions } from "openclaw/plugin-sdk/realtime-bootstrap-context";
|
|
28
|
+
//#region extensions/discord/src/voice/sdk-runtime.ts
|
|
29
|
+
let cachedDiscordVoiceSdk = null;
|
|
30
|
+
function loadDiscordVoiceSdk() {
|
|
31
|
+
if (cachedDiscordVoiceSdk) return cachedDiscordVoiceSdk;
|
|
32
|
+
cachedDiscordVoiceSdk = createRequire(import.meta.url)("@discordjs/voice");
|
|
33
|
+
return cachedDiscordVoiceSdk;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
28
36
|
//#region extensions/discord/src/voice/log-preview.ts
|
|
29
37
|
const DISCORD_VOICE_LOG_PREVIEW_CHARS = 500;
|
|
30
38
|
function formatVoiceLogPreview(text) {
|
|
@@ -177,6 +185,7 @@ function createDiscordOpusPlaybackStream(input) {
|
|
|
177
185
|
var DiscordOpusEncodeStream = class extends Transform {
|
|
178
186
|
#buffer = Buffer.alloc(0);
|
|
179
187
|
#encoder;
|
|
188
|
+
#packetPcmBytes = /* @__PURE__ */ new WeakMap();
|
|
180
189
|
constructor() {
|
|
181
190
|
super({ readableObjectMode: true });
|
|
182
191
|
}
|
|
@@ -205,24 +214,35 @@ var DiscordOpusEncodeStream = class extends Transform {
|
|
|
205
214
|
}
|
|
206
215
|
_flush(done) {
|
|
207
216
|
try {
|
|
208
|
-
|
|
209
|
-
const frame = Buffer.alloc(DISCORD_OPUS_FRAME_BYTES);
|
|
210
|
-
this.#buffer.copy(frame);
|
|
211
|
-
this.#buffer = Buffer.alloc(0);
|
|
212
|
-
this.#encodeFrame(frame);
|
|
213
|
-
}
|
|
217
|
+
this.flushPartialFrame();
|
|
214
218
|
done();
|
|
215
219
|
} catch (err) {
|
|
216
220
|
done(err instanceof Error ? err : new Error(formatErrorMessage(err)));
|
|
217
221
|
}
|
|
218
222
|
}
|
|
223
|
+
flushPartialFrame() {
|
|
224
|
+
if (this.destroyed || this.#buffer.length === 0) return false;
|
|
225
|
+
const pcmBytes = this.#buffer.length;
|
|
226
|
+
const frame = Buffer.alloc(DISCORD_OPUS_FRAME_BYTES);
|
|
227
|
+
this.#buffer.copy(frame);
|
|
228
|
+
this.#buffer = Buffer.alloc(0);
|
|
229
|
+
this.#encodeFrame(frame, pcmBytes);
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
takePcmBytes(packet) {
|
|
233
|
+
const bytes = this.#packetPcmBytes.get(packet) ?? 0;
|
|
234
|
+
this.#packetPcmBytes.delete(packet);
|
|
235
|
+
return bytes;
|
|
236
|
+
}
|
|
219
237
|
_destroy(err, done) {
|
|
220
238
|
this.#encoder?.free();
|
|
221
239
|
this.#buffer = Buffer.alloc(0);
|
|
222
240
|
done(err);
|
|
223
241
|
}
|
|
224
|
-
#encodeFrame(frame) {
|
|
225
|
-
|
|
242
|
+
#encodeFrame(frame, pcmBytes = frame.length) {
|
|
243
|
+
const packet = Buffer.from(this.#encoder.encode(frame, { frameSize: DISCORD_OPUS_FRAME_SIZE }));
|
|
244
|
+
this.#packetPcmBytes.set(packet, pcmBytes);
|
|
245
|
+
this.push(packet);
|
|
226
246
|
}
|
|
227
247
|
};
|
|
228
248
|
function pcmInt16ToBuffer(pcm) {
|
|
@@ -343,14 +363,6 @@ function isVoiceChannel(type) {
|
|
|
343
363
|
return type === discord_exports.ChannelType.GuildVoice || type === discord_exports.ChannelType.GuildStageVoice;
|
|
344
364
|
}
|
|
345
365
|
//#endregion
|
|
346
|
-
//#region extensions/discord/src/voice/sdk-runtime.ts
|
|
347
|
-
let cachedDiscordVoiceSdk = null;
|
|
348
|
-
function loadDiscordVoiceSdk() {
|
|
349
|
-
if (cachedDiscordVoiceSdk) return cachedDiscordVoiceSdk;
|
|
350
|
-
cachedDiscordVoiceSdk = createRequire(import.meta.url)("@discordjs/voice");
|
|
351
|
-
return cachedDiscordVoiceSdk;
|
|
352
|
-
}
|
|
353
|
-
//#endregion
|
|
354
366
|
//#region extensions/discord/src/voice/ingress.ts
|
|
355
367
|
const DISCORD_VOICE_MESSAGE_PROVIDER = "discord-voice";
|
|
356
368
|
const logger$7 = createSubsystemLogger("discord/voice");
|
|
@@ -803,7 +815,11 @@ var DiscordVoiceSpeakerContextResolver = class {
|
|
|
803
815
|
label: identity.label,
|
|
804
816
|
name: identity.name,
|
|
805
817
|
tag: identity.tag,
|
|
806
|
-
senderIsOwner:
|
|
818
|
+
senderIsOwner: resolveDiscordOwnerAccess({
|
|
819
|
+
allowFrom: this.params.ownerAllowFrom,
|
|
820
|
+
sender: identity,
|
|
821
|
+
allowNameMatching: false
|
|
822
|
+
}).ownerAllowed
|
|
807
823
|
};
|
|
808
824
|
this.setCachedContext(guildId, userId, context);
|
|
809
825
|
return context;
|
|
@@ -839,17 +855,6 @@ var DiscordVoiceSpeakerContextResolver = class {
|
|
|
839
855
|
}
|
|
840
856
|
}
|
|
841
857
|
}
|
|
842
|
-
resolveIsOwner(identity) {
|
|
843
|
-
return resolveDiscordOwnerAccess({
|
|
844
|
-
allowFrom: this.params.ownerAllowFrom,
|
|
845
|
-
sender: {
|
|
846
|
-
id: identity.id,
|
|
847
|
-
name: identity.name,
|
|
848
|
-
tag: identity.tag
|
|
849
|
-
},
|
|
850
|
-
allowNameMatching: false
|
|
851
|
-
}).ownerAllowed;
|
|
852
|
-
}
|
|
853
858
|
resolveCacheKey(guildId, userId) {
|
|
854
859
|
return `${guildId}:${userId}`;
|
|
855
860
|
}
|
|
@@ -2367,7 +2372,7 @@ var DiscordVoiceSessions = class {
|
|
|
2367
2372
|
ok: false,
|
|
2368
2373
|
message: "Discord realtime voice session stopped before startup completed."
|
|
2369
2374
|
};
|
|
2370
|
-
const { DiscordRealtimeVoiceSession } = await import("./realtime-session.runtime-
|
|
2375
|
+
const { DiscordRealtimeVoiceSession } = await import("./realtime-session.runtime-CGYm1t_0.js");
|
|
2371
2376
|
const realtime = new DiscordRealtimeVoiceSession({
|
|
2372
2377
|
accountId: this.params.accountId,
|
|
2373
2378
|
bootstrapContextInstructions,
|
|
@@ -2506,6 +2511,7 @@ var DiscordVoiceManager = class {
|
|
|
2506
2511
|
this.joinTasks = /* @__PURE__ */ new Map();
|
|
2507
2512
|
this.autoJoinTasks = /* @__PURE__ */ new Map();
|
|
2508
2513
|
this.fatalAutoJoinFailures = /* @__PURE__ */ new Map();
|
|
2514
|
+
this.occupancyWatchers = /* @__PURE__ */ new Set();
|
|
2509
2515
|
this.destroyed = false;
|
|
2510
2516
|
this.client = params.client;
|
|
2511
2517
|
this.botUserId = params.botUserId;
|
|
@@ -2585,8 +2591,42 @@ var DiscordVoiceManager = class {
|
|
|
2585
2591
|
refreshGuildRoster(guildId) {
|
|
2586
2592
|
this.voiceSessions.refreshGuildRoster(guildId);
|
|
2587
2593
|
}
|
|
2594
|
+
watchChannelOccupancy(params, listener) {
|
|
2595
|
+
if (this.destroyed) return () => void 0;
|
|
2596
|
+
const guildId = params.guildId.trim();
|
|
2597
|
+
const channelId = params.channelId.trim();
|
|
2598
|
+
let wasOccupied = false;
|
|
2599
|
+
const watcher = {
|
|
2600
|
+
guildId,
|
|
2601
|
+
refresh: () => {
|
|
2602
|
+
const states = listDiscordVoiceParticipantStates({
|
|
2603
|
+
client: this.client,
|
|
2604
|
+
guildId,
|
|
2605
|
+
channelId
|
|
2606
|
+
});
|
|
2607
|
+
if (states === null) return;
|
|
2608
|
+
const occupied = countDiscordVoiceHumanParticipants({
|
|
2609
|
+
states,
|
|
2610
|
+
botUserId: this.botUserId
|
|
2611
|
+
}) > 0;
|
|
2612
|
+
if (occupied !== wasOccupied) {
|
|
2613
|
+
wasOccupied = occupied;
|
|
2614
|
+
listener({ occupied });
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
};
|
|
2618
|
+
this.occupancyWatchers.add(watcher);
|
|
2619
|
+
watcher.refresh();
|
|
2620
|
+
return () => {
|
|
2621
|
+
this.occupancyWatchers.delete(watcher);
|
|
2622
|
+
};
|
|
2623
|
+
}
|
|
2624
|
+
reconcileChannelOccupancy(guildId) {
|
|
2625
|
+
for (const watcher of this.occupancyWatchers) if (!guildId || watcher.guildId === guildId) watcher.refresh();
|
|
2626
|
+
}
|
|
2588
2627
|
async autoJoin() {
|
|
2589
2628
|
if (!this.voiceEnabled || this.destroyed) return;
|
|
2629
|
+
this.reconcileChannelOccupancy();
|
|
2590
2630
|
const entriesByGuild = /* @__PURE__ */ new Map();
|
|
2591
2631
|
const duplicateGuilds = /* @__PURE__ */ new Set();
|
|
2592
2632
|
for (const entry of this.autoJoinChannels) {
|
|
@@ -2602,6 +2642,7 @@ var DiscordVoiceManager = class {
|
|
|
2602
2642
|
await this.following.startReconciliation();
|
|
2603
2643
|
}
|
|
2604
2644
|
async reconcileAutoJoinGuild(guildId) {
|
|
2645
|
+
this.reconcileChannelOccupancy(guildId);
|
|
2605
2646
|
const entry = this.resolveAutoJoinTarget(guildId);
|
|
2606
2647
|
if (!entry?.whenOccupied || !this.voiceEnabled || this.destroyed) return;
|
|
2607
2648
|
await this.enqueueAutoJoin(entry);
|
|
@@ -2726,6 +2767,10 @@ var DiscordVoiceManager = class {
|
|
|
2726
2767
|
guildId,
|
|
2727
2768
|
channelId
|
|
2728
2769
|
}));
|
|
2770
|
+
return {
|
|
2771
|
+
...result,
|
|
2772
|
+
...entry.channelName ? { channelName: entry.channelName } : {}
|
|
2773
|
+
};
|
|
2729
2774
|
} else if (!result.ok && isCurrent()) this.guildLifecycles.set(guildId, {
|
|
2730
2775
|
status: "inactive",
|
|
2731
2776
|
generation
|
|
@@ -2793,6 +2838,7 @@ var DiscordVoiceManager = class {
|
|
|
2793
2838
|
return;
|
|
2794
2839
|
}
|
|
2795
2840
|
this.membership.track(this.sessions.get(guildId), data, previousVoiceState);
|
|
2841
|
+
this.reconcileChannelOccupancy(guildId);
|
|
2796
2842
|
if (this.following.isFollowedUser(userId)) await this.following.handleFollowedUserVoiceStateUpdate({
|
|
2797
2843
|
guildId,
|
|
2798
2844
|
channelId,
|
|
@@ -2803,6 +2849,7 @@ var DiscordVoiceManager = class {
|
|
|
2803
2849
|
}
|
|
2804
2850
|
async destroy() {
|
|
2805
2851
|
this.destroyed = true;
|
|
2852
|
+
this.occupancyWatchers.clear();
|
|
2806
2853
|
this.following.destroy();
|
|
2807
2854
|
for (const entry of this.sessions.values()) entry.stop();
|
|
2808
2855
|
for (const [guildId, lifecycle] of this.guildLifecycles) this.guildLifecycles.set(guildId, {
|
|
@@ -2878,4 +2925,4 @@ var DiscordVoiceManager = class {
|
|
|
2878
2925
|
}
|
|
2879
2926
|
};
|
|
2880
2927
|
//#endregion
|
|
2881
|
-
export { DiscordVoiceGuildCreateListener, DiscordVoiceManager, DiscordVoiceReadyListener, DiscordVoiceResumedListener, DiscordVoiceStateUpdateListener,
|
|
2928
|
+
export { DiscordVoiceGuildCreateListener, DiscordVoiceManager, DiscordVoiceReadyListener, DiscordVoiceResumedListener, DiscordVoiceStateUpdateListener, createDiscordOpusEncodeStream as a, formatVoiceLogPreview as c, convertRealtimePcm24kMonoToDiscordPcm48kStereo as i, loadDiscordVoiceSdk as l, logVoiceVerbose as n, formatVoiceIngressPrompt as o, convertDiscordPcm48kStereoToRealtimePcm24kMono as r, maybeControlDiscordVoiceAgentRun as s, voice_runtime_exports as t };
|
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Mon, 24 Aug 2026 19:40:21 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -316,11 +316,11 @@ declare module "node:buffer" {
|
|
|
316
316
|
* such `Buffer` instances with zeroes.
|
|
317
317
|
*
|
|
318
318
|
* When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
|
|
319
|
-
* allocations
|
|
320
|
-
*
|
|
321
|
-
* individually allocated `Buffer`
|
|
322
|
-
*
|
|
323
|
-
* many individual `ArrayBuffer` objects.
|
|
319
|
+
* allocations less than `Buffer.poolSize >>> 1` (32KiB when default poolSize is used) are sliced
|
|
320
|
+
* from a single pre-allocated `Buffer`. This allows applications to avoid the
|
|
321
|
+
* garbage collection overhead of creating many individually allocated `Buffer`
|
|
322
|
+
* instances. This approach improves both performance and memory usage by
|
|
323
|
+
* eliminating the need to track and clean up as many individual `ArrayBuffer` objects.
|
|
324
324
|
*
|
|
325
325
|
* However, in the case where a developer may need to retain a small chunk of
|
|
326
326
|
* memory from a pool for an indeterminate amount of time, it may be appropriate
|
|
@@ -3742,7 +3742,7 @@ declare module "node:crypto" {
|
|
|
3742
3742
|
ciphertext: NodeJS.BufferSource,
|
|
3743
3743
|
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
3744
3744
|
extractable: boolean,
|
|
3745
|
-
|
|
3745
|
+
keyUsages: KeyUsage[],
|
|
3746
3746
|
): Promise<CryptoKey>;
|
|
3747
3747
|
decrypt(
|
|
3748
3748
|
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
|
|
@@ -3774,7 +3774,7 @@ declare module "node:crypto" {
|
|
|
3774
3774
|
encapsulationKey: CryptoKey,
|
|
3775
3775
|
sharedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | KmacImportParams,
|
|
3776
3776
|
extractable: boolean,
|
|
3777
|
-
|
|
3777
|
+
keyUsages: KeyUsage[],
|
|
3778
3778
|
): Promise<EncapsulatedKey>;
|
|
3779
3779
|
encrypt(
|
|
3780
3780
|
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
|
|
@@ -175,6 +175,7 @@ declare module "node:http" {
|
|
|
175
175
|
headers?: OutgoingHttpHeaders | readonly string[] | undefined;
|
|
176
176
|
host?: string | null | undefined;
|
|
177
177
|
hostname?: string | null | undefined;
|
|
178
|
+
httpValidation?: "strict" | "relaxed" | "insecure" | undefined;
|
|
178
179
|
insecureHTTPParser?: boolean | undefined;
|
|
179
180
|
localAddress?: string | undefined;
|
|
180
181
|
localPort?: number | undefined;
|
|
@@ -254,6 +255,21 @@ declare module "node:http" {
|
|
|
254
255
|
* @since v20.1.0
|
|
255
256
|
*/
|
|
256
257
|
highWaterMark?: number | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* Controls HTTP header value validation strictness
|
|
260
|
+
* for incoming requests. Accepted values are:
|
|
261
|
+
* * `'strict'`: Strictest validation; rejects any non-ASCII or control
|
|
262
|
+
* characters in header values.
|
|
263
|
+
* * `'relaxed'`: Allows a limited set of non-ASCII characters in header
|
|
264
|
+
* values, aligning with the
|
|
265
|
+
* [Fetch specification](https://fetch.spec.whatwg.org/).
|
|
266
|
+
* * `'insecure'`: Disables all header value validation (equivalent to
|
|
267
|
+
* `insecureHTTPParser: true`).
|
|
268
|
+
*
|
|
269
|
+
* Cannot be used together with `insecureHTTPParser`. **Default:** `'strict'`.
|
|
270
|
+
* @since v26.3.0
|
|
271
|
+
*/
|
|
272
|
+
httpValidation?: "strict" | "relaxed" | "insecure" | undefined;
|
|
257
273
|
/**
|
|
258
274
|
* Use an insecure HTTP parser that accepts invalid HTTP headers when `true`.
|
|
259
275
|
* Using the insecure parser should be avoided.
|
|
@@ -840,9 +840,12 @@ declare module "node:http2" {
|
|
|
840
840
|
* HTTP/2 request to the connected server.
|
|
841
841
|
*
|
|
842
842
|
* When a `ClientHttp2Session` is first created, the socket may not yet be
|
|
843
|
-
* connected.
|
|
843
|
+
* connected. If `clienthttp2session.request()` is called during this time, the
|
|
844
844
|
* actual request will be deferred until the socket is ready to go.
|
|
845
|
-
*
|
|
845
|
+
*
|
|
846
|
+
* If the session becomes unavailable before the request can be created, the
|
|
847
|
+
* returned stream will emit `ERR_HTTP2_GOAWAY_SESSION` or
|
|
848
|
+
* `ERR_HTTP2_INVALID_SESSION` asynchronously.
|
|
846
849
|
*
|
|
847
850
|
* This method is only available if `http2session.type` is equal to `http2.constants.NGHTTP2_SESSION_CLIENT`.
|
|
848
851
|
*
|
|
@@ -1166,6 +1169,11 @@ declare module "node:http2" {
|
|
|
1166
1169
|
* @default 128
|
|
1167
1170
|
*/
|
|
1168
1171
|
maxHeaderListPairs?: number | undefined;
|
|
1172
|
+
/**
|
|
1173
|
+
* Sets the maximum number of uniq origin the sever
|
|
1174
|
+
* can send via ORIGIN frames. **Default:** `128`.
|
|
1175
|
+
*/
|
|
1176
|
+
maxOriginSetSize?: number | undefined;
|
|
1169
1177
|
/**
|
|
1170
1178
|
* Sets the maximum number of outstanding, unacknowledged pings.
|
|
1171
1179
|
* @default 10
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.3.0",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -150,6 +150,6 @@
|
|
|
150
150
|
"undici-types": "~8.3.0"
|
|
151
151
|
},
|
|
152
152
|
"peerDependencies": {},
|
|
153
|
-
"typesPublisherContentHash": "
|
|
153
|
+
"typesPublisherContentHash": "125032099e1f7132c95bf327b36f694c396de965952f7cb9632ac916bbad47e9",
|
|
154
154
|
"typeScriptVersion": "5.6"
|
|
155
155
|
}
|
|
@@ -549,6 +549,58 @@ declare module "node:process" {
|
|
|
549
549
|
* @since v20.0.0
|
|
550
550
|
*/
|
|
551
551
|
has(scope: string, reference?: string): boolean;
|
|
552
|
+
/**
|
|
553
|
+
* Drops the specified permission from the current process. This operation is
|
|
554
|
+
* **irreversible** — once a permission is dropped, it cannot be restored through
|
|
555
|
+
* any Node.js API.
|
|
556
|
+
*
|
|
557
|
+
* If no reference is provided, the entire scope is dropped. For example,
|
|
558
|
+
* `process.permission.drop('fs.read')` will revoke ALL file system read
|
|
559
|
+
* permissions.
|
|
560
|
+
*
|
|
561
|
+
* When a reference is provided, only the permission for that specific resource
|
|
562
|
+
* is dropped. For example, `process.permission.drop('fs.read', '/etc/myapp')`
|
|
563
|
+
* will revoke read access to that directory while keeping other read
|
|
564
|
+
* permissions intact.
|
|
565
|
+
*
|
|
566
|
+
* **Important:** You can only drop the exact resource that was explicitly
|
|
567
|
+
* granted. The reference passed to `drop()` must match the original grant:
|
|
568
|
+
*
|
|
569
|
+
* * If a permission was granted using a wildcard (`*`), such as
|
|
570
|
+
* `--allow-fs-read=*`, individual paths cannot be dropped - only the entire
|
|
571
|
+
* scope can be dropped (by calling `drop()` without a reference).
|
|
572
|
+
* * If a directory was granted (e.g. `--allow-fs-read=/my/folder`), you cannot
|
|
573
|
+
* drop access to individual files inside it. You must drop the same directory
|
|
574
|
+
* that was granted. Any remaining grants continue to apply.
|
|
575
|
+
*
|
|
576
|
+
* The available scopes are the same as [`process.permission.has()`][]:
|
|
577
|
+
*
|
|
578
|
+
* `fs` - All File System (drops both read and write)
|
|
579
|
+
* * `fs.read` - File System read operations
|
|
580
|
+
* * `fs.write` - File System write operations
|
|
581
|
+
* * `child` - Child process spawning operations
|
|
582
|
+
* * `worker` - Worker thread spawning operation
|
|
583
|
+
* * `net` - Network operations
|
|
584
|
+
* * `inspector` - Inspector operations
|
|
585
|
+
* * `wasi` - WASI operations
|
|
586
|
+
* * `addon` - Native addon operations
|
|
587
|
+
*
|
|
588
|
+
* ```js
|
|
589
|
+
* const fs = require('node:fs');
|
|
590
|
+
*
|
|
591
|
+
* // Read configuration during startup
|
|
592
|
+
* const config = fs.readFileSync('/etc/myapp/config.json', 'utf8');
|
|
593
|
+
*
|
|
594
|
+
* // Drop read access to the config directory after initialization
|
|
595
|
+
* process.permission.drop('fs.read', '/etc/myapp');
|
|
596
|
+
*
|
|
597
|
+
* // This will now throw ERR_ACCESS_DENIED
|
|
598
|
+
* fs.readFileSync('/etc/myapp/config.json');
|
|
599
|
+
* ```
|
|
600
|
+
* @since v26.3.0
|
|
601
|
+
* @experimental
|
|
602
|
+
*/
|
|
603
|
+
drop(scope: string, reference?: string): void;
|
|
552
604
|
}
|
|
553
605
|
interface ProcessReport {
|
|
554
606
|
/**
|