packages/dsh-git-graph
zhu1090093659/dsh-web输入框上方提供 Git 分支选择器,并把分支泳道与提交历史画成图谱,沿着时间线找到任意变更。
在 DSH 新建会话页提供 Codex 风格的工作位置、worktree 与分支切换器,git 操作全部由 Host 半执行。
Codex-style Location / Branch switchers on the New Session screen of DeepSeek Harness, for workspaces that are git repositories.
在 DSH「新建会话」页给 git 工作区加一块 Codex 风格的「工作位置 / 分支」chip: 直接切 worktree、切分支、新建分支,git 事实与副作用全部由 Host 半执行 (写操作走该会话的沙箱策略)。
renders nothing when it is not.
local branch, and every linked worktree.
create-and-switch branch.
git check-ref-format.GIT_* selectors (GIT_DIR, GIT_WORK_TREE,GIT_INDEX_FILE, …) so a user shell cannot redirect the command to another repository; write operations (switch, switch -c, worktree add) are wrapped in the session's sandbox policy.
From GitHub:
dsh plugin --profile desktop add github:Qcsj777/dsh-worktree-branchAs a local link during development:
// ~/.dsh/profiles/<profile>/package.json
"dependencies": {
"dsh-worktree-branch": "link:D:/path/to/worktree-branch"
}The package ships its own Cordis patch (cordis.patch.yml) that inserts the host half with id worktree-branch. git must be on PATH.
Third-party bundles cannot add Remote namespaces, and a installed bundle's client half cannot call its own host half through host.call, so the two halves talk over same-origin HTTP:
GET /worktree-branch/state?session=<id>&cwd=<path>
POST /worktree-branch/action { sessionId, cwd, action, name?, path? }action is one of create-worktree, use-worktree, switch-branch, create-branch. The state payload is { repo, cwd, repoRoot, currentBranch, head, branches[], worktrees[], mainPath, atMain }.
client.js): registers the chip onconversation.hero.options, only on the New Session screen.
index.js): injects webServer, subprocess, sandbox,sandboxPolicy, worktrees, sessionController, sessions, workingDirectory; owns the routes above.
that is the feature, not a side effect. The switch itself does not move any files.
node check.mjs # self-check for git-parse.mjsMIT