dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DSH plugin: show per-turn token usage, estimated cost, and DeepSeek balance under every completed turn.
dsh-turn-cost — 在 DSH 每条已完成的对话下方显示 本轮 token 用量、估算费用、当前余额。

1.23M tok · 输入 45.6k 输出 12.3k 缓存 98% · 本轮 ≈¥0.087 · 余额 ¥42.00
仓库名为
DSH-token-admin;插件包名与加载名仍为dsh-turn-cost,安装命令和配置项都使用后者。
鼠标悬停可看到完整明细:未缓存输入、缓存读取/写入、输出(含推理)、缓存命中率、模型、峰/谷计价、单价、余额更新时间。
turn-tail.tokenUsage,按轮显示,不改动、不重算官方用量。deepseekAccount.getBalance(充值钱包 + 赠金钱包),没有账号服务时回退 DEEPSEEK_API_KEY 调用 /user/balance。密钥不落日志、不下发浏览器。余额 —,费用照常;价目或路由不可用时显示 本轮 —,不会影响 Chat 本身。| 数据 | 来源 |
|---|---|
| 每轮 token | ui-chat turn-tail 数据中的精确 tokenUsage(未缓存输入 / 缓存读取 / 缓存写入 / 输出 / 推理 / 合计 / 路由) |
| 费用 | 浏览器半边用 host 下发的价目表计算 |
| 余额 | DSH deepseekAccount.getBalance,或 DEEPSEEK_API_KEY → https://api.deepseek.com/user/balance |
| 价目 | 内置 DeepSeek 官方 CNY 价目(2026-09-10 起),可通过配置覆盖 |
让 DSH 会话执行:
plugin_manager(action: "install_bundle", target: "<本目录绝对路径>")
pwsh -File install.ps1
脚本会备份 profile 的 package.json、添加 link: 依赖、把 dsh-turn-cost 加入 dsh.profile.bundles,并在 profile 的 node_modules 下建 junction。
之后 完全退出并重新打开 DSH Desktop 才会加载新的 bundle。卸载:
pwsh -File install.ps1 -Uninstall
配置写在 cordis.patch.yml 的 config:,或安装后的 profile patch 里(按 id dsh-turn-cost 覆盖)。
| 键 | 默认 | 说明 |
|---|---|---|
refreshSeconds | 30 | 余额缓存时间(秒),也是浏览器刷新余额的 TTL |
balanceSource | auto | auto = 先账号后 API key;account / apikey 强制单路 |
pricing.currency | CNY | 费用显示币种;余额按接口返回币种单独显示 |
pricing.peakMultiplier | 2 | 峰时价格倍率 |
pricing.peakWindows | [[540,720],[840,1080]] | 峰时窗口(当地分钟数,09:00–12:00、14:00–18:00) |
pricing.weekendValley | true | 周末按谷时计价 |
pricing.holidays | 2026 法定节假日 | 节假日全天谷时;每年安排公布后补下一年的日期 |
pricing.timeZone | Asia/Shanghai | 判断峰谷用的 IANA 时区 |
pricing.defaultModel | flash | 未匹配到模型时使用的价位 |
pricing.models | flash / pro 两档 | 每档 cacheHit、cacheMiss、output,单位为 元/百万 token |
覆盖示例:
- id: dsh-turn-cost
config:
refreshSeconds: 60
pricing:
models:
flash:
cacheHit: 0.02
cacheMiss: 1
output: 4
pro:
cacheHit: 0.15
cacheMiss: 4.5
output: 13.5
只写一个字段也会与默认值合并,例如只改 flash.cacheHit 不会把 cacheMiss / output 清零。
费用 = (未缓存输入 × cacheMiss + 缓存读取 × cacheHit + 缓存写入 × cacheMiss + 输出 × output) / 1,000,000 × 峰时倍率
reasoningTokens 已包含在 outputTokens 中,不重复计费。conversation.chat.turnTail 插槽渲染;TUI/headless 不加载客户端半边。turn/start 且每次模型尝试都报告完整用量时才提供 tokenUsage;不完整时页脚自动隐藏。pricing 配置或 lib/index.js 的 DEFAULT_PRICING。—。node test/host.test.mjs
node test/client.test.mjs
测试使用 Node 内置模块与一个极简 React 桩,不需要安装依赖。
lib/index.js — 宿主:余额、价目、/dsh-turn-cost/state.json 路由、同源/连接栅栏。lib/client.js — 浏览器:conversation.chat.turnTail 页脚、费用计算、状态缓存。cordis.patch.yml — bundle 挂载声明。install.ps1 / install.cmd — desktop profile 安装器。MIT