dsh-artifact
在 DeepSeek Harness 对话中内联渲染 ECharts、Mermaid、Three.js 及沙箱自定义 HTML 的插件。
AI 分析
核心用途是让 AI 能够直接在聊天界面输出交互式图表、流程图和 3D 模型。适合需要直观数据可视化、架构图绘制或前端原型预览的用户。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:sumarilkkxx/dsh-artifact说明文档
阅读完整 README ↗Usage
Ask the model for a chart:
Draw a bar chart of 2024 quarterly revenue: 120, 180, 150, 210 (in 10k CNY)
The model calls render_artifact with an ECharts option, and the chart appears as an interactive card in the conversation.
render_artifact (charts / diagrams / 3D)
| Parameter | Type | Description |
|---|---|---|
engine | string | echarts (default) · mermaid · three |
option | object / string | ECharts option — engine=echarts (plain JSON, no functions; string templates like {c}%) |
code | string | Mermaid diagram source — engine=mermaid (flowchart / sequenceDiagram / classDiagram / gantt / stateDiagram / pie / erDiagram / journey) |
spec | object / string | Three.js scene — engine=three ({"meshes":[{shape,color,size,position,rotation}],"background","ambient"}) |
title | string | Card title |
height | number | Height in px (default 360, min 120) |
render_html (sandboxed custom widget)
| Parameter | Type | Description |
|---|---|---|
html | string | Self-contained HTML fragment or full document (inline scripts/styles allowed; external resources blocked) |
title | string | Card title |
height | number | Height in px (default 400, min 120) |
Example the model produces:
{
"engine": "echarts",
"title": "2024 quarterly revenue",
"option": {
"title": { "text": "Revenue (10k CNY)", "left": "center" },
"tooltip": { "trigger": "axis" },
"xAxis": { "type": "category", "name": "Quarter", "data": ["Q1", "Q2", "Q3", "Q4"] },
"yAxis": { "type": "value", "name": "Revenue" },
"series": [{ "type": "bar", "name": "Revenue", "data": [120, 180, 150, 210] }]
}
}
Security model
- Declarative payloads (
option/spec) must be pure JSON — functions,undefined, and symbols are rejected by the host half. - Engine assets are served only from the plugin's own route; path traversal is blocked.
render_htmlwidgets run in a sandboxed iframe (opaque origin) with a CSP that blocks network, top navigation, and form submission; only inline scripts/styles are allowed.