Sidebar balance row for DSH Desktop — account balance and a top-up button, right under the version row; refreshes every 10 minutes and whenever the window regains focus, with explicit signed-out and error states.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:mhxy13867806343/dsh-sidebar-account
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
侧栏底部多一行:余额 + 充值。
┌──────────────────────────────┐
│ ↑ 2.0.16 → 2.0.17 [更新] │ ← dsh-desktop-updater
├──────────────────────────────┤
│ 👛 余额 ¥1.96 [充值] │ ← 本插件
├──────────────────────────────┤
│ (头像) token 患者 │ ← 宿主自带
└──────────────────────────────┘
- 左边显示充值余额(和「设置 → 账号与余额」里那个 ¥1.96 是同一条数据); 只有赠金时显示赠金;鼠标悬停可以看到「充值余额 / 赠金余额」的完整拆分。
- 右边「充值」按钮点了直接打开充值页(系统浏览器),链接就是账号接口
getState().links.topUpUrl—— 和设置页「充值」按钮用的是同一个地址。 - 未登录时显示「未登录」,按钮依然可用(充值页那边会让你登录)。
- 收起成窄栏时变成一个钱包图标按钮,点了同样去充值。
数据来源与刷新
数据全部来自宿主已经生成好的远端命名空间 ctx.remote.account(本插件没有自己的 Host 服务):
| 调用 | 用到什么 |
|---|---|
ctx.remote.account.getState() |
status(是否登录)、links.topUpUrl(充值地址) |
ctx.remote.account.getBalance({ version, locale, timezoneOffsetSeconds }) |
value(充值余额钱包)、bonusWallets(赠金) |
刷新时机:挂载时、窗口重新获得焦点 / 页面重新可见时(30 秒节流)、每 10 分钟一次。
金额按设置页同样的规则格式化:向下截到两位小数、小于 0.01 显示 <¥0.01、千分位分组;
全程走字符串截断,不经过浮点数,避免 1.005 这类舍入坑。
备注
- 只读:本插件不写任何账号状态,也不发起登录/登出,只读余额 + 给一个充值链接。
- 不 import 任何 Harness 客户端包,样式只用
--dsw-alias-*主题变量,深浅色自动跟随。 - 排序:
sidebar.footer.action里order: 110,排在更新行(100)下面、账号行上面。
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10696
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10696
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 8484
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7509
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5395
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1082
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.