rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:shyoka/whale-ledger
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
当前对话的 Token 用量 + 费用 侧边栏,给 DeepSeek Harness 的 Web 界面用的客户端插件。
它不额外记录任何数据:只读 Harness 已经推送到页面的会话投影,把「上下文占了多少、还剩多少、这批 token 大概花了多少钱」摆在一个侧边栏页面里,并让标题栏常驻一个环形读数。
上下文 45% 57.6K / 128K
费用估算 ¥0.410 – ¥0.820
本会话累计 750,000 tok(缓存命中 71.4%)
运行统计 12 轮 · 48 步 · 3m 00s
| 位置 | 内容 |
|---|---|
| 右侧边栏「用量」页 | 上下文占用与上下文长度、系统提示/工具/对话三段构成、费用估算(人民币/美元)、会话累计 token 与缓存命中率、轮次/步骤/模型耗时/工具耗时/输出速度 |
| 右侧边栏「指南」卡片 | 「鲸账」入口 |
| 对话标题右侧 | 环形占用条 + 百分比,点一下打开上面的页面 |
全部来自 Harness 已推送到浏览器的 Session 投影,插件自己不折叠事件、不缓存数据:
| 投影 | 用途 |
|---|---|
contextPressure |
projectedTokens / pressureTokens、contextWindow → 上下文占用、长度、剩余 |
contextBreakdown |
systemTokens、toolsTokens、messageTokens → 构成条 |
tokenUsage |
uncachedInputTokens、cacheReadTokens、cacheWriteTokens、outputTokens → 累计与计费 |
sessionStats |
turns、steps、llmMs、toolMs、decodeMs、decodeTokens → 过程统计 |
modelSelection |
lastUsed.model / next.model → 选价目表 |
价目表取自 deepseek 官方文档《模型 & 价格》(https://api-docs.deepseek.com/zh-cn/quick_start/pricing,2026-11-15 抓取),单位「元 / 百万 tokens」的空闲时段价:
| 模型 | 缓存命中输入 | 缓存未命中输入 | 输出 |
|---|---|---|---|
| deepseek-flash | ¥0.02 | ¥1 | ¥4 |
| deepseek-v4-pro | ¥0.15 | ¥4.5 | ¥13.5 |
美元价:flash $0.003 / $0.15 / $0.6,pro $0.022 / $0.66 / $1.98。
命中 × 命中价 + 未命中 × 未命中价 + 输出 × 输出价;缓存写入计入未命中档。client.js 里的 PRICING 常量(连同注释里的抓取日期)即可。前提:Harness 有 Web 界面(dsh web),且右侧边栏可用。
方式一:本地目录(推荐)
把仓库目录装进 profile —— 在 Harness 的插件管理里选择安装本地目录(bundle 目录),或:
dsh plugin --profile web add /path/to/whale-ledger
然后把 dsh-whale-ledger 加进 profile package.json 的 dsh.profile.bundles(插件管理器里启用一次即可自动写入)。
方式二:直接从 GitHub
dsh plugin --profile web add github:shyoka/whale-ledger
同样需要把它加入 dsh.profile.bundles。装好后刷新页面。
设置 → 插件 里停用或卸载 dsh-whale-ledger;或从 dsh.profile.bundles 移除后 dsh plugin --profile web remove dsh-whale-ledger。
纯 JS,无构建步骤,无依赖(React / React DOM 由 Harness 页面的模块表提供)。
client.js # 全部 UI 与注册逻辑
index.js # Host 侧空 apply(本插件只有前端行为)
cordis.patch.yml # 一行 Loader 条目
locale/{zh,en}.json # 插件管理器里的标题与描述
icon.svg # 图标
test/smoke.mjs # 无需浏览器:桩掉 React 跑一遍注册与渲染
node --check client.js
node test/smoke.mjs
test/smoke.mjs 用假的 window/document/React 载入模块,断言:5 处注册(页签类型、页体、页标题、标题栏读数、字典)、正常会话下的费用区间、空会话、未知模型、Pro 档价格。它只能证明代码路径不抛错、数字对得上,不能替代真实浏览器里的视觉检查。
样式只用主题 token(--dsw-alias-* 等),浅色/深色跟随宿主;不依赖 harness 内部组件包,按钮/进度条都是原生元素。
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek。