DeepSeek Harness 插件

eightHundreds/dsh-plannotator

Star 数 ★ 0 下载量(近 30 天) 474 分类 工作流与自动化 收录于 2026-08-19 npm dsh-plannotator

打开官方 Plannotator 应用(plannotator.ai)审代理写好的计划:批注、批准,或打回重写。

安装

# npm 包(预构建)

dsh plugin --profile web add dsh-plannotator

# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)

dsh plugin --profile web add github:eightHundreds/dsh-plannotator

装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。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

English · 中文

独立的 DeepSeek Harness 插件。代理写好计划后,打开的是官方 Plannotator 应用——真正的那个产品,不是聊天里另做的一套审阅。

本仓库不是对 Plannotator 主仓库的 fork 或补丁。它用的是你已经装好的 Plannotator。

工程结构按 dsh-plugin-starter:宿主插件、纯函数 lib/、运行时 skill、node:test、CI、bundle 清单。零依赖,免构建。

index.js                    宿主插件:计划拦截 + 斜杠命令 + skill
lib/                        纯函数(可单测,不依赖 harness 服务)
skills/plannotator/SKILL.md 技能说明书(模型视角)
tests/                      node:test 单测
cordis.patch.yml            bundle patch 层

你会得到什么

代理交出计划时,会打开 Plannotator,而不是 dsh 自带的审阅卡。

也可以自己打开:

命令 做什么
/plannotator-review 审当前改动;也可以贴一个 PR 链接
/plannotator-annotate 批注一个文件、文件夹或网址
/plannotator-last 批注代理上一条回复
  1. 用 /plan 进入计划模式。
  2. 代理写出计划。
  3. 浏览器打开 Plannotator。原生 dsh 审阅卡片不应再出现。
  4. 批准、拒绝或关掉窗口。dsh 会按这个决定继续或留在计划模式。
你在 Plannotator 里的操作 dsh 侧行为
批准 离开计划模式,继续执行。
带备注批准 离开计划模式,再把备注 inject 成一条后续用户消息。
拒绝 / 批注 留在计划模式。模型带着你的反馈改计划。
关掉界面 留在计划模式,等你下一条消息。

依赖

  • dsh 0.1.0-rc.6 或兼容的 developer preview
  • Node.js 18+(dsh 宿主本身仍需要 22+)
  • 已带 plannotator opencode-plan 的 plannotator CLI(当前发行版都有)

没有 CLI 时先装:

# macOS / Linux / WSL
curl -fsSL https://plannotator.ai/install.sh | bash

# Windows PowerShell
irm https://plannotator.ai/install.ps1 | iex

确认命令可用(或文件在 ~/.local/bin/plannotator):

plannotator --help

安装

dsh plugin --profile web add dsh-plannotator
dsh web

确认层已经挂上:

dsh --profile web --dump-config   # 应看到 "# == dsh-plannotator"

然后 /plan,等模型提出计划,在 Plannotator 里审。

从 .tgz 压缩包安装

每个 v* tag 会在 GitHub Release 挂一份 npm pack 产物。dsh plugin add 可以直接吃这个 .tgz,和装 npm 包一样。不要用 Release 自动附带的源码 zip。

用 Release URL 安装:

dsh plugin --profile web add https://github.com/eightHundreds/dsh-plannotator/releases/download/v0.2.0/dsh-plannotator-0.2.0.tgz
dsh web

或先下载 dsh-plannotator-<version>.tgz,再指向本地文件:

dsh plugin --profile web add ./dsh-plannotator-0.2.0.tgz
dsh web

官方 CLI 里同样有这些终端子命令(plannotator review / annotate / last)。上面的斜杠命令是在 dsh 里对它们的包装。

从本仓库安装

git clone https://github.com/eightHundreds/dsh-plannotator.git
cd dsh-plannotator
dsh plugin --profile web add .
dsh web

不用 pnpm install,也不用构建。本地 dsh plugin add . 会继续链到这个 checkout。

用 --patch 覆盖层开发加载(插件路径必须绝对):

# dev.cordis.yml
- insert:
    - id: dsh-plannotator
      name: /绝对路径/dsh-plannotator/index.js
dsh --profile web --patch ./dev.cordis.yml

卸载

dsh plugin --profile web remove dsh-plannotator

坏掉的 bundle patch 会让整个 web profile 起不来。如果装完后 dsh web 不再启动,先卸掉插件,再跑一遍 --dump-config。

工作原理

模型退出计划模式时,插件打开官方 Plannotator,等你审完。批准、拒绝或关掉会回写到 dsh。

斜杠命令和面向模型的 skill 用 ctx.inject(['commands']) / ctx.inject(['skills']) 等对应服务 ACTIVE 后再注册,而不是在 apply() 里 ctx.get 一次就算了。包内 skills/ 不会被 dsh 扫描,skill 正文是注册时嵌进去的。

配置

普通 Plannotator 安装不用改环境变量。只有二进制不在默认位置时才需要覆盖。

变量 作用
PLANNOTATOR_BIN plannotator 可执行文件的绝对路径。
PLANNOTATOR_DSH_USE_SOURCE=1 用本地 checkout + bun 跑 Plannotator hook server。
PLANNOTATOR_DSH_SOURCE_ROOT 从这个目录向上查找 checkout。
PLANNOTATOR_DSH_SOURCE_ENTRY 直接指定 apps/hook/server/index.ts。
PLANNOTATOR_BUN / BUN source 模式下用的 bun。

未设置 PLANNOTATOR_BIN 时:若存在 ~/.local/bin/plannotator 就用它,否则用 PATH 上的 plannotator。Windows 还会查 %LOCALAPPDATA%\plannotator\plannotator.exe。

子进程总会带上 PLANNOTATOR_ORIGIN=dsh 和 PLANNOTATOR_CWD=<session cwd>。官方 opencode-plan 仍会把 UI 徽标写成 OpenCode,这是对方仓库的限制。

排障

现象 检查
仍然弹出原生 dsh 审阅卡片 --dump-config 里没有本插件、当前不在计划模式、或计划不是以 # … 开头。
/ 菜单里没有 /plannotator-* profile 还在用已发布的 0.1.4(那一版什么都没注册)。用本仓库重装:dsh plugin --profile web add .
skill 目录里没有 plannotator 同上,或宿主没有 skills 服务。包内 skills/ 不会被自动扫描。
Could not find \plannotator`` 先装 CLI,或设置 PLANNOTATOR_BIN。
装完后 dsh web 起不来 卸掉插件。不要在宿主 patch 上硬 inject: ['planMode']。
exit_plan_mode is only available in plan mode 旧版本返回了裸的 { approved: true },过不了官方 schema。升级本插件。
徽标显示 OpenCode 预期行为。官方 CLI 把 opencode-plan 标成 OpenCode。

本插件不会做的事

  • 改 Plannotator 主仓库(原生 dsh origin、安装器)
  • 替换 UserQuestionProvider 或套用 Claude hooks.json

开发

node --test

参考

许可

MIT OR Apache-2.0

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

社区评论

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。