Skip to content

fix(docs): normalize board_tokens in +create response for mermaid/whiteboard content#10

Open
eggyrooch-blip wants to merge 1 commit intolarksuite:mainfrom
eggyrooch-blip:fix/docs-create-missing-board-tokens
Open

fix(docs): normalize board_tokens in +create response for mermaid/whiteboard content#10
eggyrooch-blip wants to merge 1 commit intolarksuite:mainfrom
eggyrooch-blip:fix/docs-create-missing-board-tokens

Conversation

@eggyrooch-blip
Copy link
Copy Markdown

Problem

docs +update calls normalizeDocsUpdateResult after executing, which surfaces board_tokens in the response when the markdown contains mermaid/plantuml/whiteboard blocks. docs +create is missing the same call.

As a result, a caller who creates a document with mermaid diagrams via +create cannot know how many whiteboards were created or retrieve their tokens — even though the exact same information is available from the underlying MCP response.

Repro:

lark-cli docs +create --title "test" --markdown $'```mermaid\nflowchart LR\n  A-->B\n```'
# board_tokens is absent from output

lark-cli docs +update --doc <id> --mode append --markdown $'```mermaid\nflowchart LR\n  A-->B\n```'
# board_tokens is present in output ✓

Fix

Call normalizeDocsUpdateResult in DocsCreate.Execute after CallMCPTool, identical to how DocsUpdate.Execute does it. One-line change.

Notes

  • normalizeDocsUpdateResult (and its helpers isWhiteboardCreateMarkdown, normalizeBoardTokens) live in the same doc package and are accessible without any export changes.
  • No behavior change when markdown contains no mermaid/whiteboard blocks (normalizeDocsUpdateResult is a no-op in that case).

…teboard content

+update already calls normalizeDocsUpdateResult to surface board_tokens when
markdown contains mermaid/plantuml/whiteboard blocks. +create was missing the
same call, so callers could not know how many whiteboards were created or
retrieve their tokens. One-line fix: call normalizeDocsUpdateResult after
CallMCPTool in DocsCreate.Execute.
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants