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-valley-meter

v0.1.6

Published

峰谷电表:DeepSeek 用量小助手。输入框上方一枚极简余额徽章(框内只有「¥ + 余额数字」两组,点击 ¥ 在新页签打开官方充值页),悬停浮现 24 小时峰谷时间轴(橙=峰、蓝=谷);按官方规则处理周末全天低谷(2026-08-23 起周六周日全天按低谷价计费,界面与计费同步);官方余额 5 秒实时刷新,今日消耗独立计费。All-in-one DeepSeek peak/valley meter: minimal balance chip with a one-click top-up link, h

Readme

峰谷电表 dsh-valley-meter

DeepSeek Harness 峰谷电表 · 余额徽章 + 悬停峰谷时间轴

余额数字徽章 · 悬停 24 小时峰谷时间轴 · 官方余额 5 秒刷新 · 今日消耗独立计费 — 10 套沉稳配色预置 + 谷/峰色自定义,全中文界面。

npm version npm downloads license DeepSeek Harness

English | 中文

余额数字徽章

悬停浮现峰谷时间轴

悬停态

悬停展开演示

这是什么

一个极简的 DeepSeek Harness 插件,在输入框上方右侧挂一枚低调的余额数字徽章;光标悬停时,徽章左侧浮现一条 24 小时峰谷时间轴:

| 读数 | 说明 | |---|---| | 余额数字徽章 | 默认只显示官方账户余额数值(插件独立查询 /user/balance,每 5 秒自动刷新);框内分「¥」「数值」两组,默认无任何多余元素 | | 峰谷时间轴 | 悬停浮现的 24 小时横向时间轴:峰段(橙) / 谷段(蓝)双色 + 白色发光指针标当前本地时刻,00/06/12/18/24 刻度在上方;周末全天低谷时整条轴为谷色 | | 今日消耗 | 当日费用(插件独立监听 llm/stream 实时计费,写入账本) |

核心特性

  • 💳 一键充值:点击框内的人民币符号「¥」即在新页签打开 DeepSeek 官方充值页(platform.deepseek.com/top_up),余额不够时不用再翻菜单找入口;光标移入徽章时,¥ 身下会浮现一枚圆形底色,其左侧与徽章左端圆角完全重合。
  • 🎨 配色方案:内置 10 套沉稳配色预置(One Dark / Dracula / Nord / Tokyo Night / Gruvbox / Solarized + 中国传统色 / 潘通),也可用拾色器自定义谷色 / 峰色,改完即时生效。
  • 👆 悬停即见:默认只显示余额数字,光标悬停才浮现峰谷时间轴,不占输入区空间。
  • ⚡ 实时余额:官方余额每 5 秒自动刷新,无需手动操作。
  • 🕐 本地时区时间轴:峰/谷时段按 UTC 窗口自动换算成本地时区显示,白色发光指针标当前时刻。
  • 🗓️ 周末全天低谷(官方规则):2026-08-23 00:00 起,周六、周日全天不再区分峰谷,统一按低谷价计费。插件按北京时间判断周末,当天整条时间轴显示为谷色,计费自动走低谷价(不会再把周末按高峰价多算一倍);倒计时直接指向下周一 09:00 的首个峰时。可在设置面板关闭该规则。
  • 🔌 完全独立、实时计费:插件自己监听 llm/stream 捕获用量、按官方价格折算费用,自己查询 DeepSeek 官方余额,自己维护账本(~/.dsh/storages/valley-meter/ledger.json),不依赖任何其它插件。

安装

# npm(推荐)
npm install dsh-valley-meter

# 或从 GitHub 直发安装
dsh plugin add github:uckkk/dsh-valley-meter

然后重启 dsh web 页面即可看到余额数字徽章。

配置

打开 设置 → 峰谷电表:

  • 配色方案:10 套预置(编辑器主题 6 套 + 中国传统色 / 潘通 4 套)或「自定义」。
  • 谷时颜色 / 峰时颜色:拾色器,选「自定义」后即时生效。
  • 余额显示标题 / 今日花费显示标题 / 显示倒计时:分别开关。
  • 周末全天低谷:默认开启。官方 2026-08-23 起周六、周日全天按低谷价计费;若官方规则再变,可在此关闭,关闭后周末恢复按峰谷窗口计费。

配置写入 ~/.dsh/storages/valley-meter/config.json。

数据来源说明

本插件独立计费与查询,不依赖任何其它插件:

  • 今日费用:监听 llm/stream 捕获每次调用的 usage,按内置模型价格表(含峰/谷两档)+ 峰谷时段折算,写入自己的账本 ~/.dsh/storages/valley-meter/ledger.json。
  • 账户余额:用 DSH 凭据库/DEEPSEEK_API_KEY 查询 DeepSeek 官方 /user/balance,每 5 秒自动刷新。
  • 峰谷窗口:内置于插件(默认 UTC 01–04、06–10 = 北京时间 09:00–12:00、14:00–18:00),写在 config.json 的 peakWindows 里;设置面板目前只提供周末规则开关,不提供窗口编辑器。
  • 周末规则:官方 2026-08-23 00:00(北京时间)起,周六、周日全天统一按低谷时段价格计费;工作日高峰为北京时间 9:00–12:00 与 14:00–18:00,低谷价为高峰价的一半。插件按北京时间判定周末,生效前的时刻仍按原规则计算。

未配置 API Key 时,余额显示「暂无数据」,今日费用仍正常累计,不会报错。

开发

pnpm install
pnpm run build   # 构建 lib/client.js bundle
pnpm run check   # typecheck + test + build

License

MIT