bowenliang123/dsh-context
bowenliang123/dsh-contextDSH 上下文洞察面板:Context 仪表盘 + /context命令 + Context 浏览器,查看 Context的分类组成、内容详情、演进趋势、压缩/注入事件、统计等一站式 Context 全生命周期管理。
在 Web 侧边栏左下角显示 OpenCode Go 用量——滚动/本周/本月配额进度与悬停明细卡片,并附按北京时间标记的 DeepSeek 高峰时段进度条。
本仓库已归档,不再维护。 代码保持原样,现有版本仍可正常安装使用,但不会再有新功能或修复,也不再处理 issue 与 PR。
Archived / unmaintained. The plugin still installs and works as-is, but receives no further updates, fixes, or issue responses.
在 DeepSeek Harness Web 侧边栏左下角显示 OpenCode Go 用量的插件。
Show your OpenCode Go usage in the DeepSeek Harness web sidebar's bottom-left corner.
~/.dsh/.credentials.yaml → 环境变量)__ModuleLoader__ bundle,Host 端为纯 Node ESMdsh plugin --profile web add @badai147/dsh-ocgo-usage
从 GitHub 源安装(备选):
dsh plugin --profile web add github:badai147/dsh-ocgo-usage
重启 dsh web,左下角(设置按钮旁)即可看到「Go 用量」按钮。
💡 安装后重启
dsh web生效;自 0.1.1 起为纯 Node 实现,无需系统安装 python3。
95% (本月))lib/index.js):注册 DSH web server 路由 GET /api/ocgo-usage,按序读取 DSH 供应商配置中的 opencode-go API key(~/.dsh/.credentials.yaml → 环境变量),代理请求 https://opencode.ai/zen/go/v1/usage;key 只在本机处理,不下发浏览器lib/client.js):手写 window.__ModuleLoader__.load bundle,注册 sidebar.footer.action 按钮 + shell.overlay 悬浮卡片,通过本地路由取数https 直接发请求,不依赖 shell 与 python,Windows / macOS / Linux 均可用dsh-ocgo-usage/
├── cordis.patch.yml # bundle patch:插入 ocgo-usage 插件行
├── lib/
│ ├── index.js # Host:/api/ocgo-usage 代理路由(Node ESM)
│ └── client.js # Client:按钮 + 悬浮卡片 UI(__ModuleLoader__ bundle)
└── package.json
~/.dsh/.ocg-state.json 的读取(该文件已非当前 DSH 的供应商状态文件),仅保留 ~/.dsh/.credentials.yaml 与环境变量两个取值来源(本月) 后缀)为什么 Windows 上会报 sandbox 错误? 0.1.0 用 ctx.shell 跑 python 脚本取数,会触发 shell 沙箱检查;Windows 上可用的后端要求 ACL 临时目录位于 workspace 之外,不满足即拒绝执行。0.1.1 改用 Node 内置 https 直接请求,不再依赖 shell 与 python,Windows / macOS / Linux 均正常。
升级后仍是旧版? pnpm 可能命中旧的 lockfile。显式指定版本重装即可:dsh plugin --profile web add @badai147/dsh-ocgo-usage@0.1.1,重启 dsh web 生效。