@kodelyth/discord 2026.5.39 → 2026.6.1
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-Dqw-enky.js +81 -0
- package/dist/account-inspect-api.js +10 -0
- package/dist/accounts-B7OBFePq.js +224 -0
- package/dist/action-runtime-api.js +2 -0
- package/dist/agent-components.runtime-DVY_1VB4.js +4 -0
- package/dist/allow-list-B0s7evD7.js +354 -0
- package/dist/api-CXAcv9nZ.js +130 -0
- package/dist/api.js +23 -0
- package/dist/approval-handler.runtime-B9xUAF3n.js +426 -0
- package/dist/audit-DoiK49WO.js +24 -0
- package/dist/audit-core-BGrq3G7r.js +105 -0
- package/dist/channel-U_aeoFwW.js +795 -0
- package/dist/channel-actions-BxEBnEuv.js +173 -0
- package/dist/channel-actions.runtime-CPtpH-yl.js +263 -0
- package/dist/channel-api-BfjklLby.js +21 -0
- package/dist/channel-config-api.js +2 -0
- package/dist/channel-plugin-api.js +2 -0
- package/dist/channel.setup-BUSC0apv.js +337 -0
- package/dist/components-luonoe13.js +909 -0
- package/dist/config-api-DSYGqaLQ.js +2 -0
- package/dist/config-schema-DIqJBGwC.js +357 -0
- package/dist/configured-state.js +6 -0
- package/dist/contract-api.js +8 -0
- package/dist/conversation-identity-DXAm0_Mk.js +270 -0
- package/dist/directory-config-CYbuMmPS.js +49 -0
- package/dist/directory-contract-api.js +2 -0
- package/dist/directory-live-DX4dLRpJ.js +159 -0
- package/dist/doctor-bbKSvGVD.js +244 -0
- package/dist/doctor-contract-Btjt6NJD.js +383 -0
- package/dist/doctor-contract-api.js +2 -0
- package/dist/gateway-registry-BKSpa4GB.js +74 -0
- package/dist/handle-action.guild-admin-B5BArS2n.js +286 -0
- package/dist/inbound-context-WAOqhGlT.js +48 -0
- package/dist/inbound-event-delivery-C-1Ji3WP.js +65 -0
- package/dist/index.js +26 -0
- package/dist/manager.runtime-DXHynKE4.js +2356 -0
- package/dist/message-handler-mXzc3tA_.js +381 -0
- package/dist/message-handler.preflight-BPD1a347.js +1113 -0
- package/dist/message-handler.process-GUa3aV8z.js +1438 -0
- package/dist/message-utils-dUbem16p.js +549 -0
- package/dist/outbound-adapter-C18OAc1y.js +536 -0
- package/dist/pluralkit-D1Q2x0w5.js +22 -0
- package/dist/preflight-audio-CZtpWcIm.js +72 -0
- package/dist/preflight-audio.runtime-Brx_0_xW.js +7 -0
- package/dist/preview-streaming-D_slNIiO.js +8 -0
- package/dist/probe-D--Ca4JF.js +139 -0
- package/dist/probe.runtime-DQBchZzv.js +2 -0
- package/dist/provider-B2-31CIT.js +9565 -0
- package/dist/provider-session.runtime-BwzzSsrH.js +6 -0
- package/dist/provider.runtime-CP3oHLls.js +2 -0
- package/dist/resolve-allowlist-common-CqxPLcJO.js +34 -0
- package/dist/resolve-channels-0LX4pUbB.js +265 -0
- package/dist/resolve-users-CztOv0Qs.js +120 -0
- package/dist/runtime-DUaw66V_.js +1073 -0
- package/dist/runtime-api.actions.js +3 -0
- package/dist/runtime-api.js +30 -0
- package/dist/runtime-api.lookup.js +7 -0
- package/dist/runtime-api.monitor-CvVKvEXW.js +5 -0
- package/dist/runtime-api.monitor.js +8 -0
- package/dist/runtime-api.send.js +6 -0
- package/dist/runtime-api.threads.js +6 -0
- package/dist/runtime-fC6f4UF2.js +8 -0
- package/dist/runtime-setter-api.js +2 -0
- package/dist/secret-config-contract-B6WW5V88.js +115 -0
- package/dist/secret-contract-api.js +2 -0
- package/dist/security-audit-CnyIQKz6.js +120 -0
- package/dist/security-audit-contract-api.js +2 -0
- package/dist/security-audit.runtime-CQSkjNLu.js +2 -0
- package/dist/security-contract-DLvYOgLM.js +26 -0
- package/dist/security-contract-api.js +2 -0
- package/dist/security-doctor-DepqtNCI.js +18 -0
- package/dist/send-DCtPCHGk.js +881 -0
- package/dist/send.components-Bcgxvm52.js +474 -0
- package/dist/send.outbound-S9t0UuHc.js +330 -0
- package/dist/send.receipt-CDn3GBWC.js +3119 -0
- package/dist/send.shared-D4iBnAmn.js +669 -0
- package/dist/sender-identity-CxCe3_1a.js +43 -0
- package/dist/session-contract-Dwhw3RTY.js +6 -0
- package/dist/session-key-api.js +2 -0
- package/dist/session-key-normalization-CP8dPUid.js +23 -0
- package/dist/setup-entry.js +11 -0
- package/dist/setup-plugin-api.js +2 -0
- package/dist/shared-AIlvuZXt.js +171 -0
- package/dist/subagent-hooks-8bK-mgiU.js +120 -0
- package/dist/subagent-hooks-api.js +22 -0
- package/dist/system-events-Ba1TklaL.js +34 -0
- package/dist/target-resolver-BrtFQtoK.js +82 -0
- package/dist/targets-DWLLZE2l.js +3 -0
- package/dist/test-api.js +45 -0
- package/dist/thread-binding-api.js +4 -0
- package/dist/thread-bindings-9aKRmZv0.js +255 -0
- package/dist/thread-bindings.discord-api-ssGH5wc2.js +244 -0
- package/dist/thread-bindings.manager-0YBHGemk.js +534 -0
- package/dist/thread-bindings.session-updates-DJZGIwaU.js +54 -0
- package/dist/thread-bindings.state-eTFl-PqJ.js +318 -0
- package/dist/timeouts-CEwuGaWT.js +52 -0
- package/dist/timeouts.js +2 -0
- package/dist/typing-BmJKRpCS.js +14 -0
- package/package.json +19 -7
- package/account-inspect-api.js +0 -7
- package/action-runtime-api.js +0 -7
- package/api.js +0 -7
- package/channel-config-api.js +0 -7
- package/channel-plugin-api.js +0 -7
- package/configured-state.js +0 -7
- package/contract-api.js +0 -7
- package/directory-contract-api.js +0 -7
- package/doctor-contract-api.js +0 -7
- package/index.js +0 -7
- package/runtime-api.actions.js +0 -7
- package/runtime-api.js +0 -7
- package/runtime-api.lookup.js +0 -7
- package/runtime-api.monitor.js +0 -7
- package/runtime-api.send.js +0 -7
- package/runtime-api.threads.js +0 -7
- package/runtime-setter-api.js +0 -7
- package/secret-contract-api.js +0 -7
- package/security-audit-contract-api.js +0 -7
- package/security-contract-api.js +0 -7
- package/session-key-api.js +0 -7
- package/setup-entry.js +0 -7
- package/setup-plugin-api.js +0 -7
- package/subagent-hooks-api.js +0 -7
- package/test-api.js +0 -7
- package/thread-binding-api.js +0 -7
- package/timeouts.js +0 -7
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as readDiscordChannelCreateParams, c as readDiscordParentIdParam, i as requiredGuildPermissionForModerationAction, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-DUaw66V_.js";
|
|
2
|
+
import { t as discordMessageActions } from "./channel-actions-BxEBnEuv.js";
|
|
3
|
+
export { discordMessageActions, handleDiscordAction, isDiscordModerationAction, readDiscordChannelCreateParams, readDiscordChannelEditParams, readDiscordChannelMoveParams, readDiscordModerationCommand, readDiscordParentIdParam, requiredGuildPermissionForModerationAction };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { x as resolveDiscordOutboundSessionRoute } from "./components-luonoe13.js";
|
|
2
|
+
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-Bcgxvm52.js";
|
|
3
|
+
import { a as clearPresences, c as setPresence, i as unregisterGateway, n as getGateway, o as getPresence, r as registerGateway, s as presenceCacheSize, t as clearGateways } from "./gateway-registry-BKSpa4GB.js";
|
|
4
|
+
import { D as fetchMemberGuildPermissionsDiscord, E as fetchChannelPermissionsDiscord, O as hasAllGuildPermissionsDiscord, k as hasAnyGuildPermissionDiscord, w as DiscordSendError } from "./send.shared-D4iBnAmn.js";
|
|
5
|
+
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-DX4dLRpJ.js";
|
|
6
|
+
import { _ as resolveGroupDmAllow, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordGuildEntry, g as resolveDiscordShouldRequireMention, n as isDiscordGroupAllowedByPolicy, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, t as allowListMatches, u as resolveDiscordCommandAuthorized, v as shouldEmitDiscordReactionNotification } from "./allow-list-B0s7evD7.js";
|
|
7
|
+
import { A as removeRoleDiscord, B as removeChannelPermissionDiscord, C as fetchChannelInfoDiscord, D as kickMemberDiscord, E as fetchVoiceStatusDiscord, F as uploadStickerDiscord, I as createChannelDiscord, L as deleteChannelDiscord, M as timeoutMemberDiscord, N as listGuildEmojisDiscord, O as listGuildChannelsDiscord, P as uploadEmojiDiscord, R as editChannelDiscord, S as createScheduledEventDiscord, T as fetchRoleInfoDiscord, V as setChannelPermissionDiscord, _ 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 resolveEventCoverImage, k as listScheduledEventsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchMemberInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as moveChannelDiscord } from "./send-DCtPCHGk.js";
|
|
8
|
+
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-S9t0UuHc.js";
|
|
9
|
+
import { a as readDiscordChannelCreateParams, c as readDiscordParentIdParam, i as requiredGuildPermissionForModerationAction, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-DUaw66V_.js";
|
|
10
|
+
import { r as setDiscordRuntime } from "./runtime-fC6f4UF2.js";
|
|
11
|
+
import { t as discordMessageActions } from "./channel-actions-BxEBnEuv.js";
|
|
12
|
+
import { C as resolveThreadBindingMaxAgeMs, S as resolveThreadBindingMaxAgeExpiresAt, b as resolveThreadBindingIdleTimeoutMs, l as isRecentlyUnboundThreadWebhookMessage, x as resolveThreadBindingInactivityExpiresAt } from "./thread-bindings.state-eTFl-PqJ.js";
|
|
13
|
+
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DJZGIwaU.js";
|
|
14
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-0LX4pUbB.js";
|
|
15
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-CztOv0Qs.js";
|
|
16
|
+
import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-ssGH5wc2.js";
|
|
17
|
+
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-9aKRmZv0.js";
|
|
18
|
+
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-0YBHGemk.js";
|
|
19
|
+
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-D--Ca4JF.js";
|
|
20
|
+
import { a as mergeAbortSignals, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-CEwuGaWT.js";
|
|
21
|
+
import "./runtime-api.actions.js";
|
|
22
|
+
import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-DoiK49WO.js";
|
|
23
|
+
import "./runtime-api.lookup.js";
|
|
24
|
+
import { S as sanitizeDiscordThreadName, _ as registerDiscordListener, b as resolveDiscordReplyTarget, c as resolveDiscordGatewayIntents, d as createDiscordNativeCommand, l as waitForDiscordGatewayPluginRegistration, s as createDiscordGatewayPlugin, t as monitorDiscordProvider } from "./provider-B2-31CIT.js";
|
|
25
|
+
import { i as buildDiscordMediaPayload } from "./message-utils-dUbem16p.js";
|
|
26
|
+
import { t as createDiscordMessageHandler } from "./message-handler-mXzc3tA_.js";
|
|
27
|
+
import "./runtime-api.monitor-CvVKvEXW.js";
|
|
28
|
+
import "./runtime-api.send.js";
|
|
29
|
+
import "./runtime-api.threads.js";
|
|
30
|
+
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, DiscordSendError, testing as __testing, testing, addRoleDiscord, allowListMatches, auditDiscordChannelPermissions, autoBindSpawnedDiscordSubagent, banMemberDiscord, buildDiscordMediaPayload, 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, isDiscordGroupAllowedByPolicy, isDiscordModerationAction, isRecentlyUnboundThreadWebhookMessage, kickMemberDiscord, listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive, listGuildChannelsDiscord, listGuildEmojisDiscord, listPinsDiscord, listScheduledEventsDiscord, listThreadBindingsBySessionKey, listThreadBindingsForAccount, listThreadsDiscord, mergeAbortSignals, monitorDiscordProvider, moveChannelDiscord, normalizeDiscordAllowList, 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, sanitizeDiscordThreadName, searchMessagesDiscord, sendDiscordComponentMessage, sendMessageDiscord, sendPollDiscord, sendStickerDiscord, sendTypingDiscord, sendVoiceMessageDiscord, sendWebhookMessageDiscord, setChannelPermissionDiscord, setDiscordRuntime, setPresence, setThreadBindingIdleTimeoutBySessionKey, setThreadBindingMaxAgeBySessionKey, shouldEmitDiscordReactionNotification, timeoutMemberDiscord, unbindThreadBindingsBySessionKey, unpinMessageDiscord, unregisterGateway, uploadEmojiDiscord, uploadStickerDiscord, waitForDiscordGatewayPluginRegistration };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-DX4dLRpJ.js";
|
|
2
|
+
import { r as setDiscordRuntime } from "./runtime-fC6f4UF2.js";
|
|
3
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-0LX4pUbB.js";
|
|
4
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-CztOv0Qs.js";
|
|
5
|
+
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-D--Ca4JF.js";
|
|
6
|
+
import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-DoiK49WO.js";
|
|
7
|
+
export { auditDiscordChannelPermissions, collectDiscordAuditChannelIds, fetchDiscordApplicationId, fetchDiscordApplicationSummary, listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive, parseApplicationIdFromToken, probeDiscord, resolveDiscordChannelAllowlist, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordUserAllowlist, setDiscordRuntime };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { a as clearPresences, c as setPresence, i as unregisterGateway, n as getGateway, o as getPresence, r as registerGateway, s as presenceCacheSize, t as clearGateways } from "./gateway-registry-BKSpa4GB.js";
|
|
2
|
+
import { _ as resolveGroupDmAllow, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordGuildEntry, g as resolveDiscordShouldRequireMention, n as isDiscordGroupAllowedByPolicy, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, t as allowListMatches, u as resolveDiscordCommandAuthorized, v as shouldEmitDiscordReactionNotification } from "./allow-list-B0s7evD7.js";
|
|
3
|
+
import { a as mergeAbortSignals, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-CEwuGaWT.js";
|
|
4
|
+
import { S as sanitizeDiscordThreadName, _ as registerDiscordListener, b as resolveDiscordReplyTarget, c as resolveDiscordGatewayIntents, d as createDiscordNativeCommand, l as waitForDiscordGatewayPluginRegistration, s as createDiscordGatewayPlugin, t as monitorDiscordProvider } from "./provider-B2-31CIT.js";
|
|
5
|
+
import { i as buildDiscordMediaPayload } from "./message-utils-dUbem16p.js";
|
|
6
|
+
import { t as createDiscordMessageHandler } from "./message-handler-mXzc3tA_.js";
|
|
7
|
+
import "./runtime-api.monitor-CvVKvEXW.js";
|
|
8
|
+
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, allowListMatches, buildDiscordMediaPayload, clearGateways, clearPresences, createDiscordGatewayPlugin, createDiscordMessageHandler, createDiscordNativeCommand, getGateway, getPresence, isDiscordGroupAllowedByPolicy, mergeAbortSignals, monitorDiscordProvider, normalizeDiscordAllowList, normalizeDiscordSlug, presenceCacheSize, registerDiscordListener, registerGateway, resolveDiscordChannelConfig, resolveDiscordChannelConfigWithFallback, resolveDiscordCommandAuthorized, resolveDiscordGatewayIntents, resolveDiscordGuildEntry, resolveDiscordReplyTarget, resolveDiscordShouldRequireMention, resolveGroupDmAllow, sanitizeDiscordThreadName, setPresence, shouldEmitDiscordReactionNotification, unregisterGateway, waitForDiscordGatewayPluginRegistration };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { x as resolveDiscordOutboundSessionRoute } from "./components-luonoe13.js";
|
|
2
|
+
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-Bcgxvm52.js";
|
|
3
|
+
import { D as fetchMemberGuildPermissionsDiscord, E as fetchChannelPermissionsDiscord, O as hasAllGuildPermissionsDiscord, k as hasAnyGuildPermissionDiscord, w as DiscordSendError } from "./send.shared-D4iBnAmn.js";
|
|
4
|
+
import { A as removeRoleDiscord, B as removeChannelPermissionDiscord, C as fetchChannelInfoDiscord, D as kickMemberDiscord, E as fetchVoiceStatusDiscord, F as uploadStickerDiscord, I as createChannelDiscord, L as deleteChannelDiscord, M as timeoutMemberDiscord, N as listGuildEmojisDiscord, O as listGuildChannelsDiscord, P as uploadEmojiDiscord, R as editChannelDiscord, S as createScheduledEventDiscord, T as fetchRoleInfoDiscord, V as setChannelPermissionDiscord, _ 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 resolveEventCoverImage, k as listScheduledEventsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchMemberInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as moveChannelDiscord } from "./send-DCtPCHGk.js";
|
|
5
|
+
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-S9t0UuHc.js";
|
|
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 };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { C as resolveThreadBindingMaxAgeMs, S as resolveThreadBindingMaxAgeExpiresAt, b as resolveThreadBindingIdleTimeoutMs, l as isRecentlyUnboundThreadWebhookMessage, x as resolveThreadBindingInactivityExpiresAt } from "./thread-bindings.state-eTFl-PqJ.js";
|
|
2
|
+
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DJZGIwaU.js";
|
|
3
|
+
import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-ssGH5wc2.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-9aKRmZv0.js";
|
|
5
|
+
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-0YBHGemk.js";
|
|
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 };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createPluginRuntimeStore } from "klaw/plugin-sdk/runtime-store";
|
|
2
|
+
//#region extensions/discord/src/runtime.ts
|
|
3
|
+
const { setRuntime: setDiscordRuntime, tryGetRuntime: getOptionalDiscordRuntime, getRuntime: getDiscordRuntime } = createPluginRuntimeStore({
|
|
4
|
+
pluginId: "discord",
|
|
5
|
+
errorMessage: "Discord runtime not initialized"
|
|
6
|
+
});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { getOptionalDiscordRuntime as n, setDiscordRuntime as r, getDiscordRuntime as t };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { collectNestedChannelFieldAssignments, collectSimpleChannelFieldAssignments, getChannelSurface, isBaseFieldActiveForChannelSurface, isEnabledFlag, isRecord } from "klaw/plugin-sdk/channel-secret-basic-runtime";
|
|
2
|
+
import { collectNestedChannelTtsAssignments } from "klaw/plugin-sdk/channel-secret-tts-runtime";
|
|
3
|
+
//#region extensions/discord/src/secret-config-contract.ts
|
|
4
|
+
const secretTargetRegistryEntries = [
|
|
5
|
+
{
|
|
6
|
+
id: "channels.discord.accounts.*.pluralkit.token",
|
|
7
|
+
targetType: "channels.discord.accounts.*.pluralkit.token",
|
|
8
|
+
configFile: "klaw.json",
|
|
9
|
+
pathPattern: "channels.discord.accounts.*.pluralkit.token",
|
|
10
|
+
secretShape: "secret_input",
|
|
11
|
+
expectedResolvedValue: "string",
|
|
12
|
+
includeInPlan: true,
|
|
13
|
+
includeInConfigure: true,
|
|
14
|
+
includeInAudit: true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: "channels.discord.accounts.*.token",
|
|
18
|
+
targetType: "channels.discord.accounts.*.token",
|
|
19
|
+
configFile: "klaw.json",
|
|
20
|
+
pathPattern: "channels.discord.accounts.*.token",
|
|
21
|
+
secretShape: "secret_input",
|
|
22
|
+
expectedResolvedValue: "string",
|
|
23
|
+
includeInPlan: true,
|
|
24
|
+
includeInConfigure: true,
|
|
25
|
+
includeInAudit: true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "channels.discord.accounts.*.voice.tts.providers.*.apiKey",
|
|
29
|
+
targetType: "channels.discord.accounts.*.voice.tts.providers.*.apiKey",
|
|
30
|
+
configFile: "klaw.json",
|
|
31
|
+
pathPattern: "channels.discord.accounts.*.voice.tts.providers.*.apiKey",
|
|
32
|
+
secretShape: "secret_input",
|
|
33
|
+
expectedResolvedValue: "string",
|
|
34
|
+
includeInPlan: true,
|
|
35
|
+
includeInConfigure: true,
|
|
36
|
+
includeInAudit: true,
|
|
37
|
+
providerIdPathSegmentIndex: 6
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "channels.discord.pluralkit.token",
|
|
41
|
+
targetType: "channels.discord.pluralkit.token",
|
|
42
|
+
configFile: "klaw.json",
|
|
43
|
+
pathPattern: "channels.discord.pluralkit.token",
|
|
44
|
+
secretShape: "secret_input",
|
|
45
|
+
expectedResolvedValue: "string",
|
|
46
|
+
includeInPlan: true,
|
|
47
|
+
includeInConfigure: true,
|
|
48
|
+
includeInAudit: true
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "channels.discord.token",
|
|
52
|
+
targetType: "channels.discord.token",
|
|
53
|
+
configFile: "klaw.json",
|
|
54
|
+
pathPattern: "channels.discord.token",
|
|
55
|
+
secretShape: "secret_input",
|
|
56
|
+
expectedResolvedValue: "string",
|
|
57
|
+
includeInPlan: true,
|
|
58
|
+
includeInConfigure: true,
|
|
59
|
+
includeInAudit: true
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "channels.discord.voice.tts.providers.*.apiKey",
|
|
63
|
+
targetType: "channels.discord.voice.tts.providers.*.apiKey",
|
|
64
|
+
configFile: "klaw.json",
|
|
65
|
+
pathPattern: "channels.discord.voice.tts.providers.*.apiKey",
|
|
66
|
+
secretShape: "secret_input",
|
|
67
|
+
expectedResolvedValue: "string",
|
|
68
|
+
includeInPlan: true,
|
|
69
|
+
includeInConfigure: true,
|
|
70
|
+
includeInAudit: true,
|
|
71
|
+
providerIdPathSegmentIndex: 4
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
function collectRuntimeConfigAssignments(params) {
|
|
75
|
+
const resolved = getChannelSurface(params.config, "discord");
|
|
76
|
+
if (!resolved) return;
|
|
77
|
+
const { channel: discord, surface } = resolved;
|
|
78
|
+
collectSimpleChannelFieldAssignments({
|
|
79
|
+
channelKey: "discord",
|
|
80
|
+
field: "token",
|
|
81
|
+
channel: discord,
|
|
82
|
+
surface,
|
|
83
|
+
defaults: params.defaults,
|
|
84
|
+
context: params.context,
|
|
85
|
+
topInactiveReason: "no enabled account inherits this top-level Discord token.",
|
|
86
|
+
accountInactiveReason: "Discord account is disabled."
|
|
87
|
+
});
|
|
88
|
+
collectNestedChannelFieldAssignments({
|
|
89
|
+
channelKey: "discord",
|
|
90
|
+
nestedKey: "pluralkit",
|
|
91
|
+
field: "token",
|
|
92
|
+
channel: discord,
|
|
93
|
+
surface,
|
|
94
|
+
defaults: params.defaults,
|
|
95
|
+
context: params.context,
|
|
96
|
+
topLevelActive: isBaseFieldActiveForChannelSurface(surface, "pluralkit") && isRecord(discord.pluralkit) && isEnabledFlag(discord.pluralkit),
|
|
97
|
+
topInactiveReason: "no enabled Discord surface inherits this top-level PluralKit config or PluralKit is disabled.",
|
|
98
|
+
accountActive: ({ account, enabled }) => enabled && isRecord(account.pluralkit) && isEnabledFlag(account.pluralkit),
|
|
99
|
+
accountInactiveReason: "Discord account is disabled or PluralKit is disabled for this account."
|
|
100
|
+
});
|
|
101
|
+
collectNestedChannelTtsAssignments({
|
|
102
|
+
channelKey: "discord",
|
|
103
|
+
nestedKey: "voice",
|
|
104
|
+
channel: discord,
|
|
105
|
+
surface,
|
|
106
|
+
defaults: params.defaults,
|
|
107
|
+
context: params.context,
|
|
108
|
+
topLevelActive: isBaseFieldActiveForChannelSurface(surface, "voice") && isRecord(discord.voice) && isEnabledFlag(discord.voice),
|
|
109
|
+
topInactiveReason: "no enabled Discord surface inherits this top-level voice config or voice is disabled.",
|
|
110
|
+
accountActive: ({ account, enabled }) => enabled && isRecord(account.voice) && isEnabledFlag(account.voice),
|
|
111
|
+
accountInactiveReason: "Discord account is disabled or voice is disabled for this account."
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
export { secretTargetRegistryEntries as n, collectRuntimeConfigAssignments as t };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { t as isDiscordMutableAllowEntry } from "./security-doctor-DepqtNCI.js";
|
|
2
|
+
import { coerceNativeSetting, normalizeAllowFromList } from "klaw/plugin-sdk/channel-policy";
|
|
3
|
+
import { readChannelAllowFromStore } from "klaw/plugin-sdk/conversation-runtime";
|
|
4
|
+
import { isDangerousNameMatchingEnabled } from "klaw/plugin-sdk/dangerous-name-runtime";
|
|
5
|
+
import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "klaw/plugin-sdk/native-command-config-runtime";
|
|
6
|
+
//#region extensions/discord/src/security-audit.ts
|
|
7
|
+
function normalizeOptionalString(value) {
|
|
8
|
+
const normalized = value?.trim();
|
|
9
|
+
return normalized ? normalized : void 0;
|
|
10
|
+
}
|
|
11
|
+
function addDiscordNameBasedEntries(params) {
|
|
12
|
+
if (!Array.isArray(params.values)) return;
|
|
13
|
+
for (const value of params.values) {
|
|
14
|
+
if (!isDiscordMutableAllowEntry(String(value))) continue;
|
|
15
|
+
const text = normalizeOptionalString(String(value)) ?? "";
|
|
16
|
+
if (!text) continue;
|
|
17
|
+
params.target.add(`${params.source}:${text}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function collectDiscordSecurityAuditFindings(params) {
|
|
21
|
+
const findings = [];
|
|
22
|
+
const discordCfg = params.account.config ?? {};
|
|
23
|
+
const accountId = normalizeOptionalString(params.accountId) ?? params.account.accountId ?? "default";
|
|
24
|
+
const dangerousNameMatchingEnabled = isDangerousNameMatchingEnabled(discordCfg);
|
|
25
|
+
const storeAllowFrom = await readChannelAllowFromStore("discord", process.env, accountId).catch(() => []);
|
|
26
|
+
const discordNameBasedAllowEntries = /* @__PURE__ */ new Set();
|
|
27
|
+
const discordPathPrefix = params.orderedAccountIds.length > 1 || params.hasExplicitAccountPath ? `channels.discord.accounts.${accountId}` : "channels.discord";
|
|
28
|
+
addDiscordNameBasedEntries({
|
|
29
|
+
target: discordNameBasedAllowEntries,
|
|
30
|
+
values: discordCfg.allowFrom,
|
|
31
|
+
source: `${discordPathPrefix}.allowFrom`
|
|
32
|
+
});
|
|
33
|
+
addDiscordNameBasedEntries({
|
|
34
|
+
target: discordNameBasedAllowEntries,
|
|
35
|
+
values: discordCfg.dm?.allowFrom,
|
|
36
|
+
source: `${discordPathPrefix}.dm.allowFrom`
|
|
37
|
+
});
|
|
38
|
+
addDiscordNameBasedEntries({
|
|
39
|
+
target: discordNameBasedAllowEntries,
|
|
40
|
+
values: storeAllowFrom,
|
|
41
|
+
source: "~/.klaw/credentials/discord-allowFrom.json"
|
|
42
|
+
});
|
|
43
|
+
const guildEntries = discordCfg.guilds ?? {};
|
|
44
|
+
for (const [guildKey, guildValue] of Object.entries(guildEntries)) {
|
|
45
|
+
if (!guildValue || typeof guildValue !== "object") continue;
|
|
46
|
+
const guild = guildValue;
|
|
47
|
+
addDiscordNameBasedEntries({
|
|
48
|
+
target: discordNameBasedAllowEntries,
|
|
49
|
+
values: guild.users,
|
|
50
|
+
source: `${discordPathPrefix}.guilds.${guildKey}.users`
|
|
51
|
+
});
|
|
52
|
+
const channels = guild.channels;
|
|
53
|
+
if (!channels || typeof channels !== "object") continue;
|
|
54
|
+
for (const [channelKey, channelValue] of Object.entries(channels)) {
|
|
55
|
+
if (!channelValue || typeof channelValue !== "object") continue;
|
|
56
|
+
addDiscordNameBasedEntries({
|
|
57
|
+
target: discordNameBasedAllowEntries,
|
|
58
|
+
values: channelValue.users,
|
|
59
|
+
source: `${discordPathPrefix}.guilds.${guildKey}.channels.${channelKey}.users`
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (discordNameBasedAllowEntries.size > 0) {
|
|
64
|
+
const examples = Array.from(discordNameBasedAllowEntries).slice(0, 5);
|
|
65
|
+
const more = discordNameBasedAllowEntries.size > examples.length ? ` (+${discordNameBasedAllowEntries.size - examples.length} more)` : "";
|
|
66
|
+
findings.push({
|
|
67
|
+
checkId: "channels.discord.allowFrom.name_based_entries",
|
|
68
|
+
severity: dangerousNameMatchingEnabled ? "info" : "warn",
|
|
69
|
+
title: dangerousNameMatchingEnabled ? "Discord allowlist uses break-glass name/tag matching" : "Discord allowlist contains name or tag entries",
|
|
70
|
+
detail: dangerousNameMatchingEnabled ? `Discord name/tag allowlist matching is explicitly enabled via dangerouslyAllowNameMatching. This mutable-identity mode is operator-selected break-glass behavior and out-of-scope for vulnerability reports by itself. Found: ${examples.join(", ")}${more}.` : `Discord name/tag allowlist matching uses normalized slugs and can collide across users. Found: ${examples.join(", ")}${more}.`,
|
|
71
|
+
remediation: dangerousNameMatchingEnabled ? "Prefer stable Discord IDs (or <@id>/user:<id>/pk:<id>), then disable dangerouslyAllowNameMatching." : "Prefer stable Discord IDs (or <@id>/user:<id>/pk:<id>) in channels.discord.allowFrom and channels.discord.guilds.*.users, or explicitly opt in with dangerouslyAllowNameMatching=true if you accept the risk."
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const nativeEnabled = resolveNativeCommandsEnabled({
|
|
75
|
+
providerId: "discord",
|
|
76
|
+
providerSetting: coerceNativeSetting(discordCfg.commands?.native),
|
|
77
|
+
globalSetting: params.cfg.commands?.native
|
|
78
|
+
});
|
|
79
|
+
const nativeSkillsEnabled = resolveNativeSkillsEnabled({
|
|
80
|
+
providerId: "discord",
|
|
81
|
+
providerSetting: coerceNativeSetting(discordCfg.commands?.nativeSkills),
|
|
82
|
+
globalSetting: params.cfg.commands?.nativeSkills
|
|
83
|
+
});
|
|
84
|
+
if (!nativeEnabled && !nativeSkillsEnabled) return findings;
|
|
85
|
+
const defaultGroupPolicy = params.cfg.channels?.defaults?.groupPolicy;
|
|
86
|
+
const groupPolicy = discordCfg.groupPolicy ?? defaultGroupPolicy ?? "allowlist";
|
|
87
|
+
const guildsConfigured = Object.keys(guildEntries).length > 0;
|
|
88
|
+
const hasAnyUserAllowlist = Object.values(guildEntries).some((guild) => {
|
|
89
|
+
if (!guild || typeof guild !== "object") return false;
|
|
90
|
+
const record = guild;
|
|
91
|
+
if (Array.isArray(record.users) && record.users.length > 0) return true;
|
|
92
|
+
const channels = record.channels;
|
|
93
|
+
if (!channels || typeof channels !== "object") return false;
|
|
94
|
+
return Object.values(channels).some((channel) => {
|
|
95
|
+
if (!channel || typeof channel !== "object") return false;
|
|
96
|
+
const channelRecord = channel;
|
|
97
|
+
return Array.isArray(channelRecord.users) && channelRecord.users.length > 0;
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
const dmAllowFromRaw = discordCfg.dm?.allowFrom;
|
|
101
|
+
const ownerAllowFromConfigured = normalizeAllowFromList([...Array.isArray(dmAllowFromRaw) ? dmAllowFromRaw : [], ...storeAllowFrom]).length > 0;
|
|
102
|
+
const useAccessGroups = params.cfg.commands?.useAccessGroups !== false;
|
|
103
|
+
if (!useAccessGroups && groupPolicy !== "disabled" && guildsConfigured && !hasAnyUserAllowlist) findings.push({
|
|
104
|
+
checkId: "channels.discord.commands.native.unrestricted",
|
|
105
|
+
severity: "critical",
|
|
106
|
+
title: "Discord slash commands are unrestricted",
|
|
107
|
+
detail: "commands.useAccessGroups=false disables sender allowlists for Discord slash commands unless a per-guild/channel users allowlist is configured; with no users allowlist, any user in allowed guild channels can invoke /… commands.",
|
|
108
|
+
remediation: "Set commands.useAccessGroups=true (recommended), or configure channels.discord.guilds.<id>.users (or channels.discord.guilds.<id>.channels.<channel>.users)."
|
|
109
|
+
});
|
|
110
|
+
else if (useAccessGroups && groupPolicy !== "disabled" && guildsConfigured && !ownerAllowFromConfigured && !hasAnyUserAllowlist) findings.push({
|
|
111
|
+
checkId: "channels.discord.commands.native.no_allowlists",
|
|
112
|
+
severity: "warn",
|
|
113
|
+
title: "Discord slash commands have no allowlists",
|
|
114
|
+
detail: "Discord slash commands are enabled, but neither an owner allowFrom list nor any per-guild/channel users allowlist is configured; /… commands will be rejected for everyone.",
|
|
115
|
+
remediation: "Add your user id to channels.discord.allowFrom (or approve yourself via pairing), or configure channels.discord.guilds.<id>.users."
|
|
116
|
+
});
|
|
117
|
+
return findings;
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
export { collectDiscordSecurityAuditFindings as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { isRecord } from "klaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
+
//#region extensions/discord/src/security-contract.ts
|
|
3
|
+
const unsupportedSecretRefSurfacePatterns = ["channels.discord.threadBindings.webhookToken", "channels.discord.accounts.*.threadBindings.webhookToken"];
|
|
4
|
+
function collectUnsupportedSecretRefConfigCandidates(raw) {
|
|
5
|
+
if (!isRecord(raw)) return [];
|
|
6
|
+
if (!isRecord(raw.channels) || !isRecord(raw.channels.discord)) return [];
|
|
7
|
+
const candidates = [];
|
|
8
|
+
const discord = raw.channels.discord;
|
|
9
|
+
const threadBindings = isRecord(discord.threadBindings) ? discord.threadBindings : null;
|
|
10
|
+
if (threadBindings) candidates.push({
|
|
11
|
+
path: "channels.discord.threadBindings.webhookToken",
|
|
12
|
+
value: threadBindings.webhookToken
|
|
13
|
+
});
|
|
14
|
+
const accounts = isRecord(discord.accounts) ? discord.accounts : null;
|
|
15
|
+
if (!accounts) return candidates;
|
|
16
|
+
for (const [accountId, account] of Object.entries(accounts)) {
|
|
17
|
+
if (!isRecord(account) || !isRecord(account.threadBindings)) continue;
|
|
18
|
+
candidates.push({
|
|
19
|
+
path: `channels.discord.accounts.${accountId}.threadBindings.webhookToken`,
|
|
20
|
+
value: account.threadBindings.webhookToken
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return candidates;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { unsupportedSecretRefSurfacePatterns as n, collectUnsupportedSecretRefConfigCandidates as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region extensions/discord/src/security-doctor.ts
|
|
2
|
+
function isDiscordMutableAllowEntry(raw) {
|
|
3
|
+
const text = raw.trim();
|
|
4
|
+
if (!text || text === "*") return false;
|
|
5
|
+
const maybeMentionId = text.replace(/^<@!?/, "").replace(/>$/, "");
|
|
6
|
+
if (/^\d+$/.test(maybeMentionId)) return false;
|
|
7
|
+
for (const prefix of [
|
|
8
|
+
"discord:",
|
|
9
|
+
"user:",
|
|
10
|
+
"pk:"
|
|
11
|
+
]) {
|
|
12
|
+
if (!text.startsWith(prefix)) continue;
|
|
13
|
+
return text.slice(prefix.length).trim().length === 0;
|
|
14
|
+
}
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { isDiscordMutableAllowEntry as t };
|