dsh-wtq-pool 1.2.3 → 1.3.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 +34 -0
- package/LICENSE +21 -21
- package/README.en.md +15 -15
- package/README.md +16 -14
- package/lib/client.js +8 -13
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1308 -363
- package/package.json +4 -7
- package/renderer/panel.css +2 -2
- package/renderer/panel.js +28 -27
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# 更新说明
|
|
2
2
|
|
|
3
|
+
## [1.3.1]
|
|
4
|
+
|
|
5
|
+
- 账号池:两个区域共用一个账号池时,轮流使用与同一对话固定账号的轮转位置按区域分开;跳过刷新失败的登录后仍会轮到每个账号,两个区域也不会重复落在同一个账号上。
|
|
6
|
+
- 输入框积分:已有会话中点击读数可以正常打开换号弹窗,滚动或缩放窗口时不再报错。
|
|
7
|
+
- 积分读数:额度耗尽的账号在冷却期间仍会读取余额,充值后下一次读取即可解除挂起,面板的刷新判断不再把它当作无需更新。
|
|
8
|
+
- 积分读数:手动刷新后按最新结果重新计时,未读到的余额不会等满五分钟;请求未返回时切换模型或提供商,弹窗不再停留在切换中。
|
|
9
|
+
- 换号:登录失效返回 200 且刷新令牌成功、会话仍然失效时,该账号挂起并改用下一个,不再反复刷新同一账号。
|
|
10
|
+
- 模型:Trae、Qoder 保存的默认思考等级会写入声明,选中该模型时按设置的等级发送,不再回落到目录默认值。
|
|
11
|
+
- 换号:上游主机不可达时,尚未失败的网关仍有尝试机会,不再因同域名的连续超时错过健康账号。
|
|
12
|
+
- 账号池:同一对话固定账号命中时刷新使用顺序,长时间对话不会因绑定上限被换到新账号;不同区域的同名对话不再共用绑定。
|
|
13
|
+
- 设置:写入与当前值相同时不再影响对宿主修改的判断,插件保存后宿主刚做的修改不再丢失。
|
|
14
|
+
- 面板:登录链接缺失时按界面语言提示,不再显示英文原文。
|
|
15
|
+
|
|
16
|
+
## [1.3.0]
|
|
17
|
+
|
|
18
|
+
- 账号池:升级前的停用、移除、保底与偏好设置按旧账号 ID 继续生效。
|
|
19
|
+
- 账号池:关闭一个区域不再改变另一区域账号的名称,失败挂起与签到记录不丢失。
|
|
20
|
+
- 稳定性:模型列表读取失败按网关限量重试;刷新期间到达的设置变更在下一轮生效。
|
|
21
|
+
- 换号:WAF 页面按上游故障冷却,不再计入限流次数或拉长下一次限流窗口。
|
|
22
|
+
- 账号池:删除一个账号不再清掉同名账号仍在使用的旧版归档记录。
|
|
23
|
+
- 安全:面板日志与错误回显脱敏账号标识和 Cookie;账号文件按 0600、目录按 0700 创建(Windows 上由文件 ACL 决定),中断写入的临时登录文件会被清理。
|
|
24
|
+
- 存储:Windows 上锁文件处于删除挂起时改为等待重试,归档写入不再丢条目;持续拒绝写入时按超时失败。
|
|
25
|
+
- 存储:删除与续期同时发生时,续期得到的令牌不再写回已删除账号的文件或归档。
|
|
26
|
+
- 存储:删除期间开始的扫描不会把已删除账号写回归档;锁释放受阻时留下可回收标记,无法读取的锁不再按路径判定,回收文件在删除持续失败时也不再增长。
|
|
27
|
+
- 存储:扫描在归档与接管阶段后复读删除记录,读不到时不提交账号名单;同一账号无法按签发时间排序的多条删除记录一并保留,较新的删除不会被陈旧名单覆盖。
|
|
28
|
+
- 存储:删除失败保留原记录并重试回滚;删除完成后才返回的续期不再把已删会话的令牌写回归档。
|
|
29
|
+
- 换号:WorkBuddy 上游 5xx 改用下一个账号,不再直接结束本轮。
|
|
30
|
+
- 账号池:轮流使用与同一对话固定账号时,输入框积分显示下一个或最近一次服务的账号。
|
|
31
|
+
- 账号池:Trae、Qoder 同名账号以厂商用户 ID 区分,失败挂起、偏好与签到不再串到另一个账号。
|
|
32
|
+
- 账号池:同一会话的重复登录只保留一个账号;清除账号列表后仍保留停用截止时间;服务器故障冷却按自身窗口结束。
|
|
33
|
+
- 重载:新的加载清理上一轮的失败挂起与成长记录;停用后关闭遗留的来源网关。
|
|
34
|
+
- 积分读数:读取余额失败后 15 秒重试,不再把一次启动失败留在缓存里直到手动刷新。
|
|
35
|
+
- 安全:面板登录只接受厂商自己的登录主机,上游返回其他地址时不打开。
|
|
36
|
+
|
|
3
37
|
## [1.2.3]
|
|
4
38
|
|
|
5
39
|
- 兼容 DeepSeek Harness 0.2.2 系列,并保留 0.2.0 线与不同适配器版本中的系统提示和工具更新。
|
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
|
-
WorkBuddy fails over when an account is rate-limited
|
|
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
|
|
40
|
+
A rate limit cools for the wait the upstream stated, or the configured window when it stated none. An upstream 5xx moves the turn on to the next sign-in. Exhausted quota and a dead sign-in do not recover on their own: that account leaves rotation. A balance read that finds credits releases an exhausted-quota hold; a successful token refresh, a fresh sign-in or a manual cooldown reset releases a refused-sign-in hold. Both lapse at six hours at the latest (WorkBuddy). The non-stream requests for 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 keeps going while a sign-in belongs to a gateway that has not failed yet, and ends with a network error only once every gateway has. 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
|
|
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. When enabled, scheduled runs perform check-ins
|
|
74
|
+
- Credit automation: automatic check-in is off by default. When enabled, scheduled runs and "Run now" perform the same pass: check-ins for all three sources, WorkBuddy streak claims and cat travel. 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. The pass also claims the one-time newbie gift and campaign compensation, spends a make-up card only when yesterday is missing, and uses the lottery draws an unlocked tier grants. These growth steps run on both domestic and international accounts; cat travel is domestic only.
|
|
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. The two WorkBuddy regions are listed as two providers, `WTQ Pool (CN)` and `WTQ Pool (Global)`; each publishes the catalogue its own gateway serves, and the readout resolves the selected provider and follows this plugin's models only. In round-robin and conversation-sticky modes the readout 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
|
|
|
@@ -99,7 +99,7 @@ Supports DeepSeek Harness on the 0.2.0 and 0.2.2 prerelease lines (`engines.dsh`
|
|
|
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
|
|
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,11 +107,11 @@ 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.
|
|
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
111
|
|
|
112
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.
|
|
113
113
|
|
|
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:
|
|
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:
|
|
115
115
|
|
|
116
116
|
```
|
|
117
117
|
node tools/import-signins.cjs --data "<plugin data dir>" --from "<account file or directory>" [--region cn|global|all] [--dry-run] [--force]
|
|
@@ -119,7 +119,7 @@ node tools/import-signins.cjs --data "<plugin data dir>" --from "<account file o
|
|
|
119
119
|
|
|
120
120
|
To back them up, copy the `signins/` directory. Those files hold live tokens whose reach equals that of the account itself.
|
|
121
121
|
|
|
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.
|
|
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.
|
|
123
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.
|
|
124
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.
|
|
125
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.
|
|
@@ -142,7 +142,7 @@ Every key below is editable in the plugin page or the DSH settings page and save
|
|
|
142
142
|
| `sourceWorkbuddy` / `sourceTrae` / `sourceQoder` | `true` | Off: that source is not scanned, published or requested |
|
|
143
143
|
| `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 |
|
|
144
144
|
| `sourceDistributions` | `{}` | Trae/Qoder distribution: `priority` / `round-robin` / `expiry`; unset behaves as `priority` |
|
|
145
|
-
| `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 |
|
|
145
|
+
| `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 up to six hours instead, and a balance read that finds credits releases a spent hold sooner |
|
|
146
146
|
| `creditReserves` | `{}` | Per-account credit floor, keyed by account id; an account at or below its floor is not distributed to |
|
|
147
147
|
| `authFile` | `""` | WorkBuddy sign-in file path; every `.info` sign-in in its directory is scanned. Empty discovers it |
|
|
148
148
|
| `autoCheckin` | `{"enabled":false,"hours":[9]}` | Automatic check-in switch and times; `hours` are Beijing-time hours, empty means 09:00 |
|
|
@@ -174,13 +174,13 @@ The PI-Desktop edition uses a separate port range starting at 41831. Both editio
|
|
|
174
174
|
|
|
175
175
|
## Data and outbound requests
|
|
176
176
|
|
|
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.
|
|
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.
|
|
178
178
|
|
|
179
|
-
The plugin's own data directory, `~/.dsh/dsh-wtq-pool/` (or `$DSH_HOME/dsh-wtq-pool/` when set), holds four data files.
|
|
179
|
+
The plugin's own data directory, `~/.dsh/dsh-wtq-pool/` (or `$DSH_HOME/dsh-wtq-pool/` when set), holds four data files. Writing an archive or delete record briefly creates the matching `.lock` file. 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. On Windows the directory inherits its parent's permissions, so keep it somewhere only the current user can write.
|
|
180
180
|
|
|
181
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.
|
|
182
182
|
|
|
183
|
-
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.
|
|
184
184
|
|
|
185
185
|
Tokens go only to the hosts below:
|
|
186
186
|
|
|
@@ -193,7 +193,7 @@ Tokens go only to the hosts below:
|
|
|
193
193
|
```sh
|
|
194
194
|
pnpm install
|
|
195
195
|
pnpm run build # emits lib/ (host half as ESM, client half as CJS)
|
|
196
|
-
pnpm run typecheck # host
|
|
196
|
+
pnpm run typecheck # entry, panel and client (src/host.ts is excluded)
|
|
197
197
|
pnpm run typecheck:client
|
|
198
198
|
pnpm test # Node's own test runner, offline regressions
|
|
199
199
|
```
|
package/README.md
CHANGED
|
@@ -33,13 +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
38
|
把本机 WorkBuddy、Trae、Qoder 的桌面登录接入 DeepSeek Harness。WorkBuddy 在账号被限流或额度用尽时自动换号;Trae、Qoder 按请求选择账号,认证失败、限流或余额耗尽时改用下一个登录重试,模型不在目录里、请求体不是合法 JSON 或缺 model 这类请求自身的问题,网关在本地直接返回 404 或 400,不占用账号。三个来源各自开关,国内与国际账号分别成组。
|
|
39
39
|
|
|
40
40
|
Trae 的登录失效有时不带错误码、只给一句说明。插件按已知的英文措辞识别这种帧并换号;其余措辞按上游故障返回 502。
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
限流按上游给出的等待时间冷却,上游未给出时按配置的窗口。上游 5xx 改用下一个登录。额度用尽与登录失效不会自行恢复,账号退出轮换:额度用尽的挂起在重新读到有余额后释放,登录失效的挂起在刷新成功、重新登录或手动重置冷却后释放,两者都以六小时为上限(WorkBuddy 侧)。积分、签到状态、模型目录与手动签到这些非流式请求遇到登录失效,会先强制刷新令牌并重试一次:刷新令牌还有效的账号当场恢复,不退出轮换;刷新令牌同样失效的才挂起。Trae、Qoder 的失败挂起另计:只按冷却窗口(默认 60 秒,最长可配到 24 小时)或上游给出的等待时间降权,池中只剩它一个时仍会使用。上游主机不可达时跳过该账号并尝试下一个;连续两个账号都不可达后,只要还有登录属于尚未失败的网关就继续尝试,所有网关都失败才结束本轮并报告网络错误。上游判定账号套餐不含某模型(11158)时,该账号的这个模型停用 24 小时,其他模型照常服务;全部账号都不含该模型时按 400 返回。
|
|
43
43
|
|
|
44
44
|
## 预览
|
|
45
45
|
|
|
@@ -71,12 +71,12 @@ Trae 的登录失效有时不带错误码、只给一句说明。插件按已知
|
|
|
71
71
|
|
|
72
72
|
- 复用本机登录:读取三家桌面 App 已保存的登录文件。WorkBuddy 另支持在面板「添加账号」,通过官方登录页授权后将登录保存到插件自管目录。
|
|
73
73
|
- 按 region 注册模型分组:三家厂商各自的 region 各注册为一个 provider,可同时启用;没有账号的 region 不注册。国内模型只走国内账号,国际版模型只走国际账号。
|
|
74
|
-
- 账号分发:WorkBuddy
|
|
74
|
+
- 账号分发:WorkBuddy 支持先用一个账号、轮流使用、临期积分优先和同一对话固定一个账号,并在限流、额度用尽或上游 5xx 时自动换号;Trae、Qoder 支持优先使用、轮流使用与临期积分优先,认证失败、限流或余额耗尽时改用下一个登录重试。
|
|
75
75
|
- 网关以 SSE 返回 `chat.completion.chunk`;请求体里的 `stream` 字段不改变响应格式。
|
|
76
76
|
- 积分自动化:自动签到默认关闭。开启后的定时任务与「立即运行」执行同一轮,包含三家签到、WorkBuddy 的连登奖励和猫猫旅行。连登天数由上游按对话推进,该轮在每个账号读取连登档位前先补发一次对话活动上报,因此档位到点即可解锁领取。连登环节还会在昨日漏签且持有补签卡时自动补签以保住连续天数,领取一次性的新手礼包与活动补偿,并在兑换解锁的档位后把由此获得的抽奖次数抽完。这些成长步骤国内版与国际版都执行;猫猫旅行仅用于国内账号。
|
|
77
77
|
- 登录令牌保活:独立卡片,按需执行。桌面端留下的登录快照在扫描时并入插件自己的登录目录,由插件接管续期;桌面端正在使用的登录由桌面端续期。「立即刷新」处理插件自管的副本,按签发时间判断:签发满 6 小时的刷新,距到期不足 5 分钟的同样刷新。刷新结果写回插件自己的登录文件,登录被上游拒绝时当天即可发现。同一账号在多处留有登录时按签发时间取最新的一份。停用账号、已停用的 region 与登录已被上游拒绝的账号不参与。
|
|
78
|
-
- 输入框积分:开启 `showComposerPoints`
|
|
79
|
-
-
|
|
78
|
+
- 输入框积分:开启 `showComposerPoints` 后,输入框工具栏显示当前模型所用账号的余额,点开可换号。国内版与国际版各自发布所在网关的模型目录,分别列为 `WTQ Pool (CN)` 与 `WTQ Pool (Global)` 两个提供商;积分浮层按当前选中的提供商确认归属,只跟随本插件的模型。轮流使用与同一对话固定账号时,浮层显示下一个或最近一次服务该模型的账号。功能关闭后浮层隐藏,读数降为每 5 分钟一次,重新开启后无需切换模型即可恢复。
|
|
79
|
+
- 面板:账号与池状态、模型勾选、连接检查、成长中心都在插件页的「账号池(dsh-wtq-pool)」卡片内。模型目录在启动时加载,缓存过期后按需刷新,空闲时不轮询。停用的账号与登录已被上游拒绝的账号不参与探测。
|
|
80
80
|
- 连接检查:每条发现都带判定。网关没有监听、模型目录读取失败、发布的地址与实际绑定的不一致、provider 未被宿主接受,都算失败并给出需要修改的内容。网关启动失败时给出原因,面板按地址漂移提示重新加载插件。检查自身出错也记一条发现,报告照常给出其余结果。
|
|
81
81
|
|
|
82
82
|
## 安装
|
|
@@ -97,11 +97,11 @@ $package = (Get-ChildItem .\dist\*.tgz | Sort-Object LastWriteTime | Select-Obje
|
|
|
97
97
|
dsh plugin --profile desktop add $package
|
|
98
98
|
```
|
|
99
99
|
|
|
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`。
|
|
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 稳定版尚未发布,发布后上述版本范围会覆盖它。
|
|
101
101
|
|
|
102
102
|
> 从 1.1.x 升级到 1.2.0 后,模型提供商 ID 改为 `wtqpool-*`,请在模型选择里重新选一次。
|
|
103
103
|
|
|
104
|
-
请将 `desktop` 替换为实际使用的 profile 名。若 `dsh` 不在 `PATH` 中,改用安装目录中的 CLI。也可按 npm 包名 `dsh-wtq-pool`
|
|
104
|
+
请将 `desktop` 替换为实际使用的 profile 名。若 `dsh` 不在 `PATH` 中,改用安装目录中的 CLI。也可按 npm 包名 `dsh-wtq-pool` 或仓库地址安装;仓库地址安装直接使用已提交的 `lib/`。
|
|
105
105
|
|
|
106
106
|
**面板位置**:在侧边栏进入 **插件**,打开 **dsh-wtq-pool** 卡片(或其旁的 **配置**),完整面板嵌在该卡片内。模型分组未出现时,按面板顶部的提示重新加载插件。
|
|
107
107
|
|
|
@@ -109,9 +109,11 @@ dsh plugin --profile desktop add $package
|
|
|
109
109
|
|
|
110
110
|
在各家桌面 App 中登录,再点面板的「重新检测账号」。WorkBuddy 支持读取多个已保存的登录,需要多个账号就在 App 里逐个登录;5.6 起的 `$wbEncrypted` 登录由插件向本机已安装的 WorkBuddy 索取密钥后读取。Trae 国内版有 Trae CN 与 TRAE SOLO CN 两个登录位;Qoder 每个安装只保存一个登录,在 App 里重新登录会覆盖前一个。WorkBuddy 国际版只有一个登录文件,切换账号会直接覆盖上一个。插件在扫描时为被覆盖的登录留档,该账号照常参与分发,直到它的令牌到期;在 App 里重新登录即可续期。
|
|
111
111
|
|
|
112
|
+
Windows 下解密登录时,插件只使用固定本地磁盘上签名有效且签名公钥受支持的 WorkBuddy。宿主以管理员权限运行时,以及 macOS 或 Linux 下以 root 运行时,不解密这类登录。若 WorkBuddy 更换签名公钥,需更新插件后才能解密。macOS 下插件直接执行本机安装的 WorkBuddy 应用进程读取密钥,不校验其签名;只应执行你信任的安装。
|
|
113
|
+
|
|
112
114
|
没有桌面 App 也可以添加账号:面板 WorkBuddy 标题栏的「添加账号」在新标签页中打开官方登录页,登录完成后该账号即加入账号池。凭证写在插件自管目录的 `signins/` 下,与桌面登录同等参与分发。这类账号在面板上另有「删除」,按两次确认;删除范围见「数据」一节。桌面端正在登录的账号不给删除,那份会话属于桌面端。添加的账号属于当前选中的 region,国内版登国内号,国际版登国际号。
|
|
113
115
|
|
|
114
|
-
迁移其他工具留下的账号,直接向该目录写入文件即可:`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` 分发,需要克隆仓库并安装开发依赖后运行:
|
|
115
117
|
|
|
116
118
|
```
|
|
117
119
|
node tools/import-signins.cjs --data <插件数据目录> --from <账号文件或目录> [--region cn|global|all] [--dry-run] [--force]
|
|
@@ -119,7 +121,7 @@ node tools/import-signins.cjs --data <插件数据目录> --from <账号文件
|
|
|
119
121
|
|
|
120
122
|
备份即复制 `signins/` 目录;这些文件持有完整可用的令牌,其权能与账号本身相同。
|
|
121
123
|
|
|
122
|
-
- **账号池**:每个账号的标签、剩余积分、额度到期时间、冷却状态与签到进度。可单独停用某个账号、将其移除,或指定某个 region 优先使用哪个账号。登录被上游拒绝的账号另显示「需重新登录」徽标、拒绝原因与「暂停至」时间,挂起期间积分与签到留空。被上游判定异常使用的账号另显示「已限制」徽标与「被上游限制,直至」时间,六小时重试一次,需要到官方后台申诉。
|
|
124
|
+
- **账号池**:每个账号的标签、剩余积分、额度到期时间、冷却状态与签到进度。可单独停用某个账号、将其移除,或指定某个 region 优先使用哪个账号。登录被上游拒绝的账号另显示「需重新登录」徽标、拒绝原因与「暂停至」时间,挂起期间积分与签到留空。被上游判定异常使用的账号另显示「已限制」徽标与「被上游限制,直至」时间,六小时重试一次,需要到官方后台申诉。Trae、Qoder 两个账号重名时,名称后带 `#` 与用户 ID 后 8 位,用于区分。
|
|
123
125
|
- **模型**:勾选该 region 要暴露的模型,未勾选的模型不进入模型选择器。可修改显示名、上下文窗口、输出上限、思考等级与贴图支持。一个模型组最多发布 64 个模型,超出部分标记为「未发布」,网关仍会服务它们。
|
|
124
126
|
- **连接检查**:逐条报告网关是否监听、模型目录读到几个、注册的地址与实际绑定的是否一致、每个 provider 是否被宿主接受,并可复制整份报告。
|
|
125
127
|
- **成长中心**:仅对 WorkBuddy 生效。页面按账号逐行列出,展开一行可见该账号的连登档位。「读取状态」读取当前档位与可领取项;「立即执行」产生领取并执行成长环节,按步骤报告结果。登录被上游拒绝的账号在该轮被跳过。
|
|
@@ -142,7 +144,7 @@ WorkBuddy 国内版上游会检查 system 与助手轮次里的措辞,命中
|
|
|
142
144
|
| `sourceWorkbuddy` / `sourceTrae` / `sourceQoder` | `true` | 关闭后该来源不扫描、不发布、不请求 |
|
|
143
145
|
| `distribution` | `priority` | WorkBuddy 池的发放方式:`priority` 先用一个账号,`round-robin` 均摊,`expiry` 优先消耗临期积分,`sticky` 同一对话固定 |
|
|
144
146
|
| `sourceDistributions` | `{}` | Trae、Qoder 的分发方式:`priority` / `round-robin` / `expiry`;未设时按 `priority` |
|
|
145
|
-
| `cooldownSeconds` | `60` | 限流冷却时长。上游报出重置时间时以它为准;没有重置时间时,连续限流会让它逐次翻倍,封顶 15 分钟(窗口本身超过 15 分钟时不再翻倍)。上游给出的重置时间最长按 2 小时计;余额耗尽或登录被上游拒绝另按 6
|
|
147
|
+
| `cooldownSeconds` | `60` | 限流冷却时长。上游报出重置时间时以它为准;没有重置时间时,连续限流会让它逐次翻倍,封顶 15 分钟(窗口本身超过 15 分钟时不再翻倍)。上游给出的重置时间最长按 2 小时计;余额耗尽或登录被上游拒绝另按 6 小时停用,额度耗尽的挂起在读到有余额时提前解除 |
|
|
146
148
|
| `creditReserves` | `{}` | 按账号 id 设定的积分保底,余额不高于它的账号不参与分发 |
|
|
147
149
|
| `authFile` | `""` | WorkBuddy 登录文件路径;扫描其所在目录的全部 `.info` 登录,留空则自动发现 |
|
|
148
150
|
| `autoCheckin` | `{"enabled":false,"hours":[9]}` | 自动签到的开关与时点;`hours` 为北京时间整点,留空用 09:00 |
|
|
@@ -174,13 +176,13 @@ PI-Desktop 版使用 41831 开头的独立端口,两版可以同时安装,
|
|
|
174
176
|
|
|
175
177
|
## 数据与出网
|
|
176
178
|
|
|
177
|
-
读取三家 App 的本机登录文件。provider 通过运行时注册接入,插件设置由宿主持久化至 profile。令牌由插件保管,只发往对应厂商的接口。网关监听 `127.0.0.1
|
|
179
|
+
读取三家 App 的本机登录文件。provider 通过运行时注册接入,插件设置由宿主持久化至 profile。令牌由插件保管,只发往对应厂商的接口。网关监听 `127.0.0.1`,同机其他进程可调用并消耗账号额度;面板只接受本机回环请求。插件按单用户桌面环境设计,不区分本机其他系统用户;多人共用的机器应使用独立系统账户隔离。
|
|
178
180
|
|
|
179
|
-
插件自管数据目录 `~/.dsh/dsh-wtq-pool/`(设置了 `DSH_HOME` 时为 `$DSH_HOME/dsh-wtq-pool
|
|
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 决定;在 Windows 上数据目录会继承父目录的权限,请把它放在仅当前用户可写的位置。
|
|
180
182
|
|
|
181
183
|
插件写入的登录都在同目录的 `signins/`:面板添加的、接管桌面端快照的、续期后的副本。文件名带账号的计费身份,与桌面登录同等参与分发。这些文件同样未额外加密,访问权限由操作系统文件 ACL 决定。在面板中「删除」该账号会连同 `credentials-archive.json` 里的留档一起清除,桌面端遗留的同一份快照随之失效;重新登录该账号即解除。「移除」只是停用,可在「已移除的账号」中恢复。
|
|
182
184
|
|
|
183
|
-
|
|
185
|
+
插件只向三家厂商的接口发起请求;面板外链仅在用户点击时打开。登录页地址只接受厂商自己的域名。
|
|
184
186
|
|
|
185
187
|
令牌只会发往以下主机:
|
|
186
188
|
|
|
@@ -193,7 +195,7 @@ PI-Desktop 版使用 41831 开头的独立端口,两版可以同时安装,
|
|
|
193
195
|
```sh
|
|
194
196
|
pnpm install
|
|
195
197
|
pnpm run build # 产出 lib/(宿主半为 ESM,客户端半为 CJS)
|
|
196
|
-
pnpm run typecheck #
|
|
198
|
+
pnpm run typecheck # 入口、面板与客户端(src/host.ts 不在检查范围内)
|
|
197
199
|
pnpm run typecheck:client
|
|
198
200
|
pnpm test # Node 自带测试,离线回归
|
|
199
201
|
```
|
package/lib/client.js
CHANGED
|
@@ -28,6 +28,7 @@ window.__ModuleLoader__.load({
|
|
|
28
28
|
//#endregion
|
|
29
29
|
let react = require("react");
|
|
30
30
|
react = __toESM(react, 1);
|
|
31
|
+
let react_dom = require("react-dom");
|
|
31
32
|
//#region src/panel-route.ts
|
|
32
33
|
/**
|
|
33
34
|
* The panel's route prefix.
|
|
@@ -250,7 +251,7 @@ window.__ModuleLoader__.load({
|
|
|
250
251
|
.xd-points-btn{border:0;background:transparent;color:inherit;font:inherit;font-size:12px;line-height:1;display:inline-flex;align-items:center;gap:5px;padding:4px 7px;border-radius:999px;cursor:pointer;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
251
252
|
.xd-points-btn:hover{background:var(--dsw-alias-bg-layer-3,rgba(127,127,127,.12))}
|
|
252
253
|
.xd-points-mark{display:inline-block;width:6px;height:6px;flex:0 0 auto;border-radius:50%;background:var(--dsw-alias-state-success-primary,#4f9f7c)}
|
|
253
|
-
.xd-points-panel{position:fixed;z-index:
|
|
254
|
+
.xd-points-panel{position:fixed;z-index:1100;box-sizing:border-box;width:max-content;max-width:${PANEL_MAX_WIDTH}px;max-height:${PANEL_MAX_HEIGHT}px;overflow:auto;padding:8px;border-radius:12px;background:var(--dsw-alias-bg-layer-2,#1c1d21);color:var(--dsw-alias-label-primary,#e8e8ea);box-shadow:0 8px 28px rgba(0,0,0,.28);border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25))}
|
|
254
255
|
.xd-points-table{width:100%;border-collapse:collapse;font-size:11px;line-height:1.4}
|
|
255
256
|
.xd-points-table th{text-align:left;font-weight:600;padding:4px 6px;color:var(--dsw-alias-label-tertiary,#8b8d93)}
|
|
256
257
|
.xd-points-table td{padding:4px 6px;vertical-align:top}
|
|
@@ -378,7 +379,7 @@ window.__ModuleLoader__.load({
|
|
|
378
379
|
if (!open) return void 0;
|
|
379
380
|
const onPointer = (event) => {
|
|
380
381
|
const target = event.target;
|
|
381
|
-
if (target
|
|
382
|
+
if (!(target instanceof Node)) return;
|
|
382
383
|
if (rootRef.current?.contains(target) === true) return;
|
|
383
384
|
if (panelRef.current?.contains(target) === true) return;
|
|
384
385
|
setOpen(false);
|
|
@@ -388,7 +389,7 @@ window.__ModuleLoader__.load({
|
|
|
388
389
|
};
|
|
389
390
|
const onViewport = (event) => {
|
|
390
391
|
const target = event.target;
|
|
391
|
-
if (target
|
|
392
|
+
if (target instanceof Node && panelRef.current?.contains(target) === true) return;
|
|
392
393
|
setOpen(false);
|
|
393
394
|
};
|
|
394
395
|
document.addEventListener("pointerdown", onPointer, true);
|
|
@@ -469,6 +470,7 @@ window.__ModuleLoader__.load({
|
|
|
469
470
|
if (routeRef.current !== requestedRoute) return;
|
|
470
471
|
setRefreshing(false);
|
|
471
472
|
if (next.show === true) setPoints(next);
|
|
473
|
+
restartPollRef.current();
|
|
472
474
|
}).catch((failure) => {
|
|
473
475
|
if (routeRef.current !== requestedRoute) return;
|
|
474
476
|
setRefreshing(false);
|
|
@@ -489,7 +491,7 @@ window.__ModuleLoader__.load({
|
|
|
489
491
|
}, react.createElement("span", {
|
|
490
492
|
className: "xd-points-mark",
|
|
491
493
|
"aria-hidden": "true"
|
|
492
|
-
}), balance === void 0 ? "—" : formatCredits(balance)), open && rect !== null ? react.createElement("div", {
|
|
494
|
+
}), balance === void 0 ? "—" : formatCredits(balance)), open && rect !== null && typeof document !== "undefined" ? (0, react_dom.createPortal)(react.createElement("div", {
|
|
493
495
|
className: "xd-points-panel",
|
|
494
496
|
ref: panelRef,
|
|
495
497
|
role: "dialog",
|
|
@@ -512,7 +514,7 @@ window.__ModuleLoader__.load({
|
|
|
512
514
|
title: account.label ?? "",
|
|
513
515
|
disabled: account.active === true || busy,
|
|
514
516
|
onClick: () => pick(account)
|
|
515
|
-
}, account.label ?? "—")), react.createElement("td", null, typeof account.total === "number" ? formatCredits(account.total) : account.plan ?? "—", points.source === "qoder" && Array.isArray(account.packages) ? react.createElement("ul", { className: "xd-points-packs" }, account.packages.map((pack, index) => react.createElement("li", { key: index }, packageText(pack, t)))) : null)))))) : null);
|
|
517
|
+
}, account.label ?? "—")), react.createElement("td", null, typeof account.total === "number" ? formatCredits(account.total) : account.plan ?? "—", points.source === "qoder" && Array.isArray(account.packages) ? react.createElement("ul", { className: "xd-points-packs" }, account.packages.map((pack, index) => react.createElement("li", { key: index }, packageText(pack, t)))) : null)))))), document.body) : null);
|
|
516
518
|
}
|
|
517
519
|
//#endregion
|
|
518
520
|
//#region src/ids.ts
|
|
@@ -556,7 +558,6 @@ window.__ModuleLoader__.load({
|
|
|
556
558
|
"row.title": "WTQ Pool",
|
|
557
559
|
"row.desc": "把本机 WorkBuddy、Trae、Qoder 的桌面登录合并成一个会自动换号的模型池。",
|
|
558
560
|
"card.title": "账号池",
|
|
559
|
-
"card.hint": "下方是完整面板:账号、模型选择、签到与连接检查都在这一页里。",
|
|
560
561
|
"card.open": "重新载入面板",
|
|
561
562
|
"card.frameTitle": "账号池面板",
|
|
562
563
|
"card.missing": "面板资源没有装好,重新安装这个插件即可。",
|
|
@@ -567,7 +568,6 @@ window.__ModuleLoader__.load({
|
|
|
567
568
|
"row.title": "WTQ Pool",
|
|
568
569
|
"row.desc": "Merges this machine’s WorkBuddy, Trae and Qoder desktop sign-ins into one model pool that fails over on its own.",
|
|
569
570
|
"card.title": "Account pool",
|
|
570
|
-
"card.hint": "The full panel sits below: accounts, model selection, check-in and the connection check are all on this page.",
|
|
571
571
|
"card.open": "Reload panel",
|
|
572
572
|
"card.frameTitle": "Account pool panel",
|
|
573
573
|
"card.missing": "The panel assets are missing; reinstalling this plugin restores them.",
|
|
@@ -667,7 +667,7 @@ window.__ModuleLoader__.load({
|
|
|
667
667
|
return () => window.clearInterval(timer);
|
|
668
668
|
}, [view, generation]);
|
|
669
669
|
if (view === "summary") return react.createElement("p", { style: SUMMARY_STYLE }, t("row.desc"));
|
|
670
|
-
return react.createElement("section", { style: CARD_STYLE }, react.createElement("header", { style: HEAD_STYLE }, react.createElement("div", null, react.createElement("strong", null, t("card.title"))
|
|
670
|
+
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", {
|
|
671
671
|
type: "button",
|
|
672
672
|
style: BUTTON_STYLE,
|
|
673
673
|
onClick: () => {
|
|
@@ -704,11 +704,6 @@ window.__ModuleLoader__.load({
|
|
|
704
704
|
justifyContent: "space-between",
|
|
705
705
|
gap: 12
|
|
706
706
|
};
|
|
707
|
-
const HINT_STYLE = {
|
|
708
|
-
margin: "4px 0 0",
|
|
709
|
-
opacity: .7,
|
|
710
|
-
fontSize: 12
|
|
711
|
-
};
|
|
712
707
|
const BUTTON_STYLE = {
|
|
713
708
|
flex: "0 0 auto",
|
|
714
709
|
cursor: "pointer"
|
package/lib/index.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ interface Config {
|
|
|
69
69
|
preferredAccountIds?: Record<string, string>;
|
|
70
70
|
/** Picked Trae/Qoder account per region. */
|
|
71
71
|
preferredSourceAccounts?: Record<string, string>;
|
|
72
|
-
/** Accounts removed from the pool
|
|
72
|
+
/** Accounts removed from the pool, with their label and region kept so the panel can restore them. */
|
|
73
73
|
removedAccounts?: unknown[];
|
|
74
74
|
/** Whether the credits readout is shown beside the composer. */
|
|
75
75
|
showComposerPoints?: boolean;
|