dsh-knj-version-control: DSH Web-side Git Version Control Workbench

Preface

When developing agents or projects in DeepSeek Harness (DSH), the workspace often resides within a Git repository. However, daily tasks like modifying files, staging, committing, pulling, and pushing still require switching to a terminal or an external GUI. If the DSH Web right sidebar already has Better Sidebar enabled, the missing piece is a version control panel bound to the current workspace: one that provides visibility into local changes, controllable staging and committing, and readable previews with confirmation before write operations. Below is an introduction to the community plugin dsh-knj-version-control (maintainer yangdongzhen590). It registers a Version Control tab on the Web side, consolidating Local Changes, Commit, Update, Push, and branch switching into a single workbench. Furthermore, it outputs expandable, copyable host error codes and raw git output when Git operations fail.

What is this

dsh-knj-version-control belongs to the KNJ family of plugins and is positioned as a KNJ version-control workbench for DSH Web. It provides a local changes list, single and multi-file staging, confirmed commit / update / push operations, and readable Git failure details. Technically, it integrates via the public API dsh-better-sidebar.registerTab(), without importing or modifying Better Sidebar’s private UI, state, or Git code. It is categorized as a client-side plugin; the version in package.json is 2026.9.200. The repository is on GitHub, and the directory page is on SkillHub.

Host and Prerequisites

Better Sidebar (Optional Peer)

  • peerDependencies requires dsh-better-sidebar >= 0.15.2 and marks it as optional.
  • If the host lacks Better Sidebar or has a lower version, installation is not blocked; the plugin performs a runtime self-check, warns in the console, and exits gracefully without affecting other plugins.
  • This plugin does not pin a precise version of the sidebar; if your profile requires a unified sidebar version, you can define overrides in the profile’s pnpm-workspace.yaml.

Runtime Environment (from package.json)

  • Node: >= 22.19.0
  • DSH: >= 0.1.0-rc.6
  • Client injection: betterSidebar, Platform web

Git and Workspace

  • git must be installed and executable on the host PATH.
  • The current DSH session requires a workspace; non-Git workspaces can still be opened, but the UI will display a non-repository status.
  • Commit identity (user.name / user.email, etc.) must be configured by the user beforehand; the plugin does not modify identity, remote, credentials, or other Git configurations.

Core Features (v1)

The workbench registers a Version Control tab via an icon in the sidebar, featuring a change count badge and adopting a single strategy (reopening focuses the existing tab). The main areas within the tab are as follows:

Toolbar and Status

  • Branch Pill: Current branch with ↑ahead / ↓behind indicators; supports refresh; Update (fetch + fast-forward pull when allowed, with preview).
  • Status Line: HEAD branch, upstream, clean status or N change(s).

Local Changes

  • Grouped by type: Modified / Added / Deleted / Untracked / Conflicted, including counts per group, collapse/expand, status chips, and checkboxes.
  • Staging: When the repository supports staging, non-conflict rows have “Stage” / “Unstage”; multi-selection areas have “Stage Selected (N)” / “Unstage Selected (N)”; group headers have “Stage All” / “Unstage All”. Rows already in the index are marked Staged; conflict rows deliberately do not offer staging (conflict resolution should be completed outside the workbench).
  • Clicking a file row opens a dedicated diff page (preferring workspace diff, otherwise staged diff); side-by-side diff is reserved for future stages.

Branches and Commits

  • Clicking the branch pill: Lists local and remote branches with search support; Local branches trigger git switch after preview confirmation; remote branches are reserved behavior in v1 (prompt only).
  • Commit box: Explains the commit scope (git commit --only applies to checked files to avoid mistaking index status for commit content); supports Commit and Commit and Push… (two-step confirmation: commit confirmation then push confirmation). Amend is reserved.
  • Optional “Stage Selected Before Commit” (disabled by default): When enabled, the sequence is stage → preview → confirm.

View Reserves

  • Changes is the default view; Log and Console are placeholders in v1 and do not load data.

Failure Feedback

  • If commit, push, update, branch switch, or staging fails, a closable Failure Details dialog appears: mapped summary, host failure code, expandable/selectable/copyable Git output; failures within confirmation flows replace the confirmation box rather than showing a silent toast.

Security and Update Strategy (Design Points)

  • No arbitrary command input: All Git calls use execFile('git', fixedArgs).
  • Commit, Push, and Branch switch generate a preview token first, followed by an explicit confirmation requirement; the token is bound to the root path, operation, parameters, fingerprint, and expiration. Changes in repository state invalidate the token, and valid tokens are consumed after one use.
  • Update: Always fetch first. Uses git pull --ff-only when fast-forward is possible (still subject to fingerprint constraints; if Git refuses to overwrite uncommitted changes, the refusal reason is displayed). When histories have diverged, it pulls via merge (git pull --no-rebase), requiring confirmation and warning of potential conflicts; it does not auto-resolve, auto-stash, rebase, force-push, or auto-retry push.
  • In v1, Staging uses the same-origin /stage endpoint (no preview token), modifying only the reversible index; failures also include codes and Git output.
  • Staging and commit checkbox linkage: Staging checks the path, unstaging unchecks it, avoiding silent omissions where a file is “staged but not included in commit intent.”
  • The first version is Git-only; SVN and others are future boundaries (the SVN section in the README clarifies Git-only at the truncation point).

During ongoing refresh, preview, confirmation, staging, or update operations, the status line shows a spinner, toolbar buttons are disabled, and only one Git write operation is allowed in flight at a time.

Installation and Enablement

In the DSH installation directory/checkout, add the local package via DSH’s plugin/profile path (the README explicitly states: do not copy files directly into node_modules). The official example is a local Windows path:

dsh plugin --profile web add D:\workspace\iobs_pro\plugins\dsh-knj-version-control

Replace the path with your local clone or downloaded plugin directory; whether to pull source code from GitHub is up to you, and this article does not provide git clone steps.

Subsequently, restart or rebuild/reload the relevant Web artifacts according to your DSH version requirements, and refresh the existing GUI in your browser (the README example address is http://127.0.0.1:3080).

Note: package.json must be UTF-8 without BOM; DSH uses bare JSON.parse to read profile and plugin metadata, and BOM may cause startup failure.

Typical Usage (Reproducible Flow)

  1. Confirm git is installed on the host and the current DSH session is bound to a Git workspace; open the Version Control tab in Better Sidebar on the Web GUI.
  2. View grouped local changes in Changes; check files to be included in the next commit and use row-level or batch “Stage” / “Unstage” as needed.
  3. When differences need to be viewed, click the file row to view in the diff page (v1 describes this as “Workspace vs HEAD”; for partially staged files, the unstaged delta is shown).
  4. Fill in the commit message and use Commit; if pushing is required, use Commit and Push… to complete the two-stage confirmation.
  5. Sync remote: Toolbar Update performs fetch; fast-forward allows direct pull; if divergence exists, read the merge warning in the confirmation box before confirming.
  6. Switch local branch: Click the branch pill, select a local branch, and execute switch after preview confirmation; if the workspace is dirty, the confirmation box will prompt, and whether to continue is decided by Git.
  7. If any step fails: Read the raw Git output in the failure details dialog, handle conflicts or configuration issues in the workspace or external tools, then refresh and retry.

Applicable Scenarios and Notes

Who it is for

  • Developers already working in a DSH Web + Better Sidebar environment who wish to complete “View Changes → Stage → Commit → Pull/Push → Switch Branch” within the browser sidebar.
  • Those who value preview confirmation before write operations and retaining complete Git output on failure, rather than just fleeting notifications.

Must Know

  • The plugin executes git on the host with the current DSH process privileges; please review the source code and license yourself before installation to ensure compliance with your security and compliance requirements.
  • The community directory SkillHub has no official affiliation with DeepSeek or High-Flyer; the DSH ecosystem is “everything is a plugin,” and this article introduces a community-maintained client plugin.
  • The truncated README emphasizes the separation of Git-only and host workflow concepts; do not expect v1 to provide a complete Log console or SVN support.

Conclusion

dsh-knj-version-control brings daily Git operations into the DSH Web right-side Version Control workbench: structured Local Changes, controllable staging, token-based commit/push/switch/update confirmations, and readable Git output on failure. If your profile has Web and Better Sidebar enabled, you can integrate the local package via the README’s installation path and refresh the GUI to try it out.

  • Directory Page: https://www.skillhub.cn/plugins/yangdongzhen590/dsh-knj-version-control
  • GitHub: https://github.com/yangdongzhen590/dsh-knj-version-control
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye