zhu1090093659/dsh-web--packages-dsh-git-graph ↗★ 5.8k
@linxin666/dsh-client-ui-git-graph
External dsh web GUI plugin: a blank-session git branch selector + Git graph, with real host-side git operations and guards, as a dsh profile bundle
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:zhu1090093659/dsh-web#8d02146df032e6de8d54b7a0aba2c9da039d47e4&path:packages/dsh-git-graph说明文档
阅读完整 README ↗dsh-git-graph
English | 中文
外部 dsh Web GUI 插件:git 分支选择器与Git 图谱面板。分支选择器只在空白会话显示,挂在官方输入选择器行的 context 洞(conversation.input.selector.context,session-maybe list 槽位)中,与官方工作区选择胶囊并排。若运行 shell 未声明该槽位(npm SDK rc.6 删除了它),等待 CONTEXT_FALLBACK_MS 后回退到 conversation.input.dock;在其空白会话 hero 相位,chip 会提升进官方 hero 行,紧贴 agent-preset 座位右侧,采用与官方工作区/预设胶囊一致的透明 28px 胶囊配方和 --dsw-* 主题 token。active 会话不提供分支选择控件。git 能力在 host 进程执行(磁盘工作树 git switch),UI 在浏览器 React;工作区选择保留官方入口。
行为对齐 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" } })。激活后,下次启动 (或对应 profile)时,bundle patch 的 insert 行把 (host half:git 服务 + 路由)与浏览器 half(dsh.client 声明)一起装进 Web 组合;页面刷新后,空白会话的分支胶囊显示在 hero 行的 agent-preset 座位右侧,active 会话不显示该控件。