@rayadesu/dsh-client-ui-billing 0.1.0 → 0.2.1
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.i18n.yaml +2 -2
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/lib/client.js +107 -103
- package/lib/invariant.js +3 -3
- package/lib/types/client/BalanceBadge.d.ts +2 -2
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/invariant.d.ts +2 -2
- package/package.json +3 -3
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# last confirmed-consistent state. Both languages carry equal authority; after
|
|
3
3
|
# editing either side, bring the other along and re-record both hashes with:
|
|
4
4
|
# git hash-object README.md README.zh.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 0856ee1b93e49f34da5f534ce189568b8157d157
|
|
6
|
+
README.zh.md: 80a4334b4eaf79636fbdad0ce9484f07dfb1f8e0
|
package/README.md
CHANGED
|
@@ -12,9 +12,9 @@ The badge is account-level even though the slot is session-scoped: the header ut
|
|
|
12
12
|
|
|
13
13
|
The spends follow the conversation and the balance stays a manual snapshot:
|
|
14
14
|
|
|
15
|
-
- **Spends follow
|
|
15
|
+
- **Spends follow settled turns, debounced** — the component subscribes to the current session's running flag through the framework `useSession` seat. When a prompt turn settles (the flag flips back to idle), it recomputes this session's spend (`billing/getSessionSpend`) and today's spend (`billing/getTodaySpend`), local pricing passes with no network request, so the spend lines stay live during an ongoing conversation. The recompute is debounced for two seconds, so a burst of turns (an agent continuing across turns) prices once instead of once per turn; the host-side cache (see `dsh-llm-billing`) then serves the first miss for the rest of the minute.
|
|
16
16
|
- **Balance is manual** — the account balance is fetched on mount, on session switch, and on the explicit refresh action (`billing/getBalance`). There is no polling and no automatic refetch: the balance line only changes when one of those events happens.
|
|
17
|
-
- **Refresh keeps the last values** — an in-flight refresh leaves the previous values on screen, and a failed refresh retains the last good value instead of blanking it.
|
|
17
|
+
- **Refresh keeps the last values** — an in-flight refresh leaves the previous values on screen, and a failed refresh retains the last good value instead of blanking it. The refresh action calls `billing/getTodaySpend(true)`, which bypasses the host-side cache; the turn-triggered recompute and the mount/session-switch read use the cached path.
|
|
18
18
|
|
|
19
19
|
## Model Experience
|
|
20
20
|
|
package/README.zh.md
CHANGED
|
@@ -12,9 +12,9 @@ Web 额度特性的归属方:向 `conversation.session.header.utilities` 贡
|
|
|
12
12
|
|
|
13
13
|
花费跟随会话、额度保持手动快照:
|
|
14
14
|
|
|
15
|
-
-
|
|
15
|
+
- **花费随回合结束自动更新(去抖)** —— 组件通过框架 `useSession` 座位订阅当前会话的「运行中」标志。每当一轮 prompt 回合结束(标志翻回空闲),就只重算**本会话的花费**(`billing/getSessionSpend`)与**今日共花费**(`billing/getTodaySpend`,纯本地计价、不发网络请求),连续对话时花费行实时跟随。重算有 2 秒去抖,回合突发(agent 连续多轮)只计价一次;宿主侧缓存(见 `dsh-llm-billing`)随后在一分钟内服务首次未命中。
|
|
16
16
|
- **额度保持手动** —— 账户余额在挂载、切换会话、点刷新按钮时拉取(`billing/getBalance`)。**没有轮询、不会自动重拉**:余额行只在这几个时机变化。
|
|
17
|
-
- **刷新保留旧值** ——
|
|
17
|
+
- **刷新保留旧值** —— 刷新在途时旧值留在屏幕上,刷新失败保留上一次有效值,不清空。刷新按钮调用 `billing/getTodaySpend(true)`,绕过宿主侧缓存;回合结束触发的重算与挂载/切换会话的读取走缓存路径。
|
|
18
18
|
|
|
19
19
|
## 模型体验
|
|
20
20
|
|
package/lib/client.js
CHANGED
|
@@ -4,10 +4,10 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
7
|
let react = require("react");
|
|
9
8
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
10
|
-
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
|
|
11
11
|
var _a$1;
|
|
12
12
|
function $constructor(name, initializer, params) {
|
|
13
13
|
function init(inst, def) {
|
|
@@ -66,7 +66,7 @@ window.__ModuleLoader__.load({
|
|
|
66
66
|
return globalConfig;
|
|
67
67
|
}
|
|
68
68
|
//#endregion
|
|
69
|
-
//#region node_modules
|
|
69
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
|
|
70
70
|
function getEnumValues(entries) {
|
|
71
71
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
72
72
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -378,7 +378,7 @@ window.__ModuleLoader__.load({
|
|
|
378
378
|
return { ...iss };
|
|
379
379
|
}
|
|
380
380
|
//#endregion
|
|
381
|
-
//#region node_modules
|
|
381
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
|
|
382
382
|
const initializer$1 = (inst, def) => {
|
|
383
383
|
inst.name = "$ZodError";
|
|
384
384
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -438,7 +438,7 @@ window.__ModuleLoader__.load({
|
|
|
438
438
|
return fieldErrors;
|
|
439
439
|
}
|
|
440
440
|
//#endregion
|
|
441
|
-
//#region node_modules
|
|
441
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
|
|
442
442
|
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
443
443
|
const ctx = _ctx ? {
|
|
444
444
|
..._ctx,
|
|
@@ -552,7 +552,7 @@ window.__ModuleLoader__.load({
|
|
|
552
552
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
553
553
|
};
|
|
554
554
|
//#endregion
|
|
555
|
-
//#region node_modules
|
|
555
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
|
|
556
556
|
/**
|
|
557
557
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
558
558
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -616,7 +616,7 @@ window.__ModuleLoader__.load({
|
|
|
616
616
|
const lowercase = /^[^A-Z]*$/;
|
|
617
617
|
const uppercase = /^[^a-z]*$/;
|
|
618
618
|
//#endregion
|
|
619
|
-
//#region node_modules
|
|
619
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
|
|
620
620
|
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
621
621
|
var _a;
|
|
622
622
|
inst._zod ?? (inst._zod = {});
|
|
@@ -974,7 +974,7 @@ window.__ModuleLoader__.load({
|
|
|
974
974
|
};
|
|
975
975
|
});
|
|
976
976
|
//#endregion
|
|
977
|
-
//#region node_modules
|
|
977
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js
|
|
978
978
|
var Doc = class {
|
|
979
979
|
constructor(args = []) {
|
|
980
980
|
this.content = [];
|
|
@@ -1005,14 +1005,14 @@ window.__ModuleLoader__.load({
|
|
|
1005
1005
|
}
|
|
1006
1006
|
};
|
|
1007
1007
|
//#endregion
|
|
1008
|
-
//#region node_modules
|
|
1008
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
|
|
1009
1009
|
const version = {
|
|
1010
1010
|
major: 4,
|
|
1011
1011
|
minor: 4,
|
|
1012
1012
|
patch: 3
|
|
1013
1013
|
};
|
|
1014
1014
|
//#endregion
|
|
1015
|
-
//#region node_modules
|
|
1015
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
|
|
1016
1016
|
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1017
1017
|
var _a;
|
|
1018
1018
|
inst ?? (inst = {});
|
|
@@ -2115,7 +2115,7 @@ window.__ModuleLoader__.load({
|
|
|
2115
2115
|
}
|
|
2116
2116
|
}
|
|
2117
2117
|
//#endregion
|
|
2118
|
-
//#region node_modules
|
|
2118
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
|
|
2119
2119
|
var _a;
|
|
2120
2120
|
var $ZodRegistry = class {
|
|
2121
2121
|
constructor() {
|
|
@@ -2162,7 +2162,7 @@ window.__ModuleLoader__.load({
|
|
|
2162
2162
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
2163
2163
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
2164
2164
|
//#endregion
|
|
2165
|
-
//#region node_modules
|
|
2165
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
|
|
2166
2166
|
// @__NO_SIDE_EFFECTS__
|
|
2167
2167
|
function _string(Class, params) {
|
|
2168
2168
|
return new Class({
|
|
@@ -2667,7 +2667,7 @@ window.__ModuleLoader__.load({
|
|
|
2667
2667
|
return ch;
|
|
2668
2668
|
}
|
|
2669
2669
|
//#endregion
|
|
2670
|
-
//#region node_modules
|
|
2670
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
|
|
2671
2671
|
function initializeContext(params) {
|
|
2672
2672
|
let target = params?.target ?? "draft-2020-12";
|
|
2673
2673
|
if (target === "draft-4") target = "draft-04";
|
|
@@ -2960,7 +2960,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2960
2960
|
return finalize(ctx, schema);
|
|
2961
2961
|
};
|
|
2962
2962
|
//#endregion
|
|
2963
|
-
//#region node_modules
|
|
2963
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
|
|
2964
2964
|
const formatMap = {
|
|
2965
2965
|
guid: "uuid",
|
|
2966
2966
|
url: "uri",
|
|
@@ -3168,7 +3168,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3168
3168
|
seen.ref = def.innerType;
|
|
3169
3169
|
};
|
|
3170
3170
|
//#endregion
|
|
3171
|
-
//#region node_modules
|
|
3171
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
|
|
3172
3172
|
const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
|
|
3173
3173
|
$ZodISODateTime.init(inst, def);
|
|
3174
3174
|
ZodStringFormat.init(inst, def);
|
|
@@ -3198,7 +3198,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3198
3198
|
return /* @__PURE__ */ _isoDuration(ZodISODuration, params);
|
|
3199
3199
|
}
|
|
3200
3200
|
//#endregion
|
|
3201
|
-
//#region node_modules
|
|
3201
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js
|
|
3202
3202
|
const initializer = (inst, issues) => {
|
|
3203
3203
|
$ZodError.init(inst, issues);
|
|
3204
3204
|
inst.name = "ZodError";
|
|
@@ -3220,7 +3220,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3220
3220
|
};
|
|
3221
3221
|
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, { Parent: Error });
|
|
3222
3222
|
//#endregion
|
|
3223
|
-
//#region node_modules
|
|
3223
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
|
|
3224
3224
|
const parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
3225
3225
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
3226
3226
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -3234,7 +3234,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3234
3234
|
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
3235
3235
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
3236
3236
|
//#endregion
|
|
3237
|
-
//#region node_modules
|
|
3237
|
+
//#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
|
|
3238
3238
|
const _installedGroups = /* @__PURE__ */ new WeakMap();
|
|
3239
3239
|
function _installLazyMethods(inst, group, methods) {
|
|
3240
3240
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -3989,7 +3989,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3989
3989
|
return /* @__PURE__ */ _superRefine(fn, params);
|
|
3990
3990
|
}
|
|
3991
3991
|
//#endregion
|
|
3992
|
-
//#region
|
|
3992
|
+
//#region ../../llm/llm-billing/lib/typert.remote-client.js
|
|
3993
3993
|
const _deepseek_ai_dsh_llm_billing_billing_getBalance_result$schema = object({
|
|
3994
3994
|
"isAvailable": boolean(),
|
|
3995
3995
|
"lines": array(object({
|
|
@@ -4033,10 +4033,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4033
4033
|
}))
|
|
4034
4034
|
});
|
|
4035
4035
|
const TYPERT_REMOTE = {
|
|
4036
|
-
package: "@
|
|
4036
|
+
package: "@deepseek-ai/dsh-llm-billing",
|
|
4037
4037
|
descriptors: [
|
|
4038
4038
|
{
|
|
4039
|
-
id: "@
|
|
4039
|
+
id: "@deepseek-ai/dsh-llm-billing#billing/getBalance",
|
|
4040
4040
|
service: "billing",
|
|
4041
4041
|
namespace: "billing",
|
|
4042
4042
|
method: "getBalance",
|
|
@@ -4044,7 +4044,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4044
4044
|
parameters: [],
|
|
4045
4045
|
result: {
|
|
4046
4046
|
mode: "strict",
|
|
4047
|
-
typeSymbol: "@
|
|
4047
|
+
typeSymbol: "@deepseek-ai/dsh-llm-billing/types#DeepSeekBalance",
|
|
4048
4048
|
schema: _deepseek_ai_dsh_llm_billing_billing_getBalance_result$schema
|
|
4049
4049
|
},
|
|
4050
4050
|
sourceLocation: {
|
|
@@ -4054,7 +4054,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4054
4054
|
}
|
|
4055
4055
|
},
|
|
4056
4056
|
{
|
|
4057
|
-
id: "@
|
|
4057
|
+
id: "@deepseek-ai/dsh-llm-billing#billing/getSessionSpend",
|
|
4058
4058
|
service: "billing",
|
|
4059
4059
|
namespace: "billing",
|
|
4060
4060
|
method: "getSessionSpend",
|
|
@@ -4071,7 +4071,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4071
4071
|
}],
|
|
4072
4072
|
result: {
|
|
4073
4073
|
mode: "strict",
|
|
4074
|
-
typeSymbol: "@
|
|
4074
|
+
typeSymbol: "@deepseek-ai/dsh-llm-billing/types#DeepSeekSessionSpend",
|
|
4075
4075
|
schema: _deepseek_ai_dsh_llm_billing_billing_getSessionSpend_result$schema
|
|
4076
4076
|
},
|
|
4077
4077
|
sourceLocation: {
|
|
@@ -4081,7 +4081,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4081
4081
|
}
|
|
4082
4082
|
},
|
|
4083
4083
|
{
|
|
4084
|
-
id: "@
|
|
4084
|
+
id: "@deepseek-ai/dsh-llm-billing#billing/getTodaySpend",
|
|
4085
4085
|
service: "billing",
|
|
4086
4086
|
namespace: "billing",
|
|
4087
4087
|
method: "getTodaySpend",
|
|
@@ -4089,7 +4089,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4089
4089
|
parameters: [],
|
|
4090
4090
|
result: {
|
|
4091
4091
|
mode: "strict",
|
|
4092
|
-
typeSymbol: "@
|
|
4092
|
+
typeSymbol: "@deepseek-ai/dsh-llm-billing/types#DeepSeekTodaySpend",
|
|
4093
4093
|
schema: _deepseek_ai_dsh_llm_billing_billing_getTodaySpend_result$schema
|
|
4094
4094
|
},
|
|
4095
4095
|
sourceLocation: {
|
|
@@ -4101,8 +4101,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4101
4101
|
]
|
|
4102
4102
|
};
|
|
4103
4103
|
//#endregion
|
|
4104
|
-
//#region \0dsh-css
|
|
4105
|
-
const css = ".
|
|
4104
|
+
//#region \0dsh-css:/Users/raya/Developer/deepseek-harness/packages/client/ui-billing/src/client/BalanceBadge.module.css.mjs
|
|
4105
|
+
const css = ".EFxmGG_root{position:relative}.EFxmGG_trigger{background:var(--dsw-alias-fill-l2);min-height:32px;color:var(--dsw-alias-label-secondary);cursor:pointer;border:0;border-radius:8px;align-items:center;gap:4px;padding:4px 8px;display:inline-flex}.EFxmGG_trigger:hover,.EFxmGG_trigger:focus-visible{color:var(--dsw-alias-label-primary)}.EFxmGG_trigger svg{transition:transform .12s}.EFxmGG_chevronOpen{transform:rotate(180deg)}.EFxmGG_triggerLines{text-align:left;flex-direction:column;align-items:flex-start;gap:0;display:flex}.EFxmGG_linePrimary{font-variant-numeric:tabular-nums;font-size:12px;line-height:16px}.EFxmGG_lineSecondary{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:15px}.EFxmGG_unavailable{color:var(--dsw-alias-label-tertiary)}.EFxmGG_inlineIcon{color:var(--dsw-alias-label-tertiary);flex:none}.EFxmGG_spinning{color:var(--dsw-alias-label-tertiary);flex:none;animation:.8s linear infinite EFxmGG_spin}@keyframes EFxmGG_spin{to{transform:rotate(360deg)}}.EFxmGG_panel{z-index:100;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-specific-menu);width:336px;max-width:min(360px,100vw - 32px);box-shadow:var(--dsw-shadow-lv3);border-radius:12px;flex-direction:column;gap:2px;padding:6px;display:flex;position:absolute;top:calc(100% + 6px);right:0}.EFxmGG_amountRow{border-radius:8px;justify-content:space-between;align-items:center;gap:8px;padding:6px 8px;display:flex}.EFxmGG_amountLabel{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:13px;line-height:18px}.EFxmGG_spendRow{border-top:1px solid var(--dsw-alias-border-l2);border-radius:0;justify-content:space-between;align-items:center;gap:8px;padding:6px 8px;display:flex}.EFxmGG_costRow{align-items:center;padding:2px 8px 6px;display:flex}.EFxmGG_costBreakdown{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.EFxmGG_amountActions{align-items:center;gap:2px;display:inline-flex}.EFxmGG_infoButton,.EFxmGG_refreshButton{width:24px;height:24px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.EFxmGG_infoButton:hover,.EFxmGG_infoButton:focus-visible,.EFxmGG_refreshButton:hover,.EFxmGG_refreshButton:focus-visible{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-fill-l2)}.EFxmGG_modelRow{border-radius:8px;justify-content:space-between;align-items:baseline;gap:8px;padding:6px 8px;display:flex}.EFxmGG_modelName{color:var(--dsw-alias-label-secondary);flex:none;font-size:12px;line-height:18px}.EFxmGG_tasks{text-align:right;min-width:0;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;overflow-wrap:anywhere;font-size:12px;line-height:18px}";
|
|
4106
4106
|
const tagId = "@rayadesu/dsh-client-ui-billing/BalanceBadge.module.css";
|
|
4107
4107
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
4108
4108
|
const tag = document.createElement("style");
|
|
@@ -4112,31 +4112,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4112
4112
|
document.head.appendChild(tag);
|
|
4113
4113
|
}
|
|
4114
4114
|
var BalanceBadge_module_css_default = {
|
|
4115
|
-
"amountActions": "
|
|
4116
|
-
"amountLabel": "
|
|
4117
|
-
"amountRow": "
|
|
4118
|
-
"chevronOpen": "
|
|
4119
|
-
"costBreakdown": "
|
|
4120
|
-
"costRow": "
|
|
4121
|
-
"infoButton": "
|
|
4122
|
-
"inlineIcon": "
|
|
4123
|
-
"linePrimary": "
|
|
4124
|
-
"lineSecondary": "
|
|
4125
|
-
"modelName": "
|
|
4126
|
-
"modelRow": "
|
|
4127
|
-
"panel": "
|
|
4128
|
-
"refreshButton": "
|
|
4129
|
-
"root": "
|
|
4130
|
-
"spendRow": "
|
|
4131
|
-
"spin": "
|
|
4132
|
-
"spinning": "
|
|
4133
|
-
"tasks": "
|
|
4134
|
-
"trigger": "
|
|
4135
|
-
"triggerLines": "
|
|
4136
|
-
"unavailable": "
|
|
4115
|
+
"amountActions": "EFxmGG_amountActions",
|
|
4116
|
+
"amountLabel": "EFxmGG_amountLabel",
|
|
4117
|
+
"amountRow": "EFxmGG_amountRow",
|
|
4118
|
+
"chevronOpen": "EFxmGG_chevronOpen",
|
|
4119
|
+
"costBreakdown": "EFxmGG_costBreakdown",
|
|
4120
|
+
"costRow": "EFxmGG_costRow",
|
|
4121
|
+
"infoButton": "EFxmGG_infoButton",
|
|
4122
|
+
"inlineIcon": "EFxmGG_inlineIcon",
|
|
4123
|
+
"linePrimary": "EFxmGG_linePrimary",
|
|
4124
|
+
"lineSecondary": "EFxmGG_lineSecondary",
|
|
4125
|
+
"modelName": "EFxmGG_modelName",
|
|
4126
|
+
"modelRow": "EFxmGG_modelRow",
|
|
4127
|
+
"panel": "EFxmGG_panel",
|
|
4128
|
+
"refreshButton": "EFxmGG_refreshButton",
|
|
4129
|
+
"root": "EFxmGG_root",
|
|
4130
|
+
"spendRow": "EFxmGG_spendRow",
|
|
4131
|
+
"spin": "EFxmGG_spin",
|
|
4132
|
+
"spinning": "EFxmGG_spinning",
|
|
4133
|
+
"tasks": "EFxmGG_tasks",
|
|
4134
|
+
"trigger": "EFxmGG_trigger",
|
|
4135
|
+
"triggerLines": "EFxmGG_triggerLines",
|
|
4136
|
+
"unavailable": "EFxmGG_unavailable"
|
|
4137
4137
|
};
|
|
4138
4138
|
//#endregion
|
|
4139
|
-
//#region
|
|
4139
|
+
//#region src/client/BalanceBadge.tsx
|
|
4140
4140
|
/** Session-header billing badge: balance plus the current conversation's billed spend. */
|
|
4141
4141
|
/** Currency prefix for one balance line; unknown codes render as a literal prefix. */
|
|
4142
4142
|
function currencySymbol(currency) {
|
|
@@ -4165,10 +4165,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4165
4165
|
* every session, a refresh action, and a spend disclaimer. Refreshing keeps
|
|
4166
4166
|
* the last values visible rather than blanking them.
|
|
4167
4167
|
*
|
|
4168
|
-
* The spend follows the conversation: a
|
|
4169
|
-
* recomputes only the (local, network-free)
|
|
4170
|
-
* through `getSessionSpend` /
|
|
4171
|
-
* manual-refresh snapshot and is never
|
|
4168
|
+
* The spend follows the conversation: when a prompt turn settles in the
|
|
4169
|
+
* current session, the badge recomputes only the (local, network-free)
|
|
4170
|
+
* session spend and today's spend through `getSessionSpend` /
|
|
4171
|
+
* `getTodaySpend`; the balance stays a manual-refresh snapshot and is never
|
|
4172
|
+
* refetched on its own.
|
|
4172
4173
|
* @param props - Remote face, locale, and the standard session-header runtime share.
|
|
4173
4174
|
* @returns the badge, or null until the first balance fetch settles.
|
|
4174
4175
|
*/
|
|
@@ -4181,8 +4182,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4181
4182
|
const [open, setOpen] = (0, react.useState)(false);
|
|
4182
4183
|
const [request, setRequest] = (0, react.useState)(0);
|
|
4183
4184
|
const rootRef = (0, react.useRef)(null);
|
|
4184
|
-
const
|
|
4185
|
-
const
|
|
4185
|
+
const running = useSession((snapshot) => snapshot.running);
|
|
4186
|
+
const pricedRunningRef = (0, react.useRef)(running);
|
|
4186
4187
|
(0, react.useEffect)(() => {
|
|
4187
4188
|
let current = true;
|
|
4188
4189
|
setRefreshing(balance !== null);
|
|
@@ -4199,7 +4200,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4199
4200
|
if (!current) return;
|
|
4200
4201
|
setSpend(value);
|
|
4201
4202
|
}, () => {});
|
|
4202
|
-
const todaySpendRequest = Promise.resolve().then(getTodaySpend).then((value) => {
|
|
4203
|
+
const todaySpendRequest = Promise.resolve().then(() => getTodaySpend(request > 0)).then((value) => {
|
|
4203
4204
|
if (!current) return;
|
|
4204
4205
|
setTodaySpend(value);
|
|
4205
4206
|
}, () => {});
|
|
@@ -4222,27 +4223,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4222
4223
|
request
|
|
4223
4224
|
]);
|
|
4224
4225
|
(0, react.useEffect)(() => {
|
|
4225
|
-
if (
|
|
4226
|
-
|
|
4226
|
+
if (running === pricedRunningRef.current) return;
|
|
4227
|
+
pricedRunningRef.current = running;
|
|
4228
|
+
if (running) return;
|
|
4227
4229
|
let current = true;
|
|
4228
|
-
|
|
4229
|
-
Promise.resolve().then(() =>
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4230
|
+
const timer = setTimeout(() => {
|
|
4231
|
+
Promise.resolve().then(() => {
|
|
4232
|
+
Promise.resolve().then(() => getSessionSpend(sessionId)).then((value) => {
|
|
4233
|
+
if (!current) return;
|
|
4234
|
+
setSpend(value);
|
|
4235
|
+
}, () => {});
|
|
4236
|
+
Promise.resolve().then(() => getTodaySpend()).then((value) => {
|
|
4237
|
+
if (!current) return;
|
|
4238
|
+
setTodaySpend(value);
|
|
4239
|
+
}, () => {});
|
|
4240
|
+
});
|
|
4241
|
+
}, 2e3);
|
|
4238
4242
|
return () => {
|
|
4243
|
+
clearTimeout(timer);
|
|
4239
4244
|
current = false;
|
|
4240
4245
|
};
|
|
4241
4246
|
}, [
|
|
4242
4247
|
getSessionSpend,
|
|
4243
4248
|
getTodaySpend,
|
|
4244
4249
|
sessionId,
|
|
4245
|
-
|
|
4250
|
+
running
|
|
4246
4251
|
]);
|
|
4247
4252
|
(0, react.useEffect)(() => {
|
|
4248
4253
|
if (!open) return;
|
|
@@ -4256,20 +4261,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4256
4261
|
}, [open]);
|
|
4257
4262
|
if (balance === null) {
|
|
4258
4263
|
if (error === null) return null;
|
|
4259
|
-
return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
4264
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
4260
4265
|
label: error,
|
|
4261
4266
|
delayMs: 500,
|
|
4262
|
-
children: (0, react_jsx_runtime.jsxs)("button", {
|
|
4267
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4263
4268
|
type: "button",
|
|
4264
4269
|
className: BalanceBadge_module_css_default.trigger,
|
|
4265
4270
|
onClick: () => {
|
|
4266
4271
|
setRequest((value) => value + 1);
|
|
4267
4272
|
},
|
|
4268
4273
|
"aria-label": t("action.refresh"),
|
|
4269
|
-
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
4274
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4270
4275
|
className: BalanceBadge_module_css_default.unavailable,
|
|
4271
4276
|
children: t("state.unavailable")
|
|
4272
|
-
}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline14, { className: BalanceBadge_module_css_default.inlineIcon })]
|
|
4277
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline14, { className: BalanceBadge_module_css_default.inlineIcon })]
|
|
4273
4278
|
})
|
|
4274
4279
|
});
|
|
4275
4280
|
}
|
|
@@ -4279,10 +4284,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4279
4284
|
const line = primaryLine(balance);
|
|
4280
4285
|
const amount = line === void 0 ? "—" : `${line.symbol}${line.total}`;
|
|
4281
4286
|
const spendLine = spend !== null && spend.models.length > 0 ? t("trigger.conversationSpend", { amount: formatSpend(spend.total) }) : void 0;
|
|
4282
|
-
return (0, react_jsx_runtime.jsxs)("div", {
|
|
4287
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4283
4288
|
ref: rootRef,
|
|
4284
4289
|
className: BalanceBadge_module_css_default.root,
|
|
4285
|
-
children: [(0, react_jsx_runtime.jsxs)("button", {
|
|
4290
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4286
4291
|
type: "button",
|
|
4287
4292
|
className: BalanceBadge_module_css_default.trigger,
|
|
4288
4293
|
"aria-expanded": open,
|
|
@@ -4290,70 +4295,70 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4290
4295
|
onClick: () => {
|
|
4291
4296
|
setOpen((value) => !value);
|
|
4292
4297
|
},
|
|
4293
|
-
children: [(0, react_jsx_runtime.jsxs)("span", {
|
|
4298
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4294
4299
|
className: BalanceBadge_module_css_default.triggerLines,
|
|
4295
|
-
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
4300
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4296
4301
|
className: BalanceBadge_module_css_default.linePrimary,
|
|
4297
4302
|
children: t("trigger.balance", { amount })
|
|
4298
|
-
}), spendLine !== void 0 && (0, react_jsx_runtime.jsx)("span", {
|
|
4303
|
+
}), spendLine !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4299
4304
|
className: BalanceBadge_module_css_default.lineSecondary,
|
|
4300
4305
|
children: spendLine
|
|
4301
4306
|
})]
|
|
4302
|
-
}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { className: open ? BalanceBadge_module_css_default.chevronOpen : void 0 })]
|
|
4303
|
-
}), open ? (0, react_jsx_runtime.jsxs)("div", {
|
|
4307
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { className: open ? BalanceBadge_module_css_default.chevronOpen : void 0 })]
|
|
4308
|
+
}), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4304
4309
|
className: BalanceBadge_module_css_default.panel,
|
|
4305
4310
|
role: "dialog",
|
|
4306
4311
|
"aria-label": t("panel.aria"),
|
|
4307
4312
|
children: [
|
|
4308
|
-
(0, react_jsx_runtime.jsxs)("div", {
|
|
4313
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4309
4314
|
className: BalanceBadge_module_css_default.amountRow,
|
|
4310
|
-
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
4315
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4311
4316
|
className: BalanceBadge_module_css_default.amountLabel,
|
|
4312
4317
|
children: t("label.amount", { amount })
|
|
4313
|
-
}), (0, react_jsx_runtime.jsxs)("span", {
|
|
4318
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4314
4319
|
className: BalanceBadge_module_css_default.amountActions,
|
|
4315
|
-
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
4320
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
4316
4321
|
label: t("info.hint"),
|
|
4317
4322
|
delayMs: 200,
|
|
4318
4323
|
maxWidth: 340,
|
|
4319
|
-
children: (0, react_jsx_runtime.jsx)("button", {
|
|
4324
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4320
4325
|
type: "button",
|
|
4321
4326
|
className: BalanceBadge_module_css_default.infoButton,
|
|
4322
4327
|
"aria-label": t("info.aria"),
|
|
4323
|
-
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconQuestionOutline14, { className: BalanceBadge_module_css_default.inlineIcon })
|
|
4328
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconQuestionOutline14, { className: BalanceBadge_module_css_default.inlineIcon })
|
|
4324
4329
|
})
|
|
4325
|
-
}), (0, react_jsx_runtime.jsx)("button", {
|
|
4330
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4326
4331
|
type: "button",
|
|
4327
4332
|
className: BalanceBadge_module_css_default.refreshButton,
|
|
4328
4333
|
onClick: refresh,
|
|
4329
4334
|
"aria-label": t("action.refresh"),
|
|
4330
4335
|
"data-refreshing": refreshing || void 0,
|
|
4331
|
-
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline14, { className: refreshing ? BalanceBadge_module_css_default.spinning : BalanceBadge_module_css_default.inlineIcon })
|
|
4336
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline14, { className: refreshing ? BalanceBadge_module_css_default.spinning : BalanceBadge_module_css_default.inlineIcon })
|
|
4332
4337
|
})]
|
|
4333
4338
|
})]
|
|
4334
4339
|
}),
|
|
4335
|
-
(0, react_jsx_runtime.jsxs)("div", {
|
|
4340
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4336
4341
|
className: BalanceBadge_module_css_default.spendRow,
|
|
4337
|
-
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
4342
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4338
4343
|
className: BalanceBadge_module_css_default.amountLabel,
|
|
4339
4344
|
children: t("label.sessionSpend", { amount: spend === null ? "—" : spend.models.length === 0 ? t("stat.none") : formatSpend(spend.total) })
|
|
4340
|
-
}), (0, react_jsx_runtime.jsx)("span", {
|
|
4345
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4341
4346
|
className: BalanceBadge_module_css_default.amountLabel,
|
|
4342
4347
|
children: t("label.todaySpend", { amount: todaySpend === null ? "—" : todaySpend.models.length === 0 ? t("stat.none") : formatSpend(todaySpend.total) })
|
|
4343
4348
|
})]
|
|
4344
4349
|
}),
|
|
4345
|
-
spend?.models.map((model) => (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [(0, react_jsx_runtime.jsxs)("div", {
|
|
4350
|
+
spend?.models.map((model) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4346
4351
|
className: BalanceBadge_module_css_default.modelRow,
|
|
4347
|
-
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
4352
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4348
4353
|
className: BalanceBadge_module_css_default.modelName,
|
|
4349
4354
|
children: model.displayName
|
|
4350
|
-
}), (0, react_jsx_runtime.jsx)("span", {
|
|
4355
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4351
4356
|
className: BalanceBadge_module_css_default.tasks,
|
|
4352
4357
|
children: formatSpend(model.cost)
|
|
4353
4358
|
})]
|
|
4354
|
-
}), (0, react_jsx_runtime.jsx)("div", {
|
|
4359
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4355
4360
|
className: BalanceBadge_module_css_default.costRow,
|
|
4356
|
-
children: (0, react_jsx_runtime.jsxs)("span", {
|
|
4361
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4357
4362
|
className: BalanceBadge_module_css_default.costBreakdown,
|
|
4358
4363
|
children: [
|
|
4359
4364
|
t("label.cost.hit", { amount: formatSpend(model.cacheHitInputCost) }),
|
|
@@ -4369,7 +4374,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4369
4374
|
});
|
|
4370
4375
|
}
|
|
4371
4376
|
//#endregion
|
|
4372
|
-
//#region
|
|
4377
|
+
//#region src/client/locales.ts
|
|
4373
4378
|
/** `billing` namespace dictionaries. */
|
|
4374
4379
|
/** Dictionary namespace owned by this plugin. */
|
|
4375
4380
|
const NS = "billing";
|
|
@@ -4410,8 +4415,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4410
4415
|
"panel.aria": "DeepSeek balance details"
|
|
4411
4416
|
};
|
|
4412
4417
|
//#endregion
|
|
4413
|
-
//#region
|
|
4414
|
-
/** DeepSeek account-balance badge, browser half: one session-header utility entry. */
|
|
4418
|
+
//#region src/client/index.ts
|
|
4415
4419
|
/** Services required for locale registration, the Remote face, and the header slot. */
|
|
4416
4420
|
const inject = [
|
|
4417
4421
|
"slots",
|
|
@@ -4442,8 +4446,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4442
4446
|
if (!result.ok) throw new Error(`billing.getSessionSpend failed: ${result.error.code}: ${result.error.message}`);
|
|
4443
4447
|
return result.value;
|
|
4444
4448
|
},
|
|
4445
|
-
getTodaySpend: async () => {
|
|
4446
|
-
const result = await billing.getTodaySpend();
|
|
4449
|
+
getTodaySpend: async (force) => {
|
|
4450
|
+
const result = await billing.getTodaySpend(force);
|
|
4447
4451
|
if (!result.ok) throw new Error(`billing.getTodaySpend failed: ${result.error.code}: ${result.error.message}`);
|
|
4448
4452
|
return result.value;
|
|
4449
4453
|
}
|
package/lib/invariant.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region lib/types/invariant.js
|
|
2
2
|
/**
|
|
3
|
-
* Package-owned invariant companion for `@
|
|
4
|
-
* @module @
|
|
3
|
+
* Package-owned invariant companion for `@deepseek-ai/dsh-client-ui-billing`.
|
|
4
|
+
* @module @deepseek-ai/dsh-client-ui-billing/invariant
|
|
5
5
|
*/
|
|
6
|
-
const PACKAGE_NAME = "@
|
|
6
|
+
const PACKAGE_NAME = "@deepseek-ai/dsh-client-ui-billing";
|
|
7
7
|
/** Cordis companion plugin name. */
|
|
8
8
|
const name = "client-ui-billing-invariant";
|
|
9
9
|
/** Service required before the companion can reserve package ownership. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Session-header billing badge: balance plus the current conversation's billed spend. */
|
|
2
|
-
import type { DeepSeekBalance, DeepSeekSessionSpend, DeepSeekTodaySpend } from '@
|
|
2
|
+
import type { DeepSeekBalance, DeepSeekSessionSpend, DeepSeekTodaySpend } from '@deepseek-ai/dsh-llm-billing/types';
|
|
3
3
|
import type { SessionId } from '@deepseek-ai/dsh-client-runtime/client';
|
|
4
4
|
import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
5
5
|
import { NS } from './locales.ts';
|
|
@@ -27,7 +27,7 @@ export type BalanceBadgeProps = PropsRuntime<'conversation.session.header.utilit
|
|
|
27
27
|
* through `getSessionSpend` / `getTodaySpend`; the balance stays a
|
|
28
28
|
* manual-refresh snapshot and is never refetched on its own.
|
|
29
29
|
* @param props - Remote face, locale, and the standard session-header runtime share.
|
|
30
|
-
* @returns the badge, or null
|
|
30
|
+
* @returns the badge, or null while the first fetch is in flight.
|
|
31
31
|
*/
|
|
32
32
|
export declare function BalanceBadge({ getBalance, getSessionSpend, getTodaySpend, sessionId, useSession, t }: BalanceBadgeProps): import("react").JSX.Element | null;
|
|
33
33
|
//# sourceMappingURL=BalanceBadge.d.ts.map
|
|
@@ -15,7 +15,7 @@ export declare const zh: {
|
|
|
15
15
|
readonly 'state.unavailable': "额度不可用";
|
|
16
16
|
readonly 'action.refresh': "刷新";
|
|
17
17
|
readonly 'info.aria': "花费说明";
|
|
18
|
-
readonly 'info.hint': "仅能预估 DeepSeek
|
|
18
|
+
readonly 'info.hint': "仅能预估 DeepSeek 相关模型。本会话花费按每条消息的发生时刻(北京时间)所在峰谷时段单价计费:缓存命中输入、未命中输入(含缓存写入)、输出(含推理)分别计价。费用按 8 月 17 日实行的标准。";
|
|
19
19
|
readonly 'badge.aria': "DeepSeek 额度:{amount}";
|
|
20
20
|
readonly 'panel.aria': "DeepSeek 额度详情";
|
|
21
21
|
};
|
package/lib/types/invariant.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Package-owned invariant companion for `@
|
|
3
|
-
* @module @
|
|
2
|
+
* Package-owned invariant companion for `@deepseek-ai/dsh-client-ui-billing`.
|
|
3
|
+
* @module @deepseek-ai/dsh-client-ui-billing/invariant
|
|
4
4
|
*/
|
|
5
5
|
import type { Context } from '@deepseek-ai/cordis';
|
|
6
6
|
/** Cordis companion plugin name. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rayadesu/dsh-client-ui-billing",
|
|
3
3
|
"description": "Session-header DeepSeek account-balance and conversation-spend badge over the billing Remote",
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/types/index.d.ts",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@rayadesu/dsh-llm-billing": "^0.1
|
|
48
|
+
"@rayadesu/dsh-llm-billing": "^0.2.1",
|
|
49
49
|
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.8",
|
|
50
50
|
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.8",
|
|
51
51
|
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.8",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@deepseek-ai/cordis": "^4.0.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@rayadesu/dsh-llm-billing": "^0.1
|
|
57
|
+
"@rayadesu/dsh-llm-billing": "^0.2.1",
|
|
58
58
|
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.8",
|
|
59
59
|
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.8",
|
|
60
60
|
"@deepseek-ai/dsh-client-test-runtime": "^0.1.0-rc.8",
|