rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:jessicacui99/dsh-plugin-token-cost
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
Live token spend for the current DSH session, shown beside the composer.
Token counts are exact — the four buckets the server reports (tokenUsage: cache-hit input, cache-miss input, cache write, output), not a local character estimate.
Money is computed — buckets × your profile's price table. Click the pill to expand: per-bucket tokens, unit price, charge, and both the peak and off-peak rate (the one in force is marked), so you can check it against a bill.
Sits next to the built-in 38.4M tok · 缓存命中 99.6% stats line, same size and height.
Peak/off-peak can be pinned; by default it follows UTC time (Mon–Fri 01:00–04:00 and 06:00–10:00 are peak).
# from GitHub
dsh plugin --profile web add github:jessicacui99/dsh-plugin-token-cost
# or from a checkout you already have
dsh plugin --profile web add /absolute/path/to/dsh-plugin-token-cost
The host half mounts under patchReload: live; the browser half needs one page refresh.
There is no build step — lib/client.js is a hand-written bundle depending only on React and
react/jsx-runtime, and the host half imports nothing.
The bundled table is in yuan per 1,000,000 tokens, at the provider's peak rate.
Defaults: deepseek-flash ¥0.04 hit / ¥2 miss / ¥8 output; deepseek-v4-pro ¥0.30 / ¥9 / ¥27.
Off-peak is half of peak on every row. Models with no price show a hint instead of an amount —
never a silent ¥0.
Check the numbers against your own bill and, if they differ, override the row in your profile's
cordis.patch.yml. A patch replaces the whole config, so restate every field you keep:
- id: token-cost
config:
currency: CNY # display symbol only (¥ / $ / €)
period: auto # peak | off-peak | auto
models:
- model: deepseek-flash
provider: deepseek-official
inputCacheHit: 0.04 # yuan / 1M tokens, PEAK rate
inputCacheMiss: 2
output: 8
- model: deepseek-v4-pro
provider: deepseek-official
inputCacheHit: 0.3
inputCacheMiss: 9
output: 27
Bad config (negative numbers, a missing model, a misspelled period) fails at load rather than
running with wrong prices.
modelSelection.lastUsed — tokenUsage is a whole-log total and does not split by model.MIT
在 DSH Web 界面的输入框旁边实时显示当前会话已经花了多少钱(默认人民币)。
tokenUsage 投影(未命中缓存的输入 / 命中缓存的输入 / 缓存写入 / 输出四个分桶),不是本地按字符估算。38.4M tok · 缓存命中 99.6% 统计条旁边,同字号同高。dsh plugin --profile web add github:jessicacui99/dsh-plugin-token-cost
profile 开启 patchReload: live 时宿主半边会自动挂载;浏览器半边需要刷新一次页面。
没有构建步骤:lib/client.js 是手写 bundle,只依赖 React 与 react/jsx-runtime;宿主半边不 import 任何第三方包。
内置表单位为元 / 百万 token,写的是高峰价,空闲价按官方规则(空闲 = 高峰的一半)在显示时折算。
默认值:deepseek-flash ¥0.04 / ¥2 / ¥8,deepseek-v4-pro ¥0.30 / ¥9 / ¥27(命中 / 未命中 / 输出)。
未配置价格的模型会显示提示而不是金额,不会静默算成 0。
和账单对不上时,在 ~/.dsh/profiles/<profile>/cordis.patch.yml 里覆盖 token-cost 这一行。
一个 patch 会替换整行的 config,所以要把想保留的字段全部写出来——完整示例见上方英文小节。
modelSelection.lastUsed(当前模型)计价。CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。