Tianbaidi/dsh-plugin-scaffold ↗★ 0
dsh-plugin-scaffold
Scaffold for a DeepSeek Harness plugin: config, tools, UI cards, and hooks in one template
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Tianbaidi/dsh-plugin-scaffold说明文档
阅读完整 README ↗dsh-plugin-scaffold
一个 DeepSeek Harness (dsh) 入门插件。
它示范了社区插件可用的四种扩展形态,并以一个可用的"便签"示例呈现:
note_write / note_read / note_list / note_delete。
| 形态 | 在本仓库的位置 |
|---|---|
带 Config 的插件 | src/index.ts — Schemastery schema、默认值、cordis.yml 覆盖 |
| 工具 | ctx.tools.register(defineTool(...)) — 规范 JSON 输出 + output.render |
| UI 卡片 | presentCall / presentResult / presentationMeta — 纯投影函数 |
| 钩子 | ctx.on('session/event', ...) — 观察 agent 循环 |
试运行
把 bundle 装进任意 profile(prepare 脚本会在安装时构建):
dsh plugin --profile web add github:Tianbaidi/dsh-plugin-scaffold
打开 Web UI,让 agent"保存一个叫 project-ideas 的便签,内容是关于 脚手架的,然后列出所有便签"。想用开发 overlay?指向你的本地检出:
- insert:
- id: scaffold
name: 'file:///
/src/index.ts'
Windows 注意:overlay 里插件路径必须是
file://URL 形式 (file:///D:/...%20...),不能用裸的D:/...路径——ESM loader 会把后者 当成d:协议拒绝。
开发
pnpm install # 安装已发布的 @deepseek-ai peer 依赖
pnpm typecheck # 对已发布的 .d.ts 做严格类型检查
pnpm test # vitest:配置默认值、工具往返、上限、卡片投影
热重载:修改 src/index.ts 保存后,正在运行的 dsh web 会自动重载插件
(注册都是 effect,自动清理)。
改成你自己的
- 重命名包名和
src/index.ts里的name导出。 - 把便签领域换成你的——保留 Config / 工具 / 卡片 / 钩子的形态。
- 更新
cordis.yml里name:的 file URL,指向你的src/index.ts。
发布到生态
本项目已经是 bundle 格式(package.json 里的 dsh.bundle.patch),即官方分发格式:
可以用 dsh plugin add 装进任意 profile。
# 在 dsh 安装(npm 或源码检出)下执行:
dsh plugin --profile my-profile add /path/to/dsh-plugin-scaffold
dsh --profile my-profile "保存一个关于脚手架的便签"
Windows 注意:
dsh plugin add会把路径转发给 pnpm,遇到空格会拆开——请把包放在 不含空格的路径上,或改用 tarball。