dsh-plan-build-mode:在 Composer 里双向切换 Plan / Build 模式

前言

DeepSeek Harness(dsh)从 0.2.0-rc.2 起已内置 Plan 模式(@deepseek-ai/dsh-plan-mode),Composer 里也有官方 PlanChip。但该 chip 是「仅退出」设计:会话不在 Plan 模式时组件直接不渲染,进入 Plan 只能靠手打 /plan,入口不显眼。若你经常在「先规划再实现」和「直接改代码」之间切换,或希望新建会话默认落在某一模式,官方 UI 覆盖不全。社区插件 dsh-plan-build-mode(维护者 yzhclcl,分类:客户端)在权限控件旁提供常驻下拉,并在设置里增加「默认模式」,形态类似 opencode 的 Build/Plan 选择器。

这是什么

dsh-plan-build-mode 是面向 DeepSeek Harness 的 Plan / Build 模式切换器:在 Composer 输入栏权限控件(「完全权限」/ Full access)右侧增加始终可见的下拉,切换当前会话模式;在 Settings → General 权限行下方增加 Default mode,决定新建会话的起始模式。底层仍映射官方 /plan 与 /plan off,不替换 plan-mode 机制本身。

  • 目录页:https://www.skillhub.cn/plugins/yzhclcl/dsh-plan-build-mode
  • 源码:https://github.com/yzhclcl/dsh-plan-build-mode
  • 许可证:MIT
  • 当前包版本(资料):1.1.0

核心功能

Composer 下拉

  • 常驻显示当前模式(Build 或 Plan)与 chevron。
  • 菜单两项带勾选:Build(直接实现,对应 /plan off)、Plan(只规划不执行改动,对应 /plan)。
  • Plan 模式下使用官方 --dsw-alias-state-business-* 令牌做蓝色高亮。
  • 切换进行中(pending)时按钮乐观显示目标模式;中途切换会在下一 turn 边界生效,按钮即时反映目标。

默认模式(设置)

在 Settings → General 中,权限行正下方的 Default mode 可选 Build / Plan,只影响之后新建的会话,当前会话仍用 Composer 下拉。首次保存后,会在 ~/.dsh/profiles/<profile>/cordis.patch.yml 末尾写入插件配置(例如 defaultMode: plan),属正常的 config-editor 路径;删除条目或改回 build 即恢复默认行为。

与官方 PlanChip 的关系

插件占用同一插槽 conversation.input.plan,以 register({ priority: -1 }) 在最低优先级渲染,从而用双向下拉替代仅退出用的官方 chip。卸载后官方 PlanChip 行为立即恢复,不修改任何官方文件。

Plan 模式实际含义(使用注意)

Plan 模式是提示层引导(注入 plan:policy),不是沙箱:两种模式下工具仍可用。若需要硬只读,应改权限预设(如 Read Only),与 Plan 状态无关。

安装与启用

Web profile 建议钉版本,避免 pnpm 发布冷却拉到旧构建:

dsh plugin --profile web add dsh-plan-build-mode@1.1.0

也可直接从 GitHub 安装(无需 npm 发布):

dsh plugin --profile web add github:yzhclcl/dsh-plan-build-mode

桌面端:在应用内 Plugins 页安装;CLI 不能修改 profiles/desktop。

安装后须完全退出并重启服务该 profile 的进程。客户端 bundle 版本来自文件元数据(mtime/ctime/size),仅刷新页面不够;版本 stale 时可能出现 client-modules: bundle script ... failed to load。

卸载:

dsh plugin --profile web remove dsh-plan-build-mode

卸载后同样需要重启。

典型用法

  1. 切换当前会话:点击 Composer 权限控件右侧下拉,选 Build 或 Plan。
  2. 设定新会话默认:打开 Settings → General → Default mode,选 Build 或 Plan 并保存。

与手打 /plan、/plan off 等价,无需记命令。

适用场景与兼容性

适合:已在 DSH 0.2.x 上使用 Plan 模式、希望 UI 可发现地进出 Plan,或希望新会话默认 Plan/Build 的开发者。

环境要求(资料声明):dsh >=0.2.0-0 <0.3.0-0;在 0.2.0-rc.2、Windows、web profile 上已验证下拉、设置行、持久化与新会话 pinning。0.1.x 宿主不在范围内。

插件以当前 dsh 进程权限运行,安装前请自行查看 GitHub 仓库 源码与 MIT 许可证。SkillHub 等社区目录为独立站点,与 DeepSeek / 幻方无官方从属关系。

结尾

dsh-plan-build-mode 补的是官方 Plan 入口「只能退出、难以进入」的空缺:Composer 双向切换 + 新会话默认模式,仍走内置 /plan 命令链。需要时可从目录页或 GitHub 安装,记得钉版本并重启 profile。

  • 目录:https://www.skillhub.cn/plugins/yzhclcl/dsh-plan-build-mode
  • GitHub:https://github.com/yzhclcl/dsh-plan-build-mode
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜