Binaryinject/dsh-review-checkout

DeepSeek Harness(DSH)会话修改审查插件 —— cirelir/dsh-change-review 的加固 + Codex 风格重构版,适配 DSH Desktop 与 dsh --profile web。

catalog descriptioncatalog 简介 / catalog description:dsh-review-checkout

Project Overview项目介绍

dsh-review-checkout is a file-change review plugin for DeepSeek Harness sessions, tracking every write and edit made by the agent. It renders Codex-style per-turn cards at the end of each turn—showing file-type badges, addition/deletion counts, and timestamps—plus a dedicated review tab that aggregates the latest turn's diffs with line numbers, +/- prefixes, and syntax highlighting for JS/TS/JSON/Python/YAML/Shell/CMake and more. A live pill above the composer shows running change counts. Settings expose 12-color light/dark presets that auto-follow the DSH theme. Use it when you need turn-by-turn review of agent output or safe revert. One caveat: revert is web-only; Desktop disables it by design.

dsh-review-checkout 是 DSH 的文件改动审查插件,跟踪会话中所有写入与编辑操作。每个回合末尾呈现 Codex 风格卡片,显示文件徽章、+N −M 统计与时间戳;独立审查页签聚合最新改动,提供带行号、+/− 前缀与语法高亮的差异视图,并支持折叠、刷新与清除。设置页提供 12 色明暗双主题、跟随 DSH 主题自动切换。composer 上方实时显示改动计数。适用于需要逐回合审阅代理产出或回退误改的场景。仅 web 端支持一键还原,Desktop 端因 webServer 通道未挂载而禁用。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin add dsh-review-checkout

Binaryinject/dsh-review-checkout 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-review-checkout

DeepSeek Harness(DSH)会话修改审查插件 —— cirelir/dsh-change-review 的加固 + Codex 风格重构版,适配 DSH Desktop 与 dsh --profile web

会话内 write/edit 工具调用会被追踪并以以下形态呈现:

  • Codex 风格每轮卡片(对话流每轮尾部,记录该轮的修改)—— 文件类型徽章、+N −M 统计、时间戳,多文件时列出清单(完整路径 + 每文件统计,单击单个文件跳审查 tab 并只展开它);点击卡片任意处跳转审查 tab
  • 审查 tab(会话视图)—— 按卡片跳转的对应轮次展示:文件卡 → 展开语法高亮 diff(行号、+ / − 前缀、左缘色条;按扩展名自动识别 JS/TS/JSON/C++/Python/YAML/Shell/CMake 等),顶部吸顶「当前文件」标题条随滚动切换并可折叠/展开
  • 运行中小胶囊(会话进行中,输入框上方)—— N 个文件已更改 +X −X,空闲自动隐藏
  • 主题化 UI —— 深浅两套独立配色、自动跟随 DSH 主题;tooltip 与文本选区使用 DSH 设计变量

安装

dsh plugin add dsh-review-checkout

确认 profile 配置注册了 bundle patch(~/.dsh/profiles/<profile>/cordis.patch.yml):

- insert:
    - id: diff-review
      name: 'dsh-review-checkout'

Host 端改动需重启 DSH Desktop(或 dsh --profile web);客户端改动仅需刷新页面。

功能

模块 说明
数据通道 官方 session/follow + session/page RPC(Web 走 RPC fetch,Desktop 走 IPC 桥)——无自建 HTTP 路由,兼容 Desktop 分层组合
每轮卡片 每一轮一张(该轮无修改时显示「本轮无文件修改」):已编辑 D:\...\client.js 等 2 个文件 +N −M、文件清单(完整路径 + 每文件统计;单击单个文件跳审查 tab 并只展开该文件,其余收起)、撤销(按该轮生成倒序 op 序列,只撤回这一轮的修改)、审核 跳审查 tab;整卡可点击
审查 tab 从卡片跳转后按对应轮次展示,顶部有 「双视图 / 列表」切换:双视图 = 左侧文件列表 + 右侧详情面板(头部带该文件的 还原 按钮);列表 = 每文件一张可展开卡片(语法高亮 diff、同时只展开一个文件、文件标题吸顶);两种模式共享选中/展开状态,来回切换不丢失;刷新、清空
实时刷新 5s 轮询;含运行态小胶囊与主题同步
颜色 深浅两套独立预设(各 12 色),设置 → 修改审查 tab 切换;自动跟随 DSH 主题;::selection 随主题
撤回 每轮卡片按轮签发 diff_review_revert op 序列(最后一个操作开始倒序撤回,不影响其他轮的修改);审查双视图详情面板头部也有该文件的 还原 按钮——工具注册在官方基础层工具注册表(@deepseek-ai/dsh-tools),Web 与 Desktop 均可用
其他 编辑器选择器(会话头)、主题化自定义 tooltip、完整路径显示、原子写状态文件

配置

  • 设置 → 修改审查:浅色/深色两个 tab,各 12 色(增删行背景与文字、上下文行、行号、标签角标)、预设按钮,localStorage 持久化
  • 状态文件:~/.dsh/profiles/<profile>/diff-review-state.json(删除即清空审查历史)

架构

  • lib/index.js(Host):把 write/edit 工具调用写入会话状态;原子 JSON 持久化
  • lib/client.js(客户端):经官方通道 session/follow(snapshot)+ session/page(分页)加载会话历史,解析 tool/call / tool/result 为审查记录,渲染 Codex 风格 UI
  • 第三方约束:不碰私有层服务(webServerconnection 代理)、不做跨 fiber RPC 拦截——仅官方 slot 注册与历史 API

兼容性

  • ✅ DSH Desktop(分层作用域:渲染器 + 官方 slot)
  • dsh --profile web(完整撤回)
  • ⚠️ Desktop 撤回按钮按设计禁用(webServer 在私有 web-app 层)

开发

pnpm install
pnpm test        # 24 个单元 + 冒烟测试

客户端 bundle 由 DSH client-modules 加载;Host 改动需重启 Desktop,客户端改动只需刷新。

致谢

灵感来自 cirelir/dsh-change-review,基于社区对官方会话历史通道的调研成果构建。

License

MIT

上一个 Prev PianpianUI 下一个 Next dsh-kit