sunshaobei/dsh-session-review

Plugin插件 Native原生 ⭐ 3 Sessions & Context会话与上下文

Project Overview项目介绍

This is a purpose-built web plugin exclusively for DeepSeek Harness (DSH) that tracks all file changes made by AI editing tools during the current active user session. To install the plugin locally for development or use, run the DSH CLI command dsh plugin --profile web add /path/to/dsh-session-review, then fully restart your DSH desktop application and refresh the web interface after installation completes. It uses official DSH extension hooks and never modifies any core DSH packages, so it will not break your existing DSH installation or cause unexpected conflicts with other installed official or third-party plugins.

This plugin is designed for DSH users who need to quickly review and manage AI-generated code changes within their current editing session, without switching to external git tools. It adds a collapsible status bar directly above the DSH input box that displays the number of modified files and total added/deleted lines, and hides automatically when there are no changes in the current session. Users can click the "Review All" button on the status bar to open a dedicated review tab in the DSH sidebar, or click an individual file in the expanded list to jump straight to that file’s diff view.

The plugin has zero external runtime dependencies and requires no build step or extra package installation to work, as it only uses the React dependency provided by the DSH core platform. It tracks changes directly from tool output metadata instead of relying on git, so it never includes uncommitted changes from before the current session in its review list. It has several documented limits: it does not track changes made outside of DSH’s edit/write tools, enforces a cap of 200 files per session, and rejects undo requests for truncated changes larger than 64KB to avoid corrupting files.

这是一款专为 DSH 开发的原生 Web 插件,用于追踪当前会话中工具修改的所有文件,提供会话内修改专属的 Diff 预览与管理功能。插件全程挂载在 DSH 官方扩展点上,不会修改任何 DSH 内置核心包,会在输入框上方添加默认收起的状态栏,显示本轮修改的文件数与增减行数,无修改时自动隐藏整行。

该插件面向需要在 DSH 开发会话中快速回顾本次 AI 编辑改动的用户,支持批量回顾和单文件操作两种工作流。点击状态栏右侧的「Review 全部」按钮,即可在侧边栏打开专门的 Review 标签页,左侧列出本轮所有修改文件,右侧展示选中文件的逐处行级 Diff。展开文件列表后点击任意文件,可直接打开并聚焦到该文件的 Diff 预览界面。

插件零额外运行时依赖,无需构建或打包,仅依赖 DSH 平台提供的 React 外部依赖。它不依赖 Git 追踪改动,仅统计本次会话内 edit/write 工具产生的修改,可避免混入之前未提交的改动。插件存在容量限制,单会话最多支持 200 个文件,单处修改超过 64KB 会被截断,非工具产生的修改不会被追踪。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

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

CLI Install命令行安装

dsh plugin --profile web add github:sunshaobei/dsh-session-review

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

READMEREADME

dsh-session-review

DSH Web 插件:在输入框正上方显示"本轮会话修改的文件"一行(默认收起,点击展开),右侧 Review 按钮在侧边栏打开针对本次会话修改的 review 面板。

三个能力全部挂在官方扩展点上,不改动 DSH 任何内置包:

功能 说明
输入框上方一行 conversation.input.dock 槽位(order 15,位于 todo 与 queue 停靠条之间):收起态显示 本轮修改 N 个文件 +A −D(收/展同一张卡片,默认收起,点击展开文件列表);无修改时整行隐藏
Review 全部 收起态点击右侧 Review 全部 → 在 better-sidebar 打开 Review 标签页,左侧列出本轮修改的全部文件,右侧显示选中文件的逐处 diff(默认选中最新修改的文件)
单文件 Review 展开列表点击某个文件 → 打开/聚焦 Review 标签页并直接切到该文件的 diff(标签已打开时实时切换,不重复开标签)
撤销 / 保存 标题栏:撤销全部(每个文件恢复到会话前状态,新建文件被删除)/ 保存全部(保留全部修改并清空列表);列表项:单个 ↩ 撤销 / ✓ 保存。保存或撤销后该文件从列表消失,再次编辑时自动回到列表
行数统计 标题栏与每个列表项都显示 +增行 −删行(绿色/红色),新建文件按全文件行数计为新增

Review 的数据是"本次会话"精确的修改:宿主订阅会话事件流,收集每个成功 edit/write 工具结果携带的 meta.diffs({path, oldText, newText})——即该工具调用实际替换的文本,不依赖 git(git worktree diff 会混入本会话之前未提交的改动,这里不会)。新建文件显示为"新建 + 全量新增行"。

安装

dsh plugin --profile web add /path/to/dsh-session-review

dsh.bundle.patch 声明会让 CLI 自动把本包追加进 profile 的 bundles(宿主半随之挂载),并以 link 方式安装(开发迭代无需重复 install)。然后重启 DSH 桌面应用并刷新页面。零运行时依赖,无 peer / 构建要求。

卸载:dsh plugin --profile web remove dsh-session-review。

开发迭代:改完代码运行 scripts/deploy.sh(同步 lib 到 profile 安装目录)后重启。

架构

┌ composer (ui-conversation, 不改) ──────────────────────────────┐
│ conversation.input.dock (order 15)                             │
│   [▸] 本轮修改 N 个文件 · M 处            [Review 全部]        │  ← 收起态
│   展开:文件列表(点击 → 单文件 review)                        │
└───────────────────────────────────────────────────────────────┘
                       │ POST /session-review/api/files.list     (轮询 4s / 会话切换 / 展开瞬间)
                       │ POST /session-review/api/files.diff
                       │ POST /session-review/api/files.read     (新建文件内容)
┌ 宿主半 lib/index.js ──────────────────────────────────────────┐
│ ctx.on("session/event") → tool/result 带 meta.diffs 且非错误    │
│   → 按会话累积 {absPath → [{tool, seq, time, oldText, newText}]}│
│ 首次读取某会话时,回放 ctx.sessions.get(id).events 重建状态      │
│   (页面刷新后列表自动恢复;seq 水位线去重,幂等)               │
│ 围栏 API:isTrustedApiRequest(loopback/trustedHosts + 同源)   │
└───────────────────────────────────────────────────────────────┘
┌ Sidebar Review 标签 (betterSidebar.registerTab, 惰性注册) ─────┐
│ 左:本轮修改文件列表(badge=新建/处数,↗ 在编辑器打开)          │
│ 右:选中文件逐处 diff(行级 LCS,绿=新增 红=删除 灰=上下文)     │
│ 打开逻辑:betterSidebar.openTab(meta 或选择store 聚焦单文件)  │
│ 降级:无 better-sidebar → workspaces.openPath 系统打开          │
└───────────────────────────────────────────────────────────────┘

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev agent-dag-workflow 下一个 Next dsh-web-search-tavily →