DeepSeek Harness plugin

dsh-go-balance-show

OpenCode Go usage ring next to the send button, shown while an opencode-go model is selected.

Jump to install

Source facts

Repository
TheMyceliumOfAntan/dsh-go-balance-show
Latest update
Aug 14, 2026
Category
Usage & Billing
GitHub stars
1
Format
bundle
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/TheMyceliumOfAntan/dsh-go-balance-show
Plugin: dsh-go-balance-show
Author: TheMyceliumOfAntan

Check the source files

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

File explorer3 files
README.mdSource · read only

dsh-opencode-go-usage

DeepSeek Harness Web GUI 插件:在输入框发送按钮旁边显示 OpenCode Go 的用量圆环。 圆环实时显示滚动用量,点击后弹出 滚动 / 每周 / 每月 三个进度条及各自的重置倒计时。仅当你选中使用 opencode-go provider 的模型时显示。

常驻、零配置、跨刷新持久:装好之后每次打开页面自动加载,工作区里不需要也不能再通过「Cordis Plugin」手动启用。

功能

  • 发送按钮旁 16px 小圆环,显示 OpenCode Go 滚动用量(绿 <75% / 黄 <90% / 红 ≥90%)。
  • 点击圆环弹出面板,含三档进度条:

- 滚动(Rolling,OpenCode Go 的滚动窗口,通常 5h) - 每周(Weekly) - 每月(Monthly) - 每档显示已用百分比 + 重置倒计时

  • 圆环位于上下文环(ContextMeter)和发送/停止按钮之间(flex order 重排)。
  • 仅当 agentDefaultModel.currentSelection() 返回的 provider 为 opencode-go 时显示。
  • 自动轮询:模型判断每 5s、用量每 60s,面板支持手动刷新。

数据来源

用量来自 OpenCode Go 官方接口:

GET https://opencode.ai/zen/go/v1/usage
Authorization: Bearer <API_KEY>

返回三档用量(rolling / weekly / monthly 各自的 percentresetsAt)。

API Key 从哪里来?

插件按顺序自动读取,不会把 Key 发给浏览器(Host 端拉取后只把派生用量下发):

1. ~/.dsh/.credentials.yaml 里的 OPENCODE_GO_API_KEY; 2. ~/.local/share/opencode/auth.json 里的任意账号 key; 3. 环境变量 OPENCODE_GO_API_KEY

> 如果你用了其它位置存 Key,只需让上面任意一项命中即可;找不到 Key 时接口返回 502,面板会显示错误提示。

架构

采用 DeepSeek Harness 的「web profile 常驻 bundle 插件」结构(参考 dsh-nachoneko-theme),一个包同时包含 Host 半边(服务端)和 Client 半边(浏览器 bundle):

文件角色
index.jsHost 半边:注册 webServer 路由 /api/opencode-go/view/api/opencode-go/usage;读取 Key、用 subprocess+curl 拉用量、读取当前模型。
src/client-source.jsClient 源码(ESM,import React)。构建时被打进 client.js
client.js生成的浏览器 bundle(window.__ModuleLoader__.load(...),只 require('react') + ctx.inject(['slots']))。
cordis.patch.yml向 loader 插入 Host 行 opencode-go-usage
build.mjssrc/client-source.js 生成 client.js(改前端后运行 node build.mjs)。

关键点:

  • README / 安装都以 link: 包方式接入 web profile。
  • Client 与 Host 之间不依赖动态插件的 host.call,而是通过 Host 的 webServer 暴露 HTTP 路由、Client 用同源 fetch 读取——避免了 Remote/Typert 代码生成。
  • Host 只用 web profile 里确有的服务:webServersubprocess(web profile 没有挂 fs,所以读文件走 cmd /C type)。

安装(给朋友 / 其它机器)

前提:你的 DeepSeek Harness 用 dsh web(web profile)运行,且 DSH 主目录是 ~/.dsh

1. 把插件放到本地任意目录

把本目录(或解压 zip)放到例如 C:\Project\dsh-opencode-go-usage,保证 package.jsonindex.jsclient.jscordis.patch.yml 都在。

2. 接入 web profile

编辑 ~/.dsh/profiles/web/package.json,加入依赖并把它加进 dsh.profile.bundles

{
  "dependencies": {
    "dsh-opencode-go-usage": "link:C:/Project/dsh-opencode-go-usage"
  },
  "dsh": {
    "profile": {
      "bundles": [
        "@deepseek-ai/dsh-base",
        "@deepseek-ai/dsh-web-app",
        "dsh-opencode-go-usage"
      ]
    }
  }
}

3. 安装依赖并链接

cd ~/.dsh/profiles/web
pnpm install --force

pnpm install 可能重写 package.json,如果它把 dsh.profile.bundles 里的 dsh-opencode-go-usage 覆盖掉了,重新把它加回去,再用 cd ~/.dsh/profiles/web && pnpm install 链接,node_modules/dsh-opencode-go-usage 会变成指向插件目录的 junction。)

4. 重启 web

停掉 dsh web,重新运行 dsh web。刷新页面即可。

5. 验证

  • GET http://127.0.0.1:3080/api/opencode-go/view → 返回 {"provider":"opencode-go","isOpencodeGo":true,...}
  • GET http://127.0.0.1:3080/api/opencode-go/usage → 返回三档用量
  • 发送按钮旁(上下文环和发送钮之间)出现圆环,点击弹出三档进度条。

开发 / 修改前端

# 改了 src/client-source.js 后重新生成 client.js
node build.mjs
# Host / 路由改动在 index.js,改后需重启 dsh web

已知限制

  • Client 圆环位置的 reorder CSS 里用到了当前 web bundle 的 hash 类名(.JObwrW_root 上下文环、.uV2eYG_primary 发送钮)。如果 DSH web bundle 升级重建,这两个 hash 会变,圆环会退回最左侧(仍可用),届时把新 hash 更新到 src/client-source.jsREORDER_CSS 即可。
  • 当前按 Windows 实现(读文件用 cmd.exe,curl 达 C:\Windows\System32\curl.exe)。跨平台需改用各平台的读取/请求命令。

License

MIT