dsh-codearts 1.4.1 → 1.4.3
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 +41 -0
- package/lib/{auth-C00dJphV.mjs → auth-Cd2SvQIy.mjs} +1 -1
- package/lib/bin.mjs +3 -3
- package/lib/client/index.d.cts +3 -0
- package/lib/client/index.js +134 -98
- package/lib/index.d.mts +36 -11
- package/lib/index.mjs +196 -52
- package/lib/{keeper-MHeAp_eV.mjs → keeper-DJLwIiR4.mjs} +82 -7
- package/lib/keeper-main.mjs +62 -12
- package/lib/{upstream-D1wYeXC7.mjs → upstream-BV4XWB4l.mjs} +74 -10
- package/lib/{version-DC5JRWls.mjs → version-DqzkoxeU.mjs} +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,47 @@
|
|
|
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.4.3] - 2026-11-17
|
|
7
|
+
|
|
8
|
+
### 修复
|
|
9
|
+
|
|
10
|
+
- **排队不再直接报失败**(#10):发请求前的「挂号」以前会白等 20 秒(实测上游
|
|
11
|
+
chat 请求并不校验这张票 —— 拿第 535 位的票去 POST,942ms 就开流了),等不到
|
|
12
|
+
就自己回 400。issue 里「本轮运行失败 400:您排在第 16 位」其实是插件自己造出来的。
|
|
13
|
+
现在挂号只做 5 秒提示(底部仍显示「排队第 N 位」),没轮到也照发;只有上游
|
|
14
|
+
明确回排队拒绝(HTTP 400 `code=queued` 或流内帧)时才本地退避重发
|
|
15
|
+
(5s → 10s → 20s → 30s,与换号共用一个 75 秒截止点),真等不到才把上游原话
|
|
16
|
+
连同本地已等时长报给用户。
|
|
17
|
+
- **排队时一直等到轮到**(卡片「显示」页新开关,默认关):打开后,上游明确回
|
|
18
|
+
排队拒绝时不再短退避,而是提前打开 SSE、每 20 秒发一个空帧保住宿主连接(宿主
|
|
19
|
+
只按可解析的流事件算 90 秒空闲),轮询排队位置直到轮到再继续,最长 15 分钟;
|
|
20
|
+
等待期间底部照常显示「排队第 N 位」,点「停止生成」随时中止。
|
|
21
|
+
|
|
22
|
+
## [1.4.2] - 2026-11-16
|
|
23
|
+
|
|
24
|
+
### 修复
|
|
25
|
+
|
|
26
|
+
- **更新安装不再被守护进程挡住**:守护进程以前借 DSH 本体的进程名运行
|
|
27
|
+
(`ELECTRON_RUN_AS_NODE`),而安装器在 `%TEMP%\ns*.tmp` 阶段按进程名查找
|
|
28
|
+
`DeepSeek Harness.exe`,看到它就静默中止 —— 表现是安装失败、应用不被拉回。
|
|
29
|
+
现在优先用 DSH 自带的 `node.exe` 启动,进程名不再冲突;万一只能借本体启动,
|
|
30
|
+
守护进程会盯着 `%TEMP%`,发现安装器就主动退出并写交接标记,更新装完应用重启后
|
|
31
|
+
自动重新拉起,保活开关保持原样(不会被误当成「你手动关了」)。
|
|
32
|
+
- **守护进程启动时误判「已有实例」**:状态文件里的旧 pid 被 Windows 复用给别的
|
|
33
|
+
进程时,以前只查 pid 还活着就直接退出,保活开关刚打开又被自动关掉。现在要求
|
|
34
|
+
心跳新鲜、且确实是守护进程才认。
|
|
35
|
+
- **上下文窗口把兜底值当成上游规格展示**(#9):backfill 之后
|
|
36
|
+
`contextWindowKnown` 恒为真,合成的 32768 也被当成上游真实窗口显示。现在
|
|
37
|
+
「展示是否可信」与「守卫用哪个数」分开:只有上游确实给了窗口(或用户显式覆盖)
|
|
38
|
+
才标记为已知,兜底值只参与守卫计算,不再对外展示。
|
|
39
|
+
|
|
40
|
+
### 调整
|
|
41
|
+
|
|
42
|
+
- 账号页「粘贴 Token 添加 / 添加账号」两个按钮改用 36px 中号(`md`),避免拉满
|
|
43
|
+
整行时显得过扁;行内的「置顶 / 重新登录 / 删除」等仍保持 28px 小号。
|
|
44
|
+
- 保活关闭时的提示不再断言「开关已关闭」:现在也可能是进程被结束、为更新让路或
|
|
45
|
+
启动失败,文案改为列出这几种可能。
|
|
46
|
+
|
|
6
47
|
## [1.4.1] - 2026-11-14
|
|
7
48
|
|
|
8
49
|
### 新增
|
|
@@ -428,7 +428,7 @@ async function clearCredential(path) {
|
|
|
428
428
|
async function claimIfPossible(cred) {
|
|
429
429
|
if (!cred.accessKeyId || !cred.secretAccessKey) return;
|
|
430
430
|
try {
|
|
431
|
-
const { claimBenefit } = await import("./upstream-
|
|
431
|
+
const { claimBenefit } = await import("./upstream-BV4XWB4l.mjs").then((n) => n.P);
|
|
432
432
|
await claimBenefit({
|
|
433
433
|
token: cred.token,
|
|
434
434
|
accessKeyId: cred.accessKeyId,
|
package/lib/bin.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as codeartsAccountsPath, t as CodeArtsAccountStore } from "./auth-
|
|
3
|
-
import {
|
|
4
|
-
import { i as discoverModels, n as CodeArtsUsageTracker, r as codeartsUsagePath, t as CODEARTS_VERSION } from "./version-
|
|
2
|
+
import { i as codeartsAccountsPath, t as CodeArtsAccountStore } from "./auth-Cd2SvQIy.mjs";
|
|
3
|
+
import { H as isBenefitModel, l as fetchCallerIdentity } from "./upstream-BV4XWB4l.mjs";
|
|
4
|
+
import { i as discoverModels, n as CodeArtsUsageTracker, r as codeartsUsagePath, t as CODEARTS_VERSION } from "./version-DqzkoxeU.mjs";
|
|
5
5
|
import { existsSync, statSync } from "node:fs";
|
|
6
6
|
//#region src/bin.ts
|
|
7
7
|
/**
|
package/lib/client/index.d.cts
CHANGED
|
@@ -201,6 +201,9 @@ interface CodeArtsSettingsKey {
|
|
|
201
201
|
displayAutoClaimTitle: string;
|
|
202
202
|
displayAutoClaimHint: string;
|
|
203
203
|
displayAutoClaimToggle: string;
|
|
204
|
+
displayQueueWaitTitle: string;
|
|
205
|
+
displayQueueWaitHint: string;
|
|
206
|
+
displayQueueWaitToggle: string;
|
|
204
207
|
displayKeeperTitle: string;
|
|
205
208
|
displayKeeperHint: string;
|
|
206
209
|
displayKeeperToggle: string;
|
package/lib/client/index.js
CHANGED
|
@@ -73,7 +73,8 @@ const DEFAULT_DOCK_FLAGS = {
|
|
|
73
73
|
settingsEntry: true,
|
|
74
74
|
modelDetail: true,
|
|
75
75
|
autoClaim: false,
|
|
76
|
-
keepAliveDaemon: false
|
|
76
|
+
keepAliveDaemon: false,
|
|
77
|
+
queueWait: false
|
|
77
78
|
};
|
|
78
79
|
//#endregion
|
|
79
80
|
//#region src/client/dock-store.ts
|
|
@@ -155,112 +156,112 @@ if (typeof document !== "undefined" && document.querySelector("style[data-plugin
|
|
|
155
156
|
document.head.appendChild(tag);
|
|
156
157
|
}
|
|
157
158
|
var CodeArtsPluginCard_module_css_default = {
|
|
158
|
-
"
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
"
|
|
162
|
-
"
|
|
159
|
+
"skeletonBreath": "xoziZG_skeletonBreath",
|
|
160
|
+
"windowPopoverRow": "xoziZG_windowPopoverRow",
|
|
161
|
+
"creditRow": "xoziZG_creditRow",
|
|
162
|
+
"usageFill": "xoziZG_usageFill",
|
|
163
|
+
"claimAllRow": "xoziZG_claimAllRow",
|
|
164
|
+
"check": "xoziZG_check",
|
|
163
165
|
"usageTipSep": "xoziZG_usageTipSep",
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
+
"accountRow": "xoziZG_accountRow",
|
|
167
|
+
"modelFill": "xoziZG_modelFill",
|
|
168
|
+
"accountToggle": "xoziZG_accountToggle",
|
|
169
|
+
"accountHint": "xoziZG_accountHint",
|
|
170
|
+
"accountName": "xoziZG_accountName",
|
|
171
|
+
"hint": "xoziZG_hint",
|
|
172
|
+
"link": "xoziZG_link",
|
|
173
|
+
"balanceMeta": "xoziZG_balanceMeta",
|
|
174
|
+
"heatWeekday": "xoziZG_heatWeekday",
|
|
166
175
|
"heatHours": "xoziZG_heatHours",
|
|
167
|
-
"
|
|
176
|
+
"heatHourCell": "xoziZG_heatHourCell",
|
|
177
|
+
"accountToggleLabel": "xoziZG_accountToggleLabel",
|
|
178
|
+
"statGrid": "xoziZG_statGrid",
|
|
179
|
+
"trendTip": "xoziZG_trendTip",
|
|
180
|
+
"windowPopoverHead": "xoziZG_windowPopoverHead",
|
|
168
181
|
"accountEntry": "xoziZG_accountEntry",
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"header": "xoziZG_header",
|
|
172
|
-
"accountNameRow": "xoziZG_accountNameRow",
|
|
173
|
-
"creditBlock": "xoziZG_creditBlock",
|
|
174
|
-
"balance": "xoziZG_balance",
|
|
175
|
-
"expiryLabel": "xoziZG_expiryLabel",
|
|
182
|
+
"heatAxis": "xoziZG_heatAxis",
|
|
183
|
+
"accountToolbar": "xoziZG_accountToolbar",
|
|
176
184
|
"creditLink": "xoziZG_creditLink",
|
|
185
|
+
"error": "xoziZG_error",
|
|
186
|
+
"usageTipRow": "xoziZG_usageTipRow",
|
|
187
|
+
"statCard": "xoziZG_statCard",
|
|
188
|
+
"skeleton": "xoziZG_skeleton",
|
|
189
|
+
"modelSpec": "xoziZG_modelSpec",
|
|
190
|
+
"avatar": "xoziZG_avatar",
|
|
191
|
+
"card": "xoziZG_card",
|
|
192
|
+
"heatGrid": "xoziZG_heatGrid",
|
|
193
|
+
"balance": "xoziZG_balance",
|
|
194
|
+
"windowCaret": "xoziZG_windowCaret",
|
|
195
|
+
"windowRange": "xoziZG_windowRange",
|
|
196
|
+
"modelRequests": "xoziZG_modelRequests",
|
|
197
|
+
"creditBlock": "xoziZG_creditBlock",
|
|
198
|
+
"windowInput": "xoziZG_windowInput",
|
|
199
|
+
"accountInfo": "xoziZG_accountInfo",
|
|
200
|
+
"count": "xoziZG_count",
|
|
201
|
+
"modelName": "xoziZG_modelName",
|
|
202
|
+
"accountCard": "xoziZG_accountCard",
|
|
177
203
|
"section": "xoziZG_section",
|
|
178
|
-
"accountName": "xoziZG_accountName",
|
|
179
|
-
"sectionHead": "xoziZG_sectionHead",
|
|
180
|
-
"link": "xoziZG_link",
|
|
181
|
-
"claimAllRow": "xoziZG_claimAllRow",
|
|
182
|
-
"statValue": "xoziZG_statValue",
|
|
183
|
-
"desc": "xoziZG_desc",
|
|
184
|
-
"choices": "xoziZG_choices",
|
|
185
204
|
"name": "xoziZG_name",
|
|
186
|
-
"
|
|
205
|
+
"fieldLabel": "xoziZG_fieldLabel",
|
|
187
206
|
"modelTokens": "xoziZG_modelTokens",
|
|
188
|
-
"
|
|
189
|
-
"
|
|
190
|
-
"
|
|
191
|
-
"
|
|
192
|
-
"
|
|
207
|
+
"modelShare": "xoziZG_modelShare",
|
|
208
|
+
"choices": "xoziZG_choices",
|
|
209
|
+
"skeletonRow": "xoziZG_skeletonRow",
|
|
210
|
+
"accountNameRow": "xoziZG_accountNameRow",
|
|
211
|
+
"tabPanel": "xoziZG_tabPanel",
|
|
193
212
|
"windowPopoverValue": "xoziZG_windowPopoverValue",
|
|
194
|
-
"
|
|
195
|
-
"
|
|
196
|
-
"
|
|
197
|
-
"
|
|
213
|
+
"modelTrack": "xoziZG_modelTrack",
|
|
214
|
+
"windowUnit": "xoziZG_windowUnit",
|
|
215
|
+
"doctorRow": "xoziZG_doctorRow",
|
|
216
|
+
"body": "xoziZG_body",
|
|
217
|
+
"actions": "xoziZG_actions",
|
|
218
|
+
"heatLegendChip": "xoziZG_heatLegendChip",
|
|
219
|
+
"windowPopover": "xoziZG_windowPopover",
|
|
198
220
|
"windowHint": "xoziZG_windowHint",
|
|
199
|
-
"
|
|
221
|
+
"modelChart": "xoziZG_modelChart",
|
|
222
|
+
"field": "xoziZG_field",
|
|
223
|
+
"headText": "xoziZG_headText",
|
|
200
224
|
"statusLine": "xoziZG_statusLine",
|
|
201
|
-
"
|
|
202
|
-
"
|
|
203
|
-
"updated": "xoziZG_updated",
|
|
204
|
-
"heatCell": "xoziZG_heatCell",
|
|
205
|
-
"heatAxisSlot": "xoziZG_heatAxisSlot",
|
|
206
|
-
"trendTip": "xoziZG_trendTip",
|
|
207
|
-
"windowButtonOpen": "xoziZG_windowButtonOpen",
|
|
208
|
-
"doctorName": "xoziZG_doctorName",
|
|
209
|
-
"windowPopoverHead": "xoziZG_windowPopoverHead",
|
|
210
|
-
"statGrid": "xoziZG_statGrid",
|
|
211
|
-
"area": "xoziZG_area",
|
|
212
|
-
"fieldLabel": "xoziZG_fieldLabel",
|
|
213
|
-
"expiryRow": "xoziZG_expiryRow",
|
|
214
|
-
"skeletonRow": "xoziZG_skeletonRow",
|
|
215
|
-
"doctorList": "xoziZG_doctorList",
|
|
216
|
-
"count": "xoziZG_count",
|
|
217
|
-
"accountInfo": "xoziZG_accountInfo",
|
|
218
|
-
"accountCard": "xoziZG_accountCard",
|
|
225
|
+
"creditFooter": "xoziZG_creditFooter",
|
|
226
|
+
"header": "xoziZG_header",
|
|
219
227
|
"meta": "xoziZG_meta",
|
|
220
|
-
"
|
|
221
|
-
"
|
|
228
|
+
"expiryRow": "xoziZG_expiryRow",
|
|
229
|
+
"creditHint": "xoziZG_creditHint",
|
|
230
|
+
"bar": "xoziZG_bar",
|
|
222
231
|
"balanceRow": "xoziZG_balanceRow",
|
|
223
|
-
"
|
|
224
|
-
"skeleton": "xoziZG_skeleton",
|
|
225
|
-
"tabs": "xoziZG_tabs",
|
|
226
|
-
"accountToggle": "xoziZG_accountToggle",
|
|
227
|
-
"field": "xoziZG_field",
|
|
232
|
+
"barFill": "xoziZG_barFill",
|
|
228
233
|
"statSub": "xoziZG_statSub",
|
|
229
|
-
"
|
|
230
|
-
"
|
|
231
|
-
"
|
|
232
|
-
"
|
|
233
|
-
"
|
|
234
|
-
"creditHint": "xoziZG_creditHint",
|
|
235
|
-
"windowRange": "xoziZG_windowRange",
|
|
236
|
-
"accountToolbar": "xoziZG_accountToolbar",
|
|
234
|
+
"windowButtonOpen": "xoziZG_windowButtonOpen",
|
|
235
|
+
"doctorName": "xoziZG_doctorName",
|
|
236
|
+
"sectionLabel": "xoziZG_sectionLabel",
|
|
237
|
+
"desc": "xoziZG_desc",
|
|
238
|
+
"heatAxisSlot": "xoziZG_heatAxisSlot",
|
|
237
239
|
"manualSummary": "xoziZG_manualSummary",
|
|
238
|
-
"
|
|
239
|
-
"
|
|
240
|
+
"expiryLabel": "xoziZG_expiryLabel",
|
|
241
|
+
"usageTipName": "xoziZG_usageTipName",
|
|
242
|
+
"windowAnchor": "xoziZG_windowAnchor",
|
|
243
|
+
"accountRowActions": "xoziZG_accountRowActions",
|
|
244
|
+
"windowButtonSet": "xoziZG_windowButtonSet",
|
|
245
|
+
"heatLegend": "xoziZG_heatLegend",
|
|
246
|
+
"danger": "xoziZG_danger",
|
|
240
247
|
"statLabel": "xoziZG_statLabel",
|
|
241
|
-
"
|
|
248
|
+
"windowButton": "xoziZG_windowButton",
|
|
249
|
+
"sectionHead": "xoziZG_sectionHead",
|
|
242
250
|
"usageBar": "xoziZG_usageBar",
|
|
243
|
-
"
|
|
244
|
-
"
|
|
245
|
-
"
|
|
246
|
-
"manualForm": "xoziZG_manualForm",
|
|
247
|
-
"doctorRow": "xoziZG_doctorRow",
|
|
251
|
+
"area": "xoziZG_area",
|
|
252
|
+
"manual": "xoziZG_manual",
|
|
253
|
+
"statValue": "xoziZG_statValue",
|
|
248
254
|
"windowInputSet": "xoziZG_windowInputSet",
|
|
249
|
-
"
|
|
250
|
-
"
|
|
251
|
-
"
|
|
252
|
-
"
|
|
253
|
-
"accountToggleLabel": "xoziZG_accountToggleLabel",
|
|
254
|
-
"usageTipRow": "xoziZG_usageTipRow",
|
|
255
|
-
"modelShare": "xoziZG_modelShare",
|
|
256
|
-
"barFill": "xoziZG_barFill",
|
|
257
|
-
"balanceMeta": "xoziZG_balanceMeta",
|
|
258
|
-
"modelRequests": "xoziZG_modelRequests",
|
|
255
|
+
"doctorList": "xoziZG_doctorList",
|
|
256
|
+
"heatCell": "xoziZG_heatCell",
|
|
257
|
+
"modelRow": "xoziZG_modelRow",
|
|
258
|
+
"usageTip": "xoziZG_usageTip",
|
|
259
259
|
"balanceUnit": "xoziZG_balanceUnit",
|
|
260
|
-
"
|
|
261
|
-
"
|
|
262
|
-
"
|
|
263
|
-
"
|
|
260
|
+
"choiceRow": "xoziZG_choiceRow",
|
|
261
|
+
"tabs": "xoziZG_tabs",
|
|
262
|
+
"manualForm": "xoziZG_manualForm",
|
|
263
|
+
"creditRows": "xoziZG_creditRows",
|
|
264
|
+
"updated": "xoziZG_updated"
|
|
264
265
|
};
|
|
265
266
|
//#endregion
|
|
266
267
|
//#region src/client/CodeArtsPluginCard.tsx
|
|
@@ -1877,14 +1878,14 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1877
1878
|
className: CodeArtsPluginCard_module_css_default.accountToolbar,
|
|
1878
1879
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
1879
1880
|
variant: "outline",
|
|
1880
|
-
size: "
|
|
1881
|
+
size: "md",
|
|
1881
1882
|
"aria-expanded": manualOpen,
|
|
1882
1883
|
disabled: busy,
|
|
1883
1884
|
onClick: () => setManualOpen((open) => !open),
|
|
1884
1885
|
children: t("pasteTokenAdd")
|
|
1885
1886
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
1886
1887
|
variant: "primary",
|
|
1887
|
-
size: "
|
|
1888
|
+
size: "md",
|
|
1888
1889
|
disabled: busy || loginPending,
|
|
1889
1890
|
onClick: () => void startOAuthLogin(),
|
|
1890
1891
|
children: loginPending ? t("signingIn") : t("addAccount")
|
|
@@ -2354,6 +2355,35 @@ function CodeArtsPluginCard({ t }) {
|
|
|
2354
2355
|
})
|
|
2355
2356
|
]
|
|
2356
2357
|
}),
|
|
2358
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2359
|
+
className: CodeArtsPluginCard_module_css_default.section,
|
|
2360
|
+
children: [
|
|
2361
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2362
|
+
className: CodeArtsPluginCard_module_css_default.sectionHead,
|
|
2363
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2364
|
+
className: CodeArtsPluginCard_module_css_default.sectionLabel,
|
|
2365
|
+
children: t("displayQueueWaitTitle")
|
|
2366
|
+
})
|
|
2367
|
+
}),
|
|
2368
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2369
|
+
className: CodeArtsPluginCard_module_css_default.hint,
|
|
2370
|
+
children: t("displayQueueWaitHint")
|
|
2371
|
+
}),
|
|
2372
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2373
|
+
className: CodeArtsPluginCard_module_css_default.choices,
|
|
2374
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2375
|
+
className: CodeArtsPluginCard_module_css_default.choiceRow,
|
|
2376
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Checkbox, {
|
|
2377
|
+
className: CodeArtsPluginCard_module_css_default.check,
|
|
2378
|
+
checked: dock.queueWait === true,
|
|
2379
|
+
disabled: !dockWritable || dockSavingKeys.has("queueWait"),
|
|
2380
|
+
onChange: (on) => void toggleDock("queueWait", on),
|
|
2381
|
+
label: t("displayQueueWaitToggle")
|
|
2382
|
+
})
|
|
2383
|
+
})
|
|
2384
|
+
})
|
|
2385
|
+
]
|
|
2386
|
+
}),
|
|
2357
2387
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2358
2388
|
className: CodeArtsPluginCard_module_css_default.section,
|
|
2359
2389
|
children: [
|
|
@@ -3187,14 +3217,14 @@ if (typeof document !== "undefined" && document.querySelector("style[data-plugin
|
|
|
3187
3217
|
document.head.appendChild(tag);
|
|
3188
3218
|
}
|
|
3189
3219
|
var CodeArtsPanel_module_css_default = {
|
|
3190
|
-
"
|
|
3220
|
+
"body": "Z66cgG_body",
|
|
3221
|
+
"backCaret": "Z66cgG_backCaret",
|
|
3191
3222
|
"icon": "Z66cgG_icon",
|
|
3192
|
-
"back": "Z66cgG_back",
|
|
3193
3223
|
"head": "Z66cgG_head",
|
|
3194
|
-
"title": "Z66cgG_title",
|
|
3195
3224
|
"page": "Z66cgG_page",
|
|
3196
|
-
"
|
|
3197
|
-
"
|
|
3225
|
+
"back": "Z66cgG_back",
|
|
3226
|
+
"title": "Z66cgG_title",
|
|
3227
|
+
"desc": "Z66cgG_desc"
|
|
3198
3228
|
};
|
|
3199
3229
|
//#endregion
|
|
3200
3230
|
//#region src/client/CodeArtsPanel.tsx
|
|
@@ -3522,12 +3552,15 @@ const zh = {
|
|
|
3522
3552
|
displayAutoClaimTitle: "每日签到积分",
|
|
3523
3553
|
displayAutoClaimHint: "打开后,DSH 启动约 30 秒会自动把每个已登录账号的每日签到积分领一遍;没领到会隔 30 分钟再试,最多 3 次。上游按天去重,重复领取不会出错。领取结果可以点开积分条查看。注意:这个功能只在 DSH 运行时生效,关掉 DSH 后不会替你领。",
|
|
3524
3554
|
displayAutoClaimToggle: "自动领取每日签到积分(默认关闭)",
|
|
3555
|
+
displayQueueWaitTitle: "排队等待",
|
|
3556
|
+
displayQueueWaitHint: "上游在高峰期会回「当前请求量较大,您排在第 N 位」。打开这一项后,插件不再直接报错,而是提前打开回复流、每 20 秒发一个空帧保住连接,一直轮询到轮到再继续(最长 15 分钟)。代价:等待期间界面上已经开始「回复」,而且这一条请求会一直占着;想立刻做别的事可以点「停止生成」。默认关闭,因为这是让你自己决定要不要等。",
|
|
3557
|
+
displayQueueWaitToggle: "排队时一直等到轮到(最长 15 分钟,默认关闭)",
|
|
3525
3558
|
displayKeeperTitle: "常驻保活(DSH 关掉后仍续登录)",
|
|
3526
3559
|
displayKeeperHint: "上游给的登录凭证只活 2 小时,但要靠它换新的登录凭证(refresh token),那个能活 30 天。打开这一项后,DSH 会在系统里另起一个独立的后台进程,每 20 分钟替你续一次——所以哪怕 DSH 关着、好几天不开,回来也不用重新登录。这个进程不随 DSH 退出,要用下面的「结束」按钮手动停。默认关闭:不经你同意就在系统里留一个常驻进程不合适。",
|
|
3527
3560
|
displayKeeperToggle: "开启常驻保活进程(默认关闭)",
|
|
3528
3561
|
displayKeeperRunning: "后台进程运行中 · PID {pid} · 最近心跳 {time}",
|
|
3529
3562
|
displayKeeperStarting: "后台进程正在启动……稍等几秒刷新这一页。",
|
|
3530
|
-
displayKeeperDown: "
|
|
3563
|
+
displayKeeperDown: "后台进程没有在跑(可能被你结束、为更新让路或启动失败)。{message}",
|
|
3531
3564
|
displayKeeperStop: "结束进程",
|
|
3532
3565
|
displayKeeperStopping: "正在结束……",
|
|
3533
3566
|
displayKeeperStopped: "后台进程已结束,保活开关已同时关闭。",
|
|
@@ -3734,12 +3767,15 @@ const en = {
|
|
|
3734
3767
|
displayAutoClaimTitle: "Daily sign-in credits",
|
|
3735
3768
|
displayAutoClaimHint: "When on, about 30 seconds after DSH starts the plugin claims the daily sign-in credits for every signed-in account; if nothing was claimed it retries after 30 minutes, up to 3 times. Upstream deduplicates by day, so claiming twice is harmless. Open the credits bar to see the result. Note: this only runs while DSH is running — it cannot claim for you once DSH is closed.",
|
|
3736
3769
|
displayAutoClaimToggle: "Claim daily sign-in credits automatically (off by default)",
|
|
3770
|
+
displayQueueWaitTitle: "Queue waiting",
|
|
3771
|
+
displayQueueWaitHint: "At peak times upstream answers \"the request volume is high, you are #N in the queue\". With this on, the plugin stops failing immediately: it opens the reply stream early and sends an empty frame every 20 seconds to keep the connection alive, polling until your turn (up to 15 minutes). The trade-off: the UI already looks like an answer in progress, and the request stays occupied — press \"Stop generating\" if you need to do something else. Off by default, because whether to wait is your call.",
|
|
3772
|
+
displayQueueWaitToggle: "Wait for your turn when queued (up to 15 minutes, off by default)",
|
|
3737
3773
|
displayKeeperTitle: "Keep-alive process (stays signed in while DSH is closed)",
|
|
3738
3774
|
displayKeeperHint: "The login token upstream hands out only lives 2 hours, but the refresh token behind it lives 30 days. With this on, DSH starts a separate background process that refreshes the credential every 20 minutes — so even after DSH has been closed for days, you come back without signing in again. That process outlives DSH; stop it with the button below. Off by default: leaving a resident process on your machine without asking is not something a plugin should do.",
|
|
3739
3775
|
displayKeeperToggle: "Run the keep-alive background process (off by default)",
|
|
3740
3776
|
displayKeeperRunning: "Background process running · PID {pid} · last heartbeat {time}",
|
|
3741
3777
|
displayKeeperStarting: "The background process is starting… refresh this page in a few seconds.",
|
|
3742
|
-
displayKeeperDown: "The background process is not running (stopped by you, or it failed to start)
|
|
3778
|
+
displayKeeperDown: "The background process is not running (stopped by you, stepped aside for an update, or it failed to start). {message}",
|
|
3743
3779
|
displayKeeperStop: "Stop process",
|
|
3744
3780
|
displayKeeperStopping: "Stopping…",
|
|
3745
3781
|
displayKeeperStopped: "Background process stopped and the keep-alive switch turned off.",
|
package/lib/index.d.mts
CHANGED
|
@@ -788,9 +788,14 @@ interface CodeArtsModelInfo {
|
|
|
788
788
|
name: string;
|
|
789
789
|
contextWindow: number;
|
|
790
790
|
/**
|
|
791
|
-
* `contextWindow`
|
|
791
|
+
* 这个 `contextWindow` 能不能当「上游真实规格」展示。
|
|
792
792
|
*
|
|
793
|
-
*
|
|
793
|
+
* 由各发现源在解析时置位(上游真给了字段、且 > 0),再一路带过合并与 `backfillParams`;
|
|
794
|
+
* 用户按模型覆盖、或进程内实测学到上界时,`fetchModels` 也会把它置位(那些值是我们
|
|
795
|
+
* 确认过的,可以展示)。
|
|
796
|
+
*
|
|
797
|
+
* 参数表补出来的值**永远不带**这个标记:`contextWindow` 同时是守卫输入,补一个保守值
|
|
798
|
+
* 让它保守拦截是对的;但把兜底值印成上游规格就是假数据(issue #9 的遗留项)。
|
|
794
799
|
*/
|
|
795
800
|
contextWindowKnown?: boolean;
|
|
796
801
|
/**
|
|
@@ -1362,19 +1367,19 @@ type CodeArtsQueueOutcome =
|
|
|
1362
1367
|
{
|
|
1363
1368
|
kind: 'working';
|
|
1364
1369
|
} |
|
|
1365
|
-
/**
|
|
1370
|
+
/** 短探没轮到:只是提示,shim 照常发请求。 */
|
|
1366
1371
|
{
|
|
1367
1372
|
kind: 'queued';
|
|
1368
1373
|
position: number;
|
|
1369
1374
|
length: number;
|
|
1370
1375
|
message: string;
|
|
1371
1376
|
} |
|
|
1372
|
-
/**
|
|
1377
|
+
/** 队列本身已满;同样只是提示,不拦请求。 */
|
|
1373
1378
|
{
|
|
1374
1379
|
kind: 'queue_full';
|
|
1375
1380
|
message: string;
|
|
1376
1381
|
} |
|
|
1377
|
-
/**
|
|
1382
|
+
/** 排队接口连续失败:拿不到位置就安静地照发,不影响请求。 */
|
|
1378
1383
|
{
|
|
1379
1384
|
kind: 'error';
|
|
1380
1385
|
message: string;
|
|
@@ -1386,7 +1391,7 @@ type CodeArtsQueueOutcome =
|
|
|
1386
1391
|
interface CodeArtsQueueGateOptions {
|
|
1387
1392
|
/** 两次查询之间的间隔(官方客户端是 5 秒)。 */
|
|
1388
1393
|
intervalMs?: number;
|
|
1389
|
-
/**
|
|
1394
|
+
/** 短探多久(只影响底部提示的可见时长,不拦请求)。 */
|
|
1390
1395
|
maxWaitMs?: number;
|
|
1391
1396
|
/** 连续失败几次就放弃。 */
|
|
1392
1397
|
maxErrors?: number;
|
|
@@ -1407,10 +1412,12 @@ declare class CodeArtsQueueGate {
|
|
|
1407
1412
|
private readonly now;
|
|
1408
1413
|
constructor(options?: CodeArtsQueueGateOptions);
|
|
1409
1414
|
/**
|
|
1410
|
-
*
|
|
1411
|
-
*
|
|
1415
|
+
* 占号并**最多探 `maxWaitMs`**。调用方只拿结果做提示:`working` 表示正好轮到,
|
|
1416
|
+
* 其余结果照发 chat 请求(这张票不拦请求,见模块注释)。
|
|
1412
1417
|
*/
|
|
1413
|
-
wait(credential: CodeArtsResolved, chatId: string, model: string, signal?: AbortSignal
|
|
1418
|
+
wait(credential: CodeArtsResolved, chatId: string, model: string, signal?: AbortSignal,
|
|
1419
|
+
/** 覆盖这次探测的时长(「一直等到轮到」开关会传几分钟)。 */
|
|
1420
|
+
budgetMs?: number): Promise<CodeArtsQueueOutcome>;
|
|
1414
1421
|
/** 正在排队的条目(给底部条)。 */
|
|
1415
1422
|
snapshot(): readonly CodeArtsQueueEntry[];
|
|
1416
1423
|
dispose(): void;
|
|
@@ -1622,8 +1629,8 @@ interface CodeArtsShimOptions {
|
|
|
1622
1629
|
/** 用量账本。给了就在转发流的同时把 usage 帧记下来(卡片上的「今日用量」)。 */
|
|
1623
1630
|
usage?: CodeArtsUsageTracker;
|
|
1624
1631
|
/**
|
|
1625
|
-
*
|
|
1626
|
-
*
|
|
1632
|
+
* 上游排队闸门。给了就在发请求前短探一次排队位置(底部展示「排队第 N 位」),
|
|
1633
|
+
* **没轮到也照发** —— 实测 chat 请求不校验这张票(issue #10)。
|
|
1627
1634
|
*/
|
|
1628
1635
|
queue?: CodeArtsQueueGate;
|
|
1629
1636
|
logger?: ShimLogger;
|
|
@@ -1637,6 +1644,15 @@ interface CodeArtsShimOptions {
|
|
|
1637
1644
|
debug?: (message: string) => void;
|
|
1638
1645
|
/** 本地槽位满时最多等多久(缺省 30 秒)。测试用它把等待压到毫秒级。 */
|
|
1639
1646
|
localSlotWaitMs?: number;
|
|
1647
|
+
/** 上游回排队拒绝后的首次退避(缺省 5 秒,之后翻倍)。测试用它把等待压到毫秒级。 */
|
|
1648
|
+
queueRetryGapMs?: number;
|
|
1649
|
+
/**
|
|
1650
|
+
* 「排队时一直等到轮到」(每次请求实时读,缺省关)。
|
|
1651
|
+
*
|
|
1652
|
+
* 打开后,上游明确回排队拒绝时不再换号/短退避,而是提前开流 + 每 20 秒一个空帧
|
|
1653
|
+
* 保住宿主连接,轮询这张票直到 working(最长 15 分钟),再用同一个号发请求。
|
|
1654
|
+
*/
|
|
1655
|
+
waitInQueue?: () => boolean;
|
|
1640
1656
|
/**
|
|
1641
1657
|
* 按模型 id 覆盖 contextWindow(用户配置,每次请求实时读取)。
|
|
1642
1658
|
*
|
|
@@ -1887,6 +1903,15 @@ interface Config {
|
|
|
1887
1903
|
* 打开后卡片上会显示它的 pid,并给一个「结束」按钮。
|
|
1888
1904
|
*/
|
|
1889
1905
|
keepAliveDaemon?: boolean;
|
|
1906
|
+
/**
|
|
1907
|
+
* 「排队时一直等到轮到」(issue #10)。缺省 = **关**。
|
|
1908
|
+
*
|
|
1909
|
+
* 打开后,上游明确回排队拒绝时插件不再直接报错,而是提前打开 SSE、每 20 秒发
|
|
1910
|
+
* 一个空帧保住连接(宿主的 90 秒空闲超时只认可解析事件),轮询排队位置直到
|
|
1911
|
+
* 轮到,最长等 15 分钟。代价:等待期间界面上已经开始「回复」,属于用户知情后
|
|
1912
|
+
* 主动选择的行为,所以不默认开。
|
|
1913
|
+
*/
|
|
1914
|
+
queueWaitUntilReady?: boolean;
|
|
1890
1915
|
}
|
|
1891
1916
|
declare const Config: z<Config>;
|
|
1892
1917
|
declare function apply(ctx: Context, rawConfig: Config): void;
|