dsh-web-ui
zhu1090093659
Plugin and skin collection for DeepSeek Harness (DSH) Web UI - task board, git graph, right-side panel, remote mobile UI, pet, live token stats, and skin center.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:c-ling/dsh-plugin-wallet
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DeepSeek Harness 钱包插件(DSH 双面插件):查看 DeepSeek 官方 API 余额,并在会话维度估算 token 消费金额。
? 图标悬停查看估算口径说明);金额 ≈ ¥3.87 | 1 轮 · 68 步 | …,不再单独占用底部一行。单位:元 / 百万 tokens,北京时间(UTC+8)。
| 时段 | 模型 | 输入(缓存命中) | 输入(缓存未命中) | 输出 |
|---|---|---|---|---|
| 2026-08-17 00:00 前 | deepseek-v4-flash | 0.02 | 1.0 | 2.0 |
| 2026-08-17 00:00 前 | deepseek-v4-pro | 0.025 | 3.0 | 6.0 |
| 空闲时段 | deepseek-v4-flash | 0.05 | 1.5 | 4.5 |
| 高峰时段 | deepseek-v4-flash | 0.10 | 3.0 | 9.0 |
| 空闲时段 | deepseek-v4-pro | 0.15 | 4.5 | 13.5 |
| 高峰时段 | deepseek-v4-pro | 0.30 | 9.0 | 27.0 |
高峰时段:09:00–12:00、14:00–18:00;其余为空闲。
计费公式:(输入未命中 + 缓存写入) × 未命中价 + 缓存读取 × 命中价 + 输出 × 输出价。
金额按会话日志与内置价格表估算,不是官方账单;fork 会话与 subagent 会话各自独立统计。
从 GitHub 安装到 web profile(需要 pnpm 在 PATH 上;没有则用下面的 corepack 方式):
npx @deepseek-ai/dsh plugin --profile web add "github:c-ling/dsh-plugin-wallet#v1.2.0"
或使用已有的 dsh 命令:
dsh plugin --profile web add "github:c-ling/dsh-plugin-wallet#v1.2.0"
pnpm 不在 PATH 上时:
cd ~/.dsh/profiles/web
corepack pnpm add "github:c-ling/dsh-plugin-wallet#v1.2.0"
dsh plugin把参数原样转发给 pnpm,直接从本仓库拉取包(pnpm 9+,本机需装有git)。 安装时若看到declares no dsh.bundle — installed as a plain dependency的提示属正常现象: 本插件不是 profile bundle 层,而是通过下面的 loader 行激活。
然后在 ~/.dsh/profiles/web/cordis.patch.yml 增加一行插入:
- insert:
- id: dsh-plugin-wallet
name: 'dsh-plugin-wallet'
config: { threshold: 10, refreshIntervalMs: 300000 }
threshold 为低余额阈值(人民币,默认 10);refreshIntervalMs 为侧边栏角标的余额刷新周期(默认 5 分钟)。
重启 dsh web(client-modules 按进程缓存包裁决,新包必须重启宿主),然后硬刷新页面,
侧边栏设置按钮上方即出现钱包按钮,会话 stats 行最开头会出现金额。
curl -s http://127.0.0.1:3080/plugins/dsh-plugin-wallet/client.js | head -c 60
curl -s http://127.0.0.1:3080/dsh-plugin-wallet/balance
第一条应输出 window.__ModuleLoader__.load({ 开头的 factory bundle;
第二条应输出脱敏后的余额数据(不包含完整 API Key)。
dsh plugin --profile web add "github:c-ling/dsh-plugin-wallet#v1.2.0"
# 或:npx @deepseek-ai/dsh plugin --profile web add "github:c-ling/dsh-plugin-wallet#v1.2.0"
# 或:cd ~/.dsh/profiles/web && corepack pnpm add "github:c-ling/dsh-plugin-wallet#v1.2.0"
用新的版本号重新执行安装命令即可升级依赖;cordis.patch.yml 中的 loader 行保持不变。
重启 dsh web,然后硬刷新页面。
cd ~/.dsh/profiles/web
corepack pnpm remove dsh-plugin-wallet # 或 dsh plugin --profile web remove dsh-plugin-wallet
同时删除 cordis.patch.yml 中对应的 insert 行,然后重启 dsh web。
本插件只使用内存缓存,无持久化数据,卸载后界面完全还原。
node --check lib/index.js lib/client.js
node --test
python3 -m json.tool package.json
lib/index.js:host half。仅使用 Node 内置模块;注册
GET /dsh-plugin-wallet/balance 路由,并通过 ctx.sessionProjections 注册
walletSessionCost 投影(token 分桶存 state,读取时按价格表计费)。lib/client.js:手写 factory-CJS bundle,无构建步骤;通过
sidebar.footer.action、shell.overlay、conversation.composer.dock 三个插槽注册 UI,
inject: ["slots", "locale", "sessions"] 保证 fiber 在插槽就绪后 apply。--dsw-alias-* 主题变量。deepseek-official 且 baseURL 为 https://api.deepseek.com;自定义网关余额不查询。sidebar.footer.action,插件通过一条 :has() 规则让脚部操作条纵向排布;
DSH 升级若调整 hHd-Xa_footArea / hHd-Xa_footerActions 类名,按钮会退回普通 flex 行内(不影响功能)。CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: cost、sidebar、ui-plugin、web-ui。