dsh-opencode-go-usage

DSH PLUGIN模型与账号接入

仓库 Astervolans/dsh-opencode-go-usage

模型与账号接入 未标注验证等级 安全审查:未标注 可信度:未标注 可安装插件

常驻侧边栏的 OpenCode GO 套餐额度组件:滚动/周/月三条用量条、每条下方一条已流逝与剩余时间条、同源用量代理、/opencode-go 命令,以及针对 GO 网关聊天请求的运行时 x-opencode-session 修复。fork 自 yumusb/dsh-opencode-go-usage。

一句话选型结论

按资料字段整理

dsh-opencode-go-usage 是模型与账号接入类的 DSH 可安装插件,未做沙盒验证,暂无安全审查结论,没有现成安装命令,需要按仓库 README 接入。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类模型与账号接入 收录类型可安装插件 验证等级未标注验证等级 安全审查未标注
验证等级 UNKNOWN 未标注验证等级
GitHub 星标 未标注 复刻 未标注 · 未关闭 issue 未标注
最近更新 未标注 创建于 未标注
README 12.6 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
  1. 1
    确认版本与运行环境

    仓库没有标注兼容版本与 Node.js 要求,先确认你的 DSH 版本能装,再继续。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本未标注版本不匹配时安装会报错
Node.js 要求未标注来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名未发布到 npm可用 npm view 查看包信息

验证等级与安全审查

未标注验证等级
自动化流程结论,不是人工审核
验证等级未标注验证等级上游未给出验证结论,安装前请自行确认
安全审查未标注静态分析结论,未标注不代表已通过审查
仓库健康度未标注按仓库活跃度与最近更新时间给出
可信度未标注综合仓库活跃度与验证结果

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 基础信息齐全,可以先按仓库说明试装。

先想清楚的地方

  • 安全审查还没结论,装之前先看仓库改了什么、要什么权限。
  • 没有现成安装命令,要按仓库 README 手动接入。
  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在模型与账号接入场景里给 DSH 补能力的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
dsh-opencode-go-usage当前 未做沙盒验证 未标注 未标注 未标注 无
archify L4 · 沙盒安装通过 低风险 8.0 万 未标注 有
DeepSeek-Reasonix L4 · 沙盒安装通过 低风险 3.6 万 未标注 有
nocobase L3 · 安装规范通过 低风险 2.5 万 0.1.1-rc.2 无
learn-harness-engineering L4 · 沙盒安装通过 低风险 2.0 万 未标注 有
dsh-our-free-model 未做沙盒验证 未标注 8,064 未标注 无

仓库档案

模型与账号接入
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方Astervolans仓库 dsh-opencode-go-usage · 默认分支 未标注
分类模型与账号接入usage
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言未标注仓库主语言
许可证未标注商用或二次分发前请确认条款原文
星标 / 复刻 / issue未标注 / 未标注 / 未标注收录时的数值,非实时
创建 / 更新未标注 · 未标注最后推送 未标注
本站收录2026-10-14首次进入本站目录的时间

README 全文

12.6 KB
作者原文,中文版优先;只做安全转义,不改内容

@astervolans/dsh-opencode-go-usage

English | 中文

> ⚡ Get an OpenCode GO plan: buycodingplan.com

> This is a fork of yumusb/dsh-opencode-go-usage
> (Astervolans/dsh-opencode-go-usage),
> published as the scoped package @astervolans/dsh-opencode-go-usage. The difference from
> upstream: a time bar under each usage bar (see Features). The settings namespace, HTTP
> routes and command name are still dsh-opencode-go-usage (unchanged), so migrating from
> upstream needs no configuration changes; only the dsh.bundle.patch entry's name must be the
> resolvable scoped package name, or dsh web aborts at startup with Cannot find package.

A DSH (DeepSeek Harness) plugin that watches your OpenCode GO plan quota — the $10/month subscription that gives you usage limits on open-source models (rolling 5-hour, weekly, and monthly windows).

Compatible with DSH 0.1.7 and above, including the 0.2.0 line — declared in
peerDependencies as >=0.1.7-rc.1 <0.3.0, so DSH enforces it. See
Compatibility for the version matrix, what changed in 1.5.0, and what
to do on any other runtime.

Features

  • Sidebar widget — a live widget pinned at the bottom of the DSH web sidebar (sidebar.footer.action slot) showing three usage bars: rolling (5h), weekly, and monthly, each with a relative countdown to its window reset. When the sidebar is collapsed it shrinks to a compact percentage badge.
  • Time bars — under each usage bar sits a time bar splitting the window into two: gray on the left is time already elapsed (growing rightward) and blue on the right is time remaining (shrinking leftward); at reset the gray fills up and starts over. The time bar matches the usage bar exactly in height and radius (5 px / 3 px) and differs only in color and direction; both segments are rounded on all four corners, so the outer ends and the junction where they meet are rounded. The gray reuses the quota bar's track token (--dsw-alias-border-l2), so both stacked grays are the same shade; the blue segment uses --dsw-static-deepseek-450 (#5686fe). Reading quota used against time elapsed shows at a glance whether you are burning quota faster or slower than the clock. Hover for the elapsed/remaining percentages.
  • /opencode-go chat command — prints the same numbers as text inside any conversation.
  • Same-origin proxy — the host registers GET /opencode-go/usage, forwards to the official GO gateway with your API key. The key never reaches the browser and no CORS is involved.
  • x-opencode-session fix — at runtime, injects the real harness session id into OpenCode GO gateway chat requests (the gateway 400s requests without it). No DSH file patching; survives upgrades.

The x-opencode-session fix

The GO gateway rejects chat-completion requests that lack the x-opencode-session header (HTTP 400 MissingSessionID), and DSH's llm-pi-ai adapter never sends it. Instead of patching DSH's installed files (which every DSH upgrade overwrites), this plugin:

  • wraps globalThis.fetch once, and
  • listens to DSH's official llm/stream waterfall event to capture the per-call harness session id (options.sessionId, filled by dsh-agent-loop).

The gateway base is resolved from the called provider's own live config (llm-pi-ai.providers..baseURL, falling back to this plugin's baseUrl) — no host names are hard-coded — so only requests to that call's gateway receive the header, with the real per-conversation session id.

  • Toggle: injectSessionHeader in the plugin config (default true).
  • Observability: GET /opencode-go/usage returns sessionHeader: { active, count, diag }; diag reports what the runtime saw, e.g. streamSeen (handled llm/stream calls), lastStream (provider, session-id presence, base and its source), requests/injected/missed (wire fetches that carried the context, got the header, or fell through on a URL mismatch).

How it works

The plugin is a dual-half DSH package:

half file role
host (Node) lib/index.js registers the /opencode-go/usage web route (ctx.webServer) and the /opencode-go command (ctx.commands); resolves the key through DSH credentials; caches the upstream call (30 s)
browser lib/client.js a hand-authored window.__ModuleLoader__.load({ id, factory }) bundle that waits for and registers into the sidebar.footer.action list slot, then polls the same-origin route every 60 s

How the sidebar widget loads

DSH 0.1.7-rc composes the widget through the official client-modules scan: the
package's dsh.client declaration + exports["./client"] are picked up per
loader entry, the bundle is served from the /plugins/... combo routes, and
its boot-graph row lands in the window.__DSH_BOOT__ manifest by the host
itself — no manual bundling or index injection. (The 0.1.1/0.1.2 line used a
self-hosted /dsh-opencode-go-usage/client.js route + webServer.tapIndex row
injection; that was removed because 0.1.7-rc replaced the array-shaped boot
manifest with a { rev, entries, batches } object that must come from
client-modules only.)

Compatibility

plugin DSH runtime host half browser half
1.5.0 (current) 0.1.7 and above, including the 0.2.0 line Config schema read by the loader; config taken from the plugin entry (no ctx.settings.register/settings.get) composed by client-modules from the package's dsh.client declaration
1.4.0 0.1.7-rc.1, 0.1.7-rc.2 same as 1.5.0 same as 1.5.0
1.3.3 0.1.1-rc.2, 0.1.2-alpha.2 (the pre-0.1.7 line) ctx.settings.register namespace + ctx.settings.get reads self-hosted bundle route + webServer.tapIndex boot-graph row

The supported runtimes are declared in peerDependencies:

"peerDependencies": {
"@deepseek-ai/schemastery": "^3.18.4",
"@deepseek-ai/dsh": ">=0.1.7-rc.1 <0.3.0"
}

DSH validates the @deepseek-ai/dsh range against the running runtime before an entry
activates. From 0.2.0 on that validation is a hard gate: every @deepseek-ai/dsh /
@deepseek-ai/dsh-* peer is tested with includePrerelease, and a mismatch disables the
whole profile row (the host logs disabling profile plugin row …) rather than
half-working. The >=0.1.7-rc.1 <0.3.0 window therefore spans the 0.1.7 line and the
whole 0.2.0 line; the 1.4.0 value 0.1.7-rc.1 || 0.1.7-rc.2 cannot, because any
0.1.x range stops at <0.2.0. On an unlisted runtime, either install the plugin version
that targets it (1.3.3 for the pre-0.1.7 line) or accept the risk explicitly and
restart DSH:

dsh plugin allow-version     # exact-version exemption for name@version on this dsh

Two runtime notes for the supported versions:

  • Settings page / hot-edit / legacy import — the config fields are marked volatile,
    which needs schemastery ≥ 3.18.4. Both official packages are declared as peers rather
    than dependencies, so a fresh install resolves the copy DSH itself ships; a profile that
    still hoists an older 3.18.2 gets no auto-generated settings page, no hot-edit, and no
    migration of a legacy ~/.dsh/settings.yaml section (that section stays behind in
    settings.yaml.imported). Either way the plugin activates and reads its config from the
    profile entry (see Config reference).
  • Widget — no manual bundling or index injection is involved: the host composes it
    from the package's dsh.client declaration and serves it over /plugins/...
    (see How the sidebar widget loads).

Requirements

  • DSH 0.1.7 or newer, including the 0.2.0 line, installed and the web profile booted at least once (~/.dsh/profiles/web exists)
  • Node.js ≥ 18 (for fetch)
  • An OpenCode GO subscription and its API key

Install (official DSH flow)

Requirements: DSH 0.1.7 or newer, including the 0.2.0 line, installed with the web
profile booted once, Node.js ≥ 18, an OpenCode GO subscription.

# 1. install the package into your web profile (pnpm; enable via corepack if needed)
dsh plugin --profile web add @astervolans/dsh-opencode-go-usage

# 2. store your GO API key as a DSH credential
#    (create the key at https://opencode.ai/auth)
#    → add to ~/.dsh/.credentials.yaml:
#      OPENCODE_GO_API_KEY: sk-...

# 3. restart `dsh web` and hard-refresh the browser page

That's it for the quota widget and /opencode-go command. The CLI reconciles
the package's dsh.bundle.patch into the profile's bundle stack automatically
— no manual cordis.patch.yml editing, no symlinks.

From GitHub Packages

Every release also publishes to GitHub Packages
(https://npm.pkg.github.com), automatically, from the release workflow. That
registry requires authentication even for public packages, so add an .npmrc
— project-level, or ~/.npmrc — with a personal access token that has at least
read:packages:

@astervolans:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_PAT
dsh plugin --profile web add @astervolans/dsh-opencode-go-usage

Two things to know before choosing this route:

  • The package is private by default on GitHub, even though the repository is
    public. The first release has to be flipped to public once, at
    package settings
    → Danger Zone → Change visibility.
  • Because installation needs a token, npmjs.org (no token, no scope line) stays
    the friendlier path. GitHub Packages is a mirror, not a replacement.

From a checkout

dsh plugin --profile web add /path/to/dsh-opencode-go-usage

> New to DSH plugins? Follow the user guide (Chinese, step-by-step).

Usage

  • Widget: read it. Collapsed sidebar → percentage badge; expanded → three progress bars with reset countdowns.
  • Command: /opencode-go in any conversation prints the three windows as text.

Config reference

All fields are marked volatile, so they show up in Settings → Plugins → Plugin
configuration and hot-apply without a restart:

key default description
apiKeyEnv OPENCODE_GO_API_KEY credential reference / env var name for the API key
baseUrl https://opencode.ai/zen/go gateway base URL
cacheMs 30000 host-side upstream cache TTL
updateCheck true check npm for newer versions (widget + command show a hint; the plugin never self-upgrades)
injectSessionHeader true inject the runtime x-opencode-session header for GO gateway chat calls

> The volatile marking is guarded: .volatile() exists from schemastery 3.18.4,
> and DSH resolves a plugin's dependencies from the profile first. With an older
> hoisted copy (3.18.2) the plugin still activates and reads its config from the
> profile entry, but the auto-generated settings page and hot-edit stay off —
> reinstall the plugin (or update @deepseek-ai/schemastery in the profile) to
> get them. Either way the config can be set in the profile patch:

- id: dsh-opencode-go-usage
config:
cacheMs: 60000

The usage API

GET https://opencode.ai/zen/go/v1/usage with Authorization: Bearer:

{
"usage": {
"rolling": { "status": "ok", "percent": 0,  "resetsAt": "2026-08-14T07:51:13Z" },
"weekly":  { "status": "ok", "percent": 1,  "resetsAt": "2026-08-17T00:00:00Z" },
"monthly": { "status": "ok", "percent": 22, "resetsAt": "2026-08-21T13:05:13Z" }
}
}

Developing / modifying the widget

The browser half is a hand-authored factory bundle (window.__ModuleLoader__.load), because out-of-tree client plugins have no public build pipeline yet. It may only require() modules from the shell module table (react, react/jsx-runtime, and the registered client packages). Edit lib/client.js directly, then restart dsh web and refresh the page — the bundle revision hash changes and the shell loads the new file.

Host changes (lib/index.js) need only a dsh web restart.

Troubleshooting

  • Widget missing after restart → hard-refresh the page (Cmd/Ctrl+Shift+R); the boot graph is injected per page load.
  • /opencode-go/usage returns 502 with "no API key" → configure the key in ~/.dsh/.credentials.yaml.
  • Gateway 401/403 → the key is invalid or the subscription lapsed; check the credential.
  • Widget shows an error string → hover the collapsed badge or read the error line in the expanded widget.

License

MIT

常见问题

4 问
答案由本站依据条目字段整理,不引用上游原文
dsh-opencode-go-usage 怎么安装?

本站没有抓到该条目的安装命令,请到仓库主页确认安装方式;这类条目多数是生态应用或尚未发布安装包的项目。

dsh-opencode-go-usage 的验证等级是什么意思?

未标注验证等级。上游未给出验证结论,安装前请自行确认

dsh-opencode-go-usage 安全吗?

未标注。

dsh-opencode-go-usage 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

同名或近似条目

8 条
不同作者的仓库分开列,请确认你要装的是哪一个
模型与账号接入
按星标排序,可作替代方案

archify

archify

从仓库或系统描述生成经过校验的自包含交互式架构图、流程图、时序图、数据流图和生命周期图。

L4 · 沙盒安装通过 8.0 万 星

nocobase

nocobase

L3 · 安装规范通过 2.5 万 星

dsh-our-free-model

dsh-our-free-model

为 DeepSeek Harness 挂载免登录、免 API Key 的免费前沿模型通道,装完即用,并附用量看板与 OpenAI 兼容本地转

未标注验证等级 8,064 星

dsh-purge

dsh-purge

dsh-purge 是一款 DeepSeek Harness 设置插件,可修改默认副本、权限策略和工具限制,并添加规则卡片以分组应用补丁,支

L5 · 运行验证通过 4,573 星

Astervolans 的其它插件

1 个

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 —。