qingying012/dsh-token-watch
Watches every DSH session's token usage and pops a whale-styled desktop alert on Windows when a cost or rate threshold is crossed — no log tailing, no second process.
Six rules with configurable defaults: singleCost (¥0.30 per message), singleTokens (300,000 per message), win5mCost (¥1.00 in 5 minutes), win1hCost (¥3.00 in one hour), win10mMsgs (12 assistant messages in 10 minutes — detects runaway tool loops), and cacheRatio (98% cache read / total for messages ≥500k tokens). The plugin rides the host's own session/event stream, so every workspace and every new session is covered automatically from the moment it opens. No startup script or companion process is needed.
Install
dsh plugin --profile web add dsh-token-watchThe npm line from the README (dsh-token-watch 0.1.1). Also installable via the Electron GUI plugin manager: paste the package name, install, then enable. Windows only for the desktop alert popup; on other platforms the plugin still runs and logs, it just skips the OS notification.
Compatibility
MIT. Windows only for the pop-up (whale mascot, dark-navy outline, corner-positioned speech bubble). Cost is an estimate: prices are USD per 1M tokens from the host's providers/data/deepseek.json, converted with usdCny — not a bill. The same rule alerts at most once every cooldownMs (default 10 minutes) to prevent notification storms from busy tool loops.
Details
- Repo: qingying012/dsh-token-watch
- Category: Usage & Billing
- Stars: 0
- Version: 0.1.1 (npm)
Alternatives
KIDLi1412/dsh-token-heatmap · dingyi222666/dsh-wakatime · kelearns/dsh-token-usage