Skylarking/dsh-plugin-chat-renderer ↗★ 0

@skylarking/dsh-chat-renderer

为聊天内容提供可安装的渲染扩展,可将 mermaid 代码块内联渲染为图表。 适合需在对话中直接查看流程图表的用户;仅处理 mermaid 围栏代码块,渲染失败时保留源码。

套件
@skylarking/dsh-chat-renderer
相容性
待驗證
版本
0.1.0
最近更新
2026年8月20日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Skylarking/dsh-plugin-chat-renderer

@skylarking/dsh-chat-renderer

Installable external plugin that enhances DSH chat content. Fenced code blocks marked mermaid render as diagrams inline in the conversation. The browser bundle uses Mermaid's strict security mode and keeps the source visible when a diagram cannot be rendered.

The implementation is intentionally generic: registerCodeRenderer() owns a browser-side registry keyed by fenced-code language. Future versions of this plugin can add image, code-preview, or other block handlers without modifying DSH's conversation package.

Install from the Desktop plugin manager by selecting this directory, or use:

pnpm dsh plugin --profile web add ./plugins/chat-renderer

Then write a message containing:

```mermaid
flowchart LR
  User --> DSH
  DSH --> Cordis
```

File links and relative file paths rendered as inline code also expose their path as a hover tooltip. Double-clicking either form opens a reversible context menu with copy-path and copy-content actions; URL-backed links additionally offer open, download, and copy-content actions. The menu is implemented entirely in the plugin and is removed together with the plugin; operating-system file actions follow the browser or Desktop host's URL policy.

Disabling or uninstalling the plugin removes its rendered output and restores the original code blocks. The plugin is presentation-only and contributes no model-visible input or durable session event.