@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,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { s as buildExecApprovalCustomId } from "./components-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { a as shouldHandleDiscordApprovalRequest } from "./channel-
|
|
1
|
+
import { Dt as deleteChannelMessage, _t as stripUndefinedFields, ct as Row, et as Button, ft as TextDisplay, kt as editChannelMessage, nt as Container, q as serializePayload, ut as Separator, wt as createChannelMessage, yt as createUserDmChannel } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { s as buildExecApprovalCustomId } from "./components-gvRA0oaI.js";
|
|
3
|
+
import { N as createDiscordClient, O as createDiscordMessageNonce } from "./send.shared-BJHt0Vyf.js";
|
|
4
|
+
import { S as isDiscordExecApprovalClientEnabled, n as DISCORD_APPROVAL_ALLOWED_MENTIONS, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-CzzerX2K.js";
|
|
5
|
+
import { a as shouldHandleDiscordApprovalRequest } from "./channel-CarzU3bg.js";
|
|
6
6
|
import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
|
|
7
7
|
import { ButtonStyle } from "discord-api-types/v10";
|
|
8
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -137,97 +137,34 @@ function resolveCommandPreviews(commandText, commandPreview, maxChars, secondary
|
|
|
137
137
|
commandSecondaryPreview: formatOptionalCommandPreview(commandPreview, secondaryMaxChars)
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
const {
|
|
142
|
-
const
|
|
140
|
+
function createApprovalContainer(params) {
|
|
141
|
+
const { view } = params;
|
|
142
|
+
const plugin = view.approvalKind === "plugin";
|
|
143
|
+
const pending = view.phase === "pending";
|
|
144
|
+
const approvalLabel = plugin ? "Plugin" : "Exec";
|
|
145
|
+
const { commandPreview, commandSecondaryPreview } = plugin ? {
|
|
146
|
+
commandPreview: formatCommandPreview(view.title, 700),
|
|
147
|
+
commandSecondaryPreview: formatOptionalCommandPreview(view.description, 1e3)
|
|
148
|
+
} : resolveCommandPreviews(view.commandText, view.commandPreview, pending ? 1e3 : 500, pending ? 500 : 300);
|
|
149
|
+
const decisionLabel = view.phase !== "resolved" ? void 0 : view.decision === "allow-once" ? "Allowed (once)" : view.decision === "allow-always" ? "Allowed (always)" : "Denied";
|
|
150
|
+
const title = pending ? `${approvalLabel} Approval Required` : `${approvalLabel} Approval: ${view.phase === "expired" ? "Expired" : decisionLabel}`;
|
|
151
|
+
const description = pending ? plugin ? "A plugin action needs your approval." : "A command needs your approval." : view.phase === "expired" ? "This approval request has expired." : view.resolvedBy ? `Resolved by ${formatDiscordApprovalDisplayValue(view.resolvedBy)}` : "Resolved";
|
|
152
|
+
const accentColor = view.phase === "expired" ? "#99AAB5" : view.phase === "resolved" ? view.decision === "deny" ? "#ED4245" : view.decision === "allow-always" ? "#5865F2" : "#57F287" : plugin ? view.severity === "critical" ? "#ED4245" : view.severity === "info" ? "#5865F2" : "#FAA61A" : "#FFA500";
|
|
153
|
+
const approvalId = formatDiscordApprovalDisplayValue(view.approvalId);
|
|
154
|
+
const footer = pending ? `Expires <t:${Math.max(0, Math.floor(view.expiresAtMs / 1e3))}:R> · ID: ${approvalId}` : `ID: ${approvalId}`;
|
|
143
155
|
return new ExecApprovalContainer({
|
|
144
156
|
cfg: params.cfg,
|
|
145
157
|
accountId: params.accountId,
|
|
146
|
-
title
|
|
147
|
-
description
|
|
158
|
+
title,
|
|
159
|
+
description,
|
|
148
160
|
commandPreview,
|
|
149
161
|
commandSecondaryPreview,
|
|
150
|
-
metadataLines: buildApprovalMetadataLines(
|
|
162
|
+
metadataLines: buildApprovalMetadataLines(view.metadata),
|
|
151
163
|
actionRow: params.actionRow,
|
|
152
|
-
footer
|
|
153
|
-
accentColor: "#FFA500"
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
function createPluginApprovalRequestContainer(params) {
|
|
157
|
-
const expiresAtSeconds = Math.max(0, Math.floor(params.view.expiresAtMs / 1e3));
|
|
158
|
-
const severity = params.view.severity;
|
|
159
|
-
const accentColor = severity === "critical" ? "#ED4245" : severity === "info" ? "#5865F2" : "#FAA61A";
|
|
160
|
-
return new ExecApprovalContainer({
|
|
161
|
-
cfg: params.cfg,
|
|
162
|
-
accountId: params.accountId,
|
|
163
|
-
title: "Plugin Approval Required",
|
|
164
|
-
description: "A plugin action needs your approval.",
|
|
165
|
-
commandPreview: formatCommandPreview(params.view.title, 700),
|
|
166
|
-
commandSecondaryPreview: formatOptionalCommandPreview(params.view.description, 1e3),
|
|
167
|
-
metadataLines: buildApprovalMetadataLines(params.view.metadata),
|
|
168
|
-
actionRow: params.actionRow,
|
|
169
|
-
footer: `Expires <t:${expiresAtSeconds}:R> · ID: ${formatDiscordApprovalDisplayValue(params.view.approvalId)}`,
|
|
164
|
+
footer,
|
|
170
165
|
accentColor
|
|
171
166
|
});
|
|
172
167
|
}
|
|
173
|
-
function createExecResolvedContainer(params) {
|
|
174
|
-
const { commandPreview, commandSecondaryPreview } = resolveCommandPreviews(params.view.commandText, params.view.commandPreview, 500, 300);
|
|
175
|
-
const decisionLabel = params.view.decision === "allow-once" ? "Allowed (once)" : params.view.decision === "allow-always" ? "Allowed (always)" : "Denied";
|
|
176
|
-
const accentColor = params.view.decision === "deny" ? "#ED4245" : params.view.decision === "allow-always" ? "#5865F2" : "#57F287";
|
|
177
|
-
return new ExecApprovalContainer({
|
|
178
|
-
cfg: params.cfg,
|
|
179
|
-
accountId: params.accountId,
|
|
180
|
-
title: `Exec Approval: ${decisionLabel}`,
|
|
181
|
-
description: params.view.resolvedBy ? `Resolved by ${formatDiscordApprovalDisplayValue(params.view.resolvedBy)}` : "Resolved",
|
|
182
|
-
commandPreview,
|
|
183
|
-
commandSecondaryPreview,
|
|
184
|
-
metadataLines: buildApprovalMetadataLines(params.view.metadata),
|
|
185
|
-
footer: `ID: ${formatDiscordApprovalDisplayValue(params.view.approvalId)}`,
|
|
186
|
-
accentColor
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
function createPluginResolvedContainer(params) {
|
|
190
|
-
const decisionLabel = params.view.decision === "allow-once" ? "Allowed (once)" : params.view.decision === "allow-always" ? "Allowed (always)" : "Denied";
|
|
191
|
-
const accentColor = params.view.decision === "deny" ? "#ED4245" : params.view.decision === "allow-always" ? "#5865F2" : "#57F287";
|
|
192
|
-
return new ExecApprovalContainer({
|
|
193
|
-
cfg: params.cfg,
|
|
194
|
-
accountId: params.accountId,
|
|
195
|
-
title: `Plugin Approval: ${decisionLabel}`,
|
|
196
|
-
description: params.view.resolvedBy ? `Resolved by ${formatDiscordApprovalDisplayValue(params.view.resolvedBy)}` : "Resolved",
|
|
197
|
-
commandPreview: formatCommandPreview(params.view.title, 700),
|
|
198
|
-
commandSecondaryPreview: formatOptionalCommandPreview(params.view.description, 1e3),
|
|
199
|
-
metadataLines: buildApprovalMetadataLines(params.view.metadata),
|
|
200
|
-
footer: `ID: ${formatDiscordApprovalDisplayValue(params.view.approvalId)}`,
|
|
201
|
-
accentColor
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
function createExecExpiredContainer(params) {
|
|
205
|
-
const { commandPreview, commandSecondaryPreview } = resolveCommandPreviews(params.view.commandText, params.view.commandPreview, 500, 300);
|
|
206
|
-
return new ExecApprovalContainer({
|
|
207
|
-
cfg: params.cfg,
|
|
208
|
-
accountId: params.accountId,
|
|
209
|
-
title: "Exec Approval: Expired",
|
|
210
|
-
description: "This approval request has expired.",
|
|
211
|
-
commandPreview,
|
|
212
|
-
commandSecondaryPreview,
|
|
213
|
-
metadataLines: buildApprovalMetadataLines(params.view.metadata),
|
|
214
|
-
footer: `ID: ${formatDiscordApprovalDisplayValue(params.view.approvalId)}`,
|
|
215
|
-
accentColor: "#99AAB5"
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
function createPluginExpiredContainer(params) {
|
|
219
|
-
return new ExecApprovalContainer({
|
|
220
|
-
cfg: params.cfg,
|
|
221
|
-
accountId: params.accountId,
|
|
222
|
-
title: "Plugin Approval: Expired",
|
|
223
|
-
description: "This approval request has expired.",
|
|
224
|
-
commandPreview: formatCommandPreview(params.view.title, 700),
|
|
225
|
-
commandSecondaryPreview: formatOptionalCommandPreview(params.view.description, 1e3),
|
|
226
|
-
metadataLines: buildApprovalMetadataLines(params.view.metadata),
|
|
227
|
-
footer: `ID: ${formatDiscordApprovalDisplayValue(params.view.approvalId)}`,
|
|
228
|
-
accentColor: "#99AAB5"
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
168
|
async function updateMessage(params) {
|
|
232
169
|
try {
|
|
233
170
|
const { rest, request: discordRequest } = createDiscordClient({
|
|
@@ -287,18 +224,13 @@ const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
|
287
224
|
context
|
|
288
225
|
});
|
|
289
226
|
if (!resolved) return { body: {} };
|
|
290
|
-
const
|
|
291
|
-
return { body: stripUndefinedFields(serializePayload(buildExecApprovalPayload(view.approvalKind === "plugin" ? createPluginApprovalRequestContainer({
|
|
227
|
+
const container = createApprovalContainer({
|
|
292
228
|
view,
|
|
293
229
|
cfg,
|
|
294
230
|
accountId: resolved.accountId,
|
|
295
|
-
actionRow
|
|
296
|
-
})
|
|
297
|
-
|
|
298
|
-
cfg,
|
|
299
|
-
accountId: resolved.accountId,
|
|
300
|
-
actionRow
|
|
301
|
-
})))) };
|
|
231
|
+
actionRow: createApprovalActionRow(view)
|
|
232
|
+
});
|
|
233
|
+
return { body: stripUndefinedFields(serializePayload(buildExecApprovalPayload(container))) };
|
|
302
234
|
},
|
|
303
235
|
buildResolvedResult: ({ cfg, accountId, context, view }) => {
|
|
304
236
|
const resolvedContext = resolveHandlerContext({
|
|
@@ -309,11 +241,7 @@ const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
|
309
241
|
if (!resolvedContext) return { kind: "delete" };
|
|
310
242
|
return {
|
|
311
243
|
kind: "update",
|
|
312
|
-
payload:
|
|
313
|
-
view,
|
|
314
|
-
cfg,
|
|
315
|
-
accountId: resolvedContext.accountId
|
|
316
|
-
}) : createExecResolvedContainer({
|
|
244
|
+
payload: createApprovalContainer({
|
|
317
245
|
view,
|
|
318
246
|
cfg,
|
|
319
247
|
accountId: resolvedContext.accountId
|
|
@@ -329,11 +257,7 @@ const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
|
329
257
|
if (!resolvedContext) return { kind: "delete" };
|
|
330
258
|
return {
|
|
331
259
|
kind: "update",
|
|
332
|
-
payload:
|
|
333
|
-
view,
|
|
334
|
-
cfg,
|
|
335
|
-
accountId: resolvedContext.accountId
|
|
336
|
-
}) : createExecExpiredContainer({
|
|
260
|
+
payload: createApprovalContainer({
|
|
337
261
|
view,
|
|
338
262
|
cfg,
|
|
339
263
|
accountId: resolvedContext.accountId
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { x as fetchChannelPermissionsDiscord } from "./send.shared-
|
|
3
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
4
|
-
import "./send-
|
|
5
|
-
import {
|
|
1
|
+
import { on as __exportAll } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { x as fetchChannelPermissionsDiscord } from "./send.shared-BJHt0Vyf.js";
|
|
3
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BY-ve3yH.js";
|
|
4
|
+
import "./send-mTKSBdmZ.js";
|
|
5
|
+
import { _ as auditDiscordChannelPermissionsWithFetcher, v as collectDiscordAuditChannelIdsForAccount } from "./outbound-session-route-CzzerX2K.js";
|
|
6
6
|
//#region extensions/discord/src/audit.ts
|
|
7
7
|
var audit_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
auditDiscordChannelPermissions: () => auditDiscordChannelPermissions,
|
|
9
9
|
collectDiscordAuditChannelIds: () => collectDiscordAuditChannelIds
|
|
10
10
|
});
|
|
11
11
|
function collectDiscordAuditChannelIds(params) {
|
|
12
|
-
|
|
12
|
+
const account = inspectDiscordAccount({
|
|
13
13
|
cfg: params.cfg,
|
|
14
14
|
accountId: params.accountId
|
|
15
|
-
})
|
|
15
|
+
});
|
|
16
|
+
return collectDiscordAuditChannelIdsForAccount(account.config);
|
|
16
17
|
}
|
|
17
18
|
async function auditDiscordChannelPermissions(params) {
|
|
18
19
|
return await auditDiscordChannelPermissionsWithFetcher({
|
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { _ as parseDiscordTarget, h as normalizeDiscordMessagingTarget, m as looksLikeDiscordTargetId } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { c as resolveDiscordAccount, i as listDiscordStartupAccountIds, l as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.js";
|
|
3
3
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
4
|
-
import { u as withAbortTimeout } from "./timeouts-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as discordMessageActions } from "./channel-actions-Dr2QI8Bf.js";
|
|
4
|
+
import { u as withAbortTimeout } from "./timeouts-D86uWLt_.js";
|
|
5
|
+
import { C as shouldSuppressLocalDiscordExecApprovalPrompt, D as isChannelExecApprovalClientEnabledFromConfig, E as createChannelNativeOriginTargetResolver, O as matchesApprovalRequestFilters, S as isDiscordExecApprovalClientEnabled, T as createChannelApproverDmTargetResolver, b as getDiscordExecApprovalApprovers, d as resolveDiscordCurrentConversationIdentity, f as resolveDiscordRuntimeBindingConversationId, p as discordMessageActions, s as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, w as createApproverRestrictedNativeApprovalCapability, x as isDiscordExecApprovalApprover, y as resolveRequiredDiscordChannelPermissions } from "./outbound-session-route-CzzerX2K.js";
|
|
6
|
+
import { a as discordSecurityAdapter, c as buildTokenChannelStatusSummary, i as discordSetupContract, l as projectCredentialSnapshotFields, n as discordConfigAdapter, o as DEFAULT_ACCOUNT_ID, s as PAIRING_APPROVED_MESSAGE, t as createDiscordPluginBase, u as resolveConfiguredFromCredentialStatuses } from "./shared-BNesVA4P.js";
|
|
8
7
|
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.js";
|
|
9
|
-
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-
|
|
10
|
-
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-
|
|
11
|
-
import { n as discordOutbound } from "./outbound-adapter-
|
|
12
|
-
import { a as discordSecurityAdapter, i as discordSetupContract, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-CaAaoksy.js";
|
|
8
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-DPpBRpYI.js";
|
|
9
|
+
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-CC7HoQvt.js";
|
|
10
|
+
import { n as discordOutbound } from "./outbound-adapter-Ch0At5Ra.js";
|
|
13
11
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
14
12
|
import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.js";
|
|
15
13
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
16
14
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
17
|
-
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
18
15
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
19
16
|
import { createChannelMessageAdapterFromOutbound } from "openclaw/plugin-sdk/channel-outbound";
|
|
20
17
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
21
18
|
import { buildLegacyDmAccountAllowlistAdapter, createAccountScopedAllowlistNameResolver, createNestedAllowlistOverrideResolver } from "openclaw/plugin-sdk/allowlist-config-edit";
|
|
19
|
+
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
22
20
|
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
23
21
|
import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
24
22
|
import { appendMatchMetadata, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState, isRecord as isRecord$1, readAccountStatusSnapshot, resolveEnabledConfiguredAccountId } from "openclaw/plugin-sdk/status-helpers";
|
|
@@ -194,7 +192,7 @@ function createDiscordApprovalCapability(configOverride) {
|
|
|
194
192
|
request,
|
|
195
193
|
configOverride
|
|
196
194
|
}),
|
|
197
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
195
|
+
load: async () => (await import("./approval-handler.runtime-DZM6Kt1Z.js")).discordApprovalNativeRuntime
|
|
198
196
|
})
|
|
199
197
|
});
|
|
200
198
|
}
|
|
@@ -301,22 +299,22 @@ function resolveDiscordInboundConversation(params) {
|
|
|
301
299
|
}
|
|
302
300
|
//#endregion
|
|
303
301
|
//#region extensions/discord/src/channel.loaders.ts
|
|
304
|
-
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
305
|
-
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
306
|
-
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
307
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
308
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
309
|
-
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-
|
|
310
|
-
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-
|
|
302
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-AA8wQx0D.js").then((n) => n.t));
|
|
303
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-BexR2eUn.js").then((n) => n.n));
|
|
304
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-BtXBCH5W.js").then((n) => n.n));
|
|
305
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-B-3UHCc1.js").then((n) => n.i));
|
|
306
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-C0MnwEki.js").then((n) => n.r));
|
|
307
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-Bo1WbLLr.js"));
|
|
308
|
+
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-BckHn3cJ.js"));
|
|
311
309
|
async function probeDiscordStatusAccount(params) {
|
|
312
310
|
const startedAtMs = Date.now();
|
|
313
311
|
const runtime = await loadDiscordProbeRuntime();
|
|
314
312
|
const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
|
|
315
313
|
return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
|
|
316
314
|
}
|
|
317
|
-
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-
|
|
318
|
-
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-
|
|
319
|
-
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
315
|
+
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-DIbQA4VT.js").then((n) => n.n));
|
|
316
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-mTKSBdmZ.js").then((n) => n.t));
|
|
317
|
+
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-D_kFz_Fj.js").then((n) => n.t));
|
|
320
318
|
//#endregion
|
|
321
319
|
//#region extensions/discord/src/conversation-route-owner.ts
|
|
322
320
|
function inspectDiscordConversationRouteOwner(params) {
|
|
@@ -428,8 +426,9 @@ function resolveDiscordGroupRequireMention(params) {
|
|
|
428
426
|
return resolveScopeRequireMention(resolveDiscordPolicyScope(params));
|
|
429
427
|
}
|
|
430
428
|
function resolveDiscordGroupToolPolicy(params) {
|
|
429
|
+
const scope = resolveDiscordPolicyScope(params);
|
|
431
430
|
return resolveScopeToolsPolicy({
|
|
432
|
-
...
|
|
431
|
+
...scope,
|
|
433
432
|
senderPolicyMode: params.senderPolicyMode,
|
|
434
433
|
senderId: params.senderId,
|
|
435
434
|
senderName: params.senderName,
|
|
@@ -766,10 +765,11 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
766
765
|
}).map(toConversationLifecycleBinding)
|
|
767
766
|
},
|
|
768
767
|
heartbeat: { sendTyping: async ({ cfg, to, accountId, threadId }) => {
|
|
769
|
-
const
|
|
768
|
+
const resolvedTo = resolveDiscordAttachedOutboundTarget({
|
|
770
769
|
to,
|
|
771
770
|
threadId
|
|
772
|
-
})
|
|
771
|
+
});
|
|
772
|
+
const target = parseDiscordTarget(resolvedTo, { defaultKind: "channel" });
|
|
773
773
|
if (!target || target.kind !== "channel") return;
|
|
774
774
|
await (await loadDiscordSendModule()).sendTypingDiscord(target.id, {
|
|
775
775
|
cfg,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-
|
|
4
|
-
import "./targets-
|
|
1
|
+
import { _ as parseDiscordTarget, v as resolveDiscordChannelId } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-gvRA0oaI.js";
|
|
3
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-DydyfxST.js";
|
|
4
|
+
import "./targets-DQSye1Rv.js";
|
|
5
5
|
import "./action-runtime-api.js";
|
|
6
|
-
import {
|
|
7
|
-
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-
|
|
8
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
6
|
+
import { h as discordInboundEventDelivery } from "./outbound-session-route-CzzerX2K.js";
|
|
7
|
+
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-Bnt_7x7r.js";
|
|
8
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-Cc88ZGon.js";
|
|
9
9
|
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-fmHl1HNd.js";
|
|
10
10
|
import { normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
|
+
import { adaptMessagePresentationForChannel, normalizeLegacyInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
11
12
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
12
13
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
13
|
-
import {
|
|
14
|
-
import { readPositiveIntegerParam, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/agent-runtime";
|
|
14
|
+
import { readPositiveIntegerParam as readPositiveIntegerParam$1, readStringArrayParam as readStringArrayParam$1, readStringParam as readStringParam$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
15
15
|
//#region extensions/discord/src/actions/handle-action.ts
|
|
16
16
|
const providerId = "discord";
|
|
17
17
|
function withCurrentSourceReplyRoute(result) {
|
|
@@ -31,7 +31,7 @@ function readCurrentDiscordTarget(toolContext) {
|
|
|
31
31
|
}
|
|
32
32
|
async function handleDiscordMessageAction(ctx) {
|
|
33
33
|
const { action, params, cfg } = ctx;
|
|
34
|
-
const accountId = ctx.accountId ?? readStringParam(params, "accountId");
|
|
34
|
+
const accountId = ctx.accountId ?? readStringParam$1(params, "accountId");
|
|
35
35
|
const readContext = ctx.requesterAccountId && ctx.toolContext?.currentChannelProvider && ctx.toolContext.currentChannelId ? {
|
|
36
36
|
requesterAccountId: ctx.requesterAccountId,
|
|
37
37
|
currentChannelProvider: ctx.toolContext.currentChannelProvider,
|
|
@@ -73,22 +73,23 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
73
73
|
return result;
|
|
74
74
|
};
|
|
75
75
|
const readTarget = () => {
|
|
76
|
-
const target = readStringParam(params, "channelId") ?? readStringParam(params, "to") ?? readCurrentDiscordTarget(ctx.toolContext);
|
|
76
|
+
const target = readStringParam$1(params, "channelId") ?? readStringParam$1(params, "to") ?? readCurrentDiscordTarget(ctx.toolContext);
|
|
77
77
|
if (!target) throw new Error("Discord channel target is required (use channel:<id>).");
|
|
78
78
|
return target;
|
|
79
79
|
};
|
|
80
80
|
const resolveChannelId = () => resolveDiscordChannelId(readTarget());
|
|
81
81
|
const readSendTarget = () => {
|
|
82
|
-
const target = readStringParam(params, "to") ?? readStringParam(params, "target") ?? readCurrentDiscordTarget(ctx.toolContext);
|
|
82
|
+
const target = readStringParam$1(params, "to") ?? readStringParam$1(params, "target") ?? readCurrentDiscordTarget(ctx.toolContext);
|
|
83
83
|
if (!target) throw new Error("Discord channel target is required (use channel:<id>).");
|
|
84
84
|
return target;
|
|
85
85
|
};
|
|
86
86
|
if (action === "send") {
|
|
87
87
|
const to = readSendTarget();
|
|
88
88
|
const asVoice = readBooleanParam(params, "asVoice") === true;
|
|
89
|
-
const mediaUrl = readStringParam(params, "media", { trim: false }) ?? readStringParam(params, "path", { trim: false }) ?? readStringParam(params, "filePath", { trim: false });
|
|
90
|
-
const requestedContent = readStringParam(params, "message", { allowEmpty: true });
|
|
91
|
-
const
|
|
89
|
+
const mediaUrl = readStringParam$1(params, "media", { trim: false }) ?? readStringParam$1(params, "path", { trim: false }) ?? readStringParam$1(params, "filePath", { trim: false });
|
|
90
|
+
const requestedContent = readStringParam$1(params, "message", { allowEmpty: true });
|
|
91
|
+
const explicitComponents = coerceDiscordComponentParam(params.components);
|
|
92
|
+
const presentation = explicitComponents == null ? normalizeMessagePresentation(params.presentation) : void 0;
|
|
92
93
|
const adaptedPresentation = presentation ? adaptMessagePresentationForChannel({
|
|
93
94
|
presentation,
|
|
94
95
|
capabilities: DISCORD_PRESENTATION_CAPABILITIES
|
|
@@ -100,26 +101,26 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
100
101
|
includesMedia: Boolean(mediaUrl)
|
|
101
102
|
}) ? generatedPresentationComponents : void 0;
|
|
102
103
|
const presentationFellBack = Boolean(generatedPresentationComponents && !presentationComponents);
|
|
103
|
-
const rawComponents = presentationFellBack ? void 0 :
|
|
104
|
+
const rawComponents = presentationFellBack ? void 0 : explicitComponents ?? presentationComponents ?? buildDiscordInteractiveComponents(normalizeLegacyInteractiveReply(params.interactive));
|
|
104
105
|
const hasComponents = Boolean(rawComponents) && (typeof rawComponents === "function" || typeof rawComponents === "object");
|
|
105
106
|
const components = hasComponents ? rawComponents : void 0;
|
|
106
107
|
const rawEmbeds = params.embeds;
|
|
107
108
|
const embeds = Array.isArray(rawEmbeds) ? rawEmbeds : void 0;
|
|
108
|
-
const content = readStringParam(params, "message", {
|
|
109
|
+
const content = readStringParam$1(params, "message", {
|
|
109
110
|
required: !asVoice && !hasComponents && !embeds?.length && !mediaUrl && !presentationFellBack,
|
|
110
111
|
allowEmpty: true
|
|
111
112
|
});
|
|
112
|
-
const deliveryContent = presentationFellBack &&
|
|
113
|
+
const deliveryContent = presentationFellBack && presentation ? renderMessagePresentationFallbackText({
|
|
113
114
|
text: content,
|
|
114
|
-
presentation
|
|
115
|
+
presentation
|
|
115
116
|
}) : content;
|
|
116
|
-
const filename = readStringParam(params, "filename");
|
|
117
|
-
const replyTo = readStringParam(params, "replyTo");
|
|
117
|
+
const filename = readStringParam$1(params, "filename");
|
|
118
|
+
const replyTo = readStringParam$1(params, "replyTo");
|
|
118
119
|
const silent = readBooleanParam(params, "silent") === true;
|
|
119
120
|
const suppressEmbeds = readBooleanParam(params, "suppressEmbeds");
|
|
120
|
-
const sessionKey = readStringParam(params, "__sessionKey");
|
|
121
|
-
const agentId = readStringParam(params, "__agentId");
|
|
122
|
-
const threadName = readStringParam(params, "threadName");
|
|
121
|
+
const sessionKey = readStringParam$1(params, "__sessionKey");
|
|
122
|
+
const agentId = readStringParam$1(params, "__agentId");
|
|
123
|
+
const threadName = readStringParam$1(params, "threadName");
|
|
123
124
|
const result = await handleDiscordAction({
|
|
124
125
|
action: "sendMessage",
|
|
125
126
|
accountId: accountId ?? void 0,
|
|
@@ -142,18 +143,18 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
142
143
|
}
|
|
143
144
|
if (action === "upload-file") {
|
|
144
145
|
const to = readSendTarget();
|
|
145
|
-
const mediaUrl = readStringParam(params, "filePath", { trim: false }) ?? readStringParam(params, "path", { trim: false }) ?? readStringParam(params, "media", { trim: false });
|
|
146
|
+
const mediaUrl = readStringParam$1(params, "filePath", { trim: false }) ?? readStringParam$1(params, "path", { trim: false }) ?? readStringParam$1(params, "media", { trim: false });
|
|
146
147
|
if (!mediaUrl) {
|
|
147
|
-
if (readStringParam(params, "buffer", { trim: false })) throw new Error("Use action: \"send\" for base64 buffer attachments; upload-file requires filePath, path, or media.");
|
|
148
|
+
if (readStringParam$1(params, "buffer", { trim: false })) throw new Error("Use action: \"send\" for base64 buffer attachments; upload-file requires filePath, path, or media.");
|
|
148
149
|
throw new Error("upload-file requires filePath, path, or media.");
|
|
149
150
|
}
|
|
150
|
-
const content = readStringParam(params, "message", { allowEmpty: true }) ?? readStringParam(params, "content", { allowEmpty: true }) ?? readStringParam(params, "caption", { allowEmpty: true });
|
|
151
|
-
const filename = readStringParam(params, "filename");
|
|
152
|
-
const replyTo = readStringParam(params, "replyTo");
|
|
151
|
+
const content = readStringParam$1(params, "message", { allowEmpty: true }) ?? readStringParam$1(params, "content", { allowEmpty: true }) ?? readStringParam$1(params, "caption", { allowEmpty: true });
|
|
152
|
+
const filename = readStringParam$1(params, "filename");
|
|
153
|
+
const replyTo = readStringParam$1(params, "replyTo");
|
|
153
154
|
const silent = readBooleanParam(params, "silent") === true;
|
|
154
155
|
const suppressEmbeds = readBooleanParam(params, "suppressEmbeds");
|
|
155
|
-
const sessionKey = readStringParam(params, "__sessionKey");
|
|
156
|
-
const agentId = readStringParam(params, "__agentId");
|
|
156
|
+
const sessionKey = readStringParam$1(params, "__sessionKey");
|
|
157
|
+
const agentId = readStringParam$1(params, "__agentId");
|
|
157
158
|
const result = await handleDiscordAction({
|
|
158
159
|
action: "sendMessage",
|
|
159
160
|
accountId: accountId ?? void 0,
|
|
@@ -171,12 +172,13 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
171
172
|
return withAdoptedThreadReplyRoute(result, to, sessionKey);
|
|
172
173
|
}
|
|
173
174
|
if (action === "react") {
|
|
174
|
-
const
|
|
175
|
+
const messageIdRaw = resolveReactionMessageId({
|
|
175
176
|
args: params,
|
|
176
177
|
toolContext: ctx.toolContext
|
|
177
|
-
})
|
|
178
|
+
});
|
|
179
|
+
const messageId = normalizeOptionalStringifiedId(messageIdRaw) ?? "";
|
|
178
180
|
if (!messageId) throw new Error("messageId required. Provide messageId explicitly or react to the current inbound message.");
|
|
179
|
-
const emoji = readStringParam(params, "emoji", { allowEmpty: true });
|
|
181
|
+
const emoji = readStringParam$1(params, "emoji", { allowEmpty: true });
|
|
180
182
|
const remove = readBooleanParam(params, "remove");
|
|
181
183
|
return await handleDiscordAction({
|
|
182
184
|
action: "react",
|
|
@@ -188,8 +190,8 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
188
190
|
}, cfg, actionOptions);
|
|
189
191
|
}
|
|
190
192
|
if (action === "reactions") {
|
|
191
|
-
const messageId = readStringParam(params, "messageId", { required: true });
|
|
192
|
-
const limit = readPositiveIntegerParam(params, "limit");
|
|
193
|
+
const messageId = readStringParam$1(params, "messageId", { required: true });
|
|
194
|
+
const limit = readPositiveIntegerParam$1(params, "limit");
|
|
193
195
|
return await handleDiscordAction({
|
|
194
196
|
action: "reactions",
|
|
195
197
|
accountId: accountId ?? void 0,
|
|
@@ -199,20 +201,20 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
199
201
|
}, cfg, actionOptions);
|
|
200
202
|
}
|
|
201
203
|
if (action === "read") {
|
|
202
|
-
const limit = readPositiveIntegerParam(params, "limit");
|
|
204
|
+
const limit = readPositiveIntegerParam$1(params, "limit");
|
|
203
205
|
return await handleDiscordAction({
|
|
204
206
|
action: "readMessages",
|
|
205
207
|
accountId: accountId ?? void 0,
|
|
206
208
|
channelId: resolveChannelId(),
|
|
207
209
|
limit,
|
|
208
|
-
before: readStringParam(params, "before"),
|
|
209
|
-
after: readStringParam(params, "after"),
|
|
210
|
-
around: readStringParam(params, "around")
|
|
210
|
+
before: readStringParam$1(params, "before"),
|
|
211
|
+
after: readStringParam$1(params, "after"),
|
|
212
|
+
around: readStringParam$1(params, "around")
|
|
211
213
|
}, cfg, actionOptions);
|
|
212
214
|
}
|
|
213
215
|
if (action === "edit") {
|
|
214
|
-
const messageId = readStringParam(params, "messageId", { required: true });
|
|
215
|
-
const content = readStringParam(params, "message", { required: true });
|
|
216
|
+
const messageId = readStringParam$1(params, "messageId", { required: true });
|
|
217
|
+
const content = readStringParam$1(params, "message", { required: true });
|
|
216
218
|
return await handleDiscordAction({
|
|
217
219
|
action: "editMessage",
|
|
218
220
|
accountId: accountId ?? void 0,
|
|
@@ -222,7 +224,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
222
224
|
}, cfg, actionOptions);
|
|
223
225
|
}
|
|
224
226
|
if (action === "delete") {
|
|
225
|
-
const messageId = readStringParam(params, "messageId", { required: true });
|
|
227
|
+
const messageId = readStringParam$1(params, "messageId", { required: true });
|
|
226
228
|
return await handleDiscordAction({
|
|
227
229
|
action: "deleteMessage",
|
|
228
230
|
accountId: accountId ?? void 0,
|
|
@@ -231,7 +233,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
231
233
|
}, cfg, actionOptions);
|
|
232
234
|
}
|
|
233
235
|
if (action === "pin" || action === "unpin" || action === "list-pins") {
|
|
234
|
-
const messageId = action === "list-pins" ? void 0 : readStringParam(params, "messageId", { required: true });
|
|
236
|
+
const messageId = action === "list-pins" ? void 0 : readStringParam$1(params, "messageId", { required: true });
|
|
235
237
|
return await handleDiscordAction({
|
|
236
238
|
action: action === "pin" ? "pinMessage" : action === "unpin" ? "unpinMessage" : "listPins",
|
|
237
239
|
accountId: accountId ?? void 0,
|
|
@@ -245,11 +247,11 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
245
247
|
channelId: resolveChannelId()
|
|
246
248
|
}, cfg, actionOptions);
|
|
247
249
|
if (action === "thread-create") {
|
|
248
|
-
const name = readStringParam(params, "threadName", { required: true });
|
|
249
|
-
const messageId = readStringParam(params, "messageId");
|
|
250
|
-
const content = readStringParam(params, "message");
|
|
250
|
+
const name = readStringParam$1(params, "threadName", { required: true });
|
|
251
|
+
const messageId = readStringParam$1(params, "messageId");
|
|
252
|
+
const content = readStringParam$1(params, "message");
|
|
251
253
|
const autoArchiveMinutes = readDiscordAutoArchiveDurationParam(params, "autoArchiveMin");
|
|
252
|
-
const appliedTags = readStringArrayParam(params, "appliedTags");
|
|
254
|
+
const appliedTags = readStringArrayParam$1(params, "appliedTags");
|
|
253
255
|
const result = await handleDiscordAction({
|
|
254
256
|
action: "threadCreate",
|
|
255
257
|
accountId: accountId ?? void 0,
|
|
@@ -275,8 +277,8 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
275
277
|
return result;
|
|
276
278
|
}
|
|
277
279
|
if (action === "sticker") {
|
|
278
|
-
const to = readStringParam(params, "to", { required: true });
|
|
279
|
-
const stickerIds = readStringArrayParam(params, "stickerId", {
|
|
280
|
+
const to = readStringParam$1(params, "to", { required: true });
|
|
281
|
+
const stickerIds = readStringArrayParam$1(params, "stickerId", {
|
|
280
282
|
required: true,
|
|
281
283
|
label: "sticker-id"
|
|
282
284
|
}) ?? [];
|
|
@@ -285,7 +287,8 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
285
287
|
accountId: accountId ?? void 0,
|
|
286
288
|
to,
|
|
287
289
|
stickerIds,
|
|
288
|
-
content: readStringParam(params, "message")
|
|
290
|
+
content: readStringParam$1(params, "message"),
|
|
291
|
+
...readBooleanParam(params, "silent") === true ? { silent: true } : {}
|
|
289
292
|
}, cfg, actionOptions);
|
|
290
293
|
notifyVisibleOutbound(result, to);
|
|
291
294
|
return result;
|
|
@@ -293,11 +296,11 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
293
296
|
if (action === "set-presence") return await handleDiscordAction({
|
|
294
297
|
action: "setPresence",
|
|
295
298
|
accountId: accountId ?? void 0,
|
|
296
|
-
status: readStringParam(params, "status"),
|
|
297
|
-
activityType: readStringParam(params, "activityType"),
|
|
298
|
-
activityName: readStringParam(params, "activityName"),
|
|
299
|
-
activityUrl: readStringParam(params, "activityUrl"),
|
|
300
|
-
activityState: readStringParam(params, "activityState")
|
|
299
|
+
status: readStringParam$1(params, "status"),
|
|
300
|
+
activityType: readStringParam$1(params, "activityType"),
|
|
301
|
+
activityName: readStringParam$1(params, "activityName"),
|
|
302
|
+
activityUrl: readStringParam$1(params, "activityUrl"),
|
|
303
|
+
activityState: readStringParam$1(params, "activityState")
|
|
301
304
|
}, cfg, actionOptions);
|
|
302
305
|
const adminResult = await tryHandleDiscordMessageActionGuildAdmin({
|
|
303
306
|
ctx,
|
|
@@ -307,7 +310,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
307
310
|
});
|
|
308
311
|
if (adminResult !== void 0) {
|
|
309
312
|
if (action === "thread-reply") {
|
|
310
|
-
const threadId = readStringParam(params, "threadId") ?? readTarget();
|
|
313
|
+
const threadId = readStringParam$1(params, "threadId") ?? readTarget();
|
|
311
314
|
notifyVisibleOutbound(adminResult, threadId);
|
|
312
315
|
return withAdoptedThreadReplyRoute(adminResult, threadId);
|
|
313
316
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DiscordChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as DiscordChannelConfigSchema } from "./config-schema-B797-Spt.js";
|
|
2
2
|
export { DiscordChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordPlugin } from "./channel-
|
|
1
|
+
import { t as discordPlugin } from "./channel-CarzU3bg.js";
|
|
2
2
|
export { discordPlugin };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ChannelType } from "discord-api-types/v10";
|
|
2
|
+
//#region extensions/discord/src/channel-type.ts
|
|
3
|
+
function isDiscordThreadChannelType(channelType) {
|
|
4
|
+
return channelType === ChannelType.AnnouncementThread || channelType === ChannelType.PublicThread || channelType === ChannelType.PrivateThread;
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { isDiscordThreadChannelType as t };
|