dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DeepSeek Harness (dsh) plugin: a Mermaid diagram tool for the model, rendered as a diagram card in the Web UI.
A DeepSeek Harness (dsh) plugin that gives the model a Mermaid diagram tool and renders each diagram as a card in the Web UI conversation.
The model calls mermaid with diagram source; the call renders as an interactive card with a Diagram / Code toggle, a copy action, and a fallback to the source whenever rendering fails. Diagrams are ordinary session events, so a card replays from the log.
mermaid, with source and optional title parameters.dsh 0.2.1-alpha.1 (verified) or a compatible release.^22.19 || >=24.dsh web) for the card. The tool itself also registers in profiles without a web server.From this repository (a git install builds the package during installation):
dsh plugin --profile web add -w github:ButterHost69/dsh-mermaid-diagram
pnpm ≥10 refuses to run a git dependency's prepare script until it is allowed. If the first add fails, copy the exact package key pnpm prints into allowBuilds in the profile's pnpm-workspace.yaml:
allowBuilds:
dsh-mermaid-diagram: true
Then run the add again. Treat that allowance as permission to run this package's build on your machine.
From a local checkout:
dsh plugin --profile web add -w /absolute/path/to/dsh-mermaid-diagram
Restart dsh web (or reload the page) after installing.
Ask the model for a diagram, for example:
Draw a flowchart of our release process.
The model calls the mermaid tool, and the result appears as a card:
When the source cannot be rendered, the card opens in Code with the render error above the source.
| Piece | Responsibility |
|---|---|
src/index.ts (host) | Registers the mermaid tool and serves the bundled Mermaid runtime from /dsh-mermaid-diagram/mermaid-runtime.js. |
src/diagram.ts | Argument normalization, the size bound, and the model-facing summary. Shared by both halves. |
src/client/index.ts | Registers one keyed tool.call.toolview entry for the mermaid wire tool. |
src/client/MermaidCard.tsx | Reads the diagram from the call, lazily loads the runtime, renders the SVG, and owns the card states. |
src/client/mermaid-runtime.ts | Loads the runtime asset once per page and caches it on globalThis.mermaid. |
The tool's call and result are ordinary session events, so the card derives everything from the log: the recorded call.argsRaw supplies the source, and result.meta is not needed.
strict security level; labels are sanitized by Mermaid.npm install
npm run build # tsc declarations + tsdown bundles + the Mermaid runtime asset
npm test # vitest: host logic, card model, and card component
npm run typecheck
Build output lands in lib/: index.js (host), client.js (browser half, wrapped for the DSH client module loader), and mermaid-runtime.js (the bundled Mermaid UMD asset plus its license notice).
MIT. See LICENSE.
The bundled Mermaid runtime is Mermaid, MIT licensed; its notice ships beside the asset as lib/mermaid-runtime.js.LEGAL.txt.
Prior art: MrmoLabs/dsh-mermaid renders Mermaid fenced code blocks by enhancing the transcript DOM. This plugin takes the documented tool-view seam instead, so the capability is an explicit model tool rather than a Markdown rewrite.