@openclaw/discord 2026.9.3 → 2026.9.5
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/assets/activity.svg +40 -0
- package/assets/icon.png +0 -0
- package/dist/{account-inspect-BY-ve3yH.js → .setup/account-inspect-BwQj24ht.mjs} +1 -1
- package/dist/{activities-api-D--xtQQu.js → .setup/activities-api-DBwRt5ES.mjs} +93 -31
- package/dist/{api-LIV--eMq.js → .setup/api-CBK9zcq5.mjs} +7 -4
- package/dist/{approval-handler.runtime-CUNkTLDO.js → .setup/approval-handler.runtime-Du3n5ypX.mjs} +8 -7
- package/dist/.setup/approval-message-updates-BN7JtScm.mjs +17 -0
- package/dist/{audit-DzHj2Z4w.js → .setup/audit-C8uaKoa9.mjs} +5 -5
- package/dist/{channel-aAywxCij.js → .setup/channel-ChKdlBgH.mjs} +28 -25
- package/dist/{channel-actions.runtime-rmse1yrM.js → .setup/channel-actions.runtime-CJmiFfps.mjs} +18 -11
- package/dist/{allow-list-DWEio925.js → .setup/channel-type-DKnjV1XW.mjs} +161 -1
- package/dist/{channel.setup-CpAwAiS0.js → .setup/channel.setup-BlC3-Kzz.mjs} +4 -4
- package/dist/{components-kvIwhN7i.js → .setup/components-MqMWUWnE.mjs} +4 -3
- package/dist/{config-schema-r38UkM_J.js → .setup/config-schema-CiZz-mtA.mjs} +1 -1
- package/dist/{conversation-binding-route-qfe7oPy5.js → .setup/conversation-binding-route-_rz33QHO.mjs} +1 -1
- package/dist/{directory-config-D1uDGbWh.js → .setup/directory-config-BytTftz-.mjs} +2 -2
- package/dist/{directory-live-C5o1uKlw.js → .setup/directory-live--EGTH0DC.mjs} +4 -4
- package/dist/{discord-CmL3ati-.js → .setup/discord-BXpHW-cu.mjs} +89 -39
- package/dist/{doctor-DgKMH6N7.js → .setup/doctor-DxcdkXzz.mjs} +6 -6
- package/dist/{handle-action.guild-admin-D4XdoA8-.js → .setup/handle-action.guild-admin-DAFyh_yV.mjs} +9 -4
- package/dist/{live-policy-config-BblutQAq.js → .setup/live-policy-config-eKQ-PLdy.mjs} +1 -1
- package/dist/{message-handler-B0DbuhWz.js → .setup/message-handler-DnUrDpaU.mjs} +25 -14
- package/dist/{message-handler.preflight-BkHVlYis.js → .setup/message-handler.preflight-CtqaF_fb.mjs} +34 -20
- package/dist/{message-handler.process-CWh432Ak.js → .setup/message-handler.process-Dz1xvuQU.mjs} +72 -82
- package/dist/{outbound-adapter-CO2BRlRl.js → .setup/outbound-adapter-C8v79z9Z.mjs} +13 -9
- package/dist/{outbound-session-route-DZBYPGTR.js → .setup/outbound-session-route-CqWbuMOm.mjs} +137 -11
- package/dist/{pluralkit-BiUW53Yn.js → .setup/pluralkit-CdAt1G0P.mjs} +2 -2
- package/dist/{presence-cache-z1N8MbJ3.js → .setup/presence-cache-dYSHPWMx.mjs} +1 -1
- package/dist/{probe-BcoN44eK.js → .setup/probe-CupW4we4.mjs} +14 -10
- package/dist/{probe.runtime-BnuED0fI.js → .setup/probe.runtime-DBQ_AGPe.mjs} +1 -1
- package/dist/{provider-PI8UiejY.js → .setup/provider-72zIvN-i.mjs} +484 -288
- package/dist/{provider-session.runtime-BejUb3gm.js → .setup/provider-session.runtime-BW7QrF5C.mjs} +4 -4
- package/dist/.setup/provider.runtime-DuhmKdDU.mjs +2 -0
- package/dist/{realtime-session.runtime-MqPrvmQ1.js → .setup/realtime-session.runtime-DTccTgTM.mjs} +758 -336
- package/dist/{resolve-allowlist-common-ChPf0Qy7.js → .setup/resolve-allowlist-common-CwMBzbx9.mjs} +3 -3
- package/dist/{resolve-channels-VbpLmUS8.js → .setup/resolve-channels-BbvsLQOZ.mjs} +4 -5
- package/dist/{resolve-users-D-wRFsd5.js → .setup/resolve-users-ByFlR7LQ.mjs} +3 -3
- package/dist/{retry-B0lQ1Ado.js → .setup/retry-DBfcEgmO.mjs} +37 -10
- package/dist/{runtime-D-ZFlMQ2.js → .setup/runtime-BVoa7hhx.mjs} +2 -2
- package/dist/{runtime-Cv8GdXSO.js → .setup/runtime-SchNfUsQ.mjs} +92 -139
- package/dist/{security-audit-DKfK-iPY.js → .setup/security-audit-s5w50-Ly.mjs} +1 -1
- package/dist/{security-audit.runtime-sKZyKgpx.js → .setup/security-audit.runtime-DHtYenx9.mjs} +1 -1
- package/dist/{send-Bdp3zZH5.js → .setup/send-CKDczUNL.mjs} +60 -31
- package/dist/{send.components-Bj22B3_O.js → .setup/send.components-DWQjXhPV.mjs} +103 -106
- package/dist/{send.outbound-DF0P3C9J.js → .setup/send.outbound-D0hQ7s50.mjs} +17 -7
- package/dist/{send.shared-D4BAjlRo.js → .setup/send.shared-Zwx6BxQ5.mjs} +15 -12
- package/dist/{sender-identity-f3l5OYgV.js → .setup/sender-identity-0Ymgvmaj.mjs} +1 -1
- package/dist/.setup/setup-plugin-api-CINIEBLa.mjs +3 -0
- package/dist/{shared-CPPR0Xo4.js → .setup/shared-CaA3Vv4n.mjs} +11 -11
- package/dist/{subagent-hooks-BAwybBDC.js → .setup/subagent-hooks-Bired9q6.mjs} +16 -4
- package/dist/{system-events-B6HkUhF_.js → .setup/system-events-B2YEEMbS.mjs} +2 -2
- package/dist/{target-resolver-BgKUUwLy.js → .setup/target-resolver-B6MrxbYv.mjs} +4 -4
- package/dist/.setup/targets-D1mAB5yO.mjs +3 -0
- package/dist/{thread-bindings-B0wnEg_y.js → .setup/thread-bindings-CK5272V3.mjs} +6 -6
- package/dist/{thread-bindings.manager-DM7M3vzn.js → .setup/thread-bindings.manager-eexkKyrG.mjs} +14 -9
- package/dist/{thread-bindings.session-updates-CSBmgCcx.js → .setup/thread-bindings.session-updates-DCQq1WZ5.mjs} +1 -1
- package/dist/{thread-bindings.state-jNRrsgzV.js → .setup/thread-bindings.state-BThFQEga.mjs} +48 -30
- package/dist/{transcripts-source-VkgenQv-.js → .setup/transcripts-source-CuWYgayu.mjs} +62 -25
- package/dist/{typing-DuBg1U8Q.js → .setup/typing-BKZL5fGj.mjs} +2 -2
- package/dist/{voice-runtime-BhRqlbEt.js → .setup/voice-runtime-DHVQ2mFz.mjs} +529 -181
- package/dist/account-inspect-api.js +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +1 -1
- package/dist/api.js +19 -19
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +5 -4
- package/dist/index.js +1 -1
- package/dist/runtime-api.js +22 -22
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-entry.js +2 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/subagent-hooks-api.js +5 -4
- package/dist/thread-binding-api.js +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/buffer.d.ts +1 -0
- package/node_modules/@types/node/diagnostics_channel.d.ts +4 -4
- package/node_modules/@types/node/ffi.d.ts +1 -1
- package/node_modules/@types/node/http.d.ts +1 -1
- package/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/node/perf_hooks.d.ts +31 -19
- package/node_modules/@types/node/quic.d.ts +6 -4
- package/node_modules/@types/node/stream/web.d.ts +20 -0
- package/node_modules/@types/node/tls.d.ts +26 -15
- package/node_modules/@types/node/vfs.d.ts +7 -6
- package/node_modules/@types/node/zlib.d.ts +17 -0
- package/node_modules/discord-api-types/README.md +3 -2
- package/node_modules/discord-api-types/package.json +46 -46
- package/node_modules/discord-api-types/rest/v10/interactions.d.ts +1 -0
- package/node_modules/discord-api-types/rest/v10/interactions.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/interactions.d.ts +1 -0
- package/node_modules/discord-api-types/rest/v9/interactions.d.ts.map +1 -1
- package/node_modules/libopus-wasm/CHANGELOG.md +15 -0
- package/node_modules/libopus-wasm/README.md +1 -1
- package/node_modules/libopus-wasm/dist/discordjs.d.ts.map +1 -1
- package/node_modules/libopus-wasm/dist/generated/libopus.generated.mjs +0 -0
- package/node_modules/libopus-wasm/dist/index.d.ts.map +1 -1
- package/node_modules/libopus-wasm/dist/index.js +37 -18
- package/node_modules/libopus-wasm/package.json +13 -13
- package/node_modules/typebox/build/compile/validator.d.mts +1 -1
- package/node_modules/typebox/build/compile/validator.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +7 -5
- package/node_modules/typebox/build/format/iri.mjs +5 -1
- package/node_modules/typebox/build/guard/emit.mjs +2 -4
- package/node_modules/typebox/build/guard/guard.mjs +6 -18
- package/node_modules/typebox/build/guard/string.mjs +16 -24
- package/node_modules/typebox/build/schema/build.mjs +2 -2
- package/node_modules/typebox/build/schema/check.mjs +1 -1
- package/node_modules/typebox/build/schema/compile.d.mts +3 -2
- package/node_modules/typebox/build/schema/compile.mjs +8 -8
- package/node_modules/typebox/build/schema/engine/_context.d.mts +6 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +23 -15
- package/node_modules/typebox/build/schema/engine/_functions.d.mts +2 -2
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/_reducer.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/_refine.d.mts +5 -5
- package/node_modules/typebox/build/schema/engine/_refine.mjs +4 -7
- package/node_modules/typebox/build/schema/engine/_stack.d.mts +34 -16
- package/node_modules/typebox/build/schema/engine/_stack.mjs +148 -104
- package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +8 -8
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +26 -18
- package/node_modules/typebox/build/schema/engine/allOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/allOf.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/anyOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/anyOf.mjs +5 -10
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/boolean.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/const.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/const.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/contains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/contains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/dependencies.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +3 -6
- package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +11 -7
- package/node_modules/typebox/build/schema/engine/enum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/enum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/format.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/format.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/if.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/if.mjs +7 -15
- package/node_modules/typebox/build/schema/engine/items.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/items.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/maxContains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxItems.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxLength.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxLength.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxProperties.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maximum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maximum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minContains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minContains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minItems.d.mts +5 -5
- package/node_modules/typebox/build/schema/engine/minItems.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minLength.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minLength.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minProperties.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minimum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minimum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/multipleOf.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/not.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -8
- package/node_modules/typebox/build/schema/engine/oneOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +6 -11
- package/node_modules/typebox/build/schema/engine/pattern.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -7
- package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/prefixItems.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/properties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/properties.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +4 -10
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +11 -7
- package/node_modules/typebox/build/schema/engine/ref.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/ref.mjs +19 -15
- package/node_modules/typebox/build/schema/engine/required.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/required.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/schema.d.mts +7 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +137 -133
- package/node_modules/typebox/build/schema/engine/type.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +5 -9
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +5 -9
- package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +2 -6
- package/node_modules/typebox/build/schema/errors.d.mts +2 -2
- package/node_modules/typebox/build/schema/errors.mjs +8 -14
- package/node_modules/typebox/build/schema/intern/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/intern/index.mjs +1 -0
- package/node_modules/typebox/build/schema/intern/intern.d.mts +11 -0
- package/node_modules/typebox/build/schema/intern/intern.mjs +293 -0
- package/node_modules/typebox/build/schema/meta/draft_2019_09.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_2019_09.mjs +288 -0
- package/node_modules/typebox/build/schema/meta/draft_2020_12.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_2020_12.mjs +300 -0
- package/node_modules/typebox/build/schema/meta/draft_3.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_3.mjs +143 -0
- package/node_modules/typebox/build/schema/meta/draft_4.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_4.mjs +149 -0
- package/node_modules/typebox/build/schema/meta/draft_6.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_6.mjs +155 -0
- package/node_modules/typebox/build/schema/meta/draft_7.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_7.mjs +172 -0
- package/node_modules/typebox/build/schema/meta/index.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/index.mjs +2 -0
- package/node_modules/typebox/build/schema/meta/meta.d.mts +9 -0
- package/node_modules/typebox/build/schema/meta/meta.mjs +15 -0
- package/node_modules/typebox/build/schema/meta/schema.d.mts +6 -0
- package/node_modules/typebox/build/schema/meta/schema.mjs +1 -0
- package/node_modules/typebox/build/schema/parse.d.mts +1 -0
- package/node_modules/typebox/build/schema/parse.mjs +10 -5
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +8 -3
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +268 -139
- package/node_modules/typebox/build/schema/schema.d.mts +2 -0
- package/node_modules/typebox/build/schema/schema.mjs +2 -0
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -12
- package/node_modules/typebox/build/value/errors/errors.mjs +2 -7
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +59 -89
- package/node_modules/undici-types/client.d.ts +8 -3
- package/node_modules/undici-types/connector.d.ts +1 -0
- package/node_modules/undici-types/cookies.d.ts +1 -1
- package/node_modules/undici-types/dispatcher.d.ts +3 -3
- package/node_modules/undici-types/errors.d.ts +10 -0
- package/node_modules/undici-types/fetch.d.ts +5 -1
- package/node_modules/undici-types/handlers.d.ts +2 -0
- package/node_modules/undici-types/interceptors.d.ts +1 -1
- package/node_modules/undici-types/mock-interceptor.d.ts +5 -1
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/proxy-agent.d.ts +7 -0
- package/node_modules/zod/README.md +27 -0
- package/node_modules/zod/compile.cjs +77 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +2 -2
- package/node_modules/zod/index.d.cts +1 -2
- package/node_modules/zod/index.d.ts +1 -2
- package/node_modules/zod/index.js +5 -2
- package/node_modules/zod/package.json +13 -2
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +5 -2
- package/node_modules/zod/src/v3/ZodError.ts +22 -12
- package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
- package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
- package/node_modules/zod/src/v3/types.ts +5 -5
- package/node_modules/zod/src/v4/classic/checks.ts +1 -0
- package/node_modules/zod/src/v4/classic/compat.ts +26 -18
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +59 -44
- package/node_modules/zod/src/v4/classic/external.ts +12 -9
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +140 -78
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +2 -2
- package/node_modules/zod/src/v4/classic/iso.ts +2 -72
- package/node_modules/zod/src/v4/classic/parse.ts +10 -4
- package/node_modules/zod/src/v4/classic/schemas.ts +452 -262
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +135 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +30 -1
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +720 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +155 -13
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +11 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +274 -6
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +425 -10
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +281 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +47 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +183 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +46 -9
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +245 -12
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +234 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +33 -2
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +127 -5
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +11 -2
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1585 -173
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
- package/node_modules/zod/src/v4/core/api.ts +48 -12
- package/node_modules/zod/src/v4/core/checks.ts +57 -44
- package/node_modules/zod/src/v4/core/compile.ts +2188 -0
- package/node_modules/zod/src/v4/core/core.ts +98 -19
- package/node_modules/zod/src/v4/core/doc.ts +11 -7
- package/node_modules/zod/src/v4/core/errors.ts +115 -24
- package/node_modules/zod/src/v4/core/index.ts +3 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +6 -1
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +257 -93
- package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
- package/node_modules/zod/src/v4/core/memoizer.ts +284 -0
- package/node_modules/zod/src/v4/core/parse.ts +131 -38
- package/node_modules/zod/src/v4/core/regexes.ts +30 -13
- package/node_modules/zod/src/v4/core/registries.ts +2 -2
- package/node_modules/zod/src/v4/core/schemas.ts +759 -461
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +969 -0
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +1639 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +31 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +275 -42
- package/node_modules/zod/src/v4/core/util.ts +268 -42
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/index.ts +3 -3
- package/node_modules/zod/src/v4/locales/ar.ts +3 -0
- package/node_modules/zod/src/v4/locales/az.ts +3 -0
- package/node_modules/zod/src/v4/locales/be.ts +10 -0
- package/node_modules/zod/src/v4/locales/bg.ts +3 -0
- package/node_modules/zod/src/v4/locales/bn.ts +121 -0
- package/node_modules/zod/src/v4/locales/ca.ts +3 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +138 -0
- package/node_modules/zod/src/v4/locales/cs.ts +3 -0
- package/node_modules/zod/src/v4/locales/da.ts +5 -2
- package/node_modules/zod/src/v4/locales/de.ts +3 -0
- package/node_modules/zod/src/v4/locales/el.ts +1 -0
- package/node_modules/zod/src/v4/locales/en.ts +15 -4
- package/node_modules/zod/src/v4/locales/eo.ts +3 -0
- package/node_modules/zod/src/v4/locales/es.ts +2 -0
- package/node_modules/zod/src/v4/locales/fa.ts +3 -0
- package/node_modules/zod/src/v4/locales/fi.ts +3 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +3 -0
- package/node_modules/zod/src/v4/locales/fr.ts +19 -14
- package/node_modules/zod/src/v4/locales/gu.ts +121 -0
- package/node_modules/zod/src/v4/locales/he.ts +6 -1
- package/node_modules/zod/src/v4/locales/hi.ts +124 -0
- package/node_modules/zod/src/v4/locales/hr.ts +2 -0
- package/node_modules/zod/src/v4/locales/hu.ts +3 -0
- package/node_modules/zod/src/v4/locales/hy.ts +9 -0
- package/node_modules/zod/src/v4/locales/id.ts +3 -0
- package/node_modules/zod/src/v4/locales/index.ts +10 -0
- package/node_modules/zod/src/v4/locales/is.ts +3 -0
- package/node_modules/zod/src/v4/locales/it.ts +3 -0
- package/node_modules/zod/src/v4/locales/ja.ts +3 -0
- package/node_modules/zod/src/v4/locales/ka.ts +3 -0
- package/node_modules/zod/src/v4/locales/km.ts +3 -0
- package/node_modules/zod/src/v4/locales/kn.ts +124 -0
- package/node_modules/zod/src/v4/locales/ko.ts +3 -0
- package/node_modules/zod/src/v4/locales/lt.ts +2 -0
- package/node_modules/zod/src/v4/locales/mk.ts +3 -0
- package/node_modules/zod/src/v4/locales/ms.ts +3 -0
- package/node_modules/zod/src/v4/locales/ne.ts +126 -0
- package/node_modules/zod/src/v4/locales/nl.ts +3 -0
- package/node_modules/zod/src/v4/locales/nn.ts +119 -0
- package/node_modules/zod/src/v4/locales/no.ts +5 -2
- package/node_modules/zod/src/v4/locales/ota.ts +3 -0
- package/node_modules/zod/src/v4/locales/pl.ts +3 -0
- package/node_modules/zod/src/v4/locales/ps.ts +3 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +159 -0
- package/node_modules/zod/src/v4/locales/pt.ts +99 -58
- package/node_modules/zod/src/v4/locales/ro.ts +1 -0
- package/node_modules/zod/src/v4/locales/ru.ts +10 -0
- package/node_modules/zod/src/v4/locales/sk.ts +121 -0
- package/node_modules/zod/src/v4/locales/sl.ts +3 -0
- package/node_modules/zod/src/v4/locales/sv.ts +5 -2
- package/node_modules/zod/src/v4/locales/ta.ts +3 -0
- package/node_modules/zod/src/v4/locales/th.ts +3 -0
- package/node_modules/zod/src/v4/locales/tk.ts +111 -0
- package/node_modules/zod/src/v4/locales/tr.ts +3 -0
- package/node_modules/zod/src/v4/locales/uk.ts +3 -0
- package/node_modules/zod/src/v4/locales/ur.ts +3 -0
- package/node_modules/zod/src/v4/locales/uz.ts +1 -0
- package/node_modules/zod/src/v4/locales/vi.ts +3 -0
- package/node_modules/zod/src/v4/locales/yo.ts +3 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +3 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +3 -0
- package/node_modules/zod/src/v4/mini/checks.ts +1 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +10 -1
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/parse.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +135 -56
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +72 -5
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +21 -0
- package/node_modules/zod/v3/ZodError.cjs +22 -12
- package/node_modules/zod/v3/ZodError.d.cts +1 -1
- package/node_modules/zod/v3/ZodError.d.ts +1 -1
- package/node_modules/zod/v3/ZodError.js +22 -12
- package/node_modules/zod/v3/types.cjs +7 -5
- package/node_modules/zod/v3/types.js +7 -5
- package/node_modules/zod/v4/classic/checks.cjs +2 -1
- package/node_modules/zod/v4/classic/checks.d.cts +1 -1
- package/node_modules/zod/v4/classic/checks.d.ts +1 -1
- package/node_modules/zod/v4/classic/checks.js +1 -1
- package/node_modules/zod/v4/classic/compat.d.cts +9 -11
- package/node_modules/zod/v4/classic/compat.d.ts +9 -11
- package/node_modules/zod/v4/classic/deep-partial.cjs +39 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +43 -34
- package/node_modules/zod/v4/classic/errors.d.cts +3 -4
- package/node_modules/zod/v4/classic/errors.d.ts +3 -4
- package/node_modules/zod/v4/classic/errors.js +43 -34
- package/node_modules/zod/v4/classic/external.cjs +30 -27
- package/node_modules/zod/v4/classic/external.d.cts +5 -2
- package/node_modules/zod/v4/classic/external.d.ts +5 -2
- package/node_modules/zod/v4/classic/external.js +5 -8
- package/node_modules/zod/v4/classic/from-json-schema.cjs +136 -75
- package/node_modules/zod/v4/classic/from-json-schema.js +136 -75
- package/node_modules/zod/v4/classic/in-out.cjs +63 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +2 -2
- package/node_modules/zod/v4/classic/index.d.cts +1 -2
- package/node_modules/zod/v4/classic/index.d.ts +1 -2
- package/node_modules/zod/v4/classic/index.js +2 -2
- package/node_modules/zod/v4/classic/iso.cjs +11 -22
- package/node_modules/zod/v4/classic/iso.d.cts +2 -17
- package/node_modules/zod/v4/classic/iso.d.ts +2 -17
- package/node_modules/zod/v4/classic/iso.js +2 -17
- package/node_modules/zod/v4/classic/parse.cjs +4 -1
- package/node_modules/zod/v4/classic/parse.d.cts +17 -4
- package/node_modules/zod/v4/classic/parse.d.ts +17 -4
- package/node_modules/zod/v4/classic/parse.js +1 -0
- package/node_modules/zod/v4/classic/schemas.cjs +498 -398
- package/node_modules/zod/v4/classic/schemas.d.cts +53 -18
- package/node_modules/zod/v4/classic/schemas.d.ts +53 -18
- package/node_modules/zod/v4/classic/schemas.js +492 -396
- package/node_modules/zod/v4/core/api.cjs +23 -4
- package/node_modules/zod/v4/core/api.d.cts +13 -9
- package/node_modules/zod/v4/core/api.d.ts +13 -9
- package/node_modules/zod/v4/core/api.js +21 -4
- package/node_modules/zod/v4/core/checks.cjs +37 -31
- package/node_modules/zod/v4/core/checks.d.cts +13 -13
- package/node_modules/zod/v4/core/checks.d.ts +13 -13
- package/node_modules/zod/v4/core/checks.js +37 -31
- package/node_modules/zod/v4/core/compile.cjs +1813 -0
- package/node_modules/zod/v4/core/compile.d.cts +51 -0
- package/node_modules/zod/v4/core/compile.d.ts +51 -0
- package/node_modules/zod/v4/core/compile.js +1783 -0
- package/node_modules/zod/v4/core/core.cjs +81 -18
- package/node_modules/zod/v4/core/core.d.cts +16 -4
- package/node_modules/zod/v4/core/core.d.ts +16 -4
- package/node_modules/zod/v4/core/core.js +82 -19
- package/node_modules/zod/v4/core/doc.cjs +5 -7
- package/node_modules/zod/v4/core/doc.d.cts +3 -1
- package/node_modules/zod/v4/core/doc.d.ts +3 -1
- package/node_modules/zod/v4/core/doc.js +5 -7
- package/node_modules/zod/v4/core/errors.cjs +110 -25
- package/node_modules/zod/v4/core/errors.d.cts +4 -0
- package/node_modules/zod/v4/core/errors.d.ts +4 -0
- package/node_modules/zod/v4/core/errors.js +110 -25
- package/node_modules/zod/v4/core/index.cjs +5 -1
- package/node_modules/zod/v4/core/index.d.cts +3 -0
- package/node_modules/zod/v4/core/index.d.ts +3 -0
- package/node_modules/zod/v4/core/index.js +3 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +4 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.js +4 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +264 -95
- package/node_modules/zod/v4/core/json-schema-processors.js +243 -97
- package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
- package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
- package/node_modules/zod/v4/core/memoizer.cjs +272 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +265 -0
- package/node_modules/zod/v4/core/parse.cjs +96 -34
- package/node_modules/zod/v4/core/parse.d.cts +14 -11
- package/node_modules/zod/v4/core/parse.d.ts +14 -11
- package/node_modules/zod/v4/core/parse.js +94 -33
- package/node_modules/zod/v4/core/regexes.cjs +27 -15
- package/node_modules/zod/v4/core/regexes.d.cts +2 -0
- package/node_modules/zod/v4/core/regexes.d.ts +2 -0
- package/node_modules/zod/v4/core/regexes.js +24 -13
- package/node_modules/zod/v4/core/registries.js +2 -2
- package/node_modules/zod/v4/core/schemas.cjs +537 -326
- package/node_modules/zod/v4/core/schemas.d.cts +100 -31
- package/node_modules/zod/v4/core/schemas.d.ts +100 -31
- package/node_modules/zod/v4/core/schemas.js +526 -325
- package/node_modules/zod/v4/core/to-json-schema.cjs +242 -39
- package/node_modules/zod/v4/core/to-json-schema.d.cts +42 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +42 -3
- package/node_modules/zod/v4/core/to-json-schema.js +241 -39
- package/node_modules/zod/v4/core/util.cjs +212 -31
- package/node_modules/zod/v4/core/util.d.cts +58 -1
- package/node_modules/zod/v4/core/util.d.ts +58 -1
- package/node_modules/zod/v4/core/util.js +202 -30
- package/node_modules/zod/v4/core/versions.cjs +2 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +195 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +15 -5
- package/node_modules/zod/v4/index.d.cts +2 -2
- package/node_modules/zod/v4/index.d.ts +2 -2
- package/node_modules/zod/v4/index.js +3 -2
- package/node_modules/zod/v4/locales/ar.cjs +3 -0
- package/node_modules/zod/v4/locales/ar.js +3 -0
- package/node_modules/zod/v4/locales/az.cjs +3 -0
- package/node_modules/zod/v4/locales/az.js +3 -0
- package/node_modules/zod/v4/locales/be.cjs +10 -0
- package/node_modules/zod/v4/locales/be.js +10 -0
- package/node_modules/zod/v4/locales/bg.cjs +3 -0
- package/node_modules/zod/v4/locales/bg.js +3 -0
- package/node_modules/zod/v4/locales/bn.cjs +138 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +111 -0
- package/node_modules/zod/v4/locales/ca.cjs +3 -0
- package/node_modules/zod/v4/locales/ca.js +3 -0
- package/node_modules/zod/v4/locales/ckb.cjs +158 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +131 -0
- package/node_modules/zod/v4/locales/cs.cjs +3 -0
- package/node_modules/zod/v4/locales/cs.js +3 -0
- package/node_modules/zod/v4/locales/da.cjs +5 -2
- package/node_modules/zod/v4/locales/da.js +5 -2
- package/node_modules/zod/v4/locales/de.cjs +3 -0
- package/node_modules/zod/v4/locales/de.js +3 -0
- package/node_modules/zod/v4/locales/el.cjs +1 -0
- package/node_modules/zod/v4/locales/el.js +1 -0
- package/node_modules/zod/v4/locales/en.cjs +14 -4
- package/node_modules/zod/v4/locales/en.js +14 -4
- package/node_modules/zod/v4/locales/eo.cjs +3 -0
- package/node_modules/zod/v4/locales/eo.js +3 -0
- package/node_modules/zod/v4/locales/es.cjs +2 -0
- package/node_modules/zod/v4/locales/es.js +2 -0
- package/node_modules/zod/v4/locales/fa.cjs +3 -0
- package/node_modules/zod/v4/locales/fa.js +3 -0
- package/node_modules/zod/v4/locales/fi.cjs +3 -0
- package/node_modules/zod/v4/locales/fi.js +3 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +3 -0
- package/node_modules/zod/v4/locales/fr-CA.js +3 -0
- package/node_modules/zod/v4/locales/fr.cjs +16 -14
- package/node_modules/zod/v4/locales/fr.js +16 -14
- package/node_modules/zod/v4/locales/gu.cjs +138 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +111 -0
- package/node_modules/zod/v4/locales/he.cjs +5 -0
- package/node_modules/zod/v4/locales/he.js +5 -0
- package/node_modules/zod/v4/locales/hi.cjs +136 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +109 -0
- package/node_modules/zod/v4/locales/hr.cjs +2 -0
- package/node_modules/zod/v4/locales/hr.js +2 -0
- package/node_modules/zod/v4/locales/hu.cjs +3 -0
- package/node_modules/zod/v4/locales/hu.js +3 -0
- package/node_modules/zod/v4/locales/hy.cjs +9 -0
- package/node_modules/zod/v4/locales/hy.js +9 -0
- package/node_modules/zod/v4/locales/id.cjs +3 -0
- package/node_modules/zod/v4/locales/id.js +3 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -2
- package/node_modules/zod/v4/locales/index.d.cts +10 -0
- package/node_modules/zod/v4/locales/index.d.ts +10 -0
- package/node_modules/zod/v4/locales/index.js +10 -0
- package/node_modules/zod/v4/locales/is.cjs +3 -0
- package/node_modules/zod/v4/locales/is.js +3 -0
- package/node_modules/zod/v4/locales/it.cjs +3 -0
- package/node_modules/zod/v4/locales/it.js +3 -0
- package/node_modules/zod/v4/locales/ja.cjs +3 -0
- package/node_modules/zod/v4/locales/ja.js +3 -0
- package/node_modules/zod/v4/locales/ka.cjs +3 -0
- package/node_modules/zod/v4/locales/ka.js +3 -0
- package/node_modules/zod/v4/locales/km.cjs +3 -0
- package/node_modules/zod/v4/locales/km.js +3 -0
- package/node_modules/zod/v4/locales/kn.cjs +141 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +114 -0
- package/node_modules/zod/v4/locales/ko.cjs +3 -0
- package/node_modules/zod/v4/locales/ko.js +3 -0
- package/node_modules/zod/v4/locales/lt.cjs +2 -0
- package/node_modules/zod/v4/locales/lt.js +2 -0
- package/node_modules/zod/v4/locales/mk.cjs +3 -0
- package/node_modules/zod/v4/locales/mk.js +3 -0
- package/node_modules/zod/v4/locales/ms.cjs +3 -0
- package/node_modules/zod/v4/locales/ms.js +3 -0
- package/node_modules/zod/v4/locales/ne.cjs +136 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +109 -0
- package/node_modules/zod/v4/locales/nl.cjs +3 -0
- package/node_modules/zod/v4/locales/nl.js +3 -0
- package/node_modules/zod/v4/locales/nn.cjs +138 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +111 -0
- package/node_modules/zod/v4/locales/no.cjs +5 -2
- package/node_modules/zod/v4/locales/no.js +5 -2
- package/node_modules/zod/v4/locales/ota.cjs +3 -0
- package/node_modules/zod/v4/locales/ota.js +3 -0
- package/node_modules/zod/v4/locales/pl.cjs +3 -0
- package/node_modules/zod/v4/locales/pl.js +3 -0
- package/node_modules/zod/v4/locales/ps.cjs +3 -0
- package/node_modules/zod/v4/locales/ps.js +3 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +168 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +141 -0
- package/node_modules/zod/v4/locales/pt.cjs +87 -55
- package/node_modules/zod/v4/locales/pt.js +87 -55
- package/node_modules/zod/v4/locales/ro.cjs +1 -0
- package/node_modules/zod/v4/locales/ro.js +1 -0
- package/node_modules/zod/v4/locales/ru.cjs +10 -0
- package/node_modules/zod/v4/locales/ru.js +10 -0
- package/node_modules/zod/v4/locales/sk.cjs +141 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +114 -0
- package/node_modules/zod/v4/locales/sl.cjs +3 -0
- package/node_modules/zod/v4/locales/sl.js +3 -0
- package/node_modules/zod/v4/locales/sv.cjs +5 -2
- package/node_modules/zod/v4/locales/sv.js +5 -2
- package/node_modules/zod/v4/locales/ta.cjs +3 -0
- package/node_modules/zod/v4/locales/ta.js +3 -0
- package/node_modules/zod/v4/locales/th.cjs +3 -0
- package/node_modules/zod/v4/locales/th.js +3 -0
- package/node_modules/zod/v4/locales/tk.cjs +132 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +105 -0
- package/node_modules/zod/v4/locales/tr.cjs +3 -0
- package/node_modules/zod/v4/locales/tr.js +3 -0
- package/node_modules/zod/v4/locales/uk.cjs +3 -0
- package/node_modules/zod/v4/locales/uk.js +3 -0
- package/node_modules/zod/v4/locales/ur.cjs +3 -0
- package/node_modules/zod/v4/locales/ur.js +3 -0
- package/node_modules/zod/v4/locales/uz.cjs +1 -0
- package/node_modules/zod/v4/locales/uz.js +1 -0
- package/node_modules/zod/v4/locales/vi.cjs +3 -0
- package/node_modules/zod/v4/locales/vi.js +3 -0
- package/node_modules/zod/v4/locales/yo.cjs +3 -0
- package/node_modules/zod/v4/locales/yo.js +3 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +3 -0
- package/node_modules/zod/v4/locales/zh-CN.js +3 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +3 -0
- package/node_modules/zod/v4/locales/zh-TW.js +3 -0
- package/node_modules/zod/v4/mini/checks.cjs +2 -1
- package/node_modules/zod/v4/mini/checks.d.cts +1 -1
- package/node_modules/zod/v4/mini/checks.d.ts +1 -1
- package/node_modules/zod/v4/mini/checks.js +1 -1
- package/node_modules/zod/v4/mini/deep-partial.cjs +39 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +12 -1
- package/node_modules/zod/v4/mini/external.d.cts +5 -2
- package/node_modules/zod/v4/mini/external.d.ts +5 -2
- package/node_modules/zod/v4/mini/external.js +3 -1
- package/node_modules/zod/v4/mini/in-out.cjs +63 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/parse.cjs +3 -1
- package/node_modules/zod/v4/mini/parse.d.cts +1 -1
- package/node_modules/zod/v4/mini/parse.d.ts +1 -1
- package/node_modules/zod/v4/mini/parse.js +1 -1
- package/node_modules/zod/v4/mini/schemas.cjs +75 -47
- package/node_modules/zod/v4/mini/schemas.d.cts +43 -13
- package/node_modules/zod/v4/mini/schemas.d.ts +43 -13
- package/node_modules/zod/v4/mini/schemas.js +71 -45
- package/openclaw.plugin.json +5 -2
- package/package.json +11 -8
- package/dist/channel-type-CVLZyGYS.js +0 -7
- package/dist/outbound-components-BvskBqEN.js +0 -100
- package/dist/provider.runtime-C-Oh3OHA.js +0 -2
- package/dist/targets-fCxslBZ3.js +0 -3
- package/node_modules/discord-api-types/CHANGELOG.md +0 -2514
- package/node_modules/discord-api-types/scripts/versions.mjs +0 -46
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- /package/dist/{accounts-CwJQoLjM.js → .setup/accounts-CwJQoLjM.mjs} +0 -0
- /package/dist/{active-turn-thread-route-fmHl1HNd.js → .setup/active-turn-thread-route-fmHl1HNd.mjs} +0 -0
- /package/dist/{agent-components.runtime-CEPrf2SY.js → .setup/agent-components.runtime-CEPrf2SY.mjs} +0 -0
- /package/dist/{channel-access-C12aDZ0p.js → .setup/channel-access-C12aDZ0p.mjs} +0 -0
- /package/dist/{command-deploy-store-DFkBTViB.js → .setup/command-deploy-store-DFkBTViB.mjs} +0 -0
- /package/dist/{command-owners-D78sAoOz.js → .setup/command-owners-D78sAoOz.mjs} +0 -0
- /package/dist/{doctor-contract-Co5vRCZ6.js → .setup/doctor-contract-Co5vRCZ6.mjs} +0 -0
- /package/dist/{message-handler.history-CJOsN9w5.js → .setup/message-handler.history-CJOsN9w5.mjs} +0 -0
- /package/dist/{model-picker-preference-primitives-BHT1LkR_.js → .setup/model-picker-preference-primitives-BHT1LkR_.mjs} +0 -0
- /package/dist/{preflight-audio-DrnqFA8U.js → .setup/preflight-audio-DrnqFA8U.mjs} +0 -0
- /package/dist/{runtime-DgnVQ7zW.js → .setup/runtime-DgnVQ7zW.mjs} +0 -0
- /package/dist/{secret-config-contract-DFu9hfU8.js → .setup/secret-config-contract-DFu9hfU8.mjs} +0 -0
- /package/dist/{security-contract-DSHk7I2w.js → .setup/security-contract-DSHk7I2w.mjs} +0 -0
- /package/dist/{security-doctor-nGgPm65L.js → .setup/security-doctor-nGgPm65L.mjs} +0 -0
- /package/dist/{session-contract-BO5tlIdl.js → .setup/session-contract-BO5tlIdl.mjs} +0 -0
- /package/dist/{session-key-normalization-wJgsKPNF.js → .setup/session-key-normalization-wJgsKPNF.mjs} +0 -0
- /package/dist/{thread-binding-api-BDZJD4na.js → .setup/thread-binding-api-BDZJD4na.mjs} +0 -0
- /package/dist/{timeouts-D86uWLt_.js → .setup/timeouts-D86uWLt_.mjs} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2
|
+
<!--
|
|
3
|
+
Source: simple-icons@16.31.0, icons/discord.svg
|
|
4
|
+
https://www.npmjs.com/package/simple-icons/v/16.31.0
|
|
5
|
+
https://github.com/simple-icons/simple-icons
|
|
6
|
+
|
|
7
|
+
# CC0 1.0 Universal
|
|
8
|
+
|
|
9
|
+
## Statement of Purpose
|
|
10
|
+
|
|
11
|
+
The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an “owner”) of an original work of authorship and/or a database (each, a “Work”).
|
|
12
|
+
|
|
13
|
+
Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works (“Commons”) that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
|
|
14
|
+
|
|
15
|
+
For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the “Affirmer”), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
|
|
16
|
+
|
|
17
|
+
1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights (“Copyright and Related Rights”). Copyright and Related Rights include, but are not limited to, the following:
|
|
18
|
+
1. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
|
|
19
|
+
2. moral rights retained by the original author(s) and/or performer(s);
|
|
20
|
+
3. publicity and privacy rights pertaining to a person’s image or likeness depicted in a Work;
|
|
21
|
+
4. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(i), below;
|
|
22
|
+
5. rights protecting the extraction, dissemination, use and reuse of data in a Work;
|
|
23
|
+
6. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
|
|
24
|
+
7. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
|
|
25
|
+
|
|
26
|
+
2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the “Waiver”). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer’s heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer’s express Statement of Purpose.
|
|
27
|
+
|
|
28
|
+
3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer’s express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer’s Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the “License”). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer’s express Statement of Purpose.
|
|
29
|
+
|
|
30
|
+
4. Limitations and Disclaimers.
|
|
31
|
+
1. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
|
|
32
|
+
2. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
|
|
33
|
+
3. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person’s Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
|
|
34
|
+
4. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
|
|
35
|
+
|
|
36
|
+
For more information, please see <https://creativecommons.org/publicdomain/zero/1.0>.
|
|
37
|
+
Names and marks remain the property of their respective owners.
|
|
38
|
+
-->
|
|
39
|
+
<path fill="currentColor" stroke="none" d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z" />
|
|
40
|
+
</svg>
|
package/assets/icon.png
ADDED
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as inspectDiscordAccountTokenState, o as mergeDiscordAccountConfig, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig, v as resolveDiscordAccountAvailability } from "./accounts-CwJQoLjM.
|
|
1
|
+
import { _ as inspectDiscordAccountTokenState, o as mergeDiscordAccountConfig, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig, v as resolveDiscordAccountAvailability } from "./accounts-CwJQoLjM.mjs";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { S as parseDiscordActivityCustomId, i as buildDiscordPresentationComponents } from "./components-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { S as parseDiscordActivityCustomId, i as buildDiscordPresentationComponents } from "./components-MqMWUWnE.mjs";
|
|
2
|
+
import { E as getDiscordEndpointRuntime } from "./channel-type-DKnjV1XW.mjs";
|
|
3
|
+
import { c as resolveDiscordAccount } from "./accounts-CwJQoLjM.mjs";
|
|
4
|
+
import { r as sendDiscordComponentMessage } from "./send.components-DWQjXhPV.mjs";
|
|
5
|
+
import { b as resolveDiscordChannelId$1 } from "./retry-DBfcEgmO.mjs";
|
|
6
|
+
import { r as setDiscordActivitiesRuntime, t as DiscordActivitiesRuntime } from "./runtime-BVoa7hhx.mjs";
|
|
6
7
|
import fs from "node:fs/promises";
|
|
7
8
|
import { logError } from "openclaw/plugin-sdk/logging-core";
|
|
8
9
|
import { resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
|
|
9
10
|
import { WEBHOOK_BODY_READ_DEFAULTS, readJsonBodyWithLimit, sendHttpRequestRejection } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
11
|
+
import { WIDGET_CDN_ORIGINS } from "openclaw/plugin-sdk/widget-html";
|
|
10
12
|
import { randomBytes } from "node:crypto";
|
|
11
|
-
import { readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
|
|
12
13
|
import { fetchWithSsrFGuard as fetchWithSsrFGuard$1 } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
14
|
+
import { readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
|
|
13
15
|
//#region extensions/discord/src/activities/discord-api.ts
|
|
14
16
|
const DISCORD_TOKEN_URL = "https://discord.com/api/oauth2/token";
|
|
15
17
|
const DISCORD_USER_URL = "https://discord.com/api/v10/users/@me";
|
|
16
18
|
const DISCORD_HOST = "discord.com";
|
|
19
|
+
const DISCORD_ACTIVITY_REQUEST_TIMEOUT_MS = 15e3;
|
|
17
20
|
const JSON_MAX_BYTES = 65536;
|
|
18
21
|
const INSTANCE_ID_MAX_LENGTH = 256;
|
|
19
22
|
function normalizeInstanceId(value) {
|
|
@@ -30,13 +33,23 @@ function normalizeInstanceId(value) {
|
|
|
30
33
|
return instanceId;
|
|
31
34
|
}
|
|
32
35
|
async function fetchDiscordJson(params) {
|
|
33
|
-
const
|
|
36
|
+
const endpoint = Object.hasOwn(params, "endpointRuntime") ? params.endpointRuntime : getDiscordEndpointRuntime();
|
|
37
|
+
const liveUrl = new URL(params.url);
|
|
38
|
+
const endpointPath = liveUrl.pathname === "/api/oauth2/token" ? "/oauth2/token" : liveUrl.pathname.startsWith("/api/v10/") ? liveUrl.pathname.slice(8) : void 0;
|
|
39
|
+
if (endpoint && !endpointPath) throw new Error("Discord Activity request is outside the configured endpoint routes");
|
|
40
|
+
const { response, release } = endpoint ? {
|
|
41
|
+
response: await endpoint.fetch(`${endpoint.descriptor.restApiBaseUrl}${endpointPath}${liveUrl.search}`, {
|
|
42
|
+
...params.init,
|
|
43
|
+
signal: params.init.signal ? AbortSignal.any([params.init.signal, AbortSignal.timeout(DISCORD_ACTIVITY_REQUEST_TIMEOUT_MS)]) : AbortSignal.timeout(DISCORD_ACTIVITY_REQUEST_TIMEOUT_MS)
|
|
44
|
+
}),
|
|
45
|
+
release: async () => {}
|
|
46
|
+
} : await params.fetchGuard({
|
|
34
47
|
url: params.url,
|
|
35
48
|
fetchImpl: params.fetchImpl,
|
|
36
49
|
init: params.init,
|
|
37
50
|
policy: { allowedHostnames: [DISCORD_HOST] },
|
|
38
51
|
auditContext: params.auditContext,
|
|
39
|
-
timeoutMs:
|
|
52
|
+
timeoutMs: DISCORD_ACTIVITY_REQUEST_TIMEOUT_MS
|
|
40
53
|
});
|
|
41
54
|
try {
|
|
42
55
|
if (!response.ok) {
|
|
@@ -56,6 +69,7 @@ async function fetchDiscordJson(params) {
|
|
|
56
69
|
}
|
|
57
70
|
}
|
|
58
71
|
async function resolveActivityInstanceChannel(params) {
|
|
72
|
+
const endpointRuntime = getDiscordEndpointRuntime() ?? null;
|
|
59
73
|
let result;
|
|
60
74
|
try {
|
|
61
75
|
result = await fetchDiscordJson({
|
|
@@ -63,7 +77,8 @@ async function resolveActivityInstanceChannel(params) {
|
|
|
63
77
|
fetchImpl: params.proxyFetch,
|
|
64
78
|
url: `https://discord.com/api/v10/applications/${encodeURIComponent(params.applicationId)}/activity-instances/${encodeURIComponent(params.instanceId)}`,
|
|
65
79
|
init: { headers: { Authorization: `Bot ${params.botAuth}` } },
|
|
66
|
-
auditContext: "discord.activities.instance"
|
|
80
|
+
auditContext: "discord.activities.instance",
|
|
81
|
+
endpointRuntime
|
|
67
82
|
});
|
|
68
83
|
} catch {
|
|
69
84
|
return;
|
|
@@ -247,7 +262,7 @@ const BODY_MAX_BYTES = 8192;
|
|
|
247
262
|
const JSON_CONTENT_TYPE = "application/json; charset=utf-8";
|
|
248
263
|
const WIDGET_ID_PATTERN = /^[A-Za-z0-9_-]{22}$/;
|
|
249
264
|
const DOC_TOKEN_PATTERN = /^[A-Za-z0-9_-]{43}$/;
|
|
250
|
-
const DISCORD_ACTIVITY_WIDGET_CSP =
|
|
265
|
+
const DISCORD_ACTIVITY_WIDGET_CSP = `sandbox allow-scripts; default-src 'none'; script-src 'unsafe-inline' ${WIDGET_CDN_ORIGINS.join(" ")}; style-src 'unsafe-inline' ${WIDGET_CDN_ORIGINS.join(" ")}; img-src data: blob:; font-src data: ${WIDGET_CDN_ORIGINS.join(" ")}; connect-src 'none'; frame-ancestors *`;
|
|
251
266
|
function setCommonHeaders(res) {
|
|
252
267
|
res.setHeader("Cache-Control", "no-store");
|
|
253
268
|
res.setHeader("Referrer-Policy", "no-referrer");
|
|
@@ -310,6 +325,7 @@ function createDiscordActivityHttpHandler(deps) {
|
|
|
310
325
|
const applicationId = extractApplicationId(req);
|
|
311
326
|
const account = deps.runtime.resolveHttpAccount(applicationId);
|
|
312
327
|
if (!account) return respondJson(res, 503, { error: "Discord Activities is not fully configured" });
|
|
328
|
+
const endpointRuntime = getDiscordEndpointRuntime() ?? null;
|
|
313
329
|
const bodyResult = await readJsonBodyWithLimit(req, {
|
|
314
330
|
maxBytes: BODY_MAX_BYTES,
|
|
315
331
|
timeoutMs: bodyTimeoutMs,
|
|
@@ -347,7 +363,8 @@ function createDiscordActivityHttpHandler(deps) {
|
|
|
347
363
|
code
|
|
348
364
|
})
|
|
349
365
|
},
|
|
350
|
-
auditContext: "discord.activities.oauth.token"
|
|
366
|
+
auditContext: "discord.activities.oauth.token",
|
|
367
|
+
endpointRuntime
|
|
351
368
|
});
|
|
352
369
|
} catch {
|
|
353
370
|
return respondJson(res, 503, { error: "Discord token exchange unavailable" });
|
|
@@ -361,7 +378,8 @@ function createDiscordActivityHttpHandler(deps) {
|
|
|
361
378
|
fetchImpl: account.proxyFetch,
|
|
362
379
|
url: DISCORD_USER_URL,
|
|
363
380
|
init: { headers: { Authorization: `Bearer ${granted}` } },
|
|
364
|
-
auditContext: "discord.activities.oauth.user"
|
|
381
|
+
auditContext: "discord.activities.oauth.user",
|
|
382
|
+
endpointRuntime
|
|
365
383
|
});
|
|
366
384
|
} catch {
|
|
367
385
|
return respondJson(res, 503, { error: "Discord user lookup unavailable" });
|
|
@@ -611,13 +629,13 @@ const WIDGET_TTL_MS = 7 * DAY_MS;
|
|
|
611
629
|
const SESSION_TTL_MS = 9e5;
|
|
612
630
|
const DOC_TOKEN_TTL_MS = 6e4;
|
|
613
631
|
const PENDING_LAUNCH_TTL_MS = 12e4;
|
|
614
|
-
function
|
|
615
|
-
if (!store.
|
|
632
|
+
function requireAtomicComparison(store) {
|
|
633
|
+
if (!store.observe || !store.compareAndApply) throw new Error("Discord Activities require atomic plugin state comparisons");
|
|
616
634
|
return store;
|
|
617
635
|
}
|
|
618
636
|
function openDiscordActivityStores(openKeyedStore) {
|
|
619
637
|
return {
|
|
620
|
-
widgets:
|
|
638
|
+
widgets: requireAtomicComparison(openKeyedStore({
|
|
621
639
|
namespace: "activities-widgets",
|
|
622
640
|
maxEntries: 64,
|
|
623
641
|
overflowPolicy: "evict-oldest",
|
|
@@ -635,7 +653,7 @@ function openDiscordActivityStores(openKeyedStore) {
|
|
|
635
653
|
overflowPolicy: "evict-oldest",
|
|
636
654
|
defaultTtlMs: DOC_TOKEN_TTL_MS
|
|
637
655
|
}),
|
|
638
|
-
launches:
|
|
656
|
+
launches: requireAtomicComparison(openKeyedStore({
|
|
639
657
|
namespace: "activities-launches",
|
|
640
658
|
maxEntries: 256,
|
|
641
659
|
overflowPolicy: "evict-oldest",
|
|
@@ -646,6 +664,35 @@ function openDiscordActivityStores(openKeyedStore) {
|
|
|
646
664
|
function pendingLaunchKey(accountId, channelId, discordUserId) {
|
|
647
665
|
return `${accountId}:${channelId}:${discordUserId}`;
|
|
648
666
|
}
|
|
667
|
+
function deliveredWidgetIntent(widget, messageId) {
|
|
668
|
+
return widget ? {
|
|
669
|
+
operation: "update",
|
|
670
|
+
action: "set",
|
|
671
|
+
value: {
|
|
672
|
+
...widget,
|
|
673
|
+
deliveredMessageId: messageId
|
|
674
|
+
}
|
|
675
|
+
} : {
|
|
676
|
+
operation: "update",
|
|
677
|
+
action: "keep"
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
function pendingLaunchForWidget(existing, widgetId, createdAt) {
|
|
681
|
+
return existing && (existing.state === "ambiguous" || existing.widgetId !== widgetId) ? {
|
|
682
|
+
state: "ambiguous",
|
|
683
|
+
createdAt
|
|
684
|
+
} : {
|
|
685
|
+
state: "single",
|
|
686
|
+
widgetId,
|
|
687
|
+
createdAt
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
function retirePendingLaunchIntent(existing, widgetId) {
|
|
691
|
+
return {
|
|
692
|
+
operation: "delete",
|
|
693
|
+
action: existing?.state === "single" && existing.widgetId === widgetId ? "delete" : "keep"
|
|
694
|
+
};
|
|
695
|
+
}
|
|
649
696
|
var DiscordActivityStore = class {
|
|
650
697
|
constructor(stores) {
|
|
651
698
|
this.stores = stores;
|
|
@@ -664,10 +711,17 @@ var DiscordActivityStore = class {
|
|
|
664
711
|
}
|
|
665
712
|
async markWidgetDelivered(id, messageId) {
|
|
666
713
|
if (!/^\d+$/u.test(messageId)) throw new Error("Discord Activity delivery returned an invalid message ID");
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
714
|
+
const widgets = this.stores.widgets;
|
|
715
|
+
let observed = await widgets.observe(id);
|
|
716
|
+
while (true) {
|
|
717
|
+
const result = await widgets.compareAndApply(id, observed.comparison, deliveredWidgetIntent(observed.value, messageId));
|
|
718
|
+
if (result.status === "conflict") {
|
|
719
|
+
observed = result.current;
|
|
720
|
+
continue;
|
|
721
|
+
}
|
|
722
|
+
if (result.status === "unchanged") throw new Error("Discord Activity widget disappeared before delivery was recorded");
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
671
725
|
}
|
|
672
726
|
async deleteWidget(id) {
|
|
673
727
|
await this.stores.widgets.delete(id);
|
|
@@ -710,20 +764,28 @@ var DiscordActivityStore = class {
|
|
|
710
764
|
}
|
|
711
765
|
async recordPendingLaunch(params) {
|
|
712
766
|
const key = pendingLaunchKey(params.accountId, params.channelId, params.discordUserId);
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
};
|
|
722
|
-
|
|
767
|
+
const { widgetId, createdAt } = params;
|
|
768
|
+
const launches = this.stores.launches;
|
|
769
|
+
let observed = await launches.observe(key);
|
|
770
|
+
while (true) {
|
|
771
|
+
const result = await launches.compareAndApply(key, observed.comparison, {
|
|
772
|
+
operation: "update",
|
|
773
|
+
action: "set",
|
|
774
|
+
value: pendingLaunchForWidget(observed.value, widgetId, createdAt)
|
|
775
|
+
});
|
|
776
|
+
if (result.status !== "conflict") return;
|
|
777
|
+
observed = result.current;
|
|
778
|
+
}
|
|
723
779
|
}
|
|
724
780
|
async retirePendingLaunch(accountId, channelId, discordUserId, widgetId) {
|
|
725
781
|
const key = pendingLaunchKey(accountId, channelId, discordUserId);
|
|
726
|
-
|
|
782
|
+
const launches = this.stores.launches;
|
|
783
|
+
let observed = await launches.observe(key);
|
|
784
|
+
while (true) {
|
|
785
|
+
const result = await launches.compareAndApply(key, observed.comparison, retirePendingLaunchIntent(observed.value, widgetId));
|
|
786
|
+
if (result.status !== "conflict") return;
|
|
787
|
+
observed = result.current;
|
|
788
|
+
}
|
|
727
789
|
}
|
|
728
790
|
async consumePendingLaunch(accountId, channelId, discordUserId) {
|
|
729
791
|
const launch = await this.stores.launches.consume(pendingLaunchKey(accountId, channelId, discordUserId));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as getDiscordEndpointRuntime, w as parseDiscordRetryAfterBodySeconds } from "./channel-type-DKnjV1XW.mjs";
|
|
2
2
|
import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
3
3
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
4
|
+
import { captureChannelReadAuthority, resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
4
5
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
5
6
|
import { parseRetryAfterHeaderSeconds, resolveRetryConfig, retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
6
7
|
import { readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
7
|
-
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
8
8
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
9
9
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
10
10
|
//#region extensions/discord/src/error-body.ts
|
|
@@ -109,7 +109,9 @@ function createDiscordRequestSignal(options) {
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
async function requestDiscord(path, token, options) {
|
|
112
|
-
const
|
|
112
|
+
const assertReadAuthority = captureChannelReadAuthority();
|
|
113
|
+
const endpoint = options?.endpointRuntime === void 0 ? getDiscordEndpointRuntime() : options.endpointRuntime;
|
|
114
|
+
const fetchImpl = resolveFetch(endpoint ? (input, init) => endpoint.fetch(input, init, assertReadAuthority) : options?.fetcher ?? fetch);
|
|
113
115
|
if (!fetchImpl) throw new Error("fetch is not available");
|
|
114
116
|
const retryConfig = resolveRetryConfig(DISCORD_API_RETRY_DEFAULTS, options?.retry);
|
|
115
117
|
return retryAsync(async () => {
|
|
@@ -118,7 +120,8 @@ async function requestDiscord(path, token, options) {
|
|
|
118
120
|
const body = normalizeDiscordRequestBody(options?.body, headers);
|
|
119
121
|
const requestSignal = createDiscordRequestSignal(options ?? {});
|
|
120
122
|
try {
|
|
121
|
-
|
|
123
|
+
assertReadAuthority?.();
|
|
124
|
+
const res = await fetchImpl(`${endpoint?.descriptor.restApiBaseUrl ?? DISCORD_API_BASE}${path}`, {
|
|
122
125
|
method: options?.method ?? (body === void 0 ? "GET" : "POST"),
|
|
123
126
|
headers,
|
|
124
127
|
body,
|
package/dist/{approval-handler.runtime-CUNkTLDO.js → .setup/approval-handler.runtime-Du3n5ypX.mjs}
RENAMED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { s as buildExecApprovalCustomId } from "./components-
|
|
3
|
-
import { N as createDiscordClient, O as createDiscordMessageNonce } from "./send.shared-
|
|
4
|
-
import {
|
|
5
|
-
import { a as shouldHandleDiscordApprovalRequest } from "./channel-
|
|
1
|
+
import { A as serializePayload, G as Row, L as Button, Y as TextDisplay, et as stripUndefinedFields, ft as editChannelMessage, nt as createUserDmChannel, q as Separator, st as createChannelMessage, ut as deleteChannelMessage, z as Container } from "./discord-BXpHW-cu.mjs";
|
|
2
|
+
import { s as buildExecApprovalCustomId } from "./components-MqMWUWnE.mjs";
|
|
3
|
+
import { N as createDiscordClient, O as createDiscordMessageNonce } from "./send.shared-Zwx6BxQ5.mjs";
|
|
4
|
+
import { D as isDiscordExecApprovalClientEnabled, c as formatDiscordApprovalDisplayValue, s as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./outbound-session-route-CqWbuMOm.mjs";
|
|
5
|
+
import { a as shouldHandleDiscordApprovalRequest } from "./channel-ChKdlBgH.mjs";
|
|
6
|
+
import { t as discordApprovalMessageUpdates } from "./approval-message-updates-BN7JtScm.mjs";
|
|
6
7
|
import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
|
|
7
8
|
import { ButtonStyle } from "discord-api-types/v10";
|
|
8
9
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -176,7 +177,7 @@ async function updateMessage(params) {
|
|
|
176
177
|
accountId: params.accountId
|
|
177
178
|
});
|
|
178
179
|
const payload = buildExecApprovalPayload(params.container);
|
|
179
|
-
await discordRequest(() => editChannelMessage(rest, params.channelId, params.messageId, { body: stripUndefinedFields(serializePayload(payload)) }), "update-approval");
|
|
180
|
+
await discordApprovalMessageUpdates.enqueue(params.messageId, () => discordRequest(() => editChannelMessage(rest, params.channelId, params.messageId, { body: stripUndefinedFields(serializePayload(payload)) }), "update-approval"));
|
|
180
181
|
} catch (err) {
|
|
181
182
|
logError(`discord approvals: failed to update message: ${String(err)}`);
|
|
182
183
|
}
|
|
@@ -192,7 +193,7 @@ async function finalizeMessage(params) {
|
|
|
192
193
|
token: params.token,
|
|
193
194
|
accountId: params.accountId
|
|
194
195
|
});
|
|
195
|
-
await discordRequest(() => deleteChannelMessage(rest, params.channelId, params.messageId), "delete-approval");
|
|
196
|
+
await discordApprovalMessageUpdates.enqueue(params.messageId, () => discordRequest(() => deleteChannelMessage(rest, params.channelId, params.messageId), "delete-approval"));
|
|
196
197
|
} catch (err) {
|
|
197
198
|
logError(`discord approvals: failed to delete message: ${String(err)}`);
|
|
198
199
|
await updateMessage(params);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { $ as parseCustomId } from "./discord-BXpHW-cu.mjs";
|
|
2
|
+
import { c as parseExecApprovalData } from "./components-MqMWUWnE.mjs";
|
|
3
|
+
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
4
|
+
//#region extensions/discord/src/approval-message-updates.ts
|
|
5
|
+
const discordApprovalMessageUpdates = new KeyedAsyncQueue();
|
|
6
|
+
/** Read the current control identity, rather than reconstructing delivery ownership. */
|
|
7
|
+
function hasDiscordApprovalControl(message, approval) {
|
|
8
|
+
if (!message || typeof message !== "object") return false;
|
|
9
|
+
if ("custom_id" in message && typeof message.custom_id === "string") {
|
|
10
|
+
const customId = parseCustomId(message.custom_id);
|
|
11
|
+
const current = customId.key === "execapproval" ? parseExecApprovalData(customId.data) : null;
|
|
12
|
+
return current?.approvalId === approval.approvalId && current.approvalKind === approval.approvalKind && current.action === approval.action;
|
|
13
|
+
}
|
|
14
|
+
return "components" in message && Array.isArray(message.components) && message.components.some((component) => hasDiscordApprovalControl(component, approval));
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { hasDiscordApprovalControl as n, discordApprovalMessageUpdates as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
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 { Ut as __exportAll } from "./discord-BXpHW-cu.mjs";
|
|
2
|
+
import { x as fetchChannelPermissionsDiscord } from "./send.shared-Zwx6BxQ5.mjs";
|
|
3
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BwQj24ht.mjs";
|
|
4
|
+
import "./send-CKDczUNL.mjs";
|
|
5
|
+
import { C as collectDiscordAuditChannelIdsForAccount, S as auditDiscordChannelPermissionsWithFetcher } from "./outbound-session-route-CqWbuMOm.mjs";
|
|
6
6
|
//#region extensions/discord/src/audit.ts
|
|
7
7
|
var audit_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
auditDiscordChannelPermissions: () => auditDiscordChannelPermissions,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { c as resolveDiscordAccount, i as listDiscordStartupAccountIds, l as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.
|
|
2
|
-
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.
|
|
3
|
-
import {
|
|
4
|
-
import { u as withAbortTimeout } from "./timeouts-D86uWLt_.
|
|
5
|
-
import {
|
|
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-
|
|
7
|
-
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.
|
|
8
|
-
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-
|
|
9
|
-
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-
|
|
10
|
-
import { n as discordOutbound } from "./outbound-adapter-
|
|
11
|
-
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.
|
|
12
|
-
import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.
|
|
1
|
+
import { c as resolveDiscordAccount, i as listDiscordStartupAccountIds, l as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.mjs";
|
|
2
|
+
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
3
|
+
import { _ as normalizeDiscordMessagingTarget, g as matchesDiscordToolContextTarget, h as looksLikeDiscordTargetId, y as parseDiscordTarget } from "./retry-DBfcEgmO.mjs";
|
|
4
|
+
import { u as withAbortTimeout } from "./timeouts-D86uWLt_.mjs";
|
|
5
|
+
import { A as createChannelApproverDmTargetResolver, D as isDiscordExecApprovalClientEnabled, E as isDiscordExecApprovalApprover, M as isChannelExecApprovalClientEnabledFromConfig, N as matchesApprovalRequestFilters, O as shouldSuppressLocalDiscordExecApprovalPrompt, T as getDiscordExecApprovalApprovers, _ as resolveDiscordRuntimeBindingConversationId, f as resolveDiscordConversationRoute, g as resolveDiscordCurrentConversationIdentity, j as createChannelNativeOriginTargetResolver, k as createApproverRestrictedNativeApprovalCapability, t as resolveDiscordOutboundSessionRoute, v as discordMessageActions, w as resolveRequiredDiscordChannelPermissions } from "./outbound-session-route-CqWbuMOm.mjs";
|
|
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-CaA3Vv4n.mjs";
|
|
7
|
+
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.mjs";
|
|
8
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-_rz33QHO.mjs";
|
|
9
|
+
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DCQq1WZ5.mjs";
|
|
10
|
+
import { n as discordOutbound } from "./outbound-adapter-C8v79z9Z.mjs";
|
|
11
|
+
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.mjs";
|
|
12
|
+
import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.mjs";
|
|
13
13
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
14
14
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
15
15
|
import { createRuntimeConfigReader } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
@@ -182,6 +182,7 @@ function createDiscordApprovalCapability(configOverride) {
|
|
|
182
182
|
resolveApproverDmTargets: createDiscordApproverDmTargetResolver(configOverride),
|
|
183
183
|
notifyOriginWhenDmOnly: true,
|
|
184
184
|
nativeRuntime: createLazyChannelApprovalNativeRuntimeAdapter({
|
|
185
|
+
capabilityBoundary: true,
|
|
185
186
|
eventKinds: [
|
|
186
187
|
"exec",
|
|
187
188
|
"plugin",
|
|
@@ -198,7 +199,7 @@ function createDiscordApprovalCapability(configOverride) {
|
|
|
198
199
|
request,
|
|
199
200
|
configOverride
|
|
200
201
|
}),
|
|
201
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
202
|
+
load: async () => (await import("./approval-handler.runtime-Du3n5ypX.mjs")).discordApprovalNativeRuntime
|
|
202
203
|
})
|
|
203
204
|
});
|
|
204
205
|
}
|
|
@@ -305,22 +306,22 @@ function resolveDiscordInboundConversation(params) {
|
|
|
305
306
|
}
|
|
306
307
|
//#endregion
|
|
307
308
|
//#region extensions/discord/src/channel.loaders.ts
|
|
308
|
-
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
309
|
-
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
310
|
-
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
311
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
312
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
313
|
-
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-
|
|
314
|
-
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-
|
|
309
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-BytTftz-.mjs").then((n) => n.t));
|
|
310
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-BbvsLQOZ.mjs").then((n) => n.n));
|
|
311
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-ByFlR7LQ.mjs").then((n) => n.n));
|
|
312
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-eexkKyrG.mjs").then((n) => n.a));
|
|
313
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-B6MrxbYv.mjs").then((n) => n.r));
|
|
314
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-DuhmKdDU.mjs"));
|
|
315
|
+
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-DBQ_AGPe.mjs"));
|
|
315
316
|
async function probeDiscordStatusAccount(params) {
|
|
316
317
|
const startedAtMs = Date.now();
|
|
317
318
|
const runtime = await loadDiscordProbeRuntime();
|
|
318
319
|
const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
|
|
319
320
|
return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
|
|
320
321
|
}
|
|
321
|
-
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-
|
|
322
|
-
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-
|
|
323
|
-
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live
|
|
322
|
+
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-C8uaKoa9.mjs").then((n) => n.n));
|
|
323
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-CKDczUNL.mjs").then((n) => n.t));
|
|
324
|
+
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live--EGTH0DC.mjs").then((n) => n.t));
|
|
324
325
|
//#endregion
|
|
325
326
|
//#region extensions/discord/src/conversation-route-owner.ts
|
|
326
327
|
function inspectDiscordConversationRouteOwner(params) {
|
|
@@ -769,7 +770,7 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
769
770
|
supportsCurrentConversationBinding: true,
|
|
770
771
|
bindingStore: "adapter",
|
|
771
772
|
defaultTopLevelPlacement,
|
|
772
|
-
createManager: async ({ cfg, accountId }) => (await loadDiscordThreadBindingsManagerModule()).
|
|
773
|
+
createManager: async ({ cfg, accountId }) => (await loadDiscordThreadBindingsManagerModule()).createThreadBindingManagerAsync({
|
|
773
774
|
cfg,
|
|
774
775
|
accountId: accountId ?? void 0,
|
|
775
776
|
persist: false,
|
|
@@ -1013,6 +1014,7 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
1013
1014
|
} },
|
|
1014
1015
|
security: discordSecurityAdapter,
|
|
1015
1016
|
threading: {
|
|
1017
|
+
matchesToolContextTarget: matchesDiscordToolContextTarget,
|
|
1016
1018
|
scopedAccountReplyToMode: {
|
|
1017
1019
|
resolveAccount: (cfg, accountId) => resolveDiscordAccount({
|
|
1018
1020
|
cfg,
|
|
@@ -1023,9 +1025,10 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
1023
1025
|
},
|
|
1024
1026
|
buildToolContext: ({ context, hasRepliedRef }) => {
|
|
1025
1027
|
const currentMessagingTarget = normalizeOptionalString(context.To);
|
|
1028
|
+
const nativeChannelId = normalizeOptionalString(context.NativeChannelId);
|
|
1026
1029
|
const currentChatType = context.ChatType === "direct" || context.ChatType === "group" || context.ChatType === "channel" ? context.ChatType : void 0;
|
|
1027
1030
|
return {
|
|
1028
|
-
currentChannelId:
|
|
1031
|
+
currentChannelId: nativeChannelId ? normalizeDiscordMessagingTarget(nativeChannelId) : currentMessagingTarget,
|
|
1029
1032
|
currentChatType,
|
|
1030
1033
|
currentMessagingTarget,
|
|
1031
1034
|
currentMessageId: context.CurrentMessageId,
|
package/dist/{channel-actions.runtime-rmse1yrM.js → .setup/channel-actions.runtime-CJmiFfps.mjs}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "./targets-
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
9
|
-
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-fmHl1HNd.
|
|
1
|
+
import { C as withDiscordRequestAuthority } from "./discord-BXpHW-cu.mjs";
|
|
2
|
+
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-MqMWUWnE.mjs";
|
|
3
|
+
import { b as resolveDiscordChannelId, y as parseDiscordTarget } from "./retry-DBfcEgmO.mjs";
|
|
4
|
+
import "./targets-D1mAB5yO.mjs";
|
|
5
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-SchNfUsQ.mjs";
|
|
6
|
+
import "../action-runtime-api.js";
|
|
7
|
+
import { b as discordInboundEventDelivery, i as isDiscordComponentSpecWithinMessageLimit, n as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-session-route-CqWbuMOm.mjs";
|
|
8
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-DAFyh_yV.mjs";
|
|
9
|
+
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-fmHl1HNd.mjs";
|
|
10
10
|
import { normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
11
|
import { adaptMessagePresentationForChannel, normalizeLegacyInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
12
12
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -30,12 +30,18 @@ function readCurrentDiscordTarget(toolContext) {
|
|
|
30
30
|
return toolContext?.currentChannelId?.trim() || void 0;
|
|
31
31
|
}
|
|
32
32
|
async function handleDiscordMessageAction(ctx) {
|
|
33
|
+
ctx.assertDirectAdapterHandoff?.();
|
|
34
|
+
return await withDiscordRequestAuthority(ctx.assertDirectAdapterHandoff, () => dispatchDiscordMessageAction(ctx));
|
|
35
|
+
}
|
|
36
|
+
async function dispatchDiscordMessageAction(ctx) {
|
|
33
37
|
const { action, params, cfg } = ctx;
|
|
34
38
|
const accountId = ctx.accountId ?? readStringParam$1(params, "accountId");
|
|
35
39
|
const readContext = ctx.requesterAccountId && ctx.toolContext?.currentChannelProvider && ctx.toolContext.currentChannelId ? {
|
|
36
40
|
requesterAccountId: ctx.requesterAccountId,
|
|
37
41
|
currentChannelProvider: ctx.toolContext.currentChannelProvider,
|
|
38
|
-
currentChannelId: ctx.toolContext.currentChannelId
|
|
42
|
+
currentChannelId: ctx.toolContext.currentChannelId,
|
|
43
|
+
currentChatType: ctx.toolContext.currentChatType,
|
|
44
|
+
currentMessagingTarget: ctx.toolContext.currentMessagingTarget
|
|
39
45
|
} : void 0;
|
|
40
46
|
const readPolicyOptions = ctx.conversationReadOrigin || readContext ? {
|
|
41
47
|
...ctx.conversationReadOrigin ? { conversationReadOrigin: ctx.conversationReadOrigin } : {},
|
|
@@ -216,7 +222,8 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
216
222
|
limit,
|
|
217
223
|
before: readStringParam$1(params, "before"),
|
|
218
224
|
after: readStringParam$1(params, "after"),
|
|
219
|
-
around: readStringParam$1(params, "around")
|
|
225
|
+
around: readStringParam$1(params, "around"),
|
|
226
|
+
messageId: readStringParam$1(params, "messageId")
|
|
220
227
|
}, cfg, actionOptions);
|
|
221
228
|
}
|
|
222
229
|
if (action === "edit" || action === "delete") {
|