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-cost-crystal

v0.1.0

Published

DeepSeek Harness (dsh web) 成本潮汐观测插件:余额卡片、波峰/低峰状态与切换倒计时、近24h消耗、本会话费用,以及(后续)用量预测。

Readme

dsh-cost-crystal 💎

A cost & usage crystal ball for the DeepSeek Harness web GUI — balance, real-time rate, peak/off-peak billing, and a 🔮 next-message cost forecast, all timezone-aware.

中文说明见 README_CN.md

CI

Screenshot

dsh-cost-crystal balance card

Features

  • 🔮 Next-message cost forecast — estimates the token usage and cost of your next message from the current conversation context and historical usage; re-prices instantly when you switch models
  • Balance card — CNY/USD balance with data-freshness hints («just now / Ns ago»); click to refresh instantly
  • Real-time rate — the breathing dot and shimmer light up within 2s of token consumption, showing live tok/s
  • Peak/off-peak billing — status badge, countdown to the next rate switch, and a last-24h spend estimate
  • Plug & play — zero runtime dependencies, dark/light theme aware, API key stays on the Host

Installation

Requires the DeepSeek Harness web profile (@deepseek-ai/dsh).

# Option 1 (recommended): npm package
dsh plugin --profile web add dsh-cost-crystal

# Option 2: from GitHub
dsh plugin --profile web add "github:xxvk/dsh-cost-crystal"

# Option 3: local development
dsh plugin --profile web add /path/to/dsh-cost-crystal

Then restart dsh web and hard-refresh the browser. The package declares dsh.bundle, so dsh plugin mounts it into the profile's bundle layer automatically — no manual config.

Pricing & Timezone

  • Pricing engine implements the official DeepSeek policy timeline: model-aware unit prices, peak/off-peak/flat buckets, dual currency (CNY/USD).
  • Peak (deepseek-v4-flash etc.): hit $0.014 / miss $0.44 / output $1.32 per M tokens; off-peak at half price. Windows 01:00–04:00 and 06:00–10:00 UTC.
  • Windows are defined in UTC; state/price judged in UTC; display uses the browser's local timezone.
  • Spend/cost covers local Harness sessions only; display conversion uses a fixed rate of 7.1.
  • ⚠️ All spend/cost figures are local-log estimates and may differ from the official bill.

Roadmap

  • v0.1.0 (now): balance card + real-time rate + peak/off-peak + countdown + 24h spend + 🔮 next-message forecast
  • v0.2.0 (planned): VL model statistics — model-switch button + per-model cost/token buckets
  • v0.3.0 (planned): forecast deepening — weighted window, budget burn-down, peak hints, top requests

See ROADMAP.md and TODO.md.

Development

npm install           # only typescript devDependency
npm run build         # generate injected-script templates + tsc → lib/
npm test              # build + all tests + line rules (TDD gate)
npm run build:profile # generate local hot-reload profile plugin (dev)

Architecture: Host logic (src/index.ts / src/pricing.ts / src/usage.ts) is TypeScript; injected scripts are plain-JS sources (src/scripts/card.inline.js + card-fmt.inline.js + card-render.inline.js) escaped into generated src/card-script.ts by scripts/build-scripts.mjs (generated files: never hand-edit).

Testing (TDD gate)

Every code change must pass to be "done":

npm test    # = tsc build + node --test (all tests) + check-lines
  • Node built-in node:test, zero runtime deps; CI (.github/workflows/test.yml) runs on push/PR
  • Line rules: src/test ideal ≤200 / hard cap 300; generated lib/ exempt. See CONTRIBUTING.md

License

Apache-2.0