dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
Floating token & cost monitor for DeepSeek Harness
English · 简体中文
整个插件,除了这一行字以外,由DeepSeek Harness生成
给 DeepSeek Harness 用的悬浮小窗:显示账户余额、当前对话已消耗的 token,以及按官方价目估算的本次对话花费。
贴在窗口右边缘的一个窄竖条 + 展开卡片,可拖动、可收起,不占阅读空间。
┌──────────────────────┐ ┌──┐
│ ● 你的对话标题 × │ │¥ │
│ 余额 ¥25.87 │ │25│
│ 本对话 ≈¥0.42 25.4M│ │.8│
└──────────────────────┘ └──┘
悬停后展开明细 ↑
web_search / web_fetch 调用次数,按官方 5 元/千次计价
(官方说明 2026-11-01 00:00 前不计费,插件会按日期自动决定是否计入)插件是标准的 DSH bundle,同时带 host 半(index.js)和 client 半(client.js)。
命令里的
<profile>换成你要装的 profile 名;桌面版就是desktop。dsh plugin会把参数原样转给 pnpm,所以任何 pnpm 能装的 spec 都行。
dsh plugin --profile <profile> add github:Ta9y/dsh-token-monitor
设置 → 插件 → 安装,粘贴 github:Ta9y/dsh-token-monitor。
cd $HOME\.dsh\profiles\desktop
pnpm add file:C:/path/to/dsh-token-monitor
然后把 dsh-token-monitor 加进该目录 package.json 的 dsh.profile.bundles 数组。
⚠️ 尚未发布到 npm,这条命令现在会 404。等发布后可用:
dsh plugin --profile <profile> add dsh-token-monitor
安装后需要重启一次 DSH 进程:host 半的代码走 ESM 缓存,重载插件不会重新执行。 之后改
ui.js/config.json只要刷新页面即可。
config.json(插件目录下,改完刷新页面生效,不用重启):
{
"pollSeconds": 10, // 页面轮询间隔(秒)
"balanceSeconds": 60, // 余额查询间隔(秒)
"autoPrices": true, // true = 每月从官网抓价;false = 只用手写的 prices
"searchPer1000": 5, // Search 单价(元/千次)
"fetchPer1000": 5, // Fetch 单价(元/千次)
"searchBillingFrom": "2026-11-01",
"prices": { // 元 / 百万 token,按模型 + 时段
"deepseek-flash": {
"offpeak": { "cacheHit": 0.02, "cacheMiss": 1, "output": 4 },
"peak": { "cacheHit": 0.04, "cacheMiss": 2, "output": 8 }
},
"deepseek-v4-pro": {
"offpeak": { "cacheHit": 0.15, "cacheMiss": 4.5, "output": 13.5 },
"peak": { "cacheHit": 0.3, "cacheMiss": 9, "output": 27 }
}
}
}
单位:元 / 百万 token。高峰 = 北京时间工作日 9:00–12:00、14:00–18:00,其余时段(含周末)为半价。
requestContext() 读出;未知模型回落到 deepseek-flash价格来源:DeepSeek 官方价目页,
由插件每月自动抓取并缓存在 prices.auto.json(含 fetchedAt);解析失败时保留旧值。
ctx.deepseekAccount.getBalance())读取localStorage(竖条位置)里debug.log(诊断,可删)、token.txt(页面随机令牌)、prices.auto.json(价格缓存)@deepseek-ai/dsh-base + dsh-web-app 组合)dsh.client 客户端模块注入;纯浏览器模式(dsh web)通过 index 注入—index.js host 半:读余额、累加 usage、HTTP 路由、价格抓取
client.js client module:把 ui.js 挂进页面,并桥接应用语言
ui.js 悬浮窗本体:纯 DOM + Shadow DOM,无构建、无依赖
cordis.patch.yml bundle 层:插入插件行
config.json 默认配置
test/smoke.mjs 假 ctx 的回归测试(npm test)
test/prices.mjs 拿真实官方页面验证价格解析(npm run test:prices)
bundle patch 插入新行必须用 insert:。- id: xxx 是「覆盖已存在条目」的语义,
条目不存在时只打印 patch: entry "xxx" not found 然后静默跳过 —— 插件看起来装好了但根本没加载。
- insert:
- id: dsh-token-monitor
name: 'dsh-token-monitor'
路由/注入注册必须包在 ctx.effect() 里。否则插件热重载时旧路由不会释放,
新实例注册同名路径直接抛 duplicate route,apply 半路夭折(表现为"改了代码没反应")。
cd dsh-token-monitor
git init
git add .
git commit -m "feat: dsh-token-monitor 1.0.0"
git branch -M main
git remote add origin https://github.com/Ta9y/dsh-token-monitor.git
git push -u origin main
如果想换仓库地址,改 package.json 里的 repository / homepage / bugs 三处即可。
仓库建好后记得加 Topics(右侧 About 旁的齿轮):
dsh-plugin dsh deepseek-harness deepseek plugin token cost balance
dsh-plugin 是检索 DSH 插件时最主要的标签。