dsh-cost-meter 1.9.13 → 1.9.14

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
@@ -175,7 +175,7 @@ export function defaultConfig() {
175
175
  codexQuotaEnabled: false, // Codex 额度按需开启,避免未使用 Codex 时显示卡片或查询。
176
176
  codexQuotaSidebar: true, // 独立控制侧栏卡片,保留会话额度条。
177
177
  codexQuotaStrip: true, // 独立控制输入区额度条,旧配置保留原显示。
178
- codexQuotaSource: 'auto', // Codex 额度数据源:auto 自动探测 | connect dsh-codex-connect | subscription dsh-codex-subscription。
178
+ codexQuotaSource: 'auto', // Codex 额度数据源:auto | connect | subscription | chatgpt。
179
179
  // dsh-codex-subscription 兼容:一次性历史归类提示是否已永久关闭 / 历史归类完成时刻 ms(0 = 未应用)。
180
180
  codexCompatPromptDismissed: false,
181
181
  codexCompatHistoryAppliedAt: 0,
@@ -797,7 +797,7 @@ const VALIDATION_MESSAGES = {
797
797
  codexQuotaEnabled: 'codexQuotaEnabled 必须是布尔值',
798
798
  codexQuotaSidebar: 'codexQuotaSidebar 必须是布尔值',
799
799
  codexQuotaStrip: 'codexQuotaStrip 必须是布尔值',
800
- codexQuotaSource: 'codexQuotaSource 必须是 auto / connect / subscription',
800
+ codexQuotaSource: 'codexQuotaSource 必须是 auto / connect / subscription / chatgpt',
801
801
  codexCompatPromptDismissed: 'codexCompatPromptDismissed 必须是布尔值',
802
802
  codexCompatHistoryAppliedAt: 'codexCompatHistoryAppliedAt 必须是非负数',
803
803
  sidebarSimple: '简化显示设置必须是布尔值',
@@ -908,7 +908,7 @@ const VALIDATION_MESSAGES = {
908
908
  codexQuotaEnabled: 'codexQuotaEnabled must be a boolean',
909
909
  codexQuotaSidebar: 'codexQuotaSidebar must be a boolean',
910
910
  codexQuotaStrip: 'codexQuotaStrip must be a boolean',
911
- codexQuotaSource: 'codexQuotaSource must be auto / connect / subscription',
911
+ codexQuotaSource: 'codexQuotaSource must be auto / connect / subscription / chatgpt',
912
912
  codexCompatPromptDismissed: 'codexCompatPromptDismissed must be a boolean',
913
913
  codexCompatHistoryAppliedAt: 'codexCompatHistoryAppliedAt must be a non-negative number',
914
914
  sidebarSimple: 'Simple display settings must be boolean',
@@ -1238,8 +1238,8 @@ export function applyConfigPatch(current, rawPatch) {
1238
1238
  for (const field of ['includeSubagentCost', 'codexQuotaEnabled', 'codexQuotaSidebar', 'codexQuotaStrip', 'codexCompatPromptDismissed']) {
1239
1239
  if (candidate[field] !== undefined && typeof candidate[field] !== 'boolean') errors.push(vmsg(locale, field))
1240
1240
  }
1241
- // Codex 额度数据源:auto 自动探测(优先 subscription,失败回退 connect) | connect | subscription。
1242
- if (candidate.codexQuotaSource !== undefined && !['auto', 'connect', 'subscription'].includes(candidate.codexQuotaSource)) errors.push(vmsg(locale, 'codexQuotaSource'))
1241
+ // Codex 额度数据源:auto 依次探测 subscription、chatgpt、connect,或固定一种来源。
1242
+ if (candidate.codexQuotaSource !== undefined && !['auto', 'connect', 'subscription', 'chatgpt'].includes(candidate.codexQuotaSource)) errors.push(vmsg(locale, 'codexQuotaSource'))
1243
1243
  // dsh-codex-subscription 兼容:历史归类应用时刻为非负有限数(0 = 尚未应用)。
1244
1244
  if (candidate.codexCompatHistoryAppliedAt !== undefined
1245
1245
  && (typeof candidate.codexCompatHistoryAppliedAt !== 'number' || !Number.isFinite(candidate.codexCompatHistoryAppliedAt) || candidate.codexCompatHistoryAppliedAt < 0)) errors.push(vmsg(locale, 'codexCompatHistoryAppliedAt'))
@@ -1617,7 +1617,7 @@ export function sanitizeConfig(raw) {
1617
1617
  out.codexQuotaEnabled = out.codexQuotaEnabled === true
1618
1618
  out.codexQuotaSidebar = out.codexQuotaSidebar !== false
1619
1619
  out.codexQuotaStrip = out.codexQuotaStrip !== false
1620
- out.codexQuotaSource = oneOf(out.codexQuotaSource, ['auto', 'connect', 'subscription'], 'auto')
1620
+ out.codexQuotaSource = oneOf(out.codexQuotaSource, ['auto', 'connect', 'subscription', 'chatgpt'], 'auto')
1621
1621
  // dsh-codex-subscription 兼容:提示关闭标记收敛为布尔;历史归类完成时刻非法/非正一律归 0。
1622
1622
  out.codexCompatPromptDismissed = out.codexCompatPromptDismissed === true
1623
1623
  out.codexCompatHistoryAppliedAt = Number.isFinite(out.codexCompatHistoryAppliedAt) && out.codexCompatHistoryAppliedAt > 0 ? out.codexCompatHistoryAppliedAt : 0
@@ -253,7 +253,7 @@ const configSchema = z.object({
253
253
  codexQuotaEnabled: z.boolean().optional(),
254
254
  codexQuotaSidebar: z.boolean().optional(),
255
255
  codexQuotaStrip: z.boolean().optional(),
256
- codexQuotaSource: z.enum(['auto', 'connect', 'subscription']).optional(),
256
+ codexQuotaSource: z.enum(['auto', 'connect', 'subscription', 'chatgpt']).optional(),
257
257
  // dsh-codex-subscription 兼容:一次性历史归类提示是否永久关闭 / 历史归类完成时刻 ms(0 = 未应用)。
258
258
  codexCompatPromptDismissed: z.boolean().optional(),
259
259
  codexCompatHistoryAppliedAt: num.optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cost-meter",
3
- "version": "1.9.13",
3
+ "version": "1.9.14",
4
4
  "description": "DeepSeek Harness 会话费用统计插件:本会话成本、当日费用、历史记录与官方价格同步,支持多厂商多模型价格计费(内置 170+ 模型 ID 价格目录与自动匹配)、主流 Coding Plan 订阅额度查询与显示(14 家,含 WorkBuddy 官方积分、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 14 vendors (incl. WorkBuddy official credits, 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
5
  "type": "module",
6
6
  "main": "lib/bootstrap.js",
@@ -153,7 +153,8 @@
153
153
  "docs/update-notes-1.9.10.md",
154
154
  "docs/update-notes-1.9.11.md",
155
155
  "docs/update-notes-1.9.12.md",
156
- "docs/update-notes-1.9.13.md"
156
+ "docs/update-notes-1.9.13.md",
157
+ "docs/update-notes-1.9.14.md"
157
158
  ],
158
159
  "dependencies": {
159
160
  "acorn": "8.15.0",