편집자 노트

yichangyaoyue/dsh-client-ui-mermaid

dsh plugin that renders Mermaid fenced code blocks as SVG diagrams in the web UI

이것은 DeepSeek Harness(DSH) 플러그인입니다. 이 사이트는 GitHub README, 설치 정보, 유지보수 상태, 공개 보안 시그널을 모아 보여줍니다.

업스트림에서 중국어 README를 제공하지 않아 저장소 원본 내용을 표시합니다.

@moyiyaoyue/dsh-client-ui-mermaid

Client-only dsh 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 -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:

dsh plugin --profile web add @moyiyaoyue/dsh-client-ui-mermaid

or, for local development, from a checkout on the same drive:

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:

- insert:
    - id: client-ui-mermaid
      name: '@moyiyaoyue/dsh-client-ui-mermaid'

Restart dsh web (or the profile) after installing, then refresh the browser.

REPOSITORY SIGNALS

보안 및 설치 증거

이 점수는 공개 저장소 메타데이터와 이 사이트에 등록된 설치 증거에만 기반하며, 코드 보안 감사와 다릅니다.

출처 추적 가능

공개 플러그인 카탈로그에서 왔으며, 공개 GitHub 저장소로 연결됩니다.

라이선스

저장소가 MIT 라이선스를 선언했습니다.

유지보수 활동

최근 180일 내 코드 업데이트가 있습니다.

설치 증거

재현 가능한 정확한 설치 메타데이터가 아직 등록되지 않았습니다. 저장소 설명에 따라 직접 확인하세요.

설치 라이프사이클 스크립트

검사한 패키지 메타데이터에 설치 라이프사이클 스크립트가 선언되지 않았습니다.