@kenz1117/dsh-ui-usage-billing 1.2.8 → 1.3.0
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 +22 -1
- package/lib/types/client/live-cost.d.ts +9 -0
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/peak-alert.d.ts +9 -5
- package/lib/types/client/pricing.d.ts +22 -0
- package/lib/types/client/provider-display.d.ts +6 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -300,14 +300,35 @@ function isPeakHour(beijingHour) {
|
|
|
300
300
|
*/
|
|
301
301
|
function tierAt(timeMs) {
|
|
302
302
|
if (timeMs === null || timeMs === void 0 || !Number.isFinite(timeMs)) return "peak";
|
|
303
|
+
return tierAtWithBounds(timeMs, TIER_BOUNDARY_MINUTES);
|
|
304
|
+
}
|
|
305
|
+
/** 按给定峰段边界判档:周末全天低谷;工作日分钟数落在任一 [b(i), b(i+1)) 峰段即为高峰。 */
|
|
306
|
+
function tierAtWithBounds(timeMs, bounds) {
|
|
303
307
|
if (isBeijingWeekend(timeMs)) return "offPeak";
|
|
304
|
-
|
|
308
|
+
const minute = Math.floor(beijingMillisOfDay(timeMs) / 6e4);
|
|
309
|
+
for (let i = 0; i + 1 < bounds.length; i += 2) {
|
|
310
|
+
const start = bounds[i] ?? 0;
|
|
311
|
+
const end = bounds[i + 1] ?? 0;
|
|
312
|
+
if (minute >= start && minute < end) return "peak";
|
|
313
|
+
}
|
|
314
|
+
return "offPeak";
|
|
305
315
|
}
|
|
306
316
|
/** 时刻是否落在北京时间周末(周六/周日)。 */
|
|
307
317
|
function isBeijingWeekend(timeMs) {
|
|
308
318
|
const day = new Date(timeMs + 8 * 36e5).getUTCDay();
|
|
309
319
|
return day === 0 || day === 6;
|
|
310
320
|
}
|
|
321
|
+
/** 峰谷切换边界(北京时间的当日分钟数):09:00 / 12:00 / 14:00 / 18:00。 */
|
|
322
|
+
const TIER_BOUNDARY_MINUTES = [
|
|
323
|
+
540,
|
|
324
|
+
720,
|
|
325
|
+
840,
|
|
326
|
+
1080
|
|
327
|
+
];
|
|
328
|
+
/** 北京时间的当日毫秒数(0–86,400,000)。 */
|
|
329
|
+
function beijingMillisOfDay(timeMs) {
|
|
330
|
+
return ((timeMs + 8 * 36e5) % 864e5 + 864e5) % 864e5;
|
|
331
|
+
}
|
|
311
332
|
/**
|
|
312
333
|
* Built-in catalog of current mainstream models as of 2026-08-16, priced from
|
|
313
334
|
* each provider's official price page. Domestic providers are OpenAI-API
|
|
@@ -26,6 +26,7 @@ export interface LiveStats {
|
|
|
26
26
|
byTurn?: readonly {
|
|
27
27
|
sessionId: string;
|
|
28
28
|
turn: number;
|
|
29
|
+
model?: string;
|
|
29
30
|
cost: number;
|
|
30
31
|
}[];
|
|
31
32
|
}
|
|
@@ -66,6 +67,14 @@ export declare function lowQuotaChips(quotas: readonly QuotaSlice[], threshold?:
|
|
|
66
67
|
kind: string;
|
|
67
68
|
pct: number;
|
|
68
69
|
}[];
|
|
70
|
+
/**
|
|
71
|
+
* 当前会话最近一轮的模型(峰谷窗口跟随它):byTurn 里该会话轮次号最大的 model。
|
|
72
|
+
* 导出供测试:纯函数。
|
|
73
|
+
* @param stats - 薄统计切片。
|
|
74
|
+
* @param sessionId - 当前会话 id。
|
|
75
|
+
* @returns 该会话最近一轮的归因模型键;无轮次或轮行未带模型时 undefined。
|
|
76
|
+
*/
|
|
77
|
+
export declare function sessionModelOf(stats: LiveStats | null, sessionId: string | undefined): string | undefined;
|
|
69
78
|
/** Props: the framework's session identity plus the owning dock's locale seat. */
|
|
70
79
|
export interface LiveCostBarProps {
|
|
71
80
|
/** Current Session identity supplied by the session-scope standard kit. */
|
|
@@ -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' | 'trendEmpty' | 'budget' | 'budgetRemain' | 'budgetAmount' | 'budgetSummary' | 'sessions' | 'sessionTitle' | 'lastActive' | 'sessionOverflow' | 'budgetTierBody' | 'models' | 'providerBilling' | 'channelUnknown' | 'actual' | 'pricing' | 'input' | 'output' | 'cacheHit' | 'peak' | 'offPeak' | 'flat' | 'band' | 'close' | 'footer' | 'footerCredit' | 'lastUpdated' | 'noData' | 'todayRate' | 'rateLive' | 'rateBuiltin' | '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' | 'heatmap' | 'rounds' | 'roundsHint' | 'anomaly' | 'model' | 'thModel' | 'thInputMiss' | 'thInputHit' | 'costAbbr' | 'tabOverview' | 'tabTrends' | 'tabProviders' | 'tabPricing' | 'tabSettings' | 'budgetHint' | 'peakAlertHint' | 'peakAlertDescPeak' | 'peakAlertDescOff' | 'export' | 'exportCsvDay' | 'exportCsvSession' | 'exportJson' | 'peakShare' | 'peakSharePerCall' | 'offPeakSavings' | 'perfMax' | 'weekCost' | 'roleCost' | 'roleUser' | 'roleAssistant' | 'roleTool' | 'roleHint' | 'tierPeak' | 'tierOff' | 'tierToPeak' | 'tierToOff' | 'tierAlertEnterPeak' | 'tierAlertEnterOff' | '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' | 'heatmapMonth' | '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' | 'trendEmpty' | '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' | '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' | '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' | 'heatmapMonth' | '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>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* (默认关闭,用户到面板设置开启);「同一切换点只提醒一次」由 budget store 的
|
|
7
7
|
* `lastTierSwitchAt` 承担(与原系统通知共用一份去重,避免一条切换提醒弹两次)。
|
|
8
8
|
*/
|
|
9
|
-
import { type PriceTierId } from './pricing.ts';
|
|
9
|
+
import { type PriceTierId, type RateChannel } from './pricing.ts';
|
|
10
10
|
/** 提醒模式:只提醒进入峰时 / 只提醒进入平价 / 峰与谷都提醒。 */
|
|
11
11
|
export type PeakAlertMode = 'peak' | 'offPeak' | 'both';
|
|
12
12
|
/** 浮层位置:右下角 / 屏幕居中。 */
|
|
@@ -28,22 +28,26 @@ export interface PeakAlertConfig {
|
|
|
28
28
|
export declare const PEAK_ALERT_KEY = "dsh-billing-peak-alert-v1";
|
|
29
29
|
/** 默认配置:关、2 分钟提前、右下角、开系统通知、峰与谷都提醒。 */
|
|
30
30
|
export declare const DEFAULT_PEAK_ALERT_CONFIG: PeakAlertConfig;
|
|
31
|
-
/**
|
|
31
|
+
/** 一次命中:即将进入的档位、该切换时刻与命中的计费通道(决定文案口径)。 */
|
|
32
32
|
export interface PeakAlertHit {
|
|
33
33
|
entering: PriceTierId;
|
|
34
34
|
atMs: number;
|
|
35
|
+
channel: RateChannel;
|
|
35
36
|
}
|
|
36
37
|
/** 读取本地偏好(缺失/损坏回退默认,字段宽松校验)。 */
|
|
37
38
|
export declare function loadPeakAlertConfig(): PeakAlertConfig;
|
|
38
39
|
/** 保存偏好;存储失败静默(降级为关闭,不影响其它能力)。 */
|
|
39
40
|
export declare function savePeakAlertConfig(config: PeakAlertConfig): void;
|
|
40
41
|
/**
|
|
41
|
-
*
|
|
42
|
+
* 计算是否需要提醒:已启用、当前计费通道有峰谷窗口、距切换不足提前量、按模式过滤、
|
|
43
|
+
* 且该切换点未提醒过。通道由调用方按「当前会话最近一轮的模型 + 订阅状态」推导
|
|
44
|
+
* (rateChannelOf);none(模型不涉及峰谷)恒不提醒。
|
|
42
45
|
* 导出供测试:纯函数。
|
|
43
46
|
* @param nowMs - 当前时刻(epoch 毫秒)。
|
|
44
47
|
* @param config - 峰谷提醒偏好。
|
|
45
48
|
* @param lastAlertedAt - 上次提醒过的切换点时刻(budget store 的 lastTierSwitchAt);同点跳过。
|
|
46
|
-
* @
|
|
49
|
+
* @param channel - 当前会话模型的计费通道;none 直接返回 null。
|
|
50
|
+
* @returns 命中(含即将进入的档位、切换时刻与通道),否则 null。
|
|
47
51
|
*/
|
|
48
|
-
export declare function computePeakAlert(nowMs: number, config: PeakAlertConfig, lastAlertedAt: number): PeakAlertHit | null;
|
|
52
|
+
export declare function computePeakAlert(nowMs: number, config: PeakAlertConfig, lastAlertedAt: number, channel: RateChannel): PeakAlertHit | null;
|
|
49
53
|
//# sourceMappingURL=peak-alert.d.ts.map
|
|
@@ -204,6 +204,28 @@ export declare function upcomingTierSwitch(nowMs: number, leadMs: number): {
|
|
|
204
204
|
entering: PriceTierId;
|
|
205
205
|
atMs: number;
|
|
206
206
|
} | null;
|
|
207
|
+
/** 计费通道的峰谷窗口:无窗口 / DeepSeek 按量分时 / 智谱 Coding Plan 积分分时。 */
|
|
208
|
+
export type RateChannel = 'none' | 'deepseek-metered' | 'zhipu-coding-plan';
|
|
209
|
+
/**
|
|
210
|
+
* 由会话当前模型与订阅状态推断峰谷窗口。DeepSeek 目录模型恒为按量分时;
|
|
211
|
+
* 智谱模型仅在持有 Z.ai Coding Plan(status ok)时适用积分分时——智谱按量价
|
|
212
|
+
* 全天统一,不涉及峰谷。其余模型(含未收录)返回 none:不显示档位、不提醒,
|
|
213
|
+
* 峰谷提示严格跟随当前对话实际使用的模型而非全局规则。
|
|
214
|
+
* @param modelKey - 当前会话最近一轮的计费目录键(归因模型 key);无轮次时 undefined。
|
|
215
|
+
* @param hasZhipuPlan - 是否存在状态正常的 Z.ai Coding Plan 订阅。
|
|
216
|
+
* @returns 命中的峰谷窗口种类。
|
|
217
|
+
*/
|
|
218
|
+
export declare function rateChannelOf(modelKey: string | undefined, hasZhipuPlan: boolean): RateChannel;
|
|
219
|
+
/** 按计费通道的峰谷倒计时:none 返回 null(调用方据此隐藏档位 UI 与切换预告)。 */
|
|
220
|
+
export declare function channelCountdown(nowMs: number, channel: RateChannel): {
|
|
221
|
+
tier: PriceTierId;
|
|
222
|
+
nextSwitchInMs: number;
|
|
223
|
+
} | null;
|
|
224
|
+
/** 按计费通道的切换预告:语义同 upcomingTierSwitch,窗口取自通道;none 恒 null。 */
|
|
225
|
+
export declare function channelUpcomingSwitch(nowMs: number, channel: RateChannel, leadMs: number): {
|
|
226
|
+
entering: PriceTierId;
|
|
227
|
+
atMs: number;
|
|
228
|
+
} | null;
|
|
207
229
|
/**
|
|
208
230
|
* 切换倒计时短格式:`1h23m` / `45m` / `3m`。导出供测试:纯函数。
|
|
209
231
|
* @param ms - 剩余毫秒数。
|
|
@@ -24,5 +24,11 @@ export declare function hasCjk(name: string): boolean;
|
|
|
24
24
|
* @returns 未知路由桶返回 undefined(渲染层用 locale 文案兜底)。
|
|
25
25
|
*/
|
|
26
26
|
export declare function channelDisplayName(siteKey: string, lang?: ProviderLang): string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* 拆 direct 通道显示名的「直连 · X」前缀,返回路由名 X。
|
|
29
|
+
* @param displayName - channelDisplayName 的产物;官方直连(DeepSeek 官方)等非 direct 前缀名不匹配。
|
|
30
|
+
* @returns 非 direct 前缀名返回 undefined,调用方整名显示。
|
|
31
|
+
*/
|
|
32
|
+
export declare function directChannelRoute(displayName: string): string | undefined;
|
|
27
33
|
export {};
|
|
28
34
|
//# sourceMappingURL=provider-display.d.ts.map
|
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
|
+
"version": "1.3.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
7
7
|
"deepseek",
|