dsh-cost-meter 1.5.23 → 1.5.25

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.en.md CHANGED
@@ -4,9 +4,9 @@
4
4
 
5
5
  **Session cost tracking plugin for the DeepSeek Harness web GUI (bilingual UI)**
6
6
 
7
- Per-conversation cost · daily totals · OpenCode Go subscription quota display · budget with usage percentage · official account balance · custom provider balance · balance progress bar · history · peak/off-peak pricing hours display (peak hours UTC 01:00–04:00, 06:00–10:00) · pre-switch popup & system-notification alerts for peak/off-peak changes (position / lead time / alert type configurable) · one-click price sync from the official docs · Codex-style token usage heat grid · multi-vendor model pricing (built-in 90+ model price catalog with auto-matching) · mainstream Coding Plan quota queries & display (Anthropic / Z.ai / MiniMax / Kimi / OpenRouter / SiliconFlow / SCNet)
7
+ Per-conversation cost · daily totals · OpenCode Go subscription quota display · budget with usage percentage · official account balance · custom provider balance · balance progress bar · history · peak/off-peak pricing hours display (peak hours UTC 01:00–04:00, 06:00–10:00) · pre-switch popup & system-notification alerts for peak/off-peak changes (position / lead time / alert type configurable) · one-click price sync from the official docs · Codex-style token usage heat grid · multi-vendor model pricing (built-in 90+ model price catalog with auto-matching) · mainstream Coding Plan quota queries & display (Anthropic / Z.ai / MiniMax / Kimi / OpenRouter / SiliconFlow / CommandCode / SCNet)
8
8
 
9
- [![version](https://img.shields.io/badge/version-1.5.23-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
9
+ [![version](https://img.shields.io/badge/version-1.5.25-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
10
10
  [![npm](https://img.shields.io/npm/v/dsh-cost-meter?label=npm)](https://www.npmjs.com/package/dsh-cost-meter)
11
11
  [![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
12
12
  [![dsh](https://img.shields.io/badge/DeepSeek%20Harness-dsh--plugin-4176E6)](https://github.com/deepseek-ai/deepseek-harness)
@@ -29,7 +29,7 @@ English | [中文](README.md)
29
29
  | Official balance | Sidebar top / Settings page (configurable) | Total / granted / topped-up balance, auto-refresh + manual refresh; optional three-segment progress bar (blue/orange/gray) |
30
30
  | Custom provider balance | Sidebar / Settings page (configurable) | Configurable HTTP balance lookup (e.g. LiteLLM); bilingual labels, currency, extract rules; collapsible panel alongside Coding Plan quotas |
31
31
  | OpenCode Go quota | Sidebar / Settings / bottom-right dock (configurable) | Rolling-5h / weekly / monthly usage percent and reset times, each window toggleable independently, budget used % can show alongside; key auto-discovered (DSH credential store OPENCODE_GO_API_KEY / env / opencode login) or entered manually |
32
- | Coding plan quotas | Settings page | Multi-vendor coding-plan quota queries (Anthropic Claude Pro/Max, Z.ai / Zhipu GLM Coding Plan, MiniMax Token Plan, Kimi/Moonshot balance, OpenRouter credits, SiliconFlow balance); per-vendor enable switch and key, credentials only sent to official endpoints; neutral hints when no credentials/subscription; SCNet Token Plan has no quota API — monthly usage is estimated from the local ledger via the official credits deduction table (no credentials needed) |
32
+ | Coding plan quotas | Settings page | Multi-vendor coding-plan quota queries (Anthropic Claude Pro/Max, Z.ai / Zhipu GLM Coding Plan, MiniMax Token Plan, Kimi/Moonshot balance, OpenRouter credits, SiliconFlow balance, CommandCode 5h/weekly windows + monthly credits balance); per-vendor enable switch and key, credentials only sent to official endpoints; neutral hints when no credentials/subscription; SCNet Token Plan has no quota API — monthly usage is estimated from the local ledger via the official credits deduction table (no credentials needed) |
33
33
  | Today's cost | Sidebar bottom (above the settings button) | “Today ¥x”, hover for call count and token details |
34
34
  | Budget box | Sidebar bottom (between the balance row and the settings button) | Rounded-square frame: budget, used %, progress bar, today's cost & share of budget, used/limit; ≥80% warning, ≥100% over-budget |
35
35
  | Summary cards | Settings page | Today / this month / cumulative cost and call counts |
@@ -44,7 +44,7 @@ English | [中文](README.md)
44
44
  | Official price sync | Settings page | Fetches and parses the official pricing page, applies with one click |
45
45
  | UI language | Settings → Display settings | Simplified Chinese / English / Follow browser (auto); switches instantly and auto-saves |
46
46
  | AI price sync | [prompt](docs/AI-PRICE-SYNC-PROMPT.en.md) | DeepSeek official sync; other providers use the verified official price catalog and manual configuration |
47
- | Model & Plan adaptation guide | [adaptation doc](docs/model-and-plan-adaptation.en.md) | Adaptation matrix for per-model billing and the 7 Coding Plan vendors, the auto-matching mechanism and price sources ([中文](docs/model-and-plan-adaptation.md)) |
47
+ | Model & Plan adaptation guide | [adaptation doc](docs/model-and-plan-adaptation.en.md) | Adaptation matrix for per-model billing and the 8 Coding Plan vendors, the auto-matching mechanism and price sources ([中文](docs/model-and-plan-adaptation.md)) |
48
48
  | Peak/off-peak alert guide | [alert doc](docs/peak-alert.en.md) | Fully illustrated guide to the pre-switch popup and system notification: effect screenshots (EN/中文), settings reference and usage tips ([中文](docs/peak-alert.md)) |
49
49
  | Multi-provider billing | Settings / ledger | OpenAI, Anthropic, Google Gemini, Mistral and other providers with input/output, cache and reasoning-token pricing isolated by provider + model |
50
50
  | Model-name auto-matching | Settings / ledger | Unknown model ids are matched against the price table: case/spaces/hyphens/dots and bracket annotations (e.g. (go)) are ignored — a normalized-equal or containing name hits (e.g. `gpt5.6 luna(go)`); router providers (opencode/zen etc.) search across all vendors; can be restricted to exact match, and unmatched models can be pinned to a specific entry in Settings |
@@ -194,22 +194,22 @@ Real captures from an actual DSH sidebar of the period strip and collapsed verti
194
194
  dsh plugin --profile web add dsh-cost-meter
195
195
  ```
196
196
 
197
- **PowerShell one-click script** (copy the whole line, paste, press Enter; pnpm is provisioned automatically, git is auto-detected — no clone needed; the install chain is **pinned to the release tag `v1.5.23`** — review the script before running):
197
+ **PowerShell one-click script** (copy the whole line, paste, press Enter; pnpm is provisioned automatically, git is auto-detected — no clone needed; the install chain is **pinned to the release tag `v1.5.25`** — review the script before running):
198
198
 
199
199
  ```powershell
200
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.5.23/install.ps1 | iex
200
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.5.25/install.ps1 | iex
201
201
  ```
202
202
 
203
203
  **Or a plain command line** (the machine must already have pnpm and git; also pinned to the tag):
204
204
 
205
205
  ```sh
206
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.5.23
206
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.5.25
207
207
  ```
208
208
 
209
209
  Without git, use the GitHub tag archive:
210
210
 
211
211
  ```sh
212
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.5.23.tar.gz
212
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.5.25.tar.gz
213
213
  ```
214
214
 
215
215
  After installing, **restart** `dsh web` (plugin rows, the Typert manifest and the client bundle are all scanned at startup):
package/README.md CHANGED
@@ -4,9 +4,9 @@
4
4
 
5
5
  **DeepSeek Harness 会话费用统计插件(界面中英双语)**
6
6
 
7
- 本会话费用 · 当日费用 · OpenCode Go 订阅额度显示 · 预算与已用百分比 · 官方账户余额 · 自定义 Provider 余额查询(可配任意 HTTP 端点) · 余额三段进度条 · 历史记录 · 峰谷计价时段显示(UTC 01:00–04:00、06:00–10:00 为峰时段) · 峰/谷切换前弹窗与系统通知提醒(位置/提前量/提醒类型可配) · 官方价格一键同步 · 类 Codex Token 用量热图 · 多厂商多模型价格计费(内置 90+ 模型价格目录与自动匹配) · 主流 Coding Plan 额度查询与显示(Anthropic / Z.ai / MiniMax / Kimi / OpenRouter / SiliconFlow / SCNet 七家)
7
+ 本会话费用 · 当日费用 · OpenCode Go 订阅额度显示 · 预算与已用百分比 · 官方账户余额 · 自定义 Provider 余额查询(可配任意 HTTP 端点) · 余额三段进度条 · 历史记录 · 峰谷计价时段显示(UTC 01:00–04:00、06:00–10:00 为峰时段) · 峰/谷切换前弹窗与系统通知提醒(位置/提前量/提醒类型可配) · 官方价格一键同步 · 类 Codex Token 用量热图 · 多厂商多模型价格计费(内置 90+ 模型价格目录与自动匹配) · 主流 Coding Plan 额度查询与显示(Anthropic / Z.ai / MiniMax / Kimi / OpenRouter / SiliconFlow / CommandCode / SCNet 八家)
8
8
 
9
- [![version](https://img.shields.io/badge/version-1.5.23-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
9
+ [![version](https://img.shields.io/badge/version-1.5.25-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
10
10
  [![npm](https://img.shields.io/npm/v/dsh-cost-meter?label=npm)](https://www.npmjs.com/package/dsh-cost-meter)
11
11
  [![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
12
12
  [![dsh](https://img.shields.io/badge/DeepSeek%20Harness-dsh--plugin-4176E6)](https://github.com/deepseek-ai/deepseek-harness)
@@ -29,7 +29,7 @@
29
29
  | 官方余额 | 侧边栏顶部 / 设置页(可配) | 总余额 / 赠送 / 充值,自动刷新 + 手动刷新;可选三段进度条(蓝/橙/灰) |
30
30
  | 自定义 Provider 余额 | 侧边栏 / 设置页(可配) | 可配置 HTTP 查询任意 Provider 余额(LiteLLM 等);中/英名称、币种、extract 规则;与 Coding Plan 同区可折叠配置 |
31
31
  | OpenCode Go 额度 | 侧边栏 / 设置页 / 右下角(dock,可配) | 滚动 5 小时 / 本周 / 本月用量百分比与重置时间,三档可分别开关,可同时显示预算已用%;Key 自动发现(DSH 凭据库 OPENCODE_GO_API_KEY / 环境变量 / opencode 登录态)或手动填写 |
32
- | Coding Plan 额度 | 设置页 | 多厂商 coding plan 订阅额度查询(Anthropic Claude Pro/Max、Z.ai/智谱 GLM、MiniMax Token Plan、Kimi/Moonshot 余额、OpenRouter credits、SiliconFlow 余额),各家独立启用开关与 Key,凭据只发往官方端点;无凭据/无订阅为中性提示;SCNet 超算互联网 Token Plan 无 API 额度端点,按官方 Credits 抵扣表由本地账本估算月度用量(无需凭据) |
32
+ | Coding Plan 额度 | 设置页 | 多厂商 coding plan 订阅额度查询(Anthropic Claude Pro/Max、Z.ai/智谱 GLM、MiniMax Token Plan、Kimi/Moonshot 余额、OpenRouter credits、SiliconFlow 余额、CommandCode 5h/周窗口与月度 Credits 余额),各家独立启用开关与 Key,凭据只发往官方端点;无凭据/无订阅为中性提示;SCNet 超算互联网 Token Plan 无 API 额度端点,按官方 Credits 抵扣表由本地账本估算月度用量(无需凭据) |
33
33
  | 当日费用 | 侧边栏底部(设置按钮上方) | 「今日 ¥x」,悬停见调用次数与 token 明细 |
34
34
  | 预算图框 | 侧边栏底部(余额行与设置按钮之间) | 圆角方形图框:预算、已用%、进度条、今日费用与占预算%、已用/额度,≥80% 预警、≥100% 超支 |
35
35
  | 汇总卡片 | 设置页 | 今日 / 本月 / 累计费用与调用次数 |
@@ -45,7 +45,7 @@
45
45
  | 官方价格同步 | 设置页 | 抓取解析官方定价页,一键应用 |
46
46
  | 界面语言 | 设置页 → 显示设置 | 简体中文 / English / 跟随浏览器(自动);切换即时生效并自动保存 |
47
47
  | AI 价格同步 | [提示词](docs/AI-PRICE-SYNC-PROMPT.md) | DeepSeek 官方同步;其他 provider 使用已核对的官方价格目录与手动配置 |
48
- | 模型与 Plan 适配说明 | [适配文档](docs/model-and-plan-adaptation.md) | 各厂商模型计费与 7 家 Coding Plan 的适配矩阵、自动匹配机制与价格来源([English](docs/model-and-plan-adaptation.en.md)) |
48
+ | 模型与 Plan 适配说明 | [适配文档](docs/model-and-plan-adaptation.md) | 各厂商模型计费与 8 家 Coding Plan 的适配矩阵、自动匹配机制与价格来源([English](docs/model-and-plan-adaptation.en.md)) |
49
49
  | 峰/谷切换提醒图解 | [提醒文档](docs/peak-alert.md) | 峰谷切换前弹窗与系统通知的完整图解:效果截图(中/英)、设置项说明与使用建议([English](docs/peak-alert.en.md)) |
50
50
  | 多 provider 计费 | 设置页 / 账本 | 支持 OpenAI、Anthropic、Google Gemini、Mistral 等 provider 的 input/output、缓存与 reasoning token 价格,按 provider+model 隔离计费 |
51
51
  | 模型名自动匹配 | 设置页 / 账本 | 未知模型 id 自动匹配价格表:忽略大小写/空格/横杠/点号与括号附注,归一化等价或请求名包含表内模型名即命中(如 `gpt5.6 luna(go)`);路由 provider(opencode/zen 等)下跨厂商全库查找;可关闭为仅精确;未命中模型可手动指定计费条目 |
@@ -196,22 +196,22 @@
196
196
  dsh plugin --profile web add dsh-cost-meter
197
197
  ```
198
198
 
199
- **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.5.23`**,建议先下载审阅再运行):
199
+ **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.5.25`**,建议先下载审阅再运行):
200
200
 
201
201
  ```powershell
202
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.5.23/install.ps1 | iex
202
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.5.25/install.ps1 | iex
203
203
  ```
204
204
 
205
205
  **或直接命令行**(机器上需已有 pnpm 与 git;同样固定到 tag):
206
206
 
207
207
  ```sh
208
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.5.23
208
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.5.25
209
209
  ```
210
210
 
211
211
  没有 git 时可用 GitHub tag 打包直链:
212
212
 
213
213
  ```sh
214
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.5.23.tar.gz
214
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.5.25.tar.gz
215
215
  ```
216
216
 
217
217
  安装后**重启** `dsh web`(插件行、Typert 清单与客户端 bundle 均在启动时扫描):
package/lib/client.js CHANGED
@@ -518,6 +518,7 @@ window.__ModuleLoader__.load({
518
518
  codingPlanKimi: 'Kimi / Moonshot',
519
519
  codingPlanOpenrouter: 'OpenRouter',
520
520
  codingPlanSiliconflow: 'SiliconFlow 硅基流动',
521
+ codingPlanCommandcode: 'CommandCode',
521
522
  codingPlanScnet: 'SCNet 超算互联网 Token Plan',
522
523
  scnetPlanCreditsLabel: '月度 Credits 额度(基础 60,000 / 标准 240,000 / 高级 600,000)',
523
524
  scnetPlanStartLabel: '订阅起始日(可选,格式 YYYY-MM-DD;留空按自然月)',
@@ -849,6 +850,7 @@ window.__ModuleLoader__.load({
849
850
  codingPlanKimi: 'Kimi / Moonshot',
850
851
  codingPlanOpenrouter: 'OpenRouter',
851
852
  codingPlanSiliconflow: 'SiliconFlow',
853
+ codingPlanCommandcode: 'CommandCode',
852
854
  codingPlanScnet: 'SCNet Token Plan',
853
855
  scnetPlanCreditsLabel: 'Monthly credits quota (Basic 60,000 / Standard 240,000 / Pro 600,000)',
854
856
  scnetPlanStartLabel: 'Plan start date (optional, YYYY-MM-DD; empty = calendar month)',
@@ -3676,6 +3678,7 @@ window.__ModuleLoader__.load({
3676
3678
  { id: 'kimi', labelKey: 'codingPlanKimi' },
3677
3679
  { id: 'openrouter', labelKey: 'codingPlanOpenrouter' },
3678
3680
  { id: 'siliconflow', labelKey: 'codingPlanSiliconflow' },
3681
+ { id: 'commandcode', labelKey: 'codingPlanCommandcode' },
3679
3682
  { id: 'scnet', labelKey: 'codingPlanScnet' },
3680
3683
  ]
3681
3684
 
@@ -4154,7 +4157,7 @@ window.__ModuleLoader__.load({
4154
4157
  el('button', { className: 'cm-btn danger', onClick: doReset, disabled: busy }, t('confirmClear')),
4155
4158
  el('button', { className: 'cm-btn', onClick: () => setConfirmReset(false) }, t('cancel')))
4156
4159
  : el('button', { className: 'cm-btn danger', onClick: () => setConfirmReset(true), disabled: busy }, t('clearAllHistory'))),
4157
- el('p', { className: 'cm-note' }, t('legacyImportNote')))
4160
+ el('p', { className: 'cm-note' }, t('legacyImportNote'))))
4158
4161
  : null,
4159
4162
  // ── 显示:界面语言、徽章/侧边栏位置、图框开关等 ──
4160
4163
  tab === 'display' ? el(Fragment, { key: 'display' },
@@ -4514,7 +4517,7 @@ window.__ModuleLoader__.load({
4514
4517
  : el('button', { className: 'cm-btn', onClick: () => setConfirmFetch(true), disabled: busy }, t('syncFromDocs'))),
4515
4518
  el('p', { className: 'cm-note' },
4516
4519
  t('lastSync', { time: config.fetchedAt !== null ? new Date(config.fetchedAt).toLocaleString() : t('neverSynced') })
4517
- + t('source', { source: config.priceSource === 'official' ? t('sourceOfficial') : t('sourceBundled') })))
4520
+ + t('source', { source: config.priceSource === 'official' ? t('sourceOfficial') : t('sourceBundled') }))))
4518
4521
  : null)
4519
4522
  }
4520
4523
 
@@ -15,6 +15,8 @@
15
15
  * Kimi Code 订阅周窗/5小时窗暂无 API-Key 化公开端点(仅 kimi.com 控制台),以余额窗口接入;
16
16
  * - OpenRouter credits 端点 openrouter.ai/api/v1/credits 存活(401,官方文档明确);
17
17
  * - SiliconFlow 用户信息端点 api.siliconflow.cn/v1/user/info 存活(30014 Token is invalid);
18
+ * - CommandCode(commandcode.ai)billing credits 端点存活(401 unauthorized;issue #30):
19
+ * GET api.commandcode.ai/alpha/billing/credits,窗口(fiveHour/weekly)+ 月度 Credits 余额;
18
20
  * - SCNet(超算互联网)Token Plan 仅有 sk-tp- 专属推理端点(api.scnet.cn),额度用量只在控制台
19
21
  * 「模型服务 → Token Plan → 我的订阅/Token 用量」可见,无 API-Key 化查询端点——以本地
20
22
  * Credits 计量接入(官方抵扣表折算,见 SCNET_CREDIT_RATES;issue #26);
@@ -54,6 +56,11 @@ export const CODING_PLAN_PROVIDERS = {
54
56
  credentialEnvs: ['SILICONFLOW_API_KEY'],
55
57
  keyHint: 'SiliconFlow API Key(sk-*;显示账户余额)',
56
58
  },
59
+ commandcode: {
60
+ label: 'CommandCode',
61
+ credentialEnvs: ['COMMANDCODE_API_KEY'],
62
+ keyHint: 'commandcode.ai API Key(user_*;显示 5 小时/周窗口用量% 与月度 Credits 余额)',
63
+ },
57
64
  scnet: {
58
65
  label: 'SCNet 超算互联网 Token Plan',
59
66
  credentialEnvs: [],
@@ -348,6 +355,35 @@ export function parseSiliconFlowInfo(data) {
348
355
  return win === null ? null : { balance: win }
349
356
  }
350
357
 
358
+ /**
359
+ * 解析 CommandCode(commandcode.ai)额度响应(issue #30,
360
+ * GET https://api.commandcode.ai/alpha/billing/credits)。
361
+ * 官方返回 { credits: { monthlyCredits, ... }, windowLimits: { fiveHour: { used, cap, resetAt },
362
+ * weekly: {...} } }:窗口按 used/cap 输出已用%(resetAt 为 epoch 毫秒);月度 Credits 为
363
+ * 余额池(1 credit ≈ $1 用量,无总量字段),以文本窗口展示(与 Kimi/SiliconFlow 余额同形态)。
364
+ */
365
+ export function parseCommandCodeCredits(data) {
366
+ if (data === null || typeof data !== 'object') return null
367
+ const windows = {}
368
+ const limits = data.windowLimits
369
+ if (limits !== null && typeof limits === 'object' && !Array.isArray(limits)) {
370
+ for (const [name, raw] of Object.entries(limits)) {
371
+ if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) continue
372
+ const used = Number(raw.used)
373
+ const cap = Number(raw.cap)
374
+ if (!Number.isFinite(used) || !Number.isFinite(cap) || cap <= 0 || used < 0) continue
375
+ windows[name] = { percent: clampPct((used / cap) * 100), resetsAt: normalizeResetAt(raw.resetAt) }
376
+ }
377
+ }
378
+ const credits = data.credits
379
+ const monthly = Number(credits !== null && typeof credits === 'object' ? credits.monthlyCredits : undefined)
380
+ if (Number.isFinite(monthly) && monthly >= 0) {
381
+ const win = textWindowOf('余额 $' + (Math.round(monthly * 100) / 100).toFixed(2))
382
+ if (win !== null) windows.monthly = win
383
+ }
384
+ return Object.keys(windows).length > 0 ? windows : null
385
+ }
386
+
351
387
  // ── SCNet(超算互联网)Token Plan 本地 Credits 计量(issue #26)──────────────
352
388
  //
353
389
  // SCNet Token Plan 为 Credits 包月订阅(基础 60,000 / 标准 240,000 / 高级 600,000),
@@ -491,6 +527,7 @@ export const CODING_PLAN_ENDPOINTS = {
491
527
  kimi: ['https://api.moonshot.cn/v1/users/me/balance'],
492
528
  openrouter: ['https://openrouter.ai/api/v1/credits'],
493
529
  siliconflow: ['https://api.siliconflow.cn/v1/user/info'],
530
+ commandcode: ['https://api.commandcode.ai/alpha/billing/credits'],
494
531
  // SCNet 无 API-Key 化额度端点:本地 Credits 计量(见 scnetTokenPlanWindows),不走网络。
495
532
  scnet: [],
496
533
  }
@@ -502,6 +539,7 @@ const CODING_PLAN_PARSERS = {
502
539
  kimi: parseKimiBalance,
503
540
  openrouter: parseOpenRouterCredits,
504
541
  siliconflow: parseSiliconFlowInfo,
542
+ commandcode: parseCommandCodeCredits,
505
543
  }
506
544
 
507
545
  /**
package/lib/store.js CHANGED
@@ -73,6 +73,10 @@ export function defaultConfig() {
73
73
  anthropic: { enabled: false, display: 'settings', refreshMinutes: 15, apiKey: '' },
74
74
  zai: { enabled: false, display: 'settings', refreshMinutes: 15, apiKey: '' },
75
75
  minimax: { enabled: false, display: 'settings', refreshMinutes: 15, apiKey: '' },
76
+ kimi: { enabled: false, display: 'settings', refreshMinutes: 15, apiKey: '' },
77
+ openrouter: { enabled: false, display: 'settings', refreshMinutes: 15, apiKey: '' },
78
+ siliconflow: { enabled: false, display: 'settings', refreshMinutes: 15, apiKey: '' },
79
+ commandcode: { enabled: false, display: 'settings', refreshMinutes: 15, apiKey: '' },
76
80
  // SCNet Token Plan 无 API 额度端点:按官方 Credits 抵扣表本地估算(issue #26)。
77
81
  // planCredits=月度 Credits 额度;planStart=订阅起始日(空 = 自然月)。
78
82
  scnet: { enabled: false, display: 'settings', refreshMinutes: 15, apiKey: '', planCredits: 240000, planStart: '' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cost-meter",
3
- "version": "1.5.23",
3
+ "version": "1.5.25",
4
4
  "description": "DeepSeek Harness 会话费用统计插件:本会话成本、当日费用、历史记录与官方价格同步,支持多厂商多模型价格计费(内置 90+ 模型价格目录与自动匹配)、主流 Coding Plan 订阅额度查询与显示(7 家,含 SCNet Token Plan 本地 Credits 计量)、自定义 Provider 余额查询(可配任意 HTTP 端点)与余额进度条、峰谷计价时段显示与切换前弹窗/系统通知提醒(位置/提前量/类型可配),界面中英双语。Session cost tracking plugin for DeepSeek Harness: per-conversation cost, daily totals, history and official price sync, with multi-vendor model pricing (built-in 90+ model catalog with auto-matching), Coding Plan quota queries & display for 7 vendors (incl. local credits metering for the SCNet Token Plan), custom provider balance lookup (configurable HTTP endpoint) and balance progress bar, plus peak/off-peak pricing display with pre-switch popup & system-notification alerts (position / lead time / type configurable), in a bilingual (Chinese/English) UI.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",