@openclaw/discord 2026.9.4 → 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-w8j7Elou.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-BnPUU5NK.js → .setup/approval-handler.runtime-Du3n5ypX.mjs} +8 -7
- package/dist/.setup/approval-message-updates-BN7JtScm.mjs +17 -0
- package/dist/{audit-BgAgIzwo.js → .setup/audit-C8uaKoa9.mjs} +5 -5
- package/dist/{channel-C_OFFR5Y.js → .setup/channel-ChKdlBgH.mjs} +27 -25
- package/dist/{channel-actions.runtime-tShzmemq.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-DBFTIN6P.js → .setup/components-MqMWUWnE.mjs} +3 -3
- package/dist/{config-schema-r38UkM_J.js → .setup/config-schema-CiZz-mtA.mjs} +1 -1
- package/dist/{conversation-binding-route-CB9PRqgi.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-CpEwox_X.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-C7FZGKa8.js → .setup/message-handler-DnUrDpaU.mjs} +23 -13
- package/dist/{message-handler.preflight-DFpwDW2W.js → .setup/message-handler.preflight-CtqaF_fb.mjs} +33 -20
- package/dist/{message-handler.process-ZKrmmA9D.js → .setup/message-handler.process-Dz1xvuQU.mjs} +68 -78
- package/dist/{outbound-adapter-C8PTt7_p.js → .setup/outbound-adapter-C8v79z9Z.mjs} +13 -9
- package/dist/{outbound-session-route-B0N6os97.js → .setup/outbound-session-route-CqWbuMOm.mjs} +137 -11
- package/dist/{pluralkit-BiUW53Yn.js → .setup/pluralkit-CdAt1G0P.mjs} +2 -2
- 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-DmRHCZ_K.js → .setup/provider-72zIvN-i.mjs} +475 -286
- package/dist/{provider-session.runtime-U1M8_EYY.js → .setup/provider-session.runtime-BW7QrF5C.mjs} +4 -4
- package/dist/.setup/provider.runtime-DuhmKdDU.mjs +2 -0
- package/dist/{realtime-session.runtime-Bjsk9Q5t.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-DKeoT7UO.js → .setup/retry-DBfcEgmO.mjs} +28 -6
- package/dist/{runtime-CbknwoBH.js → .setup/runtime-BVoa7hhx.mjs} +2 -2
- package/dist/{runtime-Dxl-ZOvg.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-CLpzfzJe.js → .setup/send-CKDczUNL.mjs} +60 -31
- package/dist/{send.components-BWnkX4QN.js → .setup/send.components-DWQjXhPV.mjs} +87 -65
- package/dist/{send.outbound-BVTWrl_4.js → .setup/send.outbound-D0hQ7s50.mjs} +17 -7
- package/dist/{send.shared-BHPM3CSl.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-DfsiwCec.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-CoFQ7iSX.js → .setup/target-resolver-B6MrxbYv.mjs} +4 -4
- package/dist/.setup/targets-D1mAB5yO.mjs +3 -0
- package/dist/{thread-bindings-uudC_0TY.js → .setup/thread-bindings-CK5272V3.mjs} +6 -6
- package/dist/{thread-bindings.manager-BeUxc8nr.js → .setup/thread-bindings.manager-eexkKyrG.mjs} +14 -9
- package/dist/{thread-bindings.session-updates-BwkXpcy0.js → .setup/thread-bindings.session-updates-DCQq1WZ5.mjs} +1 -1
- package/dist/{thread-bindings.state-dDn-dwBw.js → .setup/thread-bindings.state-BThFQEga.mjs} +46 -14
- 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-DMYDMkJx.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 +4 -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 +3 -4
- package/package.json +10 -8
- package/dist/channel-type-CVLZyGYS.js +0 -7
- package/dist/outbound-components-DrlHcWfM.js +0 -100
- package/dist/provider.runtime-CqfE-RvC.js +0 -2
- package/dist/targets-Cm6aV9nJ.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/{presence-cache-dYSHPWMx.js → .setup/presence-cache-dYSHPWMx.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
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-
|
|
2
|
-
import {
|
|
3
|
-
import { o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, t as createDiscordActionGate } from "./accounts-CwJQoLjM.
|
|
4
|
-
import { r as sendDiscordComponentMessage } from "./send.components-
|
|
5
|
-
import { d as createReusableDiscordReplyReference, p as resolveDiscordReplyReference, y as
|
|
6
|
-
import { F as createDiscordRuntimeAccountContext, T as hasAnyGuildPermissionDiscord, U as getGateway, d as resolveDiscordTargetChannelId, v as canManageGuildMemberRoleDiscord, w as hasAnyChannelPermissionDiscord, x as fetchChannelPermissionsDiscord, y as canManageGuildRoleDiscord } from "./send.shared-
|
|
7
|
-
import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
8
|
-
import {
|
|
9
|
-
import { n as
|
|
10
|
-
import
|
|
11
|
-
import "./targets-Cm6aV9nJ.js";
|
|
1
|
+
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-MqMWUWnE.mjs";
|
|
2
|
+
import { l as resolveDiscordChannelConfigWithFallback, o as normalizeDiscordSlug, r as isDiscordGroupAllowedByPolicy, t as isDiscordThreadChannelType, v as resolveGroupDmAllow } from "./channel-type-DKnjV1XW.mjs";
|
|
3
|
+
import { o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, t as createDiscordActionGate } from "./accounts-CwJQoLjM.mjs";
|
|
4
|
+
import { r as sendDiscordComponentMessage } from "./send.components-DWQjXhPV.mjs";
|
|
5
|
+
import { b as resolveDiscordChannelId, d as createReusableDiscordReplyReference, p as resolveDiscordReplyReference, y as parseDiscordTarget } from "./retry-DBfcEgmO.mjs";
|
|
6
|
+
import { F as createDiscordRuntimeAccountContext, T as hasAnyGuildPermissionDiscord, U as getGateway, b as canViewDiscordGuildChannel, d as resolveDiscordTargetChannelId, v as canManageGuildMemberRoleDiscord, w as hasAnyChannelPermissionDiscord, x as fetchChannelPermissionsDiscord, y as canManageGuildRoleDiscord } from "./send.shared-Zwx6BxQ5.mjs";
|
|
7
|
+
import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-D0hQ7s50.mjs";
|
|
8
|
+
import { n as getPresence } from "./presence-cache-dYSHPWMx.mjs";
|
|
9
|
+
import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, l as DiscordThreadInitialMessageError, m as listPinsDiscord, n as fetchReactionsDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchGuildInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-CKDczUNL.mjs";
|
|
10
|
+
import "./targets-D1mAB5yO.mjs";
|
|
12
11
|
import { ChannelType, PermissionFlagsBits } from "discord-api-types/v10";
|
|
13
12
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
14
13
|
import { asBoolean, isRecord, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -16,67 +15,7 @@ import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runti
|
|
|
16
15
|
import { assertMediaNotDataUrl, jsonResult, parseAvailableTags, readNonNegativeIntegerParam, readPositiveIntegerParam, readReactionParams, readStringArrayParam, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
|
|
17
16
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
18
17
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
19
|
-
//#region extensions/discord/src/actions/runtime-deps.ts
|
|
20
|
-
const discordGuildActionRuntime = {
|
|
21
|
-
addRoleDiscord,
|
|
22
|
-
canManageGuildRoleDiscord,
|
|
23
|
-
canManageGuildMemberRoleDiscord,
|
|
24
|
-
createChannelDiscord,
|
|
25
|
-
createScheduledEventDiscord,
|
|
26
|
-
resolveEventCoverImage,
|
|
27
|
-
deleteChannelDiscord,
|
|
28
|
-
editChannelDiscord,
|
|
29
|
-
fetchChannelInfoDiscord,
|
|
30
|
-
fetchMemberInfoDiscord,
|
|
31
|
-
hasAnyChannelPermissionDiscord,
|
|
32
|
-
hasAnyGuildPermissionDiscord,
|
|
33
|
-
fetchRoleInfoDiscord,
|
|
34
|
-
fetchVoiceStatusDiscord,
|
|
35
|
-
listGuildChannelsDiscord,
|
|
36
|
-
listGuildEmojisDiscord,
|
|
37
|
-
listScheduledEventsDiscord,
|
|
38
|
-
moveChannelDiscord,
|
|
39
|
-
removeChannelPermissionDiscord,
|
|
40
|
-
removeRoleDiscord,
|
|
41
|
-
setChannelPermissionDiscord,
|
|
42
|
-
uploadEmojiDiscord,
|
|
43
|
-
uploadStickerDiscord
|
|
44
|
-
};
|
|
45
|
-
const discordModerationActionRuntime = {
|
|
46
|
-
banMemberDiscord,
|
|
47
|
-
hasAnyGuildPermissionDiscord,
|
|
48
|
-
kickMemberDiscord,
|
|
49
|
-
timeoutMemberDiscord
|
|
50
|
-
};
|
|
51
|
-
//#endregion
|
|
52
18
|
//#region extensions/discord/src/actions/runtime.messaging.runtime.ts
|
|
53
|
-
const discordMessagingActionRuntime = {
|
|
54
|
-
createThreadDiscord,
|
|
55
|
-
deleteMessageDiscord,
|
|
56
|
-
editChannelDiscord,
|
|
57
|
-
editMessageDiscord,
|
|
58
|
-
fetchChannelInfoDiscord,
|
|
59
|
-
fetchGuildInfoDiscord,
|
|
60
|
-
fetchChannelPermissionsDiscord,
|
|
61
|
-
fetchMessageDiscord,
|
|
62
|
-
fetchReactionsDiscord,
|
|
63
|
-
listPinsDiscord,
|
|
64
|
-
listThreadsDiscord,
|
|
65
|
-
pinMessageDiscord,
|
|
66
|
-
reactMessageDiscord,
|
|
67
|
-
readDiscordComponentSpec,
|
|
68
|
-
readMessagesDiscord,
|
|
69
|
-
removeOwnReactionsDiscord,
|
|
70
|
-
removeReactionDiscord,
|
|
71
|
-
resolveDiscordReactionTargetChannelId,
|
|
72
|
-
resolveDiscordChannelId,
|
|
73
|
-
searchMessagesDiscord,
|
|
74
|
-
sendDiscordComponentMessage,
|
|
75
|
-
sendMessageDiscord,
|
|
76
|
-
sendStickerDiscord,
|
|
77
|
-
sendVoiceMessageDiscord,
|
|
78
|
-
unpinMessageDiscord
|
|
79
|
-
};
|
|
80
19
|
async function resolveDiscordReactionTargetChannelId(params) {
|
|
81
20
|
try {
|
|
82
21
|
return resolveDiscordChannelId(params.target);
|
|
@@ -320,7 +259,7 @@ function createDiscordMessagingActionContext(params) {
|
|
|
320
259
|
const currentChannelId = currentReadContext?.currentChannelId?.trim();
|
|
321
260
|
if (currentReadContext?.currentChannelProvider?.trim().toLowerCase() !== "discord" || !requesterAccountId || !currentChannelId || normalizeAccountId(requesterAccountId) !== normalizeAccountId(resolvedReactionAccountId)) return false;
|
|
322
261
|
try {
|
|
323
|
-
return
|
|
262
|
+
return resolveDiscordChannelId(currentChannelId) === channelId;
|
|
324
263
|
} catch {
|
|
325
264
|
return false;
|
|
326
265
|
}
|
|
@@ -333,7 +272,7 @@ function createDiscordMessagingActionContext(params) {
|
|
|
333
272
|
const resolveGuildName = async (guildId) => {
|
|
334
273
|
if (guildNameById.has(guildId)) return guildNameById.get(guildId) ?? null;
|
|
335
274
|
try {
|
|
336
|
-
const guildName = readDiscordChannelStringField(await
|
|
275
|
+
const guildName = readDiscordChannelStringField(await fetchGuildInfoDiscord(guildId, withOpts()), "name") ?? null;
|
|
337
276
|
guildNameById.set(guildId, guildName);
|
|
338
277
|
return guildName;
|
|
339
278
|
} catch {
|
|
@@ -371,7 +310,7 @@ function createDiscordMessagingActionContext(params) {
|
|
|
371
310
|
};
|
|
372
311
|
let channelInfo;
|
|
373
312
|
try {
|
|
374
|
-
channelInfo = await
|
|
313
|
+
channelInfo = await fetchChannelInfoDiscord(channelId, withOpts());
|
|
375
314
|
} catch {
|
|
376
315
|
return fallback;
|
|
377
316
|
}
|
|
@@ -394,7 +333,7 @@ function createDiscordMessagingActionContext(params) {
|
|
|
394
333
|
parentId: readDiscordChannelStringField(channelInfo, "parent_id", "parentId"),
|
|
395
334
|
loadChannel: async (parentId) => {
|
|
396
335
|
try {
|
|
397
|
-
return await
|
|
336
|
+
return await fetchChannelInfoDiscord(parentId, withOpts());
|
|
398
337
|
} catch {
|
|
399
338
|
return;
|
|
400
339
|
}
|
|
@@ -446,9 +385,9 @@ function createDiscordMessagingActionContext(params) {
|
|
|
446
385
|
cfg: params.cfg,
|
|
447
386
|
options: params.options,
|
|
448
387
|
accountId,
|
|
449
|
-
resolveChannelId: () =>
|
|
388
|
+
resolveChannelId: () => resolveDiscordChannelId(readStringParam(params.input, "channelId", { required: true })),
|
|
450
389
|
assertReadTargetAllowed: async ({ guildId, channelId }) => {
|
|
451
|
-
const targetChannelId =
|
|
390
|
+
const targetChannelId = resolveDiscordChannelId(channelId);
|
|
452
391
|
const target = await resolveReadTargetContext(targetChannelId);
|
|
453
392
|
const currentConversation = isCurrentReadTarget(targetChannelId);
|
|
454
393
|
if (guildId) {
|
|
@@ -548,7 +487,18 @@ function createDiscordMessagingActionContext(params) {
|
|
|
548
487
|
},
|
|
549
488
|
resolveReactionChannelId: async () => {
|
|
550
489
|
const target = readStringParam(params.input, "channelId") ?? readStringParam(params.input, "to", { required: true });
|
|
551
|
-
|
|
490
|
+
if (params.action === "reactions" && !directOperator) {
|
|
491
|
+
const reactionTarget = parseDiscordTarget(target, { defaultKind: "channel" });
|
|
492
|
+
if (reactionTarget?.kind === "user" && currentReadContext?.currentChatType === "direct") {
|
|
493
|
+
const currentTarget = parseDiscordTarget(currentReadContext.currentMessagingTarget ?? "", { defaultKind: "channel" });
|
|
494
|
+
if (currentTarget?.kind === "user" && currentTarget.id === reactionTarget.id) {
|
|
495
|
+
const currentChannelId = resolveDiscordChannelId(currentReadContext.currentChannelId ?? "");
|
|
496
|
+
if (isCurrentReadTarget(currentChannelId)) return currentChannelId;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return resolveDiscordChannelId(target);
|
|
500
|
+
}
|
|
501
|
+
return await resolveDiscordReactionTargetChannelId({
|
|
552
502
|
target,
|
|
553
503
|
cfg: params.cfg,
|
|
554
504
|
accountId: resolvedReactionAccountId
|
|
@@ -637,7 +587,7 @@ async function resolveGuildIdForGuildAdminAction(params) {
|
|
|
637
587
|
if (guildId) return guildId;
|
|
638
588
|
const channelLikeId = readStringParam(params.values, "channelId") ?? readStringParam(params.values, "categoryId");
|
|
639
589
|
if (!channelLikeId) return;
|
|
640
|
-
const channel = await
|
|
590
|
+
const channel = await fetchChannelInfoDiscord(channelLikeId, createDiscordActionOptions({
|
|
641
591
|
cfg: params.cfg,
|
|
642
592
|
accountId: params.accountId
|
|
643
593
|
}));
|
|
@@ -652,13 +602,14 @@ async function resolveGuildAdminActionPermissions(params) {
|
|
|
652
602
|
if (params.action !== "channelEdit") return params.guard.permissions;
|
|
653
603
|
const channelId = readStringParam(params.values, "channelId");
|
|
654
604
|
if (!channelId) return params.guard.permissions;
|
|
655
|
-
const channel = await
|
|
605
|
+
const channel = await fetchChannelInfoDiscord(channelId, createDiscordActionOptions({
|
|
656
606
|
cfg: params.cfg,
|
|
657
607
|
accountId: params.accountId
|
|
658
608
|
}));
|
|
659
609
|
const channelType = "type" in channel ? channel.type : void 0;
|
|
660
610
|
if (!isDiscordThreadChannelType(channelType)) return params.guard.permissions;
|
|
661
|
-
|
|
611
|
+
const edit = readDiscordChannelEditParams(params.values);
|
|
612
|
+
return edit.archived === false && Object.entries(edit).every(([field, value]) => value === void 0 || field === "channelId" || field === "archived") && !isLockedThreadChannel(channel) ? [PermissionFlagsBits.ManageThreads, PermissionFlagsBits.SendMessages] : [PermissionFlagsBits.ManageThreads];
|
|
662
613
|
}
|
|
663
614
|
async function verifySenderGuildAdminPermission(params) {
|
|
664
615
|
const guard = guildAdminActionGuards[params.action];
|
|
@@ -675,17 +626,19 @@ async function verifySenderGuildAdminPermission(params) {
|
|
|
675
626
|
accountId: params.accountId
|
|
676
627
|
});
|
|
677
628
|
const targetChannelId = guard?.permissionScope === "channel" || params.action === "eventCreate" ? readChannelScopedPermissionTargetId(params.action, params.values) : void 0;
|
|
678
|
-
|
|
629
|
+
const hasPermission = targetChannelId ? await hasAnyChannelPermissionDiscord(guildId, targetChannelId, senderUserId, requiredPermissions, actionOptions) : await hasAnyGuildPermissionDiscord(guildId, senderUserId, requiredPermissions, actionOptions);
|
|
630
|
+
const requiresCurrentThreadAccess = params.action === "channelEdit" && requiredPermissions.includes(PermissionFlagsBits.SendMessages);
|
|
631
|
+
if (!hasPermission || requiresCurrentThreadAccess && (!targetChannelId || !await canViewDiscordGuildChannel(guildId, targetChannelId, senderUserId, actionOptions))) throw new Error("Sender does not have required permissions for this guild action.");
|
|
679
632
|
if (params.action === "roleAdd" || params.action === "roleRemove") {
|
|
680
633
|
const targetUserId = readStringParam(params.values, "userId", { required: true });
|
|
681
634
|
const roleId = readStringParam(params.values, "roleId", { required: true });
|
|
682
|
-
if (!await
|
|
635
|
+
if (!await canManageGuildMemberRoleDiscord(guildId, senderUserId, targetUserId, roleId, actionOptions, { assignablePermissionCeiling: params.action === "roleAdd" })) throw new Error("Sender cannot manage the requested role or member.");
|
|
683
636
|
}
|
|
684
637
|
if (params.action === "channelPermissionSet" || params.action === "channelPermissionRemove") {
|
|
685
638
|
const targetType = readStringParam(params.values, "targetType");
|
|
686
639
|
if (targetType === "member") return;
|
|
687
640
|
const targetId = readStringParam(params.values, "targetId", { required: true });
|
|
688
|
-
const canManageRole = await
|
|
641
|
+
const canManageRole = await canManageGuildRoleDiscord(guildId, senderUserId, targetId, actionOptions);
|
|
689
642
|
if (canManageRole === false || targetType === "role" && canManageRole === null) throw new Error("Sender cannot manage the requested role overwrite.");
|
|
690
643
|
}
|
|
691
644
|
}
|
|
@@ -749,7 +702,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
749
702
|
await assertGuildMetadataReadAllowed(guildId);
|
|
750
703
|
const userId = readStringParam(params, "userId", { required: true });
|
|
751
704
|
const effectiveAccountId = accountId ?? resolveDefaultDiscordAccountId(cfg);
|
|
752
|
-
const member = await
|
|
705
|
+
const member = await fetchMemberInfoDiscord(guildId, userId, createDiscordActionOptions({
|
|
753
706
|
cfg,
|
|
754
707
|
accountId: effectiveAccountId
|
|
755
708
|
}));
|
|
@@ -769,7 +722,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
769
722
|
if (!isActionEnabled("roleInfo")) throw new Error("Discord role info is disabled.");
|
|
770
723
|
const guildId = readStringParam(params, "guildId", { required: true });
|
|
771
724
|
await assertGuildMetadataReadAllowed(guildId);
|
|
772
|
-
const roles = await
|
|
725
|
+
const roles = await fetchRoleInfoDiscord(guildId, withOpts());
|
|
773
726
|
return jsonResult({
|
|
774
727
|
ok: true,
|
|
775
728
|
roles
|
|
@@ -785,7 +738,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
785
738
|
if (!guildId) throw new Error("Discord emoji listing requires guildId or a server channel.");
|
|
786
739
|
await assertGuildMetadataReadAllowed(guildId);
|
|
787
740
|
const limit = Math.min(readPositiveIntegerParam(params, "limit") ?? 100, 100);
|
|
788
|
-
const fetchEmojis = async () => (await
|
|
741
|
+
const fetchEmojis = async () => (await listGuildEmojisDiscord(guildId, withOpts())).flatMap(({ name, id, animated }) => name && id ? [{
|
|
789
742
|
name,
|
|
790
743
|
identifier: `${name}:${id}`,
|
|
791
744
|
...animated ? { animated } : {}
|
|
@@ -803,7 +756,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
803
756
|
const name = readStringParam(params, "name", { required: true });
|
|
804
757
|
const mediaUrl = readStringParam(params, "mediaUrl", { required: true });
|
|
805
758
|
const roleIds = readStringArrayParam(params, "roleIds");
|
|
806
|
-
const emoji = await
|
|
759
|
+
const emoji = await uploadEmojiDiscord({
|
|
807
760
|
guildId,
|
|
808
761
|
name,
|
|
809
762
|
mediaUrl,
|
|
@@ -825,7 +778,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
825
778
|
const description = readStringParam(params, "description", { required: true });
|
|
826
779
|
const tags = readStringParam(params, "tags", { required: true });
|
|
827
780
|
const mediaUrl = readStringParam(params, "mediaUrl", { required: true });
|
|
828
|
-
const sticker = await
|
|
781
|
+
const sticker = await uploadStickerDiscord({
|
|
829
782
|
guildId,
|
|
830
783
|
name,
|
|
831
784
|
description,
|
|
@@ -847,7 +800,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
847
800
|
cfg,
|
|
848
801
|
accountId,
|
|
849
802
|
values: params,
|
|
850
|
-
mutate:
|
|
803
|
+
mutate: addRoleDiscord
|
|
851
804
|
});
|
|
852
805
|
return jsonResult({ ok: true });
|
|
853
806
|
case "roleRemove":
|
|
@@ -856,14 +809,14 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
856
809
|
cfg,
|
|
857
810
|
accountId,
|
|
858
811
|
values: params,
|
|
859
|
-
mutate:
|
|
812
|
+
mutate: removeRoleDiscord
|
|
860
813
|
});
|
|
861
814
|
return jsonResult({ ok: true });
|
|
862
815
|
case "channelInfo": {
|
|
863
816
|
if (!isActionEnabled("channelInfo")) throw new Error("Discord channel info is disabled.");
|
|
864
817
|
const channelId = readStringParam(params, "channelId", { required: true });
|
|
865
818
|
await readTargetGate.assertReadTargetAllowed({ channelId });
|
|
866
|
-
const channel = await
|
|
819
|
+
const channel = await fetchChannelInfoDiscord(channelId, withOpts());
|
|
867
820
|
return jsonResult({
|
|
868
821
|
ok: true,
|
|
869
822
|
channel
|
|
@@ -873,7 +826,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
873
826
|
if (!isActionEnabled("channelInfo")) throw new Error("Discord channel info is disabled.");
|
|
874
827
|
const guildId = readStringParam(params, "guildId", { required: true });
|
|
875
828
|
await assertGuildMetadataReadAllowed(guildId, { filteredResults: true });
|
|
876
|
-
const channels = await
|
|
829
|
+
const channels = await listGuildChannelsDiscord(guildId, withOpts());
|
|
877
830
|
const visibleChannels = await readTargetGate.filterGuildChannelList({
|
|
878
831
|
guildId,
|
|
879
832
|
channels
|
|
@@ -888,7 +841,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
888
841
|
const guildId = readStringParam(params, "guildId", { required: true });
|
|
889
842
|
await assertGuildMetadataReadAllowed(guildId);
|
|
890
843
|
const userId = readStringParam(params, "userId", { required: true });
|
|
891
|
-
const voice = await
|
|
844
|
+
const voice = await fetchVoiceStatusDiscord(guildId, userId, withOpts());
|
|
892
845
|
return jsonResult({
|
|
893
846
|
ok: true,
|
|
894
847
|
voice
|
|
@@ -898,7 +851,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
898
851
|
if (!isActionEnabled("events")) throw new Error("Discord events are disabled.");
|
|
899
852
|
const guildId = readStringParam(params, "guildId", { required: true });
|
|
900
853
|
await assertGuildMetadataReadAllowed(guildId);
|
|
901
|
-
const events = await
|
|
854
|
+
const events = await listScheduledEventsDiscord(guildId, withOpts());
|
|
902
855
|
return jsonResult({
|
|
903
856
|
ok: true,
|
|
904
857
|
events
|
|
@@ -916,8 +869,8 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
916
869
|
const imageUrl = readStringParam(params, "image", { trim: false });
|
|
917
870
|
const entityTypeRaw = readStringParam(params, "entityType");
|
|
918
871
|
const entityType = entityTypeRaw === "stage" ? 1 : entityTypeRaw === "external" ? 3 : 2;
|
|
919
|
-
const image = imageUrl ? await
|
|
920
|
-
const
|
|
872
|
+
const image = imageUrl ? await resolveEventCoverImage(imageUrl, mediaPolicyOptions) : void 0;
|
|
873
|
+
const event = await createScheduledEventDiscord(guildId, {
|
|
921
874
|
name,
|
|
922
875
|
description,
|
|
923
876
|
scheduled_start_time: startTime,
|
|
@@ -927,8 +880,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
927
880
|
entity_metadata: entityType === 3 && location ? { location } : void 0,
|
|
928
881
|
image,
|
|
929
882
|
privacy_level: 2
|
|
930
|
-
};
|
|
931
|
-
const event = await discordGuildActionRuntime.createScheduledEventDiscord(guildId, payload, withOpts());
|
|
883
|
+
}, withOpts());
|
|
932
884
|
return jsonResult({
|
|
933
885
|
ok: true,
|
|
934
886
|
event
|
|
@@ -936,7 +888,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
936
888
|
}
|
|
937
889
|
case "channelCreate": {
|
|
938
890
|
if (!isActionEnabled("channels")) throw new Error("Discord channel management is disabled.");
|
|
939
|
-
const channel = await
|
|
891
|
+
const channel = await createChannelDiscord(readDiscordChannelCreateParams(params), withOpts());
|
|
940
892
|
return jsonResult({
|
|
941
893
|
ok: true,
|
|
942
894
|
channel
|
|
@@ -944,7 +896,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
944
896
|
}
|
|
945
897
|
case "channelEdit": {
|
|
946
898
|
if (!isActionEnabled("channels")) throw new Error("Discord channel management is disabled.");
|
|
947
|
-
const channel = await
|
|
899
|
+
const channel = await editChannelDiscord(readDiscordChannelEditParams(params), withOpts());
|
|
948
900
|
return jsonResult({
|
|
949
901
|
ok: true,
|
|
950
902
|
channel
|
|
@@ -953,19 +905,19 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
953
905
|
case "channelDelete": {
|
|
954
906
|
if (!isActionEnabled("channels")) throw new Error("Discord channel management is disabled.");
|
|
955
907
|
const channelId = readStringParam(params, "channelId", { required: true });
|
|
956
|
-
const result = await
|
|
908
|
+
const result = await deleteChannelDiscord(channelId, withOpts());
|
|
957
909
|
return jsonResult(result);
|
|
958
910
|
}
|
|
959
911
|
case "channelMove":
|
|
960
912
|
if (!isActionEnabled("channels")) throw new Error("Discord channel management is disabled.");
|
|
961
|
-
await
|
|
913
|
+
await moveChannelDiscord(readDiscordChannelMoveParams(params), withOpts());
|
|
962
914
|
return jsonResult({ ok: true });
|
|
963
915
|
case "categoryCreate": {
|
|
964
916
|
if (!isActionEnabled("channels")) throw new Error("Discord channel management is disabled.");
|
|
965
917
|
const guildId = readStringParam(params, "guildId", { required: true });
|
|
966
918
|
const name = readStringParam(params, "name", { required: true });
|
|
967
919
|
const position = readNonNegativeIntegerParam(params, "position");
|
|
968
|
-
const channel = await
|
|
920
|
+
const channel = await createChannelDiscord({
|
|
969
921
|
guildId,
|
|
970
922
|
name,
|
|
971
923
|
type: 4,
|
|
@@ -981,7 +933,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
981
933
|
const categoryId = readStringParam(params, "categoryId", { required: true });
|
|
982
934
|
const name = readStringParam(params, "name");
|
|
983
935
|
const position = readNonNegativeIntegerParam(params, "position");
|
|
984
|
-
const channel = await
|
|
936
|
+
const channel = await editChannelDiscord({
|
|
985
937
|
channelId: categoryId,
|
|
986
938
|
name: name ?? void 0,
|
|
987
939
|
position: position ?? void 0
|
|
@@ -994,7 +946,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
994
946
|
case "categoryDelete": {
|
|
995
947
|
if (!isActionEnabled("channels")) throw new Error("Discord channel management is disabled.");
|
|
996
948
|
const categoryId = readStringParam(params, "categoryId", { required: true });
|
|
997
|
-
const result = await
|
|
949
|
+
const result = await deleteChannelDiscord(categoryId, withOpts());
|
|
998
950
|
return jsonResult(result);
|
|
999
951
|
}
|
|
1000
952
|
case "channelPermissionSet": {
|
|
@@ -1003,7 +955,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
1003
955
|
const targetType = readStringParam(params, "targetType", { required: true }) === "member" ? 1 : 0;
|
|
1004
956
|
const allow = readStringParam(params, "allow");
|
|
1005
957
|
const deny = readStringParam(params, "deny");
|
|
1006
|
-
await
|
|
958
|
+
await setChannelPermissionDiscord({
|
|
1007
959
|
channelId,
|
|
1008
960
|
targetId,
|
|
1009
961
|
targetType,
|
|
@@ -1015,7 +967,7 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
1015
967
|
case "channelPermissionRemove": {
|
|
1016
968
|
if (!isActionEnabled("channels")) throw new Error("Discord channel management is disabled.");
|
|
1017
969
|
const { channelId, targetId } = readChannelPermissionTarget(params);
|
|
1018
|
-
await
|
|
970
|
+
await removeChannelPermissionDiscord(channelId, targetId, withOpts());
|
|
1019
971
|
return jsonResult({ ok: true });
|
|
1020
972
|
}
|
|
1021
973
|
default: throw new Error(`Unknown action: ${action}`);
|
|
@@ -1051,7 +1003,7 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1051
1003
|
if (!ctx.isActionEnabled("permissions")) throw new Error("Discord permissions are disabled.");
|
|
1052
1004
|
const channelId = ctx.resolveChannelId();
|
|
1053
1005
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1054
|
-
const permissions = await
|
|
1006
|
+
const permissions = await fetchChannelPermissionsDiscord(channelId, ctx.withOpts());
|
|
1055
1007
|
return jsonResult({
|
|
1056
1008
|
ok: true,
|
|
1057
1009
|
permissions
|
|
@@ -1074,7 +1026,7 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1074
1026
|
guildId,
|
|
1075
1027
|
channelId
|
|
1076
1028
|
});
|
|
1077
|
-
const message = await
|
|
1029
|
+
const message = await fetchMessageDiscord(channelId, messageId, ctx.withOpts());
|
|
1078
1030
|
return jsonResult({
|
|
1079
1031
|
ok: true,
|
|
1080
1032
|
message: ctx.normalizeMessage(message),
|
|
@@ -1087,13 +1039,14 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1087
1039
|
if (!ctx.isActionEnabled("messages")) throw new Error("Discord message reads are disabled.");
|
|
1088
1040
|
const channelId = ctx.resolveChannelId();
|
|
1089
1041
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1042
|
+
const messageId = readStringParam(ctx.params, "messageId");
|
|
1090
1043
|
const query = {
|
|
1091
1044
|
limit: readPositiveIntegerParam(ctx.params, "limit"),
|
|
1092
1045
|
before: readStringParam(ctx.params, "before"),
|
|
1093
1046
|
after: readStringParam(ctx.params, "after"),
|
|
1094
1047
|
around: readStringParam(ctx.params, "around")
|
|
1095
1048
|
};
|
|
1096
|
-
const messages = assertDiscordMessageListResult(await
|
|
1049
|
+
const messages = messageId ? [await fetchMessageDiscord(channelId, messageId, ctx.withOpts())] : assertDiscordMessageListResult(await readMessagesDiscord(channelId, query, ctx.withOpts()));
|
|
1097
1050
|
return jsonResult({
|
|
1098
1051
|
ok: true,
|
|
1099
1052
|
channelId,
|
|
@@ -1110,7 +1063,7 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1110
1063
|
trim: false
|
|
1111
1064
|
});
|
|
1112
1065
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1113
|
-
const message = await
|
|
1066
|
+
const message = await editMessageDiscord(channelId, messageId, { content }, ctx.withOpts());
|
|
1114
1067
|
return jsonResult({
|
|
1115
1068
|
ok: true,
|
|
1116
1069
|
message
|
|
@@ -1121,7 +1074,7 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1121
1074
|
const channelId = ctx.resolveChannelId();
|
|
1122
1075
|
const messageId = readStringParam(ctx.params, "messageId", { required: true });
|
|
1123
1076
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1124
|
-
await
|
|
1077
|
+
await deleteMessageDiscord(channelId, messageId, ctx.withOpts());
|
|
1125
1078
|
return jsonResult({ ok: true });
|
|
1126
1079
|
}
|
|
1127
1080
|
case "pinMessage": {
|
|
@@ -1129,7 +1082,7 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1129
1082
|
const channelId = ctx.resolveChannelId();
|
|
1130
1083
|
const messageId = readStringParam(ctx.params, "messageId", { required: true });
|
|
1131
1084
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1132
|
-
await
|
|
1085
|
+
await pinMessageDiscord(channelId, messageId, ctx.withOpts());
|
|
1133
1086
|
return jsonResult({ ok: true });
|
|
1134
1087
|
}
|
|
1135
1088
|
case "unpinMessage": {
|
|
@@ -1137,14 +1090,14 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1137
1090
|
const channelId = ctx.resolveChannelId();
|
|
1138
1091
|
const messageId = readStringParam(ctx.params, "messageId", { required: true });
|
|
1139
1092
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1140
|
-
await
|
|
1093
|
+
await unpinMessageDiscord(channelId, messageId, ctx.withOpts());
|
|
1141
1094
|
return jsonResult({ ok: true });
|
|
1142
1095
|
}
|
|
1143
1096
|
case "listPins": {
|
|
1144
1097
|
if (!ctx.isActionEnabled("pins")) throw new Error("Discord pins are disabled.");
|
|
1145
1098
|
const channelId = ctx.resolveChannelId();
|
|
1146
1099
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1147
|
-
const pins = await
|
|
1100
|
+
const pins = await listPinsDiscord(channelId, ctx.withOpts());
|
|
1148
1101
|
return jsonResult({
|
|
1149
1102
|
ok: true,
|
|
1150
1103
|
pins: pins.map((pin) => ctx.normalizeMessage(pin))
|
|
@@ -1160,8 +1113,8 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1160
1113
|
if (!guildId) {
|
|
1161
1114
|
const rawInferChannelId = channelId ?? channelIds?.[0];
|
|
1162
1115
|
if (rawInferChannelId) try {
|
|
1163
|
-
const inferChannelId =
|
|
1164
|
-
const channelInfo = await
|
|
1116
|
+
const inferChannelId = resolveDiscordChannelId(rawInferChannelId);
|
|
1117
|
+
const channelInfo = await fetchChannelInfoDiscord(inferChannelId, ctx.withOpts());
|
|
1165
1118
|
if (isRecord(channelInfo)) {
|
|
1166
1119
|
const resolved = channelInfo.guild_id ?? channelInfo.guildId;
|
|
1167
1120
|
if (typeof resolved === "string" && resolved.trim()) guildId = resolved.trim();
|
|
@@ -1172,14 +1125,14 @@ async function handleDiscordMessageManagementAction(ctx) {
|
|
|
1172
1125
|
const authorId = readStringParam(ctx.params, "authorId");
|
|
1173
1126
|
const authorIds = readStringArrayParam(ctx.params, "authorIds");
|
|
1174
1127
|
const limit = readPositiveIntegerParam(ctx.params, "limit");
|
|
1175
|
-
const channelIdList = [...(channelIds ?? []).map((id) =>
|
|
1128
|
+
const channelIdList = [...(channelIds ?? []).map((id) => resolveDiscordChannelId(id)), ...channelId ? [resolveDiscordChannelId(channelId)] : []];
|
|
1176
1129
|
if (channelIdList.length > 0) for (const targetChannelId of channelIdList) await ctx.assertReadTargetAllowed({
|
|
1177
1130
|
guildId,
|
|
1178
1131
|
channelId: targetChannelId
|
|
1179
1132
|
});
|
|
1180
1133
|
else await ctx.assertGuildReadTargetAllowed({ guildId });
|
|
1181
1134
|
const authorIdList = [...authorIds ?? [], ...authorId ? [authorId] : []];
|
|
1182
|
-
const results = await
|
|
1135
|
+
const results = await searchMessagesDiscord({
|
|
1183
1136
|
guildId,
|
|
1184
1137
|
content,
|
|
1185
1138
|
channelIds: channelIdList.length ? channelIdList : void 0,
|
|
@@ -1214,7 +1167,7 @@ async function handleDiscordReactionMessagingAction(ctx) {
|
|
|
1214
1167
|
const { emoji, remove, isEmpty } = readReactionParams(ctx.params, { removeErrorMessage: "Emoji is required to remove a Discord reaction." });
|
|
1215
1168
|
if (remove) {
|
|
1216
1169
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1217
|
-
await
|
|
1170
|
+
await removeReactionDiscord(channelId, messageId, emoji, ctx.withReactionRuntimeOptions());
|
|
1218
1171
|
return jsonResult({
|
|
1219
1172
|
ok: true,
|
|
1220
1173
|
removed: emoji
|
|
@@ -1222,14 +1175,14 @@ async function handleDiscordReactionMessagingAction(ctx) {
|
|
|
1222
1175
|
}
|
|
1223
1176
|
if (isEmpty) {
|
|
1224
1177
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1225
|
-
const removed = await
|
|
1178
|
+
const removed = await removeOwnReactionsDiscord(channelId, messageId, ctx.withReactionRuntimeOptions());
|
|
1226
1179
|
return jsonResult({
|
|
1227
1180
|
ok: true,
|
|
1228
1181
|
removed: removed.removed
|
|
1229
1182
|
});
|
|
1230
1183
|
}
|
|
1231
1184
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1232
|
-
await
|
|
1185
|
+
await reactMessageDiscord(channelId, messageId, emoji, ctx.withReactionRuntimeOptions());
|
|
1233
1186
|
return jsonResult({
|
|
1234
1187
|
ok: true,
|
|
1235
1188
|
added: emoji
|
|
@@ -1241,7 +1194,7 @@ async function handleDiscordReactionMessagingAction(ctx) {
|
|
|
1241
1194
|
const messageId = readStringParam(ctx.params, "messageId", { required: true });
|
|
1242
1195
|
const limit = readPositiveIntegerParam(ctx.params, "limit");
|
|
1243
1196
|
await ctx.assertReadTargetAllowed({ channelId });
|
|
1244
|
-
const reactions = await
|
|
1197
|
+
const reactions = await fetchReactionsDiscord(channelId, messageId, ctx.withReactionRuntimeOptions({ limit }));
|
|
1245
1198
|
return jsonResult({
|
|
1246
1199
|
ok: true,
|
|
1247
1200
|
reactions
|
|
@@ -1302,7 +1255,7 @@ async function appendDiscordThreadRenameResult(ctx, params) {
|
|
|
1302
1255
|
};
|
|
1303
1256
|
let channelId;
|
|
1304
1257
|
try {
|
|
1305
|
-
channelId =
|
|
1258
|
+
channelId = resolveDiscordChannelId(params.target);
|
|
1306
1259
|
} catch {
|
|
1307
1260
|
return {
|
|
1308
1261
|
...params.payload,
|
|
@@ -1310,12 +1263,12 @@ async function appendDiscordThreadRenameResult(ctx, params) {
|
|
|
1310
1263
|
};
|
|
1311
1264
|
}
|
|
1312
1265
|
try {
|
|
1313
|
-
const channel = await
|
|
1266
|
+
const channel = await fetchChannelInfoDiscord(channelId, ctx.withOpts());
|
|
1314
1267
|
if (!isDiscordThreadChannelType(channel.type)) return {
|
|
1315
1268
|
...params.payload,
|
|
1316
1269
|
warning: "Discord threadName was ignored because the send target is not a thread."
|
|
1317
1270
|
};
|
|
1318
|
-
const renamed = await
|
|
1271
|
+
const renamed = await editChannelDiscord({
|
|
1319
1272
|
channelId,
|
|
1320
1273
|
name: threadName
|
|
1321
1274
|
}, ctx.withOpts());
|
|
@@ -1344,7 +1297,7 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1344
1297
|
required: true,
|
|
1345
1298
|
label: "stickerIds"
|
|
1346
1299
|
});
|
|
1347
|
-
const result = await
|
|
1300
|
+
const result = await sendStickerDiscord(to, stickerIds, ctx.withOpts({
|
|
1348
1301
|
content,
|
|
1349
1302
|
...ctx.params.silent === true ? { silent: true } : {}
|
|
1350
1303
|
}));
|
|
@@ -1360,7 +1313,7 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1360
1313
|
const silent = ctx.params.silent === true;
|
|
1361
1314
|
const suppressEmbeds = ctx.params.suppressEmbeds === void 0 ? void 0 : ctx.params.suppressEmbeds === true;
|
|
1362
1315
|
const rawComponents = coerceDiscordComponentParam(ctx.params.components);
|
|
1363
|
-
const componentSpec = hasDiscordComponentObjectKeys(rawComponents) ?
|
|
1316
|
+
const componentSpec = hasDiscordComponentObjectKeys(rawComponents) ? readDiscordComponentSpec(rawComponents) : null;
|
|
1364
1317
|
const components = Array.isArray(rawComponents) || typeof rawComponents === "function" ? rawComponents : void 0;
|
|
1365
1318
|
const mediaUrl = readStringParam(ctx.params, "mediaUrl", { trim: false }) ?? readStringParam(ctx.params, "path", { trim: false }) ?? readStringParam(ctx.params, "filePath", { trim: false });
|
|
1366
1319
|
const rawEmbeds = ctx.params.embeds;
|
|
@@ -1383,7 +1336,7 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1383
1336
|
...componentSpec,
|
|
1384
1337
|
text: normalizedContent
|
|
1385
1338
|
};
|
|
1386
|
-
const result = await
|
|
1339
|
+
const result = await sendDiscordComponentMessage(to, payload, {
|
|
1387
1340
|
...ctx.withOpts(),
|
|
1388
1341
|
silent,
|
|
1389
1342
|
reply: resolveActionReplyReference(ctx, replyTo),
|
|
@@ -1410,7 +1363,7 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1410
1363
|
if (!mediaUrl) throw new Error("Voice messages require a media file reference (mediaUrl, path, or filePath).");
|
|
1411
1364
|
if (content && content.trim()) throw new Error("Voice messages cannot include text content (Discord limitation). Remove the content parameter.");
|
|
1412
1365
|
assertMediaNotDataUrl(mediaUrl);
|
|
1413
|
-
const result = await
|
|
1366
|
+
const result = await sendVoiceMessageDiscord(to, mediaUrl, {
|
|
1414
1367
|
...ctx.withOpts(),
|
|
1415
1368
|
reply: resolveActionReplyReference(ctx, replyTo),
|
|
1416
1369
|
silent,
|
|
@@ -1428,7 +1381,7 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1428
1381
|
threadName
|
|
1429
1382
|
}));
|
|
1430
1383
|
}
|
|
1431
|
-
const result = await
|
|
1384
|
+
const result = await sendMessageDiscord(to, content ?? "", {
|
|
1432
1385
|
...ctx.withOpts(),
|
|
1433
1386
|
mediaAccess: ctx.options?.mediaAccess,
|
|
1434
1387
|
mediaUrl,
|
|
@@ -1464,7 +1417,7 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1464
1417
|
appliedTags: readStringArrayParam(ctx.params, "appliedTags") ?? void 0
|
|
1465
1418
|
};
|
|
1466
1419
|
try {
|
|
1467
|
-
const thread = await
|
|
1420
|
+
const thread = await createThreadDiscord(channelId, payload, ctx.withOpts());
|
|
1468
1421
|
return jsonResult({
|
|
1469
1422
|
ok: true,
|
|
1470
1423
|
thread
|
|
@@ -1499,7 +1452,7 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1499
1452
|
guildId,
|
|
1500
1453
|
channelTargetRequiredMessage: "Discord active thread lists require a wildcard channel allowlist so each read target can be authorized."
|
|
1501
1454
|
});
|
|
1502
|
-
const threads = await
|
|
1455
|
+
const threads = await listThreadsDiscord({
|
|
1503
1456
|
guildId,
|
|
1504
1457
|
channelId,
|
|
1505
1458
|
includeArchived,
|
|
@@ -1524,7 +1477,7 @@ async function handleDiscordMessageSendAction(ctx) {
|
|
|
1524
1477
|
});
|
|
1525
1478
|
const mediaUrl = readStringParam(ctx.params, "mediaUrl");
|
|
1526
1479
|
const replyTo = readStringParam(ctx.params, "replyTo");
|
|
1527
|
-
const result = await
|
|
1480
|
+
const result = await sendMessageDiscord(`channel:${channelId}`, content, {
|
|
1528
1481
|
...ctx.withOpts(),
|
|
1529
1482
|
mediaUrl,
|
|
1530
1483
|
mediaAccess: ctx.options?.mediaAccess,
|
|
@@ -1588,7 +1541,7 @@ function readDiscordModerationCommand(action, params) {
|
|
|
1588
1541
|
//#region extensions/discord/src/actions/runtime.moderation.ts
|
|
1589
1542
|
async function verifySenderModerationPermission(params) {
|
|
1590
1543
|
if (!params.senderUserId) return;
|
|
1591
|
-
if (!await
|
|
1544
|
+
if (!await hasAnyGuildPermissionDiscord(params.guildId, params.senderUserId, [params.requiredPermission], createDiscordActionOptions({
|
|
1592
1545
|
cfg: params.cfg,
|
|
1593
1546
|
accountId: params.accountId
|
|
1594
1547
|
}))) throw new Error("Sender does not have required permissions for this moderation action.");
|
|
@@ -1613,7 +1566,7 @@ async function handleDiscordModerationAction(action, params, isActionEnabled, cf
|
|
|
1613
1566
|
});
|
|
1614
1567
|
switch (command.action) {
|
|
1615
1568
|
case "timeout": {
|
|
1616
|
-
const member = await
|
|
1569
|
+
const member = await timeoutMemberDiscord({
|
|
1617
1570
|
guildId: command.guildId,
|
|
1618
1571
|
userId: command.userId,
|
|
1619
1572
|
durationMinutes: command.durationMinutes,
|
|
@@ -1626,14 +1579,14 @@ async function handleDiscordModerationAction(action, params, isActionEnabled, cf
|
|
|
1626
1579
|
});
|
|
1627
1580
|
}
|
|
1628
1581
|
case "kick":
|
|
1629
|
-
await
|
|
1582
|
+
await kickMemberDiscord({
|
|
1630
1583
|
guildId: command.guildId,
|
|
1631
1584
|
userId: command.userId,
|
|
1632
1585
|
reason: command.reason
|
|
1633
1586
|
}, withOpts());
|
|
1634
1587
|
return jsonResult({ ok: true });
|
|
1635
1588
|
case "ban":
|
|
1636
|
-
await
|
|
1589
|
+
await banMemberDiscord({
|
|
1637
1590
|
guildId: command.guildId,
|
|
1638
1591
|
userId: command.userId,
|
|
1639
1592
|
reason: command.reason,
|