mov-eax-eax/dsh-token-anxiety0

dsh-token-anxiety

Token Anxiety widget for DeepSeek Harness: live per-task cost tracking over the session projection — peak/valley pricing, sortable cost table, currency manager (COP/USD/CNY + add/remove), click-to-explain, i18n

AI Analysis

核心用途是提供极度详尽的单次任务/请求 Token 成本分析,支持多国货币切换及调价前后的对比。适合对 API 消费极其敏感、需要精确核算成本的用户。

Package
dsh-token-anxiety
Version
0.1.0
License
MIT
Last updated
Aug 16, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:mov-eax-eax/dsh-token-anxiety

Usage

  • Hover or click the widget in the composer band to open the popup.

Widget in the chat area (dark)

Widget in the chat area (light)

  • Overview — headline cost in a big hero number (current, plus the projected post-hike figure in red when Projected is on), tasks / requests / tokens, and the pricing table: current vs projected rates per model, with the projected peak/valley values colored green when cheaper than the current rate and red when more expensive.

Overview tab (dark)

Overview tab (light)

  • Tasks — a sortable per-task table (# or share %). Each row shows its total cost; with Projected on, the cost column adds the projected peak/valley split on two rows. Hover a row for a details tooltip; click a bar to select the task and run Explain.

Tasks tab (light)

  • Currency — pick any enabled currency (defaults COP / USD / CNY); open the chooser to see FX rates, add more (flags + search), or remove them.
  • Explain — one small LLM call per task; the analysis streams in as it is generated and is written in the conversation's language (a tiny LLM call detects the ISO 639-1 code of the task's user prompt). The result is a compact ~60-100 word report in four labeled lines — Wanted: / Happened: / Avoid: / Next time: — rendered as rich text with bold accent labels.

Explain analysis (dark)

Explain analysis (light)

Configuration

Currencies

Defaults are COP / USD / CNY. Add or remove currencies from the chooser (any code in the ~40-currency catalog); the enabled list persists to pricing.override.json via POST /token-anxiety/currencies (a restart loads it). Rates are USD-base, refreshed by the pricing sync and cached for 24 h.

Pricing

Prices are embedded in PRICING (index.js) as the fallback and can be refreshed from the official DeepSeek pricing page:

curl -X POST http://127.0.0.1:3080/token-anxiety/pricing-sync -H "Content-Type: application/json" -d '{}'

The route fetches the page, asks a model to extract the current and peak/valley rates (CNY → USD at a fixed 7.0 rate; the Beijing peak windows and the effective date are parsed too) and writes pricing.override.json. FX rates (open.er-api.com, keyless) ride along, cached daily. A restart merges the override over the defaults; the pricing-derived stateVersion discards stale projection caches.

Language

When the harness locale is zh, the whole UI renders in Chinese and the currency defaults to CNY. It follows the harness locale.preference setting.