Skip to content

feat: one Markdown parser (parseMarkdownSpans); no sync advice for store-history messengers (UX-59) - #1430

Merged
leemour merged 2 commits into
mainfrom
fix/mcp-delete-markdown
Oct 17, 2026
Merged

leemour merged 2 commits into
mainfrom
fix/mcp-delete-markdown

Conversation

@leemour

@leemour leemour commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Task

Two cli-core gaps whatsapp-cli (wa) hit: three copies of one Markdown parser, and messages sync advice that store-history messengers cannot follow (UX-59). (The MCP delete-for-everyone item was dropped: #1439 settled it, since agents never delete for everyone.)

Why

What

  • parseMarkdownSpans(text): FormattedText, exported from .. It reads tg's dialect plus # headings and a one-line ``` block, sorts the spans, and validates them. Telegram's nesting refusal, tg's trailing-space trim and max's nested-link refusal stay with each messenger's renderer. I checked tg's and wa's own test suites with this parser plus their post-processing: all 20 cases pass. max's dialect is different (* italic, __ bold, ++, ^^), so max does not switch yet: that is the owner's call (NEED-1414).
  • UX-59: the new syncsOneChat(messenger) is true when history !== "store" || historyOnDemand. <chat> advice needs it; --all advice needs history !== "store". The services already know the messenger, so the members audit and chat stats set fetch only when a sync can run. Their answer builders keep the "store does not hold the chat whole" caveat (missing with no step) and drop next. I did this instead of passing the messenger into those builders. search conversations / conversations related (CLI and MCP) do take the messenger now. MCP chats_documents_list, store check (with historyOnDemand it names the first chat that is behind) and the message-search coverage line are gated the same way.

Testing

Consumer impact

  • tg-cli: can swap the parser in src/telegram/format-markdown.ts for parseMarkdownSpans from @wirecat/cli-core, keeping its nesting check and trailing-space trim. One change: # x becomes a heading span, and a one-line ```x``` becomes pre (that used to be an error). Its entity mapping has to handle heading.
  • wa: can swap src/adapter/format-markdown.ts's parser for parseMarkdownSpans and keep toWhatsApp. Same output.
  • max-cli: no change until the owner decides on its dialect (NEED-1414).
  • cli-memo: none.
  • UX-59 changes only what answers print. No API changed for consumers.

🤖 Generated with Claude Code

@leemour leemour changed the title fix: MCP delete-for-everyone needs allow, one Markdown parser, no sync advice for store-history (UX-59) feat: one Markdown parser (parseMarkdownSpans); no sync advice for store-history messengers (UX-59) Oct 17, 2026
@leemour
leemour force-pushed the fix/mcp-delete-markdown branch from c72893b to 44e8f7f Compare October 17, 2026 11:57
leemour and others added 2 commits October 17, 2026 14:13
…essenger

tg-cli, max-cli and whatsapp-cli each carried a copy of the same parser. This one
reads tg's dialect plus # headings and a one-line ``` block into FormattedText;
each messenger keeps only its renderer and the nesting it refuses. Tests ported
from tg, with headings, the one-line block and the nesting the parser leaves to
the messenger.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… (UX-59)

For history: store, the members audit, chat stats, conversation search, MCP
chats_documents_list, store check and the search coverage stop naming messages sync;
the caveat that the store does not hold the chat whole stays, without a step. With
historyOnDemand they name messages sync <chat>, never --all. The services already
know the messenger, so audit and stats gate their fetch there and the answer
builders key the caveat on completeness.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

1 participant