@eddyskywalker/dsh-chatgpt-subscription 0.36.2 → 0.38.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/CHANGELOG.md +51 -0
- package/README.md +32 -9
- package/lib/client.js +603 -134
- package/lib/client.js.map +1 -1
- package/lib/index.js +3256 -55
- package/lib/types/client/common/ComposerQuotaBadge.d.ts +7 -0
- package/lib/types/client/common/ComposerQuotaBadge.d.ts.map +1 -1
- package/lib/types/client/kimi-code/KimiCodeSection.d.ts.map +1 -1
- package/lib/types/client/kimi-code/KimiModelCapabilities.d.ts.map +1 -1
- package/lib/types/client/kimi-code/labels.d.ts +66 -0
- package/lib/types/client/kimi-code/labels.d.ts.map +1 -0
- package/lib/types/client/kimi-code/locales.d.ts +52 -11
- package/lib/types/client/kimi-code/locales.d.ts.map +1 -1
- package/lib/types/client/locales-ru/kimi-code.d.ts.map +1 -1
- package/lib/types/client/locales-ru/opendesign.d.ts.map +1 -1
- package/lib/types/client/locales-ru/progress-updates.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +4 -4
- package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts +6 -0
- package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts.map +1 -1
- package/lib/types/client/opendesign/OpenDesignSection.d.ts.map +1 -1
- package/lib/types/client/opendesign/locales.d.ts +54 -0
- package/lib/types/client/opendesign/locales.d.ts.map +1 -1
- package/lib/types/client/opendesign/styles.d.ts +5 -0
- package/lib/types/client/opendesign/styles.d.ts.map +1 -1
- package/lib/types/client/progress-updates/locales.d.ts +17 -2
- package/lib/types/client/progress-updates/locales.d.ts.map +1 -1
- package/lib/types/client/progress-updates/settings-binding.d.ts +13 -3
- package/lib/types/client/progress-updates/settings-binding.d.ts.map +1 -1
- package/lib/types/client/progress-updates/settings-section.d.ts +5 -5
- package/lib/types/client/progress-updates/settings-section.d.ts.map +1 -1
- package/lib/types/client/progress-updates/styles.d.ts.map +1 -1
- package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
- package/lib/types/host/kimi-code/client.d.ts.map +1 -1
- package/lib/types/host/kimi-code/mapper.d.ts +89 -1
- package/lib/types/host/kimi-code/mapper.d.ts.map +1 -1
- package/lib/types/host/kimi-code/model-catalog.d.ts +20 -4
- package/lib/types/host/kimi-code/model-catalog.d.ts.map +1 -1
- package/lib/types/host/kimi-code/routes.d.ts.map +1 -1
- package/lib/types/host/kimi-code/types.d.ts +50 -6
- package/lib/types/host/kimi-code/types.d.ts.map +1 -1
- package/lib/types/host/opendesign/client.d.ts +103 -0
- package/lib/types/host/opendesign/client.d.ts.map +1 -1
- package/lib/types/host/opendesign/routes.d.ts.map +1 -1
- package/lib/types/host/opendesign/types.d.ts +31 -0
- package/lib/types/host/opendesign/types.d.ts.map +1 -1
- package/lib/types/host/progress-updates/index.d.ts +5 -0
- package/lib/types/host/progress-updates/index.d.ts.map +1 -1
- package/lib/types/host/progress-updates/prompt.d.ts +37 -3
- package/lib/types/host/progress-updates/prompt.d.ts.map +1 -1
- package/lib/types/host/progress-updates/tool.d.ts.map +1 -1
- package/lib/types/host/proxy-manager.d.ts +63 -1
- package/lib/types/host/proxy-manager.d.ts.map +1 -1
- package/lib/types/host/widget-board/line-contracts.d.ts +192 -0
- package/lib/types/host/widget-board/line-contracts.d.ts.map +1 -0
- package/lib/types/host/widget-board/line-quota.d.ts +284 -0
- package/lib/types/host/widget-board/line-quota.d.ts.map +1 -0
- package/lib/types/host/widget-board/line-registry.d.ts +402 -0
- package/lib/types/host/widget-board/line-registry.d.ts.map +1 -0
- package/lib/types/host/widget-board/provider.d.ts +140 -0
- package/lib/types/host/widget-board/provider.d.ts.map +1 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/kimi-code-contracts.d.ts +30 -6
- package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -1
- package/lib/types/shared/opendesign-contracts.d.ts +47 -0
- package/lib/types/shared/opendesign-contracts.d.ts.map +1 -1
- package/package.json +2 -1
- package/widgets/line-flip/index.html +58 -0
- package/widgets/line-flip/main.js +1102 -0
- package/widgets/line-flip/style.css +729 -0
- package/widgets/line-flip/widget.json +555 -0
package/lib/client.js
CHANGED
|
@@ -3691,7 +3691,7 @@ window.__ModuleLoader__.load({
|
|
|
3691
3691
|
* exactly one and rejects the others, so the label states which one this model
|
|
3692
3692
|
* actually uses.
|
|
3693
3693
|
*/
|
|
3694
|
-
function wireLabel(wire, t) {
|
|
3694
|
+
function wireLabel$1(wire, t) {
|
|
3695
3695
|
if (wire === "anthropic") return t.wireAnthropic;
|
|
3696
3696
|
if (wire === "responses") return t.wireResponses;
|
|
3697
3697
|
return t.wireOpenai;
|
|
@@ -4120,7 +4120,7 @@ window.__ModuleLoader__.load({
|
|
|
4120
4120
|
items: (status?.models ?? []).map((model) => ({
|
|
4121
4121
|
id: model.id,
|
|
4122
4122
|
name: model.name,
|
|
4123
|
-
hint: wireLabel(model.wire, t),
|
|
4123
|
+
hint: wireLabel$1(model.wire, t),
|
|
4124
4124
|
enabled: model.enabled
|
|
4125
4125
|
})),
|
|
4126
4126
|
busy: busy !== null,
|
|
@@ -4277,15 +4277,6 @@ window.__ModuleLoader__.load({
|
|
|
4277
4277
|
});
|
|
4278
4278
|
}
|
|
4279
4279
|
//#endregion
|
|
4280
|
-
//#region src/shared/kimi-code-contracts.ts
|
|
4281
|
-
/** Every level, in escalating order; the settings card renders exactly these. */
|
|
4282
|
-
const KIMI_CODE_REASONING_EFFORTS = [
|
|
4283
|
-
"low",
|
|
4284
|
-
"high",
|
|
4285
|
-
"max",
|
|
4286
|
-
"none"
|
|
4287
|
-
];
|
|
4288
|
-
//#endregion
|
|
4289
4280
|
//#region src/client/kimi-code/locales.ts
|
|
4290
4281
|
const NS_KIMI_CODE = "dsh-kimi-code";
|
|
4291
4282
|
const zh$10 = {
|
|
@@ -4336,10 +4327,13 @@ window.__ModuleLoader__.load({
|
|
|
4336
4327
|
wireAnthropic: "Anthropic",
|
|
4337
4328
|
wireOpenai: "OpenAI",
|
|
4338
4329
|
capVideo: "视频*",
|
|
4330
|
+
capThinkingOnly: "只支持思考",
|
|
4331
|
+
capEfforts: "档位 {list}",
|
|
4339
4332
|
capDynamicTools: "动态工具",
|
|
4340
4333
|
capImageOnly: "仅图片",
|
|
4341
4334
|
capNone: "—",
|
|
4342
4335
|
capVideoFootnote: "* 视频输入需先由 kimi_attach_video 工具挂载(本地绝对路径或 http(s) 链接);直接粘贴的上传路径仍只支持图片。",
|
|
4336
|
+
capThinkingOnlyFootnote: "* 「只支持思考」的模型不能关闭思考:请求里带 none 会被服务端拒绝(400),所以它的档位里没有「关闭思考」。",
|
|
4343
4337
|
capabilitiesTitle: "模型能力",
|
|
4344
4338
|
capColMedia: "多模态",
|
|
4345
4339
|
capColTools: "动态工具",
|
|
@@ -4350,13 +4344,16 @@ window.__ModuleLoader__.load({
|
|
|
4350
4344
|
speedRegular: "标准",
|
|
4351
4345
|
speedHighspeed: "高速 (约 6×)",
|
|
4352
4346
|
quotaCost: "额度倍率",
|
|
4347
|
+
quotaUnknown: "未公布",
|
|
4353
4348
|
minimumPlan: "所需套餐",
|
|
4354
4349
|
enhanced: "思考设置",
|
|
4355
4350
|
defaultReasoningEffort: "默认思考档位",
|
|
4356
|
-
defaultReasoningEffortHint: "
|
|
4351
|
+
defaultReasoningEffortHint: "可用档位跟随勾选的模型自己声明的能力(一个都没勾时按 low / high / max / none 全列);none 表示关闭思考,只对允许关闭的模型有效。切换档位会使上下文缓存失效,建议在同一会话中保持一致。",
|
|
4352
|
+
effortThinkingOnlyNote: "勾选的模型里有只支持思考模式的:{models}。它们没有「关闭思考」这一档,请求关闭思考会被服务端拒绝(400),所以这里不提供。",
|
|
4353
|
+
effortNotOffered: "当前勾选的模型不接受",
|
|
4357
4354
|
cacheTtl: "上下文缓存时长",
|
|
4358
|
-
cacheTtlHint: "Kimi
|
|
4359
|
-
cacheTtlDefault: "
|
|
4355
|
+
cacheTtlHint: "Kimi 按前缀自动缓存,这里选择写入档位(只有 5m / 1h 两档)。不传时服务端按 5 分钟档写入。1h 写入单价约为 5m 的两倍,只有当同一前缀会在一小时内被反复读取才划算。档位在首次写入时锁定,之后命中按原 TTL 续期,无法改写。依据回合间隔选:间隔通常短于约 30 分钟选 5 分钟;调度、等子代理这类会出现长空闲的会话选 1 小时。",
|
|
4356
|
+
cacheTtlDefault: "不传(服务端按 5 分钟档写入)",
|
|
4360
4357
|
cacheTtl5m: "5 分钟",
|
|
4361
4358
|
cacheTtl1h: "1 小时",
|
|
4362
4359
|
defaultEffortAuto: "使用模型默认值",
|
|
@@ -4382,6 +4379,11 @@ window.__ModuleLoader__.load({
|
|
|
4382
4379
|
cacheFresh: "新处理 tokens",
|
|
4383
4380
|
cacheOutput: "输出 tokens",
|
|
4384
4381
|
cacheRequests: "请求数",
|
|
4382
|
+
cacheWrite: "缓存写入",
|
|
4383
|
+
cacheWrite5m: "5 分钟档",
|
|
4384
|
+
cacheWrite1h: "1 小时档",
|
|
4385
|
+
cacheWriteHint: "写入是独立计费项:1h 写入单价约为 5m 的两倍,命中后会按原 TTL 续期。分档显示 0 表示服务端没有回报该档的写入数(响应头缺失就是静默),不等于该档确实没写入。",
|
|
4386
|
+
unknownMetric: "暂无",
|
|
4385
4387
|
cacheHint: "同一会话内:系统提示与工具列表一旦变化会使缓存整体失效,因此保持工具集合稳定、把新增内容追加在末尾,命中率最高。",
|
|
4386
4388
|
cacheExpired: "本会话已空闲超过缓存有效期,下一轮将重新处理约 {tokens} 个 token。",
|
|
4387
4389
|
cacheDrift: "最近前缀状态",
|
|
@@ -4459,10 +4461,13 @@ window.__ModuleLoader__.load({
|
|
|
4459
4461
|
wireAnthropic: "Anthropic",
|
|
4460
4462
|
wireOpenai: "OpenAI",
|
|
4461
4463
|
capVideo: "Video*",
|
|
4464
|
+
capThinkingOnly: "Thinking only",
|
|
4465
|
+
capEfforts: "Levels {list}",
|
|
4462
4466
|
capDynamicTools: "Dynamic tools",
|
|
4463
4467
|
capImageOnly: "Images",
|
|
4464
4468
|
capNone: "—",
|
|
4465
4469
|
capVideoFootnote: "* Video input is attached with the kimi_attach_video tool (an absolute local path or an http(s) URL); the paste/upload path still accepts images only.",
|
|
4470
|
+
capThinkingOnlyFootnote: "* A \"thinking only\" model cannot switch thinking off: a request carrying none is rejected by the service with HTTP 400, so \"thinking off\" is not among its levels.",
|
|
4466
4471
|
capabilitiesTitle: "Capabilities",
|
|
4467
4472
|
capColMedia: "Multimodal",
|
|
4468
4473
|
capColTools: "Dynamic tools",
|
|
@@ -4473,13 +4478,16 @@ window.__ModuleLoader__.load({
|
|
|
4473
4478
|
speedRegular: "Regular",
|
|
4474
4479
|
speedHighspeed: "HighSpeed (~6x)",
|
|
4475
4480
|
quotaCost: "Quota cost",
|
|
4481
|
+
quotaUnknown: "Not published",
|
|
4476
4482
|
minimumPlan: "Required plan",
|
|
4477
4483
|
enhanced: "Thinking",
|
|
4478
4484
|
defaultReasoningEffort: "Default thinking level",
|
|
4479
|
-
defaultReasoningEffortHint: "
|
|
4485
|
+
defaultReasoningEffortHint: "The levels offered follow what the checked models declare (all of low / high / max / none when none is checked); none disables thinking and only applies to models that allow it. Switching the level invalidates the context cache, so keep it steady within a session.",
|
|
4486
|
+
effortThinkingOnlyNote: "Some checked models think at every level: {models}. They have no \"thinking off\" — the service rejects that request with HTTP 400 — so it is not offered here.",
|
|
4487
|
+
effortNotOffered: "not accepted by the checked models",
|
|
4480
4488
|
cacheTtl: "Context cache duration",
|
|
4481
|
-
cacheTtlHint: "Kimi caches prefixes automatically; this chooses the write
|
|
4482
|
-
cacheTtlDefault: "Unset (
|
|
4489
|
+
cacheTtlHint: "Kimi caches prefixes automatically; this chooses the write tier, and there are only two (5m and 1h). Unset sends no cache field, and the service then writes at the 5-minute tier. A 1h write costs about twice a 5m one and only pays off when the same prefix is re-read within the hour. The tier is locked at the first write, and later hits renew it under that original TTL. Choose by the gap between turns: 5 minutes when turns are normally less than about 30 minutes apart, 1 hour for a session that idles for long stretches, such as dispatch work waiting on subagents.",
|
|
4490
|
+
cacheTtlDefault: "Unset (service writes at the 5-minute tier)",
|
|
4483
4491
|
cacheTtl5m: "5 minutes",
|
|
4484
4492
|
cacheTtl1h: "1 hour",
|
|
4485
4493
|
defaultEffortAuto: "Use the model default",
|
|
@@ -4506,6 +4514,11 @@ window.__ModuleLoader__.load({
|
|
|
4506
4514
|
cacheFresh: "Fresh tokens",
|
|
4507
4515
|
cacheOutput: "Output tokens",
|
|
4508
4516
|
cacheRequests: "Requests",
|
|
4517
|
+
cacheWrite: "Cache writes",
|
|
4518
|
+
cacheWrite5m: "5-minute tier",
|
|
4519
|
+
cacheWrite1h: "1-hour tier",
|
|
4520
|
+
cacheWriteHint: "A write is billed separately: a 1h write costs about twice a 5m one, and a hit renews the entry under its original TTL. A tier showing 0 means the service did not report a write for it (a missing response header is silence), not that nothing was written there.",
|
|
4521
|
+
unknownMetric: "n/a",
|
|
4509
4522
|
cacheHint: "Within one session: any change to the system prompt or the tool list invalidates the whole prefix cache, so keep the tool set stable and append new material at the tail for the best hit rate.",
|
|
4510
4523
|
cacheDrift: "Last prefix state",
|
|
4511
4524
|
cacheDriftFirst: "First request (cache cold)",
|
|
@@ -4541,6 +4554,95 @@ window.__ModuleLoader__.load({
|
|
|
4541
4554
|
"en-US": en$10
|
|
4542
4555
|
};
|
|
4543
4556
|
//#endregion
|
|
4557
|
+
//#region src/shared/kimi-code-contracts.ts
|
|
4558
|
+
/** Every level, in escalating order; the settings card renders exactly these. */
|
|
4559
|
+
const KIMI_CODE_REASONING_EFFORTS = [
|
|
4560
|
+
"low",
|
|
4561
|
+
"high",
|
|
4562
|
+
"max",
|
|
4563
|
+
"none"
|
|
4564
|
+
];
|
|
4565
|
+
//#endregion
|
|
4566
|
+
//#region src/client/kimi-code/labels.ts
|
|
4567
|
+
/**
|
|
4568
|
+
* Name of the request/response dialect a model is served over.
|
|
4569
|
+
*
|
|
4570
|
+
* @param wire - dialect the adapter reports for this model.
|
|
4571
|
+
* @param t - dictionary of the card rendering it.
|
|
4572
|
+
*/
|
|
4573
|
+
function wireLabel(wire, t) {
|
|
4574
|
+
return wire === "anthropic" ? t.wireAnthropic : t.wireOpenai;
|
|
4575
|
+
}
|
|
4576
|
+
/** Human label for one thinking level. */
|
|
4577
|
+
function effortLabel(effort, t) {
|
|
4578
|
+
switch (effort) {
|
|
4579
|
+
case "low": return t.effortLow;
|
|
4580
|
+
case "high": return t.effortHigh;
|
|
4581
|
+
case "max": return t.effortMax;
|
|
4582
|
+
case "none": return t.effortNone;
|
|
4583
|
+
default: return effort;
|
|
4584
|
+
}
|
|
4585
|
+
}
|
|
4586
|
+
/**
|
|
4587
|
+
* Thinking levels one model publishes, in the order the card renders them.
|
|
4588
|
+
*
|
|
4589
|
+
* The ladder is read, never assumed: a model that declares no levels gets an
|
|
4590
|
+
* empty list, and the picker then offers none of them rather than the generic
|
|
4591
|
+
* four. `none` is dropped for a thinking-only model — the host already strips
|
|
4592
|
+
* it, and filtering again is what keeps an older host, or a live catalog that
|
|
4593
|
+
* says nothing about thinking, from putting "thinking off" back on a menu whose
|
|
4594
|
+
* request the service answers with HTTP 400.
|
|
4595
|
+
*
|
|
4596
|
+
* @param model - one entry from the model directory.
|
|
4597
|
+
*/
|
|
4598
|
+
function effortLadder(model) {
|
|
4599
|
+
const declared = model.reasoningEfforts ?? [];
|
|
4600
|
+
const known = KIMI_CODE_REASONING_EFFORTS.filter((effort) => declared.includes(effort));
|
|
4601
|
+
return model.thinkingType === "only" ? known.filter((effort) => effort !== "none") : known;
|
|
4602
|
+
}
|
|
4603
|
+
/**
|
|
4604
|
+
* Whether one model may be asked to stop reasoning.
|
|
4605
|
+
*
|
|
4606
|
+
* Read from the model's own declaration rather than assumed: `only` is the one
|
|
4607
|
+
* value that makes the question a hard no — the service answers a
|
|
4608
|
+
* disabled-thinking request with HTTP 400 and names the model — while `no`
|
|
4609
|
+
* describes a model that never reasons, so there is no switch to offer either.
|
|
4610
|
+
* `both`, and a registry that says nothing about the id, keep the switch,
|
|
4611
|
+
* because that is what this line offered before the flag existed and the
|
|
4612
|
+
* service, not the card, is the authority on refusing a level.
|
|
4613
|
+
*
|
|
4614
|
+
* @param model - one entry from the model directory.
|
|
4615
|
+
*/
|
|
4616
|
+
function canDisableThinking(model) {
|
|
4617
|
+
return model.thinkingType !== "only" && model.thinkingType !== "no";
|
|
4618
|
+
}
|
|
4619
|
+
/**
|
|
4620
|
+
* Thinking levels a conversation can actually be set to.
|
|
4621
|
+
*
|
|
4622
|
+
* The setting is one level for the whole line, so the three thinking levels are
|
|
4623
|
+
* the union of what the CHECKED models declare: a level no checked model
|
|
4624
|
+
* declares would be stored and then rejected on the first turn. "Thinking off"
|
|
4625
|
+
* is not one of those declared levels on most rows — it is a switch, not a
|
|
4626
|
+
* ladder rung — so it is decided by {@link canDisableThinking} instead, and it
|
|
4627
|
+
* disappears exactly when every checked model refuses to be switched off.
|
|
4628
|
+
*
|
|
4629
|
+
* With nothing checked there is no model to narrow it down and the full ladder
|
|
4630
|
+
* is offered.
|
|
4631
|
+
*
|
|
4632
|
+
* @param models - every model in the directory, checked or not.
|
|
4633
|
+
*/
|
|
4634
|
+
function effortOptions(models) {
|
|
4635
|
+
const enabled = models.filter((model) => model.enabled);
|
|
4636
|
+
if (enabled.length === 0) return [...KIMI_CODE_REASONING_EFFORTS];
|
|
4637
|
+
const declared = new Set(enabled.flatMap((model) => effortLadder(model)));
|
|
4638
|
+
const switchable = enabled.some((model) => canDisableThinking(model));
|
|
4639
|
+
return KIMI_CODE_REASONING_EFFORTS.filter((effort) => effort === "none" ? switchable : declared.has(effort));
|
|
4640
|
+
}
|
|
4641
|
+
/** Models that reason at every level, and so have no "thinking off". */
|
|
4642
|
+
function thinkingOnlyModels(models) {
|
|
4643
|
+
return models.filter((model) => model.thinkingType === "only");
|
|
4644
|
+
}
|
|
4645
|
+
//#endregion
|
|
4544
4646
|
//#region src/client/kimi-code/KimiModelCapabilities.tsx
|
|
4545
4647
|
/**
|
|
4546
4648
|
* Capability table for the Kimi model list.
|
|
@@ -4564,54 +4666,71 @@ window.__ModuleLoader__.load({
|
|
|
4564
4666
|
const t = useLineDict(NS_KIMI_CODE, zh$10);
|
|
4565
4667
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4566
4668
|
className: "dsha-cap-table",
|
|
4567
|
-
children: [
|
|
4568
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4669
|
+
children: [
|
|
4670
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
4671
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t.capabilitiesTitle }),
|
|
4672
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t.capColMedia }),
|
|
4673
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t.capColTools }),
|
|
4674
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t.capColNotes })
|
|
4675
|
+
] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: models.map((model) => {
|
|
4676
|
+
const ladder = effortLadder(model);
|
|
4677
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
4678
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
4679
|
+
title: [
|
|
4680
|
+
model.id,
|
|
4681
|
+
wireLabel(model.wire, t),
|
|
4682
|
+
...model.thinkingType === "only" ? [t.capThinkingOnly] : [],
|
|
4683
|
+
...ladder.length === 0 ? [] : [t.capEfforts.replace("{list}", ladder.join(" / "))],
|
|
4684
|
+
...model.defaultReasoningEffort ? [t.defaultReasoningEffort + ": " + model.defaultReasoningEffort] : [],
|
|
4685
|
+
...model.maxInputTokens === void 0 ? [] : [t.capInputCap.replace("{tokens}", String(model.maxInputTokens))],
|
|
4686
|
+
...model.minimumPlan ? [t.capPlan.replace("{plan}", model.minimumPlan)] : [],
|
|
4687
|
+
...model.quotaMultiplier === null ? [] : [`${t.quotaCost}: ${formatMultiplier(model.quotaMultiplier)}`]
|
|
4688
|
+
].join(" · "),
|
|
4689
|
+
children: model.name
|
|
4690
|
+
}),
|
|
4691
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4692
|
+
className: model.supportsVideo ? "dsha-cap-on" : "dsha-cap-off",
|
|
4693
|
+
children: model.supportsVideo ? t.capVideo : t.capImageOnly
|
|
4694
|
+
}) }),
|
|
4695
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: model.supportsDynamicTools ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4696
|
+
className: "dsha-cap-on",
|
|
4697
|
+
children: t.capDynamicTools
|
|
4698
|
+
}) : model.supportsToolUse ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4699
|
+
className: "dsha-cap-off",
|
|
4700
|
+
children: t.capNone
|
|
4701
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4702
|
+
className: "dsha-cap-off",
|
|
4703
|
+
children: t.capNoTools
|
|
4704
|
+
}) }),
|
|
4705
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("td", {
|
|
4706
|
+
className: "dsha-cap-notes",
|
|
4707
|
+
children: [model.quotaMultiplier === null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4708
|
+
className: "dsha-cap-off",
|
|
4709
|
+
children: [
|
|
4710
|
+
t.quotaCost,
|
|
4711
|
+
" ",
|
|
4712
|
+
t.quotaUnknown
|
|
4713
|
+
]
|
|
4714
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4715
|
+
className: "dsha-cap-cost",
|
|
4716
|
+
children: [
|
|
4717
|
+
t.quotaCost,
|
|
4718
|
+
" ",
|
|
4719
|
+
formatMultiplier(model.quotaMultiplier)
|
|
4720
|
+
]
|
|
4721
|
+
}), model.description ?? ""]
|
|
4722
|
+
})
|
|
4723
|
+
] }, model.id);
|
|
4724
|
+
}) })] }),
|
|
4725
|
+
models.some((model) => model.supportsVideo) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4726
|
+
className: "dsha-muted dsha-cap-footnote",
|
|
4727
|
+
children: t.capVideoFootnote
|
|
4728
|
+
}),
|
|
4729
|
+
models.some((model) => model.thinkingType === "only") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4730
|
+
className: "dsha-muted dsha-cap-footnote",
|
|
4731
|
+
children: t.capThinkingOnlyFootnote
|
|
4732
|
+
})
|
|
4733
|
+
]
|
|
4615
4734
|
});
|
|
4616
4735
|
}
|
|
4617
4736
|
//#endregion
|
|
@@ -4630,14 +4749,15 @@ window.__ModuleLoader__.load({
|
|
|
4630
4749
|
return `${(cents / 100).toFixed(2)} ${code}`;
|
|
4631
4750
|
}
|
|
4632
4751
|
}
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4752
|
+
/**
|
|
4753
|
+
* One token count as the card prints it.
|
|
4754
|
+
*
|
|
4755
|
+
* A reported zero prints as "0": zero writes is a reading, while a blank cell
|
|
4756
|
+
* reads as "nothing was measured", and the two are different claims. Only a
|
|
4757
|
+
* number this build cannot read at all falls back to "暂无".
|
|
4758
|
+
*/
|
|
4759
|
+
function tokenCount(value, t) {
|
|
4760
|
+
return typeof value === "number" && Number.isFinite(value) ? value.toLocaleString() : t.unknownMetric;
|
|
4641
4761
|
}
|
|
4642
4762
|
/** Human label for the last request's prefix-drift cause. */
|
|
4643
4763
|
function driftLabel(cause, t) {
|
|
@@ -4984,8 +5104,13 @@ window.__ModuleLoader__.load({
|
|
|
4984
5104
|
});
|
|
4985
5105
|
const quota = status?.quota;
|
|
4986
5106
|
status?.account;
|
|
4987
|
-
status?.models
|
|
5107
|
+
const models = status?.models ?? [];
|
|
5108
|
+
models.filter((model) => model.enabled).length;
|
|
4988
5109
|
const loginPending = flow?.status === "pending";
|
|
5110
|
+
const offeredEfforts = effortOptions(models);
|
|
5111
|
+
const savedEffort = status?.defaultReasoningEffort ?? null;
|
|
5112
|
+
const staleEffort = savedEffort !== null && !offeredEfforts.includes(savedEffort) ? savedEffort : null;
|
|
5113
|
+
const thinkingOnly = thinkingOnlyModels(models.filter((model) => model.enabled));
|
|
4989
5114
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4990
5115
|
className: "dsha-page",
|
|
4991
5116
|
children: [
|
|
@@ -5181,6 +5306,30 @@ window.__ModuleLoader__.load({
|
|
|
5181
5306
|
children: driftLabel(status.cache.lastDrift, t)
|
|
5182
5307
|
})]
|
|
5183
5308
|
}),
|
|
5309
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5310
|
+
className: "dsha-row",
|
|
5311
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5312
|
+
className: "dsha-label",
|
|
5313
|
+
children: t.cacheWrite
|
|
5314
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
5315
|
+
className: "dsha-value",
|
|
5316
|
+
children: [
|
|
5317
|
+
tokenCount(status.cache.cacheWriteTokens, t),
|
|
5318
|
+
" · ",
|
|
5319
|
+
t.cacheWrite5m,
|
|
5320
|
+
" ",
|
|
5321
|
+
tokenCount(status.cache.cacheWrite5mTokens, t),
|
|
5322
|
+
" · ",
|
|
5323
|
+
t.cacheWrite1h,
|
|
5324
|
+
" ",
|
|
5325
|
+
tokenCount(status.cache.cacheWrite1hTokens, t)
|
|
5326
|
+
]
|
|
5327
|
+
})]
|
|
5328
|
+
}),
|
|
5329
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5330
|
+
className: "dsha-muted",
|
|
5331
|
+
children: t.cacheWriteHint
|
|
5332
|
+
}),
|
|
5184
5333
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5185
5334
|
className: "dsha-muted",
|
|
5186
5335
|
children: t.cacheHint
|
|
@@ -5206,11 +5355,12 @@ window.__ModuleLoader__.load({
|
|
|
5206
5355
|
children: t.modelsHint
|
|
5207
5356
|
}),
|
|
5208
5357
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelChecklist, {
|
|
5209
|
-
items:
|
|
5358
|
+
items: models.map((model) => ({
|
|
5210
5359
|
id: model.id,
|
|
5211
5360
|
name: model.name,
|
|
5212
5361
|
hint: [
|
|
5213
|
-
model.wire
|
|
5362
|
+
wireLabel(model.wire, t),
|
|
5363
|
+
...model.thinkingType === "only" ? [t.capThinkingOnly] : [],
|
|
5214
5364
|
...model.supportsVideo ? [t.capVideo] : [],
|
|
5215
5365
|
...model.supportsDynamicTools ? [t.capDynamicTools] : [],
|
|
5216
5366
|
...model.minimumPlan ? [t.capPlan.replace("{plan}", model.minimumPlan)] : []
|
|
@@ -5226,7 +5376,7 @@ window.__ModuleLoader__.load({
|
|
|
5226
5376
|
list: t.modelsSection
|
|
5227
5377
|
}
|
|
5228
5378
|
}),
|
|
5229
|
-
status !== null &&
|
|
5379
|
+
status !== null && models.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(KimiModelCapabilities, { models })
|
|
5230
5380
|
]
|
|
5231
5381
|
}),
|
|
5232
5382
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
@@ -5250,15 +5400,30 @@ window.__ModuleLoader__.load({
|
|
|
5250
5400
|
const value = event.currentTarget.value;
|
|
5251
5401
|
handleUpdateEffort(value === "" ? null : value);
|
|
5252
5402
|
},
|
|
5253
|
-
children: [
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5403
|
+
children: [
|
|
5404
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
5405
|
+
value: "",
|
|
5406
|
+
children: t.defaultEffortAuto
|
|
5407
|
+
}),
|
|
5408
|
+
offeredEfforts.map((effort) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
5409
|
+
value: effort,
|
|
5410
|
+
children: effortLabel(effort, t)
|
|
5411
|
+
}, effort)),
|
|
5412
|
+
staleEffort !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
|
|
5413
|
+
value: staleEffort,
|
|
5414
|
+
children: [
|
|
5415
|
+
effortLabel(staleEffort, t),
|
|
5416
|
+
" · ",
|
|
5417
|
+
t.effortNotOffered
|
|
5418
|
+
]
|
|
5419
|
+
})
|
|
5420
|
+
]
|
|
5260
5421
|
})]
|
|
5261
5422
|
}),
|
|
5423
|
+
thinkingOnly.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5424
|
+
className: "dsha-notice",
|
|
5425
|
+
children: t.effortThinkingOnlyNote.replace("{models}", thinkingOnly.map((model) => model.name).join(" · "))
|
|
5426
|
+
}),
|
|
5262
5427
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5263
5428
|
className: "dsha-pref-row",
|
|
5264
5429
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t.cacheTtl }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
@@ -16125,6 +16290,15 @@ window.__ModuleLoader__.load({
|
|
|
16125
16290
|
usageTotalConsumed: "累计消耗 ${amount}",
|
|
16126
16291
|
usageUsageCount: "计费请求 {count} 次",
|
|
16127
16292
|
usagePlanUnknown: "已读取额度,但上游未返回套餐档位。",
|
|
16293
|
+
usageWindowsTitle: "Design Plan 额度窗口",
|
|
16294
|
+
usageWindowUsed: "已用 {used}%",
|
|
16295
|
+
usageWindowRemaining: "剩余 {remaining}%",
|
|
16296
|
+
usageWindowResetsAt: "{time} 重置",
|
|
16297
|
+
usageWindowsUnavailable: "额度窗口读取失败或该工作区未配置",
|
|
16298
|
+
usageWindowsConsoleOnly: "额度窗口仅在 OpenDesign 控制台可见:该端点不接受插件凭证",
|
|
16299
|
+
usageWindowDays: "{count} 天",
|
|
16300
|
+
usageWindowHours: "{count} 小时",
|
|
16301
|
+
usageWindowMinutes: "{count} 分钟",
|
|
16128
16302
|
limitKey: "凭据存储在系统加密凭据库中,界面从不显示 Key 本身。",
|
|
16129
16303
|
limitGateway: "请求由 OpenDesign 网关服务,实际上游由网关决定。",
|
|
16130
16304
|
limitRoute: "模型路由按 provider id 抢占:若已有其他插件占用 opendesign,本卡仍可配置,但请求由对方服务。",
|
|
@@ -16222,6 +16396,15 @@ window.__ModuleLoader__.load({
|
|
|
16222
16396
|
usageTotalConsumed: "Consumed in total ${amount}",
|
|
16223
16397
|
usageUsageCount: "Billed requests: {count}",
|
|
16224
16398
|
usagePlanUnknown: "Credits were read, but the upstream named no plan tier.",
|
|
16399
|
+
usageWindowsTitle: "Design Plan allowance windows",
|
|
16400
|
+
usageWindowUsed: "{used}% used",
|
|
16401
|
+
usageWindowRemaining: "{remaining}% remaining",
|
|
16402
|
+
usageWindowResetsAt: "Resets {time}",
|
|
16403
|
+
usageWindowsUnavailable: "Allowance windows could not be read, or this workspace has none configured",
|
|
16404
|
+
usageWindowsConsoleOnly: "Allowance windows are only visible in the OpenDesign console: the endpoint refuses plugin credentials",
|
|
16405
|
+
usageWindowDays: "days: {count}",
|
|
16406
|
+
usageWindowHours: "hours: {count}",
|
|
16407
|
+
usageWindowMinutes: "minutes: {count}",
|
|
16225
16408
|
limitKey: "API keys live in the OS credential store; the card never shows the key itself.",
|
|
16226
16409
|
limitGateway: "Requests are served by the OpenDesign gateway, which chooses the actual upstream.",
|
|
16227
16410
|
limitRoute: "The route is claimed by provider id: if another plugin already serves opendesign, this card still configures the line but that provider answers the requests.",
|
|
@@ -16265,6 +16448,54 @@ window.__ModuleLoader__.load({
|
|
|
16265
16448
|
function formatUsd(value) {
|
|
16266
16449
|
return value === null ? "—" : value;
|
|
16267
16450
|
}
|
|
16451
|
+
/** A number the card prints bare: the surrounding label already carries the unit. */
|
|
16452
|
+
function formatDecimal$1(value) {
|
|
16453
|
+
try {
|
|
16454
|
+
return new Intl.NumberFormat(void 0, { maximumFractionDigits: 1 }).format(value);
|
|
16455
|
+
} catch {
|
|
16456
|
+
return String(value);
|
|
16457
|
+
}
|
|
16458
|
+
}
|
|
16459
|
+
/** The width a share may draw: inside its own track even if the figure is not. */
|
|
16460
|
+
function clampPercent(value) {
|
|
16461
|
+
return Math.min(100, Math.max(0, value));
|
|
16462
|
+
}
|
|
16463
|
+
/**
|
|
16464
|
+
* A window's length in the words the service sold it in.
|
|
16465
|
+
*
|
|
16466
|
+
* A policy states seconds, and the tier's windows are round days and hours:
|
|
16467
|
+
* naming 604800 seconds "168 小时" would describe the window differently from
|
|
16468
|
+
* the console the user reads it in. A whole day stays a day; anything shorter
|
|
16469
|
+
* counts hours, then minutes.
|
|
16470
|
+
*/
|
|
16471
|
+
function planWindowName$1(seconds, labels) {
|
|
16472
|
+
if (seconds >= 86400 && seconds % 86400 === 0) return labels.usageWindowDays.replace("{count}", String(seconds / 86400));
|
|
16473
|
+
if (seconds >= 3600) return labels.usageWindowHours.replace("{count}", formatDecimal$1(seconds / 3600));
|
|
16474
|
+
return labels.usageWindowMinutes.replace("{count}", formatDecimal$1(seconds / 60));
|
|
16475
|
+
}
|
|
16476
|
+
/**
|
|
16477
|
+
* The windows worth drawing, or none at all.
|
|
16478
|
+
*
|
|
16479
|
+
* A failed window read and a workspace that configures no window mean the same
|
|
16480
|
+
* thing here: there is no measurement to draw, so the caller says that in words
|
|
16481
|
+
* instead of showing an empty bar.
|
|
16482
|
+
*/
|
|
16483
|
+
function planWindowRows(plan, labels) {
|
|
16484
|
+
if (plan === void 0 || plan.error !== "") return [];
|
|
16485
|
+
return plan.windows.map((window, index) => {
|
|
16486
|
+
const limit = Number(window.limitCredits);
|
|
16487
|
+
const left = Number(window.remainingCredits);
|
|
16488
|
+
const used = Number.isFinite(limit) && Number.isFinite(left) && limit > 0 ? clampPercent(Math.round((limit - left) / limit * 1e3) / 10) : null;
|
|
16489
|
+
const resetAt = window.resetsAt === null ? NaN : Date.parse(window.resetsAt);
|
|
16490
|
+
return {
|
|
16491
|
+
key: `${window.policyId}-${index}`,
|
|
16492
|
+
name: planWindowName$1(window.durationSeconds, labels),
|
|
16493
|
+
used,
|
|
16494
|
+
remaining: used === null ? null : clampPercent(Math.round((100 - used) * 10) / 10),
|
|
16495
|
+
resetsAt: Number.isFinite(resetAt) ? resetAt : null
|
|
16496
|
+
};
|
|
16497
|
+
});
|
|
16498
|
+
}
|
|
16268
16499
|
/** ISO instant as the card's date, or the honest dash. */
|
|
16269
16500
|
function formatIso(value) {
|
|
16270
16501
|
if (value === null) return "—";
|
|
@@ -16289,15 +16520,22 @@ window.__ModuleLoader__.load({
|
|
|
16289
16520
|
/**
|
|
16290
16521
|
* One account's plan and credit facts.
|
|
16291
16522
|
*
|
|
16292
|
-
*
|
|
16293
|
-
*
|
|
16294
|
-
*
|
|
16295
|
-
*
|
|
16296
|
-
*
|
|
16523
|
+
* The billing summary prices what is left and what was consumed but omits the
|
|
16524
|
+
* grant, so nothing on it can be drawn as "percent of the period used". The
|
|
16525
|
+
* Design Plan endpoint does state a grant per window — five hours, seven days —
|
|
16526
|
+
* beside what is left of it, so those windows are the only bars drawn here, each
|
|
16527
|
+
* measured against its own policy. A failed window read, or a workspace with no
|
|
16528
|
+
* window configured, gets one weak line instead of an empty bar, and the numeric
|
|
16529
|
+
* grid still carries every figure the summary did send. A failed wallet read
|
|
16530
|
+
* still shows the billing figures, because they are different surfaces of the
|
|
16531
|
+
* same account.
|
|
16297
16532
|
*/
|
|
16298
16533
|
function UsageCard(props) {
|
|
16299
16534
|
const { entry, labels } = props;
|
|
16300
16535
|
const billing = entry.billing;
|
|
16536
|
+
const planWindows = planWindowRows(entry.codingPlan, labels);
|
|
16537
|
+
const planHasBar = planWindows.some((window) => window.used !== null);
|
|
16538
|
+
const planHint = planHasBar ? null : /401|403/.test(entry.codingPlan?.error ?? "") ? labels.usageWindowsConsoleOnly : labels.usageWindowsUnavailable;
|
|
16301
16539
|
const credits = (creditsValue, usdValue) => ({
|
|
16302
16540
|
credits: formatCredits(creditsValue),
|
|
16303
16541
|
usd: formatUsd(usdValue)
|
|
@@ -16325,32 +16563,80 @@ window.__ModuleLoader__.load({
|
|
|
16325
16563
|
})
|
|
16326
16564
|
]
|
|
16327
16565
|
}),
|
|
16328
|
-
billing !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
16566
|
+
billing !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
16567
|
+
(billing.periodStart !== null || billing.periodEnd !== null) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
16568
|
+
className: "dshod-quota-meta",
|
|
16569
|
+
children: labels.usagePeriod.replace("{start}", formatIso(billing.periodStart)).replace("{end}", formatIso(billing.periodEnd))
|
|
16570
|
+
}),
|
|
16571
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
16572
|
+
className: "dshod-quota-grid",
|
|
16573
|
+
children: [
|
|
16574
|
+
(() => {
|
|
16575
|
+
const value = credits(billing.subscriptionCredits, billing.subscriptionCreditsUsd);
|
|
16576
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageSubscriptionCredits.replace("{credits}", value.credits).replace("{usd}", value.usd) });
|
|
16577
|
+
})(),
|
|
16578
|
+
(() => {
|
|
16579
|
+
const value = credits(billing.rechargeCredits, billing.rechargeCreditsUsd);
|
|
16580
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageRechargeCredits.replace("{credits}", value.credits).replace("{usd}", value.usd) });
|
|
16581
|
+
})(),
|
|
16582
|
+
(() => {
|
|
16583
|
+
const value = credits(billing.totalAvailableCredits, billing.totalAvailableCreditsUsd);
|
|
16584
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageTotalCredits.replace("{credits}", value.credits).replace("{usd}", value.usd) });
|
|
16585
|
+
})(),
|
|
16586
|
+
billing.todayConsumedUsd !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageTodayConsumed.replace("{amount}", billing.todayConsumedUsd) }),
|
|
16587
|
+
billing.totalConsumedUsd !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageTotalConsumed.replace("{amount}", billing.totalConsumedUsd) }),
|
|
16588
|
+
billing.usageCount !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageUsageCount.replace("{count}", String(billing.usageCount)) })
|
|
16589
|
+
]
|
|
16590
|
+
}),
|
|
16591
|
+
planHasBar && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
16592
|
+
className: "dshod-plan",
|
|
16593
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
16594
|
+
className: "dshod-plan-title",
|
|
16595
|
+
children: labels.usageWindowsTitle
|
|
16596
|
+
}), planWindows.map((window) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
16597
|
+
className: "dshod-plan-window",
|
|
16598
|
+
children: [
|
|
16599
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
16600
|
+
className: "dshod-plan-window-head",
|
|
16601
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
16602
|
+
className: "dshod-plan-window-name",
|
|
16603
|
+
children: window.name
|
|
16604
|
+
}), window.used !== null && window.remaining !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
16605
|
+
className: "dshod-plan-window-figures",
|
|
16606
|
+
children: [
|
|
16607
|
+
labels.usageWindowUsed.replace("{used}", formatDecimal$1(window.used)),
|
|
16608
|
+
" · ",
|
|
16609
|
+
labels.usageWindowRemaining.replace("{remaining}", formatDecimal$1(window.remaining))
|
|
16610
|
+
]
|
|
16611
|
+
})]
|
|
16612
|
+
}),
|
|
16613
|
+
window.used !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
16614
|
+
className: "dshod-meter-track",
|
|
16615
|
+
role: "progressbar",
|
|
16616
|
+
"aria-label": `${window.name} · ${labels.usageWindowUsed.replace("{used}", formatDecimal$1(window.used))}`,
|
|
16617
|
+
"aria-valuemin": 0,
|
|
16618
|
+
"aria-valuemax": 100,
|
|
16619
|
+
"aria-valuenow": window.used,
|
|
16620
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("i", {
|
|
16621
|
+
className: "dshod-meter-fill",
|
|
16622
|
+
style: { width: `${clampPercent(window.used)}%` }
|
|
16623
|
+
})
|
|
16624
|
+
}),
|
|
16625
|
+
window.resetsAt !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
16626
|
+
className: "dshod-plan-resets",
|
|
16627
|
+
children: labels.usageWindowResetsAt.replace("{time}", formatAccountDate(window.resetsAt))
|
|
16628
|
+
})
|
|
16629
|
+
]
|
|
16630
|
+
}, window.key))]
|
|
16631
|
+
})
|
|
16632
|
+
] }),
|
|
16633
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
16329
16634
|
className: "dshod-quota-meta",
|
|
16330
|
-
children: labels.usagePeriod.replace("{start}", formatIso(billing.periodStart)).replace("{end}", formatIso(billing.periodEnd))
|
|
16331
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
16332
|
-
className: "dshod-quota-grid",
|
|
16333
16635
|
children: [
|
|
16334
|
-
(()
|
|
16335
|
-
|
|
16336
|
-
|
|
16337
|
-
})(),
|
|
16338
|
-
(() => {
|
|
16339
|
-
const value = credits(billing.rechargeCredits, billing.rechargeCreditsUsd);
|
|
16340
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageRechargeCredits.replace("{credits}", value.credits).replace("{usd}", value.usd) });
|
|
16341
|
-
})(),
|
|
16342
|
-
(() => {
|
|
16343
|
-
const value = credits(billing.totalAvailableCredits, billing.totalAvailableCreditsUsd);
|
|
16344
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageTotalCredits.replace("{credits}", value.credits).replace("{usd}", value.usd) });
|
|
16345
|
-
})(),
|
|
16346
|
-
billing.todayConsumedUsd !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageTodayConsumed.replace("{amount}", billing.todayConsumedUsd) }),
|
|
16347
|
-
billing.totalConsumedUsd !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageTotalConsumed.replace("{amount}", billing.totalConsumedUsd) }),
|
|
16348
|
-
billing.usageCount !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.usageUsageCount.replace("{count}", String(billing.usageCount)) })
|
|
16636
|
+
entry.balanceUsd !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [labels.usageBalance.replace("{amount}", entry.balanceUsd), " · "] }),
|
|
16637
|
+
labels.usageReadAt.replace("{time}", formatAccountDate(entry.fetchedAt)),
|
|
16638
|
+
planHint !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [" · ", planHint] })
|
|
16349
16639
|
]
|
|
16350
|
-
})] }),
|
|
16351
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
16352
|
-
className: "dshod-quota-meta",
|
|
16353
|
-
children: [entry.balanceUsd !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [labels.usageBalance.replace("{amount}", entry.balanceUsd), " · "] }), labels.usageReadAt.replace("{time}", formatAccountDate(entry.fetchedAt))]
|
|
16354
16640
|
}),
|
|
16355
16641
|
!entry.ok && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
16356
16642
|
className: "dshod-warning",
|
|
@@ -17746,7 +18032,7 @@ window.__ModuleLoader__.load({
|
|
|
17746
18032
|
modelsHint: "勾选后模型才会显示在对话页的模型选择列表中;全部取消勾选或关闭上方开关可在列表中隐藏该供应商。",
|
|
17747
18033
|
proxySettings: "网络代理",
|
|
17748
18034
|
proxyMode: "代理模式",
|
|
17749
|
-
proxyModeHint: "
|
|
18035
|
+
proxyModeHint: "本插件的全部供应线路共用这一份代理设置,登录、令牌续期、模型目录与配额读取同样经过它;支持自动读取系统代理,修改后对后续请求生效。",
|
|
17750
18036
|
proxyModeAuto: "系统代理(自动检测)",
|
|
17751
18037
|
proxyModeCustom: "自定义代理",
|
|
17752
18038
|
proxyModeDirect: "直连(禁用代理)",
|
|
@@ -17757,7 +18043,7 @@ window.__ModuleLoader__.load({
|
|
|
17757
18043
|
proxyDetected: "检测到系统代理",
|
|
17758
18044
|
proxyDetectedEffective: "(已自动生效)",
|
|
17759
18045
|
proxyNoneDetected: "未检测到系统代理,将使用直连",
|
|
17760
|
-
proxyDirectHint: "
|
|
18046
|
+
proxyDirectHint: "本插件的全部请求将直接连接,不经过任何代理服务器。",
|
|
17761
18047
|
enhancements: "增强功能",
|
|
17762
18048
|
fastMode: "快速模式(1.5x 速度)",
|
|
17763
18049
|
fastModeHint: "提升 Token 生成速度至约 1.5 倍;将以约 2x–2.5x 速度消耗 Codex 订阅额度。",
|
|
@@ -17921,7 +18207,7 @@ window.__ModuleLoader__.load({
|
|
|
17921
18207
|
modelsHint: "Checked models appear in the conversation model picker; unchecking all or turning off the switch hides this provider from the picker.",
|
|
17922
18208
|
proxySettings: "Network Proxy",
|
|
17923
18209
|
proxyMode: "Proxy Mode",
|
|
17924
|
-
proxyModeHint: "
|
|
18210
|
+
proxyModeHint: "Every provider line in this plugin shares these proxy settings, including sign-in, token renewal, model catalog and quota reads. Supports system proxy detection; changes apply to subsequent requests.",
|
|
17925
18211
|
proxyModeAuto: "System Proxy (Auto-detect)",
|
|
17926
18212
|
proxyModeCustom: "Custom Proxy",
|
|
17927
18213
|
proxyModeDirect: "Direct (No Proxy)",
|
|
@@ -17932,7 +18218,7 @@ window.__ModuleLoader__.load({
|
|
|
17932
18218
|
proxyDetected: "Detected system proxy",
|
|
17933
18219
|
proxyDetectedEffective: " (active)",
|
|
17934
18220
|
proxyNoneDetected: "No system proxy detected; connecting directly",
|
|
17935
|
-
proxyDirectHint: "
|
|
18221
|
+
proxyDirectHint: "Every request from this plugin connects directly without using any proxy server.",
|
|
17936
18222
|
enhancements: "Enhancements",
|
|
17937
18223
|
fastMode: "Fast mode (1.5x speed)",
|
|
17938
18224
|
fastModeHint: "Generates tokens ~1.5x faster; consumes Codex subscription quota at ~2x–2.5x the normal rate.",
|
|
@@ -18111,6 +18397,11 @@ window.__ModuleLoader__.load({
|
|
|
18111
18397
|
settingsEnabledNote: "让 agent 在对话中发布进展更新",
|
|
18112
18398
|
settingsThresholdName: "催促阈值",
|
|
18113
18399
|
settingsThresholdNote: "连续这么多轮没有进展时,提醒 agent 汇报一次",
|
|
18400
|
+
settingsLanguageName: "输出语言",
|
|
18401
|
+
settingsLanguageNote: "进展更新的标题与正文用哪种语言写",
|
|
18402
|
+
settingsLanguageAuto: "自动(跟随对话)",
|
|
18403
|
+
settingsLanguageZh: "中文",
|
|
18404
|
+
settingsLanguageEn: "English",
|
|
18114
18405
|
settingsPanelName: "进展面板",
|
|
18115
18406
|
settingsPanelNote: "在右侧栏查看本次会话的全部进展",
|
|
18116
18407
|
settingsUnavailable: "这项设置当前不可修改(宿主没有开放配置表单)",
|
|
@@ -18142,6 +18433,11 @@ window.__ModuleLoader__.load({
|
|
|
18142
18433
|
settingsEnabledNote: "Let the agent post progress updates in the conversation",
|
|
18143
18434
|
settingsThresholdName: "Nudge threshold",
|
|
18144
18435
|
settingsThresholdNote: "Remind the agent after this many rounds without an update",
|
|
18436
|
+
settingsLanguageName: "Output language",
|
|
18437
|
+
settingsLanguageNote: "Which language the update titles and bodies are written in",
|
|
18438
|
+
settingsLanguageAuto: "Auto (follow the conversation)",
|
|
18439
|
+
settingsLanguageZh: "Chinese",
|
|
18440
|
+
settingsLanguageEn: "English",
|
|
18145
18441
|
settingsPanelName: "Progress panel",
|
|
18146
18442
|
settingsPanelNote: "See every update from this session in the right sidebar",
|
|
18147
18443
|
settingsUnavailable: "This setting cannot be changed right now (the host serves no config form)",
|
|
@@ -18745,7 +19041,7 @@ window.__ModuleLoader__.load({
|
|
|
18745
19041
|
modelsHint: "Отмеченные модели появляются в списке выбора модели на странице диалога; если снять все отметки или выключить переключатель выше, провайдер исчезнет из списка.",
|
|
18746
19042
|
proxySettings: "Сетевой прокси",
|
|
18747
19043
|
proxyMode: "Режим прокси",
|
|
18748
|
-
proxyModeHint: "
|
|
19044
|
+
proxyModeHint: "Все линии провайдеров этого плагина используют эти настройки прокси, включая вход, обновление токенов, каталог моделей и чтение квот; поддерживается автоопределение системного прокси, изменения действуют на последующие запросы.",
|
|
18749
19045
|
proxyModeAuto: "Системный прокси (автоопределение)",
|
|
18750
19046
|
proxyModeCustom: "Свой прокси",
|
|
18751
19047
|
proxyModeDirect: "Напрямую (без прокси)",
|
|
@@ -18756,7 +19052,7 @@ window.__ModuleLoader__.load({
|
|
|
18756
19052
|
proxyDetected: "Обнаружен системный прокси",
|
|
18757
19053
|
proxyDetectedEffective: " (уже действует)",
|
|
18758
19054
|
proxyNoneDetected: "Системный прокси не обнаружен, соединение напрямую",
|
|
18759
|
-
proxyDirectHint: "Все запросы идут напрямую, без прокси-сервера.",
|
|
19055
|
+
proxyDirectHint: "Все запросы этого плагина идут напрямую, без прокси-сервера.",
|
|
18760
19056
|
enhancements: "Дополнительные функции",
|
|
18761
19057
|
fastMode: "Быстрый режим (скорость 1.5x)",
|
|
18762
19058
|
fastModeHint: "Генерирует токены примерно в 1.5 раза быстрее; квота подписки Codex при этом расходуется в 2–2.5 раза быстрее.",
|
|
@@ -18940,10 +19236,13 @@ window.__ModuleLoader__.load({
|
|
|
18940
19236
|
wireAnthropic: "Anthropic",
|
|
18941
19237
|
wireOpenai: "OpenAI",
|
|
18942
19238
|
capVideo: "Видео*",
|
|
19239
|
+
capThinkingOnly: "Только рассуждения",
|
|
19240
|
+
capEfforts: "Уровни {list}",
|
|
18943
19241
|
capDynamicTools: "Динамические инструменты",
|
|
18944
19242
|
capImageOnly: "Изображения",
|
|
18945
19243
|
capNone: "—",
|
|
18946
19244
|
capVideoFootnote: "* Видео подключается инструментом kimi_attach_video (абсолютный локальный путь или ссылка http(s)); вставка и загрузка по-прежнему принимают только изображения.",
|
|
19245
|
+
capThinkingOnlyFootnote: "* У модели с пометкой «только рассуждения» нельзя отключить рассуждения: запрос с none сервис отклоняет (HTTP 400), поэтому уровня «рассуждения выкл.» у неё нет.",
|
|
18947
19246
|
capabilitiesTitle: "Возможности",
|
|
18948
19247
|
capColMedia: "Мультимодальность",
|
|
18949
19248
|
capColTools: "Динамические инструменты",
|
|
@@ -18954,13 +19253,16 @@ window.__ModuleLoader__.load({
|
|
|
18954
19253
|
speedRegular: "Обычная",
|
|
18955
19254
|
speedHighspeed: "Ускоренная (~6×)",
|
|
18956
19255
|
quotaCost: "Множитель квоты",
|
|
19256
|
+
quotaUnknown: "Не опубликовано",
|
|
18957
19257
|
minimumPlan: "Нужный тариф",
|
|
18958
19258
|
enhanced: "Рассуждения",
|
|
18959
19259
|
defaultReasoningEffort: "Уровень рассуждений по умолчанию",
|
|
18960
|
-
defaultReasoningEffortHint: "
|
|
19260
|
+
defaultReasoningEffortHint: "Набор уровней следует тому, что заявляют отмеченные модели (если не отмечено ни одной — все четыре: low / high / max / none); none отключает рассуждения и действует только для моделей, которые это позволяют. Смена уровня сбрасывает кеш контекста, поэтому в пределах сессии держите его неизменным.",
|
|
19261
|
+
effortThinkingOnlyNote: "Среди отмеченных моделей есть те, что рассуждают всегда: {models}. Уровня «рассуждения выкл.» у них нет — такой запрос сервис отклоняет (HTTP 400), поэтому здесь он не предлагается.",
|
|
19262
|
+
effortNotOffered: "отмеченные модели это не принимают",
|
|
18961
19263
|
cacheTtl: "Время жизни кеша контекста",
|
|
18962
|
-
cacheTtlHint: "Kimi кеширует префиксы автоматически, здесь выбирается
|
|
18963
|
-
cacheTtlDefault: "Не
|
|
19264
|
+
cacheTtlHint: "Kimi кеширует префиксы автоматически, здесь выбирается уровень записи, и их всего два: 5m и 1h. Пустое значение — поле не отправляется, и тогда сервис пишет на уровне 5 минут. Запись на 1 ч стоит примерно вдвое дороже записи на 5 мин и окупается, только если тот же префикс перечитывается в течение часа. Уровень фиксируется при первой записи, а попадания продлевают её по исходному TTL. Выбирайте по паузе между ходами: 5 минут, если она обычно короче ~30 минут; 1 час для сессий с долгим простоем, например диспетчера, ждущего субагентов.",
|
|
19265
|
+
cacheTtlDefault: "Не передавать (сервис пишет на уровне 5 минут)",
|
|
18964
19266
|
cacheTtl5m: "5 минут",
|
|
18965
19267
|
cacheTtl1h: "1 час",
|
|
18966
19268
|
defaultEffortAuto: "Как в модели по умолчанию",
|
|
@@ -18986,6 +19288,11 @@ window.__ModuleLoader__.load({
|
|
|
18986
19288
|
cacheFresh: "Новые токены",
|
|
18987
19289
|
cacheOutput: "Выходные токены",
|
|
18988
19290
|
cacheRequests: "Запросы",
|
|
19291
|
+
cacheWrite: "Запись в кеш",
|
|
19292
|
+
cacheWrite5m: "Уровень 5 минут",
|
|
19293
|
+
cacheWrite1h: "Уровень 1 час",
|
|
19294
|
+
cacheWriteHint: "Запись — отдельная статья биллинга: запись на 1 ч стоит примерно вдвое дороже записи на 5 мин, а попадание продлевает её по исходному TTL. 0 на уровне означает, что сервис не сообщил запись для этого уровня (отсутствующий заголовок — молчание), а не то, что там ничего не записали.",
|
|
19295
|
+
unknownMetric: "нет данных",
|
|
18989
19296
|
cacheHint: "В пределах одной сессии: любое изменение системного промпта или списка инструментов сбрасывает весь префиксный кеш, поэтому держите набор инструментов стабильным, а новое добавляйте в конец — так доля попаданий выше.",
|
|
18990
19297
|
cacheExpired: "Сессия простаивала дольше времени жизни кеша, поэтому следующий ход заново обработает около {tokens} токенов.",
|
|
18991
19298
|
cacheDrift: "Состояние последнего префикса",
|
|
@@ -19363,6 +19670,15 @@ window.__ModuleLoader__.load({
|
|
|
19363
19670
|
usageTotalConsumed: "Израсходовано всего ${amount}",
|
|
19364
19671
|
usageUsageCount: "Платных запросов: {count}",
|
|
19365
19672
|
usagePlanUnknown: "Кредиты прочитаны, но сервис не указал тариф.",
|
|
19673
|
+
usageWindowsTitle: "Окна лимитов Design Plan",
|
|
19674
|
+
usageWindowUsed: "использовано {used}%",
|
|
19675
|
+
usageWindowRemaining: "остаток {remaining}%",
|
|
19676
|
+
usageWindowResetsAt: "сброс {time}",
|
|
19677
|
+
usageWindowsUnavailable: "Окна лимитов не прочитаны или не настроены для этого рабочего пространства",
|
|
19678
|
+
usageWindowsConsoleOnly: "Окна лимитов видны только в консоли OpenDesign: эндпоинт не принимает учётные данные плагина",
|
|
19679
|
+
usageWindowDays: "дней: {count}",
|
|
19680
|
+
usageWindowHours: "часов: {count}",
|
|
19681
|
+
usageWindowMinutes: "минут: {count}",
|
|
19366
19682
|
limitKey: "API-ключи хранятся в системном хранилище учётных данных; карточка никогда не показывает сам ключ.",
|
|
19367
19683
|
limitGateway: "Запросы обслуживает шлюз OpenDesign, он же выбирает фактического провайдера.",
|
|
19368
19684
|
limitRoute: "Маршрут занимается по provider id: если opendesign уже обслуживает другой плагин, эта карточка по-прежнему настраивает линию, но запросы выполняет тот провайдер.",
|
|
@@ -19395,6 +19711,11 @@ window.__ModuleLoader__.load({
|
|
|
19395
19711
|
settingsEnabledNote: "Разрешить агенту публиковать ход работы в диалоге",
|
|
19396
19712
|
settingsThresholdName: "Порог напоминания",
|
|
19397
19713
|
settingsThresholdNote: "Напомнить агенту после стольких раундов без отчёта",
|
|
19714
|
+
settingsLanguageName: "Язык вывода",
|
|
19715
|
+
settingsLanguageNote: "На каком языке пишутся заголовки и тексты записей",
|
|
19716
|
+
settingsLanguageAuto: "Авто (как в диалоге)",
|
|
19717
|
+
settingsLanguageZh: "Китайский",
|
|
19718
|
+
settingsLanguageEn: "English",
|
|
19398
19719
|
settingsPanelName: "Панель хода работы",
|
|
19399
19720
|
settingsPanelNote: "Показывать все записи этой сессии в правой панели",
|
|
19400
19721
|
settingsUnavailable: "Эту настройку сейчас нельзя изменить (Host не предоставляет форму настроек)",
|
|
@@ -20203,13 +20524,24 @@ window.__ModuleLoader__.load({
|
|
|
20203
20524
|
title: facts.tooltip,
|
|
20204
20525
|
"aria-label": facts.tooltip,
|
|
20205
20526
|
onClick: () => void fetchStatus(true),
|
|
20206
|
-
children: [
|
|
20207
|
-
|
|
20208
|
-
|
|
20209
|
-
|
|
20210
|
-
|
|
20211
|
-
|
|
20212
|
-
|
|
20527
|
+
children: [
|
|
20528
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
20529
|
+
className: "dsha-composer-quota-label",
|
|
20530
|
+
children: label
|
|
20531
|
+
}),
|
|
20532
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
|
|
20533
|
+
className: "dsha-composer-quota-val",
|
|
20534
|
+
children: loading ? "…" : facts.text
|
|
20535
|
+
}),
|
|
20536
|
+
typeof facts.percent === "number" && Number.isFinite(facts.percent) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
20537
|
+
className: "dsha-composer-quota-meter",
|
|
20538
|
+
"aria-hidden": "true",
|
|
20539
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("i", {
|
|
20540
|
+
className: "dsha-composer-quota-meter-fill",
|
|
20541
|
+
style: { width: `${Math.min(100, Math.max(0, facts.percent))}%` }
|
|
20542
|
+
})
|
|
20543
|
+
})
|
|
20544
|
+
]
|
|
20213
20545
|
});
|
|
20214
20546
|
}
|
|
20215
20547
|
//#endregion
|
|
@@ -21734,6 +22066,12 @@ window.__ModuleLoader__.load({
|
|
|
21734
22066
|
* at all; the badge shows the primary (else first) readable account's latest
|
|
21735
22067
|
* balance and never triggers a read of its own — a poll must not fan out one
|
|
21736
22068
|
* upstream call per account. A pasted-key-only pool renders nothing.
|
|
22069
|
+
*
|
|
22070
|
+
* The Design Plan endpoint also states the tier's allowance windows, each with
|
|
22071
|
+
* its own grant and what is left of it, so the badge shows the remaining share
|
|
22072
|
+
* of the narrowest window and draws it as a thin bar. A reading without a
|
|
22073
|
+
* measurable window keeps the bare balance, which is what every other line
|
|
22074
|
+
* renders.
|
|
21737
22075
|
*/
|
|
21738
22076
|
function OpenDesignComposerQuota(props) {
|
|
21739
22077
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComposerQuotaBadge, {
|
|
@@ -21745,6 +22083,49 @@ window.__ModuleLoader__.load({
|
|
|
21745
22083
|
selectFacts: selectOpenDesignFacts
|
|
21746
22084
|
});
|
|
21747
22085
|
}
|
|
22086
|
+
/** A number the badge prints bare: the label around it carries the unit. */
|
|
22087
|
+
function formatDecimal(value) {
|
|
22088
|
+
try {
|
|
22089
|
+
return new Intl.NumberFormat(void 0, { maximumFractionDigits: 1 }).format(value);
|
|
22090
|
+
} catch {
|
|
22091
|
+
return String(value);
|
|
22092
|
+
}
|
|
22093
|
+
}
|
|
22094
|
+
/**
|
|
22095
|
+
* A window's length in the words the service sold it in.
|
|
22096
|
+
*
|
|
22097
|
+
* The settings card makes the same derivation; it is repeated here because the
|
|
22098
|
+
* two surfaces read different dictionaries (the section is localized, this badge
|
|
22099
|
+
* is not), and one decimal is what keeps "1.5 小时" from reading as "2 小时".
|
|
22100
|
+
*/
|
|
22101
|
+
function planWindowName(seconds) {
|
|
22102
|
+
if (seconds >= 86400 && seconds % 86400 === 0) return zh$2.usageWindowDays.replace("{count}", String(seconds / 86400));
|
|
22103
|
+
if (seconds >= 3600) return zh$2.usageWindowHours.replace("{count}", formatDecimal(seconds / 3600));
|
|
22104
|
+
return zh$2.usageWindowMinutes.replace("{count}", formatDecimal(seconds / 60));
|
|
22105
|
+
}
|
|
22106
|
+
/** What a window still has, from the grant and the remainder it states. */
|
|
22107
|
+
function windowRemaining(limitCredits, remainingCredits) {
|
|
22108
|
+
const limit = Number(limitCredits);
|
|
22109
|
+
const left = Number(remainingCredits);
|
|
22110
|
+
if (!Number.isFinite(limit) || !Number.isFinite(left) || limit <= 0) return null;
|
|
22111
|
+
const used = Math.min(100, Math.max(0, Math.round((limit - left) / limit * 1e3) / 10));
|
|
22112
|
+
return Math.min(100, Math.max(0, Math.round((100 - used) * 10) / 10));
|
|
22113
|
+
}
|
|
22114
|
+
/** Every window the badge can speak about, narrowest first. */
|
|
22115
|
+
function planWindows(plan) {
|
|
22116
|
+
if (plan === void 0 || plan.error !== "") return [];
|
|
22117
|
+
const readings = [];
|
|
22118
|
+
for (const window of plan.windows) {
|
|
22119
|
+
const remaining = windowRemaining(window.limitCredits, window.remainingCredits);
|
|
22120
|
+
if (remaining === null) continue;
|
|
22121
|
+
readings.push({
|
|
22122
|
+
seconds: window.durationSeconds,
|
|
22123
|
+
name: planWindowName(window.durationSeconds),
|
|
22124
|
+
remaining
|
|
22125
|
+
});
|
|
22126
|
+
}
|
|
22127
|
+
return readings.sort((left, right) => left.seconds - right.seconds);
|
|
22128
|
+
}
|
|
21748
22129
|
/** The line's own number picker, exported so a test can pin the rule. */
|
|
21749
22130
|
function selectOpenDesignFacts(status, _modelId) {
|
|
21750
22131
|
if (status === null || !status.authenticated || status.usage === null) return null;
|
|
@@ -21753,11 +22134,19 @@ window.__ModuleLoader__.load({
|
|
|
21753
22134
|
const primaryId = status.pool.activeAccountId ?? status.pool.accounts.find((account) => account.isPrimary)?.id;
|
|
21754
22135
|
const reading = readings.find((account) => account.accountId === primaryId) ?? readings[0];
|
|
21755
22136
|
const amount = reading.balanceUsd;
|
|
21756
|
-
const
|
|
21757
|
-
|
|
22137
|
+
const readAt = zh$2.usageReadAt.replace("{time}", new Date(reading.fetchedAt).toLocaleTimeString());
|
|
22138
|
+
const windows = planWindows(reading.codingPlan);
|
|
22139
|
+
if (windows.length === 0) return {
|
|
21758
22140
|
text: `$${amount}`,
|
|
21759
|
-
tooltip: `${reading.alias} · ${
|
|
21760
|
-
level:
|
|
22141
|
+
tooltip: `${reading.alias} · ${readAt}`,
|
|
22142
|
+
level: Number(amount) === 0 ? "danger" : "normal"
|
|
22143
|
+
};
|
|
22144
|
+
const narrowest = windows[0];
|
|
22145
|
+
return {
|
|
22146
|
+
text: zh$2.usageWindowRemaining.replace("{remaining}", formatDecimal(narrowest.remaining)),
|
|
22147
|
+
tooltip: `${reading.alias} · ${windows.map((window) => `${window.name} ${zh$2.usageWindowRemaining.replace("{remaining}", formatDecimal(window.remaining))}`).join(" · ")} · ${readAt}`,
|
|
22148
|
+
level: quotaLevel(narrowest.remaining),
|
|
22149
|
+
percent: narrowest.remaining
|
|
21761
22150
|
};
|
|
21762
22151
|
}
|
|
21763
22152
|
//#endregion
|
|
@@ -21767,6 +22156,11 @@ window.__ModuleLoader__.load({
|
|
|
21767
22156
|
* controls, which the shared `.dsha-*` vocabulary has no expression for.
|
|
21768
22157
|
* Everything else on the tab reuses the shared card.
|
|
21769
22158
|
*
|
|
22159
|
+
* The composer meter is the one shared-markup rule kept here: every line feeds
|
|
22160
|
+
* the shared badge differently, and this line is the only one that hands it a
|
|
22161
|
+
* remaining share to draw, so the rule lives beside the card that produces the
|
|
22162
|
+
* figure instead of being repeated in every line's sheet.
|
|
22163
|
+
*
|
|
21770
22164
|
* `.dshod-input` mirrors the input styling another line declares under an
|
|
21771
22165
|
* unprefixed name on purpose: that class is that line's own, and a prefix of
|
|
21772
22166
|
* ours keeps this card's look from drifting with someone else's sheet.
|
|
@@ -21796,6 +22190,17 @@ window.__ModuleLoader__.load({
|
|
|
21796
22190
|
.dshod-quota-status{color:var(--dsw-alias-label-secondary);font-size:12px}
|
|
21797
22191
|
.dshod-quota-meta{color:var(--dsw-alias-label-tertiary);font-size:12px}
|
|
21798
22192
|
.dshod-quota-grid{color:var(--dsw-alias-label-secondary);display:grid;font-size:12px;gap:4px 16px;grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
|
|
22193
|
+
.dshod-plan{display:flex;flex-direction:column;gap:6px;margin-top:2px}
|
|
22194
|
+
.dshod-plan-title{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600}
|
|
22195
|
+
.dshod-plan-window{display:flex;flex-direction:column;gap:4px}
|
|
22196
|
+
.dshod-plan-window-head{align-items:baseline;display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between}
|
|
22197
|
+
.dshod-plan-window-name{color:var(--dsw-alias-label-primary);font-size:12px}
|
|
22198
|
+
.dshod-plan-window-figures{color:var(--dsw-alias-label-secondary);font-size:12px;font-variant-numeric:tabular-nums}
|
|
22199
|
+
.dshod-plan-resets{color:var(--dsw-alias-label-tertiary);font-size:11px}
|
|
22200
|
+
.dshod-meter-track{background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-border-l2);border-radius:999px;display:block;height:6px;overflow:hidden}
|
|
22201
|
+
.dshod-meter-fill{background:var(--dsw-alias-brand-primary);display:block;height:100%;transition:width .2s ease}
|
|
22202
|
+
.dsha-composer-quota-meter{align-self:center;background:var(--dsw-alias-border-l2);border-radius:999px;display:inline-block;flex:none;height:3px;overflow:hidden;width:24px}
|
|
22203
|
+
.dsha-composer-quota-meter-fill{background:var(--dsw-alias-brand-primary);display:block;height:100%}
|
|
21799
22204
|
.dshod-adv-control{width:240px;max-width:100%;flex:none}
|
|
21800
22205
|
.dshod-adv-control.dsha-select{max-width:240px;min-width:240px;width:240px}
|
|
21801
22206
|
.dshod-adv-mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
|
|
@@ -51334,7 +51739,35 @@ window.__ModuleLoader__.load({
|
|
|
51334
51739
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 6h12M4 10h8M4 14h5" })
|
|
51335
51740
|
});
|
|
51336
51741
|
}
|
|
51337
|
-
/**
|
|
51742
|
+
/** 第三行的标记:一个地球,对应「输出语言」。 */
|
|
51743
|
+
function LanguageMark() {
|
|
51744
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
51745
|
+
viewBox: "0 0 20 20",
|
|
51746
|
+
width: "20",
|
|
51747
|
+
height: "20",
|
|
51748
|
+
fill: "none",
|
|
51749
|
+
stroke: "currentColor",
|
|
51750
|
+
strokeWidth: "1.6",
|
|
51751
|
+
strokeLinecap: "round",
|
|
51752
|
+
strokeLinejoin: "round",
|
|
51753
|
+
"aria-hidden": "true",
|
|
51754
|
+
children: [
|
|
51755
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
51756
|
+
cx: "10",
|
|
51757
|
+
cy: "10",
|
|
51758
|
+
r: "7"
|
|
51759
|
+
}),
|
|
51760
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 10h14" }),
|
|
51761
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ellipse", {
|
|
51762
|
+
cx: "10",
|
|
51763
|
+
cy: "10",
|
|
51764
|
+
rx: "3.2",
|
|
51765
|
+
ry: "7"
|
|
51766
|
+
})
|
|
51767
|
+
]
|
|
51768
|
+
});
|
|
51769
|
+
}
|
|
51770
|
+
/** 第四行的标记:一块右侧栏面板。 */
|
|
51338
51771
|
function PanelMark() {
|
|
51339
51772
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
51340
51773
|
viewBox: "0 0 20 20",
|
|
@@ -51395,7 +51828,7 @@ window.__ModuleLoader__.load({
|
|
|
51395
51828
|
});
|
|
51396
51829
|
}
|
|
51397
51830
|
/**
|
|
51398
|
-
*
|
|
51831
|
+
* 进展更新的设置分区:四行卡片。
|
|
51399
51832
|
* @param props - 壳的关闭回调、注入的打开动作与表单、文案座位。
|
|
51400
51833
|
* @returns 设置页里的这一页。
|
|
51401
51834
|
*/
|
|
@@ -51409,6 +51842,7 @@ window.__ModuleLoader__.load({
|
|
|
51409
51842
|
const writable = settings !== void 0 && snapshot.status === "ready" && snapshot.writable;
|
|
51410
51843
|
const enabled = value.progressUpdates !== false;
|
|
51411
51844
|
const threshold = typeof value.progressUpdatesNudgeThreshold === "number" ? value.progressUpdatesNudgeThreshold : 8;
|
|
51845
|
+
const language = value.progressUpdatesLanguage === "zh" || value.progressUpdatesLanguage === "en" ? value.progressUpdatesLanguage : "auto";
|
|
51412
51846
|
const [draft, setDraft] = (0, react.useState)(() => String(threshold));
|
|
51413
51847
|
(0, react.useEffect)(() => {
|
|
51414
51848
|
setDraft(String(threshold));
|
|
@@ -51528,6 +51962,38 @@ window.__ModuleLoader__.load({
|
|
|
51528
51962
|
}
|
|
51529
51963
|
})
|
|
51530
51964
|
}),
|
|
51965
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardRow, {
|
|
51966
|
+
part: "settings-row-language",
|
|
51967
|
+
brand: "#c26d2f",
|
|
51968
|
+
mark: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LanguageMark, {}),
|
|
51969
|
+
name: translate("settingsLanguageName"),
|
|
51970
|
+
note: failure?.row === "language" ? failure.text : translate("settingsLanguageNote"),
|
|
51971
|
+
danger: failure?.row === "language",
|
|
51972
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
51973
|
+
className: "dsh-progress-select",
|
|
51974
|
+
"data-dsh-part": "settings-language",
|
|
51975
|
+
"aria-label": translate("settingsLanguageName"),
|
|
51976
|
+
value: language,
|
|
51977
|
+
disabled: !writable,
|
|
51978
|
+
onChange: (event) => {
|
|
51979
|
+
write("language", "progressUpdatesLanguage", event.target.value);
|
|
51980
|
+
},
|
|
51981
|
+
children: [
|
|
51982
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
51983
|
+
value: "auto",
|
|
51984
|
+
children: translate("settingsLanguageAuto")
|
|
51985
|
+
}),
|
|
51986
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
51987
|
+
value: "zh",
|
|
51988
|
+
children: translate("settingsLanguageZh")
|
|
51989
|
+
}),
|
|
51990
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
51991
|
+
value: "en",
|
|
51992
|
+
children: translate("settingsLanguageEn")
|
|
51993
|
+
})
|
|
51994
|
+
]
|
|
51995
|
+
})
|
|
51996
|
+
}),
|
|
51531
51997
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CardRow, {
|
|
51532
51998
|
part: "settings-row-panel",
|
|
51533
51999
|
brand: "#7c6aef",
|
|
@@ -52256,6 +52722,9 @@ window.__ModuleLoader__.load({
|
|
|
52256
52722
|
.dsh-progress-number{background:var(--dsw-alias-bg-layer-1,#fff);border:0.5px solid var(--dsw-alias-border-l2,#e3e1d5);border-radius:8px;box-sizing:border-box;color:var(--dsw-alias-label-primary,#141413);font:inherit;font-size:13px;height:30px;padding:0 8px;text-align:center;width:64px}
|
|
52257
52723
|
.dsh-progress-number:focus-visible{outline:2px solid var(--dsw-alias-button-info-fill,#397ee8);outline-offset:1px}
|
|
52258
52724
|
.dsh-progress-number:disabled{cursor:default;opacity:.5}
|
|
52725
|
+
.dsh-progress-select{background:var(--dsw-alias-bg-layer-1,#fff);border:0.5px solid var(--dsw-alias-border-l2,#e3e1d5);border-radius:8px;box-sizing:border-box;color:var(--dsw-alias-label-primary,#141413);cursor:pointer;font:inherit;font-size:13px;height:30px;padding:0 6px}
|
|
52726
|
+
.dsh-progress-select:focus-visible{outline:2px solid var(--dsw-alias-button-info-fill,#397ee8);outline-offset:1px}
|
|
52727
|
+
.dsh-progress-select:disabled{cursor:default;opacity:.5}
|
|
52259
52728
|
.dsh-progress-open{align-items:center;background:transparent;border:0.5px solid var(--dsw-alias-border-l2,#e3e1d5);border-radius:8px;color:var(--dsw-alias-label-primary,#141413);cursor:pointer;display:inline-flex;font:inherit;font-size:12px;gap:2px;padding:5px 8px}
|
|
52260
52729
|
.dsh-progress-open:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(0,0,0,.04))}
|
|
52261
52730
|
.dsh-progress-open:focus-visible{outline:2px solid var(--dsw-alias-button-info-fill,#397ee8);outline-offset:2px}
|