dsh-balance-pie
Manifest validDSH Plugin: A draggable floating balance pie chart that displays your daily starting balance, actual consumption per project (tracked by the actual decrease in balance), and remaining balance; supports automatic recharge recognition, official peak-valued pricing allocation, monthly historical heatmaps, and Chinese-English language switching.
dsh-balance-pie
A DSH plugin · balance monitor / real spending / history heatmap
A plugin for DeepSeek Harness (DSH). It shows a draggable floating pie chart in the DSH web UI with the daily initial balance, real per-project spending and remaining balance; collapses to a sidebar bar; and ships a monthly history heatmap with a per-day spending table.
✨ Features
- 🥧 Draggable floating pie: today's initial / real spending / remaining at a glance
- 📊 Real spending: computed from actual balance decreases (top-ups/refunds handled automatically, survives restarts)
- 💰 Top-up detection + one-click recharge button (jumps to the official top-up page)
- 📅 History: GitHub-style monthly heatmap (days without records shown white) + per-day table (date / spend / remaining)
- 🗂 Local persistence: daily state + per-day JSONL logs (throttled writes, 90-day retention)
- 📐 Adaptive sidebar: horizontal bar when expanded, vertical bar + balance on the collapsed rail
- ⚙️ Settings hub「Balance」: parameters & history sub-pages, live-applied
- 🌐 i18n zh/en (auto-follows DSH language) with optional currency conversion for display
🚀 Quick Start
Prerequisites: DSH with a configured DeepSeek API key.
The repository ships a prebuilt bundle (lib/) and declares the dsh.bundle manifest — install it straight from GitHub, one line:
dsh plugin --profile web add github:f1yan9/dsh-balance-pie
Restart DSH web, then open the web UI — the floating pie appears bottom-right.
Uninstall:
dsh plugin --profile web remove dsh-balance-pie
Manual install: clone the repo (or place the package folder into
$DSH_HOME/profiles/node_modules/dsh-balance-pie/) and append aninsertblock to the profile'scordis.patch.yml; restart DSH web. Rebuilding from source:node build.mjs(esbuild is auto-detected).
📖 Usage
- Floating pie: drag to reposition; hover a slice for details; use — (minimize), ⚙ (settings), ↻ (refresh) and the recharge icon buttons.
- Sidebar: minimized state becomes a bar chart (horizontal when expanded, vertical + balance on the narrow rail); click it to expand the pie back.
- Settings(Balance): the parameters sub-page holds all options (polling, currency, prices, history, language…); the history sub-page shows the heatmap and table.
⚙️ Configuration
Edit in the settings drawer(Balance section), or via cordis.patch.yml in your DSH profile. Common options:
| Option | Description | Default |
|---|---|---|
pollIntervalMs | Balance poll interval | 10000 ms |
pricesJson | Per-model off-peak prices (per 1M tokens) | presets for deepseek-v4-flash |
peakMultiplier | Peak-hour price multiplier | 2 |
language | UI language (auto follows DSH) | auto |
displayCurrency | Display currency (converted) | auto (account currency) |
fxRatesJson | CNY→target-currency rates JSON | {"USD":0.14,"EUR":0.13,"GBP":0.11,"JPY":20,"KRW":190} |
topUpUrl | Recharge page URL | official top-up page |
🛠 Development
node build.mjs # rebuild lib/ (esbuild is auto-detected: HARNESS_ROOT → local pnpm store → npm i -D esbuild)
node test/run.mjs # typecheck → build → smoke → unit
📁 Data Storage
Plugin data lives under $DSH_HOME/dsh-balance-pie/:
daily-state.json— daily state (anchor, real spending, top-up baselines, today's top-up total)history/YYYY-MM-DD.jsonl— per-day history logs (90-day retention)
💱 Display conversion
Snapshot money fields (anchor/current/usedTotal/projects[].used/remaining/topUpToday) are converted by fxRatesJson into displayCurrency (auto = account currency, no conversion); language and displayCurrency ride the snapshot. The history route serves { records, fx: { displayCurrency, rate } } — records stay in the account currency, clients convert for display. topUpToday (Σ today's merged top-up/grant deltas) accrues, resets at midnight, and is restored on same-day restarts.
❓ FAQ
- Spending doesn't match the bill? Spending is real (balance decreases); per-project amounts are split by estimated usage — calibrate prices in settings if needed.
- Initial balance resets after restart? No — anchor and spending are persisted locally and restored on same-day restarts.
- Top-up not reflected? Top-ups are detected on the next poll (default 10 s); already-spent historical top-ups cannot be retro-fixed.
- Where is history stored?
$DSH_HOME/dsh-balance-pie/history/— remove the directory to clear all history.
📄 License
MIT
Comments
Loading…
From the same category
by ccch1mneyyy
DSH 官方公众号收录的 TUI 补位插件:Claude Code 风,鲸鱼顶栏/实时状态/流式思考/双击 Esc 回滚/上下文进度+TPS。npm 一键装。 DSH official WeChat featured TUI plugin — Claude Code style: whale bar, live status, streaming thoughts, double-Esc rol
★ 4.3k
↓ 10.4k/wk
MIT
TypeScript
Oct 10, 2026
dsh plugin --profile terminal add @deepseek-harness-tui/dsh-tuiby strukto-ai
The World's First Virtual Terminal for AI Agents
★ 3.7k
↓ 355/wk
Apache-2.0
TypeScript
Oct 10, 2026
dsh plugin --profile agent add @struktoai/mirage-dshby bowenliang123
The best DeepSeek Harness plugin for context insight and management, with context dashboard / browser / sidebar and context command, for context statistics, composition, breakdown, evolution details,
★ 2k
↓ 29.4k/wk
Apache-2.0
TypeScript
Oct 10, 2026
dsh plugin --profile web add dsh-contextby huiliyi37
官方 DeepSeek Harness 的交互式终端 UI 插件:自研 ANSI 极简交互渲染、流式 Markdown/工具卡、16+ 主题、slash 命令与选择器、输入历史与本地偏好持久化、LSP 诊断、memory记忆,很丝滑的开发体验。
★ 287
↓ 462/wk
Apache-2.0
TypeScript
Sep 30, 2026
dsh plugin --profile terminal add @huiliyi37/dsh-tianshu-tuiby Hilbert-beinghappy
面向 DeepSeek Harness 的 Claude Code 风格终端界面,支持 Windows、macOS 与 Linux,兼容透明终端、VS Code 主题和自定义配色。
★ 197
↓ 108/wk
MIT
TypeScript
Oct 1, 2026
dsh plugin --profile web add seekttyby T-Auto
deepseek-harness Plugin Access and Implementation Standards / deepseek-harness交互生态插件规范与实施标准
★ 84
MIT
JavaScript
Oct 10, 2026