dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
给 dsh-better-sidebar 用的仓库图谱页,分叉自 @linxin666/dsh-client-ui-git-graph 0.4.8(上游开发仓库为 zhu1090093659/dsh-web)。两者都占用 /git 路由前缀,不能同时安装,只能二选一。它会发现工作区目录往下三层以内的 Git 仓库(最多 200 个,跳过 node_modules、dist、build、out、coverage、target、vendor 与点目录),按树状列出并显示分支、head、脏文件数与冲突数,把选中仓库的提交图渲染成 SVG 泳道画布(跨泳道曲线、合并菱形、ref 徽章、行缩放与可固定的提交详情卡)。它会写入仓库:「初始化 Git 仓库」按钮会执行 git init,规范选择器会把 GIT_CONVENTIONS.md 写进仓库(或写一份工作区级的 .dsh/GIT_CONVENTIONS.md 供子仓库继承),内容来自六套框架——约定式提交、GitHub Flow、Git Flow、主干开发、约定式分支、GitLab Flow。host 会在每个模型步骤前把该文档注入 system prompt,并按文档自己声明的规则标出最近 20 个提交里不符合的那些;中文、英文与中英混排的标题都接受,可选的强约束模式会写入 strict: true。同时保留了上游插件的输入框分支徽章、交互式提交图对话框与 worktree 管理器。
English | 中文
A Git browsing plugin for DeepSeek Harness (DSH): a branch chip in the composer, plus a Repository graph tab inside dsh-better-sidebar that lists the Git repositories found up to three levels below the current workspace directory and draws the selected repository's commit graph as an SVG lane canvas.
The tab works from the session's working directory and treats that directory as a container: Git repositories up to three levels below it are reachable without registering each repository as a separate DSH workspace.
git for-each-ref per repository returns the branch time, the upstream and the ahead/behind distance in one call; while the refs have not moved the whole answer comes from the last scan, and only the status probe (dirty files, conflicts) is repeated. A workspace full of repositories no longer gets slower with every extra one.main and origin/main name the same branch, so they share a chip and mute together; symbolic refs such as origin/HEAD never become chips; tags are not filters either (a tag points at a single commit, so muting it would hide one row) and stay on the commit rows as badges; the order is the current branch, other local branches, then remote-only branches, anything past twelve folds into +N, and a *Clear filters* chip appears while something is muted. Fewer than four filterable branches and the row is not drawn at all. Row badges and the exported SVG use the same labels.− / + scale the rows and their text from a compact single line up to a roomy list.×) to clear.git-graph-.svg; environments without Blob/object URLs fall back to copying the markup.draft / settled / missing), opens it in the editor, and offers six proven frameworks to bootstrap a brand-new repository.main / master / trunk / develop), runs git init -b there, and then the conventions scaffold and framework picker open by themselves. It refuses when the directory already sits inside a repository, so it can never re-root an existing checkout.type: feat / fix / docs, subject ≤ 72, lowercase start, no trailing period, imperative, plus Chinese / English / Chinese + English when the document names a subject language, and an amber *Strict* chip for a strict document. What you see is exactly what the agent is told. It does not tally commits that are already written: nothing in the panel can change them, so a count would be noise. A document with no checkable rule says so instead of guessing./.dsh/GIT_CONVENTIONS.md in one click; a repository without its own document inherits it and the injected block names the directory it came from.strict: true, and the injected block then tells the agent to rewrite an offending message before committing; the conventions strip shows a *Strict* badge. The list collapses as soon as a card is picked. A switch clicked on an existing document is stored right away, so the list always shows what the document says./.dsh/GIT_CONVENTIONS.md (strict flag, subject language, machine-checkable rules and the body) goes into the injected block, followed by the index of the repositories below it.language: zh|en|mixed, and the injected block repeats it as a single Subject language: … line; a Chinese subject under an English-only document is flagged, and the other way round, while a mixed document is judged by the other rules alone. A document without language: checks no language at all.新增 / 修复 / 文档 work as type aliases (so does a full-width colon), and the lowercase and imperative checks only run when the first word is Latin, so Chinese subjects are never flagged for case.The chip that ships with the upstream plugin is unchanged: on a blank conversation it lets you switch or create a branch, and it opens the interactive commit-graph dialog and the worktree manager. Branch operations run in the host process; the chip hides itself on active sessions.
Item · Value DSH · >=0.2.1-rc.2 =24.0.0 dsh-better-sidebar · needed for the tab only — without it the plugin still loads and the chip keeps working
Grab the prebuilt bundle from the latest release — dsh-git-graph-sidebar.tgz, no build step needed — then install it as a plugin bundle:
.tgz from the app's plugin page.dsh plugin --profile <profile> add github:Athosoo/dsh-git-graph-sidebar
# or from the downloaded tarball
dsh plugin --profile <profile> add ./dsh-git-graph-sidebar.tgzRestart DSH after installing. The host half registers its /git/* HTTP routes at startup, so a page refresh alone is not enough for a first install, and an upgraded build is not picked up until the process restarts.
The tab needs dsh-better-sidebar installed; without it everything else — the branch chip, the graph dialog, worktrees — keeps working and only the sidebar tab is absent.
Rule · Value Scan depth · 3 levels below the working directory (a repository found at a level is not descended into) Upper bound · 200 repositories per scan, then the result is flagged as truncated Skipped directory names · node_modules, dist, build, out, coverage, target, vendor — plus every dot-directory Repository marker · a .git entry (directory, file or symlink — so worktrees and submodules are both detected) Per-entry status budget · 5 s; an entry whose git status did not return in time is still listed, without branch metadata Cache · 60 s per base path, shared between concurrent requests; the tab's refresh button bypasses it
A commit graph shows what happened; a conventions document records what the team agreed to do next time. The tab can bootstrap that document for every repository it lists.
待定 / *to decide* and status: draft, so the team fills in the decisions instead of inheriting someone else's defaults.unborn HEAD) gets the empty scaffold automatically, and the framework picker opens right away. Repositories that already contain commits but no document are listed as missing it; one click writes the scaffold.status: settled:Framework · Best for Conventional Commits · changelogs and semantic versions generated from commit messages GitHub Flow · small teams shipping from main with short-lived feature branches Git Flow · versioned releases promoted across several environments Trunk-based development · continuous delivery with very short-lived branches Conventional Branch · branch names that encode type and issue reference GitLab Flow · explicit environment branches between main and production
force, which the UI does not offer for settled documents. The document is plain Markdown in the repository root, so it is reviewed and revised like any other source file.systemPrompt section that is assembled before *every* model step, so the running agent is always told where the document is for the session's repository and gets its rules (up to 3 000 characters) inline. Nothing is injected for a workspace where no repository documents anything, and the text is cached per file mtime, so a step never re-reads an unchanged file.inherited Git conventions and names the repository it came from, so an agent inside packages/api follows the container's rules until packages/api writes its own. The index walks up to three levels down, skipping dot directories and node_modules.A workspace does not have to start as a repository. When the root of the workspace is not one, the tab's toolbar offers Initialize Git repository (and a workspace with no repositories at all shows the same button in the empty panel).
git init creates the metadata directory; no file in the workspace is touched, and existing repositories below the workspace are unaffected.already-repository instead of creating a second root inside it.Registered by the host half under /git; all of them answer JSON ({ok:true,value} / {ok:false,error}), except /git/events, which is a server-sent event stream.
Route · Purpose /git/repos · multi-repository discovery for a path ({path, refresh?}) /git/status · branch, head, dirty/untracked/conflict counts /git/branches · branch list with the current one marked /git/graph · commit list with parents and refs ({path, limit?}) /git/switch · switch branch /git/create-branch · create and switch /git/worktrees · worktree list /git/worktree-add · create a worktree /git/worktree-remove · remove a worktree /git/conventions · convention document state for a repository plus the framework catalog ({path}) /git/convention · write the document ({path, framework?, force?}) /git/init · initialize a repository in a directory that has none ({path, branch?}) /git/cleanup · branch cleanup hints: merged/unmerged counts per local branch ({path}) /git/health · repository health: detached HEAD, branches without upstream, stash, large untracked files, .git size ({path}) Note: since 1.6.1 /git/cleanup and /git/health stay as read-only HTTP routes only; the tab no longer has an entry point, and the toolbar dropped *Overview* and *Full-window view*. /git/compliance · Commit compliance: the last 20 commits checked against the document's rules, with reasons (read-only; the panel shows the rules in force, not these historical offenders) ({path}) /git/convention/preview · upgrade preview: added/rewritten/removed section counts and titles, read-only ({path}, framework) /git/workspace-convention · workspace document: state, preview or write .dsh/GIT_CONVENTIONS.md ({path}, action, framework, force) /git/events · change notifications (polled by the UI)
Every route resolves the requested path with realpath and rejects it unless it lands inside a registered workspace. Nested repository directories are accepted; anything outside a workspace gets workspace-unknown.
git init for a directory that is not a repository yet — nothing else. No commits, no branch switching, no worktrees: those stay in the chip's dialog./git route prefix, and two registrations of the same prefix conflict. Install one or the other.node_modules, dist, …) is not listed either, by design.lib/index.js is edited directly (the added parts sit in marked //#region blocks); lib/client.js is generated by splicing src/client/graph/SidebarTab.js into it. See DEVELOPMENT.md.npm run build # splice src/client/graph/SidebarTab.js into lib/client.js
npm run check # node --check on both bundles
npm run validate # every t("…") key exists in both locale dictionaries
npm run preview # render the tab to preview/*.html without a running DSHnpm run preview writes standalone HTML files (dark and light theme) that show the tab with sample repositories and commits, so layout changes can be checked in a browser without installing anything.
Apache-2.0 — see LICENSE and NOTICE.
This is a fork of @linxin666/dsh-client-ui-git-graph 0.4.8 by linxin666, also Apache-2.0. The branch chip, the commit-graph dialog, the worktree manager and the host git service come from that project. Changes in this fork: renamed package, workspace gate widened from exact-path match to inside-a-workspace, added the /git/repos discovery route, added the better-sidebar tab (repository tree, SVG canvas, zoom, pinned commit card) and its locale keys.