dsh-codearts 1.2.13 → 1.2.14
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 +44 -0
- package/lib/bin.mjs +1 -1
- package/lib/client/index.d.cts +4 -1
- package/lib/client/index.js +98 -83
- package/lib/index.d.mts +11 -0
- package/lib/index.mjs +94 -13
- package/lib/{version-E5iTxpWh.mjs → version-Msk-1m2n.mjs} +18 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,50 @@
|
|
|
3
3
|
本文件记录本插件的重要改动。格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),
|
|
4
4
|
版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
5
5
|
|
|
6
|
+
## [1.2.14] - 2026-11-09
|
|
7
|
+
|
|
8
|
+
### 变更
|
|
9
|
+
|
|
10
|
+
- **单次请求的换号次数跟着账号数走**:以前固定试 3 个账号,5 个号时前 3 个都在这一轮里
|
|
11
|
+
报了并发上限,第 4 个明明空着也轮不到,只能落到「原地排队等 52 秒」的兜底上 —— 那 52
|
|
12
|
+
秒本来能绕开。现在试 `clamp(可用账号数, 3, 6)` 个,第 7 个以后靠 LRU 在请求之间轮转
|
|
13
|
+
覆盖。同时把 75 秒预算改成「轮换 + 兜底排队」两段共用一个截止点(以前各算各的,多号
|
|
14
|
+
最坏能顶穿宿主 90 秒的流空闲超时),并且每次尝试前要求剩余预算还够过一次挂号(20 秒)。
|
|
15
|
+
- **撞上限后的「优先避开」窗口改成按每个号实测**:窗口以前固定 30 秒(`CAPPED_HINT_MS`),
|
|
16
|
+
而文件自己写着槽位「约 52 秒才释放」—— 30 秒一过这个号又变成优先候选,于是白打一次
|
|
17
|
+
上游、再记一次 cap,而每次 cap 又把窗口重置成同样的 30 秒,永远学不到真实时长。现在
|
|
18
|
+
只在「撞上限后于同一请求内排队等到成功」那条路上量出这个号的释放时长(取近 5 次的
|
|
19
|
+
中位数,钳在 5~120 秒,超范围的脏样本直接丢掉 —— 拿普通成功当样本会量成「用户下一次
|
|
20
|
+
提问隔了多久」,把窗口拉到几分钟),量到过就按实测设窗口,没量到过仍是 30 秒默认。
|
|
21
|
+
另外 `noteSuccess` 以前不清 `cappedUntil`:刚跑通的号会继续在卡片上挂着「避让中」最多
|
|
22
|
+
30 秒,那是假状态,现在成功即清除。
|
|
23
|
+
- **模型目录一直为空时的重试改成指数退避**:固定每分钟硬刷一轮,在「上游长期故障 / 号全
|
|
24
|
+
不能用」时会一直刷 —— 每轮对每个号都要 list + resolve(可能触发续期)+ 多路目录请求。
|
|
25
|
+
现在 60s → 120s → 240s → 300s 封顶,目录一旦有货回到每小时。
|
|
26
|
+
- **插件详情页改成整页宽度**:卡片以前写死 `max-width: 720px` 并居中 —— 设置页里宿主给的
|
|
27
|
+
列就差不多这个宽,看不出问题;宿主插件详情页给的是整列宽度,720 一卡右边就空出一大片,
|
|
28
|
+
看着像卡片缩水。现在宽度交给父容器,卡片只负责描边和底色。
|
|
29
|
+
|
|
30
|
+
### 修复
|
|
31
|
+
|
|
32
|
+
- **热力图「今天」那格底下像一条黑边**:那不是边框,是今天的标记线用了
|
|
33
|
+
`box-shadow: inset 0 -2px 0 0 currentColor`,跟着格子字色走。实测今天落在 lv2 档
|
|
34
|
+
(底 `#b3e8cc`、字 `#0f1115`),压出来就是 2px 近黑短线,在浅绿格子上特别刺眼。
|
|
35
|
+
现在按深浅分两档:浅底(lv1~lv3、无账、未来)压深绿,深底(lv4、lv5)压白。
|
|
36
|
+
- **首字 P95 一直是「—」**:那不是没采到样本。P95 落进「>30 秒」溢出档时
|
|
37
|
+
`percentileOf` 只回 `{ overflow: true }`、不带 value,而渲染先判 `p95 === undefined`
|
|
38
|
+
就把溢出吞成了「—」,`'>30 s'` 那一支永远走不到。实测本机今天 175 个样本、>30 秒档
|
|
39
|
+
15 个(8.6%)⇒ P95 确实在溢出档,界面却显示成没数据。现在溢出先判,显示 `>30 s`;
|
|
40
|
+
判定逻辑抽成 `latencyP95Label` 并补了用例(把顺序写回去用例会红)。
|
|
41
|
+
- **多账号时「上下文」整列显示为空**:卡片的模型列表每一行都是「— 上下文 · 64K 输出」,
|
|
42
|
+
点「刷新模型列表」也没用。上游其实给了(实测 `glm-5.2` 202752、`glm-5.3` 1M、
|
|
43
|
+
`openpangu-2.0-*` 524288),丢在跨账号合并那一步:`richerModel` 逐字段手抄拷贝清单,
|
|
44
|
+
把标记「这个上下文窗口是上游真给的还是兜底值」的 `contextWindowKnown` 静默丢了,接口
|
|
45
|
+
便不再下发这个字段。两个号时每个模型都要过一次这条函数,所以是「一直」空;单号不受影响。
|
|
46
|
+
现在合并以 `{ ...keep }` 为基底(以后加字段不会再被手抄清单漏掉),且「谁更可信」按
|
|
47
|
+
`contextWindowKnown` 判而不是按数值大小 —— 兜底值 32768 也是正数,旧判据会把另一个号
|
|
48
|
+
的真值 1M 换成兜底值,而 shim 正是拿这个数算上下文预算。
|
|
49
|
+
|
|
6
50
|
## [1.2.13] - 2026-11-09
|
|
7
51
|
|
|
8
52
|
### 修复
|
package/lib/bin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { G as codeartsAccountsPath, H as CodeArtsAccountStore, f as fetchCallerIdentity, i as discoverModels, n as CodeArtsUsageTracker, r as codeartsUsagePath, t as CODEARTS_VERSION, z as isBenefitModel } from "./version-
|
|
2
|
+
import { G as codeartsAccountsPath, H as CodeArtsAccountStore, f as fetchCallerIdentity, i as discoverModels, n as CodeArtsUsageTracker, r as codeartsUsagePath, t as CODEARTS_VERSION, z as isBenefitModel } from "./version-Msk-1m2n.mjs";
|
|
3
3
|
import { existsSync, statSync } from "node:fs";
|
|
4
4
|
//#region src/bin.ts
|
|
5
5
|
/**
|
package/lib/client/index.d.cts
CHANGED
|
@@ -128,7 +128,10 @@ interface CodeArtsSettingsKey {
|
|
|
128
128
|
doctorHintDshHome: string;
|
|
129
129
|
doctorHintPiAi: string;
|
|
130
130
|
doctorHintOther: string;
|
|
131
|
-
/**
|
|
131
|
+
/**
|
|
132
|
+
* 趋势两张图的标题与悬停提示(本月每日 / 今天逐小时)。
|
|
133
|
+
* 键名里的 Week 是历史遗留:那张图铺的是 `TREND_DAYS` = 35 天(5 周),不是 7 天。
|
|
134
|
+
*/
|
|
132
135
|
usageTrendWeek: string;
|
|
133
136
|
usageTrendHour: string;
|
|
134
137
|
usageTrendHint: string;
|
package/lib/client/index.js
CHANGED
|
@@ -61,8 +61,23 @@ function subscribeSidebarPanelWanted(listener) {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
|
+
//#region src/client/latency-label.ts
|
|
65
|
+
/**
|
|
66
|
+
* 首字延迟 P95 的显示值。
|
|
67
|
+
*
|
|
68
|
+
* 单独成模块是因为这里踩过一个静默失效的顺序:`percentileOf` 落进「>30 秒」溢出档时
|
|
69
|
+
* 只回 `{ overflow: true }`、不带 value(见 usage.ts 的注释:宁可不给精确值),
|
|
70
|
+
* 而渲染先判 `p95 === undefined` 就会把溢出吞成「—」—— 用户看到的是「这个数一直没值」,
|
|
71
|
+
* 实际是 P95 真的超过了 30 秒。溢出必须先判。
|
|
72
|
+
*/
|
|
73
|
+
function latencyP95Label(latency) {
|
|
74
|
+
if (latency.overflow === true) return ">30 s";
|
|
75
|
+
if (latency.p95 === void 0) return "—";
|
|
76
|
+
return `${Math.round(latency.p95)} ms`;
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
64
79
|
//#region \0dsh-css:/home/runner/work/dsh-codearts/dsh-codearts/src/client/CodeArtsPluginCard.module.css.mjs
|
|
65
|
-
const css$1 = ".xoziZG_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-settings-card-fill);max-width:720px}.xoziZG_header{align-items:flex-start;gap:12px;padding:14px 16px;display:flex}.xoziZG_headText{flex-direction:column;flex:1;gap:6px;min-width:0;display:flex}.xoziZG_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:22px}.xoziZG_desc{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:20px}.xoziZG_statusLine{color:var(--dsw-alias-label-primary);align-items:center;gap:6px;font-size:14px;font-weight:500;line-height:22px;display:inline-flex}.xoziZG_meta{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;line-height:18px}.xoziZG_body{border-top:.5px solid var(--dsw-alias-border-l2);margin:0 16px;padding:4px 0 16px}.xoziZG_tabs{margin-top:12px}.xoziZG_tabPanel{padding-top:2px}.xoziZG_accountToolbar{gap:8px;margin-top:12px;display:flex}.xoziZG_accountToolbar>*{flex:1}.xoziZG_manualForm{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);margin-top:12px;padding:12px}.xoziZG_accountCard{flex-direction:column;gap:10px;margin-top:12px;display:flex}.xoziZG_accountEntry{border:.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-2)}.xoziZG_accountRow{align-items:center;gap:10px;padding:12px;display:flex}.xoziZG_claimAllRow{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:flex-end;padding:10px 12px 0;display:flex}.xoziZG_avatar{background:var(--dsw-alias-bg-layer-3);width:32px;height:32px;color:var(--dsw-alias-label-primary);border-radius:50%;flex:none;justify-content:center;align-items:center;font-size:14px;font-weight:600;display:inline-flex}.xoziZG_accountInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.xoziZG_accountNameRow{align-items:center;gap:6px;min-width:0;display:flex}.xoziZG_accountName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600;line-height:20px;overflow:hidden}.xoziZG_accountRowActions{flex-wrap:wrap;flex:none;justify-content:flex-end;align-items:center;gap:6px;display:flex}.xoziZG_accountToggle{align-items:center;gap:6px;display:inline-flex}.xoziZG_accountToggleLabel{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:12px;line-height:20px}.xoziZG_accountHint{color:var(--dsw-alias-label-tertiary);margin:0;padding:0 12px 12px;font-size:12px;line-height:18px}.xoziZG_creditBlock{border-top:.5px solid var(--dsw-alias-border-l2);padding:12px}.xoziZG_balanceRow{flex-wrap:wrap;align-items:baseline;gap:6px;display:flex}.xoziZG_balance{color:var(--dsw-alias-label-primary);letter-spacing:-.02em;font-variant-numeric:tabular-nums;font-size:28px;font-weight:600;line-height:34px}.xoziZG_balanceUnit{color:var(--dsw-alias-label-secondary);font-size:12px}.xoziZG_balanceMeta{color:var(--dsw-alias-label-tertiary);margin-left:2px;font-size:12px}.xoziZG_updated{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;margin-left:auto;font-size:12px}.xoziZG_creditRows{flex-direction:column;gap:4px;margin-top:8px;display:flex}.xoziZG_creditRow{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;justify-content:space-between;align-items:baseline;gap:12px;font-size:12px;line-height:18px;display:flex}.xoziZG_usageBar{background:var(--dsw-alias-border-l2);border-radius:2px;height:4px;margin-top:4px;display:block;overflow:hidden}.xoziZG_usageFill{background:var(--dsw-alias-brand-primary);border-radius:2px;height:100%;transition:width .2s;display:block}.xoziZG_expiryRow{margin-top:2px}.xoziZG_expiryLabel{color:var(--dsw-alias-state-warn-label)}.xoziZG_bar{background:var(--dsw-alias-bg-layer-3);border-radius:2px;height:4px;margin-top:6px;display:block;overflow:hidden}.xoziZG_barFill{background:var(--dsw-alias-state-warn-primary);border-radius:2px;height:100%;display:block}.xoziZG_creditLink{margin-top:8px;display:inline-block}.xoziZG_creditFooter{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:center;gap:8px;margin-top:12px;padding-top:10px;display:flex}.xoziZG_creditHint{color:var(--dsw-alias-label-tertiary);margin:8px 0 0;font-size:12px;line-height:18px}.xoziZG_section{margin-top:16px}.xoziZG_sectionHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.xoziZG_sectionLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;font-weight:500}.xoziZG_count{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex:none;font-size:12px}.xoziZG_hint{color:var(--dsw-alias-label-secondary);margin:8px 0 0;font-size:13px;line-height:20px}.xoziZG_error{color:var(--dsw-alias-state-error-primary);margin:10px 0 0;font-size:13px;line-height:20px}.xoziZG_actions{flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px;display:flex}.xoziZG_danger{color:var(--dsw-alias-state-error-primary)}.xoziZG_link{appearance:none;color:var(--dsw-alias-brand-text);font:inherit;text-align:left;word-break:break-all;cursor:pointer;background:0 0;border:none;padding:0;font-size:12px}.xoziZG_link:hover{text-decoration:underline}.xoziZG_choices{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_choiceRow{border-radius:var(--dsw-radius-sm);align-items:center;gap:8px;margin:0 -6px;padding:5px 6px;display:flex}.xoziZG_choiceRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_statGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0 14px;display:grid}.xoziZG_statCard{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);flex-direction:column;gap:1px;padding:8px 10px;display:flex}.xoziZG_statLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.xoziZG_statValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:15px;line-height:20px}.xoziZG_statSub{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.xoziZG_modelChart{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_modelRow{font-variant-numeric:tabular-nums;border-radius:6px;grid-template-columns:minmax(0,1.2fr) minmax(48px,1fr) 56px 52px 64px;align-items:center;gap:8px;padding:4px 0;display:grid;position:relative}.xoziZG_modelRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_usageTip{z-index:5;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-3);min-width:180px;max-width:260px;color:var(--dsw-alias-label-secondary);text-align:left;font-variant-numeric:tabular-nums;pointer-events:none;padding:8px 10px;font-size:12px;line-height:1.9;position:absolute;bottom:calc(100% + 6px);right:0;box-shadow:0 10px 28px #00000073}.xoziZG_usageTip[data-float=true]{z-index:40;position:fixed;bottom:auto;right:auto}.xoziZG_usageTipName{max-width:240px;color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.xoziZG_usageTipSep{background:var(--dsw-alias-border-l2);height:1px;margin:4px 0}.xoziZG_usageTipRow{justify-content:space-between;gap:24px;display:flex}.xoziZG_usageTipRow span:last-child{color:var(--dsw-alias-label-primary);font-weight:600}.xoziZG_modelName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}.xoziZG_modelTrack{background:var(--dsw-alias-border-l2);border-radius:4px;height:8px;display:block;overflow:hidden}.xoziZG_modelFill{background:var(--dsw-alias-brand-primary);border-radius:4px;height:100%;transition:width .16s;display:block}.xoziZG_modelTokens,.xoziZG_modelShare,.xoziZG_modelRequests{color:var(--dsw-alias-label-secondary);text-align:right;white-space:nowrap;font-size:11px;line-height:16px}.xoziZG_modelRequests{color:var(--dsw-alias-label-tertiary)}.xoziZG_heatGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:8px 0 2px;display:grid}.xoziZG_heatWeekday{color:var(--dsw-alias-label-tertiary);text-align:center;font-size:10px;line-height:14px}.xoziZG_heatCell{background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);height:36px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;border:0;border-radius:8px;outline:0;justify-content:center;align-items:center;font-size:12px;transition:background .12s ease-out;display:flex}.xoziZG_heatCell[data-tone=empty]{color:var(--dsw-alias-label-tertiary)}.xoziZG_heatCell[data-tone=pad]{background:0 0}.xoziZG_heatCell[data-tone=out]{color:var(--dsw-alias-label-tertiary);opacity:.45;background:0 0}.xoziZG_heatCell[data-tone=lv1]{color:#0f1115;background:#ddf4e7}.xoziZG_heatCell[data-tone=lv2]{color:#0f1115;background:#b3e8cc}.xoziZG_heatCell[data-tone=lv3]{color:#0f1115;background:#7dd8ac}.xoziZG_heatCell[data-tone=lv4]{color:#fff;background:#40c584}.xoziZG_heatCell[data-tone=lv5]{color:#fff;background:#16a34a}.xoziZG_heatCell[data-today=true]{font-weight:700;box-shadow:inset 0 -2px}.xoziZG_heatHours{grid-template-columns:repeat(24,minmax(0,1fr));gap:3px;margin:8px 0 0;display:grid}.xoziZG_heatHourCell{background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);border-radius:4px;height:26px;transition:background .12s ease-out}.xoziZG_heatHourCell[data-tone=lv1]{background:#ddf4e7}.xoziZG_heatHourCell[data-tone=lv2]{background:#b3e8cc}.xoziZG_heatHourCell[data-tone=lv3]{background:#7dd8ac}.xoziZG_heatHourCell[data-tone=lv4]{background:#40c584}.xoziZG_heatHourCell[data-tone=lv5]{background:#16a34a}.xoziZG_heatAxis{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;grid-template-columns:repeat(24,minmax(0,1fr));gap:3px;font-size:10px;line-height:14px;display:grid}.xoziZG_heatAxisSlot{text-align:center;white-space:nowrap;overflow:hidden}.xoziZG_heatLegend{color:var(--dsw-alias-label-tertiary);justify-content:flex-start;align-items:center;gap:3px;margin:0 0 6px;font-size:10px;display:flex}.xoziZG_heatLegendChip{border-radius:3px;width:10px;height:10px}.xoziZG_heatLegendChip[data-tone=lv1]{background:#ddf4e7}.xoziZG_heatLegendChip[data-tone=lv2]{background:#b3e8cc}.xoziZG_heatLegendChip[data-tone=lv3]{background:#7dd8ac}.xoziZG_heatLegendChip[data-tone=lv4]{background:#40c584}.xoziZG_heatLegendChip[data-tone=lv5]{background:#16a34a}.xoziZG_trendTip{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;margin:2px 0 0;font-size:11px;line-height:16px}.xoziZG_check{flex:1;min-width:0}.xoziZG_check>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.xoziZG_manual{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);margin-top:12px;padding:0 12px}.xoziZG_manual[open]{padding-bottom:12px}.xoziZG_manualSummary{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:6px;padding:9px 0;font-size:13px;list-style:none;display:flex}.xoziZG_manualSummary::-webkit-details-marker{display:none}.xoziZG_field{flex-direction:column;gap:5px;margin-top:10px;display:flex}.xoziZG_fieldLabel{color:var(--dsw-alias-label-tertiary);font-size:12px}.xoziZG_area{box-sizing:border-box;resize:vertical;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;color:var(--dsw-alias-label-primary);padding:6px 8px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;line-height:20px}.xoziZG_area::placeholder{color:var(--dsw-alias-label-dimmed)}.xoziZG_area:focus{border-color:var(--dsw-alias-state-business-primary);outline:none}.xoziZG_skeleton{flex-direction:column;gap:10px;padding:4px 0;display:flex}.xoziZG_skeletonRow{border-radius:var(--dsw-radius-sm,4px);background:var(--dsw-alias-border-l2);height:12px;animation:1.4s ease-in-out infinite xoziZG_skeletonBreath}.xoziZG_skeletonRow:nth-child(2){width:72%}.xoziZG_skeletonRow:nth-child(3){width:46%}@keyframes xoziZG_skeletonBreath{0%,to{opacity:.45}50%{opacity:.9}}@media (prefers-reduced-motion:reduce){.xoziZG_skeletonRow{animation:none}}.xoziZG_modelSpec{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.xoziZG_doctorList{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_doctorRow{align-items:center;gap:8px;padding:4px 0;display:flex}.xoziZG_doctorName{color:var(--dsw-alias-label-secondary);flex:none;font-size:12px;line-height:18px}.xoziZG_doctorRow .xoziZG_meta{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}";
|
|
80
|
+
const css$1 = ".xoziZG_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-settings-card-fill);box-sizing:border-box;width:100%;max-width:none}.xoziZG_header{align-items:flex-start;gap:12px;padding:14px 16px;display:flex}.xoziZG_headText{flex-direction:column;flex:1;gap:6px;min-width:0;display:flex}.xoziZG_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:22px}.xoziZG_desc{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:20px}.xoziZG_statusLine{color:var(--dsw-alias-label-primary);align-items:center;gap:6px;font-size:14px;font-weight:500;line-height:22px;display:inline-flex}.xoziZG_meta{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;line-height:18px}.xoziZG_body{border-top:.5px solid var(--dsw-alias-border-l2);margin:0 16px;padding:4px 0 16px}.xoziZG_tabs{margin-top:12px}.xoziZG_tabPanel{padding-top:2px}.xoziZG_accountToolbar{gap:8px;margin-top:12px;display:flex}.xoziZG_accountToolbar>*{flex:1}.xoziZG_manualForm{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);margin-top:12px;padding:12px}.xoziZG_accountCard{flex-direction:column;gap:10px;margin-top:12px;display:flex}.xoziZG_accountEntry{border:.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-2)}.xoziZG_accountRow{align-items:center;gap:10px;padding:12px;display:flex}.xoziZG_claimAllRow{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:flex-end;padding:10px 12px 0;display:flex}.xoziZG_avatar{background:var(--dsw-alias-bg-layer-3);width:32px;height:32px;color:var(--dsw-alias-label-primary);border-radius:50%;flex:none;justify-content:center;align-items:center;font-size:14px;font-weight:600;display:inline-flex}.xoziZG_accountInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.xoziZG_accountNameRow{align-items:center;gap:6px;min-width:0;display:flex}.xoziZG_accountName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600;line-height:20px;overflow:hidden}.xoziZG_accountRowActions{flex-wrap:wrap;flex:none;justify-content:flex-end;align-items:center;gap:6px;display:flex}.xoziZG_accountToggle{align-items:center;gap:6px;display:inline-flex}.xoziZG_accountToggleLabel{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:12px;line-height:20px}.xoziZG_accountHint{color:var(--dsw-alias-label-tertiary);margin:0;padding:0 12px 12px;font-size:12px;line-height:18px}.xoziZG_creditBlock{border-top:.5px solid var(--dsw-alias-border-l2);padding:12px}.xoziZG_balanceRow{flex-wrap:wrap;align-items:baseline;gap:6px;display:flex}.xoziZG_balance{color:var(--dsw-alias-label-primary);letter-spacing:-.02em;font-variant-numeric:tabular-nums;font-size:28px;font-weight:600;line-height:34px}.xoziZG_balanceUnit{color:var(--dsw-alias-label-secondary);font-size:12px}.xoziZG_balanceMeta{color:var(--dsw-alias-label-tertiary);margin-left:2px;font-size:12px}.xoziZG_updated{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;margin-left:auto;font-size:12px}.xoziZG_creditRows{flex-direction:column;gap:4px;margin-top:8px;display:flex}.xoziZG_creditRow{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;justify-content:space-between;align-items:baseline;gap:12px;font-size:12px;line-height:18px;display:flex}.xoziZG_usageBar{background:var(--dsw-alias-border-l2);border-radius:2px;height:4px;margin-top:4px;display:block;overflow:hidden}.xoziZG_usageFill{background:var(--dsw-alias-brand-primary);border-radius:2px;height:100%;transition:width .2s;display:block}.xoziZG_expiryRow{margin-top:2px}.xoziZG_expiryLabel{color:var(--dsw-alias-state-warn-label)}.xoziZG_bar{background:var(--dsw-alias-bg-layer-3);border-radius:2px;height:4px;margin-top:6px;display:block;overflow:hidden}.xoziZG_barFill{background:var(--dsw-alias-state-warn-primary);border-radius:2px;height:100%;display:block}.xoziZG_creditLink{margin-top:8px;display:inline-block}.xoziZG_creditFooter{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:center;gap:8px;margin-top:12px;padding-top:10px;display:flex}.xoziZG_creditHint{color:var(--dsw-alias-label-tertiary);margin:8px 0 0;font-size:12px;line-height:18px}.xoziZG_section{margin-top:16px}.xoziZG_sectionHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.xoziZG_sectionLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;font-weight:500}.xoziZG_count{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex:none;font-size:12px}.xoziZG_hint{color:var(--dsw-alias-label-secondary);margin:8px 0 0;font-size:13px;line-height:20px}.xoziZG_error{color:var(--dsw-alias-state-error-primary);margin:10px 0 0;font-size:13px;line-height:20px}.xoziZG_actions{flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px;display:flex}.xoziZG_danger{color:var(--dsw-alias-state-error-primary)}.xoziZG_link{appearance:none;color:var(--dsw-alias-brand-text);font:inherit;text-align:left;word-break:break-all;cursor:pointer;background:0 0;border:none;padding:0;font-size:12px}.xoziZG_link:hover{text-decoration:underline}.xoziZG_choices{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_choiceRow{border-radius:var(--dsw-radius-sm);align-items:center;gap:8px;margin:0 -6px;padding:5px 6px;display:flex}.xoziZG_choiceRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_statGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0 14px;display:grid}.xoziZG_statCard{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);flex-direction:column;gap:1px;padding:8px 10px;display:flex}.xoziZG_statLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.xoziZG_statValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:15px;line-height:20px}.xoziZG_statSub{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.xoziZG_modelChart{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_modelRow{font-variant-numeric:tabular-nums;border-radius:6px;grid-template-columns:minmax(0,1.2fr) minmax(48px,1fr) 56px 52px 64px;align-items:center;gap:8px;padding:4px 0;display:grid;position:relative}.xoziZG_modelRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_usageTip{z-index:5;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-3);min-width:180px;max-width:260px;color:var(--dsw-alias-label-secondary);text-align:left;font-variant-numeric:tabular-nums;pointer-events:none;padding:8px 10px;font-size:12px;line-height:1.9;position:absolute;bottom:calc(100% + 6px);right:0;box-shadow:0 10px 28px #00000073}.xoziZG_usageTip[data-float=true]{z-index:40;position:fixed;bottom:auto;right:auto}.xoziZG_usageTipName{max-width:240px;color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.xoziZG_usageTipSep{background:var(--dsw-alias-border-l2);height:1px;margin:4px 0}.xoziZG_usageTipRow{justify-content:space-between;gap:24px;display:flex}.xoziZG_usageTipRow span:last-child{color:var(--dsw-alias-label-primary);font-weight:600}.xoziZG_modelName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}.xoziZG_modelTrack{background:var(--dsw-alias-border-l2);border-radius:4px;height:8px;display:block;overflow:hidden}.xoziZG_modelFill{background:var(--dsw-alias-brand-primary);border-radius:4px;height:100%;transition:width .16s;display:block}.xoziZG_modelTokens,.xoziZG_modelShare,.xoziZG_modelRequests{color:var(--dsw-alias-label-secondary);text-align:right;white-space:nowrap;font-size:11px;line-height:16px}.xoziZG_modelRequests{color:var(--dsw-alias-label-tertiary)}.xoziZG_heatGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:8px 0 2px;display:grid}.xoziZG_heatWeekday{color:var(--dsw-alias-label-tertiary);text-align:center;font-size:10px;line-height:14px}.xoziZG_heatCell{background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);height:36px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;border:0;border-radius:8px;outline:0;justify-content:center;align-items:center;font-size:12px;transition:background .12s ease-out;display:flex}.xoziZG_heatCell[data-tone=empty]{color:var(--dsw-alias-label-tertiary)}.xoziZG_heatCell[data-tone=pad]{background:0 0}.xoziZG_heatCell[data-tone=out]{color:var(--dsw-alias-label-tertiary);opacity:.45;background:0 0}.xoziZG_heatCell[data-tone=lv1]{color:#0f1115;background:#ddf4e7}.xoziZG_heatCell[data-tone=lv2]{color:#0f1115;background:#b3e8cc}.xoziZG_heatCell[data-tone=lv3]{color:#0f1115;background:#7dd8ac}.xoziZG_heatCell[data-tone=lv4]{color:#fff;background:#40c584}.xoziZG_heatCell[data-tone=lv5]{color:#fff;background:#16a34a}.xoziZG_heatCell[data-today=true]{box-shadow:inset 0 -2px 0 0 var(--heat-today-mark,#16a34a);font-weight:700}.xoziZG_heatCell[data-today=true][data-tone=lv4],.xoziZG_heatCell[data-today=true][data-tone=lv5]{--heat-today-mark:#fff}.xoziZG_heatHours{grid-template-columns:repeat(24,minmax(0,1fr));gap:3px;margin:8px 0 0;display:grid}.xoziZG_heatHourCell{background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);border-radius:4px;height:26px;transition:background .12s ease-out}.xoziZG_heatHourCell[data-tone=lv1]{background:#ddf4e7}.xoziZG_heatHourCell[data-tone=lv2]{background:#b3e8cc}.xoziZG_heatHourCell[data-tone=lv3]{background:#7dd8ac}.xoziZG_heatHourCell[data-tone=lv4]{background:#40c584}.xoziZG_heatHourCell[data-tone=lv5]{background:#16a34a}.xoziZG_heatAxis{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;grid-template-columns:repeat(24,minmax(0,1fr));gap:3px;font-size:10px;line-height:14px;display:grid}.xoziZG_heatAxisSlot{text-align:center;white-space:nowrap;overflow:hidden}.xoziZG_heatLegend{color:var(--dsw-alias-label-tertiary);justify-content:flex-start;align-items:center;gap:3px;margin:0 0 6px;font-size:10px;display:flex}.xoziZG_heatLegendChip{border-radius:3px;width:10px;height:10px}.xoziZG_heatLegendChip[data-tone=lv1]{background:#ddf4e7}.xoziZG_heatLegendChip[data-tone=lv2]{background:#b3e8cc}.xoziZG_heatLegendChip[data-tone=lv3]{background:#7dd8ac}.xoziZG_heatLegendChip[data-tone=lv4]{background:#40c584}.xoziZG_heatLegendChip[data-tone=lv5]{background:#16a34a}.xoziZG_trendTip{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;margin:2px 0 0;font-size:11px;line-height:16px}.xoziZG_check{flex:1;min-width:0}.xoziZG_check>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.xoziZG_manual{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);margin-top:12px;padding:0 12px}.xoziZG_manual[open]{padding-bottom:12px}.xoziZG_manualSummary{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:6px;padding:9px 0;font-size:13px;list-style:none;display:flex}.xoziZG_manualSummary::-webkit-details-marker{display:none}.xoziZG_field{flex-direction:column;gap:5px;margin-top:10px;display:flex}.xoziZG_fieldLabel{color:var(--dsw-alias-label-tertiary);font-size:12px}.xoziZG_area{box-sizing:border-box;resize:vertical;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;color:var(--dsw-alias-label-primary);padding:6px 8px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;line-height:20px}.xoziZG_area::placeholder{color:var(--dsw-alias-label-dimmed)}.xoziZG_area:focus{border-color:var(--dsw-alias-state-business-primary);outline:none}.xoziZG_skeleton{flex-direction:column;gap:10px;padding:4px 0;display:flex}.xoziZG_skeletonRow{border-radius:var(--dsw-radius-sm,4px);background:var(--dsw-alias-border-l2);height:12px;animation:1.4s ease-in-out infinite xoziZG_skeletonBreath}.xoziZG_skeletonRow:nth-child(2){width:72%}.xoziZG_skeletonRow:nth-child(3){width:46%}@keyframes xoziZG_skeletonBreath{0%,to{opacity:.45}50%{opacity:.9}}@media (prefers-reduced-motion:reduce){.xoziZG_skeletonRow{animation:none}}.xoziZG_modelSpec{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.xoziZG_doctorList{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_doctorRow{align-items:center;gap:8px;padding:4px 0;display:flex}.xoziZG_doctorName{color:var(--dsw-alias-label-secondary);flex:none;font-size:12px;line-height:18px}.xoziZG_doctorRow .xoziZG_meta{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}";
|
|
66
81
|
const tagId$1 = "dsh-codearts/CodeArtsPluginCard.module.css";
|
|
67
82
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
68
83
|
const tag = document.createElement("style");
|
|
@@ -72,98 +87,98 @@ if (typeof document !== "undefined" && document.querySelector("style[data-plugin
|
|
|
72
87
|
document.head.appendChild(tag);
|
|
73
88
|
}
|
|
74
89
|
var CodeArtsPluginCard_module_css_default = {
|
|
75
|
-
"
|
|
90
|
+
"field": "xoziZG_field",
|
|
76
91
|
"sectionHead": "xoziZG_sectionHead",
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"heatAxisSlot": "xoziZG_heatAxisSlot",
|
|
81
|
-
"accountToolbar": "xoziZG_accountToolbar",
|
|
82
|
-
"heatGrid": "xoziZG_heatGrid",
|
|
83
|
-
"sectionLabel": "xoziZG_sectionLabel",
|
|
84
|
-
"actions": "xoziZG_actions",
|
|
85
|
-
"modelTrack": "xoziZG_modelTrack",
|
|
92
|
+
"trendTip": "xoziZG_trendTip",
|
|
93
|
+
"usageFill": "xoziZG_usageFill",
|
|
94
|
+
"area": "xoziZG_area",
|
|
86
95
|
"body": "xoziZG_body",
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
96
|
+
"modelName": "xoziZG_modelName",
|
|
97
|
+
"doctorName": "xoziZG_doctorName",
|
|
98
|
+
"creditLink": "xoziZG_creditLink",
|
|
99
|
+
"manual": "xoziZG_manual",
|
|
100
|
+
"statGrid": "xoziZG_statGrid",
|
|
101
|
+
"accountName": "xoziZG_accountName",
|
|
102
|
+
"manualSummary": "xoziZG_manualSummary",
|
|
103
|
+
"doctorList": "xoziZG_doctorList",
|
|
90
104
|
"expiryLabel": "xoziZG_expiryLabel",
|
|
91
|
-
"
|
|
92
|
-
"statSub": "xoziZG_statSub",
|
|
93
|
-
"usageBar": "xoziZG_usageBar",
|
|
94
|
-
"link": "xoziZG_link",
|
|
95
|
-
"expiryRow": "xoziZG_expiryRow",
|
|
96
|
-
"modelRow": "xoziZG_modelRow",
|
|
97
|
-
"modelFill": "xoziZG_modelFill",
|
|
105
|
+
"balanceUnit": "xoziZG_balanceUnit",
|
|
98
106
|
"heatHours": "xoziZG_heatHours",
|
|
99
|
-
"
|
|
100
|
-
"skeleton": "xoziZG_skeleton",
|
|
101
|
-
"skeletonRow": "xoziZG_skeletonRow",
|
|
107
|
+
"statCard": "xoziZG_statCard",
|
|
102
108
|
"section": "xoziZG_section",
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
109
|
+
"statusLine": "xoziZG_statusLine",
|
|
110
|
+
"hint": "xoziZG_hint",
|
|
111
|
+
"tabPanel": "xoziZG_tabPanel",
|
|
112
|
+
"updated": "xoziZG_updated",
|
|
113
|
+
"balanceRow": "xoziZG_balanceRow",
|
|
106
114
|
"name": "xoziZG_name",
|
|
107
|
-
"
|
|
108
|
-
"check": "xoziZG_check",
|
|
109
|
-
"accountRow": "xoziZG_accountRow",
|
|
110
|
-
"manualSummary": "xoziZG_manualSummary",
|
|
111
|
-
"skeletonBreath": "xoziZG_skeletonBreath",
|
|
112
|
-
"manual": "xoziZG_manual",
|
|
113
|
-
"accountToggle": "xoziZG_accountToggle",
|
|
115
|
+
"count": "xoziZG_count",
|
|
114
116
|
"usageTipName": "xoziZG_usageTipName",
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"statGrid": "xoziZG_statGrid",
|
|
118
|
-
"danger": "xoziZG_danger",
|
|
119
|
-
"accountName": "xoziZG_accountName",
|
|
120
|
-
"barFill": "xoziZG_barFill",
|
|
117
|
+
"check": "xoziZG_check",
|
|
118
|
+
"skeleton": "xoziZG_skeleton",
|
|
121
119
|
"header": "xoziZG_header",
|
|
120
|
+
"modelRow": "xoziZG_modelRow",
|
|
121
|
+
"modelRequests": "xoziZG_modelRequests",
|
|
122
|
+
"skeletonRow": "xoziZG_skeletonRow",
|
|
123
|
+
"choices": "xoziZG_choices",
|
|
124
|
+
"headText": "xoziZG_headText",
|
|
125
|
+
"heatCell": "xoziZG_heatCell",
|
|
126
|
+
"skeletonBreath": "xoziZG_skeletonBreath",
|
|
127
|
+
"modelFill": "xoziZG_modelFill",
|
|
128
|
+
"modelTrack": "xoziZG_modelTrack",
|
|
122
129
|
"accountHint": "xoziZG_accountHint",
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
130
|
+
"choiceRow": "xoziZG_choiceRow",
|
|
131
|
+
"bar": "xoziZG_bar",
|
|
132
|
+
"heatWeekday": "xoziZG_heatWeekday",
|
|
133
|
+
"claimAllRow": "xoziZG_claimAllRow",
|
|
134
|
+
"usageBar": "xoziZG_usageBar",
|
|
127
135
|
"modelChart": "xoziZG_modelChart",
|
|
136
|
+
"usageTip": "xoziZG_usageTip",
|
|
137
|
+
"accountCard": "xoziZG_accountCard",
|
|
138
|
+
"balance": "xoziZG_balance",
|
|
139
|
+
"creditRow": "xoziZG_creditRow",
|
|
140
|
+
"modelShare": "xoziZG_modelShare",
|
|
128
141
|
"usageTipSep": "xoziZG_usageTipSep",
|
|
129
|
-
"
|
|
142
|
+
"heatLegendChip": "xoziZG_heatLegendChip",
|
|
143
|
+
"accountToggle": "xoziZG_accountToggle",
|
|
144
|
+
"fieldLabel": "xoziZG_fieldLabel",
|
|
145
|
+
"heatAxis": "xoziZG_heatAxis",
|
|
146
|
+
"statValue": "xoziZG_statValue",
|
|
147
|
+
"modelSpec": "xoziZG_modelSpec",
|
|
148
|
+
"heatGrid": "xoziZG_heatGrid",
|
|
149
|
+
"usageTipRow": "xoziZG_usageTipRow",
|
|
150
|
+
"statSub": "xoziZG_statSub",
|
|
130
151
|
"heatHourCell": "xoziZG_heatHourCell",
|
|
131
|
-
"
|
|
152
|
+
"avatar": "xoziZG_avatar",
|
|
153
|
+
"expiryRow": "xoziZG_expiryRow",
|
|
154
|
+
"creditRows": "xoziZG_creditRows",
|
|
132
155
|
"error": "xoziZG_error",
|
|
133
|
-
"
|
|
134
|
-
"
|
|
156
|
+
"accountToolbar": "xoziZG_accountToolbar",
|
|
157
|
+
"sectionLabel": "xoziZG_sectionLabel",
|
|
158
|
+
"doctorRow": "xoziZG_doctorRow",
|
|
159
|
+
"desc": "xoziZG_desc",
|
|
160
|
+
"manualForm": "xoziZG_manualForm",
|
|
161
|
+
"barFill": "xoziZG_barFill",
|
|
162
|
+
"tabs": "xoziZG_tabs",
|
|
163
|
+
"accountEntry": "xoziZG_accountEntry",
|
|
135
164
|
"accountInfo": "xoziZG_accountInfo",
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"modelRequests": "xoziZG_modelRequests",
|
|
139
|
-
"heatCell": "xoziZG_heatCell",
|
|
140
|
-
"tabPanel": "xoziZG_tabPanel",
|
|
141
|
-
"statValue": "xoziZG_statValue",
|
|
142
|
-
"balanceMeta": "xoziZG_balanceMeta",
|
|
143
|
-
"usageTip": "xoziZG_usageTip",
|
|
144
|
-
"heatAxis": "xoziZG_heatAxis",
|
|
145
|
-
"choiceRow": "xoziZG_choiceRow",
|
|
146
|
-
"accountToggleLabel": "xoziZG_accountToggleLabel",
|
|
147
|
-
"area": "xoziZG_area",
|
|
148
|
-
"balance": "xoziZG_balance",
|
|
165
|
+
"creditFooter": "xoziZG_creditFooter",
|
|
166
|
+
"link": "xoziZG_link",
|
|
149
167
|
"meta": "xoziZG_meta",
|
|
168
|
+
"card": "xoziZG_card",
|
|
169
|
+
"accountNameRow": "xoziZG_accountNameRow",
|
|
170
|
+
"accountRowActions": "xoziZG_accountRowActions",
|
|
171
|
+
"accountRow": "xoziZG_accountRow",
|
|
172
|
+
"accountToggleLabel": "xoziZG_accountToggleLabel",
|
|
173
|
+
"balanceMeta": "xoziZG_balanceMeta",
|
|
174
|
+
"danger": "xoziZG_danger",
|
|
175
|
+
"creditHint": "xoziZG_creditHint",
|
|
176
|
+
"statLabel": "xoziZG_statLabel",
|
|
177
|
+
"heatAxisSlot": "xoziZG_heatAxisSlot",
|
|
178
|
+
"actions": "xoziZG_actions",
|
|
150
179
|
"modelTokens": "xoziZG_modelTokens",
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
"bar": "xoziZG_bar",
|
|
154
|
-
"headText": "xoziZG_headText",
|
|
155
|
-
"hint": "xoziZG_hint",
|
|
156
|
-
"desc": "xoziZG_desc",
|
|
157
|
-
"usageFill": "xoziZG_usageFill",
|
|
158
|
-
"fieldLabel": "xoziZG_fieldLabel",
|
|
159
|
-
"doctorName": "xoziZG_doctorName",
|
|
160
|
-
"accountEntry": "xoziZG_accountEntry",
|
|
161
|
-
"tabs": "xoziZG_tabs",
|
|
162
|
-
"heatWeekday": "xoziZG_heatWeekday",
|
|
163
|
-
"manualForm": "xoziZG_manualForm",
|
|
164
|
-
"statCard": "xoziZG_statCard",
|
|
165
|
-
"updated": "xoziZG_updated",
|
|
166
|
-
"accountRowActions": "xoziZG_accountRowActions"
|
|
180
|
+
"heatLegend": "xoziZG_heatLegend",
|
|
181
|
+
"creditBlock": "xoziZG_creditBlock"
|
|
167
182
|
};
|
|
168
183
|
//#endregion
|
|
169
184
|
//#region src/client/CodeArtsPluginCard.tsx
|
|
@@ -900,7 +915,7 @@ function UsageSection({ usage, accounts, t }) {
|
|
|
900
915
|
}),
|
|
901
916
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
902
917
|
className: CodeArtsPluginCard_module_css_default.statValue,
|
|
903
|
-
children:
|
|
918
|
+
children: latencyP95Label(latency)
|
|
904
919
|
}),
|
|
905
920
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
906
921
|
className: CodeArtsPluginCard_module_css_default.statSub,
|
|
@@ -2666,7 +2681,7 @@ function CodeArtsCreditDock({ useProjection, t, zone = "dock" }) {
|
|
|
2666
2681
|
}
|
|
2667
2682
|
//#endregion
|
|
2668
2683
|
//#region \0dsh-css:/home/runner/work/dsh-codearts/dsh-codearts/src/client/CodeArtsPanel.module.css.mjs
|
|
2669
|
-
const css = ".Z66cgG_page{box-sizing:border-box;height:100%;min-height:0;padding:calc(28px + var(--dsh-frame-top-clearance,0px)) clamp(
|
|
2684
|
+
const css = ".Z66cgG_page{box-sizing:border-box;height:100%;min-height:0;padding:calc(28px + var(--dsh-frame-top-clearance,0px)) clamp(16px, 2vw, 24px) 48px;color:var(--dsw-alias-label-primary);flex-direction:column;display:flex;overflow:auto}.Z66cgG_head{flex-direction:column;gap:6px;width:100%;margin:0;display:flex}.Z66cgG_back{appearance:none;font:inherit;cursor:pointer;border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);align-self:flex-start;align-items:center;gap:6px;margin-bottom:10px;padding:5px 12px;font-size:13px;line-height:20px;display:inline-flex}.Z66cgG_back:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.Z66cgG_backCaret{border-bottom:1.6px solid;border-left:1.6px solid;width:7px;height:7px;display:inline-block;transform:rotate(45deg)}.Z66cgG_title{margin:0;font-size:20px;font-weight:600;line-height:1.4}.Z66cgG_desc{color:var(--dsw-alias-label-tertiary);margin:0;font-size:13px;line-height:1.5}.Z66cgG_body{width:100%;margin:20px 0 0}.Z66cgG_body>div{width:100%;max-width:none}.Z66cgG_icon{flex:none;display:block}";
|
|
2670
2685
|
const tagId = "dsh-codearts/CodeArtsPanel.module.css";
|
|
2671
2686
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
2672
2687
|
const tag = document.createElement("style");
|
|
@@ -2676,14 +2691,14 @@ if (typeof document !== "undefined" && document.querySelector("style[data-plugin
|
|
|
2676
2691
|
document.head.appendChild(tag);
|
|
2677
2692
|
}
|
|
2678
2693
|
var CodeArtsPanel_module_css_default = {
|
|
2694
|
+
"title": "Z66cgG_title",
|
|
2679
2695
|
"desc": "Z66cgG_desc",
|
|
2696
|
+
"backCaret": "Z66cgG_backCaret",
|
|
2680
2697
|
"head": "Z66cgG_head",
|
|
2681
2698
|
"back": "Z66cgG_back",
|
|
2682
|
-
"icon": "Z66cgG_icon",
|
|
2683
|
-
"backCaret": "Z66cgG_backCaret",
|
|
2684
|
-
"title": "Z66cgG_title",
|
|
2685
2699
|
"page": "Z66cgG_page",
|
|
2686
|
-
"body": "Z66cgG_body"
|
|
2700
|
+
"body": "Z66cgG_body",
|
|
2701
|
+
"icon": "Z66cgG_icon"
|
|
2687
2702
|
};
|
|
2688
2703
|
//#endregion
|
|
2689
2704
|
//#region src/client/CodeArtsPanel.tsx
|
package/lib/index.d.mts
CHANGED
|
@@ -1170,6 +1170,10 @@ interface AccountRuntime {
|
|
|
1170
1170
|
coolUntil: number;
|
|
1171
1171
|
/** 撞上游并发上限后的「优先避开」截止时间。 */
|
|
1172
1172
|
cappedUntil: number;
|
|
1173
|
+
/** 最近一次撞上限的时刻(0 = 没有待量的样本),用来在排队成功后量出释放时长。 */
|
|
1174
|
+
lastCapAt: number;
|
|
1175
|
+
/** 实测到的槽位释放时长样本(毫秒,最近 `CAP_SAMPLE_KEEP` 个)。 */
|
|
1176
|
+
capSamples: number[];
|
|
1173
1177
|
disabled: boolean;
|
|
1174
1178
|
lastError?: string;
|
|
1175
1179
|
/** 上次被选中的时间,用于「最久未用优先」。 */
|
|
@@ -1221,6 +1225,13 @@ declare class CodeArtsAccountPool {
|
|
|
1221
1225
|
* 处理的)。这里只记一个「优先避开」的提示,好让并发的请求先去用别的账号。
|
|
1222
1226
|
*/
|
|
1223
1227
|
noteConcurrencyCap(id: string): void;
|
|
1228
|
+
/**
|
|
1229
|
+
* 撞过上限、又在**同一个请求里**排队等到成功 —— 这就是这个号槽位释放的实测时长。
|
|
1230
|
+
*
|
|
1231
|
+
* 只在兜底排队那条路上调用:主循环里普通成功不能当样本,那样量到的是「用户下一次
|
|
1232
|
+
* 提问隔了多久」(常常是几分钟),窗口会被拉到几分钟,比固定 30 秒更糟。
|
|
1233
|
+
*/
|
|
1234
|
+
noteCapRelease(id: string): void;
|
|
1224
1235
|
/** 凭据失效等硬错误:直接停用,等用户重新登录。 */
|
|
1225
1236
|
disable(id: string, reason: string): void;
|
|
1226
1237
|
/**
|
package/lib/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as signedGet, B as markModelUnavailable, C as isTpmLimit, D as pickDailyWelfareCampaign, E as modelUnavailableReasonText, F as creditRatioLabel, G as codeartsAccountsPath, H as CodeArtsAccountStore, I as filterEnabledModels, J as startLogin, K as codeartsAuthPath, L as forgetModelUnavailable, M as CodeArtsCatalog, N as FALLBACK_CODEARTS_MODELS, O as prepareChatBody, P as clearBenefitBlocked, R as isBenefitBlocked, S as isQueueableRate, T as maxTokensCeilingFor, U as CodeArtsCredentialStore, V as modelUnavailableReason, W as MANUAL_ACCOUNT_ID, _ as isConcurrencyCap, a as refreshCatalog, b as isNotMultimodal, c as chatStream, d as degradeTokenCeiling, f as fetchCallerIdentity, g as firstFrameError, h as fetchWelfareCampaigns, i as discoverModels, j as upstreamErrorMessage, k as rateLimitFrame, l as claimDailyWelfare, m as fetchQueueStatus, n as CodeArtsUsageTracker, o as SNAP_HOST, p as fetchModels, q as credentialFromOAuth, r as codeartsUsagePath, s as canonicalModel, t as CODEARTS_VERSION, u as clearQueueStatus, v as isIamTokenError, w as isWelfareClaimedStatus, x as isParamInvalidFrame, y as isModelNotAccessible, z as isBenefitModel } from "./version-
|
|
1
|
+
import { A as signedGet, B as markModelUnavailable, C as isTpmLimit, D as pickDailyWelfareCampaign, E as modelUnavailableReasonText, F as creditRatioLabel, G as codeartsAccountsPath, H as CodeArtsAccountStore, I as filterEnabledModels, J as startLogin, K as codeartsAuthPath, L as forgetModelUnavailable, M as CodeArtsCatalog, N as FALLBACK_CODEARTS_MODELS, O as prepareChatBody, P as clearBenefitBlocked, R as isBenefitBlocked, S as isQueueableRate, T as maxTokensCeilingFor, U as CodeArtsCredentialStore, V as modelUnavailableReason, W as MANUAL_ACCOUNT_ID, _ as isConcurrencyCap, a as refreshCatalog, b as isNotMultimodal, c as chatStream, d as degradeTokenCeiling, f as fetchCallerIdentity, g as firstFrameError, h as fetchWelfareCampaigns, i as discoverModels, j as upstreamErrorMessage, k as rateLimitFrame, l as claimDailyWelfare, m as fetchQueueStatus, n as CodeArtsUsageTracker, o as SNAP_HOST, p as fetchModels, q as credentialFromOAuth, r as codeartsUsagePath, s as canonicalModel, t as CODEARTS_VERSION, u as clearQueueStatus, v as isIamTokenError, w as isWelfareClaimedStatus, x as isParamInvalidFrame, y as isModelNotAccessible, z as isBenefitModel } from "./version-Msk-1m2n.mjs";
|
|
2
2
|
import { i as lazyApi, r as createProvider } from "./models-CgKCibpk.mjs";
|
|
3
3
|
import z from "@deepseek-ai/schemastery";
|
|
4
4
|
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
@@ -12,8 +12,35 @@ import * as settingsModule from "@deepseek-ai/dsh-settings";
|
|
|
12
12
|
* 这不是冷却:账号本身没坏,只是它的会话槽位暂时满了(约 52 秒才释放)。
|
|
13
13
|
* 所以只是一个「倾向」——池里还有别的账号就先换一个;全都这样时照样会选它,
|
|
14
14
|
* 因为排队等它总比直接失败强。
|
|
15
|
+
*
|
|
16
|
+
* 这里只是**默认值**:每个号的真实释放时长不一样(52 秒是实测均值,不是常数),
|
|
17
|
+
* 一旦量到过就不再用它 —— 见 `noteCapRelease` 与 `capHintFor`。以前固定 30 秒比
|
|
18
|
+
* 实测短 20 多秒,窗口一过这个号又变成优先候选,于是白打一次上游、再记一次 cap,
|
|
19
|
+
* 而每次 cap 又把窗口重置成同样的 30 秒,永远学不到真实时长。
|
|
15
20
|
*/
|
|
16
21
|
const CAPPED_HINT_MS = 3e4;
|
|
22
|
+
/** 实测样本的下界:比这还短说明量的不是槽位释放(比如立刻就成功了)。 */
|
|
23
|
+
const CAP_SAMPLE_MIN_MS = 5e3;
|
|
24
|
+
/**
|
|
25
|
+
* 实测样本的上界:比这还长说明样本不来自「同一请求内排队等槽位」。
|
|
26
|
+
* 脏样本(用户隔几分钟才再问一次)会把避让窗口拉到几分钟,卡片会长时间显示「避让中」,
|
|
27
|
+
* 比固定 30 秒更糟 —— 所以宁可丢掉。
|
|
28
|
+
*/
|
|
29
|
+
const CAP_SAMPLE_MAX_MS = 12e4;
|
|
30
|
+
/** 参与中位数的最近样本数。 */
|
|
31
|
+
const CAP_SAMPLE_KEEP = 5;
|
|
32
|
+
/**
|
|
33
|
+
* 这个号的「优先避开」窗口:量到过就用实测中位数,没量过用默认提示。
|
|
34
|
+
*
|
|
35
|
+
* 取中位数而不是均值:一次被打断的请求可能让某个样本偏长,中位数不会被单点带跑。
|
|
36
|
+
*/
|
|
37
|
+
function capHintFor(account) {
|
|
38
|
+
const samples = account.capSamples;
|
|
39
|
+
if (samples.length === 0) return CAPPED_HINT_MS;
|
|
40
|
+
const sorted = [...samples].sort((a, b) => a - b);
|
|
41
|
+
const mid = Math.floor(sorted.length / 2);
|
|
42
|
+
return sorted.length % 2 === 1 ? sorted[mid] ?? 3e4 : Math.round(((sorted[mid - 1] ?? 3e4) + (sorted[mid] ?? 3e4)) / 2);
|
|
43
|
+
}
|
|
17
44
|
var CodeArtsAccountPool = class {
|
|
18
45
|
accounts = /* @__PURE__ */ new Map();
|
|
19
46
|
/** 用户手动暂停的账号:运行时状态留着(卡片还看得见槽位),但不参与轮转。 */
|
|
@@ -39,6 +66,8 @@ var CodeArtsAccountPool = class {
|
|
|
39
66
|
maxConcurrent: this.maxConcurrent,
|
|
40
67
|
coolUntil: 0,
|
|
41
68
|
cappedUntil: 0,
|
|
69
|
+
lastCapAt: 0,
|
|
70
|
+
capSamples: [],
|
|
42
71
|
disabled: false,
|
|
43
72
|
lastUsed: 0,
|
|
44
73
|
errorCount: 0
|
|
@@ -113,7 +142,25 @@ var CodeArtsAccountPool = class {
|
|
|
113
142
|
noteConcurrencyCap(id) {
|
|
114
143
|
const account = this.accounts.get(id);
|
|
115
144
|
if (account === void 0) return;
|
|
116
|
-
account.
|
|
145
|
+
account.lastCapAt = this.now();
|
|
146
|
+
account.cappedUntil = this.now() + capHintFor(account);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* 撞过上限、又在**同一个请求里**排队等到成功 —— 这就是这个号槽位释放的实测时长。
|
|
150
|
+
*
|
|
151
|
+
* 只在兜底排队那条路上调用:主循环里普通成功不能当样本,那样量到的是「用户下一次
|
|
152
|
+
* 提问隔了多久」(常常是几分钟),窗口会被拉到几分钟,比固定 30 秒更糟。
|
|
153
|
+
*/
|
|
154
|
+
noteCapRelease(id) {
|
|
155
|
+
const account = this.accounts.get(id);
|
|
156
|
+
if (account === void 0) return;
|
|
157
|
+
const cappedAt = account.lastCapAt;
|
|
158
|
+
account.lastCapAt = 0;
|
|
159
|
+
if (cappedAt === 0) return;
|
|
160
|
+
const sample = this.now() - cappedAt;
|
|
161
|
+
if (sample < CAP_SAMPLE_MIN_MS || sample > CAP_SAMPLE_MAX_MS) return;
|
|
162
|
+
account.capSamples.push(sample);
|
|
163
|
+
if (account.capSamples.length > CAP_SAMPLE_KEEP) account.capSamples.shift();
|
|
117
164
|
}
|
|
118
165
|
/** 凭据失效等硬错误:直接停用,等用户重新登录。 */
|
|
119
166
|
disable(id, reason) {
|
|
@@ -135,6 +182,7 @@ var CodeArtsAccountPool = class {
|
|
|
135
182
|
account.disabled = false;
|
|
136
183
|
account.coolUntil = 0;
|
|
137
184
|
account.cappedUntil = 0;
|
|
185
|
+
account.lastCapAt = 0;
|
|
138
186
|
account.errorCount = 0;
|
|
139
187
|
account.lastError = void 0;
|
|
140
188
|
}
|
|
@@ -160,6 +208,8 @@ var CodeArtsAccountPool = class {
|
|
|
160
208
|
account.errorCount = 0;
|
|
161
209
|
account.coolUntil = 0;
|
|
162
210
|
account.lastError = void 0;
|
|
211
|
+
account.cappedUntil = 0;
|
|
212
|
+
account.lastCapAt = 0;
|
|
163
213
|
}
|
|
164
214
|
/** 有没有任何账号可用(含被撞上限提示的)。 */
|
|
165
215
|
hasUsable() {
|
|
@@ -953,11 +1003,25 @@ function readBody$1(req) {
|
|
|
953
1003
|
req.on("error", reject);
|
|
954
1004
|
});
|
|
955
1005
|
}
|
|
956
|
-
/**
|
|
957
|
-
const MAX_ROTATE = 3;
|
|
1006
|
+
/** 一次请求最多把 max_tokens 降几档(65536 → 32768 → 16384 → 8192)。 */
|
|
958
1007
|
const MAX_CEILING_HEALS = 3;
|
|
959
1008
|
/**
|
|
960
|
-
*
|
|
1009
|
+
* 一次请求最多试几个账号:clamp(可用账号数, ROTATE_MIN_ATTEMPTS, ROTATE_MAX_ATTEMPTS)。
|
|
1010
|
+
*
|
|
1011
|
+
* 原来固定试 3 个(与 Go 参考的 MaxRotate 一致)。多号才是这个插件的核心场景:
|
|
1012
|
+
* 5 个号时前 3 个在这一轮里都新报了并发上限,第 4 个明明空着也轮不到,只能落到
|
|
1013
|
+
* 下面那根「原地排队等 52 秒」的稻草上 —— 那 52 秒本来是可以绕开的。
|
|
1014
|
+
*
|
|
1015
|
+
* 上界 6 只是次数天花板,真正的刹车是 CAP_WAIT_LIMIT 那个共用截止点:每次尝试都要
|
|
1016
|
+
* 挂号 + 开一次流,号再多也不能无限试下去。
|
|
1017
|
+
*/
|
|
1018
|
+
const ROTATE_MIN_ATTEMPTS = 3;
|
|
1019
|
+
const ROTATE_MAX_ATTEMPTS = 6;
|
|
1020
|
+
/** 开始下一次尝试前必须留下的预算:一次挂号最多等这么久。 */
|
|
1021
|
+
const ATTEMPT_RESERVE_MS = 2e4;
|
|
1022
|
+
/**
|
|
1023
|
+
* 一次请求在「换号轮换 + 回落到同一账号原地重发」上总共能花的墙上时间,从进入
|
|
1024
|
+
* 轮换起算,两段共用一个截止点。
|
|
961
1025
|
*
|
|
962
1026
|
* 2026-09-30 实测:一个上游会话要 ~52s 才被释放,而且**中途打断并不减免** ——
|
|
963
1027
|
* 只跑了 98ms 就中止的请求,同样占满一个名额 52s。所以用户「打断 → 马上重问」
|
|
@@ -965,7 +1029,8 @@ const MAX_CEILING_HEALS = 3;
|
|
|
965
1029
|
* 稻草,必须盖过 52s,否则用户看到的不是「稍等一下」而是直接失败。
|
|
966
1030
|
*
|
|
967
1031
|
* 上限受 pi-ai 的 90s idle 超时约束:等待期间我们发不出任何内容,超过 90s 用户
|
|
968
|
-
* 看到的就是超时。75s 给 52s 留了余量,也还在 90s
|
|
1032
|
+
* 看到的就是超时。75s 给 52s 留了余量,也还在 90s 之内。以前这个预算只归兜底那一段
|
|
1033
|
+
* 自己,轮换花掉的时间是额外加的,多号最坏能顶穿 90s —— 所以现在是共用截止点。
|
|
969
1034
|
*/
|
|
970
1035
|
const CAP_WAIT_LIMIT = 75e3;
|
|
971
1036
|
const CAP_RETRY_GAP = 3e3;
|
|
@@ -1175,6 +1240,9 @@ function createCodeArtsShim(options) {
|
|
|
1175
1240
|
/**
|
|
1176
1241
|
* 在**同一个账号**上重发,直到不再被限流或预算耗尽。
|
|
1177
1242
|
*
|
|
1243
|
+
* `untilAt` 由调用方给:它和前面的换号轮换是同一个截止点,不是这段自己重新起算,
|
|
1244
|
+
* 否则两段各自 75s 会顶穿宿主的 90s 流空闲超时。
|
|
1245
|
+
*
|
|
1178
1246
|
* 并发槽位是账号级的:有别的号就该换号,等 52s 是最后手段。
|
|
1179
1247
|
* TPM 是模型级配额:换号只是换个账号撞同一堵墙,只能原地等窗口滑过去 ——
|
|
1180
1248
|
* 间隔逐次翻倍(3s → 6s → 12s → 24s,封顶 30s),避免在配额已经满的时候
|
|
@@ -1182,9 +1250,8 @@ function createCodeArtsShim(options) {
|
|
|
1182
1250
|
*
|
|
1183
1251
|
* 命中限流不甩给 pi-ai:429 会被重试 5 次,每次再撞一次限流,越试越满。
|
|
1184
1252
|
*/
|
|
1185
|
-
async function openStream(credential, raw, contextWindow, signal) {
|
|
1253
|
+
async function openStream(credential, raw, contextWindow, signal, untilAt) {
|
|
1186
1254
|
const started = Date.now();
|
|
1187
|
-
const until = started + CAP_WAIT_LIMIT;
|
|
1188
1255
|
let gap = CAP_RETRY_GAP;
|
|
1189
1256
|
for (;;) {
|
|
1190
1257
|
const opened = await openWithCeilingHeal(credential, raw, contextWindow, signal);
|
|
@@ -1198,7 +1265,7 @@ function createCodeArtsShim(options) {
|
|
|
1198
1265
|
waitedMs
|
|
1199
1266
|
};
|
|
1200
1267
|
if (isTpmLimit(opened.result)) gap = Math.min(gap * 2, 3e4);
|
|
1201
|
-
if (Date.now() + gap >
|
|
1268
|
+
if (Date.now() + gap > untilAt) return {
|
|
1202
1269
|
...opened,
|
|
1203
1270
|
waitedMs
|
|
1204
1271
|
};
|
|
@@ -1268,7 +1335,10 @@ function createCodeArtsShim(options) {
|
|
|
1268
1335
|
let lastAccountId;
|
|
1269
1336
|
let lastStatus = 0;
|
|
1270
1337
|
let lastMessage = "";
|
|
1271
|
-
|
|
1338
|
+
const rotateDeadline = Date.now() + CAP_WAIT_LIMIT;
|
|
1339
|
+
const attempts = Math.min(Math.max(ids.length, ROTATE_MIN_ATTEMPTS), ROTATE_MAX_ATTEMPTS);
|
|
1340
|
+
for (let attempt = 0; attempt < attempts; attempt += 1) {
|
|
1341
|
+
if (Date.now() + ATTEMPT_RESERVE_MS > rotateDeadline) break;
|
|
1272
1342
|
const id = pool.pick(tried);
|
|
1273
1343
|
if (id === void 0) break;
|
|
1274
1344
|
tried.add(id);
|
|
@@ -1353,7 +1423,7 @@ function createCodeArtsShim(options) {
|
|
|
1353
1423
|
if (pool.acquire(queueAccount)) try {
|
|
1354
1424
|
const credential = await store.resolve(queueAccount);
|
|
1355
1425
|
if (credential !== void 0) {
|
|
1356
|
-
const opened = await openStream(credential, raw, contextWindow, controller.signal);
|
|
1426
|
+
const opened = await openStream(credential, raw, contextWindow, controller.signal, rotateDeadline);
|
|
1357
1427
|
const { result } = opened;
|
|
1358
1428
|
queueWaitedMs = opened.waitedMs;
|
|
1359
1429
|
if (controller.signal.aborted) {
|
|
@@ -1361,6 +1431,7 @@ function createCodeArtsShim(options) {
|
|
|
1361
1431
|
return;
|
|
1362
1432
|
}
|
|
1363
1433
|
if (result.ok) {
|
|
1434
|
+
pool.noteCapRelease(queueAccount);
|
|
1364
1435
|
pool.noteSuccess(queueAccount);
|
|
1365
1436
|
await pipeToResponse(res, result.stream, controller.signal, {
|
|
1366
1437
|
accountId: queueAccount,
|
|
@@ -2859,6 +2930,7 @@ function apply(ctx, rawConfig) {
|
|
|
2859
2930
|
});
|
|
2860
2931
|
const CATALOG_REFRESH_MS = 36e5;
|
|
2861
2932
|
const CATALOG_EMPTY_RETRY_MS = 6e4;
|
|
2933
|
+
const CATALOG_EMPTY_RETRY_MAX_MS = 3e5;
|
|
2862
2934
|
const abort = new AbortController();
|
|
2863
2935
|
const discover = async () => {
|
|
2864
2936
|
if (stopped) return;
|
|
@@ -2874,11 +2946,20 @@ function apply(ctx, rawConfig) {
|
|
|
2874
2946
|
}
|
|
2875
2947
|
};
|
|
2876
2948
|
let discoveryTimer;
|
|
2877
|
-
/**
|
|
2949
|
+
/** 连续多少轮目录是空的(用来算退避);一旦有货就归零。 */
|
|
2950
|
+
let emptyStreak = 0;
|
|
2951
|
+
/** 自我重排的发现循环:目录为空时退避着重试(60s → 5min 封顶),有货后回到每小时。 */
|
|
2878
2952
|
const discoverLoop = async () => {
|
|
2879
2953
|
await discover();
|
|
2880
2954
|
if (stopped) return;
|
|
2881
|
-
|
|
2955
|
+
let delay;
|
|
2956
|
+
if (catalog.current().length === 0) {
|
|
2957
|
+
delay = Math.min(CATALOG_EMPTY_RETRY_MS * 2 ** emptyStreak, CATALOG_EMPTY_RETRY_MAX_MS);
|
|
2958
|
+
emptyStreak += 1;
|
|
2959
|
+
} else {
|
|
2960
|
+
emptyStreak = 0;
|
|
2961
|
+
delay = CATALOG_REFRESH_MS;
|
|
2962
|
+
}
|
|
2882
2963
|
discoveryTimer = setTimeout(() => void discoverLoop(), delay);
|
|
2883
2964
|
discoveryTimer.unref?.();
|
|
2884
2965
|
};
|
|
@@ -1218,26 +1218,39 @@ function mergeModelLists(sets) {
|
|
|
1218
1218
|
return la === lb ? a.id < b.id ? -1 : 1 : la < lb ? -1 : 1;
|
|
1219
1219
|
});
|
|
1220
1220
|
}
|
|
1221
|
-
/**
|
|
1221
|
+
/**
|
|
1222
|
+
* 同一模型两条记录取更全的一条;`benefit` 永远取或。
|
|
1223
|
+
*
|
|
1224
|
+
* 基底用 `{ ...keep }` 而不是逐字段手抄:以前这里只抄自己想到的几个字段,
|
|
1225
|
+
* `contextWindowKnown` 被静默丢掉 —— 多账号时每个 id 都要过一次这条函数,卡片的
|
|
1226
|
+
* 「上下文」整列就成了「—」,而上游其实给了值。以后新增可选字段不用再记得改这里。
|
|
1227
|
+
*/
|
|
1222
1228
|
function richerModel(current, next) {
|
|
1223
1229
|
const benefit = current.benefit === true || next.benefit === true;
|
|
1224
1230
|
const keep = richerThan(next, current) ? next : current;
|
|
1225
1231
|
const drop = keep === next ? current : next;
|
|
1226
1232
|
const ratio = keep.ratio ?? drop.ratio;
|
|
1227
1233
|
const thinking = keep.thinking ?? drop.thinking;
|
|
1228
|
-
|
|
1234
|
+
const ctxFrom = keep.contextWindow > 0 ? keep : drop;
|
|
1235
|
+
const merged = {
|
|
1236
|
+
...keep,
|
|
1229
1237
|
id: keep.id,
|
|
1230
1238
|
name: keep.name || drop.name || keep.id,
|
|
1231
|
-
contextWindow:
|
|
1239
|
+
contextWindow: ctxFrom.contextWindow,
|
|
1232
1240
|
maxTokens: keep.maxTokens > 0 ? keep.maxTokens : drop.maxTokens,
|
|
1233
1241
|
supportsImages: keep.supportsImages || drop.supportsImages,
|
|
1234
1242
|
...ratio === void 0 ? {} : { ratio },
|
|
1235
1243
|
...thinking === void 0 ? {} : { thinking },
|
|
1236
1244
|
...benefit ? { benefit: true } : {}
|
|
1237
1245
|
};
|
|
1246
|
+
if (ctxFrom.contextWindowKnown === true) merged.contextWindowKnown = true;
|
|
1247
|
+
else delete merged.contextWindowKnown;
|
|
1248
|
+
return merged;
|
|
1238
1249
|
}
|
|
1239
|
-
/** a 是否比 b
|
|
1250
|
+
/** a 是否比 b 更值得保留:先认「上游真给的上下文窗口」,再比参数,最后比大小写。 */
|
|
1240
1251
|
function richerThan(a, b) {
|
|
1252
|
+
const aKnown = a.contextWindowKnown === true;
|
|
1253
|
+
if (aKnown !== (b.contextWindowKnown === true)) return aKnown;
|
|
1241
1254
|
if (a.contextWindow > 0 !== b.contextWindow > 0) return a.contextWindow > 0;
|
|
1242
1255
|
if (a.maxTokens > 0 !== b.maxTokens > 0) return a.maxTokens > 0;
|
|
1243
1256
|
return a.id !== a.id.toLowerCase() && b.id === b.id.toLowerCase();
|
|
@@ -3338,6 +3351,6 @@ function percentileOf(buckets, ratio) {
|
|
|
3338
3351
|
}
|
|
3339
3352
|
//#endregion
|
|
3340
3353
|
//#region src/version.ts
|
|
3341
|
-
const CODEARTS_VERSION = "1.2.
|
|
3354
|
+
const CODEARTS_VERSION = "1.2.14";
|
|
3342
3355
|
//#endregion
|
|
3343
3356
|
export { signedGet as A, markModelUnavailable as B, isTpmLimit as C, pickDailyWelfareCampaign as D, modelUnavailableReasonText as E, creditRatioLabel as F, codeartsAccountsPath as G, CodeArtsAccountStore as H, filterEnabledModels as I, startLogin as J, codeartsAuthPath as K, forgetModelUnavailable as L, CodeArtsCatalog as M, FALLBACK_CODEARTS_MODELS as N, prepareChatBody as O, clearBenefitBlocked as P, isBenefitBlocked as R, isQueueableRate as S, maxTokensCeilingFor as T, CodeArtsCredentialStore as U, modelUnavailableReason as V, MANUAL_ACCOUNT_ID as W, isConcurrencyCap as _, refreshCatalog as a, isNotMultimodal as b, chatStream as c, degradeTokenCeiling as d, fetchCallerIdentity as f, firstFrameError as g, fetchWelfareCampaigns as h, discoverModels as i, upstreamErrorMessage as j, rateLimitFrame as k, claimDailyWelfare as l, fetchQueueStatus as m, CodeArtsUsageTracker as n, SNAP_HOST as o, fetchModels as p, credentialFromOAuth as q, codeartsUsagePath as r, canonicalModel as s, CODEARTS_VERSION as t, clearQueueStatus as u, isIamTokenError as v, isWelfareClaimedStatus as w, isParamInvalidFrame as x, isModelNotAccessible as y, isBenefitModel as z };
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dsh-codearts",
|
|
3
3
|
"displayName": "DSH CodeArts Connect",
|
|
4
4
|
"description": "把华为云 CodeArts 接入 DeepSeek Harness —— 内置 OAuth2 登录(PKCE + DPoP),登录后即可在 DSH 对话窗口使用 CodeArts 的模型。",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.14",
|
|
6
6
|
"packageManager": "pnpm@11.24.0",
|
|
7
7
|
"author": "elegant01",
|
|
8
8
|
"keywords": [
|