DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Plugin Mermaid Preview — DeepSeek Harness 插件(DSH Plugin)
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
P

dsh-plugin-mermaid-preview

Plugin Mermaid Preview

DeepSeek Harness 中的 Mermaid 图表:文档侧边栏中的 .mmd 文件预览,以及聊天消息中渲染的 ```mermaid 代码块

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:huiyeo/dsh-plugin-mermaid-preview#9d226a597af27e735b98afa1815b8735dac8b832
README兼容性版本

兼容性与来源证明

Plugin Mermaid Preview 以 dsh-plugin-mermaid-preview 发布,当前版本为 0.2.0。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
github
Registry 更新时间
2026/9/12

版本

0.2.0stable
2026/9/12
0.1.0stable
2026/9/11

相关插件

正在加载相关插件…

最新版
0.2.0
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
web
许可证
MIT
发布源
github
GitHub
★ 1
周下载
0
最近提交
2026/9/12
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 ui-customization 分类下经过校验的插件。

Web App@deepseek-ai/dsh-web-appdsh 浏览器界面捆绑包:位于 dsh-base 之上的 Web 补丁层,加上运行时粘合插件(提供前端 dist、Web 界面提示符、bash 运行时变量和 URL 行)Experimental Agent Team Web Profile@deepseek-ai/dsh-experimental-agent-team-web-profile用于 Agent Teams Remote 和 UI 插件的实验性 Web 配置层Client Ui Task Board@linxin666/dsh-client-ui-task-board面向 DSH Web GUI 的主机权威任务面板,支持实际会话执行、主机 cron 调度以及可选的跨平台空闲睡眠保护;以挂载方式提供,无需修改 DSH 源代码。Client Ui Git Graph@linxin666/dsh-client-ui-git-graph外部 dsh Web GUI 插件:空会话 Git 分支选择器和 Git 图,包含实际的主机端 Git 操作与防护,作为 dsh 配置文件包

README

dsh-plugin-mermaid-preview

Mermaid diagrams in DeepSeek Harness, in the two places they belong:

  • .mmd / .mermaid files open in the right-sidebar document viewer as diagrams instead of plain text.
  • ```mermaid fences in chat messages render as diagrams instead of syntax-highlighted code blocks.

What it does

  • Registers a document-preview implementation for the mmd and mermaid file suffixes through the harness's public documentPreviews extension point.
  • Claims the mermaid Markdown fence language through ui-primitives's fence registry, so chat transcripts render the diagram with no cooperation from the chat package.
  • Renders with mermaid 11, bundled into the plugin's own client artifact. Both surfaces share one runtime (configuration, palette sampling, measurement, device-pixel sizing), so a diagram cannot look right in one place and wrong in the other.
  • Follows the shell's light/dark palette and re-renders when the theme changes.
  • Zooms per diagram view: − / percentage / + / 重置 in a small control under the diagram, plus Ctrl (or ⌘) + wheel over it. 100% means "fills the pane width", the remembered zoom is a view preference rather than document state, and each preview tab keeps its own zoom because the state lives in the renderer instance.
  • In chat, a fence that is still streaming keeps its code block until the body is complete: a half-drawn diagram is worse than the source the reader can already see.
  • Falls back to showing the source, with the parse error above it, when a diagram does not parse — a file the agent is still writing is the common case, so a failed render never hides the content.
  • Ships Simplified Chinese and English copy through the shell's locale service.

Supported diagram types are mermaid's own: flowchart, sequence, class, state, entity-relationship, gantt, pie, git graph, mindmap, timeline, quadrant, requirement, sankey, block, architecture, and the rest.

Requirements

  • DSH with the web profile (@deepseek-ai/dsh-web-app), which mounts @deepseek-ai/dsh-client-ui-sidebar-documentpreview. The plugin stays parked until that viewer is mounted, because documentPreviews is the service it extends.
  • Chat fences additionally need a harness that has the Markdown fence registry — a ui-primitives exporting registeredFences. On an older harness the .mmd preview works normally and ```mermaid blocks keep rendering as code blocks; the plugin logs one line saying so. It does not fail, and it does not take the file preview down with it.

Install

From npm

dsh plugin --profile web add dsh-plugin-mermaid-preview

The published tarball ships the built artifacts, and prepublishOnly rebuilds them before every release.

From a checkout

The harness serves the built lib/client.js and never reads sources, and build output is not committed, so build first:

git clone https://github.com/huiyeo/dsh-plugin-mermaid-preview
cd dsh-plugin-mermaid-preview
pnpm install
pnpm run build

Then install that directory as a profile layer:

dsh plugin --profile web add /path/to/dsh-plugin-mermaid-preview

dsh plugin add installs the package and, because the manifest declares dsh.bundle.patch, appends it to dsh.profile.bundles. The bundle layer is read at process start, so restart the dsh web process, then reload the page.

To see it without waiting for a restart, a profile with patchReload: live also accepts the row directly in $DSH_HOME/profiles/web/cordis.patch.yml, which hot-mounts on save so only a page reload is needed:

- insert:
    - id: mermaid-preview
      name: dsh-plugin-mermaid-preview

Add that only while iterating, and remove it once the process restarts: the bundle layer then mounts the same row, and documentPreviews.register() throws on a duplicate implementation id.

Verify the layer landed:

node -e "console.log(require('./package.json').dsh.profile.bundles)" \
  # run in $DSH_HOME/profiles/web  →  should list dsh-plugin-mermaid-preview

Remove it with dsh plugin --profile web remove dsh-plugin-mermaid-preview.

Development

pnpm install
pnpm run build          # lib/index.js (host half) + lib/client.js (browser half)
pnpm test               # load the built artifact the way the module system does

tests/browser-smoke.mjs additionally renders a diagram in headless Chrome and asserts on the produced SVG. It needs a browser that can actually start — a confined sandbox blocks Chrome's own IPC, so run it somewhere unrestricted:

CHROME_PATH=/path/to/chrome pnpm run test:browser

How the two halves fit together

lib/index.js is the host half and deliberately contributes nothing: a package is only scanned for a browser half when it is mounted as a host row, so the row exists to make the browser half discoverable.

lib/client.js is a single classic script that calls window.__ModuleLoader__.load({ id, factory }) with a CommonJS-style factory. That format is the harness's own client-bundle contract; the browser half of @deepseek-ai/dsh-client-modules serves the file and drives it. Two consequences shape the build:

  • Only the harness browser platform's module-table words may stay external (react, react/jsx-runtime, the UI registries). Everything else — mermaid included — must be inlined, because a require() the module table cannot answer throws when the bundle materializes.
  • The artifact must be one file. mermaid loads each diagram grammar through a dynamic import(); the plugin loader serves exactly one file per package and there is no dynamic-import hook, so codeSplitting: false folds every grammar into the factory. The result is ~7 MB uncompressed, fetched once and cached by revision.

The document body receives loading: 'bytes-complete' content, so it gets the whole file in one shot and never has to page — the paged mode would hand it an accumulated prefix with no way to request the rest.

Zoom must snap to the DEVICE pixel grid

The renderer re-sizes the SVG through its own width/height attributes rather than through CSS, so the browser re-rasterizes the vector at the target size instead of resampling a bitmap. The size it writes is snapped so that width × devicePixelRatio is a whole number:

devicePixels / devicePixelRatio   // not Math.round(cssPixels)

A whole number of CSS pixels is not a whole number of device pixels. On a 125%-scaled Windows display (devicePixelRatio === 1.25) a 326 px box covers 407.5 device pixels — half a pixel off the grid — and the browser resolves that by resampling, which reads as blur. It shows up at only some zoom steps: 50% was soft while 100% happened to land whole. Rounding CSS pixels does not fix it; snapping device pixels does. tests/ cannot catch this, because jsdom has no rasterizer.

If it ever needs re-checking, the numbers are visible from the page itself — getBoundingClientRect() on the SVG times devicePixelRatio must be a whole number at every zoom step. To reach a real browser from an agent session, the DSH Browser Control extension (Chrome MV3 + a local WebSocket bridge on 127.0.0.1:9777) works when a sandbox forbids launching one: the extension dials out as a client, so the agent only has to accept that socket and can then eval in the tab.

Layout

src/index.js                 host half (empty by design)
src/client/index.ts          plugin body: file-preview registration + chat fence claim
src/client/MermaidBody.tsx   the document-preview renderer (owns its zoom)
src/client/MermaidFence.tsx  the chat fence renderer (falls back to the code block)
src/client/mermaid-runtime.ts  shared by both: config, palette, measurement, sizing
src/client/theme.ts          shell palette sampling + dark-mode subscription
src/client/locales.ts        zh/en copy
src/client/styles.ts         plugin-owned stylesheet, injected with a tagged tag
src/client/types.ts          the minimal ambient contracts this package compiles against
cordis.patch.yml             the profile patch that mounts the row
tests/load-artifact.mjs      loads the artifact; asserts the shared-registry contract
tests/load-artifact-legacy.mjs  asserts clean degradation without the fence registry
tests/browser-smoke.mjs      headless render check (needs an unrestricted browser)
tests/zoom.html              two-instance harness proving zoom is per-view

License

MIT