dsh-client-ui-mermaid
纯客户端 dsh 插件:把对话中的 Mermaid 围栏代码块渲染为内联 SVG 图表。
yichangyaoyue
@yichangyaoyue
⬇ 2
★ 1
main
安装
dsh plugin --profile web add github:yichangyaoyue/dsh-client-ui-mermaid
需要可复现安装时,可在仓库后追加 #commit 固定提交。
纯客户端 dsh 插件:把对话中的 Mermaid 围栏代码块渲染为内联 SVG 图表。
该插件未提供要点说明,请参考仓库 README。
dshdsh-pluginmermaid
- 安装并启动 DeepSeek Harness:
npx @deepseek-ai/dsh web - 在终端执行上面的安装命令(CLI 会解析插件并核验来源)
- 用 dsh plugins list 确认已安装,必要时重启 Harness 生效
插件以当前 dsh 进程的权限运行,安装时可能执行代码。请先通读仓库源码与许可证,确认无破坏性命令与越权访问;本站只做索引,不对第三方插件安全性作担保。
| 代码仓库 | github.com/yichangyaoyue/dsh-client-ui-mermaid |
| 许可证 | MIT |
| 主要语言 | main |
| 下载量 | 2 |
| GitHub 星标 | 1 |
| 最近推送 | 2026-08-15 |
| 收录日期 | 2026-09-19 |
| 分类 | 界面增强 |
事实信息来自公开插件目录快照(2026-10-01),介绍文案由本站再加工。
以下为插件仓库 README 全文(原始内容,由公开目录抓取整理)。
# @moyiyaoyue/dsh-client-ui-mermaid
Client-only [dsh](https://github.com/deepseek-ai/deepseek-harness) plugin that
renders Mermaid fenced code blocks (```` ```mermaid ````) as inline SVG diagrams
in the web UI.
## What it does
- Watches the conversation DOM for `md-code-block` elements whose language is
`mermaid`.
- Renders each one to SVG via the Mermaid engine, replacing the plain code body
while keeping the copy button and a **源码 / 收起** source toggle.
- Re-renders diagrams when the DSH light/dark theme flips.
- Falls back to an inline error message (and keeps the source visible) when the
diagram cannot be rendered.
## How it works
- The package declares `dsh.client.platform = "web"`, so the `client-modules`
host scan serves `lib/client.js` as `/plugins/@moyiyaoyue/dsh-client-ui-mermaid/client.js`
and lists it in `window.__DSH_BOOT__`.
- The browser bundle registers a `MutationObserver` on `document.body` and
lazily executes the vendored Mermaid engine on first use.
## Mermaid engine source
The Mermaid v11 engine is **vendored into `lib/client.js`**, so diagram
rendering works fully offline — no network request is made. As a defensive
fallback (if the vendored copy ever fails to execute), the plugin tries these
CDN URLs in order:
1. `https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js`
2. `https://unpkg.com/mermaid@11/dist/mermaid.min.js`
Override the fallback before the plugin applies by setting
`window.__DSH_MERMAID_SRC__` to a URL string or an array of candidate URLs.
> Mermaid runs in the browser with `securityLevel: "strict"`, so untrusted
> diagram text cannot inject HTML into the page.
## Rebuild
Rebuild the vendored bundle and reinstall it in one step (from the repo root):
```powershell
powershell -ExecutionPolicy Bypass -File .\rebuild.ps1
```
Build sources live under `build/` (`client.template.js`, `build.js`, and the
downloaded `mermaid.min.js`).
## Install
Install from npm:
```powershell
dsh plugin --profile web add @moyiyaoyue/dsh-client-ui-mermaid
```
or, for local development, from a checkout on the same drive:
```powershell
dsh plugin --profile web add "file:../../plugins/dsh-client-ui-mermaid"
```
Because this is a client-only plugin (it declares no `dsh.bundle`), it must
also be registered as a loader entry in the profile's `cordis.patch.yml`:
```yaml
- insert:
- id: client-ui-mermaid
name: '@moyiyaoyue/dsh-client-ui-mermaid'
```
Restart `dsh web` (or the profile) after installing, then refresh the browser.
数据来源:公开的 DeepSeek Harness 插件目录与各插件 GitHub 仓库。本站为独立第三方目录,与 DeepSeek、幻方(High-Flyer)及插件作者均无隶属或背书关系。