npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@captain1275/dsh-client-ui-git-graph

v0.3.1

Published

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

Downloads

2,669

Readme

dsh-git-graph

外部 dsh Web GUI 插件:git 分支选择器Git 图谱面板,优先挂在官方输入选择器行的 context 洞(conversation.input.selector.context,session-maybe list 槽位)里,与官方工作区选择胶囊并排、紧贴输入卡上方;若运行 shell 未声明该槽位(npm SDK rc.6 删除了它),等待 CONTEXT_FALLBACK_MS 后回退到 conversation.input.dock(0.1.9 的挂载点)。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 typechecktsc -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/<id>/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 组合;页面刷新即可在输入框上方的 composer dock 带看到分支胶囊。

通用安装(任何机器)

本插件已并入 dsh-web-ui 全家桶仓库(github.com/zhu1090093659/dsh-web-ui)。插件已发布到 npm,推荐一行安装:

dsh plugin --profile web add @captain1275/dsh-client-ui-git-graph

或直接安装全家桶聚合包 @captain1275/dsh-web-ui-all 一次到位(同样一行 dsh plugin --profile web add @captain1275/dsh-web-ui-all)。

需要改代码调试时再从仓库安装:

git clone https://github.com/zhu1090093659/dsh-web-ui.git
cd dsh-web-ui
pnpm install && pnpm -r build
dsh plugin --profile web add link:$(pwd)/packages/dsh-git-graph

github: 安装方式适用于包位于仓库根部的独立仓库(prepare 脚本自包含构建;pnpm ≥10 首次会被拒绝,需按报错提示把包 key 加进 profile 的 pnpm-workspace.yaml allowBuilds 后重试)。monorepo 内的子包请用上面的 link: 方式。

本地开发循环(本仓库 checkout)

dsh plugin --profile <name> add link:/absolute/path/to/dsh-git-graph

link: 安装直接引用本地目录,重建后立即生效、无需重装(改完 pnpm run build 后刷新页面即可)。注意 link: 后跟的是绝对路径(~ 由 shell 展开,不是 pnpm 语义)。

卸载

dsh plugin --profile web remove @captain1275/dsh-client-ui-git-graph

设计要点

  • 边界与加载链调研、关键决策见 docs/ADR-001-plugin-boundary.md
  • host half 的 /git/* 只接受已注册 workspace 的路径(realpath 校验),浏览器无法对任意目录执行 git。
  • 切换语义是工作区级:git switch --no-guess <branch> 作用于 repoRoot 磁盘树,影响该工作区所有会话;项目切换 = 激活目标工作区并打开其(复用或新建的)空白会话,不给既有会话换 cwd。
  • 挂载 seam:conversation.input.selector.context(官方声明的 session-maybe list 槽位)——输入选择器行的 context 洞,与官方工作区胶囊并排;hero(空白会话)与 active 会话相位都有分支胶囊;无会话 cwd 或非 git 工作区时分支 chip 自行隐藏。声明感知 + 回退:等待该槽位声明 CONTEXT_FALLBACK_MS(npm SDK rc.6 的 shell 已删除此声明),超时未声明则改挂 conversation.input.dock(session 相位才挂载,hero 无座位——rc.6 上接受的降级);只挂一个座位,回退后迟到的 context 声明被忽略。
  • 工作区选择不在此插件内:官方工作区胶囊(conversation.input.selector.workspace)是唯一入口,本插件只提供 git 分支上下文。
  • 分支状态刷新:挂载/弹层打开/切换成功后拉取 + host SSE(/git/events,订阅期间每 2s 轮询 workspace 状态)推送外部变更 + window focus 刷新。

检查链

pnpm run typecheck
pnpm test
pnpm run build