zhu1090093659/dsh-web-ui--packages-dsh-git-graph ↗★ 514
@linxin666/dsh-client-ui-git-graph
External dsh web GUI plugin: a git branch selector + Git graph in the conversation header's context hole (beside the official workspace selector), with real host-side git operations (switch/create) and guards, as a dsh profile bundle
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:zhu1090093659/dsh-web-ui#ef3ef0dbcb057135c41bcd2b9b5cf85cfb3716e8&path:packages/dsh-git-graph说明文档
阅读完整 README ↗dsh-git-graph
外部 dsh Web GUI 插件:git 分支选择器与Git 图谱面板,挂在输入选择器行的上下文胶囊洞(conversation.input.selector.context)里,紧跟官方工作区选择器、直接 dock 在输入卡上方。git 能力在 host 进程真实执行(磁盘工作树 git switch),UI 在浏览器 React;工作区选择完全交给官方 header 入口(产品决策:自研选择器下线,不保留双入口)。
行为对齐 ZCode 的 GitBranchSwitcher:可搜索弹层、当前项打勾、「创建并检出新分支… / Git 图谱」底部操作、切换守卫(未解决冲突 / 进行中操作 / 目标分支被其他 worktree 检出)与可读报错。
仓库布局与构建
与 DeepSeek Harness 主仓保持同级(sibling checkout,turtle-ui 同款布局;路径任意,以下仅为示例):
~/code/deepseek-harness # deepseek-harness checkout(sibling)
~/code/dsh-git-graph # 本仓库
peer APIs 全部来自 sibling checkout 的源码(tsconfig 通过 ../deepseek-harness/tsconfig.base.json 的 paths 解析;sibling 目录名不同时把 tsconfig 各文件里的 ../deepseek-harness 相对路径换成实际目录即可),类型门是 pnpm run typecheck(tsc -b,会连带构建 references 指向的 sibling 包,向 sibling 的 lib/ 写声明产物——与 turtle-ui 相同的设计)。
pnpm install
pnpm run typecheck # tsc -b(含 sibling 引用项目)
pnpm test # vitest(core 纯函数 / 真实 git 服务 / jsdom 组件)
pnpm run build # tsc -b && tsdown(lib/index.js + lib/invariant.js + lib/client.js)
lib/client.js 是浏览器 bundle(闭包工厂产物,window.__ModuleLoader__.load),由 host 的 client-modules 按 /plugins//client.js 伺服;构建预设 build/tsdown.client.ts + build/web/src/platform.ts 是从主仓 packages/client/tsdown.client.ts / packages/client/web/src/platform.ts 复制的副本,主仓版本变更时需同步。
git 安装(无 sibling checkout 的消费者机器)走 prepare 脚本:tsdown --config tsdown.prepare.config.ts 从 src 直接 transpile,不做类型检查(tsconfig.prepare.json 自包含)。
激活
本包是 dsh profile bundle(package.json 声明 "dsh": { "bundle": { "patch": "./cordis.patch.yml" } })。激活后,下次启动 dsh web(或对应 profile)时,bundle patch 的 insert 行把 ui-git-graph(host half:git 服务 + /git/* 路由)与浏览器 half(dsh.client 声明)一起装进 Web 组合;页面刷新即可在输入框上方的选择器行看到分支胶囊。
通用安装(任何机器)
本插件已并入 dsh-web-ui 全家桶仓库(github.com/zhu1090093659/dsh-web-ui)。插件已发布到 npm,推荐一行安装:
dsh plugin --profile web add @linxin666/dsh-client-ui-git-graph