Saikel-Orado-Liu/dsh-cost-meter

DeepSeek Harness Web GUI 的成本追踪插件——基于快照锚定的每轮定价、账户余额及实时成本估算。

Project Overview项目介绍

This is a native plugin built exclusively for the DeepSeek Harness web GUI, designed to track per-conversation usage costs for DeepSeek API calls. It calculates each turn’s cost based on the price snapshot that was active when the turn completed, accounts for DeepSeek’s peak and off-peak pricing tiers, and never retroactively changes historical costs after future price updates. It adds a dedicated cost view tab, per-message cost chips, a live header cost estimate, and account balance tracking to the DSH interface.

To install the plugin, you use the official DSH CLI, which can be run via npx with no global installation required. The command to add it to your default web profile is npx @deepseek-ai/dsh plugin --profile web add @gamegeek-saikel/dsh-cost-meter, after which you can start DSH with npx @deepseek-ai/dsh web. Once DSH is running, the plugin automatically tracks costs for every conversation, aggregating spend from the main session and all nested descendant subagents at any depth.

The plugin requires DSH version ^0.1.5-alpha.1, and local development needs Node.js version ^22.19.0 or >=24.0.0 plus pnpm 11.7.0. It is released under the open source MIT license, and includes fully hermetic offline test suites that stub network calls and cover every core feature from price parsing to subagent aggregation. It supports both Simplified Chinese and English interfaces, and lets users configure the priority of different price sources.

这是一个专为 DeepSeek Harness (DSH) 网页端 GUI 开发的原生插件,核心功能是追踪 DeepSeek 对话的 API 使用成本。它支持按每个对话轮次锚定其发生时生效的价格快照,区分峰谷定价,提供账户余额查看、专用成本统计标签页、单条消息成本标记、顶部实时估算等功能,每轮成本计算完成后不会因为后续价格变动而改写历史记录。

需要追踪 DeepSeek API 消费的用户和开发者可以通过 DSH 官方 CLI 安装该插件到指定配置文件。输入安装命令后,插件会自动完成部署,启动 DSH 后即可在对话界面看到成本相关展示。每一轮对话完成后都会自动计算并锚定成本,聚合主会话和所有嵌套子代理的总花费,帮助用户随时掌握当前会话和账户的消费情况。

该插件要求 DSH 版本不低于 0.1.5-alpha.1,开发环境需要 Node 版本 22.19.0 或更高,以及 pnpm 11.7.0。源码遵循 MIT 许可开源,提供完整的离线测试用例,覆盖价格解析、成本锚定、子代理聚合等核心逻辑,支持中英文双语界面,用户可自定义价格来源优先级。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

npx @deepseek-ai/dsh plugin --profile web add @gamegeek-saikel/dsh-cost-meter

把 Saikel-Orado-Liu/dsh-cost-meter 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

DSH Cost Meter

English  ·  简体中文

DSH Cost Meter is a DeepSeek conversation cost-tracking plugin for the DeepSeek Harness (DSH) Web GUI — price-snapshot-anchored per-turn cost (peak/off-peak aware), account balance, a cost view tab, per-message cost chips, and a header pill with live streaming estimates. Every step's cost, price band, and snapshot version are computed once from the pricebook snapshot effective at the usage event's own time and then never recomputed — a later price change never rewrites an already-written conversation row.

  • Host half (src/): DeepSeek GET /user/balance query, the persisted snapshot-anchored pricebook, the sessionCost projection plus the pricebook-free sessionCostIndex message index, subagent cost aggregation, and the trust-fenced /cost-meter route.
  • Client half (src/client/): composer-dock readout, Cost tab, per-reply chip, header pill, and the plugin configuration card — in Simplified Chinese and English.

Installation

The plugin is published on npm as @gamegeek-saikel/dsh-cost-meter and ships as an official DSH plugin bundle (both halves — host and browser — are mounted by a single cordis.patch.yml row).

Install it into a web profile with the official DSH CLI (via npx — no global installation needed):

npx @deepseek-ai/dsh plugin --profile web add @gamegeek-saikel/dsh-cost-meter

That installs the npm latest tag, which tracks the current DSH release line. This plugin publishes on the same two npm channels DSH itself uses, and a build only runs on the DSH line it was built for, so install the channel that matches your runtime:

npm dist-tag Tracks Install command
latest the current DSH release line dsh plugin --profile web add @gamegeek-saikel/dsh-cost-meter
next the upcoming DSH release line dsh plugin --profile web add @gamegeek-saikel/dsh-cost-meter@next
alpha alpha builds dsh plugin --profile web add @gamegeek-saikel/dsh-cost-meter@alpha

npm dist-tag ls @deepseek-ai/dsh shows which DSH version serves each line, and npm view @gamegeek-saikel/dsh-cost-meter dist-tags shows which plugin version serves it. A DSH runtime refuses to load a bundle whose peer ranges reject it, so picking the wrong channel fails the install outright rather than half-loading the plugin.

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-prompt-templates 下一个 Next dsh-model-capabilities →