@openclaw/discord 2026.8.1-beta.2 → 2026.8.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-CqzrH14k.js → account-inspect-BDfKyuvL.js} +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-DJTf1LtA.js → accounts-CfQ-vSyf.js} +34 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-DS7vpdtp.js → activities-api-Dl-TOyOX.js} +134 -175
- package/dist/activities-api.js +1 -1
- package/dist/api.js +17 -17
- package/dist/{approval-handler.runtime-B6yEV79q.js → approval-handler.runtime-q4Zqo44V.js} +29 -106
- package/dist/{audit-Db-rlntl.js → audit-DgrvFPGt.js} +5 -5
- package/dist/{channel-CnnbJSt5.js → channel-BsQUalPw.js} +72 -50
- package/dist/{channel-actions.runtime-CLKrx6tr.js → channel-actions.runtime-UMGGIfSy.js} +31 -45
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/channel-type-CVLZyGYS.js +7 -0
- package/dist/{channel.setup-BFAO-V1P.js → channel.setup-rPs4dsk_.js} +5 -5
- package/dist/{outbound-session-route-DxLkrgKQ.js → components-Dk35LTf_.js} +34 -76
- package/dist/{config-schema-BgEskFAs.js → config-schema-CxPqtVI1.js} +46 -14
- package/dist/conversation-binding-route-BjvX4e35.js +43 -0
- package/dist/{directory-config-BVX7Cflc.js → directory-config-B7DY_pNG.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-DGIGxpIo.js → directory-live-DuAXKkan.js} +3 -3
- package/dist/doctor-contract-api.js +2 -2
- package/dist/{doctor-BzC-TLnB.js → doctor-zQTtn6hm.js} +33 -12
- package/dist/{handle-action.guild-admin-BNVTUISF.js → handle-action.guild-admin-DZewwLr1.js} +9 -5
- package/dist/index.js +3 -4
- package/dist/ingress-identity-CzZKcPK8.js +60 -0
- package/dist/{message-handler-Unk_f10F.js → message-handler-C5By3yl5.js} +82 -6
- package/dist/{message-handler.preflight-C9zecxR9.js → message-handler.preflight-DrszWuHw.js} +44 -118
- package/dist/{message-handler.process-DWQ6UHHu.js → message-handler.process-DyFPDLCt.js} +205 -235
- package/dist/{message-utils-BSCPVgy0.js → message-text-Ca8M6TU8.js} +43 -42
- package/dist/{outbound-adapter-D9nRivT1.js → outbound-adapter-Dif8p481.js} +118 -91
- package/dist/{outbound-components-cTzwBJ60.js → outbound-components-wjv7yyAj.js} +5 -4
- package/dist/outbound-session-route-Bn4uXaoE.js +665 -0
- package/dist/owner-access-UlYi9t0M.js +107 -0
- package/dist/{pluralkit-DdiJ9KMK.js → pluralkit-9EuEN4UD.js} +1 -1
- package/dist/{probe-Bl-k5_Ku.js → probe-n6ZXxK8V.js} +1 -1
- package/dist/{probe.runtime-M9fREKvp.js → probe.runtime-CN4bdPfZ.js} +1 -1
- package/dist/{provider-DvSNb-2v.js → provider-LXiOcJrH.js} +887 -1350
- package/dist/{provider-session.runtime-BUEqD0rA.js → provider-session.runtime-DSNe7r2W.js} +3 -3
- package/dist/provider.runtime-DiInaDXO.js +2 -0
- package/dist/{realtime-session.runtime-C7wen-aF.js → realtime-session.runtime-DOViOIjY.js} +129 -134
- package/dist/{resolve-allowlist-common-D04lpEzb.js → resolve-allowlist-common-BLoYaxEG.js} +2 -2
- package/dist/{resolve-channels-Dm7jEeg6.js → resolve-channels-D2yl_2CN.js} +5 -4
- package/dist/{resolve-users-bktrCUUU.js → resolve-users-BLxfqajZ.js} +2 -2
- package/dist/{retry-CLpJcXXf.js → retry-DqHCW6PV.js} +187 -19
- package/dist/{runtime-DGsSyDTS.js → runtime-BYamRVPN.js} +89 -86
- package/dist/{runtime-DoHjckYm.js → runtime-DrxVBTtp.js} +9 -10
- package/dist/runtime-api.js +19 -25
- package/dist/{sdk-runtime-QpY8PvCh.js → sdk-runtime-6tfgYDjY.js} +57 -89
- 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-jGnJF__m.js → security-audit-DKfK-iPY.js} +11 -12
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/{security-audit.runtime-CPN0xFYz.js → security-audit.runtime-sKZyKgpx.js} +1 -1
- package/dist/{send-B7Q6Oc1I.js → send-UJHiAm4C.js} +82 -19
- package/dist/{send.components-iJyFXw9L.js → send.components-CrBJpGT_.js} +22 -39
- package/dist/{send.outbound-DS5tHwfR.js → send.outbound-D7JYmfm9.js} +77 -78
- package/dist/{send.shared-BmwFjW6T.js → send.shared-DZJ1akvQ.js} +136 -121
- 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-Dii2HTn7.js} +41 -14
- package/dist/subagent-hooks-JyGrtQIl.js +49 -0
- package/dist/subagent-hooks-api.js +1 -6
- package/dist/{system-events-CTqDf6_s.js → system-events-BEmcj4xJ.js} +2 -2
- package/dist/{target-resolver-maOKSqO0.js → target-resolver-V-IYae6s.js} +3 -3
- package/dist/targets-CQp53cGj.js +3 -0
- package/dist/{thread-bindings-3L8p82GV.js → thread-bindings-DvYP79fy.js} +28 -26
- package/dist/{thread-bindings.manager-DCIH6WDC.js → thread-bindings.manager-Clm77DBM.js} +11 -14
- 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-CXuu_7o9.js +478 -0
- package/dist/transcripts-source-BLEMH_yi.js +270 -0
- package/dist/transcripts-source-api.js +7 -2
- package/dist/{typing-CS-nNVoe.js → typing-B9snnwMe.js} +1 -1
- package/dist/{voice-runtime-BEdqNcST.js → voice-runtime-DY6_o73o.js} +250 -150
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/README.md +19 -19
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v1.js +7 -3
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v7.js +5 -2
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v1.js +7 -3
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v7.js +5 -2
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/package.json +4 -3
- package/node_modules/@discordjs/voice/node_modules/@types/node/README.md +1 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/child_process.d.ts +0 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/crypto.d.ts +6 -6
- package/node_modules/@discordjs/voice/node_modules/@types/node/dns/promises.d.ts +5 -5
- package/node_modules/@discordjs/voice/node_modules/@types/node/dns.d.ts +5 -5
- package/node_modules/@discordjs/voice/node_modules/@types/node/fs.d.ts +7 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/http.d.ts +30 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/http2.d.ts +4 -4
- package/node_modules/@discordjs/voice/node_modules/@types/node/os.d.ts +30 -30
- package/node_modules/@discordjs/voice/node_modules/@types/node/package.json +2 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/perf_hooks.d.ts +2 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/process.d.ts +42 -43
- package/node_modules/@discordjs/voice/node_modules/@types/node/quic.d.ts +1049 -84
- package/node_modules/@discordjs/voice/node_modules/@types/node/sqlite.d.ts +14 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/stream/iter.d.ts +3 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/test.d.ts +61 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/v8.d.ts +20 -23
- package/node_modules/discord-api-types/CHANGELOG.md +8 -0
- package/node_modules/discord-api-types/package.json +4 -4
- package/node_modules/discord-api-types/payloads/v10/channel.d.ts +2 -2
- package/node_modules/discord-api-types/payloads/v10/channel.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/gateway.d.ts +4 -0
- package/node_modules/discord-api-types/payloads/v10/gateway.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/gateway.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/message.d.ts +4 -1
- package/node_modules/discord-api-types/payloads/v10/message.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/message.js +1 -0
- package/node_modules/discord-api-types/payloads/v10/message.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/channel.d.ts +2 -2
- package/node_modules/discord-api-types/payloads/v9/channel.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/gateway.d.ts +4 -0
- package/node_modules/discord-api-types/payloads/v9/gateway.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/gateway.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/message.d.ts +4 -1
- package/node_modules/discord-api-types/payloads/v9/message.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/message.js +1 -0
- package/node_modules/discord-api-types/payloads/v9/message.js.map +1 -1
- package/node_modules/typebox/build/format/date.d.mts +1 -1
- package/node_modules/typebox/build/format/date.mjs +1 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -2
- package/node_modules/typebox/build/format/date_time.mjs +3 -3
- package/node_modules/typebox/build/format/email.d.mts +1 -1
- package/node_modules/typebox/build/format/email.mjs +2 -2
- package/node_modules/typebox/build/format/hostname.mjs +2 -10
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_email.mjs +3 -3
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
- package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
- package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
- package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
- package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
- package/node_modules/typebox/build/format/idna/index.mjs +2 -0
- package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
- package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
- package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
- package/node_modules/typebox/build/format/ipv4.mjs +2 -32
- package/node_modules/typebox/build/format/ipv6.mjs +2 -61
- package/node_modules/typebox/build/format/iri.d.mts +2 -2
- package/node_modules/typebox/build/format/iri.mjs +26 -8
- package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
- package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
- package/node_modules/typebox/build/format/regex.d.mts +1 -2
- package/node_modules/typebox/build/format/regex.mjs +2 -6
- package/node_modules/typebox/build/format/time.d.mts +2 -2
- package/node_modules/typebox/build/format/time.mjs +19 -14
- package/node_modules/typebox/build/format/uri.d.mts +1 -1
- package/node_modules/typebox/build/format/uri.mjs +3 -130
- package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
- package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
- package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
- package/node_modules/typebox/build/format/uri_template.mjs +4 -5
- package/node_modules/typebox/build/format/url.d.mts +3 -3
- package/node_modules/typebox/build/format/url.mjs +4 -5
- package/node_modules/typebox/build/guard/emit.d.mts +3 -1
- package/node_modules/typebox/build/guard/emit.mjs +12 -5
- package/node_modules/typebox/build/guard/guard.d.mts +8 -2
- package/node_modules/typebox/build/guard/guard.mjs +25 -4
- package/node_modules/typebox/build/guard/string.d.mts +2 -2
- package/node_modules/typebox/build/guard/string.mjs +7 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
- package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
- package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
- package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
- package/node_modules/typebox/build/schema/types/index.mjs +0 -2
- package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
- package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
- package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
- package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
- package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
- package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
- package/node_modules/typebox/build/type/script/parser.mjs +27 -23
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/package.json +27 -27
- package/node_modules/typebox/readme.md +79 -82
- package/node_modules/undici/docs/docs/api/Client.md +21 -8
- package/node_modules/undici/lib/api/readable.js +33 -43
- package/node_modules/undici/lib/core/connect.js +16 -2
- package/node_modules/undici/lib/core/symbols.js +1 -0
- package/node_modules/undici/lib/dispatcher/client-h1.js +3 -3
- package/node_modules/undici/lib/dispatcher/client-h2.js +179 -10
- package/node_modules/undici/lib/dispatcher/client.js +74 -29
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +28 -6
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +15 -1
- package/node_modules/undici/lib/handler/retry-handler.js +7 -2
- package/node_modules/undici/lib/interceptor/cache.js +5 -2
- package/node_modules/undici/lib/interceptor/deduplicate.js +1 -1
- package/node_modules/undici/lib/mock/mock-utils.js +213 -24
- package/node_modules/undici/lib/util/cache.js +2 -4
- package/node_modules/undici/lib/web/websocket/websocket.js +22 -0
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/client.d.ts +40 -0
- package/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/ws/package.json +1 -1
- package/openclaw.plugin.json +24 -10
- package/package.json +8 -10
- package/skills/discord/SKILL.md +1 -1
- package/dist/approval-message-safety-AcIxvrf3.js +0 -140
- package/dist/audit-core-xwjIczO0.js +0 -105
- package/dist/channel-actions-5s_hjYKd.js +0 -208
- package/dist/channel-api-CAJ0wMoV.js +0 -21
- package/dist/inbound-event-delivery-De2qxTrP.js +0 -39
- package/dist/provider.runtime-C9PnJZbZ.js +0 -2
- package/dist/runtime-api.actions.js +0 -3
- package/dist/runtime-api.lookup.js +0 -7
- package/dist/runtime-api.monitor-CHxrFPnW.js +0 -5
- package/dist/runtime-api.monitor.js +0 -8
- package/dist/runtime-api.send.js +0 -7
- package/dist/runtime-api.threads.js +0 -5
- package/dist/send.reactions-BAn0iiVQ.js +0 -78
- package/dist/send.receipt-IPI1p-SP.js +0 -66
- package/dist/subagent-hooks-CTt5KCJr.js +0 -120
- package/dist/subagent-progress-DhaE_h8a.js +0 -109
- 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/node_modules/typebox/build/format/_idna.d.mts +0 -2
- package/node_modules/typebox/build/format/_idna.mjs +0 -246
- package/node_modules/typebox/build/format/_puny.d.mts +0 -1
- package/node_modules/typebox/build/format/_puny.mjs +0 -77
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
- package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
- package/dist/{allow-list-DnxIlPP2.js → allow-list-BDMimASD.js} +1 -1
- package/dist/{doctor-contract-DLa-BTiU.js → doctor-contract-DsWvKIXF.js} +1 -1
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
2
|
-
import { c as resolveDiscordChannelInfoSafe, d as resolveDiscordChannelParentSafe, l as resolveDiscordChannelNameSafe, s as resolveDiscordChannelIdSafe } from "./thread-bindings.manager-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { c as resolveDiscordChannelInfoSafe, d as resolveDiscordChannelParentSafe, l as resolveDiscordChannelNameSafe, s as resolveDiscordChannelIdSafe } from "./thread-bindings.manager-Clm77DBM.js";
|
|
3
|
+
import { v as mapGatewayDispatchData } from "./provider-LXiOcJrH.js";
|
|
4
|
+
import { d as resolveDiscordCdnPolicy, i as resolveDiscordMessageText, l as hasDiscordMessageStickers, p as resolveDiscordMessageChannelId } from "./message-text-Ca8M6TU8.js";
|
|
5
|
+
import { logDebug } from "openclaw/plugin-sdk/logging-core";
|
|
6
6
|
import { GatewayDispatchEvents } from "discord-api-types/v10";
|
|
7
7
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
8
|
+
import { normalizeNullableString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
9
|
import { danger } from "openclaw/plugin-sdk/runtime-env";
|
|
9
10
|
import { resolveBatchedReplyThreadingPolicy } from "openclaw/plugin-sdk/reply-reference";
|
|
10
11
|
import { DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, createChannelIngressError, createChannelIngressMonitor, createChannelRunQueue } from "openclaw/plugin-sdk/channel-outbound";
|
|
12
|
+
import { saveRemoteMedia } from "openclaw/plugin-sdk/media-runtime";
|
|
11
13
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
12
14
|
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
13
15
|
import { fanInChannelIngressLifecycles } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
@@ -167,6 +169,77 @@ function normalizeDiscordThreadChannel(threadChannel) {
|
|
|
167
169
|
};
|
|
168
170
|
}
|
|
169
171
|
//#endregion
|
|
172
|
+
//#region extensions/discord/src/monitor/message-avatar.ts
|
|
173
|
+
const DISCORD_AVATAR_MAX_BYTES = 256 * 1024;
|
|
174
|
+
const DISCORD_AVATAR_CACHE_MAX_ENTRIES = 128;
|
|
175
|
+
const DISCORD_GUILD_ICON_TTL_MS = 5 * 6e4;
|
|
176
|
+
function setBoundedEntry(map, key, value) {
|
|
177
|
+
map.delete(key);
|
|
178
|
+
map.set(key, value);
|
|
179
|
+
while (map.size > DISCORD_AVATAR_CACHE_MAX_ENTRIES) {
|
|
180
|
+
const oldest = map.keys().next().value;
|
|
181
|
+
if (oldest === void 0) break;
|
|
182
|
+
map.delete(oldest);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function discordAvatarUrl(owner, id, hash) {
|
|
186
|
+
return `https://cdn.discordapp.com/${owner}/${id}/${hash}.png?size=128`;
|
|
187
|
+
}
|
|
188
|
+
/** Dispatcher-lifetime resolver for eventually available Discord conversation images. */
|
|
189
|
+
function createDiscordAvatarResolver() {
|
|
190
|
+
const saved = /* @__PURE__ */ new Map();
|
|
191
|
+
const pending = /* @__PURE__ */ new Set();
|
|
192
|
+
const guildIcons = /* @__PURE__ */ new Map();
|
|
193
|
+
const pendingGuilds = /* @__PURE__ */ new Set();
|
|
194
|
+
const resolveSavedAvatar = (key, url) => {
|
|
195
|
+
const cached = saved.get(key);
|
|
196
|
+
if (cached) {
|
|
197
|
+
saved.delete(key);
|
|
198
|
+
saved.set(key, cached);
|
|
199
|
+
return cached;
|
|
200
|
+
}
|
|
201
|
+
if (pending.has(key) || pending.size >= DISCORD_AVATAR_CACHE_MAX_ENTRIES) return;
|
|
202
|
+
pending.add(key);
|
|
203
|
+
saveRemoteMedia({
|
|
204
|
+
url,
|
|
205
|
+
filePathHint: "conversation-avatar.png",
|
|
206
|
+
maxBytes: DISCORD_AVATAR_MAX_BYTES,
|
|
207
|
+
ssrfPolicy: resolveDiscordCdnPolicy()
|
|
208
|
+
}).then((media) => {
|
|
209
|
+
setBoundedEntry(saved, key, media.path);
|
|
210
|
+
}).catch((error) => {
|
|
211
|
+
logDebug(`discord conversation avatar download failed: ${formatErrorMessage(error)}`);
|
|
212
|
+
}).finally(() => {
|
|
213
|
+
pending.delete(key);
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
const refreshGuildIcon = (client, guildId, conversationId) => {
|
|
217
|
+
if (pendingGuilds.has(guildId) || pendingGuilds.size >= DISCORD_AVATAR_CACHE_MAX_ENTRIES) return;
|
|
218
|
+
pendingGuilds.add(guildId);
|
|
219
|
+
client.fetchGuild(guildId).then((guild) => {
|
|
220
|
+
const hash = guild.icon ?? null;
|
|
221
|
+
setBoundedEntry(guildIcons, guildId, {
|
|
222
|
+
expiresAt: Date.now() + DISCORD_GUILD_ICON_TTL_MS,
|
|
223
|
+
hash
|
|
224
|
+
});
|
|
225
|
+
if (hash) resolveSavedAvatar(`${conversationId}\0${hash}`, discordAvatarUrl("icons", guildId, hash));
|
|
226
|
+
}).catch((error) => {
|
|
227
|
+
logDebug(`discord guild icon lookup failed: ${formatErrorMessage(error)}`);
|
|
228
|
+
}).finally(() => {
|
|
229
|
+
pendingGuilds.delete(guildId);
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
return { resolve(params) {
|
|
233
|
+
if (!params.guildId) {
|
|
234
|
+
const hash = params.author.avatar;
|
|
235
|
+
return hash ? resolveSavedAvatar(`${params.conversationId}\0${hash}`, discordAvatarUrl("avatars", params.author.id, hash)) : void 0;
|
|
236
|
+
}
|
|
237
|
+
const guildIcon = guildIcons.get(params.guildId);
|
|
238
|
+
if (!guildIcon || guildIcon.expiresAt <= Date.now()) refreshGuildIcon(params.client, params.guildId, params.conversationId);
|
|
239
|
+
return guildIcon?.hash ? resolveSavedAvatar(`${params.conversationId}\0${guildIcon.hash}`, discordAvatarUrl("icons", params.guildId, guildIcon.hash)) : void 0;
|
|
240
|
+
} };
|
|
241
|
+
}
|
|
242
|
+
//#endregion
|
|
170
243
|
//#region extensions/discord/src/monitor/message-handler.batch-gate.ts
|
|
171
244
|
function applyImplicitReplyBatchGate(ctx, replyToMode, isBatched) {
|
|
172
245
|
const replyThreading = resolveBatchedReplyThreadingPolicy(replyToMode, isBatched);
|
|
@@ -175,7 +248,7 @@ function applyImplicitReplyBatchGate(ctx, replyToMode, isBatched) {
|
|
|
175
248
|
}
|
|
176
249
|
//#endregion
|
|
177
250
|
//#region extensions/discord/src/monitor/message-run-queue.ts
|
|
178
|
-
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-
|
|
251
|
+
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-DyFPDLCt.js"));
|
|
179
252
|
async function processDiscordQueuedMessage(params) {
|
|
180
253
|
const abortSignal = params.job.runtime.abortSignal && params.lifecycleSignal ? AbortSignal.any([params.job.runtime.abortSignal, params.lifecycleSignal]) : params.job.runtime.abortSignal ?? params.lifecycleSignal;
|
|
181
254
|
try {
|
|
@@ -262,7 +335,7 @@ function createDiscordMessageRunQueue(params) {
|
|
|
262
335
|
}
|
|
263
336
|
//#endregion
|
|
264
337
|
//#region extensions/discord/src/monitor/message-dispatcher.ts
|
|
265
|
-
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-
|
|
338
|
+
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-DrszWuHw.js"));
|
|
266
339
|
function isNonEmptyString(value) {
|
|
267
340
|
return typeof value === "string" && value.length > 0;
|
|
268
341
|
}
|
|
@@ -281,6 +354,7 @@ function createDiscordMessageDispatcher(params) {
|
|
|
281
354
|
testing: params.testing
|
|
282
355
|
});
|
|
283
356
|
const dispatcherShutdown = new AbortController();
|
|
357
|
+
const avatarResolver = createDiscordAvatarResolver();
|
|
284
358
|
const pendingDebounceEntries = /* @__PURE__ */ new Set();
|
|
285
359
|
const pendingCancellationSettlements = /* @__PURE__ */ new Set();
|
|
286
360
|
const resolveDebounceKey = (entry) => {
|
|
@@ -323,6 +397,7 @@ function createDiscordMessageDispatcher(params) {
|
|
|
323
397
|
if (entries.length === 1) {
|
|
324
398
|
const ctx = await (preflightDiscordMessageImpl ?? (await loadMessagePreflightRuntime()).preflightDiscordMessage)({
|
|
325
399
|
...params,
|
|
400
|
+
avatarResolver,
|
|
326
401
|
ackReactionScope,
|
|
327
402
|
groupPolicy,
|
|
328
403
|
abortSignal,
|
|
@@ -377,6 +452,7 @@ function createDiscordMessageDispatcher(params) {
|
|
|
377
452
|
};
|
|
378
453
|
const ctx = await (preflightDiscordMessageImpl ?? (await loadMessagePreflightRuntime()).preflightDiscordMessage)({
|
|
379
454
|
...params,
|
|
455
|
+
avatarResolver,
|
|
380
456
|
ackReactionScope,
|
|
381
457
|
groupPolicy,
|
|
382
458
|
abortSignal,
|
package/dist/{message-handler.preflight-C9zecxR9.js → message-handler.preflight-DrszWuHw.js}
RENAMED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { C as resolveTimestampMs, S as resolveDiscordSystemLocation, _ as resolveDiscordShouldRequireMention, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, f as resolveDiscordGuildEntry, i as normalizeDiscordDisplaySlug,
|
|
1
|
+
import { W as Message, jt as getChannelMessage, y as discord_exports } from "./retry-DqHCW6PV.js";
|
|
2
|
+
import { s as resolveDefaultDiscordAccountId } from "./accounts-CfQ-vSyf.js";
|
|
3
|
+
import { C as resolveTimestampMs, S as resolveDiscordSystemLocation, _ as resolveDiscordShouldRequireMention, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, f as resolveDiscordGuildEntry, i as normalizeDiscordDisplaySlug, p as resolveDiscordMemberAccessState, x as formatDiscordUserTag } from "./allow-list-BDMimASD.js";
|
|
4
|
+
import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
|
|
4
5
|
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-B9cy6RvQ.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { a as buildDiscordRoutePeer, c as resolveDiscordEffectiveRoute, f as resolveDiscordRuntimeBindingConversationId, s as resolveDiscordConversationRoute, u as resolveDiscordConversationIdentity } from "./outbound-session-route-Bn4uXaoE.js";
|
|
7
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-BjvX4e35.js";
|
|
8
|
+
import { c as resolveDiscordChannelInfoSafe, l as resolveDiscordChannelNameSafe } from "./thread-bindings.manager-Clm77DBM.js";
|
|
9
|
+
import { S as resolveDiscordTextCommandAccess, _ as handleDiscordDmCommandDecision, n as resolveDiscordPreflightChannelAccess, x as resolveDiscordDmCommandAccess } from "./provider-LXiOcJrH.js";
|
|
10
|
+
import { f as resolveDiscordChannelInfo, i as resolveDiscordMessageText, o as resolveForwardedMediaList, p as resolveDiscordMessageChannelId, r as resolveDiscordMessageHistoryText, s as resolveMediaList, u as resolveDiscordMessageStickers } from "./message-text-Ca8M6TU8.js";
|
|
11
|
+
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-BJtfyise.js";
|
|
10
12
|
import { t as createDiscordHistorySenderProvenance } from "./message-handler.history-CJOsN9w5.js";
|
|
11
|
-
import { normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
13
|
import { logDebug } from "openclaw/plugin-sdk/logging-core";
|
|
13
14
|
import { MessageReferenceType, MessageType } from "discord-api-types/v10";
|
|
14
|
-
import {
|
|
15
|
+
import { normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
15
16
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
17
|
+
import { mimeTypeFromFilePath } from "openclaw/plugin-sdk/media-mime";
|
|
18
|
+
import { getChildLogger, logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
16
19
|
import { formatAllowlistMatchMeta } from "openclaw/plugin-sdk/allow-from";
|
|
17
20
|
import { findCodeRegions, isInsideCode } from "openclaw/plugin-sdk/text-chunking";
|
|
18
21
|
import { isRecentOutboundMessageIdentity } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -20,14 +23,13 @@ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
|
20
23
|
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
21
24
|
import { enqueueRoutedSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
22
25
|
import { buildMentionRegexes, classifyChannelInboundEvent, implicitMentionKindWhen, logInboundDrop, matchesMentionWithExplicit, recordChannelBotPairLoopAndCheckSuppression, resolveInboundMentionDecision, resolveUnmentionedGroupInboundPolicy, toHistoryMediaEntries, toInboundMediaFactsWithMetadata } from "openclaw/plugin-sdk/channel-inbound";
|
|
23
|
-
import { mimeTypeFromFilePath } from "openclaw/plugin-sdk/media-mime";
|
|
24
26
|
import { hasControlCommand } from "openclaw/plugin-sdk/command-detection";
|
|
25
27
|
import { isAbortRequestText } from "openclaw/plugin-sdk/command-primitives-runtime";
|
|
26
28
|
import { shouldHandleTextCommands } from "openclaw/plugin-sdk/command-surface";
|
|
27
29
|
import { createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
28
30
|
//#region extensions/discord/src/monitor/message-handler.dm-preflight.ts
|
|
29
31
|
const loadConversationRuntime$1 = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/conversation-binding-runtime"));
|
|
30
|
-
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
32
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-UJHiAm4C.js").then((n) => n.t));
|
|
31
33
|
function resolveDiscordDmPairingSenderId(sender) {
|
|
32
34
|
return sender.isPluralKit ? `pk:${sender.id}` : sender.id;
|
|
33
35
|
}
|
|
@@ -52,7 +54,9 @@ async function resolveDiscordDmPreflightAccess(params) {
|
|
|
52
54
|
sender: {
|
|
53
55
|
id: params.sender.id,
|
|
54
56
|
name: params.sender.name,
|
|
55
|
-
tag: params.sender.tag
|
|
57
|
+
tag: params.sender.tag,
|
|
58
|
+
isPluralKit: params.sender.isPluralKit,
|
|
59
|
+
authorKind: params.author.bot ? "bot" : "user"
|
|
56
60
|
},
|
|
57
61
|
allowNameMatching: params.allowNameMatching,
|
|
58
62
|
cfg: params.preflight.cfg,
|
|
@@ -266,72 +270,6 @@ async function hydrateDiscordMessageIfNeeded(params) {
|
|
|
266
270
|
};
|
|
267
271
|
}
|
|
268
272
|
//#endregion
|
|
269
|
-
//#region extensions/discord/src/monitor/message-handler.preflight-channel-access.ts
|
|
270
|
-
function resolveDiscordPreflightChannelAccess(params) {
|
|
271
|
-
if (params.isGuildMessage && params.channelConfig?.enabled === false) {
|
|
272
|
-
logDebug(`[discord-preflight] drop: channel disabled`);
|
|
273
|
-
logVerbose(`Blocked discord channel ${params.messageChannelId} (channel disabled, ${params.channelMatchMeta})`);
|
|
274
|
-
return {
|
|
275
|
-
allowed: false,
|
|
276
|
-
channelAllowlistConfigured: false,
|
|
277
|
-
channelAllowed: false
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
const groupDmAllowed = params.isGroupDm && resolveGroupDmAllow({
|
|
281
|
-
channels: params.groupDmChannels,
|
|
282
|
-
channelId: params.messageChannelId,
|
|
283
|
-
channelName: params.displayChannelName,
|
|
284
|
-
channelSlug: params.displayChannelSlug
|
|
285
|
-
});
|
|
286
|
-
if (params.isGroupDm && !groupDmAllowed) return {
|
|
287
|
-
allowed: false,
|
|
288
|
-
channelAllowlistConfigured: false,
|
|
289
|
-
channelAllowed: false
|
|
290
|
-
};
|
|
291
|
-
const channelAllowlistConfigured = Boolean(params.guildInfo?.channels) && Object.keys(params.guildInfo?.channels ?? {}).length > 0;
|
|
292
|
-
const channelAllowed = params.channelConfig?.allowed !== false;
|
|
293
|
-
if (params.isGuildMessage && !isDiscordGroupAllowedByPolicy({
|
|
294
|
-
groupPolicy: params.groupPolicy,
|
|
295
|
-
guildAllowlisted: Boolean(params.guildInfo),
|
|
296
|
-
channelAllowlistConfigured,
|
|
297
|
-
channelAllowed
|
|
298
|
-
})) {
|
|
299
|
-
if (params.groupPolicy === "disabled") {
|
|
300
|
-
logDebug(`[discord-preflight] drop: groupPolicy disabled`);
|
|
301
|
-
logVerbose(`discord: drop guild message (groupPolicy: disabled, ${params.channelMatchMeta})`);
|
|
302
|
-
} else if (!channelAllowlistConfigured) {
|
|
303
|
-
logDebug(`[discord-preflight] drop: groupPolicy allowlist, no channel allowlist configured`);
|
|
304
|
-
logVerbose(`discord: drop guild message (groupPolicy: allowlist, no channel allowlist, ${params.channelMatchMeta})`);
|
|
305
|
-
} else {
|
|
306
|
-
logDebug(`[discord] Ignored message from channel ${params.messageChannelId} (not in guild allowlist). Add to guilds.<guildId>.channels to enable.`);
|
|
307
|
-
logVerbose(`Blocked discord channel ${params.messageChannelId} not in guild channel allowlist (groupPolicy: allowlist, ${params.channelMatchMeta})`);
|
|
308
|
-
}
|
|
309
|
-
return {
|
|
310
|
-
allowed: false,
|
|
311
|
-
channelAllowlistConfigured,
|
|
312
|
-
channelAllowed
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
if (params.isGuildMessage && params.channelConfig?.allowed === false) {
|
|
316
|
-
logDebug(`[discord-preflight] drop: channelConfig.allowed===false`);
|
|
317
|
-
logVerbose(`Blocked discord channel ${params.messageChannelId} not in guild channel allowlist (${params.channelMatchMeta})`);
|
|
318
|
-
return {
|
|
319
|
-
allowed: false,
|
|
320
|
-
channelAllowlistConfigured,
|
|
321
|
-
channelAllowed
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
if (params.isGuildMessage) {
|
|
325
|
-
logDebug(`[discord-preflight] pass: channel allowed`);
|
|
326
|
-
logVerbose(`discord: allow channel ${params.messageChannelId} (${params.channelMatchMeta})`);
|
|
327
|
-
}
|
|
328
|
-
return {
|
|
329
|
-
allowed: true,
|
|
330
|
-
channelAllowlistConfigured,
|
|
331
|
-
channelAllowed
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
//#endregion
|
|
335
273
|
//#region extensions/discord/src/monitor/message-handler.preflight-channel-context.ts
|
|
336
274
|
function resolveDiscordPreflightChannelContext(params) {
|
|
337
275
|
const threadName = params.threadChannel?.name;
|
|
@@ -400,9 +338,6 @@ function isBoundThreadBotSystemMessage(params) {
|
|
|
400
338
|
if (!text) return false;
|
|
401
339
|
return DISCORD_BOUND_THREAD_SYSTEM_PREFIXES.some((prefix) => text.startsWith(prefix));
|
|
402
340
|
}
|
|
403
|
-
function isDiscordThreadChannelType(type) {
|
|
404
|
-
return type === discord_exports.ChannelType.PublicThread || type === discord_exports.ChannelType.PrivateThread || type === discord_exports.ChannelType.AnnouncementThread;
|
|
405
|
-
}
|
|
406
341
|
function isDiscordThreadChannelMessage(params) {
|
|
407
342
|
if (!params.isGuildMessage) return false;
|
|
408
343
|
const channel = "channel" in params.message ? params.message.channel : void 0;
|
|
@@ -488,10 +423,10 @@ function logDiscordPreflightInboundSummary(params) {
|
|
|
488
423
|
}
|
|
489
424
|
//#endregion
|
|
490
425
|
//#region extensions/discord/src/monitor/message-handler.preflight-runtime.ts
|
|
491
|
-
const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-
|
|
426
|
+
const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-9EuEN4UD.js").then((n) => n.n));
|
|
492
427
|
const loadPreflightAudioRuntime = createLazyRuntimeModule(() => import("./preflight-audio-DrnqFA8U.js"));
|
|
493
|
-
const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-
|
|
494
|
-
const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./
|
|
428
|
+
const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-BEmcj4xJ.js"));
|
|
429
|
+
const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./threading-CXuu_7o9.js").then((n) => n.t));
|
|
495
430
|
function isPreflightAborted(abortSignal) {
|
|
496
431
|
return Boolean(abortSignal?.aborted);
|
|
497
432
|
}
|
|
@@ -554,40 +489,21 @@ async function resolveDiscordPreflightRoute(params) {
|
|
|
554
489
|
}),
|
|
555
490
|
parentConversationId: params.earlyThreadParentId
|
|
556
491
|
});
|
|
557
|
-
const bindingConversationId =
|
|
558
|
-
isDirectMessage:
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
route,
|
|
563
|
-
conversation: {
|
|
564
|
-
channel: "discord",
|
|
565
|
-
accountId: params.preflight.accountId,
|
|
566
|
-
conversationId: bindingConversationId,
|
|
567
|
-
parentConversationId: params.earlyThreadParentId
|
|
568
|
-
}
|
|
492
|
+
const bindingConversationId = resolveDiscordRuntimeBindingConversationId({
|
|
493
|
+
isDirectMessage: params.isDirectMessage,
|
|
494
|
+
isGroupDm: params.isGroupDm,
|
|
495
|
+
userId: params.author.id,
|
|
496
|
+
channelId: params.messageChannelId
|
|
569
497
|
});
|
|
570
|
-
|
|
571
|
-
bindingRecord: runtimeRoute.bindingRecord,
|
|
572
|
-
route
|
|
573
|
-
})) {
|
|
574
|
-
logVerbose(`discord: ignoring stale route binding for conversation ${bindingConversationId} (${runtimeRoute.bindingRecord?.targetSessionKey} -> ${route.sessionKey})`);
|
|
575
|
-
runtimeRoute = {
|
|
576
|
-
bindingRecord: null,
|
|
577
|
-
route
|
|
578
|
-
};
|
|
579
|
-
}
|
|
580
|
-
let threadBinding = runtimeRoute.bindingRecord ?? void 0;
|
|
581
|
-
const configuredRoute = threadBinding == null ? conversationRuntime.resolveConfiguredBindingRoute({
|
|
498
|
+
const { runtimeRoute, configuredRoute } = resolveDiscordConversationBindingRoute({
|
|
582
499
|
cfg: params.preflight.cfg,
|
|
583
500
|
route,
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
}) : null;
|
|
501
|
+
accountId: params.preflight.accountId,
|
|
502
|
+
runtimeConversationId: bindingConversationId,
|
|
503
|
+
configuredConversationId: params.messageChannelId,
|
|
504
|
+
parentConversationId: params.earlyThreadParentId
|
|
505
|
+
});
|
|
506
|
+
let threadBinding = runtimeRoute.bindingRecord ?? void 0;
|
|
591
507
|
const configuredBinding = configuredRoute?.bindingResolution ?? null;
|
|
592
508
|
if (!threadBinding && configuredBinding) threadBinding = configuredBinding.record;
|
|
593
509
|
const boundSessionKey = conversationRuntime.isPluginOwnedSessionBindingRecord(threadBinding) ? "" : runtimeRoute.boundSessionKey ?? threadBinding?.targetSessionKey?.trim();
|
|
@@ -725,7 +641,7 @@ async function preflightDiscordMessage(params) {
|
|
|
725
641
|
channelType: channelInfo?.type
|
|
726
642
|
});
|
|
727
643
|
const messageText = resolveDiscordMessageText(message, { includeForwarded: true });
|
|
728
|
-
const injectedBoundThreadBinding = !isDirectMessage && !isGroupDm ? resolveInjectedBoundThreadLookupRecord({
|
|
644
|
+
const injectedBoundThreadBinding = !isDirectMessage && !isGroupDm && (webhookId || author.bot) ? resolveInjectedBoundThreadLookupRecord({
|
|
729
645
|
threadBindings: params.threadBindings,
|
|
730
646
|
threadId: messageChannelId
|
|
731
647
|
}) : void 0;
|
|
@@ -985,7 +901,9 @@ async function preflightDiscordMessage(params) {
|
|
|
985
901
|
sender: {
|
|
986
902
|
id: sender.id,
|
|
987
903
|
name: sender.name,
|
|
988
|
-
tag: sender.tag
|
|
904
|
+
tag: sender.tag,
|
|
905
|
+
isPluralKit: sender.isPluralKit,
|
|
906
|
+
authorKind: author.bot ? "bot" : "user"
|
|
989
907
|
},
|
|
990
908
|
memberAccessConfigured: hasAccessRestrictions,
|
|
991
909
|
memberAllowed,
|
|
@@ -1121,6 +1039,13 @@ async function preflightDiscordMessage(params) {
|
|
|
1121
1039
|
return null;
|
|
1122
1040
|
}
|
|
1123
1041
|
}
|
|
1042
|
+
const guildId = isGuildMessage ? data.guild?.id ?? data.guild_id ?? message.guild_id : void 0;
|
|
1043
|
+
const conversationAvatar = isDirectMessage || guildId ? params.avatarResolver?.resolve({
|
|
1044
|
+
client: params.client,
|
|
1045
|
+
conversationId: messageChannelId,
|
|
1046
|
+
author,
|
|
1047
|
+
...guildId ? { guildId } : {}
|
|
1048
|
+
}) : void 0;
|
|
1124
1049
|
const mediaResolveOptions = {
|
|
1125
1050
|
fetchImpl: params.discordRestFetch,
|
|
1126
1051
|
ssrfPolicy: params.cfg.browser?.ssrfPolicy,
|
|
@@ -1157,6 +1082,7 @@ async function preflightDiscordMessage(params) {
|
|
|
1157
1082
|
...preflightTranscript !== void 0 ? { preflightAudioTranscript: preflightTranscript } : {},
|
|
1158
1083
|
preparedMedia,
|
|
1159
1084
|
wasMentioned,
|
|
1085
|
+
conversationAvatar,
|
|
1160
1086
|
route: effectiveRoute,
|
|
1161
1087
|
threadBinding,
|
|
1162
1088
|
boundSessionKey: boundSessionKey || void 0,
|