mermaid/agent-harness/MERMAID.md
Mermaid Live Editor is the official browser editor for Mermaid diagrams. It edits Mermaid source text, previews diagrams in real time, generates shareable URLs, and renders diagrams through the Mermaid renderer service.
The live editor centers around a serialized state object. The fields relevant to the CLI are:
code: Mermaid diagram sourcemermaid: Mermaid config JSON stringupdateDiagram: whether the view should refreshrough: rough-sketch rendering togglepanZoom: pan/zoom enablementgrid: editor grid toggleFor the CLI harness, this state is stored as a JSON project file with a .mermaid.json suffix.
The live editor serializes its state as:
pako: prefixThat serialized token is used by the official endpoints:
https://mermaid.live/edit#<serialized>https://mermaid.live/view#<serialized>https://mermaid.ink/svg/<serialized>https://mermaid.ink/img/<serialized>?type=pngThis harness uses the same renderer path that Mermaid Live Editor uses in production. The backend module generates the same serialized state payload and invokes the official Mermaid renderer endpoint.
That keeps the harness aligned with the actual application instead of inventing a parallel diagram format.
project new/open/save/info/samplesdiagram set/showexport render/sharesession status/undo/redoThe CLI should prove that an agent can: