@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
|
@@ -1,100 +1,83 @@
|
|
|
1
|
-
import { h as resolveFeishuAccount } from "./doctor-contract-
|
|
2
|
-
import { d as listFeishuDirectoryPeers, o as feishuOutbound, u as listFeishuDirectoryGroups } from "./channel-
|
|
3
|
-
import { A as sendMessageFeishu, C as sendStickerFeishu, D as getMessageFeishu, E as editMessageFeishu,
|
|
4
|
-
import { r as createFeishuClient } from "./client-
|
|
5
|
-
import { a as getFeishuMemberInfo, i as getChatMembers, n as buildFeishuDirectChatMembers, r as getChatInfo, t as assertFeishuChatMember } from "./chat-
|
|
6
|
-
import { t as probeFeishu } from "./probe-
|
|
1
|
+
import { h as resolveFeishuAccount } from "./doctor-contract-oIpUWtNO.mjs";
|
|
2
|
+
import { d as listFeishuDirectoryPeers, o as feishuOutbound, u as listFeishuDirectoryGroups } from "./channel-CjGGyrdx.mjs";
|
|
3
|
+
import { $ as assertFeishuApiSuccess, A as sendMessageFeishu, C as sendStickerFeishu, D as getMessageFeishu, E as editMessageFeishu, H as createConfiguredFeishuClient, k as sendCardFeishu } from "./reply-delivery-result-iCCrdxE1.mjs";
|
|
4
|
+
import { r as createFeishuClient } from "./client-wwr8PGPH.mjs";
|
|
5
|
+
import { a as getFeishuMemberInfo, i as getChatMembers, n as buildFeishuDirectChatMembers, r as getChatInfo, t as assertFeishuChatMember } from "./chat-fC3dvxFs.mjs";
|
|
6
|
+
import { t as probeFeishu } from "./probe-DXnFxq5j.mjs";
|
|
7
7
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
//#region extensions/feishu/src/directory.ts
|
|
9
9
|
const MAX_FEISHU_DIRECTORY_PAGES = 100;
|
|
10
|
-
async function
|
|
10
|
+
async function listFeishuDirectoryLive(params, options) {
|
|
11
11
|
const account = resolveFeishuAccount({
|
|
12
12
|
cfg: params.cfg,
|
|
13
13
|
accountId: params.accountId
|
|
14
14
|
});
|
|
15
|
-
if (!account.configured) return
|
|
15
|
+
if (!account.configured) return options.fallback(params);
|
|
16
|
+
const label = `Feishu live ${options.kind}`;
|
|
16
17
|
try {
|
|
17
18
|
const client = createFeishuClient(account);
|
|
18
|
-
const
|
|
19
|
+
const entries = [];
|
|
19
20
|
const limit = params.limit ?? 50;
|
|
20
21
|
const q = normalizeLowercaseStringOrEmpty(params.query);
|
|
21
|
-
const
|
|
22
|
+
const peers = options.kind === "peer";
|
|
23
|
+
const pageSize = peers && q ? 50 : Math.min(limit, peers ? 50 : 100);
|
|
22
24
|
let pageToken;
|
|
23
25
|
const seenPageTokens = /* @__PURE__ */ new Set();
|
|
24
|
-
for (let page =
|
|
25
|
-
const response = await
|
|
26
|
-
page_size: pageSize,
|
|
27
|
-
page_token: pageToken
|
|
28
|
-
} });
|
|
26
|
+
for (let page = 1; page <= MAX_FEISHU_DIRECTORY_PAGES; page += 1) {
|
|
27
|
+
const response = await options.fetchPage(client, pageSize, pageToken);
|
|
29
28
|
if (response.code !== 0) throw new Error(response.msg || `code ${response.code}`);
|
|
30
|
-
for (const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
name: name || void 0
|
|
37
|
-
});
|
|
29
|
+
for (const item of response.data?.items ?? []) {
|
|
30
|
+
const entry = options.toEntry(item);
|
|
31
|
+
if (entry && (!q || normalizeLowercaseStringOrEmpty(entry.id).includes(q) || normalizeLowercaseStringOrEmpty(entry.name).includes(q)) && (peers || !params.filter || params.filter(entry))) entries.push(entry);
|
|
32
|
+
if (entries.length >= limit) {
|
|
33
|
+
if (peers) return entries;
|
|
34
|
+
break;
|
|
38
35
|
}
|
|
39
|
-
if (peers.length >= limit) return peers;
|
|
40
36
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (
|
|
44
|
-
if (
|
|
37
|
+
const nextPageToken = response.data?.has_more ? response.data.page_token : void 0;
|
|
38
|
+
if (peers && response.data?.has_more && !nextPageToken) throw new Error(`${label} directory returned an empty page token`);
|
|
39
|
+
if (nextPageToken && seenPageTokens.has(nextPageToken)) throw new Error(`${label} directory returned a repeated page token`);
|
|
40
|
+
if (!nextPageToken) return entries;
|
|
45
41
|
seenPageTokens.add(nextPageToken);
|
|
46
42
|
pageToken = nextPageToken;
|
|
43
|
+
if (page === MAX_FEISHU_DIRECTORY_PAGES) throw new Error(`${label} directory pagination limit exceeded`);
|
|
44
|
+
if (!peers && !(entries.length < limit)) return entries;
|
|
47
45
|
}
|
|
48
|
-
throw new Error(
|
|
46
|
+
throw new Error(`${label} directory pagination limit exceeded`);
|
|
49
47
|
} catch (err) {
|
|
50
|
-
if (params.fallbackToStatic === false) throw err instanceof Error ? err : /* @__PURE__ */ new Error(
|
|
51
|
-
return
|
|
48
|
+
if (params.fallbackToStatic === false) throw err instanceof Error ? err : /* @__PURE__ */ new Error(`${label} lookup failed`);
|
|
49
|
+
return options.fallback(params);
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
function listFeishuDirectoryPeersLive(params) {
|
|
53
|
+
return listFeishuDirectoryLive(params, {
|
|
54
|
+
kind: "peer",
|
|
55
|
+
fallback: listFeishuDirectoryPeers,
|
|
56
|
+
fetchPage: (client, pageSize, pageToken) => client.contact.user.list({ params: {
|
|
57
|
+
page_size: pageSize,
|
|
58
|
+
page_token: pageToken
|
|
59
|
+
} }),
|
|
60
|
+
toEntry: (user) => user.open_id ? {
|
|
61
|
+
kind: "user",
|
|
62
|
+
id: user.open_id,
|
|
63
|
+
name: user.name || void 0
|
|
64
|
+
} : void 0
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function listFeishuDirectoryGroupsLive(params) {
|
|
68
|
+
return listFeishuDirectoryLive(params, {
|
|
69
|
+
kind: "group",
|
|
70
|
+
fallback: listFeishuDirectoryGroups,
|
|
71
|
+
fetchPage: (client, pageSize, pageToken) => client.im.chat.list({ params: {
|
|
72
|
+
page_size: pageSize,
|
|
73
|
+
page_token: pageToken
|
|
74
|
+
} }),
|
|
75
|
+
toEntry: (chat) => chat.chat_id ? {
|
|
76
|
+
kind: "group",
|
|
77
|
+
id: chat.chat_id,
|
|
78
|
+
name: chat.name || void 0
|
|
79
|
+
} : void 0
|
|
58
80
|
});
|
|
59
|
-
if (!account.configured) return listFeishuDirectoryGroups(params);
|
|
60
|
-
try {
|
|
61
|
-
const client = createFeishuClient(account);
|
|
62
|
-
const groups = [];
|
|
63
|
-
const limit = params.limit ?? 50;
|
|
64
|
-
const q = normalizeLowercaseStringOrEmpty(params.query);
|
|
65
|
-
let pageToken;
|
|
66
|
-
let pages = 0;
|
|
67
|
-
const seenPageTokens = /* @__PURE__ */ new Set();
|
|
68
|
-
do {
|
|
69
|
-
const response = await client.im.chat.list({ params: {
|
|
70
|
-
page_size: Math.min(limit, 100),
|
|
71
|
-
page_token: pageToken
|
|
72
|
-
} });
|
|
73
|
-
if (response.code !== 0) throw new Error(response.msg || `code ${response.code}`);
|
|
74
|
-
for (const chat of response.data?.items ?? []) {
|
|
75
|
-
if (chat.chat_id) {
|
|
76
|
-
const name = chat.name || "";
|
|
77
|
-
const group = {
|
|
78
|
-
kind: "group",
|
|
79
|
-
id: chat.chat_id,
|
|
80
|
-
name: name || void 0
|
|
81
|
-
};
|
|
82
|
-
if ((!q || normalizeLowercaseStringOrEmpty(chat.chat_id).includes(q) || normalizeLowercaseStringOrEmpty(name).includes(q)) && (!params.filter || params.filter(group))) groups.push(group);
|
|
83
|
-
}
|
|
84
|
-
if (groups.length >= limit) break;
|
|
85
|
-
}
|
|
86
|
-
pages += 1;
|
|
87
|
-
const nextPageToken = response.data?.has_more ? response.data.page_token : void 0;
|
|
88
|
-
if (nextPageToken && seenPageTokens.has(nextPageToken)) throw new Error("Feishu live group directory returned a repeated page token");
|
|
89
|
-
if (nextPageToken) seenPageTokens.add(nextPageToken);
|
|
90
|
-
pageToken = nextPageToken;
|
|
91
|
-
} while (pageToken && groups.length < limit && pages < MAX_FEISHU_DIRECTORY_PAGES);
|
|
92
|
-
if (pageToken && pages >= MAX_FEISHU_DIRECTORY_PAGES) throw new Error("Feishu live group directory pagination limit exceeded");
|
|
93
|
-
return groups;
|
|
94
|
-
} catch (err) {
|
|
95
|
-
if (params.fallbackToStatic === false) throw err instanceof Error ? err : /* @__PURE__ */ new Error("Feishu live group lookup failed");
|
|
96
|
-
return listFeishuDirectoryGroups(params);
|
|
97
|
-
}
|
|
98
81
|
}
|
|
99
82
|
//#endregion
|
|
100
83
|
//#region extensions/feishu/src/pins.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as createFeishuClient } from "./client-
|
|
1
|
+
import { $ as assertFeishuApiSuccess, Ft as resolveFeishuChatType, J as registerFeishuTool, Q as resolveFeishuToolAccount, Tt as resolveFeishuChatReadPreliminaryAuthorization, Y as feishuExternalToolResult, it as formatFeishuApiError, vt as assertFeishuChatReadAllowed, wt as readFeishuChatInfoWithAuthorization, yt as authorizeFeishuChatMemberRead } from "./reply-delivery-result-iCCrdxE1.mjs";
|
|
2
|
+
import { r as createFeishuClient } from "./client-wwr8PGPH.mjs";
|
|
3
3
|
import { optionalPositiveIntegerSchema } from "openclaw/plugin-sdk/channel-actions";
|
|
4
4
|
import { readPositiveIntegerParam } from "openclaw/plugin-sdk/param-readers";
|
|
5
5
|
import { Type } from "typebox";
|
|
@@ -63,26 +63,6 @@ async function getChatInfo(client, chatId) {
|
|
|
63
63
|
avatar: chat?.avatar
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
async function getAuthorizedFeishuChatInfo(params) {
|
|
67
|
-
const preliminary = resolveFeishuChatReadPreliminaryAuthorization({
|
|
68
|
-
cfg: params.cfg,
|
|
69
|
-
account: params.account,
|
|
70
|
-
chatId: params.chatId,
|
|
71
|
-
ctx: params.ctx
|
|
72
|
-
});
|
|
73
|
-
if (preliminary.decision === "deny") assertFeishuChatReadAllowed({
|
|
74
|
-
cfg: params.cfg,
|
|
75
|
-
account: params.account,
|
|
76
|
-
chatId: preliminary.chatId,
|
|
77
|
-
ctx: params.ctx
|
|
78
|
-
});
|
|
79
|
-
return readFeishuChatInfoWithAuthorization({
|
|
80
|
-
cfg: params.cfg,
|
|
81
|
-
account: params.account,
|
|
82
|
-
ctx: params.ctx,
|
|
83
|
-
preliminary
|
|
84
|
-
}, (chatId) => getChatInfo(params.client, chatId));
|
|
85
|
-
}
|
|
86
66
|
async function getChatMembers(client, chatId, pageSize, pageToken, memberIdType) {
|
|
87
67
|
const page_size = pageSize ? Math.max(1, Math.min(100, pageSize)) : 50;
|
|
88
68
|
const res = await client.im.chatMembers.get({
|
|
@@ -185,20 +165,28 @@ function registerFeishuChatTools(api) {
|
|
|
185
165
|
}
|
|
186
166
|
if (p.action === "member_info" && !p.member_id) return feishuExternalToolResult({ error: "member_id is required for action member_info" });
|
|
187
167
|
if (!p.chat_id) return feishuExternalToolResult({ error: `chat_id is required for action ${p.action}` });
|
|
188
|
-
const
|
|
189
|
-
client,
|
|
168
|
+
const readContext = {
|
|
190
169
|
cfg,
|
|
191
170
|
account,
|
|
192
|
-
chatId: p.chat_id,
|
|
193
171
|
ctx
|
|
172
|
+
};
|
|
173
|
+
const preliminary = resolveFeishuChatReadPreliminaryAuthorization({
|
|
174
|
+
...readContext,
|
|
175
|
+
chatId: p.chat_id
|
|
194
176
|
});
|
|
177
|
+
if (preliminary.decision === "deny") assertFeishuChatReadAllowed({
|
|
178
|
+
...readContext,
|
|
179
|
+
chatId: preliminary.chatId
|
|
180
|
+
});
|
|
181
|
+
const chat = await readFeishuChatInfoWithAuthorization({
|
|
182
|
+
...readContext,
|
|
183
|
+
preliminary
|
|
184
|
+
}, (chatId) => getChatInfo(client, chatId));
|
|
195
185
|
if (p.action === "info") return feishuExternalToolResult(chat);
|
|
196
186
|
const authorization = authorizeFeishuChatMemberRead({
|
|
197
|
-
|
|
198
|
-
account,
|
|
187
|
+
...readContext,
|
|
199
188
|
chatId: p.chat_id,
|
|
200
189
|
chatType: resolveFeishuChatType(chat),
|
|
201
|
-
ctx,
|
|
202
190
|
memberId: p.action === "member_info" ? p.member_id : void 0,
|
|
203
191
|
memberIdType: p.member_id_type
|
|
204
192
|
});
|
|
@@ -1,32 +1,20 @@
|
|
|
1
|
-
import { _ as __exportAll } from "./doctor-contract-
|
|
1
|
+
import { _ as __exportAll } from "./doctor-contract-oIpUWtNO.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { PlatformMessageNotDispatchedError } from "openclaw/plugin-sdk/error-runtime";
|
|
4
|
-
import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
4
|
+
import { asPositiveFiniteNumber, parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
5
5
|
import * as Lark from "@larksuiteoapi/node-sdk";
|
|
6
6
|
import { bufferToBlobPart } from "openclaw/plugin-sdk/blob-runtime";
|
|
7
7
|
import { isRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
8
8
|
import { readPluginPackageVersion, resolveAmbientNodeProxyAgent } from "openclaw/plugin-sdk/extension-shared";
|
|
9
|
-
import { captureChannelReadAuthority } from "openclaw/plugin-sdk/fetch-runtime";
|
|
9
|
+
import { captureChannelReadAuthority, captureEffectAuthority } from "openclaw/plugin-sdk/fetch-runtime";
|
|
10
10
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
11
11
|
//#region extensions/feishu/src/client-timeout.ts
|
|
12
|
-
/** Default HTTP timeout for Feishu API requests (30 seconds). */
|
|
13
12
|
const FEISHU_HTTP_TIMEOUT_MS = 3e4;
|
|
14
13
|
const FEISHU_HTTP_TIMEOUT_MAX_MS = 3e5;
|
|
15
14
|
const FEISHU_HTTP_TIMEOUT_ENV_VAR = "OPENCLAW_FEISHU_HTTP_TIMEOUT_MS";
|
|
16
15
|
function resolveConfiguredHttpTimeoutMs(creds) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
const fromDirectField = creds.httpTimeoutMs;
|
|
21
|
-
if (typeof fromDirectField === "number" && Number.isFinite(fromDirectField) && fromDirectField > 0) return clampTimeout(fromDirectField);
|
|
22
|
-
const envRaw = process.env[FEISHU_HTTP_TIMEOUT_ENV_VAR];
|
|
23
|
-
if (envRaw) {
|
|
24
|
-
const envValue = parseStrictPositiveInteger(envRaw);
|
|
25
|
-
if (envValue !== void 0) return clampTimeout(envValue);
|
|
26
|
-
}
|
|
27
|
-
const timeout = creds.config?.httpTimeoutMs;
|
|
28
|
-
if (typeof timeout !== "number" || !Number.isFinite(timeout) || timeout <= 0) return FEISHU_HTTP_TIMEOUT_MS;
|
|
29
|
-
return clampTimeout(timeout);
|
|
16
|
+
const timeout = asPositiveFiniteNumber(creds.httpTimeoutMs) ?? parseStrictPositiveInteger(process.env[FEISHU_HTTP_TIMEOUT_ENV_VAR]) ?? asPositiveFiniteNumber(creds.config?.httpTimeoutMs) ?? 3e4;
|
|
17
|
+
return Math.min(Math.max(Math.floor(timeout), 1), FEISHU_HTTP_TIMEOUT_MAX_MS);
|
|
30
18
|
}
|
|
31
19
|
//#endregion
|
|
32
20
|
//#region extensions/feishu/src/send-context.ts
|
|
@@ -91,7 +79,6 @@ const require = createRequire(import.meta.url);
|
|
|
91
79
|
const FEISHU_USER_AGENT = `openclaw-feishu-builtin/${readPluginPackageVersion({ require })}/${process.platform}`;
|
|
92
80
|
const FEISHU_SDK_ORIGIN = "https://open.feishu.cn";
|
|
93
81
|
const FEISHU_WS_CONFIG = { pingTimeout: 3 };
|
|
94
|
-
/** User-Agent header value for all Feishu API requests. */
|
|
95
82
|
function getFeishuUserAgent() {
|
|
96
83
|
return FEISHU_USER_AGENT;
|
|
97
84
|
}
|
|
@@ -286,15 +273,25 @@ function createFeishuHttpInstance(defaultTimeoutMs, configuredDomain) {
|
|
|
286
273
|
throw error;
|
|
287
274
|
}
|
|
288
275
|
}
|
|
276
|
+
async function dispatch(authority, options, send) {
|
|
277
|
+
const effect = captureEffectAuthority();
|
|
278
|
+
const prepared = await injectRequestOptions(options, authority);
|
|
279
|
+
return effect.initiate(() => {
|
|
280
|
+
authority?.assertCurrent();
|
|
281
|
+
return send(prepared);
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
const createMethod = (method) => (url, opts) => runRequest((authority) => dispatch(authority, opts, (prepared) => base[method](resolveRequestUrl(url), prepared)));
|
|
285
|
+
const createDataMethod = (method) => (url, data, opts) => runRequest((authority) => dispatch(authority, opts, (prepared) => base[method](resolveRequestUrl(url), data, prepared)));
|
|
289
286
|
return {
|
|
290
|
-
request: (opts) => runRequest(
|
|
291
|
-
get: (
|
|
292
|
-
post: (
|
|
293
|
-
put: (
|
|
294
|
-
patch: (
|
|
295
|
-
delete: (
|
|
296
|
-
head: (
|
|
297
|
-
options: (
|
|
287
|
+
request: (opts) => runRequest((authority) => dispatch(authority, normalizeMultipartUploadData(opts), (prepared) => base.request(prepared)), "request"),
|
|
288
|
+
get: createMethod("get"),
|
|
289
|
+
post: createDataMethod("post"),
|
|
290
|
+
put: createDataMethod("put"),
|
|
291
|
+
patch: createDataMethod("patch"),
|
|
292
|
+
delete: createMethod("delete"),
|
|
293
|
+
head: createMethod("head"),
|
|
294
|
+
options: createMethod("options")
|
|
298
295
|
};
|
|
299
296
|
}
|
|
300
297
|
function createFeishuClient(creds) {
|
|
@@ -321,10 +318,7 @@ function createFeishuClient(creds) {
|
|
|
321
318
|
});
|
|
322
319
|
return client;
|
|
323
320
|
}
|
|
324
|
-
/**
|
|
325
|
-
* Create a Feishu WebSocket client for an account.
|
|
326
|
-
* Note: WSClient is not cached since each call creates a new connection.
|
|
327
|
-
*/
|
|
321
|
+
/** WSClient is not cached since each call creates a new connection. */
|
|
328
322
|
async function createFeishuWSClient(account, callbacks = {}) {
|
|
329
323
|
const { accountId, appId, appSecret, domain } = account;
|
|
330
324
|
if (!appId || !appSecret) throw new Error(`Feishu credentials not configured for account "${accountId}"`);
|
|
@@ -22,7 +22,7 @@ function normalizeFeishuTarget(raw) {
|
|
|
22
22
|
}
|
|
23
23
|
function resolveReceiveIdType(id) {
|
|
24
24
|
const trimmed = id.trim();
|
|
25
|
-
const lowered =
|
|
25
|
+
const lowered = trimmed.toLowerCase();
|
|
26
26
|
if (lowered.startsWith("chat:") || lowered.startsWith("group:") || lowered.startsWith("channel:")) return "chat_id";
|
|
27
27
|
if (lowered.startsWith("open_id:")) return "open_id";
|
|
28
28
|
if (lowered.startsWith("user:") || lowered.startsWith("dm:")) return trimmed.replace(/^(user|dm):/i, "").trim().startsWith(OPEN_ID_PREFIX) ? "open_id" : "user_id";
|
|
@@ -53,15 +53,10 @@ function buildFeishuConversationId(params) {
|
|
|
53
53
|
const chatId = normalizeOptionalString(params.chatId) ?? "unknown";
|
|
54
54
|
const senderOpenId = normalizeOptionalString(params.senderOpenId);
|
|
55
55
|
const topicId = normalizeOptionalString(params.topicId);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (topicId && senderOpenId) return `${chatId}:topic:${topicId}:sender:${senderOpenId}`;
|
|
61
|
-
if (topicId) return `${chatId}:topic:${topicId}`;
|
|
62
|
-
return senderOpenId ? `${chatId}:sender:${senderOpenId}` : chatId;
|
|
63
|
-
default: return chatId;
|
|
64
|
-
}
|
|
56
|
+
let conversationId = chatId;
|
|
57
|
+
if (topicId && (params.scope === "group_topic" || params.scope === "group_topic_sender")) conversationId += `:topic:${topicId}`;
|
|
58
|
+
if (senderOpenId && (params.scope === "group_sender" || params.scope === "group_topic_sender")) conversationId += `:sender:${senderOpenId}`;
|
|
59
|
+
return conversationId;
|
|
65
60
|
}
|
|
66
61
|
function parseFeishuTargetId(raw) {
|
|
67
62
|
const target = normalizeOptionalString(raw);
|
|
@@ -161,10 +161,10 @@ function inspectFeishuCredentials(cfg, rootConfig) {
|
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
function buildResolvedFeishuAccount(params) {
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
const { accountId, source: selectionSource } = typeof params.accountId === "string" && params.accountId.trim() !== "" ? {
|
|
165
|
+
accountId: normalizeAccountId(params.accountId),
|
|
166
|
+
source: "explicit"
|
|
167
|
+
} : resolveDefaultFeishuAccountSelection(params.cfg);
|
|
168
168
|
const feishuCfg = params.cfg.channels?.feishu;
|
|
169
169
|
const merged = mergeFeishuAccountConfig(params.cfg, accountId);
|
|
170
170
|
const baseCreds = resolveFeishuBaseCredentials(merged, params.baseMode, params.cfg);
|
|
@@ -226,14 +226,10 @@ const DEFAULT_FEISHU_WEBHOOK_PATH = "/feishu/events";
|
|
|
226
226
|
function normalizeFeishuWebhookPath(value) {
|
|
227
227
|
const configured = value?.trim();
|
|
228
228
|
if (!configured) return DEFAULT_FEISHU_WEBHOOK_PATH;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return `${parsed.pathname}${parsed.search}${emptyQuery}`;
|
|
234
|
-
} catch {
|
|
235
|
-
return null;
|
|
236
|
-
}
|
|
229
|
+
const parsed = URL.parse(configured, "http://localhost");
|
|
230
|
+
if (!parsed || parsed.protocol !== "http:" && parsed.protocol !== "https:") return null;
|
|
231
|
+
const emptyQuery = !parsed.search && parsed.href.endsWith("?") && !configured.includes("#") ? "?" : "";
|
|
232
|
+
return `${parsed.pathname}${parsed.search}${emptyQuery}`;
|
|
237
233
|
}
|
|
238
234
|
//#endregion
|
|
239
235
|
//#region extensions/feishu/src/config-schema.ts
|
|
@@ -315,9 +311,6 @@ const DynamicAgentCreationSchema = z.object({
|
|
|
315
311
|
maxAgents: z.number().int().positive().optional()
|
|
316
312
|
}).strict().optional();
|
|
317
313
|
/**
|
|
318
|
-
* Feishu tools configuration.
|
|
319
|
-
* Controls which tool categories are enabled.
|
|
320
|
-
*
|
|
321
314
|
* Dependencies:
|
|
322
315
|
* - wiki requires doc (wiki content is edited via doc tools)
|
|
323
316
|
* - perm can work independently but is typically used with drive
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as listEnabledFeishuAccounts, g as resolveFeishuRuntimeAccount } from "./doctor-contract-
|
|
1
|
+
import { d as listEnabledFeishuAccounts, g as resolveFeishuRuntimeAccount } from "./doctor-contract-oIpUWtNO.mjs";
|
|
2
2
|
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.mjs";
|
|
3
|
-
import { r as registerFeishuAiAgent, t as probeFeishu } from "./probe-
|
|
3
|
+
import { r as registerFeishuAiAgent, t as probeFeishu } from "./probe-DXnFxq5j.mjs";
|
|
4
4
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
6
6
|
import { clampTimerTimeoutMs, parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -69,43 +69,6 @@ function resolveStartupProbeTimeoutMs(env = process.env) {
|
|
|
69
69
|
//#endregion
|
|
70
70
|
//#region extensions/feishu/src/monitor.startup.ts
|
|
71
71
|
const FEISHU_STARTUP_BOT_INFO_TIMEOUT_MS = resolveStartupProbeTimeoutMs();
|
|
72
|
-
function isTimeoutErrorMessage(message) {
|
|
73
|
-
const lower = normalizeLowercaseStringOrEmpty(message);
|
|
74
|
-
return lower.includes("timeout") || lower.includes("timed out");
|
|
75
|
-
}
|
|
76
|
-
function isAbortErrorMessage(message) {
|
|
77
|
-
return normalizeLowercaseStringOrEmpty(message).includes("aborted");
|
|
78
|
-
}
|
|
79
|
-
async function writeProviderBotIdentityCache(params) {
|
|
80
|
-
try {
|
|
81
|
-
await writeCachedFeishuBotIdentity({
|
|
82
|
-
accountId: params.account.accountId,
|
|
83
|
-
appId: params.account.appId,
|
|
84
|
-
botOpenId: params.botOpenId,
|
|
85
|
-
botName: params.botName
|
|
86
|
-
});
|
|
87
|
-
} catch {
|
|
88
|
-
params.runtime?.log?.(`feishu[${params.account.accountId}]: bot identity cache write failed; continuing startup`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
async function readProviderBotIdentityCache(params) {
|
|
92
|
-
try {
|
|
93
|
-
const cached = await readCachedFeishuBotIdentity({
|
|
94
|
-
accountId: params.account.accountId,
|
|
95
|
-
appId: params.account.appId
|
|
96
|
-
});
|
|
97
|
-
if (!cached) return {};
|
|
98
|
-
params.runtime?.log?.(`feishu[${params.account.accountId}]: using cached provider-verified bot identity while the fresh probe is unavailable`);
|
|
99
|
-
return {
|
|
100
|
-
botOpenId: cached.botOpenId,
|
|
101
|
-
botName: cached.botName,
|
|
102
|
-
source: "cache"
|
|
103
|
-
};
|
|
104
|
-
} catch {
|
|
105
|
-
params.runtime?.log?.(`feishu[${params.account.accountId}]: bot identity cache read failed; continuing without cached identity`);
|
|
106
|
-
return {};
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
72
|
async function fetchBotIdentityForMonitor(account, options = {}) {
|
|
110
73
|
if (options.abortSignal?.aborted) return {};
|
|
111
74
|
const timeoutMs = FEISHU_STARTUP_BOT_INFO_TIMEOUT_MS;
|
|
@@ -120,31 +83,47 @@ async function fetchBotIdentityForMonitor(account, options = {}) {
|
|
|
120
83
|
}).catch(() => {
|
|
121
84
|
(options.runtime?.log ?? console.log)(`feishu[${account.accountId}]: AI-agent registration failed unexpectedly; continuing with standard bot identity`);
|
|
122
85
|
});
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
86
|
+
try {
|
|
87
|
+
await writeCachedFeishuBotIdentity({
|
|
88
|
+
accountId: account.accountId,
|
|
89
|
+
appId: account.appId,
|
|
90
|
+
botOpenId: result.botOpenId,
|
|
91
|
+
botName: result.botName
|
|
92
|
+
});
|
|
93
|
+
} catch {
|
|
94
|
+
options.runtime?.log?.(`feishu[${account.accountId}]: bot identity cache write failed; continuing startup`);
|
|
95
|
+
}
|
|
129
96
|
return {
|
|
130
97
|
botOpenId: normalizeOptionalString(result.botOpenId),
|
|
131
98
|
botName: normalizeOptionalString(result.botName),
|
|
132
99
|
source: "provider"
|
|
133
100
|
};
|
|
134
101
|
}
|
|
135
|
-
if (result.ok) (options.runtime?.log ?? console.log)(`feishu[${account.accountId}]: bot info
|
|
136
|
-
const probeError = result.error
|
|
137
|
-
if (options.abortSignal?.aborted ||
|
|
138
|
-
if (
|
|
102
|
+
if (result.ok) (options.runtime?.log ?? console.log)(`feishu[${account.accountId}]: bot info check returned identity for a different app; ignoring stale result`);
|
|
103
|
+
const probeError = normalizeLowercaseStringOrEmpty(result.error);
|
|
104
|
+
if (options.abortSignal?.aborted || probeError.includes("aborted")) return {};
|
|
105
|
+
if (probeError.includes("timeout") || probeError.includes("timed out")) (options.runtime?.error ?? console.error)(`feishu[${account.accountId}]: bot info check timed out after ${timeoutMs}ms; continuing startup`);
|
|
139
106
|
if (options.allowCachedFallback === false) return {};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
107
|
+
try {
|
|
108
|
+
const cached = await readCachedFeishuBotIdentity({
|
|
109
|
+
accountId: account.accountId,
|
|
110
|
+
appId: account.appId
|
|
111
|
+
});
|
|
112
|
+
if (!cached) return {};
|
|
113
|
+
options.runtime?.log?.(`feishu[${account.accountId}]: using cached provider-verified bot identity while the fresh check is unavailable`);
|
|
114
|
+
return {
|
|
115
|
+
botOpenId: cached.botOpenId,
|
|
116
|
+
botName: cached.botName,
|
|
117
|
+
source: "cache"
|
|
118
|
+
};
|
|
119
|
+
} catch {
|
|
120
|
+
options.runtime?.log?.(`feishu[${account.accountId}]: bot identity cache read failed; continuing without cached identity`);
|
|
121
|
+
return {};
|
|
122
|
+
}
|
|
144
123
|
}
|
|
145
124
|
//#endregion
|
|
146
125
|
//#region extensions/feishu/src/monitor.ts
|
|
147
|
-
const loadMonitorAccountRuntime = createLazyRuntimeModule(() => import("./monitor.account-
|
|
126
|
+
const loadMonitorAccountRuntime = createLazyRuntimeModule(() => import("./monitor.account-CVz16781.mjs"));
|
|
148
127
|
async function monitorFeishuProvider(opts = {}) {
|
|
149
128
|
const cfg = opts.config;
|
|
150
129
|
if (!cfg) throw new Error("Config is required for Feishu monitor");
|