feat: OpenCode Go 用量插件 v1.0.0

DSH 左侧栏底部常驻卡片,显示 OpenCode Go 套餐的三条配额用量:
- 滚动窗口 / 本周 / 本月 的已用百分比 + 进度条
- 每条配额的重置倒计时(X小时Y分后重置)
- 标题旁显示本月重置日期
- 百分比按档位变色(<70% 绿 / 70-89% 橙 / ≥90% 红)
- SVG 圆形刷新按钮,加载时旋转;60 秒自动刷新

另有 opencode_usage 工具(供 agent 查询)与 GET /plugin/opencode-usage 接口。
服务端直连 opencode.ai/zen/go/v1/usage,API Key 不经过浏览器。
纯 JS 实现,无需构建。
This commit is contained in:
wangjinding committed 2026-11-09 15:04:53 +08:00
commit 2994a20bb0
7 files changed
+767

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
{
"name": "dsh-opencode-usage",
"version": "1.0.0",
"description": "OpenCode Go 套餐用量查看:DSH 左侧栏卡片(滚动/本周/本月三条配额进度条 + 重置倒计时 + 刷新按钮),并提供 opencode_usage 工具与 /plugin/opencode-usage 接口。直连 opencode.ai,API Key 不经过浏览器。",
"type": "module",
"license": "MIT",
"keywords": [
"dsh",
"dsh-plugin",
"opencode",
"usage",
"quota",
"sidebar"
],
"engines": {
"node": "^22.19.0 || >=24.0.0"
},
"main": "./lib/index.js",
"exports": {
".": "./lib/index.js",
"./client": "./lib/client.js",
"./cordis.patch.yml": "./cordis.patch.yml",
"./package.json": "./package.json"
},
"files": [
"lib",
"cordis.patch.yml",
"README.md",
"LICENSE"
],
"dsh": {
"bundle": {
"patch": "./cordis.patch.yml"
},
"client": {
"inject": [
"@deepseek-ai/dsh-client-connection",
"@deepseek-ai/dsh-client-ui-settings"
],
"platform": "web"
}
}
}