@kenz1117/dsh-ui-usage-billing 0.4.2 → 0.5.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/README.md +12 -11
- package/lib/client.js +1177 -995
- package/lib/index.js +7 -3
- package/lib/types/client/TrendChart.d.ts +4 -1
- package/lib/types/client/UsageBilling.d.ts +27 -4
- package/lib/types/client/anomaly.d.ts +52 -0
- package/lib/types/client/heatmap.d.ts +35 -0
- package/lib/types/client/live-cost.d.ts +55 -0
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/pricing.d.ts +5 -0
- package/lib/types/client/round-chart.d.ts +37 -0
- package/lib/types/index.d.ts +2 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -272,7 +272,8 @@ const MODEL_CATALOG = [
|
|
|
272
272
|
input: 4,
|
|
273
273
|
cacheHit: .4,
|
|
274
274
|
output: 12
|
|
275
|
-
}
|
|
275
|
+
},
|
|
276
|
+
estimated: true
|
|
276
277
|
},
|
|
277
278
|
{
|
|
278
279
|
key: "minimax",
|
|
@@ -356,7 +357,8 @@ const MODEL_CATALOG = [
|
|
|
356
357
|
input: 5,
|
|
357
358
|
cacheHit: .5,
|
|
358
359
|
output: 10
|
|
359
|
-
}
|
|
360
|
+
},
|
|
361
|
+
estimated: true
|
|
360
362
|
},
|
|
361
363
|
{
|
|
362
364
|
key: "sensenova",
|
|
@@ -368,7 +370,8 @@ const MODEL_CATALOG = [
|
|
|
368
370
|
input: 4.5,
|
|
369
371
|
cacheHit: .45,
|
|
370
372
|
output: 9
|
|
371
|
-
}
|
|
373
|
+
},
|
|
374
|
+
estimated: true
|
|
372
375
|
},
|
|
373
376
|
{
|
|
374
377
|
key: "baichuan",
|
|
@@ -1684,6 +1687,7 @@ const inject = [
|
|
|
1684
1687
|
* 订阅 provider id(llm-pi-ai 设置键)→ billing 适配器 key 的映射。
|
|
1685
1688
|
* 复用 dsh 既有的 llm-pi-ai provider 配置(apiKeyEnv 引用),不引入新配置面。
|
|
1686
1689
|
*/
|
|
1690
|
+
/** key 只取字符串凭据字段:zaiRegion 是区域枚举,由下方区域逻辑单独赋值。 */
|
|
1687
1691
|
const SUBSCRIPTION_KEY_SOURCES = [
|
|
1688
1692
|
{
|
|
1689
1693
|
provider: "kimi-coding",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* A hover crosshair shows the day's model breakdown. No chart library — the
|
|
9
9
|
* surface stays self-contained and offline.
|
|
10
10
|
*/
|
|
11
|
+
import { type CostCurrency } from './pricing.ts';
|
|
11
12
|
/** One model's legend identity: key, display name, and brand color. */
|
|
12
13
|
export interface TrendSeriesModel {
|
|
13
14
|
/** Stats key (`byModel` key), also the `byModel` map key. */
|
|
@@ -32,9 +33,11 @@ export interface TrendPoint {
|
|
|
32
33
|
* Render the daily stacked cost bars plus the total-calls line.
|
|
33
34
|
* @param props.data - sorted daily rows (ascending date).
|
|
34
35
|
* @param props.models - the model legend, in bar order.
|
|
36
|
+
* @param props.currency - display currency for the cost labels.
|
|
35
37
|
*/
|
|
36
|
-
export declare function TrendChart({ data, models }: {
|
|
38
|
+
export declare function TrendChart({ data, models, currency }: {
|
|
37
39
|
data: readonly TrendPoint[];
|
|
38
40
|
models?: readonly TrendSeriesModel[];
|
|
41
|
+
currency?: CostCurrency;
|
|
39
42
|
}): React.ReactNode;
|
|
40
43
|
//# sourceMappingURL=TrendChart.d.ts.map
|
|
@@ -12,22 +12,33 @@
|
|
|
12
12
|
import type { InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime, PropsStore } from '@deepseek-ai/dsh-client-ui-slots';
|
|
13
13
|
import type { SidebarFooterActionOwnerProps } from '@deepseek-ai/dsh-client-ui-sidebar/client';
|
|
14
14
|
import type { createBillingBudgetStore } from './budget-store.ts';
|
|
15
|
-
import { NS } from './locales.ts';
|
|
15
|
+
import { NS, type UsageBillingKey } from './locales.ts';
|
|
16
16
|
/** Model-connectivity health reported by the host model directory probe. */
|
|
17
17
|
export interface ModelHealth {
|
|
18
18
|
/** Whether the probe completed (false while still loading). */
|
|
19
19
|
checked: boolean;
|
|
20
20
|
/** True when at least one connected provider answered its model catalog. */
|
|
21
21
|
available: boolean;
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
/**
|
|
22
|
+
/** 可用模型总数:累加每个厂商成功 advertise 的模型数,而非厂商数。 */
|
|
23
|
+
models: number;
|
|
24
|
+
/** 失效厂商数(目录探测失败的厂商;失败信息不细分到模型级)。 */
|
|
25
25
|
failures: number;
|
|
26
26
|
/** Display names of providers that answered their model catalog (live). */
|
|
27
27
|
okProviders: readonly string[];
|
|
28
28
|
/** Display names of providers whose catalog probe failed. */
|
|
29
29
|
badProviders: readonly string[];
|
|
30
30
|
}
|
|
31
|
+
/** 仪表盘分区 Tab id。 */
|
|
32
|
+
export type DashboardTab = 'overview' | 'trends' | 'providers' | 'details' | 'pricing';
|
|
33
|
+
/**
|
|
34
|
+
* Tab 定义(顺序即渲染顺序):概览=主数字/预算/KPI/热力图,趋势=趋势图/每轮费用,
|
|
35
|
+
* 厂商=厂商计费与订阅,明细=工作区/会话明细,单价=模型单价表。导出供测试断言
|
|
36
|
+
* tab 与文案 key 对齐、decor 锚点落在正确分区。
|
|
37
|
+
*/
|
|
38
|
+
export declare const DASHBOARD_TABS: readonly {
|
|
39
|
+
id: DashboardTab;
|
|
40
|
+
labelKey: UsageBillingKey;
|
|
41
|
+
}[];
|
|
31
42
|
/**
|
|
32
43
|
* The dashboard's display names (中文厂商名) never equal the provider names a
|
|
33
44
|
* user actually configures (deepseek, zhipu, qwen…), so the dot match also
|
|
@@ -44,6 +55,18 @@ export declare const PROVIDER_ALIASES: Readonly<Record<string, readonly string[]
|
|
|
44
55
|
* 导出供守卫测试:短别名(mi/yi)仅允许前缀形式,防止 minimax 等误吞。
|
|
45
56
|
*/
|
|
46
57
|
export declare function providerFromModelKey(modelKey: string): string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* 本月预计总花费:按本月已有记录的平均日消耗 × 本月天数外推;无本月记录时
|
|
60
|
+
* 回退为最近 7 天日均 × 本月天数;无任何记录时返回 0(调用方不展示)。
|
|
61
|
+
* 导出供测试:纯函数,不依赖组件。
|
|
62
|
+
* @param byDay - 按日费用表。
|
|
63
|
+
* @param monthPrefix - 本月前缀(YYYY-MM)。
|
|
64
|
+
* @param today - 今日日期戳(YYYY-MM-DD)。
|
|
65
|
+
* @returns 本月预计花费(人民币元);无数据时为 0。
|
|
66
|
+
*/
|
|
67
|
+
export declare function projectMonthCost(byDay: Record<string, {
|
|
68
|
+
cost: number;
|
|
69
|
+
}>, monthPrefix: string, today: string): number;
|
|
47
70
|
/** 组件注入面:探活 + 计费指标写入(billing 自身写入,主题插件经服务读取)。 */
|
|
48
71
|
export interface UsageBillingInjected {
|
|
49
72
|
checkModels: () => Promise<ModelHealth>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cost-spike anomaly detection (pure): marks turns whose cost exceeds a
|
|
3
|
+
* rolling baseline, with attribution chips. Shared by the per-turn chart and
|
|
4
|
+
* any future surface; kept free of React so it unit-tests without a host.
|
|
5
|
+
*
|
|
6
|
+
* Adapted from the community dsh-usage-chart flagAnomalies semantics: the
|
|
7
|
+
* baseline is the previous up-to-`window` turns (rows without a cost are
|
|
8
|
+
* skipped, so the window counts effective rows).
|
|
9
|
+
*/
|
|
10
|
+
/** 异常归因 chip:输出增长 / 上下文膨胀 / 缓存命中率下降。 */
|
|
11
|
+
export type AnomalyReason = 'output-growth' | 'context-bloat' | 'cache-hit-drop';
|
|
12
|
+
/** 一轮异常标记(按会话+轮次定位)。 */
|
|
13
|
+
export interface AnomalyFlag {
|
|
14
|
+
/** 会话 id(与数据行一致,用于定位该轮)。 */
|
|
15
|
+
sessionId: string;
|
|
16
|
+
/** 会话内轮次号。 */
|
|
17
|
+
turn: number;
|
|
18
|
+
/** 该轮成本(人民币元)。 */
|
|
19
|
+
cost: number;
|
|
20
|
+
/** 归因原因(可为空:只有突增事实、无明确归因)。 */
|
|
21
|
+
reasons: readonly AnomalyReason[];
|
|
22
|
+
}
|
|
23
|
+
/** 异常判定所需的每轮数据形状(TurnUsageRow 的子集)。 */
|
|
24
|
+
export interface AnomalyRound {
|
|
25
|
+
sessionId: string;
|
|
26
|
+
turn: number;
|
|
27
|
+
/** 该轮成本;未估算(订阅/未知)时可为 0——基线窗口跳过 0 成本轮。 */
|
|
28
|
+
cost: number;
|
|
29
|
+
output: number;
|
|
30
|
+
input: number;
|
|
31
|
+
cacheHit: number;
|
|
32
|
+
cacheMiss: number;
|
|
33
|
+
}
|
|
34
|
+
/** 异常判定调参。 */
|
|
35
|
+
export interface AnomalyOptions {
|
|
36
|
+
/** 对比窗口:取该轮之前至多 window 轮做基线。默认 6。 */
|
|
37
|
+
window?: number;
|
|
38
|
+
/** 突增阈值:成本超过基线均值 × threshold 即标记。默认 2。 */
|
|
39
|
+
threshold?: number;
|
|
40
|
+
/** 归因阈值:输出/输入超过基线均值 × 该值归因为增长。默认 1.8。 */
|
|
41
|
+
reasonFactor?: number;
|
|
42
|
+
/** 归因阈值:缓存命中率低于基线该百分点归因为下降。默认 15。 */
|
|
43
|
+
reasonHitDropPp?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 标记成本异常轮次(按时间顺序传入;最近的轮次排在末尾)。
|
|
47
|
+
* @param rounds - 按起始时间升序的轮次序列(最早在前)。
|
|
48
|
+
* @param options - 窗口/阈值/归因灵敏度。
|
|
49
|
+
* @returns 异常标记数组(保持输入顺序)。
|
|
50
|
+
*/
|
|
51
|
+
export declare function flagAnomalies(rounds: readonly AnomalyRound[], options?: AnomalyOptions): AnomalyFlag[];
|
|
52
|
+
//# sourceMappingURL=anomaly.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UsageHeatmap: dependency-free month calendar heatmap of daily cost.
|
|
3
|
+
*
|
|
4
|
+
* Styled after an "activity map": one large rounded cell per day with the
|
|
5
|
+
* date number printed inside, laid out in a 7-column grid (Sunday-first).
|
|
6
|
+
* Week-first data layout: each week is one array element of 7 cells, so the
|
|
7
|
+
* grid auto-rows place them correctly without per-cell gridColumnStart hacks.
|
|
8
|
+
* Cell intensity is the day's cost quantized to five levels against the month
|
|
9
|
+
* maximum (mint-green gradient, like the reference activity map). Leading
|
|
10
|
+
* slots before the 1st and trailing slots after the last day carry the
|
|
11
|
+
* cross-month dates as gray placeholders; future days of this month render as
|
|
12
|
+
* gray placeholders too. Hover shows the exact date and amount.
|
|
13
|
+
*/
|
|
14
|
+
import { type CostCurrency } from './pricing.ts';
|
|
15
|
+
/** One heatmap day. */
|
|
16
|
+
export interface HeatmapDay {
|
|
17
|
+
/** ISO date `YYYY-MM-DD` (local calendar). */
|
|
18
|
+
date: string;
|
|
19
|
+
/** Value to intensity-map (daily cost in CNY). */
|
|
20
|
+
value: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Render the month heatmap.
|
|
24
|
+
* @param props.days - daily cost rows (keys are `YYYY-MM-DD`).
|
|
25
|
+
* @param props.currency - display currency for the hover amount.
|
|
26
|
+
* @param props.now - anchor date (defaults to today); injectable for tests.
|
|
27
|
+
* @param props.t - locale function (used for the legend labels).
|
|
28
|
+
*/
|
|
29
|
+
export declare function UsageHeatmap({ days, currency, now, t }: {
|
|
30
|
+
days: readonly HeatmapDay[];
|
|
31
|
+
currency: CostCurrency;
|
|
32
|
+
now?: Date;
|
|
33
|
+
t: (key: 'billing.costAbbr' | 'billing.noData' | 'billing.heatmapLess' | 'billing.heatmapMore') => string;
|
|
34
|
+
}): React.ReactNode;
|
|
35
|
+
//# sourceMappingURL=heatmap.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LiveCostBar: the session-scope cost ticker mounted on the composer's dock,
|
|
3
|
+
* showing the current session's accumulated spend and the latest turn's cost.
|
|
4
|
+
*
|
|
5
|
+
* It rides `conversation.composer.dock` (the stats-line family seat under the
|
|
6
|
+
* composer card, same posture as ui-conversation's own StatsLine), so it stays
|
|
7
|
+
* visible while working without opening the full dashboard. Data comes from the
|
|
8
|
+
* same `/api/billing/usage-stats` endpoint the dashboard polls; the bar reads
|
|
9
|
+
* the current session id off the framework snapshot (`useSession` parent of
|
|
10
|
+
* `sessionId`) and matches `bySession` (session total) and `byTurn` (latest
|
|
11
|
+
* turn cost). Rendering is a pure function of the snapshot, never a side effect.
|
|
12
|
+
*/
|
|
13
|
+
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-ui-slots';
|
|
14
|
+
import type { ConversationSnapshot } from '@deepseek-ai/dsh-client-runtime/client';
|
|
15
|
+
/** The usage-stats shape the composer bar needs (a thin slice, not the whole doc). */
|
|
16
|
+
export interface LiveStats {
|
|
17
|
+
bySession?: readonly {
|
|
18
|
+
id: string;
|
|
19
|
+
cost: number;
|
|
20
|
+
}[];
|
|
21
|
+
byTurn?: readonly {
|
|
22
|
+
sessionId: string;
|
|
23
|
+
turn: number;
|
|
24
|
+
cost: number;
|
|
25
|
+
}[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 当前会话累计费用:bySession 里会话 id 匹配的那行;缺省为 0。
|
|
29
|
+
* 导出供测试:纯函数。
|
|
30
|
+
* @param stats - 薄统计切片。
|
|
31
|
+
* @param sessionId - 当前会话 id。
|
|
32
|
+
* @returns 该会话累计费用(人民币元)。
|
|
33
|
+
*/
|
|
34
|
+
export declare function sessionCostOf(stats: LiveStats | null, sessionId: string | undefined): number;
|
|
35
|
+
/**
|
|
36
|
+
* 当前轮费用:byTurn 里该会话最新一轮的 cost;缺省为 0。
|
|
37
|
+
* byTurn 服务端按起始时间倒序下发,但求 max(turn) 更稳健(不依赖顺序)。
|
|
38
|
+
* 导出供测试:纯函数。
|
|
39
|
+
* @param stats - 薄统计切片。
|
|
40
|
+
* @param sessionId - 当前会话 id。
|
|
41
|
+
* @returns 最新一轮费用(人民币元)。
|
|
42
|
+
*/
|
|
43
|
+
export declare function turnCostOf(stats: LiveStats | null, sessionId: string | undefined): number;
|
|
44
|
+
/** Props: the session-scope snapshot selector the framework injects. */
|
|
45
|
+
export interface LiveCostBarProps {
|
|
46
|
+
useSession: SnapshotSelectorHook<ConversationSnapshot>;
|
|
47
|
+
/** The owning dock's locale seat (bound to the billing NS). */
|
|
48
|
+
t: (key: 'billing.liveTurn' | 'billing.liveSession') => string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Render the live cost ticker for the current session.
|
|
52
|
+
* @param props - framework session snapshot hook and locale.
|
|
53
|
+
*/
|
|
54
|
+
export declare function LiveCostBar({ useSession, t }: LiveCostBarProps): React.ReactNode;
|
|
55
|
+
//# sourceMappingURL=live-cost.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Locale dictionaries for the usage billing surface. */
|
|
2
|
-
export type UsageBillingKey = 'billing.title' | 'billing.subtitle' | 'billing.cost' | 'billing.todayCost' | 'billing.monthCost' | 'billing.yearCost' | 'billing.totalCost' | 'billing.calls' | 'billing.cacheHitRate' | 'billing.tokens' | 'billing.inputTokens' | 'billing.outputTokens' | 'billing.avgCost' | 'billing.trend' | 'billing.trend7d' | 'billing.trend30d' | 'billing.trendEmpty' | 'billing.budget' | 'billing.sessions' | 'billing.project' | 'billing.lastActive' | 'billing.sessionOverflow' | 'billing.budgetOverBody' | 'billing.models' | 'billing.estimated' | 'billing.actual' | 'billing.pricing' | 'billing.showPricing' | 'billing.hidePricing' | 'billing.pricePerM' | 'billing.input' | 'billing.output' | 'billing.cacheHit' | 'billing.peak' | 'billing.offPeak' | 'billing.flat' | 'billing.peakHours' | 'billing.band' | 'billing.openDashboard' | 'billing.close' | 'billing.lastUpdated' | 'billing.noData' | 'billing.todayRate' | 'billing.rateLive' | 'billing.rateBuiltin' | 'billing.balance' | 'billing.balanceUnconfigured' | 'billing.balanceUnauthorized' | 'billing.balanceUnreachable' | 'billing.uncatalogued' | 'billing.balanceDays' | 'billing.balanceLowBody';
|
|
2
|
+
export type UsageBillingKey = 'billing.title' | 'billing.subtitle' | 'billing.cost' | 'billing.todayCost' | 'billing.monthCost' | 'billing.yearCost' | 'billing.monthProjected' | 'billing.liveTurn' | 'billing.liveSession' | 'billing.totalCost' | 'billing.calls' | 'billing.cacheHitRate' | 'billing.tokens' | 'billing.inputTokens' | 'billing.outputTokens' | 'billing.avgCost' | 'billing.trend' | 'billing.trend7d' | 'billing.trend30d' | 'billing.trendEmpty' | 'billing.budget' | 'billing.sessions' | 'billing.project' | 'billing.lastActive' | 'billing.sessionOverflow' | 'billing.budgetOverBody' | 'billing.models' | 'billing.providerBilling' | 'billing.estimated' | 'billing.actual' | 'billing.pricing' | 'billing.showPricing' | 'billing.hidePricing' | 'billing.pricePerM' | 'billing.input' | 'billing.output' | 'billing.cacheHit' | 'billing.peak' | 'billing.offPeak' | 'billing.flat' | 'billing.peakHours' | 'billing.band' | 'billing.openDashboard' | 'billing.close' | 'billing.lastUpdated' | 'billing.noData' | 'billing.todayRate' | 'billing.rateLive' | 'billing.rateBuiltin' | 'billing.balance' | 'billing.balanceUnconfigured' | 'billing.balanceUnauthorized' | 'billing.balanceUnreachable' | 'billing.uncatalogued' | 'billing.estimatedPricing' | 'billing.balanceDays' | 'billing.balanceLowBody' | 'billing.subscriptions' | 'billing.subscriptionNotConfigured' | 'billing.subscriptionUnauthorized' | 'billing.subscriptionUnavailable' | 'billing.subscriptionInvalid' | 'billing.subscriptionRateLimited' | 'billing.subscriptionSession' | 'billing.subscriptionWeekly' | 'billing.subscriptionMonthly' | 'billing.subscriptionBilling' | 'billing.subscriptionRemaining' | 'billing.subscriptionReset' | 'billing.subscriptionNoApi' | 'billing.heatmapLess' | 'billing.heatmapMore' | 'billing.currency' | 'billing.currencyCny' | 'billing.currencyUsd' | 'billing.heatmap' | 'billing.rounds' | 'billing.anomaly' | 'billing.workspaces' | 'billing.plan' | 'billing.remaining' | 'billing.unknownModel' | 'billing.model' | 'billing.currentRound' | 'billing.costAbbr' | 'billing.tabOverview' | 'billing.tabTrends' | 'billing.tabProviders' | 'billing.tabDetails' | 'billing.tabPricing';
|
|
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>;
|
|
@@ -95,6 +95,11 @@ export interface ModelEntry {
|
|
|
95
95
|
price: ModelPrice;
|
|
96
96
|
/** Peak-hour window label for time-of-day priced models. */
|
|
97
97
|
peakHours?: string;
|
|
98
|
+
/**
|
|
99
|
+
* 单价为估算价:厂商未公布按量官方单价(公测 / 套餐制),表内价格为估算,
|
|
100
|
+
* 展示时标注以免误当正式定价;正式定价公布后移除。
|
|
101
|
+
*/
|
|
102
|
+
estimated?: boolean;
|
|
98
103
|
}
|
|
99
104
|
/**
|
|
100
105
|
* Built-in catalog of current mainstream models as of 2026-08-16, priced from
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RoundCostChart: dependency-free per-turn cost bars with spike markers.
|
|
3
|
+
*
|
|
4
|
+
* One bar per turn (most recent N, newest last), height scaled to the window
|
|
5
|
+
* maximum. Turns flagged by {@link flagAnomalies} get a warning outline and a
|
|
6
|
+
* corner marker; hover shows the turn's model, cost, and window time. Styling
|
|
7
|
+
* lives in the billing CSS module (`.rounds*`).
|
|
8
|
+
*/
|
|
9
|
+
import type { AnomalyFlag } from './anomaly.ts';
|
|
10
|
+
import { type CostCurrency } from './pricing.ts';
|
|
11
|
+
/** 每轮费用图的一行(TurnUsageRow 的展示子集)。 */
|
|
12
|
+
export interface RoundChartRow {
|
|
13
|
+
sessionId: string;
|
|
14
|
+
turn: number;
|
|
15
|
+
model: string;
|
|
16
|
+
cost: number;
|
|
17
|
+
input: number;
|
|
18
|
+
output: number;
|
|
19
|
+
cacheHit: number;
|
|
20
|
+
cacheMiss: number;
|
|
21
|
+
startedAt: number;
|
|
22
|
+
endedAt?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Render the per-turn cost bars.
|
|
26
|
+
* @param props.rounds - turns, most recent last (ascending startedAt); oldest beyond the limit are dropped.
|
|
27
|
+
* @param props.flags - spike flags matched by sessionId+turn.
|
|
28
|
+
* @param props.currency - display currency for the amount labels.
|
|
29
|
+
* @param props.t - locale function for the model label.
|
|
30
|
+
*/
|
|
31
|
+
export declare function RoundCostChart({ rounds, flags, currency, t }: {
|
|
32
|
+
rounds: readonly RoundChartRow[];
|
|
33
|
+
flags: readonly AnomalyFlag[];
|
|
34
|
+
currency: CostCurrency;
|
|
35
|
+
t: (key: 'billing.model' | 'billing.costAbbr') => string;
|
|
36
|
+
}): React.ReactNode;
|
|
37
|
+
//# sourceMappingURL=round-chart.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
import type { Context } from '@deepseek-ai/cordis';
|
|
13
13
|
import type { CredentialProvider } from '@deepseek-ai/dsh-credentials';
|
|
14
14
|
import type { SettingsProvider } from '@deepseek-ai/dsh-settings';
|
|
15
|
-
import
|
|
15
|
+
import type { SubscriptionPlanConfig } from './pricing-shared.ts';
|
|
16
|
+
import { type IdentifiedSubscriptionPlan, type SubscriptionKeys } from './subscriptions.ts';
|
|
16
17
|
/** Plugin configuration. */
|
|
17
18
|
export interface UsageBillingConfig {
|
|
18
19
|
/** Absolute path to a `.dsh-usage-stats.json` fallback file. */
|
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": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|