dsh-plan-doc
已验证@hilariouhiss/dsh-plan-doc · v0.1.0 · MIT · Web 界面
Plan-document review panel for DeepSeek Harness: intercepts exit_plan_mode, shows the markdown plan in a right-side panel styled like the sidebar, lets the user edit the document and enter feedback, then confirms to start implementing.
安装
dsh plugin add @hilariouhiss/dsh-plan-doc 用 dsh --profile default --dump-config 确认 layer 已生效 —— 参见安装指南。
源码
发布到 npm 但没有公开仓库。安装前请检查包内容。
标签
说明文档
dsh-plan-doc
DeepSeek Harness 计划文档审核插件:拦截 exit_plan_mode,把模型产出的 markdown
计划在右侧面板(样式与左侧边栏一致)中打开并渲染,支持编辑文档和输入修改
意见;确认后退出计划模式并按最终文档开始实施,或把意见交回模型修订。
工作方式
- 宿主侧:监听
tools/executewaterfall,捕获exit_plan_mode调用时不再 走内置的聊天内 "Plan review" 提问,而是把文档写入会话日志 (plan-doc/review事件)并通过plan-doc会话投影推送给浏览器,同时注册/plan-doc命令接收面板决策。 - 浏览器侧:在
shell.overlay注册右缘抽屉;文档进入review状态时自动 出现(仅对当前会话),预览/编辑二段区域 + 修改意见输入框;「确认实施」 调用/plan-doc approve [markdown],「交由模型修改」调用/plan-doc reject [feedback]。 - 确认后:会话追加
approved状态事件;若文档被修改,把修改后的文档作为 用户消息注入模型;planMode置为关闭(下一步生效);模型工具结果为{approved: true},与内置语义一致。 - 拒批后:会话追加
rejected状态事件;工具返回失败结果并携带反馈文本 (无反馈时用内置默认文案),模型留在计划模式并修订,新稿到达时面板自动重开。
文档只作为会话内文档(日志投影),不写文件;会话重启后可恢复。
安装
发布到 npm 后:
pnpm --filter @hilariouhiss/dsh-plan-doc publish
dsh plugin --profile web add @hilariouhiss/dsh-plan-doc
然后重启 dsh web(宿主插件与客户端 bundle 均在启动时加载)。
开发
pnpm install # 仓库根目录一次安装
pnpm test # 运行本包 node --test
本仓库内直接接入运行环境(调试用):
- 编辑
~/.dsh/profiles/web/package.json:dependencies添加"@hilariouhiss/dsh-plan-doc": "file:C:/source_code/Other/dsh-plugins/dsh-plan-doc";dsh.profile.bundles追加"@hilariouhiss/dsh-plan-doc"。 - 在 profile 目录执行
pnpm install。 - 重启
dsh web。
结构
| 文件 | 说明 |
|---|---|
lib/index.js |
宿主插件:tools/execute 拦截、/plan-doc 命令、plan-doc 投影注册 |
lib/doc.js |
纯函数状态机/命令解析/结果构造(可单测) |
lib/client.js |
手写客户端 bundle(__ModuleLoader__ 格式):右缘抽屉 UI、样式、zh/en 字典 |
test/doc.test.js |
node --test 单元测试 |
cordis.patch.yml |
宿主 bundle 行(dsh.bundle.patch) |