@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,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { a as shouldHandleDiscordApprovalRequest } from "./channel-
|
|
6
|
-
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
1
|
+
import { Dt as deleteChannelMessage, _t as stripUndefinedFields, ct as Row, et as Button, ft as TextDisplay, kt as editChannelMessage, nt as Container, q as serializePayload, ut as Separator, wt as createChannelMessage, yt as createUserDmChannel } from "./retry-DqHCW6PV.js";
|
|
2
|
+
import { s as buildExecApprovalCustomId } from "./components-Dk35LTf_.js";
|
|
3
|
+
import { N as createDiscordClient, O as createDiscordMessageNonce } from "./send.shared-DZJ1akvQ.js";
|
|
4
|
+
import { S as isDiscordExecApprovalClientEnabled, n as DISCORD_APPROVAL_ALLOWED_MENTIONS, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-Bn4uXaoE.js";
|
|
5
|
+
import { a as shouldHandleDiscordApprovalRequest } from "./channel-BsQUalPw.js";
|
|
7
6
|
import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
|
|
8
7
|
import { ButtonStyle } from "discord-api-types/v10";
|
|
8
|
+
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { createChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-runtime";
|
|
10
10
|
//#region extensions/discord/src/ui-colors.ts
|
|
11
11
|
const DEFAULT_DISCORD_ACCENT_COLOR = "#5865F2";
|
|
@@ -137,97 +137,34 @@ function resolveCommandPreviews(commandText, commandPreview, maxChars, secondary
|
|
|
137
137
|
commandSecondaryPreview: formatOptionalCommandPreview(commandPreview, secondaryMaxChars)
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
const {
|
|
142
|
-
const
|
|
140
|
+
function createApprovalContainer(params) {
|
|
141
|
+
const { view } = params;
|
|
142
|
+
const plugin = view.approvalKind === "plugin";
|
|
143
|
+
const pending = view.phase === "pending";
|
|
144
|
+
const approvalLabel = plugin ? "Plugin" : "Exec";
|
|
145
|
+
const { commandPreview, commandSecondaryPreview } = plugin ? {
|
|
146
|
+
commandPreview: formatCommandPreview(view.title, 700),
|
|
147
|
+
commandSecondaryPreview: formatOptionalCommandPreview(view.description, 1e3)
|
|
148
|
+
} : resolveCommandPreviews(view.commandText, view.commandPreview, pending ? 1e3 : 500, pending ? 500 : 300);
|
|
149
|
+
const decisionLabel = view.phase !== "resolved" ? void 0 : view.decision === "allow-once" ? "Allowed (once)" : view.decision === "allow-always" ? "Allowed (always)" : "Denied";
|
|
150
|
+
const title = pending ? `${approvalLabel} Approval Required` : `${approvalLabel} Approval: ${view.phase === "expired" ? "Expired" : decisionLabel}`;
|
|
151
|
+
const description = pending ? plugin ? "A plugin action needs your approval." : "A command needs your approval." : view.phase === "expired" ? "This approval request has expired." : view.resolvedBy ? `Resolved by ${formatDiscordApprovalDisplayValue(view.resolvedBy)}` : "Resolved";
|
|
152
|
+
const accentColor = view.phase === "expired" ? "#99AAB5" : view.phase === "resolved" ? view.decision === "deny" ? "#ED4245" : view.decision === "allow-always" ? "#5865F2" : "#57F287" : plugin ? view.severity === "critical" ? "#ED4245" : view.severity === "info" ? "#5865F2" : "#FAA61A" : "#FFA500";
|
|
153
|
+
const approvalId = formatDiscordApprovalDisplayValue(view.approvalId);
|
|
154
|
+
const footer = pending ? `Expires <t:${Math.max(0, Math.floor(view.expiresAtMs / 1e3))}:R> · ID: ${approvalId}` : `ID: ${approvalId}`;
|
|
143
155
|
return new ExecApprovalContainer({
|
|
144
156
|
cfg: params.cfg,
|
|
145
157
|
accountId: params.accountId,
|
|
146
|
-
title
|
|
147
|
-
description
|
|
158
|
+
title,
|
|
159
|
+
description,
|
|
148
160
|
commandPreview,
|
|
149
161
|
commandSecondaryPreview,
|
|
150
|
-
metadataLines: buildApprovalMetadataLines(
|
|
162
|
+
metadataLines: buildApprovalMetadataLines(view.metadata),
|
|
151
163
|
actionRow: params.actionRow,
|
|
152
|
-
footer
|
|
153
|
-
accentColor: "#FFA500"
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
function createPluginApprovalRequestContainer(params) {
|
|
157
|
-
const expiresAtSeconds = Math.max(0, Math.floor(params.view.expiresAtMs / 1e3));
|
|
158
|
-
const severity = params.view.severity;
|
|
159
|
-
const accentColor = severity === "critical" ? "#ED4245" : severity === "info" ? "#5865F2" : "#FAA61A";
|
|
160
|
-
return new ExecApprovalContainer({
|
|
161
|
-
cfg: params.cfg,
|
|
162
|
-
accountId: params.accountId,
|
|
163
|
-
title: "Plugin Approval Required",
|
|
164
|
-
description: "A plugin action needs your approval.",
|
|
165
|
-
commandPreview: formatCommandPreview(params.view.title, 700),
|
|
166
|
-
commandSecondaryPreview: formatOptionalCommandPreview(params.view.description, 1e3),
|
|
167
|
-
metadataLines: buildApprovalMetadataLines(params.view.metadata),
|
|
168
|
-
actionRow: params.actionRow,
|
|
169
|
-
footer: `Expires <t:${expiresAtSeconds}:R> · ID: ${formatDiscordApprovalDisplayValue(params.view.approvalId)}`,
|
|
170
|
-
accentColor
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
function createExecResolvedContainer(params) {
|
|
174
|
-
const { commandPreview, commandSecondaryPreview } = resolveCommandPreviews(params.view.commandText, params.view.commandPreview, 500, 300);
|
|
175
|
-
const decisionLabel = params.view.decision === "allow-once" ? "Allowed (once)" : params.view.decision === "allow-always" ? "Allowed (always)" : "Denied";
|
|
176
|
-
const accentColor = params.view.decision === "deny" ? "#ED4245" : params.view.decision === "allow-always" ? "#5865F2" : "#57F287";
|
|
177
|
-
return new ExecApprovalContainer({
|
|
178
|
-
cfg: params.cfg,
|
|
179
|
-
accountId: params.accountId,
|
|
180
|
-
title: `Exec Approval: ${decisionLabel}`,
|
|
181
|
-
description: params.view.resolvedBy ? `Resolved by ${formatDiscordApprovalDisplayValue(params.view.resolvedBy)}` : "Resolved",
|
|
182
|
-
commandPreview,
|
|
183
|
-
commandSecondaryPreview,
|
|
184
|
-
metadataLines: buildApprovalMetadataLines(params.view.metadata),
|
|
185
|
-
footer: `ID: ${formatDiscordApprovalDisplayValue(params.view.approvalId)}`,
|
|
186
|
-
accentColor
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
function createPluginResolvedContainer(params) {
|
|
190
|
-
const decisionLabel = params.view.decision === "allow-once" ? "Allowed (once)" : params.view.decision === "allow-always" ? "Allowed (always)" : "Denied";
|
|
191
|
-
const accentColor = params.view.decision === "deny" ? "#ED4245" : params.view.decision === "allow-always" ? "#5865F2" : "#57F287";
|
|
192
|
-
return new ExecApprovalContainer({
|
|
193
|
-
cfg: params.cfg,
|
|
194
|
-
accountId: params.accountId,
|
|
195
|
-
title: `Plugin Approval: ${decisionLabel}`,
|
|
196
|
-
description: params.view.resolvedBy ? `Resolved by ${formatDiscordApprovalDisplayValue(params.view.resolvedBy)}` : "Resolved",
|
|
197
|
-
commandPreview: formatCommandPreview(params.view.title, 700),
|
|
198
|
-
commandSecondaryPreview: formatOptionalCommandPreview(params.view.description, 1e3),
|
|
199
|
-
metadataLines: buildApprovalMetadataLines(params.view.metadata),
|
|
200
|
-
footer: `ID: ${formatDiscordApprovalDisplayValue(params.view.approvalId)}`,
|
|
164
|
+
footer,
|
|
201
165
|
accentColor
|
|
202
166
|
});
|
|
203
167
|
}
|
|
204
|
-
function createExecExpiredContainer(params) {
|
|
205
|
-
const { commandPreview, commandSecondaryPreview } = resolveCommandPreviews(params.view.commandText, params.view.commandPreview, 500, 300);
|
|
206
|
-
return new ExecApprovalContainer({
|
|
207
|
-
cfg: params.cfg,
|
|
208
|
-
accountId: params.accountId,
|
|
209
|
-
title: "Exec Approval: Expired",
|
|
210
|
-
description: "This approval request has expired.",
|
|
211
|
-
commandPreview,
|
|
212
|
-
commandSecondaryPreview,
|
|
213
|
-
metadataLines: buildApprovalMetadataLines(params.view.metadata),
|
|
214
|
-
footer: `ID: ${formatDiscordApprovalDisplayValue(params.view.approvalId)}`,
|
|
215
|
-
accentColor: "#99AAB5"
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
function createPluginExpiredContainer(params) {
|
|
219
|
-
return new ExecApprovalContainer({
|
|
220
|
-
cfg: params.cfg,
|
|
221
|
-
accountId: params.accountId,
|
|
222
|
-
title: "Plugin Approval: Expired",
|
|
223
|
-
description: "This approval request has expired.",
|
|
224
|
-
commandPreview: formatCommandPreview(params.view.title, 700),
|
|
225
|
-
commandSecondaryPreview: formatOptionalCommandPreview(params.view.description, 1e3),
|
|
226
|
-
metadataLines: buildApprovalMetadataLines(params.view.metadata),
|
|
227
|
-
footer: `ID: ${formatDiscordApprovalDisplayValue(params.view.approvalId)}`,
|
|
228
|
-
accentColor: "#99AAB5"
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
168
|
async function updateMessage(params) {
|
|
232
169
|
try {
|
|
233
170
|
const { rest, request: discordRequest } = createDiscordClient({
|
|
@@ -287,17 +224,11 @@ const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
|
287
224
|
context
|
|
288
225
|
});
|
|
289
226
|
if (!resolved) return { body: {} };
|
|
290
|
-
|
|
291
|
-
return { body: stripUndefinedFields(serializePayload(buildExecApprovalPayload(view.approvalKind === "plugin" ? createPluginApprovalRequestContainer({
|
|
227
|
+
return { body: stripUndefinedFields(serializePayload(buildExecApprovalPayload(createApprovalContainer({
|
|
292
228
|
view,
|
|
293
229
|
cfg,
|
|
294
230
|
accountId: resolved.accountId,
|
|
295
|
-
actionRow
|
|
296
|
-
}) : createExecApprovalRequestContainer({
|
|
297
|
-
view,
|
|
298
|
-
cfg,
|
|
299
|
-
accountId: resolved.accountId,
|
|
300
|
-
actionRow
|
|
231
|
+
actionRow: createApprovalActionRow(view)
|
|
301
232
|
})))) };
|
|
302
233
|
},
|
|
303
234
|
buildResolvedResult: ({ cfg, accountId, context, view }) => {
|
|
@@ -309,11 +240,7 @@ const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
|
309
240
|
if (!resolvedContext) return { kind: "delete" };
|
|
310
241
|
return {
|
|
311
242
|
kind: "update",
|
|
312
|
-
payload:
|
|
313
|
-
view,
|
|
314
|
-
cfg,
|
|
315
|
-
accountId: resolvedContext.accountId
|
|
316
|
-
}) : createExecResolvedContainer({
|
|
243
|
+
payload: createApprovalContainer({
|
|
317
244
|
view,
|
|
318
245
|
cfg,
|
|
319
246
|
accountId: resolvedContext.accountId
|
|
@@ -329,11 +256,7 @@ const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
|
329
256
|
if (!resolvedContext) return { kind: "delete" };
|
|
330
257
|
return {
|
|
331
258
|
kind: "update",
|
|
332
|
-
payload:
|
|
333
|
-
view,
|
|
334
|
-
cfg,
|
|
335
|
-
accountId: resolvedContext.accountId
|
|
336
|
-
}) : createExecExpiredContainer({
|
|
259
|
+
payload: createApprovalContainer({
|
|
337
260
|
view,
|
|
338
261
|
cfg,
|
|
339
262
|
accountId: resolvedContext.accountId
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
4
|
-
import "./send-
|
|
5
|
-
import {
|
|
1
|
+
import { on as __exportAll } from "./retry-DqHCW6PV.js";
|
|
2
|
+
import { x as fetchChannelPermissionsDiscord } from "./send.shared-DZJ1akvQ.js";
|
|
3
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BDfKyuvL.js";
|
|
4
|
+
import "./send-UJHiAm4C.js";
|
|
5
|
+
import { _ as auditDiscordChannelPermissionsWithFetcher, v as collectDiscordAuditChannelIdsForAccount } from "./outbound-session-route-Bn4uXaoE.js";
|
|
6
6
|
//#region extensions/discord/src/audit.ts
|
|
7
7
|
var audit_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
auditDiscordChannelPermissions: () => auditDiscordChannelPermissions,
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
3
|
-
import { t as resolveDiscordOutboundSessionRoute } from "./outbound-session-route-DxLkrgKQ.js";
|
|
1
|
+
import { _ as parseDiscordTarget, h as normalizeDiscordMessagingTarget, m as looksLikeDiscordTargetId } from "./retry-DqHCW6PV.js";
|
|
2
|
+
import { c as resolveDiscordAccount, i as listDiscordStartupAccountIds, l as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId } from "./accounts-CfQ-vSyf.js";
|
|
4
3
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
5
|
-
import { a as projectCredentialSnapshotFields, n as PAIRING_APPROVED_MESSAGE, o as resolveConfiguredFromCredentialStatuses, r as buildTokenChannelStatusSummary, t as DEFAULT_ACCOUNT_ID } from "./channel-api-CAJ0wMoV.js";
|
|
6
4
|
import { u as withAbortTimeout } from "./timeouts-B9cy6RvQ.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { t as discordMessageActions$1 } from "./channel-actions-5s_hjYKd.js";
|
|
5
|
+
import { C as shouldSuppressLocalDiscordExecApprovalPrompt, D as isChannelExecApprovalClientEnabledFromConfig, E as createChannelNativeOriginTargetResolver, O as matchesApprovalRequestFilters, S as isDiscordExecApprovalClientEnabled, T as createChannelApproverDmTargetResolver, b as getDiscordExecApprovalApprovers, d as resolveDiscordCurrentConversationIdentity, f as resolveDiscordRuntimeBindingConversationId, p as discordMessageActions, s as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, w as createApproverRestrictedNativeApprovalCapability, x as isDiscordExecApprovalApprover, y as resolveRequiredDiscordChannelPermissions } from "./outbound-session-route-Bn4uXaoE.js";
|
|
6
|
+
import { a as discordSecurityAdapter, c as buildTokenChannelStatusSummary, i as discordSetupContract, l as projectCredentialSnapshotFields, n as discordConfigAdapter, o as DEFAULT_ACCOUNT_ID, s as PAIRING_APPROVED_MESSAGE, t as createDiscordPluginBase, u as resolveConfiguredFromCredentialStatuses } from "./shared-Dii2HTn7.js";
|
|
10
7
|
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.js";
|
|
11
|
-
import {
|
|
12
|
-
import { n as
|
|
13
|
-
import {
|
|
8
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-BjvX4e35.js";
|
|
9
|
+
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-CJb-BpPL.js";
|
|
10
|
+
import { n as discordOutbound } from "./outbound-adapter-Dif8p481.js";
|
|
14
11
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
15
12
|
import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.js";
|
|
16
|
-
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
17
13
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
14
|
+
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
18
15
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
19
|
-
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
20
16
|
import { createChannelMessageAdapterFromOutbound } from "openclaw/plugin-sdk/channel-outbound";
|
|
21
17
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
22
18
|
import { buildLegacyDmAccountAllowlistAdapter, createAccountScopedAllowlistNameResolver, createNestedAllowlistOverrideResolver } from "openclaw/plugin-sdk/allowlist-config-edit";
|
|
19
|
+
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
23
20
|
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
24
21
|
import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
25
22
|
import { appendMatchMetadata, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState, isRecord as isRecord$1, readAccountStatusSnapshot, resolveEnabledConfiguredAccountId } from "openclaw/plugin-sdk/status-helpers";
|
|
26
23
|
import { resolveTargetsWithOptionalToken } from "openclaw/plugin-sdk/target-resolver-runtime";
|
|
27
24
|
import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
28
25
|
import { doesApprovalRequestSelectChannelAccount, resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
26
|
+
import { resolveThreadBindingSpawnPolicy } from "openclaw/plugin-sdk/conversation-runtime";
|
|
29
27
|
import { resolveScopeRequireMention, resolveScopeToolsPolicy, scopeKey } from "openclaw/plugin-sdk/channel-policy";
|
|
30
28
|
import { normalizeAtHashSlug } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
31
29
|
//#region extensions/discord/src/approval-shared.ts
|
|
@@ -194,7 +192,7 @@ function createDiscordApprovalCapability(configOverride) {
|
|
|
194
192
|
request,
|
|
195
193
|
configOverride
|
|
196
194
|
}),
|
|
197
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
195
|
+
load: async () => (await import("./approval-handler.runtime-q4Zqo44V.js")).discordApprovalNativeRuntime
|
|
198
196
|
})
|
|
199
197
|
});
|
|
200
198
|
}
|
|
@@ -301,22 +299,70 @@ function resolveDiscordInboundConversation(params) {
|
|
|
301
299
|
}
|
|
302
300
|
//#endregion
|
|
303
301
|
//#region extensions/discord/src/channel.loaders.ts
|
|
304
|
-
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
305
|
-
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
306
|
-
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
307
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
308
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
309
|
-
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-
|
|
310
|
-
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-
|
|
302
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-B7DY_pNG.js").then((n) => n.t));
|
|
303
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-D2yl_2CN.js").then((n) => n.n));
|
|
304
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-BLxfqajZ.js").then((n) => n.n));
|
|
305
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-Clm77DBM.js").then((n) => n.i));
|
|
306
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-V-IYae6s.js").then((n) => n.r));
|
|
307
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-DiInaDXO.js"));
|
|
308
|
+
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-CN4bdPfZ.js"));
|
|
311
309
|
async function probeDiscordStatusAccount(params) {
|
|
312
310
|
const startedAtMs = Date.now();
|
|
313
311
|
const runtime = await loadDiscordProbeRuntime();
|
|
314
312
|
const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
|
|
315
313
|
return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
|
|
316
314
|
}
|
|
317
|
-
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-
|
|
318
|
-
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-
|
|
319
|
-
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
315
|
+
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-DgrvFPGt.js").then((n) => n.n));
|
|
316
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-UJHiAm4C.js").then((n) => n.t));
|
|
317
|
+
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-DuAXKkan.js").then((n) => n.t));
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region extensions/discord/src/conversation-route-owner.ts
|
|
320
|
+
function inspectDiscordConversationRouteOwner(params) {
|
|
321
|
+
const direct = params.conversation.kind === "direct";
|
|
322
|
+
const nativeConversationId = params.conversation.nativeChannelId ?? params.conversation.peerId;
|
|
323
|
+
const threadConversationId = direct ? void 0 : params.conversation.threadId;
|
|
324
|
+
const runtimeConversationId = threadConversationId ?? resolveDiscordRuntimeBindingConversationId({
|
|
325
|
+
isDirectMessage: direct,
|
|
326
|
+
isGroupDm: params.conversation.kind === "group",
|
|
327
|
+
userId: direct ? params.conversation.peerId : void 0,
|
|
328
|
+
channelId: nativeConversationId
|
|
329
|
+
});
|
|
330
|
+
const route = resolveDiscordConversationRoute({
|
|
331
|
+
cfg: params.cfg,
|
|
332
|
+
accountId: params.accountId,
|
|
333
|
+
guildId: params.conversation.context?.guildId,
|
|
334
|
+
memberRoleIds: params.conversation.context?.memberRoleIds,
|
|
335
|
+
peer: {
|
|
336
|
+
kind: params.conversation.kind,
|
|
337
|
+
id: params.conversation.peerId
|
|
338
|
+
},
|
|
339
|
+
parentConversationId: params.conversation.context?.parentPeerId
|
|
340
|
+
});
|
|
341
|
+
const { runtimeRoute, configuredRoute } = resolveDiscordConversationBindingRoute({
|
|
342
|
+
cfg: params.cfg,
|
|
343
|
+
route,
|
|
344
|
+
accountId: params.accountId,
|
|
345
|
+
runtimeConversationId,
|
|
346
|
+
configuredConversationId: threadConversationId ?? nativeConversationId,
|
|
347
|
+
parentConversationId: params.conversation.context?.parentPeerId,
|
|
348
|
+
touchBinding: false
|
|
349
|
+
});
|
|
350
|
+
if (!runtimeRoute.bindingOwnerAvailable && resolveThreadBindingSpawnPolicy({
|
|
351
|
+
cfg: params.cfg,
|
|
352
|
+
channel: "discord",
|
|
353
|
+
accountId: params.accountId,
|
|
354
|
+
kind: "subagent"
|
|
355
|
+
}).enabled) return { kind: "unavailable" };
|
|
356
|
+
if (runtimeRoute.pluginId) return {
|
|
357
|
+
kind: "plugin",
|
|
358
|
+
pluginId: runtimeRoute.pluginId,
|
|
359
|
+
fallbackAgentId: route.agentId
|
|
360
|
+
};
|
|
361
|
+
return {
|
|
362
|
+
kind: "agent",
|
|
363
|
+
agentId: runtimeRoute.boundAgentId ?? configuredRoute?.boundAgentId ?? route.agentId
|
|
364
|
+
};
|
|
365
|
+
}
|
|
320
366
|
//#endregion
|
|
321
367
|
//#region extensions/discord/src/group-policy.ts
|
|
322
368
|
function normalizeDiscordSlug(value) {
|
|
@@ -513,34 +559,8 @@ function startDiscordStartupProbe(params) {
|
|
|
513
559
|
function shouldTreatDiscordDeliveredTextAsVisible(params) {
|
|
514
560
|
return params.kind === "block" && typeof params.text === "string" && params.text.trim().length > 0;
|
|
515
561
|
}
|
|
516
|
-
function resolveRuntimeDiscordMessageActions() {
|
|
517
|
-
try {
|
|
518
|
-
return getDiscordRuntime().channel?.discord?.messageActions ?? null;
|
|
519
|
-
} catch {
|
|
520
|
-
return null;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
const discordMessageActions = {
|
|
524
|
-
resolveExecutionMode: (ctx) => resolveRuntimeDiscordMessageActions()?.resolveExecutionMode?.(ctx) ?? discordMessageActions$1.resolveExecutionMode?.(ctx) ?? "local",
|
|
525
|
-
describeMessageTool: (ctx) => resolveRuntimeDiscordMessageActions()?.describeMessageTool?.(ctx) ?? discordMessageActions$1.describeMessageTool?.(ctx) ?? null,
|
|
526
|
-
requiresTrustedRequesterSender: (ctx) => resolveRuntimeDiscordMessageActions()?.requiresTrustedRequesterSender?.(ctx) ?? discordMessageActions$1.requiresTrustedRequesterSender?.(ctx) ?? false,
|
|
527
|
-
extractToolSend: (ctx) => resolveRuntimeDiscordMessageActions()?.extractToolSend?.(ctx) ?? discordMessageActions$1.extractToolSend?.(ctx) ?? null,
|
|
528
|
-
prepareSendPayload: (ctx) => resolveRuntimeDiscordMessageActions()?.prepareSendPayload?.(ctx) ?? discordMessageActions$1.prepareSendPayload?.(ctx) ?? null,
|
|
529
|
-
handleAction: async (ctx) => {
|
|
530
|
-
const runtimeHandleAction = resolveRuntimeDiscordMessageActions()?.handleAction;
|
|
531
|
-
if (runtimeHandleAction) return await runtimeHandleAction(ctx);
|
|
532
|
-
if (!discordMessageActions$1.handleAction) throw new Error("Discord message actions not available");
|
|
533
|
-
return await discordMessageActions$1.handleAction(ctx);
|
|
534
|
-
}
|
|
535
|
-
};
|
|
536
|
-
function resolveDiscordStartupAccountIds(cfg) {
|
|
537
|
-
const startupAccountIds = listEnabledDiscordAccounts(cfg).filter((candidate) => resolveConfiguredFromCredentialStatuses(candidate) ?? Boolean(normalizeOptionalString(candidate.token))).map((candidate) => candidate.accountId);
|
|
538
|
-
const defaultAccountId = resolveDefaultDiscordAccountId(cfg);
|
|
539
|
-
if (!startupAccountIds.includes(defaultAccountId)) return startupAccountIds;
|
|
540
|
-
return [defaultAccountId, ...startupAccountIds.filter((candidateId) => candidateId !== defaultAccountId)];
|
|
541
|
-
}
|
|
542
562
|
function resolveDiscordStartupDelayMs(cfg, accountId) {
|
|
543
|
-
const startupIndex =
|
|
563
|
+
const startupIndex = listDiscordStartupAccountIds(cfg).findIndex((candidateId) => candidateId === accountId);
|
|
544
564
|
return startupIndex <= 0 ? 0 : startupIndex * DISCORD_ACCOUNT_STARTUP_STAGGER_MS;
|
|
545
565
|
}
|
|
546
566
|
function formatDiscordIntents(intents) {
|
|
@@ -607,6 +627,7 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
607
627
|
"- Forms: add `components.modal` (title, fields). OpenClaw adds a trigger button and routes submissions as new messages."
|
|
608
628
|
] },
|
|
609
629
|
messaging: {
|
|
630
|
+
resolveConversationRouteOwner: inspectDiscordConversationRouteOwner,
|
|
610
631
|
targetPrefixes: ["discord"],
|
|
611
632
|
directTargetStyle: "user-prefixed",
|
|
612
633
|
targetIdComparison: "lowercase",
|
|
@@ -723,6 +744,7 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
723
744
|
},
|
|
724
745
|
conversationBindings: {
|
|
725
746
|
supportsCurrentConversationBinding: true,
|
|
747
|
+
bindingStore: "adapter",
|
|
726
748
|
defaultTopLevelPlacement,
|
|
727
749
|
createManager: async ({ cfg, accountId }) => (await loadDiscordThreadBindingsManagerModule()).createThreadBindingManager({
|
|
728
750
|
cfg,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-
|
|
4
|
-
import "./targets-
|
|
1
|
+
import { _ as parseDiscordTarget, v as resolveDiscordChannelId } from "./retry-DqHCW6PV.js";
|
|
2
|
+
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-Dk35LTf_.js";
|
|
3
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-BYamRVPN.js";
|
|
4
|
+
import "./targets-CQp53cGj.js";
|
|
5
5
|
import "./action-runtime-api.js";
|
|
6
|
-
import {
|
|
7
|
-
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-
|
|
8
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
6
|
+
import { h as discordInboundEventDelivery } from "./outbound-session-route-Bn4uXaoE.js";
|
|
7
|
+
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-wjv7yyAj.js";
|
|
8
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-DZewwLr1.js";
|
|
9
9
|
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-fmHl1HNd.js";
|
|
10
10
|
import { normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
|
-
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
12
11
|
import { adaptMessagePresentationForChannel, normalizeLegacyInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
12
|
+
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
13
13
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
14
|
-
import { readPositiveIntegerParam, readStringArrayParam, readStringParam as readStringParam$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
14
|
+
import { readPositiveIntegerParam as readPositiveIntegerParam$1, readStringArrayParam as readStringArrayParam$1, readStringParam as readStringParam$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
15
15
|
//#region extensions/discord/src/actions/handle-action.ts
|
|
16
16
|
const providerId = "discord";
|
|
17
17
|
function withCurrentSourceReplyRoute(result) {
|
|
@@ -45,6 +45,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
45
45
|
mediaAccess: ctx.mediaAccess,
|
|
46
46
|
mediaLocalRoots: ctx.mediaLocalRoots,
|
|
47
47
|
mediaReadFile: ctx.mediaReadFile,
|
|
48
|
+
...ctx.reply ? { reply: ctx.reply } : {},
|
|
48
49
|
...readPolicyOptions
|
|
49
50
|
};
|
|
50
51
|
const notifyVisibleOutbound = (result, to, fallbackSessionKey) => {
|
|
@@ -87,33 +88,33 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
87
88
|
const asVoice = readBooleanParam(params, "asVoice") === true;
|
|
88
89
|
const mediaUrl = readStringParam$1(params, "media", { trim: false }) ?? readStringParam$1(params, "path", { trim: false }) ?? readStringParam$1(params, "filePath", { trim: false });
|
|
89
90
|
const requestedContent = readStringParam$1(params, "message", { allowEmpty: true });
|
|
90
|
-
const
|
|
91
|
-
const
|
|
91
|
+
const explicitComponents = coerceDiscordComponentParam(params.components);
|
|
92
|
+
const presentation = explicitComponents == null ? normalizeMessagePresentation(params.presentation) : void 0;
|
|
93
|
+
const generatedPresentationComponents = buildDiscordPresentationComponents(presentation ? adaptMessagePresentationForChannel({
|
|
92
94
|
presentation,
|
|
93
95
|
capabilities: DISCORD_PRESENTATION_CAPABILITIES
|
|
94
|
-
}) : void 0;
|
|
95
|
-
const generatedPresentationComponents = buildDiscordPresentationComponents(adaptedPresentation);
|
|
96
|
+
}) : void 0);
|
|
96
97
|
const presentationComponents = generatedPresentationComponents && isDiscordComponentSpecWithinMessageLimit({
|
|
97
98
|
spec: generatedPresentationComponents,
|
|
98
99
|
fallbackText: requestedContent,
|
|
99
100
|
includesMedia: Boolean(mediaUrl)
|
|
100
101
|
}) ? generatedPresentationComponents : void 0;
|
|
101
102
|
const presentationFellBack = Boolean(generatedPresentationComponents && !presentationComponents);
|
|
102
|
-
const rawComponents = presentationFellBack ? void 0 :
|
|
103
|
+
const rawComponents = presentationFellBack ? void 0 : explicitComponents ?? presentationComponents ?? buildDiscordInteractiveComponents(normalizeLegacyInteractiveReply(params.interactive));
|
|
103
104
|
const hasComponents = Boolean(rawComponents) && (typeof rawComponents === "function" || typeof rawComponents === "object");
|
|
104
105
|
const components = hasComponents ? rawComponents : void 0;
|
|
106
|
+
const rawEmbeds = params.embeds;
|
|
107
|
+
const embeds = Array.isArray(rawEmbeds) ? rawEmbeds : void 0;
|
|
105
108
|
const content = readStringParam$1(params, "message", {
|
|
106
|
-
required: !asVoice && !hasComponents && !mediaUrl && !presentationFellBack,
|
|
109
|
+
required: !asVoice && !hasComponents && !embeds?.length && !mediaUrl && !presentationFellBack,
|
|
107
110
|
allowEmpty: true
|
|
108
111
|
});
|
|
109
|
-
const deliveryContent = presentationFellBack &&
|
|
112
|
+
const deliveryContent = presentationFellBack && presentation ? renderMessagePresentationFallbackText({
|
|
110
113
|
text: content,
|
|
111
|
-
presentation
|
|
114
|
+
presentation
|
|
112
115
|
}) : content;
|
|
113
116
|
const filename = readStringParam$1(params, "filename");
|
|
114
117
|
const replyTo = readStringParam$1(params, "replyTo");
|
|
115
|
-
const rawEmbeds = params.embeds;
|
|
116
|
-
const embeds = Array.isArray(rawEmbeds) ? rawEmbeds : void 0;
|
|
117
118
|
const silent = readBooleanParam(params, "silent") === true;
|
|
118
119
|
const suppressEmbeds = readBooleanParam(params, "suppressEmbeds");
|
|
119
120
|
const sessionKey = readStringParam$1(params, "__sessionKey");
|
|
@@ -142,8 +143,11 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
142
143
|
if (action === "upload-file") {
|
|
143
144
|
const to = readSendTarget();
|
|
144
145
|
const mediaUrl = readStringParam$1(params, "filePath", { trim: false }) ?? readStringParam$1(params, "path", { trim: false }) ?? readStringParam$1(params, "media", { trim: false });
|
|
145
|
-
if (!mediaUrl)
|
|
146
|
-
|
|
146
|
+
if (!mediaUrl) {
|
|
147
|
+
if (readStringParam$1(params, "buffer", { trim: false })) throw new Error("Use action: \"send\" for base64 buffer attachments; upload-file requires filePath, path, or media.");
|
|
148
|
+
throw new Error("upload-file requires filePath, path, or media.");
|
|
149
|
+
}
|
|
150
|
+
const content = readStringParam$1(params, "message", { allowEmpty: true }) ?? readStringParam$1(params, "content", { allowEmpty: true }) ?? readStringParam$1(params, "caption", { allowEmpty: true });
|
|
147
151
|
const filename = readStringParam$1(params, "filename");
|
|
148
152
|
const replyTo = readStringParam$1(params, "replyTo");
|
|
149
153
|
const silent = readBooleanParam(params, "silent") === true;
|
|
@@ -166,25 +170,6 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
166
170
|
notifyVisibleOutbound(result, to, sessionKey);
|
|
167
171
|
return withAdoptedThreadReplyRoute(result, to, sessionKey);
|
|
168
172
|
}
|
|
169
|
-
if (action === "poll") {
|
|
170
|
-
const to = readStringParam$1(params, "to", { required: true });
|
|
171
|
-
const question = readStringParam$1(params, "pollQuestion", { required: true });
|
|
172
|
-
const answers = readStringArrayParam(params, "pollOption", { required: true });
|
|
173
|
-
const allowMultiselect = readBooleanParam(params, "pollMulti");
|
|
174
|
-
const durationHours = readPositiveIntegerParam(params, "pollDurationHours");
|
|
175
|
-
const result = await handleDiscordAction({
|
|
176
|
-
action: "poll",
|
|
177
|
-
accountId: accountId ?? void 0,
|
|
178
|
-
to,
|
|
179
|
-
question,
|
|
180
|
-
answers,
|
|
181
|
-
allowMultiselect,
|
|
182
|
-
durationHours: durationHours ?? void 0,
|
|
183
|
-
content: readStringParam$1(params, "message")
|
|
184
|
-
}, cfg, actionOptions);
|
|
185
|
-
notifyVisibleOutbound(result, to);
|
|
186
|
-
return result;
|
|
187
|
-
}
|
|
188
173
|
if (action === "react") {
|
|
189
174
|
const messageId = normalizeOptionalStringifiedId(resolveReactionMessageId({
|
|
190
175
|
args: params,
|
|
@@ -204,7 +189,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
204
189
|
}
|
|
205
190
|
if (action === "reactions") {
|
|
206
191
|
const messageId = readStringParam$1(params, "messageId", { required: true });
|
|
207
|
-
const limit = readPositiveIntegerParam(params, "limit");
|
|
192
|
+
const limit = readPositiveIntegerParam$1(params, "limit");
|
|
208
193
|
return await handleDiscordAction({
|
|
209
194
|
action: "reactions",
|
|
210
195
|
accountId: accountId ?? void 0,
|
|
@@ -214,7 +199,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
214
199
|
}, cfg, actionOptions);
|
|
215
200
|
}
|
|
216
201
|
if (action === "read") {
|
|
217
|
-
const limit = readPositiveIntegerParam(params, "limit");
|
|
202
|
+
const limit = readPositiveIntegerParam$1(params, "limit");
|
|
218
203
|
return await handleDiscordAction({
|
|
219
204
|
action: "readMessages",
|
|
220
205
|
accountId: accountId ?? void 0,
|
|
@@ -264,7 +249,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
264
249
|
const messageId = readStringParam$1(params, "messageId");
|
|
265
250
|
const content = readStringParam$1(params, "message");
|
|
266
251
|
const autoArchiveMinutes = readDiscordAutoArchiveDurationParam(params, "autoArchiveMin");
|
|
267
|
-
const appliedTags = readStringArrayParam(params, "appliedTags");
|
|
252
|
+
const appliedTags = readStringArrayParam$1(params, "appliedTags");
|
|
268
253
|
const result = await handleDiscordAction({
|
|
269
254
|
action: "threadCreate",
|
|
270
255
|
accountId: accountId ?? void 0,
|
|
@@ -291,7 +276,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
291
276
|
}
|
|
292
277
|
if (action === "sticker") {
|
|
293
278
|
const to = readStringParam$1(params, "to", { required: true });
|
|
294
|
-
const stickerIds = readStringArrayParam(params, "stickerId", {
|
|
279
|
+
const stickerIds = readStringArrayParam$1(params, "stickerId", {
|
|
295
280
|
required: true,
|
|
296
281
|
label: "sticker-id"
|
|
297
282
|
}) ?? [];
|
|
@@ -300,7 +285,8 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
300
285
|
accountId: accountId ?? void 0,
|
|
301
286
|
to,
|
|
302
287
|
stickerIds,
|
|
303
|
-
content: readStringParam$1(params, "message")
|
|
288
|
+
content: readStringParam$1(params, "message"),
|
|
289
|
+
...readBooleanParam(params, "silent") === true ? { silent: true } : {}
|
|
304
290
|
}, cfg, actionOptions);
|
|
305
291
|
notifyVisibleOutbound(result, to);
|
|
306
292
|
return result;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DiscordChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as DiscordChannelConfigSchema } from "./config-schema-CxPqtVI1.js";
|
|
2
2
|
export { DiscordChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordPlugin } from "./channel-
|
|
1
|
+
import { t as discordPlugin } from "./channel-BsQUalPw.js";
|
|
2
2
|
export { discordPlugin };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ChannelType } from "discord-api-types/v10";
|
|
2
|
+
//#region extensions/discord/src/channel-type.ts
|
|
3
|
+
function isDiscordThreadChannelType(channelType) {
|
|
4
|
+
return channelType === ChannelType.AnnouncementThread || channelType === ChannelType.PublicThread || channelType === ChannelType.PrivateThread;
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { isDiscordThreadChannelType as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as inspectDiscordAccountTokenState } from "./account-inspect-
|
|
3
|
-
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-
|
|
4
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
5
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
1
|
+
import { h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-CfQ-vSyf.js";
|
|
2
|
+
import { n as inspectDiscordAccountTokenState } from "./account-inspect-BDfKyuvL.js";
|
|
3
|
+
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-Dii2HTn7.js";
|
|
4
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-D2yl_2CN.js";
|
|
5
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-BLxfqajZ.js";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|