@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
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { _ as inspectDiscordAccountTokenState, o as mergeDiscordAccountConfig, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig, v as resolveDiscordAccountAvailability } from "./accounts-CwJQoLjM.js";
|
|
2
|
+
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
|
+
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
+
import { normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
5
|
+
//#region extensions/discord/src/account-inspect.ts
|
|
6
|
+
function inspectDiscordAccountPrimary(params) {
|
|
7
|
+
const accountId = normalizeAccountId(params.accountId ?? resolveDefaultDiscordAccountId(params.cfg));
|
|
8
|
+
const merged = mergeDiscordAccountConfig(params.cfg, accountId);
|
|
9
|
+
const enabled = params.cfg.channels?.discord?.enabled !== false && merged.enabled !== false;
|
|
10
|
+
const accountConfig = resolveDiscordAccountConfig(params.cfg, accountId);
|
|
11
|
+
const hasAccountToken = Boolean(accountConfig && Object.hasOwn(accountConfig, "token"));
|
|
12
|
+
return inspectDiscordAccountTokenState({
|
|
13
|
+
base: {
|
|
14
|
+
accountId,
|
|
15
|
+
enabled,
|
|
16
|
+
name: normalizeOptionalString(merged.name)
|
|
17
|
+
},
|
|
18
|
+
config: merged,
|
|
19
|
+
accountToken: accountConfig?.token,
|
|
20
|
+
hasAccountToken,
|
|
21
|
+
channelToken: params.cfg.channels?.discord?.token,
|
|
22
|
+
resolveFallbackToken: () => {
|
|
23
|
+
const envToken = accountId === DEFAULT_ACCOUNT_ID ? normalizeSecretInputString(params.envToken ?? process.env.DISCORD_BOT_TOKEN) : void 0;
|
|
24
|
+
return {
|
|
25
|
+
token: envToken?.replace(/^Bot\s+/i, "") ?? "",
|
|
26
|
+
source: envToken ? "env" : "none"
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function inspectDiscordAccount(params) {
|
|
32
|
+
const account = inspectDiscordAccountPrimary(params);
|
|
33
|
+
return {
|
|
34
|
+
...account,
|
|
35
|
+
...resolveDiscordAccountAvailability({
|
|
36
|
+
account,
|
|
37
|
+
resolveAccounts: () => listDiscordAccountIds(params.cfg).map((accountId) => inspectDiscordAccountPrimary({
|
|
38
|
+
...params,
|
|
39
|
+
accountId
|
|
40
|
+
}))
|
|
41
|
+
})
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { inspectDiscordAccount as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
1
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BY-ve3yH.js";
|
|
2
2
|
//#region extensions/discord/account-inspect-api.ts
|
|
3
3
|
function inspectDiscordReadOnlyAccount(cfg, accountId) {
|
|
4
4
|
return inspectDiscordAccount({
|
|
@@ -1,128 +1,88 @@
|
|
|
1
|
-
import "./config-schema-DC5kDtQ5.js";
|
|
2
1
|
import { createAccountActionGate, createAccountListHelpers } from "openclaw/plugin-sdk/account-helpers";
|
|
3
|
-
import {
|
|
2
|
+
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
4
3
|
import { mapAllowFromEntries, normalizeChannelDmPolicy } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
5
|
-
import {
|
|
4
|
+
import { resolveConfiguredFromCredentialStatuses } from "openclaw/plugin-sdk/channel-status";
|
|
5
|
+
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, normalizeAccountId as normalizeAccountId$1, resolveAccountEntry } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
|
-
import {
|
|
8
|
-
import "openclaw/plugin-sdk/channel-config-schema";
|
|
9
|
-
import { normalizeResolvedSecretInputString, resolveSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
10
|
-
import { buildThreadAwareOutboundSessionRoute } from "openclaw/plugin-sdk/channel-core";
|
|
11
|
-
import { assertMediaNotDataUrl, jsonResult, parseAvailableTags, readNonNegativeIntegerParam, readPositiveIntegerParam, readReactionParams, readStringArrayParam, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
|
|
12
|
-
import { readBooleanParam as readBooleanParam$1 } from "openclaw/plugin-sdk/boolean-param";
|
|
13
|
-
import "openclaw/plugin-sdk/channel-plugin-common";
|
|
14
|
-
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
15
|
-
import { buildMessagingTarget, parseMentionPrefixOrAtUserTarget, requireTargetKind } from "openclaw/plugin-sdk/channel-targets";
|
|
7
|
+
import { hasConfiguredSecretInput, normalizeResolvedSecretInputString, normalizeSecretInputString, resolveSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
16
8
|
import { getRuntimeConfigSnapshot, getRuntimeConfigSourceSnapshot, selectApplicableRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
17
|
-
//#region extensions/discord/src/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
if (id !== DISCORD_CHANNEL_META.id) throw new Error(`Unsupported Discord channel meta lookup: ${id}`);
|
|
32
|
-
return DISCORD_CHANNEL_META;
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region extensions/discord/src/target-parsing.ts
|
|
36
|
-
function parseDiscordTarget(raw, options = {}) {
|
|
37
|
-
const trimmed = raw.trim();
|
|
38
|
-
if (!trimmed) return;
|
|
39
|
-
const providerPrefixedTarget = parseDiscordProviderPrefixedTarget(trimmed);
|
|
40
|
-
if (providerPrefixedTarget) return providerPrefixedTarget;
|
|
41
|
-
const userTarget = parseMentionPrefixOrAtUserTarget({
|
|
42
|
-
raw: trimmed,
|
|
43
|
-
mentionPattern: /^<@!?(\d+)>$/,
|
|
44
|
-
prefixes: [
|
|
45
|
-
{
|
|
46
|
-
prefix: "user:",
|
|
47
|
-
kind: "user"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
prefix: "channel:",
|
|
51
|
-
kind: "channel"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
prefix: "discord:",
|
|
55
|
-
kind: "user"
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
atUserPattern: /^\d+$/,
|
|
59
|
-
atUserErrorMessage: "Discord DMs require a user id (use user:<id> or a <@id> mention)"
|
|
60
|
-
});
|
|
61
|
-
if (userTarget) return userTarget;
|
|
62
|
-
if (/^\d+$/.test(trimmed)) {
|
|
63
|
-
if (options.defaultKind) return buildMessagingTarget(options.defaultKind, trimmed, trimmed);
|
|
64
|
-
throw new Error(options.ambiguousMessage ?? `Ambiguous Discord recipient "${trimmed}". For DMs use "user:${trimmed}" or "<@${trimmed}>"; for channels use "channel:${trimmed}".`);
|
|
65
|
-
}
|
|
66
|
-
return buildMessagingTarget("channel", trimmed, trimmed);
|
|
67
|
-
}
|
|
68
|
-
function parseDiscordProviderPrefixedTarget(raw) {
|
|
69
|
-
const match = /^discord:(channel|user):(.+)$/i.exec(raw);
|
|
70
|
-
if (!match) return;
|
|
71
|
-
const kind = match[1]?.toLowerCase();
|
|
72
|
-
const id = match[2]?.trim();
|
|
73
|
-
if (!kind || !id) return;
|
|
74
|
-
return buildMessagingTarget(kind, id, `${kind}:${id}`);
|
|
75
|
-
}
|
|
76
|
-
function resolveDiscordChannelId(raw) {
|
|
77
|
-
return requireTargetKind({
|
|
78
|
-
platform: "Discord",
|
|
79
|
-
target: parseDiscordTarget(raw, { defaultKind: "channel" }),
|
|
80
|
-
kind: "channel"
|
|
81
|
-
});
|
|
9
|
+
//#region extensions/discord/src/account-token-inspect.ts
|
|
10
|
+
function inspectDiscordConfiguredToken(value) {
|
|
11
|
+
const normalized = normalizeSecretInputString(value);
|
|
12
|
+
if (normalized) return {
|
|
13
|
+
token: normalized.replace(/^Bot\s+/i, ""),
|
|
14
|
+
tokenSource: "config",
|
|
15
|
+
tokenStatus: "available"
|
|
16
|
+
};
|
|
17
|
+
if (hasConfiguredSecretInput(value)) return {
|
|
18
|
+
token: "",
|
|
19
|
+
tokenSource: "config",
|
|
20
|
+
tokenStatus: "configured_unavailable"
|
|
21
|
+
};
|
|
22
|
+
return null;
|
|
82
23
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
24
|
+
function inspectDiscordAccountTokenState(params) {
|
|
25
|
+
const accountToken = inspectDiscordConfiguredToken(params.accountToken);
|
|
26
|
+
if (accountToken) return {
|
|
27
|
+
...params.base,
|
|
28
|
+
...accountToken,
|
|
29
|
+
configured: true,
|
|
30
|
+
config: params.config
|
|
31
|
+
};
|
|
32
|
+
if (params.hasAccountToken) return {
|
|
33
|
+
...params.base,
|
|
34
|
+
token: "",
|
|
35
|
+
tokenSource: "none",
|
|
36
|
+
tokenStatus: "missing",
|
|
37
|
+
configured: false,
|
|
38
|
+
config: params.config
|
|
39
|
+
};
|
|
40
|
+
const channelToken = inspectDiscordConfiguredToken(params.channelToken);
|
|
41
|
+
if (channelToken) return {
|
|
42
|
+
...params.base,
|
|
43
|
+
...channelToken,
|
|
44
|
+
configured: true,
|
|
45
|
+
config: params.config
|
|
46
|
+
};
|
|
47
|
+
const fallback = params.resolveFallbackToken();
|
|
48
|
+
if (fallback.token) return {
|
|
49
|
+
...params.base,
|
|
50
|
+
token: fallback.token,
|
|
51
|
+
tokenSource: fallback.source,
|
|
52
|
+
tokenStatus: "available",
|
|
53
|
+
configured: true,
|
|
54
|
+
config: params.config
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
...params.base,
|
|
58
|
+
token: "",
|
|
59
|
+
tokenSource: "none",
|
|
60
|
+
tokenStatus: "missing",
|
|
61
|
+
configured: false,
|
|
62
|
+
config: params.config
|
|
95
63
|
};
|
|
96
|
-
const baseSessionKey = buildOutboundBaseSessionKey({
|
|
97
|
-
cfg: params.cfg,
|
|
98
|
-
agentId: params.agentId,
|
|
99
|
-
channel: "discord",
|
|
100
|
-
accountId: params.accountId,
|
|
101
|
-
peer
|
|
102
|
-
});
|
|
103
|
-
return buildThreadAwareOutboundSessionRoute({
|
|
104
|
-
route: {
|
|
105
|
-
sessionKey: baseSessionKey,
|
|
106
|
-
baseSessionKey,
|
|
107
|
-
recipientSessionExact,
|
|
108
|
-
peer,
|
|
109
|
-
chatType: isDm ? "direct" : "channel",
|
|
110
|
-
from: isDm ? `discord:${peerId}` : `discord:channel:${peerId}`,
|
|
111
|
-
to: isDm ? `user:${peerId}` : `channel:${peerId}`
|
|
112
|
-
},
|
|
113
|
-
threadId: params.threadId,
|
|
114
|
-
precedence: ["threadId"],
|
|
115
|
-
useSuffix: false
|
|
116
|
-
});
|
|
117
64
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
65
|
+
/** Runtime and inspection keep the first enabled owner, preferring config over env tokens. */
|
|
66
|
+
function resolveDiscordAccountAvailability(params) {
|
|
67
|
+
if (!params.account.enabled) return {
|
|
68
|
+
enabled: false,
|
|
69
|
+
stateReason: "disabled"
|
|
70
|
+
};
|
|
71
|
+
const token = params.account.token.trim();
|
|
72
|
+
let owner;
|
|
73
|
+
if (token) for (const account of params.resolveAccounts()) {
|
|
74
|
+
if (!account.enabled || account.token.trim() !== token) continue;
|
|
75
|
+
const priority = account.tokenSource === "config" ? 2 : account.tokenSource === "env" ? 1 : 0;
|
|
76
|
+
if (!owner || priority > owner.priority) owner = {
|
|
77
|
+
accountId: account.accountId,
|
|
78
|
+
priority
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const duplicateOwner = owner && owner.accountId !== params.account.accountId ? owner.accountId : void 0;
|
|
82
|
+
return {
|
|
83
|
+
enabled: !duplicateOwner,
|
|
84
|
+
stateReason: duplicateOwner ? `duplicate bot token; using account "${duplicateOwner}"` : void 0
|
|
85
|
+
};
|
|
126
86
|
}
|
|
127
87
|
//#endregion
|
|
128
88
|
//#region extensions/discord/src/runtime-config.ts
|
|
@@ -305,55 +265,20 @@ function resolveDiscordMaxLinesPerMessage(params) {
|
|
|
305
265
|
accountId: params.accountId
|
|
306
266
|
}).config.maxLinesPerMessage;
|
|
307
267
|
}
|
|
308
|
-
function
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
for (const [index, accountId] of accountIds.entries()) {
|
|
314
|
-
const account = resolveDiscordAccount({
|
|
315
|
-
cfg: params.cfg,
|
|
268
|
+
function inspectDiscordRuntimeAvailability(account, cfg) {
|
|
269
|
+
return resolveDiscordAccountAvailability({
|
|
270
|
+
account,
|
|
271
|
+
resolveAccounts: () => listDiscordAccountIds(cfg).map((accountId) => resolveDiscordAccount({
|
|
272
|
+
cfg,
|
|
316
273
|
accountId
|
|
317
|
-
})
|
|
318
|
-
const accountToken = account.token.trim();
|
|
319
|
-
if (!account.enabled || accountToken !== token) continue;
|
|
320
|
-
const priority = account.tokenSource === "config" ? 2 : account.tokenSource === "env" ? 1 : 0;
|
|
321
|
-
if (!owner || priority > owner.priority) {
|
|
322
|
-
owner = {
|
|
323
|
-
accountId: account.accountId,
|
|
324
|
-
priority,
|
|
325
|
-
index
|
|
326
|
-
};
|
|
327
|
-
continue;
|
|
328
|
-
}
|
|
329
|
-
if (priority === owner.priority && index < owner.index) owner = {
|
|
330
|
-
accountId: account.accountId,
|
|
331
|
-
priority,
|
|
332
|
-
index
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
return owner?.accountId;
|
|
336
|
-
}
|
|
337
|
-
function resolveDiscordDuplicateTokenOwner(params) {
|
|
338
|
-
const owner = resolveDiscordAccountTokenOwner({
|
|
339
|
-
cfg: params.cfg,
|
|
340
|
-
token: params.account.token
|
|
274
|
+
}))
|
|
341
275
|
});
|
|
342
|
-
return owner && owner !== params.account.accountId ? owner : void 0;
|
|
343
276
|
}
|
|
344
277
|
function isDiscordAccountEnabledForRuntime(account, cfg) {
|
|
345
|
-
return account.enabled
|
|
346
|
-
cfg,
|
|
347
|
-
account
|
|
348
|
-
});
|
|
278
|
+
return inspectDiscordRuntimeAvailability(account, cfg).enabled;
|
|
349
279
|
}
|
|
350
280
|
function resolveDiscordAccountDisabledReason(account, cfg) {
|
|
351
|
-
|
|
352
|
-
const owner = resolveDiscordDuplicateTokenOwner({
|
|
353
|
-
cfg,
|
|
354
|
-
account
|
|
355
|
-
});
|
|
356
|
-
return owner ? `duplicate bot token; using account "${owner}"` : "disabled";
|
|
281
|
+
return inspectDiscordRuntimeAvailability(account, cfg).stateReason ?? "disabled";
|
|
357
282
|
}
|
|
358
283
|
function listEnabledDiscordAccounts(cfg) {
|
|
359
284
|
return listDiscordAccountIds(cfg).map((accountId) => resolveDiscordAccount({
|
|
@@ -368,4 +293,4 @@ function listDiscordStartupAccountIds(cfg) {
|
|
|
368
293
|
return [defaultAccountId, ...startupAccountIds.filter((candidateId) => candidateId !== defaultAccountId)];
|
|
369
294
|
}
|
|
370
295
|
//#endregion
|
|
371
|
-
export {
|
|
296
|
+
export { inspectDiscordAccountTokenState as _, listEnabledDiscordAccounts as a, resolveDiscordAccount as c, resolveDiscordAccountDisabledReason as d, resolveDiscordAccountDmPolicy as f, selectDiscordActivitiesRuntimeConfig as g, resolveDiscordToken as h, listDiscordStartupAccountIds as i, resolveDiscordAccountAllowFrom as l, normalizeDiscordToken as m, isDiscordAccountEnabledForRuntime as n, mergeDiscordAccountConfig as o, resolveDiscordMaxLinesPerMessage as p, listDiscordAccountIds as r, resolveDefaultDiscordAccountId as s, createDiscordActionGate as t, resolveDiscordAccountConfig as u, resolveDiscordAccountAvailability as v };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { t as handleDiscordAction } from "./runtime-DydyfxST.js";
|
|
2
2
|
export { handleDiscordAction };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { r as
|
|
1
|
+
import { v as resolveDiscordChannelId$1 } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { S as parseDiscordActivityCustomId, i as buildDiscordPresentationComponents } from "./components-gvRA0oaI.js";
|
|
3
|
+
import { c as resolveDiscordAccount } from "./accounts-CwJQoLjM.js";
|
|
4
|
+
import { r as sendDiscordComponentMessage } from "./send.components-nsPnc7kK.js";
|
|
5
|
+
import { r as setDiscordActivitiesRuntime, t as DiscordActivitiesRuntime } from "./runtime-BNlDfLwS.js";
|
|
5
6
|
import fs from "node:fs/promises";
|
|
6
7
|
import { logError } from "openclaw/plugin-sdk/logging-core";
|
|
7
8
|
import { resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
|
|
@@ -13,7 +14,7 @@ import { fetchWithSsrFGuard as fetchWithSsrFGuard$1 } from "openclaw/plugin-sdk/
|
|
|
13
14
|
const DISCORD_TOKEN_URL = "https://discord.com/api/oauth2/token";
|
|
14
15
|
const DISCORD_USER_URL = "https://discord.com/api/v10/users/@me";
|
|
15
16
|
const DISCORD_HOST = "discord.com";
|
|
16
|
-
const JSON_MAX_BYTES =
|
|
17
|
+
const JSON_MAX_BYTES = 65536;
|
|
17
18
|
const INSTANCE_ID_MAX_LENGTH = 256;
|
|
18
19
|
function normalizeInstanceId(value) {
|
|
19
20
|
const instanceId = value?.trim();
|
|
@@ -242,7 +243,7 @@ run().catch((error) => {
|
|
|
242
243
|
`;
|
|
243
244
|
//#endregion
|
|
244
245
|
//#region extensions/discord/src/activities/http.ts
|
|
245
|
-
const BODY_MAX_BYTES =
|
|
246
|
+
const BODY_MAX_BYTES = 8192;
|
|
246
247
|
const WIDGET_ID_PATTERN = /^[A-Za-z0-9_-]{22}$/;
|
|
247
248
|
const DOC_TOKEN_PATTERN = /^[A-Za-z0-9_-]{43}$/;
|
|
248
249
|
const DISCORD_ACTIVITY_WIDGET_CSP = "sandbox allow-scripts; default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data: blob:; font-src data:; connect-src 'none'; frame-ancestors *";
|
|
@@ -465,7 +466,7 @@ function createDiscordActivityHttpHandler(deps) {
|
|
|
465
466
|
}
|
|
466
467
|
//#endregion
|
|
467
468
|
//#region extensions/discord/src/activities/presenter.ts
|
|
468
|
-
const DISCORD_WIDGET_HTML_MAX_BYTES =
|
|
469
|
+
const DISCORD_WIDGET_HTML_MAX_BYTES = 49152;
|
|
469
470
|
function resolveDiscordChannelId(context) {
|
|
470
471
|
const raw = context.nativeChannelId?.trim() || context.currentMessagingTarget?.trim() || context.currentChannelId?.trim() || context.deliveryContext?.to?.trim();
|
|
471
472
|
if (!raw) return;
|
|
@@ -592,12 +593,12 @@ function createDiscordWidgetPresenter(runtime, deps = {}) {
|
|
|
592
593
|
}
|
|
593
594
|
//#endregion
|
|
594
595
|
//#region extensions/discord/src/activities/store.ts
|
|
595
|
-
const DAY_MS =
|
|
596
|
+
const DAY_MS = 864e5;
|
|
596
597
|
const DISCORD_EPOCH_MS = 14200704e5;
|
|
597
598
|
const WIDGET_TTL_MS = 7 * DAY_MS;
|
|
598
|
-
const SESSION_TTL_MS =
|
|
599
|
-
const DOC_TOKEN_TTL_MS =
|
|
600
|
-
const PENDING_LAUNCH_TTL_MS =
|
|
599
|
+
const SESSION_TTL_MS = 9e5;
|
|
600
|
+
const DOC_TOKEN_TTL_MS = 6e4;
|
|
601
|
+
const PENDING_LAUNCH_TTL_MS = 12e4;
|
|
601
602
|
function requireAtomicUpdate(store) {
|
|
602
603
|
if (!store.update) throw new Error("Discord Activities require atomic plugin state updates");
|
|
603
604
|
return store;
|
|
@@ -721,7 +722,8 @@ var DiscordActivityStore = class {
|
|
|
721
722
|
//#region extensions/discord/src/activities/register.ts
|
|
722
723
|
function registerDiscordActivities$1(api) {
|
|
723
724
|
setDiscordActivitiesRuntime(void 0);
|
|
724
|
-
const
|
|
725
|
+
const store = new DiscordActivityStore(openDiscordActivityStores((options) => api.runtime.state.openKeyedStore(options)));
|
|
726
|
+
const runtime = new DiscordActivitiesRuntime(store, api.config, api.runtime.config?.current ? () => api.runtime.config.current() : void 0);
|
|
725
727
|
setDiscordActivitiesRuntime(runtime);
|
|
726
728
|
const http = createDiscordActivityHttpHandler({
|
|
727
729
|
runtime,
|
package/dist/activities-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as registerDiscordActivities } from "./activities-api-
|
|
1
|
+
import { t as registerDiscordActivities } from "./activities-api-CkKcHUB6.js";
|
|
2
2
|
export { registerDiscordActivities };
|
|
@@ -258,10 +258,12 @@ function buildDiscordChannelKeys(params) {
|
|
|
258
258
|
return buildChannelKeyCandidates(params.id, allowNameMatch ? params.slug : void 0, allowNameMatch ? params.name : void 0);
|
|
259
259
|
}
|
|
260
260
|
function resolveDiscordChannelEntryMatch(channels, params, parentParams) {
|
|
261
|
+
const keys = buildDiscordChannelKeys(params);
|
|
262
|
+
const parentKeys = parentParams ? buildDiscordChannelKeys(parentParams) : void 0;
|
|
261
263
|
return resolveChannelEntryMatchWithFallback({
|
|
262
264
|
entries: channels,
|
|
263
|
-
keys
|
|
264
|
-
parentKeys
|
|
265
|
+
keys,
|
|
266
|
+
parentKeys,
|
|
265
267
|
wildcardKey: "*"
|
|
266
268
|
});
|
|
267
269
|
}
|
|
@@ -288,18 +290,19 @@ function resolveDiscordChannelConfig(params) {
|
|
|
288
290
|
const { guildInfo, channelId, channelName, channelSlug } = params;
|
|
289
291
|
const channels = guildInfo?.channels;
|
|
290
292
|
if (!hasConfiguredDiscordChannels(channels)) return null;
|
|
291
|
-
|
|
293
|
+
const match = resolveDiscordChannelEntryMatch(channels, {
|
|
292
294
|
id: channelId,
|
|
293
295
|
name: channelName,
|
|
294
296
|
slug: channelSlug
|
|
295
|
-
})
|
|
297
|
+
});
|
|
298
|
+
return resolveChannelMatchConfig(match, resolveDiscordChannelConfigEntry) ?? { allowed: false };
|
|
296
299
|
}
|
|
297
300
|
function resolveDiscordChannelConfigWithFallback(params) {
|
|
298
301
|
const { guildInfo, channelId, channelName, channelSlug, parentId, parentName, parentSlug, scope } = params;
|
|
299
302
|
const channels = guildInfo?.channels;
|
|
300
303
|
if (!hasConfiguredDiscordChannels(channels)) return null;
|
|
301
304
|
const resolvedParentSlug = parentSlug ?? (parentName ? normalizeDiscordSlug(parentName) : "");
|
|
302
|
-
|
|
305
|
+
const match = resolveDiscordChannelEntryMatch(channels, {
|
|
303
306
|
id: channelId,
|
|
304
307
|
name: channelName,
|
|
305
308
|
slug: channelSlug,
|
|
@@ -308,7 +311,8 @@ function resolveDiscordChannelConfigWithFallback(params) {
|
|
|
308
311
|
id: parentId ?? "",
|
|
309
312
|
name: parentName,
|
|
310
313
|
slug: resolvedParentSlug
|
|
311
|
-
} : void 0)
|
|
314
|
+
} : void 0);
|
|
315
|
+
return resolveChannelMatchConfig(match, resolveDiscordChannelConfigEntry) ?? { allowed: false };
|
|
312
316
|
}
|
|
313
317
|
function resolveDiscordShouldRequireMention(params) {
|
|
314
318
|
if (!params.isGuildMessage) return false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as parseDiscordRetryAfterBodySeconds } from "./retry-after-
|
|
1
|
+
import { t as parseDiscordRetryAfterBodySeconds } from "./retry-after-BrLjLUJi.js";
|
|
2
2
|
import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
3
3
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
4
4
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
@@ -27,12 +27,12 @@ const DISCORD_API_BASE = "https://discord.com/api/v10";
|
|
|
27
27
|
const DISCORD_API_RETRY_DEFAULTS = {
|
|
28
28
|
attempts: 3,
|
|
29
29
|
minDelayMs: 500,
|
|
30
|
-
maxDelayMs:
|
|
30
|
+
maxDelayMs: 3e5,
|
|
31
31
|
jitter: .1
|
|
32
32
|
};
|
|
33
33
|
const DISCORD_API_429_FALLBACK_RETRY_AFTER_SECONDS = 60;
|
|
34
|
-
const DISCORD_API_ERROR_BODY_LIMIT_BYTES =
|
|
35
|
-
const DISCORD_API_RESPONSE_BODY_LIMIT_BYTES =
|
|
34
|
+
const DISCORD_API_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
35
|
+
const DISCORD_API_RESPONSE_BODY_LIMIT_BYTES = 4194304;
|
|
36
36
|
const DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS = 1e4;
|
|
37
37
|
function parseDiscordApiErrorPayload(text) {
|
|
38
38
|
const trimmed = text.trim();
|
|
@@ -46,7 +46,8 @@ function parseDiscordApiErrorPayload(text) {
|
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
48
|
function parseRetryAfterSeconds(text, response) {
|
|
49
|
-
const
|
|
49
|
+
const payload = parseDiscordApiErrorPayload(text);
|
|
50
|
+
const retryAfter = parseDiscordRetryAfterBodySeconds(payload?.retry_after);
|
|
50
51
|
if (retryAfter !== void 0) return retryAfter;
|
|
51
52
|
const header = response.headers.get("Retry-After");
|
|
52
53
|
if (!header) return;
|
package/dist/api.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { i as requestDiscord, n as DiscordApiError, r as fetchDiscord } from "./api-
|
|
5
|
-
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-
|
|
6
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
7
|
-
import { i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-
|
|
8
|
-
import "./targets-
|
|
9
|
-
import {
|
|
10
|
-
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-
|
|
1
|
+
import { _ as parseDiscordTarget, g as normalizeDiscordOutboundTarget, h as normalizeDiscordMessagingTarget, m as looksLikeDiscordTargetId, v as resolveDiscordChannelId } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, T as parseDiscordComponentCustomIdForInteraction, _ as DISCORD_COMPONENT_CUSTOM_ID_KEY, b as buildDiscordComponentCustomId, d as buildDiscordComponentMessage, f as buildDiscordComponentMessageFlags, g as resolveDiscordComponentAttachmentName, h as readDiscordComponentSpec, l as DiscordFormModal, n as formatDiscordComponentEventText, p as DISCORD_COMPONENT_ATTACHMENT_PREFIX, r as buildDiscordInteractiveComponents, u as createDiscordFormModal, v as DISCORD_MODAL_CUSTOM_ID_KEY, w as parseDiscordComponentCustomId, x as buildDiscordModalCustomId } from "./components-gvRA0oaI.js";
|
|
3
|
+
import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount, o as mergeDiscordAccountConfig, p as resolveDiscordMaxLinesPerMessage, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId, t as createDiscordActionGate, u as resolveDiscordAccountConfig } from "./accounts-CwJQoLjM.js";
|
|
4
|
+
import { i as requestDiscord, n as DiscordApiError, r as fetchDiscord } from "./api-BfmEP6wp.js";
|
|
5
|
+
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-C0MnwEki.js";
|
|
6
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BY-ve3yH.js";
|
|
7
|
+
import { i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-D86uWLt_.js";
|
|
8
|
+
import "./targets-DQSye1Rv.js";
|
|
9
|
+
import { C as shouldSuppressLocalDiscordExecApprovalPrompt, S as isDiscordExecApprovalClientEnabled, b as getDiscordExecApprovalApprovers, x as isDiscordExecApprovalApprover } from "./outbound-session-route-CzzerX2K.js";
|
|
10
|
+
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-CarzU3bg.js";
|
|
11
11
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
12
|
-
import { t as discordSetupPlugin } from "./channel.setup-
|
|
13
|
-
import { n as handleDiscordSubagentEnded, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-
|
|
14
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
15
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-
|
|
16
|
-
import { t as fetchPluralKitMessageInfo } from "./pluralkit-
|
|
17
|
-
import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
18
|
-
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-
|
|
12
|
+
import { t as discordSetupPlugin } from "./channel.setup-z_ewMVa9.js";
|
|
13
|
+
import { n as handleDiscordSubagentEnded, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-IeZVPLGj.js";
|
|
14
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-Cc88ZGon.js";
|
|
15
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-AA8wQx0D.js";
|
|
16
|
+
import { t as fetchPluralKitMessageInfo } from "./pluralkit-B3cUVI7i.js";
|
|
17
|
+
import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-3ovFAp3b.js";
|
|
18
|
+
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-DKfK-iPY.js";
|
|
19
19
|
import { resolveOpenProviderRuntimeGroupPolicy as resolveDiscordRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
20
20
|
//#region extensions/discord/api.ts
|
|
21
|
-
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-
|
|
21
|
+
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-B2wMqeVK.js")).handleDiscordMessageAction(...args);
|
|
22
22
|
/**
|
|
23
23
|
* @deprecated Shipped `@openclaw/discord/api` compatibility only. Use native
|
|
24
24
|
* `AbortSignal.any` after filtering optional signals. Removal with the next
|