{"versions":{"2.0.0":{"name":"dsh-git-manager","version":"2.0.0","description":"A GitHub-connected visual git manager for DeepSeek Harness — guided flow (branch → commit → push → PR → review → merge), commit graph with PR/CI badges, one-click GitHub login, and structured git tools for the agent. Its panel chrome rides the DSH theme t","license":"MIT","author":{"name":"dsh-git-manager contributors"},"repository":{"type":"git","url":"git+https://github.com/Dayi-Z/dsh-git-manager.git"},"type":"module","main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":"^22.19 || >=24","dsh":">=0.1.0-rc.6"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"},"client":{"inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-slots"],"platform":"web"}},"scripts":{"build":"tsdown && npm run build:client","build:client":"tsdown --config tsdown.client.config.ts && node scripts/normalize-client-banner.mjs","typecheck":"tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit","check":"pnpm run typecheck && pnpm run build && node scripts/test-activity.mjs","test":"node scripts/test-activity.mjs","prepare":"pnpm run build","dev":"tsdown --watch"},"keywords":["dsh-plugin","deepseek-harness","git-manager","git","github","pull-request","ui"],"peerDependencies":{"@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-host-webserver":"^0.1.5-rc.1","@deepseek-ai/dsh-subprocess":"^0.1.5-rc.1","@deepseek-ai/dsh-tools":"^0.1.5-rc.1","@deepseek-ai/dsh-workspace":"^0.1.5-rc.1","dsh-better-sidebar":">=0.12.0"},"peerDependenciesMeta":{"dsh-better-sidebar":{"optional":true}},"devDependencies":{"@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-client-locale":"^0.1.5-rc.1","@deepseek-ai/dsh-client-runtime":"^0.1.0-rc.6","@deepseek-ai/dsh-client-ui-slots":"^0.1.5-rc.1","@deepseek-ai/dsh-host-webserver":"^0.1.5-rc.1","@deepseek-ai/dsh-subprocess":"^0.1.5-rc.1","@deepseek-ai/dsh-tools":"^0.1.5-rc.1","@deepseek-ai/dsh-workspace":"^0.1.5-rc.1","@types/node":"^22.13.0","@types/react":"~18.3.1","@types/react-dom":"~18.3.0","react":"^18.3.1","react-dom":"~18.3.1","tsdown":"^0.22.14","typescript":"^5.7.0"},"exports":{".":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"./client":"./client/client.js","./cordis.patch.yml":"./cordis.patch.yml","./package.json":"./package.json"},"gitHead":"903c16039b9450761d8aa0abc602053b3cdc938d","_id":"dsh-git-manager@2.0.0","bugs":{"url":"https://github.com/Dayi-Z/dsh-git-manager/issues"},"homepage":"https://github.com/Dayi-Z/dsh-git-manager#readme","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-FSsWYGlIvtLvOfIv/ujjY8TxnwsmpieXLCWegBv/Pl8ulm40H/fQTumP6XYcuOz3t7xp6UFcn0N9E5KkdXjhtA==","shasum":"c48e67f5d478f5455b30c9f8102305a7fb8034c9","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-git-manager/-/dsh-git-manager-2.0.0.tgz","fileCount":32,"unpackedSize":1374179,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCAoBpTF/l5NpuAm+EXCC1fIEZ9IuXK+1EuecxhwS4hNQIhAIkH51m9uVH3RSJxNfZ/8MuVzeWBROpn2Ftf1nGdgCXM"}],"size":352324},"_npmUser":{"name":"anonymous","email":"1309516712@qq.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"1309516712@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-git-manager_2.0.0_1789657564987_0.42643361172988437"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-09-17T15:06:05.136Z","publish_time":1789657565136,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"2.0.0"},"name":"dsh-git-manager","time":{"created":"2026-09-17T15:06:19.690Z","modified":"2026-09-17T15:06:20.375Z","2.0.0":"2026-09-17T15:06:05.136Z"},"readme":"# dsh-git-manager\r\n\r\n[English](README.md) | [中文](README.zh.md)\r\n\r\nA GitHub-connected visual git manager for [DeepSeek Harness](https://github.com/deepseek-ai/dsh) — guided GitHub-Flow steps, commit graph with PR/CI badges, one-click GitHub login, and structured git tools for the agent.\r\n\r\nIts 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](DESIGN.md).\r\n\r\n> 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.\r\n\r\n## Features\r\n\r\n- **Guided Flow Strip** (top bar): visual step indicator through the GitHub-Flow stages: Branch → Commit → Push → PR → Review → Merge.\r\n- **Branch Management**: view local/remote branches, switch, create, delete, rename, merge, fetch, checkout remote.\r\n- **Changes View**: file status (staged/unstaged/untracked), stage/unstage, commit, diff viewer (click any file to see changes), stash/pop, push, pull, fetch.\r\n- **Commit Graph** (GitLens-style lane visualization): 3-column layout (lane / SHA / subject), PR badges, cherry-pick to current, revert commit.\r\n- **PR Management**: list PRs, view detail (checks, reviews, comments), create PR, squash merge, review (Approve / Request Changes / Comment), add comment.\r\n- **Issues**: list issues, view detail, create new issue, add comment.\r\n- **GitHub Integration**: device-flow OAuth login, PAT input, `gh` CLI reuse, encrypted token storage (DPAPI on Windows).\r\n- **Structured Git Tools** (model-side): `git_status`, `git_diff`, `git_branches`, `git_commit`, `git_push`, `github_pr_list/read/create/merge/comment/review`, `github_issue_list/read/create/comment`.\r\n- **Agent Activity Monitor**: a live SSE feed of every agent tool call (start/completion/failure); a repo observer polls workspace state to surface bash git operations performed outside the plugin's tools (new commits / branch switches / working-tree changes).\r\n- **In-Panel Approvals (panel-authoritative)**: write operations pop an approval card inside the panel where you can **Approve** or **Reject** directly; races the native DSH modal — first decision wins. The native channel's automatic rejection (including the ghost deny under approval policy `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.\r\n- **i18n**: auto-follows the DSH Web locale (Chinese / English).\r\n- **Theme**: no palette of its own — follows the host theme tokens, so light/dark and third-party skins both apply.\r\n- **Two host modes**: when [`dsh-better-sidebar`](https://github.com/omdsh-dev/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.\r\n\r\n## Install\r\n\r\n```sh\r\ndsh plugin --profile web add dsh-git-manager\r\n```\r\n\r\nOr for local development:\r\n\r\n```sh\r\ndsh plugin --profile web add link:/path/to/dsh-git-manager\r\n```\r\n\r\nRestart `dsh web`, open a session bound to a git repository, and the \"Git Manager\" panel appears in the right-side column.\r\n\r\n## Architecture\r\n\r\n```\r\nsrc/\r\n  index.ts           # Cordis plugin entry: register routes + tools + system prompt\r\n  tools.ts           # Model-side structured git/GitHub tools (approval race for writes)\r\n  core/types.ts      # Shared TypeScript types\r\n  host/\r\n    git-service.ts   # Workspace-bounded git operations\r\n    routes.ts        # /gitm/* HTTP routes (incl. SSE stream /gitm/events, approval endpoint)\r\n    event-bus.ts     # In-memory event bus + pre-approvals + panel approval broker + repo observer\r\n    github-service.ts # GitHub REST wrapper (token never leaves host)\r\n    github-auth.ts   # Device flow, DPAPI token storage, gh CLI sync\r\n  client/\r\n    index.ts         # Browser entry: picks the host (better-sidebar tab vs standalone)\r\n    embed.tsx        # better-sidebar tab registration (structural, optional peer)\r\n    shell.tsx        # Standalone host: the collapsible dock card\r\n    Panel.tsx        # Main panel: Branches / Changes / Graph / PRs / Issues / GitHub / Agent\r\n    styles.ts        # The whole stylesheet, on host theme tokens (see DESIGN.md)\r\n    api.ts           # Typed fetch wrapper over /gitm/* routes\r\n    events.ts        # SSE subscription + the shared event store behind the tab badge\r\n    i18n.ts          # Bilingual dictionary (zh/en)\r\n    icons.tsx        # The single inline-SVG icon source (16px grid, 1.5 stroke)\r\n    graph.ts         # Commit DAG lane layout algorithm\r\n```\r\n\r\n## Host modes\r\n\r\nThe plugin never claims a surface the host already owns:\r\n\r\n- **`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.\r\n- **`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.\r\n\r\nThe 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).\r\n\r\nThe 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.\r\n\r\n### What counts as \"the folder I am working in\"\r\n\r\nA 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.\r\n\r\n- Auto entries are marked and shown as `name · auto` in the picker, so a shelf that grows by itself stays visible instead of mysterious.\r\n- They are capped at **20**; the oldest auto entry is evicted first, and hand-added repositories are never touched.\r\n- `repo:auto-added` is emitted on the activity stream each time one lands.\r\n- Turn it off with `config.autoRegisterRepos: false` on the plugin row — the strip below still reports what is being touched.\r\n\r\nA two-line strip under the repo picker is always visible and answers both questions at a glance:\r\n\r\n```\r\nSession folder   D:\\Harness\r\nEditing          D:\\Harness\\dsh-learn-wiki\r\n```\r\n\r\nThe 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.\r\n\r\n## Development\r\n\r\n```sh\r\npnpm install\r\npnpm run build\r\n```\r\n\r\nBuild output: `lib/` (host) and `client/` (browser bundle).\r\n\r\n```sh\r\nnode scripts/test-activity.mjs   # file-activity auto-registration (isolated temp home)\r\n```\r\n\r\n## License\r\n\r\nMIT","users":{}}