@kenz1117/dsh-ui-usage-billing 1.4.12 → 1.4.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/client.js +5 -5
- package/lib/index.js +185 -35
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/usage-billing-settings.d.ts +21 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -690,15 +690,13 @@ function formatTokens(value) {
|
|
|
690
690
|
//#endregion
|
|
691
691
|
//#region lib/types/builtin-catalog.js
|
|
692
692
|
/**
|
|
693
|
-
* Built-in catalog of current mainstream models as of 2026-
|
|
693
|
+
* Built-in catalog of current mainstream models as of 2026-09-29, priced from
|
|
694
694
|
* each provider's official price page. Domestic providers are OpenAI-API
|
|
695
695
|
* compatible and publish RMB prices directly; overseas providers publish USD
|
|
696
696
|
* and convert through the exchange rate at estimate time. Retired models
|
|
697
697
|
* (GPT-4o family, Gemini 2.x, GLM-4.x-lite, older Qwen) are deliberately
|
|
698
|
-
* absent
|
|
699
|
-
*
|
|
700
|
-
* keys match the harness stats file so real usage prices from the catalog;
|
|
701
|
-
* unknown keys fall back to `other`.
|
|
698
|
+
* absent. DeepSeek keys match the harness stats file so real usage prices
|
|
699
|
+
* from the catalog; unknown keys fall back to `other`.
|
|
702
700
|
*
|
|
703
701
|
* Time-of-day billing (peak/off-peak) is now real: DeepSeek V4 officially
|
|
704
702
|
* splits peak (09:00-12:00 / 14:00-18:00 Beijing) at 2x the off-peak rate
|
|
@@ -873,7 +871,7 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
873
871
|
price: {
|
|
874
872
|
currency: "CNY",
|
|
875
873
|
input: 6,
|
|
876
|
-
cacheHit: 1.
|
|
874
|
+
cacheHit: 1.3,
|
|
877
875
|
output: 24
|
|
878
876
|
}
|
|
879
877
|
},
|
|
@@ -930,32 +928,29 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
930
928
|
colorVar: "dsw-static-blue-400",
|
|
931
929
|
price: {
|
|
932
930
|
currency: "CNY",
|
|
933
|
-
input:
|
|
931
|
+
input: .8,
|
|
934
932
|
cacheHit: .1,
|
|
935
|
-
output:
|
|
933
|
+
output: 2.7
|
|
936
934
|
},
|
|
937
|
-
extraRows: [
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
note: "与标准价一致"
|
|
957
|
-
}
|
|
958
|
-
]
|
|
935
|
+
extraRows: [{
|
|
936
|
+
label: "显式缓存创建",
|
|
937
|
+
input: 1.25
|
|
938
|
+
}, {
|
|
939
|
+
label: "显式缓存命中",
|
|
940
|
+
input: .1
|
|
941
|
+
}]
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
key: "qwen-3.8-27b",
|
|
945
|
+
name: "Qwen3.8 27B",
|
|
946
|
+
provider: "阿里通义",
|
|
947
|
+
colorVar: "dsw-static-blue-300",
|
|
948
|
+
price: {
|
|
949
|
+
currency: "CNY",
|
|
950
|
+
input: 3,
|
|
951
|
+
cacheHit: .6,
|
|
952
|
+
output: 12
|
|
953
|
+
}
|
|
959
954
|
},
|
|
960
955
|
{
|
|
961
956
|
key: "qwen-max",
|
|
@@ -1068,7 +1063,7 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
1068
1063
|
price: {
|
|
1069
1064
|
currency: "CNY",
|
|
1070
1065
|
input: .2,
|
|
1071
|
-
cacheHit: .
|
|
1066
|
+
cacheHit: .04,
|
|
1072
1067
|
output: 2
|
|
1073
1068
|
}
|
|
1074
1069
|
},
|
|
@@ -1120,6 +1115,18 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
1120
1115
|
output: 15
|
|
1121
1116
|
}
|
|
1122
1117
|
},
|
|
1118
|
+
{
|
|
1119
|
+
key: "doubao-seed-2.1-lite",
|
|
1120
|
+
name: "Doubao Seed-2.1 Lite",
|
|
1121
|
+
provider: "字节豆包",
|
|
1122
|
+
colorVar: "dsw-static-red-300",
|
|
1123
|
+
price: {
|
|
1124
|
+
currency: "CNY",
|
|
1125
|
+
input: .8,
|
|
1126
|
+
cacheHit: .16,
|
|
1127
|
+
output: 2.7
|
|
1128
|
+
}
|
|
1129
|
+
},
|
|
1123
1130
|
{
|
|
1124
1131
|
key: "kimi",
|
|
1125
1132
|
name: "Kimi K2.7 Code",
|
|
@@ -1386,6 +1393,30 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
1386
1393
|
output: 50
|
|
1387
1394
|
}
|
|
1388
1395
|
},
|
|
1396
|
+
{
|
|
1397
|
+
key: "gpt-6-sol",
|
|
1398
|
+
name: "GPT-6 Sol",
|
|
1399
|
+
provider: "OpenAI",
|
|
1400
|
+
colorVar: "ds-green",
|
|
1401
|
+
price: {
|
|
1402
|
+
currency: "USD",
|
|
1403
|
+
input: 2,
|
|
1404
|
+
cacheHit: .2,
|
|
1405
|
+
output: 10
|
|
1406
|
+
}
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
key: "gpt-6-luna",
|
|
1410
|
+
name: "GPT-6 Luna",
|
|
1411
|
+
provider: "OpenAI",
|
|
1412
|
+
colorVar: "dsw-static-green-400",
|
|
1413
|
+
price: {
|
|
1414
|
+
currency: "USD",
|
|
1415
|
+
input: .1,
|
|
1416
|
+
cacheHit: .01,
|
|
1417
|
+
output: .5
|
|
1418
|
+
}
|
|
1419
|
+
},
|
|
1389
1420
|
{
|
|
1390
1421
|
key: "gpt-5.6-sol",
|
|
1391
1422
|
name: "GPT-5.6 Sol",
|
|
@@ -1447,6 +1478,54 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
1447
1478
|
peakHours: GEMINI_PEAK_HOURS,
|
|
1448
1479
|
tierSemantics: "latency"
|
|
1449
1480
|
},
|
|
1481
|
+
{
|
|
1482
|
+
key: "gemini-3.8-flash",
|
|
1483
|
+
name: "Gemini 3.8 Flash",
|
|
1484
|
+
provider: "Google",
|
|
1485
|
+
colorVar: "ds-blue",
|
|
1486
|
+
price: {
|
|
1487
|
+
currency: "USD",
|
|
1488
|
+
input: 1.5,
|
|
1489
|
+
cacheHit: .15,
|
|
1490
|
+
output: 7.5,
|
|
1491
|
+
offPeak: {
|
|
1492
|
+
input: .75,
|
|
1493
|
+
cacheHit: .075,
|
|
1494
|
+
output: 3.75
|
|
1495
|
+
}
|
|
1496
|
+
},
|
|
1497
|
+
promo: {
|
|
1498
|
+
factor: .5,
|
|
1499
|
+
endsAtMs: Date.UTC(2026, 11, 31, 16, 0, 0),
|
|
1500
|
+
note: "introductory 促销至 2026-12-31"
|
|
1501
|
+
},
|
|
1502
|
+
peakHours: GEMINI_PEAK_HOURS,
|
|
1503
|
+
tierSemantics: "latency"
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
key: "gemini-3.7-flash",
|
|
1507
|
+
name: "Gemini 3.7 Flash",
|
|
1508
|
+
provider: "Google",
|
|
1509
|
+
colorVar: "dsw-static-blue-300",
|
|
1510
|
+
price: {
|
|
1511
|
+
currency: "USD",
|
|
1512
|
+
input: 1.5,
|
|
1513
|
+
cacheHit: .15,
|
|
1514
|
+
output: 7.5,
|
|
1515
|
+
offPeak: {
|
|
1516
|
+
input: .75,
|
|
1517
|
+
cacheHit: .075,
|
|
1518
|
+
output: 3.75
|
|
1519
|
+
}
|
|
1520
|
+
},
|
|
1521
|
+
promo: {
|
|
1522
|
+
factor: .5,
|
|
1523
|
+
endsAtMs: Date.UTC(2026, 11, 31, 16, 0, 0),
|
|
1524
|
+
note: "introductory 促销至 2026-12-31"
|
|
1525
|
+
},
|
|
1526
|
+
peakHours: GEMINI_PEAK_HOURS,
|
|
1527
|
+
tierSemantics: "latency"
|
|
1528
|
+
},
|
|
1450
1529
|
{
|
|
1451
1530
|
key: "gemini-flash",
|
|
1452
1531
|
name: "Gemini 3.6 Flash",
|
|
@@ -1463,6 +1542,11 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
1463
1542
|
output: 3.75
|
|
1464
1543
|
}
|
|
1465
1544
|
},
|
|
1545
|
+
promo: {
|
|
1546
|
+
factor: .5,
|
|
1547
|
+
endsAtMs: Date.UTC(2026, 11, 31, 16, 0, 0),
|
|
1548
|
+
note: "introductory 促销至 2026-12-31"
|
|
1549
|
+
},
|
|
1466
1550
|
peakHours: GEMINI_PEAK_HOURS,
|
|
1467
1551
|
tierSemantics: "latency"
|
|
1468
1552
|
},
|
|
@@ -1502,6 +1586,18 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
1502
1586
|
output: 2.5
|
|
1503
1587
|
}
|
|
1504
1588
|
},
|
|
1589
|
+
{
|
|
1590
|
+
key: "grok-build-0.1",
|
|
1591
|
+
name: "Grok Build 0.1",
|
|
1592
|
+
provider: "xAI",
|
|
1593
|
+
colorVar: "dsw-static-neutral-bluish-500",
|
|
1594
|
+
price: {
|
|
1595
|
+
currency: "USD",
|
|
1596
|
+
input: 1,
|
|
1597
|
+
cacheHit: .2,
|
|
1598
|
+
output: 2
|
|
1599
|
+
}
|
|
1600
|
+
},
|
|
1505
1601
|
{
|
|
1506
1602
|
key: "llama",
|
|
1507
1603
|
name: "Llama 4 Maverick",
|
|
@@ -1586,6 +1682,42 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
1586
1682
|
output: 10
|
|
1587
1683
|
}
|
|
1588
1684
|
},
|
|
1685
|
+
{
|
|
1686
|
+
key: "claude-fable-5-1",
|
|
1687
|
+
name: "Claude Fable 5.1",
|
|
1688
|
+
provider: "Anthropic",
|
|
1689
|
+
colorVar: "ds-red",
|
|
1690
|
+
price: {
|
|
1691
|
+
currency: "USD",
|
|
1692
|
+
input: 10,
|
|
1693
|
+
cacheHit: .25,
|
|
1694
|
+
output: 50
|
|
1695
|
+
}
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
key: "claude-opus-5-5",
|
|
1699
|
+
name: "Claude Opus 5.5",
|
|
1700
|
+
provider: "Anthropic",
|
|
1701
|
+
colorVar: "ds-red",
|
|
1702
|
+
price: {
|
|
1703
|
+
currency: "USD",
|
|
1704
|
+
input: 4,
|
|
1705
|
+
cacheHit: .2,
|
|
1706
|
+
output: 20
|
|
1707
|
+
}
|
|
1708
|
+
},
|
|
1709
|
+
{
|
|
1710
|
+
key: "claude-sonnet-5-5",
|
|
1711
|
+
name: "Claude Sonnet 5.5",
|
|
1712
|
+
provider: "Anthropic",
|
|
1713
|
+
colorVar: "dsw-static-red-400",
|
|
1714
|
+
price: {
|
|
1715
|
+
currency: "USD",
|
|
1716
|
+
input: 2,
|
|
1717
|
+
cacheHit: .2,
|
|
1718
|
+
output: 10
|
|
1719
|
+
}
|
|
1720
|
+
},
|
|
1589
1721
|
{
|
|
1590
1722
|
key: "mistral-large-2512",
|
|
1591
1723
|
name: "Mistral Large 3",
|
|
@@ -1876,10 +2008,9 @@ const BUILTIN_MODEL_CATALOG = [
|
|
|
1876
2008
|
price: {
|
|
1877
2009
|
currency: "CNY",
|
|
1878
2010
|
input: 6.5,
|
|
1879
|
-
cacheHit: 1.
|
|
2011
|
+
cacheHit: 1.7,
|
|
1880
2012
|
output: 27
|
|
1881
|
-
}
|
|
1882
|
-
estimated: true
|
|
2013
|
+
}
|
|
1883
2014
|
},
|
|
1884
2015
|
{
|
|
1885
2016
|
key: "kimi-k2.6-fast",
|
|
@@ -1989,6 +2120,13 @@ const BUILTIN_MODEL_KEY_ALIASES = {
|
|
|
1989
2120
|
"claude-haiku-4.5": "claude-haiku-4-5",
|
|
1990
2121
|
"claude-opus-5": "claude-opus-5",
|
|
1991
2122
|
"claude-sonnet-5": "claude-sonnet-5",
|
|
2123
|
+
"claude-fable-5-1": "claude-fable-5-1",
|
|
2124
|
+
"claude-fable-5.1": "claude-fable-5-1",
|
|
2125
|
+
"claude-fable": "claude-fable-5-1",
|
|
2126
|
+
"claude-opus-5-5": "claude-opus-5-5",
|
|
2127
|
+
"claude-opus-5.5": "claude-opus-5-5",
|
|
2128
|
+
"claude-sonnet-5-5": "claude-sonnet-5-5",
|
|
2129
|
+
"claude-sonnet-5.5": "claude-sonnet-5-5",
|
|
1992
2130
|
"mistral-large-2512": "mistral-large-2512",
|
|
1993
2131
|
"mistral-large-3": "mistral-large-2512",
|
|
1994
2132
|
"mistral-small-2603": "mistral-small-2603",
|
|
@@ -2020,8 +2158,12 @@ const BUILTIN_MODEL_KEY_ALIASES = {
|
|
|
2020
2158
|
"doubao-seed-2.1-pro-290000": "doubao-seed-2.1-pro",
|
|
2021
2159
|
"doubao-seed-2.1-turbo": "doubao-seed-2.1-turbo",
|
|
2022
2160
|
"doubao-seed-2-1-turbo": "doubao-seed-2.1-turbo",
|
|
2161
|
+
"doubao-seed-2.1-lite": "doubao-seed-2.1-lite",
|
|
2162
|
+
"doubao-seed-2-1-lite": "doubao-seed-2.1-lite",
|
|
2023
2163
|
"qwen3.8-max": "qwen-3.8-max",
|
|
2024
2164
|
"qwen3.8-flash": "qwen-3.8-flash",
|
|
2165
|
+
"qwen3.8-27b": "qwen-3.8-27b",
|
|
2166
|
+
"qwen-3.8-27b": "qwen-3.8-27b",
|
|
2025
2167
|
"qwen3.7-max": "qwen-max",
|
|
2026
2168
|
"qwen3.6-max": "qwen3.6-max",
|
|
2027
2169
|
"qwen3.6-max-preview": "qwen3.6-max",
|
|
@@ -2066,7 +2208,15 @@ const BUILTIN_MODEL_KEY_ALIASES = {
|
|
|
2066
2208
|
"minimax-m2-7-highspeed": "minimax-m2.7-highspeed",
|
|
2067
2209
|
"minimax-m2-7-high-speed": "minimax-m2.7-highspeed",
|
|
2068
2210
|
"gpt-6": "gpt-6-astra",
|
|
2069
|
-
"gpt-6-astra": "gpt-6-astra"
|
|
2211
|
+
"gpt-6-astra": "gpt-6-astra",
|
|
2212
|
+
"gpt-6-sol": "gpt-6-sol",
|
|
2213
|
+
"gpt-6-luna": "gpt-6-luna",
|
|
2214
|
+
"gemini-3.8-flash": "gemini-3.8-flash",
|
|
2215
|
+
"gemini-3-8-flash": "gemini-3.8-flash",
|
|
2216
|
+
"gemini-3.7-flash": "gemini-3.7-flash",
|
|
2217
|
+
"gemini-3-7-flash": "gemini-3.7-flash",
|
|
2218
|
+
"grok-build-0.1": "grok-build-0.1",
|
|
2219
|
+
"grok-build": "grok-build-0.1"
|
|
2070
2220
|
};
|
|
2071
2221
|
//#endregion
|
|
2072
2222
|
//#region lib/types/aggregate.js
|
|
@@ -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' | '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';
|
|
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' | 'expandAll' | 'collapseAll' | 'todayOnly' | 'todayNoConsumption';
|
|
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>;
|
|
@@ -132,6 +132,27 @@ export declare const PINNED_MODELS_EVENT = "dsh.ui-usage-billing.pinned-pref";
|
|
|
132
132
|
export declare function loadPinnedModels(): string[];
|
|
133
133
|
/** 写入固定模型列表。失败静默(展示偏好非关键)。 */
|
|
134
134
|
export declare function savePinnedModels(keys: readonly string[]): void;
|
|
135
|
+
/**
|
|
136
|
+
* 厂商(提供商)组的展开集合与「仅看今日」过滤(issue #77)。
|
|
137
|
+
* 纯 client 偏好,存 localStorage(不依赖 node 半区接口/设置 schema)。
|
|
138
|
+
*/
|
|
139
|
+
/** localStorage key:当前展开的厂商组名列表(默认收起,仅记录用户展开过的组)。 */
|
|
140
|
+
export declare const PROVIDER_EXPANDED_STORAGE_KEY = "dsh.ui-usage-billing.provider-expanded";
|
|
141
|
+
/**
|
|
142
|
+
* 读取展开的厂商组 id 列表(审计 S2)。
|
|
143
|
+
* 持久化内容是带前缀的稳定 id(`ch:` / `sub:` / `bal:`);v1.4.14 前存的是
|
|
144
|
+
* 本地化显示名(无冒号前缀),切语言即失效——这里直接丢弃旧格式,用户重新
|
|
145
|
+
* 展开一次即可,不做不可逆的名称猜测迁移。
|
|
146
|
+
*/
|
|
147
|
+
export declare function loadProviderExpanded(): string[];
|
|
148
|
+
/** 写入展开的厂商组名列表。失败静默(展示偏好非关键)。 */
|
|
149
|
+
export declare function saveProviderExpanded(names: readonly string[]): void;
|
|
150
|
+
/** localStorage key:「仅看今日」开关(默认关)。 */
|
|
151
|
+
export declare const PROVIDERS_TODAY_STORAGE_KEY = "dsh.ui-usage-billing.providers-today";
|
|
152
|
+
/** 读取「仅看今日」开关。 */
|
|
153
|
+
export declare function loadProvidersTodayOnly(): boolean;
|
|
154
|
+
/** 写入「仅看今日」开关。失败静默(展示偏好非关键)。 */
|
|
155
|
+
export declare function saveProvidersTodayOnly(enabled: boolean): void;
|
|
135
156
|
/** 界面语言(与币种解耦后独立持久化)。 */
|
|
136
157
|
export type BillingLanguage = 'zh' | 'en';
|
|
137
158
|
/** localStorage key(与其他 `dsh.ui-usage-billing.*` 偏好同命名空间)。 */
|
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.
|
|
4
|
+
"version": "1.4.14",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
7
7
|
"deepseek",
|