npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@qzsy/dsh-git-badge

v1.3.0

Published

Workspace Git badge: detects Git repositories in the left-sidebar workspace directories and shows the branch with pending +/- line changes.

Readme

@qzsy/dsh-git-badge

Packaged from the local DSH plugin dsh-git-badge; published under the @qzsy scope.

Install

dsh plugin add @qzsy/dsh-git-badge

Upstream README

@qzsy/dsh-git-badge

A DeepSeek Harness bundle that senses whether the left-sidebar workspace directories are Git repositories and shows a Git badge with the current branch and pending +/− line changes.

Visible result

  • A Workspace Git entry in the sidebar panel list, directly below the command-palette row (sidebar.panellist, order 30). The row's right edge carries the aggregate +/− line totals of every changed workspace repository (compact +4.7k −2.0k), with the exact totals in the hover title. The row has no trailing slot, so the badge is absolutely positioned inside the row and is only rendered in the wide column; the collapsed rail shows the branch mark plus a small amber dot while any repository has pending changes.
  • Each workspace (project) row in the sidebar tree also gets its own +/− badge at the right edge: the tree has no per-row slot, so a frame-wide shell.overlay seat measures [data-row-key^="workspace:"] rows (200 ms cadence plus scroll/resize) and renders fixed badges over them. The badge hides while the row is hovered so the row's own actions keep their space, disappears when the row itself is not visible (collapsed rail or scrolled away), and never intercepts clicks.
  • Selecting the entry opens the Workspace Git main panel page (main keyed git-badge): every left-sidebar workspace directory with its status dot, path, branch pill, and +N −N line changes (untracked-only repositories show the file count), plus a segmented filter All / Changed / Clean / No Git and a manual refresh.
  • The page follows Harness theme tokens, light/dark, and the active locale (Chinese and English shipped).
  • The installed Command Palette bundle reuses the same Host route to put a +N −M (or 干净 / 无 Git) badge beside every workspace name in its Workspace section, so the counts are visible from Command+K as well.

How it works

  • Host half (index.js) owns the only real capability: it registers the exact authenticated Fetch route POST /api/git-badge through ctx.connection.fetch and runs git status --porcelain=v2 --branch and git diff HEAD --numstat (or the two-index fallback for a repository without a first commit) per workspace. A cached answer is reused for 25 s and an older one is still returned while it refreshes in the background. Directories with no .git anywhere above them are rejected without spawning git. Only absolute paths are accepted and, when the Workspace registry is mounted, only directories it owns are read. /api is the single prefix every deployment forwards — the desktop app does not expose top-level plugin routes.
  • Client half (client.js) is a plain-JavaScript browser module. It reads the workspace/session snapshots through the slots' standard hooks, POSTs to api/git-badge relative to the page base, and renders the menu row glyph, the project-row overlay, and the page. All three surfaces share one poller (statusStore): the first watcher starts it, the last one stops it, and it refreshes every 20 s while visible, on window focus, and on manual refresh. The very first read is deferred to an idle slot so the host's git processes never compete with the page's own startup requests. The overlay measures the workspace row rectangles every 200 ms plus on scroll/resize, so scrolling and group expansion stay aligned.

Requirements

  • git available on the Host PATH.
  • The Host half stays inactive in profiles without ctx.connection and the Client half registers nothing without the sidebar slot, so the bundle is inert rather than failing elsewhere.