@openclaw/discord 2026.8.1-beta.2 → 2026.8.1-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{account-inspect-CqzrH14k.js → account-inspect-D5xmUpnj.js} +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/accounts-DNl-oCEw.js +371 -0
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-DS7vpdtp.js → activities-api-KCBAmWxD.js} +133 -175
- package/dist/activities-api.js +1 -1
- package/dist/api.js +17 -17
- package/dist/{approval-handler.runtime-B6yEV79q.js → approval-handler.runtime-B12RCYr8.js} +6 -6
- package/dist/{approval-message-safety-AcIxvrf3.js → approval-message-safety-XGFPbDoI.js} +89 -3
- package/dist/{audit-Db-rlntl.js → audit-Yc7eZDd6.js} +5 -5
- package/dist/{channel-actions-5s_hjYKd.js → channel-actions-Dr2QI8Bf.js} +10 -6
- package/dist/{channel-actions.runtime-CLKrx6tr.js → channel-actions.runtime-CODTvo7c.js} +53 -68
- package/dist/{channel-CnnbJSt5.js → channel-cXYzGc4L.js} +74 -50
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-BFAO-V1P.js → channel.setup-CSiwnMgs.js} +5 -5
- package/dist/{outbound-session-route-DxLkrgKQ.js → components-ezGKo_Yh.js} +3 -49
- package/dist/{config-schema-BgEskFAs.js → config-schema-DC5kDtQ5.js} +33 -7
- package/dist/conversation-binding-route-D6rCQ5S0.js +43 -0
- package/dist/{directory-config-BVX7Cflc.js → directory-config-XyCfoqLg.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-DGIGxpIo.js → directory-live-Df0NbFJB.js} +3 -3
- package/dist/{doctor-BzC-TLnB.js → doctor-DYY31GrO.js} +33 -12
- package/dist/doctor-contract-api.js +3 -3
- package/dist/{handle-action.guild-admin-BNVTUISF.js → handle-action.guild-admin-6Tvvinsa.js} +2 -2
- package/dist/index.js +3 -4
- package/dist/{message-handler-Unk_f10F.js → message-handler-B61q5MOF.js} +82 -6
- package/dist/{message-handler.preflight-C9zecxR9.js → message-handler.preflight-Bzg_Hawz.js} +36 -46
- package/dist/{message-handler.process-DWQ6UHHu.js → message-handler.process--4_712Ec.js} +159 -183
- package/dist/{message-utils-BSCPVgy0.js → message-utils-BXLLnFl6.js} +31 -32
- package/dist/{outbound-adapter-D9nRivT1.js → outbound-adapter-DxHTOqiN.js} +83 -53
- package/dist/{outbound-components-cTzwBJ60.js → outbound-components-B2PL0ooH.js} +3 -3
- package/dist/owner-access-Bg41VzAf.js +107 -0
- package/dist/{pluralkit-DdiJ9KMK.js → pluralkit-dUl4v1X3.js} +1 -1
- package/dist/{probe-Bl-k5_Ku.js → probe-BTdtVRwU.js} +1 -1
- package/dist/{probe.runtime-M9fREKvp.js → probe.runtime-Dq5-PRKT.js} +1 -1
- package/dist/{provider-DvSNb-2v.js → provider-DlK_ynqt.js} +356 -967
- package/dist/{provider-session.runtime-BUEqD0rA.js → provider-session.runtime-CvvphHvs.js} +3 -3
- package/dist/provider.runtime-CzKGRiAF.js +2 -0
- package/dist/{realtime-session.runtime-C7wen-aF.js → realtime-session.runtime-ysbMG8v7.js} +24 -13
- package/dist/{resolve-allowlist-common-D04lpEzb.js → resolve-allowlist-common-DIVXbD1P.js} +2 -2
- package/dist/{resolve-channels-Dm7jEeg6.js → resolve-channels-CGeUoIqb.js} +3 -3
- package/dist/{resolve-users-bktrCUUU.js → resolve-users-BtKxLUZv.js} +2 -2
- package/dist/{retry-CLpJcXXf.js → retry-DNsVTeTo.js} +18 -64
- package/dist/{runtime-DoHjckYm.js → runtime-CQovMsH3.js} +9 -10
- package/dist/{runtime-DGsSyDTS.js → runtime-D71_VFLr.js} +29 -43
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +22 -21
- package/dist/runtime-api.lookup.js +5 -5
- package/dist/runtime-api.monitor-CzeTYF32.js +6 -0
- package/dist/runtime-api.monitor.js +6 -5
- package/dist/runtime-api.send.js +6 -6
- package/dist/runtime-api.threads.js +4 -4
- package/dist/{sdk-runtime-QpY8PvCh.js → sdk-runtime-37OU6_Yh.js} +3 -4
- package/dist/{secret-config-contract-B1akrlyY.js → secret-config-contract-B3i6WxV5.js} +53 -25
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/{security-audit.runtime-CPN0xFYz.js → security-audit.runtime-BVKF9VtY.js} +1 -1
- package/dist/{send-B7Q6Oc1I.js → send-rQIffSYu.js} +10 -10
- package/dist/{send.components-iJyFXw9L.js → send.components-ChK1wS7w.js} +14 -24
- package/dist/{send.outbound-DS5tHwfR.js → send.outbound-HIkgji_7.js} +26 -16
- package/dist/{send.reactions-BAn0iiVQ.js → send.reactions-gmJ6yFPo.js} +2 -2
- package/dist/{send.receipt-IPI1p-SP.js → send.receipt-Cnhoautb.js} +11 -1
- package/dist/{send.shared-BmwFjW6T.js → send.shared-B3fpaLWJ.js} +104 -104
- package/dist/{sender-identity-QtalnCYv.js → sender-identity-BJtfyise.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-BIXIX6uJ.js → shared-CaAaoksy.js} +15 -10
- package/dist/subagent-hooks-CNT2ZJTJ.js +49 -0
- package/dist/subagent-hooks-api.js +2 -2
- package/dist/{subagent-progress-DhaE_h8a.js → subagent-progress-FPLqBY1s.js} +5 -4
- package/dist/{system-events-CTqDf6_s.js → system-events-Nuwoq_au.js} +2 -2
- package/dist/{target-resolver-maOKSqO0.js → target-resolver-DIXShHaZ.js} +3 -3
- package/dist/targets-B2pf49zc.js +3 -0
- package/dist/{thread-bindings-3L8p82GV.js → thread-bindings-VlymUnbz.js} +29 -26
- package/dist/{thread-bindings.manager-DCIH6WDC.js → thread-bindings.manager-CngsgErq.js} +9 -8
- package/dist/{thread-bindings.session-updates-bJ2KQFY6.js → thread-bindings.session-updates-CJb-BpPL.js} +1 -1
- package/dist/{thread-bindings.state-aeV8HNgV.js → thread-bindings.state-D8OMdk4O.js} +1 -1
- package/dist/threading-DU6pgeGm.js +456 -0
- package/dist/transcripts-source-DeIMNbRh.js +265 -0
- package/dist/transcripts-source-api.js +7 -2
- package/dist/{typing-CS-nNVoe.js → typing-oLiS5Z13.js} +1 -1
- package/dist/{voice-runtime-BEdqNcST.js → voice-runtime-CjNFaynA.js} +181 -91
- package/openclaw.plugin.json +12 -6
- package/package.json +4 -6
- package/dist/accounts-DJTf1LtA.js +0 -219
- package/dist/channel-api-CAJ0wMoV.js +0 -21
- package/dist/provider.runtime-C9PnJZbZ.js +0 -2
- package/dist/runtime-api.monitor-CHxrFPnW.js +0 -5
- package/dist/subagent-hooks-CTt5KCJr.js +0 -120
- package/dist/targets-yUFTHoAx.js +0 -3
- package/dist/transcripts-source-CfFMexGt.js +0 -123
- package/node_modules/p-map/index.d.ts +0 -155
- package/node_modules/p-map/index.js +0 -285
- package/node_modules/p-map/license +0 -9
- package/node_modules/p-map/package.json +0 -57
- package/node_modules/p-map/readme.md +0 -190
- package/dist/{allow-list-DnxIlPP2.js → allow-list-BDMimASD.js} +1 -1
- package/dist/{audit-core-xwjIczO0.js → audit-core-BCX8UeFH.js} +1 -1
- package/dist/{doctor-contract-DLa-BTiU.js → doctor-contract-DsWvKIXF.js} +1 -1
- package/dist/{security-audit-jGnJF__m.js → security-audit-BfJhAXZp.js} +1 -1
package/dist/runtime-api.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-iJyFXw9L.js";
|
|
1
|
+
import { O as resolveDiscordOutboundSessionRoute } from "./accounts-DNl-oCEw.js";
|
|
2
|
+
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-ChK1wS7w.js";
|
|
4
3
|
import { r as setDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
5
|
-
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-
|
|
6
|
-
import { _ as resolveDiscordShouldRequireMention, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, f as resolveDiscordGuildEntry, n as isDiscordGroupAllowedByPolicy, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, t as allowListMatches, u as resolveDiscordCommandAuthorized, v as resolveGroupDmAllow, y as shouldEmitDiscordReactionNotification } from "./allow-list-
|
|
7
|
-
import {
|
|
4
|
+
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-Df0NbFJB.js";
|
|
5
|
+
import { _ as resolveDiscordShouldRequireMention, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, f as resolveDiscordGuildEntry, n as isDiscordGroupAllowedByPolicy, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, t as allowListMatches, u as resolveDiscordCommandAuthorized, v as resolveGroupDmAllow, y as shouldEmitDiscordReactionNotification } from "./allow-list-BDMimASD.js";
|
|
6
|
+
import { C as hasAllGuildPermissionsDiscord, G as registerGateway, K as unregisterGateway, S as fetchMemberGuildPermissionsDiscord, T as hasAnyGuildPermissionDiscord, U as clearGateways, W as getGateway, _ as DiscordSendError, x as fetchChannelPermissionsDiscord } from "./send.shared-B3fpaLWJ.js";
|
|
7
|
+
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-HIkgji_7.js";
|
|
8
8
|
import { i as setPresence, n as getPresence, r as presenceCacheSize, t as clearPresences } from "./presence-cache-z1N8MbJ3.js";
|
|
9
|
-
import { A as listGuildEmojisDiscord, C as fetchVoiceStatusDiscord, D as removeRoleDiscord, E as listScheduledEventsDiscord, F as editChannelDiscord, I as moveChannelDiscord, L as removeChannelPermissionDiscord, M as uploadStickerDiscord, N as createChannelDiscord, O as resolveEventCoverImage, P as deleteChannelDiscord, R as setChannelPermissionDiscord, S as fetchRoleInfoDiscord, T as listGuildChannelsDiscord, _ as banMemberDiscord, c as editMessageDiscord, d as listThreadsDiscord, f as pinMessageDiscord, g as addRoleDiscord, h as unpinMessageDiscord, i as sendWebhookMessageDiscord, j as uploadEmojiDiscord, k as timeoutMemberDiscord, l as fetchMessageDiscord, m as searchMessagesDiscord, n as sendTypingDiscord, o as createThreadDiscord, p as readMessagesDiscord, r as sendVoiceMessageDiscord, s as deleteMessageDiscord, u as listPinsDiscord, v as createScheduledEventDiscord, w as kickMemberDiscord, x as fetchMemberInfoDiscord, y as fetchChannelInfoDiscord } from "./send-
|
|
9
|
+
import { A as listGuildEmojisDiscord, C as fetchVoiceStatusDiscord, D as removeRoleDiscord, E as listScheduledEventsDiscord, F as editChannelDiscord, I as moveChannelDiscord, L as removeChannelPermissionDiscord, M as uploadStickerDiscord, N as createChannelDiscord, O as resolveEventCoverImage, P as deleteChannelDiscord, R as setChannelPermissionDiscord, S as fetchRoleInfoDiscord, T as listGuildChannelsDiscord, _ as banMemberDiscord, c as editMessageDiscord, d as listThreadsDiscord, f as pinMessageDiscord, g as addRoleDiscord, h as unpinMessageDiscord, i as sendWebhookMessageDiscord, j as uploadEmojiDiscord, k as timeoutMemberDiscord, l as fetchMessageDiscord, m as searchMessagesDiscord, n as sendTypingDiscord, o as createThreadDiscord, p as readMessagesDiscord, r as sendVoiceMessageDiscord, s as deleteMessageDiscord, u as listPinsDiscord, v as createScheduledEventDiscord, w as kickMemberDiscord, x as fetchMemberInfoDiscord, y as fetchChannelInfoDiscord } from "./send-rQIffSYu.js";
|
|
10
10
|
import { a as isAbortError, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, l as runDiscordTaskWithTimeout, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, o as normalizeDiscordInboundWorkerTimeoutMs, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, s as normalizeDiscordListenerTimeoutMs, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-B9cy6RvQ.js";
|
|
11
|
-
import { i as removeReactionDiscord, n as reactMessageDiscord, r as removeOwnReactionsDiscord, t as fetchReactionsDiscord } from "./send.reactions-
|
|
12
|
-
import { c as readDiscordChannelMoveParams, i as requiredGuildPermissionForModerationAction, l as readDiscordParentIdParam, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-
|
|
13
|
-
import { t as discordMessageActions } from "./channel-actions-
|
|
14
|
-
import { C as resolveThreadBindingMaxAgeExpiresAt, S as resolveThreadBindingInactivityExpiresAt, w as resolveThreadBindingMaxAgeMs, x as resolveThreadBindingIdleTimeoutMs } from "./thread-bindings.state-
|
|
15
|
-
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-
|
|
16
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
17
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
18
|
-
import { _ as resolveThreadBindingThreadName, g as resolveThreadBindingIntroText, h as formatThreadBindingDurationLabel, m as resolveThreadBindingPersonaFromRecord, n as createThreadBindingManager, p as resolveThreadBindingPersona, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-
|
|
19
|
-
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-
|
|
20
|
-
import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
11
|
+
import { i as removeReactionDiscord, n as reactMessageDiscord, r as removeOwnReactionsDiscord, t as fetchReactionsDiscord } from "./send.reactions-gmJ6yFPo.js";
|
|
12
|
+
import { c as readDiscordChannelMoveParams, i as requiredGuildPermissionForModerationAction, l as readDiscordParentIdParam, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-D71_VFLr.js";
|
|
13
|
+
import { t as discordMessageActions } from "./channel-actions-Dr2QI8Bf.js";
|
|
14
|
+
import { C as resolveThreadBindingMaxAgeExpiresAt, S as resolveThreadBindingInactivityExpiresAt, w as resolveThreadBindingMaxAgeMs, x as resolveThreadBindingIdleTimeoutMs } from "./thread-bindings.state-D8OMdk4O.js";
|
|
15
|
+
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-CJb-BpPL.js";
|
|
16
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-CGeUoIqb.js";
|
|
17
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-BtKxLUZv.js";
|
|
18
|
+
import { _ as resolveThreadBindingThreadName, g as resolveThreadBindingIntroText, h as formatThreadBindingDurationLabel, m as resolveThreadBindingPersonaFromRecord, n as createThreadBindingManager, p as resolveThreadBindingPersona, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-CngsgErq.js";
|
|
19
|
+
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-VlymUnbz.js";
|
|
20
|
+
import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-BTdtVRwU.js";
|
|
21
21
|
import "./runtime-api.actions.js";
|
|
22
|
-
import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-
|
|
22
|
+
import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-Yc7eZDd6.js";
|
|
23
23
|
import "./runtime-api.lookup.js";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import "./
|
|
24
|
+
import { d as waitForDiscordGatewayPluginRegistration, f as createDiscordNativeCommand, l as createDiscordGatewayPlugin, t as monitorDiscordProvider, u as resolveDiscordGatewayIntents, v as registerDiscordListener } from "./provider-DlK_ynqt.js";
|
|
25
|
+
import { o as sanitizeDiscordThreadName, r as resolveDiscordReplyTarget } from "./threading-DU6pgeGm.js";
|
|
26
|
+
import { t as createDiscordMessageHandler } from "./message-handler-B61q5MOF.js";
|
|
27
|
+
import "./runtime-api.monitor-CzeTYF32.js";
|
|
27
28
|
import "./runtime-api.send.js";
|
|
28
29
|
import "./runtime-api.threads.js";
|
|
29
30
|
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, DiscordSendError, addRoleDiscord, allowListMatches, auditDiscordChannelPermissions, autoBindSpawnedDiscordSubagent, banMemberDiscord, clearGateways, clearPresences, collectDiscordAuditChannelIds, createChannelDiscord, createDiscordGatewayPlugin, createDiscordMessageHandler, createDiscordNativeCommand, createNoopThreadBindingManager, createScheduledEventDiscord, createThreadBindingManager, createThreadDiscord, deleteChannelDiscord, deleteMessageDiscord, discordMessageActions, editChannelDiscord, editDiscordComponentMessage, editMessageDiscord, fetchChannelInfoDiscord, fetchChannelPermissionsDiscord, fetchDiscordApplicationId, fetchDiscordApplicationSummary, fetchMemberGuildPermissionsDiscord, fetchMemberInfoDiscord, fetchMessageDiscord, fetchReactionsDiscord, fetchRoleInfoDiscord, fetchVoiceStatusDiscord, formatThreadBindingDurationLabel, getGateway, getPresence, getThreadBindingManager, handleDiscordAction, hasAllGuildPermissionsDiscord, hasAnyGuildPermissionDiscord, isAbortError, isDiscordGroupAllowedByPolicy, isDiscordModerationAction, kickMemberDiscord, listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive, listGuildChannelsDiscord, listGuildEmojisDiscord, listPinsDiscord, listScheduledEventsDiscord, listThreadBindingsBySessionKey, listThreadBindingsForAccount, listThreadsDiscord, monitorDiscordProvider, moveChannelDiscord, normalizeDiscordAllowList, normalizeDiscordInboundWorkerTimeoutMs, normalizeDiscordListenerTimeoutMs, normalizeDiscordSlug, parseApplicationIdFromToken, pinMessageDiscord, presenceCacheSize, probeDiscord, reactMessageDiscord, readDiscordChannelCreateParams, readDiscordChannelEditParams, readDiscordChannelMoveParams, readDiscordModerationCommand, readDiscordParentIdParam, readMessagesDiscord, reconcileAcpThreadBindingsOnStartup, registerBuiltDiscordComponentMessage, registerDiscordListener, registerGateway, removeChannelPermissionDiscord, removeOwnReactionsDiscord, removeReactionDiscord, removeRoleDiscord, requiredGuildPermissionForModerationAction, resolveDiscordChannelAllowlist, resolveDiscordChannelConfig, resolveDiscordChannelConfigWithFallback, resolveDiscordCommandAuthorized, resolveDiscordGatewayIntents, resolveDiscordGuildEntry, resolveDiscordOutboundSessionRoute, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordReplyTarget, resolveDiscordShouldRequireMention, resolveDiscordThreadBindingIdleTimeoutMs, resolveDiscordThreadBindingMaxAgeMs, resolveDiscordUserAllowlist, resolveEventCoverImage, resolveGroupDmAllow, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingInactivityExpiresAt, resolveThreadBindingIntroText, resolveThreadBindingMaxAgeExpiresAt, resolveThreadBindingMaxAgeMs, resolveThreadBindingPersona, resolveThreadBindingPersonaFromRecord, resolveThreadBindingThreadName, resolveThreadBindingsEnabled, runDiscordTaskWithTimeout, sanitizeDiscordThreadName, searchMessagesDiscord, sendDiscordComponentMessage, sendMessageDiscord, sendPollDiscord, sendStickerDiscord, sendTypingDiscord, sendVoiceMessageDiscord, sendWebhookMessageDiscord, setChannelPermissionDiscord, setDiscordRuntime, setPresence, setThreadBindingIdleTimeoutBySessionKey, setThreadBindingMaxAgeBySessionKey, shouldEmitDiscordReactionNotification, timeoutMemberDiscord, unbindThreadBindingsBySessionKey, unpinMessageDiscord, unregisterGateway, uploadEmojiDiscord, uploadStickerDiscord, waitForDiscordGatewayPluginRegistration };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as setDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
2
|
-
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-
|
|
3
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
4
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
5
|
-
import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
6
|
-
import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-
|
|
2
|
+
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-Df0NbFJB.js";
|
|
3
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-CGeUoIqb.js";
|
|
4
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-BtKxLUZv.js";
|
|
5
|
+
import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-BTdtVRwU.js";
|
|
6
|
+
import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-Yc7eZDd6.js";
|
|
7
7
|
export { auditDiscordChannelPermissions, collectDiscordAuditChannelIds, fetchDiscordApplicationId, fetchDiscordApplicationSummary, listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive, parseApplicationIdFromToken, probeDiscord, resolveDiscordChannelAllowlist, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordUserAllowlist, setDiscordRuntime };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { _ as resolveDiscordShouldRequireMention, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, f as resolveDiscordGuildEntry, n as isDiscordGroupAllowedByPolicy, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, t as allowListMatches, u as resolveDiscordCommandAuthorized, v as resolveGroupDmAllow, y as shouldEmitDiscordReactionNotification } from "./allow-list-BDMimASD.js";
|
|
2
|
+
import { G as registerGateway, K as unregisterGateway, U as clearGateways, W as getGateway } from "./send.shared-B3fpaLWJ.js";
|
|
3
3
|
import { i as setPresence, n as getPresence, r as presenceCacheSize, t as clearPresences } from "./presence-cache-z1N8MbJ3.js";
|
|
4
4
|
import { a as isAbortError, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, l as runDiscordTaskWithTimeout, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, o as normalizeDiscordInboundWorkerTimeoutMs, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, s as normalizeDiscordListenerTimeoutMs, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-B9cy6RvQ.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "./
|
|
5
|
+
import { d as waitForDiscordGatewayPluginRegistration, f as createDiscordNativeCommand, l as createDiscordGatewayPlugin, t as monitorDiscordProvider, u as resolveDiscordGatewayIntents, v as registerDiscordListener } from "./provider-DlK_ynqt.js";
|
|
6
|
+
import { o as sanitizeDiscordThreadName, r as resolveDiscordReplyTarget } from "./threading-DU6pgeGm.js";
|
|
7
|
+
import { t as createDiscordMessageHandler } from "./message-handler-B61q5MOF.js";
|
|
8
|
+
import "./runtime-api.monitor-CzeTYF32.js";
|
|
8
9
|
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, allowListMatches, clearGateways, clearPresences, createDiscordGatewayPlugin, createDiscordMessageHandler, createDiscordNativeCommand, getGateway, getPresence, isAbortError, isDiscordGroupAllowedByPolicy, monitorDiscordProvider, normalizeDiscordAllowList, normalizeDiscordInboundWorkerTimeoutMs, normalizeDiscordListenerTimeoutMs, normalizeDiscordSlug, presenceCacheSize, registerDiscordListener, registerGateway, resolveDiscordChannelConfig, resolveDiscordChannelConfigWithFallback, resolveDiscordCommandAuthorized, resolveDiscordGatewayIntents, resolveDiscordGuildEntry, resolveDiscordReplyTarget, resolveDiscordShouldRequireMention, resolveGroupDmAllow, runDiscordTaskWithTimeout, sanitizeDiscordThreadName, setPresence, shouldEmitDiscordReactionNotification, unregisterGateway, waitForDiscordGatewayPluginRegistration };
|
package/dist/runtime-api.send.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
5
|
-
import { A as listGuildEmojisDiscord, C as fetchVoiceStatusDiscord, D as removeRoleDiscord, E as listScheduledEventsDiscord, F as editChannelDiscord, I as moveChannelDiscord, L as removeChannelPermissionDiscord, M as uploadStickerDiscord, N as createChannelDiscord, O as resolveEventCoverImage, P as deleteChannelDiscord, R as setChannelPermissionDiscord, S as fetchRoleInfoDiscord, T as listGuildChannelsDiscord, _ as banMemberDiscord, c as editMessageDiscord, d as listThreadsDiscord, f as pinMessageDiscord, g as addRoleDiscord, h as unpinMessageDiscord, i as sendWebhookMessageDiscord, j as uploadEmojiDiscord, k as timeoutMemberDiscord, l as fetchMessageDiscord, m as searchMessagesDiscord, n as sendTypingDiscord, o as createThreadDiscord, p as readMessagesDiscord, r as sendVoiceMessageDiscord, s as deleteMessageDiscord, u as listPinsDiscord, v as createScheduledEventDiscord, w as kickMemberDiscord, x as fetchMemberInfoDiscord, y as fetchChannelInfoDiscord } from "./send-
|
|
6
|
-
import { i as removeReactionDiscord, n as reactMessageDiscord, r as removeOwnReactionsDiscord, t as fetchReactionsDiscord } from "./send.reactions-
|
|
1
|
+
import { O as resolveDiscordOutboundSessionRoute } from "./accounts-DNl-oCEw.js";
|
|
2
|
+
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-ChK1wS7w.js";
|
|
3
|
+
import { C as hasAllGuildPermissionsDiscord, S as fetchMemberGuildPermissionsDiscord, T as hasAnyGuildPermissionDiscord, _ as DiscordSendError, x as fetchChannelPermissionsDiscord } from "./send.shared-B3fpaLWJ.js";
|
|
4
|
+
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-HIkgji_7.js";
|
|
5
|
+
import { A as listGuildEmojisDiscord, C as fetchVoiceStatusDiscord, D as removeRoleDiscord, E as listScheduledEventsDiscord, F as editChannelDiscord, I as moveChannelDiscord, L as removeChannelPermissionDiscord, M as uploadStickerDiscord, N as createChannelDiscord, O as resolveEventCoverImage, P as deleteChannelDiscord, R as setChannelPermissionDiscord, S as fetchRoleInfoDiscord, T as listGuildChannelsDiscord, _ as banMemberDiscord, c as editMessageDiscord, d as listThreadsDiscord, f as pinMessageDiscord, g as addRoleDiscord, h as unpinMessageDiscord, i as sendWebhookMessageDiscord, j as uploadEmojiDiscord, k as timeoutMemberDiscord, l as fetchMessageDiscord, m as searchMessagesDiscord, n as sendTypingDiscord, o as createThreadDiscord, p as readMessagesDiscord, r as sendVoiceMessageDiscord, s as deleteMessageDiscord, u as listPinsDiscord, v as createScheduledEventDiscord, w as kickMemberDiscord, x as fetchMemberInfoDiscord, y as fetchChannelInfoDiscord } from "./send-rQIffSYu.js";
|
|
6
|
+
import { i as removeReactionDiscord, n as reactMessageDiscord, r as removeOwnReactionsDiscord, t as fetchReactionsDiscord } from "./send.reactions-gmJ6yFPo.js";
|
|
7
7
|
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,5 +1,5 @@
|
|
|
1
|
-
import { C as resolveThreadBindingMaxAgeExpiresAt, S as resolveThreadBindingInactivityExpiresAt, w as resolveThreadBindingMaxAgeMs, x as resolveThreadBindingIdleTimeoutMs } from "./thread-bindings.state-
|
|
2
|
-
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-
|
|
3
|
-
import { _ as resolveThreadBindingThreadName, g as resolveThreadBindingIntroText, h as formatThreadBindingDurationLabel, m as resolveThreadBindingPersonaFromRecord, n as createThreadBindingManager, p as resolveThreadBindingPersona, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-
|
|
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-
|
|
1
|
+
import { C as resolveThreadBindingMaxAgeExpiresAt, S as resolveThreadBindingInactivityExpiresAt, w as resolveThreadBindingMaxAgeMs, x as resolveThreadBindingIdleTimeoutMs } from "./thread-bindings.state-D8OMdk4O.js";
|
|
2
|
+
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-CJb-BpPL.js";
|
|
3
|
+
import { _ as resolveThreadBindingThreadName, g as resolveThreadBindingIntroText, h as formatThreadBindingDurationLabel, m as resolveThreadBindingPersonaFromRecord, n as createThreadBindingManager, p as resolveThreadBindingPersona, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-CngsgErq.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-VlymUnbz.js";
|
|
5
5
|
export { autoBindSpawnedDiscordSubagent, createNoopThreadBindingManager, createThreadBindingManager, formatThreadBindingDurationLabel, getThreadBindingManager, listThreadBindingsBySessionKey, listThreadBindingsForAccount, reconcileAcpThreadBindingsOnStartup, resolveDiscordThreadBindingIdleTimeoutMs, resolveDiscordThreadBindingMaxAgeMs, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingInactivityExpiresAt, resolveThreadBindingIntroText, resolveThreadBindingMaxAgeExpiresAt, resolveThreadBindingMaxAgeMs, resolveThreadBindingPersona, resolveThreadBindingPersonaFromRecord, resolveThreadBindingThreadName, resolveThreadBindingsEnabled, setThreadBindingIdleTimeoutBySessionKey, setThreadBindingMaxAgeBySessionKey, unbindThreadBindingsBySessionKey };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { p as discord_exports } from "./retry-DNsVTeTo.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
@@ -314,11 +314,10 @@ async function writeVoiceWavFile(pcm) {
|
|
|
314
314
|
rootDir: resolvePreferredOpenClawTmpDir(),
|
|
315
315
|
prefix: "discord-voice-"
|
|
316
316
|
});
|
|
317
|
-
const wav = buildWavBuffer(pcm);
|
|
318
|
-
const filePath = await workspace.write("segment.wav", wav);
|
|
319
317
|
scheduleTempCleanup(workspace.dir);
|
|
318
|
+
const wav = buildWavBuffer(pcm);
|
|
320
319
|
return {
|
|
321
|
-
path:
|
|
320
|
+
path: await workspace.write("segment.wav", wav),
|
|
322
321
|
durationSeconds: estimateDurationSeconds(pcm)
|
|
323
322
|
};
|
|
324
323
|
}
|
|
@@ -1,6 +1,28 @@
|
|
|
1
|
+
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
1
2
|
import { collectNestedChannelFieldAssignments, collectSimpleChannelFieldAssignments, getChannelSurface, hasConfiguredSecretInputValue, isBaseFieldActiveForChannelSurface, isEnabledFlag, isRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
2
3
|
import { collectNestedChannelTtsAssignments } from "openclaw/plugin-sdk/channel-secret-tts-runtime";
|
|
3
4
|
//#region extensions/discord/src/secret-config-contract.ts
|
|
5
|
+
function createVoiceProviderSecretTarget(params) {
|
|
6
|
+
const path = `${params.scope === "account" ? "channels.discord.accounts.*" : "channels.discord"}.voice.${params.capability}.providers.*.apiKey`;
|
|
7
|
+
return {
|
|
8
|
+
id: path,
|
|
9
|
+
targetType: path,
|
|
10
|
+
configFile: "openclaw.json",
|
|
11
|
+
pathPattern: path,
|
|
12
|
+
secretShape: "secret_input",
|
|
13
|
+
expectedResolvedValue: "string",
|
|
14
|
+
includeInPlan: true,
|
|
15
|
+
includeInConfigure: true,
|
|
16
|
+
includeInAudit: true,
|
|
17
|
+
providerIdPathSegmentIndex: params.scope === "account" ? 7 : 5
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function discordRealtimeVoiceSecretOwnerId(accountId, providerId) {
|
|
21
|
+
return `discord:voice:realtime:${normalizeAccountId(accountId)}:${providerId}`;
|
|
22
|
+
}
|
|
23
|
+
function isRealtimeVoiceActive(value) {
|
|
24
|
+
return isRecord(value) && isEnabledFlag(value) && value.mode !== "stt-tts";
|
|
25
|
+
}
|
|
4
26
|
const secretTargetRegistryEntries = [
|
|
5
27
|
{
|
|
6
28
|
id: "channels.discord.accounts.*.pluralkit.token",
|
|
@@ -24,18 +46,14 @@ const secretTargetRegistryEntries = [
|
|
|
24
46
|
includeInConfigure: true,
|
|
25
47
|
includeInAudit: true
|
|
26
48
|
},
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
includeInConfigure: true,
|
|
36
|
-
includeInAudit: true,
|
|
37
|
-
providerIdPathSegmentIndex: 6
|
|
38
|
-
},
|
|
49
|
+
createVoiceProviderSecretTarget({
|
|
50
|
+
capability: "realtime",
|
|
51
|
+
scope: "account"
|
|
52
|
+
}),
|
|
53
|
+
createVoiceProviderSecretTarget({
|
|
54
|
+
capability: "tts",
|
|
55
|
+
scope: "account"
|
|
56
|
+
}),
|
|
39
57
|
{
|
|
40
58
|
id: "channels.discord.pluralkit.token",
|
|
41
59
|
targetType: "channels.discord.pluralkit.token",
|
|
@@ -58,18 +76,14 @@ const secretTargetRegistryEntries = [
|
|
|
58
76
|
includeInConfigure: true,
|
|
59
77
|
includeInAudit: true
|
|
60
78
|
},
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
includeInConfigure: true,
|
|
70
|
-
includeInAudit: true,
|
|
71
|
-
providerIdPathSegmentIndex: 4
|
|
72
|
-
}
|
|
79
|
+
createVoiceProviderSecretTarget({
|
|
80
|
+
capability: "realtime",
|
|
81
|
+
scope: "channel"
|
|
82
|
+
}),
|
|
83
|
+
createVoiceProviderSecretTarget({
|
|
84
|
+
capability: "tts",
|
|
85
|
+
scope: "channel"
|
|
86
|
+
})
|
|
73
87
|
];
|
|
74
88
|
function collectRuntimeConfigAssignments(params) {
|
|
75
89
|
const resolved = getChannelSurface(params.config, "discord");
|
|
@@ -116,6 +130,20 @@ function collectRuntimeConfigAssignments(params) {
|
|
|
116
130
|
accountActive: ({ account, enabled }) => enabled && isRecord(account.voice) && isEnabledFlag(account.voice),
|
|
117
131
|
accountInactiveReason: "Discord account is disabled or voice is disabled for this account."
|
|
118
132
|
});
|
|
133
|
+
collectNestedChannelTtsAssignments({
|
|
134
|
+
channelKey: "discord",
|
|
135
|
+
nestedKey: "voice",
|
|
136
|
+
providerBlockKey: "realtime",
|
|
137
|
+
ownerId: ({ accountId, providerId }) => discordRealtimeVoiceSecretOwnerId(accountId, providerId),
|
|
138
|
+
channel: discord,
|
|
139
|
+
surface,
|
|
140
|
+
defaults: params.defaults,
|
|
141
|
+
context: params.context,
|
|
142
|
+
topLevelActive: isBaseFieldActiveForChannelSurface(surface, "voice") && isRealtimeVoiceActive(discord.voice),
|
|
143
|
+
topInactiveReason: "no enabled Discord surface uses this top-level realtime voice config, voice is disabled, or voice mode is stt-tts.",
|
|
144
|
+
accountActive: ({ account, enabled }) => enabled && isRealtimeVoiceActive(account.voice),
|
|
145
|
+
accountInactiveReason: "Discord account is disabled, voice is disabled, or voice mode is stt-tts for this account."
|
|
146
|
+
});
|
|
119
147
|
}
|
|
120
148
|
//#endregion
|
|
121
|
-
export {
|
|
149
|
+
export { discordRealtimeVoiceSecretOwnerId as n, secretTargetRegistryEntries as r, collectRuntimeConfigAssignments as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as secretTargetRegistryEntries, t as collectRuntimeConfigAssignments } from "./secret-config-contract-B3i6WxV5.js";
|
|
2
2
|
export { collectRuntimeConfigAssignments, secretTargetRegistryEntries };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-
|
|
1
|
+
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-BfJhAXZp.js";
|
|
2
2
|
export { collectDiscordSecurityAuditFindings };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-
|
|
1
|
+
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-BfJhAXZp.js";
|
|
2
2
|
export { collectDiscordSecurityAuditFindings };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { $t as
|
|
2
|
-
import { s as resolveDiscordAccount } from "./accounts-DJTf1LtA.js";
|
|
1
|
+
import { $t as timeoutGuildMember, A as RateLimitError, At as pinChannelMessage, Bt as deleteChannelPermission, Ct as editChannelMessage, Dt as listChannelArchivedThreads, Ft as createGuildBan, Gt as listGuildChannels, Ht as getGuildMember, It as createGuildChannel, Jt as listGuildScheduledEvents, Kt as listGuildEmojis, Lt as createGuildEmoji, M as readDiscordCode, Mt as sendChannelTyping, N as readDiscordMessage, Nt as unpinChannelMessage, Ot as listChannelMessages, P as readRetryAfter, Pt as addGuildMemberRole, Qt as removeGuildMemberRole, Rt as createGuildScheduledEvent, St as editChannel, Tt as getChannelMessage, Ut as getGuildVoiceState, Vt as getGuild, Wt as listGuildActiveThreads, Xt as putChannelPermission, Yt as moveGuildChannels, Zt as removeGuildMember, bt as deleteChannel, en as __exportAll, i as recordDiscordMessageCreateAmbiguity, j as isUnknownDiscordVoiceStateError, jt as searchGuildMessages, k as DiscordError, kt as listChannelPins, n as createDiscordRetryRunner, qt as listGuildRoles, t as classifyDiscordDeliveryFailure, wt as getChannel, xt as deleteChannelMessage, yt as createThread, zt as createGuildSticker } from "./retry-DNsVTeTo.js";
|
|
3
2
|
import { t as parseDiscordRetryAfterBodySeconds } from "./retry-after-DdLPmPoa.js";
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import { r as
|
|
3
|
+
import { c as resolveDiscordAccount } from "./accounts-DNl-oCEw.js";
|
|
4
|
+
import { A as resolveDiscordMessageFlags, C as hasAllGuildPermissionsDiscord, L as resolveDiscordClientAccountContext, N as resolveDiscordSuppressEmbeds, P as createDiscordClient, R as resolveDiscordRest, S as fetchMemberGuildPermissionsDiscord, T as hasAnyGuildPermissionDiscord, _ as DiscordSendError, b as canViewDiscordGuildChannel, g as DISCORD_MAX_STICKER_BYTES, h as DISCORD_MAX_EVENT_COVER_BYTES, k as createDiscordMessageNonce, l as resolveChannelId, m as DISCORD_MAX_EMOJI_BYTES, n as buildDiscordTextChunks, o as normalizeEmojiName, p as sendDiscordText, q as parseAndResolveChannelRecipient, t as buildDiscordSendError, v as canManageGuildMemberRoleDiscord, w as hasAnyChannelPermissionDiscord, x as fetchChannelPermissionsDiscord, y as canManageGuildRoleDiscord, z as DISCORD_REST_TIMEOUT_MS } from "./send.shared-B3fpaLWJ.js";
|
|
5
|
+
import { n as sendPollDiscord, o as rewriteDiscordKnownMentions, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-HIkgji_7.js";
|
|
6
|
+
import { r as createDiscordSendResult } from "./send.receipt-Cnhoautb.js";
|
|
7
7
|
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS } from "./timeouts-B9cy6RvQ.js";
|
|
8
|
-
import { i as removeReactionDiscord, n as reactMessageDiscord, r as removeOwnReactionsDiscord, t as fetchReactionsDiscord } from "./send.reactions-
|
|
9
|
-
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
|
+
import { i as removeReactionDiscord, n as reactMessageDiscord, r as removeOwnReactionsDiscord, t as fetchReactionsDiscord } from "./send.reactions-gmJ6yFPo.js";
|
|
10
9
|
import fs from "node:fs/promises";
|
|
11
10
|
import { ChannelType } from "discord-api-types/v10";
|
|
12
11
|
import crypto from "node:crypto";
|
|
@@ -15,9 +14,10 @@ import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
|
15
14
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
16
15
|
import { readProviderJsonResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
17
16
|
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
18
|
-
import {
|
|
17
|
+
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
19
18
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
20
19
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
20
|
+
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
21
21
|
import { recordOutboundMessageIdentity } from "openclaw/plugin-sdk/channel-outbound";
|
|
22
22
|
import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, buildOutboundMediaLoadOptions, extensionForMime, maxBytesForKind, parseFfprobeCodecAndSampleRate, runFfmpeg, runFfprobe, unlinkIfExists } from "openclaw/plugin-sdk/media-runtime";
|
|
23
23
|
import { loadWebMediaRaw } from "openclaw/plugin-sdk/web-media";
|
|
@@ -534,8 +534,8 @@ async function runFfmpegToOutput(params) {
|
|
|
534
534
|
}
|
|
535
535
|
});
|
|
536
536
|
}
|
|
537
|
-
function createRateLimitError(response, body
|
|
538
|
-
return new RateLimitError(response, body
|
|
537
|
+
function createRateLimitError(response, body) {
|
|
538
|
+
return new RateLimitError(response, body);
|
|
539
539
|
}
|
|
540
540
|
/**
|
|
541
541
|
* Get audio duration using ffprobe
|
|
@@ -1,30 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { P as createDiscordClient, W as parseAndResolveChannelRecipient, g as createDiscordMessageNonce, l as resolveChannelId, m as SUPPRESS_NOTIFICATIONS_FLAG, t as buildDiscordSendError, u as resolveDiscordChannel } from "./send.shared-BmwFjW6T.js";
|
|
1
|
+
import { Ct as editChannelMessage, V as serializePayload, en as __exportAll, vt as createChannelMessage } from "./retry-DNsVTeTo.js";
|
|
2
|
+
import { d as buildDiscordComponentMessage, f as buildDiscordComponentMessageFlags, h as resolveDiscordComponentAttachmentName } from "./components-ezGKo_Yh.js";
|
|
3
|
+
import { c as resolveDiscordAccount, y as loadOutboundMediaFromUrl } from "./accounts-DNl-oCEw.js";
|
|
5
4
|
import { n as getOptionalDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import {
|
|
9
|
-
import { r as createDiscordSendResult } from "./send.receipt-IPI1p-SP.js";
|
|
10
|
-
import "openclaw/plugin-sdk/account-helpers";
|
|
11
|
-
import "openclaw/plugin-sdk/account-id";
|
|
12
|
-
import "openclaw/plugin-sdk/channel-config-helpers";
|
|
13
|
-
import "openclaw/plugin-sdk/routing";
|
|
14
|
-
import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
15
|
-
import "openclaw/plugin-sdk/secret-input";
|
|
5
|
+
import { D as SUPPRESS_NOTIFICATIONS_FLAG, P as createDiscordClient, k as createDiscordMessageNonce, l as resolveChannelId, q as parseAndResolveChannelRecipient, t as buildDiscordSendError, u as resolveDiscordChannel } from "./send.shared-B3fpaLWJ.js";
|
|
6
|
+
import { t as sendMessageDiscord } from "./send.outbound-HIkgji_7.js";
|
|
7
|
+
import { r as createDiscordSendResult } from "./send.receipt-Cnhoautb.js";
|
|
16
8
|
import { ChannelType } from "discord-api-types/v10";
|
|
17
9
|
import { asDateTimestampMs, isFutureDateTimestampMs, resolveDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
18
|
-
import {
|
|
10
|
+
import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
19
11
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
12
|
+
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
|
20
13
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
21
14
|
import { createPluginStateErrorReporter } from "openclaw/plugin-sdk/plugin-state-runtime";
|
|
22
15
|
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
23
|
-
import "openclaw/plugin-sdk/channel-status";
|
|
24
|
-
import "openclaw/plugin-sdk/channel-config-schema";
|
|
25
|
-
import { readBooleanParam as readBooleanParam$1 } from "openclaw/plugin-sdk/boolean-param";
|
|
26
|
-
import "openclaw/plugin-sdk/channel-plugin-common";
|
|
27
|
-
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
28
16
|
//#region extensions/discord/src/components-registry-state.ts
|
|
29
17
|
const discordComponentRegistryState = resolveGlobalSingleton(Symbol.for("openclaw.discord.componentRegistryState"), () => ({
|
|
30
18
|
componentEntries: /* @__PURE__ */ new Map(),
|
|
@@ -374,7 +362,9 @@ async function buildDiscordComponentPayload(params) {
|
|
|
374
362
|
mediaLocalRoots: params.opts.mediaLocalRoots,
|
|
375
363
|
mediaReadFile: params.opts.mediaReadFile
|
|
376
364
|
});
|
|
377
|
-
|
|
365
|
+
const filenameOverride = params.opts.filename?.trim();
|
|
366
|
+
const explicitAttachmentName = extractComponentAttachmentNames(spec)[0];
|
|
367
|
+
resolvedFileName = filenameOverride || media.fileName || explicitAttachmentName || `upload${extensionForMime(media.contentType) ?? ""}`;
|
|
378
368
|
spec = withImplicitComponentAttachmentBlock(spec, resolvedFileName);
|
|
379
369
|
files = [{
|
|
380
370
|
data: media.buffer,
|
|
@@ -396,7 +386,7 @@ async function buildDiscordComponentPayload(params) {
|
|
|
396
386
|
const flags = buildDiscordComponentMessageFlags(buildResult.components);
|
|
397
387
|
const finalFlags = params.opts.silent ? (flags ?? 0) | SUPPRESS_NOTIFICATIONS_FLAG : flags ?? void 0;
|
|
398
388
|
return {
|
|
399
|
-
body:
|
|
389
|
+
body: {
|
|
400
390
|
...serializePayload({
|
|
401
391
|
components: buildResult.components,
|
|
402
392
|
allowed_mentions: params.opts.allowedMentions,
|
|
@@ -404,7 +394,7 @@ async function buildDiscordComponentPayload(params) {
|
|
|
404
394
|
...files ? { files } : {}
|
|
405
395
|
}),
|
|
406
396
|
...messageReference ? { message_reference: messageReference } : {}
|
|
407
|
-
}
|
|
397
|
+
},
|
|
408
398
|
buildResult
|
|
409
399
|
};
|
|
410
400
|
}
|
|
@@ -533,4 +523,4 @@ async function editDiscordComponentMessage(to, messageId, spec, opts) {
|
|
|
533
523
|
});
|
|
534
524
|
}
|
|
535
525
|
//#endregion
|
|
536
|
-
export {
|
|
526
|
+
export { resolveDiscordComponentEntryWithPersistence as a, send_components_exports as i, registerBuiltDiscordComponentMessage as n, resolveDiscordModalEntryWithPersistence as o, sendDiscordComponentMessage as r, editDiscordComponentMessage as t };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as createDiscordSendReceiptFromResults, r as createDiscordSendResult } from "./send.receipt-
|
|
6
|
-
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
1
|
+
import { o as createReusableDiscordReplyReference, vt as createChannelMessage, yt as createThread } from "./retry-DNsVTeTo.js";
|
|
2
|
+
import { c as resolveDiscordAccount } from "./accounts-DNl-oCEw.js";
|
|
3
|
+
import { i as normalizeDiscordHandleKey, o as resolveDiscordDirectoryUserId } from "./directory-live-Df0NbFJB.js";
|
|
4
|
+
import { A as resolveDiscordMessageFlags, M as resolveDiscordSendEmbeds, N as resolveDiscordSuppressEmbeds, O as buildDiscordMessageRequest, P as createDiscordClient, a as normalizeDiscordPollInput, c as normalizeStickerIds, f as sendDiscordMedia, j as resolveDiscordSendComponents, k as createDiscordMessageNonce, l as resolveChannelId, n as buildDiscordTextChunks, p as sendDiscordText, q as parseAndResolveChannelRecipient, t as buildDiscordSendError, u as resolveDiscordChannel } from "./send.shared-B3fpaLWJ.js";
|
|
5
|
+
import { n as createDiscordSendReceiptFromResults, r as createDiscordSendResult } from "./send.receipt-Cnhoautb.js";
|
|
7
6
|
import { ChannelType } from "discord-api-types/v10";
|
|
8
7
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
9
|
-
import {
|
|
8
|
+
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
9
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
11
10
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
11
|
+
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
12
12
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
13
13
|
import { resolveChunkMode } from "openclaw/plugin-sdk/reply-chunking";
|
|
14
14
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
@@ -706,7 +706,8 @@ async function sendMessageDiscord(to, text, opts) {
|
|
|
706
706
|
});
|
|
707
707
|
}
|
|
708
708
|
async function sendStickerDiscord(to, stickerIds, opts) {
|
|
709
|
-
const
|
|
709
|
+
const context = await resolveDiscordStructuredSendContext(to, opts);
|
|
710
|
+
const { rewrittenContent, suppressEmbeds } = context;
|
|
710
711
|
const stickers = normalizeStickerIds(stickerIds);
|
|
711
712
|
const flags = resolveDiscordMessageFlags({ suppressEmbeds });
|
|
712
713
|
const body = {
|
|
@@ -716,11 +717,11 @@ async function sendStickerDiscord(to, stickerIds, opts) {
|
|
|
716
717
|
enforce_nonce: true,
|
|
717
718
|
...flags ? { flags } : {}
|
|
718
719
|
};
|
|
719
|
-
|
|
720
|
-
return toDiscordSendResult(await request(() => createChannelMessage(rest, channelId, { body }), "sticker", { safety: "nonce-protected-create" }), channelId, { kind: "card" });
|
|
720
|
+
return context.send("sticker", body);
|
|
721
721
|
}
|
|
722
722
|
async function sendPollDiscord(to, poll, opts) {
|
|
723
|
-
const
|
|
723
|
+
const context = await resolveDiscordStructuredSendContext(to, opts);
|
|
724
|
+
const { rewrittenContent, suppressEmbeds } = context;
|
|
724
725
|
if (poll.durationSeconds !== void 0) throw new Error("Discord polls do not support durationSeconds; use durationHours");
|
|
725
726
|
const payload = normalizeDiscordPollInput(poll);
|
|
726
727
|
const flags = resolveDiscordMessageFlags({
|
|
@@ -734,8 +735,7 @@ async function sendPollDiscord(to, poll, opts) {
|
|
|
734
735
|
enforce_nonce: true,
|
|
735
736
|
...flags ? { flags } : {}
|
|
736
737
|
};
|
|
737
|
-
|
|
738
|
-
return toDiscordSendResult(await request(() => createChannelMessage(rest, channelId, { body }), "poll", { safety: "nonce-protected-create" }), channelId, { kind: "card" });
|
|
738
|
+
return context.send("poll", body);
|
|
739
739
|
}
|
|
740
740
|
async function resolveDiscordStructuredSendContext(to, opts) {
|
|
741
741
|
const accountInfo = resolveDiscordAccount({
|
|
@@ -745,9 +745,19 @@ async function resolveDiscordStructuredSendContext(to, opts) {
|
|
|
745
745
|
const { rest, request, channelId } = await resolveDiscordSendTarget(to, opts);
|
|
746
746
|
const content = opts.content?.trim();
|
|
747
747
|
return {
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
748
|
+
send: async (kind, body) => {
|
|
749
|
+
await opts.onPlatformSendDispatch?.();
|
|
750
|
+
const result = await request(() => createChannelMessage(rest, channelId, { body }), kind, { safety: "nonce-protected-create" });
|
|
751
|
+
recordChannelActivity({
|
|
752
|
+
channel: "discord",
|
|
753
|
+
accountId: accountInfo.accountId,
|
|
754
|
+
direction: "outbound"
|
|
755
|
+
});
|
|
756
|
+
return toDiscordSendResult(result, channelId, {
|
|
757
|
+
kind: kind === "poll" ? "poll" : "card",
|
|
758
|
+
threadId: kind === "poll" ? opts.threadId : void 0
|
|
759
|
+
});
|
|
760
|
+
},
|
|
751
761
|
rewrittenContent: content ? rewriteDiscordKnownMentions(content, {
|
|
752
762
|
accountId: accountInfo.accountId,
|
|
753
763
|
mentionAliases: accountInfo.config.mentionAliases
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as createDiscordClient, i as formatReactionEmoji, r as buildReactionIdentifier, s as normalizeReactionEmoji } from "./send.shared-
|
|
1
|
+
import { Tt as getChannelMessage, _t as listMessageReactionUsers, gt as deleteOwnMessageReaction, ht as createOwnMessageReaction } from "./retry-DNsVTeTo.js";
|
|
2
|
+
import { P as createDiscordClient, i as formatReactionEmoji, r as buildReactionIdentifier, s as normalizeReactionEmoji } from "./send.shared-B3fpaLWJ.js";
|
|
3
3
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
4
4
|
//#region extensions/discord/src/send.reactions.ts
|
|
5
5
|
function createDiscordReactionRuntimeClient(opts) {
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
2
2
|
import { attachChannelToResults } from "openclaw/plugin-sdk/channel-send-result";
|
|
3
3
|
//#region extensions/discord/src/send.receipt.ts
|
|
4
|
+
function toDiscordOutboundDeliveryResult(result) {
|
|
5
|
+
const { channelId, ...delivery } = result;
|
|
6
|
+
return {
|
|
7
|
+
...delivery,
|
|
8
|
+
target: {
|
|
9
|
+
kind: "channel",
|
|
10
|
+
id: channelId
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
4
14
|
function createDiscordSendReceiptFromResults(params) {
|
|
5
15
|
const receipt = createMessageReceiptFromOutboundResults({
|
|
6
16
|
results: attachChannelToResults("discord", params.results),
|
|
@@ -63,4 +73,4 @@ function createDiscordSendResult(params) {
|
|
|
63
73
|
};
|
|
64
74
|
}
|
|
65
75
|
//#endregion
|
|
66
|
-
export { createDiscordSendReceiptFromResults as n, createDiscordSendResult as r, createDiscordSendReceipt as t };
|
|
76
|
+
export { toDiscordOutboundDeliveryResult as i, createDiscordSendReceiptFromResults as n, createDiscordSendResult as r, createDiscordSendReceipt as t };
|