@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
package/dist/api.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { r as listEnabledFeishuAccounts } from "./accounts-
|
|
2
|
-
import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-
|
|
3
|
-
import {
|
|
1
|
+
import { r as listEnabledFeishuAccounts } from "./accounts-BDoGHJDk.js";
|
|
2
|
+
import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-X30GQVwc.js";
|
|
3
|
+
import { p as parseFeishuMarkdown, u as chunkFeishuMarkdown } from "./send-result-DsqTk27v.js";
|
|
4
|
+
import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-BeJL-wq7.js";
|
|
5
|
+
import { r as createFeishuClient, s as resolveConfiguredHttpTimeoutMs } from "./client-87BmeMpj.js";
|
|
4
6
|
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.js";
|
|
5
|
-
import {
|
|
6
|
-
import { a as toolExecutionErrorResult, d as createFeishuToolClient, f as resolveAnyEnabledFeishuToolsConfig, m as resolveToolsConfig, n as registerFeishuDriveTools, o as unknownToolActionResult, p as resolveFeishuToolAccount, u as registerFeishuChatTools } from "./drive-D0lIhxqZ.js";
|
|
7
|
+
import { a as toolExecutionErrorResult, f as registerFeishuChatTools, g as resolveToolsConfig, h as resolveFeishuToolAccount, m as resolveAnyEnabledFeishuToolsConfig, n as registerFeishuDriveTools, o as unknownToolActionResult, p as createFeishuToolClient } from "./drive-B4E8OXZ0.js";
|
|
7
8
|
import { n as getFeishuThreadBindingManager, r as testing, t as createFeishuThreadBindingManager } from "./thread-bindings-V0bwk0A1.js";
|
|
8
|
-
import { n as handleFeishuSubagentEnded, r as handleFeishuSubagentSpawning, t as handleFeishuSubagentDeliveryTarget } from "./subagent-hooks-
|
|
9
|
-
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
|
+
import { n as handleFeishuSubagentEnded, r as handleFeishuSubagentSpawning, t as handleFeishuSubagentDeliveryTarget } from "./subagent-hooks-BKTOxB-T.js";
|
|
10
10
|
import { optionalPositiveIntegerSchema } from "openclaw/plugin-sdk/channel-actions";
|
|
11
|
+
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
12
|
import { existsSync } from "node:fs";
|
|
12
13
|
import { homedir } from "node:os";
|
|
13
14
|
import { basename, isAbsolute, resolve } from "node:path";
|
|
14
15
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
15
|
-
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
|
16
16
|
import { jsonResult } from "openclaw/plugin-sdk/tool-results";
|
|
17
17
|
import { Type } from "typebox";
|
|
18
|
+
import { canonicalizeBase64, estimateBase64DecodedBytes, extensionForMime } from "openclaw/plugin-sdk/media-runtime";
|
|
18
19
|
import { readPositiveIntegerParam } from "openclaw/plugin-sdk/param-readers";
|
|
19
20
|
import { createClackPrompter } from "openclaw/plugin-sdk/setup-runtime";
|
|
20
21
|
//#region extensions/feishu/src/doc-schema.ts
|
|
@@ -232,7 +233,7 @@ function calculateAdaptiveColumnWidths(blocks, tableBlockId) {
|
|
|
232
233
|
const cellId = cellIds[row * column_size + col];
|
|
233
234
|
if (cellId) {
|
|
234
235
|
const length = getWeightedLength(getCellText(cellId));
|
|
235
|
-
maxLengths[col] = Math.max(maxLengths[col], length);
|
|
236
|
+
maxLengths[col] = Math.max(maxLengths[col] ?? 0, length);
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
239
|
const totalLength = maxLengths.reduce((a, b) => a + b, 0);
|
|
@@ -252,8 +253,10 @@ function calculateAdaptiveColumnWidths(blocks, tableBlockId) {
|
|
|
252
253
|
const perColumn = Math.floor(remaining / growable.length);
|
|
253
254
|
if (perColumn === 0) break;
|
|
254
255
|
for (const i of growable) {
|
|
255
|
-
const
|
|
256
|
-
|
|
256
|
+
const width = widths[i];
|
|
257
|
+
if (width === void 0) continue;
|
|
258
|
+
const add = Math.min(perColumn, MAX_COLUMN_WIDTH - width);
|
|
259
|
+
widths[i] = width + add;
|
|
257
260
|
remaining -= add;
|
|
258
261
|
}
|
|
259
262
|
}
|
|
@@ -471,8 +474,7 @@ async function insertBlocksInBatches(client, docToken, blocks, firstLevelBlockId
|
|
|
471
474
|
}
|
|
472
475
|
if (currentBatch.blocks.length > 0) batches.push(currentBatch);
|
|
473
476
|
let currentIndex = startIndex;
|
|
474
|
-
for (
|
|
475
|
-
const batch = batches[i];
|
|
477
|
+
for (const [i, batch] of batches.entries()) {
|
|
476
478
|
logger?.info?.(`feishu_doc: Inserting batch ${i + 1}/${batches.length} (${batch.blocks.length} blocks)...`);
|
|
477
479
|
const children = await insertBatch(client, docToken, batch.blocks, batch.firstLevelIds, parentBlockId, currentIndex);
|
|
478
480
|
allChildren.push(...children);
|
|
@@ -524,6 +526,7 @@ function parseColorMarkup(content) {
|
|
|
524
526
|
} else {
|
|
525
527
|
const tagStr = normalizeLowercaseStringOrEmpty(match[1]);
|
|
526
528
|
const text = match[2];
|
|
529
|
+
if (text === void 0) continue;
|
|
527
530
|
const tags = tagStr.split(/\s+/);
|
|
528
531
|
const segment = { text };
|
|
529
532
|
for (const tag of tags) if (tag.startsWith("bg:")) {
|
|
@@ -563,6 +566,249 @@ async function updateColorText(client, docToken, blockId, content) {
|
|
|
563
566
|
};
|
|
564
567
|
}
|
|
565
568
|
//#endregion
|
|
569
|
+
//#region extensions/feishu/src/docx-markdown.ts
|
|
570
|
+
const MAX_BREAK_PROBES = 32;
|
|
571
|
+
const STABLE_LINE_CONTAINER_TYPES = /* @__PURE__ */ new Set([
|
|
572
|
+
"list",
|
|
573
|
+
"blockquote",
|
|
574
|
+
"code"
|
|
575
|
+
]);
|
|
576
|
+
function visitMarkdown(root, visitor) {
|
|
577
|
+
const pending = [root];
|
|
578
|
+
while (pending.length > 0) {
|
|
579
|
+
const node = pending.pop();
|
|
580
|
+
if (!node) continue;
|
|
581
|
+
visitor(node);
|
|
582
|
+
if (!node.children) continue;
|
|
583
|
+
for (let index = node.children.length - 1; index >= 0; index -= 1) {
|
|
584
|
+
const child = node.children[index];
|
|
585
|
+
if (child) pending.push(child);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
function resolveRemoteImageUrl(value) {
|
|
590
|
+
if (!value) return;
|
|
591
|
+
try {
|
|
592
|
+
const url = new URL(value);
|
|
593
|
+
return url.protocol === "http:" || url.protocol === "https:" ? value : void 0;
|
|
594
|
+
} catch {
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
function collectMarkdownImages(root) {
|
|
599
|
+
const definitions = /* @__PURE__ */ new Map();
|
|
600
|
+
visitMarkdown(root, (node) => {
|
|
601
|
+
if (node.type !== "definition" || !node.identifier || !node.url) return;
|
|
602
|
+
if (!definitions.has(node.identifier)) definitions.set(node.identifier, node.url);
|
|
603
|
+
});
|
|
604
|
+
const images = [];
|
|
605
|
+
visitMarkdown(root, (node) => {
|
|
606
|
+
if (node.type === "image") {
|
|
607
|
+
images.push({ url: resolveRemoteImageUrl(node.url) });
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
if (node.type === "imageReference") images.push({ url: resolveRemoteImageUrl(node.identifier ? definitions.get(node.identifier) : void 0) });
|
|
611
|
+
});
|
|
612
|
+
return images;
|
|
613
|
+
}
|
|
614
|
+
function splitSourceAtOffsets(source, offsets) {
|
|
615
|
+
const chunks = [];
|
|
616
|
+
let start = 0;
|
|
617
|
+
for (const offset of offsets) {
|
|
618
|
+
if (offset <= start || offset >= source.length) continue;
|
|
619
|
+
chunks.push(source.slice(start, offset));
|
|
620
|
+
start = offset;
|
|
621
|
+
}
|
|
622
|
+
chunks.push(source.slice(start));
|
|
623
|
+
return chunks;
|
|
624
|
+
}
|
|
625
|
+
function headingOffsets(source, root) {
|
|
626
|
+
const offsets = [];
|
|
627
|
+
for (const node of root.children ?? []) {
|
|
628
|
+
if (node.type !== "heading" || node.depth === void 0 || node.depth > 2) continue;
|
|
629
|
+
const offset = node.position?.start.offset;
|
|
630
|
+
if (offset !== void 0 && source[offset] === "#") offsets.push(offset);
|
|
631
|
+
}
|
|
632
|
+
return offsets;
|
|
633
|
+
}
|
|
634
|
+
function blockBreakOffsets(root) {
|
|
635
|
+
const offsets = [];
|
|
636
|
+
for (const block of root.children ?? []) {
|
|
637
|
+
const blockStart = block.position?.start.offset;
|
|
638
|
+
if (blockStart !== void 0 && blockStart > 0) offsets.push(blockStart);
|
|
639
|
+
}
|
|
640
|
+
return offsets;
|
|
641
|
+
}
|
|
642
|
+
function paragraphBreakOffsets(source, root) {
|
|
643
|
+
const offsets = [];
|
|
644
|
+
for (const block of root.children ?? []) {
|
|
645
|
+
if (block.type !== "paragraph") continue;
|
|
646
|
+
for (const child of block.children ?? []) {
|
|
647
|
+
if (child.type !== "text") continue;
|
|
648
|
+
const start = child.position?.start.offset;
|
|
649
|
+
const end = child.position?.end.offset;
|
|
650
|
+
if (start === void 0 || end === void 0) continue;
|
|
651
|
+
for (let offset = start; offset < end; offset += 1) {
|
|
652
|
+
const char = source[offset];
|
|
653
|
+
if (char === " " || char === " " || char === "\n" || char === "\r") offsets.push(offset + 1);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
return offsets;
|
|
658
|
+
}
|
|
659
|
+
function lineBreakOffsets(source) {
|
|
660
|
+
const offsets = [];
|
|
661
|
+
for (let offset = 0; offset < source.length; offset += 1) if (source[offset] === "\n" && offset + 1 < source.length) offsets.push(offset + 1);
|
|
662
|
+
return offsets;
|
|
663
|
+
}
|
|
664
|
+
function nearestOffset(offsets, target, sourceLength) {
|
|
665
|
+
return offsets.filter((offset) => offset > 0 && offset < sourceLength).toSorted((left, right) => Math.abs(left - target) - Math.abs(right - target) || left - right);
|
|
666
|
+
}
|
|
667
|
+
function isStableParagraphBreak(source, offset) {
|
|
668
|
+
const before = parseFeishuMarkdown(source.slice(0, offset)).children?.at(-1);
|
|
669
|
+
const after = parseFeishuMarkdown(source.slice(offset)).children?.[0];
|
|
670
|
+
return before?.type === "paragraph" && after?.type === "paragraph";
|
|
671
|
+
}
|
|
672
|
+
function isStableContainerBreak(source, offset, containerType) {
|
|
673
|
+
const before = parseFeishuMarkdown(source.slice(0, offset)).children;
|
|
674
|
+
const after = parseFeishuMarkdown(source.slice(offset)).children;
|
|
675
|
+
return before?.length === 1 && after?.length === 1 && before[0]?.type === containerType && after[0]?.type === containerType;
|
|
676
|
+
}
|
|
677
|
+
function splitTableAtRow(source, root, target) {
|
|
678
|
+
const table = root.children?.length === 1 ? root.children[0] : void 0;
|
|
679
|
+
if (table?.type !== "table") return;
|
|
680
|
+
const rows = table.children ?? [];
|
|
681
|
+
const firstBodyOffset = rows[1]?.position?.start.offset;
|
|
682
|
+
const splitOffset = nearestOffset(rows.slice(2).map((row) => row.position?.start.offset).filter((offset) => offset !== void 0), target, source.length)[0];
|
|
683
|
+
if (firstBodyOffset === void 0 || splitOffset === void 0) return;
|
|
684
|
+
const tableStart = table.position?.start.offset ?? 0;
|
|
685
|
+
const repeatedHeader = source.slice(tableStart, firstBodyOffset);
|
|
686
|
+
const chunks = [source.slice(0, splitOffset), `${repeatedHeader}${source.slice(splitOffset)}`];
|
|
687
|
+
if (chunks.every((chunk) => parseFeishuMarkdown(chunk).children?.[0]?.type === "table")) return chunks;
|
|
688
|
+
}
|
|
689
|
+
function isFencedCodeSource(source) {
|
|
690
|
+
const firstLineEnd = source.indexOf("\n");
|
|
691
|
+
const firstLine = source.slice(0, firstLineEnd === -1 ? source.length : firstLineEnd);
|
|
692
|
+
let indent = 0;
|
|
693
|
+
while (indent < firstLine.length && firstLine[indent] === " ") indent += 1;
|
|
694
|
+
if (indent > 3) return false;
|
|
695
|
+
const marker = firstLine.slice(indent);
|
|
696
|
+
return marker.startsWith("```") || marker.startsWith("~~~");
|
|
697
|
+
}
|
|
698
|
+
function createDocxMarkdownChunk(markdown) {
|
|
699
|
+
return {
|
|
700
|
+
markdown,
|
|
701
|
+
images: collectMarkdownImages(parseFeishuMarkdown(markdown))
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
function createDocxMarkdownPlan(markdown) {
|
|
705
|
+
return { chunks: splitSourceAtOffsets(markdown, headingOffsets(markdown, parseFeishuMarkdown(markdown))).map(createDocxMarkdownChunk) };
|
|
706
|
+
}
|
|
707
|
+
function splitDocxMarkdownBySize(markdown, maxChars) {
|
|
708
|
+
if (markdown.length <= maxChars) return [markdown];
|
|
709
|
+
const root = parseFeishuMarkdown(markdown);
|
|
710
|
+
const target = Math.min(markdown.length - 1, Math.max(1, maxChars));
|
|
711
|
+
const splitOffset = nearestOffset(blockBreakOffsets(root), target, markdown.length)[0];
|
|
712
|
+
if (splitOffset !== void 0) return [markdown.slice(0, splitOffset), markdown.slice(splitOffset)];
|
|
713
|
+
const paragraphOffset = nearestOffset(paragraphBreakOffsets(markdown, root), target, markdown.length).slice(0, MAX_BREAK_PROBES).find((offset) => isStableParagraphBreak(markdown, offset));
|
|
714
|
+
if (paragraphOffset !== void 0) return [markdown.slice(0, paragraphOffset), markdown.slice(paragraphOffset)];
|
|
715
|
+
if (root.children?.length === 1 && root.children[0]?.type === "code" && isFencedCodeSource(markdown)) return chunkFeishuMarkdown(markdown, maxChars);
|
|
716
|
+
const tableChunks = splitTableAtRow(markdown, root, target);
|
|
717
|
+
if (tableChunks) return tableChunks;
|
|
718
|
+
const containerType = root.children?.length === 1 ? root.children[0]?.type : void 0;
|
|
719
|
+
if (containerType && STABLE_LINE_CONTAINER_TYPES.has(containerType)) {
|
|
720
|
+
const containerOffset = nearestOffset(lineBreakOffsets(markdown), target, markdown.length).slice(0, MAX_BREAK_PROBES).find((offset) => isStableContainerBreak(markdown, offset, containerType));
|
|
721
|
+
if (containerOffset !== void 0) return [markdown.slice(0, containerOffset), markdown.slice(containerOffset)];
|
|
722
|
+
}
|
|
723
|
+
return [markdown];
|
|
724
|
+
}
|
|
725
|
+
//#endregion
|
|
726
|
+
//#region extensions/feishu/src/docx-upload-input.ts
|
|
727
|
+
function decodeBase64Image(params) {
|
|
728
|
+
const estimatedBytes = estimateBase64DecodedBytes(params.payload);
|
|
729
|
+
if (estimatedBytes > params.maxBytes) throw new Error(`${params.oversizedLabel} exceeds limit: estimated ${estimatedBytes} bytes > ${params.maxBytes} bytes`);
|
|
730
|
+
const canonical = canonicalizeBase64(params.payload);
|
|
731
|
+
if (!canonical) throw new Error(params.invalidMessage);
|
|
732
|
+
return Buffer.from(canonical, "base64");
|
|
733
|
+
}
|
|
734
|
+
function resolveDataUriImage(image, maxBytes, fileName) {
|
|
735
|
+
const commaIndex = image.indexOf(",");
|
|
736
|
+
if (commaIndex === -1) throw new Error("Invalid data URI: missing comma separator.");
|
|
737
|
+
const metadata = image.slice(5, commaIndex).split(";");
|
|
738
|
+
if (!metadata.slice(1).map((value) => value.trim().toLowerCase()).includes("base64")) throw new Error("Invalid data URI: missing ';base64' marker. Expected format: data:image/png;base64,<base64data>");
|
|
739
|
+
const buffer = decodeBase64Image({
|
|
740
|
+
payload: image.slice(commaIndex + 1),
|
|
741
|
+
maxBytes,
|
|
742
|
+
invalidMessage: "Invalid data URI: base64 payload is malformed.",
|
|
743
|
+
oversizedLabel: "Image data URI"
|
|
744
|
+
});
|
|
745
|
+
const mime = metadata[0]?.trim();
|
|
746
|
+
const extension = extensionForMime(mime)?.slice(1) ?? "png";
|
|
747
|
+
return {
|
|
748
|
+
buffer,
|
|
749
|
+
fileName: fileName ?? `image.${extension}`
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
async function resolveLocalUpload(filePath, maxBytes, localRoots, fileName) {
|
|
753
|
+
return {
|
|
754
|
+
buffer: (await getFeishuRuntime().media.loadWebMedia(resolve(filePath), {
|
|
755
|
+
maxBytes,
|
|
756
|
+
optimizeImages: false,
|
|
757
|
+
localRoots
|
|
758
|
+
})).buffer,
|
|
759
|
+
fileName: fileName ?? basename(filePath)
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
function resolveImageLocalPath(image) {
|
|
763
|
+
const candidate = image.startsWith("~") ? `${homedir()}${image.slice(1)}` : image;
|
|
764
|
+
const unambiguousPath = image.startsWith("~") || image.startsWith("./") || image.startsWith("../");
|
|
765
|
+
const absolutePath = isAbsolute(image);
|
|
766
|
+
if (unambiguousPath || absolutePath && existsSync(candidate)) return candidate;
|
|
767
|
+
if (absolutePath) throw new Error(`File not found: "${candidate}". If you intended to pass image binary data, use a data URI instead: data:image/jpeg;base64,...`);
|
|
768
|
+
}
|
|
769
|
+
async function resolveRemoteUpload(input) {
|
|
770
|
+
const fetched = await getFeishuRuntime().channel.media.readRemoteMediaBuffer({
|
|
771
|
+
url: input.url,
|
|
772
|
+
maxBytes: input.maxBytes,
|
|
773
|
+
...input.remoteReadTimeoutMs !== void 0 ? {
|
|
774
|
+
responseHeaderTimeoutMs: input.remoteReadTimeoutMs,
|
|
775
|
+
readIdleTimeoutMs: input.remoteReadTimeoutMs
|
|
776
|
+
} : {}
|
|
777
|
+
});
|
|
778
|
+
const urlFileName = new URL(input.url).pathname.split("/").pop() || "upload.bin";
|
|
779
|
+
return {
|
|
780
|
+
buffer: fetched.buffer,
|
|
781
|
+
fileName: input.fileName ?? fetched.fileName ?? urlFileName
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
async function resolveDocxUploadInput(input) {
|
|
785
|
+
const sources = [
|
|
786
|
+
input.url && "url",
|
|
787
|
+
input.filePath && "file_path",
|
|
788
|
+
input.image && "image"
|
|
789
|
+
].filter((source) => Boolean(source));
|
|
790
|
+
if (sources.length !== 1) throw new Error(sources.length === 0 ? "Either url, file_path, or image (base64/data URI) must be provided" : `Provide only one upload source; got: ${sources.join(", ")}`);
|
|
791
|
+
if (input.url) return await resolveRemoteUpload({
|
|
792
|
+
...input,
|
|
793
|
+
url: input.url
|
|
794
|
+
});
|
|
795
|
+
if (input.filePath) return await resolveLocalUpload(input.filePath, input.maxBytes, input.localRoots, input.fileName);
|
|
796
|
+
const image = input.image;
|
|
797
|
+
if (!image) throw new Error("Image input must not be empty");
|
|
798
|
+
if (image.startsWith("data:")) return resolveDataUriImage(image, input.maxBytes, input.fileName);
|
|
799
|
+
const localPath = resolveImageLocalPath(image);
|
|
800
|
+
if (localPath) return await resolveLocalUpload(localPath, input.maxBytes, input.localRoots, input.fileName);
|
|
801
|
+
return {
|
|
802
|
+
buffer: decodeBase64Image({
|
|
803
|
+
payload: image,
|
|
804
|
+
maxBytes: input.maxBytes,
|
|
805
|
+
invalidMessage: "Invalid base64: image input is malformed. Use a data URI (data:image/png;base64,...) or a local file path instead.",
|
|
806
|
+
oversizedLabel: "Base64 image"
|
|
807
|
+
}),
|
|
808
|
+
fileName: input.fileName ?? "image.png"
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
//#endregion
|
|
566
812
|
//#region extensions/feishu/src/docx.ts
|
|
567
813
|
function resolveDocToolLocalRoots(ctx) {
|
|
568
814
|
if (ctx.fsPolicy?.workspaceOnly !== true) return;
|
|
@@ -570,17 +816,6 @@ function resolveDocToolLocalRoots(ctx) {
|
|
|
570
816
|
if (!workspaceDir) return [];
|
|
571
817
|
return [resolve(workspaceDir)];
|
|
572
818
|
}
|
|
573
|
-
/** Extract image URLs from markdown content */
|
|
574
|
-
function extractImageUrls(markdown) {
|
|
575
|
-
const regex = /!\[[^\]]*\]\(([^)]+)\)/g;
|
|
576
|
-
const urls = [];
|
|
577
|
-
let match;
|
|
578
|
-
while ((match = regex.exec(markdown)) !== null) {
|
|
579
|
-
const url = match[1].trim();
|
|
580
|
-
if (url.startsWith("http://") || url.startsWith("https://")) urls.push(url);
|
|
581
|
-
}
|
|
582
|
-
return urls;
|
|
583
|
-
}
|
|
584
819
|
const BLOCK_TYPE_NAMES = {
|
|
585
820
|
1: "Page",
|
|
586
821
|
2: "Text",
|
|
@@ -721,83 +956,49 @@ async function insertBlocks(client, docToken, blocks, parentBlockId, index) {
|
|
|
721
956
|
skipped
|
|
722
957
|
};
|
|
723
958
|
}
|
|
724
|
-
|
|
725
|
-
function splitMarkdownByHeadings(markdown) {
|
|
726
|
-
const lines = markdown.split("\n");
|
|
727
|
-
const chunks = [];
|
|
728
|
-
let current = [];
|
|
729
|
-
let inFencedBlock = false;
|
|
730
|
-
for (const line of lines) {
|
|
731
|
-
if (/^(`{3,}|~{3,})/.test(line)) inFencedBlock = !inFencedBlock;
|
|
732
|
-
if (!inFencedBlock && /^#{1,2}\s/.test(line) && current.length > 0) {
|
|
733
|
-
chunks.push(current.join("\n"));
|
|
734
|
-
current = [];
|
|
735
|
-
}
|
|
736
|
-
current.push(line);
|
|
737
|
-
}
|
|
738
|
-
if (current.length > 0) chunks.push(current.join("\n"));
|
|
739
|
-
return chunks;
|
|
740
|
-
}
|
|
741
|
-
/** Split markdown by size, preferring to break outside fenced code blocks when possible */
|
|
742
|
-
function splitMarkdownBySize(markdown, maxChars) {
|
|
743
|
-
if (markdown.length <= maxChars) return [markdown];
|
|
744
|
-
const lines = markdown.split("\n");
|
|
745
|
-
const chunks = [];
|
|
746
|
-
let current = [];
|
|
747
|
-
let currentLength = 0;
|
|
748
|
-
let inFencedBlock = false;
|
|
749
|
-
for (const line of lines) {
|
|
750
|
-
if (/^(`{3,}|~{3,})/.test(line)) inFencedBlock = !inFencedBlock;
|
|
751
|
-
const lineLength = line.length + 1;
|
|
752
|
-
const wouldExceed = currentLength + lineLength > maxChars;
|
|
753
|
-
if (current.length > 0 && wouldExceed && !inFencedBlock) {
|
|
754
|
-
chunks.push(current.join("\n"));
|
|
755
|
-
current = [];
|
|
756
|
-
currentLength = 0;
|
|
757
|
-
}
|
|
758
|
-
current.push(line);
|
|
759
|
-
currentLength += lineLength;
|
|
760
|
-
}
|
|
761
|
-
if (current.length > 0) chunks.push(current.join("\n"));
|
|
762
|
-
if (chunks.length > 1) return chunks;
|
|
763
|
-
const midpoint = Math.floor(lines.length / 2);
|
|
764
|
-
if (midpoint <= 0 || midpoint >= lines.length) return [markdown];
|
|
765
|
-
return [lines.slice(0, midpoint).join("\n"), lines.slice(midpoint).join("\n")];
|
|
766
|
-
}
|
|
767
|
-
async function convertMarkdownWithFallback(client, markdown, depth = 0) {
|
|
959
|
+
async function convertMarkdownWithFallback(client, chunk, depth = 0) {
|
|
768
960
|
try {
|
|
769
|
-
return
|
|
961
|
+
return {
|
|
962
|
+
...await convertMarkdown(client, chunk.markdown),
|
|
963
|
+
images: chunk.images
|
|
964
|
+
};
|
|
770
965
|
} catch (error) {
|
|
771
|
-
if (depth >= MAX_CONVERT_RETRY_DEPTH || markdown.length < 2) throw error;
|
|
772
|
-
const
|
|
966
|
+
if (depth >= MAX_CONVERT_RETRY_DEPTH || chunk.markdown.length < 2) throw error;
|
|
967
|
+
const splitTarget = Math.max(256, Math.floor(chunk.markdown.length / 2));
|
|
968
|
+
const chunks = splitDocxMarkdownBySize(chunk.markdown, splitTarget).map(createDocxMarkdownChunk);
|
|
773
969
|
if (chunks.length <= 1) throw error;
|
|
774
970
|
const blocks = [];
|
|
775
971
|
const firstLevelBlockIds = [];
|
|
776
|
-
|
|
777
|
-
|
|
972
|
+
const images = [];
|
|
973
|
+
for (const fallbackChunk of chunks) {
|
|
974
|
+
const converted = await convertMarkdownWithFallback(client, fallbackChunk, depth + 1);
|
|
778
975
|
blocks.push(...converted.blocks);
|
|
779
976
|
firstLevelBlockIds.push(...converted.firstLevelBlockIds);
|
|
977
|
+
images.push(...converted.images);
|
|
780
978
|
}
|
|
781
979
|
return {
|
|
782
980
|
blocks,
|
|
783
|
-
firstLevelBlockIds
|
|
981
|
+
firstLevelBlockIds,
|
|
982
|
+
images
|
|
784
983
|
};
|
|
785
984
|
}
|
|
786
985
|
}
|
|
787
986
|
/** Convert markdown in chunks to avoid document.convert content size limits */
|
|
788
|
-
async function chunkedConvertMarkdown(client,
|
|
789
|
-
const chunks = splitMarkdownByHeadings(markdown);
|
|
987
|
+
async function chunkedConvertMarkdown(client, chunks) {
|
|
790
988
|
const allBlocks = [];
|
|
791
989
|
const allRootIds = [];
|
|
990
|
+
const allImages = [];
|
|
792
991
|
for (const chunk of chunks) {
|
|
793
|
-
const { blocks, firstLevelBlockIds } = await convertMarkdownWithFallback(client, chunk);
|
|
992
|
+
const { blocks, firstLevelBlockIds, images } = await convertMarkdownWithFallback(client, chunk);
|
|
794
993
|
const { orderedBlocks, rootIds } = normalizeConvertedBlockTree(blocks, firstLevelBlockIds);
|
|
795
994
|
allBlocks.push(...orderedBlocks);
|
|
796
995
|
allRootIds.push(...rootIds);
|
|
996
|
+
allImages.push(...images);
|
|
797
997
|
}
|
|
798
998
|
return {
|
|
799
999
|
blocks: allBlocks,
|
|
800
|
-
firstLevelBlockIds: allRootIds
|
|
1000
|
+
firstLevelBlockIds: allRootIds,
|
|
1001
|
+
images: allImages
|
|
801
1002
|
};
|
|
802
1003
|
}
|
|
803
1004
|
/**
|
|
@@ -855,98 +1056,21 @@ async function uploadImageToDocx(client, blockId, imageBuffer, fileName, docToke
|
|
|
855
1056
|
if (!fileToken) throw new Error("Image upload failed: no file_token returned");
|
|
856
1057
|
return fileToken;
|
|
857
1058
|
}
|
|
858
|
-
async function
|
|
859
|
-
|
|
860
|
-
url,
|
|
861
|
-
maxBytes
|
|
862
|
-
})).buffer;
|
|
863
|
-
}
|
|
864
|
-
async function resolveUploadInput(url, filePath, maxBytes, localRoots, explicitFileName, imageInput) {
|
|
865
|
-
const inputSources = [
|
|
866
|
-
url ? "url" : null,
|
|
867
|
-
filePath ? "file_path" : null,
|
|
868
|
-
imageInput ? "image" : null
|
|
869
|
-
].filter(Boolean);
|
|
870
|
-
if (inputSources.length > 1) throw new Error(`Provide only one image source; got: ${inputSources.join(", ")}`);
|
|
871
|
-
if (imageInput?.startsWith("data:")) {
|
|
872
|
-
const commaIdx = imageInput.indexOf(",");
|
|
873
|
-
if (commaIdx === -1) throw new Error("Invalid data URI: missing comma separator.");
|
|
874
|
-
const header = imageInput.slice(0, commaIdx);
|
|
875
|
-
const data = imageInput.slice(commaIdx + 1);
|
|
876
|
-
if (!header.includes(";base64")) throw new Error("Invalid data URI: missing ';base64' marker. Expected format: data:image/png;base64,<base64data>");
|
|
877
|
-
const trimmedData = data.trim();
|
|
878
|
-
if (trimmedData.length === 0 || !/^[A-Za-z0-9+/]+=*$/.test(trimmedData)) throw new Error(`Invalid data URI: base64 payload contains characters outside the standard alphabet.`);
|
|
879
|
-
const ext = extensionForMime(header.match(/data:([^;]+)/)?.[1])?.slice(1) ?? "png";
|
|
880
|
-
const estimatedBytes = Math.ceil(trimmedData.length * 3 / 4);
|
|
881
|
-
if (estimatedBytes > maxBytes) throw new Error(`Image data URI exceeds limit: estimated ${estimatedBytes} bytes > ${maxBytes} bytes`);
|
|
882
|
-
return {
|
|
883
|
-
buffer: Buffer.from(trimmedData, "base64"),
|
|
884
|
-
fileName: explicitFileName ?? `image.${ext}`
|
|
885
|
-
};
|
|
886
|
-
}
|
|
887
|
-
if (imageInput) {
|
|
888
|
-
const candidate = imageInput.startsWith("~") ? imageInput.replace(/^~/, homedir()) : imageInput;
|
|
889
|
-
const unambiguousPath = imageInput.startsWith("~") || imageInput.startsWith("./") || imageInput.startsWith("../");
|
|
890
|
-
const absolutePath = isAbsolute(imageInput);
|
|
891
|
-
if (unambiguousPath || absolutePath && existsSync(candidate)) {
|
|
892
|
-
const resolvedPath = resolve(candidate);
|
|
893
|
-
return {
|
|
894
|
-
buffer: (await getFeishuRuntime().media.loadWebMedia(resolvedPath, {
|
|
895
|
-
maxBytes,
|
|
896
|
-
optimizeImages: false,
|
|
897
|
-
localRoots
|
|
898
|
-
})).buffer,
|
|
899
|
-
fileName: explicitFileName ?? basename(candidate)
|
|
900
|
-
};
|
|
901
|
-
}
|
|
902
|
-
if (absolutePath && !existsSync(candidate)) throw new Error(`File not found: "${candidate}". If you intended to pass image binary data, use a data URI instead: data:image/jpeg;base64,...`);
|
|
903
|
-
}
|
|
904
|
-
if (imageInput) {
|
|
905
|
-
const trimmed = imageInput.trim();
|
|
906
|
-
if (trimmed.length === 0 || !/^[A-Za-z0-9+/]+=*$/.test(trimmed)) throw new Error("Invalid base64: image input contains characters outside the standard base64 alphabet. Use a data URI (data:image/png;base64,...) or a local file path instead.");
|
|
907
|
-
const estimatedBytes = Math.ceil(trimmed.length * 3 / 4);
|
|
908
|
-
if (estimatedBytes > maxBytes) throw new Error(`Base64 image exceeds limit: estimated ${estimatedBytes} bytes > ${maxBytes} bytes`);
|
|
909
|
-
const buffer = Buffer.from(trimmed, "base64");
|
|
910
|
-
if (buffer.length === 0) throw new Error("Base64 image decoded to empty buffer; check the input.");
|
|
911
|
-
return {
|
|
912
|
-
buffer,
|
|
913
|
-
fileName: explicitFileName ?? "image.png"
|
|
914
|
-
};
|
|
915
|
-
}
|
|
916
|
-
if (!url && !filePath) throw new Error("Either url, file_path, or image (base64/data URI) must be provided");
|
|
917
|
-
if (url && filePath) throw new Error("Provide only one of url or file_path");
|
|
918
|
-
if (url) {
|
|
919
|
-
const fetched = await getFeishuRuntime().channel.media.readRemoteMediaBuffer({
|
|
920
|
-
url,
|
|
921
|
-
maxBytes
|
|
922
|
-
});
|
|
923
|
-
const guessed = new URL(url).pathname.split("/").pop() || "upload.bin";
|
|
924
|
-
return {
|
|
925
|
-
buffer: fetched.buffer,
|
|
926
|
-
fileName: explicitFileName || guessed
|
|
927
|
-
};
|
|
928
|
-
}
|
|
929
|
-
const resolvedFilePath = resolve(filePath);
|
|
930
|
-
return {
|
|
931
|
-
buffer: (await getFeishuRuntime().media.loadWebMedia(resolvedFilePath, {
|
|
932
|
-
maxBytes,
|
|
933
|
-
optimizeImages: false,
|
|
934
|
-
localRoots
|
|
935
|
-
})).buffer,
|
|
936
|
-
fileName: explicitFileName || basename(filePath)
|
|
937
|
-
};
|
|
938
|
-
}
|
|
939
|
-
async function processImages(client, docToken, markdown, insertedBlocks, maxBytes) {
|
|
940
|
-
const imageUrls = extractImageUrls(markdown);
|
|
941
|
-
if (imageUrls.length === 0) return 0;
|
|
1059
|
+
async function processImages(client, docToken, images, insertedBlocks, maxBytes, imageReadTimeoutMs) {
|
|
1060
|
+
if (images.length === 0) return 0;
|
|
942
1061
|
const imageBlocks = insertedBlocks.filter((b) => b.block_type === 27);
|
|
943
1062
|
let processed = 0;
|
|
944
|
-
for (let i = 0; i < Math.min(
|
|
945
|
-
const url =
|
|
1063
|
+
for (let i = 0; i < Math.min(images.length, imageBlocks.length); i++) {
|
|
1064
|
+
const url = images[i]?.url;
|
|
946
1065
|
const blockId = imageBlocks[i]?.block_id;
|
|
947
|
-
if (!blockId) continue;
|
|
1066
|
+
if (!url || !blockId) continue;
|
|
948
1067
|
try {
|
|
949
|
-
const
|
|
1068
|
+
const upload = await resolveDocxUploadInput({
|
|
1069
|
+
url,
|
|
1070
|
+
maxBytes,
|
|
1071
|
+
remoteReadTimeoutMs: imageReadTimeoutMs
|
|
1072
|
+
});
|
|
1073
|
+
const fileToken = await uploadImageToDocx(client, blockId, upload.buffer, upload.fileName, docToken);
|
|
950
1074
|
await client.docx.documentBlock.patch({
|
|
951
1075
|
path: {
|
|
952
1076
|
document_id: docToken,
|
|
@@ -961,7 +1085,16 @@ async function processImages(client, docToken, markdown, insertedBlocks, maxByte
|
|
|
961
1085
|
}
|
|
962
1086
|
return processed;
|
|
963
1087
|
}
|
|
964
|
-
async function uploadImageBlock(client, docToken, maxBytes, localRoots, url, filePath, parentBlockId, filename, index, imageInput) {
|
|
1088
|
+
async function uploadImageBlock(client, docToken, maxBytes, imageReadTimeoutMs, localRoots, url, filePath, parentBlockId, filename, index, imageInput) {
|
|
1089
|
+
const upload = await resolveDocxUploadInput({
|
|
1090
|
+
url,
|
|
1091
|
+
filePath,
|
|
1092
|
+
image: imageInput,
|
|
1093
|
+
maxBytes,
|
|
1094
|
+
localRoots,
|
|
1095
|
+
fileName: filename,
|
|
1096
|
+
remoteReadTimeoutMs: imageReadTimeoutMs
|
|
1097
|
+
});
|
|
965
1098
|
const insertRes = await client.docx.documentBlockChildren.create({
|
|
966
1099
|
path: {
|
|
967
1100
|
document_id: docToken,
|
|
@@ -979,7 +1112,6 @@ async function uploadImageBlock(client, docToken, maxBytes, localRoots, url, fil
|
|
|
979
1112
|
if (insertRes.code !== 0) throw new Error(`Failed to create image block: ${insertRes.msg}`);
|
|
980
1113
|
const imageBlockId = insertRes.data?.children?.find((b) => b.block_type === 27)?.block_id;
|
|
981
1114
|
if (!imageBlockId) throw new Error("Failed to create image block");
|
|
982
|
-
const upload = await resolveUploadInput(url, filePath, maxBytes, localRoots, filename, imageInput);
|
|
983
1115
|
const fileToken = await uploadImageToDocx(client, imageBlockId, upload.buffer, upload.fileName, docToken);
|
|
984
1116
|
const patchRes = await client.docx.documentBlock.patch({
|
|
985
1117
|
path: {
|
|
@@ -999,8 +1131,14 @@ async function uploadImageBlock(client, docToken, maxBytes, localRoots, url, fil
|
|
|
999
1131
|
}
|
|
1000
1132
|
async function uploadFileBlock(client, docToken, maxBytes, localRoots, url, filePath, parentBlockId, filename) {
|
|
1001
1133
|
const blockId = parentBlockId ?? docToken;
|
|
1002
|
-
const upload = await
|
|
1003
|
-
|
|
1134
|
+
const upload = await resolveDocxUploadInput({
|
|
1135
|
+
url,
|
|
1136
|
+
filePath,
|
|
1137
|
+
maxBytes,
|
|
1138
|
+
localRoots,
|
|
1139
|
+
fileName: filename
|
|
1140
|
+
});
|
|
1141
|
+
const converted = await convertMarkdown(client, "[file](https://example.com/placeholder)");
|
|
1004
1142
|
const { orderedBlocks } = normalizeConvertedBlockTree(converted.blocks, converted.firstLevelBlockIds);
|
|
1005
1143
|
const { children: inserted } = await insertBlocks(client, docToken, orderedBlocks, blockId);
|
|
1006
1144
|
const placeholderBlock = inserted[0];
|
|
@@ -1124,10 +1262,11 @@ async function createDoc(client, title, folderToken, options) {
|
|
|
1124
1262
|
}
|
|
1125
1263
|
};
|
|
1126
1264
|
}
|
|
1127
|
-
async function writeDoc(client, docToken, markdown, maxBytes, logger) {
|
|
1128
|
-
const
|
|
1265
|
+
async function writeDoc(client, docToken, markdown, maxBytes, imageReadTimeoutMs, logger) {
|
|
1266
|
+
const markdownPlan = createDocxMarkdownPlan(markdown);
|
|
1129
1267
|
logger?.info?.("feishu_doc: Converting markdown...");
|
|
1130
|
-
const { blocks, firstLevelBlockIds } = await chunkedConvertMarkdown(client,
|
|
1268
|
+
const { blocks, firstLevelBlockIds, images } = await chunkedConvertMarkdown(client, markdownPlan.chunks);
|
|
1269
|
+
const deleted = await clearDocumentContent(client, docToken);
|
|
1131
1270
|
if (blocks.length === 0) return {
|
|
1132
1271
|
success: true,
|
|
1133
1272
|
blocks_deleted: deleted,
|
|
@@ -1137,7 +1276,7 @@ async function writeDoc(client, docToken, markdown, maxBytes, logger) {
|
|
|
1137
1276
|
logger?.info?.(`feishu_doc: Converted to ${blocks.length} blocks, inserting...`);
|
|
1138
1277
|
const { orderedBlocks, rootIds } = normalizeConvertedBlockTree(blocks, firstLevelBlockIds);
|
|
1139
1278
|
const { children: inserted } = blocks.length > 1e3 ? await insertBlocksInBatches(client, docToken, orderedBlocks, rootIds, logger) : await insertBlocksWithDescendant(client, docToken, orderedBlocks, rootIds);
|
|
1140
|
-
const imagesProcessed = await processImages(client, docToken,
|
|
1279
|
+
const imagesProcessed = await processImages(client, docToken, images, inserted, maxBytes, imageReadTimeoutMs);
|
|
1141
1280
|
logger?.info?.(`feishu_doc: Done (${blocks.length} blocks, ${imagesProcessed} images)`);
|
|
1142
1281
|
return {
|
|
1143
1282
|
success: true,
|
|
@@ -1146,14 +1285,15 @@ async function writeDoc(client, docToken, markdown, maxBytes, logger) {
|
|
|
1146
1285
|
images_processed: imagesProcessed
|
|
1147
1286
|
};
|
|
1148
1287
|
}
|
|
1149
|
-
async function appendDoc(client, docToken, markdown, maxBytes, logger) {
|
|
1288
|
+
async function appendDoc(client, docToken, markdown, maxBytes, imageReadTimeoutMs, logger) {
|
|
1289
|
+
const markdownPlan = createDocxMarkdownPlan(markdown);
|
|
1150
1290
|
logger?.info?.("feishu_doc: Converting markdown...");
|
|
1151
|
-
const { blocks, firstLevelBlockIds } = await chunkedConvertMarkdown(client,
|
|
1291
|
+
const { blocks, firstLevelBlockIds, images } = await chunkedConvertMarkdown(client, markdownPlan.chunks);
|
|
1152
1292
|
if (blocks.length === 0) throw new Error("Content is empty");
|
|
1153
1293
|
logger?.info?.(`feishu_doc: Converted to ${blocks.length} blocks, inserting...`);
|
|
1154
1294
|
const { orderedBlocks, rootIds } = normalizeConvertedBlockTree(blocks, firstLevelBlockIds);
|
|
1155
1295
|
const { children: inserted } = blocks.length > 1e3 ? await insertBlocksInBatches(client, docToken, orderedBlocks, rootIds, logger) : await insertBlocksWithDescendant(client, docToken, orderedBlocks, rootIds);
|
|
1156
|
-
const imagesProcessed = await processImages(client, docToken,
|
|
1296
|
+
const imagesProcessed = await processImages(client, docToken, images, inserted, maxBytes, imageReadTimeoutMs);
|
|
1157
1297
|
logger?.info?.(`feishu_doc: Done (${blocks.length} blocks, ${imagesProcessed} images)`);
|
|
1158
1298
|
return {
|
|
1159
1299
|
success: true,
|
|
@@ -1162,7 +1302,8 @@ async function appendDoc(client, docToken, markdown, maxBytes, logger) {
|
|
|
1162
1302
|
block_ids: inserted.map((b) => b.block_id)
|
|
1163
1303
|
};
|
|
1164
1304
|
}
|
|
1165
|
-
async function insertDoc(client, docToken, markdown, afterBlockId, maxBytes, logger) {
|
|
1305
|
+
async function insertDoc(client, docToken, markdown, afterBlockId, maxBytes, imageReadTimeoutMs, logger) {
|
|
1306
|
+
const markdownPlan = createDocxMarkdownPlan(markdown);
|
|
1166
1307
|
const blockInfo = await client.docx.documentBlock.get({ path: {
|
|
1167
1308
|
document_id: docToken,
|
|
1168
1309
|
block_id: afterBlockId
|
|
@@ -1187,7 +1328,7 @@ async function insertDoc(client, docToken, markdown, afterBlockId, maxBytes, log
|
|
|
1187
1328
|
if (blockIndex === -1) throw new Error(`after_block_id "${afterBlockId}" was not found among the children of parent block "${parentId}". Use list_blocks to verify the block ID.`);
|
|
1188
1329
|
const insertIndex = blockIndex + 1;
|
|
1189
1330
|
logger?.info?.("feishu_doc: Converting markdown...");
|
|
1190
|
-
const { blocks, firstLevelBlockIds } = await chunkedConvertMarkdown(client,
|
|
1331
|
+
const { blocks, firstLevelBlockIds, images } = await chunkedConvertMarkdown(client, markdownPlan.chunks);
|
|
1191
1332
|
if (blocks.length === 0) throw new Error("Content is empty");
|
|
1192
1333
|
const { orderedBlocks, rootIds } = normalizeConvertedBlockTree(blocks, firstLevelBlockIds);
|
|
1193
1334
|
logger?.info?.(`feishu_doc: Converted to ${blocks.length} blocks, inserting at index ${insertIndex}...`);
|
|
@@ -1195,7 +1336,7 @@ async function insertDoc(client, docToken, markdown, afterBlockId, maxBytes, log
|
|
|
1195
1336
|
parentBlockId: parentId,
|
|
1196
1337
|
index: insertIndex
|
|
1197
1338
|
});
|
|
1198
|
-
const imagesProcessed = await processImages(client, docToken,
|
|
1339
|
+
const imagesProcessed = await processImages(client, docToken, images, inserted, maxBytes, imageReadTimeoutMs);
|
|
1199
1340
|
logger?.info?.(`feishu_doc: Done (${blocks.length} blocks, ${imagesProcessed} images)`);
|
|
1200
1341
|
return {
|
|
1201
1342
|
success: true,
|
|
@@ -1405,6 +1546,15 @@ function registerFeishuDocTools(api) {
|
|
|
1405
1546
|
label: "Doc"
|
|
1406
1547
|
}
|
|
1407
1548
|
}).config?.mediaMaxMb ?? 30) * 1024 * 1024;
|
|
1549
|
+
const getImageReadTimeoutMs = (params, defaultAccountId) => resolveConfiguredHttpTimeoutMs(resolveFeishuToolAccount({
|
|
1550
|
+
api,
|
|
1551
|
+
executeParams: params,
|
|
1552
|
+
defaultAccountId,
|
|
1553
|
+
requiredTool: {
|
|
1554
|
+
family: "doc",
|
|
1555
|
+
label: "Doc"
|
|
1556
|
+
}
|
|
1557
|
+
}));
|
|
1408
1558
|
if (toolsCfg.doc) {
|
|
1409
1559
|
api.registerTool((ctx) => {
|
|
1410
1560
|
const defaultAccountId = ctx.agentAccountId;
|
|
@@ -1421,9 +1571,9 @@ function registerFeishuDocTools(api) {
|
|
|
1421
1571
|
const client = getClient(p, defaultAccountId);
|
|
1422
1572
|
switch (p.action) {
|
|
1423
1573
|
case "read": return jsonResult(await readDoc(client, p.doc_token));
|
|
1424
|
-
case "write": return jsonResult(await writeDoc(client, p.doc_token, p.content, getMediaMaxBytes(p, defaultAccountId), api.logger));
|
|
1425
|
-
case "append": return jsonResult(await appendDoc(client, p.doc_token, p.content, getMediaMaxBytes(p, defaultAccountId), api.logger));
|
|
1426
|
-
case "insert": return jsonResult(await insertDoc(client, p.doc_token, p.content, p.after_block_id, getMediaMaxBytes(p, defaultAccountId), api.logger));
|
|
1574
|
+
case "write": return jsonResult(await writeDoc(client, p.doc_token, p.content, getMediaMaxBytes(p, defaultAccountId), getImageReadTimeoutMs(p, defaultAccountId), api.logger));
|
|
1575
|
+
case "append": return jsonResult(await appendDoc(client, p.doc_token, p.content, getMediaMaxBytes(p, defaultAccountId), getImageReadTimeoutMs(p, defaultAccountId), api.logger));
|
|
1576
|
+
case "insert": return jsonResult(await insertDoc(client, p.doc_token, p.content, p.after_block_id, getMediaMaxBytes(p, defaultAccountId), getImageReadTimeoutMs(p, defaultAccountId), api.logger));
|
|
1427
1577
|
case "create": return jsonResult(await createDoc(client, p.title, p.folder_token, {
|
|
1428
1578
|
grantToRequester: p.grant_to_requester,
|
|
1429
1579
|
requesterOpenId: trustedRequesterOpenId
|
|
@@ -1435,7 +1585,7 @@ function registerFeishuDocTools(api) {
|
|
|
1435
1585
|
case "create_table": return jsonResult(await createTable(client, p.doc_token, p.row_size, p.column_size, p.parent_block_id, p.column_width));
|
|
1436
1586
|
case "write_table_cells": return jsonResult(await writeTableCells(client, p.doc_token, p.table_block_id, p.values));
|
|
1437
1587
|
case "create_table_with_values": return jsonResult(await createTableWithValues(client, p.doc_token, p.row_size, p.column_size, p.values, p.parent_block_id, p.column_width));
|
|
1438
|
-
case "upload_image": return jsonResult(await uploadImageBlock(client, p.doc_token, getMediaMaxBytes(p, defaultAccountId), mediaLocalRoots, p.url, p.file_path, p.parent_block_id, p.filename, p.index, p.image));
|
|
1588
|
+
case "upload_image": return jsonResult(await uploadImageBlock(client, p.doc_token, getMediaMaxBytes(p, defaultAccountId), getImageReadTimeoutMs(p, defaultAccountId), mediaLocalRoots, p.url, p.file_path, p.parent_block_id, p.filename, p.index, p.image));
|
|
1439
1589
|
case "upload_file": return jsonResult(await uploadFileBlock(client, p.doc_token, getMediaMaxBytes(p, defaultAccountId), mediaLocalRoots, p.url, p.file_path, p.parent_block_id, p.filename));
|
|
1440
1590
|
case "color_text": return jsonResult(await updateColorText(client, p.doc_token, p.block_id, p.content));
|
|
1441
1591
|
case "insert_table_row": return jsonResult(await insertTableRow(client, p.doc_token, p.block_id, p.row_index));
|
|
@@ -1893,17 +2043,23 @@ function parseBitableUrl(url) {
|
|
|
1893
2043
|
const u = new URL(url);
|
|
1894
2044
|
const tableId = u.searchParams.get("table") ?? void 0;
|
|
1895
2045
|
const wikiMatch = u.pathname.match(/\/wiki\/([A-Za-z0-9]+)/);
|
|
1896
|
-
if (wikiMatch)
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
2046
|
+
if (wikiMatch) {
|
|
2047
|
+
const wikiPathSegment = wikiMatch[1];
|
|
2048
|
+
return wikiPathSegment === void 0 ? null : {
|
|
2049
|
+
token: wikiPathSegment,
|
|
2050
|
+
tableId,
|
|
2051
|
+
isWiki: true
|
|
2052
|
+
};
|
|
2053
|
+
}
|
|
1901
2054
|
const baseMatch = u.pathname.match(/\/base\/([A-Za-z0-9]+)/);
|
|
1902
|
-
if (baseMatch)
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
2055
|
+
if (baseMatch) {
|
|
2056
|
+
const basePathSegment = baseMatch[1];
|
|
2057
|
+
return basePathSegment === void 0 ? null : {
|
|
2058
|
+
token: basePathSegment,
|
|
2059
|
+
tableId,
|
|
2060
|
+
isWiki: false
|
|
2061
|
+
};
|
|
2062
|
+
}
|
|
1907
2063
|
return null;
|
|
1908
2064
|
} catch {
|
|
1909
2065
|
return null;
|
|
@@ -2140,7 +2296,7 @@ async function createApp(client, name, folderToken, logger) {
|
|
|
2140
2296
|
try {
|
|
2141
2297
|
const tablesRes = await client.bitable.appTable.list({ path: { app_token: appToken } });
|
|
2142
2298
|
if (tablesRes.code === 0 && tablesRes.data?.items && tablesRes.data.items.length > 0) {
|
|
2143
|
-
tableId = tablesRes.data.items
|
|
2299
|
+
tableId = tablesRes.data.items.at(0)?.table_id;
|
|
2144
2300
|
if (tableId) {
|
|
2145
2301
|
const cleanup = await cleanupNewBitable(client, appToken, tableId, name, log);
|
|
2146
2302
|
cleanedRows = cleanup.cleanedRows;
|