Render Mermaid code fences as SVG diagrams with streaming support, diagram/code switching, fullscreen zoom and pan, SVG export, and a bundled same-origin runtime.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-mermaid
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:MrmoLabs/dsh-mermaid
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
简体中文 | English
Render Mermaid fenced code blocks in DeepSeek Harness Web as SVG diagrams with a Code / Diagram toggle. The plugin supports streaming responses, dark mode, fullscreen viewing, zoom and pan, SVG export, and automatic fallback to source code when rendering fails.
Features
- Supports
mermaid,mermaidjs, andmmdfenced code blocks - Works with the DSH/Shiki plain fallback, where code elements may not have a language class
- Bundles the exact Mermaid
11.17.0release and requires no runtime CDN - Loads the bundled Mermaid runtime from DSH only after the first Mermaid block is detected
- Renders multiple diagrams through a serial queue and yields between renders to keep the page responsive
- Uses Mermaid's
securityLevel: strict - Suppresses Mermaid's built-in parse-error SVG so failed renders fall back cleanly without leaving temporary error graphics in the document
- Opens rendered diagrams in a fullscreen viewer with zoom, pan, reset, and fit-to-window controls
- Keeps keyboard focus inside the fullscreen viewer, isolates background content, and returns focus to the triggering control when closed
- Announces render and download status to assistive technologies and gives generated SVG diagrams accessible names
- Exports the rendered diagram as a standalone SVG file directly from the card
- Keeps fullscreen and SVG download actions available in both views and holds the toolbar in place while switching
- Localizes plugin-owned interface and status text in Simplified Chinese or English by following the page and browser language
- Enhances only
<pre><code>blocks and ignores inline code - Prevents stale asynchronous renders from overwriting newer streaming content
- Rejects individual diagrams over 50,000 characters or 2,000 lines before invoking Mermaid
Compatibility
Last verified with @deepseek-ai/dsh 0.1.2-rc.1 on 2026-09-05 using Node.js 22.23.2. DSH is currently a developer preview and may introduce compatibility-breaking changes; please open an issue if a newer DSH release changes its plugin loader or Markdown DOM.
Install
If dsh is available globally, install the stable npm release with:
dsh plugin --profile web add -w dsh-mermaid
Without a global dsh command, invoke DSH through npx:
npx.cmd --yes @deepseek-ai/dsh plugin --profile web add -w dsh-mermaid
DSH installs the package through pnpm, detects its dsh.bundle declaration, and automatically adds dsh-mermaid to the web profile bundle list. Restart DSH Web or refresh the page after installation.
Install the latest GitHub source
npx.cmd -y github:MrmoLabs/dsh-mermaid install
This runs the repository's dsh-mermaid installer, which asks DSH to install the GitHub source into the web profile. GitHub installation builds the package during installation. If pnpm reports that it blocked a build script, add the exact package key shown by pnpm to allowBuilds in the profile's pnpm-workspace.yaml, then run the command again. Prefer the npm release for normal use.
Update and uninstall
Update the npm release:
dsh plugin --profile web update -w dsh-mermaid
Uninstall:
dsh plugin --profile web remove -w dsh-mermaid
Restart DSH Web after updating or uninstalling.
Usage
Ask a model to output a Mermaid fenced code block:
```mermaid
flowchart LR
A[Code] --> B[Diagram]
```
The code block receives Code / Diagram controls and opens in diagram view by default.
Develop from source
Node.js 22.19 or later is required.
npm.cmd install
npm.cmd run check
npm.cmd run build
dsh plugin --profile web add -w .
Build output is written to lib/. The lightweight client.js bootstrap is registered with the DSH client module loader as dsh-mermaid, while the bundled Mermaid runtime is served from the plugin's same-origin host route and loaded on demand. DSH resolves the relative installation path against the current plugin checkout.
For manual local development, the built package can also be copied to:
C:\Users\<username>\.dsh\profiles\web\node_modules\dsh-mermaid
Never commit the complete .dsh directory. It may contain conversations and credentials.
Release checks
npm.cmd run check
npm.cmd run build
npm.cmd pack --dry-run
git status --short
git diff --cached
License
Links
More in this category
tt-a1i/archify#integrations/deepseek-harness★ 81709
Generate validated, self-contained interactive architecture, workflow, sequence, data-flow, and lifecycle diagrams from repositories or system descriptions.
dream-num/dsh-univer-office★ 494
Give DeepSeek Harness a real office environment. Univer Office Plugin brings spreadsheets, docs, slides, canvases, relational tables, and more into one runtime — with connected data, validation, versioned changes, and isolated worktrees for multi-agent collaboration.
PerryLink/dsh-industry-research★ 214
Deterministic industry research reports for DeepSeek Harness — company and industry research flows produce structured, verifiable reports from staged evidence.
PolinniZhong/dsh-knit★ 53
Lists the Markdown documents, images and video that already exist anywhere in the session workspace in the DSH sidebar, ranked by relevance to the current conversation: recent messages are matched locally against document title, summary and body with IDF weighting, with no model calls and no network. Because the list is scanned from the workspace instead of remembered, restarting DSH or starting a new session does not empty it. Images and video preview in place, with relative-path images resolved and video streamed over HTTP Range. A references bar under the preview header shows which documents cite the one being previewed and which it cites, with one click to jump between them. The same ranking is exposed to the agent as a knit_docs tool, which returns the most relevant documents along with the passage that matched in each, where one is found.
HuanLinOTO/dsh-plugin-mineru★ 46
Expose MineRU document parsing tools to the model.
kw78/dsh-office-tools★ 28
Workspace-safe Office tools for agents: create/read Word, create/read/update Excel, and create/read PowerPoint decks with PNG/JPG/GIF image placement.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.