DeepSeek Harness plugin

dsh-provider-quota

Model-provider quota display: a settings section plus a sidebar capsule.

Jump to install

Source facts

Repository
781316853/dsh-provider-quota
Latest update
Aug 14, 2026
Category
Usage & Billing
GitHub stars
1
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/781316853/dsh-provider-quota
Plugin: dsh-provider-quota
Author: 781316853

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-provider-quota

模型供应商额度查询插件,为 DSH Web GUI 提供实时额度显示:侧边栏底部入口 + 弹出面板(每 60 秒自动轮询),以及「设置 → 模型额度」页的完整查询区块。

  • 支持 DeepSeek / OpenAI / Moonshot / 智谱 / OpenRouter / SiliconFlow / Z.AI 等提供余额查询接口的供应商
  • API 密钥仅在宿主侧解析,浏览器端只渲染路由返回的归一化结果,密钥不会发送到浏览器
  • 热插拔安装:通过 profile bundle patch + node_modules 链接挂载,无需改动 dsh 源码

功能

  • 侧边栏实时面板:侧边栏底部「模型额度」入口,点击弹出实时面板,每 60 秒自动轮询所有已配置供应商的余额;点击面板外或按 Esc 关闭
  • 设置页区块:「设置 → 模型额度」展示每个已配置供应商的账户余额(可用 / 已用 / 总额 / 套餐 / 滚动窗口等),支持手动刷新
  • 多形态额度:金额(CNY/USD 等)、百分比窗口(如 5 小时滚动)、Token 用量(Z.AI)
  • 中英文双语:界面文案跟随 GUI 语言

安装

> 本插件是 bundle 形态插件dsh.bundle.patch 声明宿主与浏览器两个半部分),因此除依赖安装外,还需出现在 profile 的 dsh.profile.bundles 层栈中,二者缺一不可。这一机制与官方 @deepseek-ai/dsh-base@deepseek-ai/dsh-web-app 等 bundle 插件一致。 > > 所有方式安装后都需要重启 web 服务(dsh web 或重启桌面端);也可在「设置 → 插件」页用插件管理器安装,它会自动处理依赖与 bundle 层栈。

方式一:GitHub Release tarball(无需构建)

每个版本在 GitHub Releases 附带了打包好的 tarball(含构建产物,安装即用):

dsh plugin --profile web add https://github.com/781316853/dsh-provider-quota/releases/download/v0.1.0/dsh-provider-quota-0.1.0.tgz
# 然后同上:把包名加入 dsh.profile.bundles 并重启

方式二:GitHub 仓库源(安装时自动构建)

dsh plugin --profile web add github:781316853/dsh-provider-quota
# 安装时会自动运行 prepare 构建(生成 lib/ 产物),再按上面加入 bundles 并重启

方式三:本地开发目录链接

dsh plugin --profile web add link:E:/path/to/dsh-provider-quota
# 然后同上:把包名加入 dsh.profile.bundles 并重启

安装后重启 web 服务即可加载。在「模型」页配置供应商与 API 密钥后,额度即可查询。

开发构建

pnpm install
pnpm typecheck   # tsc --noEmit
pnpm build       # esbuild → lib/index.js(宿主)+ lib/client.js(浏览器 bundle)+ tsc → lib/types(d.ts)

lib/ 为构建产物(已 gitignore),打包 / 部署前需先执行 pnpm build

发布新版本

pnpm build
pnpm pack                 # 生成 tarball(含构建产物,如 dsh-provider-quota-0.1.0.tgz)

将 tarball 上传到 GitHub Releases(仓库 → Releases → Draft a new release,选择对应 tag,附加 tarball),然后把安装章节中的下载 URL 更新为新版本地址。

使用

1. 在「模型」页配置至少一个支持余额查询的供应商及其 API 密钥 2. 实时面板:点击侧边栏底部的「模型额度」图标,面板自动刷新余额;「全部刷新」可手动立即刷新 3. 设置页:「设置 → 模型额度」查看每个供应商的详细额度与更新时间

项目结构

src/
  index.ts            # 宿主侧入口:/api/dsh-provider-quota 路由 + system-prompt 声明
  routes.ts           # 供应商列表 / 额度查询路由(密钥解析在宿主侧)
  providers.ts        # 各供应商余额接口适配
  balance.ts          # 余额归一化
  client/
    index.ts          # 浏览器侧入口:注册设置页区块 + 侧边栏入口
    QuotaSection.tsx  # 设置页额度区块
    QuotaSidebarAction.tsx  # 侧边栏底部入口按钮
    QuotaPanel.tsx    # 弹出实时面板(60s 自动轮询)
    QuotaRow.tsx      # 单供应商额度卡片
    quota-data.ts     # 共享数据层(useQuotaData 轮询 hook)
    locales.ts        # 中英文文案
scripts/
  build.mjs           # esbuild 构建宿主与浏览器 bundle
  watch.mjs           # 开发监听
  wrap-client.mjs     # 浏览器 bundle 包装为 lazy-CJS 格式
cordis.patch.yml      # bundle patch(插入 provider-quota 行到 web profile)

License

[MIT](LICENSE)