@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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-CfQ-vSyf.js";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
1
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BDfKyuvL.js";
|
|
2
2
|
//#region extensions/discord/account-inspect-api.ts
|
|
3
3
|
function inspectDiscordReadOnlyAccount(cfg, accountId) {
|
|
4
4
|
return inspectDiscordAccount({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createAccountActionGate, createAccountListHelpers } from "openclaw/plugin-sdk/account-helpers";
|
|
2
2
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
3
|
import { mapAllowFromEntries, normalizeChannelDmPolicy } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
4
|
+
import { resolveConfiguredFromCredentialStatuses } from "openclaw/plugin-sdk/channel-status";
|
|
4
5
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, normalizeAccountId as normalizeAccountId$1, resolveAccountEntry } from "openclaw/plugin-sdk/routing";
|
|
5
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
7
|
import { getRuntimeConfigSnapshot, getRuntimeConfigSourceSnapshot, selectApplicableRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
@@ -13,6 +14,32 @@ function selectDiscordRuntimeConfig(inputConfig) {
|
|
|
13
14
|
runtimeSourceConfig: getRuntimeConfigSourceSnapshot()
|
|
14
15
|
}) ?? inputConfig;
|
|
15
16
|
}
|
|
17
|
+
function withSourceActivities(runtimeAccount, sourceAccount) {
|
|
18
|
+
const { activities: _runtimeActivities, ...runtimeRest } = runtimeAccount ?? {};
|
|
19
|
+
return {
|
|
20
|
+
...runtimeRest,
|
|
21
|
+
...sourceAccount?.activities ? { activities: sourceAccount.activities } : {}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Restores plugin-owned sensitive Activity config onto the resolved runtime shape. */
|
|
25
|
+
function selectDiscordActivitiesRuntimeConfig(inputConfig) {
|
|
26
|
+
const runtimeConfig = selectDiscordRuntimeConfig(inputConfig);
|
|
27
|
+
const sourceDiscord = getRuntimeConfigSourceSnapshot()?.channels?.discord;
|
|
28
|
+
if (!sourceDiscord) return runtimeConfig;
|
|
29
|
+
const runtimeDiscord = runtimeConfig.channels?.discord;
|
|
30
|
+
const accountIds = /* @__PURE__ */ new Set([...Object.keys(runtimeDiscord?.accounts ?? {}), ...Object.keys(sourceDiscord.accounts ?? {})]);
|
|
31
|
+
const accounts = Object.fromEntries([...accountIds].map((accountId) => [accountId, withSourceActivities(runtimeDiscord?.accounts?.[accountId], sourceDiscord.accounts?.[accountId])]));
|
|
32
|
+
return {
|
|
33
|
+
...runtimeConfig,
|
|
34
|
+
channels: {
|
|
35
|
+
...runtimeConfig.channels,
|
|
36
|
+
discord: {
|
|
37
|
+
...withSourceActivities(runtimeDiscord, sourceDiscord),
|
|
38
|
+
...accountIds.size > 0 ? { accounts } : {}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
16
43
|
//#endregion
|
|
17
44
|
//#region extensions/discord/src/token.ts
|
|
18
45
|
function stripDiscordBotPrefix(token) {
|
|
@@ -215,5 +242,11 @@ function listEnabledDiscordAccounts(cfg) {
|
|
|
215
242
|
accountId
|
|
216
243
|
})).filter((account) => isDiscordAccountEnabledForRuntime(account, cfg));
|
|
217
244
|
}
|
|
245
|
+
function listDiscordStartupAccountIds(cfg) {
|
|
246
|
+
const startupAccountIds = listEnabledDiscordAccounts(cfg).filter((candidate) => resolveConfiguredFromCredentialStatuses(candidate) ?? Boolean(normalizeOptionalString(candidate.token))).map((candidate) => candidate.accountId);
|
|
247
|
+
const defaultAccountId = resolveDefaultDiscordAccountId(cfg);
|
|
248
|
+
if (!startupAccountIds.includes(defaultAccountId)) return startupAccountIds;
|
|
249
|
+
return [defaultAccountId, ...startupAccountIds.filter((candidateId) => candidateId !== defaultAccountId)];
|
|
250
|
+
}
|
|
218
251
|
//#endregion
|
|
219
|
-
export {
|
|
252
|
+
export { listEnabledDiscordAccounts as a, resolveDiscordAccount as c, resolveDiscordAccountDisabledReason as d, resolveDiscordAccountDmPolicy as f, selectDiscordActivitiesRuntimeConfig as g, resolveDiscordToken as h, listDiscordStartupAccountIds as i, resolveDiscordAccountAllowFrom as l, normalizeDiscordToken as m, isDiscordAccountEnabledForRuntime as n, mergeDiscordAccountConfig as o, resolveDiscordMaxLinesPerMessage as p, listDiscordAccountIds as r, resolveDefaultDiscordAccountId as s, createDiscordActionGate as t, resolveDiscordAccountConfig as u };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { t as handleDiscordAction } from "./runtime-BHrTlFkf.js";
|
|
2
2
|
export { handleDiscordAction };
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { r as
|
|
1
|
+
import { v as resolveDiscordChannelId$1 } from "./retry-Cv4jCU5Z.js";
|
|
2
|
+
import { i as buildDiscordPresentationComponents, x as parseDiscordActivityCustomId } from "./components-B9V5o361.js";
|
|
3
|
+
import { c as resolveDiscordAccount } from "./accounts-CfQ-vSyf.js";
|
|
4
|
+
import { r as sendDiscordComponentMessage } from "./send.components-DKKAw5VX.js";
|
|
5
|
+
import { r as setDiscordActivitiesRuntime, t as DiscordActivitiesRuntime } from "./runtime-CY4PRMF-.js";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
import { logError } from "openclaw/plugin-sdk/logging-core";
|
|
8
8
|
import { resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
|
|
9
9
|
import { WEBHOOK_BODY_READ_DEFAULTS, readJsonBodyWithLimit } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
10
10
|
import { randomBytes } from "node:crypto";
|
|
11
|
-
import { Type } from "typebox";
|
|
12
11
|
import { readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
|
|
13
12
|
import { fetchWithSsrFGuard as fetchWithSsrFGuard$1 } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
14
|
-
import { jsonResult, readStringParam } from "openclaw/plugin-sdk/channel-actions";
|
|
15
|
-
import { escapeHtml } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
16
|
-
import { WidgetHtmlInputError, assertWidgetHtmlSize, isCompleteHtmlDocument } from "openclaw/plugin-sdk/widget-html";
|
|
17
13
|
//#region extensions/discord/src/activities/discord-api.ts
|
|
18
14
|
const DISCORD_TOKEN_URL = "https://discord.com/api/oauth2/token";
|
|
19
15
|
const DISCORD_USER_URL = "https://discord.com/api/v10/users/@me";
|
|
@@ -440,6 +436,7 @@ function createDiscordActivityHttpHandler(deps) {
|
|
|
440
436
|
return { async handleHttpRequest(req, res) {
|
|
441
437
|
const url = new URL(req.url ?? "/", "http://localhost");
|
|
442
438
|
if (url.pathname !== "/discord/activity" && !url.pathname.startsWith(`/discord/activity/`)) return false;
|
|
439
|
+
if (!deps.runtime.hasEnabledAccounts()) return false;
|
|
443
440
|
const relative = url.pathname.slice(17) || "/";
|
|
444
441
|
if (req.method === "GET" && (relative === "/" || relative === "/index.html")) return respond(res, 200, DISCORD_ACTIVITY_SHELL_HTML, "text/html; charset=utf-8", { "Content-Security-Policy": DISCORD_ACTIVITY_SHELL_CSP });
|
|
445
442
|
if (req.method === "GET" && relative === "/shell.js") return respond(res, 200, DISCORD_ACTIVITY_SHELL_JS, "text/javascript; charset=utf-8");
|
|
@@ -468,6 +465,133 @@ function createDiscordActivityHttpHandler(deps) {
|
|
|
468
465
|
} };
|
|
469
466
|
}
|
|
470
467
|
//#endregion
|
|
468
|
+
//#region extensions/discord/src/activities/presenter.ts
|
|
469
|
+
const DISCORD_WIDGET_HTML_MAX_BYTES = 48 * 1024;
|
|
470
|
+
function resolveDiscordChannelId(context) {
|
|
471
|
+
const raw = context.nativeChannelId?.trim() || context.currentMessagingTarget?.trim() || context.currentChannelId?.trim() || context.deliveryContext?.to?.trim();
|
|
472
|
+
if (!raw) return;
|
|
473
|
+
try {
|
|
474
|
+
return resolveDiscordChannelId$1(raw);
|
|
475
|
+
} catch {
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
function resolveDiscordPresentationRoute(context, runtime) {
|
|
480
|
+
if (context.messageChannel !== "discord") return;
|
|
481
|
+
const cfg = runtime.currentConfig();
|
|
482
|
+
const account = resolveDiscordAccount({
|
|
483
|
+
cfg,
|
|
484
|
+
accountId: context.accountId ?? context.deliveryContext?.accountId
|
|
485
|
+
});
|
|
486
|
+
const channelId = resolveDiscordChannelId(context);
|
|
487
|
+
const activityAccount = runtime.resolveAccount(account.accountId, cfg);
|
|
488
|
+
if (!channelId || !activityAccount) return;
|
|
489
|
+
return {
|
|
490
|
+
account: activityAccount,
|
|
491
|
+
cfg,
|
|
492
|
+
channelId
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
/** Presents a canonical core widget document in the active Discord channel. */
|
|
496
|
+
function createDiscordWidgetPresenter(runtime, deps = {}) {
|
|
497
|
+
return {
|
|
498
|
+
target: "current_channel",
|
|
499
|
+
description: "Post an Activity launch button in the current Discord channel",
|
|
500
|
+
capabilities: {
|
|
501
|
+
sourceKinds: ["html"],
|
|
502
|
+
maxSourceBytes: DISCORD_WIDGET_HTML_MAX_BYTES
|
|
503
|
+
},
|
|
504
|
+
match: (context) => resolveDiscordPresentationRoute(context, runtime) !== void 0,
|
|
505
|
+
async availability(context) {
|
|
506
|
+
return resolveDiscordPresentationRoute(context, runtime) ? {
|
|
507
|
+
ok: true,
|
|
508
|
+
value: { available: true }
|
|
509
|
+
} : {
|
|
510
|
+
ok: false,
|
|
511
|
+
error: {
|
|
512
|
+
code: "unavailable",
|
|
513
|
+
message: "Discord Activities are unavailable for the current channel and account."
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
},
|
|
517
|
+
async present({ context, document, title }) {
|
|
518
|
+
const route = resolveDiscordPresentationRoute(context, runtime);
|
|
519
|
+
if (!route) return {
|
|
520
|
+
ok: false,
|
|
521
|
+
error: {
|
|
522
|
+
code: "unavailable",
|
|
523
|
+
message: "Discord Activities are unavailable for the current channel and account."
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
if (title.length > 80) return {
|
|
527
|
+
ok: false,
|
|
528
|
+
error: {
|
|
529
|
+
code: "presentation_error",
|
|
530
|
+
message: "title must be 80 characters or fewer"
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
const widgetId = await runtime.store.createWidget({
|
|
534
|
+
html: document.html,
|
|
535
|
+
title,
|
|
536
|
+
channelId: route.channelId,
|
|
537
|
+
accountId: route.account.accountId,
|
|
538
|
+
createdAt: (deps.now ?? Date.now)()
|
|
539
|
+
});
|
|
540
|
+
let result;
|
|
541
|
+
let deliveredResult;
|
|
542
|
+
let deliveryRecord;
|
|
543
|
+
let deliveryRecordError;
|
|
544
|
+
const recordDelivery = async (deliveryResult) => {
|
|
545
|
+
deliveredResult = deliveryResult;
|
|
546
|
+
deliveryRecord ??= runtime.store.markWidgetDelivered(widgetId, deliveryResult.messageId);
|
|
547
|
+
try {
|
|
548
|
+
await deliveryRecord;
|
|
549
|
+
} catch (error) {
|
|
550
|
+
deliveryRecordError ??= new Error("Discord widget was delivered, but its delivery state could not be saved", { cause: error });
|
|
551
|
+
throw deliveryRecordError;
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
try {
|
|
555
|
+
const components = buildDiscordPresentationComponents({ blocks: [{
|
|
556
|
+
type: "buttons",
|
|
557
|
+
buttons: [{
|
|
558
|
+
label: "Open widget",
|
|
559
|
+
action: {
|
|
560
|
+
type: "web-app",
|
|
561
|
+
widgetId
|
|
562
|
+
}
|
|
563
|
+
}]
|
|
564
|
+
}] });
|
|
565
|
+
if (!components) throw new Error("Discord widget launch button could not be rendered");
|
|
566
|
+
result = await (deps.sendComponentMessage ?? sendDiscordComponentMessage)(`channel:${route.channelId}`, {
|
|
567
|
+
...components,
|
|
568
|
+
text: title
|
|
569
|
+
}, {
|
|
570
|
+
cfg: route.cfg,
|
|
571
|
+
accountId: route.account.accountId,
|
|
572
|
+
allowedMentions: { parse: [] },
|
|
573
|
+
onDeliveryResult: recordDelivery
|
|
574
|
+
});
|
|
575
|
+
await recordDelivery(result);
|
|
576
|
+
} catch (error) {
|
|
577
|
+
if (deliveryRecordError) throw deliveryRecordError;
|
|
578
|
+
if (!deliveredResult) {
|
|
579
|
+
await runtime.store.deleteWidget(widgetId);
|
|
580
|
+
throw error;
|
|
581
|
+
}
|
|
582
|
+
result = deliveredResult;
|
|
583
|
+
}
|
|
584
|
+
return {
|
|
585
|
+
ok: true,
|
|
586
|
+
value: {
|
|
587
|
+
kind: "message",
|
|
588
|
+
receipt: result.receipt
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
//#endregion
|
|
471
595
|
//#region extensions/discord/src/activities/store.ts
|
|
472
596
|
const DAY_MS = 1440 * 60 * 1e3;
|
|
473
597
|
const DISCORD_EPOCH_MS = 14200704e5;
|
|
@@ -595,173 +719,9 @@ var DiscordActivityStore = class {
|
|
|
595
719
|
}
|
|
596
720
|
};
|
|
597
721
|
//#endregion
|
|
598
|
-
//#region extensions/discord/src/activities/tool.ts
|
|
599
|
-
const DISCORD_WIDGET_HTML_MAX_BYTES = 48 * 1024;
|
|
600
|
-
const DiscordWidgetParameters = Type.Object({
|
|
601
|
-
html: Type.String({ description: "Self-contained HTML document or body fragment" }),
|
|
602
|
-
title: Type.String({
|
|
603
|
-
minLength: 1,
|
|
604
|
-
maxLength: 80
|
|
605
|
-
}),
|
|
606
|
-
button_label: Type.Optional(Type.String({
|
|
607
|
-
minLength: 1,
|
|
608
|
-
maxLength: 80
|
|
609
|
-
}))
|
|
610
|
-
});
|
|
611
|
-
const ShowWidgetParameters = Type.Object({
|
|
612
|
-
title: Type.String({
|
|
613
|
-
minLength: 1,
|
|
614
|
-
maxLength: 80
|
|
615
|
-
}),
|
|
616
|
-
widget_code: Type.String({ description: "Self-contained HTML document or body fragment" }),
|
|
617
|
-
button_label: Type.Optional(Type.String({
|
|
618
|
-
minLength: 1,
|
|
619
|
-
maxLength: 80
|
|
620
|
-
}))
|
|
621
|
-
});
|
|
622
|
-
function currentConfig(context, runtime) {
|
|
623
|
-
return context.getRuntimeConfig?.() ?? context.runtimeConfig ?? context.config ?? runtime.currentConfig();
|
|
624
|
-
}
|
|
625
|
-
function resolveDiscordChannelId(context) {
|
|
626
|
-
const raw = context.nativeChannelId?.trim() || context.deliveryContext?.to?.trim();
|
|
627
|
-
if (!raw) return;
|
|
628
|
-
try {
|
|
629
|
-
return resolveDiscordChannelId$1(raw);
|
|
630
|
-
} catch {
|
|
631
|
-
return;
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
function buildDiscordWidgetDocument(title, html) {
|
|
635
|
-
if (isCompleteHtmlDocument(html)) return html;
|
|
636
|
-
return `<!doctype html>
|
|
637
|
-
<html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${escapeHtml(title)}</title>
|
|
638
|
-
<style>:root{color-scheme:dark;background:#111214;color:#dbdee1;font:14px system-ui,sans-serif}*{box-sizing:border-box}html,body{margin:0;min-height:100%}body{padding:16px}</style></head><body>${html}</body></html>`;
|
|
639
|
-
}
|
|
640
|
-
const DISCORD_WIDGET_VARIANT = {
|
|
641
|
-
name: "discord_widget",
|
|
642
|
-
label: "Discord Widget",
|
|
643
|
-
description: "Deprecated: use show_widget. Show an interactive, self-contained HTML widget to the user in Discord.",
|
|
644
|
-
htmlParam: "html",
|
|
645
|
-
parameters: DiscordWidgetParameters
|
|
646
|
-
};
|
|
647
|
-
const SHOW_WIDGET_VARIANT = {
|
|
648
|
-
name: "show_widget",
|
|
649
|
-
label: "Show Widget",
|
|
650
|
-
description: "Show an interactive, self-contained HTML widget to the user on their current surface. In Discord, posts an Activity launch button.",
|
|
651
|
-
htmlParam: "widget_code",
|
|
652
|
-
parameters: ShowWidgetParameters
|
|
653
|
-
};
|
|
654
|
-
function createDiscordWidgetToolVariant(context, deps, variant) {
|
|
655
|
-
if (context.messageChannel !== "discord") return null;
|
|
656
|
-
const cfg = currentConfig(context, deps.runtime);
|
|
657
|
-
const account = resolveDiscordAccount({
|
|
658
|
-
cfg,
|
|
659
|
-
accountId: context.agentAccountId ?? context.deliveryContext?.accountId
|
|
660
|
-
});
|
|
661
|
-
if (!deps.runtime.isAccountEnabled(account.accountId, cfg)) return null;
|
|
662
|
-
return {
|
|
663
|
-
label: variant.label,
|
|
664
|
-
name: variant.name,
|
|
665
|
-
description: variant.description,
|
|
666
|
-
parameters: variant.parameters,
|
|
667
|
-
execute: async (_toolCallId, rawParams) => {
|
|
668
|
-
const params = rawParams;
|
|
669
|
-
const html = readStringParam(params, variant.htmlParam, {
|
|
670
|
-
required: true,
|
|
671
|
-
trim: false
|
|
672
|
-
});
|
|
673
|
-
const title = readStringParam(params, "title", { required: true });
|
|
674
|
-
const buttonLabel = readStringParam(params, "button_label") || "Open widget";
|
|
675
|
-
if (!html.trim()) throw new WidgetHtmlInputError(`${variant.htmlParam} is required`);
|
|
676
|
-
assertWidgetHtmlSize(html, DISCORD_WIDGET_HTML_MAX_BYTES, { inputName: variant.htmlParam });
|
|
677
|
-
if (title.length > 80) throw new WidgetHtmlInputError("title must be 80 characters or fewer");
|
|
678
|
-
if (!buttonLabel.trim() || buttonLabel.length > 80) throw new WidgetHtmlInputError("button_label must be 1 to 80 characters");
|
|
679
|
-
const channelId = resolveDiscordChannelId(context);
|
|
680
|
-
if (!channelId) throw new WidgetHtmlInputError(`${variant.name} requires a concrete Discord channel in the current session`);
|
|
681
|
-
const widgetId = await deps.runtime.store.createWidget({
|
|
682
|
-
html: buildDiscordWidgetDocument(title, html),
|
|
683
|
-
title,
|
|
684
|
-
channelId,
|
|
685
|
-
accountId: account.accountId,
|
|
686
|
-
createdAt: (deps.now ?? Date.now)()
|
|
687
|
-
});
|
|
688
|
-
let result;
|
|
689
|
-
let deliveredResult;
|
|
690
|
-
let deliveryRecord;
|
|
691
|
-
let deliveryRecordError;
|
|
692
|
-
const recordDelivery = async (deliveryResult) => {
|
|
693
|
-
deliveredResult = deliveryResult;
|
|
694
|
-
deliveryRecord ??= deps.runtime.store.markWidgetDelivered(widgetId, deliveryResult.messageId);
|
|
695
|
-
try {
|
|
696
|
-
await deliveryRecord;
|
|
697
|
-
} catch (error) {
|
|
698
|
-
deliveryRecordError ??= new Error("Discord widget was delivered, but its delivery state could not be saved", { cause: error });
|
|
699
|
-
throw deliveryRecordError;
|
|
700
|
-
}
|
|
701
|
-
};
|
|
702
|
-
try {
|
|
703
|
-
const components = buildDiscordPresentationComponents({ blocks: [{
|
|
704
|
-
type: "buttons",
|
|
705
|
-
buttons: [{
|
|
706
|
-
label: buttonLabel.trim(),
|
|
707
|
-
action: {
|
|
708
|
-
type: "web-app",
|
|
709
|
-
widgetId
|
|
710
|
-
}
|
|
711
|
-
}]
|
|
712
|
-
}] });
|
|
713
|
-
if (!components) throw new Error("Discord widget launch button could not be rendered");
|
|
714
|
-
result = await (deps.sendComponentMessage ?? sendDiscordComponentMessage)(`channel:${channelId}`, {
|
|
715
|
-
...components,
|
|
716
|
-
text: title
|
|
717
|
-
}, {
|
|
718
|
-
cfg,
|
|
719
|
-
accountId: account.accountId,
|
|
720
|
-
allowedMentions: { parse: [] },
|
|
721
|
-
onDeliveryResult: recordDelivery
|
|
722
|
-
});
|
|
723
|
-
await recordDelivery(result);
|
|
724
|
-
} catch (error) {
|
|
725
|
-
if (deliveryRecordError) throw deliveryRecordError;
|
|
726
|
-
if (!deliveredResult) {
|
|
727
|
-
await deps.runtime.store.deleteWidget(widgetId);
|
|
728
|
-
throw error;
|
|
729
|
-
}
|
|
730
|
-
result = deliveredResult;
|
|
731
|
-
}
|
|
732
|
-
return jsonResult({
|
|
733
|
-
widgetId,
|
|
734
|
-
messageId: result.messageId,
|
|
735
|
-
channelId: result.channelId
|
|
736
|
-
});
|
|
737
|
-
}
|
|
738
|
-
};
|
|
739
|
-
}
|
|
740
|
-
function createDiscordWidgetTool(context, deps) {
|
|
741
|
-
return createDiscordWidgetToolVariant(context, deps, DISCORD_WIDGET_VARIANT);
|
|
742
|
-
}
|
|
743
|
-
function createDiscordShowWidgetTool(context, deps) {
|
|
744
|
-
return createDiscordWidgetToolVariant(context, deps, SHOW_WIDGET_VARIANT);
|
|
745
|
-
}
|
|
746
|
-
//#endregion
|
|
747
722
|
//#region extensions/discord/src/activities/register.ts
|
|
748
723
|
function registerDiscordActivities$1(api) {
|
|
749
724
|
setDiscordActivitiesRuntime(void 0);
|
|
750
|
-
const enabledAccountIds = [];
|
|
751
|
-
for (const accountId of listDiscordAccountIds(api.config)) {
|
|
752
|
-
const account = resolveDiscordAccount({
|
|
753
|
-
cfg: api.config,
|
|
754
|
-
accountId
|
|
755
|
-
});
|
|
756
|
-
if (!isDiscordAccountEnabledForRuntime(account, api.config)) continue;
|
|
757
|
-
const resolution = resolveDiscordActivitiesConfig(account.config);
|
|
758
|
-
if (resolution.enabled) {
|
|
759
|
-
enabledAccountIds.push(account.accountId);
|
|
760
|
-
continue;
|
|
761
|
-
}
|
|
762
|
-
if (resolution.reason === "missing-client-secret") api.logger.warn(`[discord] activities configured for account ${account.accountId}, but no client secret resolved; feature disabled`);
|
|
763
|
-
}
|
|
764
|
-
if (enabledAccountIds.length === 0) return;
|
|
765
725
|
const runtime = new DiscordActivitiesRuntime(new DiscordActivityStore(openDiscordActivityStores((options) => api.runtime.state.openKeyedStore(options))), api.config, api.runtime.config?.current ? () => api.runtime.config.current() : void 0);
|
|
766
726
|
setDiscordActivitiesRuntime(runtime);
|
|
767
727
|
const http = createDiscordActivityHttpHandler({
|
|
@@ -774,8 +734,7 @@ function registerDiscordActivities$1(api) {
|
|
|
774
734
|
match: "prefix",
|
|
775
735
|
handler: async (req, res) => await http.handleHttpRequest(req, res)
|
|
776
736
|
});
|
|
777
|
-
api.
|
|
778
|
-
api.registerTool((context) => createDiscordWidgetTool(context, { runtime }), { name: "discord_widget" });
|
|
737
|
+
api.registerWidgetPresenter(createDiscordWidgetPresenter(runtime));
|
|
779
738
|
}
|
|
780
739
|
//#endregion
|
|
781
740
|
//#region extensions/discord/activities-api.ts
|
package/dist/activities-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as registerDiscordActivities } from "./activities-api-
|
|
1
|
+
import { t as registerDiscordActivities } from "./activities-api-q-9PaaHH.js";
|
|
2
2
|
export { registerDiscordActivities };
|
package/dist/api.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { _ as parseDiscordTarget, g as normalizeDiscordOutboundTarget, h as normalizeDiscordMessagingTarget, m as looksLikeDiscordTargetId, v as resolveDiscordChannelId } from "./retry-Cv4jCU5Z.js";
|
|
2
|
+
import { C as parseDiscordComponentCustomId, E as parseDiscordModalCustomIdForInteraction, T as parseDiscordModalCustomId, _ as DISCORD_MODAL_CUSTOM_ID_KEY, b as buildDiscordModalCustomId, d as buildDiscordComponentMessage, f as buildDiscordComponentMessageFlags, g as DISCORD_COMPONENT_CUSTOM_ID_KEY, h as resolveDiscordComponentAttachmentName, l as DiscordFormModal, m as readDiscordComponentSpec, n as formatDiscordComponentEventText, p as DISCORD_COMPONENT_ATTACHMENT_PREFIX, r as buildDiscordInteractiveComponents, u as createDiscordFormModal, w as parseDiscordComponentCustomIdForInteraction, y as buildDiscordComponentCustomId } from "./components-B9V5o361.js";
|
|
3
|
+
import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount, o as mergeDiscordAccountConfig, p as resolveDiscordMaxLinesPerMessage, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId, t as createDiscordActionGate, u as resolveDiscordAccountConfig } from "./accounts-CfQ-vSyf.js";
|
|
4
4
|
import { i as requestDiscord, n as DiscordApiError, r as fetchDiscord } from "./api-DNVbJyEy.js";
|
|
5
|
-
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-
|
|
6
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
5
|
+
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-vxIh6O3-.js";
|
|
6
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BDfKyuvL.js";
|
|
7
7
|
import { i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-B9cy6RvQ.js";
|
|
8
|
-
import "./targets-
|
|
9
|
-
import {
|
|
10
|
-
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-
|
|
8
|
+
import "./targets-CtTKvntJ.js";
|
|
9
|
+
import { C as shouldSuppressLocalDiscordExecApprovalPrompt, S as isDiscordExecApprovalClientEnabled, b as getDiscordExecApprovalApprovers, x as isDiscordExecApprovalApprover } from "./outbound-session-route-Cg15ZFJd.js";
|
|
10
|
+
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-Dx1tMTfx.js";
|
|
11
11
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
12
|
-
import { t as discordSetupPlugin } from "./channel.setup-
|
|
13
|
-
import { n as handleDiscordSubagentEnded,
|
|
14
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
15
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-
|
|
16
|
-
import { t as fetchPluralKitMessageInfo } from "./pluralkit-
|
|
17
|
-
import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
18
|
-
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-
|
|
12
|
+
import { t as discordSetupPlugin } from "./channel.setup-DOzXS2Pk.js";
|
|
13
|
+
import { n as handleDiscordSubagentEnded, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-DQzvOptn.js";
|
|
14
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-BdwCRHmm.js";
|
|
15
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-BK6eqekJ.js";
|
|
16
|
+
import { t as fetchPluralKitMessageInfo } from "./pluralkit-Tiyl70dx.js";
|
|
17
|
+
import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-n6ZXxK8V.js";
|
|
18
|
+
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-BfJhAXZp.js";
|
|
19
19
|
import { resolveOpenProviderRuntimeGroupPolicy as resolveDiscordRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
20
20
|
//#region extensions/discord/api.ts
|
|
21
|
-
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-
|
|
21
|
+
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-CLWWu9nC.js")).handleDiscordMessageAction(...args);
|
|
22
22
|
/**
|
|
23
23
|
* @deprecated Shipped `@openclaw/discord/api` compatibility only. Use native
|
|
24
24
|
* `AbortSignal.any` after filtering optional signals. Removal with the next
|
|
@@ -29,4 +29,4 @@ function mergeAbortSignals(signals) {
|
|
|
29
29
|
return activeSignals.length > 1 ? AbortSignal.any(activeSignals) : activeSignals[0];
|
|
30
30
|
}
|
|
31
31
|
//#endregion
|
|
32
|
-
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_COMPONENT_ATTACHMENT_PREFIX, DISCORD_COMPONENT_CUSTOM_ID_KEY, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, DISCORD_MODAL_CUSTOM_ID_KEY, DiscordApiError, DiscordFormModal, buildDiscordComponentCustomId, buildDiscordComponentMessage, buildDiscordComponentMessageFlags, buildDiscordInteractiveComponents, buildDiscordModalCustomId, collectDiscordSecurityAuditFindings, collectDiscordStatusIssues, createDiscordActionGate, createDiscordFormModal, discordPlugin, discordSetupPlugin, fetchDiscord, fetchDiscordApplicationId, fetchDiscordApplicationSummary, fetchPluralKitMessageInfo, formatDiscordComponentEventText, getDiscordExecApprovalApprovers, handleDiscordMessageAction, handleDiscordSubagentDeliveryTarget, handleDiscordSubagentEnded,
|
|
32
|
+
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_COMPONENT_ATTACHMENT_PREFIX, DISCORD_COMPONENT_CUSTOM_ID_KEY, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, DISCORD_MODAL_CUSTOM_ID_KEY, DiscordApiError, DiscordFormModal, buildDiscordComponentCustomId, buildDiscordComponentMessage, buildDiscordComponentMessageFlags, buildDiscordInteractiveComponents, buildDiscordModalCustomId, collectDiscordSecurityAuditFindings, collectDiscordStatusIssues, createDiscordActionGate, createDiscordFormModal, discordPlugin, discordSetupPlugin, fetchDiscord, fetchDiscordApplicationId, fetchDiscordApplicationSummary, fetchPluralKitMessageInfo, formatDiscordComponentEventText, getDiscordExecApprovalApprovers, handleDiscordMessageAction, handleDiscordSubagentDeliveryTarget, handleDiscordSubagentEnded, inspectDiscordAccount, isDiscordExecApprovalApprover, isDiscordExecApprovalClientEnabled, listDiscordAccountIds, listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig, listEnabledDiscordAccounts, looksLikeDiscordTargetId, mergeAbortSignals, mergeDiscordAccountConfig, normalizeDiscordMessagingTarget, normalizeDiscordOutboundTarget, normalizeExplicitDiscordSessionKey, parseApplicationIdFromToken, parseDiscordComponentCustomId, parseDiscordComponentCustomIdForInteraction as parseDiscordComponentCustomIdForCarbon, parseDiscordComponentCustomIdForInteraction, parseDiscordModalCustomId, parseDiscordModalCustomIdForInteraction as parseDiscordModalCustomIdForCarbon, parseDiscordModalCustomIdForInteraction, parseDiscordSendTarget, parseDiscordTarget, probeDiscord, readDiscordComponentSpec, requestDiscord, resolveDefaultDiscordAccountId, resolveDiscordAccount, resolveDiscordAccountConfig, resolveDiscordChannelId, resolveDiscordComponentAttachmentName, resolveDiscordGroupRequireMention, resolveDiscordGroupToolPolicy, resolveDiscordMaxLinesPerMessage, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordRuntimeGroupPolicy, resolveDiscordTarget, shouldSuppressLocalDiscordExecApprovalPrompt, tryHandleDiscordMessageActionGuildAdmin };
|