dsh-cost-meter 1.7.48 → 1.7.49

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
@@ -143,6 +143,7 @@ export function defaultConfig() {
143
143
  showTotalWithPlan: false, // 「含 Plan 总额」全局开关(v1.6.0):开启后全部金额展示按总等值(cost)计;默认按真金白银(apiCost)
144
144
  includeSubagentCost: false, // 本会话展示可合并连续子代理后代;不重复写入每日账本。
145
145
  codexQuotaEnabled: false, // Codex 额度按需开启,避免未使用 Codex 时显示卡片或查询。
146
+ codexQuotaSidebar: true, // 独立控制侧栏卡片,保留会话额度条。
146
147
  sidebarSimple: false,
147
148
  sidebarSimplePromptSeen: false,
148
149
  sidebarModels: { enabled: false, period: 'today', topN: 5, summary: 'total', position: 'last', defaultOpen: false, remember: true, tokens: false, shares: true, refreshSeconds: 60, dock: false },
@@ -740,6 +741,7 @@ const VALIDATION_MESSAGES = {
740
741
  showTotalWithPlan: 'showTotalWithPlan 必须是布尔值',
741
742
  includeSubagentCost: 'includeSubagentCost 必须是布尔值',
742
743
  codexQuotaEnabled: 'codexQuotaEnabled 必须是布尔值',
744
+ codexQuotaSidebar: 'codexQuotaSidebar 必须是布尔值',
743
745
  sidebarSimple: '简化显示设置必须是布尔值',
744
746
  sidebarModels: '模型花费卡片设置无效:Top-N 为 1–10,刷新间隔为 10–60 秒',
745
747
  sidebarStyle: 'sidebarStyle 必须是 standard / compact',
@@ -844,6 +846,7 @@ const VALIDATION_MESSAGES = {
844
846
  showTotalWithPlan: 'showTotalWithPlan must be a boolean',
845
847
  includeSubagentCost: 'includeSubagentCost must be a boolean',
846
848
  codexQuotaEnabled: 'codexQuotaEnabled must be a boolean',
849
+ codexQuotaSidebar: 'codexQuotaSidebar must be a boolean',
847
850
  sidebarSimple: 'Simple display settings must be boolean',
848
851
  sidebarModels: 'Invalid model cost card settings: Top-N must be 1–10 and refresh interval 10–60 seconds',
849
852
  sidebarStyle: 'sidebarStyle must be standard / compact',
@@ -1142,7 +1145,7 @@ export function applyConfigPatch(current, rawPatch) {
1142
1145
  if (candidate.sidebarTodayMetric !== undefined && !['cost', 'tokens'].includes(candidate.sidebarTodayMetric)) errors.push('sidebarTodayMetric must be cost or tokens')
1143
1146
  // 「含 Plan 总额」全局开关(v1.6.0):布尔,可缺省(默认关)。
1144
1147
  if (candidate.showTotalWithPlan !== undefined && typeof candidate.showTotalWithPlan !== 'boolean') errors.push(vmsg(locale, 'showTotalWithPlan'))
1145
- for (const field of ['includeSubagentCost', 'codexQuotaEnabled']) {
1148
+ for (const field of ['includeSubagentCost', 'codexQuotaEnabled', 'codexQuotaSidebar']) {
1146
1149
  if (candidate[field] !== undefined && typeof candidate[field] !== 'boolean') errors.push(vmsg(locale, field))
1147
1150
  }
1148
1151
  // 侧边栏进度条样式:standard(默认,纵向单列) | compact(额度卡两列网格)。
@@ -1480,6 +1483,7 @@ export function sanitizeConfig(raw) {
1480
1483
  out.showTotalWithPlan = out.showTotalWithPlan === true
1481
1484
  out.includeSubagentCost = out.includeSubagentCost === true
1482
1485
  out.codexQuotaEnabled = out.codexQuotaEnabled === true
1486
+ out.codexQuotaSidebar = out.codexQuotaSidebar !== false
1483
1487
  out.sidebarSimple = out.sidebarSimple === true
1484
1488
  out.sidebarSimplePromptSeen = out.sidebarSimplePromptSeen === true
1485
1489
  out.sidebarModels = Object.fromEntries(Object.entries(base.sidebarModels).map(([k, fallback]) => {
@@ -166,6 +166,7 @@ const configSchema = z.object({
166
166
  showTotalWithPlan: z.boolean().optional(),
167
167
  includeSubagentCost: z.boolean().optional(),
168
168
  codexQuotaEnabled: z.boolean().optional(),
169
+ codexQuotaSidebar: z.boolean().optional(),
169
170
  sidebarSimple: z.boolean().optional(),
170
171
  sidebarSimplePromptSeen: z.boolean().optional(),
171
172
  sidebarModels: z.object({ enabled: z.boolean(), period: z.enum(['today', 'history']), topN: z.number().int().min(1).max(10), summary: z.enum(['total', 'top']), position: z.enum(['first', 'afterBalance', 'last']), defaultOpen: z.boolean(), remember: z.boolean(), tokens: z.boolean(), shares: z.boolean(), refreshSeconds: z.number().int().min(10).max(60), dock: z.boolean() }).strict().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cost-meter",
3
- "version": "1.7.48",
3
+ "version": "1.7.49",
4
4
  "description": "DeepSeek Harness 会话费用统计插件:本会话成本、当日费用、历史记录与官方价格同步,支持多厂商多模型价格计费(内置 90+ 模型价格目录与自动匹配)、主流 Coding Plan 订阅额度查询与显示(11 家,含小米 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 90+ model catalog with auto-matching), Coding Plan quota queries & display for 11 vendors (incl. 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/index.js",