dsh-wtq-pool 1.2.0 → 1.2.2
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 +23 -0
- package/README.en.md +20 -15
- package/README.md +20 -15
- package/lib/index.js +682 -281
- package/package.json +12 -9
- package/renderer/index.html +1 -1
- package/renderer/panel.css +2 -1
- package/renderer/panel.js +168 -85
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# 更新说明
|
|
2
2
|
|
|
3
|
+
## [1.2.2]
|
|
4
|
+
|
|
5
|
+
- 登录:新的登录流程替换旧流程后,不再保存旧流程的结果或清除新流程。
|
|
6
|
+
- 账号池:每次续期后重新确认账号资格,避免使用在等待期间被停用、移除或冷却的账号。
|
|
7
|
+
- 隐私:关闭 WorkBuddy 或其全部区域后,刷新跳过登录凭证扫描;未完成的扫描不再回填账号或继续写入凭证。
|
|
8
|
+
- 成长中心:任务取消后停止后续补签、领奖、活动上报与抽奖,不再继续消费补签卡。
|
|
9
|
+
- WorkBuddy:补齐或折叠系统消息时使用非空内容,兼容 Kimi 3.1 的消息校验,避免空系统消息触发 11151。
|
|
10
|
+
- 账号发现:手动重新检测会在当前扫描结束后重新读取,避免漏掉刚新增的登录。
|
|
11
|
+
- 流式输出:WorkBuddy 在 `[DONE]` 前补齐缺失的结束帧,正确处理分块结束标记与未分隔的尾帧;工具调用补用 `tool_calls` 结束原因。
|
|
12
|
+
- 签到:单账号签到显示领取结果并更新状态;批量签到显示脱敏后的首个失败原因,Qoder 的不可重试拒绝不再安排补领。
|
|
13
|
+
- 安全:本地预览只提供必要的公开资源,拒绝非回环 Host,不再公开仓库内部文件。
|
|
14
|
+
- 面板与文档:调整风险提示与悬停标签对比度,明确两版独立存储和共享凭证的续期限制。
|
|
15
|
+
- 依赖:更新 Zod 与 fast-uri 的兼容补丁,修复开发依赖中的已知安全问题。
|
|
16
|
+
|
|
17
|
+
## [1.2.1]
|
|
18
|
+
|
|
19
|
+
- 签到:单账号与批量领取后立即更新账号卡片;已领取的回执按已签到处理,单账号签到遇到当日已领取时直接显示成功;已领取的活动不再遮住其后可领取的轮次;过期登录在批量签到前跳过;Trae 设备签到当天用完后,同批剩余同版本账号标记为跳过;国际版不显示签到入口与说明。
|
|
20
|
+
- 网关:WorkBuddy 轮换尝试数覆盖整个账号池;传输失败与首字节前断流换号,最多重试一次;空 200 流同样换号;流内失败保留上游原因与等待时间,耗尽时返回 `Retry-After`;WAF 页面不再按额度耗尽处理。
|
|
21
|
+
- Qoder:只含 role 或 usage 的帧不再被当作已输出,随后的失败帧仍会触发换号;嵌套错误不覆盖外层可读原因,但嵌套的等待时间与失败类别仍会被读取;错误响应体读取有上限。
|
|
22
|
+
- 安全:WorkBuddy 标准安装路径、环境变量指定的可执行文件与注册表扫描结果都必须通过 Authenticode 校验;注册表扫描不访问 UNC 或相对路径。
|
|
23
|
+
- 隐私:日志中的账号标签改为短哈希,令牌、路径与邮箱在写入前统一脱敏;面板登录只打开 https 链接。
|
|
24
|
+
- 面板:初始语言跟随宿主;全部账号停用时健康点不再显示正常;键盘操作后焦点回到原控件;账号控件与模型字段提供可访问名称,签到按钮的名称与可见文字一致;成长记录按最新一次运行显示;登录过期后签到按钮不可点;批量签到结束后清除进行中提示;Qoder 时间标注北京时间;深色删除确认按钮对比度修正。
|
|
25
|
+
|
|
3
26
|
## [1.2.0]
|
|
4
27
|
|
|
5
28
|
- 品牌:模型提供商 ID 由 `xdpool-*` 改为 `wtqpool-*`;升级后模型选择需要重新选一次。
|
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
|
-
>
|
|
36
|
+
> Unofficial clients may trigger account restrictions. Review the risks and the relevant service terms before use.
|
|
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
|
|
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
|

|
|
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
|
|
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
|

|
|
55
55
|
|
|
@@ -63,15 +63,11 @@ Live preview: <https://chengzhi-c.github.io/dsh-wtq-pool/>.
|
|
|
63
63
|
|
|
64
64
|

|
|
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
|
-

|
|
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
|
|
73
69
|
|
|
74
|
-
- Reuse
|
|
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.
|
|
75
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.
|
|
76
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.
|
|
77
73
|
- Gateway responses are SSE streams of `chat.completion.chunk`; the `stream` field in the request body does not change the format.
|
|
@@ -83,7 +79,16 @@ To run the preview locally, clone the repository, run `node docs/serve.cjs`, and
|
|
|
83
79
|
|
|
84
80
|
## Install
|
|
85
81
|
|
|
86
|
-
For a local package, run
|
|
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
|
|
@@ -117,7 +122,7 @@ To back them up, copy the `signins/` directory, which already has the format a b
|
|
|
117
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.
|
|
118
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.
|
|
119
124
|
|
|
120
|
-
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.
|
|
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
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
|
|
|
@@ -163,15 +168,15 @@ These are the preferred ports. When one is taken, the gateway binds an ephemeral
|
|
|
163
168
|
|
|
164
169
|
When another process takes a port between the reservation and the listen, that gateway's start fails: its model group is dropped, the connection check reports the reason, and the panel surfaces address drift. Requests reach the new address only after the plugin is reloaded and the host re-reads its declaration.
|
|
165
170
|
|
|
166
|
-
The PI-Desktop edition uses a separate range starting at 41831
|
|
171
|
+
The PI-Desktop edition uses a separate port range starting at 41831. Both editions can be installed together, but settings and credentials are stored separately and are not synchronized. If both use the same WorkBuddy sign-in, upstream refresh-token rotation may invalidate the other copy. When an edition asks for a new sign-in, add the account again there rather than overwriting it with old `signins/` files. The editions may show different token expiry times.
|
|
167
172
|
|
|
168
173
|
## Data and outbound requests
|
|
169
174
|
|
|
170
|
-
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
|
|
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.
|
|
171
176
|
|
|
172
|
-
The plugin's own data directory, `~/.dsh/dsh-wtq-pool/` (or `$DSH_HOME
|
|
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.
|
|
173
178
|
|
|
174
|
-
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.
|
|
175
180
|
|
|
176
181
|
The plugin sends requests only to the vendor endpoints; panel links open only when clicked.
|
|
177
182
|
|
|
@@ -198,7 +203,7 @@ The host-agnostic core:
|
|
|
198
203
|
| Module | Responsibility |
|
|
199
204
|
| --- | --- |
|
|
200
205
|
| `loopback.ts` | The loopback security model (Host and Origin checks), response writing, stream relay and message redaction |
|
|
201
|
-
| `accounts.ts` | WorkBuddy sign-in parsing,
|
|
206
|
+
| `accounts.ts` | WorkBuddy sign-in parsing, the account pool and its cooldowns |
|
|
202
207
|
| `upstream.ts` | The WorkBuddy upstream client, error classification, rate-limit reset parsing |
|
|
203
208
|
| `catalog.ts` | The model catalogue and its static fallback list |
|
|
204
209
|
| `shim.ts` | The WorkBuddy gateway's OpenAI-compatible endpoint |
|
package/README.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
|
-
>
|
|
36
|
+
> 使用非官方客户端可能触发厂商的账号风控或限制。请评估相关风险,并遵守对应服务的使用条款。
|
|
37
37
|
|
|
38
38
|
把本机 WorkBuddy、Trae、Qoder 的桌面登录接入 DeepSeek Harness。WorkBuddy 在账号被限流或额度用尽时自动换号;Trae、Qoder 按请求选择账号,认证失败、限流或余额耗尽时改用下一个登录重试,模型不存在、请求体非法这类请求自身的问题则按上游原样返回。三个来源各自开关,国内与国际账号分别成组。
|
|
39
39
|
|
|
40
|
-
限流按上游给出的等待时间冷却,上游未给出时按配置的窗口。额度用尽与登录失效不会自行恢复,账号退出轮换:额度用尽的挂起在余额重新读到后释放,登录失效的挂起在刷新成功、重新登录或手动重置冷却后释放,两者都在六小时后(WorkBuddy 侧)到期。积分、签到状态、模型目录与手动签到这些非流式读取遇到登录失效,会先强制刷新令牌并重试一次:刷新令牌还有效的账号当场恢复,不退出轮换;刷新令牌同样失效的才挂起。Trae、Qoder 的失败挂起另计:只按冷却窗口(默认 60 秒,最长可配到 24
|
|
40
|
+
限流按上游给出的等待时间冷却,上游未给出时按配置的窗口。额度用尽与登录失效不会自行恢复,账号退出轮换:额度用尽的挂起在余额重新读到后释放,登录失效的挂起在刷新成功、重新登录或手动重置冷却后释放,两者都在六小时后(WorkBuddy 侧)到期。积分、签到状态、模型目录与手动签到这些非流式读取遇到登录失效,会先强制刷新令牌并重试一次:刷新令牌还有效的账号当场恢复,不退出轮换;刷新令牌同样失效的才挂起。Trae、Qoder 的失败挂起另计:只按冷却窗口(默认 60 秒,最长可配到 24 小时)或上游给出的等待时间降权,池中只剩它一个时仍会使用。上游主机不可达时跳过该账号并尝试下一个;连续两个账号都不可达时结束本轮并报告网络错误。上游判定账号套餐不含某模型(11158)时,该账号的这个模型停用 24 小时,其他模型照常服务;全部账号都不含该模型时按 400 返回。
|
|
41
41
|
|
|
42
42
|
## 预览
|
|
43
43
|
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
|
|
50
50
|

|
|
51
51
|
|
|
52
|
-
模型页编辑每个模型的显示与发布参数。Trae 目录给出的默认窗口因模型而异(116k 至 400k
|
|
52
|
+
模型页编辑每个模型的显示与发布参数。Trae 目录给出的默认窗口因模型而异(116k 至 400k);未声明更大档位的模型,按 1M 发布上限。Trae 目录给出费率的模型带 `x0.79` 形式的费率标签;目录未给出费率的模型以及全部 Qoder 模型均不标注:
|
|
53
53
|
|
|
54
54
|

|
|
55
55
|
|
|
@@ -63,15 +63,11 @@
|
|
|
63
63
|
|
|
64
64
|

|
|
65
65
|
|
|
66
|
-
开启 `showComposerPoints` 后,输入框工具栏显示当前模型所用账号的积分,点击可查看该组账号并切换。下图为实际输入框扩展的离屏渲染:
|
|
67
|
-
|
|
68
|
-

|
|
69
|
-
|
|
70
66
|
本地预览需先克隆仓库,运行 `node docs/serve.cjs`,再打开它输出的地址。该页面不能用 `file://` 打开,因为浏览器不允许它读取同目录下的面板文件。
|
|
71
67
|
|
|
72
68
|
## 功能
|
|
73
69
|
|
|
74
|
-
- 复用本机登录:读取三家桌面 App
|
|
70
|
+
- 复用本机登录:读取三家桌面 App 已保存的登录文件。WorkBuddy 另支持在面板「添加账号」,通过官方登录页授权后将登录保存到插件自管目录。
|
|
75
71
|
- 按 region 注册模型分组:三家厂商各自的 region 各注册为一个 provider,可同时启用;没有账号的 region 不注册。国内模型只走国内账号,国际版模型只走国际账号。
|
|
76
72
|
- 账号分发:WorkBuddy 支持先用一个账号、轮流使用、临期积分优先和同一对话固定一个账号,并在限流或额度用尽时自动换号;Trae、Qoder 支持优先使用、轮流使用与临期积分优先,认证失败、限流或余额耗尽时改用下一个登录重试。
|
|
77
73
|
- 网关以 SSE 返回 `chat.completion.chunk`;请求体里的 `stream` 字段不改变响应格式。
|
|
@@ -83,7 +79,16 @@
|
|
|
83
79
|
|
|
84
80
|
## 安装
|
|
85
81
|
|
|
86
|
-
|
|
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
|
|
@@ -117,7 +122,7 @@ node tools/import-signins.cjs --data <插件数据目录> --from <账号文件
|
|
|
117
122
|
- **连接检查**:逐条报告网关是否监听、模型目录读到几个、注册的地址与实际绑定的是否一致、每个 provider 是否被宿主接受,并可复制整份报告。
|
|
118
123
|
- **成长中心**:仅对 WorkBuddy 生效。页面按账号逐行列出,展开一行可见该账号的连登档位。「读取状态」读取当前档位与可领取项;「立即执行」产生领取并执行成长环节,按步骤报告结果。登录被上游拒绝的账号在该轮被跳过。
|
|
119
124
|
|
|
120
|
-
签到可对单个账号执行,也可在标题栏一次领完该来源。自动签到默认关闭,开启后默认于 09:00(北京时间)执行;当天错过的时段在当天内的下一次启动仍会补领,跨天则不补。Trae 的每日签到每台设备限领一次;Qoder
|
|
125
|
+
签到可对单个账号执行,也可在标题栏一次领完该来源。自动签到默认关闭,开启后默认于 09:00(北京时间)执行;当天错过的时段在当天内的下一次启动仍会补领,跨天则不补。Trae 的每日签到每台设备限领一次;Qoder 国内版的新一轮于每天 10:00(北京时间)开放。WorkBuddy、Trae、Qoder 的国际版没有每日签到,面板不显示签到入口。登录被上游拒绝的账号在该轮被跳过。
|
|
121
126
|
|
|
122
127
|
WorkBuddy 国内版上游会拒绝「客户端身份写着 DeepSeek Harness」的对话请求(返回 11128,渠道校验未通过)。插件遇到这条拒绝时,会把系统消息并入首条用户消息并重试一次;助手历史里的客户端名称也会移除,因为渠道校验同样读取助手消息。通过的提示按 region 记住,同一段提示之后不再重复这次往返。签到、成长中心与保活走各自的接口。
|
|
123
128
|
|
|
@@ -161,17 +166,17 @@ Qoder 42871 / 42881
|
|
|
161
166
|
|
|
162
167
|
以上为首选端口。端口被占用时网关绑定系统分配的临时端口,运行时注册的 provider 使用本次实际地址,面板显示回退结果。
|
|
163
168
|
|
|
164
|
-
PI-Desktop 版使用 41831
|
|
169
|
+
PI-Desktop 版使用 41831 开头的独立端口,两版可以同时安装,设置和凭证分别保存,不会自动同步。若两版使用同一份 WorkBuddy 登录,上游轮换刷新令牌时可能使另一版的登录失效。出现「需重新登录」时,在对应版本重新添加账号,不要复制旧的 `signins/` 文件覆盖;两版显示的令牌到期时间可能不同。
|
|
165
170
|
|
|
166
171
|
端口在预留与监听之间被其他进程占用时,该网关本次启动失败:其模型组被摘掉,连接检查报出失败原因,面板提示重新加载插件。重新加载后宿主重新读取声明,请求才会落到新地址。
|
|
167
172
|
|
|
168
173
|
## 数据与出网
|
|
169
174
|
|
|
170
|
-
读取三家 App 的本机登录文件。provider 通过运行时注册接入,插件设置由宿主持久化至 profile。令牌由插件保管,只发往对应厂商的接口。网关监听 `127.0.0.1
|
|
175
|
+
读取三家 App 的本机登录文件。provider 通过运行时注册接入,插件设置由宿主持久化至 profile。令牌由插件保管,只发往对应厂商的接口。网关监听 `127.0.0.1`,同机其他进程可调用并消耗账号额度;面板只接受本机回环请求。
|
|
171
176
|
|
|
172
|
-
插件自管数据目录 `~/.dsh/dsh-wtq-pool/`(设置了 `DSH_HOME`
|
|
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 决定。
|
|
173
178
|
|
|
174
|
-
插件写入的登录都在同目录的 `signins
|
|
179
|
+
插件写入的登录都在同目录的 `signins/`:面板添加的、接管桌面端快照的、续期后的副本。文件名带账号的计费身份,与桌面登录同等参与分发。这些文件同样未额外加密,访问权限由操作系统文件 ACL 决定。在面板中「删除」该账号会连同 `credentials-archive.json` 里的留档一起清除,桌面端遗留的同一份快照随之失效;重新登录该账号即解除。「移除」只是停用,可在「已移除的账号」中恢复。
|
|
175
180
|
|
|
176
181
|
插件只向三家厂商的接口发起请求;面板外链仅在用户点击时打开。
|
|
177
182
|
|
|
@@ -198,7 +203,7 @@ pnpm test # Node 自带测试,离线回归
|
|
|
198
203
|
| 模块 | 职责 |
|
|
199
204
|
| --- | --- |
|
|
200
205
|
| `loopback.ts` | 回环端点的安全模型(Host 与 Origin 校验)、响应写入、流式中继与报错脱敏 |
|
|
201
|
-
| `accounts.ts` | WorkBuddy
|
|
206
|
+
| `accounts.ts` | WorkBuddy 登录文件解析、账号池与冷却 |
|
|
202
207
|
| `upstream.ts` | WorkBuddy 上游客户端、错误分类、限流重置解析 |
|
|
203
208
|
| `catalog.ts` | 模型目录与静态兜底列表 |
|
|
204
209
|
| `shim.ts` | WorkBuddy 网关的 OpenAI 兼容端点 |
|