integrations/deepseek-harness
tt-a1i/archify从仓库或系统描述生成经过校验的自包含交互式架构图、流程图、时序图、数据流图和生命周期图。
把 DSH Web 会话消息中的 Mermaid 代码围栏渲染为惰性加载的 SVG 图表,严格消毒并跟随明暗主题。
A standalone plugin that renders ```mermaid code fences in DSH Web conversation messages as SVG diagrams. Install it into a web profile with dsh plugin.
| Light theme · in conversation (not zoomed) | Dark theme · in conversation (not zoomed) |
|---|---|
| Light theme · zoom overlay | Dark theme · zoom overlay |
|---|---|
The zoom overlay auto-fits the diagram to the screen (near full-screen with a small margin), zooms with the mouse wheel, and pans by dragging with the left or middle button. With theme: auto the diagram colors follow the GUI light/dark theme.
src/index.ts): registers the webServer prefix route /mermaid-dist, lazily serves the mermaid UMD build from the plugin's own node_modules/mermaid, and exposes a fixed config.json endpoint.src/client/): watches the conversation DOM and renders fences whose infostring is mermaid to SVG:
mermaid.render() produces an SVG that replaces the fence's <pre> body; the language banner and copy button stay (copy still copies the source);securityLevel is always strict: labels are DOMPurify-sanitized by mermaid itself and click handlers are never bound;theme: auto reads body[data-ds-dark-theme] and re-renders visible diagrams when the attribute flips (offscreen diagrams refresh when they re-enter the viewport);The client package is ~10 KB (gzip ~4 KB); mermaid (~700 KB) is fetched on demand only when a mermaid fence actually appears — it never enters the boot graph.
From the GitHub repository (the build runs automatically in the prepare script):
dsh plugin --profile web add github:AKS1st/dsh-mermaid
dsh web # restart the web service for the profile to take effect
If pnpm reports that the git dependency needs to run build scripts (
ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED), add the package toallowBuildsin the profile'spnpm-workspace.yamland retry.
Local development (build first, then install):
npm install
npm run build
dsh plugin --profile web add .
dsh web
Uninstall:
dsh plugin --profile web remove dsh-mermaid
The bundle applies this configuration by default:
- insert:
- id: mermaid
name: 'dsh-mermaid'
config:
theme: auto
maxTextSize: 50000
maxEdges: 2000
securityLevel: strict
| Key | Default | Description |
|---|---|---|
theme | auto | Diagram theme: auto (follows light/dark), default, dark, neutral, forest, base |
maxTextSize | 50000 | Per-diagram text cap (guards against oversized diagrams) |
maxEdges | 2000 | Edge-count guard |
securityLevel | strict | Fixed to strict; loose is never accepted |
Override with - set: or - update: in the profile's cordis.patch.yml.
securityLevel is locked to strict; HTML in labels is DOMPurify-sanitized by mermaid itself; bindFunctions is never called and click handlers stay inert.CodeBlock's stable hooks (the literal md-code-block class and the infostring text); selectors need to be kept in sync if the upstream renderer is refactored.securityLevel: strict, mermaid's click interactions are unavailable.