DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Model Usage — DeepSeek Harness 插件(DSH Plugin)
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
M

dsh-model-usage

Model Usage

DeepSeek Harness 插件:在会话标题中显示模型使用情况和账户余额——OpenCode Go 计划使用情况(滚动周期/每周/每月)及所选模型的每月上限,以及 DeepSeek 账户余额——仅在匹配的模型处于当前选择状态时显示相应信息。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:itchenshi/dsh-model-usage#5fb7297931e99a7c2590ea28fe4d4857cabe0852
README兼容性版本

兼容性与来源证明

Model Usage 以 dsh-model-usage 发布,当前版本为 0.3.1。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
github
Registry 更新时间
2026/9/21

版本

0.3.1stable
2026/9/21

相关插件

正在加载相关插件…

最新版
0.3.1
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
web
许可证
MIT
发布源
github
周下载
0
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 models-usage 分类下经过校验的插件。

Usage@linxin666/dsh-usage用于 dsh Web GUI 的使用统计插件:检测各提供商的余额和编程套餐配额,并实时记录令牌使用情况;侧边栏 Settings 行上方显示紧凑的价格概览卡片Whale Widgetdsh-whale-widgetDSH Web 界面右下角的 DeepSeek 余额小鲸鱼挂件:余额/今日已用/峰谷定价、自定义泡泡点击序列(文本/余额/今日/峰谷/图片/随机语句与并列加权选择)、逐行样式与字体、悬浮快捷编辑、音效与每轮消耗、自定义角色/动图/音效、吸附与翻转自定义Commandcode Provider@mars-sea/dsh-commandcode-provider适用于 Command Code 的非官方 DeepSeek Harness LLM 提供商插件,移植自 pi-commandcode-provider(MIT)。注册“commandcode”提供商路由,并在 Models 页面添加卡片和实时模型目录。Plugin Subscriptionsdsh-plugin-subscriptions将 ChatGPT (Codex)、Claude、Grok (X Premium)、GitHub Copilot 和 Google Antigravity 订阅用作 DeepSeek Harness LLM 提供商,并通过网页设置页面使用 OAuth 登录

README

dsh-model-usage

Shows model usage / account balance in the DeepSeek Harness session header, gated on the session's active model selection:

Active model routeWidget showsSource
opencode-go / opencodeOpenCode Go plan usage — rolling / weekly / monthly percentages + reset time, plus the selected model's monthly cap (上限 $60)GET https://opencode.ai/zen/go/v1/usage + per-model limits table (see below)
deepseek-officialDeepSeek account balance — total / granted / topped-upGET https://api.deepseek.com/user/balance
┌─ session header ─────────────────────────────────────────────────────────┐
│  My conversation title  [OpenCode Go 滚动 18% 周 82% 月 42% 上限 $60] 打开功能 ▾ │
│  Another conversation   [DeepSeek ¥110.00]                           打开功能 ▾ │
└──────────────────────────────────────────────────────────────────────────┘
        slot: conversation.session.header.actions

Placement

The widget registers at conversation.session.header.actions, which the engine documents as "Title-adjacent Session actions in ascending order" — verified in the engine's own header source as:

titleRow
  ├─ titleCluster
  │    ├─ crumbs         ← the session title
  │    └─ headerActions  ← THIS widget (right of title)
  ├─ headerUtilities     ← "open feature" buttons
  └─ headerCorner        ← right-sidebar ExpandButton

Gating rule

The widget renders only when the session's current model routes to a tracked provider. The selection is read from ctx.modelDirectories.directoryFor(sessionId).store — the same shared state the model selector and composer seat use, so a model switch shows/hides the widget immediately.

Which route belongs to which section is configuration, owned by the host half: the host returns its live provider→section map (sections) on every poll, and the client gates on that. Changing providers in cordis.patch.yml therefore takes effect without touching client code.

Two halves

HalfFileRuns inJob
Hostlib/index.jsNodeFetches each section from its upstream and serves it over one same-origin JSON route.
Clientclient/client.jsBrowserRegisters the header widget, polls the host route, gates on the active model.

API keys never reach the browser: the host half resolves them through ctx.credentials by reference (OPENCODE_GO_API_KEY, DEEPSEEK_API_KEY) and calls the upstream.

Host route

这条路由受引擎的信任围栏保护(Host 白名单 + 浏览器会话 cookie)。它返回账户用量与余额, 因此不带 cookie 的裸 curl 会得到 401 unauthorized(修复前返回 200 —— 任何本机进程、 以及被 DNS rebinding 的页面都能读到)。同源的页面请求会自动带上 cookie;手工调用需先用 dsh web 打印的 URL 换一次会话 cookie,再以 -H 'cookie: …' 传入(示例见 dsh-gui-last-session/README.md)。

GET /model-usage
{
  "ok": true,
  "sections": {
    "opencode-go": { "providers": ["opencode-go","opencode"], "keyRef": "OPENCODE_GO_API_KEY" },
    "deepseek":    { "providers": ["deepseek-official"],    "keyRef": "DEEPSEEK_API_KEY" }
  },
  "opencode-go": { "ok": true, "usage":   { "rolling": {…}, "weekly": {…}, "monthly": {…} }, "fetchedAt": 1700000000000 },
  "deepseek":    { "ok": true, "balance": { "isAvailable": true, "infos": [ { "currency":"CNY", "total":"110.00", "granted":"10.00", "toppedUp":"100.00" } ] }, "fetchedAt": 1700000000000 },
  "limits": { "deepseek-v4.1-flash": { "hours5": 12, "weekly": 30, "monthly": 60 }, … },
  "limitsMeta": { "source": "docs|cache|builtin", "updatedAt": "2026-09-20T…" }
}

The per-section entries are keyed by section key — the same keys as sections, which is what the page half indexes with (the camelCase opencodeGo / deepseek names are the config keys in cordis.patch.yml, not the wire keys).

Each section reports its own outcome, so a user with only one of the two keys still gets that half; the other half degrades to a diagnostic label ({"ok":false,"reason":"no-key|unauthorized|network|timeout|bad-payload"}) instead of hiding the widget.

Upstream APIs (verified)

OpenCode Go usage

GET https://opencode.ai/zen/go/v1/usage
Authorization: Bearer <OPENCODE_GO_API_KEY>
200 {"usage":{"rolling":{"status":"ok","percent":18,"resetsAt":"..."},
              "weekly":{...},"monthly":{...}}}

DeepSeek account balance (official docs)

GET https://api.deepseek.com/user/balance
Authorization: Bearer <DEEPSEEK_API_KEY>
200 {"is_available":true,
     "balance_infos":[{"currency":"CNY","total_balance":"110.00",
                       "granted_balance":"10.00","topped_up_balance":"100.00"}]}

The host normalizes and clamps the usage payload (percent 0–100) and normalizes the balance amounts (the upstream sends decimal strings; finite numbers are accepted too). Each section is cached for 60s and re-polled after failures no sooner than 30s.

Per-model monthly limits (opencode-go)

OpenCode Go's usage endpoint is account-wide — it ignores per-model params, and there is no API for the per-model monthly caps documented under "使用限制" (e.g. DeepSeek V4.1 Flash $60/mo, DeepSeek V4 Pro $15/mo). So the plugin:

  1. ships a built-in table (BUILTIN_MODEL_LIMITS, last synced 2026-09-20),
  2. auto-refreshes by fetching the public docs page (https://opencode.ai/docs/zh-cn/go/ — server-rendered, no JS, no API key) and parsing the limits + model-id tables into model id → monthly $,
  3. caches the parsed result at $DSH_HOME/logs/model-usage-limits.json,
  4. falls back cache → built-in on any fetch/parse failure.

Refresh schedule: at plugin start (background), then every 24h. The widget shows the selected model's monthly cap (上限 $60) next to the account-level percent bars, and its tooltip lists the derived caps (5h = 20% · week = 50% · month = 100%), the data source (OpenCode Go 文档(9/20) / 本地缓存 / 内置表), and a note that the percentages are account-wide while the cap is per model. A rate-limited bucket is shown in red with its reset time.

The derived tiers are computed host-side (deriveLimitTiers); the client just looks up limits[modelId].

Install

dsh plugin --profile web add dsh-model-usage

Restart dsh web (or reopen DSH GUI) afterwards. The same package can be installed from DSH GUI's Settings → Third-party plugins, or one-click from the plugin marketplace.

Configuration

The plugin row lives in cordis.patch.yml; every key is optional:

- insert:
    - id: model-usage
      name: dsh-model-usage
      config:
        enabled: true

        opencodeGo:
          baseUrl: https://opencode.ai/zen/go/v1   # upstream root
          apiKeyRef: OPENCODE_GO_API_KEY           # credential reference
          providers: [opencode-go, opencode]       # routes treated as OpenCode Go

        deepseek:
          baseUrl: https://api.deepseek.com        # upstream root
          apiKeyRef: DEEPSEEK_API_KEY              # credential reference
          providers: [deepseek-official]           # the engine's DeepSeek route

A top-level baseUrl / apiKeyRef / providers is still read as the opencodeGo section (this plugin used to be OpenCode-Go-only).

Development

node --check lib/index.js
npm test        # local behaviour tests (no network, no engine)

tests/e2e.cjs is a full integration check against a real engine + browser (it needs a running profile, so it is not part of npm test).

License

MIT