@openclaw/discord 2026.8.1-beta.3 → 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-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-q-9PaaHH.js} +5 -4
- package/dist/activities-api.js +1 -1
- package/dist/api.js +15 -15
- package/dist/{approval-handler.runtime-B12RCYr8.js → approval-handler.runtime-B7qhK3fR.js} +28 -105
- package/dist/{audit-Yc7eZDd6.js → audit-CBEv_ERu.js} +5 -5
- package/dist/{channel-cXYzGc4L.js → channel-Dx1tMTfx.js} +18 -20
- package/dist/{channel-actions.runtime-CODTvo7c.js → channel-actions.runtime-CLWWu9nC.js} +56 -56
- 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-DOzXS2Pk.js} +5 -5
- package/dist/{components-ezGKo_Yh.js → components-B9V5o361.js} +6 -22
- package/dist/{conversation-binding-route-D6rCQ5S0.js → conversation-binding-route-DJYrY2TQ.js} +1 -1
- package/dist/{directory-config-XyCfoqLg.js → directory-config-BK6eqekJ.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-Df0NbFJB.js → directory-live-DSAJSrJk.js} +2 -2
- package/dist/{doctor-DYY31GrO.js → doctor-Cm7Y1pJ2.js} +4 -4
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{handle-action.guild-admin-6Tvvinsa.js → handle-action.guild-admin-BdwCRHmm.js} +9 -5
- package/dist/index.js +1 -1
- package/dist/{message-handler-B61q5MOF.js → message-handler-BXpWZyni.js} +5 -5
- package/dist/{message-handler.preflight-Bzg_Hawz.js → message-handler.preflight-Ba5LAY_X.js} +13 -15
- package/dist/{message-handler.process--4_712Ec.js → message-handler.process-3HEzmemS.js} +59 -65
- package/dist/{message-utils-BXLLnFl6.js → message-text-aiwO5R2F.js} +32 -30
- package/dist/{outbound-adapter-DxHTOqiN.js → outbound-adapter-BE4jSq2d.js} +53 -58
- package/dist/{outbound-components-B2PL0ooH.js → outbound-components-oLpg8Qzb.js} +3 -3
- package/dist/outbound-session-route-Cg15ZFJd.js +625 -0
- package/dist/{owner-access-Bg41VzAf.js → owner-access-UlYi9t0M.js} +1 -1
- package/dist/{pluralkit-dUl4v1X3.js → pluralkit-Tiyl70dx.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-B11xwilq.js} +244 -238
- package/dist/{provider-session.runtime-CvvphHvs.js → provider-session.runtime-B9xe-Qaf.js} +3 -3
- package/dist/provider.runtime-DiYaHvOz.js +2 -0
- package/dist/{realtime-session.runtime-ysbMG8v7.js → realtime-session.runtime-CU8IQUS-.js} +74 -86
- package/dist/{resolve-allowlist-common-DIVXbD1P.js → resolve-allowlist-common-BLoYaxEG.js} +1 -1
- package/dist/{resolve-channels-CGeUoIqb.js → resolve-channels-C2sT_n67.js} +4 -3
- package/dist/{resolve-users-BtKxLUZv.js → resolve-users-CzpjLwjy.js} +2 -2
- package/dist/{retry-DNsVTeTo.js → retry-Cv4jCU5Z.js} +144 -5
- package/dist/{runtime-D71_VFLr.js → runtime-BHrTlFkf.js} +72 -55
- package/dist/{runtime-CQovMsH3.js → runtime-CY4PRMF-.js} +2 -2
- package/dist/runtime-api.js +16 -23
- package/dist/{sdk-runtime-37OU6_Yh.js → sdk-runtime-4geQHtXc.js} +55 -86
- package/dist/{send-rQIffSYu.js → send-C49MFF9j.js} +78 -15
- package/dist/{send.components-ChK1wS7w.js → send.components-DKKAw5VX.js} +14 -21
- package/dist/{send.outbound-HIkgji_7.js → send.outbound-zam0TrZx.js} +58 -69
- package/dist/{send.shared-B3fpaLWJ.js → send.shared-JjljcV4O.js} +35 -20
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-CaAaoksy.js → shared-_5EcP4jW.js} +27 -8
- package/dist/{subagent-hooks-CNT2ZJTJ.js → subagent-hooks-DQzvOptn.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -6
- package/dist/{system-events-Nuwoq_au.js → system-events-C7yxaHWP.js} +1 -1
- package/dist/{target-resolver-DIXShHaZ.js → target-resolver-vxIh6O3-.js} +3 -3
- package/dist/targets-CtTKvntJ.js +3 -0
- package/dist/{thread-bindings-VlymUnbz.js → thread-bindings-DW5F9vat.js} +3 -4
- package/dist/{thread-bindings.manager-CngsgErq.js → thread-bindings.manager-ByOtwjo_.js} +6 -10
- package/dist/{threading-DU6pgeGm.js → threading-agH1T_6s.js} +47 -25
- package/dist/{transcripts-source-DeIMNbRh.js → transcripts-source-BR11iHA4.js} +3 -3
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-oLiS5Z13.js → typing-Dc_YMY2e.js} +1 -1
- package/dist/{voice-runtime-CjNFaynA.js → voice-runtime-DIeaa8fJ.js} +56 -64
- 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/package.json +8 -8
- 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
- package/dist/{config-schema-DC5kDtQ5.js → config-schema-BR13IAx6.js} +2 -2
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { m as readDiscordComponentSpec } from "./components-
|
|
3
|
-
import {
|
|
4
|
-
import { r as sendDiscordComponentMessage } from "./send.components-
|
|
1
|
+
import { f as resolveDiscordReplyReference, u as createReusableDiscordReplyReference, v as resolveDiscordChannelId } from "./retry-Cv4jCU5Z.js";
|
|
2
|
+
import { m as readDiscordComponentSpec } from "./components-B9V5o361.js";
|
|
3
|
+
import { o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, t as createDiscordActionGate } from "./accounts-CfQ-vSyf.js";
|
|
4
|
+
import { r as sendDiscordComponentMessage } from "./send.components-DKKAw5VX.js";
|
|
5
5
|
import { a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, n as isDiscordGroupAllowedByPolicy, v as resolveGroupDmAllow } from "./allow-list-BDMimASD.js";
|
|
6
|
-
import {
|
|
7
|
-
import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
6
|
+
import { F as createDiscordRuntimeAccountContext, T as hasAnyGuildPermissionDiscord, U as getGateway, d as resolveDiscordTargetChannelId, v as canManageGuildMemberRoleDiscord, w as hasAnyChannelPermissionDiscord, x as fetchChannelPermissionsDiscord, y as canManageGuildRoleDiscord } from "./send.shared-JjljcV4O.js";
|
|
7
|
+
import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-zam0TrZx.js";
|
|
8
|
+
import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
|
|
8
9
|
import { n as getPresence } from "./presence-cache-z1N8MbJ3.js";
|
|
9
|
-
import { A as
|
|
10
|
-
import
|
|
11
|
-
import "./targets-B2pf49zc.js";
|
|
10
|
+
import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, l as DiscordThreadInitialMessageError, m as listPinsDiscord, n as fetchReactionsDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchGuildInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-C49MFF9j.js";
|
|
11
|
+
import "./targets-CtTKvntJ.js";
|
|
12
12
|
import { ChannelType, PermissionFlagsBits } from "discord-api-types/v10";
|
|
13
13
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
14
14
|
import { asBoolean, isRecord, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
15
15
|
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
16
|
+
import { assertMediaNotDataUrl, jsonResult, parseAvailableTags, readNonNegativeIntegerParam, readPositiveIntegerParam, readReactionParams, readStringArrayParam, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
|
|
16
17
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
18
|
+
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
17
19
|
//#region extensions/discord/src/actions/runtime-deps.ts
|
|
18
20
|
const discordGuildActionRuntime = {
|
|
19
21
|
addRoleDiscord,
|
|
@@ -241,8 +243,7 @@ function readDiscordChannelType(value) {
|
|
|
241
243
|
return typeof type === "number" ? type : void 0;
|
|
242
244
|
}
|
|
243
245
|
function isDiscordThreadChannel(value) {
|
|
244
|
-
|
|
245
|
-
return type === 10 || type === 11 || type === 12;
|
|
246
|
+
return isDiscordThreadChannelType(readDiscordChannelType(value));
|
|
246
247
|
}
|
|
247
248
|
function isDiscordReadAncestryAllowed(params) {
|
|
248
249
|
for (const ancestor of params.target.ancestors) {
|
|
@@ -623,9 +624,6 @@ const guildAdminActionGuards = {
|
|
|
623
624
|
channelPermissionSet: channelPermissionGuard,
|
|
624
625
|
channelPermissionRemove: channelPermissionGuard
|
|
625
626
|
};
|
|
626
|
-
function isThreadChannelType(channelType) {
|
|
627
|
-
return channelType === ChannelType.GuildNewsThread || channelType === ChannelType.GuildPublicThread || channelType === ChannelType.GuildPrivateThread;
|
|
628
|
-
}
|
|
629
627
|
function isLockedThreadChannel(channel) {
|
|
630
628
|
if (!channel || typeof channel !== "object") return false;
|
|
631
629
|
return channel.thread_metadata?.locked === true;
|
|
@@ -658,7 +656,7 @@ async function resolveGuildAdminActionPermissions(params) {
|
|
|
658
656
|
cfg: params.cfg,
|
|
659
657
|
accountId: params.accountId
|
|
660
658
|
}));
|
|
661
|
-
if (!
|
|
659
|
+
if (!isDiscordThreadChannelType("type" in channel ? channel.type : void 0)) return params.guard.permissions;
|
|
662
660
|
return params.values.archived === false && !("name" in params.values) && !("topic" in params.values) && !("position" in params.values) && !("parentId" in params.values) && !("clearParent" in params.values) && !("nsfw" in params.values) && !("rateLimitPerUser" in params.values) && !("locked" in params.values) && !("autoArchiveDuration" in params.values) && !isLockedThreadChannel(channel) ? [PermissionFlagsBits.ManageThreads, PermissionFlagsBits.SendMessagesInThreads] : [PermissionFlagsBits.ManageThreads];
|
|
663
661
|
}
|
|
664
662
|
async function verifySenderGuildAdminPermission(params) {
|
|
@@ -772,11 +770,23 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
772
770
|
}
|
|
773
771
|
case "emojiList": {
|
|
774
772
|
if (!isActionEnabled("reactions")) throw new Error("Discord reactions are disabled.");
|
|
775
|
-
const guildId =
|
|
773
|
+
const guildId = await resolveGuildIdForGuildAdminAction({
|
|
774
|
+
values: params,
|
|
775
|
+
accountId,
|
|
776
|
+
cfg
|
|
777
|
+
});
|
|
778
|
+
if (!guildId) throw new Error("Discord emoji listing requires guildId or a server channel.");
|
|
776
779
|
await assertGuildMetadataReadAllowed(guildId);
|
|
780
|
+
const limit = Math.min(readPositiveIntegerParam(params, "limit") ?? 100, 100);
|
|
781
|
+
const fetchEmojis = async () => (await discordGuildActionRuntime.listGuildEmojisDiscord(guildId, withOpts())).flatMap(({ name, id, animated }) => name && id ? [{
|
|
782
|
+
name,
|
|
783
|
+
identifier: `${name}:${id}`,
|
|
784
|
+
...animated ? { animated } : {}
|
|
785
|
+
}] : []).toSorted((left, right) => left.name.localeCompare(right.name) || left.identifier.localeCompare(right.identifier));
|
|
786
|
+
const gateway = getGateway(accountId ?? resolveDefaultDiscordAccountId(cfg));
|
|
777
787
|
return jsonResult({
|
|
778
788
|
ok: true,
|
|
779
|
-
emojis: await
|
|
789
|
+
emojis: (gateway ? await gateway.fetchGuildEmojis(guildId, fetchEmojis) : await fetchEmojis()).slice(0, limit)
|
|
780
790
|
});
|
|
781
791
|
}
|
|
782
792
|
case "emojiUpload": {
|
|
@@ -1259,7 +1269,7 @@ async function appendDiscordThreadRenameResult(ctx, params) {
|
|
|
1259
1269
|
};
|
|
1260
1270
|
}
|
|
1261
1271
|
try {
|
|
1262
|
-
if (!
|
|
1272
|
+
if (!isDiscordThreadChannelType((await discordMessagingActionRuntime.fetchChannelInfoDiscord(channelId, ctx.withOpts())).type)) return {
|
|
1263
1273
|
...params.payload,
|
|
1264
1274
|
warning: "Discord threadName was ignored because the send target is not a thread."
|
|
1265
1275
|
};
|
|
@@ -1292,8 +1302,13 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1292
1302
|
required: true,
|
|
1293
1303
|
label: "stickerIds"
|
|
1294
1304
|
});
|
|
1295
|
-
|
|
1296
|
-
|
|
1305
|
+
return jsonResult({
|
|
1306
|
+
ok: true,
|
|
1307
|
+
result: await discordMessagingActionRuntime.sendStickerDiscord(to, stickerIds, ctx.withOpts({
|
|
1308
|
+
content,
|
|
1309
|
+
...ctx.params.silent === true ? { silent: true } : {}
|
|
1310
|
+
}))
|
|
1311
|
+
});
|
|
1297
1312
|
}
|
|
1298
1313
|
case "sendMessage": {
|
|
1299
1314
|
if (!ctx.isActionEnabled("messages")) throw new Error("Discord message sends are disabled.");
|
|
@@ -1324,25 +1339,26 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1324
1339
|
...componentSpec,
|
|
1325
1340
|
text: normalizedContent
|
|
1326
1341
|
};
|
|
1342
|
+
const result = await discordMessagingActionRuntime.sendDiscordComponentMessage(to, payload, {
|
|
1343
|
+
...ctx.withOpts(),
|
|
1344
|
+
silent,
|
|
1345
|
+
reply: resolveActionReplyReference(ctx, replyTo),
|
|
1346
|
+
sessionKey: sessionKey ?? void 0,
|
|
1347
|
+
agentId: agentId ?? void 0,
|
|
1348
|
+
mediaUrl: mediaUrl ?? void 0,
|
|
1349
|
+
filename: filename ?? void 0,
|
|
1350
|
+
mediaAccess: ctx.options?.mediaAccess,
|
|
1351
|
+
mediaLocalRoots: ctx.options?.mediaLocalRoots,
|
|
1352
|
+
mediaReadFile: ctx.options?.mediaReadFile,
|
|
1353
|
+
...suppressEmbeds === void 0 ? {} : { suppressEmbeds }
|
|
1354
|
+
});
|
|
1327
1355
|
return jsonResult(await appendDiscordThreadRenameResult(ctx, {
|
|
1328
1356
|
payload: {
|
|
1329
1357
|
ok: true,
|
|
1330
|
-
result
|
|
1331
|
-
...ctx.withOpts(),
|
|
1332
|
-
silent,
|
|
1333
|
-
reply: resolveActionReplyReference(ctx, replyTo),
|
|
1334
|
-
sessionKey: sessionKey ?? void 0,
|
|
1335
|
-
agentId: agentId ?? void 0,
|
|
1336
|
-
mediaUrl: mediaUrl ?? void 0,
|
|
1337
|
-
filename: filename ?? void 0,
|
|
1338
|
-
mediaAccess: ctx.options?.mediaAccess,
|
|
1339
|
-
mediaLocalRoots: ctx.options?.mediaLocalRoots,
|
|
1340
|
-
mediaReadFile: ctx.options?.mediaReadFile,
|
|
1341
|
-
...suppressEmbeds === void 0 ? {} : { suppressEmbeds }
|
|
1342
|
-
}),
|
|
1358
|
+
result,
|
|
1343
1359
|
components: true
|
|
1344
1360
|
},
|
|
1345
|
-
target: to,
|
|
1361
|
+
target: result.receipt?.threadId ?? to,
|
|
1346
1362
|
threadName
|
|
1347
1363
|
}));
|
|
1348
1364
|
}
|
|
@@ -1367,24 +1383,25 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1367
1383
|
threadName
|
|
1368
1384
|
}));
|
|
1369
1385
|
}
|
|
1386
|
+
const result = await discordMessagingActionRuntime.sendMessageDiscord(to, content ?? "", {
|
|
1387
|
+
...ctx.withOpts(),
|
|
1388
|
+
mediaAccess: ctx.options?.mediaAccess,
|
|
1389
|
+
mediaUrl,
|
|
1390
|
+
filename: filename ?? void 0,
|
|
1391
|
+
mediaLocalRoots: ctx.options?.mediaLocalRoots,
|
|
1392
|
+
mediaReadFile: ctx.options?.mediaReadFile,
|
|
1393
|
+
reply: resolveActionReplyReference(ctx, replyTo),
|
|
1394
|
+
components,
|
|
1395
|
+
embeds,
|
|
1396
|
+
silent,
|
|
1397
|
+
...suppressEmbeds === void 0 ? {} : { suppressEmbeds }
|
|
1398
|
+
});
|
|
1370
1399
|
return jsonResult(await appendDiscordThreadRenameResult(ctx, {
|
|
1371
1400
|
payload: {
|
|
1372
1401
|
ok: true,
|
|
1373
|
-
result
|
|
1374
|
-
...ctx.withOpts(),
|
|
1375
|
-
mediaAccess: ctx.options?.mediaAccess,
|
|
1376
|
-
mediaUrl,
|
|
1377
|
-
filename: filename ?? void 0,
|
|
1378
|
-
mediaLocalRoots: ctx.options?.mediaLocalRoots,
|
|
1379
|
-
mediaReadFile: ctx.options?.mediaReadFile,
|
|
1380
|
-
reply: resolveActionReplyReference(ctx, replyTo),
|
|
1381
|
-
components,
|
|
1382
|
-
embeds,
|
|
1383
|
-
silent,
|
|
1384
|
-
...suppressEmbeds === void 0 ? {} : { suppressEmbeds }
|
|
1385
|
-
})
|
|
1402
|
+
result
|
|
1386
1403
|
},
|
|
1387
|
-
target: to,
|
|
1404
|
+
target: result.receipt?.threadId ?? to,
|
|
1388
1405
|
threadName
|
|
1389
1406
|
}));
|
|
1390
1407
|
}
|
|
@@ -1465,7 +1482,8 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1465
1482
|
mediaAccess: ctx.options?.mediaAccess,
|
|
1466
1483
|
mediaLocalRoots: ctx.options?.mediaLocalRoots,
|
|
1467
1484
|
mediaReadFile: ctx.options?.mediaReadFile,
|
|
1468
|
-
reply: resolveActionReplyReference(ctx, replyTo)
|
|
1485
|
+
reply: resolveActionReplyReference(ctx, replyTo),
|
|
1486
|
+
...ctx.params.silent === true ? { silent: true } : {}
|
|
1469
1487
|
})
|
|
1470
1488
|
});
|
|
1471
1489
|
}
|
|
@@ -1587,13 +1605,13 @@ const VALID_STATUSES = /* @__PURE__ */ new Set([
|
|
|
1587
1605
|
"idle",
|
|
1588
1606
|
"invisible"
|
|
1589
1607
|
]);
|
|
1590
|
-
async function handleDiscordPresenceAction(action, params, isActionEnabled) {
|
|
1608
|
+
async function handleDiscordPresenceAction(action, params, isActionEnabled, cfg) {
|
|
1591
1609
|
if (action !== "setPresence") throw new Error(`Unknown presence action: ${action}`);
|
|
1592
1610
|
if (!isActionEnabled("presence", false)) throw new Error("Discord presence changes are disabled.");
|
|
1593
|
-
const accountId = readStringParam(params, "accountId");
|
|
1611
|
+
const accountId = readStringParam(params, "accountId") ?? resolveDefaultDiscordAccountId(cfg);
|
|
1594
1612
|
const gateway = getGateway(accountId);
|
|
1595
|
-
if (!gateway) throw new Error(`Discord gateway not available
|
|
1596
|
-
if (!gateway.isConnected) throw new Error(`Discord gateway is not connected
|
|
1613
|
+
if (!gateway) throw new Error(`Discord gateway not available for account "${accountId}". The bot may not be connected.`);
|
|
1614
|
+
if (!gateway.isConnected) throw new Error(`Discord gateway is not connected for account "${accountId}".`);
|
|
1597
1615
|
const statusRaw = readStringParam(params, "status") ?? "online";
|
|
1598
1616
|
if (!VALID_STATUSES.has(statusRaw)) throw new Error(`Invalid status "${statusRaw}". Must be one of: ${[...VALID_STATUSES].join(", ")}`);
|
|
1599
1617
|
const status = statusRaw;
|
|
@@ -1681,7 +1699,6 @@ const moderationActions = /* @__PURE__ */ new Set([
|
|
|
1681
1699
|
"kick",
|
|
1682
1700
|
"ban"
|
|
1683
1701
|
]);
|
|
1684
|
-
const presenceActions = /* @__PURE__ */ new Set(["setPresence"]);
|
|
1685
1702
|
async function handleDiscordAction(params, cfg, options) {
|
|
1686
1703
|
const action = readStringParam(params, "action", { required: true });
|
|
1687
1704
|
const isActionEnabled = createDiscordActionGate({
|
|
@@ -1691,7 +1708,7 @@ async function handleDiscordAction(params, cfg, options) {
|
|
|
1691
1708
|
if (messagingActions.has(action)) return await handleDiscordMessagingAction(action, params, isActionEnabled, cfg, options);
|
|
1692
1709
|
if (guildActions.has(action)) return await handleDiscordGuildAction(action, params, isActionEnabled, cfg, options);
|
|
1693
1710
|
if (moderationActions.has(action)) return await handleDiscordModerationAction(action, params, isActionEnabled, cfg);
|
|
1694
|
-
if (
|
|
1711
|
+
if (action === "setPresence") return await handleDiscordPresenceAction(action, params, isActionEnabled, cfg);
|
|
1695
1712
|
throw new Error(`Unknown action: ${action}`);
|
|
1696
1713
|
}
|
|
1697
1714
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as resolveDiscordAccount, g as selectDiscordActivitiesRuntimeConfig, n as isDiscordAccountEnabledForRuntime, r as listDiscordAccountIds } from "./accounts-
|
|
2
|
-
import {
|
|
1
|
+
import { c as resolveDiscordAccount, g as selectDiscordActivitiesRuntimeConfig, n as isDiscordAccountEnabledForRuntime, r as listDiscordAccountIds } from "./accounts-CfQ-vSyf.js";
|
|
2
|
+
import { z as resolveDiscordProxyFetchForAccount } from "./send.shared-JjljcV4O.js";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
//#region extensions/discord/src/activities/config.ts
|
|
5
5
|
function resolveDiscordActivitiesConfig(account, env = process.env) {
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-ChK1wS7w.js";
|
|
1
|
+
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-DKKAw5VX.js";
|
|
3
2
|
import { r as setDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
4
|
-
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-
|
|
3
|
+
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-DSAJSrJk.js";
|
|
5
4
|
import { _ as resolveDiscordShouldRequireMention, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, f as resolveDiscordGuildEntry, n as isDiscordGroupAllowedByPolicy, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, t as allowListMatches, u as resolveDiscordCommandAuthorized, v as resolveGroupDmAllow, y as shouldEmitDiscordReactionNotification } from "./allow-list-BDMimASD.js";
|
|
6
|
-
import { C as hasAllGuildPermissionsDiscord, G as
|
|
7
|
-
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
5
|
+
import { C as hasAllGuildPermissionsDiscord, G as unregisterGateway, H as clearGateways, S as fetchMemberGuildPermissionsDiscord, T as hasAnyGuildPermissionDiscord, U as getGateway, W as registerGateway, _ as DiscordSendError, x as fetchChannelPermissionsDiscord } from "./send.shared-JjljcV4O.js";
|
|
6
|
+
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-zam0TrZx.js";
|
|
8
7
|
import { i as setPresence, n as getPresence, r as presenceCacheSize, t as clearPresences } from "./presence-cache-z1N8MbJ3.js";
|
|
9
|
-
import { A as
|
|
8
|
+
import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, c as sendWebhookMessageDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-C49MFF9j.js";
|
|
10
9
|
import { a as isAbortError, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, l as runDiscordTaskWithTimeout, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, o as normalizeDiscordInboundWorkerTimeoutMs, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, s as normalizeDiscordListenerTimeoutMs, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-B9cy6RvQ.js";
|
|
11
|
-
import { i as
|
|
12
|
-
import {
|
|
13
|
-
import { t as discordMessageActions } from "./channel-actions-Dr2QI8Bf.js";
|
|
10
|
+
import { c as readDiscordChannelMoveParams, i as requiredGuildPermissionForModerationAction, l as readDiscordParentIdParam, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-BHrTlFkf.js";
|
|
11
|
+
import { p as discordMessageActions, t as resolveDiscordOutboundSessionRoute } from "./outbound-session-route-Cg15ZFJd.js";
|
|
14
12
|
import { C as resolveThreadBindingMaxAgeExpiresAt, S as resolveThreadBindingInactivityExpiresAt, w as resolveThreadBindingMaxAgeMs, x as resolveThreadBindingIdleTimeoutMs } from "./thread-bindings.state-D8OMdk4O.js";
|
|
15
13
|
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-CJb-BpPL.js";
|
|
16
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
17
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
18
|
-
import { _ as resolveThreadBindingThreadName, g as resolveThreadBindingIntroText, h as formatThreadBindingDurationLabel, m as resolveThreadBindingPersonaFromRecord, n as createThreadBindingManager, p as resolveThreadBindingPersona, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-
|
|
19
|
-
import { a as reconcileAcpThreadBindingsOnStartup, c as resolveDiscordThreadBindingMaxAgeMs, i as listThreadBindingsForAccount, l as resolveThreadBindingsEnabled, n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey, s as resolveDiscordThreadBindingIdleTimeoutMs } from "./thread-bindings-
|
|
20
|
-
import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
21
|
-
import "./
|
|
22
|
-
import {
|
|
23
|
-
import "./
|
|
24
|
-
import {
|
|
25
|
-
import { o as sanitizeDiscordThreadName, r as resolveDiscordReplyTarget } from "./threading-DU6pgeGm.js";
|
|
26
|
-
import { t as createDiscordMessageHandler } from "./message-handler-B61q5MOF.js";
|
|
27
|
-
import "./runtime-api.monitor-CzeTYF32.js";
|
|
28
|
-
import "./runtime-api.send.js";
|
|
29
|
-
import "./runtime-api.threads.js";
|
|
14
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-C2sT_n67.js";
|
|
15
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-CzpjLwjy.js";
|
|
16
|
+
import { _ as resolveThreadBindingThreadName, g as resolveThreadBindingIntroText, h as formatThreadBindingDurationLabel, m as resolveThreadBindingPersonaFromRecord, n as createThreadBindingManager, p as resolveThreadBindingPersona, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-ByOtwjo_.js";
|
|
17
|
+
import { a as reconcileAcpThreadBindingsOnStartup, c as resolveDiscordThreadBindingMaxAgeMs, i as listThreadBindingsForAccount, l as resolveThreadBindingsEnabled, n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey, s as resolveDiscordThreadBindingIdleTimeoutMs } from "./thread-bindings-DW5F9vat.js";
|
|
18
|
+
import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-n6ZXxK8V.js";
|
|
19
|
+
import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-CBEv_ERu.js";
|
|
20
|
+
import { d as waitForDiscordGatewayPluginRegistration, f as createDiscordNativeCommand, l as createDiscordGatewayPlugin, t as monitorDiscordProvider, u as resolveDiscordGatewayIntents, v as registerDiscordListener } from "./provider-B11xwilq.js";
|
|
21
|
+
import { o as sanitizeDiscordThreadName, r as resolveDiscordReplyTarget } from "./threading-agH1T_6s.js";
|
|
22
|
+
import { t as createDiscordMessageHandler } from "./message-handler-BXpWZyni.js";
|
|
30
23
|
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, DiscordSendError, addRoleDiscord, allowListMatches, auditDiscordChannelPermissions, autoBindSpawnedDiscordSubagent, banMemberDiscord, clearGateways, clearPresences, collectDiscordAuditChannelIds, createChannelDiscord, createDiscordGatewayPlugin, createDiscordMessageHandler, createDiscordNativeCommand, createNoopThreadBindingManager, createScheduledEventDiscord, createThreadBindingManager, createThreadDiscord, deleteChannelDiscord, deleteMessageDiscord, discordMessageActions, editChannelDiscord, editDiscordComponentMessage, editMessageDiscord, fetchChannelInfoDiscord, fetchChannelPermissionsDiscord, fetchDiscordApplicationId, fetchDiscordApplicationSummary, fetchMemberGuildPermissionsDiscord, fetchMemberInfoDiscord, fetchMessageDiscord, fetchReactionsDiscord, fetchRoleInfoDiscord, fetchVoiceStatusDiscord, formatThreadBindingDurationLabel, getGateway, getPresence, getThreadBindingManager, handleDiscordAction, hasAllGuildPermissionsDiscord, hasAnyGuildPermissionDiscord, isAbortError, isDiscordGroupAllowedByPolicy, isDiscordModerationAction, kickMemberDiscord, listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive, listGuildChannelsDiscord, listGuildEmojisDiscord, listPinsDiscord, listScheduledEventsDiscord, listThreadBindingsBySessionKey, listThreadBindingsForAccount, listThreadsDiscord, monitorDiscordProvider, moveChannelDiscord, normalizeDiscordAllowList, normalizeDiscordInboundWorkerTimeoutMs, normalizeDiscordListenerTimeoutMs, normalizeDiscordSlug, parseApplicationIdFromToken, pinMessageDiscord, presenceCacheSize, probeDiscord, reactMessageDiscord, readDiscordChannelCreateParams, readDiscordChannelEditParams, readDiscordChannelMoveParams, readDiscordModerationCommand, readDiscordParentIdParam, readMessagesDiscord, reconcileAcpThreadBindingsOnStartup, registerBuiltDiscordComponentMessage, registerDiscordListener, registerGateway, removeChannelPermissionDiscord, removeOwnReactionsDiscord, removeReactionDiscord, removeRoleDiscord, requiredGuildPermissionForModerationAction, resolveDiscordChannelAllowlist, resolveDiscordChannelConfig, resolveDiscordChannelConfigWithFallback, resolveDiscordCommandAuthorized, resolveDiscordGatewayIntents, resolveDiscordGuildEntry, resolveDiscordOutboundSessionRoute, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordReplyTarget, resolveDiscordShouldRequireMention, resolveDiscordThreadBindingIdleTimeoutMs, resolveDiscordThreadBindingMaxAgeMs, resolveDiscordUserAllowlist, resolveEventCoverImage, resolveGroupDmAllow, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingInactivityExpiresAt, resolveThreadBindingIntroText, resolveThreadBindingMaxAgeExpiresAt, resolveThreadBindingMaxAgeMs, resolveThreadBindingPersona, resolveThreadBindingPersonaFromRecord, resolveThreadBindingThreadName, resolveThreadBindingsEnabled, runDiscordTaskWithTimeout, sanitizeDiscordThreadName, searchMessagesDiscord, sendDiscordComponentMessage, sendMessageDiscord, sendPollDiscord, sendStickerDiscord, sendTypingDiscord, sendVoiceMessageDiscord, sendWebhookMessageDiscord, setChannelPermissionDiscord, setDiscordRuntime, setPresence, setThreadBindingIdleTimeoutBySessionKey, setThreadBindingMaxAgeBySessionKey, shouldEmitDiscordReactionNotification, timeoutMemberDiscord, unbindThreadBindingsBySessionKey, unpinMessageDiscord, unregisterGateway, uploadEmojiDiscord, uploadStickerDiscord, waitForDiscordGatewayPluginRegistration };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { y as discord_exports } from "./retry-Cv4jCU5Z.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
@@ -99,29 +99,6 @@ function buildWavBuffer(pcm) {
|
|
|
99
99
|
header.writeUInt32LE(pcm.length, 40);
|
|
100
100
|
return Buffer.concat([header, pcm]);
|
|
101
101
|
}
|
|
102
|
-
async function createOpusDecoder(params) {
|
|
103
|
-
let decoder;
|
|
104
|
-
try {
|
|
105
|
-
decoder = await createDecoder({
|
|
106
|
-
channels: CHANNELS,
|
|
107
|
-
sampleRate: SAMPLE_RATE
|
|
108
|
-
});
|
|
109
|
-
} catch (err) {
|
|
110
|
-
const failure = formatErrorMessage(err);
|
|
111
|
-
if (!warnedOpusMissing) {
|
|
112
|
-
warnedOpusMissing = true;
|
|
113
|
-
params.onWarn(`discord voice: no usable opus decoder available (libopus-wasm: ${failure}); cannot decode voice audio`);
|
|
114
|
-
}
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
name: "libopus-wasm",
|
|
119
|
-
decoder: {
|
|
120
|
-
decode: (buffer) => pcmInt16ToBuffer(decoder.decode(buffer, { maxFrameSize: DISCORD_OPUS_FRAME_SIZE })),
|
|
121
|
-
free: () => decoder.free()
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
102
|
function createDiscordOpusEncodeStream() {
|
|
126
103
|
return new DiscordOpusEncodeStream();
|
|
127
104
|
}
|
|
@@ -185,99 +162,92 @@ function createDiscordOpusPlaybackStream(input) {
|
|
|
185
162
|
}
|
|
186
163
|
var DiscordOpusEncodeStream = class extends Transform {
|
|
187
164
|
#buffer = Buffer.alloc(0);
|
|
188
|
-
#encoder
|
|
189
|
-
#encoderPromise = null;
|
|
165
|
+
#encoder;
|
|
190
166
|
constructor() {
|
|
191
167
|
super({ readableObjectMode: true });
|
|
192
168
|
}
|
|
193
|
-
|
|
194
|
-
|
|
169
|
+
_construct(done) {
|
|
170
|
+
createEncoder({
|
|
195
171
|
application: Application.Audio,
|
|
196
172
|
channels: CHANNELS,
|
|
197
173
|
sampleRate: SAMPLE_RATE
|
|
198
|
-
})
|
|
199
|
-
|
|
200
|
-
|
|
174
|
+
}).then((encoder) => {
|
|
175
|
+
this.#encoder = encoder;
|
|
176
|
+
done();
|
|
177
|
+
}, (err) => done(err instanceof Error ? err : new Error(formatErrorMessage(err))));
|
|
201
178
|
}
|
|
202
179
|
_transform(chunk, _encoding, done) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
this.#buffer = this.#buffer.subarray(DISCORD_OPUS_FRAME_BYTES);
|
|
210
|
-
this.push(Buffer.from(encoder.encode(frame, { frameSize: DISCORD_OPUS_FRAME_SIZE })));
|
|
211
|
-
}
|
|
212
|
-
done();
|
|
213
|
-
} catch (err) {
|
|
214
|
-
done(err instanceof Error ? err : new Error(formatErrorMessage(err)));
|
|
180
|
+
try {
|
|
181
|
+
this.#buffer = this.#buffer.length > 0 ? Buffer.concat([this.#buffer, chunk]) : Buffer.from(chunk);
|
|
182
|
+
while (this.#buffer.length >= DISCORD_OPUS_FRAME_BYTES) {
|
|
183
|
+
const frame = this.#buffer.subarray(0, DISCORD_OPUS_FRAME_BYTES);
|
|
184
|
+
this.#buffer = this.#buffer.subarray(DISCORD_OPUS_FRAME_BYTES);
|
|
185
|
+
this.#encodeFrame(frame);
|
|
215
186
|
}
|
|
216
|
-
|
|
187
|
+
done();
|
|
188
|
+
} catch (err) {
|
|
189
|
+
done(err instanceof Error ? err : new Error(formatErrorMessage(err)));
|
|
190
|
+
}
|
|
217
191
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
this.#buffer = Buffer.alloc(0);
|
|
226
|
-
this.push(Buffer.from(encoder.encode(frame, { frameSize: DISCORD_OPUS_FRAME_SIZE })));
|
|
227
|
-
}
|
|
228
|
-
this.#freeEncoder();
|
|
229
|
-
done();
|
|
230
|
-
} catch (err) {
|
|
231
|
-
done(err instanceof Error ? err : new Error(formatErrorMessage(err)));
|
|
192
|
+
_flush(done) {
|
|
193
|
+
try {
|
|
194
|
+
if (this.#buffer.length > 0) {
|
|
195
|
+
const frame = Buffer.alloc(DISCORD_OPUS_FRAME_BYTES);
|
|
196
|
+
this.#buffer.copy(frame);
|
|
197
|
+
this.#buffer = Buffer.alloc(0);
|
|
198
|
+
this.#encodeFrame(frame);
|
|
232
199
|
}
|
|
233
|
-
|
|
200
|
+
done();
|
|
201
|
+
} catch (err) {
|
|
202
|
+
done(err instanceof Error ? err : new Error(formatErrorMessage(err)));
|
|
203
|
+
}
|
|
234
204
|
}
|
|
235
205
|
_destroy(err, done) {
|
|
236
|
-
this.#
|
|
206
|
+
this.#encoder?.free();
|
|
207
|
+
this.#buffer = Buffer.alloc(0);
|
|
237
208
|
done(err);
|
|
238
209
|
}
|
|
239
|
-
#
|
|
240
|
-
this.#encoder
|
|
241
|
-
this.#encoder = null;
|
|
210
|
+
#encodeFrame(frame) {
|
|
211
|
+
this.push(Buffer.from(this.#encoder.encode(frame, { frameSize: DISCORD_OPUS_FRAME_SIZE })));
|
|
242
212
|
}
|
|
243
213
|
};
|
|
244
214
|
function pcmInt16ToBuffer(pcm) {
|
|
245
215
|
return Buffer.from(pcm.buffer, pcm.byteOffset, pcm.byteLength);
|
|
246
216
|
}
|
|
247
217
|
async function decodeOpusStream(stream, params) {
|
|
248
|
-
const selected = await createOpusDecoder({ onWarn: params.onWarn });
|
|
249
|
-
if (!selected) return Buffer.alloc(0);
|
|
250
|
-
params.onVerbose(`opus decoder: ${selected.name}`);
|
|
251
218
|
const chunks = [];
|
|
219
|
+
await decodeOpusStreamChunks(stream, {
|
|
220
|
+
...params,
|
|
221
|
+
onChunk: (chunk) => chunks.push(chunk)
|
|
222
|
+
});
|
|
223
|
+
return Buffer.concat(chunks);
|
|
224
|
+
}
|
|
225
|
+
async function decodeOpusStreamChunks(stream, params) {
|
|
226
|
+
let decoder;
|
|
252
227
|
try {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
228
|
+
decoder = await createDecoder({
|
|
229
|
+
channels: CHANNELS,
|
|
230
|
+
sampleRate: SAMPLE_RATE
|
|
231
|
+
});
|
|
258
232
|
} catch (err) {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
233
|
+
if (!warnedOpusMissing) {
|
|
234
|
+
warnedOpusMissing = true;
|
|
235
|
+
params.onWarn(`discord voice: no usable opus decoder available (libopus-wasm: ${formatErrorMessage(err)}); cannot decode voice audio`);
|
|
236
|
+
}
|
|
237
|
+
return;
|
|
263
238
|
}
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
async function decodeOpusStreamChunks(stream, params) {
|
|
267
|
-
const selected = await createOpusDecoder({ onWarn: params.onWarn });
|
|
268
|
-
if (!selected) return;
|
|
269
|
-
params.onVerbose(`opus decoder: ${selected.name}`);
|
|
239
|
+
params.onVerbose("opus decoder: libopus-wasm");
|
|
270
240
|
try {
|
|
271
241
|
for await (const chunk of stream) {
|
|
272
242
|
if (!chunk || !(chunk instanceof Buffer) || chunk.length === 0) continue;
|
|
273
|
-
const decoded =
|
|
274
|
-
if (decoded
|
|
243
|
+
const decoded = decoder.decode(chunk, { maxFrameSize: DISCORD_OPUS_FRAME_SIZE });
|
|
244
|
+
if (decoded.length > 0) params.onChunk(pcmInt16ToBuffer(decoded));
|
|
275
245
|
}
|
|
276
246
|
} catch (err) {
|
|
277
247
|
params.onError?.(err);
|
|
278
248
|
if (shouldLogVerbose()) logVerbose(`discord voice: opus decode failed: ${formatErrorMessage(err)}`);
|
|
279
249
|
} finally {
|
|
280
|
-
|
|
250
|
+
decoder.free();
|
|
281
251
|
}
|
|
282
252
|
}
|
|
283
253
|
function convertDiscordPcm48kStereoToRealtimePcm24kMono(pcm) {
|
|
@@ -338,7 +308,6 @@ const CAPTURE_FINALIZE_GRACE_MS = 2e3;
|
|
|
338
308
|
const VOICE_CONNECT_READY_TIMEOUT_MS = 3e4;
|
|
339
309
|
const VOICE_RECONNECT_GRACE_MS = 15e3;
|
|
340
310
|
const PLAYBACK_READY_TIMEOUT_MS = 6e4;
|
|
341
|
-
const SPEAKING_READY_TIMEOUT_MS = 6e4;
|
|
342
311
|
function resolveVoiceTimeoutMs(value, fallbackMs) {
|
|
343
312
|
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return fallbackMs;
|
|
344
313
|
return Math.floor(value);
|
|
@@ -366,4 +335,4 @@ function loadDiscordVoiceSdk() {
|
|
|
366
335
|
return cachedDiscordVoiceSdk;
|
|
367
336
|
}
|
|
368
337
|
//#endregion
|
|
369
|
-
export {
|
|
338
|
+
export { decodeOpusStreamChunks as _, VOICE_CONNECT_READY_TIMEOUT_MS as a, maybeControlDiscordVoiceAgentRun as b, isVoiceChannel as c, resolveVoiceTimeoutMs as d, convertDiscordPcm48kStereoToRealtimePcm24kMono as f, decodeOpusStream as g, createDiscordOpusPlaybackStream as h, PLAYBACK_READY_TIMEOUT_MS as i, logVoiceVerbose as l, createDiscordOpusEncodeStream as m, CAPTURE_FINALIZE_GRACE_MS as n, VOICE_RECONNECT_GRACE_MS as o, convertRealtimePcm24kMonoToDiscordPcm48kStereo as p, MIN_SEGMENT_SECONDS as r, isDiscordRealtimeVoiceMode as s, loadDiscordVoiceSdk as t, resolveDiscordVoiceMode as u, writeVoiceWavFile as v, formatVoiceLogPreview as x, formatVoiceIngressPrompt as y };
|