
Security News
PHP Patches Critical RCE Vulnerabilities, Organizations Urged to Take Unpatched Sites Offline
PHP releases emergency patches for two critical RCE vulnerabilities as agencies urge organizations to take unpatched sites offline.
dsh-plugin-opencode-usage
Advanced tools
OpenCode Go 用量百分比悬浮面板:在 DeepSeek Harness Web 会话窗口左下角显示滚动/每周/每月用量百分比与重置时间。
OpenCode Go 订阅用量悬浮面板:在 DeepSeek Harness Web GUI 会话窗口左下角显示订阅额度使用情况。
Esc 与点击面板外部关闭
DSH Web 浏览器
│ 1. 点击会话窗口左下角按钮
▼
GET /plugins/opencode-usage/stats
│
▼
DSH Host 插件
│ 2. ctx.credentials.resolve("OPENCODE_GO_API_KEY")
│ 3. GET https://opencode.ai/zen/go/v1/usage
│ Authorization: Bearer <api-key>
│ 4. 透出 percent / remainingPercent / resetsAt
▼
返回 JSON,由 React 面板渲染
官方接口只返回 percent 与 resetsAt:
{
"usage": {
"rolling": { "status": "ok", "percent": 30, "resetsAt": "..." },
"weekly": { "status": "ok", "percent": 19, "resetsAt": "..." },
"monthly": { "status": "ok", "percent": 9, "resetsAt": "..." }
}
}
插件直接展示官方 API 返回的百分比,不做金额换算。
dsh-plugin-opencode-usage/
├── cordis.patch.yml # bundle patch: 把插件插入 profile host 组合
├── lib/
│ ├── index.js # Host 半: 订阅额度 API 查询 + HTTP 路由
│ └── client.js # Client 半: 会话窗口左下角悬浮按钮 + 面板
├── LICENSE
├── package.json # dsh.bundle / dsh.client 元数据
└── README.md
不同模型的额度金额不同(例如 V4 Pro 月度 $15、V4 Flash 月度 $30, 整体月上限 $60),因此插件只展示官方 API 返回的百分比,不做金额换算。
| 窗口 | 官方接口字段 | 说明 |
|---|---|---|
| 滚动用量 | usage.rolling | 5 小时滚动窗口百分比 |
| 每周用量 | usage.weekly | 每周窗口百分比 |
| 每月用量 | usage.monthly | 月度窗口百分比 |
官方 API 只返回 percent 与 resetsAt;插件同时给出 remainingPercent = 100 - percent。
从 npm 安装(推荐):
dsh plugin --profile web add dsh-plugin-opencode-usage
也可以从 GitHub 仓库安装(无构建步骤,lib/ 即源码,可直接引用):
dsh plugin --profile web add github:jiekesu967/dsh-plugin-opencode-usage
或者从本地目录安装:
dsh plugin --profile web add ./dsh-plugin-opencode-usage
安装后 dsh plugin 会自动写入 web profile 的 dependencies,并把
dsh-plugin-opencode-usage 追加到 dsh.profile.bundles。重启 dsh web
并刷新页面后,会话窗口左下角会出现独立的 “OpenCode Go 用量” 悬浮入口。
在 profile 的 cordis.patch.yml 覆盖 opencode-usage 条目:
- id: opencode-usage
config:
# Harness credentials 文件中保存 API key 的变量名
credentialRef: OPENCODE_GO_API_KEY
# OpenCode Go 订阅接口
apiBaseUrl: https://opencode.ai/zen/go/v1
# host 成功结果缓存时间
cacheMs: 30000
在 ~/.dsh/.credentials.yaml 中确认存在:
OPENCODE_GO_API_KEY: sk-...
也可以通过 DSH Web 的 Models / Credentials 设置页写入。
入口注册在 shell.overlay,绝对定位于 AppFrame 的会话中心列左下角:
12px、底部 16px12px392px,右侧/顶部超出视口时自动回退ResizeObserver 监听会话中心列,侧边栏展开/收起、详情面板开关、窗口缩放时实时跟随插件声明了它需要哪一版 Harness,市场与 dsh-market 据此判断能否安装:
"engines": {
"node": "^22.19.0 || >=24.0.0",
"dsh": ">=0.1.5-rc.1 <0.2.0-0" // 支持 DSH 0.1.5 这一条发布线
},
"peerDependencies": {
"@deepseek-ai/cordis": "^4.0.2",
"@deepseek-ai/dsh-client-locale": ">=0.1.5-rc.1 <0.2.0-0",
"@deepseek-ai/dsh-client-ui-renderer": ">=0.1.5-rc.1 <0.2.0-0",
"@deepseek-ai/dsh-credentials": ">=0.1.5-rc.1 <0.2.0-0",
"@deepseek-ai/dsh-host-webserver": ">=0.1.5-rc.1 <0.2.0-0"
}
已验证覆盖 0.1.5-rc.2(当前最新)与 0.1.5-rc.1。
关于范围写法:
>=0.0.1-rc <2这类「看起来很宽」的范围会静默排除所有预发布构建。 node-semver 只有当范围内某个比较符与该版本的major.minor.patch元组完全一致、 且自身带预发布标签时才放行预发布版本,而>=0.0.1-rc <2在0.1.5这个元组上没有 这样的比较符。上界写成<0.2.0-0而不是<0.2.0,同样是为了让0.2.0-rc.1这类版本被正确拒绝而不是意外放行。
未声明任何 Harness 依赖时,市场会显示 unknown(未声明) 而不是「兼容」—— 这也是本插件 0.1.0 的状态,0.1.1 起已显式声明。
web profile;headless 下不注册路由GET /plugins/opencode-usage/stats 不做鉴权,它继承 webserver 的绑定地址。
默认 profile 绑定 127.0.0.1,只有本机可访问;若你把 profile 的
webServer.config.host 改成 0.0.0.0,同一局域网内的任何人都能读到用量百分比。
API key 本身不会离开 host 进程(只作为请求头上游使用),所以泄露的是用量信息而非凭据。
介意的话请保持回环绑定,或在反向代理层限制该路径。MIT
FAQs
OpenCode Go 用量百分比悬浮面板:在 DeepSeek Harness Web 会话窗口左下角显示滚动/每周/每月用量百分比与重置时间。
The npm package dsh-plugin-opencode-usage receives a total of 140 weekly downloads. As such, dsh-plugin-opencode-usage popularity was classified as not popular.
We found that dsh-plugin-opencode-usage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
PHP releases emergency patches for two critical RCE vulnerabilities as agencies urge organizations to take unpatched sites offline.

Threat Research
/Security News
A supply chain attack compromised LiteLLM 1.107.0 on PyPI and Docker, spreading malware that steals cloud credentials, developer secrets, and AI provider keys.

Security News
vlt 1.5.0 links skills from JavaScript dependencies to coding agents, with lockfile versioning and Socket data to filter out known malicious packages.