deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
DSH「用量与余额」面板增强版 —— 官方余额实时拉取 · 逐事件精确计价 · 全渠道消耗估算 · Codex 风格活动时间轴。
Enhanced DSH usage & balance panel — live official balance, per-event pricing, all-channel spend estimates, and a Codex-style activity timeline.
Fork of Ychris12138/dsh-usage-stats (MIT), based on v0.2.0.

Fork 自 Ychris12138/dsh-usage-stats(MIT),在其 v0.2.0 基础上做了计价引擎重构与UI 结构级重构。
GET /user/balance 直接拉取,5 分钟缓存 + 手动刷新,无任何本地估算dsh plugin --profile web add "link:<本目录绝对路径>" # 本地源码
# 或发布后:
dsh plugin --profile web add dsh-usage-stats-plus # npm
# 或:
dsh plugin --profile web add github:Nixz0824/dsh-usage-stats-plus
装完刷新浏览器页面(客户端 bundle 随页面加载)。重启后由 profile bundles 自动装配。
数据源:官方价格文档 https://api-docs.deepseek.com/zh-cn/quick_start/pricing(2026-08-17 生效,元 / 百万 tokens):
| 模型 | 时段 | 缓存命中 | 输入(未命中) | 输出 |
|---|---|---|---|---|
| V4-Pro | 高峰 9:00–12:00 / 14:00–18:00(北京时间) | 0.30 | 9.0 | 27.0 |
| V4-Pro | 空闲 | 0.15 | 4.5 | 13.5 |
| V4-Flash | 高峰 | 0.10 | 3.0 | 9.0 |
| V4-Flash | 空闲 | 0.05 | 1.5 | 4.5 |
config.prices 补充在 profile 的 cordis.patch.yml(或本包 cordis.patch.yml 的 insert 条目)里覆盖:
- insert:
- id: usage-stats
name: dsh-usage-stats-plus
config:
prices:
"deepseek-v4-pro": { peak: { hit: 0.30, miss: 9.0, output: 27.0 }, offpeak: { hit: 0.15, miss: 4.5, output: 13.5 } }
# "some-other-model": { hit: 2, miss: 4, output: 8 } # 全天一口价
# default: { hit: 0.1, miss: 1, output: 4 }
Host(Node)
├── lib/pricing.js 官方峰谷价目 + 旧价期 + 北京时间峰谷判定(逐事件计价)
├── lib/usage.js 会话事件 → 每日/每模型 token 分桶 + 精确成本(替换语义)
├── lib/index.js 增量聚合 + 持久缓存 + /api/usage-stats/* 五个只读回环接口
│ + 每日余额快照(全渠道消耗差值估算)
└── lib/accounts.js 官方余额/订阅额度拉取(loopback-only,无密钥入库)
Client(浏览器,lib/client.js)
├── 余额卡:可用余额(官方实时)+ 今日消耗(全渠道估优先,DSH 内精确兜底,hover 说明口径)
├── Token 用量:今日/本月/累计 + 缓存命中率细条
└── Token 活动:12 个月时间轴,每日(热力图)/每周(柱)/累计(曲线) 三视图
npm run check # node --check 全部 lib 文件
无构建步骤(纯 JS bundle,lib/client.js 为官方 ModuleLoader 格式手写产物)。
MIT,保留上游 dsh-usage-stats contributors(2026)版权声明。感谢 Ychris12138 的原版。
Fork of Ychris12138/dsh-usage-stats (MIT). This release rebuilds the pricing engine and the panel layout on top of v0.2.0.
GET /user/balance, 5-minute cache plus manual refresh, no local estimatedsh plugin --profile web add "link:<absolute-path-to-this-folder>" # local source
# or after publish:
dsh plugin --profile web add dsh-usage-stats-plus # npm
# or:
dsh plugin --profile web add github:Nixz0824/dsh-usage-stats-plus
Reload the browser page after install (the client bundle loads with the page). A restart lets profile bundles mount it automatically.
Source: official pricing docs https://api-docs.deepseek.com/quick_start/pricing (effective 2026-08-17, CNY / million tokens):
| Model | Window | Cache hit | Input (miss) | Output |
|---|---|---|---|---|
| V4-Pro | Peak 09:00–12:00 / 14:00–18:00 (Beijing time) | 0.30 | 9.0 | 27.0 |
| V4-Pro | Off-peak | 0.15 | 4.5 | 13.5 |
| V4-Flash | Peak | 0.10 | 3.0 | 9.0 |
| V4-Flash | Off-peak | 0.05 | 1.5 | 4.5 |
unknown, not a fake 0). Add them with config.pricesOverride in the profile cordis.patch.yml (or in this package's cordis.patch.yml insert):
- insert:
- id: usage-stats
name: dsh-usage-stats-plus
config:
prices:
"deepseek-v4-pro": { peak: { hit: 0.30, miss: 9.0, output: 27.0 }, offpeak: { hit: 0.15, miss: 4.5, output: 13.5 } }
# "some-other-model": { hit: 2, miss: 4, output: 8 } # flat all-day rate
# default: { hit: 0.1, miss: 1, output: 4 }
Host (Node)
├── lib/pricing.js official peak/off-peak table + legacy period + Beijing peak windows
├── lib/usage.js session events → per-day / per-model token buckets + exact cost
├── lib/index.js incremental fold + persistent cache + five read-only /api/usage-stats/* loopback routes
│ + daily balance snapshots (all-channel spend estimate)
└── lib/accounts.js official balance / subscription quota (loopback only, no secrets on disk)
Client (browser, lib/client.js)
├── Balance card: available balance (official live) + today's spend (all-channel first, DSH-exact fallback)
├── Token usage: today / this month / all-time + cache-hit bar
└── Token activity: 12-month timeline, Daily (heatmap) / Weekly (bars) / Cumulative (curve)
npm run check # node --check every file under lib/
No build step (lib/client.js is a hand-written official ModuleLoader bundle).
MIT. Keeps the upstream dsh-usage-stats contributors (2026) copyright notice. Thanks to Ychris12138 for the original plugin.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。