opencode-usage-limits 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +145 -85
- package/CHANGELOG.zh-CN.md +139 -0
- package/README.md +100 -93
- package/README.zh-CN.md +173 -0
- package/dist/tui.js +5 -164
- package/package.json +3 -3
- package/CHANGELOG.en.md +0 -167
- package/README.en.md +0 -184
package/CHANGELOG.md
CHANGED
|
@@ -1,124 +1,184 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All notable changes to `usage-limits` are documented here. The format is based on
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
4
6
|
|
|
5
|
-
[
|
|
7
|
+
[English](./CHANGELOG.md) · [简体中文](./CHANGELOG.zh-CN.md)
|
|
6
8
|
|
|
7
|
-
## 0.3.
|
|
9
|
+
## 0.3.4 - 2026-12-01
|
|
10
|
+
|
|
11
|
+
### Removed
|
|
12
|
+
|
|
13
|
+
- **Removed the OpenCode Go per-model allowance line.** The official monthly allowances per model change
|
|
14
|
+
too often — several rows moved within November 2026 alone — so a hard-coded table is always one release
|
|
15
|
+
behind and a stale dollar figure is worse than none. OpenCode Go now shows **percentages, progress bars
|
|
16
|
+
and reset countdowns only**. ClinePass keeps `used / limit`, because those caps are read live from
|
|
17
|
+
`/users/me/plan` and never hard-coded.
|
|
18
|
+
- Dropped the supporting code: `GO_MODEL_ALLOWANCE`, `PlanTier`, `modelAllowance()` and their rendering in
|
|
19
|
+
both the TUI and the offline preview. The `model` CLI argument of `preview.mjs` is gone with it.
|
|
8
20
|
|
|
9
|
-
###
|
|
21
|
+
### Docs
|
|
10
22
|
|
|
11
|
-
- **
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
- Repository docs now default to **English**: `README.md` and `CHANGELOG.md` are English, with
|
|
24
|
+
`README.zh-CN.md` and `CHANGELOG.zh-CN.md` as the Simplified Chinese translations.
|
|
25
|
+
|
|
26
|
+
## 0.3.3 - 2026-11-05
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- **Go allowance table synced with the official 2026-11 table**
|
|
31
|
+
([docs](https://opencode.ai/v2/docs/console/go/)): **DeepSeek V4.1 Flash is now $100/month**
|
|
32
|
+
(Go Plus $200, up from $80/$160) — the only price change in this release.
|
|
33
|
+
- **Six models added**: `gemini-4-argon` ($30/$120), `kimi-k3.1-pro` ($15/$60),
|
|
34
|
+
`minimax-m3.1-flash` ($20/$80), `hy4` ($60/$240), plus `beam-free` and `iceman-contributor-free` (free).
|
|
35
|
+
- **`step-5-preview-free` corrected to `step-5-preview`**: the model is paid now ($15/$60), so showing `∞`
|
|
36
|
+
was wrong.
|
|
37
|
+
- **Six delisted models removed**: `grok-4.6`, `space-bunny`, `minimax-m2.7`, `deepseek-v4-flash`,
|
|
38
|
+
`deepseek-v4-flash-vision-exp`, `longcat-2.5-preview-free`. Unknown models keep rendering `—`.
|
|
39
|
+
- The table is now **sorted by model ID** so it can be diffed against the docs page; the source link in
|
|
40
|
+
the comment points at `https://opencode.ai/v2/docs/console/go/`.
|
|
41
|
+
- Go Teams (Go + $5 per model) is not part of the reference line, which keeps showing `$Go/$Go Plus`.
|
|
21
42
|
|
|
22
43
|
## 0.3.2 - 2026-11-05
|
|
23
44
|
|
|
24
|
-
###
|
|
45
|
+
### Fixed
|
|
25
46
|
|
|
26
|
-
- **npm
|
|
27
|
-
0.3.1
|
|
28
|
-
Babel
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
47
|
+
- **The plugin failed to load entirely when installed from npm**
|
|
48
|
+
([#2](https://github.com/GamingNowEdward/opencode-usage-limits/issues/2)): 0.3.1 shipped raw `.tsx`
|
|
49
|
+
source, but OpenCode only runs its own Solid Babel transform on plugin files that live **outside**
|
|
50
|
+
`node_modules`. In an npm-installed plugin directory the source is transpiled by Bun alone, which
|
|
51
|
+
injects an `@opentui/solid/jsx-dev-runtime` import from the `@jsxImportSource` pragma. That injection
|
|
52
|
+
happens *after* the host rewrote the source imports, so it falls back to Bun's native resolution —
|
|
53
|
+
and `@opentui/solid` is an optional peer that npm never installs. The result was a `stage=load`
|
|
54
|
+
failure: no sidebar block and no entry in the plugin list. The package now ships **compiled output**:
|
|
55
|
+
`tui.tsx` is compiled with `babel-preset-solid { generate: "universal", moduleName: "@opentui/solid" }`
|
|
56
|
+
and bundled into `dist/tui.js`, which `exports["./tui"]` points at. The artifact only contains explicit
|
|
57
|
+
`@opentui/solid` / `solid-js` / `@opencode/plugin/tui` imports, which the host rewrites to its own runtime.
|
|
34
58
|
|
|
35
|
-
###
|
|
59
|
+
### Changed
|
|
36
60
|
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
|
|
61
|
+
- Added `scripts/build.mjs` (`npm run build`; `npm run dev` watches), run automatically before publishing
|
|
62
|
+
through `prepack`.
|
|
63
|
+
- The published package no longer contains `tui.tsx` / `tui.ts` / `core.ts`, only `dist/tui.js` and
|
|
64
|
+
`index.ts`. The `.tsx` source stays in the repository for local development.
|
|
40
65
|
|
|
41
|
-
###
|
|
66
|
+
### Thanks
|
|
42
67
|
|
|
43
|
-
-
|
|
44
|
-
|
|
68
|
+
- Thanks to [@third774](https://github.com/third774) for reporting the problem, pinpointing the injected
|
|
69
|
+
JSX runtime path, and verifying the compiled-output approach — 0.3.2 adopts that option.
|
|
45
70
|
|
|
46
71
|
## 0.3.1 - 2026-10-26
|
|
47
72
|
|
|
48
|
-
###
|
|
73
|
+
### Fixed
|
|
49
74
|
|
|
50
|
-
- **OpenCode v2.1
|
|
51
|
-
|
|
52
|
-
`API key not found
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
75
|
+
- **The panel broke once OpenCode v2.1 moved credentials**: v2 migrated login credentials from
|
|
76
|
+
`auth.json` to the `credential` table in `opencode.db`, but the plugin still read `auth.json`, so
|
|
77
|
+
selecting OpenCode Go always showed `API key not found`. Keys are now read through
|
|
78
|
+
`context.client.credential.list()`, with `auth.json` as a fallback only.
|
|
79
|
+
- **Prefer the host usage endpoint**: when the host exposes `GET /api/experimental/usage/limits`,
|
|
80
|
+
OpenCode Go uses that payload directly (no key at all); older releases fall back to the Zen endpoint.
|
|
81
|
+
- `preview.mjs` now reads credentials from `opencode.db` too, so the panel can be verified without the TUI.
|
|
56
82
|
|
|
57
83
|
## 0.3.0 - 2026-10-13
|
|
58
84
|
|
|
59
|
-
###
|
|
85
|
+
### Changed
|
|
60
86
|
|
|
61
|
-
- **OpenCode Go
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
87
|
+
- **OpenCode Go now shows percentages only.** The official allowances are **per model** ($15–$80, plus a
|
|
88
|
+
Go Plus tier), so the old flat `$12/$30/$60` no longer holds. Measurement also shows the percentage
|
|
89
|
+
cannot be turned into dollars: 84% monthly corresponded to $49.27 of actual 30-day spend, implying a
|
|
90
|
+
~$59 allowance rather than $80. The `used / limit` row is therefore gone for Go.
|
|
91
|
+
- **New allowance reference line** at the bottom of the panel, showing the selected model and its
|
|
92
|
+
allowance (`deepseek-v4.1-flash $80/$160`) so you can tell how expensive the model is. The built-in
|
|
93
|
+
table covers the official **31 models**; unknown models show `—` and free models show `∞`. This line is
|
|
94
|
+
purely informational and takes no part in any calculation.
|
|
95
|
+
- The `limits` option is narrowed to a **ClinePass-only fallback** (used when the plan read fails);
|
|
96
|
+
OpenCode Go no longer accepts dollar budgets.
|
|
97
|
+
- **ClinePass is unchanged**: caps are still read live from `/users/me/plan` and `used / limit` stays accurate.
|
|
65
98
|
|
|
66
|
-
###
|
|
99
|
+
### Fixed
|
|
67
100
|
|
|
68
|
-
-
|
|
101
|
+
- `formatUsd` threw `Cannot read properties of undefined` when a window had no limit; the amount text is
|
|
102
|
+
now computed safely instead of relying on a `<Show>` guard to prevent evaluation.
|
|
69
103
|
|
|
70
104
|
## 0.2.1 - 2026-10-06
|
|
71
105
|
|
|
72
|
-
###
|
|
106
|
+
### Docs
|
|
73
107
|
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
108
|
+
- Added npm version / downloads / license / OpenCode version badges to the README.
|
|
109
|
+
- Added a "Requirements" section (OpenCode v2.0.0+, a connected subscription, reachable usage endpoints).
|
|
110
|
+
- This release is the first automated publish through GitHub Actions + OIDC trusted publishing.
|
|
77
111
|
|
|
78
112
|
## 0.2.0 - 2026-10-06
|
|
79
113
|
|
|
80
|
-
###
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
- **ClinePass
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
|
|
95
|
-
-
|
|
114
|
+
### Added
|
|
115
|
+
|
|
116
|
+
- Added the [MIT](./LICENSE) license file.
|
|
117
|
+
- **ClinePass spend display**: reads `inferenceCapThreshold` from `GET /users/me/plan` and shows
|
|
118
|
+
`used / limit` like OpenCode Go. The unit was calibrated against live data: caps and `costUsd`
|
|
119
|
+
share a unit, **1 unit = 1e-8 USD** ($10 / $25 / $50). Caps are cached for 6 hours and a failed
|
|
120
|
+
read never affects the usage reading itself.
|
|
121
|
+
- **Partial-data notice**: shows `partial data · N/3 windows` when fewer windows are returned.
|
|
122
|
+
- **Rate-limit backoff**: 429 / 5xx / network failures back off exponentially (capped at 5 minutes) and
|
|
123
|
+
the error line shows `retry in Ns`; auth and shape errors are not retried. Polling moved from a fixed
|
|
124
|
+
`setInterval` to result-driven `setTimeout` scheduling.
|
|
125
|
+
- **Configurable budgets**: a new `limits` option overrides the built-in budgets
|
|
126
|
+
(e.g. `{ "opencode-go": { "monthly": 100 } }`); it is also the fallback when a ClinePass plan read fails.
|
|
127
|
+
- **Minimal re-render**: the window list moved from `<For>` to `<Index>`, so a usage refresh no longer
|
|
128
|
+
destroys and rebuilds the three rows; the tick moved from every second to **minute boundaries**
|
|
129
|
+
(second-precision only while a retry countdown is on screen); countdown and age text are wrapped in
|
|
130
|
+
`createMemo` so unchanged text is never written to the DOM; the title row's right side is now a
|
|
131
|
+
**fixed-width cell**, removing the layout jitter on each refresh. Update frequency drops from 4 spots
|
|
132
|
+
per second to once a minute.
|
|
133
|
+
- **Freshness only shown when stale**: the title row's right cell stays blank while data is fresh; the
|
|
134
|
+
age (`2m` / `5m`) appears only once the reading is older than 2.5 polling intervals (~75s), in the
|
|
135
|
+
warning colour. The previously always-on `now` label is gone.
|
|
136
|
+
|
|
137
|
+
### Fixed
|
|
138
|
+
|
|
139
|
+
- **Usage request dropped when switching models**: the in-flight guard is now tracked
|
|
140
|
+
**per provider** instead of a single global boolean. Previously, if a request was still in
|
|
141
|
+
flight, the request for the newly selected provider was skipped and the panel only refreshed on
|
|
142
|
+
the next poll (up to 30 seconds later). It now fires immediately, and the stale response is
|
|
143
|
+
dropped by the provider check so it cannot pollute the panel.
|
|
144
|
+
- **Window status ignored**: each OpenCode Go window carries a `status` field that was previously
|
|
145
|
+
read as a percentage only. A non-`ok` status now forces the danger colour and prints the status
|
|
146
|
+
word, instead of showing a disabled window as healthy.
|
|
147
|
+
- **Missing windows silently dropped**: if one of the three windows was absent the row simply
|
|
148
|
+
disappeared with no warning; incomplete readings are now called out explicitly.
|
|
149
|
+
- **Multiple credentials**: `extractKey` only handled a single credential object, so an `auth.json`
|
|
150
|
+
holding an array (several accounts/connections) resolved to no key at all; it now takes the first
|
|
151
|
+
usable one.
|
|
96
152
|
|
|
97
153
|
## 0.1.0 - 2026-10-06
|
|
98
154
|
|
|
99
|
-
|
|
155
|
+
Initial release.
|
|
100
156
|
|
|
101
|
-
###
|
|
157
|
+
### Added
|
|
102
158
|
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
- OpenCode Go
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
|
|
109
|
-
- `
|
|
110
|
-
-
|
|
111
|
-
-
|
|
159
|
+
- Sidebar usage block supporting **OpenCode Go** (`opencode-go`) and **ClinePass** (`cline-pass`).
|
|
160
|
+
- Three rolling windows: **5 hours / weekly / monthly**, with percentage, progress bar and reset countdown.
|
|
161
|
+
- OpenCode Go additionally shows the `used / limit` amount ($12 / $30 / $60).
|
|
162
|
+
- Green / yellow / red usage indication: < 50% green, 50–79% yellow, ≥ 80% red.
|
|
163
|
+
- Collapsible panel: click the title row to collapse to one line, toggle via the command palette
|
|
164
|
+
command **Toggle usage panel**; the state is persisted.
|
|
165
|
+
- The API key is read live from OpenCode's `auth.json`; the plugin stores no credentials.
|
|
166
|
+
- `refreshMs` option (default 30000 ms).
|
|
167
|
+
- Nothing is rendered for other providers, so the sidebar is never taken up needlessly.
|
|
168
|
+
- Offline preview script [`preview.mjs`](./preview.mjs).
|
|
112
169
|
|
|
113
|
-
###
|
|
170
|
+
### Changed
|
|
114
171
|
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
|
|
172
|
+
- The sidebar claim now uses `prepend`, placing the block between the cache stats, Context and MCP.
|
|
173
|
+
- The normal state colour moved from the theme's primary colour to the theme's `success` (green),
|
|
174
|
+
giving a consistent semantic green / yellow / red set.
|
|
175
|
+
- The unfilled progress track moved from `background.raised.base` to `border.base`, so it no longer
|
|
176
|
+
blends into the panel background.
|
|
177
|
+
- The reset countdown label is uniformly `↻ ` (a single space after the glyph).
|
|
178
|
+
- Thresholds changed from 70 / 90 to **50 / 80**.
|
|
120
179
|
|
|
121
|
-
###
|
|
180
|
+
### Notes
|
|
122
181
|
|
|
123
|
-
-
|
|
124
|
-
|
|
182
|
+
- The usage endpoints are provider **undocumented** APIs and their fields may change at any time;
|
|
183
|
+
on error the block shows an error line and keeps the last data.
|
|
184
|
+
- The ClinePass endpoint returns percentages only, so no dollar amount is shown.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# 变更日志
|
|
2
|
+
|
|
3
|
+
本文件记录 `usage-limits` 的版本变更。格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
4
|
+
|
|
5
|
+
[English](./CHANGELOG.md) · [简体中文](./CHANGELOG.zh-CN.md)
|
|
6
|
+
|
|
7
|
+
## 0.3.4 - 2026-12-01
|
|
8
|
+
|
|
9
|
+
### 移除
|
|
10
|
+
|
|
11
|
+
- **移除 OpenCode Go 的模型额度参考行**:官方每模型月度额度变动频繁(仅 2026-11 一个月内就调整过多档),
|
|
12
|
+
硬编码的表永远滞后一版,而过期的金额比不显示更误导。OpenCode Go 现在只显示**百分比、进度条与重置倒计时**。
|
|
13
|
+
ClinePass 保留 `已用 / 限额`,因为它的上限是从 `/users/me/plan` 实时读取的,不依赖硬编码。
|
|
14
|
+
- 一并删除相关代码:`GO_MODEL_ALLOWANCE`、`PlanTier`、`modelAllowance()`,以及 TUI 与离线预览中的对应渲染;
|
|
15
|
+
`preview.mjs` 的 `model` 命令行参数随之移除。
|
|
16
|
+
|
|
17
|
+
### 文档
|
|
18
|
+
|
|
19
|
+
- 仓库文档默认语言改为**英文**:`README.md` 与 `CHANGELOG.md` 为英文,
|
|
20
|
+
`README.zh-CN.md` 与 `CHANGELOG.zh-CN.md` 为简体中文。
|
|
21
|
+
|
|
22
|
+
## 0.3.3 - 2026-11-05
|
|
23
|
+
|
|
24
|
+
### 变更
|
|
25
|
+
|
|
26
|
+
- **Go 额度表同步官方 2026-11 版**([官方表](https://opencode.ai/v2/docs/console/go/)):
|
|
27
|
+
**DeepSeek V4.1 Flash 月度额度 $80 → $100**(Go Plus $160 → $200),这是本次唯一的金额上调。
|
|
28
|
+
- **新增 6 个模型**:`gemini-4-argon`($30/$120)、`kimi-k3.1-pro`($15/$60)、
|
|
29
|
+
`minimax-m3.1-flash`($20/$80)、`hy4`($60/$240)、`beam-free` 与 `iceman-contributor-free`(免费)。
|
|
30
|
+
- **`step-5-preview-free` 修正为 `step-5-preview`**:该模型已转为付费($15/$60),原先按免费显示 `∞` 有误。
|
|
31
|
+
- **移除 6 个官方已下架模型**:`grok-4.6`、`space-bunny`、`minimax-m2.7`、`deepseek-v4-flash`、
|
|
32
|
+
`deepseek-v4-flash-vision-exp`、`longcat-2.5-preview-free`。未收录模型继续显示 `—`。
|
|
33
|
+
- 额度表改为**按模型 ID 升序**排列,便于与官方表逐条对照;注释中的出处链接更新为
|
|
34
|
+
`https://opencode.ai/v2/docs/console/go/`。
|
|
35
|
+
- Go Teams 档(每个模型比 Go 高 $5)不纳入参考行,参考行仍显示 `$Go/$Go Plus`。
|
|
36
|
+
|
|
37
|
+
## 0.3.2 - 2026-11-05
|
|
38
|
+
|
|
39
|
+
### 修复
|
|
40
|
+
|
|
41
|
+
- **npm 安装后插件完全无法加载**([#2](https://github.com/GamingNowEdward/opencode-usage-limits/issues/2)):
|
|
42
|
+
0.3.1 直接发布 `.tsx` 源码,而 OpenCode 只对 **node_modules 之外**的插件文件运行自带的 Solid
|
|
43
|
+
Babel 转换。npm 安装的插件目录里,源码由 Bun 自行转译,会按 `@jsxImportSource` 注入
|
|
44
|
+
`@opentui/solid/jsx-dev-runtime` 导入;该注入发生在宿主重写 import 之后,于是回到 Bun 原生解析,
|
|
45
|
+
而 `@opentui/solid` 是可选 peer、npm 不会安装,最终 `stage=load` 失败,侧边栏不出现、插件列表也没有条目。
|
|
46
|
+
现在改为**发布编译产物**:`tui.tsx` 经 `babel-preset-solid { generate: "universal",
|
|
47
|
+
moduleName: "@opentui/solid" }` 编译并打包为 `dist/tui.js`,`exports["./tui"]` 指向该文件。
|
|
48
|
+
产物中只有显式的 `@opentui/solid` / `solid-js` / `@opencode/plugin/tui` 导入,宿主可以正常重写到自己的运行时。
|
|
49
|
+
|
|
50
|
+
### 变更
|
|
51
|
+
|
|
52
|
+
- 新增构建脚本 `scripts/build.mjs`(`npm run build`;`npm run dev` 为监听模式),发布前由 `prepack` 自动执行。
|
|
53
|
+
- 发布包不再包含 `tui.tsx` / `tui.ts` / `core.ts`,仅包含 `dist/tui.js` 与 `index.ts`。
|
|
54
|
+
仓库内仍保留 `.tsx` 源码,供本地开发使用。
|
|
55
|
+
|
|
56
|
+
### 致谢
|
|
57
|
+
|
|
58
|
+
- 感谢 [@third774](https://github.com/third774) 报告该问题、定位到 JSX 运行时注入路径,并先行
|
|
59
|
+
验证了「发布编译产物」这一方案;0.3.2 采用的是该方案。
|
|
60
|
+
|
|
61
|
+
## 0.3.1 - 2026-10-26
|
|
62
|
+
|
|
63
|
+
### 修复
|
|
64
|
+
|
|
65
|
+
- **OpenCode v2.1+ 凭据迁移导致面板失效**:v2 把登录凭据从 `auth.json` 迁移到 `opencode.db`
|
|
66
|
+
的 `credential` 表,插件仍只读 `auth.json`,因此选中 OpenCode Go 时固定显示
|
|
67
|
+
`API key not found`。现在优先通过 `context.client.credential.list()` 读取,`auth.json` 仅作兜底。
|
|
68
|
+
- **优先使用宿主用量接口**:宿主提供 `GET /api/experimental/usage/limits` 时,OpenCode Go 直接使用
|
|
69
|
+
该接口(无需密钥);旧版本自动回退到 Zen 用量接口。
|
|
70
|
+
- `preview.mjs` 同步支持从 `opencode.db` 读取凭据,便于在不启动 TUI 的情况下验证。
|
|
71
|
+
|
|
72
|
+
## 0.3.0 - 2026-10-13
|
|
73
|
+
|
|
74
|
+
### 变更
|
|
75
|
+
|
|
76
|
+
- **OpenCode Go 改为只显示百分比**。官方额度已改成**按模型区分**($15–$80,另有 Go Plus 档),原有的统一 `$12/$30/$60` 不再成立。实测进一步表明百分比**不能**换算成美元:月度 84% 对应的 30 天实际花费为 $49.27,反推额度约 $59 而非 $80。因此移除了 Go 窗口的 `已用 / 限额` 行。
|
|
77
|
+
- **新增模型额度参考行**(放在面板底部):显示当前模型与其额度,如 `deepseek-v4.1-flash $80/$160`,用于判断该模型是贵还是便宜。内置官方 **31 个模型**的额度表;未收录的模型显示 `—`,免费模型显示 `∞`。该行**仅作参考,不参与任何计算**。
|
|
78
|
+
- `limits` 配置项收窄为 **ClinePass 专用回退**(套餐上限读取失败时使用);OpenCode Go 不再接受美元额度配置。
|
|
79
|
+
- **ClinePass 行为不变**:额度仍从 `/users/me/plan` 实时读取,`已用 / 限额` 保持准确。
|
|
80
|
+
|
|
81
|
+
### 修复
|
|
82
|
+
|
|
83
|
+
- 额度缺失时 `formatUsd` 会抛 `Cannot read properties of undefined`;金额文本改为安全求值(不再依赖 `<Show>` 守卫拦住求值)。
|
|
84
|
+
|
|
85
|
+
## 0.2.1 - 2026-10-06
|
|
86
|
+
|
|
87
|
+
### 文档
|
|
88
|
+
|
|
89
|
+
- README 增加 npm 版本 / 下载量 / 许可 / OpenCode 版本徽章。
|
|
90
|
+
- README 新增「要求」小节(OpenCode v2.0.0+、已连接订阅、网络可达用量接口)。
|
|
91
|
+
- 本次为通过 GitHub Actions + OIDC 可信发布的首次自动发布验证。
|
|
92
|
+
|
|
93
|
+
## 0.2.0 - 2026-10-06
|
|
94
|
+
|
|
95
|
+
### 新增
|
|
96
|
+
|
|
97
|
+
- 补充 [MIT](./LICENSE) 许可文件。
|
|
98
|
+
- **ClinePass 显示金额**:新增读取 `GET /users/me/plan` 的 `inferenceCapThreshold`,与 OpenCode Go 一样显示 `已用 / 限额`。额度单位经实测标定:`cap` 与 `costUsd` 同单位,**1 单位 = 1e-8 USD**(即 $10 / $25 / $50),上限缓存 6 小时,读取失败不影响用量本身。
|
|
99
|
+
- **部分数据提示**:窗口数不足时显示 `partial data · N/3 windows`。
|
|
100
|
+
- **限流退避**:429 / 5xx / 网络失败时指数退避(最长 5 分钟),错误行显示 `retry in Ns`;鉴权与数据形状错误不重试。轮询由固定 `setInterval` 改为按结果调度的 `setTimeout`。
|
|
101
|
+
- **额度可配置**:新增 `limits` 选项可覆盖内置额度(如 `{ "opencode-go": { "monthly": 100 } }`);ClinePass 读不到套餐上限时也会回退到该配置。
|
|
102
|
+
- **渲染更新最小化**:窗口列表由 `<For>` 改为 `<Index>`,用量刷新时不再销毁重建三行组件;tick 由每秒改为**对齐分钟边界**(仅在有重试倒计时时恢复每秒);倒计时与年龄文本用 `createMemo` 包裹,文本未变则不写 DOM;标题行右侧改为**固定宽度单元格**,消除刷新瞬间的布局抖动。更新频率由每秒 4 处降为每分钟 1 次。
|
|
103
|
+
- **新鲜度只在过期时提示**:标题行右侧平时留空,只有数据超过 2.5 个轮询间隔(约 75 秒)时才显示年龄(`2m` / `5m`)并转为警告色;此前恒显的 `now` 已移除,不再制造噪音。
|
|
104
|
+
|
|
105
|
+
### 修复
|
|
106
|
+
|
|
107
|
+
- **切换模型时用量请求被丢弃**:并发守卫由全局布尔改为**按 provider** 记录在途状态。此前若上一个请求尚未返回,切换到另一 provider 的这次请求会被直接跳过,需等下一个轮询周期(最多 30 秒)才刷新;现在会立即发起,迟到的旧响应由 provider 校验丢弃,不会污染面板。
|
|
108
|
+
- **窗口状态被忽略**:OpenCode Go 的每个窗口带有 `status` 字段,此前只读百分比。现在状态非 `ok` 时该窗口强制显示为红色并标注状态词,不再把已停用的窗口显示成正常。
|
|
109
|
+
- **缺失窗口静默跳过**:此前三个窗口缺哪个就少哪一行且不告警,现在会显式提示数据不完整。
|
|
110
|
+
- **多凭据兼容**:`extractKey` 此前只处理单个凭据对象,若 `auth.json` 以数组存放多个账号/连接,会完全读不到密钥;现在会取第一个可用的密钥。
|
|
111
|
+
|
|
112
|
+
## 0.1.0 - 2026-10-06
|
|
113
|
+
|
|
114
|
+
首个版本。
|
|
115
|
+
|
|
116
|
+
### 新增
|
|
117
|
+
|
|
118
|
+
- 侧边栏用量区块,支持 **OpenCode Go**(`opencode-go`)与 **ClinePass**(`cline-pass`)。
|
|
119
|
+
- 三个滚动窗口:**5 小时 / 周 / 月**,展示百分比、进度条与重置倒计时。
|
|
120
|
+
- OpenCode Go 额外显示 `已用 / 限额` 金额($12 / $30 / $60)。
|
|
121
|
+
- 绿黄红用量提醒:< 50% 绿、50–79% 黄、≥ 80% 红。
|
|
122
|
+
- 整体折叠:点击标题行收起为一行,并通过命令面板 **Toggle usage panel** 切换;状态持久化。
|
|
123
|
+
- 密钥从 OpenCode 的 `auth.json` 实时读取,插件不存储任何凭据。
|
|
124
|
+
- `refreshMs` 配置项(默认 30000 毫秒)。
|
|
125
|
+
- 选中其他 provider 时完全不渲染,不占空间。
|
|
126
|
+
- 离线预览脚本 [`preview.mjs`](./preview.mjs)。
|
|
127
|
+
|
|
128
|
+
### 变更
|
|
129
|
+
|
|
130
|
+
- 侧边栏插入位置改用 `prepend`,区块排在缓存统计、Context、MCP 之间。
|
|
131
|
+
- 正常态配色由主题主色改为主题 `success`(绿色),与黄 / 红构成统一语义色。
|
|
132
|
+
- 进度条未填充轨道由 `background.raised.base` 改为 `border.base`,避免与面板同色而隐形。
|
|
133
|
+
- 重置倒计时标签统一为 `↻ `(感叹号后保留一个空格)。
|
|
134
|
+
- 阈值由 70 / 90 调整为 **50 / 80**。
|
|
135
|
+
|
|
136
|
+
### 说明
|
|
137
|
+
|
|
138
|
+
- 用量接口为 provider 的**非公开**接口,字段可能随时变化;接口异常时区块会显示错误行并保留上次数据。
|
|
139
|
+
- ClinePass 接口仅返回百分比,因此不显示金额。
|