dsh-opencode-go
Manifest validWeb Plugin: Permanently display OpenCode GO dual-account and CommandCode package usage in the session header (scroll through 5h/weekly/monthly views), auto-refreshes every 3 minutes
dsh-opencode-go
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.
功能 / Features
- 会话头部芯片,显示各账号的周用量百分比(≥90% 或受限=红、≥70%=橙、否则绿)
- 悬停气泡分账号展示:滚动(5h) / 周 / 月 用量 + 滚动窗口剩余时间
- 3 分钟自动刷新 + 手动刷新按钮
- 切换会话不重复拉取:用量数据与定时器为模块级共享缓存,组件重挂载直接读缓存
- 单个账号失败不影响其他账号(对应行显示「获取失败」)
- 密钥只存在于宿主侧,浏览器永不接触
安装 / Install
dsh plugin --profile web add github:305037991x-pixel/dsh-opencode-go
重启 dsh web 并硬刷新页面(Ctrl+Shift+R)。
兼容性 / Compatibility
与核版本解耦:所有 @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并钉死具体版本会让插件在核升级后 解析到旧副本,从而加载失败。
配置 / Configuration
在 $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)。
工作原理 / How it works
| 端 | 文件 | 职责 |
|---|---|---|
| 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,建议迁移。
License
MIT
Comments
Loading…
From the same category
by anywhere-labs
为 DeepSeek Harness (DSH) 插件生态打造的现代化桌面端解决方案。万物皆「插件」,桌面本身也是「插件」。
★ 30.4k
↓ 108/wk
MIT
TypeScript
Oct 10, 2026
dsh plugin --profile web add dsh-plugin-desktopby zhu1090093659
DeepSeek Harness (DSH) Web Plugin Aggregation Ecosystem · Everything is a plugin, distributed via the Creative Workshop
★ 8.6k
↓ 125/wk
Apache-2.0
TypeScript
Oct 10, 2026
dsh plugin --profile web add dsh-webA collection of independent Web UI plugins and skins, including task boards, Git graphs, mobile access, and live token stats.
★ 7.6k
↓ 119/wk
Apache-2.0
TypeScript
dsh plugin --profile web add dsh-webby omdsh-dev
开放的侧边栏底座,支持三方拓展注册新侧边栏页面。内置文件渲染编辑/终端/侧边对话/Git/子代理页面 | Open sidebar foundation, supports third-party extensions to register new sidebar pages. Built-in file rendering/editing, terminal, side chat, Git,
★ 4.1k
↓ 38.1k/wk
MIT
TypeScript
Oct 9, 2026
dsh plugin --profile web add dsh-better-sidebarby bowenliang123
The best DeepSeek Harness plugin for context insight and management, with context dashboard / browser / sidebar and context command, for context statistics, composition, breakdown, evolution details,
★ 2k
↓ 34.4k/wk
Apache-2.0
TypeScript
Oct 11, 2026
dsh plugin --profile web add dsh-contextby shaobeichen
把 DeepSeek Harness 装进你的口袋:电脑上跑 dsh web,手机扫码即同步访问(局域网 + 公网,实时同屏)Put DeepSeek Harness in your pocket: run dsh web on your computer and access it synchronously by scanning a QR code on your phone (LAN +
★ 1.6k
↓ 3.2k/wk
GPL-2.0
JavaScript
Sep 16, 2026
dsh plugin --profile web add dsh-pocket