dsh-webui-perf
awa-123-cw
DeepSeek Harness WebUI 性能优化开关插件:长代码流式渲染/历史加载/高亮缓存优化,设置面板一键开关(with official-package patches)
PROJECT TOPICS
PROJECT README
English | 中文
DeepSeek Harness(DSH)工作台插件:用你的 DeepSeek 官方 API Key 实时查看账户余额和当前会话花费。
CNY ¥19.16),弹层含总余额 / 赠送 / 充值明细,60 秒自动刷新。会话 ¥0.0042 融合进系统自带的 composer 统计条同一行,悬停显示明细(模型 / 未命中 / 命中 / 输出 / 合计 / 计费时段)。费用按官方价格页快照计算(含 2026-08-17 峰谷调价,按北京时间峰谷时段自动选价),是估算值,token 数来自 DSH 的 tokenUsage 会话投影(provider 报告的真实值)。packages/
deepseek-billing/ 宿主插件(dsh.bundle 包):注册 /api/deepseek-billing/balance 路由,
以 apikey 查询官方余额接口;与客户端包一起安装后,
其 bundle 补丁自动挂载两行插件
ui-deepseek-billing/ 客户端插件(dsh.client 包):余额按钮 + 统计条费用组
patches/
001-composer-stats-extra.patch (可选)给 dsh 客户端源码打 15 行补丁,
解锁"统计条融合"(详见下文)
tools/ vendored 的 client bundle 构建预设(脱离主仓库也能重建 bundle)
预构建产物(lib/)已提交,开箱即用,无需编译。
git clone https://github.com/xinCodes/deepseek-billing-plugin.git
file: 依赖挂进去(<repo> 指代本仓库路径):cd $DSH_HOME/profiles/billing # 不存在则 mkdir 后用 dsh plugin --profile billing 初始化
pnpm add file:<repo>/packages/deepseek-billing file:<repo>/packages/ui-deepseek-billing
其中 packages/deepseek-billing 声明了 dsh.bundle(patch 清单),bundle 机制会把补丁里两行插件(宿主 + 客户端)挂进组合树,无需 --patch;客户端包需一并安装(它是补丁引用的包名)。
dsh --profile billing web
packages/deepseek-billing 拷到检出根 packages/billing/deepseek-billing,把 packages/ui-deepseek-billing 拷到 packages/client/ui-deepseek-billing。packages/bundle/web-app/package.json 的 dependencies 加 "@deepseek-ai/dsh-deepseek-billing": "workspace:^"(客户端包已在其内则跳过)。pnpm install 后,用 bundle 补丁启动:pnpm dsh web --patch ./packages/billing/deepseek-billing/cordis.patch.yml
余额接口需要你的 DeepSeek 官方 API Key(open platform 的 sk- key)。插件按以下顺序解析,密钥只发往 api.deepseek.com:
apiKeyDEEPSEEK_API_KEY)DEEPSEEK_API_KEY覆盖示例(编辑 packages/deepseek-billing/cordis.patch.yml):
- insert:
- id: deepseek-billing
name: '@deepseek-ai/dsh-deepseek-billing'
config:
baseURL: 'https://api.deepseek.com'
apiKeyEnv: DEEPSEEK_API_KEY
# apiKey: sk-xxx # 不推荐写入配置,优先用环境变量/credentials
费用融合依赖 DSH 客户端新增的一个子槽 conversation.composer.stats.extra。未打补丁也能用(余额功能完整),只是会话费用不显示。要解锁:
cd <你的 deepseek-harness 检出>
git apply <repo>/patches/001-composer-stats-extra.patch
pnpm --filter @deepseek-ai/dsh-client-ui-conversation bundle # 重建 conversation 的 client bundle
# 重启 dsh web 并硬刷新页面
补丁内容(StatsLine 及其 slot 声明共 ~15 行):给统计条条目声明一个 list 子槽,并在统计行里渲染它,费用组件借此把 会话 ¥… 插进同一行。
packages/ui-deepseek-billing/src/pricing.ts 的 DEFAULT_PRICE_TABLE:按生效时间的多档价目(2026-08-17 起峰谷定价已建模)。官方调价时改这里即可;改动后重新 pnpm build(或只用检出内构建)。
pnpm install # 依赖来自 npm 上的 @deepseek-ai/* rc 包
pnpm build # 类型检查 + 重建客户端 bundle(lib/client.js)
pnpm test # 宿主包单元测试(客户端测试需在完整 dsh 检出内运行)
api.deepseek.com(余额接口),不落日志、不进前端界面。A plugin for the DeepSeek Harness web workbench that shows your DeepSeek account balance (top session header) and the current session's estimated cost (fused into the built-in composer stats strip, live from the tokenUsage session projection). Cost pricing snapshots the official pricing page, including the 2026-08-17 Beijing peak/off-peak tiers; it is an estimate. Installation: clone, add both packages to a DSH profile as file: dependencies (the deepseek-billing package is a dsh.bundle, so its patch mounts both halves automatically), then dsh --profile <name> web. To enable the stats-strip fusion, apply patches/001-composer-stats-extra.patch to your harness checkout and rebuild the conversation client bundle. The API key is read from plugin config → credentials domain → DEEPSEEK_API_KEY env, and is sent only to api.deepseek.com.
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。