@openclaw/feishu 2026.7.1-beta.2 → 2026.7.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{accounts-Cfzht2Hc.js → accounts-Bs5uJ4h0.js} +4 -3
- package/dist/api.js +56 -65
- package/dist/{app-registration-DuEyfVY1.js → app-registration-BwQ-aGTe.js} +22 -10
- package/dist/{channel-Bwm5rvHg.js → channel-DwCydAeD.js} +63 -37
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-C6SITclp.js → channel.runtime-COT2fcCf.js} +66 -129
- package/dist/contract-api.js +1 -1
- package/dist/{conversation-id-DuL575sn.js → conversation-id-CdLdoot3.js} +5 -1
- package/dist/{drive-djUl8IRC.js → drive-BupYOoHa.js} +46 -42
- package/dist/json-response-CheljwGr.js +9 -0
- package/dist/{monitor-Ckch4qvr.js → monitor-5gbbXIO-.js} +2 -2
- package/dist/{monitor.account-GXGIJrgw.js → monitor.account-lMwQ5v1Q.js} +146 -65
- package/dist/runtime-api.js +1 -1
- package/dist/{send-BJTjDWKi.js → send-DzLGqjEt.js} +17 -35
- package/dist/send-result-BMQw-YhV.js +287 -0
- package/dist/{session-conversation-CZSMgac-.js → session-conversation-BYuoVJwl.js} +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-api.js +1 -1
- package/dist/{subagent-hooks-1pqt5tAA.js → subagent-hooks-B2iWPYJ1.js} +1 -1
- package/dist/subagent-hooks-api.js +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/README.md +40 -0
- package/node_modules/@larksuiteoapi/node-sdk/README.zh.md +38 -0
- package/node_modules/@larksuiteoapi/node-sdk/es/index.js +183 -24
- package/node_modules/@larksuiteoapi/node-sdk/lib/index.js +186 -23
- package/node_modules/@larksuiteoapi/node-sdk/package.json +1 -72
- package/node_modules/@larksuiteoapi/node-sdk/types/index.d.ts +105 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/assert/strict.d.ts +10 -1
- package/node_modules/@types/node/assert.d.ts +144 -17
- package/node_modules/@types/node/async_hooks.d.ts +9 -9
- package/node_modules/@types/node/buffer.d.ts +64 -30
- package/node_modules/@types/node/child_process.d.ts +17 -21
- package/node_modules/@types/node/cluster.d.ts +13 -13
- package/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@types/node/crypto.d.ts +471 -575
- package/node_modules/@types/node/diagnostics_channel.d.ts +274 -32
- package/node_modules/@types/node/dns.d.ts +15 -15
- package/node_modules/@types/node/events.d.ts +3 -3
- package/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@types/node/fs/promises.d.ts +7 -4
- package/node_modules/@types/node/fs.d.ts +24 -18
- package/node_modules/@types/node/globals.d.ts +4 -4
- package/node_modules/@types/node/http.d.ts +30 -5
- package/node_modules/@types/node/http2.d.ts +5 -1
- package/node_modules/@types/node/index.d.ts +1 -3
- package/node_modules/@types/node/inspector.d.ts +1 -1
- package/node_modules/@types/node/module.d.ts +16 -45
- package/node_modules/@types/node/net.d.ts +1 -1
- package/node_modules/@types/node/os.d.ts +2 -2
- package/node_modules/@types/node/package.json +4 -4
- package/node_modules/@types/node/perf_hooks.d.ts +1 -9
- package/node_modules/@types/node/process.d.ts +25 -12
- package/node_modules/@types/node/quic.d.ts +92 -11
- package/node_modules/@types/node/readline.d.ts +12 -11
- package/node_modules/@types/node/repl.d.ts +10 -10
- package/node_modules/@types/node/sqlite.d.ts +56 -1
- package/node_modules/@types/node/stream/iter.d.ts +150 -0
- package/node_modules/@types/node/stream/promises.d.ts +2 -2
- package/node_modules/@types/node/stream/web.d.ts +1 -1
- package/node_modules/@types/node/stream.d.ts +37 -5
- package/node_modules/@types/node/test/reporters.d.ts +1 -1
- package/node_modules/@types/node/test.d.ts +120 -10
- package/node_modules/@types/node/tls.d.ts +1 -1
- package/node_modules/@types/node/ts5.6/index.d.ts +2 -4
- package/node_modules/@types/node/ts5.7/index.d.ts +1 -3
- package/node_modules/@types/node/url.d.ts +3 -3
- package/node_modules/@types/node/util/types.d.ts +1 -1
- package/node_modules/@types/node/util.d.ts +22 -22
- package/node_modules/@types/node/v8.d.ts +85 -3
- package/node_modules/@types/node/vm.d.ts +9 -9
- package/node_modules/@types/node/web-globals/domexception.d.ts +15 -0
- package/node_modules/@types/node/worker_threads.d.ts +10 -12
- package/node_modules/@types/node/zlib.d.ts +3 -3
- package/node_modules/side-channel/CHANGELOG.md +10 -0
- package/node_modules/side-channel/README.md +1 -1
- package/node_modules/side-channel/index.js +5 -2
- package/node_modules/side-channel/package.json +10 -10
- package/node_modules/side-channel/test/index.js +16 -0
- package/node_modules/typebox/build/compile/validator.d.mts +2 -7
- package/node_modules/typebox/build/compile/validator.mjs +6 -36
- package/node_modules/typebox/build/error/errors.d.mts +1 -7
- package/node_modules/typebox/build/format/_idna.mjs +36 -6
- package/node_modules/typebox/build/format/_puny.mjs +4 -1
- package/node_modules/typebox/build/format/uuid.d.mts +2 -2
- package/node_modules/typebox/build/format/uuid.mjs +3 -3
- package/node_modules/typebox/build/guard/emit.d.mts +0 -4
- package/node_modules/typebox/build/guard/emit.mjs +0 -8
- package/node_modules/typebox/build/guard/guard.d.mts +4 -8
- package/node_modules/typebox/build/guard/guard.mjs +5 -13
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
- package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
- package/node_modules/typebox/build/schema/engine/schema.mjs +5 -10
- package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
- package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/types/index.mjs +0 -1
- package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
- package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
- package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
- package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
- package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
- package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
- package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
- package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
- package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
- package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
- package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
- package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
- package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
- package/node_modules/typebox/build/type/action/index.d.mts +7 -4
- package/node_modules/typebox/build/type/action/index.mjs +7 -4
- package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
- package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
- package/node_modules/typebox/build/type/action/module.d.mts +8 -7
- package/node_modules/typebox/build/type/action/module.mjs +7 -6
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
- package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -5
- package/node_modules/typebox/build/type/action/with.d.mts +11 -0
- package/node_modules/typebox/build/type/action/with.mjs +11 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
- package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
- package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
- package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
- package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
- package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
- package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/index.mjs +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
- package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
- package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
- package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
- package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
- package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
- package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
- package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
- package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
- package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
- package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
- package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
- package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
- package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
- package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
- package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
- package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
- package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
- package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
- package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
- package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
- package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
- package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
- package/node_modules/typebox/build/type/extends/object.mjs +25 -3
- package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
- package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
- package/node_modules/typebox/build/type/extends/record.mjs +23 -0
- package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
- package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
- package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
- package/node_modules/typebox/build/type/extends/union.mjs +2 -2
- package/node_modules/typebox/build/type/script/mapping.d.mts +84 -99
- package/node_modules/typebox/build/type/script/mapping.mjs +81 -85
- package/node_modules/typebox/build/type/script/parser.d.mts +40 -40
- package/node_modules/typebox/build/type/script/parser.mjs +22 -22
- package/node_modules/typebox/build/type/script/script.d.mts +3 -4
- package/node_modules/typebox/build/type/script/script.mjs +3 -2
- package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
- package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
- package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
- package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
- package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
- package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
- package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
- package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
- package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
- package/node_modules/typebox/build/type/types/call.d.mts +3 -3
- package/node_modules/typebox/build/type/types/call.mjs +3 -2
- package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
- package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
- package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
- package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
- package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
- package/node_modules/typebox/build/type/types/enum.mjs +5 -0
- package/node_modules/typebox/build/type/types/index.d.mts +1 -4
- package/node_modules/typebox/build/type/types/index.mjs +1 -4
- package/node_modules/typebox/build/type/types/number.d.mts +1 -1
- package/node_modules/typebox/build/type/types/number.mjs +1 -1
- package/node_modules/typebox/build/type/types/record.d.mts +13 -7
- package/node_modules/typebox/build/type/types/record.mjs +15 -9
- package/node_modules/typebox/build/type/types/static.d.mts +2 -5
- package/node_modules/typebox/build/typebox.d.mts +4 -8
- package/node_modules/typebox/build/typebox.mjs +4 -8
- package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
- package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
- package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
- package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
- package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
- package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
- package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
- package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
- package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
- package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
- package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
- package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/index.d.mts +0 -1
- package/node_modules/typebox/build/value/index.mjs +0 -1
- package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
- package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
- package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
- package/node_modules/typebox/build/value/value.d.mts +0 -1
- package/node_modules/typebox/build/value/value.mjs +0 -1
- package/node_modules/typebox/package.json +25 -25
- package/node_modules/typebox/readme.md +97 -80
- package/node_modules/undici-types/agent.d.ts +0 -2
- package/node_modules/undici-types/client.d.ts +25 -19
- package/node_modules/undici-types/dispatcher.d.ts +7 -33
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici-types/fetch.d.ts +24 -4
- package/node_modules/undici-types/h2c-client.d.ts +6 -6
- package/node_modules/undici-types/handlers.d.ts +1 -2
- package/node_modules/undici-types/header.d.ts +5 -0
- package/node_modules/undici-types/index.d.ts +3 -1
- package/node_modules/undici-types/interceptors.d.ts +1 -1
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/pool.d.ts +0 -2
- package/node_modules/undici-types/proxy-agent.d.ts +2 -2
- package/node_modules/undici-types/round-robin-pool.d.ts +0 -2
- package/node_modules/undici-types/snapshot-agent.d.ts +4 -0
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +2 -2
- package/node_modules/undici-types/webidl.d.ts +0 -1
- package/npm-shrinkwrap.json +23 -23
- package/package.json +6 -6
- package/skills/feishu-drive/SKILL.md +17 -3
- package/dist/send-result-DSsIa4-p.js +0 -140
- package/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
- package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
- package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
- package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
- package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
- package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
- package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
- package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
- package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
- package/node_modules/typebox/build/type/action/options.d.mts +0 -11
- package/node_modules/typebox/build/type/action/options.mjs +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
- package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
- package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
- package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/base.d.mts +0 -50
- package/node_modules/typebox/build/type/types/base.mjs +0 -84
- package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
- package/node_modules/typebox/build/type/types/promise.mjs +0 -29
- package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
- package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
- package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
- package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
- package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
- package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
- package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
- package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
- package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
- package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
- package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
- package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
- package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.mjs +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { _ as normalizeCommentFileType, c as encodeQuery, d as isRecord$1, f as normalizeString, g as buildFeishuCommentTarget, h as requestFeishuApi, l as extractReplyText, m as readString, o as resolveFeishuAccount, p as parseCommentContentElements, s as resolveFeishuRuntimeAccount } from "./accounts-
|
|
1
|
+
import { _ as normalizeCommentFileType, c as encodeQuery, d as isRecord$1, f as normalizeString, g as buildFeishuCommentTarget, h as requestFeishuApi, l as extractReplyText, m as readString, o as resolveFeishuAccount, p as parseCommentContentElements, s as resolveFeishuRuntimeAccount } from "./accounts-Bs5uJ4h0.js";
|
|
2
2
|
import { i as resolveReceiveIdType } from "./targets-BUjQ1TcA.js";
|
|
3
|
-
import { c as normalizeFeishuAllowEntry, d as resolveFeishuGroupConversationIngressAccess, f as resolveFeishuGroupSenderActivationIngressAccess, l as resolveFeishuDmIngressAccess, p as resolveFeishuReplyPolicy, s as hasExplicitFeishuGroupConfig, u as resolveFeishuGroupConfig } from "./channel-
|
|
4
|
-
import {
|
|
5
|
-
import { t as buildFeishuConversationId } from "./conversation-id-
|
|
3
|
+
import { c as normalizeFeishuAllowEntry, d as resolveFeishuGroupConversationIngressAccess, f as resolveFeishuGroupSenderActivationIngressAccess, l as resolveFeishuDmIngressAccess, p as resolveFeishuReplyPolicy, s as hasExplicitFeishuGroupConfig, u as resolveFeishuGroupConfig } from "./channel-DwCydAeD.js";
|
|
4
|
+
import { d as decodeFeishuCardAction, l as buildFeishuCardActionTextFallback, o as resolveFeishuCardTemplate, u as createFeishuCardInteractionEnvelope } from "./send-result-BMQw-YhV.js";
|
|
5
|
+
import { o as resolveConfiguredFeishuGroupSessionScope, t as buildFeishuConversationId } from "./conversation-id-CdLdoot3.js";
|
|
6
6
|
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.js";
|
|
7
7
|
import { a as getFeishuUserAgent, i as createFeishuWSClient, n as createEventDispatcher, r as createFeishuClient } from "./client-BwgAJuvo.js";
|
|
8
|
-
import {
|
|
8
|
+
import { i as createCommentTypingReactionLifecycle, s as getChatInfo, t as deliverCommentThreadText } from "./drive-BupYOoHa.js";
|
|
9
9
|
import { t as createFeishuThreadBindingManager } from "./thread-bindings-V0bwk0A1.js";
|
|
10
10
|
import { createReplyPrefixContext, evaluateSupplementalContextVisibility, getSessionEntry, normalizeAgentId as normalizeAgentId$2, resolveChannelContextVisibilityMode } from "./runtime-api.js";
|
|
11
|
-
import {
|
|
11
|
+
import { t as readFeishuJsonResponse } from "./json-response-CheljwGr.js";
|
|
12
|
+
import { _ as resolveFeishuIdentityEmoji, c as parsePostContent, d as isMentionForwardRequest, f as isFeishuGroupChatType, g as normalizeFeishuExternalKey, h as shouldSuppressFeishuTextForVoiceMedia, i as sendCardFeishu, l as extractMentionTargets, m as sendMediaFeishu, n as getMessageFeishu, o as sendMessageFeishu, p as saveMessageResourceFeishu, r as listFeishuThreadMessages, s as sendStructuredCardFeishu, u as isFeishuBroadcastMention } from "./send-DzLGqjEt.js";
|
|
12
13
|
import { i as waitForAbortableDelay, r as raceWithTimeoutAndAbort } from "./probe-Cv2M2Ivr.js";
|
|
13
14
|
import { a as clearFeishuBotIdentityState, c as httpServers, d as wsClients, f as fetchBotIdentityForMonitor, i as botOpenIds, l as recordWebhookStatus, n as FEISHU_WEBHOOK_MAX_BODY_BYTES, o as closeTrackedFeishuHttpServer, r as botNames, s as feishuWebhookRateLimiter, t as FEISHU_WEBHOOK_BODY_TIMEOUT_MS, u as setFeishuBotIdentityState } from "./monitor.state-R4ZgNpac.js";
|
|
14
15
|
import { createChannelMessageReplyPipeline, formatChannelProgressDraftLineForEntry, isChannelProgressDraftWorkToolName, resolveAgentOutboundIdentity } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -29,7 +30,7 @@ import { applyBasicWebhookRequestGuards, resolveRequestClientIp } from "openclaw
|
|
|
29
30
|
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
30
31
|
import { resolveSendableOutboundReplyParts, resolveTextChunksWithFallback, sendMediaWithLeadingCaption } from "openclaw/plugin-sdk/reply-payload";
|
|
31
32
|
import { resolvePinnedMainDmOwnerFromAllowlist, safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
32
|
-
import { buildChannelInboundEventContext, toInboundMediaFacts } from "openclaw/plugin-sdk/channel-inbound";
|
|
33
|
+
import { buildChannelInboundEventContext, formatInboundMediaUnavailableText, toInboundMediaFacts } from "openclaw/plugin-sdk/channel-inbound";
|
|
33
34
|
import { DEFAULT_GROUP_HISTORY_LIMIT, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
34
35
|
import { resolveDefaultGroupPolicy, resolveOpenProviderRuntimeGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
35
36
|
import { sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -97,22 +98,7 @@ function parseMessageContent(content, messageType) {
|
|
|
97
98
|
try {
|
|
98
99
|
const parsed = JSON.parse(content);
|
|
99
100
|
if (messageType === "text") return parsed.text || "";
|
|
100
|
-
if (
|
|
101
|
-
"image",
|
|
102
|
-
"file",
|
|
103
|
-
"audio",
|
|
104
|
-
"video",
|
|
105
|
-
"media",
|
|
106
|
-
"sticker"
|
|
107
|
-
].includes(messageType)) {
|
|
108
|
-
if (messageType === "audio") {
|
|
109
|
-
const speechToText = typeof parsed.speech_to_text === "string" ? parsed.speech_to_text.trim() : "";
|
|
110
|
-
if (speechToText) return speechToText;
|
|
111
|
-
}
|
|
112
|
-
const placeholder = inferPlaceholder(messageType);
|
|
113
|
-
const fileName = typeof parsed.file_name === "string" ? parsed.file_name.trim() : "";
|
|
114
|
-
return fileName ? `${placeholder} (${fileName})` : placeholder;
|
|
115
|
-
}
|
|
101
|
+
if (FEISHU_MEDIA_MESSAGE_TYPES.has(messageType)) return formatFeishuMediaContent(parsed, messageType).body;
|
|
116
102
|
if (messageType === "share_chat") {
|
|
117
103
|
if (parsed && typeof parsed === "object") {
|
|
118
104
|
const share = parsed;
|
|
@@ -128,6 +114,43 @@ function parseMessageContent(content, messageType) {
|
|
|
128
114
|
return content;
|
|
129
115
|
}
|
|
130
116
|
}
|
|
117
|
+
const FEISHU_MEDIA_MESSAGE_TYPES = /* @__PURE__ */ new Set([
|
|
118
|
+
"image",
|
|
119
|
+
"file",
|
|
120
|
+
"audio",
|
|
121
|
+
"video",
|
|
122
|
+
"media",
|
|
123
|
+
"sticker"
|
|
124
|
+
]);
|
|
125
|
+
function formatFeishuMediaContent(parsed, messageType) {
|
|
126
|
+
const speechToText = messageType === "audio" && typeof parsed.speech_to_text === "string" ? parsed.speech_to_text.trim() : "";
|
|
127
|
+
if (speechToText) return { body: speechToText };
|
|
128
|
+
const placeholder = inferPlaceholder(messageType);
|
|
129
|
+
const fileName = typeof parsed.file_name === "string" ? parsed.file_name.trim() : "";
|
|
130
|
+
return {
|
|
131
|
+
body: fileName ? `${placeholder} (${fileName})` : placeholder,
|
|
132
|
+
mediaPlaceholder: placeholder,
|
|
133
|
+
unavailableBody: fileName || void 0
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function resolveFeishuMediaFailurePresentation(content, messageType) {
|
|
137
|
+
if (messageType === "post") return { unavailableBody: parsePostContent(content, {
|
|
138
|
+
renderMediaPlaceholders: false,
|
|
139
|
+
emptyTextFallback: ""
|
|
140
|
+
}).textContent };
|
|
141
|
+
if (!FEISHU_MEDIA_MESSAGE_TYPES.has(messageType)) return {};
|
|
142
|
+
try {
|
|
143
|
+
const parsed = JSON.parse(content);
|
|
144
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
145
|
+
const presentation = formatFeishuMediaContent(parsed, messageType);
|
|
146
|
+
return {
|
|
147
|
+
mediaPlaceholder: presentation.mediaPlaceholder,
|
|
148
|
+
unavailableBody: presentation.unavailableBody
|
|
149
|
+
};
|
|
150
|
+
} catch {
|
|
151
|
+
return {};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
131
154
|
function formatSubMessageContent(content, contentType) {
|
|
132
155
|
try {
|
|
133
156
|
const parsed = JSON.parse(content);
|
|
@@ -248,11 +271,18 @@ async function resolveFeishuMediaList(params) {
|
|
|
248
271
|
"media",
|
|
249
272
|
"sticker",
|
|
250
273
|
"post"
|
|
251
|
-
].includes(messageType)) return
|
|
274
|
+
].includes(messageType)) return {
|
|
275
|
+
media: [],
|
|
276
|
+
unavailableCount: 0
|
|
277
|
+
};
|
|
252
278
|
const out = [];
|
|
279
|
+
let unavailableCount = 0;
|
|
253
280
|
if (messageType === "post") {
|
|
254
281
|
const { imageKeys, mediaKeys } = parsePostContent(content);
|
|
255
|
-
if (imageKeys.length === 0 && mediaKeys.length === 0) return
|
|
282
|
+
if (imageKeys.length === 0 && mediaKeys.length === 0) return {
|
|
283
|
+
media: [],
|
|
284
|
+
unavailableCount: 0
|
|
285
|
+
};
|
|
256
286
|
if (imageKeys.length > 0) log?.(`feishu: post message contains ${imageKeys.length} embedded image(s)`);
|
|
257
287
|
if (mediaKeys.length > 0) log?.(`feishu: post message contains ${mediaKeys.length} embedded media file(s)`);
|
|
258
288
|
for (const imageKey of imageKeys) try {
|
|
@@ -274,6 +304,7 @@ async function resolveFeishuMediaList(params) {
|
|
|
274
304
|
});
|
|
275
305
|
log?.(`feishu: downloaded embedded image ${imageKey}, saved to ${saved.path}`);
|
|
276
306
|
} catch (err) {
|
|
307
|
+
unavailableCount += 1;
|
|
277
308
|
log?.(`feishu: failed to download embedded image ${imageKey}: ${String(err)}`);
|
|
278
309
|
}
|
|
279
310
|
for (const media of mediaKeys) try {
|
|
@@ -297,15 +328,25 @@ async function resolveFeishuMediaList(params) {
|
|
|
297
328
|
});
|
|
298
329
|
log?.(`feishu: downloaded embedded media ${media.fileKey}, saved to ${saved.path}`);
|
|
299
330
|
} catch (err) {
|
|
331
|
+
unavailableCount += 1;
|
|
300
332
|
log?.(`feishu: failed to download embedded media ${media.fileKey}: ${String(err)}`);
|
|
301
333
|
}
|
|
302
|
-
return
|
|
334
|
+
return {
|
|
335
|
+
media: out,
|
|
336
|
+
unavailableCount
|
|
337
|
+
};
|
|
303
338
|
}
|
|
304
339
|
const mediaKeys = parseMediaKeys(content, messageType);
|
|
305
|
-
if (!mediaKeys.imageKey && !mediaKeys.fileKey) return
|
|
340
|
+
if (!mediaKeys.imageKey && !mediaKeys.fileKey) return {
|
|
341
|
+
media: [],
|
|
342
|
+
unavailableCount: 1
|
|
343
|
+
};
|
|
306
344
|
try {
|
|
307
345
|
const fileKey = mediaKeys.fileKey || mediaKeys.imageKey;
|
|
308
|
-
if (!fileKey) return
|
|
346
|
+
if (!fileKey) return {
|
|
347
|
+
media: [],
|
|
348
|
+
unavailableCount: 1
|
|
349
|
+
};
|
|
309
350
|
const saved = await resolveSavedFeishuMedia({
|
|
310
351
|
result: await saveMessageResourceFeishu({
|
|
311
352
|
cfg,
|
|
@@ -326,9 +367,13 @@ async function resolveFeishuMediaList(params) {
|
|
|
326
367
|
});
|
|
327
368
|
log?.(`feishu: downloaded ${messageType} media, saved to ${saved.path}`);
|
|
328
369
|
} catch (err) {
|
|
370
|
+
unavailableCount += 1;
|
|
329
371
|
log?.(`feishu: failed to download ${messageType} media: ${String(err)}`);
|
|
330
372
|
}
|
|
331
|
-
return
|
|
373
|
+
return {
|
|
374
|
+
media: out,
|
|
375
|
+
unavailableCount
|
|
376
|
+
};
|
|
332
377
|
}
|
|
333
378
|
//#endregion
|
|
334
379
|
//#region extensions/feishu/src/bot-sender-name.ts
|
|
@@ -881,7 +926,7 @@ function resolveAllowedHostnames(domain) {
|
|
|
881
926
|
}
|
|
882
927
|
return ["open.feishu.cn"];
|
|
883
928
|
}
|
|
884
|
-
async function getToken(creds) {
|
|
929
|
+
async function getToken(creds, deps) {
|
|
885
930
|
const key = `${creds.domain ?? "feishu"}|${creds.appId}`;
|
|
886
931
|
const cached = tokenCache.get(key);
|
|
887
932
|
const rawNow = Date.now();
|
|
@@ -902,15 +947,18 @@ async function getToken(creds) {
|
|
|
902
947
|
app_secret: creds.appSecret
|
|
903
948
|
})
|
|
904
949
|
},
|
|
950
|
+
fetchImpl: deps?.fetchImpl,
|
|
951
|
+
lookupFn: deps?.lookupFn,
|
|
905
952
|
policy: { allowedHostnames: resolveAllowedHostnames(creds.domain) },
|
|
906
953
|
auditContext: "feishu.streaming-card.token"
|
|
907
954
|
});
|
|
908
|
-
|
|
955
|
+
let data;
|
|
956
|
+
try {
|
|
957
|
+
if (!response.ok) throw new Error(`Token request failed with HTTP ${response.status}`);
|
|
958
|
+
data = await readFeishuJsonResponse(response, "feishu.streaming-card.token");
|
|
959
|
+
} finally {
|
|
909
960
|
await release();
|
|
910
|
-
throw new Error(`Token request failed with HTTP ${response.status}`);
|
|
911
961
|
}
|
|
912
|
-
const data = await response.json();
|
|
913
|
-
await release();
|
|
914
962
|
if (data.code !== 0 || !data.tenant_access_token) throw new Error(`Token error: ${data.msg}`);
|
|
915
963
|
tokenCache.set(key, {
|
|
916
964
|
token: data.tenant_access_token,
|
|
@@ -951,7 +999,7 @@ function resolveStreamingCardSendMode(options) {
|
|
|
951
999
|
}
|
|
952
1000
|
/** Streaming card session manager */
|
|
953
1001
|
var FeishuStreamingSession = class {
|
|
954
|
-
constructor(client, creds, log) {
|
|
1002
|
+
constructor(client, creds, log, deps) {
|
|
955
1003
|
this.state = null;
|
|
956
1004
|
this.queue = Promise.resolve();
|
|
957
1005
|
this.closed = false;
|
|
@@ -962,6 +1010,8 @@ var FeishuStreamingSession = class {
|
|
|
962
1010
|
this.client = client;
|
|
963
1011
|
this.creds = creds;
|
|
964
1012
|
this.log = log;
|
|
1013
|
+
this.fetchImpl = deps?.fetchImpl;
|
|
1014
|
+
this.lookupFn = deps?.lookupFn;
|
|
965
1015
|
}
|
|
966
1016
|
async start(receiveId, receiveIdType = "chat_id", options) {
|
|
967
1017
|
if (this.state) return;
|
|
@@ -1003,7 +1053,10 @@ var FeishuStreamingSession = class {
|
|
|
1003
1053
|
init: {
|
|
1004
1054
|
method: "POST",
|
|
1005
1055
|
headers: {
|
|
1006
|
-
Authorization: `Bearer ${await getToken(this.creds
|
|
1056
|
+
Authorization: `Bearer ${await getToken(this.creds, {
|
|
1057
|
+
fetchImpl: this.fetchImpl,
|
|
1058
|
+
lookupFn: this.lookupFn
|
|
1059
|
+
})}`,
|
|
1007
1060
|
"Content-Type": "application/json",
|
|
1008
1061
|
"User-Agent": getFeishuUserAgent()
|
|
1009
1062
|
},
|
|
@@ -1012,15 +1065,18 @@ var FeishuStreamingSession = class {
|
|
|
1012
1065
|
data: JSON.stringify(cardJson)
|
|
1013
1066
|
})
|
|
1014
1067
|
},
|
|
1068
|
+
fetchImpl: this.fetchImpl,
|
|
1069
|
+
lookupFn: this.lookupFn,
|
|
1015
1070
|
policy: { allowedHostnames: resolveAllowedHostnames(this.creds.domain) },
|
|
1016
1071
|
auditContext: "feishu.streaming-card.create"
|
|
1017
1072
|
});
|
|
1018
|
-
|
|
1073
|
+
let createData;
|
|
1074
|
+
try {
|
|
1075
|
+
if (!createRes.ok) throw new Error(`Create card request failed with HTTP ${createRes.status}`);
|
|
1076
|
+
createData = await readFeishuJsonResponse(createRes, "feishu.streaming-card.create");
|
|
1077
|
+
} finally {
|
|
1019
1078
|
await releaseCreate();
|
|
1020
|
-
throw new Error(`Create card request failed with HTTP ${createRes.status}`);
|
|
1021
1079
|
}
|
|
1022
|
-
const createData = await createRes.json();
|
|
1023
|
-
await releaseCreate();
|
|
1024
1080
|
if (createData.code !== 0 || !createData.data?.card_id) throw new Error(`Create card failed: ${createData.msg}`);
|
|
1025
1081
|
const cardId = createData.data.card_id;
|
|
1026
1082
|
const cardContent = JSON.stringify({
|
|
@@ -1075,7 +1131,10 @@ var FeishuStreamingSession = class {
|
|
|
1075
1131
|
init: {
|
|
1076
1132
|
method: "PUT",
|
|
1077
1133
|
headers: {
|
|
1078
|
-
Authorization: `Bearer ${await getToken(this.creds
|
|
1134
|
+
Authorization: `Bearer ${await getToken(this.creds, {
|
|
1135
|
+
fetchImpl: this.fetchImpl,
|
|
1136
|
+
lookupFn: this.lookupFn
|
|
1137
|
+
})}`,
|
|
1079
1138
|
"Content-Type": "application/json",
|
|
1080
1139
|
"User-Agent": getFeishuUserAgent()
|
|
1081
1140
|
},
|
|
@@ -1085,6 +1144,8 @@ var FeishuStreamingSession = class {
|
|
|
1085
1144
|
uuid: `s_${this.state.cardId}_${this.state.sequence}`
|
|
1086
1145
|
})
|
|
1087
1146
|
},
|
|
1147
|
+
fetchImpl: this.fetchImpl,
|
|
1148
|
+
lookupFn: this.lookupFn,
|
|
1088
1149
|
policy: { allowedHostnames: resolveAllowedHostnames(this.creds.domain) },
|
|
1089
1150
|
auditContext: "feishu.streaming-card.update"
|
|
1090
1151
|
});
|
|
@@ -1109,7 +1170,10 @@ var FeishuStreamingSession = class {
|
|
|
1109
1170
|
init: {
|
|
1110
1171
|
method: "PUT",
|
|
1111
1172
|
headers: {
|
|
1112
|
-
Authorization: `Bearer ${await getToken(this.creds
|
|
1173
|
+
Authorization: `Bearer ${await getToken(this.creds, {
|
|
1174
|
+
fetchImpl: this.fetchImpl,
|
|
1175
|
+
lookupFn: this.lookupFn
|
|
1176
|
+
})}`,
|
|
1113
1177
|
"Content-Type": "application/json",
|
|
1114
1178
|
"User-Agent": getFeishuUserAgent()
|
|
1115
1179
|
},
|
|
@@ -1123,6 +1187,8 @@ var FeishuStreamingSession = class {
|
|
|
1123
1187
|
uuid: `r_${this.state.cardId}_${this.state.sequence}`
|
|
1124
1188
|
})
|
|
1125
1189
|
},
|
|
1190
|
+
fetchImpl: this.fetchImpl,
|
|
1191
|
+
lookupFn: this.lookupFn,
|
|
1126
1192
|
policy: { allowedHostnames: resolveAllowedHostnames(this.creds.domain) },
|
|
1127
1193
|
auditContext: "feishu.streaming-card.replace"
|
|
1128
1194
|
});
|
|
@@ -1187,7 +1253,10 @@ var FeishuStreamingSession = class {
|
|
|
1187
1253
|
init: {
|
|
1188
1254
|
method: "PUT",
|
|
1189
1255
|
headers: {
|
|
1190
|
-
Authorization: `Bearer ${await getToken(this.creds
|
|
1256
|
+
Authorization: `Bearer ${await getToken(this.creds, {
|
|
1257
|
+
fetchImpl: this.fetchImpl,
|
|
1258
|
+
lookupFn: this.lookupFn
|
|
1259
|
+
})}`,
|
|
1191
1260
|
"Content-Type": "application/json",
|
|
1192
1261
|
"User-Agent": getFeishuUserAgent()
|
|
1193
1262
|
},
|
|
@@ -1197,6 +1266,8 @@ var FeishuStreamingSession = class {
|
|
|
1197
1266
|
uuid: `n_${this.state.cardId}_${this.state.sequence}`
|
|
1198
1267
|
})
|
|
1199
1268
|
},
|
|
1269
|
+
fetchImpl: this.fetchImpl,
|
|
1270
|
+
lookupFn: this.lookupFn,
|
|
1200
1271
|
policy: { allowedHostnames: resolveAllowedHostnames(this.creds.domain) },
|
|
1201
1272
|
auditContext: "feishu.streaming-card.note-update"
|
|
1202
1273
|
}).then(async ({ release }) => {
|
|
@@ -1227,7 +1298,10 @@ var FeishuStreamingSession = class {
|
|
|
1227
1298
|
init: {
|
|
1228
1299
|
method: "PATCH",
|
|
1229
1300
|
headers: {
|
|
1230
|
-
Authorization: `Bearer ${await getToken(this.creds
|
|
1301
|
+
Authorization: `Bearer ${await getToken(this.creds, {
|
|
1302
|
+
fetchImpl: this.fetchImpl,
|
|
1303
|
+
lookupFn: this.lookupFn
|
|
1304
|
+
})}`,
|
|
1231
1305
|
"Content-Type": "application/json; charset=utf-8",
|
|
1232
1306
|
"User-Agent": getFeishuUserAgent()
|
|
1233
1307
|
},
|
|
@@ -1240,6 +1314,8 @@ var FeishuStreamingSession = class {
|
|
|
1240
1314
|
uuid: `c_${this.state.cardId}_${this.state.sequence}`
|
|
1241
1315
|
})
|
|
1242
1316
|
},
|
|
1317
|
+
fetchImpl: this.fetchImpl,
|
|
1318
|
+
lookupFn: this.lookupFn,
|
|
1243
1319
|
policy: { allowedHostnames: resolveAllowedHostnames(this.creds.domain) },
|
|
1244
1320
|
auditContext: "feishu.streaming-card.close"
|
|
1245
1321
|
}).then(async ({ release }) => {
|
|
@@ -1287,7 +1363,7 @@ const TYPING_EMOJI = "Typing";
|
|
|
1287
1363
|
*
|
|
1288
1364
|
* @see https://open.feishu.cn/document/server-docs/api-call-guide/generic-error-code
|
|
1289
1365
|
*/
|
|
1290
|
-
const FEISHU_BACKOFF_CODES = new Set([
|
|
1366
|
+
const FEISHU_BACKOFF_CODES = /* @__PURE__ */ new Set([
|
|
1291
1367
|
99991400,
|
|
1292
1368
|
99991403,
|
|
1293
1369
|
429
|
|
@@ -1996,10 +2072,6 @@ function shouldSendNoVisibleReplyFallback(dispatchResult) {
|
|
|
1996
2072
|
const queuedFinalFailed = dispatchResult.queuedFinal === true && failedFinalCount > 0;
|
|
1997
2073
|
return dispatchResult.sendPolicyDenied !== true && dispatchResult.sourceReplyDeliveryMode !== "message_tool_only" && (emptyEligibleDispatch || queuedFinalFailed);
|
|
1998
2074
|
}
|
|
1999
|
-
function resolveConfiguredFeishuGroupSessionScope(params) {
|
|
2000
|
-
const legacyTopicSessionMode = params.groupConfig?.topicSessionMode ?? params.feishuCfg?.topicSessionMode ?? "disabled";
|
|
2001
|
-
return params.groupConfig?.groupSessionScope ?? params.feishuCfg?.groupSessionScope ?? (legacyTopicSessionMode === "enabled" ? "group_topic" : "group");
|
|
2002
|
-
}
|
|
2003
2075
|
function isFeishuTopicSessionScope(scope) {
|
|
2004
2076
|
return scope === "group_topic" || scope === "group_topic_sender";
|
|
2005
2077
|
}
|
|
@@ -2116,8 +2188,9 @@ function parseFeishuMessageEvent(event, botOpenId, _botName) {
|
|
|
2116
2188
|
content,
|
|
2117
2189
|
contentType: event.message.message_type
|
|
2118
2190
|
};
|
|
2119
|
-
|
|
2120
|
-
|
|
2191
|
+
const mentionForwardBotOpenId = botOpenId?.trim();
|
|
2192
|
+
if (mentionForwardBotOpenId && isMentionForwardRequest(event, mentionForwardBotOpenId)) {
|
|
2193
|
+
const mentionTargets = extractMentionTargets(event, mentionForwardBotOpenId);
|
|
2121
2194
|
if (mentionTargets.length > 0) ctx.mentionTargets = mentionTargets;
|
|
2122
2195
|
}
|
|
2123
2196
|
return ctx;
|
|
@@ -2576,7 +2649,7 @@ async function handleFeishuMessage(params) {
|
|
|
2576
2649
|
});
|
|
2577
2650
|
log(`feishu[${account.accountId}]: ${inboundLabel}: ${preview}`);
|
|
2578
2651
|
const mediaMaxBytes = (feishuCfg?.mediaMaxMb ?? 30) * 1024 * 1024;
|
|
2579
|
-
const
|
|
2652
|
+
const mediaResolution = await resolveFeishuMediaList({
|
|
2580
2653
|
cfg,
|
|
2581
2654
|
messageId: ctx.messageId,
|
|
2582
2655
|
messageType: event.message.message_type,
|
|
@@ -2585,6 +2658,13 @@ async function handleFeishuMessage(params) {
|
|
|
2585
2658
|
log,
|
|
2586
2659
|
accountId: account.accountId
|
|
2587
2660
|
});
|
|
2661
|
+
const mediaList = mediaResolution.media;
|
|
2662
|
+
const mediaFailurePresentation = resolveFeishuMediaFailurePresentation(event.message.content, event.message.message_type);
|
|
2663
|
+
const mediaFailureContent = mediaResolution.unavailableCount > 0 ? formatInboundMediaUnavailableText({
|
|
2664
|
+
body: mediaFailurePresentation.unavailableBody ?? ctx.content,
|
|
2665
|
+
mediaPlaceholder: mediaFailurePresentation.mediaPlaceholder,
|
|
2666
|
+
notice: `[feishu ${mediaResolution.unavailableCount > 1 ? `${mediaResolution.unavailableCount} attachments` : "attachment"} unavailable]`
|
|
2667
|
+
}) : ctx.content;
|
|
2588
2668
|
let quotedMessageInfo = null;
|
|
2589
2669
|
let quotedContent;
|
|
2590
2670
|
if (ctx.parentId) try {
|
|
@@ -2610,7 +2690,7 @@ async function handleFeishuMessage(params) {
|
|
|
2610
2690
|
} catch (err) {
|
|
2611
2691
|
log(`feishu[${account.accountId}]: failed to fetch quoted message: ${String(err)}`);
|
|
2612
2692
|
}
|
|
2613
|
-
if (!
|
|
2693
|
+
if (!mediaFailureContent.trim() && mediaList.length === 0 && !quotedContent?.trim()) {
|
|
2614
2694
|
log(`feishu[${account.accountId}]: skipping empty message (no text, no media, no quoted) from ${ctx.senderOpenId}`);
|
|
2615
2695
|
return;
|
|
2616
2696
|
}
|
|
@@ -2623,10 +2703,11 @@ async function handleFeishuMessage(params) {
|
|
|
2623
2703
|
});
|
|
2624
2704
|
const preflightAudioIndex = audioTranscript === void 0 ? -1 : mediaList.findIndex((media) => media.contentType?.startsWith("audio/"));
|
|
2625
2705
|
const inboundMedia = toInboundMediaFacts(mediaList, { transcribed: (_media, index) => index === preflightAudioIndex });
|
|
2626
|
-
const agentFacingContent = audioTranscript ??
|
|
2627
|
-
const
|
|
2706
|
+
const agentFacingContent = audioTranscript ?? mediaFailureContent;
|
|
2707
|
+
const commandFacingContent = audioTranscript ?? ctx.content;
|
|
2708
|
+
const agentFacingCtx = agentFacingContent === ctx.content ? ctx : {
|
|
2628
2709
|
...ctx,
|
|
2629
|
-
content:
|
|
2710
|
+
content: agentFacingContent
|
|
2630
2711
|
};
|
|
2631
2712
|
const effectiveCommandProbeBody = audioTranscript === void 0 ? commandProbeBody : isGroup ? normalizeFeishuCommandProbeBody(audioTranscript) : audioTranscript;
|
|
2632
2713
|
const commandAuthorized = (audioTranscript === void 0 ? effectiveShouldComputeCommandAuthorized : core.channel.commands.shouldComputeCommandAuthorized(effectiveCommandProbeBody, effectiveCfg)) ? isDirect && audioTranscript === void 0 && effectiveDmIngress ? effectiveDmIngress.commandAccess.authorized : isGroup ? (await resolveFeishuGroupSenderActivationIngressAccess({
|
|
@@ -2845,8 +2926,8 @@ async function handleFeishuMessage(params) {
|
|
|
2845
2926
|
body: combinedBody,
|
|
2846
2927
|
bodyForAgent: messageBody,
|
|
2847
2928
|
inboundHistory,
|
|
2848
|
-
rawBody:
|
|
2849
|
-
commandBody:
|
|
2929
|
+
rawBody: commandFacingContent,
|
|
2930
|
+
commandBody: commandFacingContent
|
|
2850
2931
|
},
|
|
2851
2932
|
access: {
|
|
2852
2933
|
mentions: {
|
|
@@ -3358,7 +3439,7 @@ function pruneChatTypeCache(now) {
|
|
|
3358
3439
|
}
|
|
3359
3440
|
}
|
|
3360
3441
|
function sanitizeLogValue(v) {
|
|
3361
|
-
return v.replace(/[\r\n]/g, " ")
|
|
3442
|
+
return truncateUtf16Safe(v.replace(/[\r\n]/g, " "), 500);
|
|
3362
3443
|
}
|
|
3363
3444
|
function resolveFeishuApprovalCardExpiresAt(nowRaw = Date.now()) {
|
|
3364
3445
|
const now = asDateTimestampMs(nowRaw);
|
|
@@ -3637,7 +3718,7 @@ function startBotIdentityRecovery(params) {
|
|
|
3637
3718
|
//#endregion
|
|
3638
3719
|
//#region extensions/feishu/src/card-ux-launcher.ts
|
|
3639
3720
|
const FEISHU_QUICK_ACTION_CARD_TTL_MS = 10 * 6e4;
|
|
3640
|
-
const QUICK_ACTION_MENU_KEYS = new Set([
|
|
3721
|
+
const QUICK_ACTION_MENU_KEYS = /* @__PURE__ */ new Set([
|
|
3641
3722
|
"quick-actions",
|
|
3642
3723
|
"quick_actions",
|
|
3643
3724
|
"launcher"
|
|
@@ -4152,7 +4233,7 @@ function selectCommentThreadPromptReplies(replies, targetReplyId) {
|
|
|
4152
4233
|
if (replies.length <= FEISHU_COMMENT_THREAD_PROMPT_LIMIT) return replies;
|
|
4153
4234
|
const targetIndex = replies.findIndex((reply) => reply.replyId === targetReplyId);
|
|
4154
4235
|
const currentIndex = targetIndex >= 0 ? targetIndex : replies.length - 1;
|
|
4155
|
-
const selected = new Set([
|
|
4236
|
+
const selected = /* @__PURE__ */ new Set([
|
|
4156
4237
|
0,
|
|
4157
4238
|
currentIndex,
|
|
4158
4239
|
replies.length - 1
|
|
@@ -4184,7 +4265,7 @@ function selectWholeCommentTimelineEntries(params) {
|
|
|
4184
4265
|
if (params.entries.length <= FEISHU_WHOLE_COMMENT_PROMPT_LIMIT) return params.entries;
|
|
4185
4266
|
const currentIndex = params.entries.findIndex((entry) => entry.commentId === params.currentCommentId);
|
|
4186
4267
|
if (currentIndex < 0) return params.entries.slice(-12);
|
|
4187
|
-
const selected = new Set([currentIndex]);
|
|
4268
|
+
const selected = /* @__PURE__ */ new Set([currentIndex]);
|
|
4188
4269
|
const nearestBotAfter = params.entries.findIndex((entry, index) => index > currentIndex && entry.isBotAuthored);
|
|
4189
4270
|
if (nearestBotAfter >= 0) selected.add(nearestBotAfter);
|
|
4190
4271
|
for (let index = currentIndex - 1; index >= 0; index -= 1) if (params.entries[index]?.isBotAuthored) {
|
|
@@ -4425,7 +4506,7 @@ async function resolveDriveCommentEventCore(params) {
|
|
|
4425
4506
|
return null;
|
|
4426
4507
|
}
|
|
4427
4508
|
const context = await fetchDriveCommentContext({
|
|
4428
|
-
client: createClient ? createClient(account ?? { accountId }) : createFeishuClient((await import("./accounts-
|
|
4509
|
+
client: createClient ? createClient(account ?? { accountId }) : createFeishuClient((await import("./accounts-Bs5uJ4h0.js").then((n) => n.t)).resolveFeishuAccount({
|
|
4429
4510
|
cfg,
|
|
4430
4511
|
accountId
|
|
4431
4512
|
})),
|
|
@@ -5159,7 +5240,7 @@ function formatFeishuWsErrorForLog(err) {
|
|
|
5159
5240
|
}).join("").replace(/:\/\/[^:@/\s]+:[^@/\s]+@/g, "://[redacted]@").replace(/\b(authorization\s*[:=]\s*Bearer\s+)[^\s,;]+/gi, "$1[redacted]").replace(/\b(Bearer\s+)[A-Za-z0-9._~+/-]+=*/g, "$1[redacted]").replace(/\b((?:app[_-]?secret|tenant[_-]?access[_-]?token|access[_-]?token|refresh[_-]?token|token|secret|password)\s*[:=]\s*)[^\s&;,]+/gi, "$1[redacted]").replace(/\s+/g, " ").trim();
|
|
5160
5241
|
if (!redacted) return "unknown error";
|
|
5161
5242
|
if (redacted.length <= FEISHU_WS_LOG_ERROR_MAX_LENGTH) return redacted;
|
|
5162
|
-
return `${redacted
|
|
5243
|
+
return `${truncateUtf16Safe(redacted, FEISHU_WS_LOG_ERROR_MAX_LENGTH)}...`;
|
|
5163
5244
|
}
|
|
5164
5245
|
function isFeishuWsTerminalError(err) {
|
|
5165
5246
|
const message = err.message.trim();
|
|
@@ -5441,7 +5522,7 @@ async function resolveReactionSyntheticEvent(params) {
|
|
|
5441
5522
|
const senderId = event.user_id?.open_id;
|
|
5442
5523
|
const senderUserId = event.user_id?.user_id;
|
|
5443
5524
|
if (!emoji || !messageId || !senderId) return null;
|
|
5444
|
-
const { resolveFeishuAccount } = await import("./accounts-
|
|
5525
|
+
const { resolveFeishuAccount } = await import("./accounts-Bs5uJ4h0.js").then((n) => n.t);
|
|
5445
5526
|
const reactionNotifications = resolveFeishuAccount({
|
|
5446
5527
|
cfg,
|
|
5447
5528
|
accountId
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as setFeishuRuntime } from "./runtime-C5JxBWZp.js";
|
|
2
2
|
import { createReplyPrefixContext } from "openclaw/plugin-sdk/channel-outbound";
|
|
3
3
|
import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
|
|
4
|
-
import { PAIRING_APPROVED_MESSAGE, buildProbeChannelStatusSummary, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/channel-status";
|
|
5
4
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
5
|
+
import { PAIRING_APPROVED_MESSAGE, buildProbeChannelStatusSummary, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/channel-status";
|
|
6
6
|
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
7
7
|
import { getSessionEntry } from "openclaw/plugin-sdk/session-store-runtime";
|
|
8
8
|
import { DEFAULT_ACCOUNT_ID, buildChannelConfigSchema, createActionGate, createDedupeCache } from "openclaw/plugin-sdk/core";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { d as isRecord$1, h as requestFeishuApi, s as resolveFeishuRuntimeAccount } from "./accounts-
|
|
1
|
+
import { d as isRecord$1, h as requestFeishuApi, s as resolveFeishuRuntimeAccount } from "./accounts-Bs5uJ4h0.js";
|
|
2
2
|
import { i as resolveReceiveIdType, r as normalizeFeishuTarget } from "./targets-BUjQ1TcA.js";
|
|
3
|
-
import { i as toFeishuSendResult, r as resolveFeishuReceiptKind, t as assertFeishuMessageApiSuccess } from "./send-result-
|
|
3
|
+
import { i as toFeishuSendResult, o as resolveFeishuCardTemplate, r as resolveFeishuReceiptKind, t as assertFeishuMessageApiSuccess } from "./send-result-BMQw-YhV.js";
|
|
4
4
|
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.js";
|
|
5
5
|
import { r as createFeishuClient } from "./client-BwgAJuvo.js";
|
|
6
6
|
import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
7
|
-
import { isRecord, normalizeLowercaseStringOrEmpty
|
|
7
|
+
import { isRecord, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { convertMarkdownTables } from "openclaw/plugin-sdk/text-chunking";
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import path from "node:path";
|
|
@@ -73,7 +73,7 @@ const FEISHU_MEDIA_HTTP_TIMEOUT_MS = 12e4;
|
|
|
73
73
|
const FEISHU_VOICE_FILE_NAME = "voice.ogg";
|
|
74
74
|
const FEISHU_VOICE_SAMPLE_RATE_HZ = 48e3;
|
|
75
75
|
const FEISHU_VOICE_BITRATE = "64k";
|
|
76
|
-
const FEISHU_TRANSCODABLE_AUDIO_EXTS = new Set([
|
|
76
|
+
const FEISHU_TRANSCODABLE_AUDIO_EXTS = /* @__PURE__ */ new Set([
|
|
77
77
|
".aac",
|
|
78
78
|
".aiff",
|
|
79
79
|
".alac",
|
|
@@ -641,7 +641,7 @@ function isFeishuBroadcastMention(mention) {
|
|
|
641
641
|
function extractMentionTargets(event, botOpenId) {
|
|
642
642
|
return (event.message.mentions ?? []).filter((m) => {
|
|
643
643
|
if (isFeishuBroadcastMention(m)) return false;
|
|
644
|
-
if (
|
|
644
|
+
if (m.id.open_id === botOpenId) return false;
|
|
645
645
|
return Boolean(m.id.open_id);
|
|
646
646
|
}).map((m) => ({
|
|
647
647
|
openId: m.id.open_id,
|
|
@@ -658,11 +658,13 @@ function extractMentionTargets(event, botOpenId) {
|
|
|
658
658
|
function isMentionForwardRequest(event, botOpenId) {
|
|
659
659
|
const mentions = event.message.mentions ?? [];
|
|
660
660
|
if (mentions.length === 0) return false;
|
|
661
|
+
const normalizedBotOpenId = botOpenId?.trim();
|
|
662
|
+
if (!normalizedBotOpenId) return false;
|
|
661
663
|
const isDirectMessage = !isFeishuGroupChatType(event.message.chat_type);
|
|
662
664
|
const userMentions = mentions.filter((m) => !isFeishuBroadcastMention(m));
|
|
663
|
-
const hasOtherMention = userMentions.some((m) => m.id.open_id !==
|
|
665
|
+
const hasOtherMention = userMentions.some((m) => m.id.open_id !== normalizedBotOpenId);
|
|
664
666
|
if (isDirectMessage) return hasOtherMention;
|
|
665
|
-
return userMentions.some((m) => m.id.open_id ===
|
|
667
|
+
return userMentions.some((m) => m.id.open_id === normalizedBotOpenId) && hasOtherMention;
|
|
666
668
|
}
|
|
667
669
|
/**
|
|
668
670
|
* Format @mention for card message (lark_md)
|
|
@@ -734,7 +736,7 @@ function renderCodeBlockElement(element) {
|
|
|
734
736
|
const code = (toStringOrEmpty(element.text) || toStringOrEmpty(element.content)).replace(/\r\n/g, "\n");
|
|
735
737
|
return `\`\`\`${language}\n${code}${code.endsWith("\n") ? "" : "\n"}\`\`\``;
|
|
736
738
|
}
|
|
737
|
-
function renderElement(element, imageKeys, mediaKeys, mentionedOpenIds) {
|
|
739
|
+
function renderElement(element, imageKeys, mediaKeys, mentionedOpenIds, renderMediaPlaceholders) {
|
|
738
740
|
if (!isRecord$1(element)) return escapeMarkdownText(toStringOrEmpty(element));
|
|
739
741
|
switch (normalizeLowercaseStringOrEmpty(toStringOrEmpty(element.tag))) {
|
|
740
742
|
case "text": return renderTextElement(element);
|
|
@@ -748,7 +750,7 @@ function renderElement(element, imageKeys, mediaKeys, mentionedOpenIds) {
|
|
|
748
750
|
case "img": {
|
|
749
751
|
const imageKey = normalizeFeishuExternalKey(toStringOrEmpty(element.image_key));
|
|
750
752
|
if (imageKey) imageKeys.push(imageKey);
|
|
751
|
-
return "![image]";
|
|
753
|
+
return renderMediaPlaceholders ? "![image]" : "";
|
|
752
754
|
}
|
|
753
755
|
case "media": {
|
|
754
756
|
const fileKey = normalizeFeishuExternalKey(toStringOrEmpty(element.file_key));
|
|
@@ -759,7 +761,7 @@ function renderElement(element, imageKeys, mediaKeys, mentionedOpenIds) {
|
|
|
759
761
|
fileName
|
|
760
762
|
});
|
|
761
763
|
}
|
|
762
|
-
return "[media]";
|
|
764
|
+
return renderMediaPlaceholders ? "[media]" : "";
|
|
763
765
|
}
|
|
764
766
|
case "emotion": return renderEmotionElement(element);
|
|
765
767
|
case "md":
|
|
@@ -800,7 +802,7 @@ function resolvePostPayload(parsed) {
|
|
|
800
802
|
if (wrappedPost) return wrappedPost;
|
|
801
803
|
return resolveLocalePayload(parsed);
|
|
802
804
|
}
|
|
803
|
-
function parsePostContent(content) {
|
|
805
|
+
function parsePostContent(content, options = {}) {
|
|
804
806
|
try {
|
|
805
807
|
const payload = resolvePostPayload(JSON.parse(content));
|
|
806
808
|
if (!payload) return {
|
|
@@ -816,11 +818,11 @@ function parsePostContent(content) {
|
|
|
816
818
|
for (const paragraph of payload.content) {
|
|
817
819
|
if (!Array.isArray(paragraph)) continue;
|
|
818
820
|
let renderedParagraph = "";
|
|
819
|
-
for (const element of paragraph) renderedParagraph += renderElement(element, imageKeys, mediaKeys, mentionedOpenIds);
|
|
821
|
+
for (const element of paragraph) renderedParagraph += renderElement(element, imageKeys, mediaKeys, mentionedOpenIds, options.renderMediaPlaceholders !== false);
|
|
820
822
|
paragraphs.push(renderedParagraph);
|
|
821
823
|
}
|
|
822
824
|
return {
|
|
823
|
-
textContent: [escapeMarkdownText(payload.title.trim()), paragraphs.join("\n").trim()].filter(Boolean).join("\n\n").trim() || FALLBACK_POST_TEXT,
|
|
825
|
+
textContent: [escapeMarkdownText(payload.title.trim()), paragraphs.join("\n").trim()].filter(Boolean).join("\n\n").trim() || (options.emptyTextFallback ?? FALLBACK_POST_TEXT),
|
|
824
826
|
imageKeys,
|
|
825
827
|
mediaKeys,
|
|
826
828
|
mentionedOpenIds
|
|
@@ -836,24 +838,9 @@ function parsePostContent(content) {
|
|
|
836
838
|
}
|
|
837
839
|
//#endregion
|
|
838
840
|
//#region extensions/feishu/src/send.ts
|
|
839
|
-
const WITHDRAWN_REPLY_ERROR_CODES = new Set([230011, 231003]);
|
|
841
|
+
const WITHDRAWN_REPLY_ERROR_CODES = /* @__PURE__ */ new Set([230011, 231003]);
|
|
840
842
|
const INTERACTIVE_CARD_FALLBACK_TEXT = "[Interactive Card]";
|
|
841
843
|
const POST_FALLBACK_TEXT = "[Rich text message]";
|
|
842
|
-
const FEISHU_CARD_TEMPLATES = new Set([
|
|
843
|
-
"blue",
|
|
844
|
-
"green",
|
|
845
|
-
"red",
|
|
846
|
-
"orange",
|
|
847
|
-
"purple",
|
|
848
|
-
"indigo",
|
|
849
|
-
"wathet",
|
|
850
|
-
"turquoise",
|
|
851
|
-
"yellow",
|
|
852
|
-
"grey",
|
|
853
|
-
"carmine",
|
|
854
|
-
"violet",
|
|
855
|
-
"lime"
|
|
856
|
-
]);
|
|
857
844
|
function shouldFallbackFromReplyTarget(response) {
|
|
858
845
|
if (response.code !== void 0 && WITHDRAWN_REPLY_ERROR_CODES.has(response.code)) return true;
|
|
859
846
|
const msg = normalizeLowercaseStringOrEmpty(response.msg);
|
|
@@ -1202,11 +1189,6 @@ function buildMarkdownCard(text) {
|
|
|
1202
1189
|
}] }
|
|
1203
1190
|
};
|
|
1204
1191
|
}
|
|
1205
|
-
function resolveFeishuCardTemplate(template) {
|
|
1206
|
-
const normalized = normalizeOptionalLowercaseString(template);
|
|
1207
|
-
if (!normalized || !FEISHU_CARD_TEMPLATES.has(normalized)) return;
|
|
1208
|
-
return normalized;
|
|
1209
|
-
}
|
|
1210
1192
|
/**
|
|
1211
1193
|
* Build a Feishu interactive card with optional header and note footer.
|
|
1212
1194
|
* When header/note are omitted, behaves identically to buildMarkdownCard.
|
|
@@ -1276,4 +1258,4 @@ async function sendMarkdownCardFeishu(params) {
|
|
|
1276
1258
|
});
|
|
1277
1259
|
}
|
|
1278
1260
|
//#endregion
|
|
1279
|
-
export {
|
|
1261
|
+
export { resolveFeishuIdentityEmoji as _, sendMarkdownCardFeishu as a, parsePostContent as c, isMentionForwardRequest as d, isFeishuGroupChatType as f, normalizeFeishuExternalKey as g, shouldSuppressFeishuTextForVoiceMedia as h, sendCardFeishu as i, extractMentionTargets as l, sendMediaFeishu as m, getMessageFeishu as n, sendMessageFeishu as o, saveMessageResourceFeishu as p, listFeishuThreadMessages as r, sendStructuredCardFeishu as s, editMessageFeishu as t, isFeishuBroadcastMention as u, resolveFeishuIdentityHeaderTitle as v };
|