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

@stonehao/dsh-account-pool

v0.1.0

Published

Account pool for dsh: round-robin routing on agent/request, 429/quota cooldown failover on agent/request-error, per-account usage ledger

Readme

@stonehao/dsh-account-pool

Provider pool plugin for DeepSeek Harness (dsh): the harness provider registry with 429/quota cooldown failover, a per-provider usage ledger, and live quota probes.

Model

The pool IS the dsh provider registry. Every route llm.listProviders() reports is a member; the pool re-derives lazily (default every 30s, on request and status hits), so provider changes in dsh land on the next turn. There is no separate account layer — no tiers, no model overrides, no custom routes: providers dsh does not configure are not the pool's business.

  • Routing (agent/request): a request naming a member provider passes through untouched (your session's model choice always wins). When that member is cooling, the request drifts to the next healthy member (round-robin over registry order, serving that member's first configured model). Requests for non-members are never rewritten.
  • Failover (agent/request-error): 429/quota-class failures cool the serving member and answer {kind:'retry'} while another healthy member exists.
  • Ledger: per-provider requests/failures/tokens persisted under dataDir.
  • Status route: POST /api/account-pool/status returns {ok, value:{rev, generatedAt, accounts[]}} (or {ok, value:null} when the registry is empty) under the authenticated /api fence.
  • UI (browser half): a right-sidebar tab with member cards (live cooldown countdowns, token usage, balance capsules), a main-panel dashboard (conversation.view), and a page in Settings → Built-in plugins.

Configuration

Schemastery Config (all fields have defaults):

| field | default | meaning | |---|---|---| | dataDir | ~/.dsh/account-pool | holds providers.json, ledger.json, cooldown.json | | cooldownMs | 60000 | base 429/quota cooldown | | honorRetryAfter | true | extend cooldown to provider Retry-After when larger | | quotaPollMs | 300000 | quota probe interval; 0 disables the poller | | discoverRefreshMs | 30000 | pool re-derivation age; request/status hits trigger it |

providers.json (metadata only)

Keyed by provider route; unknown fields and unknown providers are inert — this file cannot add, remove, or reroute members.

{
  "zai-coding-cn": { "label": "主力度", "quotaProbe": "deepseek-balance" },
  "another-route": { "quotaProbe": "deepseek-balance", "quotaBaseURL": "https://api.deepseek.com", "key": "sk-..." }
}
  • label — display name override (defaults to the registry's provider name)
  • quotaProbe / quotaBaseURL — balance probe selection and endpoint
  • key — probe credential, synced into the harness credential store; the only place a key is ever written down

Install

Two channels; both mount the same cordis.patch.yml.

From npm:

dsh plugin --profile web add @stonehao/dsh-account-pool

From this repository's source (no publish step; the version tracks the repo commit and is pinned in the profile lockfile):

dsh plugin --profile web add "git+https://gitee.com/haostone/dsh-plugins.git#path:packages/dsh-account-pool"

The source channel builds lib/client.js through the package's prepare script, and pnpm only runs a git package's build scripts when the profile allowlists it — add this to $DSH_HOME/profiles/<name>/pnpm-workspace.yaml first, or use npm run plugin install account-pool --profile web --apply from the repository root, which handles it.

dsh plugin writes the package into the profile's dependencies and dsh.profile.bundles, and mounts it through this package's cordis.patch.yml — no hand-edited patch rows, no junction to maintain. Restart the profile afterwards. See the repository AGENTS.md for the link-vs-hardlink behaviour and for isolated-home testing.