dsh-wtq-pool 1.2.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,8 +1,45 @@
1
1
  # 更新说明
2
2
 
3
+ ## [1.3.0]
4
+
5
+ - 账号池:升级前的停用、移除、保底与偏好设置按旧账号 ID 继续生效。
6
+ - 账号池:关闭一个区域不再改变另一区域账号的名称,失败挂起与签到记录不丢失。
7
+ - 稳定性:模型列表读取失败按网关限量重试;刷新期间到达的设置变更在下一轮生效。
8
+ - 换号:WAF 页面按上游故障冷却,不再计入限流次数或拉长下一次限流窗口。
9
+ - 账号池:删除一个账号不再清掉同名账号仍在使用的旧版归档记录。
10
+ - 安全:面板日志与错误回显脱敏账号标识和 Cookie;账号文件按 0600、目录按 0700 创建(Windows 上由文件 ACL 决定),中断写入的临时登录文件会被清理。
11
+ - 存储:Windows 上锁文件处于删除挂起时改为等待重试,归档写入不再丢条目;持续拒绝写入时按超时失败。
12
+ - 存储:删除与续期同时发生时,续期得到的令牌不再写回已删除账号的文件或归档。
13
+ - 存储:删除期间开始的扫描不会把已删除账号写回归档;锁释放受阻时留下可回收标记,无法读取的锁不再按路径判定,回收文件在删除持续失败时也不再增长。
14
+ - 存储:扫描在归档与接管阶段后复读删除记录,读不到时不提交账号名单;同一账号无法按签发时间排序的多条删除记录一并保留,较新的删除不会被陈旧名单覆盖。
15
+ - 存储:删除失败保留原记录并重试回滚;删除完成后才返回的续期不再把已删会话的令牌写回归档。
16
+ - 换号:WorkBuddy 上游 5xx 改用下一个账号,不再直接结束本轮。
17
+ - 账号池:轮流使用与同一对话固定账号时,输入框积分显示下一个或最近一次服务的账号。
18
+ - 账号池:Trae、Qoder 同名账号以厂商用户 ID 区分,失败挂起、偏好与签到不再串到另一个账号。
19
+ - 账号池:同一会话的重复登录只保留一个账号;清除账号列表后仍保留停用截止时间;服务器故障冷却按自身窗口结束。
20
+ - 重载:新的加载清理上一轮的失败挂起与成长记录;停用后关闭遗留的来源网关。
21
+ - 积分读数:读取余额失败后 15 秒重试,不再把一次启动失败留在缓存里直到手动刷新。
22
+ - 安全:面板登录只接受厂商自己的登录主机,上游返回其他地址时不打开。
23
+
24
+ ## [1.2.3]
25
+
26
+ - 兼容 DeepSeek Harness 0.2.2 系列,并保留 0.2.0 线与不同适配器版本中的系统提示和工具更新。
27
+ - WorkBuddy:支持字符串形式的加密登录字段;登录不可读时保留原账号,不再复制同账号的旧快照。
28
+ - 账号并发:登录、续期、删除与归档写入串行执行,避免旧扫描或另一个实例覆盖新登录。
29
+ - 安全:WorkBuddy 安装检测只接受固定本地卷上的签名文件;子进程清理不可信环境;错误与日志不保留上游回显的凭据。
30
+ - 安全:上游以数组形式回显的敏感请求头整体脱敏,数组元素含 `]`、嵌套数组或响应被截断时也不再泄漏剩余凭据。
31
+ - 恢复:设置读取按顺序应用;插件停止或重载时取消旧扫描,网关重启等待旧端口释放并登记实际监听地址。
32
+ - 存储:Windows 短暂占用凭证文件时重试原子替换,避免续期结果写入失败。
33
+ - 构建:宿主与客户端产物独立生成,重复构建时不再丢失任一入口。
34
+ - 流式输出:含工具调用的回合即使上游返回 `stop`,也按 `tool_calls` 完成。
35
+ - 换号:Trae、Qoder 返回 200 而响应体为空时,改用下一个登录。
36
+ - 换号:登录失效、余额耗尽、限流与空回合改用下一个登录;上游 5xx 按原状态返回。
37
+ - Trae:登录失效帧只有一句说明、没有错误码时,按已知措辞识别为登录失效并换号;其余措辞按上游故障返回 502。
38
+ - 签到:Qoder 两个站点的活动列表与领取走各自的接口(`openapi.qoder.sh` 与 `openapi.qoder.com.cn`),面板与自动签到按上游返回的活动进行。
39
+
3
40
  ## [1.2.2]
4
41
 
5
- - 登录:新的登录流程替换旧流程后,不再保存旧流程的结果或清除新流程。
42
+ - 登录:新的登录流程替换旧流程后,旧流程的轮询结果被丢弃,新流程已写入的登录保持不变。
6
43
  - 账号池:每次续期后重新确认账号资格,避免使用在等待期间被停用、移除或冷却的账号。
7
44
  - 隐私:关闭 WorkBuddy 或其全部区域后,刷新跳过登录凭证扫描;未完成的扫描不再回填账号或继续写入凭证。
8
45
  - 成长中心:任务取消后停止后续补签、领奖、活动上报与抽奖,不再继续消费补签卡。
@@ -16,7 +53,7 @@
16
53
 
17
54
  ## [1.2.1]
18
55
 
19
- - 签到:单账号与批量领取后立即更新账号卡片;已领取的回执按已签到处理,单账号签到遇到当日已领取时直接显示成功;已领取的活动不再遮住其后可领取的轮次;过期登录在批量签到前跳过;Trae 设备签到当天用完后,同批剩余同版本账号标记为跳过;国际版不显示签到入口与说明。
56
+ - 签到:单账号与批量领取后立即更新账号卡片;已领取的回执按已签到处理,单账号签到遇到当日已领取时直接显示成功;已领取的活动不再遮住其后可领取的轮次;过期登录在批量签到前跳过;Trae 设备签到当天用完后,同批剩余同版本账号标记为跳过;Trae 国际版不显示签到入口与说明。
20
57
  - 网关:WorkBuddy 轮换尝试数覆盖整个账号池;传输失败与首字节前断流换号,最多重试一次;空 200 流同样换号;流内失败保留上游原因与等待时间,耗尽时返回 `Retry-After`;WAF 页面不再按额度耗尽处理。
21
58
  - Qoder:只含 role 或 usage 的帧不再被当作已输出,随后的失败帧仍会触发换号;嵌套错误不覆盖外层可读原因,但嵌套的等待时间与失败类别仍会被读取;错误响应体读取有上限。
22
59
  - 安全:WorkBuddy 标准安装路径、环境变量指定的可执行文件与注册表扫描结果都必须通过 Authenticode 校验;注册表扫描不访问 UNC 或相对路径。
@@ -30,7 +67,7 @@
30
67
  ## [1.1.1]
31
68
 
32
69
  - 登录:刷新失败的账号在本轮请求内跳过,不再反复重试同一个账号;200 信封的登录失效也区分「被拒」与「刷新失败」,后者不再写 6 小时停用。
33
- - 渠道校验:11128 出现在 HTTP 200 的 JSON 信封时同样折叠系统消息并重试一次,通过的提示照常按 region 记住。
70
+ - 渠道校验:11128 出现在 HTTP 200 的 JSON 信封时同样折叠系统消息并重试一次,通过的提示照常按 region 缓存。
34
71
  - 签到:Trae、Qoder 的单账号签到在超时后继续占用守卫,避免第二次点击与仍在进行的领取并行。
35
72
  - Qoder:展示用量只带到期时间、没有可用额度时回退到 quota 路由,不再直接报「用量不可用」。
36
73
  - 设置:宿主推送的旧设置文档不再覆盖刚保存的账号停用、移除与模型选择;DSH 重载保留 provider 声明与 Trae/Qoder 目录,地址漂移按实际发布地址判断。
@@ -40,9 +77,9 @@
40
77
 
41
78
  - 登录:多处登录按签发时间取最新;续期写回插件自管文件;被拒登录先刷新重试,刷新令牌也失效才挂起 6 小时,挂起期间跳过轮询、签到、成长与保活。
42
79
  - 账号限制:11140 标注「已限制」并换号,全部受限回 403 提示申诉;11158 按账号 × 模型停用 24 小时,全部被拒回 400。
43
- - 网络:刷新超时、限流或网络故障时账号留在轮换;网络错误结束本轮,不冷却账号。
80
+ - 网络:刷新超时、限流或网络故障时账号留在轮换;网络错误只结束本轮。
44
81
  - 网关:200 信封里的账号级业务码按原因处理;缺结束帧时补 `finish_reason` 与 `[DONE]`;Trae、Qoder 等待期间发保活;路由支持查询串;空正文回 502。
45
- - 对话:国内版渠道校验(11128)拒绝提示词时,自动把系统消息并入首条用户消息并重试一次;通过的提示按 region 记住,后续轮次不再重复这次往返。移除「客户端名称」开关。
82
+ - 对话:国内版渠道校验(11128)拒绝提示词时,自动把系统消息并入首条用户消息并重试一次;通过的提示按 region 缓存,后续轮次不再重复这次往返。移除「客户端名称」开关。
46
83
  - 面板:区分「需重新登录」「已限制」与普通冷却;删除立即消失且不被桌面快照带回;签到防连点;重载后提示刷新。
47
84
  - 令牌保活:独立卡片,按签发时间续期;桌面遗留快照由插件接管,正在使用的由桌面端续期。
48
85
  - 连接检查:网关启动失败原因与端口记入报告,停用、重启与卸载时清除;重载清掉未完成的设备登录。
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 chengzhi-c
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 chengzhi-c
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md CHANGED
@@ -33,11 +33,11 @@
33
33
  <a href="https://github.com/chengzhi-c/dsh-wtq-pool/stargazers"><img src="https://img.shields.io/github/stars/chengzhi-c/dsh-wtq-pool?style=flat-square" alt="GitHub stars"></a>
34
34
  </p>
35
35
 
36
- > Unofficial clients may trigger account restrictions. Review the risks and the relevant service terms before use.
36
+ > This project is for learning use only. Unofficial clients may trigger account restrictions. Review the risks and the relevant service terms before use.
37
37
 
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.
38
+ WorkBuddy fails over when an account is rate-limited, out of quota or answered with an upstream 5xx. 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 locally with 404 or 400. 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, 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.
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. A Trae sign-in expiry can arrive as one sentence with no error code; a frame matching the known wording is read as an expired sign-in and rotated past, and any other wording is answered as upstream failure with 502.
41
41
 
42
42
  ## Preview
43
43
 
@@ -69,11 +69,11 @@ To run the preview locally, clone the repository, run `node docs/serve.cjs`, and
69
69
 
70
70
  - Reuse local sign-ins from the three desktop apps. WorkBuddy also supports Add account in the panel, which uses its official login page and saves the sign-in in the plugin's own directory.
71
71
  - Register model groups by region: each region of each vendor becomes its own provider, and several can be on at once; a region with no account is not registered. A domestic model runs only on domestic accounts, and an international model only on international ones.
72
- - Account distribution: WorkBuddy supports priority, round-robin, expiring credits first and conversation-sticky accounts, and fails over on a rate limit or exhausted quota. Trae and Qoder support priority, round-robin and expiring credits first, and move on to the next sign-in on an authentication failure, a rate limit or exhausted quota.
72
+ - Account distribution: WorkBuddy supports priority, round-robin, expiring credits first and conversation-sticky accounts, and fails over on a rate limit, exhausted quota or upstream 5xx. Trae and Qoder support priority, round-robin and expiring credits first, and move on to the next sign-in on an authentication failure, a rate limit or exhausted quota.
73
73
  - Gateway responses are SSE streams of `chat.completion.chunk`; the `stream` field in the request body does not change the format.
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.
74
+ - Credit automation: automatic check-in is off by default. When enabled, scheduled runs perform check-ins and WorkBuddy growth claims. Streak days advance through upstream conversations, so each pass posts one activity report per account before reading its tiers; a tier becomes claimable the moment it unlocks. A make-up card is spent only when yesterday is missing and a card is available. After streak tiers are claimed, available lottery draws are used. Cat travel is available only for domestic accounts.
75
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.
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.
76
+ - Composer credits: with `showComposerPoints` on, the composer toolbar shows the balance of the account behind the current model; click it to switch accounts. In round-robin and conversation-sticky modes it names the account that serves next or served last. 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.
77
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.
78
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.
79
79
 
@@ -95,11 +95,11 @@ $package = (Get-ChildItem .\dist\*.tgz | Sort-Object LastWriteTime | Select-Obje
95
95
  dsh plugin --profile desktop add $package
96
96
  ```
97
97
 
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`.
98
+ Supports DeepSeek Harness on the 0.2.0 and 0.2.2 prerelease lines (`engines.dsh` in `package.json`: `>=0.2.0-rc.1 <0.2.1-0 || >=0.2.2-rc.1 <0.2.3-0`) with its matching dependencies. npm's `latest` tag currently points to `0.2.2-rc.1`, which requires Node `>=24.9.0`; the plugin's Node requirement `^22.19.0 || >=24.0.0` also applies. The stable 0.2.2 release is not published yet; the semver range will cover it once released.
99
99
 
100
100
  > After upgrading from 1.1.x to 1.2.0, provider ids are `wtqpool-*`; reselect your model once.
101
101
 
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.
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 uses the committed `lib/` as is.
103
103
 
104
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.
105
105
 
@@ -107,24 +107,26 @@ Replace `desktop` with the profile name actually in use. If `dsh` is not on `PAT
107
107
 
108
108
  Sign in inside each vendor's desktop app, then click "Detect accounts again". WorkBuddy reads several saved sign-ins; a `$wbEncrypted` sign-in from 5.6 on is read with a key obtained from the locally installed WorkBuddy. The domestic Trae build has two sign-in slots, Trae CN and TRAE SOLO CN. Qoder keeps one sign-in per installation, so signing in again in the app overwrites the previous one. The international WorkBuddy client keeps a single sign-in file, so switching accounts overwrites the previous one. The plugin archives a sign-in as it is overwritten, and that account keeps serving until its token expires; signing it in again in the app renews it.
109
109
 
110
+ On Windows, decrypting sign-ins requires a WorkBuddy executable on a fixed local drive with a valid signature and a supported signing key. The plugin does not decrypt these sign-ins when the host runs elevated on Windows or as root on macOS or Linux. If WorkBuddy changes its signing key, update the plugin before decrypting them. On macOS the plugin runs the locally installed WorkBuddy executable to read the key without verifying its signature; only run installations you trust.
111
+
110
112
  An account can also be added without the desktop app: "Add account" in the panel's WorkBuddy header opens the vendor's login page in a new tab, and the account joins the pool once that page completes. The credential is written under `signins/` in the plugin's own data directory and takes part in distribution on the same terms as a desktop sign-in. Such an account also carries a "Delete" action, which confirms on a second press; see the Data section for what it removes. An account the desktop app is signed into right now has no Delete: that session belongs to the app. The account is added to the region currently selected, so the domestic region signs in a domestic account and the international region an international one.
111
113
 
112
- To migrate accounts left behind by another tool, write the files into that directory: `signins/` is the import format, and one `{auth, account}` document named `*.info` dropped there becomes an ordinary account on the next scan. `tools/import-signins.cjs` reads those account files (`--from` accepts files or directories) and writes them in the shape this plugin reads, skipping any account the plugin's own data directory already holds; `--dry-run` shows what would change and `--force` overwrites:
114
+ To migrate accounts left behind by another tool, write the files into that directory: `signins/` is the import format, and one `{auth, account}` document named `*.info` dropped there becomes an ordinary account on the next scan. `tools/import-signins.cjs` reads those account files (`--from` accepts files or directories) and writes them in the shape this plugin reads, skipping any account the plugin's own data directory already holds; `--dry-run` shows what would change and `--force` overwrites. The script is not shipped in the `.tgz`; clone the repository and install its development dependencies to run it:
113
115
 
114
116
  ```
115
117
  node tools/import-signins.cjs --data "<plugin data dir>" --from "<account file or directory>" [--region cn|global|all] [--dry-run] [--force]
116
118
  ```
117
119
 
118
- To back them up, copy the `signins/` directory, which already has the format a backup needs. Those files hold live tokens whose reach equals that of the account itself.
120
+ To back them up, copy the `signins/` directory. Those files hold live tokens whose reach equals that of the account itself.
119
121
 
120
- - **Account pool**: each account's label, remaining credits, quota expiry, cooldown state and check-in progress. An account can be disabled on its own or removed, and a region can be pinned to one preferred account. An account whose sign-in the upstream refused shows a "re-login needed" badge, the reason and a "held until" time; credits and check-in stay blank while held. An account the upstream restricted instead shows a "restricted" badge and a "restricted by the upstream until" stamp, is retried every six hours, and needs an appeal in the WorkBuddy console.
122
+ - **Account pool**: each account's label, remaining credits, quota expiry, cooldown state and check-in status. An account can be disabled on its own or removed, and a region can be pinned to one preferred account. An account whose sign-in the upstream refused shows a "re-login needed" badge, the reason and a "held until" time; credits and check-in stay blank while held. An account the upstream restricted instead shows a "restricted" badge and a "restricted by the upstream until" stamp, is retried every six hours, and needs an appeal in the WorkBuddy console. When two Trae or Qoder accounts share a display name, each label carries a `#` and the last eight characters of the user id.
121
123
  - **Models**: select which models this region exposes; anything unselected stays out of the model picker. The display name, context window, output limit, thinking levels and image support are editable. A model group publishes at most 64 models; any beyond that are marked "not published" while the gateway still serves them.
122
124
  - **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.
123
125
  - **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.
124
126
 
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.
127
+ 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; a Qoder round opens at the `startAt` its campaign list returns, commonly 10:00 (Beijing time). Whether a check-in appears depends on the activity state the upstream returns for that account. An account whose sign-in the upstream refused is skipped in that round.
126
128
 
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.
129
+ The domestic WorkBuddy host reads the system and assistant turns for wording that belongs to a client it does not serve, and answers 11128 (channel check failed), whether the refusal arrives as HTTP 400 or as a JSON envelope with HTTP 200. When it lands, the plugin retries once: the system messages fold into the first user message, a `developer` role folds into `system`, the client name in assistant history becomes `DeepSeek`, and the request keeps one neutral system message. An accepted prompt is cached 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.
128
130
 
129
131
  "Refresh now" reports refreshed, already fresh, failed and without a refresh token separately.
130
132
 
@@ -172,13 +174,13 @@ The PI-Desktop edition uses a separate port range starting at 41831. Both editio
172
174
 
173
175
  ## Data and outbound requests
174
176
 
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`, so other local processes can call them and spend account quota. The panel accepts loopback requests only.
177
+ 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`, so other local processes can call them and spend account quota. The panel accepts loopback requests only. The plugin is designed for a single-user desktop and does not separate other OS users on the same machine; use separate OS accounts on a shared machine.
176
178
 
177
- The plugin's own data directory, `~/.dsh/dsh-wtq-pool/` (or `$DSH_HOME/dsh-wtq-pool/` 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.
179
+ The plugin's own data directory, `~/.dsh/dsh-wtq-pool/` (or `$DSH_HOME/dsh-wtq-pool/` when set), holds four data files. An interrupted archive, delete-record or sign-in write can leave temporary files behind: writing the same file again clears leftovers older than ten minutes, and a scan does the same for sign-in temps in the plugin's own directory; deleting an account removes its sign-in temps with it. `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, a delete time and a random record id, so a scan cannot take the same superseded snapshot back over from the desktop app; a scan clears the entry after the account signs in again with a different token and a newer issue time; deletes for one account that cannot be ordered by issue time are kept together, so a stale one cannot replace a newer one; a record written by 1.2.3 matches only by token digest and is not cleared automatically. These files carry no additional encryption; access is bounded by the operating system's file ACLs.
178
180
 
179
181
  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.
180
182
 
181
- The plugin sends requests only to the vendor endpoints; panel links open only when clicked.
183
+ The plugin sends requests only to the vendor endpoints; panel links open only when clicked. A login page URL is accepted only on the vendor's own hosts.
182
184
 
183
185
  Tokens go only to the hosts below:
184
186
 
package/README.md CHANGED
@@ -33,11 +33,13 @@
33
33
  <a href="https://github.com/chengzhi-c/dsh-wtq-pool/stargazers"><img src="https://img.shields.io/github/stars/chengzhi-c/dsh-wtq-pool?style=flat-square" alt="GitHub stars"></a>
34
34
  </p>
35
35
 
36
- > 使用非官方客户端可能触发厂商的账号风控或限制。请评估相关风险,并遵守对应服务的使用条款。
36
+ > 本项目仅供学习使用。使用非官方客户端可能触发厂商的账号风控或限制。请评估相关风险,并遵守对应服务的使用条款。
37
37
 
38
- 把本机 WorkBuddy、Trae、Qoder 的桌面登录接入 DeepSeek Harness。WorkBuddy 在账号被限流或额度用尽时自动换号;Trae、Qoder 按请求选择账号,认证失败、限流或余额耗尽时改用下一个登录重试,模型不存在、请求体非法这类请求自身的问题则按上游原样返回。三个来源各自开关,国内与国际账号分别成组。
38
+ 把本机 WorkBuddy、Trae、Qoder 的桌面登录接入 DeepSeek Harness。WorkBuddy 在账号被限流或额度用尽时自动换号;Trae、Qoder 按请求选择账号,认证失败、限流或余额耗尽时改用下一个登录重试,模型不在目录里、请求体不是合法 JSON 或缺 model 这类请求自身的问题,网关在本地直接返回 404 或 400,不占用账号。三个来源各自开关,国内与国际账号分别成组。
39
39
 
40
- 限流按上游给出的等待时间冷却,上游未给出时按配置的窗口。额度用尽与登录失效不会自行恢复,账号退出轮换:额度用尽的挂起在余额重新读到后释放,登录失效的挂起在刷新成功、重新登录或手动重置冷却后释放,两者都在六小时后(WorkBuddy 侧)到期。积分、签到状态、模型目录与手动签到这些非流式读取遇到登录失效,会先强制刷新令牌并重试一次:刷新令牌还有效的账号当场恢复,不退出轮换;刷新令牌同样失效的才挂起。Trae、Qoder 的失败挂起另计:只按冷却窗口(默认 60 秒,最长可配到 24 小时)或上游给出的等待时间降权,池中只剩它一个时仍会使用。上游主机不可达时跳过该账号并尝试下一个;连续两个账号都不可达时结束本轮并报告网络错误。上游判定账号套餐不含某模型(11158)时,该账号的这个模型停用 24 小时,其他模型照常服务;全部账号都不含该模型时按 400 返回。
40
+ Trae 的登录失效有时不带错误码、只给一句说明。插件按已知的英文措辞识别这种帧并换号;其余措辞按上游故障返回 502。
41
+
42
+ 限流按上游给出的等待时间冷却,上游未给出时按配置的窗口。上游 5xx 改用下一个登录。额度用尽与登录失效不会自行恢复,账号退出轮换:额度用尽的挂起在余额重新读到后释放,登录失效的挂起在刷新成功、重新登录或手动重置冷却后释放,两者都在六小时后(WorkBuddy 侧)到期。积分、签到状态、模型目录与手动签到这些非流式读取遇到登录失效,会先强制刷新令牌并重试一次:刷新令牌还有效的账号当场恢复,不退出轮换;刷新令牌同样失效的才挂起。Trae、Qoder 的失败挂起另计:只按冷却窗口(默认 60 秒,最长可配到 24 小时)或上游给出的等待时间降权,池中只剩它一个时仍会使用。上游主机不可达时跳过该账号并尝试下一个;连续两个账号都不可达时结束本轮并报告网络错误。上游判定账号套餐不含某模型(11158)时,该账号的这个模型停用 24 小时,其他模型照常服务;全部账号都不含该模型时按 400 返回。
41
43
 
42
44
  ## 预览
43
45
 
@@ -69,11 +71,11 @@
69
71
 
70
72
  - 复用本机登录:读取三家桌面 App 已保存的登录文件。WorkBuddy 另支持在面板「添加账号」,通过官方登录页授权后将登录保存到插件自管目录。
71
73
  - 按 region 注册模型分组:三家厂商各自的 region 各注册为一个 provider,可同时启用;没有账号的 region 不注册。国内模型只走国内账号,国际版模型只走国际账号。
72
- - 账号分发:WorkBuddy 支持先用一个账号、轮流使用、临期积分优先和同一对话固定一个账号,并在限流或额度用尽时自动换号;Trae、Qoder 支持优先使用、轮流使用与临期积分优先,认证失败、限流或余额耗尽时改用下一个登录重试。
74
+ - 账号分发:WorkBuddy 支持先用一个账号、轮流使用、临期积分优先和同一对话固定一个账号,并在限流、额度用尽或上游 5xx 时自动换号;Trae、Qoder 支持优先使用、轮流使用与临期积分优先,认证失败、限流或余额耗尽时改用下一个登录重试。
73
75
  - 网关以 SSE 返回 `chat.completion.chunk`;请求体里的 `stream` 字段不改变响应格式。
74
- - 积分自动化:自动签到默认关闭。开启后的定时任务与「立即运行」执行同一轮,包含三家签到、WorkBuddy 的连登奖励和猫猫旅行。连登天数由上游按对话推进,该轮在每个账号读取连登档位前先补发一次对话活动上报,因此档位到点即可解锁领取,用户无需再进 WorkBuddy 发一句消息。连登环节还会在昨日漏签且持有补签卡时自动补签以保住连续天数,领取一次性的新手礼包与活动补偿,并在兑换解锁的档位后把由此获得的抽奖次数抽完。这些成长步骤国内版与国际版都执行;猫猫旅行只跑国内账号,国际版没有对应接口。
76
+ - 积分自动化:自动签到默认关闭。开启后的定时任务与「立即运行」执行同一轮,包含三家签到、WorkBuddy 的连登奖励和猫猫旅行。连登天数由上游按对话推进,该轮在每个账号读取连登档位前先补发一次对话活动上报,因此档位到点即可解锁领取。连登环节还会在昨日漏签且持有补签卡时自动补签以保住连续天数,领取一次性的新手礼包与活动补偿,并在兑换解锁的档位后把由此获得的抽奖次数抽完。这些成长步骤国内版与国际版都执行;猫猫旅行仅用于国内账号。
75
77
  - 登录令牌保活:独立卡片,按需执行。桌面端留下的登录快照在扫描时并入插件自己的登录目录,由插件接管续期;桌面端正在使用的登录由桌面端续期。「立即刷新」处理插件自管的副本,按签发时间判断:签发满 6 小时的刷新,距到期不足 5 分钟的同样刷新。刷新结果写回插件自己的登录文件,登录被上游拒绝时当天即可发现。同一账号在多处留有登录时按签发时间取最新的一份。停用账号、已停用的 region 与登录已被上游拒绝的账号不参与。
76
- - 输入框积分:开启 `showComposerPoints` 后,输入框工具栏显示当前模型所用账号的余额,点开可换号。功能关闭后浮层隐藏,读数降为每 5 分钟一次,重新开启后无需切换模型即可恢复。
78
+ - 输入框积分:开启 `showComposerPoints` 后,输入框工具栏显示当前模型所用账号的余额,点开可换号。轮流使用与同一对话固定账号时,显示下一个或最近一次服务该模型的账号。功能关闭后浮层隐藏,读数降为每 5 分钟一次,重新开启后无需切换模型即可恢复。
77
79
  - 面板:账号与池状态、模型勾选、连接检查、成长中心都在插件页的「账号池」卡片内。模型目录在启动时加载,缓存过期后按需刷新,空闲时不轮询。停用的账号与登录已被上游拒绝的账号不参与探测。
78
80
  - 连接检查:每条发现都带判定。网关没有监听、模型目录读取失败、发布的地址与实际绑定的不一致、provider 未被宿主接受,都算失败并给出需要修改的内容。网关启动失败时给出原因,面板按地址漂移提示重新加载插件。检查自身出错也记一条发现,报告照常给出其余结果。
79
81
 
@@ -95,11 +97,11 @@ $package = (Get-ChildItem .\dist\*.tgz | Sort-Object LastWriteTime | Select-Obje
95
97
  dsh plugin --profile desktop add $package
96
98
  ```
97
99
 
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`。
100
+ 需要 DeepSeek Harness 0.2.0 与 0.2.2 两条预发布线(`package.json` 的 `engines.dsh`:`>=0.2.0-rc.1 <0.2.1-0 || >=0.2.2-rc.1 <0.2.3-0`)与 Node `^22.19.0 || >=24.0.0`。npm 的 `latest` 目前指向 `0.2.2-rc.1`,该宿主要求 Node `>=24.9.0`;插件自身的 Node 要求 `^22.19.0 || >=24.0.0` 同样适用。0.2.2 稳定版尚未发布,发布后上述版本范围会覆盖它。
99
101
 
100
102
  > 从 1.1.x 升级到 1.2.0 后,模型提供商 ID 改为 `wtqpool-*`,请在模型选择里重新选一次。
101
103
 
102
- 请将 `desktop` 替换为实际使用的 profile 名。若 `dsh` 不在 `PATH` 中,改用安装目录中的 CLI。也可按 npm 包名 `dsh-wtq-pool` 或仓库地址安装;按仓库地址安装时 pnpm 会通过 `prepare` 脚本从源码构建,需要在 profile 的 `pnpm-workspace.yaml` 中写入 `allowBuilds: dsh-wtq-pool: true`,并固定在某个 commit 上。
104
+ 请将 `desktop` 替换为实际使用的 profile 名。若 `dsh` 不在 `PATH` 中,改用安装目录中的 CLI。也可按 npm 包名 `dsh-wtq-pool` 或仓库地址安装;仓库地址安装直接使用已提交的 `lib/`。
103
105
 
104
106
  **面板位置**:在侧边栏进入 **插件**,打开 **dsh-wtq-pool** 卡片(或其旁的 **配置**),完整面板嵌在该卡片内。模型分组未出现时,按面板顶部的提示重新加载插件。
105
107
 
@@ -107,24 +109,26 @@ dsh plugin --profile desktop add $package
107
109
 
108
110
  在各家桌面 App 中登录,再点面板的「重新检测账号」。WorkBuddy 支持读取多个已保存的登录,需要多个账号就在 App 里逐个登录;5.6 起的 `$wbEncrypted` 登录由插件向本机已安装的 WorkBuddy 索取密钥后读取。Trae 国内版有 Trae CN 与 TRAE SOLO CN 两个登录位;Qoder 每个安装只保存一个登录,在 App 里重新登录会覆盖前一个。WorkBuddy 国际版只有一个登录文件,切换账号会直接覆盖上一个。插件在扫描时为被覆盖的登录留档,该账号照常参与分发,直到它的令牌到期;在 App 里重新登录即可续期。
109
111
 
112
+ Windows 下解密登录时,插件只使用固定本地磁盘上签名有效且签名公钥受支持的 WorkBuddy。宿主以管理员权限运行时,以及 macOS 或 Linux 下以 root 运行时,不解密这类登录。若 WorkBuddy 更换签名公钥,需更新插件后才能解密。macOS 下插件直接执行本机安装的 WorkBuddy 应用进程读取密钥,不校验其签名;只应执行你信任的安装。
113
+
110
114
  没有桌面 App 也可以添加账号:面板 WorkBuddy 标题栏的「添加账号」在新标签页中打开官方登录页,登录完成后该账号即加入账号池。凭证写在插件自管目录的 `signins/` 下,与桌面登录同等参与分发。这类账号在面板上另有「删除」,按两次确认;删除范围见「数据」一节。桌面端正在登录的账号不给删除,那份会话属于桌面端。添加的账号属于当前选中的 region,国内版登国内号,国际版登国际号。
111
115
 
112
- 迁移其他工具留下的账号,直接向该目录写入文件即可:`signins/` 本身就是导入导出格式,放入一份以 `.info` 结尾的 `{auth, account}` 登录文件,下次扫描即作为一个普通账号。仓库中的 `tools/import-signins.cjs` 读取其他工具留下的账号文件(`--from` 接受文件或目录),按本插件识别的形状写入 `signins/`,默认跳过本插件数据目录里已有的账号,`--dry-run` 先查看,`--force` 才覆盖:
116
+ 迁移其他工具留下的账号,直接向该目录写入文件即可:`signins/` 本身就是导入导出格式,放入一份以 `.info` 结尾的 `{auth, account}` 登录文件,下次扫描即作为一个普通账号。仓库中的 `tools/import-signins.cjs` 读取其他工具留下的账号文件(`--from` 接受文件或目录),按本插件识别的形状写入 `signins/`,默认跳过本插件数据目录里已有的账号,`--dry-run` 先查看,`--force` 才覆盖。该脚本不随 `.tgz` 分发,需要克隆仓库并安装开发依赖后运行:
113
117
 
114
118
  ```
115
119
  node tools/import-signins.cjs --data <插件数据目录> --from <账号文件或目录> [--region cn|global|all] [--dry-run] [--force]
116
120
  ```
117
121
 
118
- 需要备份时直接复制 `signins/` 目录,它已经是备份应有的格式;这些文件持有完整可用的令牌,其权能与账号本身相同。
122
+ 备份即复制 `signins/` 目录;这些文件持有完整可用的令牌,其权能与账号本身相同。
119
123
 
120
- - **账号池**:每个账号的标签、剩余积分、额度到期时间、冷却状态与签到进度。可单独停用某个账号、将其移除,或指定某个 region 优先使用哪个账号。登录被上游拒绝的账号另显示「需重新登录」徽标、拒绝原因与「暂停至」时间,挂起期间积分与签到留空。被上游判定异常使用的账号另显示「已限制」徽标与「被上游限制,直至」时间,六小时重试一次,需要到官方后台申诉。
124
+ - **账号池**:每个账号的标签、剩余积分、额度到期时间、冷却状态与签到进度。可单独停用某个账号、将其移除,或指定某个 region 优先使用哪个账号。登录被上游拒绝的账号另显示「需重新登录」徽标、拒绝原因与「暂停至」时间,挂起期间积分与签到留空。被上游判定异常使用的账号另显示「已限制」徽标与「被上游限制,直至」时间,六小时重试一次,需要到官方后台申诉。Trae、Qoder 两个账号重名时,名称后带 `#` 与用户 ID 后 8 位,用于区分。
121
125
  - **模型**:勾选该 region 要暴露的模型,未勾选的模型不进入模型选择器。可修改显示名、上下文窗口、输出上限、思考等级与贴图支持。一个模型组最多发布 64 个模型,超出部分标记为「未发布」,网关仍会服务它们。
122
126
  - **连接检查**:逐条报告网关是否监听、模型目录读到几个、注册的地址与实际绑定的是否一致、每个 provider 是否被宿主接受,并可复制整份报告。
123
127
  - **成长中心**:仅对 WorkBuddy 生效。页面按账号逐行列出,展开一行可见该账号的连登档位。「读取状态」读取当前档位与可领取项;「立即执行」产生领取并执行成长环节,按步骤报告结果。登录被上游拒绝的账号在该轮被跳过。
124
128
 
125
- 签到可对单个账号执行,也可在标题栏一次领完该来源。自动签到默认关闭,开启后默认于 09:00(北京时间)执行;当天错过的时段在当天内的下一次启动仍会补领,跨天则不补。Trae 的每日签到每台设备限领一次;Qoder 国内版的新一轮于每天 10:00(北京时间)开放。WorkBuddy、Trae、Qoder 的国际版没有每日签到,面板不显示签到入口。登录被上游拒绝的账号在该轮被跳过。
129
+ 签到可对单个账号执行,也可在标题栏一次领完该来源。自动签到默认关闭,开启后默认于 09:00(北京时间)执行;当天错过的时段在当天内的下一次启动仍会补领,跨天则不补。Trae 的每日签到每台设备限领一次;Qoder 的活动开放时间以活动列表返回的 `startAt` 为准,常见为每天 10:00(北京时间)。是否显示签到取决于上游对该账号返回的活动状态。登录被上游拒绝的账号在该轮被跳过。
126
130
 
127
- WorkBuddy 国内版上游会拒绝「客户端身份写着 DeepSeek Harness」的对话请求(返回 11128,渠道校验未通过)。插件遇到这条拒绝时,会把系统消息并入首条用户消息并重试一次;助手历史里的客户端名称也会移除,因为渠道校验同样读取助手消息。通过的提示按 region 记住,同一段提示之后不再重复这次往返。签到、成长中心与保活走各自的接口。
131
+ WorkBuddy 国内版上游会检查 system 与助手轮次里的措辞,命中属于它不服务的客户端的措辞时返回 11128(渠道校验未通过)。插件收到这条拒绝后重试一次:系统消息并入首条用户消息,`developer` 角色并入 system,助手历史里的客户端名称替换为 `DeepSeek`,请求仍保留一条中性系统消息。通过的提示按 region 缓存,同一段提示之后不再重复这次往返。签到、成长中心与保活走各自的接口。
128
132
 
129
133
  「立即刷新」的结果按刷新、已是最新、失败、无刷新令牌分项报告。
130
134
 
@@ -172,13 +176,13 @@ PI-Desktop 版使用 41831 开头的独立端口,两版可以同时安装,
172
176
 
173
177
  ## 数据与出网
174
178
 
175
- 读取三家 App 的本机登录文件。provider 通过运行时注册接入,插件设置由宿主持久化至 profile。令牌由插件保管,只发往对应厂商的接口。网关监听 `127.0.0.1`,同机其他进程可调用并消耗账号额度;面板只接受本机回环请求。
179
+ 读取三家 App 的本机登录文件。provider 通过运行时注册接入,插件设置由宿主持久化至 profile。令牌由插件保管,只发往对应厂商的接口。网关监听 `127.0.0.1`,同机其他进程可调用并消耗账号额度;面板只接受本机回环请求。插件按单用户桌面环境设计,不区分本机其他系统用户;多人共用的机器应使用独立系统账户隔离。
176
180
 
177
- 插件自管数据目录 `~/.dsh/dsh-wtq-pool/`(设置了 `DSH_HOME` 时为 `$DSH_HOME/dsh-wtq-pool/`)包含四个文件(写删除记录时会短暂多一个 `deleted-signins.json.lock`)。`checkin-slots.json` 记录已领取的签到时段和待重试的 Qoder 时点,时段只保留三天。`doctor.txt` 是最近一次连接检查的报告,逐项记录通过与否,不列账号标签。`credentials-archive.json` 留存被切号覆盖的登录,含访问令牌、刷新令牌、账号标识(昵称、uin/uid、企业 ID)与本机登录文件路径;按令牌到期时间保留,到期后再过 30 天清除,没有到期时间的记录保留到该账号被删除。`deleted-signins.json` 记录已删除的登录,只存令牌摘要、该登录的签发时间与删除时间,用来阻止扫描把桌面端遗留的同一份快照重新接管回来;同一个账号重新登录后(签发时间更新)该记录自动失效。上述文件未额外加密,访问权限由操作系统文件 ACL 决定。
181
+ 插件自管数据目录 `~/.dsh/dsh-wtq-pool/`(设置了 `DSH_HOME` 时为 `$DSH_HOME/dsh-wtq-pool/`)包含四个文件(写归档或删除记录时会短暂出现对应的 `.lock` 文件;写入归档、删除记录或登录文件中断时可能留下临时文件:再次写入同一文件时会清理超过十分钟的残留,登录临时文件由扫描按同一时限清理;删除账号会连同该账号的临时文件一并清除)。`checkin-slots.json` 记录已领取的签到时段和待重试的 Qoder 时点,时段只保留三天。`doctor.txt` 是最近一次连接检查的报告,逐项记录通过与否,不列账号标签。`credentials-archive.json` 留存被切号覆盖的登录,含访问令牌、刷新令牌、账号标识(昵称、uin/uid、企业 ID)与本机登录文件路径;按令牌到期时间保留,到期后再过 30 天清除,没有到期时间的记录保留到该账号被删除。`deleted-signins.json` 记录已删除的登录,只存令牌摘要、该登录的签发时间、删除时间与一个随机记录标识,用来阻止扫描把桌面端遗留的同一份快照重新接管回来;桌面端重新登录该账号后(令牌不同且签发时间更新),下一次扫描会清除该记录;同一账号的多条删除记录若无法按签发时间排序,会一并保留,避免较早的删除覆盖较新的记录;1.2.3 写入的旧记录只按令牌摘要匹配,不会自动清除。上述文件未额外加密,访问权限由操作系统文件 ACL 决定。
178
182
 
179
183
  插件写入的登录都在同目录的 `signins/`:面板添加的、接管桌面端快照的、续期后的副本。文件名带账号的计费身份,与桌面登录同等参与分发。这些文件同样未额外加密,访问权限由操作系统文件 ACL 决定。在面板中「删除」该账号会连同 `credentials-archive.json` 里的留档一起清除,桌面端遗留的同一份快照随之失效;重新登录该账号即解除。「移除」只是停用,可在「已移除的账号」中恢复。
180
184
 
181
- 插件只向三家厂商的接口发起请求;面板外链仅在用户点击时打开。
185
+ 插件只向三家厂商的接口发起请求;面板外链仅在用户点击时打开。登录页地址只接受厂商自己的域名。
182
186
 
183
187
  令牌只会发往以下主机:
184
188
 
package/lib/client.js CHANGED
@@ -556,26 +556,26 @@ window.__ModuleLoader__.load({
556
556
  "row.title": "WTQ Pool",
557
557
  "row.desc": "把本机 WorkBuddy、Trae、Qoder 的桌面登录合并成一个会自动换号的模型池。",
558
558
  "card.title": "账号池",
559
- "card.hint": "下方是完整面板:账号、模型选择、签到与连接检查都在这一页里。",
560
559
  "card.open": "重新载入面板",
561
560
  "card.frameTitle": "账号池面板",
562
561
  "card.missing": "面板资源没有装好,重新安装这个插件即可。",
563
- "card.probeFailed": "面板没有打开:"
562
+ "card.probeFailed": "面板没有打开:",
563
+ "card.networkError": "网络连接失败"
564
564
  };
565
565
  const en = {
566
566
  "row.title": "WTQ Pool",
567
567
  "row.desc": "Merges this machine’s WorkBuddy, Trae and Qoder desktop sign-ins into one model pool that fails over on its own.",
568
568
  "card.title": "Account pool",
569
- "card.hint": "The full panel sits below: accounts, model selection, check-in and the connection check are all on this page.",
570
569
  "card.open": "Reload panel",
571
570
  "card.frameTitle": "Account pool panel",
572
571
  "card.missing": "The panel assets are missing; reinstalling this plugin restores them.",
573
- "card.probeFailed": "The panel did not open:"
572
+ "card.probeFailed": "The panel did not open:",
573
+ "card.networkError": "Network error"
574
574
  };
575
575
  /**
576
576
  * The embedded panel.
577
577
  *
578
- * of the Plugins page and the Plugins page's out of the panel: the panel was
578
+ * The frame keeps the panel's page and the Plugins page apart: the panel was
579
579
  * written as a whole page, and the frame is the boundary that lets it stay one.
580
580
  *
581
581
  * The frame is only mounted for the full page. The row's inline summary is asked
@@ -637,9 +637,13 @@ window.__ModuleLoader__.load({
637
637
  setProbeFailure(`HTTP ${response.status}`);
638
638
  });
639
639
  }).catch(() => {
640
- if (!live || remaining > 1) return;
640
+ if (!live) return;
641
+ if (remaining > 1) {
642
+ setTimeout(() => probe(remaining - 1), 500);
643
+ return;
644
+ }
641
645
  setMissing(true);
642
- setProbeFailure(null);
646
+ setProbeFailure(t("card.networkError"));
643
647
  });
644
648
  };
645
649
  probe(attempts);
@@ -661,7 +665,7 @@ window.__ModuleLoader__.load({
661
665
  return () => window.clearInterval(timer);
662
666
  }, [view, generation]);
663
667
  if (view === "summary") return react.createElement("p", { style: SUMMARY_STYLE }, t("row.desc"));
664
- return react.createElement("section", { style: CARD_STYLE }, react.createElement("header", { style: HEAD_STYLE }, react.createElement("div", null, react.createElement("strong", null, t("card.title")), react.createElement("p", { style: HINT_STYLE }, t("card.hint"))), react.createElement("button", {
668
+ return react.createElement("section", { style: CARD_STYLE }, react.createElement("header", { style: HEAD_STYLE }, react.createElement("div", null, react.createElement("strong", null, t("card.title"))), react.createElement("button", {
665
669
  type: "button",
666
670
  style: BUTTON_STYLE,
667
671
  onClick: () => {
@@ -698,11 +702,6 @@ window.__ModuleLoader__.load({
698
702
  justifyContent: "space-between",
699
703
  gap: 12
700
704
  };
701
- const HINT_STYLE = {
702
- margin: "4px 0 0",
703
- opacity: .7,
704
- fontSize: 12
705
- };
706
705
  const BUTTON_STYLE = {
707
706
  flex: "0 0 auto",
708
707
  cursor: "pointer"