DeepSeek Harness 插件

Assidefok/dsh-opencodego-status

Star 数 ★ 0 分类 用量与计费 收录于 2026-10-20

在 Harness Web UI 上悬浮显示 OpenCode Go 用量:5 小时滚动、每周与每月百分比、重置倒计时与续订日期,支持设备码登录与静默刷新。

安装

# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)

dsh plugin --profile web add github:Assidefok/dsh-opencodego-status

装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。

README

该插件的 README 只有英文版本。

A floating overlay for the DeepSeek Harness Web UI that shows your OpenCode Go usage — the 5-hour rolling limit, the weekly limit and the monthly limit — at a glance.

OpenCode Go usage overlay, collapsed pill

The collapsed pill lives in the corner of the window and shows the three percentages with a colour dot per limit. Click it for progress bars, reset countdowns, the renewal date, and the sign-in controls.

OpenCode Go usage overlay, expanded card

What you get

  • Collapsed pill — 5h · 7d · 30d percentages, coloured by how close you are to the limit (brand → warning from 60% → error from 80%), plus the weekly reset countdown.
  • Expanded card — one progress bar per limit, resets in and renews in countdowns, Refresh, Sign out, and a link to the OpenCode console.
  • Device-code sign-in — connect from the overlay; the code is shown in the card and approved in the browser. No password is ever typed into the overlay.
  • Silent token refresh — the stored session is refreshed before it expires.
  • English and Chinese UI, following the Harness locale service.
  • Theme-aware — every colour and border comes from the Harness theme tokens, so light and dark themes both look native.

The numbers come from the OpenCode Console Go subscription meters, the same source the console page itself renders.

Requirements

  • DeepSeek Harness Web UI (0.2.x).
  • An OpenCode Go subscription. The overlay reads the Go plan meters; it shows Not connected when no OpenCode session is stored, and an error state when the subscription is missing or the API changes.

Install

dsh plugin --profile web add github:Assidefok/dsh-opencodego-status

Then refresh the Harness Web UI. A small pill appears in the top-right corner.

Connect

  1. Click the pill, then Connect.
  2. The card shows a short code (for example GNNM-XQHS) and an Open approval page button. Approve the device in the browser.
  3. The overlay switches to your live usage as soon as the console confirms.

The session is stored locally at $DSH_HOME/opencodego-status/state.json with 0600 permissions ($DSH_HOME defaults to ~/.dsh). Sign out in the card deletes it. Tokens are sent only to opencode.ai; the browser half never receives them.

Configuration

The bundle row in the Harness profile's cordis.patch.yml accepts:

- id: opencodego-status
  name: dsh-opencodego-status
  config:
    enabled: true        # hide the overlay without uninstalling the bundle
    position: top-right  # top-right | top-left | bottom-right | bottom-left
    refreshSeconds: 60   # 15 – 3600
    showResets: true     # show reset countdowns

How it works

  • The host half (index.js) registers a prefix route at /api/opencodego-status and talks to the OpenCode Console: <origin>/console/auth/device/code, <origin>/console/auth/device/token (device grant and refresh grant) and <origin>/console/api/go/status.
  • The client half (client.js) registers one entry in the shell.overlay slot and polls /api/opencodego-status/status. It never sees an access token.
  • No dependencies, no build step: the client module is plain JavaScript and React comes from the Harness browser module table.

The console endpoint is not a documented public API. If OpenCode changes it, the overlay degrades to an error state with a Retry button instead of breaking the UI.

License

MIT — see LICENSE.

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

社区评论

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。