@kenz1117/dsh-ui-usage-billing 0.3.0 → 0.4.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 +44 -35
- package/lib/client.js +1080 -229
- package/lib/index.js +651 -33
- package/lib/types/aggregate.d.ts +50 -9
- package/lib/types/client/pricing.d.ts +41 -2
- package/lib/types/index.d.ts +17 -1
- package/lib/types/pricing-shared.d.ts +39 -0
- package/lib/types/subscriptions.d.ts +59 -0
- package/package.json +4 -1
package/lib/types/aggregate.d.ts
CHANGED
|
@@ -11,12 +11,8 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { SessionPersistence } from '@deepseek-ai/dsh-session-persistence';
|
|
13
13
|
import type { TokenUsage } from '@deepseek-ai/dsh-llm';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* as-is and price zero (they are not in the catalog; subscription-plan routes
|
|
17
|
-
* like kimi-coding / token plans fall here and therefore cost nothing).
|
|
18
|
-
*/
|
|
19
|
-
export declare const MODEL_KEY_ALIASES: Readonly<Record<string, string>>;
|
|
14
|
+
import { MODEL_KEY_ALIASES } from './client/pricing.ts';
|
|
15
|
+
export { MODEL_KEY_ALIASES };
|
|
20
16
|
/**
|
|
21
17
|
* 走订阅套餐(coding / token plan / opencode 订阅)的 provider id:这些通道的
|
|
22
18
|
* 调用按套餐计费,不再按 token 计费,因此即使模型 id 与计费表撞名也一律豁免。
|
|
@@ -51,10 +47,15 @@ export declare function emptyUsage(): ModelUsage;
|
|
|
51
47
|
* @param usage - the provider-reported usage of one call.
|
|
52
48
|
* @param key - the billing-catalog key this call belongs to.
|
|
53
49
|
* @param subscription - whether the call went through a subscription plan; such calls never cost money.
|
|
50
|
+
* @param timeMs - the call's wall-clock time (epoch ms); drives peak/off-peak pricing.
|
|
54
51
|
*/
|
|
55
|
-
export declare function foldUsage(acc: ModelUsage, usage: TokenUsage, key: string, subscription: boolean): void;
|
|
52
|
+
export declare function foldUsage(acc: ModelUsage, usage: TokenUsage, key: string, subscription: boolean, timeMs: number): void;
|
|
56
53
|
/** Local-time date stamp (the host runs in the user's timezone). */
|
|
57
54
|
export declare function dayStamp(time: number): string;
|
|
55
|
+
/** cwd 未知时工作区聚合的占位名(UI 显示 em dash,保持语言无关)。 */
|
|
56
|
+
export declare const UNKNOWN_WORKSPACE_NAME = "\u2014";
|
|
57
|
+
/** 工作区名:取 cwd 的末级目录名;无 cwd 时返回 {@link UNKNOWN_WORKSPACE_NAME}。 */
|
|
58
|
+
export declare function workspaceNameOf(cwd: string | undefined): string;
|
|
58
59
|
/**
|
|
59
60
|
* The persistence surface the aggregate reads: enough of
|
|
60
61
|
* `SessionPersistence` to list sessions and read each log once; `locate`
|
|
@@ -74,6 +75,10 @@ export interface UsageStatsDocument {
|
|
|
74
75
|
byDayModels: Record<string, Record<string, ModelUsage>>;
|
|
75
76
|
/** 会话明细:按费用倒序,封顶 {@link SESSION_ROW_LIMIT} 行;旧快照可能缺失。 */
|
|
76
77
|
bySession: SessionUsageRow[];
|
|
78
|
+
/** 每轮费用明细:按起始时间倒序,封顶 {@link TURN_ROW_LIMIT} 行;旧快照可能缺失。 */
|
|
79
|
+
byTurn?: TurnUsageRow[];
|
|
80
|
+
/** 工作区聚合:按 cwd 末级目录归并,按费用倒序;旧快照可能缺失。 */
|
|
81
|
+
byWorkspace?: WorkspaceUsageRow[];
|
|
77
82
|
}
|
|
78
83
|
/** 会话明细行:仪表盘「会话明细」面板的数据源。 */
|
|
79
84
|
export interface SessionUsageRow {
|
|
@@ -88,8 +93,42 @@ export interface SessionUsageRow {
|
|
|
88
93
|
/** 最后一个事件的时间戳(毫秒)。 */
|
|
89
94
|
lastActive: number;
|
|
90
95
|
}
|
|
96
|
+
/** 每轮费用明细行:仪表盘「每轮费用」图的数据源。 */
|
|
97
|
+
export interface TurnUsageRow {
|
|
98
|
+
/** 会话 id(字符串形式):不同会话的轮次号相互独立,展示时需区分。 */
|
|
99
|
+
sessionId: string;
|
|
100
|
+
/** 会话内轮次号。 */
|
|
101
|
+
turn: number;
|
|
102
|
+
/** 归因模型 key(计费目录键;未收录原样保留)。 */
|
|
103
|
+
model: string;
|
|
104
|
+
input: number;
|
|
105
|
+
output: number;
|
|
106
|
+
cacheHit: number;
|
|
107
|
+
cacheMiss: number;
|
|
108
|
+
/** 该轮成本(人民币元,按调用时刻精确判高峰/空闲档)。 */
|
|
109
|
+
cost: number;
|
|
110
|
+
/** 轮起始时刻(毫秒)。 */
|
|
111
|
+
startedAt: number;
|
|
112
|
+
/** 轮结束时刻(毫秒);未结束轮缺失。 */
|
|
113
|
+
endedAt?: number;
|
|
114
|
+
}
|
|
115
|
+
/** 会话内折叠的每轮行(不含 sessionId,合并时补齐)。 */
|
|
116
|
+
type SessionTurnRow = Omit<TurnUsageRow, 'sessionId'>;
|
|
117
|
+
/** 工作区聚合行:按会话 cwd 的末级目录归并。 */
|
|
118
|
+
export interface WorkspaceUsageRow {
|
|
119
|
+
/** 目录末级名;cwd 未知的会话归入「未命名」。 */
|
|
120
|
+
name: string;
|
|
121
|
+
calls: number;
|
|
122
|
+
cost: number;
|
|
123
|
+
input: number;
|
|
124
|
+
output: number;
|
|
125
|
+
/** 该工作区最近一次活跃时刻(毫秒)。 */
|
|
126
|
+
lastActive: number;
|
|
127
|
+
}
|
|
91
128
|
/** 会话明细行的响应封顶:控制 payload 体积,重度用户的完整长尾不逐行下发。 */
|
|
92
129
|
export declare const SESSION_ROW_LIMIT = 100;
|
|
130
|
+
/** 每轮费用行的响应封顶:同样控制 payload 体积。 */
|
|
131
|
+
export declare const TURN_ROW_LIMIT = 200;
|
|
93
132
|
/** 聚合文档的短 TTL(毫秒):合并密集轮询,TTL 内直接复用上次的合并结果。 */
|
|
94
133
|
export declare const AGGREGATE_TTL_MS = 5000;
|
|
95
134
|
/** One persisted session's folded usage plus drill-down metadata. */
|
|
@@ -100,6 +139,8 @@ interface SessionFold {
|
|
|
100
139
|
byDayModels: Map<string, Map<string, ModelUsage>>;
|
|
101
140
|
/** 每个模型 key 在本会话内走订阅通道的调用数(合并时跨会话累加判定 plan)。 */
|
|
102
141
|
planCalls: Map<string, number>;
|
|
142
|
+
/** 每轮费用明细(按轮次号升序,不含 sessionId);sessionId 在合并时补齐。 */
|
|
143
|
+
turns: SessionTurnRow[];
|
|
103
144
|
/** 日志里最新的 session/title 文本(无标题事件时 undefined)。 */
|
|
104
145
|
title?: string;
|
|
105
146
|
/** 最后一个事件的时间戳(毫秒);空日志为 0。 */
|
|
@@ -107,7 +148,8 @@ interface SessionFold {
|
|
|
107
148
|
}
|
|
108
149
|
/**
|
|
109
150
|
* Fold one session's events into a {@link SessionFold}. 每个 LLM 调用归属到
|
|
110
|
-
* 其前置 request/header
|
|
151
|
+
* 其前置 request/header 记录的模型;同时提取最新会话标题、最后活跃时间,
|
|
152
|
+
* 并按轮次折叠每轮费用明细(turn/start → turn/end;调用按 (turn) 归组)。
|
|
111
153
|
* @param events - the session's persisted events in log order.
|
|
112
154
|
* @param subscriptionProviders - provider ids billed through subscription plans.
|
|
113
155
|
* @returns the per-session fold (cached by the incremental aggregator).
|
|
@@ -140,5 +182,4 @@ export declare function createUsageAggregator(persistence: UsagePersistence, opt
|
|
|
140
182
|
* @returns the usage-stats document (same shape the dashboard expects).
|
|
141
183
|
*/
|
|
142
184
|
export declare function aggregateUsage(persistence: UsagePersistence, options?: AggregateOptions): Promise<UsageStatsDocument>;
|
|
143
|
-
export {};
|
|
144
185
|
//# sourceMappingURL=aggregate.d.ts.map
|
|
@@ -37,6 +37,21 @@ export declare function getRateInfo(): {
|
|
|
37
37
|
};
|
|
38
38
|
/** Default share of traffic assumed to fall in the peak band (0..1). */
|
|
39
39
|
export declare const DEFAULT_PEAK_SHARE = 0.5;
|
|
40
|
+
/** 计费时段档位:高峰 / 空闲(官方 DeepSeek 刊例价:高峰 = 空闲 × 2)。 */
|
|
41
|
+
export type PriceTierId = 'peak' | 'offPeak';
|
|
42
|
+
/** 成本显示币种:人民币(国内模型直价)/ 美元(国外模型直价或换算显示)。 */
|
|
43
|
+
export type CostCurrency = 'cny' | 'usd';
|
|
44
|
+
/**
|
|
45
|
+
* 高峰时段判定(北京时间,UTC+8,无夏令时):09:00–12:00、14:00–18:00。
|
|
46
|
+
* @param beijingHour - 北京时间的小时数(0–23)。
|
|
47
|
+
*/
|
|
48
|
+
export declare function isPeakHour(beijingHour: number): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 由时刻(epoch 毫秒)推断计费时段;时刻未知/非法时按高峰计(保守:未知
|
|
51
|
+
* 时刻不低估成本,与社区 dsh-usage-chart 的 tierAt 语义一致)。
|
|
52
|
+
* @param timeMs - Unix epoch 毫秒;null/undefined/NaN 视为未知。
|
|
53
|
+
*/
|
|
54
|
+
export declare function tierAt(timeMs: number | null | undefined): PriceTierId;
|
|
40
55
|
/** Usage buckets consumed by one model (counts in raw tokens). */
|
|
41
56
|
export interface TokenUsageBuckets {
|
|
42
57
|
/** Uncached input tokens. */
|
|
@@ -97,6 +112,13 @@ export interface ModelEntry {
|
|
|
97
112
|
* from 2026-08-17, and Gemini's Flex tier discounts spare-capacity traffic.
|
|
98
113
|
*/
|
|
99
114
|
export declare const MODEL_CATALOG: readonly ModelEntry[];
|
|
115
|
+
/**
|
|
116
|
+
* 真实 provider model id → 计费目录键(`MODEL_CATALOG[].key`)的映射。未知 id
|
|
117
|
+
* 原样保留并落回 `other`(未知模型不估算费用)。聚合层(aggregate.ts)在折叠时
|
|
118
|
+
* 用同一张表把日志里的 model id 归并为目录键,客户端渲染(`modelOf`)也按它
|
|
119
|
+
* 解析,两侧共用一份映射,避免同一模型两侧不一致导致「未收录」。
|
|
120
|
+
*/
|
|
121
|
+
export declare const MODEL_KEY_ALIASES: Readonly<Record<string, string>>;
|
|
100
122
|
/** Lookup a model by its stats key; falls back to the generic `other` entry. */
|
|
101
123
|
export declare function modelOf(key: string): ModelEntry;
|
|
102
124
|
/** Resolve a price-table row by its CSS variable name (theme token or fallback color). */
|
|
@@ -117,8 +139,25 @@ export declare function resolveToken(name: string): string;
|
|
|
117
139
|
* @returns the estimated cost in CNY.
|
|
118
140
|
*/
|
|
119
141
|
export declare function computeCost(entry: ModelEntry, buckets: TokenUsageBuckets, peakShare?: number): number;
|
|
120
|
-
/**
|
|
121
|
-
|
|
142
|
+
/**
|
|
143
|
+
* 按调用时刻精确判定高峰/空闲档并计价(P0-1:替代固定比例混合)。时刻未知
|
|
144
|
+
* (null/NaN,理论不发生在真实事件流)时回退 {@link DEFAULT_PEAK_SHARE} 混合,
|
|
145
|
+
* 保持旧语义不低估。平档模型(无 offPeak)两个时段同价。
|
|
146
|
+
* @param entry - the catalog entry whose prices apply.
|
|
147
|
+
* @param buckets - token usage counts.
|
|
148
|
+
* @param timeMs - the call's wall-clock time (epoch ms); null falls back to the peak-share mix.
|
|
149
|
+
* @param peakShare - fallback mix used only when `timeMs` is missing.
|
|
150
|
+
* @returns the estimated cost in the entry's native currency.
|
|
151
|
+
*/
|
|
152
|
+
export declare function computeCostAt(entry: ModelEntry, buckets: TokenUsageBuckets, timeMs: number | null | undefined, peakShare?: number): number;
|
|
153
|
+
/** 人民币 → 美元(显示换算用):1 USD = {@link USD_TO_CNY} CNY。 */
|
|
154
|
+
export declare function cnyToUsd(cny: number): number;
|
|
155
|
+
/**
|
|
156
|
+
* Format an amount with adaptive precision and the given currency symbol.
|
|
157
|
+
* @param amount - the amount (CNY by default; pass `usd` for dollar display).
|
|
158
|
+
* @param currency - display currency; default `cny`.
|
|
159
|
+
*/
|
|
160
|
+
export declare function formatMoney(amount: number, currency?: CostCurrency): string;
|
|
122
161
|
/**
|
|
123
162
|
* Format a per-1M-token price in its native currency (free when the rate is
|
|
124
163
|
* zero): CNY for domestic models, USD for overseas ones.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -10,12 +10,17 @@
|
|
|
10
10
|
* fabricated samples.
|
|
11
11
|
*/
|
|
12
12
|
import type { Context } from '@deepseek-ai/cordis';
|
|
13
|
+
import type { CredentialProvider } from '@deepseek-ai/dsh-credentials';
|
|
14
|
+
import type { SettingsProvider } from '@deepseek-ai/dsh-settings';
|
|
15
|
+
import { type IdentifiedSubscriptionPlan, type SubscriptionKeys, type SubscriptionPlanConfig } from './subscriptions.ts';
|
|
13
16
|
/** Plugin configuration. */
|
|
14
17
|
export interface UsageBillingConfig {
|
|
15
18
|
/** Absolute path to a `.dsh-usage-stats.json` fallback file. */
|
|
16
19
|
statsPath?: string;
|
|
17
20
|
/** 订阅制(coding / token / agent plan)provider id 列表;默认 kimi-coding、xiaomi-token-plan-cn。 */
|
|
18
21
|
subscriptionProviders?: string[];
|
|
22
|
+
/** 订阅套餐额度适配器(kimi / zai / opencode-go);默认全部内置。 */
|
|
23
|
+
subscriptionPlans?: readonly SubscriptionPlanConfig[];
|
|
19
24
|
/** 余额查询用的 DeepSeek 凭据引用(环境变量名);默认 DEEPSEEK_API_KEY。 */
|
|
20
25
|
balanceApiKeyEnv?: string;
|
|
21
26
|
/** 月度预算(人民币元);设置后随 usage-stats 下发,仪表盘显示预算进度条。 */
|
|
@@ -24,8 +29,19 @@ export interface UsageBillingConfig {
|
|
|
24
29
|
不设置则客户端按默认阈值(50 元)兜底。 */
|
|
25
30
|
lowBalanceThreshold?: number;
|
|
26
31
|
}
|
|
27
|
-
/** Required services: the web server
|
|
32
|
+
/** Required services: the web server, the persisted session log store, and user settings. */
|
|
28
33
|
export declare const inject: string[];
|
|
34
|
+
/**
|
|
35
|
+
* 解析订阅适配器需要的 API Key:从 llm-pi-ai 设置的 `providers.<id>.apiKeyEnv`
|
|
36
|
+
* 读引用(如 kimi-coding → KIMI_CODING_API_KEY),再经凭据 seam 解析成实际值。
|
|
37
|
+
* 同时识别出用户配置了 key 的订阅套餐(供面板只显示已识别的)。
|
|
38
|
+
* @param settings - the settings service (reads the llm-pi-ai namespace).
|
|
39
|
+
* @param credentials - the credentials service (resolves the env refs).
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveSubscriptionKeys(settings: SettingsProvider, credentials: CredentialProvider): Promise<{
|
|
42
|
+
keys: SubscriptionKeys;
|
|
43
|
+
identified: IdentifiedSubscriptionPlan[];
|
|
44
|
+
}>;
|
|
29
45
|
/**
|
|
30
46
|
* Host plugin body: serve real aggregated usage to the browser dashboard.
|
|
31
47
|
* @param ctx - host context carrying webServer and sessionPersistence.
|
|
@@ -47,4 +47,43 @@ export interface ProviderBalance {
|
|
|
47
47
|
export interface BalanceResponse {
|
|
48
48
|
balances: readonly ProviderBalance[];
|
|
49
49
|
}
|
|
50
|
+
/** Quota query result status; the dashboard maps each to a row state. */
|
|
51
|
+
export type SubscriptionStatus = 'ok' | 'not-configured' | 'unauthorized' | 'rate-limited' | 'unavailable' | 'invalid-response';
|
|
52
|
+
/** One quota window (session / weekly / monthly / billing). */
|
|
53
|
+
export interface SubscriptionWindow {
|
|
54
|
+
kind: 'session' | 'weekly' | 'monthly' | 'billing';
|
|
55
|
+
/** Used share in percent (0–100, one decimal). */
|
|
56
|
+
usedPercent: number;
|
|
57
|
+
/** Remaining share in percent (0–100, one decimal). */
|
|
58
|
+
remainingPercent: number;
|
|
59
|
+
/** ISO reset time; absent when the provider reports none. */
|
|
60
|
+
resetsAt?: string;
|
|
61
|
+
/** Absolute remaining amount; present when the provider reports one. */
|
|
62
|
+
remaining?: number;
|
|
63
|
+
}
|
|
64
|
+
/** One provider's subscription plan quota row. */
|
|
65
|
+
export interface SubscriptionQuota {
|
|
66
|
+
/** Adapter id: `kimi` / `zai` / `opencode-go`. */
|
|
67
|
+
provider: string;
|
|
68
|
+
/** Human display name (e.g. Kimi For Coding). */
|
|
69
|
+
displayName: string;
|
|
70
|
+
/** Plan label; absent when the provider did not name one. */
|
|
71
|
+
plan?: string;
|
|
72
|
+
status: SubscriptionStatus;
|
|
73
|
+
/** Quota windows, newest-window first; empty when the query failed. */
|
|
74
|
+
windows: readonly SubscriptionWindow[];
|
|
75
|
+
}
|
|
76
|
+
/** Response of `/api/billing/subscriptions`. */
|
|
77
|
+
export interface SubscriptionResponse {
|
|
78
|
+
quotas: readonly SubscriptionQuota[];
|
|
79
|
+
}
|
|
80
|
+
/** Config for one subscription adapter (validated in apply). */
|
|
81
|
+
export interface SubscriptionPlanConfig {
|
|
82
|
+
/** Adapter id: `kimi` / `zai` / `opencode-go`. */
|
|
83
|
+
provider: string;
|
|
84
|
+
/** API base URL override; defaults to the provider's public endpoint. */
|
|
85
|
+
baseUrl?: string;
|
|
86
|
+
/** Z.ai region override; defaults to the settings-namespace `zaiRegion`. */
|
|
87
|
+
region?: 'global' | 'bigmodel-cn';
|
|
88
|
+
}
|
|
50
89
|
//# sourceMappingURL=pricing-shared.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subscription-plan quota polling (node half): how much of each coding/token
|
|
3
|
+
* plan is left. The billing dashboard already exempts subscription providers
|
|
4
|
+
* from per-token cost; this module surfaces the REMAINING quota so the user
|
|
5
|
+
* sees plan headroom instead of a blank row.
|
|
6
|
+
*
|
|
7
|
+
* The panel shows only the plans the user actually configured: adapters with
|
|
8
|
+
* a known quota API (Kimi, Z.ai, OpenCode Go) query the remaining amount;
|
|
9
|
+
* other subscription providers the harness recognizes (volcengine / baidu /
|
|
10
|
+
* qwen / xiaomi token plans, agent plans…) are identified and listed with a
|
|
11
|
+
* "no quota API" marker rather than hidden. API keys come from the `llm-pi-ai`
|
|
12
|
+
* settings namespace (`apiKeyEnv` refs) resolved through the credentials seam.
|
|
13
|
+
*/
|
|
14
|
+
import type { SubscriptionPlanConfig, SubscriptionQuota } from './pricing-shared.ts';
|
|
15
|
+
/** 订阅适配器需要的凭据(来自 llm-pi-ai 设置命名空间)。 */
|
|
16
|
+
export interface SubscriptionKeys {
|
|
17
|
+
/** Kimi For Coding API key。 */
|
|
18
|
+
kimiApiKey: string;
|
|
19
|
+
/** Z.ai API key。 */
|
|
20
|
+
zaiApiKey: string;
|
|
21
|
+
/** OpenCode Go API key。 */
|
|
22
|
+
opencodeApiKey: string;
|
|
23
|
+
/** Z.ai 区域(global / bigmodel-cn)。 */
|
|
24
|
+
zaiRegion: 'global' | 'bigmodel-cn';
|
|
25
|
+
}
|
|
26
|
+
/** 空凭据:全部未配置时的初始值。 */
|
|
27
|
+
export declare const EMPTY_SUBSCRIPTION_KEYS: SubscriptionKeys;
|
|
28
|
+
/** 已识别的一个订阅套餐(用户在 llm-pi-ai 里配置了 key 的订阅类 provider)。 */
|
|
29
|
+
export interface IdentifiedSubscriptionPlan {
|
|
30
|
+
/** llm-pi-ai 的 provider id(如 kimi-coding、xiaomi-token-plan-cn)。 */
|
|
31
|
+
provider: string;
|
|
32
|
+
/** 显示名(映射表命中则用映射,否则用 id)。 */
|
|
33
|
+
displayName: string;
|
|
34
|
+
/** 是否有额度查询适配器。 */
|
|
35
|
+
adapter: boolean;
|
|
36
|
+
/** 适配器区域覆盖(zai-coding-cn → bigmodel-cn)。 */
|
|
37
|
+
region?: 'global' | 'bigmodel-cn';
|
|
38
|
+
}
|
|
39
|
+
/** 是否是订阅类 provider id(如 kimi-coding、xiaomi-token-plan-cn)。 */
|
|
40
|
+
export declare function isSubscriptionProviderId(providerId: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 从 llm-pi-ai 设置里识别订阅套餐:带订阅类 id 且配置了 apiKeyEnv 的 provider。
|
|
43
|
+
* @param providers - the `providers` map of the llm-pi-ai settings namespace.
|
|
44
|
+
* @returns identified plans in configuration order.
|
|
45
|
+
*/
|
|
46
|
+
export declare function identifySubscriptionPlans(providers: Record<string, {
|
|
47
|
+
apiKeyEnv?: string;
|
|
48
|
+
} | undefined> | undefined): IdentifiedSubscriptionPlan[];
|
|
49
|
+
/**
|
|
50
|
+
* Collect quota for the given plans concurrently (adapter-backed plans only;
|
|
51
|
+
* identified plans without an adapter are surfaced by the caller as "no
|
|
52
|
+
* quota API" rows).
|
|
53
|
+
* @param keys - the API keys from the llm-pi-ai settings namespace.
|
|
54
|
+
* @param plans - adapter-backed plans to poll; empty by default.
|
|
55
|
+
* @param timeoutMs - per-request timeout; defaults to 15s.
|
|
56
|
+
* @returns the quotas in plan order (unknown providers degrade to `unavailable`).
|
|
57
|
+
*/
|
|
58
|
+
export declare function collectSubscriptions(keys: SubscriptionKeys, plans?: readonly SubscriptionPlanConfig[], timeoutMs?: number): Promise<readonly SubscriptionQuota[]>;
|
|
59
|
+
//# sourceMappingURL=subscriptions.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": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -61,6 +61,8 @@
|
|
|
61
61
|
"@deepseek-ai/dsh-llm": "*",
|
|
62
62
|
"@deepseek-ai/dsh-session": "*",
|
|
63
63
|
"@deepseek-ai/dsh-session-persistence": "*",
|
|
64
|
+
"@deepseek-ai/dsh-settings": "*",
|
|
65
|
+
"@deepseek-ai/schemastery": "*",
|
|
64
66
|
"@deepseek-ai/cordis": "*",
|
|
65
67
|
"react": "^18.2.0"
|
|
66
68
|
},
|
|
@@ -74,6 +76,7 @@
|
|
|
74
76
|
"@deepseek-ai/dsh-client-ui-conversation": "*",
|
|
75
77
|
"@deepseek-ai/dsh-client-ui-primitives": "*",
|
|
76
78
|
"@deepseek-ai/dsh-client-ui-slots": "*",
|
|
79
|
+
"@deepseek-ai/dsh-client-web-react": "*",
|
|
77
80
|
"@deepseek-ai/dsh-invariants": "*",
|
|
78
81
|
"@testing-library/react": "^16.1.0",
|
|
79
82
|
"@types/react": "~18.3.1",
|