@openclaw/feishu 2026.7.1 → 2026.7.2-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/{accounts-Bs5uJ4h0.js → accounts-BDoGHJDk.js} +29 -54
- package/dist/api.js +351 -195
- package/dist/{app-registration-BwQ-aGTe.js → app-registration-BzkyrVZu.js} +11 -11
- package/dist/{channel-DRQRQQQ3.js → channel-X30GQVwc.js} +591 -398
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-pvr-Y5ji.js → channel.runtime-By2uqa3Q.js} +272 -107
- package/dist/{client-B7EAV_Ss.js → client-87BmeMpj.js} +55 -29
- package/dist/contract-api.js +1 -1
- package/dist/{conversation-id-CdLdoot3.js → conversation-id-BeJL-wq7.js} +3 -0
- package/dist/doctor-contract-DXH5hux1.js +97 -0
- package/dist/doctor-contract-api.js +2 -0
- package/dist/{drive-D0lIhxqZ.js → drive-B4E8OXZ0.js} +181 -33
- package/dist/{monitor-CsbheK9J.js → monitor-CHl0bWzb.js} +3 -3
- package/dist/{monitor.account-Dr7do33p.js → monitor.account-BSRV2hIF.js} +529 -549
- package/dist/monitor.startup-Cy8NPGAX.js +43 -0
- package/dist/{probe-Dxyo9zlw.js → probe-BgboTHIn.js} +3 -6
- package/dist/{secret-contract-DLaBl9m4.js → secret-contract-DnlMcrn5.js} +14 -69
- package/dist/secret-contract-api.js +1 -1
- package/dist/{send-Be2GMA6Z.js → send-DrWM_Ilf.js} +67 -40
- package/dist/send-result-DsqTk27v.js +770 -0
- package/dist/{session-conversation-BYuoVJwl.js → session-conversation-BksWrfzm.js} +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-api.js +1 -1
- package/dist/setup-entry.js +0 -5
- package/dist/{subagent-hooks-B2iWPYJ1.js → subagent-hooks-BKTOxB-T.js} +9 -5
- package/dist/subagent-hooks-api.js +1 -1
- package/node_modules/@types/debug/LICENSE +21 -0
- package/node_modules/@types/debug/README.md +69 -0
- package/node_modules/@types/debug/index.d.ts +50 -0
- package/node_modules/@types/debug/package.json +58 -0
- package/node_modules/@types/mdast/LICENSE +21 -0
- package/node_modules/@types/mdast/README.md +15 -0
- package/node_modules/@types/mdast/index.d.ts +1123 -0
- package/node_modules/@types/mdast/package.json +47 -0
- package/node_modules/@types/ms/LICENSE +21 -0
- package/node_modules/@types/ms/README.md +82 -0
- package/node_modules/@types/ms/index.d.ts +63 -0
- package/node_modules/@types/ms/package.json +26 -0
- package/node_modules/@types/unist/LICENSE +21 -0
- package/node_modules/@types/unist/README.md +15 -0
- package/node_modules/@types/unist/index.d.ts +119 -0
- package/node_modules/@types/unist/package.json +60 -0
- package/node_modules/character-entities/index.d.ts +6 -0
- package/node_modules/character-entities/index.js +2132 -0
- package/node_modules/character-entities/license +22 -0
- package/node_modules/character-entities/package.json +78 -0
- package/node_modules/character-entities/readme.md +152 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/decode-named-character-reference/index.d.ts +13 -0
- package/node_modules/decode-named-character-reference/index.d.ts.map +1 -0
- package/node_modules/decode-named-character-reference/index.dom.d.ts +6 -0
- package/node_modules/decode-named-character-reference/index.dom.d.ts.map +1 -0
- package/node_modules/decode-named-character-reference/index.dom.js +32 -0
- package/node_modules/decode-named-character-reference/index.js +19 -0
- package/node_modules/decode-named-character-reference/license +22 -0
- package/node_modules/decode-named-character-reference/package.json +90 -0
- package/node_modules/decode-named-character-reference/readme.md +136 -0
- package/node_modules/dequal/dist/index.js +86 -0
- package/node_modules/dequal/dist/index.min.js +1 -0
- package/node_modules/dequal/dist/index.mjs +84 -0
- package/node_modules/dequal/index.d.ts +1 -0
- package/node_modules/dequal/license +21 -0
- package/node_modules/dequal/lite/index.d.ts +1 -0
- package/node_modules/dequal/lite/index.js +31 -0
- package/node_modules/dequal/lite/index.min.js +1 -0
- package/node_modules/dequal/lite/index.mjs +29 -0
- package/node_modules/dequal/package.json +57 -0
- package/node_modules/dequal/readme.md +112 -0
- package/node_modules/devlop/lib/default.js +9 -0
- package/node_modules/devlop/lib/development.d.ts +84 -0
- package/node_modules/devlop/lib/development.js +238 -0
- package/node_modules/devlop/license +22 -0
- package/node_modules/devlop/package.json +80 -0
- package/node_modules/devlop/readme.md +360 -0
- package/node_modules/longest-streak/index.d.ts +11 -0
- package/node_modules/longest-streak/index.js +36 -0
- package/node_modules/longest-streak/license +22 -0
- package/node_modules/longest-streak/package.json +73 -0
- package/node_modules/longest-streak/readme.md +150 -0
- package/node_modules/markdown-table/index.d.ts +171 -0
- package/node_modules/markdown-table/index.d.ts.map +1 -0
- package/node_modules/markdown-table/index.js +393 -0
- package/node_modules/markdown-table/license +22 -0
- package/node_modules/markdown-table/package.json +77 -0
- package/node_modules/markdown-table/readme.md +344 -0
- package/node_modules/mdast-util-from-markdown/dev/index.d.ts +23 -0
- package/node_modules/mdast-util-from-markdown/dev/index.js +2 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts +53 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts.map +1 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/index.js +1348 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/types.d.ts +295 -0
- package/node_modules/mdast-util-from-markdown/dev/lib/types.js +2 -0
- package/node_modules/mdast-util-from-markdown/index.d.ts +23 -0
- package/node_modules/mdast-util-from-markdown/index.js +2 -0
- package/node_modules/mdast-util-from-markdown/lib/index.d.ts +53 -0
- package/node_modules/mdast-util-from-markdown/lib/index.d.ts.map +1 -0
- package/node_modules/mdast-util-from-markdown/lib/index.js +1177 -0
- package/node_modules/mdast-util-from-markdown/lib/types.d.ts +295 -0
- package/node_modules/mdast-util-from-markdown/lib/types.js +2 -0
- package/node_modules/mdast-util-from-markdown/license +22 -0
- package/node_modules/mdast-util-from-markdown/package.json +99 -0
- package/node_modules/mdast-util-from-markdown/readme.md +535 -0
- package/node_modules/mdast-util-gfm-table/index.d.ts +54 -0
- package/node_modules/mdast-util-gfm-table/index.js +2 -0
- package/node_modules/mdast-util-gfm-table/lib/index.d.ts +51 -0
- package/node_modules/mdast-util-gfm-table/lib/index.js +300 -0
- package/node_modules/mdast-util-gfm-table/license +22 -0
- package/node_modules/mdast-util-gfm-table/package.json +101 -0
- package/node_modules/mdast-util-gfm-table/readme.md +605 -0
- package/node_modules/mdast-util-phrasing/index.d.ts +1 -0
- package/node_modules/mdast-util-phrasing/index.js +1 -0
- package/node_modules/mdast-util-phrasing/lib/index.d.ts +3 -0
- package/node_modules/mdast-util-phrasing/lib/index.js +45 -0
- package/node_modules/mdast-util-phrasing/license +23 -0
- package/node_modules/mdast-util-phrasing/package.json +78 -0
- package/node_modules/mdast-util-phrasing/readme.md +200 -0
- package/node_modules/mdast-util-to-markdown/index.d.ts +16 -0
- package/node_modules/mdast-util-to-markdown/index.js +3 -0
- package/node_modules/mdast-util-to-markdown/lib/configure.d.ts +9 -0
- package/node_modules/mdast-util-to-markdown/lib/configure.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/configure.js +79 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts +17 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js +29 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts +13 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/break.js +30 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts +13 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/code.js +75 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts +13 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/definition.js +76 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts +24 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js +69 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts +13 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/heading.js +75 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts +15 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/html.js +20 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts +21 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js +63 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts +21 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/image.js +82 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/index.d.ts +42 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/index.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/index.js +45 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts +19 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +76 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts +21 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js +63 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts +24 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/link.js +114 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts +13 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list-item.js +62 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts +13 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/list.js +100 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts +17 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js +20 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts +13 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/root.js +23 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts +24 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/strong.js +69 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts +17 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/text.js +15 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts +11 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js +21 -0
- package/node_modules/mdast-util-to-markdown/lib/index.d.ts +14 -0
- package/node_modules/mdast-util-to-markdown/lib/index.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/index.js +187 -0
- package/node_modules/mdast-util-to-markdown/lib/join.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/join.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/join.js +39 -0
- package/node_modules/mdast-util-to-markdown/lib/types.d.ts +965 -0
- package/node_modules/mdast-util-to-markdown/lib/types.js +2 -0
- package/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts +4 -0
- package/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/unsafe.js +146 -0
- package/node_modules/mdast-util-to-markdown/lib/util/association.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/util/association.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/association.js +33 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js +21 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts +8 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js +38 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js +21 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js +21 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-fence.js +21 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +21 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-quote.js +21 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js +21 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-rule.js +21 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/check-strong.js +21 -0
- package/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js +24 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts +19 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-flow.js +84 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts +19 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +125 -0
- package/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts +7 -0
- package/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.d.ts +10 -0
- package/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js +11 -0
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts +33 -0
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/encode-info.js +82 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts +13 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js +22 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts +9 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +34 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts +9 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js +34 -0
- package/node_modules/mdast-util-to-markdown/lib/util/indent-lines.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/util/indent-lines.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js +35 -0
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts +12 -0
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js +41 -0
- package/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts +29 -0
- package/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/safe.js +174 -0
- package/node_modules/mdast-util-to-markdown/lib/util/track.d.ts +2 -0
- package/node_modules/mdast-util-to-markdown/lib/util/track.d.ts.map +1 -0
- package/node_modules/mdast-util-to-markdown/lib/util/track.js +55 -0
- package/node_modules/mdast-util-to-markdown/license +22 -0
- package/node_modules/mdast-util-to-markdown/package.json +132 -0
- package/node_modules/mdast-util-to-markdown/readme.md +750 -0
- package/node_modules/mdast-util-to-string/index.d.ts +2 -0
- package/node_modules/mdast-util-to-string/index.js +5 -0
- package/node_modules/mdast-util-to-string/lib/index.d.ts +31 -0
- package/node_modules/mdast-util-to-string/lib/index.js +108 -0
- package/node_modules/mdast-util-to-string/license +22 -0
- package/node_modules/mdast-util-to-string/package.json +78 -0
- package/node_modules/mdast-util-to-string/readme.md +218 -0
- package/node_modules/micromark/dev/index.d.ts +82 -0
- package/node_modules/micromark/dev/index.d.ts.map +1 -0
- package/node_modules/micromark/dev/index.js +68 -0
- package/node_modules/micromark/dev/lib/compile.d.ts +16 -0
- package/node_modules/micromark/dev/lib/compile.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/compile.js +1152 -0
- package/node_modules/micromark/dev/lib/constructs.d.ts +73 -0
- package/node_modules/micromark/dev/lib/constructs.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/constructs.js +101 -0
- package/node_modules/micromark/dev/lib/create-tokenizer.d.ts +46 -0
- package/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/create-tokenizer.js +717 -0
- package/node_modules/micromark/dev/lib/initialize/content.d.ts +4 -0
- package/node_modules/micromark/dev/lib/initialize/content.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/initialize/content.js +99 -0
- package/node_modules/micromark/dev/lib/initialize/document.d.ts +10 -0
- package/node_modules/micromark/dev/lib/initialize/document.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/initialize/document.js +445 -0
- package/node_modules/micromark/dev/lib/initialize/flow.d.ts +4 -0
- package/node_modules/micromark/dev/lib/initialize/flow.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/initialize/flow.js +86 -0
- package/node_modules/micromark/dev/lib/initialize/text.d.ts +8 -0
- package/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/initialize/text.js +244 -0
- package/node_modules/micromark/dev/lib/parse.d.ts +10 -0
- package/node_modules/micromark/dev/lib/parse.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/parse.js +58 -0
- package/node_modules/micromark/dev/lib/postprocess.d.ts +9 -0
- package/node_modules/micromark/dev/lib/postprocess.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/postprocess.js +19 -0
- package/node_modules/micromark/dev/lib/preprocess.d.ts +13 -0
- package/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -0
- package/node_modules/micromark/dev/lib/preprocess.js +141 -0
- package/node_modules/micromark/dev/stream.d.ts +35 -0
- package/node_modules/micromark/dev/stream.d.ts.map +1 -0
- package/node_modules/micromark/dev/stream.js +270 -0
- package/node_modules/micromark/index.d.ts +82 -0
- package/node_modules/micromark/index.d.ts.map +1 -0
- package/node_modules/micromark/index.js +60 -0
- package/node_modules/micromark/lib/compile.d.ts +16 -0
- package/node_modules/micromark/lib/compile.d.ts.map +1 -0
- package/node_modules/micromark/lib/compile.js +1060 -0
- package/node_modules/micromark/lib/constructs.d.ts +73 -0
- package/node_modules/micromark/lib/constructs.d.ts.map +1 -0
- package/node_modules/micromark/lib/constructs.js +85 -0
- package/node_modules/micromark/lib/create-tokenizer.d.ts +46 -0
- package/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -0
- package/node_modules/micromark/lib/create-tokenizer.js +611 -0
- package/node_modules/micromark/lib/initialize/content.d.ts +4 -0
- package/node_modules/micromark/lib/initialize/content.d.ts.map +1 -0
- package/node_modules/micromark/lib/initialize/content.js +79 -0
- package/node_modules/micromark/lib/initialize/document.d.ts +10 -0
- package/node_modules/micromark/lib/initialize/document.d.ts.map +1 -0
- package/node_modules/micromark/lib/initialize/document.js +362 -0
- package/node_modules/micromark/lib/initialize/flow.d.ts +4 -0
- package/node_modules/micromark/lib/initialize/flow.d.ts.map +1 -0
- package/node_modules/micromark/lib/initialize/flow.js +58 -0
- package/node_modules/micromark/lib/initialize/text.d.ts +8 -0
- package/node_modules/micromark/lib/initialize/text.d.ts.map +1 -0
- package/node_modules/micromark/lib/initialize/text.js +212 -0
- package/node_modules/micromark/lib/parse.d.ts +10 -0
- package/node_modules/micromark/lib/parse.d.ts.map +1 -0
- package/node_modules/micromark/lib/parse.js +56 -0
- package/node_modules/micromark/lib/postprocess.d.ts +9 -0
- package/node_modules/micromark/lib/postprocess.d.ts.map +1 -0
- package/node_modules/micromark/lib/postprocess.js +18 -0
- package/node_modules/micromark/lib/preprocess.d.ts +13 -0
- package/node_modules/micromark/lib/preprocess.d.ts.map +1 -0
- package/node_modules/micromark/lib/preprocess.js +115 -0
- package/node_modules/micromark/license +22 -0
- package/node_modules/micromark/package.json +100 -0
- package/node_modules/micromark/readme.md +488 -0
- package/node_modules/micromark/stream.d.ts +35 -0
- package/node_modules/micromark/stream.d.ts.map +1 -0
- package/node_modules/micromark/stream.js +256 -0
- package/node_modules/micromark-core-commonmark/dev/index.d.ts +23 -0
- package/node_modules/micromark-core-commonmark/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/index.js +22 -0
- package/node_modules/micromark-core-commonmark/dev/lib/attention.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/attention.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/attention.js +300 -0
- package/node_modules/micromark-core-commonmark/dev/lib/autolink.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/autolink.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/autolink.js +269 -0
- package/node_modules/micromark-core-commonmark/dev/lib/blank-line.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/blank-line.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/blank-line.js +62 -0
- package/node_modules/micromark-core-commonmark/dev/lib/block-quote.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/block-quote.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/block-quote.js +162 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-escape.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-escape.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-escape.js +69 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-reference.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-reference.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/character-reference.js +166 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +514 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +202 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-text.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-text.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/code-text.js +257 -0
- package/node_modules/micromark-core-commonmark/dev/lib/content.d.ts +7 -0
- package/node_modules/micromark-core-commonmark/dev/lib/content.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/content.js +185 -0
- package/node_modules/micromark-core-commonmark/dev/lib/definition.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/definition.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/definition.js +295 -0
- package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.js +65 -0
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +233 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +989 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-text.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-text.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/html-text.js +783 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.js +656 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +110 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +62 -0
- package/node_modules/micromark-core-commonmark/dev/lib/line-ending.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/line-ending.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/line-ending.js +34 -0
- package/node_modules/micromark-core-commonmark/dev/lib/list.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/list.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/list.js +306 -0
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +210 -0
- package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/thematic-break.js +120 -0
- package/node_modules/micromark-core-commonmark/index.d.ts +23 -0
- package/node_modules/micromark-core-commonmark/index.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/index.js +22 -0
- package/node_modules/micromark-core-commonmark/lib/attention.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/attention.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/attention.js +241 -0
- package/node_modules/micromark-core-commonmark/lib/autolink.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/autolink.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/autolink.js +233 -0
- package/node_modules/micromark-core-commonmark/lib/blank-line.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/blank-line.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/blank-line.js +61 -0
- package/node_modules/micromark-core-commonmark/lib/block-quote.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/block-quote.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/block-quote.js +143 -0
- package/node_modules/micromark-core-commonmark/lib/character-escape.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/character-escape.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/character-escape.js +64 -0
- package/node_modules/micromark-core-commonmark/lib/character-reference.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/character-reference.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/character-reference.js +149 -0
- package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/code-fenced.js +460 -0
- package/node_modules/micromark-core-commonmark/lib/code-indented.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/code-indented.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/code-indented.js +177 -0
- package/node_modules/micromark-core-commonmark/lib/code-text.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/code-text.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/code-text.js +225 -0
- package/node_modules/micromark-core-commonmark/lib/content.d.ts +7 -0
- package/node_modules/micromark-core-commonmark/lib/content.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/content.js +163 -0
- package/node_modules/micromark-core-commonmark/lib/definition.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/definition.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/definition.js +254 -0
- package/node_modules/micromark-core-commonmark/lib/hard-break-escape.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/hard-break-escape.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +60 -0
- package/node_modules/micromark-core-commonmark/lib/heading-atx.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/heading-atx.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/heading-atx.js +195 -0
- package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/html-flow.js +876 -0
- package/node_modules/micromark-core-commonmark/lib/html-text.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/html-text.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/html-text.js +678 -0
- package/node_modules/micromark-core-commonmark/lib/label-end.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/label-end.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/label-end.js +560 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-image.js +102 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/label-start-link.js +55 -0
- package/node_modules/micromark-core-commonmark/lib/line-ending.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/line-ending.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/line-ending.js +33 -0
- package/node_modules/micromark-core-commonmark/lib/list.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/list.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/list.js +213 -0
- package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/setext-underline.js +185 -0
- package/node_modules/micromark-core-commonmark/lib/thematic-break.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/thematic-break.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/thematic-break.js +102 -0
- package/node_modules/micromark-core-commonmark/license +22 -0
- package/node_modules/micromark-core-commonmark/package.json +74 -0
- package/node_modules/micromark-core-commonmark/readme.md +171 -0
- package/node_modules/micromark-extension-gfm-table/dev/index.d.ts +55 -0
- package/node_modules/micromark-extension-gfm-table/dev/index.js +2 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.d.ts +38 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.js +212 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/html.d.ts +11 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/html.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/html.js +148 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/infer.d.ts +14 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/infer.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/infer.js +64 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/syntax.d.ts +18 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/syntax.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/dev/lib/syntax.js +941 -0
- package/node_modules/micromark-extension-gfm-table/index.d.ts +55 -0
- package/node_modules/micromark-extension-gfm-table/index.js +2 -0
- package/node_modules/micromark-extension-gfm-table/lib/edit-map.d.ts +38 -0
- package/node_modules/micromark-extension-gfm-table/lib/edit-map.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/lib/edit-map.js +202 -0
- package/node_modules/micromark-extension-gfm-table/lib/html.d.ts +11 -0
- package/node_modules/micromark-extension-gfm-table/lib/html.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/lib/html.js +130 -0
- package/node_modules/micromark-extension-gfm-table/lib/infer.d.ts +14 -0
- package/node_modules/micromark-extension-gfm-table/lib/infer.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/lib/infer.js +52 -0
- package/node_modules/micromark-extension-gfm-table/lib/syntax.d.ts +18 -0
- package/node_modules/micromark-extension-gfm-table/lib/syntax.d.ts.map +1 -0
- package/node_modules/micromark-extension-gfm-table/lib/syntax.js +819 -0
- package/node_modules/micromark-extension-gfm-table/license +22 -0
- package/node_modules/micromark-extension-gfm-table/package.json +128 -0
- package/node_modules/micromark-extension-gfm-table/readme.md +515 -0
- package/node_modules/micromark-factory-destination/dev/index.d.ts +42 -0
- package/node_modules/micromark-factory-destination/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-destination/dev/index.js +255 -0
- package/node_modules/micromark-factory-destination/index.d.ts +42 -0
- package/node_modules/micromark-factory-destination/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-destination/index.js +206 -0
- package/node_modules/micromark-factory-destination/license +22 -0
- package/node_modules/micromark-factory-destination/package.json +57 -0
- package/node_modules/micromark-factory-destination/readme.md +234 -0
- package/node_modules/micromark-factory-label/dev/index.d.ts +37 -0
- package/node_modules/micromark-factory-label/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-label/dev/index.js +172 -0
- package/node_modules/micromark-factory-label/index.d.ts +37 -0
- package/node_modules/micromark-factory-label/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-label/index.js +148 -0
- package/node_modules/micromark-factory-label/license +22 -0
- package/node_modules/micromark-factory-label/package.json +60 -0
- package/node_modules/micromark-factory-label/readme.md +224 -0
- package/node_modules/micromark-factory-space/dev/index.d.ts +37 -0
- package/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-space/dev/index.js +67 -0
- package/node_modules/micromark-factory-space/index.d.ts +37 -0
- package/node_modules/micromark-factory-space/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-space/index.js +64 -0
- package/node_modules/micromark-factory-space/license +22 -0
- package/node_modules/micromark-factory-space/package.json +55 -0
- package/node_modules/micromark-factory-space/readme.md +225 -0
- package/node_modules/micromark-factory-title/dev/index.d.ts +36 -0
- package/node_modules/micromark-factory-title/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-title/dev/index.js +169 -0
- package/node_modules/micromark-factory-title/index.d.ts +36 -0
- package/node_modules/micromark-factory-title/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-title/index.js +158 -0
- package/node_modules/micromark-factory-title/license +22 -0
- package/node_modules/micromark-factory-title/package.json +58 -0
- package/node_modules/micromark-factory-title/readme.md +229 -0
- package/node_modules/micromark-factory-whitespace/dev/index.d.ts +22 -0
- package/node_modules/micromark-factory-whitespace/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-whitespace/dev/index.js +53 -0
- package/node_modules/micromark-factory-whitespace/index.d.ts +22 -0
- package/node_modules/micromark-factory-whitespace/index.d.ts.map +1 -0
- package/node_modules/micromark-factory-whitespace/index.js +44 -0
- package/node_modules/micromark-factory-whitespace/license +22 -0
- package/node_modules/micromark-factory-whitespace/package.json +57 -0
- package/node_modules/micromark-factory-whitespace/readme.md +205 -0
- package/node_modules/micromark-util-character/dev/index.d.ts +195 -0
- package/node_modules/micromark-util-character/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-character/dev/index.js +252 -0
- package/node_modules/micromark-util-character/index.d.ts +195 -0
- package/node_modules/micromark-util-character/index.d.ts.map +1 -0
- package/node_modules/micromark-util-character/index.js +246 -0
- package/node_modules/micromark-util-character/license +22 -0
- package/node_modules/micromark-util-character/package.json +57 -0
- package/node_modules/micromark-util-character/readme.md +446 -0
- package/node_modules/micromark-util-chunked/dev/index.d.ts +41 -0
- package/node_modules/micromark-util-chunked/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-chunked/dev/index.js +89 -0
- package/node_modules/micromark-util-chunked/index.d.ts +41 -0
- package/node_modules/micromark-util-chunked/index.d.ts.map +1 -0
- package/node_modules/micromark-util-chunked/index.js +81 -0
- package/node_modules/micromark-util-chunked/license +22 -0
- package/node_modules/micromark-util-chunked/package.json +57 -0
- package/node_modules/micromark-util-chunked/readme.md +219 -0
- package/node_modules/micromark-util-classify-character/dev/index.d.ts +18 -0
- package/node_modules/micromark-util-classify-character/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-classify-character/dev/index.js +38 -0
- package/node_modules/micromark-util-classify-character/index.d.ts +18 -0
- package/node_modules/micromark-util-classify-character/index.d.ts.map +1 -0
- package/node_modules/micromark-util-classify-character/index.js +27 -0
- package/node_modules/micromark-util-classify-character/license +22 -0
- package/node_modules/micromark-util-classify-character/package.json +59 -0
- package/node_modules/micromark-util-classify-character/readme.md +205 -0
- package/node_modules/micromark-util-combine-extensions/index.d.ts +22 -0
- package/node_modules/micromark-util-combine-extensions/index.d.ts.map +1 -0
- package/node_modules/micromark-util-combine-extensions/index.js +143 -0
- package/node_modules/micromark-util-combine-extensions/license +22 -0
- package/node_modules/micromark-util-combine-extensions/package.json +52 -0
- package/node_modules/micromark-util-combine-extensions/readme.md +201 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts +16 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/dev/index.js +42 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/index.d.ts +16 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/index.d.ts.map +1 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/index.js +32 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/license +22 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/package.json +59 -0
- package/node_modules/micromark-util-decode-numeric-character-reference/readme.md +184 -0
- package/node_modules/micromark-util-decode-string/dev/index.d.ts +14 -0
- package/node_modules/micromark-util-decode-string/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-decode-string/dev/index.js +53 -0
- package/node_modules/micromark-util-decode-string/index.d.ts +14 -0
- package/node_modules/micromark-util-decode-string/index.d.ts.map +1 -0
- package/node_modules/micromark-util-decode-string/index.js +45 -0
- package/node_modules/micromark-util-decode-string/license +22 -0
- package/node_modules/micromark-util-decode-string/package.json +63 -0
- package/node_modules/micromark-util-decode-string/readme.md +179 -0
- package/node_modules/micromark-util-encode/index.d.ts +14 -0
- package/node_modules/micromark-util-encode/index.d.ts.map +1 -0
- package/node_modules/micromark-util-encode/index.js +33 -0
- package/node_modules/micromark-util-encode/license +22 -0
- package/node_modules/micromark-util-encode/package.json +47 -0
- package/node_modules/micromark-util-encode/readme.md +176 -0
- package/node_modules/micromark-util-html-tag-name/index.d.ts +30 -0
- package/node_modules/micromark-util-html-tag-name/index.d.ts.map +1 -0
- package/node_modules/micromark-util-html-tag-name/index.js +93 -0
- package/node_modules/micromark-util-html-tag-name/license +22 -0
- package/node_modules/micromark-util-html-tag-name/package.json +47 -0
- package/node_modules/micromark-util-html-tag-name/readme.md +193 -0
- package/node_modules/micromark-util-normalize-identifier/dev/index.d.ts +21 -0
- package/node_modules/micromark-util-normalize-identifier/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-normalize-identifier/dev/index.js +38 -0
- package/node_modules/micromark-util-normalize-identifier/index.d.ts +21 -0
- package/node_modules/micromark-util-normalize-identifier/index.d.ts.map +1 -0
- package/node_modules/micromark-util-normalize-identifier/index.js +33 -0
- package/node_modules/micromark-util-normalize-identifier/license +22 -0
- package/node_modules/micromark-util-normalize-identifier/package.json +58 -0
- package/node_modules/micromark-util-normalize-identifier/readme.md +187 -0
- package/node_modules/micromark-util-resolve-all/index.d.ts +22 -0
- package/node_modules/micromark-util-resolve-all/index.d.ts.map +1 -0
- package/node_modules/micromark-util-resolve-all/index.js +32 -0
- package/node_modules/micromark-util-resolve-all/license +22 -0
- package/node_modules/micromark-util-resolve-all/package.json +48 -0
- package/node_modules/micromark-util-resolve-all/readme.md +238 -0
- package/node_modules/micromark-util-sanitize-uri/dev/index.d.ts +36 -0
- package/node_modules/micromark-util-sanitize-uri/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-sanitize-uri/dev/index.js +124 -0
- package/node_modules/micromark-util-sanitize-uri/index.d.ts +36 -0
- package/node_modules/micromark-util-sanitize-uri/index.d.ts.map +1 -0
- package/node_modules/micromark-util-sanitize-uri/index.js +107 -0
- package/node_modules/micromark-util-sanitize-uri/license +22 -0
- package/node_modules/micromark-util-sanitize-uri/package.json +59 -0
- package/node_modules/micromark-util-sanitize-uri/readme.md +214 -0
- package/node_modules/micromark-util-subtokenize/dev/index.d.ts +12 -0
- package/node_modules/micromark-util-subtokenize/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-subtokenize/dev/index.js +284 -0
- package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.d.ts +161 -0
- package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.d.ts.map +1 -0
- package/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.js +288 -0
- package/node_modules/micromark-util-subtokenize/index.d.ts +12 -0
- package/node_modules/micromark-util-subtokenize/index.d.ts.map +1 -0
- package/node_modules/micromark-util-subtokenize/index.js +228 -0
- package/node_modules/micromark-util-subtokenize/lib/splice-buffer.d.ts +161 -0
- package/node_modules/micromark-util-subtokenize/lib/splice-buffer.d.ts.map +1 -0
- package/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +251 -0
- package/node_modules/micromark-util-subtokenize/license +22 -0
- package/node_modules/micromark-util-subtokenize/package.json +60 -0
- package/node_modules/micromark-util-subtokenize/readme.md +181 -0
- package/node_modules/micromark-util-symbol/lib/codes.d.ts +139 -0
- package/node_modules/micromark-util-symbol/lib/codes.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/codes.js +158 -0
- package/node_modules/micromark-util-symbol/lib/constants.d.ts +37 -0
- package/node_modules/micromark-util-symbol/lib/constants.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/constants.js +44 -0
- package/node_modules/micromark-util-symbol/lib/default.d.ts +5 -0
- package/node_modules/micromark-util-symbol/lib/default.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/default.js +4 -0
- package/node_modules/micromark-util-symbol/lib/types.d.ts +106 -0
- package/node_modules/micromark-util-symbol/lib/types.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/types.js +453 -0
- package/node_modules/micromark-util-symbol/lib/values.d.ts +102 -0
- package/node_modules/micromark-util-symbol/lib/values.d.ts.map +1 -0
- package/node_modules/micromark-util-symbol/lib/values.js +109 -0
- package/node_modules/micromark-util-symbol/license +22 -0
- package/node_modules/micromark-util-symbol/package.json +43 -0
- package/node_modules/micromark-util-symbol/readme.md +168 -0
- package/node_modules/micromark-util-types/index.d.ts +1312 -0
- package/node_modules/micromark-util-types/index.js +2 -0
- package/node_modules/micromark-util-types/license +22 -0
- package/node_modules/micromark-util-types/package.json +71 -0
- package/node_modules/micromark-util-types/readme.md +151 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/unist-util-is/index.d.ts +5 -0
- package/node_modules/unist-util-is/index.d.ts.map +1 -0
- package/node_modules/unist-util-is/index.js +7 -0
- package/node_modules/unist-util-is/lib/index.d.ts +111 -0
- package/node_modules/unist-util-is/lib/index.d.ts.map +1 -0
- package/node_modules/unist-util-is/lib/index.js +296 -0
- package/node_modules/unist-util-is/license +22 -0
- package/node_modules/unist-util-is/package.json +103 -0
- package/node_modules/unist-util-is/readme.md +351 -0
- package/node_modules/unist-util-stringify-position/index.d.ts +1 -0
- package/node_modules/unist-util-stringify-position/index.js +1 -0
- package/node_modules/unist-util-stringify-position/lib/index.d.ts +61 -0
- package/node_modules/unist-util-stringify-position/lib/index.js +84 -0
- package/node_modules/unist-util-stringify-position/license +22 -0
- package/node_modules/unist-util-stringify-position/package.json +80 -0
- package/node_modules/unist-util-stringify-position/readme.md +206 -0
- package/node_modules/unist-util-visit/index.d.ts +9 -0
- package/node_modules/unist-util-visit/index.js +2 -0
- package/node_modules/unist-util-visit/lib/index.d.ts +195 -0
- package/node_modules/unist-util-visit/lib/index.d.ts.map +1 -0
- package/node_modules/unist-util-visit/lib/index.js +312 -0
- package/node_modules/unist-util-visit/license +22 -0
- package/node_modules/unist-util-visit/package.json +108 -0
- package/node_modules/unist-util-visit/readme.md +313 -0
- package/node_modules/unist-util-visit-parents/index.d.ts +14 -0
- package/node_modules/unist-util-visit-parents/index.js +2 -0
- package/node_modules/unist-util-visit-parents/lib/color.d.ts +6 -0
- package/node_modules/unist-util-visit-parents/lib/color.d.ts.map +1 -0
- package/node_modules/unist-util-visit-parents/lib/color.js +7 -0
- package/node_modules/unist-util-visit-parents/lib/color.node.d.ts +6 -0
- package/node_modules/unist-util-visit-parents/lib/color.node.d.ts.map +1 -0
- package/node_modules/unist-util-visit-parents/lib/color.node.js +7 -0
- package/node_modules/unist-util-visit-parents/lib/index.d.ts +219 -0
- package/node_modules/unist-util-visit-parents/lib/index.d.ts.map +1 -0
- package/node_modules/unist-util-visit-parents/lib/index.js +399 -0
- package/node_modules/unist-util-visit-parents/license +22 -0
- package/node_modules/unist-util-visit-parents/package.json +106 -0
- package/node_modules/unist-util-visit-parents/readme.md +388 -0
- package/node_modules/zwitch/index.d.ts +67 -0
- package/node_modules/zwitch/index.js +118 -0
- package/node_modules/zwitch/license +22 -0
- package/node_modules/zwitch/package.json +72 -0
- package/node_modules/zwitch/readme.md +226 -0
- package/npm-shrinkwrap.json +737 -3
- package/openclaw.plugin.json +164 -89
- package/package.json +10 -7
- package/skills/feishu-drive/SKILL.md +5 -2
- package/dist/legacy-state-migrations-api.js +0 -73
- package/dist/monitor.state-DAHbcR2N.js +0 -173
- package/dist/send-result-BMQw-YhV.js +0 -287
|
@@ -1,74 +1,61 @@
|
|
|
1
|
-
import { a as resolveDefaultFeishuAccountId, d as isRecord$1, i as listFeishuAccountIds, n as inspectFeishuCredentials, o as resolveFeishuAccount, r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount } from "./accounts-
|
|
2
|
-
import { i as resolveReceiveIdType, n as looksLikeFeishuId, r as normalizeFeishuTarget
|
|
3
|
-
import { a as readNativeFeishuCardJson, n as createFeishuSendReceipt, u as
|
|
4
|
-
import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, o as resolveConfiguredFeishuGroupSessionScope, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-
|
|
1
|
+
import { a as resolveDefaultFeishuAccountId, d as isRecord$1, i as listFeishuAccountIds, n as inspectFeishuCredentials, o as resolveFeishuAccount, r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount } from "./accounts-BDoGHJDk.js";
|
|
2
|
+
import { i as resolveReceiveIdType, n as looksLikeFeishuId, r as normalizeFeishuTarget } from "./targets-BUjQ1TcA.js";
|
|
3
|
+
import { A as resolveFeishuChatType, D as resolveFeishuGroupToolPolicy, N as createFeishuCardInteractionEnvelope, _ as canEnumerateAllFeishuPeers, a as readNativeFeishuCardJson, b as resolveFeishuChatReadPreliminaryAuthorization, g as canEnumerateAllFeishuGroups, h as authorizeFeishuChatMemberRead, k as normalizeFeishuChatType, m as assertFeishuChatReadAllowed, n as createFeishuSendReceipt, u as chunkFeishuMarkdown, v as isFeishuGroupReadAllowed, w as resolveFeishuGroupConfig, y as isFeishuGroupReadEnabled } from "./send-result-DsqTk27v.js";
|
|
4
|
+
import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, o as resolveConfiguredFeishuGroupSessionScope, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-BeJL-wq7.js";
|
|
5
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-DXH5hux1.js";
|
|
5
6
|
import { t as messageActionTargetAliases } from "./security-audit-BIeA3W3Q.js";
|
|
6
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-
|
|
7
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DnlMcrn5.js";
|
|
7
8
|
import { t as collectFeishuSecurityAuditFindings } from "./security-audit-shared-BIHeF-S_.js";
|
|
8
|
-
import { t as resolveFeishuSessionConversation } from "./session-conversation-
|
|
9
|
+
import { t as resolveFeishuSessionConversation } from "./session-conversation-BksWrfzm.js";
|
|
9
10
|
import { createLazyRuntimeModule, createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
10
11
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
11
12
|
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
|
13
|
+
import { ToolAuthorizationError, createActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
12
14
|
import { adaptScopedAccountAccessor, createHybridChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
13
15
|
import { buildChannelOutboundSessionRoute, createChatChannelPlugin, stripChannelTargetPrefix } from "openclaw/plugin-sdk/channel-core";
|
|
14
16
|
import { createAccountStatusSink, createRuntimeOutboundDelegates, defineChannelMessageAdapter } from "openclaw/plugin-sdk/channel-outbound";
|
|
15
17
|
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
16
18
|
import { createAllowlistProviderGroupPolicyWarningCollector, projectConfigAccountIdWarningCollector } from "openclaw/plugin-sdk/channel-policy";
|
|
17
19
|
import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-runtime";
|
|
18
|
-
import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter, listDirectoryGroupEntriesFromMapKeysAndAllowFrom, listDirectoryUserEntriesFromAllowFromAndMapKeys } from "openclaw/plugin-sdk/directory-runtime";
|
|
19
|
-
import { interactiveReplyToPresentation, normalizeInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
|
|
20
|
+
import { applyDirectoryQueryAndLimit, createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter, listDirectoryGroupEntriesFromMapKeysAndAllowFrom, listDirectoryUserEntriesFromAllowFrom, listDirectoryUserEntriesFromAllowFromAndMapKeys } from "openclaw/plugin-sdk/directory-runtime";
|
|
21
|
+
import { interactiveReplyToPresentation, normalizeInteractiveReply, normalizeMessagePresentation, renderMessagePresentationChartFallbackText, renderMessagePresentationFallbackText, renderMessagePresentationTableFallbackText, resolveInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
|
|
20
22
|
import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
21
23
|
import { buildProbeChannelStatusSummary, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
22
24
|
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
23
|
-
import {
|
|
24
|
-
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2
|
|
25
|
-
import {
|
|
26
|
-
import { createActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
27
|
-
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-primitives";
|
|
25
|
+
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
26
|
+
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2 } from "openclaw/plugin-sdk/account-resolution";
|
|
27
|
+
import { createChannelApprovalAuth } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
28
28
|
import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
|
|
29
29
|
import { normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/account-id";
|
|
30
|
+
import { DmPolicySchema, GroupPolicySchema, buildChannelConfigSchema, buildGroupEntrySchema, buildMultiAccountChannelSchema } from "openclaw/plugin-sdk/channel-config-schema";
|
|
30
31
|
import { z } from "zod";
|
|
31
32
|
import { buildSecretInputSchema, hasConfiguredSecretInput as hasConfiguredSecretInput$2 } from "openclaw/plugin-sdk/secret-input";
|
|
32
33
|
import fs from "node:fs";
|
|
33
34
|
import os from "node:os";
|
|
34
35
|
import path from "node:path";
|
|
35
36
|
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
36
|
-
import {
|
|
37
|
+
import { deleteSessionEntry, isValidAgentHarnessSessionStoreEntry, listSessionEntries, loadTranscriptEventsSync, parseSqliteSessionFileMarker, resolveSessionStoreBackupPaths, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
37
38
|
import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
|
|
38
|
-
import {
|
|
39
|
-
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, createSetupTranslator, formatDocsLink, hasConfiguredSecretInput as hasConfiguredSecretInput$1, mergeAllowFromEntries, patchTopLevelChannelConfigSection, promptSingleChannelSecretInput, splitSetupEntries } from "openclaw/plugin-sdk/setup";
|
|
39
|
+
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, createSetupTranslator, formatDocsLink, hasConfiguredSecretInput as hasConfiguredSecretInput$1, mergeAllowFromEntries, patchTopLevelChannelConfigSection, promptSingleChannelSecretInput, setSetupChannelEnabled, splitSetupEntries } from "openclaw/plugin-sdk/setup";
|
|
40
40
|
//#region extensions/feishu/src/approval-auth.ts
|
|
41
41
|
function normalizeFeishuApproverId(value) {
|
|
42
42
|
const trimmed = normalizeOptionalLowercaseString(normalizeFeishuTarget(String(value)));
|
|
43
43
|
return trimmed?.startsWith("ou_") ? trimmed : void 0;
|
|
44
44
|
}
|
|
45
|
-
const feishuApprovalAuth =
|
|
45
|
+
const feishuApprovalAuth = createChannelApprovalAuth({
|
|
46
46
|
channelLabel: "Feishu",
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
resolveInputs: ({ cfg, accountId }) => {
|
|
48
|
+
return { allowFrom: resolveFeishuAccount({
|
|
49
49
|
cfg,
|
|
50
50
|
accountId
|
|
51
|
-
}).config;
|
|
52
|
-
return resolveApprovalApprovers({
|
|
53
|
-
allowFrom: account.allowFrom,
|
|
54
|
-
normalizeApprover: normalizeFeishuApproverId
|
|
55
|
-
});
|
|
51
|
+
}).config.allowFrom };
|
|
56
52
|
},
|
|
57
|
-
|
|
58
|
-
});
|
|
53
|
+
normalizeApprover: normalizeFeishuApproverId
|
|
54
|
+
}).approvalAuth;
|
|
59
55
|
//#endregion
|
|
60
56
|
//#region extensions/feishu/src/config-schema.ts
|
|
61
57
|
const ChannelActionsSchema = z.object({ reactions: z.boolean().optional() }).strict().optional();
|
|
62
|
-
const
|
|
63
|
-
"open",
|
|
64
|
-
"pairing",
|
|
65
|
-
"allowlist"
|
|
66
|
-
]);
|
|
67
|
-
const GroupPolicySchema = z.union([z.enum([
|
|
68
|
-
"open",
|
|
69
|
-
"allowlist",
|
|
70
|
-
"disabled"
|
|
71
|
-
]), z.literal("allowall").transform(() => "open")]);
|
|
58
|
+
const FeishuGroupPolicySchema = z.union([GroupPolicySchema, z.literal("allowall").transform(() => "open")]);
|
|
72
59
|
const FeishuDomainSchema = z.union([z.enum(["feishu", "lark"]), z.string().url().startsWith("https://")]);
|
|
73
60
|
const FeishuConnectionModeSchema = z.enum(["websocket", "webhook"]);
|
|
74
61
|
const TtsOverrideSchema = z.object({
|
|
@@ -115,12 +102,18 @@ const RenderModeSchema = z.enum([
|
|
|
115
102
|
"raw",
|
|
116
103
|
"card"
|
|
117
104
|
]).optional();
|
|
118
|
-
const StreamingModeSchema = z.boolean().optional();
|
|
119
|
-
const BlockStreamingSchema = z.boolean().optional();
|
|
120
105
|
const BlockStreamingCoalesceSchema = z.object({
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
106
|
+
minChars: z.number().int().positive().optional(),
|
|
107
|
+
maxChars: z.number().int().positive().optional(),
|
|
108
|
+
idleMs: z.number().int().nonnegative().optional()
|
|
109
|
+
}).strict().optional();
|
|
110
|
+
const FeishuStreamingSchema = z.object({
|
|
111
|
+
mode: z.enum(["off", "partial"]).optional(),
|
|
112
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
113
|
+
block: z.object({
|
|
114
|
+
enabled: z.boolean().optional(),
|
|
115
|
+
coalesce: BlockStreamingCoalesceSchema
|
|
116
|
+
}).strict().optional()
|
|
124
117
|
}).strict().optional();
|
|
125
118
|
const ChannelHeartbeatVisibilitySchema = z.object({
|
|
126
119
|
visibility: z.enum(["visible", "hidden"]).optional(),
|
|
@@ -194,17 +187,12 @@ const ReactionNotificationModeSchema = z.enum([
|
|
|
194
187
|
* causing the reply to appear as a topic (话题) under the original message.
|
|
195
188
|
*/
|
|
196
189
|
const ReplyInThreadSchema = z.enum(["disabled", "enabled"]).optional();
|
|
197
|
-
const FeishuGroupSchema =
|
|
198
|
-
requireMention: z.boolean().optional(),
|
|
190
|
+
const FeishuGroupSchema = buildGroupEntrySchema({
|
|
199
191
|
tools: ToolPolicySchema,
|
|
200
|
-
skills: z.array(z.string()).optional(),
|
|
201
|
-
enabled: z.boolean().optional(),
|
|
202
|
-
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
203
|
-
systemPrompt: z.string().optional(),
|
|
204
192
|
groupSessionScope: GroupSessionScopeSchema,
|
|
205
193
|
topicSessionMode: TopicSessionModeSchema,
|
|
206
194
|
replyInThread: ReplyInThreadSchema
|
|
207
|
-
}).
|
|
195
|
+
}).omit({ toolsBySender: true });
|
|
208
196
|
const FeishuSharedConfigShape = {
|
|
209
197
|
webhookHost: z.string().optional(),
|
|
210
198
|
webhookPort: z.number().int().positive().optional(),
|
|
@@ -213,7 +201,7 @@ const FeishuSharedConfigShape = {
|
|
|
213
201
|
configWrites: z.boolean().optional(),
|
|
214
202
|
dmPolicy: DmPolicySchema.optional(),
|
|
215
203
|
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
216
|
-
groupPolicy:
|
|
204
|
+
groupPolicy: FeishuGroupPolicySchema.optional(),
|
|
217
205
|
groupAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
218
206
|
groupSenderAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
219
207
|
requireMention: z.boolean().optional(),
|
|
@@ -222,14 +210,11 @@ const FeishuSharedConfigShape = {
|
|
|
222
210
|
dmHistoryLimit: z.number().int().min(0).optional(),
|
|
223
211
|
dms: z.record(z.string(), DmConfigSchema).optional(),
|
|
224
212
|
textChunkLimit: z.number().int().positive().optional(),
|
|
225
|
-
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
226
|
-
blockStreaming: BlockStreamingSchema,
|
|
227
|
-
blockStreamingCoalesce: BlockStreamingCoalesceSchema,
|
|
228
213
|
mediaMaxMb: z.number().positive().optional(),
|
|
229
214
|
httpTimeoutMs: z.number().int().positive().max(3e5).optional(),
|
|
230
215
|
heartbeat: ChannelHeartbeatVisibilitySchema,
|
|
231
216
|
renderMode: RenderModeSchema,
|
|
232
|
-
streaming:
|
|
217
|
+
streaming: FeishuStreamingSchema,
|
|
233
218
|
tools: FeishuToolsConfigSchema,
|
|
234
219
|
actions: ChannelActionsSchema,
|
|
235
220
|
replyInThread: ReplyInThreadSchema,
|
|
@@ -256,7 +241,7 @@ const FeishuAccountConfigSchema = z.object({
|
|
|
256
241
|
groupSessionScope: GroupSessionScopeSchema,
|
|
257
242
|
topicSessionMode: TopicSessionModeSchema
|
|
258
243
|
}).strict();
|
|
259
|
-
const
|
|
244
|
+
const FeishuChannelConfigSchema = buildChannelConfigSchema(buildMultiAccountChannelSchema(z.object({
|
|
260
245
|
enabled: z.boolean().optional(),
|
|
261
246
|
defaultAccount: z.string().optional(),
|
|
262
247
|
appId: z.string().optional(),
|
|
@@ -269,15 +254,17 @@ const FeishuConfigSchema = z.object({
|
|
|
269
254
|
...FeishuSharedConfigShape,
|
|
270
255
|
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
|
271
256
|
reactionNotifications: ReactionNotificationModeSchema.optional().default("own"),
|
|
272
|
-
groupPolicy:
|
|
257
|
+
groupPolicy: FeishuGroupPolicySchema.optional().default("allowlist"),
|
|
273
258
|
requireMention: z.boolean().optional(),
|
|
274
259
|
groupSessionScope: GroupSessionScopeSchema,
|
|
275
260
|
topicSessionMode: TopicSessionModeSchema,
|
|
276
261
|
dynamicAgentCreation: DynamicAgentCreationSchema,
|
|
277
262
|
typingIndicator: z.boolean().optional().default(true),
|
|
278
|
-
resolveSenderNames: z.boolean().optional().default(true)
|
|
279
|
-
|
|
280
|
-
|
|
263
|
+
resolveSenderNames: z.boolean().optional().default(true)
|
|
264
|
+
}).strict(), {
|
|
265
|
+
accountSchema: FeishuAccountConfigSchema,
|
|
266
|
+
optionalAccount: true
|
|
267
|
+
}).superRefine((value, ctx) => {
|
|
281
268
|
const defaultAccount = value.defaultAccount?.trim();
|
|
282
269
|
if (defaultAccount && value.accounts && Object.keys(value.accounts).length > 0) {
|
|
283
270
|
const normalizedDefaultAccount = normalizeAccountId$1(defaultAccount);
|
|
@@ -333,7 +320,7 @@ const FeishuConfigSchema = z.object({
|
|
|
333
320
|
message: "channels.feishu.dmPolicy=\"open\" requires channels.feishu.allowFrom to include \"*\""
|
|
334
321
|
});
|
|
335
322
|
}
|
|
336
|
-
});
|
|
323
|
+
}), { jsonSchemaMode: "input" });
|
|
337
324
|
//#endregion
|
|
338
325
|
//#region extensions/feishu/src/directory.static.ts
|
|
339
326
|
function toFeishuDirectoryPeers(ids) {
|
|
@@ -374,6 +361,27 @@ async function listFeishuDirectoryGroups(params) {
|
|
|
374
361
|
limit: params.limit
|
|
375
362
|
}).map((entry) => entry.id));
|
|
376
363
|
}
|
|
364
|
+
async function listAuthorizedFeishuDirectoryPeers(params) {
|
|
365
|
+
return toFeishuDirectoryPeers(listDirectoryUserEntriesFromAllowFrom({
|
|
366
|
+
allowFrom: resolveFeishuAccount({
|
|
367
|
+
cfg: params.cfg,
|
|
368
|
+
accountId: params.accountId
|
|
369
|
+
}).config.allowFrom,
|
|
370
|
+
query: params.query,
|
|
371
|
+
limit: params.limit,
|
|
372
|
+
normalizeId: (entry) => normalizeFeishuTarget(entry) ?? entry
|
|
373
|
+
}).map((entry) => entry.id));
|
|
374
|
+
}
|
|
375
|
+
async function listAuthorizedFeishuDirectoryGroups(params) {
|
|
376
|
+
const account = resolveFeishuAccount({
|
|
377
|
+
cfg: params.cfg,
|
|
378
|
+
accountId: params.accountId
|
|
379
|
+
});
|
|
380
|
+
return toFeishuDirectoryGroups(applyDirectoryQueryAndLimit(listDirectoryGroupEntriesFromMapKeysAndAllowFrom({
|
|
381
|
+
groups: Object.fromEntries(Object.entries(account.config.groups ?? {}).filter(([, group]) => group?.enabled !== false)),
|
|
382
|
+
allowFrom: account.config.groupAllowFrom
|
|
383
|
+
}).filter((entry) => isFeishuGroupReadAllowed(params.cfg, account, entry.id, false)).map((entry) => entry.id), params));
|
|
384
|
+
}
|
|
377
385
|
//#endregion
|
|
378
386
|
//#region extensions/feishu/src/doctor.ts
|
|
379
387
|
const FEISHU_STATE_DIR = "feishu";
|
|
@@ -407,6 +415,12 @@ function existsFile(filePath) {
|
|
|
407
415
|
return false;
|
|
408
416
|
}
|
|
409
417
|
}
|
|
418
|
+
function resolveFeishuAgentSessionsDir(agentId) {
|
|
419
|
+
return path.join(resolveStateDir(), "agents", normalizeAgentId(agentId), "sessions");
|
|
420
|
+
}
|
|
421
|
+
function isSqliteTranscriptMarker(value) {
|
|
422
|
+
return parseSqliteSessionFileMarker(value) !== void 0;
|
|
423
|
+
}
|
|
410
424
|
function safeReadDir(dir) {
|
|
411
425
|
try {
|
|
412
426
|
return fs.readdirSync(dir, { withFileTypes: true });
|
|
@@ -472,9 +486,11 @@ function resolveConfiguredDefaultAgentId(cfg) {
|
|
|
472
486
|
function collectFeishuSessionTargets(params) {
|
|
473
487
|
const byStorePath = /* @__PURE__ */ new Map();
|
|
474
488
|
const addTarget = (target) => {
|
|
475
|
-
|
|
489
|
+
const resolvedStorePath = path.resolve(target.storePath);
|
|
490
|
+
byStorePath.set(`${normalizeAgentId(target.agentId)}\0${resolvedStorePath}`, {
|
|
476
491
|
...target,
|
|
477
|
-
|
|
492
|
+
agentId: normalizeAgentId(target.agentId),
|
|
493
|
+
storePath: resolvedStorePath
|
|
478
494
|
});
|
|
479
495
|
};
|
|
480
496
|
for (const agentId of collectConfiguredAgentIds(params.cfg)) addTarget({
|
|
@@ -528,16 +544,23 @@ function collectCorruptFeishuStateJsonFindings(feishuStateDir) {
|
|
|
528
544
|
function resolveSessionTranscriptCandidates(params) {
|
|
529
545
|
const candidates = /* @__PURE__ */ new Set();
|
|
530
546
|
const sessionsDir = path.dirname(params.storePath);
|
|
547
|
+
const agentSessionsDir = resolveFeishuAgentSessionsDir(params.agentId);
|
|
531
548
|
const addSafeCandidate = (candidate) => {
|
|
532
549
|
const resolved = path.isAbsolute(candidate) ? path.resolve(candidate) : path.resolve(sessionsDir, candidate);
|
|
533
|
-
|
|
550
|
+
const isStoreCandidate = isPathWithinRoot(resolved, sessionsDir);
|
|
551
|
+
const isAgentSessionCandidate = isPathWithinRoot(resolved, agentSessionsDir);
|
|
552
|
+
if (resolved === sessionsDir || resolved === agentSessionsDir || !isStoreCandidate && !isAgentSessionCandidate) return false;
|
|
534
553
|
candidates.add(resolved);
|
|
554
|
+
return true;
|
|
535
555
|
};
|
|
536
556
|
if (typeof params.entry.sessionId === "string" && /^[a-z0-9][a-z0-9._-]{0,127}$/i.test(params.entry.sessionId)) {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
557
|
+
let addedExplicitCandidate = false;
|
|
558
|
+
if (typeof params.entry.sessionFile === "string" && params.entry.sessionFile.trim()) {
|
|
559
|
+
const explicitSessionFile = params.entry.sessionFile.trim();
|
|
560
|
+
if (isSqliteTranscriptMarker(explicitSessionFile)) return [];
|
|
561
|
+
addedExplicitCandidate = addSafeCandidate(explicitSessionFile);
|
|
562
|
+
}
|
|
563
|
+
if (!addedExplicitCandidate) candidates.add(path.join(sessionsDir, `${params.entry.sessionId}.jsonl`));
|
|
541
564
|
return [...candidates].toSorted();
|
|
542
565
|
}
|
|
543
566
|
if (typeof params.entry.sessionFile === "string" && params.entry.sessionFile.trim()) addSafeCandidate(params.entry.sessionFile.trim());
|
|
@@ -556,6 +579,47 @@ function isBlankUserMessage(value) {
|
|
|
556
579
|
function isUserMessage(value) {
|
|
557
580
|
return isRecord(value) && value.type === "message" && isRecord(value.message) && value.message.role === "user";
|
|
558
581
|
}
|
|
582
|
+
function inspectTranscriptEntries(params) {
|
|
583
|
+
let blankUserMessageRun = 0;
|
|
584
|
+
let maxBlankUserMessageRun = 0;
|
|
585
|
+
for (const entry of params.entries) if (isBlankUserMessage(entry)) {
|
|
586
|
+
blankUserMessageRun += 1;
|
|
587
|
+
maxBlankUserMessageRun = Math.max(maxBlankUserMessageRun, blankUserMessageRun);
|
|
588
|
+
} else if (isUserMessage(entry)) blankUserMessageRun = 0;
|
|
589
|
+
if (params.entries.length === 0) {
|
|
590
|
+
if (params.allowMissingSessionHeader) return null;
|
|
591
|
+
return {
|
|
592
|
+
kind: "invalid-session-transcript",
|
|
593
|
+
sessionKey: params.sessionKey,
|
|
594
|
+
storePath: params.storePath,
|
|
595
|
+
path: params.transcriptPath,
|
|
596
|
+
reason: "empty transcript"
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
const firstEntry = params.entries[0];
|
|
600
|
+
if (!isSessionHeader(firstEntry) && (!params.allowMissingSessionHeader || !isUserMessage(firstEntry) && !isBlankUserMessage(firstEntry))) return {
|
|
601
|
+
kind: "invalid-session-transcript",
|
|
602
|
+
sessionKey: params.sessionKey,
|
|
603
|
+
storePath: params.storePath,
|
|
604
|
+
path: params.transcriptPath,
|
|
605
|
+
reason: "invalid session header"
|
|
606
|
+
};
|
|
607
|
+
if ((params.malformedLines ?? 0) > 0) return {
|
|
608
|
+
kind: "invalid-session-transcript",
|
|
609
|
+
sessionKey: params.sessionKey,
|
|
610
|
+
storePath: params.storePath,
|
|
611
|
+
path: params.transcriptPath,
|
|
612
|
+
reason: `${params.malformedLines} malformed JSONL line(s)`
|
|
613
|
+
};
|
|
614
|
+
if (maxBlankUserMessageRun >= BLANK_USER_MESSAGE_REPAIR_THRESHOLD) return {
|
|
615
|
+
kind: "blank-user-message-run",
|
|
616
|
+
sessionKey: params.sessionKey,
|
|
617
|
+
storePath: params.storePath,
|
|
618
|
+
path: params.transcriptPath,
|
|
619
|
+
count: maxBlankUserMessageRun
|
|
620
|
+
};
|
|
621
|
+
return null;
|
|
622
|
+
}
|
|
559
623
|
function inspectSessionTranscript(params) {
|
|
560
624
|
let stat;
|
|
561
625
|
try {
|
|
@@ -585,52 +649,54 @@ function inspectSessionTranscript(params) {
|
|
|
585
649
|
}
|
|
586
650
|
const entries = [];
|
|
587
651
|
let malformedLines = 0;
|
|
588
|
-
let blankUserMessageRun = 0;
|
|
589
|
-
let maxBlankUserMessageRun = 0;
|
|
590
652
|
for (const line of raw.split(/\r?\n/)) {
|
|
591
653
|
if (!line.trim()) continue;
|
|
592
654
|
try {
|
|
593
655
|
const entry = JSON.parse(line);
|
|
594
656
|
entries.push(entry);
|
|
595
|
-
if (isBlankUserMessage(entry)) {
|
|
596
|
-
blankUserMessageRun += 1;
|
|
597
|
-
maxBlankUserMessageRun = Math.max(maxBlankUserMessageRun, blankUserMessageRun);
|
|
598
|
-
} else if (isUserMessage(entry)) blankUserMessageRun = 0;
|
|
599
657
|
} catch {
|
|
600
658
|
malformedLines += 1;
|
|
601
659
|
}
|
|
602
660
|
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
if (
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
661
|
+
return inspectTranscriptEntries({
|
|
662
|
+
...params,
|
|
663
|
+
entries,
|
|
664
|
+
malformedLines
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
function inspectSqliteSessionTranscript(params) {
|
|
668
|
+
if (typeof params.entry.sessionFile !== "string") return null;
|
|
669
|
+
const marker = parseSqliteSessionFileMarker(params.entry.sessionFile);
|
|
670
|
+
if (!marker) return null;
|
|
671
|
+
const sessionId = typeof params.entry.sessionId === "string" && params.entry.sessionId.trim() ? params.entry.sessionId.trim() : marker.sessionId;
|
|
672
|
+
let entries;
|
|
673
|
+
try {
|
|
674
|
+
entries = loadTranscriptEventsSync({
|
|
675
|
+
agentId: marker.agentId,
|
|
676
|
+
sessionId,
|
|
677
|
+
sessionKey: params.sessionKey,
|
|
678
|
+
storePath: marker.storePath
|
|
679
|
+
});
|
|
680
|
+
} catch {
|
|
681
|
+
return {
|
|
682
|
+
kind: "invalid-session-transcript",
|
|
683
|
+
sessionKey: params.sessionKey,
|
|
684
|
+
storePath: params.storePath,
|
|
685
|
+
path: params.entry.sessionFile,
|
|
686
|
+
reason: "unreadable"
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
return inspectTranscriptEntries({
|
|
626
690
|
sessionKey: params.sessionKey,
|
|
627
691
|
storePath: params.storePath,
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
692
|
+
transcriptPath: params.entry.sessionFile,
|
|
693
|
+
allowMissingSessionHeader: true,
|
|
694
|
+
entries
|
|
695
|
+
});
|
|
632
696
|
}
|
|
633
697
|
function collectFeishuSessionFindings(params) {
|
|
698
|
+
const sqliteFinding = inspectSqliteSessionTranscript(params);
|
|
699
|
+
if (sqliteFinding) return [sqliteFinding];
|
|
634
700
|
const transcriptCandidates = resolveSessionTranscriptCandidates(params);
|
|
635
701
|
const existing = transcriptCandidates.filter(existsFile);
|
|
636
702
|
if (transcriptCandidates.length > 0 && existing.length === 0) return [{
|
|
@@ -682,24 +748,23 @@ function inspectFeishuDoctorState(params) {
|
|
|
682
748
|
cfg: params.cfg,
|
|
683
749
|
env,
|
|
684
750
|
stateDir
|
|
685
|
-
})) {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
}
|
|
751
|
+
})) for (const { sessionKey: key, entry } of listSessionEntries({
|
|
752
|
+
agentId: target.agentId,
|
|
753
|
+
storePath: target.storePath
|
|
754
|
+
}).filter(({ sessionKey, entry: sessionEntry }) => !isValidAgentHarnessSessionStoreEntry(sessionKey, sessionEntry) && isFeishuSessionEntry(sessionKey, sessionEntry)).toSorted((left, right) => left.sessionKey.localeCompare(right.sessionKey))) {
|
|
755
|
+
const sessionEntry = toFeishuSessionEntry(entry);
|
|
756
|
+
sessionEntries.push({
|
|
757
|
+
key,
|
|
758
|
+
storePath: target.storePath,
|
|
759
|
+
agentId: target.agentId,
|
|
760
|
+
entry: sessionEntry
|
|
761
|
+
});
|
|
762
|
+
findings.push(...collectFeishuSessionFindings({
|
|
763
|
+
sessionKey: key,
|
|
764
|
+
storePath: target.storePath,
|
|
765
|
+
agentId: target.agentId,
|
|
766
|
+
entry: sessionEntry
|
|
767
|
+
}));
|
|
703
768
|
}
|
|
704
769
|
return {
|
|
705
770
|
stateDir,
|
|
@@ -735,13 +800,19 @@ function movePathToBackup(params) {
|
|
|
735
800
|
return true;
|
|
736
801
|
}
|
|
737
802
|
function copyStoreBackup(params) {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
803
|
+
const targetDir = path.join(params.backupDir, "session-stores", params.agentId);
|
|
804
|
+
for (const sourcePath of resolveSessionStoreBackupPaths({
|
|
805
|
+
agentId: params.agentId,
|
|
806
|
+
storePath: params.storePath
|
|
807
|
+
})) {
|
|
808
|
+
if (!existsFile(sourcePath)) continue;
|
|
809
|
+
const targetPath = path.join(targetDir, path.basename(sourcePath));
|
|
810
|
+
fs.mkdirSync(path.dirname(targetPath), {
|
|
811
|
+
recursive: true,
|
|
812
|
+
mode: 448
|
|
813
|
+
});
|
|
814
|
+
fs.copyFileSync(sourcePath, resolveUniquePath(targetPath));
|
|
815
|
+
}
|
|
745
816
|
}
|
|
746
817
|
function collectSessionArtifactPaths(params) {
|
|
747
818
|
const artifacts = /* @__PURE__ */ new Set();
|
|
@@ -821,15 +892,22 @@ async function repairFeishuDoctorState(params) {
|
|
|
821
892
|
agentId: group.agentId
|
|
822
893
|
});
|
|
823
894
|
const keys = new Set(group.entries.map((entry) => entry.key));
|
|
824
|
-
const removedEntries =
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
895
|
+
const removedEntries = [];
|
|
896
|
+
for (const key of keys) {
|
|
897
|
+
const currentEntry = listSessionEntries({
|
|
898
|
+
agentId: group.agentId,
|
|
899
|
+
storePath
|
|
900
|
+
}).find((candidate) => candidate.sessionKey === key)?.entry;
|
|
901
|
+
if (!currentEntry || isValidAgentHarnessSessionStoreEntry(key, currentEntry)) continue;
|
|
902
|
+
if (!await deleteSessionEntry({
|
|
903
|
+
agentId: group.agentId,
|
|
904
|
+
archiveTranscript: true,
|
|
905
|
+
sessionKey: key,
|
|
906
|
+
storePath
|
|
907
|
+
})) continue;
|
|
908
|
+
const entry = group.entries.find((candidate) => candidate.key === key);
|
|
909
|
+
if (entry) removedEntries.push(entry);
|
|
910
|
+
}
|
|
833
911
|
const removed = removedEntries.length;
|
|
834
912
|
removedSessionEntries += removed;
|
|
835
913
|
if (removed > 0) {
|
|
@@ -913,189 +991,43 @@ async function runFeishuDoctorSequence(params) {
|
|
|
913
991
|
warningNotes: report.warnings
|
|
914
992
|
};
|
|
915
993
|
}
|
|
916
|
-
const feishuDoctor = {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
shouldRepair
|
|
920
|
-
|
|
994
|
+
const feishuDoctor = {
|
|
995
|
+
legacyConfigRules,
|
|
996
|
+
normalizeCompatibilityConfig,
|
|
997
|
+
runConfigSequence: async ({ cfg, env, shouldRepair }) => await runFeishuDoctorSequence({
|
|
998
|
+
cfg,
|
|
999
|
+
env,
|
|
1000
|
+
shouldRepair
|
|
1001
|
+
})
|
|
1002
|
+
};
|
|
921
1003
|
//#endregion
|
|
922
|
-
//#region extensions/feishu/src/
|
|
923
|
-
const
|
|
924
|
-
const
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
normalizeSubject: normalizeFeishuAllowEntry,
|
|
936
|
-
sensitivity: "pii"
|
|
937
|
-
}],
|
|
938
|
-
isWildcardEntry: (entry) => normalizeFeishuAllowEntry(entry) === "*",
|
|
939
|
-
resolveEntryId: ({ entryIndex }) => `feishu-entry-${entryIndex + 1}`
|
|
940
|
-
});
|
|
941
|
-
function normalizeFeishuAllowEntry(raw) {
|
|
942
|
-
const trimmed = raw.trim();
|
|
943
|
-
if (!trimmed) return "";
|
|
944
|
-
if (trimmed === "*") return "*";
|
|
945
|
-
let withoutProviderPrefix = trimmed;
|
|
946
|
-
while (FEISHU_PROVIDER_PREFIX_RE.test(withoutProviderPrefix)) withoutProviderPrefix = withoutProviderPrefix.replace(FEISHU_PROVIDER_PREFIX_RE, "").trim();
|
|
947
|
-
if (withoutProviderPrefix === "*") return "*";
|
|
948
|
-
const lowered = normalizeOptionalLowercaseString(withoutProviderPrefix) ?? "";
|
|
949
|
-
if (!lowered) return "";
|
|
950
|
-
const prefixed = lowered.match(FEISHU_TYPED_PREFIX_RE);
|
|
951
|
-
if (prefixed?.[1]) {
|
|
952
|
-
const kind = [
|
|
953
|
-
"chat",
|
|
954
|
-
"group",
|
|
955
|
-
"channel"
|
|
956
|
-
].includes(prefixed[1]) ? "chat" : "user";
|
|
957
|
-
const value = withoutProviderPrefix.slice(prefixed[0].length).trim();
|
|
958
|
-
return value === "*" ? "*" : value ? `${kind}:${value}` : "";
|
|
1004
|
+
//#region extensions/feishu/src/presentation-card.ts
|
|
1005
|
+
const FEISHU_CARD_MAX_BYTES = 30 * 1024;
|
|
1006
|
+
const FEISHU_CARD_MAX_ELEMENTS = 200;
|
|
1007
|
+
function countFeishuCardElements(value, ancestors = /* @__PURE__ */ new Set()) {
|
|
1008
|
+
if (Array.isArray(value)) return value.reduce((count, entry) => count + countFeishuCardElements(entry, ancestors), 0);
|
|
1009
|
+
if (!value || typeof value !== "object") return 0;
|
|
1010
|
+
if (ancestors.has(value)) return 201;
|
|
1011
|
+
ancestors.add(value);
|
|
1012
|
+
const record = value;
|
|
1013
|
+
let count = typeof record.tag === "string" ? 1 : 0;
|
|
1014
|
+
for (const entry of Object.values(record)) {
|
|
1015
|
+
count += countFeishuCardElements(entry, ancestors);
|
|
1016
|
+
if (count > FEISHU_CARD_MAX_ELEMENTS) break;
|
|
959
1017
|
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
if (detectedType === "open_id" || detectedType === "user_id") return `user:${withoutProviderPrefix}`;
|
|
963
|
-
return "";
|
|
964
|
-
}
|
|
965
|
-
function normalizeFeishuDmPolicy(policy) {
|
|
966
|
-
return policy === "open" || policy === "pairing" || policy === "allowlist" || policy === "disabled" ? policy : "pairing";
|
|
967
|
-
}
|
|
968
|
-
function normalizeFeishuGroupPolicy(policy) {
|
|
969
|
-
return policy === "allowall" ? "open" : policy;
|
|
970
|
-
}
|
|
971
|
-
function createFeishuIngressSubject(params) {
|
|
972
|
-
const ids = [params.primaryId, ...params.alternateIds ?? []].map((value) => value?.trim()).filter((value) => Boolean(value));
|
|
973
|
-
return {
|
|
974
|
-
stableId: ids[0],
|
|
975
|
-
aliases: { "feishu-alt-id": ids[1] }
|
|
976
|
-
};
|
|
977
|
-
}
|
|
978
|
-
function createFeishuIngressResolver(params) {
|
|
979
|
-
return createChannelIngressResolver({
|
|
980
|
-
channelId: "feishu",
|
|
981
|
-
accountId: normalizeAccountId(params.accountId) ?? "default",
|
|
982
|
-
identity: feishuIngressIdentity,
|
|
983
|
-
cfg: params.cfg,
|
|
984
|
-
...params.readAllowFromStore ? { readStoreAllowFrom: params.readAllowFromStore } : {}
|
|
985
|
-
});
|
|
1018
|
+
ancestors.delete(value);
|
|
1019
|
+
return count;
|
|
986
1020
|
}
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
}
|
|
993
|
-
subject: createFeishuIngressSubject({
|
|
994
|
-
primaryId: params.senderOpenId,
|
|
995
|
-
alternateIds: [params.senderUserId]
|
|
996
|
-
}),
|
|
997
|
-
conversation: {
|
|
998
|
-
kind: "direct",
|
|
999
|
-
id: params.conversationId
|
|
1000
|
-
},
|
|
1001
|
-
event: { mayPair: params.mayPair },
|
|
1002
|
-
dmPolicy: normalizeFeishuDmPolicy(params.dmPolicy),
|
|
1003
|
-
groupPolicy: "disabled",
|
|
1004
|
-
allowFrom: params.allowFrom ?? [],
|
|
1005
|
-
...params.command ? { command: params.command } : {}
|
|
1006
|
-
});
|
|
1007
|
-
}
|
|
1008
|
-
async function resolveFeishuGroupConversationIngressAccess(params) {
|
|
1009
|
-
const groupPolicy = normalizeFeishuGroupPolicy(params.groupPolicy);
|
|
1010
|
-
const groupAllowFrom = groupPolicy === "allowlist" && params.groupExplicitlyConfigured ? [...params.groupAllowFrom ?? [], params.chatId] : params.groupAllowFrom ?? [];
|
|
1011
|
-
return await createFeishuIngressResolver({
|
|
1012
|
-
cfg: params.cfg,
|
|
1013
|
-
accountId: params.accountId
|
|
1014
|
-
}).message({
|
|
1015
|
-
subject: createFeishuIngressSubject({ primaryId: params.chatId }),
|
|
1016
|
-
conversation: {
|
|
1017
|
-
kind: "group",
|
|
1018
|
-
id: params.chatId
|
|
1019
|
-
},
|
|
1020
|
-
dmPolicy: "disabled",
|
|
1021
|
-
groupPolicy,
|
|
1022
|
-
groupAllowFrom
|
|
1023
|
-
});
|
|
1024
|
-
}
|
|
1025
|
-
async function resolveFeishuGroupSenderActivationIngressAccess(params) {
|
|
1026
|
-
const groupAllowFrom = params.allowFrom ?? [];
|
|
1027
|
-
return await createFeishuIngressResolver({
|
|
1028
|
-
cfg: params.cfg,
|
|
1029
|
-
accountId: params.accountId
|
|
1030
|
-
}).message({
|
|
1031
|
-
subject: createFeishuIngressSubject({
|
|
1032
|
-
primaryId: params.senderOpenId,
|
|
1033
|
-
alternateIds: [params.senderUserId]
|
|
1034
|
-
}),
|
|
1035
|
-
conversation: {
|
|
1036
|
-
kind: "group",
|
|
1037
|
-
id: params.chatId
|
|
1038
|
-
},
|
|
1039
|
-
dmPolicy: "disabled",
|
|
1040
|
-
groupPolicy: groupAllowFrom.length > 0 ? "allowlist" : "open",
|
|
1041
|
-
groupAllowFrom,
|
|
1042
|
-
mentionFacts: {
|
|
1043
|
-
canDetectMention: true,
|
|
1044
|
-
wasMentioned: params.mentionedBot
|
|
1045
|
-
},
|
|
1046
|
-
policy: { activation: {
|
|
1047
|
-
requireMention: params.requireMention,
|
|
1048
|
-
allowTextCommands: false
|
|
1049
|
-
} },
|
|
1050
|
-
...params.command ? { command: params.command } : {}
|
|
1051
|
-
});
|
|
1052
|
-
}
|
|
1053
|
-
function resolveFeishuGroupConfig(params) {
|
|
1054
|
-
const groups = params.cfg?.groups ?? {};
|
|
1055
|
-
const wildcard = groups["*"];
|
|
1056
|
-
const groupId = params.groupId?.trim();
|
|
1057
|
-
if (!groupId) return;
|
|
1058
|
-
const direct = groups[groupId];
|
|
1059
|
-
if (direct) return direct;
|
|
1060
|
-
const lowered = normalizeOptionalLowercaseString(groupId) ?? "";
|
|
1061
|
-
const matchKey = Object.keys(groups).find((key) => normalizeOptionalLowercaseString(key) === lowered);
|
|
1062
|
-
if (matchKey) return groups[matchKey];
|
|
1063
|
-
return wildcard;
|
|
1064
|
-
}
|
|
1065
|
-
function hasExplicitFeishuGroupConfig(params) {
|
|
1066
|
-
const groups = params.cfg?.groups ?? {};
|
|
1067
|
-
const groupId = params.groupId?.trim();
|
|
1068
|
-
if (!groupId) return false;
|
|
1069
|
-
if (Object.hasOwn(groups, groupId) && groupId !== "*") return true;
|
|
1070
|
-
const lowered = normalizeOptionalLowercaseString(groupId) ?? "";
|
|
1071
|
-
return Object.keys(groups).some((key) => key !== "*" && normalizeOptionalLowercaseString(key) === lowered);
|
|
1072
|
-
}
|
|
1073
|
-
function resolveFeishuGroupToolPolicy(params) {
|
|
1074
|
-
const cfg = params.cfg.channels?.feishu;
|
|
1075
|
-
if (!cfg) return;
|
|
1076
|
-
return resolveFeishuGroupConfig({
|
|
1077
|
-
cfg,
|
|
1078
|
-
groupId: params.groupId
|
|
1079
|
-
})?.tools;
|
|
1021
|
+
function isFeishuCardWithinEnvelope(card) {
|
|
1022
|
+
try {
|
|
1023
|
+
return Buffer.byteLength(JSON.stringify(card), "utf8") <= FEISHU_CARD_MAX_BYTES && countFeishuCardElements(card) <= FEISHU_CARD_MAX_ELEMENTS;
|
|
1024
|
+
} catch {
|
|
1025
|
+
return false;
|
|
1026
|
+
}
|
|
1080
1027
|
}
|
|
1081
|
-
function
|
|
1082
|
-
if (
|
|
1083
|
-
const feishuCfg = params.cfg.channels?.feishu;
|
|
1084
|
-
const resolvedCfg = resolveMergedAccountConfig({
|
|
1085
|
-
channelConfig: feishuCfg,
|
|
1086
|
-
accounts: feishuCfg?.accounts,
|
|
1087
|
-
accountId: normalizeAccountId(params.accountId),
|
|
1088
|
-
normalizeAccountId,
|
|
1089
|
-
omitKeys: ["defaultAccount"]
|
|
1090
|
-
});
|
|
1091
|
-
const groupRequireMention = resolveFeishuGroupConfig({
|
|
1092
|
-
cfg: resolvedCfg,
|
|
1093
|
-
groupId: params.groupId
|
|
1094
|
-
})?.requireMention;
|
|
1095
|
-
return { requireMention: typeof groupRequireMention === "boolean" ? groupRequireMention : typeof resolvedCfg.requireMention === "boolean" ? resolvedCfg.requireMention : params.groupPolicy !== "open" };
|
|
1028
|
+
function assertFeishuCardWithinEnvelope(card, label = "Feishu card") {
|
|
1029
|
+
if (!isFeishuCardWithinEnvelope(card)) throw new Error(`${label} exceeds the 30 KB or 200-element API limit.`);
|
|
1096
1030
|
}
|
|
1097
|
-
//#endregion
|
|
1098
|
-
//#region extensions/feishu/src/presentation-card.ts
|
|
1099
1031
|
function escapeFeishuCardMarkdownText(text) {
|
|
1100
1032
|
return text.replace(/[&<>]/g, (char) => {
|
|
1101
1033
|
switch (char) {
|
|
@@ -1117,11 +1049,13 @@ function resolveSafeFeishuButtonUrl(url) {
|
|
|
1117
1049
|
}
|
|
1118
1050
|
}
|
|
1119
1051
|
function resolveFeishuButtonUrl(button) {
|
|
1052
|
+
if (button.action?.type === "url" || button.action?.type === "web-app") return button.action.url;
|
|
1053
|
+
if (button.action) return;
|
|
1120
1054
|
return button.url ?? button.webApp?.url ?? button.web_app?.url;
|
|
1121
1055
|
}
|
|
1122
1056
|
function resolveFeishuCommandButtonValue(button) {
|
|
1123
|
-
if (button.action?.type === "callback") return;
|
|
1124
1057
|
if (button.action?.type === "command") return button.action.command;
|
|
1058
|
+
if (button.action) return;
|
|
1125
1059
|
return button.value;
|
|
1126
1060
|
}
|
|
1127
1061
|
function mapFeishuButtonType(style) {
|
|
@@ -1171,6 +1105,14 @@ function buildFeishuCardElementsForBlock(block) {
|
|
|
1171
1105
|
}];
|
|
1172
1106
|
if (block.type === "divider") return [{ tag: "hr" }];
|
|
1173
1107
|
if (block.type === "buttons") return block.buttons.map((button) => buildFeishuPayloadButton(button)).filter((button) => Boolean(button));
|
|
1108
|
+
if (block.type === "chart") return [{
|
|
1109
|
+
tag: "markdown",
|
|
1110
|
+
content: escapeFeishuCardMarkdownText(renderMessagePresentationChartFallbackText(block))
|
|
1111
|
+
}];
|
|
1112
|
+
if (block.type === "table") return [{
|
|
1113
|
+
tag: "markdown",
|
|
1114
|
+
content: escapeFeishuCardMarkdownText(renderMessagePresentationTableFallbackText(block))
|
|
1115
|
+
}];
|
|
1174
1116
|
const labels = block.options.map((option) => `- ${option.label}`).join("\n");
|
|
1175
1117
|
return [{
|
|
1176
1118
|
tag: "markdown",
|
|
@@ -1427,7 +1369,7 @@ function applyNewAppSecurityPolicy(cfg, accountId, openId, groupPolicy) {
|
|
|
1427
1369
|
next = patchFeishuConfig(next, accountId, groupPatch);
|
|
1428
1370
|
return next;
|
|
1429
1371
|
}
|
|
1430
|
-
const loadAppRegistrationModule = createLazyRuntimeModule(() => import("./app-registration-
|
|
1372
|
+
const loadAppRegistrationModule = createLazyRuntimeModule(() => import("./app-registration-BzkyrVZu.js"));
|
|
1431
1373
|
async function promptFeishuDomain(params) {
|
|
1432
1374
|
return await params.prompter.select({
|
|
1433
1375
|
message: t("wizard.feishu.domainPrompt"),
|
|
@@ -1454,7 +1396,7 @@ async function promptFeishuSetupMethod(prompter) {
|
|
|
1454
1396
|
initialValue: "manual"
|
|
1455
1397
|
});
|
|
1456
1398
|
}
|
|
1457
|
-
async function runScanToCreate(prompter, domain) {
|
|
1399
|
+
async function runScanToCreate(prompter, domain, beforePersistentEffect) {
|
|
1458
1400
|
const { beginAppRegistration, initAppRegistration, pollAppRegistration, printQrCode } = await loadAppRegistrationModule();
|
|
1459
1401
|
try {
|
|
1460
1402
|
await initAppRegistration(domain);
|
|
@@ -1462,6 +1404,7 @@ async function runScanToCreate(prompter, domain) {
|
|
|
1462
1404
|
await prompter.note(t("wizard.feishu.scanUnavailable"), t("wizard.feishu.setupTitle"));
|
|
1463
1405
|
return null;
|
|
1464
1406
|
}
|
|
1407
|
+
await beforePersistentEffect?.();
|
|
1465
1408
|
const begin = await beginAppRegistration(domain);
|
|
1466
1409
|
await prompter.note(t("wizard.feishu.scanQr"), t("wizard.feishu.scanTitle"));
|
|
1467
1410
|
await printQrCode(begin.qrUrl);
|
|
@@ -1508,7 +1451,7 @@ async function runNewAppFlow(params) {
|
|
|
1508
1451
|
initialValue: currentDomain
|
|
1509
1452
|
});
|
|
1510
1453
|
scanDomain = selectedDomain;
|
|
1511
|
-
const scanResult = setupMethod === "scan" ? await runScanToCreate(prompter, selectedDomain) : null;
|
|
1454
|
+
const scanResult = setupMethod === "scan" ? await runScanToCreate(prompter, selectedDomain, options?.beforePersistentEffect) : null;
|
|
1512
1455
|
if (scanResult) {
|
|
1513
1456
|
appId = scanResult.appId;
|
|
1514
1457
|
appSecret = scanResult.appSecret;
|
|
@@ -1651,7 +1594,7 @@ const feishuSetupWizard = {
|
|
|
1651
1594
|
});
|
|
1652
1595
|
let probeResult = null;
|
|
1653
1596
|
if (configured && account.configured) try {
|
|
1654
|
-
const { probeFeishu } = await import("./probe-
|
|
1597
|
+
const { probeFeishu } = await import("./probe-BgboTHIn.js").then((n) => n.n);
|
|
1655
1598
|
probeResult = await probeFeishu(account);
|
|
1656
1599
|
} catch {}
|
|
1657
1600
|
if (!configured) return [formatFeishuStatusLine("needs-credentials")];
|
|
@@ -1687,11 +1630,7 @@ const feishuSetupWizard = {
|
|
|
1687
1630
|
});
|
|
1688
1631
|
},
|
|
1689
1632
|
dmPolicy: feishuDmPolicy,
|
|
1690
|
-
disable: (cfg) =>
|
|
1691
|
-
cfg,
|
|
1692
|
-
channel,
|
|
1693
|
-
patch: { enabled: false }
|
|
1694
|
-
})
|
|
1633
|
+
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false)
|
|
1695
1634
|
};
|
|
1696
1635
|
//#endregion
|
|
1697
1636
|
//#region extensions/feishu/src/channel.ts
|
|
@@ -1727,7 +1666,7 @@ const meta = {
|
|
|
1727
1666
|
order: 70,
|
|
1728
1667
|
preferSessionLookupForAnnounceTarget: true
|
|
1729
1668
|
};
|
|
1730
|
-
const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
1669
|
+
const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-By2uqa3Q.js"), "feishuChannelRuntime");
|
|
1731
1670
|
function toFeishuMessageSendResult(result, kind) {
|
|
1732
1671
|
const receipt = result.receipt ?? createFeishuSendReceipt({
|
|
1733
1672
|
messageId: result.messageId,
|
|
@@ -1771,9 +1710,22 @@ const feishuMessageAdapter = defineChannelMessageAdapter({
|
|
|
1771
1710
|
}
|
|
1772
1711
|
});
|
|
1773
1712
|
async function createFeishuActionClient(account) {
|
|
1774
|
-
const { createFeishuClient } = await import("./client-
|
|
1713
|
+
const { createFeishuClient } = await import("./client-87BmeMpj.js").then((n) => n.t);
|
|
1775
1714
|
return createFeishuClient(account);
|
|
1776
1715
|
}
|
|
1716
|
+
async function resolveFeishuChatTypeById(params) {
|
|
1717
|
+
const client = await createFeishuActionClient(params.account);
|
|
1718
|
+
return resolveFeishuChatType(await params.runtime.getChatInfo(client, params.chatId));
|
|
1719
|
+
}
|
|
1720
|
+
async function resolveFeishuMessageChatType(params) {
|
|
1721
|
+
const knownChatType = normalizeFeishuChatType(params.message.chatType);
|
|
1722
|
+
if (knownChatType) return knownChatType;
|
|
1723
|
+
return resolveFeishuChatTypeById({
|
|
1724
|
+
account: params.account,
|
|
1725
|
+
chatId: params.message.chatId,
|
|
1726
|
+
runtime: params.runtime
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1777
1729
|
const collectFeishuSecurityWarnings = createAllowlistProviderGroupPolicyWarningCollector({
|
|
1778
1730
|
providerConfigPresent: (cfg) => cfg.channels?.feishu !== void 0,
|
|
1779
1731
|
resolveGroupPolicy: ({ cfg, accountId }) => resolveFeishuAccount({
|
|
@@ -2017,6 +1969,119 @@ function resolveFeishuMessageId(params) {
|
|
|
2017
1969
|
"reply_to"
|
|
2018
1970
|
]);
|
|
2019
1971
|
}
|
|
1972
|
+
function resolveFeishuMessageReadTarget(ctx) {
|
|
1973
|
+
const explicitChatId = resolveFeishuChatId({ params: ctx.params });
|
|
1974
|
+
const currentChatId = resolveFeishuChatId({
|
|
1975
|
+
params: {},
|
|
1976
|
+
toolContext: ctx.toolContext
|
|
1977
|
+
});
|
|
1978
|
+
const chatId = explicitChatId ?? currentChatId;
|
|
1979
|
+
if (!chatId) return;
|
|
1980
|
+
const normalizedChatId = normalizeFeishuTarget(chatId) ?? chatId.trim();
|
|
1981
|
+
if (normalizedChatId !== (currentChatId ? normalizeFeishuTarget(currentChatId) ?? currentChatId.trim() : void 0)) return { chatId: normalizedChatId };
|
|
1982
|
+
return {
|
|
1983
|
+
chatId: normalizedChatId,
|
|
1984
|
+
chatType: ctx.toolContext?.currentChatType === "direct" ? "p2p" : ctx.toolContext?.currentChatType === "group" || ctx.toolContext?.currentChatType === "channel" ? "group" : void 0
|
|
1985
|
+
};
|
|
1986
|
+
}
|
|
1987
|
+
function assertFeishuMessageMatchesReadTarget(params) {
|
|
1988
|
+
if ((normalizeFeishuTarget(params.messageChatId) ?? params.messageChatId.trim()) !== params.authorizedChatId) throw new ToolAuthorizationError("Feishu message target is not allowed.");
|
|
1989
|
+
}
|
|
1990
|
+
async function authorizeFeishuMessageReadTarget(params) {
|
|
1991
|
+
const authorize = (chatType) => assertFeishuChatReadAllowed({
|
|
1992
|
+
cfg: params.ctx.cfg,
|
|
1993
|
+
account: params.account,
|
|
1994
|
+
chatId: params.target.chatId,
|
|
1995
|
+
chatType,
|
|
1996
|
+
ctx: params.ctx
|
|
1997
|
+
});
|
|
1998
|
+
if (params.target.chatType) return authorize(params.target.chatType);
|
|
1999
|
+
const preliminary = resolveFeishuChatReadPreliminaryAuthorization({
|
|
2000
|
+
cfg: params.ctx.cfg,
|
|
2001
|
+
account: params.account,
|
|
2002
|
+
chatId: params.target.chatId,
|
|
2003
|
+
ctx: params.ctx
|
|
2004
|
+
});
|
|
2005
|
+
if (preliminary.decision === "allow") return preliminary.chatId;
|
|
2006
|
+
if (preliminary.decision === "deny") throw new ToolAuthorizationError("Feishu read target is not allowed.");
|
|
2007
|
+
await getAuthorizedFeishuChatInfo({
|
|
2008
|
+
ctx: params.ctx,
|
|
2009
|
+
account: params.account,
|
|
2010
|
+
runtime: params.runtime,
|
|
2011
|
+
chatId: params.target.chatId
|
|
2012
|
+
});
|
|
2013
|
+
return preliminary.chatId;
|
|
2014
|
+
}
|
|
2015
|
+
async function getAuthorizedFeishuChatInfo(params) {
|
|
2016
|
+
const preliminary = resolveFeishuChatReadPreliminaryAuthorization({
|
|
2017
|
+
cfg: params.ctx.cfg,
|
|
2018
|
+
account: params.account,
|
|
2019
|
+
chatId: params.chatId,
|
|
2020
|
+
ctx: params.ctx
|
|
2021
|
+
});
|
|
2022
|
+
if (preliminary.decision === "deny") throw new ToolAuthorizationError("Feishu read target is not allowed.");
|
|
2023
|
+
const client = await createFeishuActionClient(params.account);
|
|
2024
|
+
let chat;
|
|
2025
|
+
try {
|
|
2026
|
+
chat = await params.runtime.getChatInfo(client, preliminary.chatId);
|
|
2027
|
+
} catch (error) {
|
|
2028
|
+
if (preliminary.decision === "needs-metadata") assertFeishuChatReadAllowed({
|
|
2029
|
+
cfg: params.ctx.cfg,
|
|
2030
|
+
account: params.account,
|
|
2031
|
+
chatId: preliminary.chatId,
|
|
2032
|
+
ctx: params.ctx
|
|
2033
|
+
});
|
|
2034
|
+
throw error;
|
|
2035
|
+
}
|
|
2036
|
+
assertFeishuChatReadAllowed({
|
|
2037
|
+
cfg: params.ctx.cfg,
|
|
2038
|
+
account: params.account,
|
|
2039
|
+
chatId: preliminary.chatId,
|
|
2040
|
+
chatType: resolveFeishuChatType(chat),
|
|
2041
|
+
ctx: params.ctx
|
|
2042
|
+
});
|
|
2043
|
+
return {
|
|
2044
|
+
chat,
|
|
2045
|
+
client
|
|
2046
|
+
};
|
|
2047
|
+
}
|
|
2048
|
+
async function getAuthorizedFeishuMessage(params) {
|
|
2049
|
+
const target = resolveFeishuMessageReadTarget(params.ctx);
|
|
2050
|
+
if (!target && params.ctx.conversationReadOrigin !== "direct-operator") throw new ToolAuthorizationError("Feishu message reads require a chat target or current conversation.");
|
|
2051
|
+
const authorizedChatId = target ? await authorizeFeishuMessageReadTarget({
|
|
2052
|
+
ctx: params.ctx,
|
|
2053
|
+
account: params.account,
|
|
2054
|
+
runtime: params.runtime,
|
|
2055
|
+
target
|
|
2056
|
+
}) : void 0;
|
|
2057
|
+
const message = await params.runtime.getMessageFeishu({
|
|
2058
|
+
cfg: params.ctx.cfg,
|
|
2059
|
+
messageId: params.messageId,
|
|
2060
|
+
accountId: params.ctx.accountId ?? void 0
|
|
2061
|
+
});
|
|
2062
|
+
if (!message) return null;
|
|
2063
|
+
if (authorizedChatId) assertFeishuMessageMatchesReadTarget({
|
|
2064
|
+
authorizedChatId,
|
|
2065
|
+
messageChatId: message.chatId
|
|
2066
|
+
});
|
|
2067
|
+
assertFeishuChatReadAllowed({
|
|
2068
|
+
cfg: params.ctx.cfg,
|
|
2069
|
+
account: params.account,
|
|
2070
|
+
chatId: message.chatId,
|
|
2071
|
+
chatType: await resolveFeishuMessageChatType({
|
|
2072
|
+
account: params.account,
|
|
2073
|
+
message,
|
|
2074
|
+
runtime: params.runtime
|
|
2075
|
+
}),
|
|
2076
|
+
ctx: params.ctx
|
|
2077
|
+
});
|
|
2078
|
+
return message;
|
|
2079
|
+
}
|
|
2080
|
+
async function requireAuthorizedFeishuMessage(params) {
|
|
2081
|
+
const message = await getAuthorizedFeishuMessage(params);
|
|
2082
|
+
if (!message) throw new Error(`Feishu message not found: ${params.messageId}`);
|
|
2083
|
+
return message;
|
|
2084
|
+
}
|
|
2020
2085
|
function resolveFeishuMemberId(params) {
|
|
2021
2086
|
return readFirstString(params, [
|
|
2022
2087
|
"memberId",
|
|
@@ -2030,6 +2095,9 @@ function resolveFeishuMemberId(params) {
|
|
|
2030
2095
|
]);
|
|
2031
2096
|
}
|
|
2032
2097
|
function resolveFeishuMemberIdType(params) {
|
|
2098
|
+
return resolveRequestedFeishuMemberIdType(params) ?? "open_id";
|
|
2099
|
+
}
|
|
2100
|
+
function resolveRequestedFeishuMemberIdType(params) {
|
|
2033
2101
|
const raw = readFirstString(params, [
|
|
2034
2102
|
"memberIdType",
|
|
2035
2103
|
"member_id_type",
|
|
@@ -2044,7 +2112,7 @@ function resolveFeishuMemberIdType(params) {
|
|
|
2044
2112
|
"union_id"
|
|
2045
2113
|
])) return "user_id";
|
|
2046
2114
|
if (readFirstString(params, ["unionId", "union_id"]) && !readFirstString(params, ["openId", "open_id"])) return "union_id";
|
|
2047
|
-
return "open_id";
|
|
2115
|
+
if (readFirstString(params, ["openId", "open_id"])) return "open_id";
|
|
2048
2116
|
}
|
|
2049
2117
|
const feishuPlugin = createChatChannelPlugin({
|
|
2050
2118
|
base: {
|
|
@@ -2076,7 +2144,7 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2076
2144
|
mentions: { stripPatterns: () => ["<at user_id=\"[^\"]*\">[^<]*</at>"] },
|
|
2077
2145
|
reload: { configPrefixes: ["channels.feishu"] },
|
|
2078
2146
|
doctor: feishuDoctor,
|
|
2079
|
-
configSchema:
|
|
2147
|
+
configSchema: FeishuChannelConfigSchema,
|
|
2080
2148
|
config: {
|
|
2081
2149
|
...feishuConfigAdapter,
|
|
2082
2150
|
setAccountEnabled: ({ cfg, accountId, enabled }) => {
|
|
@@ -2153,21 +2221,44 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2153
2221
|
const presentation = normalizeMessagePresentation(ctx.params.presentation) ?? (interactive ? interactiveReplyToPresentation(interactive) : void 0);
|
|
2154
2222
|
const mediaUrl = readFeishuMediaParam(ctx.params);
|
|
2155
2223
|
const audioAsVoice = readBooleanParam(ctx.params, ["asVoice", "audioAsVoice"]);
|
|
2156
|
-
|
|
2224
|
+
if (textCard && !presentation) assertFeishuCardWithinEnvelope(textCard, "Feishu native card");
|
|
2225
|
+
const generatedCard = presentation ? buildFeishuPresentationCard({
|
|
2157
2226
|
presentation,
|
|
2158
2227
|
fallbackText: textCard ? void 0 : resolveInteractiveTextFallback({
|
|
2159
2228
|
text,
|
|
2160
2229
|
interactive
|
|
2161
2230
|
})
|
|
2162
|
-
}) :
|
|
2231
|
+
}) : void 0;
|
|
2232
|
+
const presentationCard = generatedCard && isFeishuCardWithinEnvelope(generatedCard) ? generatedCard : void 0;
|
|
2233
|
+
const presentationFellBack = Boolean(generatedCard && !presentationCard);
|
|
2234
|
+
const card = presentation ? presentationCard : textCard;
|
|
2163
2235
|
if (card && mediaUrl) throw new Error(`Feishu ${ctx.action} does not support card with media.`);
|
|
2164
|
-
if (!card && !text && !mediaUrl) throw new Error(`Feishu ${ctx.action} requires text/message, media, or card.`);
|
|
2236
|
+
if (!card && !text && !mediaUrl && !presentationFellBack) throw new Error(`Feishu ${ctx.action} requires text/message, media, or card.`);
|
|
2165
2237
|
const runtime = await loadFeishuChannelRuntime();
|
|
2166
2238
|
const maybeSendMedia = runtime.feishuOutbound.sendMedia;
|
|
2167
2239
|
if (mediaUrl && !maybeSendMedia) throw new Error("Feishu media sending is not available.");
|
|
2168
2240
|
const sendMedia = maybeSendMedia;
|
|
2169
2241
|
let result;
|
|
2170
|
-
if (
|
|
2242
|
+
if (presentationFellBack && presentation) {
|
|
2243
|
+
const sendPayload = runtime.feishuOutbound.sendPayload;
|
|
2244
|
+
if (!sendPayload) throw new Error("Feishu presentation fallback delivery is not available.");
|
|
2245
|
+
const fallbackText = textCard ? void 0 : text;
|
|
2246
|
+
result = await sendPayload({
|
|
2247
|
+
cfg: ctx.cfg,
|
|
2248
|
+
to,
|
|
2249
|
+
text: fallbackText ?? "",
|
|
2250
|
+
payload: {
|
|
2251
|
+
text: fallbackText,
|
|
2252
|
+
presentation,
|
|
2253
|
+
...mediaUrl ? { mediaUrl } : {},
|
|
2254
|
+
...audioAsVoice === void 0 ? {} : { audioAsVoice }
|
|
2255
|
+
},
|
|
2256
|
+
accountId: ctx.accountId ?? void 0,
|
|
2257
|
+
mediaLocalRoots: ctx.mediaLocalRoots,
|
|
2258
|
+
...replyInThread ? { threadId: replyToMessageId } : { replyToId: replyToMessageId },
|
|
2259
|
+
...audioAsVoice === void 0 ? {} : { audioAsVoice }
|
|
2260
|
+
});
|
|
2261
|
+
} else if (card) {
|
|
2171
2262
|
if (containsLegacyFeishuCardCommandValue(card)) throw new Error("Feishu card buttons that trigger text or commands must use structured interaction envelopes.");
|
|
2172
2263
|
result = await runtime.sendCardFeishu({
|
|
2173
2264
|
cfg: ctx.cfg,
|
|
@@ -2205,11 +2296,11 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2205
2296
|
if (ctx.action === "read") {
|
|
2206
2297
|
const messageId = resolveFeishuMessageId(ctx.params);
|
|
2207
2298
|
if (!messageId) throw new Error("Feishu read requires messageId.");
|
|
2208
|
-
const
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2299
|
+
const message = await getAuthorizedFeishuMessage({
|
|
2300
|
+
ctx,
|
|
2301
|
+
account,
|
|
2302
|
+
runtime: await loadFeishuChannelRuntime(),
|
|
2303
|
+
messageId
|
|
2213
2304
|
});
|
|
2214
2305
|
if (!message) return {
|
|
2215
2306
|
isError: true,
|
|
@@ -2231,12 +2322,18 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2231
2322
|
if (!messageId) throw new Error("Feishu edit requires messageId.");
|
|
2232
2323
|
const text = readFirstString(ctx.params, ["text", "message"]);
|
|
2233
2324
|
const card = ctx.params.card && typeof ctx.params.card === "object" ? ctx.params.card : void 0;
|
|
2234
|
-
const
|
|
2325
|
+
const runtime = await loadFeishuChannelRuntime();
|
|
2326
|
+
await requireAuthorizedFeishuMessage({
|
|
2327
|
+
ctx,
|
|
2328
|
+
account,
|
|
2329
|
+
runtime,
|
|
2330
|
+
messageId
|
|
2331
|
+
});
|
|
2235
2332
|
return jsonActionResult({
|
|
2236
2333
|
ok: true,
|
|
2237
2334
|
channel: "feishu",
|
|
2238
2335
|
action: "edit",
|
|
2239
|
-
...await editMessageFeishu({
|
|
2336
|
+
...await runtime.editMessageFeishu({
|
|
2240
2337
|
cfg: ctx.cfg,
|
|
2241
2338
|
messageId,
|
|
2242
2339
|
text,
|
|
@@ -2248,12 +2345,18 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2248
2345
|
if (ctx.action === "pin") {
|
|
2249
2346
|
const messageId = resolveFeishuMessageId(ctx.params);
|
|
2250
2347
|
if (!messageId) throw new Error("Feishu pin requires messageId.");
|
|
2251
|
-
const
|
|
2348
|
+
const runtime = await loadFeishuChannelRuntime();
|
|
2349
|
+
await requireAuthorizedFeishuMessage({
|
|
2350
|
+
ctx,
|
|
2351
|
+
account,
|
|
2352
|
+
runtime,
|
|
2353
|
+
messageId
|
|
2354
|
+
});
|
|
2252
2355
|
return jsonActionResult({
|
|
2253
2356
|
ok: true,
|
|
2254
2357
|
channel: "feishu",
|
|
2255
2358
|
action: "pin",
|
|
2256
|
-
pin: await createPinFeishu({
|
|
2359
|
+
pin: await runtime.createPinFeishu({
|
|
2257
2360
|
cfg: ctx.cfg,
|
|
2258
2361
|
messageId,
|
|
2259
2362
|
accountId: ctx.accountId ?? void 0
|
|
@@ -2263,8 +2366,14 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2263
2366
|
if (ctx.action === "unpin") {
|
|
2264
2367
|
const messageId = resolveFeishuMessageId(ctx.params);
|
|
2265
2368
|
if (!messageId) throw new Error("Feishu unpin requires messageId.");
|
|
2266
|
-
const
|
|
2267
|
-
await
|
|
2369
|
+
const runtime = await loadFeishuChannelRuntime();
|
|
2370
|
+
await requireAuthorizedFeishuMessage({
|
|
2371
|
+
ctx,
|
|
2372
|
+
account,
|
|
2373
|
+
runtime,
|
|
2374
|
+
messageId
|
|
2375
|
+
});
|
|
2376
|
+
await runtime.removePinFeishu({
|
|
2268
2377
|
cfg: ctx.cfg,
|
|
2269
2378
|
messageId,
|
|
2270
2379
|
accountId: ctx.accountId ?? void 0
|
|
@@ -2279,7 +2388,14 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2279
2388
|
if (ctx.action === "list-pins") {
|
|
2280
2389
|
const chatId = resolveFeishuChatId(ctx);
|
|
2281
2390
|
if (!chatId) throw new Error("Feishu list-pins requires chatId or channelId.");
|
|
2282
|
-
const
|
|
2391
|
+
const runtime = await loadFeishuChannelRuntime();
|
|
2392
|
+
await getAuthorizedFeishuChatInfo({
|
|
2393
|
+
ctx,
|
|
2394
|
+
account,
|
|
2395
|
+
runtime,
|
|
2396
|
+
chatId
|
|
2397
|
+
});
|
|
2398
|
+
const { listPinsFeishu } = runtime;
|
|
2283
2399
|
return jsonActionResult({
|
|
2284
2400
|
ok: true,
|
|
2285
2401
|
channel: "feishu",
|
|
@@ -2299,39 +2415,97 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2299
2415
|
const chatId = resolveFeishuChatId(ctx);
|
|
2300
2416
|
if (!chatId) throw new Error("Feishu channel-info requires chatId or channelId.");
|
|
2301
2417
|
const runtime = await loadFeishuChannelRuntime();
|
|
2302
|
-
const client = await
|
|
2303
|
-
|
|
2418
|
+
const { chat: channel, client } = await getAuthorizedFeishuChatInfo({
|
|
2419
|
+
ctx,
|
|
2420
|
+
account,
|
|
2421
|
+
runtime,
|
|
2422
|
+
chatId
|
|
2423
|
+
});
|
|
2424
|
+
const chatType = resolveFeishuChatType(channel);
|
|
2304
2425
|
if (!(ctx.params.includeMembers === true || ctx.params.members === true)) return jsonActionResult({
|
|
2305
2426
|
ok: true,
|
|
2306
2427
|
provider: "feishu",
|
|
2307
2428
|
action: "channel-info",
|
|
2308
2429
|
channel
|
|
2309
2430
|
});
|
|
2431
|
+
const requestedMemberIdType = resolveRequestedFeishuMemberIdType(ctx.params);
|
|
2432
|
+
const authorization = authorizeFeishuChatMemberRead({
|
|
2433
|
+
cfg: ctx.cfg,
|
|
2434
|
+
account,
|
|
2435
|
+
chatId,
|
|
2436
|
+
chatType,
|
|
2437
|
+
ctx,
|
|
2438
|
+
memberIdType: requestedMemberIdType
|
|
2439
|
+
});
|
|
2310
2440
|
return jsonActionResult({
|
|
2311
2441
|
ok: true,
|
|
2312
2442
|
provider: "feishu",
|
|
2313
2443
|
action: "channel-info",
|
|
2314
2444
|
channel,
|
|
2315
|
-
members: await runtime.getChatMembers(client, chatId, readOptionalPositiveInteger(ctx.params, ["pageSize", "page_size"]), readFirstString(ctx.params, ["pageToken", "page_token"]), resolveFeishuMemberIdType(ctx.params))
|
|
2445
|
+
members: authorization.kind === "direct" ? runtime.buildFeishuDirectChatMembers(authorization) : await runtime.getChatMembers(client, chatId, readOptionalPositiveInteger(ctx.params, ["pageSize", "page_size"]), readFirstString(ctx.params, ["pageToken", "page_token"]), resolveFeishuMemberIdType(ctx.params))
|
|
2316
2446
|
});
|
|
2317
2447
|
}
|
|
2318
2448
|
if (ctx.action === "member-info") {
|
|
2319
2449
|
const runtime = await loadFeishuChannelRuntime();
|
|
2320
|
-
const client = await createFeishuActionClient(account);
|
|
2321
2450
|
const memberId = resolveFeishuMemberId(ctx.params);
|
|
2322
|
-
if (memberId)
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2451
|
+
if (memberId) {
|
|
2452
|
+
const chatId = resolveFeishuChatId(ctx);
|
|
2453
|
+
if (!chatId) throw new Error("Feishu member-info requires chatId or channelId when memberId is provided.");
|
|
2454
|
+
const { chat, client } = await getAuthorizedFeishuChatInfo({
|
|
2455
|
+
ctx,
|
|
2456
|
+
account,
|
|
2457
|
+
runtime,
|
|
2458
|
+
chatId
|
|
2459
|
+
});
|
|
2460
|
+
const requestedMemberIdType = resolveRequestedFeishuMemberIdType(ctx.params);
|
|
2461
|
+
const memberIdType = resolveFeishuMemberIdType(ctx.params);
|
|
2462
|
+
const authorization = authorizeFeishuChatMemberRead({
|
|
2463
|
+
cfg: ctx.cfg,
|
|
2464
|
+
account,
|
|
2465
|
+
chatId,
|
|
2466
|
+
chatType: resolveFeishuChatType(chat),
|
|
2467
|
+
ctx,
|
|
2468
|
+
memberId,
|
|
2469
|
+
memberIdType: requestedMemberIdType
|
|
2470
|
+
});
|
|
2471
|
+
if (authorization.kind === "group") {
|
|
2472
|
+
await runtime.assertFeishuChatMember(client, chatId, memberId, memberIdType);
|
|
2473
|
+
return jsonActionResult({
|
|
2474
|
+
ok: true,
|
|
2475
|
+
channel: "feishu",
|
|
2476
|
+
action: "member-info",
|
|
2477
|
+
member: await runtime.getFeishuMemberInfo(client, memberId, memberIdType)
|
|
2478
|
+
});
|
|
2479
|
+
}
|
|
2480
|
+
return jsonActionResult({
|
|
2481
|
+
ok: true,
|
|
2482
|
+
channel: "feishu",
|
|
2483
|
+
action: "member-info",
|
|
2484
|
+
member: await runtime.getFeishuMemberInfo(client, authorization.memberId, authorization.memberIdType)
|
|
2485
|
+
});
|
|
2486
|
+
}
|
|
2328
2487
|
const chatId = resolveFeishuChatId(ctx);
|
|
2329
2488
|
if (!chatId) throw new Error("Feishu member-info requires memberId or chatId/channelId.");
|
|
2489
|
+
const { chat, client } = await getAuthorizedFeishuChatInfo({
|
|
2490
|
+
ctx,
|
|
2491
|
+
account,
|
|
2492
|
+
runtime,
|
|
2493
|
+
chatId
|
|
2494
|
+
});
|
|
2495
|
+
const requestedMemberIdType = resolveRequestedFeishuMemberIdType(ctx.params);
|
|
2496
|
+
const authorization = authorizeFeishuChatMemberRead({
|
|
2497
|
+
cfg: ctx.cfg,
|
|
2498
|
+
account,
|
|
2499
|
+
chatId,
|
|
2500
|
+
chatType: resolveFeishuChatType(chat),
|
|
2501
|
+
ctx,
|
|
2502
|
+
memberIdType: requestedMemberIdType
|
|
2503
|
+
});
|
|
2330
2504
|
return jsonActionResult({
|
|
2331
2505
|
ok: true,
|
|
2332
2506
|
channel: "feishu",
|
|
2333
2507
|
action: "member-info",
|
|
2334
|
-
...await runtime.getChatMembers(client, chatId, readOptionalPositiveInteger(ctx.params, ["pageSize", "page_size"]), readFirstString(ctx.params, ["pageToken", "page_token"]), resolveFeishuMemberIdType(ctx.params))
|
|
2508
|
+
...authorization.kind === "direct" ? runtime.buildFeishuDirectChatMembers(authorization) : await runtime.getChatMembers(client, chatId, readOptionalPositiveInteger(ctx.params, ["pageSize", "page_size"]), readFirstString(ctx.params, ["pageToken", "page_token"]), resolveFeishuMemberIdType(ctx.params))
|
|
2335
2509
|
});
|
|
2336
2510
|
}
|
|
2337
2511
|
if (ctx.action === "channel-list") {
|
|
@@ -2339,43 +2513,33 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2339
2513
|
const query = readFirstString(ctx.params, ["query"]);
|
|
2340
2514
|
const limit = readOptionalPositiveInteger(ctx.params, ["limit"]);
|
|
2341
2515
|
const scope = readFirstString(ctx.params, ["scope", "kind"]) ?? "all";
|
|
2516
|
+
const directOperator = ctx.conversationReadOrigin === "direct-operator";
|
|
2517
|
+
const listGroups = directOperator || canEnumerateAllFeishuGroups(ctx.cfg, account) ? runtime.listFeishuDirectoryGroupsLive : listAuthorizedFeishuDirectoryGroups;
|
|
2518
|
+
const listPeers = directOperator || canEnumerateAllFeishuPeers(account) ? runtime.listFeishuDirectoryPeersLive : listAuthorizedFeishuDirectoryPeers;
|
|
2519
|
+
const directoryParams = {
|
|
2520
|
+
cfg: ctx.cfg,
|
|
2521
|
+
query,
|
|
2522
|
+
limit,
|
|
2523
|
+
accountId: ctx.accountId ?? void 0,
|
|
2524
|
+
fallbackToStatic: false
|
|
2525
|
+
};
|
|
2526
|
+
const groupDirectoryParams = {
|
|
2527
|
+
...directoryParams,
|
|
2528
|
+
filter: directOperator ? (group) => isFeishuGroupReadEnabled(ctx.cfg, account, group.id) : canEnumerateAllFeishuGroups(ctx.cfg, account) ? (group) => isFeishuGroupReadAllowed(ctx.cfg, account, group.id, false) : void 0
|
|
2529
|
+
};
|
|
2342
2530
|
if (scope === "groups" || scope === "group" || scope === "channels" || scope === "channel") return jsonActionResult({
|
|
2343
2531
|
ok: true,
|
|
2344
2532
|
channel: "feishu",
|
|
2345
2533
|
action: "channel-list",
|
|
2346
|
-
groups: await
|
|
2347
|
-
cfg: ctx.cfg,
|
|
2348
|
-
query,
|
|
2349
|
-
limit,
|
|
2350
|
-
fallbackToStatic: false,
|
|
2351
|
-
accountId: ctx.accountId ?? void 0
|
|
2352
|
-
})
|
|
2534
|
+
groups: await listGroups(groupDirectoryParams)
|
|
2353
2535
|
});
|
|
2354
2536
|
if (scope === "peers" || scope === "peer" || scope === "members" || scope === "member" || scope === "users" || scope === "user") return jsonActionResult({
|
|
2355
2537
|
ok: true,
|
|
2356
2538
|
channel: "feishu",
|
|
2357
2539
|
action: "channel-list",
|
|
2358
|
-
peers: await
|
|
2359
|
-
cfg: ctx.cfg,
|
|
2360
|
-
query,
|
|
2361
|
-
limit,
|
|
2362
|
-
fallbackToStatic: false,
|
|
2363
|
-
accountId: ctx.accountId ?? void 0
|
|
2364
|
-
})
|
|
2540
|
+
peers: await listPeers(directoryParams)
|
|
2365
2541
|
});
|
|
2366
|
-
const [groups, peers] = await Promise.all([
|
|
2367
|
-
cfg: ctx.cfg,
|
|
2368
|
-
query,
|
|
2369
|
-
limit,
|
|
2370
|
-
fallbackToStatic: false,
|
|
2371
|
-
accountId: ctx.accountId ?? void 0
|
|
2372
|
-
}), runtime.listFeishuDirectoryPeersLive({
|
|
2373
|
-
cfg: ctx.cfg,
|
|
2374
|
-
query,
|
|
2375
|
-
limit,
|
|
2376
|
-
fallbackToStatic: false,
|
|
2377
|
-
accountId: ctx.accountId ?? void 0
|
|
2378
|
-
})]);
|
|
2542
|
+
const [groups, peers] = await Promise.all([listGroups(groupDirectoryParams), listPeers(directoryParams)]);
|
|
2379
2543
|
return jsonActionResult({
|
|
2380
2544
|
ok: true,
|
|
2381
2545
|
channel: "feishu",
|
|
@@ -2392,18 +2556,24 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2392
2556
|
const clearAll = ctx.params.clearAll === true;
|
|
2393
2557
|
if (remove) {
|
|
2394
2558
|
if (!emoji) throw new Error("Emoji is required to remove a Feishu reaction.");
|
|
2395
|
-
const
|
|
2396
|
-
|
|
2559
|
+
const runtime = await loadFeishuChannelRuntime();
|
|
2560
|
+
await requireAuthorizedFeishuMessage({
|
|
2561
|
+
ctx,
|
|
2562
|
+
account,
|
|
2563
|
+
runtime,
|
|
2564
|
+
messageId
|
|
2565
|
+
});
|
|
2566
|
+
const ownReaction = (await runtime.listReactionsFeishu({
|
|
2397
2567
|
cfg: ctx.cfg,
|
|
2398
2568
|
messageId,
|
|
2399
2569
|
emojiType: emoji,
|
|
2400
2570
|
accountId: ctx.accountId ?? void 0
|
|
2401
|
-
})).find((entry) => entry.operatorType === "app");
|
|
2571
|
+
})).find((entry) => entry.operatorType === "app" && Boolean(account.appId) && entry.operatorId === account.appId);
|
|
2402
2572
|
if (!ownReaction) return jsonActionResult({
|
|
2403
2573
|
ok: true,
|
|
2404
2574
|
removed: null
|
|
2405
2575
|
});
|
|
2406
|
-
await removeReactionFeishu({
|
|
2576
|
+
await runtime.removeReactionFeishu({
|
|
2407
2577
|
cfg: ctx.cfg,
|
|
2408
2578
|
messageId,
|
|
2409
2579
|
reactionId: ownReaction.reactionId,
|
|
@@ -2416,15 +2586,22 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2416
2586
|
}
|
|
2417
2587
|
if (!emoji) {
|
|
2418
2588
|
if (!clearAll) throw new Error("Emoji is required to add a Feishu reaction. Set clearAll=true to remove all bot reactions.");
|
|
2419
|
-
const
|
|
2420
|
-
|
|
2589
|
+
const runtime = await loadFeishuChannelRuntime();
|
|
2590
|
+
await requireAuthorizedFeishuMessage({
|
|
2591
|
+
ctx,
|
|
2592
|
+
account,
|
|
2593
|
+
runtime,
|
|
2594
|
+
messageId
|
|
2595
|
+
});
|
|
2596
|
+
const reactions = await runtime.listReactionsFeishu({
|
|
2421
2597
|
cfg: ctx.cfg,
|
|
2422
2598
|
messageId,
|
|
2423
2599
|
accountId: ctx.accountId ?? void 0
|
|
2424
2600
|
});
|
|
2425
2601
|
let removed = 0;
|
|
2426
|
-
|
|
2427
|
-
|
|
2602
|
+
const ownReactions = reactions.filter((entry) => entry.operatorType === "app" && Boolean(account.appId) && entry.operatorId === account.appId);
|
|
2603
|
+
for (const reaction of ownReactions) {
|
|
2604
|
+
await runtime.removeReactionFeishu({
|
|
2428
2605
|
cfg: ctx.cfg,
|
|
2429
2606
|
messageId,
|
|
2430
2607
|
reactionId: reaction.reactionId,
|
|
@@ -2437,8 +2614,14 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2437
2614
|
removed
|
|
2438
2615
|
});
|
|
2439
2616
|
}
|
|
2440
|
-
const
|
|
2441
|
-
await
|
|
2617
|
+
const runtime = await loadFeishuChannelRuntime();
|
|
2618
|
+
await requireAuthorizedFeishuMessage({
|
|
2619
|
+
ctx,
|
|
2620
|
+
account,
|
|
2621
|
+
runtime,
|
|
2622
|
+
messageId
|
|
2623
|
+
});
|
|
2624
|
+
await runtime.addReactionFeishu({
|
|
2442
2625
|
cfg: ctx.cfg,
|
|
2443
2626
|
messageId,
|
|
2444
2627
|
emojiType: emoji,
|
|
@@ -2452,10 +2635,16 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2452
2635
|
if (ctx.action === "reactions") {
|
|
2453
2636
|
const messageId = resolveFeishuMessageId(ctx.params);
|
|
2454
2637
|
if (!messageId) throw new Error("Feishu reactions lookup requires messageId.");
|
|
2455
|
-
const
|
|
2638
|
+
const runtime = await loadFeishuChannelRuntime();
|
|
2639
|
+
await requireAuthorizedFeishuMessage({
|
|
2640
|
+
ctx,
|
|
2641
|
+
account,
|
|
2642
|
+
runtime,
|
|
2643
|
+
messageId
|
|
2644
|
+
});
|
|
2456
2645
|
return jsonActionResult({
|
|
2457
2646
|
ok: true,
|
|
2458
|
-
reactions: await listReactionsFeishu({
|
|
2647
|
+
reactions: await runtime.listReactionsFeishu({
|
|
2459
2648
|
cfg: ctx.cfg,
|
|
2460
2649
|
messageId,
|
|
2461
2650
|
accountId: ctx.accountId ?? void 0
|
|
@@ -2513,10 +2702,7 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2513
2702
|
};
|
|
2514
2703
|
return { to: `chat:${parsed?.chatId ?? conversationId.trim()}` };
|
|
2515
2704
|
},
|
|
2516
|
-
resolveSessionConversation:
|
|
2517
|
-
kind,
|
|
2518
|
-
rawId
|
|
2519
|
-
}),
|
|
2705
|
+
resolveSessionConversation: resolveFeishuSessionConversation,
|
|
2520
2706
|
resolveOutboundSessionRoute: (params) => resolveFeishuOutboundSessionRoute(params),
|
|
2521
2707
|
targetResolver: {
|
|
2522
2708
|
looksLikeId: looksLikeFeishuId,
|
|
@@ -2569,7 +2755,7 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2569
2755
|
})
|
|
2570
2756
|
}),
|
|
2571
2757
|
gateway: { startAccount: async (ctx) => {
|
|
2572
|
-
const { monitorFeishuProvider } = await import("./monitor-
|
|
2758
|
+
const { monitorFeishuProvider } = await import("./monitor-CHl0bWzb.js");
|
|
2573
2759
|
const account = resolveFeishuRuntimeAccount({
|
|
2574
2760
|
cfg: ctx.cfg,
|
|
2575
2761
|
accountId: ctx.accountId
|
|
@@ -2613,9 +2799,16 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2613
2799
|
});
|
|
2614
2800
|
}
|
|
2615
2801
|
} },
|
|
2802
|
+
threading: { buildToolContext: ({ context, hasRepliedRef }) => ({
|
|
2803
|
+
currentChannelId: normalizeOptionalString(context.NativeChannelId) ?? normalizeOptionalString(context.To),
|
|
2804
|
+
currentChatType: context.ChatType === "direct" || context.ChatType === "group" || context.ChatType === "channel" ? context.ChatType : void 0,
|
|
2805
|
+
currentMessagingTarget: normalizeOptionalString(context.To),
|
|
2806
|
+
currentThreadTs: context.MessageThreadId != null ? String(context.MessageThreadId) : void 0,
|
|
2807
|
+
hasRepliedRef
|
|
2808
|
+
}) },
|
|
2616
2809
|
outbound: {
|
|
2617
2810
|
deliveryMode: "direct",
|
|
2618
|
-
chunker:
|
|
2811
|
+
chunker: chunkFeishuMarkdown,
|
|
2619
2812
|
chunkerMode: "markdown",
|
|
2620
2813
|
textChunkLimit: 4e3,
|
|
2621
2814
|
sanitizeText: ({ text }) => sanitizeAssistantVisibleText(text),
|
|
@@ -2656,4 +2849,4 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2656
2849
|
}
|
|
2657
2850
|
});
|
|
2658
2851
|
//#endregion
|
|
2659
|
-
export { setFeishuNamedAccountEnabled$1 as a,
|
|
2852
|
+
export { setFeishuNamedAccountEnabled$1 as a, isFeishuCardWithinEnvelope as c, feishuSetupAdapter as i, listFeishuDirectoryGroups as l, feishuSetupWizard as n, assertFeishuCardWithinEnvelope as o, runFeishuLogin as r, buildFeishuPresentationCardElements as s, feishuPlugin as t, listFeishuDirectoryPeers as u };
|