dsh-cost-meter 1.9.3 → 1.9.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/lib/store.js CHANGED
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import { FX_FIELDS, frozenAmounts, frozenFields, addFrozen, freezeLegacyAmounts, fxRatesOf } from './exchange-rates.js'
9
+ import { normalizeModelStatistics, validModelStatistics } from './model-statistics.js'
9
10
  import { readFileSync, renameSync, statSync } from 'node:fs'
10
11
  import { randomUUID } from 'node:crypto'
11
12
  import { validRequestFee } from './web-request-pricing.js'
@@ -158,6 +159,7 @@ export function defaultConfig() {
158
159
  hideOfficialBalance: false, // 隐藏官方账户余额(issue #45):开启后侧边栏/会话页/设置页的官方余额 UI 整体不渲染
159
160
  hideBudget: false, // Hide the sidebar budget card without disabling budget tracking.
160
161
  hideTodayCost: false, // 隐藏今日消耗金额(issue #46):开启后侧栏今日费用行/预算明细今日行/概览今日卡片不渲染
162
+ modelStatistics: {}, // Per channel/model: today, monthly/all-time summaries and budgets.
161
163
  hideSessionCostHeader: false,
162
164
  hideSessionCostDock: false,
163
165
  hideTurnCost: false,
@@ -170,6 +172,7 @@ export function defaultConfig() {
170
172
  includeSubagentCost: false, // 本会话展示可合并连续子代理后代;不重复写入每日账本。
171
173
  codexQuotaEnabled: false, // Codex 额度按需开启,避免未使用 Codex 时显示卡片或查询。
172
174
  codexQuotaSidebar: true, // 独立控制侧栏卡片,保留会话额度条。
175
+ codexQuotaSource: 'auto', // Codex 额度数据源:auto 自动探测 | connect dsh-codex-connect | subscription dsh-codex-subscription。
173
176
  // dsh-codex-subscription 兼容:一次性历史归类提示是否已永久关闭 / 历史归类完成时刻 ms(0 = 未应用)。
174
177
  codexCompatPromptDismissed: false,
175
178
  codexCompatHistoryAppliedAt: 0,
@@ -178,7 +181,9 @@ export function defaultConfig() {
178
181
  sidebarModels: { enabled: false, period: 'today', topN: 5, summary: 'total', position: 'last', defaultOpen: false, remember: true, tokens: false, shares: true, refreshSeconds: 60, dock: false },
179
182
  sidebarStyle: 'standard', // 侧边栏进度条样式:standard(标准,纵向单列) | compact(紧凑,额度卡两列网格)
180
183
  legacyAutoImportedAt: 0, // 安装前历史自动导入标记(issue #27):完成时刻 ms;0 = 尚未跑过
181
- peakStyle: 'compact', // 峰谷时段条样式:compact(简洁单行/竖向同构) | classic(经典分段/胶囊芯片)
184
+ peakStyle: 'compact', // compact / classic 保留原样;progress 按侧栏布局显示时间进度。
185
+ peakTimeDisplay: 'both', // both / countdown / switch
186
+ peakProgressPromptSeen: false,
182
187
  priceMatch: 'auto', // 未知模型名自动匹配价格表:auto(归一化/安全后缀) | exact(仅精确)
183
188
  priceMatchDismissed: [], // 从匹配设置中移除的 provider:model 行;不删除用量或改变计价规则。
184
189
  priceOverrides: {}, // 手动匹配覆盖:{ 'provider:modelId': 'provider:模型 | deepseek:__default__' };裸模型名 = 同渠道换名(旧版遗留,跨渠道裸 DeepSeek 名由查价兜底自愈,issue #56)
@@ -788,12 +793,13 @@ const VALIDATION_MESSAGES = {
788
793
  includeSubagentCost: 'includeSubagentCost 必须是布尔值',
789
794
  codexQuotaEnabled: 'codexQuotaEnabled 必须是布尔值',
790
795
  codexQuotaSidebar: 'codexQuotaSidebar 必须是布尔值',
796
+ codexQuotaSource: 'codexQuotaSource 必须是 auto / connect / subscription',
791
797
  codexCompatPromptDismissed: 'codexCompatPromptDismissed 必须是布尔值',
792
798
  codexCompatHistoryAppliedAt: 'codexCompatHistoryAppliedAt 必须是非负数',
793
799
  sidebarSimple: '简化显示设置必须是布尔值',
794
800
  sidebarModels: '模型花费卡片设置无效:Top-N 为 1–10,刷新间隔为 10–60 秒',
795
801
  sidebarStyle: 'sidebarStyle 必须是 standard / compact',
796
- peakStyle: 'peakStyle 必须是 compact / classic',
802
+ peakStyle: 'peakStyle 必须是 compact / classic / progress',
797
803
  priceMatch: 'priceMatch 必须是 auto / exact',
798
804
  priceOverrides: 'priceOverrides 必须是字符串→字符串映射',
799
805
  priceMatchDismissed: 'priceMatchDismissed 必须是模型键字符串数组(最多 1000 项,每项 1–512 字符)',
@@ -897,12 +903,13 @@ const VALIDATION_MESSAGES = {
897
903
  includeSubagentCost: 'includeSubagentCost must be a boolean',
898
904
  codexQuotaEnabled: 'codexQuotaEnabled must be a boolean',
899
905
  codexQuotaSidebar: 'codexQuotaSidebar must be a boolean',
906
+ codexQuotaSource: 'codexQuotaSource must be auto / connect / subscription',
900
907
  codexCompatPromptDismissed: 'codexCompatPromptDismissed must be a boolean',
901
908
  codexCompatHistoryAppliedAt: 'codexCompatHistoryAppliedAt must be a non-negative number',
902
909
  sidebarSimple: 'Simple display settings must be boolean',
903
910
  sidebarModels: 'Invalid model cost card settings: Top-N must be 1–10 and refresh interval 10–60 seconds',
904
911
  sidebarStyle: 'sidebarStyle must be standard / compact',
905
- peakStyle: 'peakStyle must be compact / classic',
912
+ peakStyle: 'peakStyle must be compact / classic / progress',
906
913
  priceMatch: 'priceMatch must be auto / exact',
907
914
  priceOverrides: 'priceOverrides must be a string→string map',
908
915
  priceMatchDismissed: 'priceMatchDismissed must contain at most 1000 model keys of 1–512 characters',
@@ -1079,6 +1086,7 @@ export function applyConfigPatch(current, rawPatch) {
1079
1086
  const candidate = mergeDeep(structuredClone(current), patch)
1080
1087
  // 这两张编辑表随对应设置整表提交;逐键深合并会把用户移除的键补回来。
1081
1088
  if (Object.hasOwn(patch, 'priceOverrides')) candidate.priceOverrides = structuredClone(patch.priceOverrides)
1089
+ if (Object.hasOwn(patch, 'modelStatistics')) candidate.modelStatistics = structuredClone(patch.modelStatistics)
1082
1090
  const qwenPatch = patch.codingPlans?.qwen
1083
1091
  if (qwenPatch !== null && typeof qwenPatch === 'object' && !Array.isArray(qwenPatch) && Object.hasOwn(qwenPatch, 'rates')) {
1084
1092
  candidate.codingPlans.qwen.rates = structuredClone(qwenPatch.rates)
@@ -1209,6 +1217,7 @@ export function applyConfigPatch(current, rawPatch) {
1209
1217
  if (candidate.hideOfficialBalance !== undefined && typeof candidate.hideOfficialBalance !== 'boolean') errors.push(vmsg(locale, 'hideOfficialBalance'))
1210
1218
  if (candidate.hideBudget !== undefined && typeof candidate.hideBudget !== 'boolean') errors.push(vmsg(locale, 'hideBudget'))
1211
1219
  if (candidate.hideTodayCost !== undefined && typeof candidate.hideTodayCost !== 'boolean') errors.push(vmsg(locale, 'hideTodayCost'))
1220
+ if (!validModelStatistics(candidate.modelStatistics)) errors.push(locale === 'en' ? 'Invalid per-model statistics switches' : '模型统计开关无效')
1212
1221
  for (const key of ['hideSessionCostHeader', 'hideSessionCostDock', 'hideTurnCost']) {
1213
1222
  if (candidate[key] !== undefined && typeof candidate[key] !== 'boolean') errors.push(locale === 'en' ? `${key} must be a boolean` : `${key} 必须是布尔值`)
1214
1223
  }
@@ -1222,6 +1231,8 @@ export function applyConfigPatch(current, rawPatch) {
1222
1231
  for (const field of ['includeSubagentCost', 'codexQuotaEnabled', 'codexQuotaSidebar', 'codexCompatPromptDismissed']) {
1223
1232
  if (candidate[field] !== undefined && typeof candidate[field] !== 'boolean') errors.push(vmsg(locale, field))
1224
1233
  }
1234
+ // Codex 额度数据源:auto 自动探测(优先 subscription,失败回退 connect) | connect | subscription。
1235
+ if (candidate.codexQuotaSource !== undefined && !['auto', 'connect', 'subscription'].includes(candidate.codexQuotaSource)) errors.push(vmsg(locale, 'codexQuotaSource'))
1225
1236
  // dsh-codex-subscription 兼容:历史归类应用时刻为非负有限数(0 = 尚未应用)。
1226
1237
  if (candidate.codexCompatHistoryAppliedAt !== undefined
1227
1238
  && (typeof candidate.codexCompatHistoryAppliedAt !== 'number' || !Number.isFinite(candidate.codexCompatHistoryAppliedAt) || candidate.codexCompatHistoryAppliedAt < 0)) errors.push(vmsg(locale, 'codexCompatHistoryAppliedAt'))
@@ -1235,7 +1246,9 @@ export function applyConfigPatch(current, rawPatch) {
1235
1246
  || ['enabled', 'defaultOpen', 'remember', 'tokens', 'shares', 'dock'].some(k => typeof sm[k] !== 'boolean')
1236
1247
  || !['today', 'history'].includes(sm.period) || !['total', 'top'].includes(sm.summary) || !['first', 'afterBalance', 'last'].includes(sm.position)
1237
1248
  || !Number.isInteger(sm.topN) || sm.topN < 1 || sm.topN > 10 || !Number.isInteger(sm.refreshSeconds) || sm.refreshSeconds < 10 || sm.refreshSeconds > 60) errors.push(vmsg(locale, 'sidebarModels'))
1238
- if (candidate.peakStyle !== 'compact' && candidate.peakStyle !== 'classic') errors.push(vmsg(locale, 'peakStyle'))
1249
+ if (!['compact', 'classic', 'progress'].includes(candidate.peakStyle)) errors.push(vmsg(locale, 'peakStyle'))
1250
+ if (!['both', 'countdown', 'switch'].includes(candidate.peakTimeDisplay)) errors.push('peakTimeDisplay must be both / countdown / switch')
1251
+ if (typeof candidate.peakProgressPromptSeen !== 'boolean') errors.push('peakProgressPromptSeen must be boolean')
1239
1252
  if (candidate.priceMatch !== 'auto' && candidate.priceMatch !== 'exact') errors.push(vmsg(locale, 'priceMatch'))
1240
1253
  const overrides = candidate.priceOverrides
1241
1254
  if (candidate.priceMatchDismissed !== undefined && (!Array.isArray(candidate.priceMatchDismissed)
@@ -1566,7 +1579,8 @@ export function sanitizeConfig(raw) {
1566
1579
  // 枚举收敛。
1567
1580
  out.locale = oneOf(out.locale, ['auto', 'zh', 'en'], 'auto')
1568
1581
  out.position = oneOf(out.position, ['dock', 'header', 'off'], 'dock')
1569
- out.peakStyle = oneOf(out.peakStyle, ['compact', 'classic'], 'compact')
1582
+ out.peakStyle = oneOf(out.peakStyle, ['compact', 'classic', 'progress'], 'compact')
1583
+ out.peakTimeDisplay = oneOf(out.peakTimeDisplay, ['both', 'countdown', 'switch'], 'both')
1570
1584
  out.priceMatch = oneOf(out.priceMatch, ['auto', 'exact'], 'auto')
1571
1585
  // 官方价格币种与价表币种标记(issue #47):非法值回落 USD(价表缺省即 USD)。
1572
1586
  out.pricingCurrency = oneOf(out.pricingCurrency, ['USD', 'CNY'], 'USD')
@@ -1580,6 +1594,7 @@ export function sanitizeConfig(raw) {
1580
1594
  out.hideOfficialBalance = out.hideOfficialBalance === true
1581
1595
  out.hideBudget = out.hideBudget === true
1582
1596
  out.hideTodayCost = out.hideTodayCost === true
1597
+ out.modelStatistics = normalizeModelStatistics(out.modelStatistics)
1583
1598
  for (const key of ['hideSessionCostHeader', 'hideSessionCostDock', 'hideTurnCost']) out[key] = out[key] === true
1584
1599
  out.sessionCostCompact = out.sessionCostCompact === true
1585
1600
  out.contextCostsEnabled = out.contextCostsEnabled === true
@@ -1590,6 +1605,7 @@ export function sanitizeConfig(raw) {
1590
1605
  out.includeSubagentCost = out.includeSubagentCost === true
1591
1606
  out.codexQuotaEnabled = out.codexQuotaEnabled === true
1592
1607
  out.codexQuotaSidebar = out.codexQuotaSidebar !== false
1608
+ out.codexQuotaSource = oneOf(out.codexQuotaSource, ['auto', 'connect', 'subscription'], 'auto')
1593
1609
  // dsh-codex-subscription 兼容:提示关闭标记收敛为布尔;历史归类完成时刻非法/非正一律归 0。
1594
1610
  out.codexCompatPromptDismissed = out.codexCompatPromptDismissed === true
1595
1611
  out.codexCompatHistoryAppliedAt = Number.isFinite(out.codexCompatHistoryAppliedAt) && out.codexCompatHistoryAppliedAt > 0 ? out.codexCompatHistoryAppliedAt : 0
@@ -1862,6 +1878,7 @@ export function sanitizeConfig(raw) {
1862
1878
  const SECRET_REF_MAP = {
1863
1879
  balance: 'DEEPSEEK_BALANCE_API_KEY',
1864
1880
  goQuota: 'OPENCODE_GO_API_KEY',
1881
+ 'codingPlans.opendesign': 'OPENDESIGN_CONTROL_KEY',
1865
1882
  'codingPlans.anthropic': 'ANTHROPIC_OAUTH_TOKEN',
1866
1883
  'codingPlans.zai': 'ZAI_API_KEY',
1867
1884
  'codingPlans.minimax': 'MINIMAX_API_KEY',
@@ -236,6 +236,7 @@ const configSchema = z.object({
236
236
  hideOfficialBalance: z.boolean().optional(),
237
237
  hideBudget: z.boolean().optional(),
238
238
  hideTodayCost: z.boolean().optional(),
239
+ modelStatistics: z.record(z.string(), z.object({ today: z.boolean().optional(), summary: z.boolean().optional(), budget: z.boolean().optional() }).strict()).optional(),
239
240
  hideSessionCostHeader: z.boolean().optional(),
240
241
  hideSessionCostDock: z.boolean().optional(),
241
242
  hideTurnCost: z.boolean().optional(),
@@ -249,6 +250,7 @@ const configSchema = z.object({
249
250
  includeSubagentCost: z.boolean().optional(),
250
251
  codexQuotaEnabled: z.boolean().optional(),
251
252
  codexQuotaSidebar: z.boolean().optional(),
253
+ codexQuotaSource: z.enum(['auto', 'connect', 'subscription']).optional(),
252
254
  // dsh-codex-subscription 兼容:一次性历史归类提示是否永久关闭 / 历史归类完成时刻 ms(0 = 未应用)。
253
255
  codexCompatPromptDismissed: z.boolean().optional(),
254
256
  codexCompatHistoryAppliedAt: num.optional(),
@@ -259,7 +261,9 @@ const configSchema = z.object({
259
261
  priceMatchDismissed: z.array(z.string()).optional(),
260
262
  // 安装前历史自动导入完成时刻(issue #27,内部标记;0/缺席 = 尚未跑过)。
261
263
  legacyAutoImportedAt: num.optional(),
262
- peakStyle: z.enum(['compact', 'classic']).optional(),
264
+ peakStyle: z.enum(['compact', 'classic', 'progress']).optional(),
265
+ peakTimeDisplay: z.enum(['both', 'countdown', 'switch']).optional(),
266
+ peakProgressPromptSeen: z.boolean().optional(),
263
267
  priceMatch: z.enum(['auto', 'exact']).optional(),
264
268
  priceOverrides: z.record(z.string(), z.string()).optional(),
265
269
  priceTableDisplay: z.record(z.string(), z.boolean()).optional(),
@@ -596,6 +600,7 @@ export const stateSchema = z.object({
596
600
  // strict codec 会丢弃未声明字段,故必须显式声明整棵状态树。
597
601
  codexCompat: z.object({
598
602
  installed: z.boolean(),
603
+ enabled: z.boolean().optional(),
599
604
  version: z.string(),
600
605
  detection: z.enum(['package', 'profile', 'none']),
601
606
  planClass: z.enum(['auto', 'plan', 'api']),
package/package.json CHANGED
@@ -1,193 +1,194 @@
1
- {
2
- "name": "dsh-cost-meter",
3
- "version": "1.9.3",
4
- "description": "DeepSeek Harness 会话费用统计插件:本会话成本、当日费用、历史记录与官方价格同步,支持多厂商多模型价格计费(内置 170+ 模型 ID 价格目录与自动匹配)、主流 Coding Plan 订阅额度查询与显示(13 家,含 OpenDesign 工作区查询、含小米 MiMo Token Plan 控制台 Cookie 查询、SCNet Token Plan 本地 Credits 计量与火山方舟 Volcano Ark Coding Plan AK/SK 签名查询)、自定义 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 170+ model-ID catalog with auto-matching), Coding Plan quota queries & display for 13 vendors (incl. OpenDesign workspace queries, Xiaomi MiMo Token Plan via console cookie, local credits metering for the SCNet Token Plan and Volcano Ark Coding Plan via AK/SK signature), plan/API dual-track billing with per-1% & full-window Token Plan usage estimates, 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
- "type": "module",
6
- "main": "lib/bootstrap.js",
7
- "bin": {
8
- "dsh-cost-meter-repair-sessions": "./lib/repair-sessions-cli.js"
9
- },
10
- "exports": {
11
- ".": {
12
- "default": "./lib/bootstrap.js"
13
- },
14
- "./client": {
15
- "default": "./lib/client.js"
16
- },
17
- "./typert": {
18
- "default": "./lib/typert.host.js"
19
- },
20
- "./package.json": "./package.json",
21
- "./locale/*.json": "./locale/*.json"
22
- },
23
- "dsh": {
24
- "bundle": {
25
- "patch": "./cordis.patch.yml"
26
- },
27
- "client": {
28
- "platform": "web"
29
- },
30
- "compatibility": {
31
- "dsh": ">=0.2.0-rc.1 <0.3.0-0",
32
- "dshReleases": {
33
- "0.2.0-rc.1": "compatible",
34
- "0.2.0-rc.2": "compatible",
35
- "0.2.1-alpha.5": "compatible",
36
- "0.2.1-rc.1": "compatible",
37
- "0.2.1-rc.2": "compatible"
38
- }
39
- }
40
- },
41
- "dshhub": {
42
- "schemaVersion": 1,
43
- "displayName": "dsh-cost-meter",
44
- "summary": "DeepSeek Harness 会话费用统计:本会话费用、预算图框、官方余额、自定义 Provider 余额查询、Coding Plan 额度查询、历史记录,支持峰谷计价(切换前弹窗与系统通知提醒)与官方价格一键同步。",
45
- "categories": [
46
- "费用",
47
- "Web UI",
48
- "观测"
49
- ],
50
- "surfaces": [
51
- "host",
52
- "web"
53
- ],
54
- "capabilities": {
55
- "provides": [
56
- "service:cost-meter"
57
- ]
58
- },
59
- "compatibility": {
60
- "dsh": ">=0.2.0-rc.1 <0.3.0-0",
61
- "node": ">=20"
62
- },
63
- "permissions": {
64
- "network": [
65
- "https://api.deepseek.com",
66
- "https://api-docs.deepseek.com",
67
- "https://open.volcengineapi.com",
68
- "https://ark.cn-beijing.volces.com",
69
- "https://opencode.ai",
70
- "https://api.anthropic.com",
71
- "https://api.z.ai",
72
- "https://open.bigmodel.cn",
73
- "https://www.minimaxi.com",
74
- "https://www.minimax.cn",
75
- "https://www.minimax.io",
76
- "https://api.kimi.com",
77
- "https://api.moonshot.cn",
78
- "https://openrouter.ai",
79
- "https://api.siliconflow.cn",
80
- "https://api.commandcode.ai",
81
- "https://api.factory.ai",
82
- "https://ax.ac.sugon.com",
83
- "https://platform.qianwenai.com",
84
- "https://platform-home.qianwenai.com",
85
- "https://business.aliyuncs.com",
86
- "https://tokenrhythm.studio",
87
- "https://platform.xiaomimimo.com",
88
- "https://amr-api.open-design.ai",
89
- "https://api.frankfurter.dev"
90
- ]
91
- }
92
- },
93
- "files": [
94
- "docs/web-request-fees.md",
95
- "locale",
96
- "lib",
97
- "cordis.patch.yml",
98
- "docs/provider-pricing.json",
99
- "docs/billing-statistics.md",
100
- "docs/billion-context-billing.md",
101
- "docs/opendesign-billing.md",
102
- "docs/custom-balance-sources.md",
103
- "docs/performance-2026-10-18.md",
104
- "docs/performance-2026-10-18.json",
105
- "docs/update-notes-2026-10-15.md",
106
- "docs/ledger-lock-recovery.md",
107
- "docs/external-usage.md",
108
- "docs/qwen-cli-quota.md",
109
- "docs/factory-quota.md",
110
- "docs/session-sidebar-recovery.md",
111
- "docs/provider-pricing-2026-10.md",
112
- "docs/openrouter-prices.md",
113
- "docs/context-costs-design.md",
114
- "docs/context-costs-preview.png",
115
- "docs/cost-share-overview.png",
116
- "docs/call-detail-preview.png",
117
- "docs/step-billing-preview.png",
118
- "docs/maintenance-review-2026-10-10.md",
119
- "THIRD_PARTY_NOTICES.md",
120
- "docs/display-settings.md",
121
- "docs/update-notes-1.8.28.md",
122
- "docs/update-notes-1.8.29.md",
123
- "docs/context-stream-diagnostics.md",
124
- "docs/exchange-rates.md",
125
- "docs/update-notes-1.8.30.md",
126
- "docs/idle-performance.md",
127
- "docs/pricing-history-storage.md",
128
- "docs/custom-model-prices.md",
129
- "docs/update-notes-1.8.31.md",
130
- "docs/update-notes-1.8.32.md",
131
- "docs/update-notes-1.8.33.md",
132
- "docs/update-notes-1.8.34.md",
133
- "docs/update-notes-1.8.35.md",
134
- "docs/update-notes-1.8.36.md",
135
- "docs/update-notes-1.9.0.md",
136
- "docs/update-notes-1.9.1.md",
137
- "docs/update-notes-1.9.2.md",
138
- "docs/better-session.md",
139
- "docs/model-history-repricing.md",
140
- "docs/tokenrhythm-balance.md",
141
- "docs/dsh-0.2.1-compatibility.md",
142
- "docs/pnpm-supply-chain-policy.md",
143
- "docs/update-notes-1.9.3.md"
144
- ],
145
- "dependencies": {
146
- "acorn": "8.15.0",
147
- "zod": "4.6.5"
148
- },
149
- "peerDependencies": {
150
- "@deepseek-ai/dsh-credentials": ">=0.2.0-rc.1 <0.3.0-0 || >=0.2.1-0 <0.3.0-0",
151
- "@deepseek-ai/dsh-home-paths": ">=0.2.0-rc.1 <0.3.0-0 || >=0.2.1-0 <0.3.0-0"
152
- },
153
- "repository": {
154
- "type": "git",
155
- "url": "git+https://github.com/Han-1413141/dsh-cost-meter.git"
156
- },
157
- "homepage": "https://github.com/Han-1413141/dsh-cost-meter#readme",
158
- "keywords": [
159
- "deepseek",
160
- "deepseek-harness",
161
- "dsh",
162
- "dsh-plugin",
163
- "client-plugin",
164
- "cost",
165
- "usage",
166
- "billing",
167
- "budget",
168
- "i18n",
169
- "bilingual",
170
- "zh",
171
- "en",
172
- "language"
173
- ],
174
- "license": "MIT",
175
- "engines": {
176
- "node": ">=20",
177
- "dsh": ">=0.2.0-rc.1 <0.3.0-0"
178
- },
179
- "os": [
180
- "darwin",
181
- "linux",
182
- "win32"
183
- ],
184
- "scripts": {
185
- "build": "node scripts/build.mjs",
186
- "test": "node test/verify.mjs"
187
- },
188
- "devDependencies": {
189
- "@deepseek-ai/dsh-credentials": "0.2.1-rc.1",
190
- "@deepseek-ai/dsh-home-paths": "0.2.1-rc.1",
191
- "esbuild": "^0.28.2"
192
- }
193
- }
1
+ {
2
+ "name": "dsh-cost-meter",
3
+ "version": "1.9.4",
4
+ "description": "DeepSeek Harness 会话费用统计插件:本会话成本、当日费用、历史记录与官方价格同步,支持多厂商多模型价格计费(内置 170+ 模型 ID 价格目录与自动匹配)、主流 Coding Plan 订阅额度查询与显示(13 家,含 OpenDesign 工作区查询、含小米 MiMo Token Plan 控制台 Cookie 查询、SCNet Token Plan 本地 Credits 计量与火山方舟 Volcano Ark Coding Plan AK/SK 签名查询)、自定义 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 170+ model-ID catalog with auto-matching), Coding Plan quota queries & display for 13 vendors (incl. OpenDesign workspace queries, Xiaomi MiMo Token Plan via console cookie, local credits metering for the SCNet Token Plan and Volcano Ark Coding Plan via AK/SK signature), plan/API dual-track billing with per-1% & full-window Token Plan usage estimates, 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
+ "type": "module",
6
+ "main": "lib/bootstrap.js",
7
+ "bin": {
8
+ "dsh-cost-meter-repair-sessions": "./lib/repair-sessions-cli.js"
9
+ },
10
+ "exports": {
11
+ ".": {
12
+ "default": "./lib/bootstrap.js"
13
+ },
14
+ "./client": {
15
+ "default": "./lib/client.js"
16
+ },
17
+ "./typert": {
18
+ "default": "./lib/typert.host.js"
19
+ },
20
+ "./package.json": "./package.json",
21
+ "./locale/*.json": "./locale/*.json"
22
+ },
23
+ "dsh": {
24
+ "bundle": {
25
+ "patch": "./cordis.patch.yml"
26
+ },
27
+ "client": {
28
+ "platform": "web"
29
+ },
30
+ "compatibility": {
31
+ "dsh": ">=0.2.0-rc.1 <0.3.0-0",
32
+ "dshReleases": {
33
+ "0.2.0-rc.1": "compatible",
34
+ "0.2.0-rc.2": "compatible",
35
+ "0.2.1-alpha.5": "compatible",
36
+ "0.2.1-rc.1": "compatible",
37
+ "0.2.1-rc.2": "compatible"
38
+ }
39
+ }
40
+ },
41
+ "dshhub": {
42
+ "schemaVersion": 1,
43
+ "displayName": "dsh-cost-meter",
44
+ "summary": "DeepSeek Harness 会话费用统计:本会话费用、预算图框、官方余额、自定义 Provider 余额查询、Coding Plan 额度查询、历史记录,支持峰谷计价(切换前弹窗与系统通知提醒)与官方价格一键同步。",
45
+ "categories": [
46
+ "费用",
47
+ "Web UI",
48
+ "观测"
49
+ ],
50
+ "surfaces": [
51
+ "host",
52
+ "web"
53
+ ],
54
+ "capabilities": {
55
+ "provides": [
56
+ "service:cost-meter"
57
+ ]
58
+ },
59
+ "compatibility": {
60
+ "dsh": ">=0.2.0-rc.1 <0.3.0-0",
61
+ "node": ">=20"
62
+ },
63
+ "permissions": {
64
+ "network": [
65
+ "https://api.deepseek.com",
66
+ "https://api-docs.deepseek.com",
67
+ "https://open.volcengineapi.com",
68
+ "https://ark.cn-beijing.volces.com",
69
+ "https://opencode.ai",
70
+ "https://api.anthropic.com",
71
+ "https://api.z.ai",
72
+ "https://open.bigmodel.cn",
73
+ "https://www.minimaxi.com",
74
+ "https://www.minimax.cn",
75
+ "https://www.minimax.io",
76
+ "https://api.kimi.com",
77
+ "https://api.moonshot.cn",
78
+ "https://openrouter.ai",
79
+ "https://api.siliconflow.cn",
80
+ "https://api.commandcode.ai",
81
+ "https://api.factory.ai",
82
+ "https://ax.ac.sugon.com",
83
+ "https://platform.qianwenai.com",
84
+ "https://platform-home.qianwenai.com",
85
+ "https://business.aliyuncs.com",
86
+ "https://tokenrhythm.studio",
87
+ "https://platform.xiaomimimo.com",
88
+ "https://amr-api.open-design.ai",
89
+ "https://api.frankfurter.dev"
90
+ ]
91
+ }
92
+ },
93
+ "files": [
94
+ "docs/web-request-fees.md",
95
+ "locale",
96
+ "lib",
97
+ "cordis.patch.yml",
98
+ "docs/provider-pricing.json",
99
+ "docs/billing-statistics.md",
100
+ "docs/billion-context-billing.md",
101
+ "docs/opendesign-billing.md",
102
+ "docs/custom-balance-sources.md",
103
+ "docs/performance-2026-10-18.md",
104
+ "docs/performance-2026-10-18.json",
105
+ "docs/update-notes-2026-10-15.md",
106
+ "docs/ledger-lock-recovery.md",
107
+ "docs/external-usage.md",
108
+ "docs/qwen-cli-quota.md",
109
+ "docs/factory-quota.md",
110
+ "docs/session-sidebar-recovery.md",
111
+ "docs/provider-pricing-2026-10.md",
112
+ "docs/openrouter-prices.md",
113
+ "docs/context-costs-design.md",
114
+ "docs/context-costs-preview.png",
115
+ "docs/cost-share-overview.png",
116
+ "docs/call-detail-preview.png",
117
+ "docs/step-billing-preview.png",
118
+ "docs/maintenance-review-2026-10-10.md",
119
+ "THIRD_PARTY_NOTICES.md",
120
+ "docs/display-settings.md",
121
+ "docs/update-notes-1.8.28.md",
122
+ "docs/update-notes-1.8.29.md",
123
+ "docs/context-stream-diagnostics.md",
124
+ "docs/exchange-rates.md",
125
+ "docs/update-notes-1.8.30.md",
126
+ "docs/idle-performance.md",
127
+ "docs/pricing-history-storage.md",
128
+ "docs/custom-model-prices.md",
129
+ "docs/update-notes-1.8.31.md",
130
+ "docs/update-notes-1.8.32.md",
131
+ "docs/update-notes-1.8.33.md",
132
+ "docs/update-notes-1.8.34.md",
133
+ "docs/update-notes-1.8.35.md",
134
+ "docs/update-notes-1.8.36.md",
135
+ "docs/update-notes-1.9.0.md",
136
+ "docs/update-notes-1.9.1.md",
137
+ "docs/update-notes-1.9.2.md",
138
+ "docs/better-session.md",
139
+ "docs/model-history-repricing.md",
140
+ "docs/tokenrhythm-balance.md",
141
+ "docs/dsh-0.2.1-compatibility.md",
142
+ "docs/pnpm-supply-chain-policy.md",
143
+ "docs/update-notes-1.9.3.md",
144
+ "docs/update-notes-1.9.4.md"
145
+ ],
146
+ "dependencies": {
147
+ "acorn": "8.15.0",
148
+ "zod": "4.6.5"
149
+ },
150
+ "peerDependencies": {
151
+ "@deepseek-ai/dsh-credentials": ">=0.2.0-rc.1 <0.3.0-0 || >=0.2.1-0 <0.3.0-0",
152
+ "@deepseek-ai/dsh-home-paths": ">=0.2.0-rc.1 <0.3.0-0 || >=0.2.1-0 <0.3.0-0"
153
+ },
154
+ "repository": {
155
+ "type": "git",
156
+ "url": "git+https://github.com/Han-1413141/dsh-cost-meter.git"
157
+ },
158
+ "homepage": "https://github.com/Han-1413141/dsh-cost-meter#readme",
159
+ "keywords": [
160
+ "deepseek",
161
+ "deepseek-harness",
162
+ "dsh",
163
+ "dsh-plugin",
164
+ "client-plugin",
165
+ "cost",
166
+ "usage",
167
+ "billing",
168
+ "budget",
169
+ "i18n",
170
+ "bilingual",
171
+ "zh",
172
+ "en",
173
+ "language"
174
+ ],
175
+ "license": "MIT",
176
+ "engines": {
177
+ "node": ">=20",
178
+ "dsh": ">=0.2.0-rc.1 <0.3.0-0"
179
+ },
180
+ "os": [
181
+ "darwin",
182
+ "linux",
183
+ "win32"
184
+ ],
185
+ "scripts": {
186
+ "build": "node scripts/build.mjs",
187
+ "test": "node test/verify.mjs"
188
+ },
189
+ "devDependencies": {
190
+ "@deepseek-ai/dsh-credentials": "0.2.1-rc.1",
191
+ "@deepseek-ai/dsh-home-paths": "0.2.1-rc.1",
192
+ "esbuild": "^0.28.2"
193
+ }
194
+ }