{"_id":"@dsh-mixxed/dsh-client-ui-git-branch","_rev":"2-e42745b91c0d3d422cf0ea2bd7362998","name":"@dsh-mixxed/dsh-client-ui-git-branch","dist-tags":{"latest":"0.5.1"},"versions":{"0.5.0":{"name":"@dsh-mixxed/dsh-client-ui-git-branch","version":"0.5.0","keywords":["dsh","plugin","deepseek","git","branch"],"license":"MIT","_id":"@dsh-mixxed/dsh-client-ui-git-branch@0.5.0","maintainers":[{"name":"dragons96999","email":"dragons96999@163.com"}],"homepage":"https://github.com/dsh-mixxed/dsh-client-ui-git-branch#readme","bugs":{"url":"https://github.com/dsh-mixxed/dsh-client-ui-git-branch/issues"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"},"client":{"inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-slots"],"platform":"web"}},"dist":{"shasum":"3633b627493e34c28603205342e1e89cde1eef57","tarball":"https://registry.npmjs.org/@dsh-mixxed/dsh-client-ui-git-branch/-/dsh-client-ui-git-branch-0.5.0.tgz","fileCount":10,"integrity":"sha512-tb3Chb5/97ltPZ3xq7wcsEXwxAmqHRCYVeeK//evdBYX+u1v/KDj5DvLkHbWtpNYcSuM3WLJr3iBur+jr6igbg==","signatures":[{"sig":"MEQCIE6w1KA5YTjrL9ThvkE6fW0fBSu+vSEAIIxMJOTYdssmAiA2U+JcAgjuoO7csr/6AtWTAUghlkiZSYojNiaOhu0Irw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":135998},"type":"module","exports":{".":"./lib/index.js","./client":"./lib/client.js","./package.json":"./package.json"},"gitHead":"677df475d2738245c2904bfd31abed005f1a4de2","scripts":{"pack":"npm pack","test":"vitest run","build":"node scripts/build.mjs","prepack":"npm run build","typecheck":"tsc -p tsconfig.json"},"_npmUser":{"name":"dragons96999","email":"dragons96999@163.com"},"repository":{"url":"git+https://github.com/dsh-mixxed/dsh-client-ui-git-branch.git","type":"git"},"_npmVersion":"11.9.0","description":"Out-of-tree dsh plugin: a git branch selector in the chat composer, immediately left of the model seat (current branch, fuzzy search, 5-row scroll, switch with conflict toast).","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"clsx":"^2.0.0","jsdom":"^26.0.0","react":"18.3.1","vitest":"^3.0.0","esbuild":"^0.25.0","react-dom":"18.3.1","typescript":"^5.7.2","@types/node":"^24.0.0","@types/react":"^18.3.12","lightningcss":"^1.29.0","@types/react-dom":"18.3.0","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-client-locale":"0.1.0-rc.6","@deepseek-ai/dsh-client-runtime":"0.1.0-rc.6","@deepseek-ai/dsh-host-webserver":"0.1.0-rc.6","@deepseek-ai/dsh-client-ui-slots":"0.1.0-rc.6","@deepseek-ai/dsh-client-ui-primitives":"0.1.0-rc.6","@deepseek-ai/dsh-client-ui-conversation":"0.1.0-rc.6"},"_npmOperationalInternal":{"tmp":"tmp/dsh-client-ui-git-branch_0.5.0_1786857937780_0.2882201452927642","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@dsh-mixxed/dsh-client-ui-git-branch","version":"0.5.1","description":"Out-of-tree dsh plugin: a git branch selector in the chat composer, immediately left of the model seat (current branch, fuzzy search, 5-row scroll, switch with conflict toast).","type":"module","license":"MIT","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"repository":{"type":"git","url":"git+https://github.com/dsh-mixxed/dsh-client-ui-git-branch.git"},"keywords":["dsh","plugin","deepseek","git","branch"],"exports":{".":"./lib/index.js","./client":"./lib/client.js","./package.json":"./package.json"},"dsh":{"client":{"platform":"web","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-slots"]},"bundle":{"patch":"./cordis.patch.yml"}},"scripts":{"build":"node scripts/build.mjs","prepack":"npm run build","typecheck":"tsc -p tsconfig.json","test":"vitest run","pack":"npm pack"},"devDependencies":{"@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-client-locale":"0.1.0-rc.6","@deepseek-ai/dsh-client-runtime":"0.1.0-rc.6","@deepseek-ai/dsh-client-ui-conversation":"0.1.0-rc.6","@deepseek-ai/dsh-client-ui-primitives":"0.1.0-rc.6","@deepseek-ai/dsh-client-ui-slots":"0.1.0-rc.6","@deepseek-ai/dsh-host-webserver":"0.1.0-rc.6","@types/node":"^24.0.0","@types/react":"^18.3.12","@types/react-dom":"18.3.0","clsx":"^2.0.0","esbuild":"^0.25.0","jsdom":"^26.0.0","lightningcss":"^1.29.0","react":"18.3.1","react-dom":"18.3.1","typescript":"^5.7.2","vitest":"^3.0.0"},"gitHead":"979ec9fe0a3c51174f22eed11dddf47dc2d84b69","_id":"@dsh-mixxed/dsh-client-ui-git-branch@0.5.1","bugs":{"url":"https://github.com/dsh-mixxed/dsh-client-ui-git-branch/issues"},"homepage":"https://github.com/dsh-mixxed/dsh-client-ui-git-branch#readme","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-vCUy522hPyqwhtkTkcd+h2ADk1WkZ69GiTGPtVlZHi2vOOy9P2GM36IsMJWann2iB4DsqwKaX91ratFHfcVYfg==","shasum":"f141a88e87eb3d92cd8e5074e8badde6fdef073b","tarball":"https://registry.npmjs.org/@dsh-mixxed/dsh-client-ui-git-branch/-/dsh-client-ui-git-branch-0.5.1.tgz","fileCount":10,"unpackedSize":144193,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC2hXdgR8a5aXksp85OkAWvNEIqE2J+dR5uFfTdgNOLeAIgIjWjSryyzud0/kZ02vgnkxJ0yub7c67w1xxJ4sOvanc="}]},"_npmUser":{"name":"dragons96999","email":"dragons96999@163.com"},"directories":{},"maintainers":[{"name":"dragons96999","email":"dragons96999@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-client-ui-git-branch_0.5.1_1786883191228_0.4377600054368902"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-16T05:25:37.627Z","modified":"2026-08-16T12:26:31.526Z","0.5.0":"2026-08-16T05:25:37.975Z","0.5.1":"2026-08-16T12:26:31.367Z"},"bugs":{"url":"https://github.com/dsh-mixxed/dsh-client-ui-git-branch/issues"},"license":"MIT","homepage":"https://github.com/dsh-mixxed/dsh-client-ui-git-branch#readme","keywords":["dsh","plugin","deepseek","git","branch"],"repository":{"type":"git","url":"git+https://github.com/dsh-mixxed/dsh-client-ui-git-branch.git"},"description":"Out-of-tree dsh plugin: a git branch selector in the chat composer, immediately left of the model seat (current branch, fuzzy search, 5-row scroll, switch with conflict toast).","maintainers":[{"name":"dragons96999","email":"dragons96999@163.com"}],"readme":"# dsh-client-ui-git-branch\n\n[English](README.md) | 中文\n\n一个 dsh（DeepSeek Harness）out-of-tree 插件：在对话输入栏中、**模型选择的正左侧**\n（`conversation.input.right`）添加一个 **git 分支选择器**。\n\n## 安装\n\n1. 从 npm 安装插件（已发布为 `@dsh-mixxed/dsh-client-ui-git-branch`）：\n\n   ```sh\n   dsh plugin --profile web add @dsh-mixxed/dsh-client-ui-git-branch\n   ```\n\n   包声明了 `dsh.bundle`（包内自带 `cordis.patch.yml`），因此 `dsh plugin add` 会自动把它追加进\n   profile 的 `dsh.profile.bundles` 层栈，下次启动自动挂载——**无需手动编辑 cordis.patch.yml**。\n\n   从旧版本（未声明 bundle）升级：请删除 `$DSH_HOME/profiles/<name>/cordis.patch.yml` 中旧的\n   `ui-git-branch` 挂载行——bundle 层现在会提供它，两者并存会挂载两次。\n\n2. **重启 profile**（新增插件的发现需要重启）并刷新浏览器页面。打开工作区为 git 仓库的会话，\n   模型选择左侧即出现分支 chip。\n\n### 源码构建（开发 / 离线）\n\n```sh\npnpm install\npnpm run typecheck\npnpm test\npnpm run build\nnpm pack          # 生成 dsh-mixxed-dsh-client-ui-git-branch-<version>.tgz\ndsh plugin --profile web add ./dsh-mixxed-dsh-client-ui-git-branch-<version>.tgz\n```\n\n## 功能特性\n\n- 座位位于**模型选择左侧**，chip 与菜单外观与模型选择完全一致\n- 仅当本机安装了 `git` **且**当前会话工作区是 git 仓库时才显示\n- 分支**模糊搜索**（子串或按序子序列匹配），带清除按钮\n- 列表**最多同时展示 5 行**；更多分支通过列表内部滚动条查看（不滚动页面）\n- **当前分支以不同颜色特别标注**（品牌蓝 + 勾选图标）\n- **上游关联信息（VSCode 风格）**：每个分支显示其远程短名（`origin/main`），配彩色\n  领先/落后提交计数（`↑2` 琥珀色 / `↓3` 绿色），上游被删除时显示红色 `gone` 标记；\n  纯本地分支不显示任何关联信息。当前分支不同步时，触发器 chip 上也会显示同样的徽标\n- **本地 / 远程分组**——见 [分支分组](#分支分组)\n- **新建分支**：弹窗输入分支名，从 HEAD 创建并自动签出（`git switch -c`）；非法名实时\n  提示，重名冲突显示 git 原始报错\n- 切换分支带冲突检测：切换失败（通常是未提交改动会被覆盖）弹出 Toast 显示 git 原始报错\n- 完整 **中 / 英 i18n** 与多主题自动适配（全部基于 `--dsw-*` 设计令牌）\n- 分离 HEAD 安全（触发器回退显示 `HEAD`）；无提交的新仓库也能列出当前分支\n\n## 分支分组\n\n列表在两个 sticky 标题下分组展示：\n\n- **本地分支**——全部本地分支。有关联远程的分支保留其上游映射\n  （`master → origin/master`，含领先/落后计数）。\n- **远程分支**——仅显示**远程存在、本地没有对应分支**的分支\n  （`origin/HEAD` 符号引用与裸远程 ref 已排除）。\n\n交互行为：\n\n- 模糊**搜索同时作用于两个分组**；无匹配项的分组自动折叠隐藏。\n- 点击**远程**分支：创建本地跟踪分支并切换（`git switch --track origin/feature` →\n  本地 `feature` 跟踪 `origin/feature`），随后该分支移入本地分组。\n- 点击**本地**分支：切换工作树（`git switch`）；切换被阻止（通常是未提交改动会被覆盖）\n  时弹出 Toast 显示 git 原始报错。\n\n## 验证\n\n```sh\ndsh --profile <name> --dump-config | Select-String ui-git-branch\n```\n\n组合后的配置包含 `ui-git-branch` 行，且 `$DSH_HOME/profiles/<name>/package.json` 的\n`dsh.profile.bundles` 中列出了 `@dsh-mixxed/dsh-client-ui-git-branch`（由 `dsh plugin add`\n自动追加）。\n\n重启后，输入栏显示分支 chip；展开可见分组列表、搜索框与「新建分支」入口。\n\n## 开发\n\n```sh\npnpm run typecheck   # 严格 tsc（src + tests）\npnpm test            # vitest：host 逻辑（fake runner）+ 真实 git 集成 + jsdom 组件测试\npnpm run build       # esbuild 双产物 → lib/index.js（node ESM）+ lib/client.js（浏览器 CJS 闭包）\n```\n\n开发用独立测试 profile：`git-branch-dev`（与用户的 `web` profile 隔离），以\n`dsh --profile git-branch-dev --port 3800` 启动。\n\n## 许可证\n\nMIT\n","readmeFilename":"README.zh.md"}