@openclaw/feishu 2026.9.4 → 2026.9.6
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 +3 -0
- package/assets/icon.png +0 -0
- package/dist/{accounts-cCMNFBKg.js → .setup/accounts-DmU0xYPx.mjs} +1 -1
- package/dist/{app-registration-BI99e_JI.js → .setup/app-registration-Bv4mvauR.mjs} +1 -1
- package/dist/{channel-HDnQAH4Z.js → .setup/channel-DsndN1sp.mjs} +93 -86
- package/dist/{channel.runtime-B-f6ajOp.js → .setup/channel.runtime-tihKUwVI.mjs} +32 -18
- package/dist/{chat-zhIPXu4X.js → .setup/chat-BlvUjdN9.mjs} +2 -2
- package/dist/{client-DMbIL3UH.js → .setup/client-DCwNVFZg.mjs} +128 -11
- package/dist/{conversation-id-VYgGQ-GX.js → .setup/conversation-id-H-lUayji.mjs} +49 -14
- package/dist/{monitor-EuNsFn2T.js → .setup/monitor-OTT7VckU.mjs} +7 -6
- package/dist/{monitor.account-CZ7EtqYS.js → .setup/monitor.account-D5j6WomE.mjs} +297 -127
- package/dist/{probe-D_SatdZl.js → .setup/probe-bdidyhAn.mjs} +2 -2
- package/dist/{reply-delivery-result-C3smdVzb.js → .setup/reply-delivery-result-CRIHpSze.mjs} +136 -118
- package/dist/.setup/runtime-setter-api-CG-RC4_r.mjs +3 -0
- package/dist/.setup/secret-contract-api-jmCkqVLc.mjs +3 -0
- package/dist/{security-audit-DKfR4Cv3.js → .setup/security-audit-CmiKKfU-.mjs} +1 -1
- package/dist/{session-conversation-DFCIvQK-.js → .setup/session-conversation-ZC6TC1zk.mjs} +1 -1
- package/dist/.setup/setup-api-VAUkwtTi.mjs +3 -0
- package/dist/{subagent-hooks-Buadpie_.js → .setup/subagent-hooks-BBfF1hZk.mjs} +3 -19
- package/dist/api.js +29 -15
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +3 -3
- package/dist/doctor-contract-api.js +1 -1
- package/dist/runtime-api.js +1 -1
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-api.js +1 -1
- package/dist/setup-entry.js +4 -3
- package/dist/subagent-hooks-api.js +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/es/index.js +199 -35
- package/node_modules/@larksuiteoapi/node-sdk/lib/index.js +199 -35
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/CHANGELOG.md +62 -0
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/README.md +233 -5
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/dist/axios.js +387 -89
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/dist/browser/axios.cjs +458 -98
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/dist/esm/axios.js +458 -98
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/dist/node/axios.cjs +568 -116
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/index.d.cts +4 -0
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/index.d.ts +4 -0
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/adapters/fetch.js +64 -11
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/adapters/http.js +134 -50
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/adapters/xhr.js +52 -3
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/core/Axios.js +19 -14
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/core/InterceptorManager.js +107 -8
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/core/buildFullPath.js +1 -13
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/core/dispatchRequest.js +8 -2
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/core/mergeConfig.js +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/core/methodList.js +17 -0
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/defaults/index.js +2 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/Http2Sessions.js +2 -0
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/HttpStatusCode.js +11 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/fromDataURI.js +5 -4
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/progressEventReducer.js +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/resolveConfig.js +4 -2
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/shouldBypassProxy.js +182 -6
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/throttle.js +3 -2
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/toFormData.js +14 -21
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/utils.js +134 -13
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/package.json +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/README.md +24 -17
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/dist/light/protobuf.js +124 -14
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/dist/minimal/protobuf.js +63 -9
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/dist/protobuf.js +133 -18
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/ext/descriptor.generated.d.ts +7 -0
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/ext/descriptor.js +24 -0
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/ext/protojson.js +14 -4
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/ext/textformat.js +8 -4
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/google/protobuf/descriptor.json +20 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/google/protobuf/descriptor.proto +14 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/index.d.ts +12 -0
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/package.json +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/src/decoder.js +31 -2
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/src/enum.js +10 -0
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/src/object.js +5 -2
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/src/parse.js +9 -4
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/src/reader.js +61 -7
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/src/type.js +10 -0
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/protobufjs/src/wrappers.js +5 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/qs/.github/THREAT_MODEL.md +3 -3
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/qs/CHANGELOG.md +15 -0
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/qs/README.md +19 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/qs/dist/qs.js +21 -21
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/qs/eslint.config.mjs +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/qs/lib/parse.js +3 -4
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/qs/lib/stringify.js +23 -8
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/qs/lib/utils.js +10 -3
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/qs/package.json +4 -4
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/qs/test/parse.js +192 -3
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/qs/test/stringify.js +317 -0
- package/node_modules/@larksuiteoapi/node-sdk/node_modules/qs/test/utils.js +12 -0
- package/node_modules/@larksuiteoapi/node-sdk/package.json +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/types/index.d.ts +35 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.d.ts +13 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.d.ts.map +1 -1
- package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.js +35 -16
- package/node_modules/micromark-extension-gfm-table/dev/lib/html.js +5 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/syntax.js +26 -3
- package/node_modules/micromark-extension-gfm-table/lib/edit-map.d.ts +13 -0
- package/node_modules/micromark-extension-gfm-table/lib/edit-map.d.ts.map +1 -1
- package/node_modules/micromark-extension-gfm-table/lib/edit-map.js +37 -17
- package/node_modules/micromark-extension-gfm-table/lib/html.js +5 -0
- package/node_modules/micromark-extension-gfm-table/lib/syntax.js +29 -2
- package/node_modules/micromark-extension-gfm-table/package.json +6 -48
- package/node_modules/micromark-extension-gfm-table/readme.md +40 -40
- 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/zod/README.md +29 -2
- package/node_modules/zod/compile.cjs +96 -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 +21 -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/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +20 -8
- 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/helpers/errorUtil.ts +1 -1
- 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 +14 -9
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +363 -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 +640 -375
- 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 +186 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +36 -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 +3 -3
- 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 +985 -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 +261 -13
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +20 -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 +403 -6
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +582 -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/iban.test.ts +81 -0
- 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 +319 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +67 -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 +215 -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 +85 -9
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +301 -12
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -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/prefault.test.ts +70 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- 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 +79 -3
- 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/standard-schema.test.ts +19 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +222 -6
- 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 +44 -3
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1812 -204
- 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 +645 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
- package/node_modules/zod/src/v4/core/api.ts +87 -35
- package/node_modules/zod/src/v4/core/checks.ts +119 -146
- package/node_modules/zod/src/v4/core/compile.ts +2313 -0
- package/node_modules/zod/src/v4/core/core.ts +99 -22
- package/node_modules/zod/src/v4/core/doc.ts +17 -9
- package/node_modules/zod/src/v4/core/errors.ts +113 -25
- package/node_modules/zod/src/v4/core/index.ts +3 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +8 -3
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +424 -156
- package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
- package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
- package/node_modules/zod/src/v4/core/parse.ts +164 -50
- package/node_modules/zod/src/v4/core/regexes.ts +42 -15
- package/node_modules/zod/src/v4/core/registries.ts +2 -2
- package/node_modules/zod/src/v4/core/schemas.ts +1000 -538
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -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 +2036 -0
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -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/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -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 +133 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +283 -48
- package/node_modules/zod/src/v4/core/util.ts +454 -157
- 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 +5 -0
- package/node_modules/zod/src/v4/locales/az.ts +5 -0
- package/node_modules/zod/src/v4/locales/be.ts +12 -0
- package/node_modules/zod/src/v4/locales/bg.ts +5 -0
- package/node_modules/zod/src/v4/locales/bn.ts +123 -0
- package/node_modules/zod/src/v4/locales/ca.ts +5 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
- package/node_modules/zod/src/v4/locales/cs.ts +5 -0
- package/node_modules/zod/src/v4/locales/da.ts +7 -2
- package/node_modules/zod/src/v4/locales/de.ts +5 -0
- package/node_modules/zod/src/v4/locales/el.ts +3 -0
- package/node_modules/zod/src/v4/locales/en.ts +17 -4
- package/node_modules/zod/src/v4/locales/eo.ts +5 -0
- package/node_modules/zod/src/v4/locales/es.ts +4 -0
- package/node_modules/zod/src/v4/locales/fa.ts +5 -0
- package/node_modules/zod/src/v4/locales/fi.ts +5 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +5 -0
- package/node_modules/zod/src/v4/locales/fr.ts +21 -14
- package/node_modules/zod/src/v4/locales/gu.ts +123 -0
- package/node_modules/zod/src/v4/locales/he.ts +8 -1
- package/node_modules/zod/src/v4/locales/hi.ts +126 -0
- package/node_modules/zod/src/v4/locales/hr.ts +4 -0
- package/node_modules/zod/src/v4/locales/hu.ts +5 -0
- package/node_modules/zod/src/v4/locales/hy.ts +11 -0
- package/node_modules/zod/src/v4/locales/id.ts +5 -0
- package/node_modules/zod/src/v4/locales/index.ts +11 -0
- package/node_modules/zod/src/v4/locales/is.ts +5 -0
- package/node_modules/zod/src/v4/locales/it.ts +5 -0
- package/node_modules/zod/src/v4/locales/ja.ts +5 -0
- package/node_modules/zod/src/v4/locales/ka.ts +5 -0
- package/node_modules/zod/src/v4/locales/km.ts +5 -0
- package/node_modules/zod/src/v4/locales/kn.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +5 -0
- package/node_modules/zod/src/v4/locales/lt.ts +4 -0
- package/node_modules/zod/src/v4/locales/mk.ts +5 -0
- package/node_modules/zod/src/v4/locales/ms.ts +5 -0
- package/node_modules/zod/src/v4/locales/ne.ts +128 -0
- package/node_modules/zod/src/v4/locales/nl.ts +5 -0
- package/node_modules/zod/src/v4/locales/nn.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +7 -2
- package/node_modules/zod/src/v4/locales/ota.ts +5 -0
- package/node_modules/zod/src/v4/locales/pl.ts +5 -0
- package/node_modules/zod/src/v4/locales/ps.ts +5 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
- package/node_modules/zod/src/v4/locales/pt.ts +101 -58
- package/node_modules/zod/src/v4/locales/ro.ts +3 -0
- package/node_modules/zod/src/v4/locales/ru.ts +12 -0
- package/node_modules/zod/src/v4/locales/sk.ts +123 -0
- package/node_modules/zod/src/v4/locales/sl.ts +5 -0
- package/node_modules/zod/src/v4/locales/sv.ts +7 -2
- package/node_modules/zod/src/v4/locales/ta.ts +5 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +5 -0
- package/node_modules/zod/src/v4/locales/tk.ts +113 -0
- package/node_modules/zod/src/v4/locales/tr.ts +5 -0
- package/node_modules/zod/src/v4/locales/uk.ts +5 -0
- package/node_modules/zod/src/v4/locales/ur.ts +5 -0
- package/node_modules/zod/src/v4/locales/uz.ts +3 -0
- package/node_modules/zod/src/v4/locales/vi.ts +5 -0
- package/node_modules/zod/src/v4/locales/yo.ts +5 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +5 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +5 -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 +12 -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 +167 -63
- 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/computed.test.ts +11 -17
- 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 +158 -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/recursive-types.test.ts +16 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +44 -0
- package/node_modules/zod/v3/ZodError.cjs +41 -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/errors.cjs +19 -0
- package/node_modules/zod/v3/external.cjs +19 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
- package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
- package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
- package/node_modules/zod/v3/helpers/util.cjs +19 -0
- package/node_modules/zod/v3/index.cjs +19 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +26 -5
- package/node_modules/zod/v3/types.js +7 -5
- package/node_modules/zod/v4/classic/checks.cjs +21 -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/coerce.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.cjs +19 -0
- 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 +58 -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 +62 -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 +51 -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 +376 -75
- package/node_modules/zod/v4/classic/from-json-schema.js +357 -75
- package/node_modules/zod/v4/classic/in-out.cjs +82 -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 +21 -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 +30 -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 +23 -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 +591 -426
- package/node_modules/zod/v4/classic/schemas.d.cts +68 -19
- package/node_modules/zod/v4/classic/schemas.d.ts +68 -19
- package/node_modules/zod/v4/classic/schemas.js +564 -424
- package/node_modules/zod/v4/core/api.cjs +66 -24
- package/node_modules/zod/v4/core/api.d.cts +22 -12
- package/node_modules/zod/v4/core/api.d.ts +22 -12
- package/node_modules/zod/v4/core/api.js +44 -24
- package/node_modules/zod/v4/core/checks.cjs +88 -128
- package/node_modules/zod/v4/core/checks.d.cts +29 -13
- package/node_modules/zod/v4/core/checks.d.ts +29 -13
- package/node_modules/zod/v4/core/checks.js +68 -127
- package/node_modules/zod/v4/core/compile.cjs +1908 -0
- package/node_modules/zod/v4/core/compile.d.cts +65 -0
- package/node_modules/zod/v4/core/compile.d.ts +65 -0
- package/node_modules/zod/v4/core/compile.js +1858 -0
- package/node_modules/zod/v4/core/core.cjs +101 -19
- 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 +83 -20
- package/node_modules/zod/v4/core/doc.cjs +31 -9
- 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 +12 -9
- package/node_modules/zod/v4/core/errors.cjs +126 -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 +107 -25
- package/node_modules/zod/v4/core/index.cjs +24 -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 +24 -1
- 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 +6 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +441 -156
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +400 -158
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- 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 +360 -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 +311 -0
- package/node_modules/zod/v4/core/parse.cjs +148 -46
- 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 +127 -45
- package/node_modules/zod/v4/core/regexes.cjs +54 -17
- package/node_modules/zod/v4/core/regexes.d.cts +5 -0
- package/node_modules/zod/v4/core/regexes.d.ts +5 -0
- package/node_modules/zod/v4/core/regexes.js +32 -15
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/registries.js +2 -2
- package/node_modules/zod/v4/core/schemas.cjs +785 -386
- package/node_modules/zod/v4/core/schemas.d.cts +123 -34
- package/node_modules/zod/v4/core/schemas.d.ts +123 -34
- package/node_modules/zod/v4/core/schemas.js +753 -386
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +269 -45
- package/node_modules/zod/v4/core/to-json-schema.d.cts +45 -5
- package/node_modules/zod/v4/core/to-json-schema.d.ts +45 -5
- package/node_modules/zod/v4/core/to-json-schema.js +247 -44
- package/node_modules/zod/v4/core/util.cjs +372 -157
- package/node_modules/zod/v4/core/util.d.cts +79 -1
- package/node_modules/zod/v4/core/util.d.ts +79 -1
- package/node_modules/zod/v4/core/util.js +341 -156
- package/node_modules/zod/v4/core/versions.cjs +21 -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 +214 -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 +34 -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 +5 -0
- package/node_modules/zod/v4/locales/ar.js +5 -0
- package/node_modules/zod/v4/locales/az.cjs +5 -0
- package/node_modules/zod/v4/locales/az.js +5 -0
- package/node_modules/zod/v4/locales/be.cjs +12 -0
- package/node_modules/zod/v4/locales/be.js +12 -0
- package/node_modules/zod/v4/locales/bg.cjs +5 -0
- package/node_modules/zod/v4/locales/bg.js +5 -0
- package/node_modules/zod/v4/locales/bn.cjs +140 -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 +113 -0
- package/node_modules/zod/v4/locales/ca.cjs +5 -0
- package/node_modules/zod/v4/locales/ca.js +5 -0
- package/node_modules/zod/v4/locales/ckb.cjs +160 -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 +133 -0
- package/node_modules/zod/v4/locales/cs.cjs +5 -0
- package/node_modules/zod/v4/locales/cs.js +5 -0
- package/node_modules/zod/v4/locales/da.cjs +7 -2
- package/node_modules/zod/v4/locales/da.js +7 -2
- package/node_modules/zod/v4/locales/de.cjs +5 -0
- package/node_modules/zod/v4/locales/de.js +5 -0
- package/node_modules/zod/v4/locales/el.cjs +3 -0
- package/node_modules/zod/v4/locales/el.js +3 -0
- package/node_modules/zod/v4/locales/en.cjs +16 -4
- package/node_modules/zod/v4/locales/en.js +16 -4
- package/node_modules/zod/v4/locales/eo.cjs +5 -0
- package/node_modules/zod/v4/locales/eo.js +5 -0
- package/node_modules/zod/v4/locales/es.cjs +4 -0
- package/node_modules/zod/v4/locales/es.js +4 -0
- package/node_modules/zod/v4/locales/fa.cjs +5 -0
- package/node_modules/zod/v4/locales/fa.js +5 -0
- package/node_modules/zod/v4/locales/fi.cjs +5 -0
- package/node_modules/zod/v4/locales/fi.js +5 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +5 -0
- package/node_modules/zod/v4/locales/fr-CA.js +5 -0
- package/node_modules/zod/v4/locales/fr.cjs +18 -14
- package/node_modules/zod/v4/locales/fr.js +18 -14
- package/node_modules/zod/v4/locales/gu.cjs +140 -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 +113 -0
- package/node_modules/zod/v4/locales/he.cjs +7 -0
- package/node_modules/zod/v4/locales/he.js +7 -0
- package/node_modules/zod/v4/locales/hi.cjs +138 -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 +111 -0
- package/node_modules/zod/v4/locales/hr.cjs +4 -0
- package/node_modules/zod/v4/locales/hr.js +4 -0
- package/node_modules/zod/v4/locales/hu.cjs +5 -0
- package/node_modules/zod/v4/locales/hu.js +5 -0
- package/node_modules/zod/v4/locales/hy.cjs +11 -0
- package/node_modules/zod/v4/locales/hy.js +11 -0
- package/node_modules/zod/v4/locales/id.cjs +5 -0
- package/node_modules/zod/v4/locales/id.js +5 -0
- package/node_modules/zod/v4/locales/index.cjs +43 -2
- package/node_modules/zod/v4/locales/index.d.cts +11 -0
- package/node_modules/zod/v4/locales/index.d.ts +11 -0
- package/node_modules/zod/v4/locales/index.js +11 -0
- package/node_modules/zod/v4/locales/is.cjs +5 -0
- package/node_modules/zod/v4/locales/is.js +5 -0
- package/node_modules/zod/v4/locales/it.cjs +5 -0
- package/node_modules/zod/v4/locales/it.js +5 -0
- package/node_modules/zod/v4/locales/ja.cjs +5 -0
- package/node_modules/zod/v4/locales/ja.js +5 -0
- package/node_modules/zod/v4/locales/ka.cjs +5 -0
- package/node_modules/zod/v4/locales/ka.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +5 -0
- package/node_modules/zod/v4/locales/km.js +5 -0
- package/node_modules/zod/v4/locales/kn.cjs +143 -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 +116 -0
- package/node_modules/zod/v4/locales/ko.cjs +5 -0
- package/node_modules/zod/v4/locales/ko.js +5 -0
- package/node_modules/zod/v4/locales/lt.cjs +4 -0
- package/node_modules/zod/v4/locales/lt.js +4 -0
- package/node_modules/zod/v4/locales/mk.cjs +5 -0
- package/node_modules/zod/v4/locales/mk.js +5 -0
- package/node_modules/zod/v4/locales/ms.cjs +5 -0
- package/node_modules/zod/v4/locales/ms.js +5 -0
- package/node_modules/zod/v4/locales/ne.cjs +138 -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 +111 -0
- package/node_modules/zod/v4/locales/nl.cjs +5 -0
- package/node_modules/zod/v4/locales/nl.js +5 -0
- package/node_modules/zod/v4/locales/nn.cjs +140 -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 +113 -0
- package/node_modules/zod/v4/locales/no.cjs +7 -2
- package/node_modules/zod/v4/locales/no.js +7 -2
- package/node_modules/zod/v4/locales/ota.cjs +5 -0
- package/node_modules/zod/v4/locales/ota.js +5 -0
- package/node_modules/zod/v4/locales/pl.cjs +5 -0
- package/node_modules/zod/v4/locales/pl.js +5 -0
- package/node_modules/zod/v4/locales/ps.cjs +5 -0
- package/node_modules/zod/v4/locales/ps.js +5 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +170 -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 +143 -0
- package/node_modules/zod/v4/locales/pt.cjs +89 -55
- package/node_modules/zod/v4/locales/pt.js +89 -55
- package/node_modules/zod/v4/locales/ro.cjs +3 -0
- package/node_modules/zod/v4/locales/ro.js +3 -0
- package/node_modules/zod/v4/locales/ru.cjs +12 -0
- package/node_modules/zod/v4/locales/ru.js +12 -0
- package/node_modules/zod/v4/locales/sk.cjs +143 -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 +116 -0
- package/node_modules/zod/v4/locales/sl.cjs +5 -0
- package/node_modules/zod/v4/locales/sl.js +5 -0
- package/node_modules/zod/v4/locales/sv.cjs +7 -2
- package/node_modules/zod/v4/locales/sv.js +7 -2
- package/node_modules/zod/v4/locales/ta.cjs +5 -0
- package/node_modules/zod/v4/locales/ta.js +5 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +5 -0
- package/node_modules/zod/v4/locales/th.js +5 -0
- package/node_modules/zod/v4/locales/tk.cjs +134 -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 +107 -0
- package/node_modules/zod/v4/locales/tr.cjs +5 -0
- package/node_modules/zod/v4/locales/tr.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +5 -0
- package/node_modules/zod/v4/locales/uk.js +5 -0
- package/node_modules/zod/v4/locales/ur.cjs +5 -0
- package/node_modules/zod/v4/locales/ur.js +5 -0
- package/node_modules/zod/v4/locales/uz.cjs +3 -0
- package/node_modules/zod/v4/locales/uz.js +3 -0
- package/node_modules/zod/v4/locales/vi.cjs +5 -0
- package/node_modules/zod/v4/locales/vi.js +5 -0
- package/node_modules/zod/v4/locales/yo.cjs +5 -0
- package/node_modules/zod/v4/locales/yo.js +5 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +5 -0
- package/node_modules/zod/v4/locales/zh-CN.js +5 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +5 -0
- package/node_modules/zod/v4/locales/zh-TW.js +5 -0
- package/node_modules/zod/v4/mini/checks.cjs +21 -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/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +58 -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 +33 -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 +82 -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/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +19 -0
- package/node_modules/zod/v4/mini/parse.cjs +22 -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 +117 -53
- package/node_modules/zod/v4/mini/schemas.d.cts +49 -14
- package/node_modules/zod/v4/mini/schemas.d.ts +49 -14
- package/node_modules/zod/v4/mini/schemas.js +92 -51
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/openclaw.plugin.json +25 -58
- package/package.json +11 -8
- package/dist/targets-BTQCYRZQ.js +0 -48
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- /package/dist/{audio-preflight.runtime-BBfC9elv.js → .setup/audio-preflight.runtime-BBfC9elv.mjs} +0 -0
- /package/dist/{doctor-contract-w6FpMypv.js → .setup/doctor-contract-w6FpMypv.mjs} +0 -0
- /package/dist/{json-response-DXajw_FU.js → .setup/json-response-DXajw_FU.mjs} +0 -0
- /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
- /package/dist/{runtime-C5JxBWZp.js → .setup/runtime-C5JxBWZp.mjs} +0 -0
- /package/dist/{secret-contract-BCpDLdg9.js → .setup/secret-contract-BCpDLdg9.mjs} +0 -0
- /package/dist/{security-audit-shared-CK5rVR-1.js → .setup/security-audit-shared-CK5rVR-1.mjs} +0 -0
- /package/dist/{thread-bindings-BiL1wGqK.js → .setup/thread-bindings-BiL1wGqK.mjs} +0 -0
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { o as resolveFeishuAccount, s as resolveFeishuRuntimeAccount } from "./accounts-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as normalizeFeishuWebhookPath, o as normalizeFeishuExternalKey } from "./doctor-contract-w6FpMypv.
|
|
5
|
-
import {
|
|
6
|
-
import { a as getFeishuUserAgent, i as createFeishuWSClient, n as createEventDispatcher, r as createFeishuClient
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { t as fetchBotIdentityForMonitor } from "./monitor-EuNsFn2T.js";
|
|
1
|
+
import { o as resolveFeishuAccount, s as resolveFeishuRuntimeAccount } from "./accounts-DmU0xYPx.mjs";
|
|
2
|
+
import { o as resolveConfiguredFeishuGroupSessionScope, t as buildFeishuConversationId, u as resolveReceiveIdType } from "./conversation-id-H-lUayji.mjs";
|
|
3
|
+
import { A as sendMessageFeishu, At as normalizeFeishuChatType, B as parsePostContent, Ct as normalizeFeishuAllowEntry, D as getMessageFeishu, Dt as resolveFeishuGroupSenderActivationIngressAccess, Et as resolveFeishuGroupConversationIngressAccess, F as isFeishuBroadcastMention, Ft as decodeFeishuCardAction, G as deliverCommentThreadText, H as buildFeishuMediaFallbackText, I as isMentionForwardRequest, L as isFeishuGroupChatType, N as formatFeishuMediaContent, Nt as buildFeishuCardActionTextFallback, O as listFeishuThreadMessages, P as extractMentionTargets, Pt as createFeishuCardInteractionEnvelope, R as normalizeFeishuEventChatType, S as sendMediaFeishu, St as hasExplicitFeishuGroupConfig, T as chunkFeishuCardMarkdown, Tt as resolveFeishuGroupConfig, U as resolveFeishuIdentityEmoji, a as shouldSendNoVisibleReplyFallback, at as requestFeishuApi, b as withinCardTableLimit, d as consumeFeishuPresentationFallbackMarker, et as createCommentTypingReactionLifecycle, ft as chunkFeishuPostMarkdown, i as noVisibleFeishuReplyDelivery, it as parseCommentContentElements, j as sendStructuredCardFeishu, jt as resolveFeishuChatType, k as sendCardFeishu, kt as resolveFeishuReplyPolicy, n as createFeishuReplyDeliveryResult, nt as extractReplyText, ot as buildFeishuCommentTarget, pt as materializeFeishuPostMarkdownSoftBreaks, r as mergeFeishuReplyDeliveryResults, st as normalizeCommentFileType, t as createFeishuPartialReplyDeliveryError, tt as encodeQuery, u as buildFeishuPresentationFallback, ut as resolveFeishuCardTemplate, v as renderFeishuReplyPayload, w as shouldSuppressFeishuTextForVoiceMedia, wt as resolveFeishuDmIngressAccess, x as saveMessageResourceFeishu, y as resolveFeishuRichReply, z as parseInteractiveCardContent } from "./reply-delivery-result-CRIHpSze.mjs";
|
|
4
|
+
import { a as normalizeFeishuWebhookPath, o as normalizeFeishuExternalKey } from "./doctor-contract-w6FpMypv.mjs";
|
|
5
|
+
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.mjs";
|
|
6
|
+
import { a as getFeishuUserAgent, f as resolveConfiguredHttpTimeoutMs, i as createFeishuWSClient, n as createEventDispatcher, r as createFeishuClient } from "./client-DCwNVFZg.mjs";
|
|
7
|
+
import { r as getChatInfo } from "./chat-BlvUjdN9.mjs";
|
|
8
|
+
import { t as createFeishuThreadBindingManager } from "./thread-bindings-BiL1wGqK.mjs";
|
|
9
|
+
import { evaluateSupplementalContextVisibility, normalizeAgentId as normalizeAgentId$1, resolveChannelContextVisibilityMode } from "../runtime-api.js";
|
|
10
|
+
import { t as readFeishuJsonResponse } from "./json-response-DXajw_FU.mjs";
|
|
11
|
+
import { a as waitForAbortableDelay, i as raceWithTimeoutAndAbort } from "./probe-bdidyhAn.mjs";
|
|
12
|
+
import { t as fetchBotIdentityForMonitor } from "./monitor-OTT7VckU.mjs";
|
|
14
13
|
import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
15
|
-
import { DEFAULT_INGRESS_ADOPTION_STALL_MS, bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor, createChannelMessageReplyPipeline, createReplyPrefixContext, formatChannelProgressDraftLineForEntry,
|
|
14
|
+
import { DEFAULT_INGRESS_ADOPTION_STALL_MS, bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor, createChannelMessageReplyPipeline, createReplyPrefixContext, formatChannelProgressDraftLineForEntry, resolveAgentOutboundIdentity, resolveChannelPreviewStreamMode, resolveChannelStreamingBlockEnabled } from "openclaw/plugin-sdk/channel-outbound";
|
|
16
15
|
import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
|
|
17
16
|
import { ensureConfiguredBindingRouteReady, resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-runtime";
|
|
18
17
|
import { collectErrorGraphCandidates, formatErrorMessage, toStringifiedError } from "openclaw/plugin-sdk/error-runtime";
|
|
19
|
-
import { asDateTimestampMs, isFutureDateTimestampMs, parseStrictNonNegativeInteger, resolveDateTimestampMs, resolveExpiresAtMsFromDurationMs, resolveExpiresAtMsFromDurationSeconds, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
18
|
+
import { asDateTimestampMs, isFutureDateTimestampMs, parseStrictNonNegativeInteger, resolveDateTimestampMs, resolveExpiresAtMsFromDurationMs, resolveExpiresAtMsFromDurationSeconds, resolvePromptHistoryLimit, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
20
19
|
import { asBoolean, asNullableRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeNullableString, normalizeOptionalLowercaseString, normalizeOptionalString, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
21
20
|
import { stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
|
|
22
21
|
import { resolveDefaultGroupPolicy, resolveOpenProviderRuntimeGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
@@ -31,12 +30,13 @@ import { getReplyPayloadTtsSupplement, resolveSendableOutboundReplyParts, resolv
|
|
|
31
30
|
import { resolvePinnedMainDmOwnerFromAllowlist, safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
32
31
|
import * as Lark from "@larksuiteoapi/node-sdk";
|
|
33
32
|
import { isRecord as isRecord$1 } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
33
|
+
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
34
34
|
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
35
35
|
import { sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
36
36
|
import { WEBHOOK_ANOMALY_COUNTER_DEFAULTS, WEBHOOK_RATE_LIMIT_DEFAULTS, applyBasicWebhookRequestGuards, createFixedWindowRateLimiter, createWebhookAnomalyTracker, resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
|
|
37
37
|
import * as crypto$1 from "node:crypto";
|
|
38
38
|
import crypto, { createHash } from "node:crypto";
|
|
39
|
-
import {
|
|
39
|
+
import { createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
40
40
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
41
41
|
import { createChannelReplayGuard } from "openclaw/plugin-sdk/persistent-dedupe";
|
|
42
42
|
import { resolveChannelConfigWrites } from "openclaw/plugin-sdk/channel-config-writes";
|
|
@@ -46,7 +46,7 @@ import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
|
|
|
46
46
|
import * as http from "node:http";
|
|
47
47
|
import { createRuntimeConfigReader } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
48
48
|
import { channelBlockedPatch, channelReadyPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
|
49
|
-
import { installRequestBodyLimitGuard, readWebhookBodyOrReject } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
49
|
+
import { createWebhookInFlightLimiter, installRequestBodyLimitGuard, readWebhookBodyOrReject, sendHttpRequestRejection } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
50
50
|
import { isAbortRequestText, isBtwRequestText } from "openclaw/plugin-sdk/command-primitives-runtime";
|
|
51
51
|
//#region extensions/feishu/src/bot-agent-body.ts
|
|
52
52
|
const MAX_MENTION_CONTEXT_NAME_LENGTH = 80;
|
|
@@ -83,7 +83,7 @@ function buildFeishuAgentBody(params) {
|
|
|
83
83
|
function createFeishuBroadcastIngressSettlement(params) {
|
|
84
84
|
const lanes = /* @__PURE__ */ new Set();
|
|
85
85
|
const failures = [];
|
|
86
|
-
const
|
|
86
|
+
const fallbackAbort = new AbortController();
|
|
87
87
|
let fanoutSettled = false;
|
|
88
88
|
let terminal;
|
|
89
89
|
let adoption;
|
|
@@ -91,6 +91,14 @@ function createFeishuBroadcastIngressSettlement(params) {
|
|
|
91
91
|
let finalizing = false;
|
|
92
92
|
let deferred = false;
|
|
93
93
|
let replayReleased = false;
|
|
94
|
+
let resolveSettlement;
|
|
95
|
+
const settlement = new Promise((resolve) => {
|
|
96
|
+
resolveSettlement = resolve;
|
|
97
|
+
});
|
|
98
|
+
params.trackTask?.(settlement);
|
|
99
|
+
const finishSettlement = () => {
|
|
100
|
+
if (![...lanes].some((lane) => lane.adopting)) resolveSettlement();
|
|
101
|
+
};
|
|
94
102
|
const beginFinalizing = () => {
|
|
95
103
|
if (finalizing) return;
|
|
96
104
|
finalizing = true;
|
|
@@ -118,6 +126,8 @@ function createFeishuBroadcastIngressSettlement(params) {
|
|
|
118
126
|
await params.lifecycle?.onAbandoned();
|
|
119
127
|
} finally {
|
|
120
128
|
terminal = "abandoned";
|
|
129
|
+
fallbackAbort.abort(error);
|
|
130
|
+
finishSettlement();
|
|
121
131
|
}
|
|
122
132
|
};
|
|
123
133
|
const abandon = async (error) => {
|
|
@@ -131,8 +141,8 @@ function createFeishuBroadcastIngressSettlement(params) {
|
|
|
131
141
|
await activeAbandonment;
|
|
132
142
|
};
|
|
133
143
|
const runAdoption = async () => {
|
|
134
|
-
beginFinalizing();
|
|
135
144
|
try {
|
|
145
|
+
beginFinalizing();
|
|
136
146
|
await params.lifecycle?.onAdopted();
|
|
137
147
|
terminal = "adopted";
|
|
138
148
|
try {
|
|
@@ -146,6 +156,8 @@ function createFeishuBroadcastIngressSettlement(params) {
|
|
|
146
156
|
} catch (error) {
|
|
147
157
|
await runAbandonment(error).catch(() => void 0);
|
|
148
158
|
throw error;
|
|
159
|
+
} finally {
|
|
160
|
+
finishSettlement();
|
|
149
161
|
}
|
|
150
162
|
};
|
|
151
163
|
const adopt = async () => {
|
|
@@ -179,18 +191,24 @@ function createFeishuBroadcastIngressSettlement(params) {
|
|
|
179
191
|
};
|
|
180
192
|
return {
|
|
181
193
|
lifecycle: {
|
|
182
|
-
abortSignal: params.lifecycle?.abortSignal ??
|
|
194
|
+
abortSignal: params.lifecycle?.abortSignal ?? fallbackAbort.signal,
|
|
183
195
|
onAdopted: async () => {
|
|
184
|
-
if (lane.status === "adopted" || lane.status === "completed" || lane.status === "failed" || lane.status === "abandoned") return;
|
|
196
|
+
if (terminal || lane.status === "adopted" || lane.status === "completed" || lane.status === "failed" || lane.status === "abandoned") return;
|
|
185
197
|
lane.status = "adopted";
|
|
186
|
-
|
|
198
|
+
lane.adopting = true;
|
|
187
199
|
try {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
200
|
+
beginFinalizing();
|
|
201
|
+
try {
|
|
202
|
+
await lane.replayClaim?.commit();
|
|
203
|
+
} catch (error) {
|
|
204
|
+
reportReplayCommitError(error);
|
|
205
|
+
}
|
|
206
|
+
lane.status = "completed";
|
|
207
|
+
await maybeSettle();
|
|
208
|
+
} finally {
|
|
209
|
+
lane.adopting = false;
|
|
210
|
+
if (terminal) finishSettlement();
|
|
191
211
|
}
|
|
192
|
-
lane.status = "completed";
|
|
193
|
-
await maybeSettle();
|
|
194
212
|
},
|
|
195
213
|
onDeferred: () => {
|
|
196
214
|
if (lane.status !== "pending") return;
|
|
@@ -198,6 +216,7 @@ function createFeishuBroadcastIngressSettlement(params) {
|
|
|
198
216
|
defer();
|
|
199
217
|
},
|
|
200
218
|
onDeferredHeartbeat: () => params.lifecycle?.onDeferredHeartbeat?.(),
|
|
219
|
+
deferredHeartbeatIntervalMs: params.lifecycle?.deferredHeartbeatIntervalMs,
|
|
201
220
|
onAdoptionFinalizing: beginFinalizing,
|
|
202
221
|
onAbandoned: async () => {
|
|
203
222
|
if (lane.status === "completed" || lane.status === "failed" || lane.status === "abandoned") return;
|
|
@@ -2585,14 +2604,14 @@ function createFeishuReplyDispatcher(params) {
|
|
|
2585
2604
|
return false;
|
|
2586
2605
|
} : void 0,
|
|
2587
2606
|
onReasoningEnd: reasoningPreviewEnabled ? () => false : void 0,
|
|
2588
|
-
|
|
2589
|
-
if (
|
|
2607
|
+
onItemEvent: previewStreamingEnabled ? (payload) => {
|
|
2608
|
+
if (payload.kind === "preamble" || payload.hideFromChannelProgress || payload.suppressChannelProgress) return false;
|
|
2609
|
+
const { kind: itemKind, ...item } = payload;
|
|
2590
2610
|
const statusLineLocal = formatChannelProgressDraftLineForEntry(account.config, {
|
|
2591
|
-
event: "
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
}, { detailMode: payload.detailMode });
|
|
2611
|
+
event: "item",
|
|
2612
|
+
itemKind,
|
|
2613
|
+
...item
|
|
2614
|
+
});
|
|
2596
2615
|
if (statusLineLocal) return updateStreamingStatusLine(statusLineLocal);
|
|
2597
2616
|
return false;
|
|
2598
2617
|
} : void 0,
|
|
@@ -2622,11 +2641,6 @@ function getFeishuSyntheticDirectPreDispatchTarget(event) {
|
|
|
2622
2641
|
//#region extensions/feishu/src/bot.ts
|
|
2623
2642
|
const permissionErrorNotifiedAt = /* @__PURE__ */ new Map();
|
|
2624
2643
|
const PERMISSION_ERROR_COOLDOWN_MS = 3e5;
|
|
2625
|
-
function shouldSendNoVisibleReplyFallback(dispatchResult) {
|
|
2626
|
-
const emptyEligibleDispatch = dispatchResult.noVisibleReplyFallbackEligible === true && dispatchResult.settledReceipt?.anyVisibleDelivered !== true;
|
|
2627
|
-
const finalFailedBeforeSend = (dispatchResult.settledReceipt?.counts.final.failedBeforeSend ?? 0) > 0;
|
|
2628
|
-
return dispatchResult.sendPolicyDenied !== true && dispatchResult.sourceReplyDeliveryMode !== "message_tool_only" && (emptyEligibleDispatch || finalFailedBeforeSend);
|
|
2629
|
-
}
|
|
2630
2644
|
function isFeishuTopicSessionScope(scope) {
|
|
2631
2645
|
return scope === "group_topic" || scope === "group_topic_sender";
|
|
2632
2646
|
}
|
|
@@ -2636,7 +2650,7 @@ async function resolveFeishuAudioTranscript(params) {
|
|
|
2636
2650
|
if (audioMedia.length === 0) return;
|
|
2637
2651
|
if (params.content.trim()) return params.content;
|
|
2638
2652
|
try {
|
|
2639
|
-
const { transcribeFirstAudio } = await import("./audio-preflight.runtime-BBfC9elv.
|
|
2653
|
+
const { transcribeFirstAudio } = await import("./audio-preflight.runtime-BBfC9elv.mjs");
|
|
2640
2654
|
return await transcribeFirstAudio({
|
|
2641
2655
|
ctx: {
|
|
2642
2656
|
media: audioMedia,
|
|
@@ -2860,7 +2874,7 @@ async function handleFeishuMessage(params) {
|
|
|
2860
2874
|
const names = ctx.mentionTargets.map((t) => t.name).join(", ");
|
|
2861
2875
|
log(`feishu[${account.accountId}]: detected @ forward request, targets: [${names}]`);
|
|
2862
2876
|
}
|
|
2863
|
-
const historyLimit =
|
|
2877
|
+
const historyLimit = resolvePromptHistoryLimit(feishuCfg?.historyLimit ?? cfg.messages?.groupChat?.historyLimit);
|
|
2864
2878
|
const groupConfig = isGroup ? resolveFeishuGroupConfig({
|
|
2865
2879
|
cfg: feishuCfg,
|
|
2866
2880
|
groupId: ctx.chatId
|
|
@@ -3409,7 +3423,7 @@ async function handleFeishuMessage(params) {
|
|
|
3409
3423
|
mode: contextVisibilityMode,
|
|
3410
3424
|
kind: "history"
|
|
3411
3425
|
});
|
|
3412
|
-
const relevantMessages =
|
|
3426
|
+
const relevantMessages = senderScoped ? allowlistedMessages.filter((msg) => msg.senderType === "app" || msg.senderId !== void 0 && senderIds.has(msg.senderId.trim())) : allowlistedMessages;
|
|
3413
3427
|
const threadStarterBody = rootMsg?.content ?? relevantMessages[0]?.content;
|
|
3414
3428
|
const historyMessages = Boolean(rootMsg?.content || ctx.rootId) ? relevantMessages : relevantMessages.slice(1);
|
|
3415
3429
|
const historyParts = historyMessages.map((msg) => {
|
|
@@ -3437,6 +3451,7 @@ async function handleFeishuMessage(params) {
|
|
|
3437
3451
|
const contextBinding = {
|
|
3438
3452
|
agentId,
|
|
3439
3453
|
sessionKey: agentSessionKey,
|
|
3454
|
+
nativeChannelId: ctx.chatId,
|
|
3440
3455
|
messageId: ctx.messageId,
|
|
3441
3456
|
inboundEventKind: "user_request"
|
|
3442
3457
|
};
|
|
@@ -3500,8 +3515,8 @@ async function handleFeishuMessage(params) {
|
|
|
3500
3515
|
threadId: ctx.rootId && isTopicSessionForThread ? ctx.rootId : void 0
|
|
3501
3516
|
},
|
|
3502
3517
|
route: {
|
|
3518
|
+
...route,
|
|
3503
3519
|
agentId,
|
|
3504
|
-
dmScope: route.dmScope,
|
|
3505
3520
|
accountId: agentAccountId,
|
|
3506
3521
|
routeSessionKey: agentSessionKey
|
|
3507
3522
|
},
|
|
@@ -3578,6 +3593,7 @@ async function handleFeishuMessage(params) {
|
|
|
3578
3593
|
return;
|
|
3579
3594
|
}
|
|
3580
3595
|
const broadcastSettlement = createFeishuBroadcastIngressSettlement({
|
|
3596
|
+
trackTask: params.trackTask,
|
|
3581
3597
|
lifecycle: turnAdoptionLifecycle,
|
|
3582
3598
|
replayClaim: broadcastClaim.kind === "claimed" ? broadcastClaim.handle : void 0,
|
|
3583
3599
|
onReplayCommitError: (err) => error(`feishu[${account.accountId}]: failed to commit broadcast replay guard: ${String(err)}`),
|
|
@@ -4006,6 +4022,7 @@ async function dispatchSyntheticCommand(params) {
|
|
|
4006
4022
|
log: params.runtime?.log ?? console.log
|
|
4007
4023
|
});
|
|
4008
4024
|
await handleFeishuMessage({
|
|
4025
|
+
trackTask: params.trackTask,
|
|
4009
4026
|
cfg: params.cfg,
|
|
4010
4027
|
event: buildSyntheticMessageEvent$1(params.event, params.command, resolvedChatType, params.botOpenId),
|
|
4011
4028
|
botOpenId: params.botOpenId,
|
|
@@ -4052,7 +4069,7 @@ function cacheResolvedCardActionChatType(cacheKey, value, now) {
|
|
|
4052
4069
|
});
|
|
4053
4070
|
}
|
|
4054
4071
|
async function resolveCardActionChatType(params) {
|
|
4055
|
-
const explicitChatType = normalizeFeishuChatType
|
|
4072
|
+
const explicitChatType = normalizeFeishuChatType(params.chatType);
|
|
4056
4073
|
if (explicitChatType) return explicitChatType;
|
|
4057
4074
|
const chatId = params.event.context.chat_id?.trim();
|
|
4058
4075
|
if (!chatId) return "p2p";
|
|
@@ -4192,6 +4209,7 @@ async function handleFeishuCardAction(params) {
|
|
|
4192
4209
|
return;
|
|
4193
4210
|
}
|
|
4194
4211
|
await dispatchSyntheticCommand({
|
|
4212
|
+
trackTask: params.trackTask,
|
|
4195
4213
|
cfg,
|
|
4196
4214
|
event,
|
|
4197
4215
|
command,
|
|
@@ -4217,6 +4235,7 @@ async function handleFeishuCardAction(params) {
|
|
|
4217
4235
|
const content = buildFeishuCardActionTextFallback(event);
|
|
4218
4236
|
log(`feishu[${account.accountId}]: handling card action from ${event.operator.open_id}: ${content}`);
|
|
4219
4237
|
await dispatchSyntheticCommand({
|
|
4238
|
+
trackTask: params.trackTask,
|
|
4220
4239
|
cfg,
|
|
4221
4240
|
event,
|
|
4222
4241
|
command: content,
|
|
@@ -4378,6 +4397,7 @@ function buildFeishuFlushIngressLifecycle(sources, options) {
|
|
|
4378
4397
|
}
|
|
4379
4398
|
})();
|
|
4380
4399
|
adopting = activeAdoption;
|
|
4400
|
+
options?.trackTask?.(activeAdoption);
|
|
4381
4401
|
try {
|
|
4382
4402
|
await activeAdoption;
|
|
4383
4403
|
} finally {
|
|
@@ -4396,6 +4416,7 @@ function buildFeishuFlushIngressLifecycle(sources, options) {
|
|
|
4396
4416
|
transportLifecycle.onDeferred();
|
|
4397
4417
|
},
|
|
4398
4418
|
onDeferredHeartbeat: () => transportLifecycle.onDeferredHeartbeat?.(),
|
|
4419
|
+
deferredHeartbeatIntervalMs: transportLifecycle.deferredHeartbeatIntervalMs,
|
|
4399
4420
|
onAdoptionFinalizing: () => {
|
|
4400
4421
|
transportLifecycle.onAdoptionFinalizing();
|
|
4401
4422
|
},
|
|
@@ -4858,8 +4879,10 @@ function createFeishuBotMenuHandler(params) {
|
|
|
4858
4879
|
const error = runtime?.error ?? console.error;
|
|
4859
4880
|
const getBotOpenId = params.getBotOpenId ?? ((id) => botOpenIds.get(id));
|
|
4860
4881
|
const getBotName = params.getBotName ?? ((id) => botNames.get(id));
|
|
4861
|
-
|
|
4882
|
+
const isActive = params.isAccountActive ?? (() => true);
|
|
4883
|
+
const handle = async (data) => {
|
|
4862
4884
|
try {
|
|
4885
|
+
if (!isActive()) return;
|
|
4863
4886
|
const event = parseFeishuBotMenuEvent(data);
|
|
4864
4887
|
if (!event) return;
|
|
4865
4888
|
const operatorOpenId = event.operator?.operator_id?.open_id?.trim();
|
|
@@ -4889,6 +4912,10 @@ function createFeishuBotMenuHandler(params) {
|
|
|
4889
4912
|
namespace: accountId,
|
|
4890
4913
|
log
|
|
4891
4914
|
});
|
|
4915
|
+
if (!isActive()) {
|
|
4916
|
+
if (claim.kind === "claimed") claim.handle.release({ error: /* @__PURE__ */ new Error("feishu account stopped before menu dispatch") });
|
|
4917
|
+
return;
|
|
4918
|
+
}
|
|
4892
4919
|
if (claim.kind === "duplicate") {
|
|
4893
4920
|
log(`feishu[${accountId}]: dropping duplicate bot-menu event for ${syntheticMessageId}`);
|
|
4894
4921
|
return;
|
|
@@ -4898,6 +4925,7 @@ function createFeishuBotMenuHandler(params) {
|
|
|
4898
4925
|
return;
|
|
4899
4926
|
}
|
|
4900
4927
|
const handleLegacyMenu = () => handleFeishuMessage({
|
|
4928
|
+
trackTask: params.trackTask,
|
|
4901
4929
|
cfg,
|
|
4902
4930
|
event: syntheticEvent,
|
|
4903
4931
|
botOpenId: getBotOpenId(accountId),
|
|
@@ -4919,6 +4947,10 @@ function createFeishuBotMenuHandler(params) {
|
|
|
4919
4947
|
if (claim.kind === "claimed") await claim.handle.commit();
|
|
4920
4948
|
return;
|
|
4921
4949
|
}
|
|
4950
|
+
if (!isActive()) {
|
|
4951
|
+
if (claim.kind === "claimed") claim.handle.release({ error: /* @__PURE__ */ new Error("feishu account stopped before menu dispatch") });
|
|
4952
|
+
return;
|
|
4953
|
+
}
|
|
4922
4954
|
return await handleLegacyMenu();
|
|
4923
4955
|
}).catch(async (err) => {
|
|
4924
4956
|
if (isFeishuRetryableSyntheticEventError(err)) {
|
|
@@ -4927,6 +4959,7 @@ function createFeishuBotMenuHandler(params) {
|
|
|
4927
4959
|
} else if (claim.kind === "claimed") await claim.handle.commit();
|
|
4928
4960
|
throw err;
|
|
4929
4961
|
});
|
|
4962
|
+
params.trackTask?.(promise);
|
|
4930
4963
|
if (fireAndForget) {
|
|
4931
4964
|
promise.catch((err) => {
|
|
4932
4965
|
error(`feishu[${accountId}]: error handling bot menu event: ${String(err)}`);
|
|
@@ -4938,6 +4971,11 @@ function createFeishuBotMenuHandler(params) {
|
|
|
4938
4971
|
error(`feishu[${accountId}]: error handling bot menu event: ${String(err)}`);
|
|
4939
4972
|
}
|
|
4940
4973
|
};
|
|
4974
|
+
return (data) => {
|
|
4975
|
+
const task = handle(data);
|
|
4976
|
+
params.trackTask?.(task);
|
|
4977
|
+
return task;
|
|
4978
|
+
};
|
|
4941
4979
|
}
|
|
4942
4980
|
//#endregion
|
|
4943
4981
|
//#region extensions/feishu/src/comment-dispatcher.ts
|
|
@@ -5541,7 +5579,7 @@ async function resolveDriveCommentEventCore(params) {
|
|
|
5541
5579
|
return null;
|
|
5542
5580
|
}
|
|
5543
5581
|
const context = await fetchDriveCommentContext({
|
|
5544
|
-
client: createClient ? createClient(account ?? { accountId }) : createFeishuClient((await import("./accounts-
|
|
5582
|
+
client: createClient ? createClient(account ?? { accountId }) : createFeishuClient((await import("./accounts-DmU0xYPx.mjs").then((n) => n.t)).resolveFeishuAccount({
|
|
5545
5583
|
cfg,
|
|
5546
5584
|
accountId
|
|
5547
5585
|
})),
|
|
@@ -6016,9 +6054,6 @@ function createFeishuDriveCommentNoticeHandler(params) {
|
|
|
6016
6054
|
}
|
|
6017
6055
|
//#endregion
|
|
6018
6056
|
//#region extensions/feishu/src/monitor.message-handler.ts
|
|
6019
|
-
function normalizeFeishuChatType$1(value) {
|
|
6020
|
-
return value === "group" || value === "topic_group" || value === "private" || value === "p2p" ? value : void 0;
|
|
6021
|
-
}
|
|
6022
6057
|
function parseFeishuMessageEventPayload(value) {
|
|
6023
6058
|
if (!isRecord(value)) return null;
|
|
6024
6059
|
const sender = value.sender;
|
|
@@ -6028,7 +6063,7 @@ function parseFeishuMessageEventPayload(value) {
|
|
|
6028
6063
|
if (!isRecord(senderId)) return null;
|
|
6029
6064
|
const messageId = readStringValue(message.message_id);
|
|
6030
6065
|
const chatId = readStringValue(message.chat_id);
|
|
6031
|
-
const chatType =
|
|
6066
|
+
const chatType = normalizeFeishuEventChatType(message.chat_type);
|
|
6032
6067
|
const messageType = readStringValue(message.message_type);
|
|
6033
6068
|
if (!messageId || !chatId || !chatType || !messageType || typeof message.content !== "string") return null;
|
|
6034
6069
|
return value;
|
|
@@ -6050,7 +6085,7 @@ function dedupeFeishuDebounceEntriesByDedupeKey(entries) {
|
|
|
6050
6085
|
const seen = /* @__PURE__ */ new Set();
|
|
6051
6086
|
const deduped = [];
|
|
6052
6087
|
for (const entry of entries) {
|
|
6053
|
-
const dedupeKey =
|
|
6088
|
+
const dedupeKey = entry.messageDedupeKey;
|
|
6054
6089
|
if (!dedupeKey) {
|
|
6055
6090
|
deduped.push(entry);
|
|
6056
6091
|
continue;
|
|
@@ -6072,7 +6107,7 @@ function resolveFeishuDebounceMentions(params) {
|
|
|
6072
6107
|
const botMentions = merged.filter((mention) => mention.id.open_id?.trim() === normalizedBotOpenId);
|
|
6073
6108
|
return botMentions.length > 0 ? botMentions : void 0;
|
|
6074
6109
|
}
|
|
6075
|
-
function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, runtime, chatHistories, fireAndForget, handleMessage, resolveDebounceText: resolveText, hasProcessedMessage, getBotOpenId = () => void 0, getBotName = () => void 0, resolveSequentialKey = ({ accountId: accountIdLocal, event }) => `feishu:${accountIdLocal}:${event.message.chat_id?.trim() || "unknown"}`, statusSink, resolveIngressLifecycle }) {
|
|
6110
|
+
function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, runtime, chatHistories, fireAndForget, isAccountActive = () => true, trackTask, handleMessage, resolveDebounceText: resolveText, hasProcessedMessage, getBotOpenId = () => void 0, getBotName = () => void 0, resolveSequentialKey = ({ accountId: accountIdLocal, event }) => `feishu:${accountIdLocal}:${event.message.chat_id?.trim() || "unknown"}`, statusSink, resolveIngressLifecycle }) {
|
|
6076
6111
|
const readConfig = createRuntimeConfigReader(cfg);
|
|
6077
6112
|
const resolveDebounceMs = () => channelRuntime.debounce.resolveInboundDebounceMs({
|
|
6078
6113
|
cfg: readConfig(),
|
|
@@ -6096,7 +6131,8 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
6096
6131
|
await turnAdoptionLifecycle.onAbandoned();
|
|
6097
6132
|
return;
|
|
6098
6133
|
}
|
|
6099
|
-
|
|
6134
|
+
const handling = handleMessage({
|
|
6135
|
+
trackTask,
|
|
6100
6136
|
cfg,
|
|
6101
6137
|
event,
|
|
6102
6138
|
preparedContent,
|
|
@@ -6110,6 +6146,8 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
6110
6146
|
messageDedupeKey,
|
|
6111
6147
|
turnAdoptionLifecycle
|
|
6112
6148
|
});
|
|
6149
|
+
trackTask?.(handling);
|
|
6150
|
+
await handling;
|
|
6113
6151
|
};
|
|
6114
6152
|
await enqueue(sequentialKey, task);
|
|
6115
6153
|
};
|
|
@@ -6126,7 +6164,7 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
6126
6164
|
const recordSuppressedMessageIds = async (entries, dispatchDedupeKey) => {
|
|
6127
6165
|
const keepDedupeKey = dispatchDedupeKey?.trim();
|
|
6128
6166
|
const suppressedIds = new Set(entries.map((entry) => ({
|
|
6129
|
-
id:
|
|
6167
|
+
id: entry.messageDedupeKey,
|
|
6130
6168
|
claim: entry.processingClaim
|
|
6131
6169
|
})).filter(({ id }) => Boolean(id) && (!keepDedupeKey || id !== keepDedupeKey)));
|
|
6132
6170
|
for (const suppressed of suppressedIds) try {
|
|
@@ -6156,7 +6194,10 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
6156
6194
|
const { lifecycle, settle } = buildFeishuFlushIngressLifecycle(activeEntries.map((entry) => ({
|
|
6157
6195
|
lifecycle: entry.turnAdoptionLifecycle,
|
|
6158
6196
|
replayClaim: entry.processingClaim
|
|
6159
|
-
})), {
|
|
6197
|
+
})), {
|
|
6198
|
+
trackTask,
|
|
6199
|
+
onReplayCommitError: (err) => error(`feishu[${accountId}]: failed to commit logical replay guard: ${String(err)}`)
|
|
6200
|
+
});
|
|
6160
6201
|
return createFlush({
|
|
6161
6202
|
lifecycle,
|
|
6162
6203
|
dispatch: async (admissionLifecycle) => {
|
|
@@ -6167,19 +6208,19 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
6167
6208
|
}
|
|
6168
6209
|
try {
|
|
6169
6210
|
if (activeEntries.length === 1) {
|
|
6170
|
-
await dispatchFeishuMessage(last.event,
|
|
6211
|
+
await dispatchFeishuMessage(last.event, last.messageDedupeKey, last.processingClaim, admissionLifecycle);
|
|
6171
6212
|
await settle();
|
|
6172
6213
|
return;
|
|
6173
6214
|
}
|
|
6174
6215
|
const dedupedEntries = dedupeFeishuDebounceEntriesByDedupeKey(activeEntries);
|
|
6175
6216
|
const freshEntries = [];
|
|
6176
|
-
for (const entry of dedupedEntries) if (!await hasProcessedMessage(
|
|
6217
|
+
for (const entry of dedupedEntries) if (!await hasProcessedMessage(entry.messageDedupeKey, accountId, log)) freshEntries.push(entry);
|
|
6177
6218
|
const dispatchEntry = freshEntries.at(-1);
|
|
6178
6219
|
if (!dispatchEntry) {
|
|
6179
6220
|
await settle();
|
|
6180
6221
|
return;
|
|
6181
6222
|
}
|
|
6182
|
-
const dispatchDedupeKey =
|
|
6223
|
+
const dispatchDedupeKey = dispatchEntry.messageDedupeKey;
|
|
6183
6224
|
if (!lifecycle) await recordSuppressedMessageIds(dedupedEntries, dispatchDedupeKey);
|
|
6184
6225
|
const combinedText = freshEntries.map((entry) => resolveDebounceText(entry.event)).filter(Boolean).join("\n");
|
|
6185
6226
|
const mergedMentions = resolveFeishuDebounceMentions({
|
|
@@ -6217,6 +6258,10 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
6217
6258
|
});
|
|
6218
6259
|
return async (data) => {
|
|
6219
6260
|
const turnAdoptionLifecycle = resolveIngressLifecycle?.(data);
|
|
6261
|
+
if (!isAccountActive() || turnAdoptionLifecycle?.abortSignal.aborted) {
|
|
6262
|
+
await turnAdoptionLifecycle?.onAbandoned();
|
|
6263
|
+
return;
|
|
6264
|
+
}
|
|
6220
6265
|
const completeSuppressedIngress = async () => {
|
|
6221
6266
|
if (!turnAdoptionLifecycle) return;
|
|
6222
6267
|
turnAdoptionLifecycle.onAdoptionFinalizing();
|
|
@@ -6237,11 +6282,21 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
6237
6282
|
await completeSuppressedIngress();
|
|
6238
6283
|
return;
|
|
6239
6284
|
}
|
|
6285
|
+
const messageDedupeKey = resolveFeishuMessageDedupeKey(event);
|
|
6240
6286
|
const claim = await claimUnprocessedFeishuMessage({
|
|
6241
|
-
messageId:
|
|
6287
|
+
messageId: messageDedupeKey,
|
|
6242
6288
|
namespace: accountId,
|
|
6243
6289
|
log
|
|
6244
6290
|
});
|
|
6291
|
+
if (!isAccountActive() || turnAdoptionLifecycle?.abortSignal.aborted) {
|
|
6292
|
+
const stoppedError = /* @__PURE__ */ new Error("feishu account stopped before message admission");
|
|
6293
|
+
if (claim.kind === "claimed") claim.handle.release({ error: stoppedError });
|
|
6294
|
+
await turnAdoptionLifecycle?.onAbandoned();
|
|
6295
|
+
return {
|
|
6296
|
+
kind: "failed-retryable",
|
|
6297
|
+
error: stoppedError
|
|
6298
|
+
};
|
|
6299
|
+
}
|
|
6245
6300
|
if (claim.kind === "duplicate" || claim.kind === "inflight") {
|
|
6246
6301
|
log(`feishu[${accountId}]: dropping ${claim.kind} event for message ${messageId}`);
|
|
6247
6302
|
await completeSuppressedIngress();
|
|
@@ -6249,6 +6304,7 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
6249
6304
|
}
|
|
6250
6305
|
const debounceEntry = {
|
|
6251
6306
|
event,
|
|
6307
|
+
messageDedupeKey,
|
|
6252
6308
|
...claim.kind === "claimed" ? { processingClaim: claim.handle } : {},
|
|
6253
6309
|
...turnAdoptionLifecycle ? { turnAdoptionLifecycle } : {}
|
|
6254
6310
|
};
|
|
@@ -6298,6 +6354,7 @@ function buildFeishuWebhookRateLimitKey(params) {
|
|
|
6298
6354
|
//#region extensions/feishu/src/monitor.transport.ts
|
|
6299
6355
|
const FEISHU_WEBHOOK_ACCEPTED_HEADER = "x-openclaw-delivery-accepted";
|
|
6300
6356
|
const FEISHU_WEBHOOK_ACCEPTED_VALUE = "durable";
|
|
6357
|
+
const FEISHU_PRE_AUTH_MAX_IN_FLIGHT = 64;
|
|
6301
6358
|
const FEISHU_WEBHOOK_TIMESTAMP_MAX_SKEW_MS = 36e5;
|
|
6302
6359
|
const FEISHU_WS_RECONNECT_INITIAL_DELAY_MS = 1e3;
|
|
6303
6360
|
const FEISHU_WS_RECONNECT_MAX_DELAY_MS = 3e4;
|
|
@@ -6524,6 +6581,11 @@ async function monitorWebhook({ account, accountId, runtime, abortSignal, eventD
|
|
|
6524
6581
|
const path = account.config.webhookPath ?? "/feishu/events";
|
|
6525
6582
|
if (normalizeFeishuWebhookPath(path) !== path) throw new Error(`Feishu account "${accountId}" webhookPath must be a canonical HTTP request path; run "openclaw doctor --fix" to repair it`);
|
|
6526
6583
|
const host = account.config.webhookHost ?? "127.0.0.1";
|
|
6584
|
+
const preAuthInFlightLimiter = createWebhookInFlightLimiter({
|
|
6585
|
+
maxInFlightPerKey: FEISHU_PRE_AUTH_MAX_IN_FLIGHT,
|
|
6586
|
+
maxTrackedKeys: 1
|
|
6587
|
+
});
|
|
6588
|
+
const preAuthInFlightKey = `${accountId}:${path}`;
|
|
6527
6589
|
log(`feishu[${accountId}]: starting Webhook server on ${host}:${port}, path ${path}...`);
|
|
6528
6590
|
const server = http.createServer();
|
|
6529
6591
|
server.on("request", (req, res) => {
|
|
@@ -6560,31 +6622,46 @@ async function monitorWebhook({ account, accountId, runtime, abortSignal, eventD
|
|
|
6560
6622
|
nowMs: Date.now(),
|
|
6561
6623
|
requireJsonContentType: true
|
|
6562
6624
|
})) return;
|
|
6625
|
+
if (!preAuthInFlightLimiter.tryAcquire(preAuthInFlightKey)) {
|
|
6626
|
+
sendHttpRequestRejection(req, res, 429, "Rate limit exceeded", "text/plain; charset=utf-8").catch((err) => {
|
|
6627
|
+
error(`feishu[${accountId}]: webhook concurrency rejection failed: ${String(err)}`);
|
|
6628
|
+
});
|
|
6629
|
+
return;
|
|
6630
|
+
}
|
|
6563
6631
|
const guard = installRequestBodyLimitGuard(req, res, {
|
|
6564
6632
|
maxBytes: FEISHU_WEBHOOK_MAX_BODY_BYTES,
|
|
6565
6633
|
timeoutMs: FEISHU_WEBHOOK_BODY_TIMEOUT_MS,
|
|
6566
6634
|
responseFormat: "text"
|
|
6567
6635
|
});
|
|
6568
|
-
if (guard.isTripped())
|
|
6636
|
+
if (guard.isTripped()) {
|
|
6637
|
+
preAuthInFlightLimiter.release(preAuthInFlightKey);
|
|
6638
|
+
return;
|
|
6639
|
+
}
|
|
6569
6640
|
(async () => {
|
|
6570
6641
|
try {
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6642
|
+
let rawBody;
|
|
6643
|
+
try {
|
|
6644
|
+
const body = await readWebhookBodyOrReject({
|
|
6645
|
+
req,
|
|
6646
|
+
res,
|
|
6647
|
+
maxBytes: FEISHU_WEBHOOK_MAX_BODY_BYTES,
|
|
6648
|
+
timeoutMs: FEISHU_WEBHOOK_BODY_TIMEOUT_MS,
|
|
6649
|
+
profile: "pre-auth"
|
|
6650
|
+
});
|
|
6651
|
+
if (!body.ok || res.writableEnded) return;
|
|
6652
|
+
if (guard.isTripped()) return;
|
|
6653
|
+
rawBody = body.value;
|
|
6654
|
+
if (!isFeishuWebhookSignatureValid({
|
|
6655
|
+
headers: req.headers,
|
|
6656
|
+
rawBody,
|
|
6657
|
+
encryptKey
|
|
6658
|
+
})) {
|
|
6659
|
+
respondText(res, 401, "Invalid signature");
|
|
6660
|
+
return;
|
|
6661
|
+
}
|
|
6662
|
+
} finally {
|
|
6663
|
+
guard.dispose();
|
|
6664
|
+
preAuthInFlightLimiter.release(preAuthInFlightKey);
|
|
6588
6665
|
}
|
|
6589
6666
|
const payload = parseFeishuWebhookPayload(rawBody);
|
|
6590
6667
|
if (!payload) {
|
|
@@ -6612,8 +6689,6 @@ async function monitorWebhook({ account, accountId, runtime, abortSignal, eventD
|
|
|
6612
6689
|
} catch (err) {
|
|
6613
6690
|
error(`feishu[${accountId}]: webhook handler error: ${String(err)}`);
|
|
6614
6691
|
if (!res.headersSent) respondText(res, 500, "Internal Server Error");
|
|
6615
|
-
} finally {
|
|
6616
|
-
guard.dispose();
|
|
6617
6692
|
}
|
|
6618
6693
|
})();
|
|
6619
6694
|
});
|
|
@@ -6723,22 +6798,94 @@ function buildSyntheticMessageEvent(turn) {
|
|
|
6723
6798
|
}
|
|
6724
6799
|
};
|
|
6725
6800
|
}
|
|
6801
|
+
function createVcInviteAdoption(params) {
|
|
6802
|
+
const cancellation = new AbortController();
|
|
6803
|
+
const settled = createDeferred();
|
|
6804
|
+
let handedOff = false;
|
|
6805
|
+
let released = false;
|
|
6806
|
+
let adoption;
|
|
6807
|
+
const abandon = () => {
|
|
6808
|
+
if (released || adoption) return;
|
|
6809
|
+
released = true;
|
|
6810
|
+
params.abortSignal?.removeEventListener("abort", abandon);
|
|
6811
|
+
const error = params.abortSignal?.reason ?? /* @__PURE__ */ new Error("Feishu VC invitation abandoned before adoption");
|
|
6812
|
+
cancellation.abort(error);
|
|
6813
|
+
params.claim.release({ error });
|
|
6814
|
+
settled.resolve();
|
|
6815
|
+
};
|
|
6816
|
+
params.trackTask?.(settled.promise);
|
|
6817
|
+
params.abortSignal?.addEventListener("abort", abandon, { once: true });
|
|
6818
|
+
if (params.abortSignal?.aborted) abandon();
|
|
6819
|
+
return {
|
|
6820
|
+
lifecycle: {
|
|
6821
|
+
abortSignal: cancellation.signal,
|
|
6822
|
+
onAdopted: () => {
|
|
6823
|
+
if (adoption) return adoption;
|
|
6824
|
+
if (params.isAccountActive?.() === false) abandon();
|
|
6825
|
+
cancellation.signal.throwIfAborted();
|
|
6826
|
+
handedOff = true;
|
|
6827
|
+
params.abortSignal?.removeEventListener("abort", abandon);
|
|
6828
|
+
adoption = Promise.resolve().then(async () => {
|
|
6829
|
+
await params.claim.commit();
|
|
6830
|
+
}).finally(() => settled.resolve());
|
|
6831
|
+
return adoption;
|
|
6832
|
+
},
|
|
6833
|
+
onDeferred: () => {
|
|
6834
|
+
handedOff = true;
|
|
6835
|
+
},
|
|
6836
|
+
onAdoptionFinalizing: () => {
|
|
6837
|
+
handedOff = true;
|
|
6838
|
+
},
|
|
6839
|
+
onAbandoned: abandon
|
|
6840
|
+
},
|
|
6841
|
+
finish: async () => {
|
|
6842
|
+
if (!handedOff) abandon();
|
|
6843
|
+
await adoption;
|
|
6844
|
+
}
|
|
6845
|
+
};
|
|
6846
|
+
}
|
|
6726
6847
|
async function dispatchVcMeetingInvitedTurn(params) {
|
|
6727
6848
|
params.runtime?.log?.(`feishu[${params.accountId}]: vc meeting invited, dispatching synthetic p2p message sender=${params.turn.inviter.senderId} meeting_no=${params.turn.meetingNo}`);
|
|
6728
6849
|
const event = setFeishuSyntheticDirectPreDispatchTarget(buildSyntheticMessageEvent(params.turn), `user:${params.turn.inviter.senderId}`);
|
|
6729
|
-
await
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
runtime: params.runtime,
|
|
6734
|
-
channelRuntime: params.channelRuntime
|
|
6850
|
+
const claim = await claimUnprocessedFeishuMessage({
|
|
6851
|
+
messageId: resolveFeishuMessageDedupeKey(event),
|
|
6852
|
+
namespace: params.accountId,
|
|
6853
|
+
log: params.runtime?.log ?? console.log
|
|
6735
6854
|
});
|
|
6855
|
+
if (claim.kind !== "claimed") return;
|
|
6856
|
+
if (params.abortSignal?.aborted || params.isAccountActive?.() === false) {
|
|
6857
|
+
claim.handle.release({ error: /* @__PURE__ */ new Error("Feishu account stopped before VC dispatch") });
|
|
6858
|
+
return;
|
|
6859
|
+
}
|
|
6860
|
+
const adoption = createVcInviteAdoption({
|
|
6861
|
+
claim: claim.handle,
|
|
6862
|
+
abortSignal: params.abortSignal,
|
|
6863
|
+
isAccountActive: params.isAccountActive,
|
|
6864
|
+
trackTask: params.trackTask
|
|
6865
|
+
});
|
|
6866
|
+
try {
|
|
6867
|
+
await handleFeishuMessage({
|
|
6868
|
+
trackTask: params.trackTask,
|
|
6869
|
+
cfg: params.cfg,
|
|
6870
|
+
accountId: params.accountId,
|
|
6871
|
+
event,
|
|
6872
|
+
runtime: params.runtime,
|
|
6873
|
+
channelRuntime: params.channelRuntime,
|
|
6874
|
+
turnAdoptionLifecycle: adoption.lifecycle
|
|
6875
|
+
});
|
|
6876
|
+
} catch (error) {
|
|
6877
|
+
await adoption.lifecycle.onAbandoned();
|
|
6878
|
+
throw error;
|
|
6879
|
+
} finally {
|
|
6880
|
+
await adoption.finish();
|
|
6881
|
+
}
|
|
6736
6882
|
}
|
|
6737
6883
|
function createFeishuVcMeetingInvitedHandler(params) {
|
|
6738
6884
|
const { cfg, accountId, runtime, fireAndForget, autoJoin } = params;
|
|
6739
6885
|
const log = runtime?.log ?? console.log;
|
|
6740
6886
|
const error = runtime?.error ?? console.error;
|
|
6741
|
-
|
|
6887
|
+
const handle = async (data) => {
|
|
6888
|
+
if (params.abortSignal?.aborted || params.isAccountActive?.() === false) return;
|
|
6742
6889
|
if (!autoJoin) {
|
|
6743
6890
|
log(`feishu[${accountId}]: ignoring vc meeting invite (vcAutoJoin=false)`);
|
|
6744
6891
|
return;
|
|
@@ -6749,24 +6896,25 @@ function createFeishuVcMeetingInvitedHandler(params) {
|
|
|
6749
6896
|
log(`feishu[${accountId}]: vc meeting invited event has invalid meeting_no or inviter identity, skipping`);
|
|
6750
6897
|
return;
|
|
6751
6898
|
}
|
|
6752
|
-
|
|
6899
|
+
await dispatchVcMeetingInvitedTurn({
|
|
6900
|
+
trackTask: params.trackTask,
|
|
6753
6901
|
cfg,
|
|
6754
6902
|
accountId,
|
|
6755
6903
|
runtime,
|
|
6756
6904
|
channelRuntime: params.channelRuntime,
|
|
6757
|
-
turn
|
|
6905
|
+
turn,
|
|
6906
|
+
abortSignal: params.abortSignal,
|
|
6907
|
+
isAccountActive: params.isAccountActive
|
|
6758
6908
|
});
|
|
6759
|
-
if (fireAndForget) {
|
|
6760
|
-
promise.catch((err) => {
|
|
6761
|
-
error(`feishu[${accountId}]: error handling vc meeting invited event: ${String(err)}`);
|
|
6762
|
-
});
|
|
6763
|
-
return;
|
|
6764
|
-
}
|
|
6765
|
-
await promise;
|
|
6766
6909
|
} catch (err) {
|
|
6767
6910
|
error(`feishu[${accountId}]: error handling vc meeting invited event: ${String(err)}`);
|
|
6768
6911
|
}
|
|
6769
6912
|
};
|
|
6913
|
+
return (data) => {
|
|
6914
|
+
const task = handle(data);
|
|
6915
|
+
params.trackTask?.(task);
|
|
6916
|
+
return fireAndForget ? Promise.resolve() : task;
|
|
6917
|
+
};
|
|
6770
6918
|
}
|
|
6771
6919
|
//#endregion
|
|
6772
6920
|
//#region extensions/feishu/src/sequential-key.ts
|
|
@@ -6789,7 +6937,7 @@ async function resolveReactionSyntheticEvent(params) {
|
|
|
6789
6937
|
const senderUserId = event.user_id?.user_id?.trim();
|
|
6790
6938
|
const senderId = senderOpenId || senderUserId;
|
|
6791
6939
|
if (!emoji || !messageId || !senderId) return null;
|
|
6792
|
-
const { resolveFeishuAccount } = await import("./accounts-
|
|
6940
|
+
const { resolveFeishuAccount } = await import("./accounts-DmU0xYPx.mjs").then((n) => n.t);
|
|
6793
6941
|
const reactionNotifications = resolveFeishuAccount({
|
|
6794
6942
|
cfg,
|
|
6795
6943
|
accountId
|
|
@@ -6812,7 +6960,7 @@ async function resolveReactionSyntheticEvent(params) {
|
|
|
6812
6960
|
return null;
|
|
6813
6961
|
}
|
|
6814
6962
|
const fallbackChatType = reactedMsg.chatType;
|
|
6815
|
-
const resolvedChatType =
|
|
6963
|
+
const resolvedChatType = normalizeFeishuEventChatType(event.chat_type) ?? fallbackChatType;
|
|
6816
6964
|
if (!resolvedChatType) {
|
|
6817
6965
|
logger?.(`feishu[${accountId}]: skipping reaction ${emoji} on ${messageId} without chat type context`);
|
|
6818
6966
|
return null;
|
|
@@ -6841,9 +6989,6 @@ async function resolveReactionSyntheticEvent(params) {
|
|
|
6841
6989
|
}
|
|
6842
6990
|
};
|
|
6843
6991
|
}
|
|
6844
|
-
function normalizeFeishuChatType(value) {
|
|
6845
|
-
return value === "group" || value === "topic_group" || value === "private" || value === "p2p" ? value : void 0;
|
|
6846
|
-
}
|
|
6847
6992
|
function parseFeishuBotAddedEventPayload(value) {
|
|
6848
6993
|
if (!isRecord(value) || !readStringValue(value.chat_id) || !isRecord(value.operator_id)) return null;
|
|
6849
6994
|
return value;
|
|
@@ -6905,14 +7050,17 @@ function registerEventHandlers(eventDispatcher, context) {
|
|
|
6905
7050
|
const log = runtime?.log ?? console.log;
|
|
6906
7051
|
const error = runtime?.error ?? console.error;
|
|
6907
7052
|
const runFeishuHandler = async (params) => {
|
|
7053
|
+
if (!context.isAccountActive()) return;
|
|
7054
|
+
const task = params.task();
|
|
7055
|
+
context.trackTask(task);
|
|
6908
7056
|
if (fireAndForget) {
|
|
6909
|
-
|
|
7057
|
+
task.catch((err) => {
|
|
6910
7058
|
error(`${params.errorMessage}: ${String(err)}`);
|
|
6911
7059
|
});
|
|
6912
7060
|
return;
|
|
6913
7061
|
}
|
|
6914
7062
|
try {
|
|
6915
|
-
await
|
|
7063
|
+
await task;
|
|
6916
7064
|
} catch (err) {
|
|
6917
7065
|
error(`${params.errorMessage}: ${String(err)}`);
|
|
6918
7066
|
}
|
|
@@ -6925,6 +7073,8 @@ function registerEventHandlers(eventDispatcher, context) {
|
|
|
6925
7073
|
runtime,
|
|
6926
7074
|
chatHistories,
|
|
6927
7075
|
fireAndForget,
|
|
7076
|
+
isAccountActive: context.isAccountActive,
|
|
7077
|
+
trackTask: context.trackTask,
|
|
6928
7078
|
handleMessage: handleFeishuMessage,
|
|
6929
7079
|
resolveDebounceText: ({ event, botOpenId, botName }) => parseFeishuMessageEvent(event, botOpenId, botName).content,
|
|
6930
7080
|
hasProcessedMessage: hasProcessedFeishuMessage,
|
|
@@ -6968,7 +7118,10 @@ function registerEventHandlers(eventDispatcher, context) {
|
|
|
6968
7118
|
runtime,
|
|
6969
7119
|
fireAndForget,
|
|
6970
7120
|
channelRuntime,
|
|
6971
|
-
autoJoin: context.vcAutoJoin
|
|
7121
|
+
autoJoin: context.vcAutoJoin,
|
|
7122
|
+
abortSignal: context.abortSignal,
|
|
7123
|
+
isAccountActive: context.isAccountActive,
|
|
7124
|
+
trackTask: context.trackTask
|
|
6972
7125
|
}),
|
|
6973
7126
|
"im.message.reaction.created_v1": async (data) => {
|
|
6974
7127
|
await runFeishuHandler({
|
|
@@ -6983,8 +7136,9 @@ function registerEventHandlers(eventDispatcher, context) {
|
|
|
6983
7136
|
botOpenId: myBotId,
|
|
6984
7137
|
logger: log
|
|
6985
7138
|
});
|
|
6986
|
-
if (!syntheticEvent) return;
|
|
7139
|
+
if (!syntheticEvent || !context.isAccountActive()) return;
|
|
6987
7140
|
await handleFeishuMessage({
|
|
7141
|
+
trackTask: context.trackTask,
|
|
6988
7142
|
cfg,
|
|
6989
7143
|
event: syntheticEvent,
|
|
6990
7144
|
botOpenId: myBotId,
|
|
@@ -7011,8 +7165,9 @@ function registerEventHandlers(eventDispatcher, context) {
|
|
|
7011
7165
|
logger: log,
|
|
7012
7166
|
action: "deleted"
|
|
7013
7167
|
});
|
|
7014
|
-
if (!syntheticEvent) return;
|
|
7168
|
+
if (!syntheticEvent || !context.isAccountActive()) return;
|
|
7015
7169
|
await handleFeishuMessage({
|
|
7170
|
+
trackTask: context.trackTask,
|
|
7016
7171
|
cfg,
|
|
7017
7172
|
event: syntheticEvent,
|
|
7018
7173
|
botOpenId: myBotId,
|
|
@@ -7031,30 +7186,30 @@ function registerEventHandlers(eventDispatcher, context) {
|
|
|
7031
7186
|
runtime,
|
|
7032
7187
|
chatHistories,
|
|
7033
7188
|
fireAndForget,
|
|
7189
|
+
isAccountActive: context.isAccountActive,
|
|
7190
|
+
trackTask: context.trackTask,
|
|
7034
7191
|
channelRuntime
|
|
7035
7192
|
}),
|
|
7036
7193
|
"card.action.trigger": async (data) => {
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7194
|
+
await runFeishuHandler({
|
|
7195
|
+
errorMessage: `feishu[${accountId}]: error handling card action`,
|
|
7196
|
+
task: async () => {
|
|
7197
|
+
const event = parseFeishuCardActionEventPayload(data);
|
|
7198
|
+
if (!event) {
|
|
7199
|
+
error(`feishu[${accountId}]: ignoring malformed card action payload`);
|
|
7200
|
+
return;
|
|
7201
|
+
}
|
|
7202
|
+
await handleFeishuCardAction({
|
|
7203
|
+
cfg,
|
|
7204
|
+
event,
|
|
7205
|
+
botOpenId: botOpenIds.get(accountId),
|
|
7206
|
+
runtime,
|
|
7207
|
+
channelRuntime,
|
|
7208
|
+
accountId,
|
|
7209
|
+
trackTask: context.trackTask
|
|
7210
|
+
});
|
|
7042
7211
|
}
|
|
7043
|
-
|
|
7044
|
-
cfg,
|
|
7045
|
-
event,
|
|
7046
|
-
botOpenId: botOpenIds.get(accountId),
|
|
7047
|
-
runtime,
|
|
7048
|
-
channelRuntime,
|
|
7049
|
-
accountId
|
|
7050
|
-
});
|
|
7051
|
-
if (fireAndForget) promise.catch((err) => {
|
|
7052
|
-
error(`feishu[${accountId}]: error handling card action: ${String(err)}`);
|
|
7053
|
-
});
|
|
7054
|
-
else await promise;
|
|
7055
|
-
} catch (err) {
|
|
7056
|
-
error(`feishu[${accountId}]: error handling card action: ${String(err)}`);
|
|
7057
|
-
}
|
|
7212
|
+
});
|
|
7058
7213
|
}
|
|
7059
7214
|
});
|
|
7060
7215
|
}
|
|
@@ -7084,8 +7239,16 @@ async function monitorSingleAccount(params) {
|
|
|
7084
7239
|
if (connectionMode === "webhook" && !account.verificationToken?.trim()) throw new Error(`Feishu account "${accountId}" webhook mode requires verificationToken`);
|
|
7085
7240
|
if (connectionMode === "webhook" && !account.encryptKey?.trim()) throw new Error(`Feishu account "${accountId}" webhook mode requires encryptKey`);
|
|
7086
7241
|
const warmupCount = await warmupDedupFromPluginState(accountId, log);
|
|
7242
|
+
if (abortSignal?.aborted) return;
|
|
7087
7243
|
if (warmupCount > 0) log(`feishu[${accountId}]: dedup warmup loaded ${warmupCount} entries from plugin state`);
|
|
7088
7244
|
let threadBindingManager;
|
|
7245
|
+
const accountStopped = new AbortController();
|
|
7246
|
+
const accountAbortSignal = abortSignal ? AbortSignal.any([abortSignal, accountStopped.signal]) : accountStopped.signal;
|
|
7247
|
+
const pendingTasks = /* @__PURE__ */ new Set();
|
|
7248
|
+
const trackTask = (task) => {
|
|
7249
|
+
pendingTasks.add(task);
|
|
7250
|
+
task.then(() => pendingTasks.delete(task), () => pendingTasks.delete(task));
|
|
7251
|
+
};
|
|
7089
7252
|
try {
|
|
7090
7253
|
const eventDispatcher = createEventDispatcher(account);
|
|
7091
7254
|
const durableIngress = typeof eventDispatcher.invoke === "function" ? createFeishuDurableIngress({
|
|
@@ -7107,8 +7270,10 @@ async function monitorSingleAccount(params) {
|
|
|
7107
7270
|
runtime,
|
|
7108
7271
|
chatHistories,
|
|
7109
7272
|
fireAndForget: params.fireAndForget ?? true,
|
|
7273
|
+
isAccountActive: () => !accountAbortSignal.aborted,
|
|
7274
|
+
trackTask,
|
|
7110
7275
|
vcAutoJoin: account.config.vcAutoJoin === true,
|
|
7111
|
-
abortSignal,
|
|
7276
|
+
abortSignal: accountAbortSignal,
|
|
7112
7277
|
...durableIngress ? { resolveIngressLifecycle: durableIngress.resolveLifecycle } : {},
|
|
7113
7278
|
...params.statusSink ? { statusSink: params.statusSink } : {}
|
|
7114
7279
|
});
|
|
@@ -7133,7 +7298,12 @@ async function monitorSingleAccount(params) {
|
|
|
7133
7298
|
...params.statusSink ? { statusSink: params.statusSink } : {}
|
|
7134
7299
|
});
|
|
7135
7300
|
} finally {
|
|
7136
|
-
|
|
7301
|
+
accountStopped.abort(/* @__PURE__ */ new Error("Feishu account stopped"));
|
|
7302
|
+
try {
|
|
7303
|
+
await durableIngress?.stop();
|
|
7304
|
+
} finally {
|
|
7305
|
+
while (pendingTasks.size > 0) await Promise.allSettled(pendingTasks);
|
|
7306
|
+
}
|
|
7137
7307
|
}
|
|
7138
7308
|
} finally {
|
|
7139
7309
|
threadBindingManager?.stop();
|