dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
OpenCode GO plan usage chip for DeepSeek Harness Web: dual-account rolling/weekly/monthly quota, 3-min auto refresh, per-account hover breakdown
OpenCode GO / CommandCode 套餐用量芯片 · Plan usage chip for DeepSeek Harness Web
会话头部常驻的套餐用量芯片:同时监控两个 OpenCode GO 账号与一个 CommandCode 账号的滚动(5h)/每周/每月三个额度窗口,3 分钟自动刷新,悬停分账号查看明细与滚动窗口剩余时间。
A persistent usage chip in the conversation header: watches two OpenCode GO accounts plus one CommandCode account across rolling(5h) / weekly / monthly quota windows, auto-refreshes every 3 minutes, and shows per-account breakdown with rolling-window countdown on hover.
dsh plugin --profile web add github:305037991x-pixel/dsh-opencode-go
重启 dsh web 并硬刷新页面(Ctrl+Shift+R)。
与核版本解耦:所有 @deepseek-ai/dsh-* 核心包都声明为可选 peerDependencies
(范围 >=0.1.0-rc.6 <0.2.0),插件自身不安装、不携带任何核心包副本,
运行时一律使用宿主正在运行的那份核。因此升级 DSH 核不需要重装本插件。
The plugin never bundles or pins core packages. All @deepseek-ai/dsh-* imports resolve to
whatever core the host is currently running, so it survives core upgrades without reinstalling.
lib/index.js)只依赖两个稳定接口:dsh-credentials 的 credentialRef
与 dsh-launch-environment 的 launchEnvironmentOf。lib/client.js)通过 dsh.client.inject 由宿主的客户端模块表提供依赖,
同样与核版本无关。dsh.compatibility.dshReleases 记录已验证可用的核版本。dependencies 并钉死具体版本会让插件在核升级后
解析到旧副本,从而加载失败。在 $DSH_HOME/.credentials.yaml 中配置(或环境变量同名):
# OpenCode GO 账号 A(必填)
OPENCODE_GO_API_KEY: sk-xxx
# OpenCode GO 账号 B(可选,不配则只显示一个账号)
OPENCODE_GO_API_KEY_B: sk-yyy
# CommandCode(可选,不配则不显示该行)
COMMANDCODE_API_KEY: cmd-zzz
OpenCode GO 的 Key 在 opencode.ai/auth 创建;CommandCode 的 Key 在其 Studio 创建(即 Provider API 使用的 CMD_API_KEY)。
| 端 | 文件 | 职责 |
|---|---|---|
| Host | lib/index.js | 注册 GET /dsh-opencode-go/usage:并行解析各账号的 key(凭证服务:环境变量 → $DSH_HOME/.credentials.yaml → .env),按账号类型调用对应官方接口,返回 { ok, accounts: [...] } |
| Client | lib/client.js | 在 conversation.session.header.utilities 槽位注册芯片;模块级共享数据 + 3 分钟定时器;悬停气泡分账号渲染 |
上游接口:
| 账号类型 | 接口 | 窗口来源 |
|---|---|---|
| OpenCode GO(A/B) | https://opencode.ai/zen/go/v1/usage | 官方直接返回 rolling(5h)/weekly/monthly 三窗口(percent/status/resetsAt) |
| CommandCode | https://api.commandcode.ai/alpha/billing/credits + /alpha/usage/summary(可选 /alpha/whoami?limits=1 取 orgId) | 与 command-code CLI /usage 命令同源的 /alpha 系列端点;5h/周窗口由 windowLimits.fiveHour/weekly 的 used/cap 换算百分比,月窗口 = totalMonthlyCredits /(已用 + 剩余 monthlyCredits) |
注:CommandCode 的
/alpha端点未在官方文档登记(文档只列/provider/v1/*),但为官方 CLI 自身使用的接口;若官方日后提供正式用量 API,建议迁移。
MIT