dsh-worktree-manager

DSH PLUGIN会话与消息

仓库 shenkonghui/dsh-worktree-manager

会话与消息 未标注验证等级 安全审查:未标注 可信度:未标注 可安装插件

为 DSH 任务启动窗口补上 git worktree 管理能力:按仓库分组列出、搜索、创建并切换 worktree,选中后自动注册为工作区。

一句话选型结论

按资料字段整理

dsh-worktree-manager 是会话与消息类的 DSH 可安装插件,未做沙盒验证,暂无安全审查结论,列出 5 项功能,没有现成安装命令,需要按仓库 README 接入。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类会话与消息 收录类型可安装插件 验证等级未标注验证等级 安全审查未标注
验证等级 UNKNOWN 未标注验证等级
GitHub 星标 0 复刻 0 · 未关闭 issue 未标注
最近更新 2026-09-18 创建于 2026-09-09
README 11.0 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
  1. 1
    确认版本与运行环境

    仓库没有标注兼容版本与 Node.js 要求,先确认你的 DSH 版本能装,再继续。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本未标注版本不匹配时安装会报错
Node.js 要求未标注来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名未发布到 npm可用 npm view 查看包信息

能做什么

5 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-worktree-manager:为 DeepSeek Harness 任务窗口补上 Git worktree 选择能力

  • 工作区选择器注入 Git Worktree 按钮
  • 按仓库分组列出并折叠 worktree
  • 跨仓库按名称/分支/路径搜索
  • 新建分支 worktree 并自动注册
  • 查看变更、提交历史与文件 diff

上游标签

deepseek-harnessdsh-plugingit-worktree

验证等级与安全审查

未标注验证等级
自动化流程结论,不是人工审核
验证等级未标注验证等级上游未给出验证结论,安装前请自行确认
安全审查未标注静态分析结论,未标注不代表已通过审查
仓库健康度未标注按仓库活跃度与最近更新时间给出
可信度未标注综合仓库活跃度与验证结果

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 列出了 5 项功能,能直接看出它解决什么问题。

先想清楚的地方

  • 安全审查还没结论,装之前先看仓库改了什么、要什么权限。
  • 没有现成安装命令,要按仓库 README 手动接入。
  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在会话与消息场景里给 DSH 补能力的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
dsh-worktree-manager当前 未做沙盒验证 未标注 0 未标注 无
dsh-desktop L3 · 安装规范通过 低风险 3.0 万 未标注 无
openpets L4 · 沙盒安装通过 低风险 1,274 未标注 有
deeptide L4 · 沙盒安装通过 低风险 1,104 0.1.1-rc.2 有
jingyun-dsh L3 · 安装规范通过 低风险 1,004 未标注 有
study-mate 未做沙盒验证 未标注 856 未标注 无

仓库档案

会话与消息
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方shenkonghui仓库 dsh-worktree-manager · 默认分支 未标注
分类会话与消息session
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言JavaScript仓库主语言
许可证未标注商用或二次分发前请确认条款原文
星标 / 复刻 / issue0 / 0 / 未标注收录时的数值,非实时
创建 / 更新2026-09-09 · 2026-09-18最后推送 未标注
本站收录2026-09-15首次进入本站目录的时间

README 全文

11.0 KB
作者原文,中文版优先;只做安全转义,不改内容

dsh-worktree-manager

A DeepSeek Harness plugin that adds git worktree management to the task start window — list, create, and select worktrees for development.

Why

Git worktrees let you have multiple working directories connected to the same repository, each on a different branch. This is useful when you want to:

  • Work on a feature branch without stashing changes on main
  • Run tests on one branch while developing on another
  • Keep a clean main checkout for reference while developing

The dsh task start window has a workspace picker for selecting a directory to work in, but it doesn't know about git worktrees. This plugin bridges that gap by:

  1. Adding a "Git Worktree" button to the workspace picker area
  2. Scanning all registered dsh workspaces and grouping those inside a git repository by their shared repository root
  3. Providing a dropdown that lists worktrees grouped by repository, with per-repo collapsible sections and a cross-repo search filter
  4. Allowing creation of new worktrees (new branch) with a target-repo selector
  5. Auto-registering selected/created worktrees as dsh workspaces and switching to them

Architecture

The plugin follows the dsh dual-half plugin pattern:

Host half (src/index.ts)

A Cordis plugin that injects ctx.webServer, ctx.shell, and ctx.workspaceRegistry. It registers HTTP routes under /plugins/dsh-worktree-manager/api/:

Method Path Description
GET /api/list?repoPath= List git worktrees for a repository
GET /api/topology Per-repo branch/workspace topology (repo discovery + worktree lists + merge status in one scan)
GET /api/changes?path= Working-tree changes of the containing repo, recursing into submodules
GET /api/history?path=&limit= Commit history of the containing worktree, newest first
GET /api/commit?path=&hash=[&sub=] One commit's changed files; submodule pointer moves list the submodule commits in between. With sub, hash refers to a commit inside that submodule
GET /api/diff?path=&file=[&sub=][&hash=] Unified diff of one file (working tree vs HEAD, or one commit)
POST /api/create Create a new worktree and register it as a workspace
POST /api/remove Remove a git worktree and unregister its dsh workspace
POST /api/branches List branches in a repository

The host half uses node:child_process to run git worktree commands and ctx.workspaceRegistry.create() to register worktrees as dsh workspaces. POST requests are rejected when the Origin header doesn't match the request Host (CSRF guard); non-browser clients that omit Origin are unaffected.

Client half (src/client/index.ts)

A browser module loaded at boot (immediately: true). It uses a MutationObserver to detect when the workspace picker appears in the SPA, then injects a "Git Worktree" button. Clicking the button opens a dropdown that:

  • Calls GET /api/topology to discover all git repositories among the registered dsh workspaces
  • Concurrently loads worktrees for every discovered repository via GET /api/list
  • Renders worktrees grouped by repository, each section collapsible; the repository containing the current workspace expands by default
  • Provides a search box that filters worktrees across all repositories by name, branch, or path
  • Offers a create row with a target-repo selector (defaulting to the current workspace's repo) and a new-branch input

The client communicates with the host through fetch() calls to the custom HTTP routes.

Install

从 git 源直接安装即可——仓库已提交构建产物 lib/,安装过程中不做任何编译,也不需要 allowBuilds 构建授权:

dsh plugin --profile web add github:shenkonghui/dsh-worktree-manager

也可以从本地检出构建后安装,再启动 Web UI:

npm run build
npm install
npx @deepseek-ai/dsh web

The harness discovers the plugin from the dsh manifest field and:
- Loads the host half as a Cordis plugin (registers HTTP routes)
- Injects the client bundle at boot (immediately: true)

产物维护

lib/ 已纳入版本控制(.gitignore 不再忽略它),这正是 git 源安装能免构建的原因。代价是:改动 src/ 后必须重新构建并连同 lib/ 一起提交,否则远程仓库会停留在旧产物上。

npm run build      # 重建 lib/(host 半 tsc 输出 + client 半 esbuild 打包)
npm run check:lib  # 把源码重建到临时目录,与入库产物逐字节比对

npm run check:lib 在产物缺失、多余或内容不同时以非零码退出并列出差异文件,用来在提交前拦住漂移。

自检脚本

两个脚本都读 lib/ 产物,所以要在 npm run build 之后跑:

node scripts/changes-self-check.mjs   # 「变更」视图的 git 管线(status/diff-tree/submodule)
node scripts/merge-self-check.mjs     # worktree 合并状态判定(分支级快查 + detached HEAD 单点判定)

Usage

  1. Start the dsh web UI
  2. In the task start window, look for the "Worktree" button near the workspace picker
  3. Click it to open the worktree dropdown — it scans all registered workspaces and groups worktrees by repository
  4. To select an existing worktree: expand a repository section, then click a worktree to switch to it
  5. To filter: type in the search box to match worktrees across all repositories by name, branch, or path
  6. To create a new worktree: choose a target repository from the selector (defaults to the current repo), type a new branch name, and click "创建"

The selected/created worktree directory is registered as a dsh workspace and the sidebar switches to it.

合并状态配色

分组开启后,侧边栏里每个 worktree 行的分支徽标会体现它是否已经合回主干:

  • 基准分支 = 该仓库主工作树当前检出的分支(/api/topology 的 mainBranch)。主工作树自身是基准,不参与判定,保持蓝色。
  • 判定方式 = 该 worktree 分支的 tip 是否可从基准到达,即完全合并(git branch --merged);detached HEAD 的 worktree 改用其 HEAD 提交做单点祖先判定(git merge-base --is-ancestor)。合并后又有新提交的算未合并。
  • 绿色 = 已合并到基准;蓝色 = 未合并。
  • 徽标的 hover 提示会写明 已合并到 <基准> / 未合并到 <基准>。
  • 判不出来时(基准不存在,例如主工作树处于 detached HEAD)不在 /api/topology 的 worktree 行上给 merged 字段:徽标保持蓝色,但提示只显示分支名,不会被误报成「未合并」。

判定在宿主侧完成(/api/topology 的 worktrees[].merged),客户端只负责取色,因此拓扑刷新时状态会一起更新。

API Reference

GET /plugins/dsh-worktree-manager/api/list

Query parameters: repoPath (required)

Returns:

{
"worktrees": [
{
"path": "/repo/main",
"head": "abc123...",
"branch": "main",
"bare": false,
"locked": false,
"prunable": false
}
]
}

GET /plugins/dsh-worktree-manager/api/topology

No parameters. Scans every registered dsh workspace, resolves its git repository root via git rev-parse --git-common-dir (so linked worktrees group under their main worktree), and returns one entry per distinct root — repo discovery, per-repo worktree lists and merge status all in one response.

{
"repos": [
{
"root": "/path/to/repo",
"name": "repo",
"mainBranch": "main",
"worktrees": [
{ "path": "/path/to/repo-worktrees/feature", "branch": "feature", "merged": true, "locked": true }
],
"workspaces": [
{ "id": "ws-uuid", "path": "/path/to/repo", "title": "repo" },
{ "id": "ws-uuid-2", "path": "/path/to/repo-worktrees/feature", "title": "feature" }
]
}
]
}

worktrees lists only linked worktrees (the main worktree is root itself); merged is absent when the host could not decide (e.g. the main worktree is on detached HEAD). locked/prunable are present only when set, for dropdown badges.

GET /plugins/dsh-worktree-manager/api/changes

Query parameters: path (required, any directory inside the repo/worktree)

Returns the working-tree changes of the containing worktree. Submodule pointer rows are excluded from files and reported per submodule instead; each submodule's own working-tree changes are listed file-level.

{
"root": "/path/to/worktree",
"branch": "main",
"files": [{ "code": "??", "path": "new.txt" }],
"submodules": [
{
"path": "sub",
"name": "sub",
"newCommits": true,
"uninitialized": false,
"files": [{ "code": " M", "path": "a.txt" }]
}
]
}

GET /plugins/dsh-worktree-manager/api/history

Query parameters: path (required), limit (optional, 1–200, default 50)

Returns { root, branch?, commits: [{ hash, subject, author, date }] } (date = epoch ms). Empty commits for a repository with no commits yet.

GET /plugins/dsh-worktree-manager/api/commit

Query parameters: path (required), hash (required, commit hash), sub (optional, submodule path relative to the worktree root)

Returns one commit's changed files. Submodule pointer rows become submodules entries listing the submodule commits between the old and new pointer (git -C log old..new). With sub, hash refers to a commit inside that submodule instead — the handler runs git diff-tree inside the submodule and returns only that commit's files (empty submodules).

{
"files": [{ "code": "M", "path": "f.txt" }],
"submodules": [{ "path": "sub", "name": "sub", "commits": ["abc1234 sub change"] }]
}

GET /plugins/dsh-worktree-manager/api/diff

Query parameters: path (required), file (required, repo-relative), sub (optional, submodule-relative directory the file lives in), hash (optional, commit hash)

Returns { diff } — the unified diff of one file. With hash, the commit's diff for the file; otherwise the working tree vs HEAD (staged + unstaged). Untracked files fall back to a /dev/null pseudo-diff. file/sub must stay inside the worktree (absolute paths and .. segments are rejected).

POST /plugins/dsh-worktree-manager/api/create

Body:

{
"repoPath": "/path/to/repo",
"branch": "feature/my-feature",
"newBranch": true,
"targetPath": "/path/to/worktree"
}

Returns the created worktree info and the dsh workspace ID.

POST /plugins/dsh-worktree-manager/api/remove

Body:

{
"worktreePath": "/path/to/worktree",
"force": false
}

Deletes the worktree from its main worktree and unregisters the dsh workspace registered for it (if any).

POST /plugins/dsh-worktree-manager/api/branches

Body:

{
"repoPath": "/path/to/repo"
}

Returns { "branches": ["main", "develop", ...], "current": "main" }.

License

MIT

常见问题

6 问
答案由本站依据条目字段整理,不引用上游原文
dsh-worktree-manager 怎么安装?

本站没有抓到该条目的安装命令,请到仓库主页确认安装方式;这类条目多数是生态应用或尚未发布安装包的项目。

dsh-worktree-manager 的验证等级是什么意思?

未标注验证等级。上游未给出验证结论,安装前请自行确认

dsh-worktree-manager 安全吗?

未标注。

dsh-worktree-manager 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

dsh-worktree-manager 有哪些功能?

工作区选择器注入 Git Worktree 按钮、按仓库分组列出并折叠 worktree、跨仓库按名称/分支/路径搜索、新建分支 worktree 并自动注册、查看变更、提交历史与文件 diff。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

同名或近似条目

1 条
不同作者的仓库分开列,请确认你要装的是哪一个
会话与消息
按星标排序,可作替代方案

dsh-desktop

dsh-desktop

为 DeepSeek Harness (DSH) 插件生态打造的现代化桌面端解决方案。万物皆「插件」,桌面本身也是「插件」。

L3 · 安装规范通过 3.0 万 星

openpets

openpets

L4 · 沙盒安装通过 1,274 星

deeptide

deeptide

L4 · 沙盒安装通过 1,104 星

jingyun-dsh

jingyun-dsh

井云 DSH 客户端插件,为 DeepSeek Harness 注入会员登录、订阅支付、算力管控与应用市场,让智能体和技能快速变成可交易商品

L3 · 安装规范通过 1,004 星

study-mate

study-mate

StudyMate 是 DSH 的「学习模式」预设与技能包,为数学、计算机科目定制学习路线、讲解课件与练习评估,跨科目共享记忆。

未标注验证等级 856 星

shenkonghui 的其它插件

1 个

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 —。