The philosophy of DeepSeek Harness is “everything is a plugin.” During agent development or debugging, Mermaid flowcharts in Markdown code blocks often appear in conversations. If displayed as plain text, it is difficult to intuitively understand the logical structure. The dsh-mermaid plugin solves this problem by rendering Mermaid code in the conversation into SVG flowcharts.
This is a client plugin for DeepSeek Harness, maintained by GongYuanCaiJi. Its core logic was ported line by line from pi-mermaid@0.3.0, adapting the rendering logic originally intended for TUI to the DSH Web client.
Core Features¶
- Automatic rendering and validation: When a mermaid fence appears in the conversation—whether sent by the user or the assistant—it is automatically rendered as SVG. The official Mermaid parser is used for syntax validation, and if an error occurs, a warning or error is displayed below the diagram.
- Type support: Supports
graph/flowchart,sequenceDiagram,classDiagram,erDiagram, andstateDiagram(-v2). - Performance and limits: Code blocks exceeding 400 lines or 20000 characters are automatically skipped with a notification. Rendering results are cached by
(session, turn)to avoid repeated computation. - Interactive features: Each diagram includes a collapsible source code block, and the
/mermaidcommand is supported to manually re-render the diagram in the last assistant message.
Installation and Enablement¶
The plugin has not yet been published to npm and must be installed from the GitHub source. During installation, allowBuilds must be enabled to allow the prepare script to run the build.
dsh plugin add github:GongYuanCaiJi/dsh-mermaid
After installation, Mermaid code in the conversation will be automatically rendered as charts in the DeepSeek Harness Web client.
Typical Usage¶
Send a message containing a Mermaid fence in the conversation, and the system will automatically render it as an SVG chart.
```mermaid
graph TD
Start --> End
```
Send the /mermaid command to manually re-render the diagram in the last assistant message.
Notes¶
The plugin runs with the permissions of the current DSH process. Please check the source code and license (MIT) before installation. For more details and the source code, see the GitHub repository: https://github.com/GongYuanCaiJi/dsh-mermaid