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

dsh-mchose-battery

v1.0.1

Published

Mchose wireless mouse battery + connection-mode indicator in the DSH sidebar (WebHID)

Downloads

293

Readme

dsh-mchose-battery

A DSH (DeepSeek Harness) client plugin that shows the real-time battery level and connection mode (2.4G / USB) of an Mchose (迈从) wireless mouse in the sidebar, just above the settings button.

It talks to the mouse directly from the browser via WebHID — no companion app, no driver, no daemon. It refreshes every 5 seconds, and automatically follows the mouse as it switches between wired USB and the 2.4G receiver.

Requires a DSH Web GUI (http://127.0.0.1:3080), profile web.

Features

  • 🪫 Real-time battery percentage (updates every 5s)
  • 🔌 Connection mode: 2.4G / USB
  • ⚡ Charging indicator
  • 🎯 Sidebar widget injected right above the settings button (no background bar, gray icon + text)
  • 🔄 Auto-detects wired ↔ wireless switching (5s polling + disconnect events)

How it works

The plugin reads the device's HID config interface (usagePage 0xFF01, VID 0x3837):

  • Sends a profile-reload command on report 0x11
  • The mouse pushes an E2 status report on input report 0x13
  • The report is XOR-decoded into battery % / charging / device name
  • Wired USB = PID 0x4018, 2.4G receiver = PID 0x100A

Prerequisites

  • A DSH installation with the web profile (Web GUI)
  • A browser with WebHID support: Chrome / Edge (desktop). Firefox and Safari do not support WebHID.
  • An authorized mouse on first use: the browser will show the WebHID device-picker prompt — you must select the Mchose mouse and click Connect.

Installation

This package is a profile bundle (it declares dsh.bundle.patch), so it installs with the built-in DSH plugin command — no manual patch editing required. The bundle patch auto-registers the plugin as a host entry, which in turn makes DSH serve its WebHID client bundle to the browser.

Option A — via dsh plugin (recommended)

# from the registry where dsh-mchose-battery is published
dsh plugin --profile web add dsh-mchose-battery

That's it. dsh plugin add runs pnpm add, detects the dsh.bundle declaration, and adds the package to the profile's bundle layer. Restart DSH and hard-refresh (Ctrl+Shift+R).

If testing from a local checkout instead of a registry, a path spec works too: dsh plugin --profile web add ./publish/dsh-mchose-battery

Option B — manual copy

For machines where dsh plugin/pnpm isn't convenient:

# put the whole folder where DSH can resolve it
git clone <your-repo> "$USERPROFILE\.dsh\node_modules\dsh-mchose-battery"

and register a row in ~/.dsh/profiles/web/cordis.patch.yml:

- insert:
    - id: mchose-battery
      name: dsh-mchose-battery

Then restart DSH and hard-refresh the Web GUI (Ctrl+Shift+R). Open the console and you should see:

[mchose] loaded v4 (polling, no auto-flip)

⚠️ Because DSH caches the client bundle revision at startup, you generally need to restart DSH (not just refresh) after installing/upgrading.

Full step-by-step instructions for colleagues: INSTALL.md.


WebHID authorization (first run)

The first time (and after the browser "forget"s the device), DSH will show the WebHID device picker. Make sure:

  1. The mouse is connected (wired or via 2.4G receiver).
  2. Select the Mchose device from the list.
  3. Click Connect.

The sidebar widget will then show e.g. 78% · 2.4G or USB · 100% · ⚡.

Troubleshooting

| Symptom | What to check | | --- | --- | | Sidebar shows "连接迈从鼠标" forever | WebHID picker not approved — click the widget / allow the device | | "WebHID 不可用" | Not Chrome/Edge, or WebHID blocked | | Battery stuck at -- | Device not on the expected interface; check console for raw= hex | | Stale mode after unplug | Should self-correct within ~5s (polling); if not, restart DSH |

Developing

The plugin is a plain npm package:

  • lib/index.js — host half (no-op)
  • lib/client.js — browser client (WebHID), served by DSH's client-bundle mechanism
  • package.jsondsh.client metadata (platform: "web", immediately: true)
node --check lib/client.js   # syntax check

License

MIT