@openclaw/discord 2026.8.1-beta.2 → 2026.9.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{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-q-9PaaHH.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-B7qhK3fR.js} +29 -106
- package/dist/{audit-Db-rlntl.js → audit-CBEv_ERu.js} +5 -5
- package/dist/{channel-CnnbJSt5.js → channel-Dx1tMTfx.js} +72 -50
- package/dist/{channel-actions.runtime-CLKrx6tr.js → channel-actions.runtime-CLWWu9nC.js} +28 -43
- 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-DOzXS2Pk.js} +5 -5
- package/dist/{outbound-session-route-DxLkrgKQ.js → components-B9V5o361.js} +8 -70
- package/dist/{config-schema-BgEskFAs.js → config-schema-BR13IAx6.js} +33 -7
- package/dist/conversation-binding-route-DJYrY2TQ.js +43 -0
- package/dist/{directory-config-BVX7Cflc.js → directory-config-BK6eqekJ.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-DGIGxpIo.js → directory-live-DSAJSrJk.js} +3 -3
- package/dist/{doctor-BzC-TLnB.js → doctor-Cm7Y1pJ2.js} +33 -12
- package/dist/doctor-contract-api.js +2 -2
- package/dist/{handle-action.guild-admin-BNVTUISF.js → handle-action.guild-admin-BdwCRHmm.js} +9 -5
- package/dist/index.js +3 -4
- package/dist/{message-handler-Unk_f10F.js → message-handler-BXpWZyni.js} +82 -6
- package/dist/{message-handler.preflight-C9zecxR9.js → message-handler.preflight-Ba5LAY_X.js} +38 -50
- package/dist/{message-handler.process-DWQ6UHHu.js → message-handler.process-3HEzmemS.js} +204 -234
- package/dist/{message-utils-BSCPVgy0.js → message-text-aiwO5R2F.js} +41 -40
- package/dist/{outbound-adapter-D9nRivT1.js → outbound-adapter-BE4jSq2d.js} +113 -88
- package/dist/{outbound-components-cTzwBJ60.js → outbound-components-oLpg8Qzb.js} +3 -3
- package/dist/outbound-session-route-Cg15ZFJd.js +625 -0
- package/dist/owner-access-UlYi9t0M.js +107 -0
- package/dist/{pluralkit-DdiJ9KMK.js → pluralkit-Tiyl70dx.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-B11xwilq.js} +720 -1325
- package/dist/{provider-session.runtime-BUEqD0rA.js → provider-session.runtime-B9xe-Qaf.js} +3 -3
- package/dist/provider.runtime-DiYaHvOz.js +2 -0
- package/dist/{realtime-session.runtime-C7wen-aF.js → realtime-session.runtime-CU8IQUS-.js} +97 -98
- package/dist/{resolve-allowlist-common-D04lpEzb.js → resolve-allowlist-common-BLoYaxEG.js} +2 -2
- package/dist/{resolve-channels-Dm7jEeg6.js → resolve-channels-C2sT_n67.js} +5 -4
- package/dist/{resolve-users-bktrCUUU.js → resolve-users-CzpjLwjy.js} +2 -2
- package/dist/{retry-CLpJcXXf.js → retry-Cv4jCU5Z.js} +111 -18
- package/dist/{runtime-DGsSyDTS.js → runtime-BHrTlFkf.js} +88 -85
- package/dist/{runtime-DoHjckYm.js → runtime-CY4PRMF-.js} +9 -10
- package/dist/runtime-api.js +19 -25
- package/dist/{sdk-runtime-QpY8PvCh.js → sdk-runtime-4geQHtXc.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-contract-api.js +1 -1
- package/dist/{security-audit.runtime-CPN0xFYz.js → security-audit.runtime-BVKF9VtY.js} +1 -1
- package/dist/{send-B7Q6Oc1I.js → send-C49MFF9j.js} +82 -19
- package/dist/{send.components-iJyFXw9L.js → send.components-DKKAw5VX.js} +21 -38
- package/dist/{send.outbound-DS5tHwfR.js → send.outbound-zam0TrZx.js} +77 -78
- package/dist/{send.shared-BmwFjW6T.js → send.shared-JjljcV4O.js} +135 -120
- 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-_5EcP4jW.js} +38 -14
- package/dist/subagent-hooks-DQzvOptn.js +49 -0
- package/dist/subagent-hooks-api.js +1 -6
- package/dist/{system-events-CTqDf6_s.js → system-events-C7yxaHWP.js} +2 -2
- package/dist/{target-resolver-maOKSqO0.js → target-resolver-vxIh6O3-.js} +3 -3
- package/dist/targets-CtTKvntJ.js +3 -0
- package/dist/{thread-bindings-3L8p82GV.js → thread-bindings-DW5F9vat.js} +28 -26
- package/dist/{thread-bindings.manager-DCIH6WDC.js → thread-bindings.manager-ByOtwjo_.js} +9 -12
- 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-agH1T_6s.js +478 -0
- package/dist/transcripts-source-BR11iHA4.js +265 -0
- package/dist/transcripts-source-api.js +7 -2
- package/dist/{typing-CS-nNVoe.js → typing-Dc_YMY2e.js} +1 -1
- package/dist/{voice-runtime-BEdqNcST.js → voice-runtime-DIeaa8fJ.js} +230 -148
- 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 +12 -6
- package/package.json +8 -10
- 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
- package/dist/{security-audit-jGnJF__m.js → security-audit-BfJhAXZp.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-Cv4jCU5Z.js";
|
|
2
|
+
import { s as buildExecApprovalCustomId } from "./components-B9V5o361.js";
|
|
3
|
+
import { N as createDiscordClient, O as createDiscordMessageNonce } from "./send.shared-JjljcV4O.js";
|
|
4
|
+
import { S as isDiscordExecApprovalClientEnabled, n as DISCORD_APPROVAL_ALLOWED_MENTIONS, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-Cg15ZFJd.js";
|
|
5
|
+
import { a as shouldHandleDiscordApprovalRequest } from "./channel-Dx1tMTfx.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-Cv4jCU5Z.js";
|
|
2
|
+
import { x as fetchChannelPermissionsDiscord } from "./send.shared-JjljcV4O.js";
|
|
3
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BDfKyuvL.js";
|
|
4
|
+
import "./send-C49MFF9j.js";
|
|
5
|
+
import { _ as auditDiscordChannelPermissionsWithFetcher, v as collectDiscordAuditChannelIdsForAccount } from "./outbound-session-route-Cg15ZFJd.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-Cv4jCU5Z.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-Cg15ZFJd.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-_5EcP4jW.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-DJYrY2TQ.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-BE4jSq2d.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-B7qhK3fR.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-BK6eqekJ.js").then((n) => n.t));
|
|
303
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-C2sT_n67.js").then((n) => n.n));
|
|
304
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-CzpjLwjy.js").then((n) => n.n));
|
|
305
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-ByOtwjo_.js").then((n) => n.i));
|
|
306
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-vxIh6O3-.js").then((n) => n.r));
|
|
307
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-DiYaHvOz.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-CBEv_ERu.js").then((n) => n.n));
|
|
316
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-C49MFF9j.js").then((n) => n.t));
|
|
317
|
+
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-DSAJSrJk.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-Cv4jCU5Z.js";
|
|
2
|
+
import { i as buildDiscordPresentationComponents, r as buildDiscordInteractiveComponents } from "./components-B9V5o361.js";
|
|
3
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-BHrTlFkf.js";
|
|
4
|
+
import "./targets-CtTKvntJ.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-Cg15ZFJd.js";
|
|
7
|
+
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-oLpg8Qzb.js";
|
|
8
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-BdwCRHmm.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) => {
|
|
@@ -88,11 +89,10 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
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
91
|
const presentation = params.components == null ? normalizeMessagePresentation(params.presentation) : void 0;
|
|
91
|
-
const
|
|
92
|
+
const generatedPresentationComponents = buildDiscordPresentationComponents(presentation ? adaptMessagePresentationForChannel({
|
|
92
93
|
presentation,
|
|
93
94
|
capabilities: DISCORD_PRESENTATION_CAPABILITIES
|
|
94
|
-
}) : void 0;
|
|
95
|
-
const generatedPresentationComponents = buildDiscordPresentationComponents(adaptedPresentation);
|
|
95
|
+
}) : void 0);
|
|
96
96
|
const presentationComponents = generatedPresentationComponents && isDiscordComponentSpecWithinMessageLimit({
|
|
97
97
|
spec: generatedPresentationComponents,
|
|
98
98
|
fallbackText: requestedContent,
|
|
@@ -102,18 +102,18 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
102
102
|
const rawComponents = presentationFellBack ? void 0 : params.components ?? presentationComponents ?? buildDiscordInteractiveComponents(normalizeLegacyInteractiveReply(params.interactive));
|
|
103
103
|
const hasComponents = Boolean(rawComponents) && (typeof rawComponents === "function" || typeof rawComponents === "object");
|
|
104
104
|
const components = hasComponents ? rawComponents : void 0;
|
|
105
|
+
const rawEmbeds = params.embeds;
|
|
106
|
+
const embeds = Array.isArray(rawEmbeds) ? rawEmbeds : void 0;
|
|
105
107
|
const content = readStringParam$1(params, "message", {
|
|
106
|
-
required: !asVoice && !hasComponents && !mediaUrl && !presentationFellBack,
|
|
108
|
+
required: !asVoice && !hasComponents && !embeds?.length && !mediaUrl && !presentationFellBack,
|
|
107
109
|
allowEmpty: true
|
|
108
110
|
});
|
|
109
|
-
const deliveryContent = presentationFellBack &&
|
|
111
|
+
const deliveryContent = presentationFellBack && presentation ? renderMessagePresentationFallbackText({
|
|
110
112
|
text: content,
|
|
111
|
-
presentation
|
|
113
|
+
presentation
|
|
112
114
|
}) : content;
|
|
113
115
|
const filename = readStringParam$1(params, "filename");
|
|
114
116
|
const replyTo = readStringParam$1(params, "replyTo");
|
|
115
|
-
const rawEmbeds = params.embeds;
|
|
116
|
-
const embeds = Array.isArray(rawEmbeds) ? rawEmbeds : void 0;
|
|
117
117
|
const silent = readBooleanParam(params, "silent") === true;
|
|
118
118
|
const suppressEmbeds = readBooleanParam(params, "suppressEmbeds");
|
|
119
119
|
const sessionKey = readStringParam$1(params, "__sessionKey");
|
|
@@ -142,8 +142,11 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
142
142
|
if (action === "upload-file") {
|
|
143
143
|
const to = readSendTarget();
|
|
144
144
|
const mediaUrl = readStringParam$1(params, "filePath", { trim: false }) ?? readStringParam$1(params, "path", { trim: false }) ?? readStringParam$1(params, "media", { trim: false });
|
|
145
|
-
if (!mediaUrl)
|
|
146
|
-
|
|
145
|
+
if (!mediaUrl) {
|
|
146
|
+
if (readStringParam$1(params, "buffer", { trim: false })) throw new Error("Use action: \"send\" for base64 buffer attachments; upload-file requires filePath, path, or media.");
|
|
147
|
+
throw new Error("upload-file requires filePath, path, or media.");
|
|
148
|
+
}
|
|
149
|
+
const content = readStringParam$1(params, "message", { allowEmpty: true }) ?? readStringParam$1(params, "content", { allowEmpty: true }) ?? readStringParam$1(params, "caption", { allowEmpty: true });
|
|
147
150
|
const filename = readStringParam$1(params, "filename");
|
|
148
151
|
const replyTo = readStringParam$1(params, "replyTo");
|
|
149
152
|
const silent = readBooleanParam(params, "silent") === true;
|
|
@@ -166,25 +169,6 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
166
169
|
notifyVisibleOutbound(result, to, sessionKey);
|
|
167
170
|
return withAdoptedThreadReplyRoute(result, to, sessionKey);
|
|
168
171
|
}
|
|
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
172
|
if (action === "react") {
|
|
189
173
|
const messageId = normalizeOptionalStringifiedId(resolveReactionMessageId({
|
|
190
174
|
args: params,
|
|
@@ -204,7 +188,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
204
188
|
}
|
|
205
189
|
if (action === "reactions") {
|
|
206
190
|
const messageId = readStringParam$1(params, "messageId", { required: true });
|
|
207
|
-
const limit = readPositiveIntegerParam(params, "limit");
|
|
191
|
+
const limit = readPositiveIntegerParam$1(params, "limit");
|
|
208
192
|
return await handleDiscordAction({
|
|
209
193
|
action: "reactions",
|
|
210
194
|
accountId: accountId ?? void 0,
|
|
@@ -214,7 +198,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
214
198
|
}, cfg, actionOptions);
|
|
215
199
|
}
|
|
216
200
|
if (action === "read") {
|
|
217
|
-
const limit = readPositiveIntegerParam(params, "limit");
|
|
201
|
+
const limit = readPositiveIntegerParam$1(params, "limit");
|
|
218
202
|
return await handleDiscordAction({
|
|
219
203
|
action: "readMessages",
|
|
220
204
|
accountId: accountId ?? void 0,
|
|
@@ -264,7 +248,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
264
248
|
const messageId = readStringParam$1(params, "messageId");
|
|
265
249
|
const content = readStringParam$1(params, "message");
|
|
266
250
|
const autoArchiveMinutes = readDiscordAutoArchiveDurationParam(params, "autoArchiveMin");
|
|
267
|
-
const appliedTags = readStringArrayParam(params, "appliedTags");
|
|
251
|
+
const appliedTags = readStringArrayParam$1(params, "appliedTags");
|
|
268
252
|
const result = await handleDiscordAction({
|
|
269
253
|
action: "threadCreate",
|
|
270
254
|
accountId: accountId ?? void 0,
|
|
@@ -291,7 +275,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
291
275
|
}
|
|
292
276
|
if (action === "sticker") {
|
|
293
277
|
const to = readStringParam$1(params, "to", { required: true });
|
|
294
|
-
const stickerIds = readStringArrayParam(params, "stickerId", {
|
|
278
|
+
const stickerIds = readStringArrayParam$1(params, "stickerId", {
|
|
295
279
|
required: true,
|
|
296
280
|
label: "sticker-id"
|
|
297
281
|
}) ?? [];
|
|
@@ -300,7 +284,8 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
300
284
|
accountId: accountId ?? void 0,
|
|
301
285
|
to,
|
|
302
286
|
stickerIds,
|
|
303
|
-
content: readStringParam$1(params, "message")
|
|
287
|
+
content: readStringParam$1(params, "message"),
|
|
288
|
+
...readBooleanParam(params, "silent") === true ? { silent: true } : {}
|
|
304
289
|
}, cfg, actionOptions);
|
|
305
290
|
notifyVisibleOutbound(result, to);
|
|
306
291
|
return result;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DiscordChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as DiscordChannelConfigSchema } from "./config-schema-BR13IAx6.js";
|
|
2
2
|
export { DiscordChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordPlugin } from "./channel-
|
|
1
|
+
import { t as discordPlugin } from "./channel-Dx1tMTfx.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-_5EcP4jW.js";
|
|
4
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-C2sT_n67.js";
|
|
5
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-CzpjLwjy.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";
|