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-scope-english

v0.1.0

Published

Codex-style context visibility for DeepSeek Harness: live context-window occupancy, composition breakdown, KV-cache hit rate, and a GitHub-style 53-week usage heatmap

Readme

dsh-scope-english

License: MIT

English

Context visibility for DeepSeek Harness (dsh) — a Codex-style /context lens for every session, plus a GitHub-style usage heatmap for your whole history.

Two UI contributions, one plugin:

  1. Context Lens (session header) — live context-window occupancy with a segmented system / tools / messages composition bar, per-bucket session totals, and KV-cache hit rate. All data flows through the official token-meter session projections via useProjection — no RPC, no custom wire protocol.
  2. Usage Heatmap (sidebar footer) — a GitHub-contribution-graph-style rolling 53-week token-usage grid. Click any day for the four token buckets, cache hit rate, session count, and per-model ranking. Fed by this plugin's own loopback-only aggregation endpoint.

Screenshots

usage heatmap

Why

DeepSeek Harness treats wording and context as first-class engineering concerns, yet the stock Web UI shows no context occupancy and no usage history. dsh-scope-english fills both gaps the harness-native way: reading the projections the platform already computes, styling with the platform's design tokens (--dsw-alias-*), and mounting through the platform's slot registry — light/dark themes both correct with zero media queries.

Install

Requires dsh ≥ 0.1.0-rc.6 on your PATH.

dsh plugin --profile web add dsh-scope-english
dsh web                             # restart dsh to load the plugin

The installer copies lib/, cordis.patch.yml, and package.json into the profile's node_modules and appends the bundle insert to the profile's cordis.patch.yml (idempotent — safe to re-run after every rebuild).

Uninstall

rm -rf ~/.dsh/profiles/web/node_modules/dsh-scope-english
# then remove the "# dsh-scope-english" block from ~/.dsh/profiles/web/cordis.patch.yml
rm -f ~/.dsh/storages/dsh-scope-english-cache.json   # optional: drop the fold cache

How it works

Client half (lib/client.js, loaded via the package's dsh.client declaration):

  • conversation.session.header.actions (order 30, after the job list) renders the lens trigger: an occupancy ring with the live percentage. The popover reads three official projections — tokenUsage (four buckets accumulated over the whole durable log), contextPressure (input-side window pressure + the route's context window), and contextBreakdown (heuristic system/tools/message composition of the next request).
  • sidebar.footer.action renders the heatmap trigger (label when the sidebar is wide, icon on the rail). The popover fetches GET /api/dsh-scope-english/days same-origin.

Host half (lib/index.js): one read-only, loopback-fenced endpoint (/api/dsh-scope-english/days). Aggregation is incremental: per-session fold state is cached in memory and persisted to ~/.dsh/storages/dsh-scope-english-cache.json; each request folds only events added since the last fold. Live sessions fold their in-memory tail; persisted sessions use the storage backend's opaque revision and readFrom(id, fromSeq), with contiguity checks and a full refold on log rewrites. Steady-state cost stays O(new events) no matter how large the logs grow.

Fold semantics mirror dsh-token-meter's tokenUsage projection: a usage sample rides an assistant/chunk (data.chunk.type === "usage") or assistant/message (data.usage); a repeated sample for the same (turn, step) replaces the earlier value instead of double counting, re-attributed to the later event's day and model. Model attribution follows assistant/message's data.message.source, falling back to the last request/header config.

Nothing is sent anywhere: the endpoint refuses non-loopback callers and non-GET methods before any work, and no provider credentials are read.

Development

npm run build                          # tsdown: host ESM + browser ModuleLoader bundle
node scripts/fixture-session.mjs       # optional: write a demo session log with usage events
node scripts/install.mjs web && dsh web

Compatibility

Built and verified against dsh 0.1.0-rc.6 (@deepseek-ai/dsh-base / dsh-web-app bundles). The harness is in developer preview and iterates quickly — expect compatibility-breaking changes.

License

MIT