@openclaw/discord 2026.6.34 → 2026.6.35
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/{api-CjnGBhM3.js → api-1GXlSrYP.js} +42 -21
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-BWPQrzpP.js → approval-handler.runtime-Dv4p7REU.js} +3 -3
- package/dist/{audit-BwJ_2OjL.js → audit-DEVi9nIs.js} +3 -3
- package/dist/{channel-DU4jnQgl.js → channel-CQIRiosn.js} +15 -15
- package/dist/{channel-actions-CwmIqnYN.js → channel-actions-JziPEcBU.js} +2 -2
- package/dist/{channel-actions.runtime-DvpTfaJ4.js → channel-actions.runtime-D7L47LY3.js} +5 -5
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-glZ5Y98a.js → channel.setup-oMeR19Cc.js} +2 -2
- package/dist/{components-j6lTZBsT.js → components-_s5UPJqU.js} +1 -1
- package/dist/{conversation-identity-36FFBwm5.js → conversation-identity-B0k94-bz.js} +2 -2
- package/dist/{directory-config-BYMFzL29.js → directory-config-CD1svkyN.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-9JtJCiu8.js → directory-live-DBTsSRxl.js} +5 -5
- package/dist/{handle-action.guild-admin-xxGYrp-I.js → handle-action.guild-admin-CYIFMxh-.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{manager.runtime-NxCd-PVt.js → manager.runtime-BZVdGX2d.js} +17 -9
- package/dist/{message-handler-cizxbaDc.js → message-handler-DZd9Bpq8.js} +6 -6
- package/dist/{message-handler.preflight-CbD0u7U7.js → message-handler.preflight-Axv9J9EO.js} +12 -11
- package/dist/{message-handler.process-Do4EM591.js → message-handler.process-CG0zFS-Z.js} +10 -10
- package/dist/{message-utils-CJeAoISH.js → message-utils-Dbuw27gd.js} +1 -1
- package/dist/{outbound-adapter-Dxs6iKEq.js → outbound-adapter-CKC_kmUN.js} +6 -6
- package/dist/pluralkit-CfTReLl3.js +40 -0
- package/dist/{probe-esE_Oqdm.js → probe-DcgZIpyF.js} +3 -2
- package/dist/{probe.runtime-C3Atgpvr.js → probe.runtime-CVwM9L5E.js} +1 -1
- package/dist/{provider-B-s93q9s.js → provider-CwwSXIIj.js} +73 -33
- package/dist/{provider-session.runtime-BKMOqHpd.js → provider-session.runtime-reBWkqHZ.js} +3 -3
- package/dist/provider.runtime-BsmTLYS_.js +2 -0
- package/dist/{resolve-allowlist-common-3gB2Gpmm.js → resolve-allowlist-common-D7bZqAw3.js} +3 -3
- package/dist/{resolve-channels-B3gQf8QL.js → resolve-channels--oE-RnO6.js} +6 -6
- package/dist/{resolve-users-BO10y5fJ.js → resolve-users-QXo8CXBU.js} +5 -5
- package/dist/{runtime-CFlR3L9X.js → runtime-CF7ramAs.js} +7 -7
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +19 -19
- package/dist/runtime-api.lookup.js +5 -5
- package/dist/runtime-api.monitor-CzF8MUl_.js +6 -0
- package/dist/runtime-api.monitor.js +5 -5
- package/dist/runtime-api.send.js +5 -5
- package/dist/runtime-api.threads.js +3 -3
- package/dist/{send-JHxfT4Pk.js → send-Bb295iHT.js} +5 -5
- package/dist/{send.components-CN35E2Ck.js → send.components-COkDUO3B.js} +4 -4
- package/dist/{send.outbound-B-cA1Esv.js → send.outbound-B_sk0hNe.js} +3 -3
- package/dist/{send.receipt-CGecJDin.js → send.receipt-Cli6_9Sn.js} +19 -7
- package/dist/{send.shared-vcbfThdy.js → send.shared-BCG7MWnP.js} +2 -2
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{subagent-hooks-20wXhVzZ.js → subagent-hooks-CtqoWK4x.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-DR27TE7p.js → system-events-BxGNk_wE.js} +1 -1
- package/dist/{target-resolver-CDi1gI90.js → target-resolver-BcoK6b0g.js} +2 -2
- package/dist/targets-Q-ZoP7K4.js +3 -0
- package/dist/{thread-bindings-DU4T6nDo.js → thread-bindings-DJ_HT6GJ.js} +4 -4
- package/dist/{thread-bindings.discord-api-CYkr-3Gj.js → thread-bindings.discord-api-OPyjvgyz.js} +4 -4
- package/dist/{thread-bindings.manager-BqWs1UE2.js → thread-bindings.manager-Cd2HAVw_.js} +3 -3
- package/dist/{transcripts-source-D-lBI5ZD.js → transcripts-source-CPf5gURy.js} +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-xr05bL-r.js → typing-DY0cwLdg.js} +1 -1
- package/node_modules/undici/docs/docs/api/Client.md +25 -8
- 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/api/readable.js +33 -43
- package/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
- package/node_modules/undici/lib/core/connect.js +16 -2
- package/node_modules/undici/lib/core/symbols.js +3 -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 +9 -1
- package/node_modules/undici/lib/dispatcher/client-h2.js +221 -12
- package/node_modules/undici/lib/dispatcher/client.js +76 -30
- 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 +37 -8
- 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 +106 -22
- 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 +155 -32
- package/node_modules/undici/lib/interceptor/cache.js +65 -9
- 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 +217 -27
- package/node_modules/undici/lib/util/cache.js +43 -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/lib/web/websocket/websocket.js +22 -0
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/client.d.ts +50 -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/npm-shrinkwrap.json +7 -7
- package/package.json +6 -5
- package/dist/pluralkit-DI6RYaVj.js +0 -24
- package/dist/provider.runtime-CaTJrpnl.js +0 -2
- package/dist/runtime-api.monitor-CRiBIQEI.js +0 -6
- package/dist/targets-C6yd3y8R.js +0 -3
package/dist/runtime-api.send.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { x as resolveDiscordOutboundSessionRoute } from "./components-
|
|
2
|
-
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-
|
|
3
|
-
import { A as fetchMemberGuildPermissionsDiscord, N as hasAnyGuildPermissionDiscord, T as DiscordSendError, j as hasAllGuildPermissionsDiscord, k as fetchChannelPermissionsDiscord } from "./send.shared-
|
|
4
|
-
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, c as sendWebhookMessageDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-
|
|
5
|
-
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
1
|
+
import { x as resolveDiscordOutboundSessionRoute } from "./components-_s5UPJqU.js";
|
|
2
|
+
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-COkDUO3B.js";
|
|
3
|
+
import { A as fetchMemberGuildPermissionsDiscord, N as hasAnyGuildPermissionDiscord, T as DiscordSendError, j as hasAllGuildPermissionsDiscord, k as fetchChannelPermissionsDiscord } from "./send.shared-BCG7MWnP.js";
|
|
4
|
+
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, c as sendWebhookMessageDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-Bb295iHT.js";
|
|
5
|
+
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-B_sk0hNe.js";
|
|
6
6
|
export { DiscordSendError, addRoleDiscord, banMemberDiscord, createChannelDiscord, createScheduledEventDiscord, createThreadDiscord, deleteChannelDiscord, deleteMessageDiscord, editChannelDiscord, editDiscordComponentMessage, editMessageDiscord, fetchChannelInfoDiscord, fetchChannelPermissionsDiscord, fetchMemberGuildPermissionsDiscord, fetchMemberInfoDiscord, fetchMessageDiscord, fetchReactionsDiscord, fetchRoleInfoDiscord, fetchVoiceStatusDiscord, hasAllGuildPermissionsDiscord, hasAnyGuildPermissionDiscord, kickMemberDiscord, listGuildChannelsDiscord, listGuildEmojisDiscord, listPinsDiscord, listScheduledEventsDiscord, listThreadsDiscord, moveChannelDiscord, pinMessageDiscord, reactMessageDiscord, readMessagesDiscord, registerBuiltDiscordComponentMessage, removeChannelPermissionDiscord, removeOwnReactionsDiscord, removeReactionDiscord, removeRoleDiscord, resolveDiscordOutboundSessionRoute, resolveEventCoverImage, searchMessagesDiscord, sendDiscordComponentMessage, sendMessageDiscord, sendPollDiscord, sendStickerDiscord, sendTypingDiscord, sendVoiceMessageDiscord, sendWebhookMessageDiscord, setChannelPermissionDiscord, timeoutMemberDiscord, unpinMessageDiscord, uploadEmojiDiscord, uploadStickerDiscord };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as resolveThreadBindingIdleTimeoutMs, E as resolveThreadBindingMaxAgeMs, T as resolveThreadBindingMaxAgeExpiresAt, d as isRecentlyUnboundThreadWebhookMessage, w as resolveThreadBindingInactivityExpiresAt } from "./thread-bindings.state-iSWjCYjB.js";
|
|
2
2
|
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-Chs3HgGa.js";
|
|
3
|
-
import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-
|
|
4
|
-
import { a as reconcileAcpThreadBindingsOnStartup, c as resolveDiscordThreadBindingMaxAgeMs, i as listThreadBindingsForAccount, l as resolveThreadBindingsEnabled, n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey, s as resolveDiscordThreadBindingIdleTimeoutMs } from "./thread-bindings-
|
|
5
|
-
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-
|
|
3
|
+
import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-OPyjvgyz.js";
|
|
4
|
+
import { a as reconcileAcpThreadBindingsOnStartup, c as resolveDiscordThreadBindingMaxAgeMs, i as listThreadBindingsForAccount, l as resolveThreadBindingsEnabled, n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey, s as resolveDiscordThreadBindingIdleTimeoutMs } from "./thread-bindings-DJ_HT6GJ.js";
|
|
5
|
+
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-Cd2HAVw_.js";
|
|
6
6
|
export { testing as __testing, testing, autoBindSpawnedDiscordSubagent, createNoopThreadBindingManager, createThreadBindingManager, formatThreadBindingDurationLabel, getThreadBindingManager, isRecentlyUnboundThreadWebhookMessage, listThreadBindingsBySessionKey, listThreadBindingsForAccount, reconcileAcpThreadBindingsOnStartup, resolveDiscordThreadBindingIdleTimeoutMs, resolveDiscordThreadBindingMaxAgeMs, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingInactivityExpiresAt, resolveThreadBindingIntroText, resolveThreadBindingMaxAgeExpiresAt, resolveThreadBindingMaxAgeMs, resolveThreadBindingPersona, resolveThreadBindingPersonaFromRecord, resolveThreadBindingThreadName, resolveThreadBindingsEnabled, setThreadBindingIdleTimeoutBySessionKey, setThreadBindingMaxAgeBySessionKey, unbindThreadBindingsBySessionKey };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { At as getGuildMember, Bt as removeGuildMemberRole, C as readDiscordCode, Ct as createGuildBan, Dt as createGuildSticker, Et as createGuildScheduledEvent, Ft as listGuildRoles, It as listGuildScheduledEvents, Lt as moveGuildChannels, Mt as listGuildActiveThreads, Nt as listGuildChannels, Ot as deleteChannelPermission, Pt as listGuildEmojis, Rt as putChannelPermission, S as RateLimitError, St as addGuildMemberRole, T as readRetryAfter, Tt as createGuildEmoji, Vt as timeoutGuildMember, Wt as __exportAll, _t as listChannelPins, at as deleteOwnMessageReaction, bt as sendChannelTyping, ct as createThread, dt as editChannel, ft as editChannelMessage, gt as listChannelMessages, ht as listChannelArchivedThreads, it as createOwnMessageReaction, jt as getGuildVoiceState, kt as getGuild, lt as deleteChannel, mt as getChannelMessage, n as createDiscordSendResult, ot as listMessageReactionUsers, pt as getChannel, st as createChannelMessage, ut as deleteChannelMessage, vt as pinChannelMessage, w as readDiscordMessage, wt as createGuildChannel, x as DiscordError, xt as unpinChannelMessage, yt as searchGuildMessages, zt as removeGuildMember } from "./send.receipt-
|
|
1
|
+
import { At as getGuildMember, Bt as removeGuildMemberRole, C as readDiscordCode, Ct as createGuildBan, Dt as createGuildSticker, Et as createGuildScheduledEvent, Ft as listGuildRoles, It as listGuildScheduledEvents, Lt as moveGuildChannels, Mt as listGuildActiveThreads, Nt as listGuildChannels, Ot as deleteChannelPermission, Pt as listGuildEmojis, Rt as putChannelPermission, S as RateLimitError, St as addGuildMemberRole, T as readRetryAfter, Tt as createGuildEmoji, Vt as timeoutGuildMember, Wt as __exportAll, _t as listChannelPins, at as deleteOwnMessageReaction, bt as sendChannelTyping, ct as createThread, dt as editChannel, ft as editChannelMessage, gt as listChannelMessages, ht as listChannelArchivedThreads, it as createOwnMessageReaction, jt as getGuildVoiceState, kt as getGuild, lt as deleteChannel, mt as getChannelMessage, n as createDiscordSendResult, ot as listMessageReactionUsers, pt as getChannel, st as createChannelMessage, ut as deleteChannelMessage, vt as pinChannelMessage, w as readDiscordMessage, wt as createGuildChannel, x as DiscordError, xt as unpinChannelMessage, yt as searchGuildMessages, zt as removeGuildMember } from "./send.receipt-Cli6_9Sn.js";
|
|
2
2
|
import { s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { A as fetchMemberGuildPermissionsDiscord, B as resolveDiscordRest, C as DISCORD_MAX_EVENT_COVER_BYTES, D as canManageGuildRoleDiscord, E as canManageGuildMemberRoleDiscord, F as parseAndResolveChannelRecipient, I as createDiscordClient, M as hasAnyChannelPermissionDiscord, N as hasAnyGuildPermissionDiscord, O as canViewDiscordGuildChannel, S as DISCORD_MAX_EMOJI_BYTES, T as DiscordSendError, _ as createDiscordMessageNonce, i as formatReactionEmoji, j as hasAllGuildPermissionsDiscord, k as fetchChannelPermissionsDiscord, l as resolveChannelId, o as normalizeEmojiName, r as buildReactionIdentifier, s as normalizeReactionEmoji, t as buildDiscordSendError, w as DISCORD_MAX_STICKER_BYTES, z as resolveDiscordClientAccountContext } from "./send.shared-
|
|
4
|
-
import { n as sendPollDiscord, r as sendStickerDiscord, s as rewriteDiscordKnownMentions, t as sendMessageDiscord } from "./send.outbound-
|
|
3
|
+
import { A as fetchMemberGuildPermissionsDiscord, B as resolveDiscordRest, C as DISCORD_MAX_EVENT_COVER_BYTES, D as canManageGuildRoleDiscord, E as canManageGuildMemberRoleDiscord, F as parseAndResolveChannelRecipient, I as createDiscordClient, M as hasAnyChannelPermissionDiscord, N as hasAnyGuildPermissionDiscord, O as canViewDiscordGuildChannel, S as DISCORD_MAX_EMOJI_BYTES, T as DiscordSendError, _ as createDiscordMessageNonce, i as formatReactionEmoji, j as hasAllGuildPermissionsDiscord, k as fetchChannelPermissionsDiscord, l as resolveChannelId, o as normalizeEmojiName, r as buildReactionIdentifier, s as normalizeReactionEmoji, t as buildDiscordSendError, w as DISCORD_MAX_STICKER_BYTES, z as resolveDiscordClientAccountContext } from "./send.shared-BCG7MWnP.js";
|
|
4
|
+
import { n as sendPollDiscord, r as sendStickerDiscord, s as rewriteDiscordKnownMentions, t as sendMessageDiscord } from "./send.outbound-B_sk0hNe.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { ChannelType } from "discord-api-types/v10";
|
|
7
7
|
import { parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -12,7 +12,7 @@ import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, extensionForMime, maxBytesForKind
|
|
|
12
12
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
13
13
|
import { loadWebMediaRaw } from "openclaw/plugin-sdk/web-media";
|
|
14
14
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
15
|
-
import { readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
15
|
+
import { readProviderJsonResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
16
16
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
17
17
|
import fs from "node:fs/promises";
|
|
18
18
|
import { resolvePreferredOpenClawTmpDir, tempWorkspace } from "openclaw/plugin-sdk/temp-path";
|
|
@@ -597,7 +597,7 @@ async function requestVoiceUploadUrl(params) {
|
|
|
597
597
|
});
|
|
598
598
|
try {
|
|
599
599
|
if (!res.ok) throw await createVoiceRequestError(res, "Upload URL request failed");
|
|
600
|
-
return await res.
|
|
600
|
+
return await readProviderJsonResponse(res, "discord.voice.upload-url");
|
|
601
601
|
} finally {
|
|
602
602
|
await release();
|
|
603
603
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Wt as __exportAll, ft as editChannelMessage, j as serializePayload, n as createDiscordSendResult, st as createChannelMessage } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll, ft as editChannelMessage, j as serializePayload, n as createDiscordSendResult, st as createChannelMessage } from "./send.receipt-Cli6_9Sn.js";
|
|
2
2
|
import { s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
3
|
import "./config-api-JiPdJeb0.js";
|
|
4
4
|
import "./channel-api-CAJ0wMoV.js";
|
|
5
|
-
import { c as buildDiscordComponentMessage, f as resolveDiscordComponentAttachmentName, l as buildDiscordComponentMessageFlags } from "./components-
|
|
6
|
-
import { F as parseAndResolveChannelRecipient, I as createDiscordClient, _ as createDiscordMessageNonce, h as SUPPRESS_NOTIFICATIONS_FLAG, l as resolveChannelId, m as toDiscordFileBlob, t as buildDiscordSendError, u as resolveDiscordChannelType, x as stripUndefinedFields } from "./send.shared-
|
|
7
|
-
import { t as sendMessageDiscord } from "./send.outbound-
|
|
5
|
+
import { c as buildDiscordComponentMessage, f as resolveDiscordComponentAttachmentName, l as buildDiscordComponentMessageFlags } from "./components-_s5UPJqU.js";
|
|
6
|
+
import { F as parseAndResolveChannelRecipient, I as createDiscordClient, _ as createDiscordMessageNonce, h as SUPPRESS_NOTIFICATIONS_FLAG, l as resolveChannelId, m as toDiscordFileBlob, t as buildDiscordSendError, u as resolveDiscordChannelType, x as stripUndefinedFields } from "./send.shared-BCG7MWnP.js";
|
|
7
|
+
import { t as sendMessageDiscord } from "./send.outbound-B_sk0hNe.js";
|
|
8
8
|
import { n as getOptionalDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
9
9
|
import "openclaw/plugin-sdk/account-id";
|
|
10
10
|
import "openclaw/plugin-sdk/secret-input";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ct as createThread, n as createDiscordSendResult, st as createChannelMessage } from "./send.receipt-
|
|
1
|
+
import { ct as createThread, n as createDiscordSendResult, st as createChannelMessage } from "./send.receipt-Cli6_9Sn.js";
|
|
2
2
|
import { s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { F as parseAndResolveChannelRecipient, I as createDiscordClient, _ as createDiscordMessageNonce, a as normalizeDiscordPollInput, b as resolveDiscordSendEmbeds, c as normalizeStickerIds, f as sendDiscordMedia, g as buildDiscordMessageRequest, l as resolveChannelId, n as buildDiscordTextChunks, p as sendDiscordText, t as buildDiscordSendError, u as resolveDiscordChannelType, v as resolveDiscordMessageFlags, y as resolveDiscordSendComponents } from "./send.shared-
|
|
4
|
-
import { a as resolveDiscordDirectoryUserId } from "./directory-live-
|
|
3
|
+
import { F as parseAndResolveChannelRecipient, I as createDiscordClient, _ as createDiscordMessageNonce, a as normalizeDiscordPollInput, b as resolveDiscordSendEmbeds, c as normalizeStickerIds, f as sendDiscordMedia, g as buildDiscordMessageRequest, l as resolveChannelId, n as buildDiscordTextChunks, p as sendDiscordText, t as buildDiscordSendError, u as resolveDiscordChannelType, v as resolveDiscordMessageFlags, y as resolveDiscordSendComponents } from "./send.shared-BCG7MWnP.js";
|
|
4
|
+
import { a as resolveDiscordDirectoryUserId } from "./directory-live-DBTsSRxl.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { ChannelType } from "discord-api-types/v10";
|
|
7
7
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
@@ -262,6 +262,7 @@ async function createChannelWebhook(rest, channelId, data) {
|
|
|
262
262
|
}
|
|
263
263
|
//#endregion
|
|
264
264
|
//#region extensions/discord/src/internal/command-deploy.ts
|
|
265
|
+
const DISCORD_APPLICATION_COMMAND_LIMIT_REACHED = 30032;
|
|
265
266
|
/**
|
|
266
267
|
* Per-`command-deploy-cache.json` path async mutex. `server-channels.ts` can
|
|
267
268
|
* start several Discord deployers concurrently in the same Node.js process;
|
|
@@ -349,16 +350,24 @@ var DiscordCommandDeployer = class {
|
|
|
349
350
|
async reconcileGlobalCommands(desired) {
|
|
350
351
|
const existing = await this.getCommands();
|
|
351
352
|
const existingByKey = new Map(existing.map((command) => [stableCommandKey(command), command]));
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
353
|
+
const desiredCommands = desired.map((command) => ({
|
|
354
|
+
command,
|
|
355
|
+
key: stableCommandKey(command)
|
|
356
|
+
}));
|
|
357
|
+
const desiredKeys = new Set(desiredCommands.map(({ key }) => key));
|
|
358
|
+
for (const { command, key } of desiredCommands) {
|
|
356
359
|
const current = existingByKey.get(key);
|
|
357
|
-
if (!current)
|
|
360
|
+
if (current && !commandsEqual(current, command)) await editApplicationCommand(this.rest, this.params.clientId, current.id, command);
|
|
361
|
+
}
|
|
362
|
+
for (const { command, key } of desiredCommands) {
|
|
363
|
+
if (existingByKey.has(key)) continue;
|
|
364
|
+
try {
|
|
358
365
|
await createApplicationCommand(this.rest, this.params.clientId, command);
|
|
359
|
-
|
|
366
|
+
} catch (error) {
|
|
367
|
+
if (!isApplicationCommandLimitError(error)) throw error;
|
|
368
|
+
await overwriteApplicationCommands(this.rest, this.params.clientId, desired);
|
|
369
|
+
return;
|
|
360
370
|
}
|
|
361
|
-
if (!commandsEqual(current, command)) await editApplicationCommand(this.rest, this.params.clientId, current.id, command);
|
|
362
371
|
}
|
|
363
372
|
for (const command of existing) if (!desiredKeys.has(stableCommandKey(command))) await deleteApplicationCommand(this.rest, this.params.clientId, command.id);
|
|
364
373
|
}
|
|
@@ -427,6 +436,9 @@ function groupGuildCommands(commands) {
|
|
|
427
436
|
function stableCommandKey(command) {
|
|
428
437
|
return `${command.type ?? ApplicationCommandType.ChatInput}:${command.name}`;
|
|
429
438
|
}
|
|
439
|
+
function isApplicationCommandLimitError(error) {
|
|
440
|
+
return error !== null && typeof error === "object" && "discordCode" in error && error.discordCode === DISCORD_APPLICATION_COMMAND_LIMIT_REACHED;
|
|
441
|
+
}
|
|
430
442
|
function comparableCommand(value) {
|
|
431
443
|
if (!value || typeof value !== "object") return value;
|
|
432
444
|
const omit = new Set([
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { At as getGuildMember, M as Embed, S as RateLimitError, b as RequestClient, j as serializePayload, kt as getGuild, nt as createUserDmChannel, pt as getChannel, rt as getCurrentUser, s as chunkDiscordTextWithMode, st as createChannelMessage } from "./send.receipt-
|
|
1
|
+
import { At as getGuildMember, M as Embed, S as RateLimitError, b as RequestClient, j as serializePayload, kt as getGuild, nt as createUserDmChannel, pt as getChannel, rt as getCurrentUser, s as chunkDiscordTextWithMode, st as createChannelMessage } from "./send.receipt-Cli6_9Sn.js";
|
|
2
2
|
import { a as mergeDiscordAccountConfig, p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-
|
|
3
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-BcoK6b0g.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { ChannelType, MessageFlags, PermissionFlagsBits } from "discord-api-types/v10";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as testing, n as createThreadBindingManager } from "./thread-bindings.manager-
|
|
1
|
+
import { i as testing, n as createThreadBindingManager } from "./thread-bindings.manager-Cd2HAVw_.js";
|
|
2
2
|
export { createThreadBindingManager, testing as discordThreadBindingTesting };
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordSetupPlugin } from "./channel.setup-
|
|
1
|
+
import { t as discordSetupPlugin } from "./channel.setup-oMeR19Cc.js";
|
|
2
2
|
export { discordSetupPlugin };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-Cli6_9Sn.js";
|
|
2
2
|
import { s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey } from "./thread-bindings-
|
|
3
|
+
import { n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey } from "./thread-bindings-DJ_HT6GJ.js";
|
|
4
4
|
import { normalizeOptionalLowercaseString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { formatThreadBindingDisabledError, formatThreadBindingSpawnDisabledError, resolveThreadBindingSpawnPolicy } from "openclaw/plugin-sdk/conversation-runtime";
|
|
6
6
|
//#region extensions/discord/src/subagent-hooks.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region extensions/discord/subagent-hooks-api.ts
|
|
2
2
|
let discordSubagentHooksPromise = null;
|
|
3
3
|
function loadDiscordSubagentHooksModule() {
|
|
4
|
-
discordSubagentHooksPromise ??= import("./subagent-hooks-
|
|
4
|
+
discordSubagentHooksPromise ??= import("./subagent-hooks-CtqoWK4x.js").then((n) => n.i);
|
|
5
5
|
return discordSubagentHooksPromise;
|
|
6
6
|
}
|
|
7
7
|
function registerDiscordSubagentHooks(api) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as discord_exports } from "./send.receipt-
|
|
1
|
+
import { c as discord_exports } from "./send.receipt-Cli6_9Sn.js";
|
|
2
2
|
import { b as formatDiscordUserTag } from "./allow-list-C-MqM-B_.js";
|
|
3
3
|
//#region extensions/discord/src/monitor/system-events.ts
|
|
4
4
|
function resolveDiscordSystemEvent(message, location) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Ht as parseDiscordTarget, Wt as __exportAll, r as allowFromContainsDiscordUserId } from "./send.receipt-
|
|
1
|
+
import { Ht as parseDiscordTarget, Wt as __exportAll, r as allowFromContainsDiscordUserId } from "./send.receipt-Cli6_9Sn.js";
|
|
2
2
|
import { c as resolveDiscordAccountAllowFrom, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { i as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-
|
|
3
|
+
import { i as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-DBTsSRxl.js";
|
|
4
4
|
import { buildMessagingTarget } from "openclaw/plugin-sdk/channel-targets";
|
|
5
5
|
//#region extensions/discord/src/send-target-parsing.ts
|
|
6
6
|
const parseDiscordSendTarget = (raw, options = {}) => parseDiscordTarget(raw, options);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Ht as parseDiscordTarget, Wt as __exportAll } from "./send.receipt-
|
|
2
|
-
import "./targets-
|
|
1
|
+
import { Ht as parseDiscordTarget, Wt as __exportAll } from "./send.receipt-Cli6_9Sn.js";
|
|
2
|
+
import "./targets-Q-ZoP7K4.js";
|
|
3
3
|
import { A as shouldPersistBindingMutations, C as resolveThreadBindingIdleTimeoutMs$1, D as saveBindingsToDisk, E as resolveThreadBindingMaxAgeMs$1, T as resolveThreadBindingMaxAgeExpiresAt, d as isRecentlyUnboundThreadWebhookMessage, g as rememberRecentUnboundWebhookEcho, h as normalizeThreadId, n as MANAGERS_BY_ACCOUNT_ID, t as BINDINGS_BY_THREAD_ID, u as getThreadBindingToken, w as resolveThreadBindingInactivityExpiresAt, y as removeBindingRecord } from "./thread-bindings.state-iSWjCYjB.js";
|
|
4
4
|
import { n as setThreadBindingMaxAgeBySessionKey, r as resolveBindingIdsForTargetSession, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-Chs3HgGa.js";
|
|
5
|
-
import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, s as resolveChannelIdForBinding, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-
|
|
6
|
-
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-
|
|
5
|
+
import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, s as resolveChannelIdForBinding, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-OPyjvgyz.js";
|
|
6
|
+
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-Cd2HAVw_.js";
|
|
7
7
|
import { normalizeOptionalLowercaseString, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
9
9
|
import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
|
package/dist/{thread-bindings.discord-api-CYkr-3Gj.js → thread-bindings.discord-api-OPyjvgyz.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Ut as resolveDiscordChannelId, pt as getChannel, tt as createChannelWebhook } from "./send.receipt-
|
|
2
|
-
import { L as createDiscordRestClient } from "./send.shared-
|
|
3
|
-
import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-
|
|
4
|
-
import { t as sendMessageDiscord } from "./send.outbound-
|
|
1
|
+
import { Ut as resolveDiscordChannelId, pt as getChannel, tt as createChannelWebhook } from "./send.receipt-Cli6_9Sn.js";
|
|
2
|
+
import { L as createDiscordRestClient } from "./send.shared-BCG7MWnP.js";
|
|
3
|
+
import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-Bb295iHT.js";
|
|
4
|
+
import { t as sendMessageDiscord } from "./send.outbound-B_sk0hNe.js";
|
|
5
5
|
import { M as toReusableWebhookKey, _ as rememberReusableWebhook, i as REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL, t as BINDINGS_BY_THREAD_ID } from "./thread-bindings.state-iSWjCYjB.js";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { ChannelType } from "discord-api-types/v10";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Ut as resolveDiscordChannelId, Wt as __exportAll, pt as getChannel } from "./send.receipt-
|
|
2
|
-
import { L as createDiscordRestClient } from "./send.shared-
|
|
1
|
+
import { Ut as resolveDiscordChannelId, Wt as __exportAll, pt as getChannel } from "./send.receipt-Cli6_9Sn.js";
|
|
2
|
+
import { L as createDiscordRestClient } from "./send.shared-BCG7MWnP.js";
|
|
3
3
|
import { C as resolveThreadBindingIdleTimeoutMs$1, D as saveBindingsToDisk, E as resolveThreadBindingMaxAgeMs$1, F as THREAD_BINDINGS_SWEEP_INTERVAL_MS, N as DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS, O as setBindingRecord, S as resolveBindingRecordKey, T as resolveThreadBindingMaxAgeExpiresAt, b as resetThreadBindingsForTests, c as ensureBindingsLoaded, g as rememberRecentUnboundWebhookEcho, h as normalizeThreadId, k as shouldDefaultPersist, l as forgetThreadBindingToken, m as normalizeThreadBindingDurationMs, n as MANAGERS_BY_ACCOUNT_ID, p as normalizeTargetKind, r as PERSIST_BY_ACCOUNT_ID, s as THREAD_BINDING_TOUCH_PERSIST_MIN_INTERVAL_MS, t as BINDINGS_BY_THREAD_ID, u as getThreadBindingToken, v as rememberThreadBindingToken, w as resolveThreadBindingInactivityExpiresAt, x as resolveBindingIdsForSession, y as removeBindingRecord } from "./thread-bindings.state-iSWjCYjB.js";
|
|
4
|
-
import { a as isThreadArchived, b as resolveThreadBindingThreadName, c as summarizeDiscordError, i as isDiscordThreadGoneError, n as createWebhookForChannel, o as maybeSendBindingMessage, r as findReusableWebhook, s as resolveChannelIdForBinding, t as createThreadForBinding, v as resolveThreadBindingFarewellText } from "./thread-bindings.discord-api-
|
|
4
|
+
import { a as isThreadArchived, b as resolveThreadBindingThreadName, c as summarizeDiscordError, i as isDiscordThreadGoneError, n as createWebhookForChannel, o as maybeSendBindingMessage, r as findReusableWebhook, s as resolveChannelIdForBinding, t as createThreadForBinding, v as resolveThreadBindingFarewellText } from "./thread-bindings.discord-api-OPyjvgyz.js";
|
|
5
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { normalizeAccountId, resolveAgentIdFromSessionKey } from "openclaw/plugin-sdk/routing";
|
|
7
7
|
import { getRuntimeConfigSnapshot } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-Cli6_9Sn.js";
|
|
2
2
|
//#region extensions/discord/src/voice/transcripts-source.ts
|
|
3
3
|
var transcripts_source_exports = /* @__PURE__ */ __exportAll({
|
|
4
4
|
discordVoiceTranscriptsSourceProvider: () => discordVoiceTranscriptsSourceProvider,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
1
|
+
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-CPf5gURy.js";
|
|
2
2
|
export { discordVoiceTranscriptsSourceProvider };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Wt as __exportAll, bt as sendChannelTyping } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll, bt as sendChannelTyping } from "./send.receipt-Cli6_9Sn.js";
|
|
2
2
|
import { l as raceWithTimeout } from "./timeouts-C5TBc_9x.js";
|
|
3
3
|
//#region extensions/discord/src/monitor/typing.ts
|
|
4
4
|
var typing_exports = /* @__PURE__ */ __exportAll({ sendTyping: () => sendTyping });
|
|
@@ -111,22 +111,35 @@ added: v1.0.0
|
|
|
111
111
|
`autoSelectFamily` is enabled. **Default:** `250`.
|
|
112
112
|
* `allowH2` {boolean} Enables HTTP/2 support when the server assigns it a
|
|
113
113
|
higher priority through ALPN negotiation. **Default:** `true`.
|
|
114
|
-
* `useH2c` {boolean} Enforces h2c (HTTP/2 cleartext) for non-HTTPS
|
|
115
|
-
|
|
116
|
-
* `maxConcurrentStreams` {number} The maximum number of concurrent HTTP/2
|
|
114
|
+
* `useH2c` {boolean} _Deprecated: use h2Options.useH2c instead_ Enforces h2c (HTTP/2 cleartext) for non-HTTPS
|
|
115
|
+
connections. **Default:** `false`.
|
|
116
|
+
* `maxConcurrentStreams` {number} _Deprecated: use h2Options.useH2c instead_ The maximum number of concurrent HTTP/2
|
|
117
117
|
streams for a single session. Once h2 is negotiated this — not `pipelining`,
|
|
118
118
|
which is HTTP/1.1 only — is the ceiling used to dispatch in-flight requests.
|
|
119
119
|
It may be overridden by the server's `SETTINGS_MAX_CONCURRENT_STREAMS`
|
|
120
120
|
frame. **Default:** `100`.
|
|
121
|
-
* `
|
|
122
|
-
size (`SETTINGS_INITIAL_WINDOW_SIZE`). Must be a positive integer.
|
|
123
|
-
**Default:** `262144`.
|
|
124
|
-
* `connectionWindowSize` {number} The HTTP/2 connection-level flow-control
|
|
121
|
+
* `connectionWindowSize` {number} _Deprecated: use h2Options.connectionWindowSize instead_ The HTTP/2 connection-level flow-control
|
|
125
122
|
window size set via `ClientHttp2Session.setLocalWindowSize()`. Must be a
|
|
126
123
|
positive integer. **Default:** `524288`.
|
|
127
|
-
* `pingInterval` {number} The time interval, in milliseconds, between HTTP/2
|
|
124
|
+
* `pingInterval` {number} _Deprecated: use h2Options.pingInterval instead_ The time interval, in milliseconds, between HTTP/2
|
|
128
125
|
PING frames. Set to `0` to disable PING frames. Applies only to HTTP/2
|
|
129
126
|
connections and emits a `ping` event on the client. **Default:** `60e3`.
|
|
127
|
+
* `h2Options` {object} Set of options for HTTP/2 sessions
|
|
128
|
+
* `useH2c` {boolean} Enforces h2c (HTTP/2 cleartext) for non-HTTPS
|
|
129
|
+
connections. **Default:** `false`.
|
|
130
|
+
* `maxConcurrentStreams` {number} The maximum number of concurrent HTTP/2
|
|
131
|
+
streams for a single session. Once h2 is negotiated this — not `pipelining`,
|
|
132
|
+
which is HTTP/1.1 only — is the ceiling used to dispatch in-flight requests.
|
|
133
|
+
It may be overridden by the server's `SETTINGS_MAX_CONCURRENT_STREAMS`
|
|
134
|
+
frame. **Default:** `100`.
|
|
135
|
+
* `connectionWindowSize` {number} The HTTP/2 connection-level flow-control
|
|
136
|
+
window size set via `ClientHttp2Session.setLocalWindowSize()`. Must be a
|
|
137
|
+
positive integer. **Default:** `524288`.
|
|
138
|
+
* `pingInterval` {number} The time interval, in milliseconds, between HTTP/2
|
|
139
|
+
PING frames. Set to `0` to disable PING frames. Applies only to HTTP/2
|
|
140
|
+
connections and emits a `ping` event on the client. **Default:** `60e3`.
|
|
141
|
+
* `settings` {object} `SETTINGS` frame options. For full reference, take a
|
|
142
|
+
look to [HTTP/2#Settings Object](https://nodejs.org/api/http2.html#settings-object)
|
|
130
143
|
* `webSocket` {Object} (optional) WebSocket-specific configuration.
|
|
131
144
|
* `maxFragments` {number} The maximum number of fragments in a message. Set
|
|
132
145
|
to `0` to disable the limit. **Default:** `131072`.
|
|
@@ -134,6 +147,10 @@ added: v1.0.0
|
|
|
134
147
|
WebSocket messages. Applied to uncompressed messages, compressed frame
|
|
135
148
|
payloads, and decompressed (`permessage-deflate`) messages. Set to `0` to
|
|
136
149
|
disable the limit. **Default:** `134217728`.
|
|
150
|
+
* `eventSource` {Object} (optional) EventSource-specific configuration.
|
|
151
|
+
* `maxEventSize` {number} The maximum allowed event size, in bytes, for
|
|
152
|
+
EventSource messages. Set to `0` to disable the limit.
|
|
153
|
+
**Default:** `buffer.kStringMaxLength`.
|
|
137
154
|
* Returns: {Client}
|
|
138
155
|
|
|
139
156
|
Instantiating a `Client` does not open a connection; the connection is
|
|
@@ -25,8 +25,9 @@ it is used only for HTTPS requests.
|
|
|
25
25
|
proxied. Each entry may include a leading dot or `*.` wildcard (for example
|
|
26
26
|
`.example.com`) to match subdomains, and an optional `:port` suffix to restrict
|
|
27
27
|
the match to a specific port. A request bypasses the proxy when its host equals
|
|
28
|
-
an entry or is a subdomain of one.
|
|
29
|
-
|
|
28
|
+
an entry or is a subdomain of one. A trailing dot is ignored on both sides, so
|
|
29
|
+
`example.com.` and `example.com` match each other. Setting `no_proxy` to `*`
|
|
30
|
+
bypasses the proxy for every request.
|
|
30
31
|
|
|
31
32
|
The uppercase variants `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` are also
|
|
32
33
|
honored. When both the lowercase and uppercase forms of a variable are set, the
|
|
@@ -66,6 +66,9 @@ added: v6.5.0
|
|
|
66
66
|
wait before re-establishing a dropped connection. The server may override
|
|
67
67
|
this value with a `retry` field. **Default:** `3000`.
|
|
68
68
|
|
|
69
|
+
EventSource-specific limits can be configured on the dispatcher using the
|
|
70
|
+
`eventSource` option. See [`Client`][] for details.
|
|
71
|
+
|
|
69
72
|
Creates a new `EventSource` and immediately begins connecting to `url`. The
|
|
70
73
|
request is sent with the `Accept: text/event-stream` header, a cache mode of
|
|
71
74
|
`no-store`, and an initiator type of `other`.
|
|
@@ -349,6 +352,7 @@ eventSource.onerror = () => {
|
|
|
349
352
|
```
|
|
350
353
|
|
|
351
354
|
[WHATWG-conformant]: https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events
|
|
355
|
+
[`Client`]: Client.md#new-clienturl-options
|
|
352
356
|
[`Dispatcher`]: Dispatcher.md#class-dispatcher
|
|
353
357
|
[`addEventListener()`]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
|
|
354
358
|
[server-sent events]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
|
|
@@ -101,8 +101,8 @@ body yourself.
|
|
|
101
101
|
|
|
102
102
|
* `opts` {Object} (optional)
|
|
103
103
|
* `maxSize` {number} Maximum number of bytes to read and discard. Responses
|
|
104
|
-
whose
|
|
105
|
-
`1_048_576` (1 MiB).
|
|
104
|
+
whose declared or received body size exceeds this value are aborted.
|
|
105
|
+
**Default:** `1_048_576` (1 MiB).
|
|
106
106
|
|
|
107
107
|
Per-request override: set `dumpMaxSize` on the dispatch options to override
|
|
108
108
|
the global `maxSize` for a specific request.
|
|
@@ -210,6 +210,9 @@ Automatically decompresses response bodies encoded with `gzip`, `x-gzip`,
|
|
|
210
210
|
skipped. **Default:** `[204, 304]`.
|
|
211
211
|
* `skipErrorResponses` {boolean} When `true`, responses with a status code
|
|
212
212
|
>= 400 are not decompressed. **Default:** `true`.
|
|
213
|
+
* `maxSize` {number} Maximum decompressed response size in bytes. The request
|
|
214
|
+
fails with a `ResponseExceededMaxSizeError` if the decoded body exceeds
|
|
215
|
+
this limit. **Default:** `67108864` (64 MiB).
|
|
213
216
|
|
|
214
217
|
**Returns:** {Dispatcher.DispatcherComposeInterceptor}
|
|
215
218
|
|
|
@@ -221,7 +224,8 @@ import { Agent, interceptors } from 'undici'
|
|
|
221
224
|
const agent = new Agent().compose(
|
|
222
225
|
interceptors.decompress({
|
|
223
226
|
skipStatusCodes: [204, 304],
|
|
224
|
-
skipErrorResponses: false // decompress error bodies too
|
|
227
|
+
skipErrorResponses: false, // decompress error bodies too
|
|
228
|
+
maxSize: 16 * 1024 * 1024 // limit decoded bodies to 16 MiB
|
|
225
229
|
})
|
|
226
230
|
)
|
|
227
231
|
```
|
|
@@ -60,6 +60,11 @@ added: v7.23.0
|
|
|
60
60
|
a password embedded in `proxyUrl`. **Default:** the URL password, if any.
|
|
61
61
|
* `connect` {Function} Custom connector used to open the socket to the proxy.
|
|
62
62
|
**Default:** a connector built from `proxyTls`.
|
|
63
|
+
* `connectTimeout` {number} Maximum time in milliseconds for each proxy
|
|
64
|
+
connection, SOCKS5 negotiation, and target TLS negotiation stage. A value of
|
|
65
|
+
`0` disables these stage timeouts. `proxyTls.timeout` and
|
|
66
|
+
`requestTls.timeout` override it for their respective TLS stages.
|
|
67
|
+
**Default:** `5000`.
|
|
63
68
|
* `proxyTls` {BuildOptions} TLS options for the connection to the proxy itself
|
|
64
69
|
(SOCKS5 over TLS). When set, the proxy connection is established over TLS and
|
|
65
70
|
`servername` defaults to the proxy host name.
|
|
@@ -69,7 +74,8 @@ added: v7.23.0
|
|
|
69
74
|
host name.
|
|
70
75
|
|
|
71
76
|
Throws an `InvalidArgumentError` if `proxyUrl` is missing or does not use the
|
|
72
|
-
`socks5:` or `socks:` protocol.
|
|
77
|
+
`socks5:` or `socks:` protocol, or if `connectTimeout`, `proxyTls.timeout`, or
|
|
78
|
+
`requestTls.timeout` is not a finite, non-negative number.
|
|
73
79
|
|
|
74
80
|
```mjs
|
|
75
81
|
import { Socks5ProxyAgent } from 'undici'
|
|
@@ -15,7 +15,6 @@ const kContentType = Symbol('kContentType')
|
|
|
15
15
|
const kContentLength = Symbol('kContentLength')
|
|
16
16
|
const kUsed = Symbol('kUsed')
|
|
17
17
|
const kBytesRead = Symbol('kBytesRead')
|
|
18
|
-
const kPreservedBuffer = Symbol('kPreservedBuffer')
|
|
19
18
|
|
|
20
19
|
const noop = () => {}
|
|
21
20
|
|
|
@@ -326,36 +325,14 @@ class BodyReadable extends Readable {
|
|
|
326
325
|
*/
|
|
327
326
|
setEncoding (encoding) {
|
|
328
327
|
if (Buffer.isEncoding(encoding)) {
|
|
329
|
-
// Preserve raw Buffer chunks for the consume path (body.text(),
|
|
330
|
-
// body.json(), etc.) before super.setEncoding() replaces them
|
|
331
|
-
// with decoded strings. Without this, the consume path would
|
|
332
|
-
// lose access to the original bytes — some of which may be held
|
|
333
|
-
// by the decoder for incomplete multi-byte sequences, and the
|
|
334
|
-
// rest converted to strings that can't be safely concatenated
|
|
335
|
-
// byte-wise.
|
|
336
|
-
const state = this._readableState
|
|
337
|
-
const buffer = state.buffer
|
|
338
|
-
if (buffer && state.length > 0) {
|
|
339
|
-
const bufferIndex = state.bufferIndex ?? 0
|
|
340
|
-
const preserved = []
|
|
341
|
-
const source = typeof buffer.slice === 'function'
|
|
342
|
-
? buffer.slice(bufferIndex)
|
|
343
|
-
: buffer
|
|
344
|
-
for (const data of source) {
|
|
345
|
-
if (Buffer.isBuffer(data)) {
|
|
346
|
-
preserved.push(data)
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
if (preserved.length > 0) {
|
|
350
|
-
this[kPreservedBuffer] = (this[kPreservedBuffer] || []).concat(preserved)
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
328
|
// Delegate to Node.js Readable.setEncoding() which initializes a
|
|
355
329
|
// StringDecoder and re-encodes already-buffered chunks. This properly
|
|
356
330
|
// handles multi-byte sequences split at chunk boundaries for the
|
|
357
331
|
// for-await / on('data') paths. Without this, Node.js uses
|
|
358
332
|
// buf.toString(encoding) on each chunk, producing U+FFFD for split chars.
|
|
333
|
+
//
|
|
334
|
+
// The consume path (body.text(), body.json(), ...) copes with the
|
|
335
|
+
// decoded strings this leaves in state.buffer, see consumeStart().
|
|
359
336
|
super.setEncoding(encoding)
|
|
360
337
|
}
|
|
361
338
|
return this
|
|
@@ -464,17 +441,7 @@ function consumeStart (consume) {
|
|
|
464
441
|
|
|
465
442
|
const { _readableState: state } = consume.stream
|
|
466
443
|
|
|
467
|
-
|
|
468
|
-
// (which would break Buffer.concat in chunksDecode). Use the preserved
|
|
469
|
-
// raw Buffers (saved before super.setEncoding() in setEncoding()) for
|
|
470
|
-
// byte-level accurate consumption. Otherwise read from state.buffer.
|
|
471
|
-
const preserved = consume.stream[kPreservedBuffer]
|
|
472
|
-
if (preserved && preserved.length > 0) {
|
|
473
|
-
for (const chunk of preserved) {
|
|
474
|
-
consumePush(consume, chunk)
|
|
475
|
-
}
|
|
476
|
-
consume.stream[kPreservedBuffer] = null
|
|
477
|
-
} else if (state.bufferIndex) {
|
|
444
|
+
if (state.bufferIndex) {
|
|
478
445
|
const start = state.bufferIndex
|
|
479
446
|
const end = state.buffer.length
|
|
480
447
|
for (let n = start; n < end; n++) {
|
|
@@ -486,14 +453,29 @@ function consumeStart (consume) {
|
|
|
486
453
|
}
|
|
487
454
|
}
|
|
488
455
|
|
|
456
|
+
// If setEncoding() was called, state.buffer holds decoded strings, which
|
|
457
|
+
// consumePush() turns back into bytes. The trailing bytes of a multi-byte
|
|
458
|
+
// sequence split across a chunk boundary are not part of any of those
|
|
459
|
+
// strings, they are held inside the decoder until the rest arrives, so
|
|
460
|
+
// take them from there.
|
|
461
|
+
const decoder = state.decoder
|
|
462
|
+
if (decoder != null && decoder.lastNeed > 0) {
|
|
463
|
+
consumePush(consume, Buffer.from(decoder.lastChar.subarray(0, decoder.lastTotal - decoder.lastNeed)))
|
|
464
|
+
}
|
|
465
|
+
|
|
489
466
|
if (state.endEmitted) {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
467
|
+
// No `this` to read the consume off here: consumeStart is a free function, called from
|
|
468
|
+
// the queueMicrotask above. The callback below does have one, because the emitter passes
|
|
469
|
+
// the stream as its receiver. Returning matters too - consumeEnd() clears consume.stream,
|
|
470
|
+
// which the resume() below would then dereference.
|
|
471
|
+
consumeEnd(consume, state.encoding)
|
|
472
|
+
return
|
|
495
473
|
}
|
|
496
474
|
|
|
475
|
+
consume.stream.on('end', function () {
|
|
476
|
+
consumeEnd(this[kConsume], this._readableState.encoding)
|
|
477
|
+
})
|
|
478
|
+
|
|
497
479
|
consume.stream.resume()
|
|
498
480
|
|
|
499
481
|
while (consume.stream.read() != null) {
|
|
@@ -583,7 +565,7 @@ function consumeEnd (consume, encoding) {
|
|
|
583
565
|
|
|
584
566
|
/**
|
|
585
567
|
* @param {Consume} consume
|
|
586
|
-
* @param {Buffer} chunk
|
|
568
|
+
* @param {Buffer|string} chunk
|
|
587
569
|
* @returns {void}
|
|
588
570
|
*/
|
|
589
571
|
function consumePush (consume, chunk) {
|
|
@@ -591,6 +573,14 @@ function consumePush (consume, chunk) {
|
|
|
591
573
|
return
|
|
592
574
|
}
|
|
593
575
|
|
|
576
|
+
if (typeof chunk === 'string') {
|
|
577
|
+
// Buffered before the consume started, while an encoding was set.
|
|
578
|
+
// consume.length has to stay a byte count and chunksDecode()/chunksConcat()
|
|
579
|
+
// only work on bytes, so re-encode. A string's own length is in UTF-16 code
|
|
580
|
+
// units and Uint8Array.prototype.set() ignores a string argument entirely.
|
|
581
|
+
chunk = Buffer.from(chunk, consume.stream._readableState.encoding)
|
|
582
|
+
}
|
|
583
|
+
|
|
594
584
|
consume.length += chunk.length
|
|
595
585
|
consume.body.push(chunk)
|
|
596
586
|
}
|
|
@@ -87,7 +87,7 @@ class MemoryCacheStore extends EventEmitter {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
|
-
* @param {import('../../types/cache-interceptor.d.ts').default.CacheKey}
|
|
90
|
+
* @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key
|
|
91
91
|
* @returns {import('../../types/cache-interceptor.d.ts').default.GetResult | undefined}
|
|
92
92
|
*/
|
|
93
93
|
get (key) {
|
|
@@ -179,7 +179,7 @@ class MemoryCacheStore extends EventEmitter {
|
|
|
179
179
|
|
|
180
180
|
// Perform eviction
|
|
181
181
|
for (const [key, entries] of store.#entries) {
|
|
182
|
-
for (const entry of entries.splice(0, entries.length / 2)) {
|
|
182
|
+
for (const entry of entries.splice(0, Math.ceil(entries.length / 2))) {
|
|
183
183
|
store.#size -= entry.size
|
|
184
184
|
store.#count -= 1
|
|
185
185
|
}
|
|
@@ -105,13 +105,27 @@ function buildConnector ({ allowH2, preferH2, useH2c, maxCachedSessions, socketP
|
|
|
105
105
|
|
|
106
106
|
port = port || 80
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
const connectOptions = {
|
|
109
109
|
highWaterMark: 64 * 1024, // Same as nodejs fs streams.
|
|
110
110
|
...options,
|
|
111
111
|
localAddress,
|
|
112
112
|
port,
|
|
113
113
|
host: hostname
|
|
114
|
-
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const family = net.isIP(hostname)
|
|
117
|
+
if (family !== 0 && servername && servername !== hostname) {
|
|
118
|
+
connectOptions.host = servername
|
|
119
|
+
connectOptions.lookup = (_hostname, lookupOptions, cb) => {
|
|
120
|
+
if (lookupOptions.all) {
|
|
121
|
+
cb(null, [{ address: hostname, family }])
|
|
122
|
+
} else {
|
|
123
|
+
cb(null, hostname, family)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
socket = net.connect(connectOptions)
|
|
115
129
|
if (useH2c === true) {
|
|
116
130
|
socket.alpnProtocol = 'h2'
|
|
117
131
|
}
|
|
@@ -5,6 +5,8 @@ module.exports = {
|
|
|
5
5
|
kDestroy: Symbol('destroy'),
|
|
6
6
|
kDispatch: Symbol('dispatch'),
|
|
7
7
|
kUrl: Symbol('url'),
|
|
8
|
+
kRequestOrigin: Symbol('request origin'),
|
|
9
|
+
kOriginless: Symbol('originless'),
|
|
8
10
|
kWriting: Symbol('writing'),
|
|
9
11
|
kResuming: Symbol('resuming'),
|
|
10
12
|
kQueue: Symbol('queue'),
|
|
@@ -56,6 +58,7 @@ module.exports = {
|
|
|
56
58
|
kCounter: Symbol('socket request counter'),
|
|
57
59
|
kMaxResponseSize: Symbol('max response size'),
|
|
58
60
|
kHTTP2Session: Symbol('http2Session'),
|
|
61
|
+
kHTTP2Options: Symbol('http2 options'),
|
|
59
62
|
kHTTP2SessionState: Symbol('http2Session state'),
|
|
60
63
|
kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
|
|
61
64
|
kConstruct: Symbol('constructable'),
|