@openclaw/discord 2026.8.1-beta.3 → 2026.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{account-inspect-D5xmUpnj.js → account-inspect-BDfKyuvL.js} +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-DNl-oCEw.js → accounts-CfQ-vSyf.js} +5 -124
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-KCBAmWxD.js → activities-api-Dl-TOyOX.js} +5 -4
- package/dist/activities-api.js +1 -1
- package/dist/api.js +16 -16
- package/dist/{approval-handler.runtime-B12RCYr8.js → approval-handler.runtime-q4Zqo44V.js} +28 -105
- package/dist/{audit-Yc7eZDd6.js → audit-DgrvFPGt.js} +5 -5
- package/dist/{channel-cXYzGc4L.js → channel-BsQUalPw.js} +18 -20
- package/dist/{channel-actions.runtime-CODTvo7c.js → channel-actions.runtime-UMGGIfSy.js} +59 -58
- 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-CSiwnMgs.js → channel.setup-rPs4dsk_.js} +5 -5
- package/dist/{components-ezGKo_Yh.js → components-Dk35LTf_.js} +33 -29
- package/dist/{config-schema-DC5kDtQ5.js → config-schema-CxPqtVI1.js} +16 -10
- package/dist/{conversation-binding-route-D6rCQ5S0.js → conversation-binding-route-BjvX4e35.js} +1 -1
- package/dist/{directory-config-XyCfoqLg.js → directory-config-B7DY_pNG.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-Df0NbFJB.js → directory-live-DuAXKkan.js} +2 -2
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{doctor-DYY31GrO.js → doctor-zQTtn6hm.js} +4 -4
- package/dist/{handle-action.guild-admin-6Tvvinsa.js → handle-action.guild-admin-DZewwLr1.js} +9 -5
- package/dist/index.js +1 -1
- package/dist/ingress-identity-CzZKcPK8.js +60 -0
- package/dist/{message-handler-B61q5MOF.js → message-handler-C5By3yl5.js} +5 -5
- package/dist/{message-handler.preflight-Bzg_Hawz.js → message-handler.preflight-DrszWuHw.js} +20 -84
- package/dist/{message-handler.process--4_712Ec.js → message-handler.process-DyFPDLCt.js} +60 -66
- package/dist/{message-utils-BXLLnFl6.js → message-text-Ca8M6TU8.js} +34 -32
- package/dist/{outbound-adapter-DxHTOqiN.js → outbound-adapter-Dif8p481.js} +58 -61
- package/dist/{outbound-components-B2PL0ooH.js → outbound-components-wjv7yyAj.js} +5 -4
- package/dist/outbound-session-route-Bn4uXaoE.js +665 -0
- package/dist/{owner-access-Bg41VzAf.js → owner-access-UlYi9t0M.js} +1 -1
- package/dist/{pluralkit-dUl4v1X3.js → pluralkit-9EuEN4UD.js} +1 -1
- package/dist/{probe-BTdtVRwU.js → probe-n6ZXxK8V.js} +1 -1
- package/dist/{probe.runtime-Dq5-PRKT.js → probe.runtime-CN4bdPfZ.js} +1 -1
- package/dist/{provider-DlK_ynqt.js → provider-LXiOcJrH.js} +443 -295
- package/dist/{provider-session.runtime-CvvphHvs.js → provider-session.runtime-DSNe7r2W.js} +3 -3
- package/dist/provider.runtime-DiInaDXO.js +2 -0
- package/dist/{realtime-session.runtime-ysbMG8v7.js → realtime-session.runtime-DOViOIjY.js} +106 -122
- package/dist/{resolve-allowlist-common-DIVXbD1P.js → resolve-allowlist-common-BLoYaxEG.js} +1 -1
- package/dist/{resolve-channels-CGeUoIqb.js → resolve-channels-D2yl_2CN.js} +4 -3
- package/dist/{resolve-users-BtKxLUZv.js → resolve-users-BLxfqajZ.js} +2 -2
- package/dist/{retry-DNsVTeTo.js → retry-DqHCW6PV.js} +220 -6
- package/dist/{runtime-D71_VFLr.js → runtime-BYamRVPN.js} +73 -56
- package/dist/{runtime-CQovMsH3.js → runtime-DrxVBTtp.js} +2 -2
- package/dist/runtime-api.js +16 -23
- package/dist/{sdk-runtime-37OU6_Yh.js → sdk-runtime-6tfgYDjY.js} +55 -86
- package/dist/{security-audit-BfJhAXZp.js → security-audit-DKfK-iPY.js} +10 -11
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/{security-audit.runtime-BVKF9VtY.js → security-audit.runtime-sKZyKgpx.js} +1 -1
- package/dist/{send-rQIffSYu.js → send-UJHiAm4C.js} +78 -15
- package/dist/{send.components-ChK1wS7w.js → send.components-CrBJpGT_.js} +15 -22
- package/dist/{send.outbound-HIkgji_7.js → send.outbound-D7JYmfm9.js} +58 -69
- package/dist/{send.shared-B3fpaLWJ.js → send.shared-DZJ1akvQ.js} +36 -21
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-CaAaoksy.js → shared-Dii2HTn7.js} +31 -9
- package/dist/{subagent-hooks-CNT2ZJTJ.js → subagent-hooks-JyGrtQIl.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -6
- package/dist/{system-events-Nuwoq_au.js → system-events-BEmcj4xJ.js} +1 -1
- package/dist/{target-resolver-DIXShHaZ.js → target-resolver-V-IYae6s.js} +3 -3
- package/dist/targets-CQp53cGj.js +3 -0
- package/dist/{thread-bindings-VlymUnbz.js → thread-bindings-DvYP79fy.js} +3 -4
- package/dist/{thread-bindings.manager-CngsgErq.js → thread-bindings.manager-Clm77DBM.js} +8 -12
- package/dist/{threading-DU6pgeGm.js → threading-CXuu_7o9.js} +47 -25
- package/dist/{transcripts-source-DeIMNbRh.js → transcripts-source-BLEMH_yi.js} +9 -4
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-oLiS5Z13.js → typing-B9snnwMe.js} +1 -1
- package/dist/{voice-runtime-CjNFaynA.js → voice-runtime-DY6_o73o.js} +76 -66
- 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 -4
- package/package.json +8 -8
- package/skills/discord/SKILL.md +1 -1
- package/dist/approval-message-safety-XGFPbDoI.js +0 -226
- package/dist/audit-core-BCX8UeFH.js +0 -105
- package/dist/channel-actions-Dr2QI8Bf.js +0 -212
- package/dist/inbound-event-delivery-De2qxTrP.js +0 -39
- package/dist/provider.runtime-CzKGRiAF.js +0 -2
- package/dist/runtime-api.actions.js +0 -3
- package/dist/runtime-api.lookup.js +0 -7
- package/dist/runtime-api.monitor-CzeTYF32.js +0 -6
- package/dist/runtime-api.monitor.js +0 -9
- package/dist/runtime-api.send.js +0 -7
- package/dist/runtime-api.threads.js +0 -5
- package/dist/send.reactions-gmJ6yFPo.js +0 -78
- package/dist/send.receipt-Cnhoautb.js +0 -76
- package/dist/subagent-progress-FPLqBY1s.js +0 -110
- package/dist/targets-B2pf49zc.js +0 -3
- 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
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-
|
|
4
|
-
import "./targets-
|
|
1
|
+
import { _ as parseDiscordTarget, v as resolveDiscordChannelId } from "./retry-DqHCW6PV.js";
|
|
2
|
+
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-Dk35LTf_.js";
|
|
3
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-BYamRVPN.js";
|
|
4
|
+
import "./targets-CQp53cGj.js";
|
|
5
5
|
import "./action-runtime-api.js";
|
|
6
|
-
import {
|
|
7
|
-
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-
|
|
8
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
6
|
+
import { h as discordInboundEventDelivery } from "./outbound-session-route-Bn4uXaoE.js";
|
|
7
|
+
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-wjv7yyAj.js";
|
|
8
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-DZewwLr1.js";
|
|
9
9
|
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-fmHl1HNd.js";
|
|
10
10
|
import { normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
|
+
import { adaptMessagePresentationForChannel, normalizeLegacyInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
11
12
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
12
13
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
13
|
-
import {
|
|
14
|
-
import { readPositiveIntegerParam, readStringArrayParam, readStringParam } 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) {
|
|
@@ -31,7 +31,7 @@ function readCurrentDiscordTarget(toolContext) {
|
|
|
31
31
|
}
|
|
32
32
|
async function handleDiscordMessageAction(ctx) {
|
|
33
33
|
const { action, params, cfg } = ctx;
|
|
34
|
-
const accountId = ctx.accountId ?? readStringParam(params, "accountId");
|
|
34
|
+
const accountId = ctx.accountId ?? readStringParam$1(params, "accountId");
|
|
35
35
|
const readContext = ctx.requesterAccountId && ctx.toolContext?.currentChannelProvider && ctx.toolContext.currentChannelId ? {
|
|
36
36
|
requesterAccountId: ctx.requesterAccountId,
|
|
37
37
|
currentChannelProvider: ctx.toolContext.currentChannelProvider,
|
|
@@ -73,53 +73,53 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
73
73
|
return result;
|
|
74
74
|
};
|
|
75
75
|
const readTarget = () => {
|
|
76
|
-
const target = readStringParam(params, "channelId") ?? readStringParam(params, "to") ?? readCurrentDiscordTarget(ctx.toolContext);
|
|
76
|
+
const target = readStringParam$1(params, "channelId") ?? readStringParam$1(params, "to") ?? readCurrentDiscordTarget(ctx.toolContext);
|
|
77
77
|
if (!target) throw new Error("Discord channel target is required (use channel:<id>).");
|
|
78
78
|
return target;
|
|
79
79
|
};
|
|
80
80
|
const resolveChannelId = () => resolveDiscordChannelId(readTarget());
|
|
81
81
|
const readSendTarget = () => {
|
|
82
|
-
const target = readStringParam(params, "to") ?? readStringParam(params, "target") ?? readCurrentDiscordTarget(ctx.toolContext);
|
|
82
|
+
const target = readStringParam$1(params, "to") ?? readStringParam$1(params, "target") ?? readCurrentDiscordTarget(ctx.toolContext);
|
|
83
83
|
if (!target) throw new Error("Discord channel target is required (use channel:<id>).");
|
|
84
84
|
return target;
|
|
85
85
|
};
|
|
86
86
|
if (action === "send") {
|
|
87
87
|
const to = readSendTarget();
|
|
88
88
|
const asVoice = readBooleanParam(params, "asVoice") === true;
|
|
89
|
-
const mediaUrl = readStringParam(params, "media", { trim: false }) ?? readStringParam(params, "path", { trim: false }) ?? readStringParam(params, "filePath", { trim: false });
|
|
90
|
-
const requestedContent = readStringParam(params, "message", { allowEmpty: true });
|
|
91
|
-
const
|
|
92
|
-
const
|
|
89
|
+
const mediaUrl = readStringParam$1(params, "media", { trim: false }) ?? readStringParam$1(params, "path", { trim: false }) ?? readStringParam$1(params, "filePath", { trim: false });
|
|
90
|
+
const requestedContent = readStringParam$1(params, "message", { allowEmpty: true });
|
|
91
|
+
const explicitComponents = coerceDiscordComponentParam(params.components);
|
|
92
|
+
const presentation = explicitComponents == null ? normalizeMessagePresentation(params.presentation) : void 0;
|
|
93
|
+
const generatedPresentationComponents = buildDiscordPresentationComponents(presentation ? adaptMessagePresentationForChannel({
|
|
93
94
|
presentation,
|
|
94
95
|
capabilities: DISCORD_PRESENTATION_CAPABILITIES
|
|
95
|
-
}) : void 0;
|
|
96
|
-
const generatedPresentationComponents = buildDiscordPresentationComponents(adaptedPresentation);
|
|
96
|
+
}) : void 0);
|
|
97
97
|
const presentationComponents = generatedPresentationComponents && isDiscordComponentSpecWithinMessageLimit({
|
|
98
98
|
spec: generatedPresentationComponents,
|
|
99
99
|
fallbackText: requestedContent,
|
|
100
100
|
includesMedia: Boolean(mediaUrl)
|
|
101
101
|
}) ? generatedPresentationComponents : void 0;
|
|
102
102
|
const presentationFellBack = Boolean(generatedPresentationComponents && !presentationComponents);
|
|
103
|
-
const rawComponents = presentationFellBack ? void 0 :
|
|
103
|
+
const rawComponents = presentationFellBack ? void 0 : explicitComponents ?? presentationComponents ?? buildDiscordInteractiveComponents(normalizeLegacyInteractiveReply(params.interactive));
|
|
104
104
|
const hasComponents = Boolean(rawComponents) && (typeof rawComponents === "function" || typeof rawComponents === "object");
|
|
105
105
|
const components = hasComponents ? rawComponents : void 0;
|
|
106
106
|
const rawEmbeds = params.embeds;
|
|
107
107
|
const embeds = Array.isArray(rawEmbeds) ? rawEmbeds : void 0;
|
|
108
|
-
const content = readStringParam(params, "message", {
|
|
108
|
+
const content = readStringParam$1(params, "message", {
|
|
109
109
|
required: !asVoice && !hasComponents && !embeds?.length && !mediaUrl && !presentationFellBack,
|
|
110
110
|
allowEmpty: true
|
|
111
111
|
});
|
|
112
|
-
const deliveryContent = presentationFellBack &&
|
|
112
|
+
const deliveryContent = presentationFellBack && presentation ? renderMessagePresentationFallbackText({
|
|
113
113
|
text: content,
|
|
114
|
-
presentation
|
|
114
|
+
presentation
|
|
115
115
|
}) : content;
|
|
116
|
-
const filename = readStringParam(params, "filename");
|
|
117
|
-
const replyTo = readStringParam(params, "replyTo");
|
|
116
|
+
const filename = readStringParam$1(params, "filename");
|
|
117
|
+
const replyTo = readStringParam$1(params, "replyTo");
|
|
118
118
|
const silent = readBooleanParam(params, "silent") === true;
|
|
119
119
|
const suppressEmbeds = readBooleanParam(params, "suppressEmbeds");
|
|
120
|
-
const sessionKey = readStringParam(params, "__sessionKey");
|
|
121
|
-
const agentId = readStringParam(params, "__agentId");
|
|
122
|
-
const threadName = readStringParam(params, "threadName");
|
|
120
|
+
const sessionKey = readStringParam$1(params, "__sessionKey");
|
|
121
|
+
const agentId = readStringParam$1(params, "__agentId");
|
|
122
|
+
const threadName = readStringParam$1(params, "threadName");
|
|
123
123
|
const result = await handleDiscordAction({
|
|
124
124
|
action: "sendMessage",
|
|
125
125
|
accountId: accountId ?? void 0,
|
|
@@ -142,18 +142,18 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
142
142
|
}
|
|
143
143
|
if (action === "upload-file") {
|
|
144
144
|
const to = readSendTarget();
|
|
145
|
-
const mediaUrl = readStringParam(params, "filePath", { trim: false }) ?? readStringParam(params, "path", { trim: false }) ?? readStringParam(params, "media", { trim: false });
|
|
145
|
+
const mediaUrl = readStringParam$1(params, "filePath", { trim: false }) ?? readStringParam$1(params, "path", { trim: false }) ?? readStringParam$1(params, "media", { trim: false });
|
|
146
146
|
if (!mediaUrl) {
|
|
147
|
-
if (readStringParam(params, "buffer", { trim: false })) throw new Error("Use action: \"send\" for base64 buffer attachments; upload-file requires filePath, path, or media.");
|
|
147
|
+
if (readStringParam$1(params, "buffer", { trim: false })) throw new Error("Use action: \"send\" for base64 buffer attachments; upload-file requires filePath, path, or media.");
|
|
148
148
|
throw new Error("upload-file requires filePath, path, or media.");
|
|
149
149
|
}
|
|
150
|
-
const content = readStringParam(params, "message", { allowEmpty: true }) ?? readStringParam(params, "content", { allowEmpty: true }) ?? readStringParam(params, "caption", { allowEmpty: true });
|
|
151
|
-
const filename = readStringParam(params, "filename");
|
|
152
|
-
const replyTo = readStringParam(params, "replyTo");
|
|
150
|
+
const content = readStringParam$1(params, "message", { allowEmpty: true }) ?? readStringParam$1(params, "content", { allowEmpty: true }) ?? readStringParam$1(params, "caption", { allowEmpty: true });
|
|
151
|
+
const filename = readStringParam$1(params, "filename");
|
|
152
|
+
const replyTo = readStringParam$1(params, "replyTo");
|
|
153
153
|
const silent = readBooleanParam(params, "silent") === true;
|
|
154
154
|
const suppressEmbeds = readBooleanParam(params, "suppressEmbeds");
|
|
155
|
-
const sessionKey = readStringParam(params, "__sessionKey");
|
|
156
|
-
const agentId = readStringParam(params, "__agentId");
|
|
155
|
+
const sessionKey = readStringParam$1(params, "__sessionKey");
|
|
156
|
+
const agentId = readStringParam$1(params, "__agentId");
|
|
157
157
|
const result = await handleDiscordAction({
|
|
158
158
|
action: "sendMessage",
|
|
159
159
|
accountId: accountId ?? void 0,
|
|
@@ -176,7 +176,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
176
176
|
toolContext: ctx.toolContext
|
|
177
177
|
})) ?? "";
|
|
178
178
|
if (!messageId) throw new Error("messageId required. Provide messageId explicitly or react to the current inbound message.");
|
|
179
|
-
const emoji = readStringParam(params, "emoji", { allowEmpty: true });
|
|
179
|
+
const emoji = readStringParam$1(params, "emoji", { allowEmpty: true });
|
|
180
180
|
const remove = readBooleanParam(params, "remove");
|
|
181
181
|
return await handleDiscordAction({
|
|
182
182
|
action: "react",
|
|
@@ -188,8 +188,8 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
188
188
|
}, cfg, actionOptions);
|
|
189
189
|
}
|
|
190
190
|
if (action === "reactions") {
|
|
191
|
-
const messageId = readStringParam(params, "messageId", { required: true });
|
|
192
|
-
const limit = readPositiveIntegerParam(params, "limit");
|
|
191
|
+
const messageId = readStringParam$1(params, "messageId", { required: true });
|
|
192
|
+
const limit = readPositiveIntegerParam$1(params, "limit");
|
|
193
193
|
return await handleDiscordAction({
|
|
194
194
|
action: "reactions",
|
|
195
195
|
accountId: accountId ?? void 0,
|
|
@@ -199,20 +199,20 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
199
199
|
}, cfg, actionOptions);
|
|
200
200
|
}
|
|
201
201
|
if (action === "read") {
|
|
202
|
-
const limit = readPositiveIntegerParam(params, "limit");
|
|
202
|
+
const limit = readPositiveIntegerParam$1(params, "limit");
|
|
203
203
|
return await handleDiscordAction({
|
|
204
204
|
action: "readMessages",
|
|
205
205
|
accountId: accountId ?? void 0,
|
|
206
206
|
channelId: resolveChannelId(),
|
|
207
207
|
limit,
|
|
208
|
-
before: readStringParam(params, "before"),
|
|
209
|
-
after: readStringParam(params, "after"),
|
|
210
|
-
around: readStringParam(params, "around")
|
|
208
|
+
before: readStringParam$1(params, "before"),
|
|
209
|
+
after: readStringParam$1(params, "after"),
|
|
210
|
+
around: readStringParam$1(params, "around")
|
|
211
211
|
}, cfg, actionOptions);
|
|
212
212
|
}
|
|
213
213
|
if (action === "edit") {
|
|
214
|
-
const messageId = readStringParam(params, "messageId", { required: true });
|
|
215
|
-
const content = readStringParam(params, "message", { required: true });
|
|
214
|
+
const messageId = readStringParam$1(params, "messageId", { required: true });
|
|
215
|
+
const content = readStringParam$1(params, "message", { required: true });
|
|
216
216
|
return await handleDiscordAction({
|
|
217
217
|
action: "editMessage",
|
|
218
218
|
accountId: accountId ?? void 0,
|
|
@@ -222,7 +222,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
222
222
|
}, cfg, actionOptions);
|
|
223
223
|
}
|
|
224
224
|
if (action === "delete") {
|
|
225
|
-
const messageId = readStringParam(params, "messageId", { required: true });
|
|
225
|
+
const messageId = readStringParam$1(params, "messageId", { required: true });
|
|
226
226
|
return await handleDiscordAction({
|
|
227
227
|
action: "deleteMessage",
|
|
228
228
|
accountId: accountId ?? void 0,
|
|
@@ -231,7 +231,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
231
231
|
}, cfg, actionOptions);
|
|
232
232
|
}
|
|
233
233
|
if (action === "pin" || action === "unpin" || action === "list-pins") {
|
|
234
|
-
const messageId = action === "list-pins" ? void 0 : readStringParam(params, "messageId", { required: true });
|
|
234
|
+
const messageId = action === "list-pins" ? void 0 : readStringParam$1(params, "messageId", { required: true });
|
|
235
235
|
return await handleDiscordAction({
|
|
236
236
|
action: action === "pin" ? "pinMessage" : action === "unpin" ? "unpinMessage" : "listPins",
|
|
237
237
|
accountId: accountId ?? void 0,
|
|
@@ -245,11 +245,11 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
245
245
|
channelId: resolveChannelId()
|
|
246
246
|
}, cfg, actionOptions);
|
|
247
247
|
if (action === "thread-create") {
|
|
248
|
-
const name = readStringParam(params, "threadName", { required: true });
|
|
249
|
-
const messageId = readStringParam(params, "messageId");
|
|
250
|
-
const content = readStringParam(params, "message");
|
|
248
|
+
const name = readStringParam$1(params, "threadName", { required: true });
|
|
249
|
+
const messageId = readStringParam$1(params, "messageId");
|
|
250
|
+
const content = readStringParam$1(params, "message");
|
|
251
251
|
const autoArchiveMinutes = readDiscordAutoArchiveDurationParam(params, "autoArchiveMin");
|
|
252
|
-
const appliedTags = readStringArrayParam(params, "appliedTags");
|
|
252
|
+
const appliedTags = readStringArrayParam$1(params, "appliedTags");
|
|
253
253
|
const result = await handleDiscordAction({
|
|
254
254
|
action: "threadCreate",
|
|
255
255
|
accountId: accountId ?? void 0,
|
|
@@ -275,8 +275,8 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
275
275
|
return result;
|
|
276
276
|
}
|
|
277
277
|
if (action === "sticker") {
|
|
278
|
-
const to = readStringParam(params, "to", { required: true });
|
|
279
|
-
const stickerIds = readStringArrayParam(params, "stickerId", {
|
|
278
|
+
const to = readStringParam$1(params, "to", { required: true });
|
|
279
|
+
const stickerIds = readStringArrayParam$1(params, "stickerId", {
|
|
280
280
|
required: true,
|
|
281
281
|
label: "sticker-id"
|
|
282
282
|
}) ?? [];
|
|
@@ -285,7 +285,8 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
285
285
|
accountId: accountId ?? void 0,
|
|
286
286
|
to,
|
|
287
287
|
stickerIds,
|
|
288
|
-
content: readStringParam(params, "message")
|
|
288
|
+
content: readStringParam$1(params, "message"),
|
|
289
|
+
...readBooleanParam(params, "silent") === true ? { silent: true } : {}
|
|
289
290
|
}, cfg, actionOptions);
|
|
290
291
|
notifyVisibleOutbound(result, to);
|
|
291
292
|
return result;
|
|
@@ -293,11 +294,11 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
293
294
|
if (action === "set-presence") return await handleDiscordAction({
|
|
294
295
|
action: "setPresence",
|
|
295
296
|
accountId: accountId ?? void 0,
|
|
296
|
-
status: readStringParam(params, "status"),
|
|
297
|
-
activityType: readStringParam(params, "activityType"),
|
|
298
|
-
activityName: readStringParam(params, "activityName"),
|
|
299
|
-
activityUrl: readStringParam(params, "activityUrl"),
|
|
300
|
-
activityState: readStringParam(params, "activityState")
|
|
297
|
+
status: readStringParam$1(params, "status"),
|
|
298
|
+
activityType: readStringParam$1(params, "activityType"),
|
|
299
|
+
activityName: readStringParam$1(params, "activityName"),
|
|
300
|
+
activityUrl: readStringParam$1(params, "activityUrl"),
|
|
301
|
+
activityState: readStringParam$1(params, "activityState")
|
|
301
302
|
}, cfg, actionOptions);
|
|
302
303
|
const adminResult = await tryHandleDiscordMessageActionGuildAdmin({
|
|
303
304
|
ctx,
|
|
@@ -307,7 +308,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
307
308
|
});
|
|
308
309
|
if (adminResult !== void 0) {
|
|
309
310
|
if (action === "thread-reply") {
|
|
310
|
-
const threadId = readStringParam(params, "threadId") ?? readTarget();
|
|
311
|
+
const threadId = readStringParam$1(params, "threadId") ?? readTarget();
|
|
311
312
|
notifyVisibleOutbound(adminResult, threadId);
|
|
312
313
|
return withAdoptedThreadReplyRoute(adminResult, threadId);
|
|
313
314
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DiscordChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as DiscordChannelConfigSchema } from "./config-schema-CxPqtVI1.js";
|
|
2
2
|
export { DiscordChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordPlugin } from "./channel-
|
|
1
|
+
import { t as discordPlugin } from "./channel-BsQUalPw.js";
|
|
2
2
|
export { discordPlugin };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ChannelType } from "discord-api-types/v10";
|
|
2
|
+
//#region extensions/discord/src/channel-type.ts
|
|
3
|
+
function isDiscordThreadChannelType(channelType) {
|
|
4
|
+
return channelType === ChannelType.AnnouncementThread || channelType === ChannelType.PublicThread || channelType === ChannelType.PrivateThread;
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { isDiscordThreadChannelType as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-
|
|
2
|
-
import { n as inspectDiscordAccountTokenState } from "./account-inspect-
|
|
3
|
-
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-
|
|
4
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
5
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
1
|
+
import { h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-CfQ-vSyf.js";
|
|
2
|
+
import { n as inspectDiscordAccountTokenState } from "./account-inspect-BDfKyuvL.js";
|
|
3
|
+
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-Dii2HTn7.js";
|
|
4
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-D2yl_2CN.js";
|
|
5
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-BLxfqajZ.js";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as TextInput, Q as RadioGroup, X as Label, Y as CheckboxGroup, Z as Modal, at as MediaGallery, ct as Row, dt as StringSelectMenu, et as Button, ft as TextDisplay, gt as parseCustomId, it as LinkButton, lt as Section, mt as UserSelectMenu, nt as Container, on as __exportAll, ot as MentionableSelectMenu, pt as Thumbnail, rt as File, st as RoleSelectMenu, tt as ChannelSelectMenu, ut as Separator } from "./retry-DqHCW6PV.js";
|
|
2
2
|
import { ButtonStyle, MessageFlags, TextInputStyle } from "discord-api-types/v10";
|
|
3
3
|
import crypto from "node:crypto";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
import {
|
|
5
|
+
import { legacyInteractiveReplyToPresentation, resolveMessagePresentationActionValue, resolveMessagePresentationButtonAction, resolveMessagePresentationOptionAction } from "openclaw/plugin-sdk/interactive-runtime";
|
|
6
|
+
import { resolveAskUserQuestionOptionIndex } from "openclaw/plugin-sdk/reply-payload";
|
|
6
7
|
import { buildApprovalResolutionRef } from "openclaw/plugin-sdk/approval-reference-runtime";
|
|
7
8
|
//#region extensions/discord/src/custom-id-codec.ts
|
|
8
9
|
/**
|
|
@@ -230,6 +231,7 @@ function parseButtonSpec(raw, label) {
|
|
|
230
231
|
callbackDataKind: readOptionalCallbackDataKind(obj.callbackDataKind, `${label}.callbackDataKind`),
|
|
231
232
|
emoji: readOptionalEmoji(obj.emoji, `${label}.emoji`),
|
|
232
233
|
disabled: typeof obj.disabled === "boolean" ? obj.disabled : void 0,
|
|
234
|
+
reusable: typeof obj.reusable === "boolean" ? obj.reusable : void 0,
|
|
233
235
|
allowedUsers: readOptionalStringArray(obj.allowedUsers, `${label}.allowedUsers`)
|
|
234
236
|
};
|
|
235
237
|
}
|
|
@@ -390,13 +392,20 @@ function parseComponentBlock(raw, label) {
|
|
|
390
392
|
default: throw new Error(`${label}.type must be a supported component block`);
|
|
391
393
|
}
|
|
392
394
|
}
|
|
395
|
+
function coerceDiscordComponentParam(raw) {
|
|
396
|
+
if (typeof raw !== "string") return raw;
|
|
397
|
+
try {
|
|
398
|
+
return JSON.parse(raw);
|
|
399
|
+
} catch {
|
|
400
|
+
return raw;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
393
403
|
function readDiscordComponentSpec(raw) {
|
|
394
404
|
if (raw === void 0 || raw === null) return null;
|
|
395
405
|
const obj = requireObject(raw, "components");
|
|
396
406
|
const blocksRaw = obj.blocks;
|
|
397
407
|
const blocks = Array.isArray(blocksRaw) ? blocksRaw.map((entry, idx) => parseComponentBlock(entry, `components.blocks[${idx}]`)) : void 0;
|
|
398
408
|
const modalRaw = obj.modal;
|
|
399
|
-
const reusable = typeof obj.reusable === "boolean" ? obj.reusable : void 0;
|
|
400
409
|
let modal;
|
|
401
410
|
if (modalRaw !== void 0) {
|
|
402
411
|
const modalObj = requireObject(modalRaw, "components.modal");
|
|
@@ -415,7 +424,7 @@ function readDiscordComponentSpec(raw) {
|
|
|
415
424
|
}
|
|
416
425
|
return {
|
|
417
426
|
text: normalizeOptionalString(obj.text),
|
|
418
|
-
reusable,
|
|
427
|
+
reusable: typeof obj.reusable === "boolean" ? obj.reusable : void 0,
|
|
419
428
|
container: typeof obj.container === "object" && obj.container && !Array.isArray(obj.container) ? {
|
|
420
429
|
accentColor: obj.container.accentColor,
|
|
421
430
|
spoiler: typeof obj.container.spoiler === "boolean" ? obj.container.spoiler : void 0
|
|
@@ -919,7 +928,7 @@ function resolveDiscordSelectCallbackDataKind(options) {
|
|
|
919
928
|
if (renderableOptions.some((option) => option.action)) return "mixed";
|
|
920
929
|
}
|
|
921
930
|
const DISCORD_INTERACTIVE_BUTTON_ROW_SIZE = 5;
|
|
922
|
-
function buildDiscordButtonComponent(button,
|
|
931
|
+
function buildDiscordButtonComponent(button, options) {
|
|
923
932
|
const action = resolveMessagePresentationButtonAction(button);
|
|
924
933
|
if (!action) return;
|
|
925
934
|
if (action.type === "approval") {
|
|
@@ -933,6 +942,13 @@ function buildDiscordButtonComponent(button, optionIndex) {
|
|
|
933
942
|
};
|
|
934
943
|
}
|
|
935
944
|
if (action.type === "question") {
|
|
945
|
+
if ("intent" in action) return;
|
|
946
|
+
const optionIndex = resolveAskUserQuestionOptionIndex({
|
|
947
|
+
questionOptionIndices: options.questionOptionIndices,
|
|
948
|
+
questionId: action.questionId,
|
|
949
|
+
optionValue: action.optionValue
|
|
950
|
+
});
|
|
951
|
+
if (optionIndex === void 0) return;
|
|
936
952
|
const internalCustomId = buildDiscordQuestionCustomId({
|
|
937
953
|
questionId: action.questionId,
|
|
938
954
|
optionIndex
|
|
@@ -965,8 +981,11 @@ function buildDiscordButtonComponent(button, optionIndex) {
|
|
|
965
981
|
if (button.reusable === true) component.reusable = true;
|
|
966
982
|
return component;
|
|
967
983
|
}
|
|
968
|
-
function appendDiscordButtonBlocks(blocks, buttons) {
|
|
969
|
-
const components = buttons.
|
|
984
|
+
function appendDiscordButtonBlocks(blocks, buttons, options) {
|
|
985
|
+
const components = buttons.flatMap((button) => {
|
|
986
|
+
const component = buildDiscordButtonComponent(button, options);
|
|
987
|
+
return component ? [component] : [];
|
|
988
|
+
});
|
|
970
989
|
for (let index = 0; index < components.length; index += DISCORD_INTERACTIVE_BUTTON_ROW_SIZE) blocks.push({
|
|
971
990
|
type: "actions",
|
|
972
991
|
buttons: components.slice(index, index + DISCORD_INTERACTIVE_BUTTON_ROW_SIZE)
|
|
@@ -993,26 +1012,10 @@ function appendDiscordSelectBlock(blocks, block) {
|
|
|
993
1012
|
/**
|
|
994
1013
|
* @deprecated Use buildDiscordPresentationComponents with MessagePresentation.
|
|
995
1014
|
*/
|
|
996
|
-
function buildDiscordInteractiveComponents(interactive) {
|
|
997
|
-
|
|
998
|
-
if (block.type === "text") {
|
|
999
|
-
const text = block.text.trim();
|
|
1000
|
-
if (text) state.push({
|
|
1001
|
-
type: "text",
|
|
1002
|
-
text
|
|
1003
|
-
});
|
|
1004
|
-
return state;
|
|
1005
|
-
}
|
|
1006
|
-
if (block.type === "buttons") {
|
|
1007
|
-
appendDiscordButtonBlocks(state, block.buttons);
|
|
1008
|
-
return state;
|
|
1009
|
-
}
|
|
1010
|
-
if (block.type === "select") appendDiscordSelectBlock(state, block);
|
|
1011
|
-
return state;
|
|
1012
|
-
});
|
|
1013
|
-
return blocks.length > 0 ? { blocks } : void 0;
|
|
1015
|
+
function buildDiscordInteractiveComponents(interactive, options = {}) {
|
|
1016
|
+
return buildDiscordPresentationComponents(interactive ? legacyInteractiveReplyToPresentation(interactive) : void 0, options);
|
|
1014
1017
|
}
|
|
1015
|
-
function buildDiscordPresentationComponents(presentation) {
|
|
1018
|
+
function buildDiscordPresentationComponents(presentation, options = {}) {
|
|
1016
1019
|
if (!presentation) return;
|
|
1017
1020
|
const blocks = [];
|
|
1018
1021
|
if (presentation.title) blocks.push({
|
|
@@ -1021,7 +1024,7 @@ function buildDiscordPresentationComponents(presentation) {
|
|
|
1021
1024
|
});
|
|
1022
1025
|
for (const block of presentation.blocks) {
|
|
1023
1026
|
if (block.type === "text" || block.type === "context") {
|
|
1024
|
-
const text = block.text
|
|
1027
|
+
const text = block.text;
|
|
1025
1028
|
if (text) blocks.push({
|
|
1026
1029
|
type: "text",
|
|
1027
1030
|
text: block.type === "context" ? `-# ${text}` : text
|
|
@@ -1033,7 +1036,7 @@ function buildDiscordPresentationComponents(presentation) {
|
|
|
1033
1036
|
continue;
|
|
1034
1037
|
}
|
|
1035
1038
|
if (block.type === "buttons") {
|
|
1036
|
-
appendDiscordButtonBlocks(blocks, block.buttons);
|
|
1039
|
+
appendDiscordButtonBlocks(blocks, block.buttons, options);
|
|
1037
1040
|
continue;
|
|
1038
1041
|
}
|
|
1039
1042
|
if (block.type === "select") appendDiscordSelectBlock(blocks, block);
|
|
@@ -1053,6 +1056,7 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
1053
1056
|
buildDiscordComponentMessageFlags: () => buildDiscordComponentMessageFlags,
|
|
1054
1057
|
buildDiscordInteractiveComponents: () => buildDiscordInteractiveComponents,
|
|
1055
1058
|
buildDiscordModalCustomId: () => buildDiscordModalCustomId,
|
|
1059
|
+
coerceDiscordComponentParam: () => coerceDiscordComponentParam,
|
|
1056
1060
|
createDiscordFormModal: () => createDiscordFormModal,
|
|
1057
1061
|
formatDiscordComponentEventText: () => formatDiscordComponentEventText,
|
|
1058
1062
|
parseDiscordComponentCustomId: () => parseDiscordComponentCustomId,
|
|
@@ -1069,4 +1073,4 @@ function formatDiscordComponentEventText(params) {
|
|
|
1069
1073
|
return `Selected ${values.join(", ")} from "${params.label}".`;
|
|
1070
1074
|
}
|
|
1071
1075
|
//#endregion
|
|
1072
|
-
export {
|
|
1076
|
+
export { parseDiscordActivityCustomIdForInteraction as C, parseDiscordModalCustomIdForInteraction as D, parseDiscordModalCustomId as E, decodeCustomIdComponent as O, parseDiscordActivityCustomId as S, parseDiscordComponentCustomIdForInteraction as T, DISCORD_COMPONENT_CUSTOM_ID_KEY as _, shared_interactive_exports as a, buildDiscordComponentCustomId as b, parseExecApprovalData as c, buildDiscordComponentMessage as d, buildDiscordComponentMessageFlags as f, resolveDiscordComponentAttachmentName as g, readDiscordComponentSpec as h, buildDiscordPresentationComponents as i, encodeCustomIdComponent as k, DiscordFormModal as l, coerceDiscordComponentParam as m, formatDiscordComponentEventText as n, parseDiscordQuestionData as o, DISCORD_COMPONENT_ATTACHMENT_PREFIX as p, buildDiscordInteractiveComponents as r, buildExecApprovalCustomId as s, components_exports as t, createDiscordFormModal as u, DISCORD_MODAL_CUSTOM_ID_KEY as v, parseDiscordComponentCustomId as w, buildDiscordModalCustomId as x, buildDiscordActivityCustomId as y };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { normalizeLegacyDmAliases } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
-
import { ChannelBotLoopProtectionSchema, ChannelDangerouslyAllowNameMatchingSchema, ChannelPreviewStreamingConfigSchema, ChannelStreamingProgressSchema, ProviderCommandsSchema, TtsConfigSchema, buildChannelAllowBotsSchema, buildChannelConfigSchema, buildChannelExecApprovalsSchema, buildChannelReactionShape, buildCommonChannelAccountShape, buildGroupEntrySchema, requireAllowlistAllowFrom, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
|
|
4
|
-
import { asObjectRecord } from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
5
3
|
import { buildSecretInputSchema, registerSensitiveConfigSchema } from "openclaw/plugin-sdk/secret-input";
|
|
6
|
-
import { z } from "zod";
|
|
7
4
|
import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
|
|
5
|
+
import { ChannelBotLoopProtectionSchema, ChannelDangerouslyAllowNameMatchingSchema, ChannelPreviewStreamingConfigSchema, ChannelStreamingProgressSchema, ProviderCommandsSchema, TtsConfigSchema, buildChannelAccountSchemaParts, buildChannelAllowBotsSchema, buildChannelConfigSchema, buildChannelExecApprovalsSchema, buildChannelReactionShape, buildGroupEntrySchema, requireAllowlistAllowFrom, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
|
|
6
|
+
import { asObjectRecord } from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
7
|
+
import { z } from "zod";
|
|
8
8
|
//#region extensions/discord/src/config-ui-hints.ts
|
|
9
9
|
const discordChannelConfigUiHints = {
|
|
10
10
|
"": {
|
|
@@ -35,6 +35,10 @@ const discordChannelConfigUiHints = {
|
|
|
35
35
|
},
|
|
36
36
|
progress: { includeCommentary: true }
|
|
37
37
|
}),
|
|
38
|
+
joinIntro: {
|
|
39
|
+
label: "Discord Guild Join Introduction",
|
|
40
|
+
help: "Post one brief, room-specific introduction when the bot joins an allowed Discord guild (default: true). Account settings override the channel-wide setting."
|
|
41
|
+
},
|
|
38
42
|
proxy: {
|
|
39
43
|
label: "Discord Proxy URL",
|
|
40
44
|
help: "Proxy URL for Discord gateway + API requests (app-id lookup and allowlist resolution). Set per account via channels.discord.accounts.<id>.proxy."
|
|
@@ -461,13 +465,14 @@ const DiscordVoiceSchema = z.object({
|
|
|
461
465
|
captureSilenceGraceMs: z.number().int().positive().max(3e4).optional(),
|
|
462
466
|
tts: TtsConfigSchema.optional()
|
|
463
467
|
}).strict().optional();
|
|
468
|
+
const { accountShape, rootPolicyShape } = buildChannelAccountSchemaParts({
|
|
469
|
+
omit: ["groupAllowFrom"],
|
|
470
|
+
allowFrom: DiscordIdListSchema.optional(),
|
|
471
|
+
streaming: DiscordPreviewStreamingConfigSchema.optional()
|
|
472
|
+
});
|
|
464
473
|
const DiscordAccountSchemaBase = z.object({
|
|
465
|
-
...
|
|
466
|
-
|
|
467
|
-
groupPolicyDefault: true,
|
|
468
|
-
allowFrom: DiscordIdListSchema.optional(),
|
|
469
|
-
streaming: DiscordPreviewStreamingConfigSchema.optional()
|
|
470
|
-
}),
|
|
474
|
+
...accountShape,
|
|
475
|
+
joinIntro: z.boolean().optional(),
|
|
471
476
|
commands: ProviderCommandsSchema,
|
|
472
477
|
token: registerSensitiveConfigSchema(SecretInputSchema.optional()),
|
|
473
478
|
applicationId: DiscordIdSchema.optional(),
|
|
@@ -608,7 +613,8 @@ function normalizeShippedDiscordDmAliases(value) {
|
|
|
608
613
|
} : rest;
|
|
609
614
|
}
|
|
610
615
|
const DiscordAccountSchema = z.preprocess(normalizeShippedDiscordDmAliases, DiscordAccountSchemaBase);
|
|
611
|
-
const DiscordConfigSchemaBase = DiscordAccountSchemaBase.
|
|
616
|
+
const DiscordConfigSchemaBase = DiscordAccountSchemaBase.safeExtend({
|
|
617
|
+
...rootPolicyShape,
|
|
612
618
|
accounts: z.record(z.string(), DiscordAccountSchema.optional()).optional(),
|
|
613
619
|
defaultAccount: z.string().optional()
|
|
614
620
|
}).superRefine((value, ctx) => {
|
package/dist/{conversation-binding-route-D6rCQ5S0.js → conversation-binding-route-BjvX4e35.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-Bn4uXaoE.js";
|
|
2
2
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
3
3
|
import { resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-binding-runtime";
|
|
4
4
|
//#region extensions/discord/src/monitor/conversation-binding-route.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId } from "./accounts-
|
|
1
|
+
import { on as __exportAll } from "./retry-DqHCW6PV.js";
|
|
2
|
+
import { l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId } from "./accounts-CfQ-vSyf.js";
|
|
3
3
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
4
4
|
import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
5
5
|
//#region extensions/discord/src/directory-config.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-
|
|
1
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-B7DY_pNG.js";
|
|
2
2
|
//#region extensions/discord/directory-contract-api.ts
|
|
3
3
|
const discordDirectoryContractPlugin = {
|
|
4
4
|
id: "discord",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as resolveDiscordAccount, m as normalizeDiscordToken } from "./accounts-
|
|
1
|
+
import { on as __exportAll } from "./retry-DqHCW6PV.js";
|
|
2
|
+
import { c as resolveDiscordAccount, m as normalizeDiscordToken } from "./accounts-CfQ-vSyf.js";
|
|
3
3
|
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-DNVbJyEy.js";
|
|
4
4
|
import { a as normalizeDiscordSlug } from "./allow-list-BDMimASD.js";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
@@ -3,8 +3,8 @@ import { a as THREAD_BINDINGS_MAX_ENTRIES, d as normalizePersistedBinding, k as
|
|
|
3
3
|
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-DsWvKIXF.js";
|
|
4
4
|
import { i as sanitizeRecentModels, r as preferenceTimestampMs, t as buildPreferenceModelKey } from "./model-picker-preference-primitives-BHT1LkR_.js";
|
|
5
5
|
import { MAX_DATE_TIMESTAMP_MS, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
6
|
-
import { definePluginDoctorMigrationFromPlans } from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
7
6
|
import path from "node:path";
|
|
7
|
+
import { definePluginDoctorMigrationFromPlans } from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
8
8
|
import fs from "node:fs";
|
|
9
9
|
//#region extensions/discord/src/monitor/model-picker-preferences-migrations.ts
|
|
10
10
|
const PREFERENCE_MAX_ENTRIES = 2e3;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as resolveDefaultDiscordAccountId } from "./accounts-
|
|
2
|
-
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
3
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
4
|
-
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-
|
|
1
|
+
import { s as resolveDefaultDiscordAccountId } from "./accounts-CfQ-vSyf.js";
|
|
2
|
+
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-BLEMH_yi.js";
|
|
3
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BDfKyuvL.js";
|
|
4
|
+
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-Dii2HTn7.js";
|
|
5
5
|
import { n as normalizeCompatibilityConfig } from "./doctor-contract-DsWvKIXF.js";
|
|
6
6
|
import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.js";
|
|
7
7
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
package/dist/{handle-action.guild-admin-6Tvvinsa.js → handle-action.guild-admin-DZewwLr1.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { c as readDiscordChannelMoveParams, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { c as readDiscordChannelMoveParams, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-BYamRVPN.js";
|
|
2
2
|
import "./action-runtime-api.js";
|
|
3
|
-
import {
|
|
3
|
+
import { m as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-Bn4uXaoE.js";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
+
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
5
6
|
import { readNonNegativeIntegerParam, readPositiveIntegerParam, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/agent-runtime";
|
|
6
7
|
//#region extensions/discord/src/actions/handle-action.guild-admin.ts
|
|
7
8
|
function readDiscordRequesterSenderId(ctx) {
|
|
@@ -36,11 +37,13 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
36
37
|
}, cfg, readPolicyOptions);
|
|
37
38
|
}
|
|
38
39
|
if (action === "emoji-list") {
|
|
39
|
-
const guildId = readStringParam(actionParams, "guildId"
|
|
40
|
+
const guildId = readStringParam(actionParams, "guildId");
|
|
41
|
+
const limit = readPositiveIntegerParam(actionParams, "limit");
|
|
40
42
|
return await handleDiscordAction({
|
|
41
43
|
action: "emojiList",
|
|
42
44
|
accountId: accountId ?? void 0,
|
|
43
|
-
guildId
|
|
45
|
+
...guildId ? { guildId } : { channelId: resolveChannelId() },
|
|
46
|
+
...limit ? { limit } : {}
|
|
44
47
|
}, cfg, readPolicyOptions);
|
|
45
48
|
}
|
|
46
49
|
if (action === "emoji-upload") {
|
|
@@ -283,7 +286,8 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
283
286
|
channelId,
|
|
284
287
|
content,
|
|
285
288
|
mediaUrl: mediaUrl ?? void 0,
|
|
286
|
-
replyTo: replyTo ?? void 0
|
|
289
|
+
replyTo: replyTo ?? void 0,
|
|
290
|
+
...readBooleanParam(actionParams, "silent") === true ? { silent: true } : {}
|
|
287
291
|
}, cfg, actionOptions);
|
|
288
292
|
}
|
|
289
293
|
if (action === "search") {
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as registerDiscordActivities } from "./activities-api-
|
|
1
|
+
import { t as registerDiscordActivities } from "./activities-api-Dl-TOyOX.js";
|
|
2
2
|
import { registerDiscordSubagentHooks } from "./subagent-hooks-api.js";
|
|
3
3
|
import { registerDiscordTranscriptSourceProvider } from "./transcripts-source-api.js";
|
|
4
4
|
import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|