@openclaw/discord 2026.10.10 → 2026.11.5-beta.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/.setup/{account-inspect-X_Xlr42B.mjs → account-inspect-CSz5Qodj.mjs} +1 -1
- package/dist/.setup/{accounts-C18HNgge.mjs → accounts-DtjvhJUj.mjs} +9 -6
- package/dist/.setup/{active-turn-thread-route-BAc_Xik-.mjs → active-turn-thread-route-DkPnk2x8.mjs} +1 -2
- package/dist/.setup/{allow-list-D1ZGfhXh.mjs → allow-list-DahA0Jxh.mjs} +3 -150
- package/dist/.setup/{api-Bth1wKF9.mjs → api-Bp0HI4q3.mjs} +10 -20
- package/dist/.setup/{approval-handler.runtime-BAoEELJJ.mjs → approval-handler.runtime-Cy53ugTf.mjs} +80 -61
- package/dist/.setup/{approval-message-updates-Cks-MSCJ.mjs → approval-message-updates-DqOXxPss.mjs} +2 -2
- package/dist/.setup/{audit-Dw_rAZIz.mjs → audit-DoPKOfQE.mjs} +4 -4
- package/dist/.setup/{channel-BMpMAeQL.mjs → channel-Ds6iuNdy.mjs} +134 -201
- package/dist/.setup/channel-access-DhJhVrdZ.mjs +23 -0
- package/dist/.setup/channel.setup-BLt9dkIG.mjs +235 -0
- package/dist/.setup/{components-BvOWSPxr.mjs → components-WTfUxead.mjs} +208 -426
- package/dist/.setup/components.base-C5sAPHe4.mjs +31 -0
- package/dist/.setup/{config-schema-Coyq5wOr.mjs → config-schema-GX2yDgIH.mjs} +6 -7
- package/dist/.setup/{conversation-binding-route-DOPUZNYo.mjs → conversation-binding-route-CZdm-X5A.mjs} +2 -2
- package/dist/.setup/{directory-config-CIqVnQtn.mjs → directory-config-BXJuh9-J.mjs} +1 -1
- package/dist/.setup/{directory-live-DUuPEWub.mjs → directory-live-CEopeb8Q.mjs} +55 -62
- package/dist/.setup/{discord-eFlHX1Gn.mjs → discord-r79VFjJp.mjs} +1087 -1664
- package/dist/.setup/{doctor-Dty_Ossy.mjs → doctor-UfLW8nye.mjs} +3 -5
- package/dist/.setup/endpoint-runtime-BM3x-m6O.mjs +138 -0
- package/dist/.setup/guilds-DQucP5Tn.mjs +21 -0
- package/dist/.setup/{handle-action-DXY91jF-.mjs → handle-action-BarHOi-v.mjs} +15 -15
- package/dist/.setup/{handle-action.guild-admin-BvBCfhXF.mjs → handle-action.guild-admin-oRUb8p_O.mjs} +5 -5
- package/dist/.setup/listeners-CHgTENFu.mjs +46 -0
- package/dist/.setup/{live-policy-config-DO1Fk2hp.mjs → live-policy-config-EKp4O6zx.mjs} +2 -3
- package/dist/.setup/{message-handler-fL1j1NiR.mjs → message-handler-DUeT8Asf.mjs} +154 -113
- package/dist/.setup/{message-handler.preflight-DkjwNZAd.mjs → message-handler.preflight-C6TNtKW0.mjs} +30 -104
- package/dist/.setup/{message-handler.preflight-pluralkit-DR4BnvMU.mjs → message-handler.preflight-pluralkit-6E9TFmmN.mjs} +9 -22
- package/dist/.setup/{message-handler.process-ClOwIPDK.mjs → message-handler.process-D8_oQ5Cp.mjs} +256 -367
- package/dist/.setup/outbound-payload-DUsrFICb.mjs +445 -0
- package/dist/.setup/{outbound-session-route-TFBPPkoz.mjs → outbound-session-route-Cb8cv4Oi.mjs} +138 -86
- package/dist/.setup/{preflight-audio-CwtPIsvk.mjs → preflight-audio-r4BbaJxh.mjs} +1 -5
- package/dist/.setup/{presence-cache-CgutE4NN.mjs → presence-cache-B3xj3b0l.mjs} +1 -6
- package/dist/.setup/{probe-DNge7OEP.mjs → probe-BUmJyH35.mjs} +5 -9
- package/dist/.setup/{provider-BBDuE14w.mjs → provider-Dm2ERSxe.mjs} +3600 -4454
- package/dist/.setup/{provider-session.runtime-D8hMXXqJ.mjs → provider-session.runtime-DCIqDsIg.mjs} +3 -3
- package/dist/.setup/provider.runtime-DmxPGoUg.mjs +1 -0
- package/dist/.setup/proxy-fetch-B8cK6FLQ.mjs +29 -0
- package/dist/.setup/{realtime-session.runtime-cetognkp.mjs → realtime-session.runtime-WJL6NdwK.mjs} +43 -81
- package/dist/.setup/{receive-recovery-C77CVdGM.mjs → receive-recovery-DV_v5ROf.mjs} +13 -27
- package/dist/.setup/{resolve-allowlist-common-CI77288n.mjs → resolve-allowlist-common-C37fgnYG.mjs} +3 -12
- package/dist/.setup/{resolve-channels-DYc6-xgV.mjs → resolve-channels-CwpnQ7C2.mjs} +5 -4
- package/dist/.setup/{resolve-users-BQT7XWF2.mjs → resolve-users-D6jSwe8R.mjs} +4 -7
- package/dist/.setup/{runtime-CcijhTJT.mjs → runtime-B-PgPsGR.mjs} +6 -6
- package/dist/.setup/{runtime-CI0UJqeS.mjs → runtime-DhOMlnYS.mjs} +196 -235
- package/dist/.setup/{secret-config-contract-BdbCvqnM.mjs → secret-config-contract-CP6teHec.mjs} +4 -9
- package/dist/.setup/{send-Cbq-IVsS.mjs → send-DnLL6XoO.mjs} +149 -174
- package/dist/.setup/{send.components-BV6ucNpJ.mjs → send.components-xB43CksK.mjs} +61 -71
- package/dist/.setup/{send.outbound-CGhBhzjQ.mjs → send.outbound-B11X6TOE.mjs} +75 -129
- package/dist/.setup/{send.receipt-Dw-_r5Bx.mjs → send.receipt-CMteCIZS.mjs} +29 -31
- package/dist/.setup/{send.shared-D4MioxW_.mjs → send.shared-BcLLZBul.mjs} +38 -112
- package/dist/.setup/{sender-identity-DrN5c4ec.mjs → sender-identity-CGNpdJmb.mjs} +3 -9
- package/dist/.setup/setup-plugin-api-C6AMx3hu.mjs +2 -0
- package/dist/.setup/{shared-Bp0sxD5R.mjs → shared-BEYw16he.mjs} +8 -10
- package/dist/.setup/shared-interactive-DKBw4SNV.mjs +311 -0
- package/dist/.setup/{subagent-hooks-mQbDkvuD.mjs → subagent-hooks-DlYElpXa.mjs} +1 -1
- package/dist/.setup/{system-events-2zc2eGfF.mjs → system-events--Pk6y9aP.mjs} +2 -2
- package/dist/.setup/{target-resolver-CAHeVfmZ.mjs → target-resolver-Bo9EpGp_.mjs} +3 -3
- package/dist/.setup/{thread-bindings-Dg7X_ZXP.mjs → thread-bindings-BF-hr-bg.mjs} +12 -20
- package/dist/.setup/{thread-bindings.manager-DCDYksah.mjs → thread-bindings.manager-CQCkha5r.mjs} +22 -42
- package/dist/.setup/{thread-bindings.session-updates-C76plLS3.mjs → thread-bindings.session-updates-C2gJAj_I.mjs} +11 -18
- package/dist/.setup/{threading-l0UfrE6x.mjs → threading-HA9C2wYR.mjs} +68 -104
- package/dist/.setup/{timeouts-DTrUsJ_W.mjs → timeouts-CT9hnmo4.mjs} +1 -1
- package/dist/.setup/{transcripts-source-CGgOaWcu.mjs → transcripts-source-DzpzETZR.mjs} +102 -172
- package/dist/.setup/{voice-runtime-DY1EwDfi.mjs → voice-runtime-Bo_nsVvX.mjs} +231 -448
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +285 -337
- package/dist/api.js +16 -16
- package/dist/assets/embedded-app-sdk.mjs +1 -1
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/runtime-api.js +22 -22
- package/dist/secret-contract-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +56 -68
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.cjs +2 -3
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.mjs +2 -3
- package/node_modules/@napi-rs/wasm-runtime/dist/fs.js +3339 -4021
- package/node_modules/@napi-rs/wasm-runtime/package.json +1 -1
- package/node_modules/@types/lodash/README.md +1 -1
- package/node_modules/@types/lodash/common/function.d.ts +2 -2
- package/node_modules/@types/lodash/package.json +2 -2
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/discord-api-types/package.json +4 -4
- package/node_modules/discord-api-types/rest/v10/index.d.ts +8 -0
- package/node_modules/discord-api-types/rest/v10/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/index.js +8 -0
- package/node_modules/discord-api-types/rest/v10/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v10/oauth2.d.ts +26 -2
- package/node_modules/discord-api-types/rest/v10/oauth2.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/index.d.ts +8 -0
- package/node_modules/discord-api-types/rest/v9/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/index.js +8 -0
- package/node_modules/discord-api-types/rest/v9/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v9/oauth2.d.ts +26 -2
- package/node_modules/discord-api-types/rest/v9/oauth2.d.ts.map +1 -1
- package/node_modules/typebox/build/format/duration.d.mts +2 -2
- package/node_modules/typebox/build/format/duration.mjs +2 -2
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_email.mjs +1 -0
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
- package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
- package/node_modules/typebox/build/format/ipv4.mjs +2 -2
- package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
- package/node_modules/typebox/build/format/ipv6.mjs +1 -1
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/schema/build.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
- package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
- package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
- package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
- package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
- package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
- package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
- package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
- package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
- package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
- package/node_modules/typebox/build/system/memory/create.mjs +18 -13
- package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
- package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
- package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
- package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
- package/node_modules/typebox/build/system/memory/update.mjs +43 -16
- package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
- package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
- package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
- package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
- package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +1 -1
- package/node_modules/undici/docs/docs/api/Interceptors.md +15 -2
- package/node_modules/undici/lib/dispatcher/client-h2.js +78 -3
- package/node_modules/undici/lib/dispatcher/pool-base.js +20 -3
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/api.d.ts +1 -1
- package/node_modules/undici/types/utility.d.ts +4 -4
- package/node_modules/uuid/package.json +17 -17
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
- package/node_modules/zod/src/v4/core/compile.ts +9 -0
- package/node_modules/zod/src/v4/core/schemas.ts +35 -1
- package/node_modules/zod/src/v4/core/util.ts +13 -0
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/v4/core/compile.cjs +8 -0
- package/node_modules/zod/v4/core/compile.js +8 -0
- package/node_modules/zod/v4/core/schemas.cjs +30 -0
- package/node_modules/zod/v4/core/schemas.d.cts +3 -1
- package/node_modules/zod/v4/core/schemas.d.ts +3 -1
- package/node_modules/zod/v4/core/schemas.js +30 -0
- package/node_modules/zod/v4/core/util.cjs +15 -0
- package/node_modules/zod/v4/core/util.d.cts +2 -0
- package/node_modules/zod/v4/core/util.d.ts +2 -0
- package/node_modules/zod/v4/core/util.js +14 -0
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/openclaw.plugin.json +1 -31
- package/package.json +8 -8
- package/dist/.setup/channel-access-BPrWoEXM.mjs +0 -47
- package/dist/.setup/channel.setup-DVe7Y3Jf.mjs +0 -245
- package/dist/.setup/outbound-adapter-DWyAWBFh.mjs +0 -537
- package/dist/.setup/provider.runtime-BQ1z4Aq1.mjs +0 -1
- package/dist/.setup/setup-plugin-api-B4J6wmL1.mjs +0 -2
- package/dist/.setup/targets-BaklhOqq.mjs +0 -3
- package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
- package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { c as resolveDefaultDiscordAccountId } from "./accounts-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-
|
|
5
|
-
import {
|
|
6
|
-
import { n as resolveDiscordConversationBindingRouteAsync } from "./conversation-binding-route-
|
|
7
|
-
import { n as
|
|
8
|
-
import { A as
|
|
9
|
-
import { A as resolveDiscordChannelInfo, C as resolveMediaList, D as resolveDiscordMessageStickers, O as resolveDiscordReferencedReplyMessage, S as resolveForwardedMediaList, _ as resolveDiscordMessageBatch, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, v as resolveDiscordMessageHistoryText, y as resolveDiscordMessageMentionDocuments } from "./transcripts-source-
|
|
10
|
-
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-
|
|
11
|
-
import { a as createDiscordHistorySenderProvenance, c as hasRawDiscordUserMention, d as matchesActiveDiscordMentionPatterns, f as resolveDiscordMentionState, i as loadSystemEventsRuntime, l as isBoundThreadBotSystemMessage,
|
|
1
|
+
import { c as resolveDefaultDiscordAccountId } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { h as Message, k as getChannelMessage, t as discord_exports } from "./discord-r79VFjJp.mjs";
|
|
3
|
+
import { S as formatDiscordUserTag, a as normalizeDiscordDisplaySlug, f as resolveDiscordGuildEntry, h as resolveDiscordMentionPolicy, l as resolveDiscordChannelConfigWithFallback, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState } from "./allow-list-DahA0Jxh.mjs";
|
|
4
|
+
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-CT9hnmo4.mjs";
|
|
5
|
+
import { _ as resolveDiscordConversationIdentity, h as resolveDiscordEffectiveRoute, m as resolveDiscordConversationRoute, p as buildDiscordRoutePeer, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-Cb8cv4Oi.mjs";
|
|
6
|
+
import { n as resolveDiscordConversationBindingRouteAsync } from "./conversation-binding-route-CZdm-X5A.mjs";
|
|
7
|
+
import { n as resolveDiscordChannelNameSafe } from "./channel-access-DhJhVrdZ.mjs";
|
|
8
|
+
import { A as resolveDiscordTextCommandAccess, T as handleDiscordDmCommandDecision, k as resolveDiscordDmCommandAccess, n as resolveDiscordPreflightChannelAccess } from "./provider-Dm2ERSxe.mjs";
|
|
9
|
+
import { A as resolveDiscordChannelInfo, C as resolveMediaList, D as resolveDiscordMessageStickers, O as resolveDiscordReferencedReplyMessage, S as resolveForwardedMediaList, _ as resolveDiscordMessageBatch, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, v as resolveDiscordMessageHistoryText, y as resolveDiscordMessageMentionDocuments } from "./transcripts-source-DzpzETZR.mjs";
|
|
10
|
+
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-CGNpdJmb.mjs";
|
|
11
|
+
import { a as createDiscordHistorySenderProvenance, c as hasRawDiscordUserMention, d as matchesActiveDiscordMentionPatterns, f as resolveDiscordMentionState, i as loadSystemEventsRuntime, l as isBoundThreadBotSystemMessage, n as loadDiscordThreadingRuntime, p as shouldIgnoreBoundThreadWebhookMessage, r as loadPreflightAudioRuntime, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo, u as isDiscordThreadChannelMessage } from "./message-handler.preflight-pluralkit-6E9TFmmN.mjs";
|
|
12
12
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
13
|
-
import { getChildLogger, logVerbose
|
|
13
|
+
import { getChildLogger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
14
14
|
import { MessageReferenceType, MessageType } from "discord-api-types/v10";
|
|
15
|
-
import {
|
|
15
|
+
import { parseDateStringTimestampMs } from "openclaw/plugin-sdk/number-runtime";
|
|
16
16
|
import { formatAllowlistMatchMeta } from "openclaw/plugin-sdk/allow-from";
|
|
17
17
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
18
18
|
import { isRecentOutboundMessageIdentity } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -26,7 +26,7 @@ import { shouldHandleTextCommands } from "openclaw/plugin-sdk/command-surface";
|
|
|
26
26
|
import { createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
27
27
|
// extensions/discord/src/monitor/message-handler.dm-preflight.ts
|
|
28
28
|
const loadConversationRuntime$1 = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/conversation-binding-runtime"));
|
|
29
|
-
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
29
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-DnLL6XoO.mjs").then((n) => n.t));
|
|
30
30
|
async function resolveDiscordDmPreflightAccess(params) {
|
|
31
31
|
if (params.dmPolicy === "disabled") {
|
|
32
32
|
logVerbose("discord: drop dm (dmPolicy: disabled)");
|
|
@@ -159,7 +159,6 @@ async function hydrateDiscordMessageIfNeeded(params) {
|
|
|
159
159
|
let hydrated = params.message;
|
|
160
160
|
if (shouldHydrateDiscordMessagePayload(params.message)) try {
|
|
161
161
|
const fetched = await getChannelMessage(params.client.rest, params.messageChannelId, params.message.id);
|
|
162
|
-
logVerbose(`discord: hydrated inbound payload via REST for ${params.message.id}`);
|
|
163
162
|
hydrated = new Message(params.client, {
|
|
164
163
|
...params.message.partial ? {} : params.message.rawData,
|
|
165
164
|
...fetched
|
|
@@ -209,22 +208,12 @@ function buildDiscordPreflightHistoryEntry(params) {
|
|
|
209
208
|
return params.isGuildMessage && params.historyLimit > 0 && textForHistory ? {
|
|
210
209
|
sender: params.senderLabel,
|
|
211
210
|
body: textForHistory,
|
|
212
|
-
timestamp:
|
|
211
|
+
timestamp: parseDateStringTimestampMs(params.message.timestamp),
|
|
213
212
|
messageId: params.message.id,
|
|
214
213
|
mediaIds: resolveDiscordHistoryMediaIds(params.message),
|
|
215
214
|
senderProvenance: createDiscordHistorySenderProvenance(params)
|
|
216
215
|
} : void 0;
|
|
217
216
|
}
|
|
218
|
-
// extensions/discord/src/monitor/message-handler.preflight-logging.ts
|
|
219
|
-
function logDiscordPreflightChannelConfig(params) {
|
|
220
|
-
if (!shouldLogVerbose()) return;
|
|
221
|
-
const channelConfigSummary = params.channelConfig ? `allowed=${params.channelConfig.allowed} enabled=${params.channelConfig.enabled ?? "unset"} requireMention=${params.channelConfig.requireMention ?? "unset"} ignoreOtherMentions=${params.channelConfig.ignoreOtherMentions ?? "unset"} matchKey=${params.channelConfig.matchKey ?? "none"} matchSource=${params.channelConfig.matchSource ?? "none"} users=${params.channelConfig.users?.length ?? 0} roles=${params.channelConfig.roles?.length ?? 0} skills=${params.channelConfig.skills?.length ?? 0}` : "none";
|
|
222
|
-
logDebug(`[discord-preflight] channelConfig=${channelConfigSummary} channelMatchMeta=${params.channelMatchMeta} channelId=${params.channelId}`);
|
|
223
|
-
}
|
|
224
|
-
function logDiscordPreflightInboundSummary(params) {
|
|
225
|
-
if (!shouldLogVerbose()) return;
|
|
226
|
-
logVerbose(`discord: inbound id=${params.messageId} guild=${params.guildId ?? "dm"} channel=${params.channelId} mention=${params.wasMentioned ? "yes" : "no"} type=${params.isDirectMessage ? "dm" : params.isGroupDm ? "group-dm" : "guild"} content=${params.hasContent ? "yes" : "no"}`);
|
|
227
|
-
}
|
|
228
217
|
// extensions/discord/src/monitor/message-handler.preflight-thread.ts
|
|
229
218
|
async function resolveDiscordPreflightThreadContext(params) {
|
|
230
219
|
const { resolveDiscordThreadChannel, resolveDiscordThreadParentInfo } = await loadDiscordThreadingRuntime();
|
|
@@ -273,8 +262,7 @@ async function resolveDiscordPreflightRoute(params) {
|
|
|
273
262
|
accountId: params.preflight.accountId,
|
|
274
263
|
runtimeConversationId: bindingConversationId,
|
|
275
264
|
configuredConversationId: params.messageChannelId,
|
|
276
|
-
parentConversationId: params.earlyThreadParentId
|
|
277
|
-
touchBinding: false
|
|
265
|
+
parentConversationId: params.earlyThreadParentId
|
|
278
266
|
});
|
|
279
267
|
const configuredBinding = configuredRoute?.bindingResolution ?? null;
|
|
280
268
|
const threadBinding = runtimeRoute.bindingRecord ?? configuredBinding?.record;
|
|
@@ -291,7 +279,6 @@ async function resolveDiscordPreflightRoute(params) {
|
|
|
291
279
|
configuredBinding,
|
|
292
280
|
boundSessionKey,
|
|
293
281
|
effectiveRoute,
|
|
294
|
-
boundAgentId: boundSessionKey ? effectiveRoute.agentId : void 0,
|
|
295
282
|
baseSessionKey: effectiveRoute.sessionKey
|
|
296
283
|
};
|
|
297
284
|
}
|
|
@@ -308,43 +295,17 @@ async function resolveDiscordHistoryMediaForPendingRecord(params) {
|
|
|
308
295
|
const imageAttachments = (params.message.attachments ?? []).filter(isDiscordImageAttachmentCandidate).slice(0, DISCORD_HISTORY_MEDIA_MAX_ATTACHMENTS);
|
|
309
296
|
const stickers = resolveDiscordMessageStickers(params.message).slice(0, Math.max(0, DISCORD_HISTORY_MEDIA_MAX_ATTACHMENTS - imageAttachments.length));
|
|
310
297
|
if (imageAttachments.length === 0 && stickers.length === 0) return [];
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
return {};
|
|
316
|
-
}
|
|
317
|
-
})();
|
|
318
|
-
const mediaMessage = Object.assign(Object.create(Object.getPrototypeOf(params.message)), params.message);
|
|
319
|
-
Object.defineProperties(mediaMessage, {
|
|
320
|
-
attachments: { value: imageAttachments },
|
|
321
|
-
rawData: { value: {
|
|
322
|
-
...rawData,
|
|
323
|
-
attachments: imageAttachments,
|
|
324
|
-
sticker_items: stickers,
|
|
325
|
-
stickers
|
|
326
|
-
} },
|
|
327
|
-
stickers: { value: stickers }
|
|
328
|
-
});
|
|
329
|
-
const mediaList = await resolveMediaList(mediaMessage, Math.min(params.preflight.mediaMaxBytes, DISCORD_HISTORY_MEDIA_MAX_BYTES), {
|
|
298
|
+
const mediaList = await resolveMediaList({
|
|
299
|
+
attachments: imageAttachments,
|
|
300
|
+
stickers
|
|
301
|
+
}, Math.min(params.preflight.mediaMaxBytes, DISCORD_HISTORY_MEDIA_MAX_BYTES), {
|
|
330
302
|
fetchImpl: params.preflight.discordRestFetch,
|
|
331
303
|
ssrfPolicy: params.preflight.cfg.browser?.ssrfPolicy,
|
|
332
304
|
readIdleTimeoutMs: DISCORD_HISTORY_MEDIA_IDLE_TIMEOUT_MS,
|
|
333
305
|
totalTimeoutMs: DISCORD_HISTORY_MEDIA_TOTAL_TIMEOUT_MS,
|
|
334
306
|
abortSignal: params.preflight.abortSignal
|
|
335
307
|
});
|
|
336
|
-
|
|
337
|
-
return (await toInboundMediaFactsWithMetadata(mediaList, { messageId: params.message.id })).map((media, index) => ({
|
|
338
|
-
path: media.path,
|
|
339
|
-
url: media.url,
|
|
340
|
-
contentType: media.contentType,
|
|
341
|
-
kind: index >= stickerStartIndex ? "sticker" : media.kind ?? "image",
|
|
342
|
-
durationMs: media.durationMs,
|
|
343
|
-
width: media.width,
|
|
344
|
-
height: media.height,
|
|
345
|
-
transcribed: media.transcribed,
|
|
346
|
-
messageId: media.messageId
|
|
347
|
-
}));
|
|
308
|
+
return (await toInboundMediaFactsWithMetadata(mediaList, { messageId: params.message.id })).map((media) => Object.assign({}, media, { kind: media.kind ?? "image" }));
|
|
348
309
|
}
|
|
349
310
|
async function preflightDiscordMessage(params) {
|
|
350
311
|
if (params.abortSignal?.aborted || params.isPolicyCurrent?.() === false) return null;
|
|
@@ -391,10 +352,7 @@ async function preflightDiscordMessage(params) {
|
|
|
391
352
|
const isGroupDm = channelInfo?.type === discord_exports.ChannelType.GroupDM;
|
|
392
353
|
const isDirectMessage = channelInfo?.type === discord_exports.ChannelType.DM || !isGuildMessage && !isGroupDm && channelInfo?.type == null;
|
|
393
354
|
const messageText = resolveDiscordMessageText(message, { includeForwarded: true });
|
|
394
|
-
const injectedBoundThreadBinding = !isDirectMessage && !isGroupDm && (webhookId || author.bot) ?
|
|
395
|
-
threadBindings: params.threadBindings,
|
|
396
|
-
threadId: messageChannelId
|
|
397
|
-
}) : void 0;
|
|
355
|
+
const injectedBoundThreadBinding = !isDirectMessage && !isGroupDm && (webhookId || author.bot) ? params.threadBindings.getByThreadId?.(messageChannelId) : void 0;
|
|
398
356
|
const ignoreBoundThreadMessage = (threadBinding, isBoundThreadSession) => {
|
|
399
357
|
let reason;
|
|
400
358
|
if (shouldIgnoreBoundThreadWebhookMessage({
|
|
@@ -413,7 +371,6 @@ async function preflightDiscordMessage(params) {
|
|
|
413
371
|
};
|
|
414
372
|
if (ignoreBoundThreadMessage(injectedBoundThreadBinding, () => Boolean(injectedBoundThreadBinding) && isDiscordThreadChannelMessage({
|
|
415
373
|
isGuildMessage,
|
|
416
|
-
message,
|
|
417
374
|
channelInfo
|
|
418
375
|
}))) return null;
|
|
419
376
|
const pluralkitInfo = await resolveDiscordPreflightPluralKitInfo({
|
|
@@ -436,7 +393,6 @@ async function preflightDiscordMessage(params) {
|
|
|
436
393
|
...params.data,
|
|
437
394
|
message
|
|
438
395
|
};
|
|
439
|
-
logDebug(`[discord-preflight] channelId=${messageChannelId} guild_id=${params.data.guild_id} channelType=${channelInfo?.type} isGuild=${isGuildMessage} isDM=${isDirectMessage} isGroupDm=${isGroupDm}`);
|
|
440
396
|
if (isGroupDm && !params.groupDmEnabled) {
|
|
441
397
|
logVerbose("discord: drop group dm (group dms disabled)");
|
|
442
398
|
return null;
|
|
@@ -494,7 +450,7 @@ async function preflightDiscordMessage(params) {
|
|
|
494
450
|
earlyThreadParentId: threadParentId
|
|
495
451
|
});
|
|
496
452
|
if (params.isPolicyCurrent?.() === false) return null;
|
|
497
|
-
const { conversationRuntime, threadBinding, configuredBinding, boundSessionKey, effectiveRoute,
|
|
453
|
+
const { conversationRuntime, threadBinding, configuredBinding, boundSessionKey, effectiveRoute, baseSessionKey } = routeState;
|
|
498
454
|
const isBoundThreadSession = Boolean(threadBinding && threadChannel);
|
|
499
455
|
if (ignoreBoundThreadMessage(threadBinding, () => isBoundThreadSession)) return null;
|
|
500
456
|
const mentionRegexes = buildMentionRegexes(params.cfg, effectiveRoute.agentId, {
|
|
@@ -525,9 +481,7 @@ async function preflightDiscordMessage(params) {
|
|
|
525
481
|
guildId: params.data.guild_id ?? void 0,
|
|
526
482
|
guildEntries: params.guildEntries
|
|
527
483
|
}) : null;
|
|
528
|
-
logDebug(`[discord-preflight] guild_id=${params.data.guild_id} guild_obj=${Boolean(params.data.guild)} guild_obj_id=${params.data.guild?.id} guildInfo=${Boolean(guildInfo)} guildEntries=${params.guildEntries ? Object.keys(params.guildEntries).join(",") : "none"}`);
|
|
529
484
|
if (isGuildMessage && params.guildEntries && Object.keys(params.guildEntries).length > 0 && !guildInfo) {
|
|
530
|
-
logDebug(`[discord-preflight] guild blocked: guild_id=${params.data.guild_id} guildEntries keys=${Object.keys(params.guildEntries).join(",")}`);
|
|
531
485
|
logVerbose(`Blocked discord guild ${params.data.guild_id ?? "unknown"} (not in discord.guilds)`);
|
|
532
486
|
return null;
|
|
533
487
|
}
|
|
@@ -542,11 +496,6 @@ async function preflightDiscordMessage(params) {
|
|
|
542
496
|
threadParentName
|
|
543
497
|
});
|
|
544
498
|
const channelMatchMeta = formatAllowlistMatchMeta(channelConfig);
|
|
545
|
-
logDiscordPreflightChannelConfig({
|
|
546
|
-
channelConfig,
|
|
547
|
-
channelMatchMeta,
|
|
548
|
-
channelId: messageChannelId
|
|
549
|
-
});
|
|
550
499
|
if (!resolveDiscordPreflightChannelAccess({
|
|
551
500
|
isGuildMessage,
|
|
552
501
|
isGroupDm,
|
|
@@ -586,7 +535,7 @@ async function preflightDiscordMessage(params) {
|
|
|
586
535
|
isGuildMessage,
|
|
587
536
|
isThread: Boolean(threadChannel),
|
|
588
537
|
botId,
|
|
589
|
-
threadOwnerId: threadChannel ?
|
|
538
|
+
threadOwnerId: threadChannel ? threadChannel.ownerId ?? channelInfo?.ownerId : void 0,
|
|
590
539
|
channelConfig,
|
|
591
540
|
guildInfo
|
|
592
541
|
});
|
|
@@ -600,7 +549,6 @@ async function preflightDiscordMessage(params) {
|
|
|
600
549
|
allowNameMatching
|
|
601
550
|
});
|
|
602
551
|
if (isGuildMessage && hasAccessRestrictions && !memberAllowed) {
|
|
603
|
-
logDebug(`[discord-preflight] drop: member not allowed`);
|
|
604
552
|
logVerbose("Blocked discord guild sender (not in users/roles allowlist)");
|
|
605
553
|
return null;
|
|
606
554
|
}
|
|
@@ -643,15 +591,6 @@ async function preflightDiscordMessage(params) {
|
|
|
643
591
|
acpBinding: Boolean(configuredBinding)
|
|
644
592
|
});
|
|
645
593
|
const wasMentioned = wasNormallyMentioned || hasActiveBotMention || Boolean(groupThread?.mentionedAgentIds.length);
|
|
646
|
-
logDiscordPreflightInboundSummary({
|
|
647
|
-
messageId: message.id,
|
|
648
|
-
guildId: params.data.guild_id ?? void 0,
|
|
649
|
-
channelId: messageChannelId,
|
|
650
|
-
wasMentioned,
|
|
651
|
-
isDirectMessage,
|
|
652
|
-
isGroupDm,
|
|
653
|
-
hasContent: Boolean(messageText)
|
|
654
|
-
});
|
|
655
594
|
const allowTextCommands = shouldHandleTextCommands({
|
|
656
595
|
cfg: params.cfg,
|
|
657
596
|
surface: "discord"
|
|
@@ -722,10 +661,7 @@ async function preflightDiscordMessage(params) {
|
|
|
722
661
|
hasControlCommand: hasControlCommandInMessage,
|
|
723
662
|
hasAbortRequest
|
|
724
663
|
});
|
|
725
|
-
logDebug(`[discord-preflight] shouldRequireMention=${shouldRequireMention} baseRequireMention=${shouldRequireMentionByConfig} boundThreadSession=${isBoundThreadSession} mentionDecision.shouldSkip=${mentionDecision.shouldSkip} wasMentioned=${wasMentioned}`);
|
|
726
664
|
if (isGuildMessage && shouldRequireMention && mentionDecision.shouldSkip) {
|
|
727
|
-
logDebug(`[discord-preflight] drop: no-mention`);
|
|
728
|
-
logVerbose(`discord: drop guild message (mention required, botId=${botId ?? "<missing>"})`);
|
|
729
665
|
logger.info({
|
|
730
666
|
channelId: messageChannelId,
|
|
731
667
|
reason: "no-mention"
|
|
@@ -735,7 +671,6 @@ async function preflightDiscordMessage(params) {
|
|
|
735
671
|
}
|
|
736
672
|
if (requiresActiveBotMention) {
|
|
737
673
|
if (!(isDirectMessage || hasActiveBotMention || mentionDecision.matchedImplicitMentionKinds.some((kind) => kind !== "reply_to_bot"))) {
|
|
738
|
-
logDebug(`[discord-preflight] drop: bot message missing mention (allowBots=mentions)`);
|
|
739
674
|
logVerbose("discord: drop bot message (allowBots=mentions, missing mention)");
|
|
740
675
|
return null;
|
|
741
676
|
}
|
|
@@ -746,28 +681,22 @@ async function preflightDiscordMessage(params) {
|
|
|
746
681
|
const referencedAuthor = referencedReply?.author;
|
|
747
682
|
const replyTargetsOtherBot = Boolean(botId) && Boolean(referencedAuthor?.bot) && referencedAuthor?.id !== botId && !referencedWebhookId;
|
|
748
683
|
if (isGuildMessage && ignoreOtherMentions && (hasUserOrRoleMention || replyTargetsOtherBot) && !wasMentioned && !mentionDecision.implicitMention) {
|
|
749
|
-
logDebug(`[discord-preflight] drop: addressed-to-other`);
|
|
750
684
|
logVerbose(`discord: drop guild message (addressed to another identity, ignoreOtherMentions=true, botId=${botId})`);
|
|
751
685
|
await recordPendingHistoryEntry();
|
|
752
686
|
return null;
|
|
753
687
|
}
|
|
754
|
-
const
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
guild: params.data.guild ?? void 0,
|
|
758
|
-
channelName: channelName ?? messageChannelId
|
|
759
|
-
});
|
|
688
|
+
const systemGuild = params.data.guild;
|
|
689
|
+
const systemChannelName = channelName ?? messageChannelId;
|
|
690
|
+
const systemLocation = isDirectMessage ? "DM" : isGroupDm ? `Group DM #${systemChannelName}` : systemGuild?.name ? `${systemGuild.name} #${systemChannelName}` : `#${systemChannelName}`;
|
|
760
691
|
const { resolveDiscordSystemEvent } = await loadSystemEventsRuntime();
|
|
761
692
|
if (params.isPolicyCurrent?.() === false) return null;
|
|
762
693
|
const systemText = resolveDiscordSystemEvent(message, systemLocation);
|
|
763
694
|
if (systemText) {
|
|
764
|
-
logDebug(`[discord-preflight] drop: system event`);
|
|
765
695
|
enqueueRoutedSystemEvent(systemText, effectiveRoute, { contextKey: `discord:system:${messageChannelId}:${message.id}` });
|
|
766
696
|
return null;
|
|
767
697
|
}
|
|
768
698
|
const hasNativeMedia = (message.attachments?.length ?? 0) > 0 || resolveDiscordMessageStickers(message).length > 0;
|
|
769
699
|
if (!messageText && !hasNativeMedia) {
|
|
770
|
-
logDebug(`[discord-preflight] drop: empty content`);
|
|
771
700
|
logVerbose(`discord: drop message ${message.id} (empty content)`);
|
|
772
701
|
return null;
|
|
773
702
|
}
|
|
@@ -782,7 +711,7 @@ async function preflightDiscordMessage(params) {
|
|
|
782
711
|
return null;
|
|
783
712
|
}
|
|
784
713
|
}
|
|
785
|
-
if (author.bot && !sender.isPluralKit &&
|
|
714
|
+
if (author.bot && !sender.isPluralKit && params.botUserId) {
|
|
786
715
|
const botLoopResult = recordChannelBotPairLoopAndCheckSuppression({
|
|
787
716
|
scopeId: params.accountId,
|
|
788
717
|
conversationId: messageChannelId,
|
|
@@ -791,7 +720,7 @@ async function preflightDiscordMessage(params) {
|
|
|
791
720
|
config: params.discordConfig?.botLoopProtection,
|
|
792
721
|
defaultsConfig: params.cfg.channels?.defaults?.botLoopProtection,
|
|
793
722
|
defaultEnabled: true,
|
|
794
|
-
nowMs:
|
|
723
|
+
nowMs: parseDateStringTimestampMs(message.timestamp)
|
|
795
724
|
});
|
|
796
725
|
if (botLoopResult.suppressed) {
|
|
797
726
|
logVerbose(`discord: bot-to-bot loop detected before media download, suppressing for ${Math.max(0, Math.ceil((botLoopResult.cooldownUntilMs - Date.now()) / 1e3))}s`);
|
|
@@ -817,7 +746,6 @@ async function preflightDiscordMessage(params) {
|
|
|
817
746
|
const forwardedMedia = await resolveForwardedMediaList(message, params.mediaMaxBytes, mediaResolveOptions);
|
|
818
747
|
if (params.abortSignal?.aborted) return null;
|
|
819
748
|
preparedMedia.push(...forwardedMedia);
|
|
820
|
-
logDebug(`[discord-preflight] success: route=${effectiveRoute.agentId} sessionKey=${effectiveRoute.sessionKey}`);
|
|
821
749
|
return {
|
|
822
750
|
cfg: params.cfg,
|
|
823
751
|
client: params.client,
|
|
@@ -859,12 +787,10 @@ async function preflightDiscordMessage(params) {
|
|
|
859
787
|
messageText,
|
|
860
788
|
...preflightTranscript !== void 0 ? { preflightAudioTranscript: preflightTranscript } : {},
|
|
861
789
|
preparedMedia,
|
|
862
|
-
wasMentioned,
|
|
863
790
|
conversationAvatar,
|
|
864
791
|
route: effectiveRoute,
|
|
865
792
|
threadBinding,
|
|
866
793
|
boundSessionKey: boundSessionKey || void 0,
|
|
867
|
-
boundAgentId,
|
|
868
794
|
guildInfo,
|
|
869
795
|
guildSlug,
|
|
870
796
|
threadChannel,
|
|
@@ -885,4 +811,4 @@ async function preflightDiscordMessage(params) {
|
|
|
885
811
|
canDetectMention
|
|
886
812
|
};
|
|
887
813
|
}
|
|
888
|
-
export { preflightDiscordMessage
|
|
814
|
+
export { preflightDiscordMessage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { D as resolveDiscordMessageStickers } from "./transcripts-source-
|
|
1
|
+
import { w as isDiscordThreadChannelType } from "./allow-list-DahA0Jxh.mjs";
|
|
2
|
+
import { D as resolveDiscordMessageStickers } from "./transcripts-source-DzpzETZR.mjs";
|
|
3
3
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
4
4
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
5
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -21,12 +21,6 @@ function isBoundThreadBotSystemMessage(params) {
|
|
|
21
21
|
function isDiscordThreadChannelMessage(params) {
|
|
22
22
|
return params.isGuildMessage && isDiscordThreadChannelType(params.channelInfo?.type);
|
|
23
23
|
}
|
|
24
|
-
function resolveInjectedBoundThreadLookupRecord(params) {
|
|
25
|
-
const getByThreadId = params.threadBindings.getByThreadId;
|
|
26
|
-
if (typeof getByThreadId !== "function") return;
|
|
27
|
-
const binding = getByThreadId(params.threadId);
|
|
28
|
-
return binding && typeof binding === "object" ? binding : void 0;
|
|
29
|
-
}
|
|
30
24
|
function resolveDiscordMentionState(params) {
|
|
31
25
|
if (params.isDirectMessage) return {
|
|
32
26
|
implicitMentionKinds: [],
|
|
@@ -90,29 +84,22 @@ function createDiscordHistorySenderProvenance(params) {
|
|
|
90
84
|
});
|
|
91
85
|
}
|
|
92
86
|
function filterDiscordHistoryEntriesForContext(params) {
|
|
93
|
-
if (params.mode === "all") return
|
|
94
|
-
|
|
95
|
-
omitted: 0
|
|
96
|
-
};
|
|
97
|
-
const filtered = filterSupplementalContextItems({
|
|
87
|
+
if (params.mode === "all") return [...params.entries];
|
|
88
|
+
return filterSupplementalContextItems({
|
|
98
89
|
items: params.entries,
|
|
99
90
|
mode: params.mode,
|
|
100
91
|
kind: "history",
|
|
101
92
|
isSenderAllowed: (entry) => Boolean(entry.senderProvenance) && params.isSenderAllowed(entry.senderProvenance)
|
|
102
|
-
});
|
|
103
|
-
return {
|
|
104
|
-
entries: filtered.items,
|
|
105
|
-
omitted: filtered.omitted
|
|
106
|
-
};
|
|
93
|
+
}).items;
|
|
107
94
|
}
|
|
108
95
|
function resolveDiscordHistoryMediaIds(message) {
|
|
109
96
|
return [...(message.attachments ?? []).map((attachment) => `attachment:${attachment.id}`), ...resolveDiscordMessageStickers(message).map((sticker) => `sticker:${sticker.id}`)];
|
|
110
97
|
}
|
|
111
98
|
// extensions/discord/src/monitor/message-handler.preflight-runtime.ts
|
|
112
99
|
const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-DcXbHTpQ.mjs").then((n) => n.n));
|
|
113
|
-
const loadPreflightAudioRuntime = createLazyRuntimeModule(() => import("./preflight-audio-
|
|
114
|
-
const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events
|
|
115
|
-
const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./threading-
|
|
100
|
+
const loadPreflightAudioRuntime = createLazyRuntimeModule(() => import("./preflight-audio-r4BbaJxh.mjs"));
|
|
101
|
+
const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events--Pk6y9aP.mjs"));
|
|
102
|
+
const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./threading-HA9C2wYR.mjs").then((n) => n.t));
|
|
116
103
|
// extensions/discord/src/monitor/message-handler.preflight-pluralkit.ts
|
|
117
104
|
async function resolveDiscordPreflightPluralKitInfo(params) {
|
|
118
105
|
if (!params.config?.enabled || !params.webhookId) return null;
|
|
@@ -129,4 +116,4 @@ async function resolveDiscordPreflightPluralKitInfo(params) {
|
|
|
129
116
|
return null;
|
|
130
117
|
}
|
|
131
118
|
}
|
|
132
|
-
export { createDiscordHistorySenderProvenance as a, hasRawDiscordUserMention as c, matchesActiveDiscordMentionPatterns as d, resolveDiscordMentionState as f, loadSystemEventsRuntime as i, isBoundThreadBotSystemMessage as l,
|
|
119
|
+
export { createDiscordHistorySenderProvenance as a, hasRawDiscordUserMention as c, matchesActiveDiscordMentionPatterns as d, resolveDiscordMentionState as f, loadSystemEventsRuntime as i, isBoundThreadBotSystemMessage as l, loadDiscordThreadingRuntime as n, filterDiscordHistoryEntriesForContext as o, shouldIgnoreBoundThreadWebhookMessage as p, loadPreflightAudioRuntime as r, resolveDiscordHistoryMediaIds as s, resolveDiscordPreflightPluralKitInfo as t, isDiscordThreadChannelMessage as u };
|