@zhangzhian/dsh-devtools-git

中文文档
0.3.1发布于 2026/11/03MITTypeScriptES Module

dsh-devtools 的 Git 组件:源代码管理面板 + git_* 工具

原始使用文档
文档目录7 节
  1. 安装
  2. 提供什么
  3. 要求
  4. English
  5. Install
  6. What it provides
  7. Requirements

English | 简体中文

@zhangzhian/dsh-devtools-git

DSH 开发工具的 Git 组件:右栏的源代码管理面板,外加一套给 Agent 用的 git_* 工具。

Git 面板:状态分组、提交框、改动列表

安装

不要单独装它。装清单包 —— 它会作为依赖自动拉下来,并在插件页上给你一个可开关的组件行。

dsh plugin --profile web add @zhangzhian/dsh-devtools

提供什么

  • 宿主半:Agent 工具 git_status、git_diff、git_stage、git_commit。
  • 客户端半:面板 —— 状态分组(冲突 / 已暂存 / 未暂存 / 未跟踪)、按文件的 diff (平台的 DiffBlock,开成以文件名命名、可关闭的页签)、 提交图,以及提交 / 推送 / 拉取 / 抓取 / 合并 / 变基 / 存储的弹窗。
  • 提交默认带上全部改动:点「提交」会先 git add -A(修改 / 已暂存 / 未跟踪)再提交; 只想提交暂存区用菜单里的「只提交已暂存文件」。
  • 推送被拒时自动整合再推:远端领先导致 non-fast-forward 时自动 fetch + pull (按 pullMode,默认合并)+ 重推一次;有冲突就停下并把冲突文件交给你(配置 pushAutoSync 可关)。

要求

  • dsh >= 0.2.0-rc.2。
  • 不需要额外装依赖:@deepseek-ai/* 由 dsh 安装本身提供(声明成 peer,不会重复安装)。

English

@zhangzhian/dsh-devtools-git

The Git component of DSH devtools: a source-control panel in the right sidebar, plus a set of git_* tools for the agent.

Git panel: status groups, commit box, changed files

Install

Do not install this package directly. Install the bundle package — it pulls this in as a dependency and gives you a switchable component row on the plugin page.

dsh plugin --profile web add @zhangzhian/dsh-devtools

What it provides

  • Host half: the agent tools git_status, git_diff, git_stage, git_commit.
  • Client half: the panel — status groups (conflict / staged / unstaged / untracked), per-file diffs (the platform DiffBlock, opened as a closable tab named after the file), a commit graph, and dialogs for commit / push / pull / fetch / merge / rebase / stash.
  • Commit takes every change by default: clicking Commit runs git add -A (modified / staged / untracked) first; use "Commit staged files only" in the menu to commit just the index.
  • Push auto-integrates when rejected: on non-fast-forward, it runs fetch + pull (per pullMode, merge by default) + retries the push once; conflicts stop at Pull and are handed back to you (pushAutoSync can turn this off).

Requirements

  • dsh >= 0.2.0-rc.2.
  • No extra dependencies: @deepseek-ai/* is provided by the dsh installation itself (declared as peer dependencies, so it is never installed a second time).

版本与发布记录

@zhangzhian/dsh-devtools-git 共发布 9 个版本,首次发布于 2026/10/08;过去 12 个月发布了 9 个版本。

版本发布日期距今
0.3.1latest2026/11/03今天
0.3.02026/11/012 天前
0.2.22026/10/2113 天前
0.2.12026/10/2014 天前
0.2.02026/10/2014 天前
0.1.22026/10/1123 天前

关于 @zhangzhian/dsh-devtools-git 的常见问题

@zhangzhian/dsh-devtools-git 是什么?

dsh-devtools 的 Git 组件:源代码管理面板 + git_* 工具

如何安装 @zhangzhian/dsh-devtools-git?

在项目目录运行 npm install @zhangzhian/dsh-devtools-git,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@deepseek-ai/cordis(~4.0.4)、@deepseek-ai/dsh-fs(^0.2.0-rc.2)、@deepseek-ai/dsh-llm(^0.2.0-rc.2)、@deepseek-ai/dsh-tools(^0.2.0-rc.2)、@deepseek-ai/dsh-session(^0.2.0-rc.2)、@deepseek-ai/schemastery(~3.18.4)、@deepseek-ai/dsh-subprocess(^0.2.0-rc.2)、@deepseek-ai/dsh-util-values(^0.2.0-rc.2)、@deepseek-ai/dsh-storage-domain(^0.2.0-rc.2)、@deepseek-ai/dsh-typert-protocol(^0.2.0-rc.2)、@deepseek-ai/dsh-session-projection(^0.2.0-rc.2)、@deepseek-ai/dsh-agent-default-model(^0.2.0-rc.2)、@deepseek-ai/dsh-api-workspace-files(^0.2.0-rc.2)、@deepseek-ai/dsh-api-session-controller(^0.2.0-rc.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@zhangzhian/dsh-devtools-git 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@zhangzhian/dsh-devtools-git 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@zhangzhian/dsh-devtools-git 可以商用吗?

@zhangzhian/dsh-devtools-git 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@zhangzhian/dsh-devtools-git 还在维护吗?

最新版本 0.3.1 发布于 2026/11/03(今天);至今共发布 9 个版本,其中过去 12 个月发布了 9 个;首次发布于 2026/10/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。