@kenz1117/dsh-ui-usage-billing 1.4.5 → 1.4.7

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/index.js CHANGED
@@ -1140,6 +1140,42 @@ const BUILTIN_MODEL_CATALOG = [
1140
1140
  output: 100
1141
1141
  }
1142
1142
  },
1143
+ {
1144
+ key: "mimo-v2.6-pro",
1145
+ name: "MiMo V2.6 Pro",
1146
+ provider: "小米",
1147
+ colorVar: "dsw-static-green-400",
1148
+ price: {
1149
+ currency: "CNY",
1150
+ input: 3,
1151
+ cacheHit: .025,
1152
+ output: 6
1153
+ }
1154
+ },
1155
+ {
1156
+ key: "mimo-v2.6-flash",
1157
+ name: "MiMo V2.6 Flash",
1158
+ provider: "小米",
1159
+ colorVar: "dsw-static-green-400",
1160
+ price: {
1161
+ currency: "CNY",
1162
+ input: 1,
1163
+ cacheHit: .02,
1164
+ output: 2
1165
+ }
1166
+ },
1167
+ {
1168
+ key: "mimo-v2.6-pro-ultraspeed",
1169
+ name: "MiMo V2.6 Pro UltraSpeed",
1170
+ provider: "小米",
1171
+ colorVar: "dsw-static-green-400",
1172
+ price: {
1173
+ currency: "CNY",
1174
+ input: 30,
1175
+ cacheHit: .25,
1176
+ output: 60
1177
+ }
1178
+ },
1143
1179
  {
1144
1180
  key: "mimo-v2.5",
1145
1181
  name: "MiMo V2.5",
@@ -1402,6 +1438,18 @@ const BUILTIN_MODEL_CATALOG = [
1402
1438
  peakHours: GEMINI_PEAK_HOURS,
1403
1439
  tierSemantics: "latency"
1404
1440
  },
1441
+ {
1442
+ key: "grok-4.7",
1443
+ name: "Grok 4.7",
1444
+ provider: "xAI",
1445
+ colorVar: "dsw-static-neutral-bluish-700",
1446
+ price: {
1447
+ currency: "USD",
1448
+ input: 2,
1449
+ cacheHit: .5,
1450
+ output: 6
1451
+ }
1452
+ },
1405
1453
  {
1406
1454
  key: "grok",
1407
1455
  name: "Grok 4.6",
@@ -1622,6 +1670,62 @@ const BUILTIN_MODEL_CATALOG = [
1622
1670
  },
1623
1671
  estimated: true
1624
1672
  },
1673
+ {
1674
+ key: "qwen3.7-plus",
1675
+ name: "Qwen3.7 Plus",
1676
+ provider: "阿里通义",
1677
+ colorVar: "dsw-static-orange-500",
1678
+ price: {
1679
+ currency: "CNY",
1680
+ input: 2,
1681
+ cacheHit: .4,
1682
+ output: 8
1683
+ },
1684
+ extraRows: [
1685
+ {
1686
+ label: "显式缓存创建",
1687
+ input: 2.5
1688
+ },
1689
+ {
1690
+ label: "显式缓存命中",
1691
+ input: .2
1692
+ },
1693
+ {
1694
+ label: "Batch File",
1695
+ input: 1,
1696
+ output: 4,
1697
+ note: "长期半价"
1698
+ }
1699
+ ]
1700
+ },
1701
+ {
1702
+ key: "qwen3.7-flash",
1703
+ name: "Qwen3.7 Flash",
1704
+ provider: "阿里通义",
1705
+ colorVar: "dsw-static-orange-400",
1706
+ price: {
1707
+ currency: "CNY",
1708
+ input: .2,
1709
+ cacheHit: .02,
1710
+ output: .8
1711
+ },
1712
+ extraRows: [
1713
+ {
1714
+ label: "显式缓存创建",
1715
+ input: .25
1716
+ },
1717
+ {
1718
+ label: "显式缓存命中",
1719
+ input: .02
1720
+ },
1721
+ {
1722
+ label: "Batch File",
1723
+ input: .1,
1724
+ output: .4,
1725
+ note: "长期半价"
1726
+ }
1727
+ ]
1728
+ },
1625
1729
  {
1626
1730
  key: "qwen3.6-max",
1627
1731
  name: "Qwen3.6 Max",
@@ -1686,6 +1790,18 @@ const BUILTIN_MODEL_CATALOG = [
1686
1790
  },
1687
1791
  estimated: true
1688
1792
  },
1793
+ {
1794
+ key: "glm-5",
1795
+ name: "GLM-5",
1796
+ provider: "智谱 AI",
1797
+ colorVar: "dsw-static-blue-400",
1798
+ price: {
1799
+ currency: "CNY",
1800
+ input: 4,
1801
+ cacheHit: 1,
1802
+ output: 18
1803
+ }
1804
+ },
1689
1805
  {
1690
1806
  key: "glm-5.2-fast",
1691
1807
  name: "GLM-5.2 Fast",
@@ -1693,11 +1809,10 @@ const BUILTIN_MODEL_CATALOG = [
1693
1809
  colorVar: "dsw-static-blue-300",
1694
1810
  price: {
1695
1811
  currency: "CNY",
1696
- input: 6,
1697
- cacheHit: 1.2,
1698
- output: 24
1699
- },
1700
- estimated: true
1812
+ input: 16,
1813
+ cacheHit: 4,
1814
+ output: 56
1815
+ }
1701
1816
  },
1702
1817
  {
1703
1818
  key: "kimi-k3-fast",
@@ -3204,6 +3319,7 @@ function createUsageAggregator(persistence, options = {}) {
3204
3319
  ...searchEstimate > 0 ? { searchCallEstimateCny: searchEstimate } : {},
3205
3320
  ...perf === void 0 ? {} : { perf },
3206
3321
  ...staleLedgerSessions > 0 ? { staleLedgerSessions } : {},
3322
+ ...skipped.length > 0 ? { unreadableSessions: skipped.length } : {},
3207
3323
  byRole: (() => {
3208
3324
  const chars = roles.userChars + roles.toolChars;
3209
3325
  const userShare = chars > 0 ? roles.userChars / chars : .5;
@@ -274,6 +274,8 @@ export interface UsageStatsDocument {
274
274
  perf?: PerfStats;
275
275
  /** 只存在于账本、且缺 foldVersion 的旧会话数;无旧行时省略。 */
276
276
  staleLedgerSessions?: number;
277
+ /** 读时迁移拒读而未统计的会话数(原始日志未动,上游修复后自动恢复);无拒读时省略。 */
278
+ unreadableSessions?: number;
277
279
  }
278
280
  /** 按角色费用归因:user / tool 为输入成本的启发式摊分,assistant 为输出成本实测。 */
279
281
  export interface RoleCost {
@@ -313,6 +313,8 @@ export interface UsageStats {
313
313
  perf?: ClientPerf;
314
314
  /** 旧版算法账本行兜底的会话数(模型归属可能失真);0 或缺省 = 全部数据可信。 */
315
315
  staleLedgerSessions?: number;
316
+ /** 读时迁移拒读而未统计的会话数;0 或缺省 = 全部会话已统计。 */
317
+ unreadableSessions?: number;
316
318
  /** 插件版本号(服务端读自包 package.json;旧快照缺失)。 */
317
319
  pluginVersion?: string;
318
320
  }
@@ -1,5 +1,5 @@
1
1
  /** Locale dictionaries for the usage billing surface. */
2
- export type UsageBillingKey = 'title' | 'cost' | 'todayCost' | 'monthCost' | 'yearCost' | 'monthProjected' | 'liveTurn' | 'liveSession' | 'calls' | 'cacheHitRate' | 'tokens' | 'inputTokens' | 'outputTokens' | 'avgCost' | 'kpiRange' | 'avgRangeToday' | 'avgRange7d' | 'avgRangeWeek' | 'avgRangeMonth' | 'avgRangeAll' | 'trend' | 'trend7d' | 'trend30d' | 'trendMetric' | 'trendMetricCost' | 'trendMetricTokens' | 'pricingSearch' | 'bandPinHint' | 'trendEmpty' | 'trendTotal' | 'roundsUnit' | 'healthModelsLive' | 'healthVendorsDown' | 'healthVendorsUnavailable' | 'budget' | 'budgetRemain' | 'budgetAmount' | 'budgetSummary' | 'sessions' | 'sessionTitle' | 'lastActive' | 'sessionOverflow' | 'budgetTierBody' | 'models' | 'providerBilling' | 'channelUnknown' | 'directTag' | 'relayTag' | 'unknownTag' | 'planCountUnit' | 'actual' | 'pricing' | 'input' | 'output' | 'cacheHit' | 'peak' | 'offPeak' | 'flat' | 'band' | 'close' | 'footer' | 'footerCredit' | 'lastUpdated' | 'noData' | 'todayRate' | 'rateLive' | 'rateBuiltin' | 'pricingSyncedAt' | 'pricingSyncNow' | 'pricingSyncing' | 'promoBadge' | 'promoUntil' | 'promoOpenEnded' | 'pricingTip' | 'pricingUnit' | 'pricingNotes' | 'ubPeak' | 'ubOff' | 'ubStd' | 'peakBand' | 'pricingSource' | 'noteCache' | 'noteBand' | 'noteSource' | 'balance' | 'recharge' | 'rechargeHint' | 'balanceUnconfigured' | 'balanceUnauthorized' | 'balanceUnreachable' | 'uncatalogued' | 'estimatedPricing' | 'balanceDays' | 'balanceLowBody' | 'reconcileDrift' | 'reconcileDismiss' | 'subscriptionNotConfigured' | 'subscriptionUnauthorized' | 'subscriptionUnavailable' | 'subscriptionInvalid' | 'subscriptionRateLimited' | 'subscriptionSession' | 'subscriptionWeekly' | 'subscriptionMonthly' | 'subscriptionBilling' | 'subscriptionRemaining' | 'subscriptionExhausted' | 'subscriptionReset' | 'subscriptionNoApi' | 'floatWindow' | 'floatModeCombined' | 'floatModeSubscription' | 'floatMode' | 'floatTargets' | 'floatWindowHint' | 'floatPrimaryToday' | 'floatPrimaryWeek' | 'floatPrimaryMonth' | 'floatNoTargets' | 'floatNoTargetsHint' | 'cardDisplay' | 'cardDisplayHint' | 'cardMetric' | 'cardMetricMoney' | 'cardMetricTokens' | 'cardSpan' | 'cardSpanDay' | 'cardSpanWeek' | 'cardSpanMonth' | 'triggerMonthTokens' | 'triggerTodayTokens' | 'triggerWeekTokens' | 'subscriptionsStale' | 'staleLedgerNotice' | 'tokenCacheWrite' | 'toolRank' | 'toolName' | 'userPrices' | 'userPricesHint' | 'userPriceSave' | 'userPriceModel' | 'userPriceSource' | 'userPriceSourceHint' | 'userPriceOffPeak' | 'userPriceNormal' | 'userPriceCurrency' | 'userPriceAdd' | 'userPriceRemoveSelected' | 'userPriceSelect' | 'sessionStaleBadge' | 'sessionUntitled' | 'heatmapLess' | 'heatmapMore' | 'currency' | 'currencyCny' | 'currencyUsd' | 'currencyEur' | 'language' | 'heatmap' | 'rounds' | 'roundsHint' | 'anomaly' | 'model' | 'thModel' | 'thInputMiss' | 'thInputHit' | 'costAbbr' | 'tabOverview' | 'tabTrends' | 'tabProviders' | 'tabPricing' | 'tabSettings' | 'budgetHint' | 'peakAlertHint' | 'peakAlertDescPeak' | 'peakAlertDescOff' | 'peakAlertDescPeakZhipu' | 'peakAlertDescOffZhipu' | 'export' | 'exportCsvDay' | 'exportCsvSession' | 'exportJson' | 'peakShare' | 'peakSharePerCall' | 'offPeakSavings' | 'perfMax' | 'weekCost' | 'roleCost' | 'roleUser' | 'roleAssistant' | 'roleTool' | 'roleHint' | 'tierPeak' | 'tierOff' | 'tierToPeak' | 'tierToOff' | 'tierAlertEnterPeak' | 'tierAlertEnterOff' | 'tierAlertEnterPeakZhipu' | 'tierAlertEnterOffZhipu' | 'peakAlertTitlePeak' | 'peakAlertTitleOff' | 'peakAlert' | 'peakAlertLeadMin' | 'peakAlertPos' | 'peakAlertMode' | 'peakAlertPosCorner' | 'peakAlertPosCenter' | 'peakAlertModePeak' | 'peakAlertModeOff' | 'peakAlertModeBoth' | 'peakAlertWebNotify' | 'peakAlertPreview' | 'planTypeCode' | 'planTypeToken' | 'subscriptionFeePerMonth' | 'triggerToday' | 'triggerMonth' | 'subscriptionTag' | 'free' | 'perfSamples' | 'perfTtft' | 'perfP50' | 'perfP90' | 'perfTps' | 'perfLatency' | 'perfEstimated' | 'perfEmpty' | 'perfTpsUnit' | 'perfTitle' | 'perfHint' | 'perfAll' | 'perfChartEmpty' | 'heatmapYear' | 'heatmapHalf' | 'heatmapMonth' | 'metricCost' | 'metricTokens' | 'heatmapTotal' | 'activeDays' | 'streakDays' | 'subscriptionAutoDetect' | 'pluginAuthor' | 'pluginRepository' | 'pluginNpm' | 'pluginLicense' | 'tabToken' | 'tokenExport' | 'tokenExportCsv' | 'tokenReasoningShare' | 'tokenReasoningShort' | 'tokenIo' | 'tokenPeak' | 'tokenDaily' | 'tokenByModel' | 'tokenMiss' | 'tokenHit' | 'tokenOutput' | 'tokenViewStructure' | 'tokenViewModel' | 'tokenHitShort' | 'tokenMissShort' | 'tokenTotal' | 'tokenShare' | 'usageStatsTool' | 'usageStatsToolHint' | 'balanceGranted' | 'balanceTopped' | 'balanceDaily' | 'balanceDaysLong' | 'balanceDaysUnit' | 'popTodayModel' | 'popNoConsumption' | 'popTitle' | 'popDirectLead' | 'popSubLead' | 'unpricedHint' | 'searchEstimateHint' | 'siteListDisplay' | 'siteListDisplayHint' | 'liveCostBar' | 'liveCostBarHint' | 'liveCostBarPosition' | 'liveCostBarPosBelow' | 'liveCostBarPosAbove' | 'liveCostBarPosToolbar' | 'exportCsvSite' | 'panelRelayQuota' | 'relayBalance' | 'relayNoQuota' | 'relayWindowUsed' | 'relayKindNewApi' | 'relayKindSub2Api' | 'relayKindUnknown';
2
+ export type UsageBillingKey = 'title' | 'cost' | 'todayCost' | 'monthCost' | 'yearCost' | 'monthProjected' | 'liveTurn' | 'liveSession' | 'calls' | 'cacheHitRate' | 'tokens' | 'inputTokens' | 'outputTokens' | 'avgCost' | 'kpiRange' | 'avgRangeToday' | 'avgRange7d' | 'avgRangeWeek' | 'avgRangeMonth' | 'avgRangeAll' | 'trend' | 'trend7d' | 'trend30d' | 'trendMetric' | 'trendMetricCost' | 'trendMetricTokens' | 'pricingSearch' | 'bandPinHint' | 'trendEmpty' | 'trendTotal' | 'roundsUnit' | 'healthModelsLive' | 'healthVendorsDown' | 'healthVendorsUnavailable' | 'budget' | 'budgetRemain' | 'budgetAmount' | 'budgetSummary' | 'sessions' | 'sessionTitle' | 'lastActive' | 'sessionOverflow' | 'budgetTierBody' | 'models' | 'providerBilling' | 'channelUnknown' | 'directTag' | 'relayTag' | 'unknownTag' | 'planCountUnit' | 'actual' | 'pricing' | 'input' | 'output' | 'cacheHit' | 'peak' | 'offPeak' | 'flat' | 'band' | 'close' | 'footer' | 'footerCredit' | 'lastUpdated' | 'noData' | 'todayRate' | 'rateLive' | 'rateBuiltin' | 'pricingSyncedAt' | 'pricingSyncNow' | 'pricingSyncing' | 'promoBadge' | 'promoUntil' | 'promoOpenEnded' | 'pricingTip' | 'pricingUnit' | 'pricingNotes' | 'ubPeak' | 'ubOff' | 'ubStd' | 'peakBand' | 'pricingSource' | 'noteCache' | 'noteBand' | 'noteSource' | 'balance' | 'recharge' | 'rechargeHint' | 'balanceUnconfigured' | 'balanceUnauthorized' | 'balanceUnreachable' | 'uncatalogued' | 'estimatedPricing' | 'balanceDays' | 'balanceLowBody' | 'reconcileDrift' | 'reconcileDismiss' | 'subscriptionNotConfigured' | 'subscriptionUnauthorized' | 'subscriptionUnavailable' | 'subscriptionInvalid' | 'subscriptionRateLimited' | 'subscriptionSession' | 'subscriptionWeekly' | 'subscriptionMonthly' | 'subscriptionBilling' | 'subscriptionRemaining' | 'subscriptionExhausted' | 'subscriptionReset' | 'subscriptionNoApi' | 'floatWindow' | 'floatModeCombined' | 'floatModeSubscription' | 'floatMode' | 'floatTargets' | 'floatWindowHint' | 'floatPrimaryToday' | 'floatPrimaryWeek' | 'floatPrimaryMonth' | 'floatNoTargets' | 'floatNoTargetsHint' | 'cardDisplay' | 'cardDisplayHint' | 'cardMetric' | 'cardMetricMoney' | 'cardMetricTokens' | 'cardSpan' | 'cardSpanDay' | 'cardSpanWeek' | 'cardSpanMonth' | 'triggerMonthTokens' | 'triggerTodayTokens' | 'triggerWeekTokens' | 'subscriptionsStale' | 'staleLedgerNotice' | 'unreadableNotice' | 'tokenCacheWrite' | 'toolRank' | 'toolName' | 'userPrices' | 'userPricesHint' | 'userPriceSave' | 'userPriceModel' | 'userPriceSource' | 'userPriceSourceHint' | 'userPriceOffPeak' | 'userPriceNormal' | 'userPriceCurrency' | 'userPriceAdd' | 'userPriceRemoveSelected' | 'userPriceSelect' | 'sessionStaleBadge' | 'sessionUntitled' | 'heatmapLess' | 'heatmapMore' | 'currency' | 'currencyCny' | 'currencyUsd' | 'currencyEur' | 'language' | 'heatmap' | 'rounds' | 'roundsHint' | 'anomaly' | 'model' | 'thModel' | 'thInputMiss' | 'thInputHit' | 'costAbbr' | 'tabOverview' | 'tabTrends' | 'tabProviders' | 'tabPricing' | 'tabSettings' | 'budgetHint' | 'peakAlertHint' | 'peakAlertDescPeak' | 'peakAlertDescOff' | 'peakAlertDescPeakZhipu' | 'peakAlertDescOffZhipu' | 'export' | 'exportCsvDay' | 'exportCsvSession' | 'exportJson' | 'peakShare' | 'peakSharePerCall' | 'offPeakSavings' | 'perfMax' | 'weekCost' | 'roleCost' | 'roleUser' | 'roleAssistant' | 'roleTool' | 'roleHint' | 'tierPeak' | 'tierOff' | 'tierToPeak' | 'tierToOff' | 'tierAlertEnterPeak' | 'tierAlertEnterOff' | 'tierAlertEnterPeakZhipu' | 'tierAlertEnterOffZhipu' | 'peakAlertTitlePeak' | 'peakAlertTitleOff' | 'peakAlert' | 'peakAlertLeadMin' | 'peakAlertPos' | 'peakAlertMode' | 'peakAlertPosCorner' | 'peakAlertPosCenter' | 'peakAlertModePeak' | 'peakAlertModeOff' | 'peakAlertModeBoth' | 'peakAlertWebNotify' | 'peakAlertPreview' | 'planTypeCode' | 'planTypeToken' | 'subscriptionFeePerMonth' | 'triggerToday' | 'triggerMonth' | 'subscriptionTag' | 'free' | 'perfSamples' | 'perfTtft' | 'perfP50' | 'perfP90' | 'perfTps' | 'perfLatency' | 'perfEstimated' | 'perfEmpty' | 'perfTpsUnit' | 'perfTitle' | 'perfHint' | 'perfAll' | 'perfChartEmpty' | 'heatmapYear' | 'heatmapHalf' | 'heatmapMonth' | 'metricCost' | 'metricTokens' | 'heatmapTotal' | 'activeDays' | 'streakDays' | 'subscriptionAutoDetect' | 'pluginAuthor' | 'pluginRepository' | 'pluginNpm' | 'pluginLicense' | 'tabToken' | 'tokenExport' | 'tokenExportCsv' | 'tokenReasoningShare' | 'tokenReasoningShort' | 'tokenIo' | 'tokenPeak' | 'tokenDaily' | 'tokenByModel' | 'tokenMiss' | 'tokenHit' | 'tokenOutput' | 'tokenViewStructure' | 'tokenViewModel' | 'tokenHitShort' | 'tokenMissShort' | 'tokenTotal' | 'tokenShare' | 'usageStatsTool' | 'usageStatsToolHint' | 'balanceGranted' | 'balanceTopped' | 'balanceDaily' | 'balanceDaysLong' | 'balanceDaysUnit' | 'popTodayModel' | 'popNoConsumption' | 'popTitle' | 'popDirectLead' | 'popSubLead' | 'unpricedHint' | 'searchEstimateHint' | 'siteListDisplay' | 'siteListDisplayHint' | 'liveCostBar' | 'liveCostBarHint' | 'liveCostBarPosition' | 'liveCostBarPosBelow' | 'liveCostBarPosAbove' | 'liveCostBarPosToolbar' | 'exportCsvSite' | 'panelRelayQuota' | 'relayBalance' | 'relayNoQuota' | 'relayWindowUsed' | 'relayKindNewApi' | 'relayKindSub2Api' | 'relayKindUnknown';
3
3
  export declare const NS = "usageBilling";
4
4
  export declare const zh: Record<UsageBillingKey, string>;
5
5
  export declare const en: Record<UsageBillingKey, string>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kenz1117/dsh-ui-usage-billing",
3
3
  "description": "Usage billing dashboard for DeepSeek Harness: sidebar cost metrics plus a full dashboard modal, priced from a current multi-provider catalog with real usage aggregated from session logs.",
4
- "version": "1.4.5",
4
+ "version": "1.4.7",
5
5
  "keywords": [
6
6
  "deepseek-harness",
7
7
  "deepseek",