Skip to content

dsh-git

Verified

@hy-sde-org/dsh-git Β· v0.2.1-rc.5 Β· MIT

Agentic git plumbing for DeepSeek Harness: the host ctx.git service (diff parsing, hunk staging, commit/push/log over the subprocess seam) plus the vcs/repo-lock/worktree layers behind the commit/review/worktree tools in @hy-sde-org/dsh-tool-git.

Install

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

Confirm the layer applied with dsh --profile default --dump-config β€” see the install guide.

Source

Tags

Readme

@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)