Building a full Git panel inside an AI chat: a DeepSeek Harness plugin
For developers living inside AI chat tools, this shows a practical pattern for extending DSH without leaving the conversation context, and it documents the exact host/client split and security guardrails that make such plugins viable.
DeepSeek Harness (DSH) now has a plugin that puts a full Git panel inside the AI conversation UI. @wagq/dsh-git adds a Git icon to the session title bar; clicking it opens a three-tab modal with staged changes, a commit graph with swim lanes, and a terminal rooted at the repo. The developer wrote it after finding existing options not to their taste, and the project doubles as a reference for how DSH plugins actually work.
DSH plugins split into a host side (Node.js, runs in DSH's process) and a client side (React, injected into the browser). They communicate over a local HTTP API. The host registers routes under /wagq-git, using execFile with argument arrays for all git operations, never shell strings, and sets a 64MB maxBuffer to handle large repos. Security checks block DNS rebinding and cross-site POSTs, and realpath validation keeps file APIs inside the repo.
The client injects a button into the conversation slot, resolves the working directory from sessionId, and renders the panel. A standout feature: a "Generate commit message" button sends the staged diff to the same model the current session uses, with a 12,000-character patch limit, and falls back to the deployment's default model. The author also documents pitfalls, like needing the package name rather than a local path in the Cordis patch, and system messages being a top-level option rather than part of the messages array.
The dual-host/client architecture with local HTTP is a clean separation: host side owns the file system and git, client side owns the DOM, and security is enforced at the HTTP boundary.
Reusing the current conversation's model for commit message generation ties tool behavior to the user's style, a small touch that makes the feature feel native to the chat context.
The commit graph lane compression avoidance is a deliberate UX choice; most graph renderers collapse lanes, but stable columns reduce visual jumps when scrolling through long histories.
The author's decision to write local context types instead of augmenting Cordis types keeps the plugin compile-clean but sacrifices some type safety at the boundary.
The plugin only transmits diffs, not full files, which is both a performance and a privacy decision; 12,000 characters is a tight limit but keeps generation fast.
Splitting host and client into two halves is a sound approach; the plugin's structure becomes clear right away. And only sending the diff rather than the full text for commit messages is considerate.