dsh-cost-meter 1.8.12 → 1.8.13
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 +7 -7
- package/README.zh-CN.md +7 -7
- package/docs/billing-statistics.md +3 -1
- package/lib/client.js +5 -5
- package/lib/store.js +4 -0
- package/lib/typert.host.js +1 -0
- package/package.json +1 -1
package/lib/store.js
CHANGED
|
@@ -144,6 +144,7 @@ export function defaultConfig() {
|
|
|
144
144
|
hideSessionCostHeader: false,
|
|
145
145
|
hideSessionCostDock: false,
|
|
146
146
|
hideTurnCost: false,
|
|
147
|
+
sessionCostCompact: false, // 输入区下方会话费用行只显示金额(悬停 title 与费用明细弹窗保留完整分项)
|
|
147
148
|
sidebarTodayMetric: 'cost',
|
|
148
149
|
showTotalWithPlan: false, // 「含 Plan 总额」全局开关(v1.6.0):开启后全部金额展示按总等值(cost)计;默认按真金白银(apiCost)
|
|
149
150
|
includeSubagentCost: false, // 本会话展示可合并连续子代理后代;不重复写入每日账本。
|
|
@@ -1150,6 +1151,8 @@ export function applyConfigPatch(current, rawPatch) {
|
|
|
1150
1151
|
for (const key of ['hideSessionCostHeader', 'hideSessionCostDock', 'hideTurnCost']) {
|
|
1151
1152
|
if (candidate[key] !== undefined && typeof candidate[key] !== 'boolean') errors.push(locale === 'en' ? `${key} must be a boolean` : `${key} 必须是布尔值`)
|
|
1152
1153
|
}
|
|
1154
|
+
// 会话费用行紧凑模式:布尔,可缺省(默认关)。
|
|
1155
|
+
if (candidate.sessionCostCompact !== undefined && typeof candidate.sessionCostCompact !== 'boolean') errors.push(locale === 'en' ? 'sessionCostCompact must be a boolean' : 'sessionCostCompact 必须是布尔值')
|
|
1153
1156
|
if (candidate.sidebarTodayMetric !== undefined && !['cost', 'tokens'].includes(candidate.sidebarTodayMetric)) errors.push('sidebarTodayMetric must be cost or tokens')
|
|
1154
1157
|
// 「含 Plan 总额」全局开关(v1.6.0):布尔,可缺省(默认关)。
|
|
1155
1158
|
if (candidate.showTotalWithPlan !== undefined && typeof candidate.showTotalWithPlan !== 'boolean') errors.push(vmsg(locale, 'showTotalWithPlan'))
|
|
@@ -1494,6 +1497,7 @@ export function sanitizeConfig(raw) {
|
|
|
1494
1497
|
out.hideOfficialBalance = out.hideOfficialBalance === true
|
|
1495
1498
|
out.hideTodayCost = out.hideTodayCost === true
|
|
1496
1499
|
for (const key of ['hideSessionCostHeader', 'hideSessionCostDock', 'hideTurnCost']) out[key] = out[key] === true
|
|
1500
|
+
out.sessionCostCompact = out.sessionCostCompact === true
|
|
1497
1501
|
out.sidebarTodayMetric = oneOf(out.sidebarTodayMetric, ['cost', 'tokens'], 'cost')
|
|
1498
1502
|
out.showTotalWithPlan = out.showTotalWithPlan === true
|
|
1499
1503
|
out.includeSubagentCost = out.includeSubagentCost === true
|
package/lib/typert.host.js
CHANGED
|
@@ -193,6 +193,7 @@ const configSchema = z.object({
|
|
|
193
193
|
hideSessionCostHeader: z.boolean().optional(),
|
|
194
194
|
hideSessionCostDock: z.boolean().optional(),
|
|
195
195
|
hideTurnCost: z.boolean().optional(),
|
|
196
|
+
sessionCostCompact: z.boolean().optional(),
|
|
196
197
|
sidebarTodayMetric: z.enum(['cost', 'tokens']).optional(),
|
|
197
198
|
// 「含 Plan 总额」全局开关(v1.6.0):开启后全部金额展示按总等值(cost)计。
|
|
198
199
|
showTotalWithPlan: z.boolean().optional(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-cost-meter",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.13",
|
|
4
4
|
"description": "DeepSeek Harness 会话费用统计插件:本会话成本、当日费用、历史记录与官方价格同步,支持多厂商多模型价格计费(内置 170+ 模型 ID 价格目录与自动匹配)、主流 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 170+ model-ID 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",
|