dsh-commit-ai
DSH Web GUI plugin: adds a 'Generate with AI' button to the dsh-solution-explorer commit box, filling the commit message from the staged diff using the deployment's default LLM in Conventional Commits format.
- Stars
- 0
- Language
- JavaScript
- Created
- Aug 29, 2026
- Updated
- Aug 29, 2026
Introduction
dsh-commit-ai
DSH Web GUI plugin. Adds a "✨ Generate with AI" button to the
dsh-solution-explorer commit box that fills the commit message from the
staged diff using the deployment's default LLM, in Conventional Commits
format.
This plugin injects UI into the SCM panel without modifying
dsh-solution-explorer source code: it watches for the
.sol-exp-commit-box element to appear and inserts a sibling button above
the existing Commit button. Updates to dsh-solution-explorer are
preserved.
Install
dsh plugin --profile web add link:/path/to/dsh-commit-ai
Then restart dsh web (or refresh the page so the new bundle is picked
up).
How it works
- Client (
lib/client.js): aMutationObserverwatches the document body; whenever.sol-exp-commit-boxshows up, it inserts the AI button as a sibling of.sol-exp-commit-row, withdisplay: block; margin: 6px 0 0 0; width: 100%, so the spacing matches the existing 6px gap between the textarea and the Commit button. A 1-secondctx.timer.intervalcovers the rare MutationObserver miss duringinnerHTMLrewrites. - Host (
lib/index.js): aharness.handle("ai-commit-suggest", ...)RPC. Given{ root }, it runsgit -C <root> diff --cachedandgit -C <root> status --porcelain -zviactx.shell, trims the diff tomaxDiffChars(default 14 KB), and callsctx.llm.streamwith a Conventional Commits system prompt. The text-delta chunks are concatenated and returned as{ ok, message, provider, model }. - The button fills the textarea using the native
HTMLTextAreaElement.prototype.valuesetter and dispatches aninputevent, which is the same pathdsh-solution-exploreralready listens to (oninput="window.__solExpCommitMsg(this.value)"); the existing Commit button's disabled state is updated automatically.
Configuration
The plugin's config schema (in package.json → dsh.bundle.config once
mounted) is:
| Key | Default | Description |
|---|---|---|
maxOutputTokens | 220 | Max output tokens for the commit message model call. |
temperature | 0.2 | Sampling temperature. |
maxDiffChars | 14000 | Hard cap on diff size (chars) sent to the model. |
maxFilesListed | 50 | Max staged file paths listed in the prompt. |
Active-repo discovery
The plugin reads the active git root from the DOM:
- multi-repo:
.sol-exp-repo-item.active[data-repo-path] - single-repo: the only
.sol-exp-repo-item[data-repo-path] - fallback: the SCM tab will simply report "no active repo" if neither
selector is present (this should not happen with the shipped
dsh-solution-explorer).
License
MIT.