lehhair/dsh-html-artifact
Project Overview项目介绍
This is a native plugin built exclusively for DeepSeek Harness (DSH) that enables real-time rendering of HTML artifacts within DSH sessions. It provides a dedicated set of artifact tools that let the AI model create, patch, read, list, and destroy HTML documents directly in the session. Instead of requiring the model to send the entire updated HTML document every time a change is made, it uses incremental patching with the same old_string/new_string semantics DSH’s core file edit tool uses, cutting down on token usage and updating previews in place. This reduces unnecessary token bloat and keeps the session responsive even for large HTML documents.
To install the plugin, you need to pull the latest tarball from the GitHub Releases page and run the DSH plugin add command with the direct latest download URL. After adding the plugin, you must restart the DSH web service and refresh your browser page for the changes to take effect. Installing directly from source code is not recommended, because the built artifacts are gitignored, so a source install will not include the required files to run the plugin. If you run into issues with cached old versions after an upgrade, you need to remove the plugin first before reinstalling, and clear the pnpm store cache if needed.
All rendered HTML previews run inside a sandboxed iframe with a strict Content Security Policy that blocks external access to the host DSH environment, so artifact scripts cannot access sensitive data from the main page. Users can submit interaction data from the artifact back to the DSH session, including explicit state from the artifact script, form values, and button click events, for the model to process. For development, you need to have a local checkout of DSH core, install dependencies with pnpm, run type checking and tests before building, and CI automatically handles building and releasing new versions to GitHub.
这是一款专为DeepSeek Harness(DSH)打造的原生插件,用于在DSH会话中实时渲染HTML产物。它让模型通过专用的artifact工具创建、修补HTML文档,产物会在DSH界面的沙箱iframe中实时渲染。和每次重发整个HTML文档不同,它采用增量补丁机制,和文件编辑工具使用同一套old_string/new_string语义,仅传输变更,预览原地更新。
安装需要从GitHub Releases获取最新tar包,通过dsh plugin命令添加到profile层,重启DSH web服务后生效。不建议直接从源码安装,因为构建产物被忽略,源码安装会缺失必要文件。插件支持创建、补丁、读取、删除、枚举五种操作,还提供了安全的沙箱隔离机制,限制产物脚本访问宿主环境。
插件支持用户交互数据回传,用户在预览产物内操作后,可点击提交按钮把状态、表单值、点击事件注入当前会话供模型分析。开发依赖本地DSH源码,通过pnpm安装依赖、构建检测,CI自动打包发布产物。升级时需要注意pnpm的URL缓存问题,旧版本需要先卸载再重新安装。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-html-artifact(lehhair/dsh-html-artifact)
仓库:https://github.com/lehhair/dsh-html-artifact
本站详情页:https://www.yhbd.top/plugins/lehhair-dsh-html-artifact/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证未声明 · ⭐ 2 · 最近提交 2026-08-15 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add "https://github.com/lehhair/dsh-html-artifact/releases/latest/download/dsh-external-dsh-html-artifact.tgz"
把 lehhair/dsh-html-artifact 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-html-artifact
HTML 实时渲染插件:模型通过专门的 artifact 工具创建/修补 HTML 文档,GUI 在沙箱 iframe 里实时渲染。核心区别:模型打 patch(old_string/new_string,和文件 edit 工具同一套语义),而不是每次重发整个 HTML —— 只传增量,预览原地更新。
纯扩展实现,不改 harness core:
- 服务端:
artifact工具(create / patch / read / destroy / list),per-session 注册表;card: 'artifact'渲染意图通过presentResult走线(core 的 union 不认识这个 card,返回值做了边界强转,客户端未知 card 自动降级 generic)。 - 客户端:
tool.call.toolviewkeyed slot 注册artifact行的原子视图,沙箱 iframe(CSPdefault-src 'none'+sandbox="allow-scripts"不透明源 + 主题变量 + 尺寸桥 + 存储 shim),同一 artifact id 的后续 patch 调用原地更新预览。
安装
发布版走 GitHub Releases 的 tarball(dsh plugin 安装后自动加入 profile 层栈),releases/latest 永远指向最新版本,链接不用随版本改动:
dsh plugin --profile web add "https://github.com/lehhair/dsh-html-artifact/releases/latest/download/dsh-external-dsh-html-artifact.tgz"
然后重启 dsh web 服务,刷新页面。不要用 dsh plugin add github:lehhair/dsh-html-artifact 安装源码(仓库的 lib/ 被 gitignore,源码安装没有构建产物)。
⚠️ 升级注意:pnpm 会按 URL 缓存 tarball——同一
latest链接在新版本发布后可能命中旧缓存。装到旧版时先dsh plugin --profile web remove @dsh-external/dsh-html-artifact再重新安装(必要时pnpm store prune)。
用法
模型侧(工具描述已内置):
artifact create { title?, html? }—— 创建,GUI 立即渲染沙箱预览。artifact patch { id, old_string, new_string, replace_all? }—— 对已有 artifact 打补丁,只发变更;每个 patch 调用结算后预览原地更新,会话里显示一行旧/新对比。artifact read { id }/artifact destroy { id }/artifact list—— 读取源码 / 关闭 / 枚举。
安全边界:预览在 srcdoc iframe 中,CSP default-src 'none'(脚本/样式允许内联,外部 https/http 资源允许),iframe 无 allow-same-origin(不透明源),artifact 脚本无法触达宿主文档;localStorage/sessionStorage 被内存 shim 替代。
交互数据提交
预览底部 Submit interaction 按钮会把用户在 artifact 内的交互数据注入当前会话(Agent.followup,agent 立即读取分析)。收集三层:
- 显式协议(推荐,游戏/计数器等内部状态):artifact 脚本把值得提交的状态写成 JSON 值并随状态变化更新:
工具描述里已内置该指令,模型生成带内部状态的 artifact 时会自动写。window.__dshArtifactData = { score: currentScore, moves: moves } - 表单控件(自动):
input/textarea/select/checkbox/radio的当前值按 name/id 收集。 - 按钮点击(自动):点击过的按钮(
data-artifact-action优先,否则按钮文本)与次数自动记录。
开发
pnpm install # devDeps 是 link: 到 ../dsh2026/deepseek-harness 的本地 checkout
pnpm run check # typecheck + test + build
测试:tests/registry.spec.ts(服务端纯逻辑:替换语义、字节上限、截断、错误分类)+ tests/artifact-row.spec.tsx(客户端渲染:沙箱 iframe、patch 对比、跨调用实时更新、destroy/list/read 分支)。
CI(.github/workflows/build-release.yml):发布时 checkout 固定 ref 的 harness 构建后打包 tarball 上传到 Release。注意:同 URL 重建 release 会命中 pnpm 的 URL 缓存,出新版本务必 bump version。
chaojixinren/dsh-reviewer-bot
boe1900/owndsh
0lidaxiang/dsh-plugin-greet
qinyre/dsh-plugin-install
zhn1100/dsh-forge