当 DSH Web 中的消息包含 Mermaid 语法时,通过本地渲染以图像形式预览 Mermaid Diagrams,并允许接入外部渲染服务器。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:baconbao/dsh-mermaid-image-preview
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A DeepSeek Harness Plugin for Previewing Mermaid Diagram Images
Preview Mermaid syntax as images via local rendering in DSH when a chat message contains a Mermaid fenced code block (```mermaid or ```mmd).

Features and how it works
- Preview mermaid diagrams by rendering images directly!
- Local renderer first! If it fails, it can fall back to an external or self-hosted rendering engine by configuring a fallback server.
- Nothing gets replaced: the preview is added below the agent's reply, so the original messages are not covered up or changed.
- Settings in Plugin page: adjust the plugin's runtime settings in the Plugins panel - no restart needed.
- Light/dark themes follow the UI automatically.
Support diagram types
The plugin renders diagrams locally with a built-in renderer. It supports 13 diagram types out of the box.
Rendered locally: flowchart, sequenceDiagram, classDiagram, stateDiagram, erDiagram, pie, journey, gitGraph, requirementDiagram, timeline, quadrantChart, packet-beta, xychart-beta
Expand: gantt, mindmap, block-beta, sankey-beta, architecture-beta, zenuml, C4Context
[!NOTE] You can enable the fallback to render expanded types — see Configuration below.
Installation
Install from github
Install with DeepSeek Harness Desktop (the desktop profile)
In DeepSeek Harness (Desktop), go to the Plugins panel, click the + Add plugin button, paste one of the URLs below, then click the Install button.
### latest release version
https://github.com/baconbao/dsh-mermaid-image-preview
### specific version
https://github.com/baconbao/dsh-mermaid-image-preview#<VERSION_TAG|GIT_TAG>
### dev version
https://github.com/baconbao/dsh-mermaid-image-preview#dev
[!NOTE] Make sure Git is installed on your machine before installing.
Install with DeepSeek Harness WebUI (the web profile)
### latest release version
$ npx @deepseek-ai/dsh plugin --profile web add github:baconbao/dsh-mermaid-image-preview
### specific version
$ npx @deepseek-ai/dsh plugin --profile web add github:baconbao/dsh-mermaid-image-preview#<VERSION_TAG|GIT_TAG>
### dev version
$ npx @deepseek-ai/dsh plugin --profile web add github:baconbao/dsh-mermaid-image-preview#dev
Install from source code
$ git clone https://github.com/baconbao/dsh-mermaid-image-preview
$ cd dsh-mermaid-image-preview
$ pnpm install
$ dsh plugin --profile web add .
[!IMPORTANT] Restart DSH after installing.
Configuration
Change runtime settings on the plugin page

The Plugins panel lists this plugin under Installed; open its page and the configuration block carries the runtime settings - no restart needed. Values are stored in localStorage and applied immediately across all sessions.
Change render server via configuration file
Diagrams are rendered locally by default. To use your own render server or
enable the external fallback, edit the profile's cordis.patch.yml (e.g.
~/.dsh/profiles/web/cordis.patch.yml for WebUI, or ~/.dsh/profiles/desktop/cordis.patch.yml for Desktop):
- id: ui-dsh-mermaid-image-preview
config:
enableLocalRender: true
fallbackRenderUrl: https://mermaid.ink
enableFallback: false
enableLocalRender: render locally (defaulttrue). Set it tofalseto always use the fallback server (enableFallbackis ignored).fallbackRenderUrl: fallback render server (defaulthttps://mermaid.ink).enableFallback: use the fallback server when local rendering fails (defaultfalse).- Restart DSH after changing these settings.
- To host your own fallback render server, see https://github.com/jihchi/mermaid.ink for the details.
Uninstallation
Unstall with DeepSeek Harness Desktop (the desktop profile)
Open this plugin's page in the Plugins panel, then click Uninstall.
Unstall with DeepSeek Harness WebUI (the web profile)
$ dsh plugin --profile web remove @baconbao/dsh-mermaid-image-preview
[!NOTE] Since v0.2.0, the plugin/package ID has been
@baconbao/dsh-mermaid-image-preview(it wasdsh-mermaid-image-previewbefore).
Test
Ask the agent to produce:
```mermaid
graph TD
A[Start] --> B{Success?}
B -->|Yes| C[Done]
B -->|No| D[Retry]
```
Compatibility
| This plugin version | Supported DSH version |
|---|---|
| v0.4.0 and later | 0.1.6-alpha.2 and later |
| v0.3.2 and earlier | 0.1.0-rc.6 – 0.1.6-alpha.1 |
Author
baconbao, vibe coding with AI
License
链接
同类插件
tt-a1i/archify#integrations/deepseek-harness★ 96245
从仓库或系统描述生成经过校验的自包含交互式架构图、流程图、时序图、数据流图和生命周期图。
dream-num/dsh-univer-office★ 717
为 DeepSeek Harness 打造一个真正的办公环境。Univer Office 插件将电子表格、文档、幻灯片、画布、多维表格等汇聚到同一个运行时——数据互联、修改经过校验、变更按版本管理,并以隔离工作树支持多 Agent 协作。
Roland0511/dsh-marktext★ 604
基于 MarkText 内核 muya 的右侧栏所见即所得 Markdown 编辑器:打开 .md 按渲染结果编辑,保存走 ctx.fs 并带版本守卫。
ECNU/EduWork#dsh-knowledge-studio★ 354
基于工作区资料的 Studio,复用 DSH 模型与共享成果服务,制作报告、演示文稿、表格、思维导图、测验、闪卡及音视频。Office 生成需 Python 3.12+ 及相关依赖,并配置 DSH_OFFICE_PYTHON;媒体渲染需 Chromium;本地语音转写另需 whisper.cpp 和模型。
PerryLink/dsh-industry-research★ 219
面向 DeepSeek Harness 的确定性行业研究报告:公司与行业研究流程基于分阶段证据产出结构化、可核验的报告。
joeseesun/qiaomu-ui-learn-dsh★ 84
浏览界面设计参考和交互标本,练习设计测验,并导出 Markdown 学习笔记。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。