Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@argszero/cordis-plugin-git-status

Read-only git workspace status chip for the dsh web composer: shows the current branch, ahead/behind counts, and dirty-file counts next to the input area — the DSH ↔ Claude Desktop parity feature requested upstream in deepseek-ai/deepseek-harness discussion #5073.

This plugin is a working reference implementation for that feature request: it demonstrates the third-party client-plugin channel end to end (node half + dsh.client browser half + SSE bridge), so maintainers can lift the pattern if the feature is adopted upstream.

What it does

┌─────────────────────────────────────────────── composer ───┐
│  [main ↳ ↑3 ↓1 ●5]  Ask anything…                    (send) │
└─────────────────────────────────────────────────────────────┘
  • Node half runs git status --porcelain=v2 --branch read-only (no mutation commands, ever) and serves the summarized snapshot over an SSE channel (/plugins/git-status), pushing a new frame only when the status changes.
  • Client half (browser) subscribes to the SSE channel and renders the chip into the conversation.composer.dock slot via the same ctx.slots.register API the built-in UI uses. The browser never runs git — it only renders the snapshot (the "UI only renders the snapshot" boundary).
  • Non-git fallback: a directory that is not a git repository renders nothing; the node half reports a typed not-a-repo frame instead of crashing or spamming.

Installation

# add to your dsh profile's user layer (cordis.patch.yml)
dsh plugin add @argszero/cordis-plugin-git-status

or insert into the user-layer cordis.patch.yml yourself:

plugins:
  '@argszero/cordis-plugin-git-status': {}

Configuration

plugins:
  '@argszero/cordis-plugin-git-status':
    root: /absolute/path/to/repo   # default: the dsh process cwd
    intervalMs: 5000               # poll interval (min 500)
    path: /plugins/git-status      # SSE endpoint

How the channel works (source anchors, 0.1.2-alpha.1)

  1. The package declares "dsh": { "client": { ... } } in package.json — the DshClientDeclaration schema (packages/client/modules/src/index.ts:55-69).
  2. The client-modules node half scans the host Loader entries for that declaration (index.ts:2-3), bundles the ./client export, and serves it.
  3. The browser boot loads the bundle through its own client-side Cordis Loader (packages/client/web/src/boot.ts:113-135).
  4. The frozen module table (packages/client/web/src/seed.ts) exposes @deepseek-ai/dsh-client-ui-slots, so the client half registers into the measured composer dock slot (packages/client/ui-conversation/src/client/ contract/slots.ts:131) exactly like the built-in StatsLine (packages/client/ui-chat/src/client/apply.ts:152-154).
  5. The SSE bridge follows the in-tree /plugins/events channel of @deepseek-ai/dsh-client-hmr.

Development

npm install
npm run typecheck   # strict tsc over both halves
npm test            # parser unit tests + real-git-repo integration test
npm run build       # esbuild bundles → lib/index.js (node) + lib/client.js (browser)

Requires Node ^22.19 || >=24 (native TypeScript type stripping for tests).

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages