为 DSH Web 增加 Canvas 抽屉与八个模型工具,用于创建、局部补丁、版本管理和导出 HTML、Markdown、Mermaid、SVG 与 React 工件。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:lokih1028/dsh-plugin-canvas-pro
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
Canvas-Pro for DeepSeek Harness: a Web drawer plus eight model tools for creating, patching, versioning, and exporting canvas artifacts.
What it does
After install, the Web session header gets a Canvas button. The agent can create HTML, Markdown, Mermaid, SVG, or React artifacts; the drawer previews them in a sandboxed iframe.
Model tools:
| Tool | Purpose |
|---|---|
create_canvas_artifact |
Create an artifact |
update_canvas_artifact |
Patch by selection, line range, or overwrite |
get_canvas_selection |
Read the latest preview selection |
get_canvas_artifact |
Read current content |
list_canvas_versions |
List snapshots |
revert_canvas_artifact |
Restore a previous snapshot as a new version |
diff_canvas_artifact |
Unified or split diff between versions |
export_canvas_artifact |
Export markdown, html, svg, png data URL, or json |
Selecting text in the preview opens Explain / Refactor / Fix / custom prompt actions and submits them into the current chat.
Compared with open-source DSH plugins
Sources are the plugins' own listings on awesome-dsh-plugin. This table only covers claims that those listings make and that this repo implements.
| dsh-live-canvas | dsh-canvas-preview | dsh-generative-ui | Canvas-Pro | |
|---|---|---|---|---|
| What it is | Live sandbox for HTML / React / Vue / SVG / Mermaid / Markdown | Conversation tab that previews workspace HTML | Streaming TSX UI inline or in a side canvas | Artifact workspace: drawer + eight model tools |
| Agent tools | Preview-oriented | canvas_preview-style HTML preview |
Agent writes TSX; cards can run bash / curl / model / files | create / update / get / get_selection / list_versions / revert / diff / export |
| Partial edit | Not the product focus | Typically whole HTML | New TSX frames | replace_selection, replace_range, full_overwrite |
| Selection → next turn | DOM click inspector | Not listed | Click on a card drives the next chat turn | Explain / Refactor / Fix / custom prompt from a text selection |
| Versions | Side-by-side visual diff | Not listed | State kept across stream frames | Snapshot history, revert as a new version, unified and split line diff |
| Export | Vite ZIP | Local PNG / JPG / SVG | Not listed | Markdown, standalone HTML, SVG, PNG rasterization (SVG fallback), JSON archive |
| Persistence | Session / HMR | Workspace HTML files | In-memory UI state | $DSH_HOME/storages/canvas-pro/artifacts.json |
| Drawer | Preview surface | Conversation tab | Inline + side canvas | Resizable overlay; chat turns do not force it open |
Same-name plugins that are not competitors here:
- dsh-agent-canvas — Agent / Subagent / Workflow graph, not document artifacts.
- dsh-ark9canvas — image generation workbench.
- dsh-web-artifact-designer — a skill that writes HTML/SVG files, not a live drawer.
Where the others are stronger:
- live-canvas: real React / Vue / Mermaid runtimes, SSE hot reload, device matrix, Vite ZIP.
- canvas-preview: first-class PNG / JPG export from workspace HTML.
- generative-ui: streaming TSX compile, no extra tool schema, clicks inside a card start the next turn.
Where Canvas-Pro is stronger for DSH artifact work:
- Patch instead of regenerate. The agent can replace a selected span or a line range. Preview plugins usually take a new full document.
- Text selection is a first-class agent input. The drawer posts the span into the current composer; the host can also read it via
get_canvas_selection. - Version time machine. Each patch is a snapshot; the agent can list, diff, and revert without rewriting the file from scratch.
- Export is a model tool, not only a UI button: markdown / html / svg / png / json from
export_canvas_artifact. - Local artifact store survives Web restarts under
$DSH_HOME.
Not claimed: richer live React/Mermaid than live-canvas; streaming TSX than generative-ui; raster PNG/JPG reliability than canvas-preview.
Install
dsh plugin --profile web add github:lokih1028/dsh-plugin-canvas-pro
Restart the Web profile, then refresh the GUI.
Config
- id: canvas-pro
name: dsh-plugin-canvas-pro
config:
maxHistoryPerArtifact: 50
enableReactPreview: true
Artifacts are stored under $DSH_HOME/storages/canvas-pro/artifacts.json when DSH_HOME is set.
Limits
- React artifacts currently show source in the preview sandbox; they are not executed as a live React tree.
- Mermaid artifacts show source unless you convert them to HTML.
- PNG export tries a browser rasterization of the SVG preview; if that fails it falls back to SVG.
- Selection line numbers come from the rendered preview, not always from source lines. Prefer
replace_selectionoverreplace_rangewhen the two disagree.
License
MIT
链接
同类插件
zhu1090093659/dsh-web#packages/dsh-task-board★ 7488
侧边栏多列任务看板:卡片交给真实 DSH 智能体会话执行,支持 cron 定时(Host 侧到点执行,关浏览器也生效)。
zhu1090093659/dsh-web#packages/dsh-web-all★ 7488
DSH Web UI 插件与皮肤合集:任务看板、git 图、右侧面板、远程移动端 UI、桌宠、实时 token 统计与皮肤中心。
omdsh-dev/DSH-better-sidebar★ 3555
侧边栏完整工作台:内置文件渲染编辑、终端、Git 与子代理,支持三方插件注册新 Tab。
ccch1mneyyy/dsh-TUI★ 2994
Claude Code 风格全屏终端 UI:像素鲸鱼顶栏、实时工作状态行、思考流式展开。
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 2274
右下角常驻的小鲸鱼余额挂件:显示余额、今日已用、每轮对话消耗与随机台词,带音效与设置菜单。
Devin-AXIS/deepseek-design#deepseek-idesign★ 1072
可视化设计工作室,支持网站、App 原型、海报、信息卡、报告和杂志的模板创建、元素编辑、选区级 AI 草稿衔接与导出。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。