@kenz1117/dsh-ui-usage-billing 0.2.6 → 0.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/README.md +32 -4
- package/lib/client.js +764 -257
- package/lib/index.js +194 -63
- package/lib/types/aggregate.d.ts +73 -6
- package/lib/types/client/TrendChart.d.ts +5 -4
- package/lib/types/client/UsageBilling.d.ts +30 -4
- package/lib/types/client/apply.d.ts +31 -0
- package/lib/types/client/billing-service.d.ts +40 -0
- package/lib/types/client/budget-store.d.ts +32 -0
- package/lib/types/client/index.d.ts +2 -0
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/pricing.d.ts +0 -10
- package/lib/types/index.d.ts +5 -0
- package/package.json +2 -1
|
@@ -37,16 +37,6 @@ 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
|
-
/**
|
|
41
|
-
* Model keys served through a subscription plan (e.g. a coding plan or topic
|
|
42
|
-
* plan) instead of metered per-token API billing. Usage through these routes
|
|
43
|
-
* costs no tokens: the estimator treats them as ¥0 and the billing table
|
|
44
|
-
* labels them 订阅包含. Add any model key your deployment serves through a
|
|
45
|
-
* plan here; leave empty when every route is pay-as-you-go.
|
|
46
|
-
*/
|
|
47
|
-
export declare const SUBSCRIPTION_PLAN_KEYS: readonly string[];
|
|
48
|
-
/** Whether one stats model key is billed through a subscription plan. */
|
|
49
|
-
export declare function isSubscriptionPlan(key: string): boolean;
|
|
50
40
|
/** Usage buckets consumed by one model (counts in raw tokens). */
|
|
51
41
|
export interface TokenUsageBuckets {
|
|
52
42
|
/** Uncached input tokens. */
|
package/lib/types/index.d.ts
CHANGED
|
@@ -18,6 +18,11 @@ export interface UsageBillingConfig {
|
|
|
18
18
|
subscriptionProviders?: string[];
|
|
19
19
|
/** 余额查询用的 DeepSeek 凭据引用(环境变量名);默认 DEEPSEEK_API_KEY。 */
|
|
20
20
|
balanceApiKeyEnv?: string;
|
|
21
|
+
/** 月度预算(人民币元);设置后随 usage-stats 下发,仪表盘显示预算进度条。 */
|
|
22
|
+
monthlyBudget?: number;
|
|
23
|
+
/** 余额不足告警阈值(人民币元):余额低于此值时仪表盘每天提醒一次;
|
|
24
|
+
不设置则客户端按默认阈值(50 元)兜底。 */
|
|
25
|
+
lowBalanceThreshold?: number;
|
|
21
26
|
}
|
|
22
27
|
/** Required services: the web server and the persisted session log store. */
|
|
23
28
|
export declare const inject: 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": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"@deepseek-ai/dsh-client-ui-sidebar": "*",
|
|
57
57
|
"@deepseek-ai/dsh-client-ui-primitives": "*",
|
|
58
58
|
"@deepseek-ai/dsh-client-ui-slots": "*",
|
|
59
|
+
"@deepseek-ai/dsh-credentials": "*",
|
|
59
60
|
"@deepseek-ai/dsh-invariants": "*",
|
|
60
61
|
"@deepseek-ai/dsh-llm": "*",
|
|
61
62
|
"@deepseek-ai/dsh-session": "*",
|