mov-eax-eax/dsh-token-anxiety ↗★ 0
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
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:mov-eax-eax/dsh-token-anxiety说明文档
阅读完整 README ↗Usage
- Hover or click the widget in the composer band to open the popup.


- 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.


- 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.

- 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.


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.