Files
openclaw/extensions/feishu/package.json
Peter Lee 98e88ab1a6 fix(feishu): preserve line breaks in post markdown (#99394)
* fix(feishu): upgrade single newlines to paragraph breaks in post md messages

* fix(feishu): move post-md normalization out of adapter chunker, add card-mode regression test

* fix(feishu): normalize post-md newlines before chunk/limit decisions

* fix(feishu): remove post-md normalization from outbound chunker

Move newline normalization out of feishuOutbound.chunker so card and
document-comment text paths are not affected. Post-md normalization
remains scoped to sendOutboundText, buildFeishuPostMessagePayload, and
editMessageFeishu where the render mode is known.

Add regression test verifying the chunker preserves single newlines
unchanged.

Ref: https://github.com/openclaw/openclaw/pull/99394#issuecomment-4873230477

* fix(feishu): route card on raw text, add post-md expansion length guards

* fix(feishu): scope reply target to first subchunk in expanded post fanout

* fix(feishu): skip redundant post-md normalization for pre-chunked outbound and reply text

ClawSweeper review identified that subchunks from already-normalized
post-md text re-enter sendMessageFeishu which normalizes again. If a
chunk boundary falls inside a fenced code block the second chunk lacks
the opening fence, so findCodeRegions treats code newlines as prose and
expands them to paragraph breaks.

Add alreadyNormalized flag to buildFeishuPostMessagePayload and
sendMessageFeishu so pre-normalized callers (sendOutboundText overflow
path and reply-dispatcher sendChunkedTextReply) can skip the redundant
normalization pass.

* fix(feishu): convert markdown tables before post-md newline normalization in outbound path

ClawSweeper identified that sendOutboundText normalizes newlines before
sendMessageFeishu runs convertMarkdownTables. The blank lines inserted by
normalization break markdown table row contiguity, so raw-mode Feishu
accounts can lose table rendering while fixing paragraph spacing.

Convert tables before the newline upgrader so the converter sees the
original table structure. sendMessageFeishu runs convertMarkdownTables
again internally, but that is a no-op on already-converted text.
This matches the reply-dispatcher path which already converts tables
before normalization.

* chore(feishu): avoid exporting internal card builders, test through public send API

The card-mode newline preservation tests now exercise sendMarkdownCardFeishu
and sendStructuredCardFeishu instead of calling buildMarkdownCard and
buildStructuredCard directly. This keeps the SDK surface unchanged from
upstream/main.

The schema-2.0 width config and buildStructuredCard header-fallback tests
are removed because upstream/main already covers them under the sends
cards with schema-2.0 width config describe.

* fix(feishu): preserve markdown newlines in posts

* fix(feishu): preserve multiline markdown structure

* fix(feishu): preserve markdown structure while chunking

* fix(feishu): satisfy package and type gates

* fix(feishu): chunk posts within byte envelope

* fix(feishu): restore channel chunker contract

* chore(feishu): leave release notes release-owned

* chore(feishu): shrink max-lines baseline

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-14 12:46:03 -07:00

65 lines
1.5 KiB
JSON

{
"name": "@openclaw/feishu",
"version": "2026.7.2",
"description": "OpenClaw Feishu/Lark channel plugin for chats and workplace tools (community maintained by @m1heng).",
"repository": {
"type": "git",
"url": "https://github.com/openclaw/openclaw"
},
"type": "module",
"dependencies": {
"@larksuiteoapi/node-sdk": "1.68.0",
"mdast-util-from-markdown": "2.0.3",
"mdast-util-gfm-table": "2.0.0",
"micromark-extension-gfm-table": "2.1.1",
"typebox": "1.3.3",
"zod": "4.4.3"
},
"devDependencies": {
"@openclaw/plugin-sdk": "workspace:*",
"openclaw": "workspace:*"
},
"peerDependencies": {
"openclaw": ">=2026.7.2"
},
"peerDependenciesMeta": {
"openclaw": {
"optional": true
}
},
"openclaw": {
"extensions": [
"./index.ts"
],
"setupEntry": "./setup-entry.ts",
"channel": {
"id": "feishu",
"label": "Feishu",
"selectionLabel": "Feishu/Lark (飞书)",
"docsPath": "/channels/feishu",
"docsLabel": "feishu",
"blurb": "飞书/Lark enterprise messaging with doc/wiki/drive tools.",
"aliases": [
"lark"
],
"order": 35,
"quickstartAllowFrom": true
},
"install": {
"npmSpec": "@openclaw/feishu",
"defaultChoice": "npm",
"minHostVersion": ">=2026.5.29"
},
"compat": {
"pluginApi": ">=2026.7.2"
},
"build": {
"openclawVersion": "2026.7.2"
},
"release": {
"publishToClawHub": true,
"publishToNpm": true
}
}
}