dshbase

插件目录 / Developer / dsh-git-branch

dsh-git-branch

未验证 hanyueqiang

✓ 持续维护 基于 6 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

1Stars
0Forks
0未关闭 issue
语言
2026-08-16最近推送
跨平台平台

功能简介

Developer 类别的 DeepSeek Harness 插件。

我们的评价
未验证 — 尚未实测

Developer 类别的 DeepSeek Harness 插件。 尚未验证——请自行安装测试。

「未验证」表示我们的自动化 CI 尚未安装过该插件。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

你是插件作者? 想拿到「已验证」标签——提交你自己的验证证据(截图、日志或短视频),我们审核通过后即改为「已验证」。

提交验证证据 ↗

README

dsh-git-branch

English | 中文

Show the current workspace git branch right after the composer mode controls (access mode / plan) in the DeepSeek Harness (DSH) Web UI. It renders only when the workspace is inside a git repository, and it refreshes automatically when you switch branches in another tool.

Where it appears

The composer tool row is laid out as [+ commands] [access mode] [plan] ← branch chip. This plugin registers into the conversation.input.left slot — the additive seat immediately after the resident mode chrome — so the branch chip sits right next to the mode controls.

  • Branch: ⎇ main
  • Detached HEAD: ⎇ detached @ a1b2c3d
  • Not a git repository: nothing renders
  • Click the chip: refresh immediately (tooltip explains)

Install

The package is a DSH bundle (it ships its own cordis.patch.yml), so dsh plugin add both installs the dependency and activates it — no manual config:

# from npm
dsh plugin --profile web add dsh-git-branch

# or a local checkout (development)
dsh plugin --profile web add ./dsh-git-branch

Then restart the profile and refresh the page:

# restart dsh web, then reload the browser tab

How it works: package.json declares dsh.bundle.patch = ./cordis.patch.yml, which - inserts one git-branch plugin row. dsh plugin add detects dsh.bundle and adds the package to dsh.profile.bundles; on the next boot that patch layer takes effect, the host loads the host half, and the client half is served to the browser automatically.

Optional host config

To change the command name, override the row (same id) in your own profile cordis.patch.yml:

- id: git-branch
  name: dsh-git-branch
  config:
    commandName: git-branch   # optional; default is git-branch

Unknown config keys fail at load.

Client refresh constant

See the top of src/client/index.tsx (or lib/client.js):

  • POLL_INTERVAL_MS = 60000: slow safety-net poll; <= 0 disables it.

How it works

  • host: lib/index.js registers the /git-branch command; the handler walks up from session.header.cwd to the nearest .git (worktrees and submodules included), parses HEAD, and returns the result as JSON in the command's text field.
  • client: lib/client.js registers the conversation.input.left chip, fetches the branch through ctx.remote.commands.execute, and registers a conversation.chat.commandview entry for git-branch that renders null, hiding the transport command from the transcript.

Refresh triggers (see DESIGN.md): mount / session-or-workspace switch → immediate; window focus → immediate; visibilitychange → visible → immediate; chip click → immediate; 60s poll → fallback.

Layout

dsh-git-branch/
├── package.json          # dsh.bundle + dsh.client + peerDependencies
├── cordis.patch.yml      # bundle patch: inserts the git-branch plugin row
├── LICENSE
├── src/
│   ├── index.ts          # host half (TypeScript source)
│   └── client/index.tsx  # client half (TypeScript source)
├── lib/
│   ├── index.js          # host half (prebuilt)
│   ├── index.d.ts
│   ├── client.js         # client half (prebuilt, window.__ModuleLoader__ format)
│   └── client.d.ts
├── DESIGN.md             # git-branch refresh-rules design
├── README.md             # English (this file)
└── README.zh.md          # 中文

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-git-branch」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:hanyueqiang/dsh-git-branch

Headless(CLI)profile:

dsh plugin --profile headless add github:hanyueqiang/dsh-git-branch

实测报告

尚未 L3 验证——若已跑过,见下方失败备注。

状态:pending · 最近测试 2026-08-26
备注:验证: runtime-fail 浏览全部待验证失败 →
安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7795 个插件 →