sumarilkkxx/dsh-artifact0

dsh-artifact

在 DeepSeek Harness 对话中内联渲染 ECharts、Mermaid、Three.js 及沙箱自定义 HTML 的插件。

AI 分析

核心用途是让 AI 能够直接在聊天界面输出交互式图表、流程图和 3D 模型。适合需要直观数据可视化、架构图绘制或前端原型预览的用户。

包名
dsh-artifact
版本
0.2.0
许可证
MIT
最近更新
2026年8月16日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:sumarilkkxx/dsh-artifact

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)

ParameterTypeDescription
enginestringecharts (default) · mermaid · three
optionobject / stringECharts option — engine=echarts (plain JSON, no functions; string templates like {c}%)
codestringMermaid diagram source — engine=mermaid (flowchart / sequenceDiagram / classDiagram / gantt / stateDiagram / pie / erDiagram / journey)
specobject / stringThree.js scene — engine=three ({"meshes":[{shape,color,size,position,rotation}],"background","ambient"})
titlestringCard title
heightnumberHeight in px (default 360, min 120)

render_html (sandboxed custom widget)

ParameterTypeDescription
htmlstringSelf-contained HTML fragment or full document (inline scripts/styles allowed; external resources blocked)
titlestringCard title
heightnumberHeight 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_html widgets run in a sandboxed iframe (opaque origin) with a CSP that blocks network, top navigation, and form submission; only inline scripts/styles are allowed.