hy-sde/dsh-git--packages-git ↗★ 0

@hy-sde-org/dsh-git

智能体 Git 操作主机端服务插件 作为底层服务,为上层 Git 工具提供差异解析、暂存、提交等 CLI 封装支持。

包名
@hy-sde-org/dsh-git
兼容性
待验证
Harness 依赖范围
^0.2.0-rc.2
Cordis 依赖范围
~4.0.4
版本
0.2.0-rc.2
许可证
NOASSERTION
最近更新
2026年10月3日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:hy-sde/dsh-git#189f27bec98e5eb8fc3797ccadc6196100b1d092&path:packages/git

@hy-sde-org/dsh-git

Host-plane ctx.git service for the DeepSeek Harness: a stateless, thin wrapper around the git CLI through the ctx.subprocess seam, plus the diff-parsing primitives and split-commit execution verbs the model-facing tools need. Consumed by @hy-sde-org/dsh-tool-git; never called by the model directly.

  • GitService — run / status / diffText / diffStat / stagedFiles / resetIndex / stageHunks / commit / log / currentBranch / isWorktree, plus push with remote/branch/upstream options and root for the review gate.
  • parseFileDiffs / parseNumstat / computeDependencyOrder / LOCK_FILES — pure diff + topo-sort + lock-file primitives.
  • vcs — TS contract port of omp's native pi-vcs surface (error taxonomy, repo discovery, newline-safe joinPatches, HEAD stat-poll watch).
  • withRepoLock — in-process per-repository mutation queue (repo-lock).
  • acquireWorktree / releaseWorktree / listWorktrees / pruneWorktrees / destroyWorktree — a durable-lease worktree pool with dry-run safety (worktree).
  • conventional — llm-git canonical commit-type vocabulary plus commit message normalization / validation (scopes, summaries, bodies, pep-595 length rules).
  • apply(ctx, config) registers ctx.git (subprocess seam required).

Port of omp (oh-my-pi)'s git layer — see LICENSE. The service owns no durable state and shells out per call, so one host instance serves every session; which repo the tools act on comes from the calling agent's session cwd at call time.

Install & mount

See the repo README.md — as a plugin:

dsh plugin --profile web add @hy-sde-org/dsh-git

The bundle cordis.patch.yml inserts the git row into the profile's base composition (stock INSERT patch form, safe on official releases). The tools mount from any user preset that copies examples/agent-preset/.

Development

pnpm install
pnpm run check   # tsc --noEmit
pnpm run build   # tsc -p tsconfig.build.json → dist/
pnpm run test    # vitest (89 tests: conventional/repo-lock/vcs/worktree/service/unit on real temp repos)