OK-wx/dsh-ocgo-lite 预览 preview

OK-wx/dsh-ocgo-lite

OpenCode Go 用量常驻条:套餐余量圆环 + token/花费实时统计(本次会话/全部范围 + 按模型联动,官方实时定价),一键复制 API Key。OpenCode Go 用量条,适用于 DeepSeek Harness。

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH) that adds a persistent status bar under DSH's chat composer dock to show OpenCode Go usage metrics including package quota remaining, token consumption and estimated cost. It requires zero external dependencies to run, and all core functionality is bundled directly into the plugin package. Users can click different sections of the status bar to pop up detailed modal cards that show account login status, one-click API Key copy with toast notification, quota breakdown by cycle, token consumption grouped by model, and cost ranking for different usage scopes.

It is designed for DSH users who use OpenCode Go as their primary LLM provider, and helps them keep track of their usage to avoid unexpected overage charges. The plugin automatically detects the active DSH session and lets users switch between three different usage scopes: total across all sessions, only the current session, or just the most recent conversation. It also lets users filter metrics to only show data for a specific selected model, and remembers each session's scope and model selection independently so settings are restored when you switch back to a previous session.

To install the plugin, you can use the official DSH plugin command to add it directly from the GitHub repository, install it via runtime hot reload without restarting DSH, or install it one-click from a supported DSH plugin marketplace. It requires a DSH web environment, Node.js version 22.5 or newer, and a locally cached OpenCode Go auth file from an existing local login. Pricing data is updated automatically every 24 hours from OpenCode's official documentation, falls back to a built-in table if fetching fails, and the project is released under the open source MIT license.

这是一款原生 DeepSeek Harness 插件,专门用于在 DSH 的聊天输入框下方常驻展示 OpenCode Go 的套餐余量、token 消耗和使用花费,本身零外部依赖。用户点击状态条即可弹出详情卡片,查看账户登录状态、API Key 一键复制、各周期配额百分比、不同统计范围和模型的消耗明细以及花费排行等信息。

适合使用 OpenCode Go 作为 DSH 模型提供商的用户,帮助他们随时掌握套餐使用情况,避免超额扣费。插件会自动识别当前会话,支持切换统计范围(全部会话/本次会话/最近对话)和筛选特定模型,用户的范围和模型选择会按会话独立记忆,切换回原会话时自动恢复原有配置。

插件要求 DSH web 环境、Node.js 版本不低于 22.5,且用户本地已登录 OpenCode Go 并存有授权文件。定价会每 24 小时自动从官方文档抓取更新,抓取失败则回退到内置定价表,无官方定价的模型不会计入统计。项目采用 MIT 许可证开源,可通过 DSH 官方命令、热注入或插件市场一键安装。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 note1 项提示
  • 10 stars - an early-stage project星标 10,属于早期项目
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:OK-wx/dsh-ocgo-lite

把 OK-wx/dsh-ocgo-lite 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-ocgo-lite

OpenCode Go 用量常驻条 — DeepSeek Harness 插件。

聊天输入框下方(composer dock)常驻展开显示 OpenCode Go 套餐余量、token 消耗与花费,零外部依赖。

常驻条总览

✨ 功能

GO:账户卡片

点击弹出账户卡片:登录状态、套餐、配额概览、API Key 掩码 + 一键复制(复制成功有 toast 提示)。

GO 账户卡片

滚动 / 周 / 月:套餐配额

官方配额百分比圆环(健康色:蓝/黄/红),点击弹出三窗口进度条 + 重置倒计时。

配额详情

范围:全部 / 本次会话 / 最近对话

点击切换统计范围——全部(所有 DSH 会话合计)/ 本次会话(仅当前聊天)/ 最近对话(最近活跃会话的最后一次任务执行消耗,按 turn 细分,含子代理/后台任务);切到限定会话时若只有 1 个模型自动选中该模型。每个会话的「范围 + 模型」选择会被记忆,切走再切回原样恢复。

范围选择

模型:按模型联动

点击弹出模型选择器——范围=本次会话时只列出本次会话用过的模型;选中后状态条 token/花费联动显示该模型(范围+模型双层联动)。

模型选择

token:消耗明细

完整数字 + 详情卡片(输入/输出/推理/缓存读/写 + 按模型分组明细,标题随范围显示「总消耗 token / 本次会话总消耗」);选中模型时只显示该模型口径。

token 详情

花费:金额排行

详情卡片:累计金额 + 按模型花费排行(占比条 + 各模型官方定价,随范围/模型联动)。

花费详情

  • 点击页面空白处关闭详情卡片
  • 30 秒自动刷新(无感,不闪 loading)
  • 实时更新:直读会话日志文件(多帧 zstd 解压 + JSONL 行解析,秒级)
  • 会话配置记忆:每个会话独立记住自己的「范围 + 模型」选择——切到其他会话再切回来,配置原样恢复,互不影响
  • 切换会话立即显示(前端共享缓存)
  • 复制成功有 toast 弹窗提示

🗄️ 数据来源与口径

数据 来源 口径
配额余量 官方 https://opencode.ai/zen/go/v1/usage(Bearer auth.json key) 账户级(含其他设备/软件),不受范围切换影响
token / 花费 DSH 会话事件(assistant/message 的 usage,按 provider 分组统计) DSH 会话全部 provider(opencode-go / deepseek-official / 其他套餐,自动识别切换),范围=全部/本次会话/最近对话
金额 按官方定价表估算(per 1M tokens) 输入 $0.44 / 输出 $1.32 / 缓存读 $0.014(deepseek-v4-flash Peak 档);官方表自动跟随(含新增 MiMo/Muse 等模型);无官方定价的模型金额不计入,显示「定价未知」

实时性

  • Client 轮询携带 ?live=<sessionId>,Host 增量直读会话日志文件 (帧级流式解压:逐帧 zstd 解压 + 逐行解析,单帧即弃):只重读 mtime 变化的 会话(活跃会话),未变化的直接用缓存条目 → 常规轮询仅处理 12 个文件 (几十几百毫秒),本次会话与全部范围下的模型明细均实时
  • 全部范围覆盖所有会话(不按数量截断,总量完整);基线为帧级流式全量扫描 (单文件 ≤ 64MB 压缩 / 解压文本 ≤ 128MB / 并发 ≤ 2,逐文件处理即释放, 峰值内存 ≈ 2 个文件)→ 5 分钟缓存 + in-flight 锁(防重复扫描),冷启动一次性 ~5s

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-github-connector 下一个 Next dsh-latex-tools →