dsh-wtq-pool 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,11 +1,34 @@
1
1
  # 更新说明
2
2
 
3
+ ## [1.2.1]
4
+
5
+ - 签到:单账号与批量领取后立即更新账号卡片;已领取的回执按已签到处理,单账号签到遇到当日已领取时直接显示成功;已领取的活动不再遮住其后可领取的轮次;过期登录在批量签到前跳过;Trae 设备签到当天用完后,同批剩余同版本账号标记为跳过;国际版不显示签到入口与说明。
6
+ - 网关:WorkBuddy 轮换尝试数覆盖整个账号池;传输失败与首字节前断流换号,最多重试一次;空 200 流同样换号;流内失败保留上游原因与等待时间,耗尽时返回 `Retry-After`;WAF 页面不再按额度耗尽处理。
7
+ - Qoder:只含 role 或 usage 的帧不再被当作已输出,随后的失败帧仍会触发换号;嵌套错误不覆盖外层可读原因,但嵌套的等待时间与失败类别仍会被读取;错误响应体读取有上限。
8
+ - 安全:WorkBuddy 标准安装路径、环境变量指定的可执行文件与注册表扫描结果都必须通过 Authenticode 校验;注册表扫描不访问 UNC 或相对路径。
9
+ - 隐私:日志中的账号标签改为短哈希,令牌、路径与邮箱在写入前统一脱敏;面板登录只打开 https 链接。
10
+ - 面板:初始语言跟随宿主;全部账号停用时健康点不再显示正常;键盘操作后焦点回到原控件;账号控件与模型字段提供可访问名称,签到按钮的名称与可见文字一致;成长记录按最新一次运行显示;登录过期后签到按钮不可点;批量签到结束后清除进行中提示;Qoder 时间标注北京时间;深色删除确认按钮对比度修正。
11
+
12
+ ## [1.2.0]
13
+
14
+ - 品牌:模型提供商 ID 由 `xdpool-*` 改为 `wtqpool-*`;升级后模型选择需要重新选一次。
15
+
16
+ ## [1.1.1]
17
+
18
+ - 登录:刷新失败的账号在本轮请求内跳过,不再反复重试同一个账号;200 信封的登录失效也区分「被拒」与「刷新失败」,后者不再写 6 小时停用。
19
+ - 渠道校验:11128 出现在 HTTP 200 的 JSON 信封时同样折叠系统消息并重试一次,通过的提示照常按 region 记住。
20
+ - 签到:Trae、Qoder 的单账号签到在超时后继续占用守卫,避免第二次点击与仍在进行的领取并行。
21
+ - Qoder:展示用量只带到期时间、没有可用额度时回退到 quota 路由,不再直接报「用量不可用」。
22
+ - 设置:宿主推送的旧设置文档不再覆盖刚保存的账号停用、移除与模型选择;DSH 重载保留 provider 声明与 Trae/Qoder 目录,地址漂移按实际发布地址判断。
23
+ - 面板与文档:保活卡片只在 WorkBuddy 页签显示;补充刷新重置时间的 2 小时上限、输入框积分关闭后的慢轮询、助手历史改名说明。
24
+
3
25
  ## [1.1.0]
4
26
 
5
27
  - 登录:多处登录按签发时间取最新;续期写回插件自管文件;被拒登录先刷新重试,刷新令牌也失效才挂起 6 小时,挂起期间跳过轮询、签到、成长与保活。
6
28
  - 账号限制:11140 标注「已限制」并换号,全部受限回 403 提示申诉;11158 按账号 × 模型停用 24 小时,全部被拒回 400。
7
29
  - 网络:刷新超时、限流或网络故障时账号留在轮换;网络错误结束本轮,不冷却账号。
8
30
  - 网关:200 信封里的账号级业务码按原因处理;缺结束帧时补 `finish_reason` 与 `[DONE]`;Trae、Qoder 等待期间发保活;路由支持查询串;空正文回 502。
31
+ - 对话:国内版渠道校验(11128)拒绝提示词时,自动把系统消息并入首条用户消息并重试一次;通过的提示按 region 记住,后续轮次不再重复这次往返。移除「客户端名称」开关。
9
32
  - 面板:区分「需重新登录」「已限制」与普通冷却;删除立即消失且不被桌面快照带回;签到防连点;重载后提示刷新。
10
33
  - 令牌保活:独立卡片,按签发时间续期;桌面遗留快照由插件接管,正在使用的由桌面端续期。
11
34
  - 连接检查:网关启动失败原因与端口记入报告,停用、重启与卸载时清除;重载清掉未完成的设备登录。
package/README.en.md CHANGED
@@ -37,7 +37,7 @@
37
37
 
38
38
  Use local WorkBuddy, Trae and Qoder desktop sign-ins in DeepSeek Harness. WorkBuddy fails over when an account is rate-limited or out of quota. Trae and Qoder select an account per request and move on to the next sign-in on an authentication failure, a rate limit or exhausted quota, while a problem with the request itself, such as an unknown model or a malformed body, is answered as the upstream answered it. Each source has its own switch, with domestic and international accounts grouped separately.
39
39
 
40
- A rate limit cools for the wait the upstream stated, or the configured window when it stated none. Exhausted quota and a dead sign-in do not recover on their own: that account leaves rotation. A balance read releases an exhausted-quota hold; a successful token refresh, a fresh sign-in or a manual cooldown reset releases a refused-sign-in hold, and both lapse after six hours (WorkBuddy). The non-stream reads of credits, check-in state, the model catalogue and check-ins force one token refresh and one retry when a sign-in is refused: an account whose refresh token still works recovers on the spot and never leaves rotation, and only one whose refresh token is spent too is held. Trae and Qoder holds are accounted separately, demoting the sign-in only by the cooldown window (60 seconds by default, configurable up to 24 hours) or by the wait the upstream stated, and it is still used when it is the only one left. When the upstream host cannot be reached at all, the turn ends with a network error. When the upstream says an account's plan does not include a model (11158), that model is disabled on that account for 24 hours while its other models keep serving; if no account includes it, the turn is answered with 400.
40
+ A rate limit cools for the wait the upstream stated, or the configured window when it stated none. Exhausted quota and a dead sign-in do not recover on their own: that account leaves rotation. A balance read releases an exhausted-quota hold; a successful token refresh, a fresh sign-in or a manual cooldown reset releases a refused-sign-in hold, and both lapse after six hours (WorkBuddy). The non-stream reads of credits, check-in state, the model catalogue and check-ins force one token refresh and one retry when a sign-in is refused: an account whose refresh token still works recovers on the spot and never leaves rotation, and only one whose refresh token is spent too is held. Trae and Qoder holds are accounted separately, demoting the sign-in only by the cooldown window (60 seconds by default, configurable up to 24 hours) or by the wait the upstream stated, and it is still used when it is the only one left. When the upstream host cannot be reached, that account is skipped for the request and the next one is tried; after two accounts fail that way, the turn ends with a network error. When the upstream says an account's plan does not include a model (11158), that model is disabled on that account for 24 hours while its other models keep serving; if no account includes it, the turn is answered with 400.
41
41
 
42
42
  ## Preview
43
43
 
@@ -49,7 +49,7 @@ The panel reads the host's `app.getAppearance()` when it loads, which fixes its
49
49
 
50
50
  ![Dark theme](https://github.com/chengzhi-c/dsh-wtq-pool/raw/main/docs/preview-dark.png)
51
51
 
52
- The model page edits each model's display and publishing settings. A Trae directory row states only its plan default, which differs per model (116k to 400k). A model that states no larger tier is published with the measured 1M ceiling. A Trae model whose directory states a rate carries a cost tag such as `x0.79`; models whose directory states none, and every Qoder model, stay unlabelled:
52
+ The model page edits each model's display and publishing settings. A Trae directory row states only its plan default, which differs per model (116k to 400k). A model that states no larger tier is published with a 1M ceiling. A Trae model whose directory states a rate carries a cost tag such as `x0.79`; models whose directory states none, and every Qoder model, stay unlabelled:
53
53
 
54
54
  ![Model settings](https://github.com/chengzhi-c/dsh-wtq-pool/raw/main/docs/preview-models.png)
55
55
 
@@ -63,10 +63,6 @@ Live preview: <https://chengzhi-c.github.io/dsh-wtq-pool/>.
63
63
 
64
64
  ![Preview page](https://github.com/chengzhi-c/dsh-wtq-pool/raw/main/docs/preview-page.png)
65
65
 
66
- With `showComposerPoints` enabled, the composer toolbar shows the credits of the account behind the current model; click it to inspect that group and switch accounts. The image below is an off-screen render of the actual composer extension:
67
-
68
- ![Composer credits](https://github.com/chengzhi-c/dsh-wtq-pool/raw/main/docs/preview-composer.png)
69
-
70
66
  To run the preview locally, clone the repository, run `node docs/serve.cjs`, and open the address it prints. The page cannot be opened over `file://`, because a browser will not let it read the panel files beside it.
71
67
 
72
68
  ## Features
@@ -77,13 +73,22 @@ To run the preview locally, clone the repository, run `node docs/serve.cjs`, and
77
73
  - Gateway responses are SSE streams of `chat.completion.chunk`; the `stream` field in the request body does not change the format.
78
74
  - Credit automation: automatic check-in is off by default. Once enabled, the scheduled run and "Run now" perform the same round: the three check-ins plus the WorkBuddy streak bonus and cat travel. The upstream advances the streak on a conversation, so the round reports one chat activity per account before reading the streak tiers, and a tier that comes due is unlocked and collected without the user opening WorkBuddy to send a message. The streak step also spends a make-up card when yesterday was missed, collects the one-off starter gift and campaign compensation, and spends the draws a redeemed tier awards. These growth steps run for domestic and international accounts alike; cat travel runs for domestic accounts only, because the international host has no such API.
79
75
  - Token keep-alive: on demand, on a card of its own. A snapshot the desktop client left behind is adopted into the plugin's own sign-in directory when the pool scans, and the plugin renews it from then on; the desktop app renews the sign-in it is using. "Refresh now" works on the plugin's own copies and judges by issue time: anything signed more than six hours ago is refreshed, and a token within five minutes of expiry takes the same path. The answer is written back into the sign-in file the plugin owns, so a sign-in the upstream refused is found the same day. When one account has sign-ins in several places, the newest issue time wins. Disabled accounts, disabled regions and accounts whose sign-in the upstream refused stay out.
80
- - Composer credits: with `showComposerPoints` on, the composer toolbar shows the balance of the account behind the current model; click it to switch accounts, and switching the feature off stops the readout's polling.
76
+ - Composer credits: with `showComposerPoints` on, the composer toolbar shows the balance of the account behind the current model; click it to switch accounts. Switching the feature off hides the readout and slows the poll to once every five minutes, so switching it back on recovers without a model change.
81
77
  - Panel: account and pool state, model selection, the connection check and the growth centre all live in the account-pool card on the plugin page. The model catalogue loads at startup and refreshes on demand once its cache expires; it does not poll while idle. Disabled accounts and accounts whose sign-in the upstream refused are never probed.
82
78
  - Connection check: every finding carries a verdict. A gateway that is not listening, a catalogue that could not be read, a published address that differs from the one actually bound, and a provider the host did not accept all count as failures and say what to change. A gateway whose start failed is reported with the reason, and the panel surfaces address drift as a reload hint. A check that fails on its own becomes a finding, and the rest of the report still appears.
83
79
 
84
80
  ## Install
85
81
 
86
- For a local package, run `pnpm install && pnpm run build && npm pack --pack-destination dist` in the source directory, then install the generated `.tgz`:
82
+ For a local package, run these in the source directory:
83
+
84
+ ```powershell
85
+ pnpm install
86
+ pnpm run build
87
+ New-Item -ItemType Directory -Force dist | Out-Null
88
+ npm pack --pack-destination dist
89
+ ```
90
+
91
+ Then install the generated `.tgz`:
87
92
 
88
93
  ```powershell
89
94
  $package = (Get-ChildItem .\dist\*.tgz | Sort-Object LastWriteTime | Select-Object -Last 1).FullName
@@ -92,6 +97,8 @@ dsh plugin --profile desktop add $package
92
97
 
93
98
  Requires DeepSeek Harness on the 0.2.0 line (`engines.dsh` in `package.json`: `>=0.2.0-rc.1 <0.2.1`) and Node `^22.19.0 || >=24.0.0`.
94
99
 
100
+ > After upgrading from 1.1.x to 1.2.0, provider ids are `wtqpool-*`; reselect your model once.
101
+
95
102
  Replace `desktop` with the profile name actually in use. If `dsh` is not on `PATH`, use the CLI in its installation directory. The npm name `dsh-wtq-pool` and the repository URL also work as install sources; a repository-URL install builds from source through the `prepare` script, which requires `allowBuilds: dsh-wtq-pool: true` in the profile's `pnpm-workspace.yaml` and a pinned commit.
96
103
 
97
104
  **Where the panel is**: open **Plugins** in the sidebar, then open the **dsh-wtq-pool** card, or the **Configure** control beside it; the full panel is embedded in that card. If the model groups do not appear, reload the plugin as the note at the top of the panel says.
@@ -115,11 +122,9 @@ To back them up, copy the `signins/` directory, which already has the format a b
115
122
  - **Connection check**: reports line by line whether each gateway is listening, how many models its catalogue returned, whether the registered address matches the one actually bound, and whether the host accepted each provider, and can copy the whole report.
116
123
  - **Growth centre**: applies to WorkBuddy only. It lists one row per account, and expanding a row shows that account's streak tiers. "Read state" reads the current tiers and what is due; "Run now" claims them and runs the growth stage, reporting every step: the make-up card, the gift and compensation, the activity report, and the streak tiers with their draws. An account whose sign-in the upstream refused is skipped in that round.
117
124
 
118
- Check-in runs per account, or for a whole source from the title bar. Automatic check-in is off by default; when on it claims at 09:00 (Beijing time), and a slot missed earlier the same day is still claimed at the next start, while one from a previous day is not. Trae's daily check-in is once per device; Qoder's new round opens at 10:00 (Beijing time). An account whose sign-in the upstream refused is skipped in that round.
119
-
120
- The domestic WorkBuddy host refuses conversational requests whose client identifies itself as DeepSeek Harness (11128, channel check failed). Check-in, the growth centre and the keep-alive use their own endpoints.
125
+ Check-in runs per account, or for a whole source from the title bar. Automatic check-in is off by default; when on it claims at 09:00 (Beijing time), and a slot missed earlier the same day is still claimed at the next start, while one from a previous day is not. Trae's daily check-in is once per device; Qoder CN's new round opens at 10:00 (Beijing time). The international WorkBuddy, Trae and Qoder services have no daily check-in, and the panel shows no check-in entry for them. An account whose sign-in the upstream refused is skipped in that round.
121
126
 
122
- The panel's **Client name** switch controls that rewrite and is off by default. Turned on, every occurrence of `DeepSeek Harness` in the prompt is sent as `DeepSeek`; turned off, the original wording is sent.
127
+ The domestic WorkBuddy host refuses conversational requests whose client identifies itself as DeepSeek Harness (11128, channel check failed), whether the refusal arrives as HTTP 400 or as a JSON envelope with HTTP 200. When it lands, the plugin folds the system messages into the first user message and retries once; the client name is also removed from assistant history, because the channel check reads assistant turns too. An accepted prompt is remembered per region, so the same prompt does not pay that round trip again. Check-in, the growth centre and the keep-alive use their own endpoints.
123
128
 
124
129
  "Refresh now" reports refreshed, already fresh, failed and without a refresh token separately.
125
130
 
@@ -127,7 +132,7 @@ A read stays in the host process, so reloading the panel still paints the last f
127
132
 
128
133
  ## Settings
129
134
 
130
- Every key below is editable in the plugin page and saved on confirm:
135
+ Every key below is editable in the plugin page or the DSH settings page and saved on confirm:
131
136
 
132
137
  | Key | Default (effective) | Meaning |
133
138
  | --- | --- | --- |
@@ -135,12 +140,11 @@ Every key below is editable in the plugin page and saved on confirm:
135
140
  | `sourceWorkbuddy` / `sourceTrae` / `sourceQoder` | `true` | Off: that source is not scanned, published or requested |
136
141
  | `distribution` | `priority` | How the WorkBuddy pool spreads requests: `priority` uses one account first, `round-robin` spreads evenly, `expiry` spends expiring credits first, `sticky` pins one account per conversation |
137
142
  | `sourceDistributions` | `{}` | Trae/Qoder distribution: `priority` / `round-robin` / `expiry`; unset behaves as `priority` |
138
- | `cooldownSeconds` | `60` | Rate-limit cooldown. A reset time the upstream reports takes precedence; with none, consecutive limits double it up to 15 minutes (a longer configured window is left alone) |
143
+ | `cooldownSeconds` | `60` | Rate-limit cooldown. A reset time the upstream reports takes precedence; with none, consecutive limits double it up to 15 minutes (a longer configured window is left alone). A reported reset is capped at two hours; a spent balance or a refused sign-in is held for six hours instead |
139
144
  | `creditReserves` | `{}` | Per-account credit floor, keyed by account id; an account at or below its floor is not distributed to |
140
145
  | `authFile` | `""` | WorkBuddy sign-in file path; every `.info` sign-in in its directory is scanned. Empty discovers it |
141
146
  | `autoCheckin` | `{"enabled":false,"hours":[9]}` | Automatic check-in switch and times; `hours` are Beijing-time hours, empty means 09:00 |
142
147
  | `showComposerPoints` | `false` | Show the active account's credits in the composer |
143
- | `rewriteClientName` | `false` | Send `DeepSeek` in place of the client name `DeepSeek Harness` in the prompt going to the domestic host, so its channel check (11128) passes; the international host accepts either name |
144
148
  | `disabledAccountIds` | `[]` | Account ids disabled in the panel |
145
149
  | `disabledRegions` | `[]` | Regions disabled on their own, as `source:region` keys |
146
150
  | `modelSelection` | `{}` | Which models each gateway publishes, plus display name, context window and other overrides |
@@ -170,9 +174,9 @@ The PI-Desktop edition uses a separate range starting at 41831, so both plugins
170
174
 
171
175
  The plugin reads the vendors' local sign-in files. Providers are registered at runtime; the host persists plugin settings in the profile. Tokens are held by the plugin and go only to the relevant vendor endpoints. Gateways listen on `127.0.0.1`; the panel accepts loopback requests only.
172
176
 
173
- The plugin's own data directory, `~/.dsh/dsh-wtq-pool/` (or `$DSH_HOME` when set), holds four files (a `deleted-signins.json.lock` appears for a moment while the delete record is written). `checkin-slots.json` records the check-in slots already collected, kept for three days. `doctor.txt` is the most recent connection report, item by item, and names no account. `credentials-archive.json` keeps the sign-ins a later account switch overwrote, access tokens included, by token expiry, dropping each 30 days after it. `deleted-signins.json` records deleted sign-ins as a token digest, the sign-in's issue time and a delete time, so a scan cannot take the same superseded snapshot back over from the desktop app; the entry lapses once that account signs in again.
177
+ The plugin's own data directory, `~/.dsh/dsh-wtq-pool/` (or `$DSH_HOME` when set), holds four files (a `deleted-signins.json.lock` appears for a moment while the delete record is written). `checkin-slots.json` records the check-in slots already collected and the pending Qoder retry time; slots are kept for three days. `doctor.txt` is the most recent connection report, item by item, and lists no account label. `credentials-archive.json` keeps the sign-ins a later account switch overwrote: access and refresh tokens, account identifiers (nickname, uin/uid, enterprise id) and the local sign-in path. Entries are kept by token expiry, dropping each 30 days after it; an entry with no stated expiry is kept until the account is deleted. `deleted-signins.json` records deleted sign-ins as a token digest, the sign-in's issue time and a delete time, so a scan cannot take the same superseded snapshot back over from the desktop app; the entry lapses once that account signs in again. These files carry no additional encryption; access is bounded by the operating system's file ACLs.
174
178
 
175
- Every sign-in the plugin writes lives in `signins/` beside it: ones added from the panel, snapshots adopted from the desktop app, and renewed copies. Each file is named after the account's billing identity and read on the same terms as a desktop sign-in. "Delete" in the panel removes that file together with its archive entry, and the snapshot the desktop app left behind stops being adopted; signing the account in again brings it back. "Remove" only disables the account, and "Removed accounts" restores it.
179
+ Every sign-in the plugin writes lives in `signins/` beside it: ones added from the panel, snapshots adopted from the desktop app, and renewed copies. Each file is named after the account's billing identity and read on the same terms as a desktop sign-in. These files are not additionally encrypted either; access is bounded by the operating system's file ACLs. "Delete" in the panel removes that file together with its archive entry, and the snapshot the desktop app left behind stops being adopted; signing the account in again brings it back. "Remove" only disables the account, and "Removed accounts" restores it.
176
180
 
177
181
  The plugin sends requests only to the vendor endpoints; panel links open only when clicked.
178
182
 
package/README.md CHANGED
@@ -37,7 +37,7 @@
37
37
 
38
38
  把本机 WorkBuddy、Trae、Qoder 的桌面登录接入 DeepSeek Harness。WorkBuddy 在账号被限流或额度用尽时自动换号;Trae、Qoder 按请求选择账号,认证失败、限流或余额耗尽时改用下一个登录重试,模型不存在、请求体非法这类请求自身的问题则按上游原样返回。三个来源各自开关,国内与国际账号分别成组。
39
39
 
40
- 限流按上游给出的等待时间冷却,上游未给出时按配置的窗口。额度用尽与登录失效不会自行恢复,账号退出轮换:额度用尽的挂起在余额重新读到后释放,登录失效的挂起在刷新成功、重新登录或手动重置冷却后释放,两者都在六小时后(WorkBuddy 侧)到期。积分、签到状态、模型目录与手动签到这些非流式读取遇到登录失效,会先强制刷新令牌并重试一次:刷新令牌还有效的账号当场恢复,不退出轮换;刷新令牌同样失效的才挂起。Trae、Qoder 的失败挂起另计:只按冷却窗口(默认 60 秒,最长可配到 24 小时)或上游给出的等待时间降权,池中只剩它一个时仍会使用。上游主机不可达时结束本轮并报告网络错误。上游判定账号套餐不含某模型(11158)时,该账号的这个模型停用 24 小时,其他模型照常服务;全部账号都不含该模型时按 400 返回。
40
+ 限流按上游给出的等待时间冷却,上游未给出时按配置的窗口。额度用尽与登录失效不会自行恢复,账号退出轮换:额度用尽的挂起在余额重新读到后释放,登录失效的挂起在刷新成功、重新登录或手动重置冷却后释放,两者都在六小时后(WorkBuddy 侧)到期。积分、签到状态、模型目录与手动签到这些非流式读取遇到登录失效,会先强制刷新令牌并重试一次:刷新令牌还有效的账号当场恢复,不退出轮换;刷新令牌同样失效的才挂起。Trae、Qoder 的失败挂起另计:只按冷却窗口(默认 60 秒,最长可配到 24 小时)或上游给出的等待时间降权,池中只剩它一个时仍会使用。上游主机不可达时跳过该账号并尝试下一个;连续两个账号都不可达时结束本轮并报告网络错误。上游判定账号套餐不含某模型(11158)时,该账号的这个模型停用 24 小时,其他模型照常服务;全部账号都不含该模型时按 400 返回。
41
41
 
42
42
  ## 预览
43
43
 
@@ -49,7 +49,7 @@
49
49
 
50
50
  ![暗色主题](https://github.com/chengzhi-c/dsh-wtq-pool/raw/main/docs/preview-dark.png)
51
51
 
52
- 模型页编辑每个模型的显示与发布参数。Trae 目录给出的默认窗口因模型而异(116k 至 400k);未声明更大档位的模型,本插件按实测可用的 1M 发布上限。Trae 目录给出费率的模型带 `x0.79` 形式的费率标签;目录未给出费率的模型以及全部 Qoder 模型均不标注:
52
+ 模型页编辑每个模型的显示与发布参数。Trae 目录给出的默认窗口因模型而异(116k 至 400k);未声明更大档位的模型,按 1M 发布上限。Trae 目录给出费率的模型带 `x0.79` 形式的费率标签;目录未给出费率的模型以及全部 Qoder 模型均不标注:
53
53
 
54
54
  ![模型设置](https://github.com/chengzhi-c/dsh-wtq-pool/raw/main/docs/preview-models.png)
55
55
 
@@ -63,10 +63,6 @@
63
63
 
64
64
  ![预览页](https://github.com/chengzhi-c/dsh-wtq-pool/raw/main/docs/preview-page.png)
65
65
 
66
- 开启 `showComposerPoints` 后,输入框工具栏显示当前模型所用账号的积分,点击可查看该组账号并切换。下图为实际输入框扩展的离屏渲染:
67
-
68
- ![输入框积分](https://github.com/chengzhi-c/dsh-wtq-pool/raw/main/docs/preview-composer.png)
69
-
70
66
  本地预览需先克隆仓库,运行 `node docs/serve.cjs`,再打开它输出的地址。该页面不能用 `file://` 打开,因为浏览器不允许它读取同目录下的面板文件。
71
67
 
72
68
  ## 功能
@@ -77,13 +73,22 @@
77
73
  - 网关以 SSE 返回 `chat.completion.chunk`;请求体里的 `stream` 字段不改变响应格式。
78
74
  - 积分自动化:自动签到默认关闭。开启后的定时任务与「立即运行」执行同一轮,包含三家签到、WorkBuddy 的连登奖励和猫猫旅行。连登天数由上游按对话推进,该轮在每个账号读取连登档位前先补发一次对话活动上报,因此档位到点即可解锁领取,用户无需再进 WorkBuddy 发一句消息。连登环节还会在昨日漏签且持有补签卡时自动补签以保住连续天数,领取一次性的新手礼包与活动补偿,并在兑换解锁的档位后把由此获得的抽奖次数抽完。这些成长步骤国内版与国际版都执行;猫猫旅行只跑国内账号,国际版没有对应接口。
79
75
  - 登录令牌保活:独立卡片,按需执行。桌面端留下的登录快照在扫描时并入插件自己的登录目录,由插件接管续期;桌面端正在使用的登录由桌面端续期。「立即刷新」处理插件自管的副本,按签发时间判断:签发满 6 小时的刷新,距到期不足 5 分钟的同样刷新。刷新结果写回插件自己的登录文件,登录被上游拒绝时当天即可发现。同一账号在多处留有登录时按签发时间取最新的一份。停用账号、已停用的 region 与登录已被上游拒绝的账号不参与。
80
- - 输入框积分:开启 `showComposerPoints` 后,输入框工具栏显示当前模型所用账号的余额,点开可换号。功能关闭后浮层停止轮询。
76
+ - 输入框积分:开启 `showComposerPoints` 后,输入框工具栏显示当前模型所用账号的余额,点开可换号。功能关闭后浮层隐藏,读数降为每 5 分钟一次,重新开启后无需切换模型即可恢复。
81
77
  - 面板:账号与池状态、模型勾选、连接检查、成长中心都在插件页的「账号池」卡片内。模型目录在启动时加载,缓存过期后按需刷新,空闲时不轮询。停用的账号与登录已被上游拒绝的账号不参与探测。
82
78
  - 连接检查:每条发现都带判定。网关没有监听、模型目录读取失败、发布的地址与实际绑定的不一致、provider 未被宿主接受,都算失败并给出需要修改的内容。网关启动失败时给出原因,面板按地址漂移提示重新加载插件。检查自身出错也记一条发现,报告照常给出其余结果。
83
79
 
84
80
  ## 安装
85
81
 
86
- 本地包:在源码目录执行 `pnpm install && pnpm run build && npm pack --pack-destination dist`,再安装生成的 `.tgz`:
82
+ 本地包:在源码目录依次执行:
83
+
84
+ ```powershell
85
+ pnpm install
86
+ pnpm run build
87
+ New-Item -ItemType Directory -Force dist | Out-Null
88
+ npm pack --pack-destination dist
89
+ ```
90
+
91
+ 再安装生成的 `.tgz`:
87
92
 
88
93
  ```powershell
89
94
  $package = (Get-ChildItem .\dist\*.tgz | Sort-Object LastWriteTime | Select-Object -Last 1).FullName
@@ -92,6 +97,8 @@ dsh plugin --profile desktop add $package
92
97
 
93
98
  需要 DeepSeek Harness 0.2.0 线(`package.json` 的 `engines.dsh`:`>=0.2.0-rc.1 <0.2.1`)与 Node `^22.19.0 || >=24.0.0`。
94
99
 
100
+ > 从 1.1.x 升级到 1.2.0 后,模型提供商 ID 改为 `wtqpool-*`,请在模型选择里重新选一次。
101
+
95
102
  请将 `desktop` 替换为实际使用的 profile 名。若 `dsh` 不在 `PATH` 中,改用安装目录中的 CLI。也可按 npm 包名 `dsh-wtq-pool` 或仓库地址安装;按仓库地址安装时 pnpm 会通过 `prepare` 脚本从源码构建,需要在 profile 的 `pnpm-workspace.yaml` 中写入 `allowBuilds: dsh-wtq-pool: true`,并固定在某个 commit 上。
96
103
 
97
104
  **面板位置**:在侧边栏进入 **插件**,打开 **dsh-wtq-pool** 卡片(或其旁的 **配置**),完整面板嵌在该卡片内。模型分组未出现时,按面板顶部的提示重新加载插件。
@@ -115,11 +122,9 @@ node tools/import-signins.cjs --data <插件数据目录> --from <账号文件
115
122
  - **连接检查**:逐条报告网关是否监听、模型目录读到几个、注册的地址与实际绑定的是否一致、每个 provider 是否被宿主接受,并可复制整份报告。
116
123
  - **成长中心**:仅对 WorkBuddy 生效。页面按账号逐行列出,展开一行可见该账号的连登档位。「读取状态」读取当前档位与可领取项;「立即执行」产生领取并执行成长环节,按步骤报告结果。登录被上游拒绝的账号在该轮被跳过。
117
124
 
118
- 签到可对单个账号执行,也可在标题栏一次领完该来源。自动签到默认关闭,开启后默认于 09:00(北京时间)执行;当天错过的时段在当天内的下一次启动仍会补领,跨天则不补。Trae 的每日签到每台设备限领一次;Qoder 的新一轮于每天 10:00(北京时间)开放。登录被上游拒绝的账号在该轮被跳过。
119
-
120
- WorkBuddy 国内版上游会拒绝「客户端身份写着 DeepSeek Harness」的对话请求(返回 11128,渠道校验未通过)。签到、成长中心与保活走各自的接口。
125
+ 签到可对单个账号执行,也可在标题栏一次领完该来源。自动签到默认关闭,开启后默认于 09:00(北京时间)执行;当天错过的时段在当天内的下一次启动仍会补领,跨天则不补。Trae 的每日签到每台设备限领一次;Qoder 国内版的新一轮于每天 10:00(北京时间)开放。WorkBuddy、Trae、Qoder 的国际版没有每日签到,面板不显示签到入口。登录被上游拒绝的账号在该轮被跳过。
121
126
 
122
- 面板的「客户端名称」开关控制这条改写,默认关闭。开启后,提示词里 `DeepSeek Harness` 的每一处都改为 `DeepSeek`;关闭后恢复原名。
127
+ WorkBuddy 国内版上游会拒绝「客户端身份写着 DeepSeek Harness」的对话请求(返回 11128,渠道校验未通过)。插件遇到这条拒绝时,会把系统消息并入首条用户消息并重试一次;助手历史里的客户端名称也会移除,因为渠道校验同样读取助手消息。通过的提示按 region 记住,同一段提示之后不再重复这次往返。签到、成长中心与保活走各自的接口。
123
128
 
124
129
  「立即刷新」的结果按刷新、已是最新、失败、无刷新令牌分项报告。
125
130
 
@@ -127,7 +132,7 @@ WorkBuddy 国内版上游会拒绝「客户端身份写着 DeepSeek Harness」
127
132
 
128
133
  ## 设置
129
134
 
130
- 以下键在插件页修改,保存后生效:
135
+ 以下键在插件页或 DSH 的设置页修改,保存后生效:
131
136
 
132
137
  | 键 | 默认(生效值) | 说明 |
133
138
  | --- | --- | --- |
@@ -135,12 +140,11 @@ WorkBuddy 国内版上游会拒绝「客户端身份写着 DeepSeek Harness」
135
140
  | `sourceWorkbuddy` / `sourceTrae` / `sourceQoder` | `true` | 关闭后该来源不扫描、不发布、不请求 |
136
141
  | `distribution` | `priority` | WorkBuddy 池的发放方式:`priority` 先用一个账号,`round-robin` 均摊,`expiry` 优先消耗临期积分,`sticky` 同一对话固定 |
137
142
  | `sourceDistributions` | `{}` | Trae、Qoder 的分发方式:`priority` / `round-robin` / `expiry`;未设时按 `priority` |
138
- | `cooldownSeconds` | `60` | 限流冷却时长。上游报出重置时间时以它为准;没有重置时间时,连续限流会让它逐次翻倍,封顶 15 分钟(窗口本身超过 15 分钟时不再翻倍) |
143
+ | `cooldownSeconds` | `60` | 限流冷却时长。上游报出重置时间时以它为准;没有重置时间时,连续限流会让它逐次翻倍,封顶 15 分钟(窗口本身超过 15 分钟时不再翻倍)。上游给出的重置时间最长按 2 小时计;余额耗尽或登录被上游拒绝另按 6 小时停用 |
139
144
  | `creditReserves` | `{}` | 按账号 id 设定的积分保底,余额不高于它的账号不参与分发 |
140
145
  | `authFile` | `""` | WorkBuddy 登录文件路径;扫描其所在目录的全部 `.info` 登录,留空则自动发现 |
141
146
  | `autoCheckin` | `{"enabled":false,"hours":[9]}` | 自动签到的开关与时点;`hours` 为北京时间整点,留空用 09:00 |
142
147
  | `showComposerPoints` | `false` | 在输入框工具栏显示当前账号积分 |
143
- | `rewriteClientName` | `false` | 发往国内版的提示词里把客户端名称 `DeepSeek Harness` 改为 `DeepSeek`,供渠道校验(11128)通过;国际版接受任一名称 |
144
148
  | `disabledAccountIds` | `[]` | 面板中停用的账号 id |
145
149
  | `disabledRegions` | `[]` | 单独停用的 region,形如 `source:region` |
146
150
  | `modelSelection` | `{}` | 每个网关勾选哪些模型,以及显示名、上下文窗口等覆写 |
@@ -170,9 +174,9 @@ PI-Desktop 版使用 41831 开头的另一段端口,两个插件可以同时
170
174
 
171
175
  读取三家 App 的本机登录文件。provider 通过运行时注册接入,插件设置由宿主持久化至 profile。令牌由插件保管,只发往对应厂商的接口。网关监听 `127.0.0.1`,面板只接受本机回环请求。
172
176
 
173
- 插件自管数据目录 `~/.dsh/dsh-wtq-pool/`(设置了 `DSH_HOME` 时改用它)包含四个文件(写删除记录时会短暂多一个 `deleted-signins.json.lock`)。`checkin-slots.json` 记录已领取的签到时段,只保留三天。`doctor.txt` 是最近一次连接检查的报告,逐项记录通过与否,不含账号名称。`credentials-archive.json` 留存被切号覆盖的登录,含访问令牌;按令牌到期时间保留,到期后再过 30 天清除。`deleted-signins.json` 记录已删除的登录,只存令牌摘要、该登录的签发时间与删除时间,用来阻止扫描把桌面端遗留的同一份快照重新接管回来;同一个账号重新登录后(签发时间更新)该记录自动失效。
177
+ 插件自管数据目录 `~/.dsh/dsh-wtq-pool/`(设置了 `DSH_HOME` 时改用它)包含四个文件(写删除记录时会短暂多一个 `deleted-signins.json.lock`)。`checkin-slots.json` 记录已领取的签到时段和待重试的 Qoder 时点,时段只保留三天。`doctor.txt` 是最近一次连接检查的报告,逐项记录通过与否,不列账号标签。`credentials-archive.json` 留存被切号覆盖的登录,含访问令牌、刷新令牌、账号标识(昵称、uin/uid、企业 ID)与本机登录文件路径;按令牌到期时间保留,到期后再过 30 天清除,没有到期时间的记录保留到该账号被删除。`deleted-signins.json` 记录已删除的登录,只存令牌摘要、该登录的签发时间与删除时间,用来阻止扫描把桌面端遗留的同一份快照重新接管回来;同一个账号重新登录后(签发时间更新)该记录自动失效。上述文件未额外加密,访问权限由操作系统文件 ACL 决定。
174
178
 
175
- 插件写入的登录都在同目录的 `signins/`:面板添加的、接管桌面端快照的、续期后的副本。文件名带账号的计费身份,与桌面登录同等参与分发。在面板中「删除」该账号会连同 `credentials-archive.json` 里的留档一起清除,桌面端遗留的同一份快照随之失效;重新登录该账号即解除。「移除」只是停用,可在「已移除的账号」中恢复。
179
+ 插件写入的登录都在同目录的 `signins/`:面板添加的、接管桌面端快照的、续期后的副本。文件名带账号的计费身份,与桌面登录同等参与分发。这些文件同样未额外加密,访问权限由操作系统文件 ACL 决定。在面板中「删除」该账号会连同 `credentials-archive.json` 里的留档一起清除,桌面端遗留的同一份快照随之失效;重新登录该账号即解除。「移除」只是停用,可在「已移除的账号」中恢复。
176
180
 
177
181
  插件只向三家厂商的接口发起请求;面板外链仅在用户点击时打开。
178
182
 
package/lib/client.js CHANGED
@@ -350,7 +350,7 @@ window.__ModuleLoader__.load({
350
350
  if (stopped) return;
351
351
  if (next.enabled === false) {
352
352
  setPoints(null);
353
- window.clearTimeout(timer);
353
+ schedule(null);
354
354
  return;
355
355
  }
356
356
  const shown = next.show === true ? next : null;
@@ -754,7 +754,6 @@ window.__ModuleLoader__.load({
754
754
  ...composerEn
755
755
  }
756
756
  }), "dsh-wtq-pool: copy");
757
- ctx.locale.bind(NAMESPACE);
758
757
  } catch (error) {
759
758
  console.error("[dsh-wtq-pool] the copy did not register (the labels fall back to their keys):", error);
760
759
  }
package/lib/index.d.ts CHANGED
@@ -73,8 +73,6 @@ interface Config {
73
73
  removedAccounts?: unknown[];
74
74
  /** Whether the credits readout is shown beside the composer. */
75
75
  showComposerPoints?: boolean;
76
- /** Whether the client name is rewritten for the domestic host's channel check. */
77
- rewriteClientName?: boolean;
78
76
  /** How each Trae/Qoder region spreads requests. */
79
77
  sourceDistributions?: Record<string, string>;
80
78
  }