@openclaw/discord 2026.8.1-beta.3 → 2026.8.2
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-BY-ve3yH.js +45 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-DNl-oCEw.js → accounts-CwJQoLjM.js} +87 -162
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-KCBAmWxD.js → activities-api-CkKcHUB6.js} +14 -12
- package/dist/activities-api.js +1 -1
- package/dist/{allow-list-BDMimASD.js → allow-list-C2JuH-R0.js} +10 -6
- package/dist/{api-DNVbJyEy.js → api-BfmEP6wp.js} +6 -5
- package/dist/api.js +18 -18
- package/dist/{approval-handler.runtime-B12RCYr8.js → approval-handler.runtime-DZM6Kt1Z.js} +30 -106
- package/dist/{audit-Yc7eZDd6.js → audit-DIbQA4VT.js} +8 -7
- package/dist/{channel-cXYzGc4L.js → channel-CarzU3bg.js} +25 -25
- package/dist/{channel-actions.runtime-CODTvo7c.js → channel-actions.runtime-B2wMqeVK.js} +60 -57
- 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-z_ewMVa9.js} +18 -18
- package/dist/{components-ezGKo_Yh.js → components-gvRA0oaI.js} +33 -29
- package/dist/{config-schema-DC5kDtQ5.js → config-schema-B797-Spt.js} +21 -14
- package/dist/{conversation-binding-route-D6rCQ5S0.js → conversation-binding-route-DPpBRpYI.js} +1 -1
- package/dist/{directory-config-XyCfoqLg.js → directory-config-AA8wQx0D.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-Df0NbFJB.js → directory-live-D_kFz_Fj.js} +4 -4
- package/dist/{doctor-DYY31GrO.js → doctor-QQTOkBfW.js} +5 -5
- package/dist/{doctor-contract-DsWvKIXF.js → doctor-contract-Co5vRCZ6.js} +9 -6
- package/dist/doctor-contract-api.js +4 -3
- package/dist/{handle-action.guild-admin-6Tvvinsa.js → handle-action.guild-admin-Cc88ZGon.js} +9 -5
- package/dist/index.js +1 -1
- package/dist/ingress-identity-BCzfPPYM.js +60 -0
- package/dist/{message-handler-B61q5MOF.js → message-handler-CAeEpqWo.js} +14 -10
- package/dist/{message-handler.preflight-Bzg_Hawz.js → message-handler.preflight-CoKoE3dY.js} +32 -91
- package/dist/{message-handler.process--4_712Ec.js → message-handler.process-cdIJ_fDT.js} +99 -123
- package/dist/{message-utils-BXLLnFl6.js → message-text-C0K4-fkg.js} +41 -34
- package/dist/{outbound-adapter-DxHTOqiN.js → outbound-adapter-Ch0At5Ra.js} +85 -78
- package/dist/{outbound-components-B2PL0ooH.js → outbound-components-Bnt_7x7r.js} +5 -4
- package/dist/outbound-session-route-CzzerX2K.js +668 -0
- package/dist/{owner-access-Bg41VzAf.js → owner-access-yc1sX7Gx.js} +7 -6
- package/dist/{pluralkit-dUl4v1X3.js → pluralkit-B3cUVI7i.js} +2 -2
- package/dist/{probe-BTdtVRwU.js → probe-3ovFAp3b.js} +3 -3
- package/dist/{probe.runtime-Dq5-PRKT.js → probe.runtime-BckHn3cJ.js} +1 -1
- package/dist/{provider-DlK_ynqt.js → provider-CjI8BSzS.js} +511 -342
- package/dist/{provider-session.runtime-CvvphHvs.js → provider-session.runtime-DdKRMcE9.js} +3 -3
- package/dist/provider.runtime-Bo1WbLLr.js +2 -0
- package/dist/{realtime-session.runtime-ysbMG8v7.js → realtime-session.runtime-37IC-p5K.js} +110 -126
- package/dist/{resolve-allowlist-common-DIVXbD1P.js → resolve-allowlist-common-BJ5UZNNT.js} +3 -3
- package/dist/{resolve-channels-CGeUoIqb.js → resolve-channels-BexR2eUn.js} +6 -5
- package/dist/{resolve-users-BtKxLUZv.js → resolve-users-BtXBCH5W.js} +5 -4
- package/dist/{retry-after-DdLPmPoa.js → retry-after-BrLjLUJi.js} +2 -1
- package/dist/{retry-DNsVTeTo.js → retry-t5RcEsPk.js} +237 -15
- package/dist/{runtime-CQovMsH3.js → runtime-BNlDfLwS.js} +2 -2
- package/dist/{runtime-D71_VFLr.js → runtime-DydyfxST.js} +182 -131
- package/dist/runtime-api.js +19 -26
- package/dist/{secret-config-contract-B3i6WxV5.js → secret-config-contract-DFu9hfU8.js} +14 -6
- package/dist/secret-contract-api.js +1 -1
- 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-mTKSBdmZ.js} +149 -58
- package/dist/{send.components-ChK1wS7w.js → send.components-nsPnc7kK.js} +29 -30
- package/dist/{send.outbound-HIkgji_7.js → send.outbound-CaOs9Zy1.js} +87 -84
- package/dist/{send.shared-B3fpaLWJ.js → send.shared-BJHt0Vyf.js} +55 -33
- package/dist/{sender-identity-BJtfyise.js → sender-identity-Dt0imZyY.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-CaAaoksy.js → shared-BNesVA4P.js} +43 -18
- package/dist/{subagent-hooks-CNT2ZJTJ.js → subagent-hooks-IeZVPLGj.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -6
- package/dist/{system-events-Nuwoq_au.js → system-events-Be5EJI3b.js} +2 -2
- package/dist/{target-resolver-DIXShHaZ.js → target-resolver-C0MnwEki.js} +6 -5
- package/dist/targets-DQSye1Rv.js +3 -0
- package/dist/{thread-bindings-VlymUnbz.js → thread-bindings-wECUSIIG.js} +6 -6
- package/dist/{thread-bindings.manager-CngsgErq.js → thread-bindings.manager-B-3UHCc1.js} +31 -32
- package/dist/{thread-bindings.session-updates-CJb-BpPL.js → thread-bindings.session-updates-CC7HoQvt.js} +2 -1
- package/dist/{threading-DU6pgeGm.js → threading-te5ADPQI.js} +51 -27
- package/dist/{timeouts-B9cy6RvQ.js → timeouts-D86uWLt_.js} +1 -1
- package/dist/{transcripts-source-DeIMNbRh.js → transcripts-source-DkUhR7YK.js} +9 -4
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-oLiS5Z13.js → typing-DAwJF5VT.js} +2 -2
- package/dist/{voice-runtime-CjNFaynA.js → voice-runtime-COyYYTDD.js} +418 -74
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/README.md +1 -1
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/conforms.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/package.json +3 -3
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubArray.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubObject.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubString.d.ts +2 -0
- 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 +41 -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 +14 -6
- package/package.json +8 -8
- package/skills/discord/SKILL.md +1 -1
- package/dist/account-inspect-D5xmUpnj.js +0 -89
- 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/sdk-runtime-37OU6_Yh.js +0 -369
- 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,4 +1,4 @@
|
|
|
1
|
-
import { c as resolveDiscordChannelInfoSafe } from "./thread-bindings.manager-
|
|
1
|
+
import { c as resolveDiscordChannelInfoSafe } from "./thread-bindings.manager-B-3UHCc1.js";
|
|
2
2
|
import { ComponentType, StickerFormatType } from "discord-api-types/v10";
|
|
3
3
|
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -11,8 +11,8 @@ import { formatMediaPlaceholderText } from "openclaw/plugin-sdk/channel-inbound"
|
|
|
11
11
|
const discordChannelInfoCacheState = { entries: /* @__PURE__ */ new Map() };
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region extensions/discord/src/monitor/message-channel-info.ts
|
|
14
|
-
const DISCORD_CHANNEL_INFO_CACHE_TTL_MS =
|
|
15
|
-
const DISCORD_CHANNEL_INFO_NEGATIVE_CACHE_TTL_MS =
|
|
14
|
+
const DISCORD_CHANNEL_INFO_CACHE_TTL_MS = 3e5;
|
|
15
|
+
const DISCORD_CHANNEL_INFO_NEGATIVE_CACHE_TTL_MS = 3e4;
|
|
16
16
|
const DISCORD_CHANNEL_INFO_CACHE_MAX_ENTRIES = 1e3;
|
|
17
17
|
function resolveDiscordChannelInfoCacheExpiresAt(ttlMs, nowMs) {
|
|
18
18
|
return resolveExpiresAtMsFromDurationMs(ttlMs, { nowMs });
|
|
@@ -68,6 +68,34 @@ async function resolveDiscordChannelInfo(client, channelId) {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
//#endregion
|
|
71
|
+
//#region extensions/discord/src/monitor/media-ssrf-policy.ts
|
|
72
|
+
const DISCORD_MEDIA_SSRF_POLICY = {
|
|
73
|
+
hostnameAllowlist: [
|
|
74
|
+
"cdn.discordapp.com",
|
|
75
|
+
"media.discordapp.net",
|
|
76
|
+
"*.discordapp.com",
|
|
77
|
+
"*.discordapp.net"
|
|
78
|
+
],
|
|
79
|
+
allowRfc2544BenchmarkRange: true
|
|
80
|
+
};
|
|
81
|
+
function mergeHostnameList(...lists) {
|
|
82
|
+
const merged = lists.flatMap((list) => list ?? []).map((value) => value.trim()).filter((value) => value.length > 0);
|
|
83
|
+
return merged.length > 0 ? uniqueStrings(merged) : void 0;
|
|
84
|
+
}
|
|
85
|
+
/** Merges caller network policy with the Discord-owned CDN allowlist. */
|
|
86
|
+
function resolveDiscordCdnPolicy(policy) {
|
|
87
|
+
if (!policy) return DISCORD_MEDIA_SSRF_POLICY;
|
|
88
|
+
const hostnameAllowlist = mergeHostnameList(DISCORD_MEDIA_SSRF_POLICY.hostnameAllowlist, policy.hostnameAllowlist);
|
|
89
|
+
const allowedHostnames = mergeHostnameList(DISCORD_MEDIA_SSRF_POLICY.allowedHostnames, policy.allowedHostnames);
|
|
90
|
+
return {
|
|
91
|
+
...DISCORD_MEDIA_SSRF_POLICY,
|
|
92
|
+
...policy,
|
|
93
|
+
...allowedHostnames ? { allowedHostnames } : {},
|
|
94
|
+
...hostnameAllowlist ? { hostnameAllowlist } : {},
|
|
95
|
+
allowRfc2544BenchmarkRange: Boolean(DISCORD_MEDIA_SSRF_POLICY.allowRfc2544BenchmarkRange) || Boolean(policy.allowRfc2544BenchmarkRange)
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
71
99
|
//#region extensions/discord/src/monitor/message-forwarded.ts
|
|
72
100
|
const FORWARD_MESSAGE_REFERENCE_TYPE = 1;
|
|
73
101
|
function normalizeDiscordStickerItems(value) {
|
|
@@ -103,6 +131,11 @@ function resolveDiscordReferencedReplyMessage(message) {
|
|
|
103
131
|
const referenceType = message.messageReference?.type;
|
|
104
132
|
return Number(referenceType) === FORWARD_MESSAGE_REFERENCE_TYPE ? null : message.referencedMessage ?? null;
|
|
105
133
|
}
|
|
134
|
+
function resolveDiscordReferencedReplyMessageId(message) {
|
|
135
|
+
const referenceType = message.messageReference?.type;
|
|
136
|
+
if (Number(referenceType) === FORWARD_MESSAGE_REFERENCE_TYPE) return null;
|
|
137
|
+
return normalizeOptionalString(message.messageReference?.message_id) ?? normalizeOptionalString(message.referencedMessage?.id) ?? null;
|
|
138
|
+
}
|
|
106
139
|
function formatDiscordSnapshotAuthor(author) {
|
|
107
140
|
if (!author) return;
|
|
108
141
|
const globalName = normalizeOptionalString(author.global_name) ?? void 0;
|
|
@@ -115,34 +148,6 @@ function formatDiscordSnapshotAuthor(author) {
|
|
|
115
148
|
if (author.id) return `@${author.id}`;
|
|
116
149
|
}
|
|
117
150
|
//#endregion
|
|
118
|
-
//#region extensions/discord/src/monitor/media-ssrf-policy.ts
|
|
119
|
-
const DISCORD_MEDIA_SSRF_POLICY = {
|
|
120
|
-
hostnameAllowlist: [
|
|
121
|
-
"cdn.discordapp.com",
|
|
122
|
-
"media.discordapp.net",
|
|
123
|
-
"*.discordapp.com",
|
|
124
|
-
"*.discordapp.net"
|
|
125
|
-
],
|
|
126
|
-
allowRfc2544BenchmarkRange: true
|
|
127
|
-
};
|
|
128
|
-
function mergeHostnameList(...lists) {
|
|
129
|
-
const merged = lists.flatMap((list) => list ?? []).map((value) => value.trim()).filter((value) => value.length > 0);
|
|
130
|
-
return merged.length > 0 ? uniqueStrings(merged) : void 0;
|
|
131
|
-
}
|
|
132
|
-
/** Merges caller network policy with the Discord-owned CDN allowlist. */
|
|
133
|
-
function resolveDiscordCdnPolicy(policy) {
|
|
134
|
-
if (!policy) return DISCORD_MEDIA_SSRF_POLICY;
|
|
135
|
-
const hostnameAllowlist = mergeHostnameList(DISCORD_MEDIA_SSRF_POLICY.hostnameAllowlist, policy.hostnameAllowlist);
|
|
136
|
-
const allowedHostnames = mergeHostnameList(DISCORD_MEDIA_SSRF_POLICY.allowedHostnames, policy.allowedHostnames);
|
|
137
|
-
return {
|
|
138
|
-
...DISCORD_MEDIA_SSRF_POLICY,
|
|
139
|
-
...policy,
|
|
140
|
-
...allowedHostnames ? { allowedHostnames } : {},
|
|
141
|
-
...hostnameAllowlist ? { hostnameAllowlist } : {},
|
|
142
|
-
allowRfc2544BenchmarkRange: Boolean(DISCORD_MEDIA_SSRF_POLICY.allowRfc2544BenchmarkRange) || Boolean(policy.allowRfc2544BenchmarkRange)
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
//#endregion
|
|
146
151
|
//#region extensions/discord/src/monitor/message-media.ts
|
|
147
152
|
const AUDIO_ATTACHMENT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
148
153
|
".aac",
|
|
@@ -366,6 +371,7 @@ async function appendResolvedMediaFromAttachments(params) {
|
|
|
366
371
|
});
|
|
367
372
|
params.out.push({
|
|
368
373
|
path: saved.path,
|
|
374
|
+
fileName: attachment.filename,
|
|
369
375
|
...classification
|
|
370
376
|
});
|
|
371
377
|
} catch (err) {
|
|
@@ -436,6 +442,7 @@ async function appendResolvedMediaFromStickers(params) {
|
|
|
436
442
|
params.out.push({
|
|
437
443
|
path: saved.path,
|
|
438
444
|
contentType: saved.contentType,
|
|
445
|
+
fileName: candidate.fileName,
|
|
439
446
|
kind: "sticker"
|
|
440
447
|
});
|
|
441
448
|
lastError = null;
|
|
@@ -495,8 +502,8 @@ function resolveDiscordMentions(text, message) {
|
|
|
495
502
|
if (!Array.isArray(mentions) || mentions.length === 0) return text;
|
|
496
503
|
let out = text;
|
|
497
504
|
for (const user of mentions) {
|
|
498
|
-
const label = user.globalName || user.username;
|
|
499
|
-
out = out.replace(new RegExp(`<@!?${user.id}>`, "g"), `@${label}`);
|
|
505
|
+
const label = user.globalName || user.username || user.id;
|
|
506
|
+
out = out.replace(new RegExp(`<@!?${user.id}>`, "g"), () => `@${label}`);
|
|
500
507
|
}
|
|
501
508
|
return out;
|
|
502
509
|
}
|
|
@@ -561,4 +568,4 @@ function resolveDiscordSnapshotMessageText(snapshot) {
|
|
|
561
568
|
return [content || embedText || componentText, attachmentText].filter(Boolean).join("\n");
|
|
562
569
|
}
|
|
563
570
|
//#endregion
|
|
564
|
-
export { formatDiscordMediaText as a, resolveReferencedReplyMediaList as c,
|
|
571
|
+
export { formatDiscordMediaText as a, resolveReferencedReplyMediaList as c, resolveDiscordReferencedReplyMessage as d, resolveDiscordReferencedReplyMessageId as f, resolveDiscordMessageChannelId as h, resolveDiscordMessageText as i, hasDiscordMessageStickers as l, resolveDiscordChannelInfo as m, resolveDiscordForwardedMessagesTextFromSnapshots as n, resolveForwardedMediaList as o, resolveDiscordCdnPolicy as p, resolveDiscordMessageHistoryText as r, resolveMediaList as s, resolveDiscordEmbedText as t, resolveDiscordMessageStickers as u };
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { a as chunkDiscordTextWithMode,
|
|
2
|
-
import { t as createDiscordActionGate } from "./accounts-
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import { n as notifyDiscordInboundEventOutboundPayloadSuccess, t as discordInboundEventDelivery } from "./inbound-event-delivery-De2qxTrP.js";
|
|
6
|
-
import { a as sendDiscordComponentMessageLazy, i as resolveDiscordComponentSpec, n as buildDiscordPresentationPayload, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-B2PL0ooH.js";
|
|
1
|
+
import { a as chunkDiscordTextWithMode, f as resolveDiscordReplyReference, g as normalizeDiscordOutboundTarget, l as toDiscordOutboundDeliveryResult, o as createDiscordSendReceipt, r as hasDiscordMessageCreateAmbiguity, s as createDiscordSendReceiptFromResults } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { t as createDiscordActionGate } from "./accounts-CwJQoLjM.js";
|
|
3
|
+
import { g as notifyDiscordInboundEventOutboundPayloadSuccess, h as discordInboundEventDelivery, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-CzzerX2K.js";
|
|
4
|
+
import { a as sendDiscordComponentMessageLazy, i as resolveDiscordComponentSpec, n as buildDiscordPresentationPayload, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-Bnt_7x7r.js";
|
|
7
5
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
8
6
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
|
+
import { getReplyPayloadTtsSupplement, resolvePayloadMediaUrls, sendPayloadMediaSequenceOrFallback, sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
9
8
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
10
9
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
11
10
|
import { createReplyToFanout, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
12
11
|
import { attachChannelToResult, createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
|
|
13
|
-
import { getReplyPayloadTtsSupplement, resolvePayloadMediaUrls, sendPayloadMediaSequenceOrFallback, sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
14
12
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
15
13
|
import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
16
14
|
//#region extensions/discord/src/media-detection.ts
|
|
@@ -35,7 +33,8 @@ function normalizeMediaPathForExtension(mediaUrl) {
|
|
|
35
33
|
}
|
|
36
34
|
} catch {
|
|
37
35
|
const withoutHash = trimmed.split("#", 1)[0] ?? trimmed;
|
|
38
|
-
|
|
36
|
+
const withoutQuery = withoutHash.split("?", 1)[0] ?? withoutHash;
|
|
37
|
+
return normalizeLowercaseStringOrEmpty(withoutQuery);
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
function isLikelyDiscordVideoMedia(mediaUrl) {
|
|
@@ -61,7 +60,7 @@ function normalizeDiscordApprovalPayload(payload) {
|
|
|
61
60
|
}
|
|
62
61
|
//#endregion
|
|
63
62
|
//#region extensions/discord/src/outbound-send-context.ts
|
|
64
|
-
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
63
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-mTKSBdmZ.js").then((n) => n.t));
|
|
65
64
|
function resolveDiscordOutboundTarget(params) {
|
|
66
65
|
if (params.threadId == null) return params.to;
|
|
67
66
|
const threadId = normalizeOptionalStringifiedId(params.threadId) ?? "";
|
|
@@ -98,11 +97,6 @@ async function createDiscordPayloadSendContext(ctx) {
|
|
|
98
97
|
//#endregion
|
|
99
98
|
//#region extensions/discord/src/outbound-payload.ts
|
|
100
99
|
const log$1 = createSubsystemLogger("discord/outbound");
|
|
101
|
-
function resolveDiscordDeliveryProgress(ctx) {
|
|
102
|
-
return ctx.onDeliveryResult ? async (result) => {
|
|
103
|
-
await ctx.onDeliveryResult?.(attachChannelToResult("discord", toDiscordOutboundDeliveryResult(result)));
|
|
104
|
-
} : void 0;
|
|
105
|
-
}
|
|
106
100
|
function createDiscordUnknownPayloadResult(target) {
|
|
107
101
|
return {
|
|
108
102
|
messageId: "",
|
|
@@ -120,7 +114,8 @@ function resolveDiscordDeliveryOptions(ctx, sendContext, reply = sendContext.res
|
|
|
120
114
|
accountId: ctx.accountId ?? void 0,
|
|
121
115
|
silent: ctx.silent ?? void 0,
|
|
122
116
|
cfg: ctx.cfg,
|
|
123
|
-
onPlatformSendDispatch: ctx.onPlatformSendDispatch
|
|
117
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch,
|
|
118
|
+
assertPlatformSendAuthorized: ctx.assertDirectAdapterHandoff
|
|
124
119
|
};
|
|
125
120
|
}
|
|
126
121
|
function resolveDiscordFormattedDeliveryOptions(ctx, sendContext, reply = sendContext.resolveReply()) {
|
|
@@ -146,6 +141,35 @@ async function sendDiscordOutboundPayload(params) {
|
|
|
146
141
|
});
|
|
147
142
|
const mediaUrls = resolvePayloadMediaUrls(payload);
|
|
148
143
|
const sendContext = await createDiscordPayloadSendContext(ctx);
|
|
144
|
+
const payloadContext = {
|
|
145
|
+
...ctx,
|
|
146
|
+
payload
|
|
147
|
+
};
|
|
148
|
+
const deliveredResults = [];
|
|
149
|
+
let createdThreadId;
|
|
150
|
+
payloadContext.onDeliveryResult = async (result) => {
|
|
151
|
+
await ctx.onDeliveryResult?.(result);
|
|
152
|
+
const threadId = result.receipt?.threadId;
|
|
153
|
+
if (threadId && payloadContext.threadId == null) {
|
|
154
|
+
payloadContext.threadId = threadId;
|
|
155
|
+
sendContext.target = `channel:${threadId}`;
|
|
156
|
+
createdThreadId = threadId;
|
|
157
|
+
}
|
|
158
|
+
if (createdThreadId && result.target?.kind === "channel" && result.receipt) deliveredResults.push({
|
|
159
|
+
messageId: result.messageId,
|
|
160
|
+
channelId: result.target.id,
|
|
161
|
+
receipt: result.receipt
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
const completeResult = (result) => createdThreadId ? {
|
|
165
|
+
...result,
|
|
166
|
+
receipt: createDiscordSendReceiptFromResults({
|
|
167
|
+
results: deliveredResults,
|
|
168
|
+
threadId: createdThreadId
|
|
169
|
+
})
|
|
170
|
+
} : result;
|
|
171
|
+
const completeDelivery = (result) => attachChannelToResult("discord", toDiscordOutboundDeliveryResult(completeResult(result)));
|
|
172
|
+
const onDeliveryResult = async (result) => await payloadContext.onDeliveryResult?.(attachChannelToResult("discord", toDiscordOutboundDeliveryResult(result)));
|
|
149
173
|
if (payload.audioAsVoice && mediaUrls.length > 0) {
|
|
150
174
|
const voiceReply = sendContext.resolveReply();
|
|
151
175
|
let voiceFailure;
|
|
@@ -169,38 +193,38 @@ async function sendDiscordOutboundPayload(params) {
|
|
|
169
193
|
if (fallbackText) await sendContext.send(sendContext.target, fallbackText, {
|
|
170
194
|
verbose: false,
|
|
171
195
|
...resolveDiscordFormattedDeliveryOptions(ctx, sendContext, voiceReply),
|
|
172
|
-
onDeliveryResult
|
|
196
|
+
onDeliveryResult
|
|
173
197
|
});
|
|
174
198
|
voiceFailure = { error: err };
|
|
175
199
|
}
|
|
176
200
|
if (!voiceFailure) {
|
|
177
|
-
await
|
|
201
|
+
await payloadContext.onDeliveryResult?.(attachChannelToResult("discord", toDiscordOutboundDeliveryResult(lastResult)));
|
|
178
202
|
if (payload.text?.trim()) lastResult = await sendContext.send(sendContext.target, payload.text, {
|
|
179
203
|
verbose: false,
|
|
180
204
|
...resolveDiscordFormattedDeliveryOptions(ctx, sendContext),
|
|
181
|
-
onDeliveryResult
|
|
205
|
+
onDeliveryResult
|
|
182
206
|
});
|
|
183
207
|
}
|
|
184
208
|
for (const mediaUrl of mediaUrls.slice(1)) try {
|
|
185
209
|
lastResult = await sendContext.send(sendContext.target, "", {
|
|
186
210
|
verbose: false,
|
|
187
211
|
...resolveDiscordMediaDeliveryOptions(ctx, sendContext, mediaUrl),
|
|
188
|
-
onDeliveryResult
|
|
212
|
+
onDeliveryResult
|
|
189
213
|
});
|
|
190
214
|
} catch (err) {
|
|
191
215
|
if (!voiceFailure) throw err;
|
|
192
216
|
log$1.warn("discord remaining media send failed after voice failure", { error: err });
|
|
193
217
|
}
|
|
194
218
|
if (voiceFailure) throw voiceFailure.error;
|
|
195
|
-
return
|
|
219
|
+
return completeDelivery(lastResult);
|
|
196
220
|
}
|
|
221
|
+
const discordData = payload.channelData?.discord && typeof payload.channelData.discord === "object" && !Array.isArray(payload.channelData.discord) ? payload.channelData.discord : {};
|
|
222
|
+
const filename = normalizeOptionalString(discordData.filename);
|
|
197
223
|
const componentSpec = await resolveDiscordComponentSpec(payload);
|
|
198
224
|
if (!componentSpec) {
|
|
199
|
-
const discordData = payload.channelData?.discord && typeof payload.channelData.discord === "object" && !Array.isArray(payload.channelData.discord) ? payload.channelData.discord : {};
|
|
200
225
|
const nativeComponents = Array.isArray(discordData.components) ? discordData.components : void 0;
|
|
201
226
|
const embeds = Array.isArray(discordData.embeds) ? discordData.embeds : void 0;
|
|
202
|
-
|
|
203
|
-
if (nativeComponents || embeds?.length || filename) return attachChannelToResult("discord", toDiscordOutboundDeliveryResult(await sendPayloadMediaSequenceOrFallback({
|
|
227
|
+
if (nativeComponents || embeds?.length || filename) return completeDelivery(await sendPayloadMediaSequenceOrFallback({
|
|
204
228
|
text: payload.text ?? "",
|
|
205
229
|
mediaUrls,
|
|
206
230
|
fallbackResult: createDiscordUnknownPayloadResult(sendContext.target),
|
|
@@ -210,7 +234,7 @@ async function sendDiscordOutboundPayload(params) {
|
|
|
210
234
|
embeds,
|
|
211
235
|
filename,
|
|
212
236
|
...resolveDiscordFormattedDeliveryOptions(ctx, sendContext),
|
|
213
|
-
onDeliveryResult
|
|
237
|
+
onDeliveryResult
|
|
214
238
|
}),
|
|
215
239
|
send: async ({ text, mediaUrl, isFirst }) => await sendContext.send(sendContext.target, text, {
|
|
216
240
|
verbose: false,
|
|
@@ -218,70 +242,46 @@ async function sendDiscordOutboundPayload(params) {
|
|
|
218
242
|
components: isFirst ? nativeComponents : void 0,
|
|
219
243
|
embeds: isFirst ? embeds : void 0,
|
|
220
244
|
filename: isFirst ? filename : void 0,
|
|
221
|
-
onDeliveryResult
|
|
245
|
+
onDeliveryResult
|
|
222
246
|
})
|
|
223
|
-
}))
|
|
224
|
-
|
|
225
|
-
...ctx,
|
|
226
|
-
payload
|
|
227
|
-
};
|
|
228
|
-
const deliveredResults = [];
|
|
229
|
-
let createdThreadId;
|
|
230
|
-
payloadContext.onDeliveryResult = async (result) => {
|
|
231
|
-
await ctx.onDeliveryResult?.(result);
|
|
232
|
-
const threadId = result.receipt?.threadId;
|
|
233
|
-
if (threadId && payloadContext.threadId == null) {
|
|
234
|
-
payloadContext.threadId = threadId;
|
|
235
|
-
createdThreadId = threadId;
|
|
236
|
-
}
|
|
237
|
-
if (createdThreadId && result.target?.kind === "channel" && result.receipt) deliveredResults.push({
|
|
238
|
-
messageId: result.messageId,
|
|
239
|
-
channelId: result.target.id,
|
|
240
|
-
receipt: result.receipt
|
|
241
|
-
});
|
|
242
|
-
};
|
|
243
|
-
const result = await sendTextMediaPayload({
|
|
247
|
+
}));
|
|
248
|
+
return completeResult(await sendTextMediaPayload({
|
|
244
249
|
channel: "discord",
|
|
245
250
|
ctx: payloadContext,
|
|
246
251
|
adapter: params.fallbackAdapter
|
|
247
|
-
});
|
|
248
|
-
return createdThreadId ? {
|
|
249
|
-
...result,
|
|
250
|
-
receipt: createDiscordSendReceiptFromResults({
|
|
251
|
-
results: deliveredResults,
|
|
252
|
-
threadId: createdThreadId
|
|
253
|
-
})
|
|
254
|
-
} : result;
|
|
252
|
+
}));
|
|
255
253
|
}
|
|
256
|
-
return
|
|
254
|
+
return completeDelivery(await sendPayloadMediaSequenceOrFallback({
|
|
257
255
|
text: payload.text ?? "",
|
|
258
256
|
mediaUrls,
|
|
259
257
|
fallbackResult: createDiscordUnknownPayloadResult(sendContext.target),
|
|
260
258
|
sendNoMedia: async () => {
|
|
261
259
|
return await sendDiscordComponentMessageLazy(sendContext.target, componentSpec, {
|
|
262
260
|
...resolveDiscordFormattedDeliveryOptions(ctx, sendContext),
|
|
263
|
-
|
|
261
|
+
filename,
|
|
262
|
+
onDeliveryResult
|
|
264
263
|
});
|
|
265
264
|
},
|
|
266
265
|
send: async ({ text, mediaUrl, isFirst }) => {
|
|
267
266
|
if (isFirst) return await sendDiscordComponentMessageLazy(sendContext.target, componentSpec, {
|
|
268
267
|
...resolveDiscordMediaDeliveryOptions(ctx, sendContext, mediaUrl),
|
|
269
|
-
|
|
268
|
+
filename,
|
|
269
|
+
onDeliveryResult
|
|
270
270
|
});
|
|
271
271
|
return await sendContext.send(sendContext.target, text, {
|
|
272
272
|
verbose: false,
|
|
273
273
|
...resolveDiscordMediaDeliveryOptions(ctx, sendContext, mediaUrl),
|
|
274
|
-
onDeliveryResult
|
|
274
|
+
onDeliveryResult
|
|
275
275
|
});
|
|
276
276
|
}
|
|
277
|
-
}))
|
|
277
|
+
}));
|
|
278
278
|
}
|
|
279
279
|
//#endregion
|
|
280
280
|
//#region extensions/discord/src/outbound-adapter.ts
|
|
281
281
|
const DISCORD_TEXT_CHUNK_LIMIT = 2e3;
|
|
282
282
|
const log = createSubsystemLogger("discord/outbound");
|
|
283
|
-
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-
|
|
284
|
-
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-
|
|
283
|
+
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-wECUSIIG.js").then((n) => n.t));
|
|
284
|
+
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-nsPnc7kK.js").then((n) => n.i));
|
|
285
285
|
function resolveDiscordWebhookIdentity(params) {
|
|
286
286
|
const usernameRaw = normalizeOptionalString(params.identity?.name);
|
|
287
287
|
const fallbackUsername = normalizeOptionalString(params.binding.label) ?? params.binding.agentId;
|
|
@@ -313,7 +313,8 @@ async function maybeSendDiscordWebhookText(params) {
|
|
|
313
313
|
replyTo: params.replyToId ?? void 0,
|
|
314
314
|
username: persona.username,
|
|
315
315
|
avatarUrl: persona.avatarUrl,
|
|
316
|
-
onPlatformSendDispatch: params.onPlatformSendDispatch
|
|
316
|
+
onPlatformSendDispatch: params.onPlatformSendDispatch,
|
|
317
|
+
assertPlatformSendAuthorized: params.assertPlatformSendAuthorized
|
|
317
318
|
});
|
|
318
319
|
}
|
|
319
320
|
async function resolveDiscordOutboundMessageSend(params) {
|
|
@@ -339,7 +340,8 @@ async function resolveDiscordOutboundMessageSend(params) {
|
|
|
339
340
|
onDeliveryResult: params.onDeliveryResult ? async (result) => {
|
|
340
341
|
await params.onDeliveryResult?.(attachChannelToResult("discord", toDiscordOutboundDeliveryResult(result)));
|
|
341
342
|
} : void 0,
|
|
342
|
-
onPlatformSendDispatch: params.onPlatformSendDispatch
|
|
343
|
+
onPlatformSendDispatch: params.onPlatformSendDispatch,
|
|
344
|
+
assertPlatformSendAuthorized: params.assertDirectAdapterHandoff
|
|
343
345
|
}
|
|
344
346
|
};
|
|
345
347
|
}
|
|
@@ -390,7 +392,8 @@ const discordOutbound = {
|
|
|
390
392
|
onPlatformSendDispatch: ctx.onPlatformSendDispatch ? async () => {
|
|
391
393
|
webhookSelected = true;
|
|
392
394
|
await ctx.onPlatformSendDispatch?.();
|
|
393
|
-
} : void 0
|
|
395
|
+
} : void 0,
|
|
396
|
+
assertPlatformSendAuthorized: ctx.assertDirectAdapterHandoff
|
|
394
397
|
});
|
|
395
398
|
if (webhookResult) return toDiscordOutboundDeliveryResult(webhookResult);
|
|
396
399
|
} catch (error) {
|
|
@@ -403,16 +406,20 @@ const discordOutbound = {
|
|
|
403
406
|
},
|
|
404
407
|
sendMedia: async (ctx) => {
|
|
405
408
|
const { send, target, options } = await resolveDiscordOutboundMessageSend(ctx);
|
|
406
|
-
if (ctx.audioAsVoice && ctx.mediaUrl)
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
409
|
+
if (ctx.audioAsVoice && ctx.mediaUrl) {
|
|
410
|
+
const sendVoice = resolveOutboundSendDep(ctx.deps, "discordVoice") ?? (await loadDiscordSendRuntime()).sendVoiceMessageDiscord;
|
|
411
|
+
return toDiscordOutboundDeliveryResult(await sendVoice(target, ctx.mediaUrl, {
|
|
412
|
+
cfg: ctx.cfg,
|
|
413
|
+
reply: options.reply,
|
|
414
|
+
accountId: ctx.accountId ?? void 0,
|
|
415
|
+
silent: ctx.silent ?? void 0,
|
|
416
|
+
mediaAccess: ctx.mediaAccess,
|
|
417
|
+
mediaLocalRoots: ctx.mediaLocalRoots,
|
|
418
|
+
mediaReadFile: ctx.mediaReadFile,
|
|
419
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch,
|
|
420
|
+
assertPlatformSendAuthorized: ctx.assertDirectAdapterHandoff
|
|
421
|
+
}));
|
|
422
|
+
}
|
|
416
423
|
const mediaOptions = {
|
|
417
424
|
...options,
|
|
418
425
|
mediaUrl: ctx.mediaUrl,
|
|
@@ -427,9 +434,8 @@ const discordOutbound = {
|
|
|
427
434
|
reply: options.reply?.scope === "all" ? options.reply : void 0
|
|
428
435
|
});
|
|
429
436
|
const threadId = captionResult.receipt?.threadId;
|
|
430
|
-
if (!threadId) return toDiscordOutboundDeliveryResult(mediaResult);
|
|
431
437
|
return toDiscordOutboundDeliveryResult({
|
|
432
|
-
...captionResult,
|
|
438
|
+
...threadId ? captionResult : mediaResult,
|
|
433
439
|
receipt: createDiscordSendReceiptFromResults({
|
|
434
440
|
results: [captionResult, mediaResult],
|
|
435
441
|
threadId
|
|
@@ -438,7 +444,7 @@ const discordOutbound = {
|
|
|
438
444
|
}
|
|
439
445
|
return toDiscordOutboundDeliveryResult(await send(target, ctx.text, mediaOptions));
|
|
440
446
|
},
|
|
441
|
-
sendPoll: async ({ cfg, to, poll, content, accountId, threadId, silent, sessionKey, inboundEventKind, onPlatformSendDispatch }) => {
|
|
447
|
+
sendPoll: async ({ cfg, to, poll, content, accountId, threadId, silent, sessionKey, inboundEventKind, onPlatformSendDispatch, assertDirectAdapterHandoff }) => {
|
|
442
448
|
if (!createDiscordActionGate({
|
|
443
449
|
cfg,
|
|
444
450
|
accountId
|
|
@@ -453,7 +459,8 @@ const discordOutbound = {
|
|
|
453
459
|
threadId: threadId ?? void 0,
|
|
454
460
|
silent: silent ?? void 0,
|
|
455
461
|
cfg,
|
|
456
|
-
onPlatformSendDispatch
|
|
462
|
+
onPlatformSendDispatch,
|
|
463
|
+
assertPlatformSendAuthorized: assertDirectAdapterHandoff
|
|
457
464
|
});
|
|
458
465
|
discordInboundEventDelivery.notify({
|
|
459
466
|
sessionKey,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as readDiscordComponentSpec } from "./components-gvRA0oaI.js";
|
|
2
|
+
import { resolveAskUserQuestionOptionIndices } from "openclaw/plugin-sdk/reply-payload";
|
|
2
3
|
import { createLazyRuntimeModule, createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
3
4
|
//#region extensions/discord/src/outbound-components.ts
|
|
4
5
|
const DISCORD_MESSAGE_COMPONENT_LIMIT = 40;
|
|
@@ -30,11 +31,11 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
|
-
const loadDiscordComponentSend = createLazyRuntimeNamedExport(() => import("./send.components-
|
|
34
|
+
const loadDiscordComponentSend = createLazyRuntimeNamedExport(() => import("./send.components-nsPnc7kK.js").then((n) => n.i), "sendDiscordComponentMessage");
|
|
34
35
|
async function sendDiscordComponentMessageLazy(...args) {
|
|
35
36
|
return await (await loadDiscordComponentSend())(...args);
|
|
36
37
|
}
|
|
37
|
-
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-
|
|
38
|
+
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-gvRA0oaI.js").then((n) => n.a));
|
|
38
39
|
function addPayloadTextFallback(spec, payload) {
|
|
39
40
|
return spec.text ? spec : {
|
|
40
41
|
...spec,
|
|
@@ -68,7 +69,7 @@ function isDiscordComponentSpecWithinMessageLimit(params) {
|
|
|
68
69
|
}) <= DISCORD_MESSAGE_COMPONENT_LIMIT;
|
|
69
70
|
}
|
|
70
71
|
async function buildDiscordPresentationPayload(params) {
|
|
71
|
-
const componentSpec = (await loadDiscordSharedInteractive()).buildDiscordPresentationComponents(params.presentation);
|
|
72
|
+
const componentSpec = (await loadDiscordSharedInteractive()).buildDiscordPresentationComponents(params.presentation, { questionOptionIndices: resolveAskUserQuestionOptionIndices(params.payload) });
|
|
72
73
|
if (!componentSpec) return null;
|
|
73
74
|
const includesMedia = Boolean(params.payload.mediaUrl || params.payload.mediaUrls?.some((mediaUrl) => mediaUrl));
|
|
74
75
|
if (!isDiscordComponentSpecWithinMessageLimit({
|