@chenlongapps/opencode-token-usage 0.3.1 → 0.3.3

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/README.md CHANGED
@@ -60,8 +60,8 @@ For remote sessions, add the package name to `plugins` in your local `~/.config/
60
60
  - A fork is a separate session tree. Inherited message copies are attributed only to their original source to prevent double counting.
61
61
  - `Context` only searches messages after the most recent compaction with `status === "completed"` and is hidden when reliable usage or a model context limit is unavailable.
62
62
  - `Steps` counts every assistant message in the tree, whether or not it reported usage, and reuses the fork-copy de-duplication so inherited history is never counted twice.
63
- - `Cost` prices every message with its recorded model. A complete applicable price resolved by OpenCode takes precedence; when OpenCode has no usable price, the plugin falls back to a packaged snapshot of manufacturer prices.
64
- - Gateway models can use manufacturer fallback prices through exact model IDs and documented aliases. The fallback does not include gateway markups, regional premiums, discounts, tool fees, or taxes, so Cost is an estimate rather than a provider bill.
63
+ - `Cost` prices every message with its recorded model. A complete non-zero price resolved by OpenCode takes precedence. If OpenCode reports a complete zero price, a complete official snapshot price overrides it; incomplete prices fall back for the whole message without mixing rates.
64
+ - Gateway models can use fallback prices through exact model IDs, documented aliases, and known wrappers. A terminal `-free` or `:free` is removed only for an exact base ID lookup; other suffixes are not stripped. The fallback excludes gateway markups, regional premiums, unlisted discounts, tool fees, and taxes, so Cost is an estimate rather than a provider bill.
65
65
  - Confirmed free usage displays `$0.00`; unavailable prices display `—`; known subtotals with unpriced messages are marked `partial`. See the [built-in price snapshot](docs/pricing.md) for coverage, sources, and limitations.
66
66
  - Initial read failures display `Unavailable`. Later failures retain the last complete snapshot, display `Not updated`, and retry automatically.
67
67
 
package/README.zh-CN.md CHANGED
@@ -60,8 +60,8 @@ opencode plugin add @chenlongapps/opencode-token-usage
60
60
  - 分叉会话是独立会话树。继承消息副本只归原始来源,避免重复计费。
61
61
  - `Context` 仅搜索最后一次 `status === "completed"` 的 compaction 之后;没有可靠用量或模型上限时隐藏。
62
62
  - `Steps` 统计树中全部 assistant 消息,无论是否已上报用量;复用分叉副本去重,继承历史不会重复计数。
63
- - `Cost` 按每条消息记录的实际模型分别计算。OpenCode 当前解析出的完整适用价格优先;OpenCode 没有可用价格时,回退到插件内置的厂商官方价格快照。
64
- - 网关模型可通过精确模型 ID 和已记录别名使用厂商价格,但不包含网关加价、区域溢价、折扣、工具费和税费,因此 Cost 是估算而非提供商账单。
63
+ - `Cost` 按每条消息记录的实际模型分别计算。OpenCode 当前解析出的完整非零价格优先;若 OpenCode 给出完整零价,且内置价格快照可以完整计价,则采用快照价格。价格不完整时整条消息回退,不混用两套费率。
64
+ - 网关模型通过精确模型 ID、明确别名和已知包装格式匹配;也会尝试移除终尾 `-free` 或 `:free` 后精确查找基础 ID,其他后缀不会剥离。快照不包含网关加价、区域溢价、未列明的折扣、工具费和税费,因此 Cost 是估算而非提供商账单。
65
65
  - 确认免费时显示 `$0.00`;价格不可用时显示 `—`;只有部分消息可计算时在已知小计后标注 `partial`。覆盖范围、来源和限制见[内置官方价格快照](docs/pricing.md)。
66
66
  - 首次读取失败显示 `Unavailable`;后续失败保留上次完整快照、标注 `Not updated` 并自动重试。
67
67
 
package/ROADMAP.md CHANGED
@@ -82,6 +82,12 @@ Steps 1,234
82
82
  * [x] 已收录模型永久保留,后续持续核验价格和来源
83
83
  * [x] 通过单元测试与 OpenCode 2.0.11 打包集成验证
84
84
 
85
+ ## v0.3.2 — GPT-6 Sol / Luna 定价
86
+
87
+ * [x] 根据 OpenAI 官方 Standard 价格补全两款模型的短、长上下文费率
88
+ * [x] 将 OpenAI 长上下文切换边界校正为传入 token 超过 272,000
89
+ * [x] 通过类型检查、45 项自动化测试及构建
90
+
85
91
  ## v0.4.0 — 用量命令
86
92
 
87
93
  目标:按需提供比侧边栏更详细的 token 信息。
package/dist/pricing.js CHANGED
@@ -2,48 +2,62 @@ export const OFFICIAL_PRICE_SNAPSHOT = {
2
2
  verified: "2026-09-23",
3
3
  newModelCutoff: "2026-03-22",
4
4
  entries: [
5
- // OpenAI standard processing. The tier sizes are exclusive thresholds, so
6
- // 271,999 implements the official "long context at 272K" boundary.
5
+ // OpenAI standard processing. Tier sizes are exclusive thresholds, so
6
+ // 272,000 implements the official ">272K input tokens" boundary.
7
7
  {
8
8
  id: "gpt-5.5", released: "2026-04-23", source: "https://developers.openai.com/api/docs/pricing",
9
9
  prices: [
10
10
  { input: 5, output: 30, cache: { read: 0.5 } },
11
- { tier: { type: "context", size: 271_999 }, input: 10, output: 45, cache: { read: 1 } },
11
+ { tier: { type: "context", size: 272_000 }, input: 10, output: 45, cache: { read: 1 } },
12
12
  ],
13
13
  },
14
14
  {
15
15
  id: "gpt-5.5-pro", released: "2026-04-23", source: "https://developers.openai.com/api/docs/pricing",
16
16
  prices: [
17
17
  { input: 30, output: 180 },
18
- { tier: { type: "context", size: 271_999 }, input: 60, output: 270 },
18
+ { tier: { type: "context", size: 272_000 }, input: 60, output: 270 },
19
19
  ],
20
20
  },
21
21
  {
22
22
  id: "gpt-5.6-sol", released: "2026-07-09", source: "https://developers.openai.com/api/docs/pricing",
23
23
  prices: [
24
24
  { input: 4, output: 20, cache: { read: 0.4, write: 5 } },
25
- { tier: { type: "context", size: 271_999 }, input: 8, output: 30, cache: { read: 0.8, write: 10 } },
25
+ { tier: { type: "context", size: 272_000 }, input: 8, output: 30, cache: { read: 0.8, write: 10 } },
26
26
  ],
27
27
  },
28
28
  {
29
29
  id: "gpt-5.6-terra", released: "2026-07-09", source: "https://developers.openai.com/api/docs/pricing",
30
30
  prices: [
31
31
  { input: 2, output: 12, cache: { read: 0.2, write: 2.5 } },
32
- { tier: { type: "context", size: 271_999 }, input: 4, output: 18, cache: { read: 0.4, write: 5 } },
32
+ { tier: { type: "context", size: 272_000 }, input: 4, output: 18, cache: { read: 0.4, write: 5 } },
33
33
  ],
34
34
  },
35
35
  {
36
36
  id: "gpt-5.6-luna", released: "2026-07-09", source: "https://developers.openai.com/api/docs/pricing",
37
37
  prices: [
38
38
  { input: 0.2, output: 1.2, cache: { read: 0.02, write: 0.25 } },
39
- { tier: { type: "context", size: 271_999 }, input: 0.4, output: 1.8, cache: { read: 0.04, write: 0.5 } },
39
+ { tier: { type: "context", size: 272_000 }, input: 0.4, output: 1.8, cache: { read: 0.04, write: 0.5 } },
40
40
  ],
41
41
  },
42
42
  {
43
43
  id: "gpt-6-astra", released: "2026-09-04", source: "https://developers.openai.com/api/docs/pricing",
44
44
  prices: [
45
45
  { input: 10, output: 50, cache: { read: 1, write: 12.5 } },
46
- { tier: { type: "context", size: 271_999 }, input: 20, output: 75, cache: { read: 2, write: 25 } },
46
+ { tier: { type: "context", size: 272_000 }, input: 20, output: 75, cache: { read: 2, write: 25 } },
47
+ ],
48
+ },
49
+ {
50
+ id: "gpt-6-sol", released: "2026-09-22", source: "https://developers.openai.com/api/docs/pricing",
51
+ prices: [
52
+ { input: 2, output: 10, cache: { read: 0.2, write: 2.5 } },
53
+ { tier: { type: "context", size: 272_000 }, input: 4, output: 15, cache: { read: 0.4, write: 5 } },
54
+ ],
55
+ },
56
+ {
57
+ id: "gpt-6-luna", released: "2026-09-22", source: "https://developers.openai.com/api/docs/pricing",
58
+ prices: [
59
+ { input: 0.1, output: 0.5, cache: { read: 0.01, write: 0.125 } },
60
+ { tier: { type: "context", size: 272_000 }, input: 0.2, output: 0.75, cache: { read: 0.02, write: 0.25 } },
47
61
  ],
48
62
  },
49
63
  // The official ChatGPT SKU `chat-latest`. OpenRouter serves it under the
@@ -161,9 +175,7 @@ export const OFFICIAL_PRICE_SNAPSHOT = {
161
175
  source: "https://cohere.com/pricing",
162
176
  prices: [{ input: 2.5, output: 10 }],
163
177
  },
164
- // Meta Model API standard-tier rates. The contributor tier is a separate
165
- // discounted program that permits training on prompts and completions, so
166
- // it is intentionally not part of the standard snapshot.
178
+ // Meta Model API standard-tier rates.
167
179
  {
168
180
  id: "muse-spark-1.1", released: "2026-07-09", source: "https://ai.developer.meta.com/docs/pricing-rate-limits",
169
181
  prices: [{ input: 1.25, output: 4.25, cache: { read: 0.15 } }],
@@ -176,6 +188,17 @@ export const OFFICIAL_PRICE_SNAPSHOT = {
176
188
  id: "muse-spark-1.3", released: "2026-09-02", source: "https://ai.developer.meta.com/docs/pricing-rate-limits",
177
189
  prices: [{ input: 1.25, output: 4.25, cache: { read: 0.15 } }],
178
190
  },
191
+ // Meta Contributor rates are conditional on allowing Meta to use prompts
192
+ // and completions for training. OpenCode's contributor-free model IDs
193
+ // resolve here after removing their terminal -free suffix.
194
+ {
195
+ id: "muse-spark-1.2-contributor", released: "2026-08-05", source: "https://ai.developer.meta.com/docs/pricing-rate-limits",
196
+ prices: [{ input: 0.1, output: 0.2, cache: { read: 0.002 } }],
197
+ },
198
+ {
199
+ id: "muse-spark-1.3-contributor", released: "2026-09-02", source: "https://ai.developer.meta.com/docs/pricing-rate-limits",
200
+ prices: [{ input: 0.1, output: 0.2, cache: { read: 0.002 } }],
201
+ },
179
202
  // Inception's current Mercury 2.5 API page shows an 80% launch discount;
180
203
  // the snapshot records the billed standard-platform rates on verification
181
204
  // day rather than the crossed-out list prices. No cache-write token rate is
@@ -484,5 +507,14 @@ export function officialPrice(model) {
484
507
  if (entry)
485
508
  return entry;
486
509
  }
510
+ for (const candidate of candidates) {
511
+ for (const suffix of ["-free", ":free"]) {
512
+ if (!candidate.endsWith(suffix))
513
+ continue;
514
+ const entry = index.get(candidate.slice(0, -suffix.length));
515
+ if (entry)
516
+ return entry;
517
+ }
518
+ }
487
519
  return undefined;
488
520
  }
package/dist/usage.d.ts CHANGED
@@ -83,8 +83,9 @@ export declare function estimate(tokens: Tokens, prices?: readonly Price[]): {
83
83
  defaultPrice: boolean;
84
84
  };
85
85
  export type CostStatus = "empty" | "complete" | "partial" | "unavailable";
86
- /** Prices every call with its recorded model. OpenCode's resolved price wins;
87
- * the built-in manufacturer snapshot is used only when that price is incomplete. */
86
+ /** Prices every call with its recorded model. A complete non-zero OpenCode
87
+ * price wins; a complete snapshot price can replace a complete OpenCode zero.
88
+ * Incomplete OpenCode prices fall back to the snapshot as a whole. */
88
89
  export declare function summarize(messages: Iterable<UsageMessage>, catalog?: PriceCatalog): {
89
90
  tokens: Tokens;
90
91
  total: number;
package/dist/usage.js CHANGED
@@ -22,8 +22,9 @@ export function estimate(tokens, prices = []) {
22
22
  && (rate === undefined || !Number.isFinite(rate) || rate < 0))),
23
23
  };
24
24
  }
25
- /** Prices every call with its recorded model. OpenCode's resolved price wins;
26
- * the built-in manufacturer snapshot is used only when that price is incomplete. */
25
+ /** Prices every call with its recorded model. A complete non-zero OpenCode
26
+ * price wins; a complete snapshot price can replace a complete OpenCode zero.
27
+ * Incomplete OpenCode prices fall back to the snapshot as a whole. */
27
28
  export function summarize(messages, catalog = new Map()) {
28
29
  const tokens = normalize();
29
30
  let cost = 0;
@@ -50,8 +51,11 @@ export function summarize(messages, catalog = new Map()) {
50
51
  continue;
51
52
  }
52
53
  let value = estimate(t, catalog.get(modelKey(message.model)));
53
- if (value.defaultPrice)
54
- value = estimate(t, officialPrice(message.model)?.prices);
54
+ if (value.defaultPrice || value.cost === 0) {
55
+ const snapshot = estimate(t, officialPrice(message.model)?.prices);
56
+ if (!snapshot.defaultPrice)
57
+ value = snapshot;
58
+ }
55
59
  if (value.defaultPrice)
56
60
  missingCosts++;
57
61
  else {
package/docs/pricing.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # 内置官方价格快照
2
2
 
3
- v0.3.0 在 OpenCode 当前模型目录没有可用于某条消息的完整价格时,使用本页所列的厂商官方标准价补全。快照核验于 **2026-09-23**,共收录 72 个模型,金额均为美元 / 100 万 token。
3
+ 插件自 v0.3.0 起,在 OpenCode 当前模型目录没有可用于某条消息的完整价格时,使用本页所列的公开 API 价格补全。若 OpenCode 给出完整零价,而快照能完整计价,则使用快照价格。快照核验于 **2026-09-23**,共收录 79 个模型,金额均为美元 / 100 万 token。
4
4
 
5
5
  ## 规则
6
6
 
7
7
  - 每条 assistant 与 compaction 消息按自身记录的 `providerID`、模型 ID 和 token 用量分别计算。
8
- - OpenCode 当前解析出的完整适用价格优先;仅当适用档位或本次实际使用的 token 类别缺价时,整条消息回退到内置价格,不混用两套费率。
9
- - 网关模型只通过精确厂商 ID、精确别名及已知包装格式匹配,例如 `openai/gpt-5.6-luna`、`us.anthropic.claude-opus-5` 和 `claude-opus-5@default`。不按相似名称猜测。
10
- - 目录首版只新增 2026-03-22 至 2026-09-22 发布、具有明确标准 token 价格的模型。后续版本只限制新增窗口,已经收录的模型不会因超过半年而自动删除。
11
- - 采用标准同步 API 的公开价,不含 Batch、Flex、Fast/Priority、区域溢价、网关加价、免费额度、企业折扣、工具费和税费,因此 Cost 仍是估算,不代表账单。
8
+ - OpenCode 当前解析出的完整适用非零价格优先。若完整适用价格为零,则尝试使用内置价格;只有快照能完整覆盖该消息实际使用的 token 类别时才覆盖零价,否则保留 OpenCode 的零价。OpenCode 价格不完整时,整条消息回退到内置价格,不混用两套费率。
9
+ - 网关模型只通过精确厂商 ID、精确别名及已知包装格式匹配,例如 `openai/gpt-5.6-luna`、`us.anthropic.claude-opus-5` 和 `claude-opus-5@default`。匹配这些现有形式后,也会尝试仅移除模型 ID 的末尾 `-free` 或 `:free` 再精确匹配基础 ID,例如 `mimo-v2.6-flash-free`、`meta/muse-spark-1.3:free` 和 `muse-spark-1.3-contributor-free`;`-pro`、`-fast`、`-free-preview` 等其他后缀不会剥离。不按相似名称猜测。
10
+ - 目录首版只新增 2026-03-22 至 2026-09-22 发布、具有明确 token 费率的模型。后续版本只限制新增窗口,已经收录的条目不会因超过半年而自动删除。
11
+ - 采用标准同步 API 的公开价;Meta Contributor 条件价按单独标注的来源记录。不含 Batch、Flex、Fast/Priority、区域溢价、网关加价、企业折扣、工具费和税费,因此 Cost 仍是估算,不代表账单。
12
12
  - 任一有用量消息仍无法定价时,已知小计标记 `partial`;全部无法定价时显示 `—`。明确零价才显示 `$0.00`。
13
13
  - 促销价按核验日官网显示的费率收录(如 `gpt-5.6-sol`、MiniMax-M3 的"长期 5 折"标价),不用划线原价。
14
14
 
@@ -18,15 +18,17 @@ v0.3.0 在 OpenCode 当前模型目录没有可用于某条消息的完整价格
18
18
 
19
19
  | 模型 | 发布日期 | Input | Output | Cache Read | Cache Write | 长上下文档位 |
20
20
  | --- | --- | ---: | ---: | ---: | ---: | --- |
21
- | `gpt-5.5` | 2026-04-23 | 5 | 30 | 0.5 | — | ≥272K:10 / 45 / 1 / — |
22
- | `gpt-5.5-pro` | 2026-04-23 | 30 | 180 | — | — | ≥272K:60 / 270 / — / — |
23
- | `gpt-5.6-sol` | 2026-07-09 | 4 | 20 | 0.4 | 5 | ≥272K:8 / 30 / 0.8 / 10 |
24
- | `gpt-5.6-terra` | 2026-07-09 | 2 | 12 | 0.2 | 2.5 | ≥272K:4 / 18 / 0.4 / 5 |
25
- | `gpt-5.6-luna` | 2026-07-09 | 0.2 | 1.2 | 0.02 | 0.25 | ≥272K:0.4 / 1.8 / 0.04 / 0.5 |
26
- | `gpt-6-astra` | 2026-09-04 | 10 | 50 | 1 | 12.5 | ≥272K:20 / 75 / 2 / 25 |
21
+ | `gpt-5.5` | 2026-04-23 | 5 | 30 | 0.5 | — | >272K:10 / 45 / 1 / — |
22
+ | `gpt-5.5-pro` | 2026-04-23 | 30 | 180 | — | — | >272K:60 / 270 / — / — |
23
+ | `gpt-5.6-sol` | 2026-07-09 | 4 | 20 | 0.4 | 5 | >272K:8 / 30 / 0.8 / 10 |
24
+ | `gpt-5.6-terra` | 2026-07-09 | 2 | 12 | 0.2 | 2.5 | >272K:4 / 18 / 0.4 / 5 |
25
+ | `gpt-5.6-luna` | 2026-07-09 | 0.2 | 1.2 | 0.02 | 0.25 | >272K:0.4 / 1.8 / 0.04 / 0.5 |
26
+ | `gpt-6-astra` | 2026-09-04 | 10 | 50 | 1 | 12.5 | >272K:20 / 75 / 2 / 25 |
27
+ | `gpt-6-sol` | 2026-09-22 | 2 | 10 | 0.2 | 2.5 | >272K:4 / 15 / 0.4 / 5 |
28
+ | `gpt-6-luna` | 2026-09-22 | 0.1 | 0.5 | 0.01 | 0.125 | >272K:0.2 / 0.75 / 0.02 / 0.25 |
27
29
  | `chat-latest`(别名 `gpt-chat-latest`) | 2026-05-05 | 5 | 30 | 0.5 | — | — |
28
30
 
29
- `gpt-5.6-sol` 的当前标准价是限期促销价;快照采用核验日官网显示的费率。`chat-latest` 是官方 ChatGPT SKU,OpenRouter 上的 `gpt-chat-latest` 作为精确别名指向同一条目。
31
+ `gpt-6-sol` 和 `gpt-6-luna` 的发布日期见 [OpenAI API 更新日志](https://developers.openai.com/api/docs/changelog)。表内 OpenAI 长上下文价格在传入 token 超过 272,000 时对整条请求生效。`gpt-5.6-sol` 的当前标准价是限期促销价;快照采用核验日官网显示的费率。`chat-latest` 是官方 ChatGPT SKU,OpenRouter 上的 `gpt-chat-latest` 作为精确别名指向同一条目。
30
32
 
31
33
  ## Anthropic
32
34
 
@@ -197,7 +199,14 @@ Step 5 Preview 官方明确说明 cache-miss Input 包含首次缓存写入,
197
199
  | `muse-spark-1.2` | 2026-08-05 | 1.25 | 4.25 | 0.15 |
198
200
  | `muse-spark-1.3` | 2026-09-02 | 1.25 | 4.25 | 0.15 |
199
201
 
200
- 这里只收录 Standard tier。Contributor tier 虽然也是官方 API,但以允许 Meta 使用提示词和回答训练为条件的折扣方案,不属于标准价;官方没有 cache write token 价。
202
+ Contributor tier 以允许 Meta 使用提示词和回答进行训练为条件,按独立 tier 记录。官方没有公布 cache write token 价。
203
+
204
+ | Contributor 模型 | 发布日期 | Input | Output | Cache Read | Cache Write |
205
+ | --- | --- | ---: | ---: | ---: | ---: |
206
+ | `muse-spark-1.2-contributor` | 2026-08-05 | 0.10 | 0.20 | 0.002 | — |
207
+ | `muse-spark-1.3-contributor` | 2026-09-02 | 0.10 | 0.20 | 0.002 | — |
208
+
209
+ OpenCode Zen 的 `muse-spark-1.2-contributor-free` 和 `muse-spark-1.3-contributor-free` 会精确匹配各自 Contributor 条目;Cost 因此按 Meta Contributor 费率估算。
201
210
 
202
211
  ## Inception
203
212
 
@@ -276,7 +285,7 @@ Fugu Ultra 的编排 token 已包含在 API 返回的 input/output 用量中,
276
285
  - Realtime、音频、图片、视频、embedding、按页、按分钟和按工具调用收费的模型无法仅由当前五类 token 用量准确计算。
277
286
  - `grok-4.20`、`grok-4.20-multi-agent` 发布于 2026-03-09,早于目录收录窗口起点 2026-03-22。
278
287
  - Fast/Priority 等加速档(`claude-opus-*-fast`、`gpt-5.6-*-pro`、`gpt-6-astra-pro`、MiniMax priority 档)不是标准同步价。
279
- - 免费模型(Gemma 系列、`cohere/north-mini-code` 等开源或网关零价款)不设价格条目。
280
- - 无法从厂商官方页面确认标准 token 价格的模型不猜价,包括 OpenRouter stealth/alpha 匿名模型、`z-ai/glm-5v-turbo`、`qwen3.6-plus-preview`、腾讯 `hy3-preview` 与 `hy-mt2-*`、`kwaipilot/kat-coder-pro-v2.5` 及其 Air 版本、`inclusionai/ling-3.0-*`、`bytedance-seed/seed-2.0-code` 等。这些模型目前只能查到 OpenRouter、AtlasCloud、DeepInfra 等网关或第三方报价,不能据此推断厂商标准价。
288
+ - 其他免费模型(Gemma 系列、`cohere/north-mini-code` 等开源或网关零价款)不设价格条目。
289
+ - 无法从厂商官方页面确认标准 token 价格的模型不猜价,包括 OpenRouter stealth/alpha 匿名模型、`z-ai/glm-5v-turbo`、`qwen3.6-plus-preview`、腾讯 `hy3-preview` 与 `hy-mt2-*`、`kwaipilot/kat-coder-pro-v2.5` 及其 Air 版本、除上表 OpenCode Zen SKU 外的 `inclusionai/ling-3.0-*`、`bytedance-seed/seed-2.0-code` 等。这些模型目前只能查到 OpenRouter、AtlasCloud、DeepInfra 等网关或第三方报价,不能据此推断厂商标准价。
281
290
  - 浮动别名(`-latest` 指针与 OpenRouter `~` 前缀条目)随底层模型漂移,不收录固定价。
282
291
  - 只有询价、托管部署价或无法从厂商官方页面确认标准 token 价格的模型不猜价。
@@ -1,6 +1,18 @@
1
1
  # 验证记录
2
2
 
3
- ## 未发布(SDK 2.0.11)
3
+ ## v0.3.2(GPT-6 Sol / Luna 价格更新,SDK 2.0.11)
4
+
5
+ 验证日期:2026-09-23。根据 [OpenAI API 更新日志](https://developers.openai.com/api/docs/changelog),`gpt-6-sol` 和 `gpt-6-luna` 于 2026-09-22 发布;[官方定价页](https://developers.openai.com/api/docs/pricing)列出两者的 Standard 短、长上下文四类 token 费率。内置快照由 72 个模型增至 74 个。根据 [Sol](https://developers.openai.com/api/docs/models/gpt-6-sol) 与 [Luna](https://developers.openai.com/api/docs/models/gpt-6-luna) 模型说明,传入 token 超过 272,000 时才使用长上下文价格;同轮也将已有 OpenAI 条目的边界从 271,999 校正为 272,000。
6
+
7
+ | 检查 | 结果 |
8
+ | --- | --- |
9
+ | `npm run typecheck` | 通过 |
10
+ | `npm test` | 45 项通过,新增两款模型的费率、精确匹配和档位边界断言 |
11
+ | `npm run build` | 通过 |
12
+
13
+ 本轮未重跑 `npm run test:smoke`;下方的打包集成记录对应更新前的 72 模型快照。
14
+
15
+ ## v0.3.1(SDK 2.0.11)
4
16
 
5
17
  验证日期:2026-09-23。环境:macOS、Node.js v22.23.2、npm 10.9.8、OpenCode v2.0.11;`@opencode/plugin`、`@opencode/client`、`@opencode/schema` 和 `@opencode/theme` 均精确锁定为 2.0.11。
6
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chenlongapps/opencode-token-usage",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Session-tree token usage, live performance, context window and estimated cost for OpenCode 2",
5
5
  "keywords": [
6
6
  "opencode",