@openclaw/feishu 2026.10.2 → 2026.10.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{app-registration-BB6TubaW.mjs → app-registration-DQOq5urV.mjs} +13 -32
- package/dist/.setup/{channel-DZakdZ3r.mjs → channel-CjGGyrdx.mjs} +87 -174
- package/dist/.setup/{channel.runtime-rXFuQXLL.mjs → channel.runtime-SaC_uTPM.mjs} +57 -74
- package/dist/.setup/{chat-mTBvMMvx.mjs → chat-fC3dvxFs.mjs} +16 -28
- package/dist/.setup/{client-CcxmEkoy.mjs → client-wwr8PGPH.mjs} +24 -30
- package/dist/.setup/{conversation-id-C1ofUfU8.mjs → conversation-id-D00i9uy5.mjs} +5 -10
- package/dist/.setup/{doctor-contract-DyOo8NvC.mjs → doctor-contract-oIpUWtNO.mjs} +8 -15
- package/dist/.setup/{monitor-CXaFHMmi.mjs → monitor-Yt__BUki.mjs} +33 -54
- package/dist/.setup/{monitor.account-cJ8gavqv.mjs → monitor.account-CVz16781.mjs} +359 -658
- package/dist/.setup/{probe-BjSykXB8.mjs → probe-DXnFxq5j.mjs} +14 -17
- package/dist/.setup/{reply-delivery-result-laBNOmBu.mjs → reply-delivery-result-iCCrdxE1.mjs} +153 -181
- package/dist/.setup/{session-conversation-C53IEUWt.mjs → session-conversation-BSBNK5Mq.mjs} +1 -1
- package/dist/.setup/{setup-api-fZcYXGxe.mjs → setup-api-B_LFQQ-Q.mjs} +1 -1
- package/dist/.setup/{subagent-hooks-C8Z_x3KJ.mjs → subagent-hooks-9Pc1-k37.mjs} +7 -17
- package/dist/.setup/{thread-bindings-jW2x5VuN.mjs → thread-bindings-DdNLxoL3.mjs} +21 -44
- package/dist/api.js +218 -326
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/doctor-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 +1 -1
- package/dist/subagent-hooks-api.js +1 -1
- package/node_modules/@openclaw/fs-safe/CHANGELOG.md +35 -0
- package/node_modules/@openclaw/fs-safe/README.md +1 -1
- package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/advanced.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-durability.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-merge.js +4 -4
- package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-read.js +5 -4
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.js +22 -38
- package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.js +117 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.d.ts +8 -5
- package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.js +27 -50
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.js +57 -11
- package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.js +5 -5
- package/node_modules/@openclaw/fs-safe/dist/guest-native-python.js +52 -5
- package/node_modules/@openclaw/fs-safe/dist/guest.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/native-operations.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/native-operations.js +22 -26
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.js +5 -1
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/permission-exec.js +2 -1
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.d.ts +6 -1
- package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/publish-file.js +34 -7
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +1 -4
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +6 -0
- package/node_modules/@openclaw/fs-safe/dist/root-create-input.d.ts +15 -1
- package/node_modules/@openclaw/fs-safe/dist/root-create-input.js +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +6 -12
- package/node_modules/@openclaw/fs-safe/dist/root-impl.js +15 -15
- package/node_modules/@openclaw/fs-safe/dist/root-paths.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-walk.js +4 -4
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.d.ts +10 -1
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.js +20 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.js +19 -7
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +25 -3
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.js +187 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.js +15 -1
- package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.js +29 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-target.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.js +6 -6
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts +4 -4
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.js +17 -16
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.js +20 -28
- package/node_modules/@openclaw/fs-safe/dist/walk.js +2 -13
- package/node_modules/@openclaw/fs-safe/dist/watch-native.d.ts +2 -2
- package/node_modules/@openclaw/fs-safe/dist/watch-native.js +3 -1
- package/node_modules/@openclaw/fs-safe/dist/watch-rescan.js +3 -9
- package/node_modules/@openclaw/fs-safe/dist/watch.js +2 -3
- package/node_modules/@openclaw/fs-safe/docs/advanced.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/archive.md +3 -0
- package/node_modules/@openclaw/fs-safe/docs/atomic.md +11 -3
- package/node_modules/@openclaw/fs-safe/docs/contributing.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/copy.md +48 -0
- package/node_modules/@openclaw/fs-safe/docs/guest.md +21 -4
- package/node_modules/@openclaw/fs-safe/docs/path-scope.md +4 -0
- package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +46 -8
- package/node_modules/@openclaw/fs-safe/docs/temp.md +12 -0
- package/node_modules/@openclaw/fs-safe/docs/watch.md +3 -2
- package/node_modules/@openclaw/fs-safe/package.json +15 -15
- package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
- package/node_modules/follow-redirects/index.js +10 -1
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/mdast-util-to-markdown/index.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/configure.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/configure.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/configure.js +19 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js +12 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/break.js +16 -5
- package/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/code.js +13 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts +30 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js +39 -41
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.js +11 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/html.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts +10 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js +17 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts +10 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/image.js +10 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts +9 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +14 -4
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts +10 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js +17 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts +13 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/link.js +24 -9
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.js +12 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/list.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/root.js +13 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts +30 -2
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.js +39 -41
- package/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/text.js +7 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts +6 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js +6 -0
- package/node_modules/mdast-util-to-markdown/lib/index.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/index.js +34 -8
- package/node_modules/mdast-util-to-markdown/lib/join.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/join.js +18 -1
- package/node_modules/mdast-util-to-markdown/lib/types.d.ts +50 -30
- package/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/unsafe.js +15 -1
- package/node_modules/mdast-util-to-markdown/lib/util/character.d.ts +23 -0
- package/node_modules/mdast-util-to-markdown/lib/util/character.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/character.js +32 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.js +4 -0
- package/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js +3 -1
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.js +9 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts +95 -4
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +636 -57
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts +2 -2
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.js +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js +12 -7
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +7 -2
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js +20 -15
- package/node_modules/mdast-util-to-markdown/lib/util/html-kind.d.ts +31 -0
- package/node_modules/mdast-util-to-markdown/lib/util/html-kind.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/html-kind.js +63 -0
- package/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts +5 -0
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts +2 -2
- package/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts.map +1 -1
- package/node_modules/mdast-util-to-markdown/lib/util/safe.js +71 -7
- package/node_modules/mdast-util-to-markdown/package.json +13 -57
- package/node_modules/mdast-util-to-markdown/readme.md +139 -84
- package/node_modules/micromark/dev/lib/compile.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/compile.js +14 -4
- package/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/create-tokenizer.js +7 -6
- package/node_modules/micromark/dev/lib/initialize/document.js +25 -21
- package/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/initialize/text.js +10 -6
- package/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/preprocess.js +19 -21
- package/node_modules/micromark/lib/compile.d.ts.map +1 -1
- package/node_modules/micromark/lib/compile.js +37 -29
- package/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -1
- package/node_modules/micromark/lib/create-tokenizer.js +37 -35
- package/node_modules/micromark/lib/initialize/document.js +21 -13
- package/node_modules/micromark/lib/initialize/text.d.ts.map +1 -1
- package/node_modules/micromark/lib/initialize/text.js +7 -3
- package/node_modules/micromark/lib/preprocess.d.ts.map +1 -1
- package/node_modules/micromark/lib/preprocess.js +16 -19
- package/node_modules/micromark/package.json +2 -15
- package/node_modules/micromark-core-commonmark/dev/lib/attention.js +18 -24
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +1 -43
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +19 -43
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +2 -6
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +2 -53
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.js +14 -12
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +14 -5
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +14 -5
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.js +67 -0
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +8 -5
- package/node_modules/micromark-core-commonmark/lib/attention.js +14 -24
- package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/code-fenced.js +1 -39
- package/node_modules/micromark-core-commonmark/lib/code-indented.js +11 -29
- package/node_modules/micromark-core-commonmark/lib/heading-atx.js +2 -6
- package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/html-flow.js +2 -51
- package/node_modules/micromark-core-commonmark/lib/label-end.js +11 -10
- package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/label-start-image.js +11 -3
- package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/label-start-link.js +11 -3
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js +61 -0
- package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/setext-underline.js +7 -5
- package/node_modules/micromark-core-commonmark/package.json +4 -16
- package/node_modules/micromark-factory-space/dev/index.d.ts +24 -1
- package/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -1
- package/node_modules/micromark-factory-space/dev/index.js +58 -3
- package/node_modules/micromark-factory-space/index.d.ts +24 -1
- package/node_modules/micromark-factory-space/index.d.ts.map +1 -1
- package/node_modules/micromark-factory-space/index.js +55 -3
- package/node_modules/micromark-factory-space/package.json +1 -10
- package/node_modules/micromark-factory-space/readme.md +25 -25
- package/node_modules/micromark-util-edit-map/dev/index.d.ts +78 -0
- package/node_modules/micromark-util-edit-map/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-edit-map/dev/index.js +237 -0
- package/node_modules/micromark-util-edit-map/index.d.ts +78 -0
- package/node_modules/micromark-util-edit-map/index.d.ts.map +1 -0
- package/node_modules/micromark-util-edit-map/index.js +225 -0
- package/node_modules/micromark-util-edit-map/license +22 -0
- package/node_modules/micromark-util-edit-map/package.json +48 -0
- package/node_modules/micromark-util-edit-map/readme.md +234 -0
- package/node_modules/micromark-util-types/index.d.ts +6 -3
- package/node_modules/micromark-util-types/package.json +2 -36
- package/node_modules/ws/lib/websocket.js +17 -3
- package/node_modules/ws/package.json +1 -1
- package/package.json +5 -5
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.d.ts +0 -17
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.js +0 -66
- package/node_modules/@openclaw/fs-safe/dist/publish-file-native.d.ts +0 -4
- package/node_modules/@openclaw/fs-safe/dist/publish-file-native.js +0 -35
- package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.d.ts +0 -7
- package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.js +0 -16
- package/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts +0 -7
- package/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts.map +0 -1
package/dist/.setup/{reply-delivery-result-laBNOmBu.mjs → reply-delivery-result-iCCrdxE1.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as normalizeFeishuExternalKey, d as listEnabledFeishuAccounts, f as listFeishuAccountIds, g as resolveFeishuRuntimeAccount, h as resolveFeishuAccount, m as resolveDefaultFeishuAccountId } from "./doctor-contract-
|
|
2
|
-
import { l as normalizeFeishuTarget, s as detectIdType, u as resolveReceiveIdType } from "./conversation-id-
|
|
1
|
+
import { c as normalizeFeishuExternalKey, d as listEnabledFeishuAccounts, f as listFeishuAccountIds, g as resolveFeishuRuntimeAccount, h as resolveFeishuAccount, m as resolveDefaultFeishuAccountId } from "./doctor-contract-oIpUWtNO.mjs";
|
|
2
|
+
import { l as normalizeFeishuTarget, s as detectIdType, u as resolveReceiveIdType } from "./conversation-id-D00i9uy5.mjs";
|
|
3
3
|
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.mjs";
|
|
4
|
-
import { c as withFeishuMessageDispatch, o as captureFeishuSendAuthority, r as createFeishuClient, s as runBeforeFeishuMessageDispatch } from "./client-
|
|
4
|
+
import { c as withFeishuMessageDispatch, o as captureFeishuSendAuthority, r as createFeishuClient, s as runBeforeFeishuMessageDispatch } from "./client-wwr8PGPH.mjs";
|
|
5
5
|
import { normalizeAccountId, normalizeOptionalAccountId, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
|
|
6
6
|
import { compileAllowlist, resolveAllowlistMatchByCandidates } from "openclaw/plugin-sdk/allow-from";
|
|
7
7
|
import { ToolAuthorizationError } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -27,12 +27,13 @@ import { retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
|
27
27
|
import { readPositiveIntegerParam } from "openclaw/plugin-sdk/param-readers";
|
|
28
28
|
import { Type } from "typebox";
|
|
29
29
|
import { isBlockedHostnameOrIp, resolvePinnedHostnameWithPolicy } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
30
|
+
import { containsAsciiControlCharacter } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
30
31
|
import { detectMime, mediaKindFromMime } from "openclaw/plugin-sdk/media-mime";
|
|
31
32
|
import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, buildOutboundMediaLoadOptions, runFfmpeg, runFfprobe } from "openclaw/plugin-sdk/media-runtime";
|
|
32
33
|
import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
|
|
33
34
|
import { saveMediaStream } from "openclaw/plugin-sdk/media-store";
|
|
34
35
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
35
|
-
import { escapeHtml, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
36
|
+
import { escapeHtml, escapeRegExp, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
36
37
|
//#region extensions/feishu/src/card-interaction.ts
|
|
37
38
|
const FEISHU_CARD_INTERACTION_VERSION = "ocf1";
|
|
38
39
|
function isInteractionKind(value) {
|
|
@@ -350,11 +351,7 @@ function isFeishuGroupReadAllowed(cfg, account, chatId, current) {
|
|
|
350
351
|
}).allowed;
|
|
351
352
|
}
|
|
352
353
|
function isFeishuGroupReadEnabled(cfg, account, chatId) {
|
|
353
|
-
|
|
354
|
-
return resolveFeishuGroupConfig({
|
|
355
|
-
cfg: account.config,
|
|
356
|
-
groupId: chatId
|
|
357
|
-
})?.enabled !== false;
|
|
354
|
+
return isFeishuGroupReadAllowed(cfg, account, chatId, true);
|
|
358
355
|
}
|
|
359
356
|
function canEnumerateAllFeishuPeers(account) {
|
|
360
357
|
return compileAllowlist(normalizeFeishuAllowlist(account.config.allowFrom)).wildcard;
|
|
@@ -403,19 +400,15 @@ async function readFeishuChatInfoWithAuthorization(params, readChatInfo) {
|
|
|
403
400
|
chat = await readChatInfo(params.preliminary.chatId);
|
|
404
401
|
} catch (error) {
|
|
405
402
|
if (params.preliminary.decision === "needs-metadata") assertFeishuChatReadAllowed({
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
chatId: params.preliminary.chatId,
|
|
409
|
-
ctx: params.ctx
|
|
403
|
+
...params,
|
|
404
|
+
chatId: params.preliminary.chatId
|
|
410
405
|
});
|
|
411
406
|
throw error;
|
|
412
407
|
}
|
|
413
408
|
assertFeishuChatReadAllowed({
|
|
414
|
-
|
|
415
|
-
account: params.account,
|
|
409
|
+
...params,
|
|
416
410
|
chatId: params.preliminary.chatId,
|
|
417
|
-
chatType: resolveFeishuChatType(chat)
|
|
418
|
-
ctx: params.ctx
|
|
411
|
+
chatType: resolveFeishuChatType(chat)
|
|
419
412
|
});
|
|
420
413
|
return chat;
|
|
421
414
|
}
|
|
@@ -620,13 +613,8 @@ function escapeFeishuCardPlainText(text) {
|
|
|
620
613
|
}
|
|
621
614
|
function resolveSafeFeishuButtonUrl(url) {
|
|
622
615
|
const trimmed = typeof url === "string" ? url.trim() : "";
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
const parsed = new URL(trimmed);
|
|
626
|
-
return parsed.protocol === "https:" || parsed.protocol === "http:" ? trimmed : void 0;
|
|
627
|
-
} catch {
|
|
628
|
-
return;
|
|
629
|
-
}
|
|
616
|
+
const parsed = URL.parse(trimmed);
|
|
617
|
+
return parsed?.protocol === "https:" || parsed?.protocol === "http:" ? trimmed : void 0;
|
|
630
618
|
}
|
|
631
619
|
function sanitizeNativeFeishuButtonBehavior(behavior) {
|
|
632
620
|
if (!isRecord(behavior)) return;
|
|
@@ -792,24 +780,37 @@ function encodeQuery(params) {
|
|
|
792
780
|
const queryString = query.toString();
|
|
793
781
|
return queryString ? `?${queryString}` : "";
|
|
794
782
|
}
|
|
795
|
-
function
|
|
796
|
-
if (!isRecord(error)) return typeof error === "string" ? error : JSON.stringify(error);
|
|
797
|
-
const config = isRecord(error.config) ? error.config : void 0;
|
|
783
|
+
function extractFeishuApiErrorMeta(error) {
|
|
784
|
+
if (!isRecord(error)) return { message: typeof error === "string" ? error : JSON.stringify(error) };
|
|
798
785
|
const response = isRecord(error.response) ? error.response : void 0;
|
|
799
786
|
const responseData = isRecord(response?.data) ? response?.data : void 0;
|
|
800
|
-
const feishuLogId = readStringValue(responseData?.log_id) || (options.includeNestedErrorLogId ? readStringValue(isRecord(responseData?.error) ? responseData.error.log_id : void 0) : void 0);
|
|
801
787
|
const nestedError = isRecord(responseData?.error) ? responseData.error : void 0;
|
|
802
|
-
return
|
|
788
|
+
return {
|
|
803
789
|
message: typeof error.message === "string" ? error.message : JSON.stringify(error),
|
|
804
790
|
code: readStringValue(error.code),
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
791
|
+
config: isRecord(error.config) ? error.config : void 0,
|
|
792
|
+
httpStatus: typeof response?.status === "number" ? response.status : void 0,
|
|
793
|
+
feishuCode: typeof responseData?.code === "number" ? responseData.code : readStringValue(responseData?.code),
|
|
794
|
+
feishuMsg: readStringValue(responseData?.msg),
|
|
795
|
+
feishuLogId: readStringValue(responseData?.log_id),
|
|
796
|
+
nestedErrorLogId: readStringValue(nestedError?.log_id),
|
|
797
|
+
troubleshooter: readStringValue(responseData?.troubleshooter) || readStringValue(nestedError?.troubleshooter)
|
|
798
|
+
};
|
|
799
|
+
}
|
|
800
|
+
function formatFeishuApiError(error, options = {}) {
|
|
801
|
+
if (!isRecord(error)) return typeof error === "string" ? error : JSON.stringify(error);
|
|
802
|
+
const meta = extractFeishuApiErrorMeta(error);
|
|
803
|
+
return JSON.stringify({
|
|
804
|
+
message: meta.message,
|
|
805
|
+
code: meta.code,
|
|
806
|
+
method: readStringValue(meta.config?.method),
|
|
807
|
+
url: readStringValue(meta.config?.url),
|
|
808
|
+
...options.includeConfigParams ? { params: meta.config?.params } : {},
|
|
809
|
+
http_status: meta.httpStatus,
|
|
810
|
+
feishu_code: meta.feishuCode,
|
|
811
|
+
feishu_msg: meta.feishuMsg,
|
|
812
|
+
feishu_log_id: meta.feishuLogId || (options.includeNestedErrorLogId ? meta.nestedErrorLogId : void 0),
|
|
813
|
+
feishu_troubleshooter: meta.troubleshooter
|
|
813
814
|
});
|
|
814
815
|
}
|
|
815
816
|
const FEISHU_SEND_RETRY_BASE_MS = 500;
|
|
@@ -877,35 +878,28 @@ function parseCommentLinkedDocumentPath(pathname) {
|
|
|
877
878
|
const segments = normalizeStringEntries(pathname.split("/"));
|
|
878
879
|
const offset = segments[0]?.toLowerCase() === "space" ? 1 : 0;
|
|
879
880
|
const kind = COMMENT_LINK_KIND_ALIASES.get(segments[offset]?.toLowerCase() ?? "");
|
|
880
|
-
const token =
|
|
881
|
+
const token = segments[offset + 1];
|
|
881
882
|
if (!kind || !isReasonableFeishuLinkToken(token)) return null;
|
|
882
883
|
return {
|
|
883
884
|
urlKind: kind,
|
|
884
885
|
token
|
|
885
886
|
};
|
|
886
887
|
}
|
|
887
|
-
function hasResolvedLinkedDocumentReference(link) {
|
|
888
|
-
return link.urlKind !== "unknown" && (Boolean(link.resolvedObjToken) || Boolean(link.wikiNodeToken));
|
|
889
|
-
}
|
|
890
888
|
function resolveCommentLinkedDocumentFromUrl(params) {
|
|
889
|
+
const parsed = URL.parse(params.rawUrl);
|
|
890
|
+
const parsedPath = parsed && parseCommentLinkedDocumentPath(parsed.pathname);
|
|
891
|
+
if (!parsedPath) return;
|
|
892
|
+
const { urlKind, token } = parsedPath;
|
|
891
893
|
const link = {
|
|
892
894
|
rawUrl: params.rawUrl,
|
|
893
|
-
urlKind
|
|
895
|
+
urlKind
|
|
894
896
|
};
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
link.urlKind = urlKind;
|
|
900
|
-
if (urlKind === "wiki") link.wikiNodeToken = token;
|
|
901
|
-
else {
|
|
902
|
-
link.resolvedObjType = urlKind;
|
|
903
|
-
link.resolvedObjToken = token;
|
|
904
|
-
}
|
|
905
|
-
if (link.resolvedObjType && link.resolvedObjToken && normalizeCommentFileType(link.resolvedObjType)) link.isCurrentDocument = params.currentDocument?.fileType === link.resolvedObjType && params.currentDocument.fileToken === link.resolvedObjToken;
|
|
906
|
-
} catch {
|
|
907
|
-
return link;
|
|
897
|
+
if (urlKind === "wiki") link.wikiNodeToken = token;
|
|
898
|
+
else {
|
|
899
|
+
link.resolvedObjType = urlKind;
|
|
900
|
+
link.resolvedObjToken = token;
|
|
908
901
|
}
|
|
902
|
+
if (link.resolvedObjType && link.resolvedObjToken && normalizeCommentFileType(link.resolvedObjType)) link.isCurrentDocument = params.currentDocument?.fileType === link.resolvedObjType && params.currentDocument.fileToken === link.resolvedObjToken;
|
|
909
903
|
return link;
|
|
910
904
|
}
|
|
911
905
|
function parseCommentContentElements(params) {
|
|
@@ -946,7 +940,7 @@ function parseCommentContentElements(params) {
|
|
|
946
940
|
rawUrl,
|
|
947
941
|
currentDocument: params.currentDocument
|
|
948
942
|
});
|
|
949
|
-
if (
|
|
943
|
+
if (linkedDocument) {
|
|
950
944
|
const key = [
|
|
951
945
|
linkedDocument.rawUrl,
|
|
952
946
|
linkedDocument.urlKind,
|
|
@@ -1083,14 +1077,14 @@ async function cleanupAmbientCommentTypingReaction(params) {
|
|
|
1083
1077
|
});
|
|
1084
1078
|
}
|
|
1085
1079
|
function createCommentTypingReactionLifecycle(params) {
|
|
1086
|
-
const
|
|
1080
|
+
const replyId = params.replyId?.trim();
|
|
1081
|
+
const key = replyId ? buildCommentTypingReactionKey({
|
|
1087
1082
|
...params,
|
|
1088
|
-
replyId
|
|
1083
|
+
replyId
|
|
1089
1084
|
}) : void 0;
|
|
1090
1085
|
const state = key ? ensureCommentTypingReactionState(key) : void 0;
|
|
1091
1086
|
return {
|
|
1092
1087
|
start: async () => {
|
|
1093
|
-
const replyId = params.replyId?.trim();
|
|
1094
1088
|
if (!state || state.cleaned || state.active || !replyId) return;
|
|
1095
1089
|
state.active = await requestCommentTypingReaction({
|
|
1096
1090
|
...params,
|
|
@@ -1099,7 +1093,6 @@ function createCommentTypingReactionLifecycle(params) {
|
|
|
1099
1093
|
});
|
|
1100
1094
|
},
|
|
1101
1095
|
cleanup: async () => {
|
|
1102
|
-
const replyId = params.replyId?.trim();
|
|
1103
1096
|
if (!key || !replyId) return;
|
|
1104
1097
|
await cleanupCommentTypingReactionByKey({
|
|
1105
1098
|
key,
|
|
@@ -1208,11 +1201,6 @@ const FeishuDriveSchema = Type.Union([
|
|
|
1208
1201
|
]);
|
|
1209
1202
|
//#endregion
|
|
1210
1203
|
//#region extensions/feishu/src/tools-config.ts
|
|
1211
|
-
/**
|
|
1212
|
-
* Default tool configuration.
|
|
1213
|
-
* - doc, chat, wiki, drive, scopes, bitable: enabled by default
|
|
1214
|
-
* - perm: disabled by default (sensitive operation)
|
|
1215
|
-
*/
|
|
1216
1204
|
const DEFAULT_TOOLS_CONFIG = {
|
|
1217
1205
|
doc: true,
|
|
1218
1206
|
chat: true,
|
|
@@ -1319,7 +1307,22 @@ function unknownToolActionResult(action) {
|
|
|
1319
1307
|
return jsonResult({ error: `Unknown action: ${String(action)}` });
|
|
1320
1308
|
}
|
|
1321
1309
|
function toolExecutionErrorResult(error) {
|
|
1322
|
-
|
|
1310
|
+
let message = formatErrorMessage(error);
|
|
1311
|
+
const response = isRecord(error) && isRecord(error.response) ? error.response : void 0;
|
|
1312
|
+
if (isRecord(response?.data) ? response.data : void 0) {
|
|
1313
|
+
const meta = extractFeishuApiErrorMeta({
|
|
1314
|
+
message,
|
|
1315
|
+
response
|
|
1316
|
+
});
|
|
1317
|
+
message = formatErrorMessage(JSON.stringify({
|
|
1318
|
+
message,
|
|
1319
|
+
http_status: meta.httpStatus,
|
|
1320
|
+
feishu_code: meta.feishuCode,
|
|
1321
|
+
feishu_msg: meta.feishuMsg,
|
|
1322
|
+
feishu_log_id: meta.feishuLogId || meta.nestedErrorLogId
|
|
1323
|
+
}));
|
|
1324
|
+
}
|
|
1325
|
+
return feishuExternalToolResult({ error: message });
|
|
1323
1326
|
}
|
|
1324
1327
|
//#endregion
|
|
1325
1328
|
//#region extensions/feishu/src/tool-registration.ts
|
|
@@ -1390,13 +1393,10 @@ function normalizeCommentPageSize(pageSize) {
|
|
|
1390
1393
|
if (typeof pageSize !== "number" || !Number.isFinite(pageSize)) return;
|
|
1391
1394
|
return String(Math.min(Math.max(Math.floor(pageSize), 1), 100));
|
|
1392
1395
|
}
|
|
1393
|
-
function
|
|
1394
|
-
const
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
}
|
|
1398
|
-
function resolveDriveCommentParams(params, context, action) {
|
|
1399
|
-
const ambient = resolveAmbientCommentTarget(context);
|
|
1396
|
+
function resolveDriveCommentParams(params, context) {
|
|
1397
|
+
const { action } = params;
|
|
1398
|
+
const delivery = context.deliveryContext;
|
|
1399
|
+
const ambient = delivery?.channel && delivery.channel !== "feishu" ? null : parseFeishuCommentTarget(delivery?.to);
|
|
1400
1400
|
let resolved = params;
|
|
1401
1401
|
if (ambient && (action !== "add_comment" || ambient.fileType === "doc" || ambient.fileType === "docx")) resolved = {
|
|
1402
1402
|
...params,
|
|
@@ -1411,26 +1411,6 @@ function resolveDriveCommentParams(params, context, action) {
|
|
|
1411
1411
|
file_type: fileType
|
|
1412
1412
|
};
|
|
1413
1413
|
}
|
|
1414
|
-
function extractDriveApiErrorMeta(error) {
|
|
1415
|
-
if (!isRecord(error)) return { message: typeof error === "string" ? error : JSON.stringify(error) };
|
|
1416
|
-
const response = isRecord(error.response) ? error.response : void 0;
|
|
1417
|
-
const responseData = isRecord(response?.data) ? response?.data : void 0;
|
|
1418
|
-
return {
|
|
1419
|
-
message: typeof error.message === "string" ? error.message : JSON.stringify(error),
|
|
1420
|
-
httpStatus: typeof response?.status === "number" ? response.status : void 0,
|
|
1421
|
-
feishuCode: typeof responseData?.code === "number" ? responseData.code : readStringValue(responseData?.code),
|
|
1422
|
-
feishuMsg: readStringValue(responseData?.msg),
|
|
1423
|
-
feishuLogId: readStringValue(responseData?.log_id)
|
|
1424
|
-
};
|
|
1425
|
-
}
|
|
1426
|
-
async function getRootFolderToken(client) {
|
|
1427
|
-
const domain = client.domain ?? "https://open.feishu.cn";
|
|
1428
|
-
const res = await client.httpInstance.get(`${domain}/open-apis/drive/explorer/v2/root_folder/meta`);
|
|
1429
|
-
if (res.code !== 0) throw new Error(res.msg ?? "Failed to get root folder");
|
|
1430
|
-
const token = res.data?.token;
|
|
1431
|
-
if (!token) throw new Error("Root folder token not found");
|
|
1432
|
-
return token;
|
|
1433
|
-
}
|
|
1434
1414
|
async function listFolder(client, params = {}) {
|
|
1435
1415
|
const folderToken = typeof params.folder_token === "string" ? params.folder_token.trim() : void 0;
|
|
1436
1416
|
const validFolderToken = folderToken && folderToken !== "0" ? folderToken : void 0;
|
|
@@ -1477,7 +1457,7 @@ async function getFileInfo(client, fileToken, type) {
|
|
|
1477
1457
|
with_url: true
|
|
1478
1458
|
} });
|
|
1479
1459
|
} catch (error) {
|
|
1480
|
-
if (
|
|
1460
|
+
if (extractFeishuApiErrorMeta(error).feishuCode === 99991672) return getRootFileInfo(client, fileToken);
|
|
1481
1461
|
throw error;
|
|
1482
1462
|
}
|
|
1483
1463
|
if (res.code === 99991672) return getRootFileInfo(client, fileToken);
|
|
@@ -1497,7 +1477,9 @@ async function getFileInfo(client, fileToken, type) {
|
|
|
1497
1477
|
async function createFolder(client, name, folderToken) {
|
|
1498
1478
|
let effectiveToken = folderToken && folderToken !== "0" ? folderToken : "0";
|
|
1499
1479
|
if (effectiveToken === "0") try {
|
|
1500
|
-
|
|
1480
|
+
const domain = client.domain ?? "https://open.feishu.cn";
|
|
1481
|
+
const root = await client.httpInstance.get(`${domain}/open-apis/drive/explorer/v2/root_folder/meta`);
|
|
1482
|
+
if (root.code === 0 && root.data?.token) effectiveToken = root.data.token;
|
|
1501
1483
|
} catch {}
|
|
1502
1484
|
const res = await client.drive.file.createFolder({ data: {
|
|
1503
1485
|
name,
|
|
@@ -1509,50 +1491,6 @@ async function createFolder(client, name, folderToken) {
|
|
|
1509
1491
|
url: res.data?.url
|
|
1510
1492
|
};
|
|
1511
1493
|
}
|
|
1512
|
-
async function moveFile(client, fileToken, type, folderToken) {
|
|
1513
|
-
const res = await client.drive.file.move({
|
|
1514
|
-
path: { file_token: fileToken },
|
|
1515
|
-
data: {
|
|
1516
|
-
type,
|
|
1517
|
-
folder_token: folderToken
|
|
1518
|
-
}
|
|
1519
|
-
});
|
|
1520
|
-
assertFeishuApiSuccess(res);
|
|
1521
|
-
return {
|
|
1522
|
-
success: true,
|
|
1523
|
-
task_id: res.data?.task_id
|
|
1524
|
-
};
|
|
1525
|
-
}
|
|
1526
|
-
async function deleteFile(client, fileToken, type) {
|
|
1527
|
-
const res = await client.drive.file.delete({
|
|
1528
|
-
path: { file_token: fileToken },
|
|
1529
|
-
params: { type }
|
|
1530
|
-
});
|
|
1531
|
-
assertFeishuApiSuccess(res);
|
|
1532
|
-
return {
|
|
1533
|
-
success: true,
|
|
1534
|
-
task_id: res.data?.task_id
|
|
1535
|
-
};
|
|
1536
|
-
}
|
|
1537
|
-
async function listDriveCommentPage(client, params) {
|
|
1538
|
-
const filePath = `/open-apis/drive/v1/files/${encodeURIComponent(params.file_token)}/comments`;
|
|
1539
|
-
const isReplies = params.action === "list_comment_replies";
|
|
1540
|
-
const response = assertDriveApiSuccess(await requestDriveApi({
|
|
1541
|
-
client,
|
|
1542
|
-
method: "GET",
|
|
1543
|
-
url: (isReplies ? `${filePath}/${encodeURIComponent(params.comment_id)}/replies` : filePath) + encodeQuery({
|
|
1544
|
-
file_type: params.file_type,
|
|
1545
|
-
page_size: normalizeCommentPageSize(params.page_size),
|
|
1546
|
-
page_token: params.page_token,
|
|
1547
|
-
user_id_type: "open_id"
|
|
1548
|
-
})
|
|
1549
|
-
}));
|
|
1550
|
-
return {
|
|
1551
|
-
has_more: response.data?.has_more ?? false,
|
|
1552
|
-
page_token: response.data?.page_token,
|
|
1553
|
-
...isReplies ? { replies: (response.data?.items ?? []).map(normalizeCommentReply) } : { comments: (response.data?.items ?? []).map(normalizeCommentCard) }
|
|
1554
|
-
};
|
|
1555
|
-
}
|
|
1556
1494
|
async function addComment(client, params) {
|
|
1557
1495
|
if (params.block_id?.trim() && params.file_type !== "docx") throw new Error("block_id is only supported for docx comments");
|
|
1558
1496
|
return {
|
|
@@ -1572,17 +1510,6 @@ async function addComment(client, params) {
|
|
|
1572
1510
|
}))).data
|
|
1573
1511
|
};
|
|
1574
1512
|
}
|
|
1575
|
-
async function queryCommentById(client, params) {
|
|
1576
|
-
return assertDriveApiSuccess(await requestDriveApi({
|
|
1577
|
-
client,
|
|
1578
|
-
method: "POST",
|
|
1579
|
-
url: `/open-apis/drive/v1/files/${encodeURIComponent(params.file_token)}/comments/batch_query` + encodeQuery({
|
|
1580
|
-
file_type: params.file_type,
|
|
1581
|
-
user_id_type: "open_id"
|
|
1582
|
-
}),
|
|
1583
|
-
data: { comment_ids: [params.comment_id] }
|
|
1584
|
-
})).data?.items?.find((comment) => comment.comment_id?.trim() === params.comment_id);
|
|
1585
|
-
}
|
|
1586
1513
|
async function replyComment(client, params) {
|
|
1587
1514
|
const url = `/open-apis/drive/v1/files/${encodeURIComponent(params.file_token)}/comments/${encodeURIComponent(params.comment_id)}/replies`;
|
|
1588
1515
|
const query = { file_type: params.file_type };
|
|
@@ -1610,7 +1537,7 @@ async function replyComment(client, params) {
|
|
|
1610
1537
|
});
|
|
1611
1538
|
} catch (error) {
|
|
1612
1539
|
if (error instanceof FeishuReplyCommentError || error instanceof PlatformMessageNotDispatchedError) throw error;
|
|
1613
|
-
const meta =
|
|
1540
|
+
const meta = extractFeishuApiErrorMeta(error);
|
|
1614
1541
|
console.warn(`[feishu_drive] replyComment threw comment=${params.comment_id} file_type=${params.file_type} error=${formatFeishuApiError(error, { includeConfigParams: true })}`);
|
|
1615
1542
|
throw new FeishuReplyCommentError(meta);
|
|
1616
1543
|
}
|
|
@@ -1618,7 +1545,15 @@ async function replyComment(client, params) {
|
|
|
1618
1545
|
async function deliverCommentThreadText(client, params) {
|
|
1619
1546
|
let isWholeComment = params.is_whole_comment;
|
|
1620
1547
|
if (isWholeComment === void 0) try {
|
|
1621
|
-
isWholeComment = (await
|
|
1548
|
+
isWholeComment = (assertDriveApiSuccess(await requestDriveApi({
|
|
1549
|
+
client,
|
|
1550
|
+
method: "POST",
|
|
1551
|
+
url: `/open-apis/drive/v1/files/${encodeURIComponent(params.file_token)}/comments/batch_query` + encodeQuery({
|
|
1552
|
+
file_type: params.file_type,
|
|
1553
|
+
user_id_type: "open_id"
|
|
1554
|
+
}),
|
|
1555
|
+
data: { comment_ids: [params.comment_id] }
|
|
1556
|
+
})).data?.items?.find((item) => item.comment_id?.trim() === params.comment_id))?.is_whole === true;
|
|
1622
1557
|
} catch (error) {
|
|
1623
1558
|
console.warn(`[feishu_drive] comment metadata preflight failed comment=${params.comment_id} file_type=${params.file_type} error=${formatErrorMessage(error)}`);
|
|
1624
1559
|
isWholeComment = false;
|
|
@@ -1668,13 +1603,49 @@ function registerFeishuDriveTools(api) {
|
|
|
1668
1603
|
case "list": return feishuExternalToolResult(await listFolder(client, p));
|
|
1669
1604
|
case "info": return feishuExternalToolResult(await getFileInfo(client, p.file_token, p.type));
|
|
1670
1605
|
case "create_folder": return feishuExternalToolResult(await createFolder(client, p.name, p.folder_token));
|
|
1671
|
-
case "move":
|
|
1672
|
-
case "delete":
|
|
1606
|
+
case "move":
|
|
1607
|
+
case "delete": {
|
|
1608
|
+
const path = { file_token: p.file_token };
|
|
1609
|
+
const res = p.action === "move" ? await client.drive.file.move({
|
|
1610
|
+
path,
|
|
1611
|
+
data: {
|
|
1612
|
+
type: p.type,
|
|
1613
|
+
folder_token: p.folder_token
|
|
1614
|
+
}
|
|
1615
|
+
}) : await client.drive.file.delete({
|
|
1616
|
+
path,
|
|
1617
|
+
params: { type: p.type }
|
|
1618
|
+
});
|
|
1619
|
+
assertFeishuApiSuccess(res);
|
|
1620
|
+
return feishuExternalToolResult({
|
|
1621
|
+
success: true,
|
|
1622
|
+
task_id: res.data?.task_id
|
|
1623
|
+
});
|
|
1624
|
+
}
|
|
1673
1625
|
case "list_comments":
|
|
1674
|
-
case "list_comment_replies":
|
|
1626
|
+
case "list_comment_replies": {
|
|
1627
|
+
const resolved = resolveDriveCommentParams(p, ctx);
|
|
1628
|
+
const filePath = `/open-apis/drive/v1/files/${encodeURIComponent(resolved.file_token)}/comments`;
|
|
1629
|
+
const isReplies = resolved.action === "list_comment_replies";
|
|
1630
|
+
const response = assertDriveApiSuccess(await requestDriveApi({
|
|
1631
|
+
client,
|
|
1632
|
+
method: "GET",
|
|
1633
|
+
url: (isReplies ? `${filePath}/${encodeURIComponent(resolved.comment_id)}/replies` : filePath) + encodeQuery({
|
|
1634
|
+
file_type: resolved.file_type,
|
|
1635
|
+
page_size: normalizeCommentPageSize(resolved.page_size),
|
|
1636
|
+
page_token: resolved.page_token,
|
|
1637
|
+
user_id_type: "open_id"
|
|
1638
|
+
})
|
|
1639
|
+
}));
|
|
1640
|
+
return feishuExternalToolResult({
|
|
1641
|
+
has_more: response.data?.has_more ?? false,
|
|
1642
|
+
page_token: response.data?.page_token,
|
|
1643
|
+
...isReplies ? { replies: (response.data?.items ?? []).map(normalizeCommentReply) } : { comments: (response.data?.items ?? []).map(normalizeCommentCard) }
|
|
1644
|
+
});
|
|
1645
|
+
}
|
|
1675
1646
|
case "add_comment":
|
|
1676
1647
|
case "reply_comment": {
|
|
1677
|
-
const resolved = resolveDriveCommentParams(p, ctx
|
|
1648
|
+
const resolved = resolveDriveCommentParams(p, ctx);
|
|
1678
1649
|
try {
|
|
1679
1650
|
return feishuExternalToolResult(await (resolved.action === "add_comment" ? addComment(client, resolved) : deliverCommentThreadText(client, resolved)));
|
|
1680
1651
|
} finally {
|
|
@@ -1716,15 +1687,9 @@ function resolveFeishuIdentityHeaderTitle(identity) {
|
|
|
1716
1687
|
//#endregion
|
|
1717
1688
|
//#region extensions/feishu/src/media-fallback.ts
|
|
1718
1689
|
const FEISHU_MEDIA_UPLOAD_FAILURE_FALLBACK_TEXT = "Media upload failed. Please try again.";
|
|
1719
|
-
function hasAsciiControlCharacter(value) {
|
|
1720
|
-
return Array.from(value).some((character) => {
|
|
1721
|
-
const code = character.charCodeAt(0);
|
|
1722
|
-
return code <= 31 || code === 127;
|
|
1723
|
-
});
|
|
1724
|
-
}
|
|
1725
1690
|
async function resolvePublicFeishuMediaReference(value) {
|
|
1726
1691
|
const raw = value?.trim();
|
|
1727
|
-
if (!raw ||
|
|
1692
|
+
if (!raw || containsAsciiControlCharacter(raw)) return;
|
|
1728
1693
|
try {
|
|
1729
1694
|
const parsed = new URL(raw);
|
|
1730
1695
|
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") return;
|
|
@@ -2103,13 +2068,11 @@ function extractInteractiveElementsText(elements, variables) {
|
|
|
2103
2068
|
}
|
|
2104
2069
|
function readInteractiveElementArrays(parsed) {
|
|
2105
2070
|
const body = isRecord(parsed.body) ? parsed.body : void 0;
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
}
|
|
2112
|
-
return elementArrays;
|
|
2071
|
+
return [
|
|
2072
|
+
parsed.elements,
|
|
2073
|
+
body?.elements,
|
|
2074
|
+
...[parsed.i18n_elements, body?.i18n_elements].flatMap((candidate) => isRecord(candidate) ? Object.values(candidate) : [])
|
|
2075
|
+
].filter(Array.isArray);
|
|
2113
2076
|
}
|
|
2114
2077
|
function readInteractiveCardTitle(parsed, variables) {
|
|
2115
2078
|
if (typeof parsed.title === "string") return applyCardTemplateVariables(parsed.title, variables).trim();
|
|
@@ -2139,6 +2102,18 @@ function isFeishuGroupChatType(chatType) {
|
|
|
2139
2102
|
}
|
|
2140
2103
|
//#endregion
|
|
2141
2104
|
//#region extensions/feishu/src/mention.ts
|
|
2105
|
+
function normalizeMentions(text, mentions, botStripId) {
|
|
2106
|
+
if (!mentions || mentions.length === 0) return text;
|
|
2107
|
+
const escapeName = (value) => value.replace(/</g, "<").replace(/>/g, ">");
|
|
2108
|
+
const replacements = /* @__PURE__ */ new Map();
|
|
2109
|
+
for (const mention of mentions) {
|
|
2110
|
+
const mentionId = typeof mention.id === "string" ? mention.id : mention.id.open_id;
|
|
2111
|
+
const replacement = botStripId && mentionId === botStripId ? "" : mentionId ? `<at user_id="${mentionId}">${escapeName(mention.name)}</at>` : `@${mention.name}`;
|
|
2112
|
+
replacements.set(mention.key, replacement);
|
|
2113
|
+
}
|
|
2114
|
+
const keys = [...replacements.keys()].toSorted((a, b) => b.length - a.length).map(escapeRegExp);
|
|
2115
|
+
return text.replace(new RegExp(keys.join("|"), "g"), (key) => replacements.get(key)).trim();
|
|
2116
|
+
}
|
|
2142
2117
|
function isFeishuBroadcastMention(mention) {
|
|
2143
2118
|
const normalizedKey = mention.key?.trim().toLowerCase();
|
|
2144
2119
|
if (normalizedKey === "@all" || normalizedKey === "@_all") return true;
|
|
@@ -2148,9 +2123,6 @@ function isFeishuBroadcastMention(mention) {
|
|
|
2148
2123
|
mention.id?.union_id
|
|
2149
2124
|
].some((id) => id?.trim().toLowerCase() === "all");
|
|
2150
2125
|
}
|
|
2151
|
-
/**
|
|
2152
|
-
* Extract mention targets from message event (excluding the bot itself)
|
|
2153
|
-
*/
|
|
2154
2126
|
function extractMentionTargets(event, botOpenId) {
|
|
2155
2127
|
return (event.message.mentions ?? []).filter((m) => !isFeishuBroadcastMention(m) && m.id.open_id !== botOpenId && Boolean(m.id.open_id)).map((m) => ({
|
|
2156
2128
|
openId: m.id.open_id,
|
|
@@ -2188,11 +2160,11 @@ function formatFeishuMediaContent(parsed, messageType) {
|
|
|
2188
2160
|
if (speechToText) return speechToText;
|
|
2189
2161
|
return "";
|
|
2190
2162
|
}
|
|
2191
|
-
function formatSubMessageContent(content, contentType) {
|
|
2163
|
+
function formatSubMessageContent(content, contentType, mentions) {
|
|
2192
2164
|
try {
|
|
2193
2165
|
const parsed = JSON.parse(content);
|
|
2194
2166
|
switch (contentType) {
|
|
2195
|
-
case "text": return parsed.text || content;
|
|
2167
|
+
case "text": return normalizeMentions(parsed.text || content, mentions);
|
|
2196
2168
|
case "post": return renderPostContent(parsed).textContent;
|
|
2197
2169
|
case "interactive": return parseInteractiveCardContent(parsed);
|
|
2198
2170
|
case "image": return "[Image]";
|
|
@@ -2215,7 +2187,7 @@ function parseMergeForwardContent(items) {
|
|
|
2215
2187
|
if (subMessages.length === 0) return "[Merged and Forwarded Message - no sub-messages found]";
|
|
2216
2188
|
subMessages.sort((a, b) => (parseStrictNonNegativeInteger(a.create_time) ?? 0) - (parseStrictNonNegativeInteger(b.create_time) ?? 0));
|
|
2217
2189
|
const lines = ["[Merged and Forwarded Messages]"];
|
|
2218
|
-
for (const item of subMessages.slice(0, maxMessages)) lines.push(`- ${formatSubMessageContent(item.body?.content || "", item.msg_type || "text")}`);
|
|
2190
|
+
for (const item of subMessages.slice(0, maxMessages)) lines.push(`- ${formatSubMessageContent(item.body?.content || "", item.msg_type || "text", item.mentions)}`);
|
|
2219
2191
|
if (subMessages.length > maxMessages) lines.push(`... and ${subMessages.length - maxMessages} more messages`);
|
|
2220
2192
|
const rendered = lines.join("\n");
|
|
2221
2193
|
return rendered.length <= 2e4 ? rendered : `${truncateUtf16Safe(rendered, 19961).trimEnd()}
|
|
@@ -2360,7 +2332,7 @@ function parseFeishuMessageContent(rawContent, msgType, messageId) {
|
|
|
2360
2332
|
}
|
|
2361
2333
|
function parseFeishuMessageItem(item, fallbackMessageId) {
|
|
2362
2334
|
const msgType = item.msg_type ?? "text";
|
|
2363
|
-
const
|
|
2335
|
+
const content = parseFeishuMessageContent(item.body?.content ?? "", msgType, item.message_id);
|
|
2364
2336
|
return {
|
|
2365
2337
|
messageId: item.message_id ?? fallbackMessageId ?? "",
|
|
2366
2338
|
chatId: item.chat_id ?? "",
|
|
@@ -2368,7 +2340,7 @@ function parseFeishuMessageItem(item, fallbackMessageId) {
|
|
|
2368
2340
|
senderId: item.sender?.id,
|
|
2369
2341
|
senderOpenId: item.sender?.id_type === "open_id" ? item.sender?.id : void 0,
|
|
2370
2342
|
senderType: item.sender?.sender_type,
|
|
2371
|
-
content:
|
|
2343
|
+
content: msgType === "text" ? normalizeMentions(content, item.mentions) : content,
|
|
2372
2344
|
contentType: msgType,
|
|
2373
2345
|
createTime: parseStrictNonNegativeInteger(item.create_time),
|
|
2374
2346
|
...item.root_id ? { rootId: item.root_id } : {},
|
|
@@ -2886,7 +2858,7 @@ async function probeMediaDurationMs(params) {
|
|
|
2886
2858
|
return Math.max(1, Math.round(seconds * 1e3));
|
|
2887
2859
|
});
|
|
2888
2860
|
} catch (err) {
|
|
2889
|
-
console.warn("[feishu] failed to
|
|
2861
|
+
console.warn("[feishu] failed to check media duration; upload will omit it:", err);
|
|
2890
2862
|
return;
|
|
2891
2863
|
}
|
|
2892
2864
|
}
|
|
@@ -3329,7 +3301,7 @@ function mergeFeishuReplyDeliveryResults(results, content) {
|
|
|
3329
3301
|
return createFeishuReplyDeliveryResult({
|
|
3330
3302
|
results: visible,
|
|
3331
3303
|
visibleReplySent: visible.length > 0,
|
|
3332
|
-
content: content
|
|
3304
|
+
content: content ?? (acceptedContent.length > 0 ? acceptedContent.join("\n\n") : void 0)
|
|
3333
3305
|
});
|
|
3334
3306
|
}
|
|
3335
3307
|
/** Keeps a failed outcome while exposing the provider-visible subset to core lifecycle hooks. */
|
|
@@ -3341,4 +3313,4 @@ function createFeishuPartialReplyDeliveryError(cause, result) {
|
|
|
3341
3313
|
});
|
|
3342
3314
|
}
|
|
3343
3315
|
//#endregion
|
|
3344
|
-
export {
|
|
3316
|
+
export { assertFeishuApiSuccess as $, sendMessageFeishu as A, resolveFeishuGroupConversationIngressAccess as At, parseInteractiveCardContent as B, sendStickerFeishu as C, isFeishuGroupReadEnabled as Ct, getMessageFeishu as D, normalizeFeishuAllowEntry as Dt, editMessageFeishu as E, hasExplicitFeishuGroupConfig as Et, isFeishuBroadcastMention as F, resolveFeishuChatType as Ft, resolveFeishuIdentityHeaderTitle as G, createConfiguredFeishuClient as H, isMentionForwardRequest as I, FEISHU_CARD_INTERACTION_VERSION as It, registerFeishuTool as J, deliverCommentThreadText as K, normalizeMentions as L, createFeishuCardInteractionEnvelope as Lt, toFeishuMessageSendResult as M, resolveFeishuGroupToolPolicy as Mt, formatFeishuMediaContent as N, resolveFeishuReplyPolicy as Nt, listFeishuThreadMessages as O, resolveFeishuDmIngressAccess as Ot, extractMentionTargets as P, normalizeFeishuChatType as Pt, resolveFeishuToolAccount as Q, isFeishuGroupChatType as R, decodeFeishuCardAction as Rt, sendMediaFeishu as S, isFeishuGroupReadAllowed as St, chunkFeishuCardMarkdown as T, resolveFeishuChatReadPreliminaryAuthorization as Tt, buildFeishuMediaFallbackText as U, parsePostContent as V, resolveFeishuIdentityEmoji as W, unknownToolActionResult as X, feishuExternalToolResult as Y, createFeishuToolClient as Z, renderFeishuPresentationPayload as _, visitFeishuMarkdown as _t, shouldSendNoVisibleReplyFallback as a, parseCommentContentElements as at, withinCardTableLimit as b, canEnumerateAllFeishuGroups as bt, buildFeishuPayloadCard as c, normalizeCommentFileType as ct, consumeFeishuPresentationFallbackMarker as d, resolveFeishuCardTemplate as dt, cleanupAmbientCommentTypingReaction as et, feishuCardWithinTableLimit as f, chunkFeishuMarkdown as ft, renderFeishuPresentationFallbackText as g, shouldUseFeishuCard as gt, readNativeFeishuCard as h, parseFeishuMarkdown as ht, noVisibleFeishuReplyDelivery as i, formatFeishuApiError as it, sendStructuredCardFeishu as j, resolveFeishuGroupSenderActivationIngressAccess as jt, sendCardFeishu as k, resolveFeishuGroupConfig as kt, buildFeishuPresentationCard as l, parseFeishuCommentTarget as lt, markRenderedFeishuCard as m, materializeFeishuPostMarkdownSoftBreaks as mt, createFeishuReplyDeliveryResult as n, encodeQuery as nt, FEISHU_PRESENTATION_CAPABILITIES as o, requestFeishuApi as ot, isFeishuCardWithinEnvelope as p, chunkFeishuPostMarkdown as pt, registerFeishuDriveTools as q, mergeFeishuReplyDeliveryResults as r, extractReplyText as rt, assertFeishuCardWithinEnvelope as s, buildFeishuCommentTarget as st, createFeishuPartialReplyDeliveryError as t, createCommentTypingReactionLifecycle as tt, buildFeishuPresentationFallback as u, readNativeFeishuCardJson as ut, renderFeishuReplyPayload as v, assertFeishuChatReadAllowed as vt, shouldSuppressFeishuTextForVoiceMedia as w, readFeishuChatInfoWithAuthorization as wt, saveMessageResourceFeishu as x, canEnumerateAllFeishuPeers as xt, resolveFeishuRichReply as y, authorizeFeishuChatMemberRead as yt, normalizeFeishuEventChatType as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-
|
|
1
|
+
import { r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-D00i9uy5.mjs";
|
|
2
2
|
//#region extensions/feishu/src/session-conversation.ts
|
|
3
3
|
function resolveFeishuParentConversationCandidates(rawId) {
|
|
4
4
|
const parsed = parseFeishuConversationId({ conversationId: rawId });
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-
|
|
1
|
+
import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-CjGGyrdx.mjs";
|
|
2
2
|
import "../setup-api.js";
|
|
3
3
|
export { feishuPlugin, feishuSetupAdapter, feishuSetupWizard };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as __exportAll } from "./doctor-contract-
|
|
2
|
-
import { d as stripFeishuProviderPrefix, l as normalizeFeishuTarget, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-
|
|
3
|
-
import { n as getFeishuThreadBindingManager } from "./thread-bindings-
|
|
1
|
+
import { _ as __exportAll } from "./doctor-contract-oIpUWtNO.mjs";
|
|
2
|
+
import { d as stripFeishuProviderPrefix, l as normalizeFeishuTarget, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-D00i9uy5.mjs";
|
|
3
|
+
import { n as getFeishuThreadBindingManager } from "./thread-bindings-DdNLxoL3.mjs";
|
|
4
4
|
import { normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/feishu/src/subagent-hooks.ts
|
|
6
6
|
var subagent_hooks_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -66,26 +66,16 @@ function resolveFeishuRequesterConversation(manager, params) {
|
|
|
66
66
|
function resolveFeishuDeliveryOrigin(params) {
|
|
67
67
|
const deliveryTo = params.deliveryTo?.trim();
|
|
68
68
|
const deliveryThreadId = params.deliveryThreadId?.trim();
|
|
69
|
-
|
|
70
|
-
channel: "feishu",
|
|
71
|
-
accountId: params.accountId,
|
|
72
|
-
to: deliveryTo,
|
|
73
|
-
...deliveryThreadId ? { threadId: deliveryThreadId } : {}
|
|
74
|
-
};
|
|
75
|
-
const parsed = parseFeishuConversationId({
|
|
69
|
+
const parsed = deliveryTo ? null : parseFeishuConversationId({
|
|
76
70
|
conversationId: params.conversationId,
|
|
77
71
|
parentConversationId: params.parentConversationId
|
|
78
72
|
});
|
|
79
|
-
|
|
80
|
-
channel: "feishu",
|
|
81
|
-
accountId: params.accountId,
|
|
82
|
-
to: `chat:${params.parentConversationId?.trim() || parsed.chatId}`,
|
|
83
|
-
threadId: parsed.topicId
|
|
84
|
-
};
|
|
73
|
+
const threadId = deliveryTo ? deliveryThreadId : parsed?.topicId;
|
|
85
74
|
return {
|
|
86
75
|
channel: "feishu",
|
|
87
76
|
accountId: params.accountId,
|
|
88
|
-
to: `user:${params.conversationId}`
|
|
77
|
+
to: deliveryTo || (parsed?.topicId ? `chat:${params.parentConversationId?.trim() || parsed.chatId}` : `user:${params.conversationId}`),
|
|
78
|
+
...threadId ? { threadId } : {}
|
|
89
79
|
};
|
|
90
80
|
}
|
|
91
81
|
function resolveMatchingChildBinding(params) {
|