dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
GitHub-connected visual git panel for DeepSeek Harness - branch switcher, file-level approval cards, PR/issue workspace
A GitHub-connected visual git manager for DeepSeek Harness — guided GitHub-Flow steps, commit graph with PR/CI badges, one-click GitHub login, and structured git tools for the agent.
Its panel chrome is built the way dsh-better-sidebar builds its own: every color, type role and motion value rides a DSH theme token, the chrome is flat (hairlines and hover fills, no shadows in the flow), and icon-only controls are round and transparent until hovered. Light/dark and any dsh-web-ui skin re-skin the panel for free — the panel contains no palette of its own and no theme selector. See DESIGN.md.
Renamed from gitcompass in 2.0.0. The package, the plugin row id (
dsh-git-manager), the HTTP routes (/gitm/*) and the CSS surface (--gm-*) all moved together. The model-facing tool names (git_status,git_commit,github_pr_*, …) are deliberately unchanged — they name the operation, not the product.
gh CLI reuse, encrypted token storage (DPAPI on Windows).git_status, git_diff, git_branches, git_commit, git_push, github_pr_list/read/create/merge/comment/review, github_issue_list/read/create/comment.never, e.g. the danger-full-access preset) cannot veto the panel card — the panel approval path works under any approval policy. Panel decisions are one-shot and memory-only; with no panel connected the call fails fast with a hint to open the panel (or pre-approve the tool there), instead of silently hanging for 5 minutes.dsh-better-sidebar is installed the panel contributes itself as one of its sidebar tabs and gives up its own column to it; without it the panel keeps its standalone right-column card, now collapsible. See below.dsh plugin --profile web add dsh-git-manager
Or for local development:
dsh plugin --profile web add link:/path/to/dsh-git-manager
Restart dsh web, open a session bound to a git repository, and the "Git Manager" panel appears in the right-side column.
src/
index.ts # Cordis plugin entry: register routes + tools + system prompt
tools.ts # Model-side structured git/GitHub tools (approval race for writes)
core/types.ts # Shared TypeScript types
host/
git-service.ts # Workspace-bounded git operations
routes.ts # /gitm/* HTTP routes (incl. SSE stream /gitm/events, approval endpoint)
event-bus.ts # In-memory event bus + pre-approvals + panel approval broker + repo observer
github-service.ts # GitHub REST wrapper (token never leaves host)
github-auth.ts # Device flow, DPAPI token storage, gh CLI sync
client/
index.ts # Browser entry: picks the host (better-sidebar tab vs standalone)
embed.tsx # better-sidebar tab registration (structural, optional peer)
shell.tsx # Standalone host: the collapsible dock card
Panel.tsx # Main panel: Branches / Changes / Graph / PRs / Issues / GitHub / Agent
styles.ts # The whole stylesheet, on host theme tokens (see DESIGN.md)
api.ts # Typed fetch wrapper over /gitm/* routes
events.ts # SSE subscription + the shared event store behind the tab badge
i18n.ts # Bilingual dictionary (zh/en)
icons.tsx # The single inline-SVG icon source (16px grid, 1.5 stroke)
graph.ts # Commit DAG lane layout algorithm
The plugin never claims a surface the host already owns:
dsh-better-sidebar present — the panel registers a sidebar tab (dsh-git-manager:panel, titled "Git Manager" / "Git 管理", idempotent) and does not mount its own column. You open it from the sidebar's new-tab list; it then persists with the session. The tab carries a live badge with the number of write operations waiting for your approval.dsh-better-sidebar absent — the panel keeps its own right-column card, with a collapse handle in its header. Collapsing leaves just that header strip and stops all polling (nothing hits git in the background); the state persists.The detection is a runtime probe (ctx.get('betterSidebar')), so better-sidebar stays an optional peer: no hard dependency, no build-time import of its types, and a failed registration degrades to the standalone card instead of losing the panel. It can be overruled with localStorage['gm.host'] = 'dock' | 'tab' (default: auto).
The panel also follows the session's workspace: it resolves the cwd of the session it belongs to (the tab's scope.cwd, else the active session), and re-selects the repository whenever you switch sessions — adding it to the list first if it was never seen (the host walks up to the innermost repository root, so a session sitting in a nested repo gets that repo rather than the workspace containing it). A repository you picked by hand is never overridden.
A session workspace is often only a container — D:\Harness holds a dozen independent repositories — so following the session cwd alone can never tell you which one you are actually editing. The host therefore also watches tools/execute: it reads the path arguments of the file tools (read, write, edit, grep, glob, …), walks up to the enclosing repository root, and auto-registers that repository into the picker. A file that does not exist yet counts too — the observation happens before the tool runs, so a write creating a new file is exactly the case that matters.
name · auto in the picker, so a shelf that grows by itself stays visible instead of mysterious.repo:auto-added is emitted on the activity stream each time one lands.config.autoRegisterRepos: false on the plugin row — the strip below still reports what is being touched.A two-line strip under the repo picker is always visible and answers both questions at a glance:
Session folder D:\Harness
Editing D:\Harness\dsh-learn-wiki
The first line is the session folder the panel follows; the second is the folder the agent is touching right now (Editing for writing tools, Reading for read-only ones). When the second one is a known repository that is not currently selected, a Switch button appears beside it.
pnpm install
pnpm run build
Build output: lib/ (host) and client/ (browser bundle).
node scripts/test-activity.mjs # file-activity auto-registration (isolated temp home)
MIT