yascitom/dsh-opencode-go-box 预览 preview

yascitom/dsh-opencode-go-box

Plugin插件 Native原生 ⭐ 6 MIT Migration & Compatibility迁移与兼容

Project Overview项目介绍

This is a purpose-built Web-GUI plugin created exclusively for DeepSeek Harness (DSH), designed for users who access the OpenCode Go large language model via DSH. It delivers comprehensive usage observation tools, including tracking used quota across three time windows (5-hour rolling, weekly, monthly), token consumption per DSH session and per individual model call, cache hit rate calculation at multiple levels, and model-based session filtering. It also supports bilingual UI switching, can be installed with a single DSH CLI command, and automatically integrates into your existing DSH profile without manual edits.

After installation, the plugin adds a new "OpenCode Go" section to DSH's settings sidebar, with two separate tabs for quota overview and DSH session usage details. All usage data is pulled directly from DSH's own session logs, so the plugin works on any DSH deployment regardless of whether you have the OpenCode client installed locally. It also adds a persistent real-time quota widget to the bottom of the conversation composer, which polls for updated usage every 30 seconds and changes color automatically when usage crosses predefined warning or danger thresholds.

The plugin relies on standard web bundle components that are included by default in DSH's default web profile, so no extra dependencies are required after installation. Users can customize multiple configuration options, including the usage API base URL, request timeout, warning and danger percentage thresholds, and the maximum number of recent sessions to scan for usage details. The project is released under the permissive MIT open source license, and the plugin includes built-in notices for its known limitations, such as potential undocumented API changes and minor discrepancies between local token stats and official billing.

这是专为 DeepSeek Harness (DSH) 打造的 Web-GUI 原生插件,面向接入 OpenCode Go 模型的用户提供完整的用量观测能力。核心功能包括展示5小时滚动、每周、每月三个额度窗口的已用百分比、套餐限额与重置时间,统计DSH内每个会话及每次模型调用的token用量,计算多级缓存命中率,支持按模型分组筛选会话,提供双语切换界面。可通过DSH官方插件命令一键安装,会自动整合进当前DSH配置文件,无需手动修改。

安装后会在DSH设置侧边栏新增「OpenCode Go」栏目,包含「额度」和「DSH会话明细」两个标签页。用量数据完全基于DSH自身的会话日志,无论你是否在本地安装OpenCode客户端,任何DSH部署都可以正常使用该插件。底栏会常驻一个实时刷新的额度挂件,每30秒轮询一次最新用量,达到阈值会自动变色提醒,方便用户随时掌握剩余额度。

插件依赖DSH默认web配置已包含的标准web bundle组合,无需额外安装依赖。用户可在配置文件中自定义接口地址、请求超时、提醒阈值和最大扫描会话数等参数。已知限制包括用量接口未公开文档可能变更,本地统计token数据和官方账单可能存在差异,插件已在界面标注提示。项目采用MIT许可证开源,无使用成本。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 6 stars - very few users, little community feedback星标只有 6,几乎没人在用,遇到问题缺少社区反馈
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:yascitom/dsh-opencode-go-box

把 yascitom/dsh-opencode-go-box 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-opencode-go-usage

中文 | English

一个 DeepSeek Harness Web-GUI 插件,为接入 OpenCode Go 模型的用户提供完整用量观测:

  • 额度窗口:5 小时滚动 / 每周 / 每月 三个窗口的已用百分比、套餐参考限额和重置时间;
  • DSH 会话明细:DeepSeek Harness 中每个使用 opencode-go 模型的会话的 token 用量,并可下钻到每一次模型调用(turn/step 级);
  • 缓存统计:会话累计、单会话、单次调用三个层级都展示缓存读取(命中)/ 缓存写入,并计算缓存命中率(缓存读取占全部输入的比例);
  • 模型筛选:按模型分组筛选会话(chips),查看每个模型的用量与缓存情况,并附按模型汇总对比表;
  • 双语界面:内置中文 / English 两套文案,面板右上角可一键切换语言(与「设置 → 通用 → 语言」联动并持久化);
  • 底栏常驻挂件:输入框下方一行实时额度(30s 轮询),按阈值自动变色;
  • 数据新鲜度:额度页与底栏挂件均标注「最近成功更新」时间;轮询失败时保留最后一次成功数据并标注「未更新」(stale),不会误清空为失败状态;
  • 诊断区块:额度页可展开「诊断」——HTTP 状态码、解析版本、凭证来源与掩码 key、最近 3 次请求快照(含原始响应体),便于与官方页面核对;
  • 计费口径提示:DSH 明细标注「本地统计仅供参考」,提醒日志 token 与官方账单可能存在的差异。

功能特性

  • 设置侧边栏新增 "OpenCode Go" 栏目(settings.section 贡献),内含「额度」「DSH 会话明细」两个标签页
  • Host 端 Typert Remote opencodeUsage:usage / dshUsage / dshSessionMessages 三个方法
  • DSH 会话明细完全基于 DeepSeek Harness 自身的会话日志(每条 assistant/message 事件自带 token 记账),不依赖本机是否安装 OpenCode 客户端,任何 DSH 部署都能用
  • 缓存统计:cacheReadTokens(命中)/ cacheWriteTokens(写入)按会话、按调用展示;命中率 = 缓存读取 ÷(非缓存输入 + 缓存读取)
  • 模型筛选:会话按 source.model 分组,chips 一键筛选,筛选后累计卡片与列表同步收窄;全部模型时展示「按模型汇总」表(会话数 / 输入 / 缓存读取 / 缓存写入 / 输出 / 推理 / 命中率)
  • 推理 token 说明:opencode-go 由 DSH 的 pi-ai 适配器接入,该适配器把推理消耗并入输出 token,不单独记录 reasoningTokens,因此推理列显示为 —(未上报),而非误导性的 0;单独上报推理的适配器(如 dsh-llm-deepseek)会正常显示数值
  • 调用明细:单会话下钻展示每次模型调用的时间、模型与五项 token 计数;长会话保留最近 400 次调用(累计统计始终覆盖全部调用)
  • 底栏挂件(conversation.composer.dock 贡献):🟢 5h 22% · W 13% · M 13% · ↻ 2h13m(W=每周、M=每月、↻=重置倒计时,悬停显示完整文字),按 5 小时滚动窗口阈值变色(默认 <60% 绿 / 60–85% 橙 / ≥85% 红)
  • 数据新鲜度:额度页每 30s 自动刷新(与底栏挂件同频),显示「最近成功更新」时间;任何一次拉取失败都保留上一次成功数据并标注「未更新」,手动点「刷新」才显示加载态
  • 诊断:额度页可展开「诊断」区块——最近成功拉取时间 / HTTP 状态码 / 解析版本 / 凭证来源与掩码 key / 最近 3 次请求快照(每次含时间、状态、错误与原始响应体,超长响应自动截断为预览)
  • 前置校验:若 设置 → 模型 中未添加 opencode-go,或未找到 API key,会显示引导说明而非报错
  • API key 解析链:opencode-go provider 配置所声明的凭证引用(apiKeyEnv,通过 llm provider 目录动态发现)→ DSH 凭证层的常规引用 OPENCODE_GO_API_KEY → OpenCode 的 auth.json

安装

dsh plugin --profile web add github:yascitom/dsh-opencode-go-box

或从本地源码目录安装:

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

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-annotate 下一个 Next dsh-perlica-ding →