DeepSeek Harness plugin

dsh-opencode-go-quota-weijiang

DeepSeek Harness (DSH) plugin bundle showing your OpenCode Go remaining quota (5h / weekly / monthly) as a HUD beside the conversation and in the plugin settings.

Jump to install

Source facts

Repository
weijianguizhou/dsh-opencode-go-quota
Latest update
Aug 19, 2026
Category
Tools & Capabilities
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/weijianguizhou/dsh-opencode-go-quota
Plugin: dsh-opencode-go-quota-weijiang
Author: weijianguizhou

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-quota

> DeepSeek Harness (DSH) 插件:把你的 OpenCode Go 剩余额度(5 小时滚动 / 每周 / 每月)做成类似游戏血条的 HUD,实时显示在对话输入框旁边,同时也在「设置 → 插件配置」里提供完整卡片。

一个开箱即用的 DSH「组合包」(bundle) 插件。安装后,它会定时抓取你的 OpenCode Go 用量看板,解析三档窗口的用量百分比与重置倒计时,并显示在 DSH 界面里。

效果预览

  • 对话区 HUD:输入框下方一排迷你血条(5h / Week / Month),实时显示剩余百分比,悬停可看重置倒计时,右侧是更新时间。
  • 设置卡片:「设置 → 插件配置 → OpenCode Go」,完整进度条 + 手动刷新按钮。
  • 手动刷新:点刷新即让 host 重新抓取,无需重启。

快速开始(30 秒)

# 1. 安装(用你的 profile 名,如 web / desktop / tui)
dsh plugin --profile web add https://github.com/weijianguizhou/dsh-opencode-go-quota

# 2. 在 profile 配置里填上你的凭据(见下方「配置」)
# 3. 重启 DSH,打开对话即可看到 HUD

---

目录

1. [安装](#安装) 2. [配置](#配置) 3. [获取凭据](#获取凭据) 4. [桌面端额外一步(重要)](#桌面端额外一步重要) 5. [验证是否生效](#验证是否生效) 6. [常见问题](#常见问题) 7. [开发者:本地构建与测试](#开发者本地构建与测试) 8. [License](#license)

---

安装

前置条件

  • DSH(DeepSeek Harness)桌面端或 Web 服务已安装并运行。
  • 你有一个已登录的 OpenCode Go 账号(用 opencode CLI 或官网均可)。

方式一:从 Git 安装(推荐)

dsh plugin --profile web add https://github.com/weijianguizhou/dsh-opencode-go-quota

> 把 web 换成你自己的 profile 名(web / desktop / tui 等)。

方式二:从本地目录安装(开发 / 试用)

# 在插件仓库根目录
dsh plugin --profile web add .

安装完成后,dsh 会把本包追加进该 profile 的 dsh.profile.bundles,重启 profile 即加载。

---

配置

凭据只停留在本机,两种来源按优先级(高 → 低):

1. 配置文件(推荐)

在你 profile 的 cordis.patch.yml 里覆盖默认行:

- insert:
    - id: opencode-go-quota
      name: dsh-opencode-go-quota
      config:
        workspaceId: '你的workspaceId'
        authCookie: '你的browser-auth-cookie'   # 不是 sk- API key!
        timeoutMs: 10000        # 可选,抓取超时(毫秒)
        refreshMinutes: 5       # 可选,自动刷新间隔(分钟)

2. 环境变量(配置文件缺省时回退)

export OPENCODE_GO_WORKSPACE_ID=...
export OPENCODE_GO_AUTH_COOKIE=...

authCookie 在 schema 里标记为 role('secret')永不进入任何响应或日志。

---

获取凭据

> ⚠️ auth cookie 是 HttpOnly 且可能被浏览器 App-Bound Encryption 加密存储,无法通过 document.cookie 或读取浏览器文件自动提取。最可靠的手动方法如下:

1. 浏览器登录 opencode.ai,进入 Go 用量页(能看到 Rolling / Weekly / Monthly)。 2. 按 F12 打开开发者工具 → Network(网络) → 按 F5 刷新页面。 3. 点列表里最上面那条 opencode.ai 文档请求(Type 为 document),看右侧 Headers → Request Headers。 4. 找到 Cookie: ... 一行,复制其中 auth= 后面的整段

  • workspaceId:看板 URL 里 https://opencode.ai/workspace/<这一串>/go 的中间段。
  • auth cookie:上一步复制的那串(形如 Fe26.2...),不是** ~/.local/share/opencode/auth.json 里的 sk- key。

> 安全:把它当密码对待,别提交 git。cookie 通常有效期约 90 天,过期后重新获取更新即可。

---

桌面端额外一步(重要)

DSH 桌面端(非 Web 服务)上,设置命名空间需要显式加入 allowlist 才会被前端读取,否则 HUD 和卡片都不会显示。

编辑桌面端安装里的:

<DSH Desktop>/resources/app.asar.unpacked/node_modules/@deepseek-ai/dsh-host-apiproxy/lib/index.js

找到 WEB_SETTINGS_NAMESPACES 数组,加入 "opencode-go-quota"

const WEB_SETTINGS_NAMESPACES = [
  "agent-loop",
  "shell",
  "locale",
  "permission",
  "ui-conversation",
  "ui-theme",
  "web-search-deepseek",
  "opencode-go-quota",   // <-- 加这一行
];

然后重启 DSH Desktop。完整说明见 [docs/desktop-allowlist.md](docs/desktop-allowlist.md)。

> 注意:桌面端更新后会覆盖 app.asar.unpacked,此补丁需在更新后重新应用。Web 服务端一般已放开,无需此步骤。

---

验证是否生效

打开 DSH,进入一个会话(对话框)后:

  • HUD:输入框下方应出现 OpenCode Go 一排血条(5h / Week / Month)。
  • 设置卡片:「设置 → 插件配置」里应有「OpenCode Go 剩余额度」卡片。
  • 若显示「尚未配置」,说明凭据没填对;若显示「加载失败」,多为 cookie 过期或看板改版。

---

常见问题

问题原因 / 解决
HUD / 卡片不显示桌面端未加 WEB_SETTINGS_NAMESPACES allowlist(见上)或凭据未配置
显示「尚未配置 workspaceId / authCookie」cordis.patch.yml 未填或环境变量未设
显示「加载失败」cookie 过期(约 90 天)或看板结构改版,重新获取凭据
刷新后数值不变看板缓存;稍候或检查 refreshMinutes
安装报 pnpm 权限错误dsh plugin 输出提示,按 pnpm 提示放行 git 依赖的 prepare 脚本

---

开发者:本地构建与测试

DSH 要求 ./client 导出的是预构建 bundle(window.__ModuleLoader__.load 形式),不会自动编译源码。lib/client.js 已随仓库提交,改源码后需重新构建:

npm install          # 安装 esbuild 等 devDependencies
npm run build        # 重新生成 lib/client.js(改了 client 源码后必须跑)
npm run check        # 语法检查 + 重建 bundle + 全部验证
npm test             # 只跑 verify.js + verify-host.js
node verify.js          # 解析引擎验证(mock 页面,无需网络)
node verify-host.js     # Host 半侧验证(mock ctx)
node scripts/live-verify.js  # 真实抓取验证(需要先存好凭据)

真实账号验证输出示例:

===== LIVE PARSE RESULT =====
rolling: used=3.00%  remaining=97.00%  reset_in=245min
weekly:  used=1.00%  remaining=99.00%  reset_in=7827min
monthly: used=0.00%  remaining=100.00%  reset_in=44567min
LIVE VERIFY OK ✓

项目结构

dsh-opencode-go-quota/
├── package.json          # dsh.bundle manifest
├── cordis.patch.yml      # 配置层:插入 opencode-go-quota 插件行
├── src/
│   ├── host/             # Host 半侧:抓取 + settings 命名空间 + 服务
│   └── client/           # 浏览器半侧:composer.dock HUD + 设置卡片
├── scripts/
│   ├── build-client.mjs  # 用 esbuild 构建 lib/client.js
│   ├── save-creds.js     # 交互式保存凭据
│   └── live-verify.js    # 真实 dashboard 验证
├── test/                 # scraper 单测
├── verify.js / verify-host.js
└── docs/desktop-allowlist.md

二次开发

  • 标准 DSH 组合包:fork 后改 cordis.patch.ymlpackage.jsondsh.bundle 声明即可让用户在自己的 profile 覆盖默认配置。
  • 看板 HTML 若改版:只需适配 src/host/scraper.js 的正则 / data-slot 分支,单测会立刻暴露问题。
  • HUD 挂在 conversation.composer.dock;想改位置,调整 src/client/index.js 里的 slot 名即可。

---

License

MIT