Provides official DeepSeek balance, per-session cost, and third-party Token usage panels for DSH Web. Supports multi-account hot switching, 24-hour peak-valley pricing display, and anti-phishing recharge portal.
- Language
- JavaScript
- License
- MIT
- Branch
- main
Install
$ dsh plugin --profile web add github:feibi-mochi/deepseek-harness-walletRun the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial
Install via your agent
Install the DeepSeek Harness plugin feibi-mochi/deepseek-harness-wallet for me: review the repository at https://github.com/feibi-mochi/deepseek-harness-wallet first, then run the install command and verify the plugin loads successfully.
Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.
One-Line Pitch
A mini "wallet" badge permanently displayed next to the input field in DSH Web, showing DeepSeek official account balance, current session cost, and third-party Token usage. Provides one-click multi-account switching, low balance alerts, and official recharge entry.
Core Features
- Real-time official DeepSeek balance: Auto-refreshes every 60 seconds, with 2 / 6 / 15 / 30 second progressive retry on startup. Shows friendly error instead of crash when API Key is not configured (index.js:35 / index.js:737-749)
- Current session cost and Token bucketing: Listens to host
llm/streamevents, separately accounts input / cache-read / cache-write / output / reasoning tokens for official provider and other providers. Each usage locks in the price at that moment to avoid cross-tier mixing (index.js:710-731 / index.js:481-498) - 24h peak/valley billing clock: Ring clock at sidebar bottom shows Beijing timezone peak hours (09:00–12:00, 14:00–18:00) and half-price valley periods in real-time, with switch countdown and optional desktop notifications (index.js:41-43 / CHANGELOG.md:7-10)
- Multi-account management and hot switching: Add multiple DeepSeek accounts (name + API Key) in panel "Account Management". After switching, no restart needed; next LLM request charges to new account. UI only shows masked Key (index.js:435-451 / README.md:39-44)
- Phishing-proof official recharge entry: "↗Recharge" button on right side of badge directly opens
https://platform.deepseek.com/top_up. URL is hardcoded in code and cannot be changed. First click shows popup confirming the domain (index.js:28 / README.md:138) - Badge supports drag-and-dock, scaling, and floating window: Can drag between three modes: next to input field, floating, or sidebar docking. Dock position and scaling ratio persist. Panel can be detached as draggable floating window, further minimized to a movable dot (lib/client.js:1965-2099 / CHANGELOG.md:38-44)
- Completion reminder and peak/valley switch desktop notification: Shows popup via host notification channel when conversation completes. Can be set to stay or auto-close after timer. Falls back to in-page notification when system notifications not supported (lib/client.js:715-755 / README.md:31)
Technical Implementation
- Language: JavaScript (ESM):
index.jsis the host half,lib/client.jsis the client half (package.json:5 / package.json:6-11) - Key Dependencies: Zero third-party runtime dependencies. Only uses Node built-ins
node:crypto/node:fs/node:os. Browser side renders via React (injected by DSH Web). All CSS variables use--dsw-alias-*theme (package.json:0 / index.js:19-22 / lib/client.js:262-310) - Architecture Pattern: Dual half host plugin. Host half intercepts model stream usage blocks via
ctx.on('llm/stream', usageTap, { global: true }), accounts by provider.ctx.webServer.registerexposes 8 JSON routes:/api/wallet/{snapshot,threshold,refresh,clear-session,accounts,accounts/activate,accounts/remove,official-providers}. Client half registers itself into page viawindow.__ModuleLoader__.load({ id: 'deepseek-harness-wallet', factory }). Compatibility adaptercreateCompatibilityAdapter()unifies abstraction for notification / storage / permission / external link 4 types of host orchestration points (index.js:697-903 / lib/client.js:6-11 / lib/client.js:45-240) - Entry Files: Server entry
index.js(apply/name = 'wallet'); Client entrylib/client.js; Mount declarationcordis.patch.yml(inserts id=wallet, name=deepseek-harness-walletinto web profile) (cordis.patch.yml:1-4 / package.json:49-61)
Use Cases
Suitable for those who use DeepSeek as their primary model and need to see official balance, current session cost, and third-party Token consumption at a glance during each session. It consolidates the scattered cost signals from the official open platform console, DSH model settings, and session details into a draggable mini badge. Particularly useful when multiple people share one machine or when rotating billing across multiple accounts.
Prerequisites & Compatibility
| Dependency | Minimum Version | Notes |
|---|---|---|
| DeepSeek Harness (DSH) | 0.1.0-rc.6+ (tested with 0.1.0-rc.7) | README badge pins 0.1.0--rc.6, RELEASE-NOTES-v0.2.2 reports tested 0.1.0-rc.7 (README.md:6 / RELEASE-NOTES-v0.2.2.md:12-27) |
| Node.js (only for host import) | `^22.19.0 | |
| Platform | Cross-platform | Tested on Windows + Edge. CI runs all three platforms (Ubuntu / macOS / Windows) × Node 22 / 24 all green. No native modules introduced, zero OS-specific branches (README.md:99-105 / RELEASE-NOTES-v0.2.2.md:12-27) |
| API Key | DEEPSEEK_API_KEY for balance query | Token/cost accounting still works without key, but balance shows error state (AGENTS.md:13) |
| Native Modules | None | Zero third-party dependencies |
Installation
dsh plugin --profile web add github:feibi-mochi/deepseek-harness-wallet
Configuration
This plugin does not read host config files; all user-level settings are adjusted via in-panel UI and persisted immediately. Below are the actual key names, purposes, and default values for each setting (lib/client.js:18-35 / lib/client.js:1043-1140):
| Config | Type | Description | Default |
|---|---|---|---|
| Badge Layout | enum | Badge dock position: In Input / Floating / Sidebar | home (In Input) |
| Badge Scale | number(0.75–1.25) | Badge zoom. Max 120% when in input, up to 125% when floating/sidebar | 1.00 |
| Panel Content | two flags | Whether to show official / third-party data in badge. At least one must remain | { official: true, third: true } |
| Completion Reminder | enum | off / 5s / 10s / 30s / 60s / keep | off |
| Low Balance Blink | boolean | Whether badge pulses red when balance below threshold | true |
| Low Balance Threshold (CNY/USD per currency) | number(0–100000) | Alert when balance below this line. CNY and USD are independent, automatically applied based on active account | CNY 5 |
| Peak/Valley Ring Clock (sidebar bottom) | boolean | Whether to show 24h billing time chart | true |
| Peak/Valley Switch System Notification | boolean | Whether to show desktop notification when entering peak/valley | false |
| Permanent Session Delete (only when host supports) | boolean | Exposes permanent delete entry in session menu. Host without capability has switch permanently grayed out | Determined by host capability |
| Accounts (multi-account) | list | Name + API Key, stored in $DSH_HOME/storages/accounts.json. First added becomes active | Empty |
| Third-party Provider Mapped to Official Bucket | string[] | Which wrapper providers to count as official price in settings page (useful for visual models routed via proxy billed at official rate) | Only built-in deepseek-official |
FAQ
Q: The badge (chip) doesn't appear after installation. What should I do?
A: You must first dsh plugin --profile web add deepseek-harness-wallet, then restart dsh web, and finally hard refresh the page in browser. The client half is injected via window.__ModuleLoader__.load({ id: 'deepseek-harness-wallet' }). Hard refresh is the necessary condition to trigger loading.
Q: Why does the balance show error / no number?
A: Balance depends on DEEPSEEK_API_KEY. When absent or invalid, it directly queries the official /user/balance endpoint. The key only leaves this machine as the Authorization header. Token/cost accounting does not depend on key and works normally. Balance will recover once you configure the key in DSH model settings or add it via account management.
Q: Third-party model sessions show no balance and cost, only Tokens. Why?
A: Balance and official price list only connect to official API. Third-party providers have no official price list or balance endpoint, so only input / cache-read / output token counts are tracked, without cost estimate or balance.
Q: How to switch between multiple DeepSeek accounts? Who gets billed next?
A: Add accounts (name + API key) in panel "Account Management". The switch writes to credential channel credentials.set('DEEPSEEK_API_KEY', ...). The llm-deepseek route resolves that credential per request, so the next LLM call bills to the new account without restart. If DEEPSEEK_API_KEY is also set in environment variables, the credential provider will refuse to overwrite, and the switch will fail with a prompt.
Q: Can the recharge link address be changed?
A: No. RECHARGE_URL = 'https://platform.deepseek.com/top_up' is hardcoded on host side and cannot be configured—this is intentionally designed as anti-phishing measure. First click shows popup to confirm the domain.
Q: The "Permanent Delete Session" switch is grayed out. How to enable?
A: This is a host capability, not something the plugin can implement independently. It requires the host DSH to actually implement session deletion path and broadcast data-dshw-capability-permanent-delete='true' to clients. Current official release lacks this capability, so the switch stays disabled. If you're a host developer, reference the integrations/dsh-session-delete/ suite to wire up the capability.
Q: Where is data stored? Does clearing current session data delete conversations?
A: Wallet data is stored in $DSH_HOME/storages/wallet.json, accounts in $DSH_HOME/storages/accounts.json, UI display content/scaling/layout etc. stored in browser localStorage. "Clear current session data" only clears token/cost counts for the current session, does not delete chat and session itself.
Q: Old dsh-wallet installed on the machine. How to clean up?
A: dsh-wallet was renamed to deepseek-harness-wallet in 0.1.1. Old package won't auto-uninstall and will compete with new package for same UI row. Run dsh plugin --profile web remove dsh-wallet then restart dsh web.
Q: Session cost (¥/$) seems not quite accurate?
A: Cost is estimated by "price at that moment" for each usage event as it hits the price list: v4 models have peak/valley tiers built-in (Beijing time 09:00–12:00 and 14:00–18:00 are peak, valley is half of peak). Historical calls' billing is not overwritten by new prices. Balance returned from official API is the authoritative value; estimates are for reference only.
Getting Started Difficulty
Beginner — one dsh plugin add + restart dsh web + hard refresh shows badge next to input field. Enter panel "Account Management" when you want to use multi-account or customize thresholds.
Known Issues & Limitations
- Hard refresh required: Client half registers in
window.__ModuleLoader__.load, loading happens at page load. After install/update, badge won't appear without hard refresh (AGENTS.md:23-25) - Multi-account conflicts with environment variables: If shell already has
export DEEPSEEK_API_KEY, credential provider will refuse to overwrite, switch button reports error directly—unset the env var first then switch (README.md:43-44) - Permanent delete depends on host capability: Current official DSH release does not provide
permanentDeletecapability, UI switch stays disabled. Cannot fake it via config change. Wiring steps explained separately inintegrations/dsh-session-delete/(AGENTS.md:54-57) - Old package name residue:
dsh-walletversions before 0.1.1 won't auto-uninstall, need manualdsh plugin --profile web remove dsh-walletto prevent two packages fighting for same row (README.md:93) - USD account cost is estimate: CNY price list converted at official long-term fixed exchange rate, badge clearly states "approx. $x". Exchange rate is not real-time, official balance is authoritative (README.md:42-43)
- Recharge URL not configurable:
https://platform.deepseek.com/top_upis hardcoded as anti-phishing design (README.md:138)
DeepSeek Harness Control Center
DeepSeek Harness monitoring, alerts, recharge, and session control center.
Balance ¥5.89 · Session ¥0.72 · Official 18.8M | Third-party 800K · ↗ Recharge
English · 简体中文 · Install · Compatibility · Changelog
A local-first companion that keeps account status, per-conversation usage, completion reminders, official recharge, flexible layout, and host-gated session controls beside the DSH composer.
If DeepSeek Harness Control Center helps you, please consider leaving a ⭐ Star. Thank you!
What it does
余额 ¥5.89 · 本场 ¥0.72 · 官 18.8M | 三方 800K · ↗充
- Official DeepSeek — live balance (60s global refresh with fast boot retries), current-session cost locked to the price active for each usage event (including the 2026-08-17 peak/off-peak rollout), and token breakdown.
- 24h peak/off-peak ring clock — resident sidebar footer widget indicating real-time pricing windows (peak vs. 50% discount off-peak), countdown to next switch, and optional desktop switch notifications.
- Third-party total — current-session tokens (input / cache read / output). No balance guessing, no cost math, zero configuration.
- Click the chip to open the detail panel: correctly formatted per-currency balances, cost and token splits, a freely editable low-balance threshold in CNY (two decimals, persisted globally; alerts only compare a CNY balance and never mix currencies), manual refresh, and a jump to the official recharge page (first click shows the domain for confirmation — anti-phishing).
- Move, dock, and scale — drag the chip freely, preview nearby snap targets, use compact horizontal or vertical layouts, adjust its scale from the control panel, and show official or third-party data independently. The choices are remembered locally.
- Floating window mode — detach the detail panel into a draggable window with a remembered position, or minimize it directly to a freely movable dot; the dot turns red below the threshold.
- Completion reminders — optionally notify when a conversation finishes, with persistent or timed modes, queueing and deduplication for simultaneous completions, cross-tab coordination, and an in-page fallback when system notifications are unavailable.
- Optional permanent deletion — when the DSH host advertises a real deletion capability, an opt-in setting enables a confirmed permanent-delete action in the session menu; unsupported hosts keep the control disabled.
- Low-balance alert — below the threshold the chip turns red with a breathing animation and fires one desktop notification; it resets automatically once the balance recovers.
- Theme-native UI — built entirely on
--dsw-alias-*theme variables, so light and dark themes both render correctly; the panel closes when you click outside and flips open-direction near screen edges. - Clear current-session wallet data — one button clears only the open conversation's token/cost records; it does not delete the conversation, and every other conversation is untouched.
Multi-account
- Open the wallet panel → 账户管理 to add accounts (name + API key), switch the active one, or remove them.
- The first account added becomes the active account automatically and is synced into the credentials seam.
- Switching prompts a confirmation because it changes LLM billing for subsequent requests: the switch writes the account key into the credentials seam (
credentials.set('DEEPSEEK_API_KEY', ...)), and since the llm-deepseek provider route resolves that reference per request, the very next LLM call is billed with the new account — no restart needed. - Account keys are stored plaintext in
$DSH_HOME/storages/accounts.json; the UI only ever shows masked keys. Balance lookups prefer the active account's key and fall back to the credentials seam when no account is active. - Session cost follows the active account's currency: USD-settled accounts show
本约 $x— a clearly-labeled estimate converted from the CNY price table at the vendor's long-standing list ratio (not a live FX rate); CNY accounts show the exact本场 ¥x. - If
DEEPSEEK_API_KEYis supplied by the launching environment, switching is refused with a clear error (the credentials provider rejects shadowed writes) — unset it in your shell to enable switching.
Project overview
One place for the signals that matter
DeepSeek Harness can keep several conversations and model providers active at once, but balance, usage, background-task status, and session actions normally live in different places. Control Center brings the information worth checking repeatedly beside the composer, so the current workflow can answer three questions at a glance: How much official balance remains? What has this conversation used? Does anything need attention?
Present when needed, quiet when not
The project is designed around quick reading and in-context action rather than another full-page dashboard. Its compact surface expands only when needed, adapts to the available space, and leaves layout and reminder behavior under the user's control. Accounting remains separated by conversation and provider, while wallet-data cleanup and permanent session deletion remain intentionally different operations.
Extensible without hiding the boundaries
The npm package handles monitoring and interface behavior; optional host powers are enabled only when DSH actually provides them. That capability-based boundary keeps unsupported actions visibly unavailable and gives browsers or desktop wrappers a small, reviewable adaptation surface. Future providers and controls can therefore be added without changing the established deepseek-harness-wallet package identity or silently expanding what the plugin is trusted to do.
Want permanent session deletion? It cannot be enabled by configuring the plugin alone. Give the integration guide and Agent adaptation prompt to an Agent with access to the buildable DSH source. The control-panel switch becomes available only after the host implementation is built, tested, and advertises the capability.
Details: compatibility · data and trust · pricing
Install
From npm:
dsh plugin --profile web add deepseek-harness-wallet
or from GitHub directly:
dsh plugin --profile web add github:feibi-mochi/deepseek-harness-control-center
Restart dsh web, then hard-refresh the page.
Update
dsh plugin --profile web update deepseek-harness-wallet
Remove
dsh plugin --profile web remove deepseek-harness-wallet
The package was renamed from
dsh-wallettodeepseek-harness-walletin 0.1.1. If you installed the old name, remove it withdsh plugin --profile web remove dsh-walletfirst.
Browser, desktop, and OS compatibility
The client contains no operating-system-specific feature branch; it checks the Web and host capabilities it needs. That makes the same code portable, but portable code is not the same as real-device verification:
| Verification level | Coverage |
|---|---|
| Real environment checked for this release | Windows + current Edge + DSH Web |
| Automated compatibility checks | Browser notification failure, in-page fallback, cross-tab fallback, storage fallback, CSS-scale fallback, and synchronous/asynchronous desktop adapters |
| Capability-compatible targets | Current Chrome, Edge, and Firefox on Windows/macOS/Linux; Safari on macOS; Electron/Tauri-style DSH wrappers that provide the requirements below |
The last row describes intended compatibility, not a claim that every browser/OS/wrapper combination was physically tested. If system notifications are unavailable or denied, reminders fall back to an in-page notice; if Web Locks are unavailable, a renewable local-storage lease coordinates reminder ownership across tabs. CSS zoom also has a transform fallback. Core wallet data, controls, dragging, docking, scaling, and visibility settings use these shared paths rather than an OS name check.
Electron, Tauri, and other DSH desktop wrappers can run the wallet when they expose the normal DSH Web plugin loader, slots, wallet HTTP endpoints, DOM, and fetch. A wrapper that restricts native notifications, persistent storage, or external links may define one optional adapter before the plugin bundle loads:
window.__DSH_WALLET_ADAPTER__ = {
// All fields are optional. Keep storage synchronous and localStorage-compatible.
storage: { getItem, setItem, removeItem },
notify({ title, body, tag, requireInteraction, onClick, onClose }) {
// May return a notification-like handle, Promise, or nothing.
// Call the supplied onClick/onClose callbacks for native events.
},
requestNotificationPermission() { return 'granted' },
openExternal(url) { return true },
capabilities: { permanentDelete: true },
}
notify() may return a notification-like handle, a Promise for one, or nothing for fire-and-forget native APIs. The payload also includes onClick / onClose callbacks so Electron IPC, Tauri notification actions, and other desktop bridges can return events without copying wallet logic; returning false asks the wallet to use its browser fallback. requestNotificationPermission() is optional for hosts such as Tauri and macOS that require a native permission request. Returning false from openExternal() likewise asks the wallet to try the browser fallback. Declare permanentDelete only when the host actually implements the wallet preference and session-menu action; compatible hosts advertise it automatically, while unsupported hosts show a disabled control instead of a switch that has no effect. Platform adaptations are intentionally confined to createCompatibilityAdapter() in lib/client.js, so an Agent can add a new wrapper without editing wallet accounting or UI logic.
For buildable DSH hosts, the npm package and repository include a versioned Agent-assisted permanent-delete integration kit with a Chinese guide, complete Agent prompt, read-only preflight, compatibility manifest, upstream notice, and an exact-baseline reference patch. The patch is not a universal installer: a different DSH commit must be inspected and adapted by semantics, and closed or non-rebuildable desktop applications remain unsupported.
Data & trust
| Item | Behavior |
|---|---|
| Token accounting | Listens to the llm/stream event and buckets per provider (deepseek-official vs. everything else) and per session; each usage event also locks its contemporaneous official price, so multiple sessions and pricing windows never mix. |
| Balance | The key from the credentials seam (or the active account's key) never leaves this machine except as the Authorization header of the official /user/balance request. |
| Accounts | Keys live in $DSH_HOME/storages/accounts.json (plaintext, matching the harness's own credential storage); the UI only ever shows masked keys, and switching writes the chosen key into the credentials seam for LLM billing. |
| Session log | The plugin writes no events; its data lives in $DSH_HOME/storages/wallet.json. |
| Local settings | Layout, scale, visibility, reminder, and panel settings stay in browser-compatible local storage. |
| Permanent deletion | Opt-in and host-gated. The wallet never advertises the action unless the host implements the matching session deletion path. |
| Model surface | No tools registered, no prompt injection, zero token cost. |
| Recharge | The URL is hardcoded to the official https://platform.deepseek.com/top_up and is not user-configurable (anti-phishing). |
Pricing timeline
CNY per 1M tokens, curated from official announcements (cache writes are not billed):
- Since 2025-02-09 — deepseek-chat 2/8 (cache read 0.5), deepseek-reasoner 4/16 (cache read 1)
- Since 2026-04-24 — v4-flash 1/2 (cache read 0.02), v4-pro 3/6 (cache read 0.025)
- Since 2026-08-17 00:00 Beijing — peak/off-peak pricing for the v4 models (peak windows Beijing 09:00–12:00 / 14:00–18:00; off-peak is half the peak rate):
- v4-flash (off-peak / peak): cache read 0.05 / 0.10, input 1.5 / 3, output 4.5 / 9
- v4-pro (off-peak / peak): cache read 0.15 / 0.30, input 4.5 / 9, output 13.5 / 27
deepseek-chat and deepseek-reasoner keep their flat rates. Each usage event is priced when it arrives; upgrading from 0.1.2 migrates legacy counters once using the then-current rate. Costs are estimates; the API-returned balance is authoritative.
Roadmap
- Third-party price tables (cost per token)
- Balance history chart
- Balance-API adapters for other providers (e.g. Zhipu)
License
Read the usage guide →
Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.
Listing badge
[](https://deepseek-plugin.org/plugins/feibi-mochi/deepseek-harness-wallet)Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.