dsh-wtq-pool 0.0.0-stage → 1.0.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 ADDED
@@ -0,0 +1,46 @@
1
+ # 更新说明
2
+
3
+ ## [1.0.1]
4
+
5
+ ### 修复
6
+
7
+ - 设置保存改用插件条目的实际命名空间,不再因为名字对不上而失败,面板里的来源开关、区域开关、签到与模型选择都受影响;宿主设置读取失败时保留上一次读到的设置,不清空停用账号、移除记录、积分保底和模型覆盖,补丁按顶层键替换。
8
+ - 面板路由挂载早于引擎就绪的窗口期内请求不再报 500;某条路由注册失败时释放已注册的部分,不再让面板卡在半挂载。
9
+ - 「重新检测账号」与加载期把账号扫描和网关启动纳入整段预算,按时应答,未完成的部分由后台刷新补齐;重新检测会移除登录文件已不在的 WorkBuddy 账号,目录暂时读不到时保留原账号与冷却。
10
+ - 输入框积分弹窗的「刷新」按总预算逐账号补读,多账号机器上不再逐个等满;面板通道调用带客户端超时;首次读取 WorkBuddy 积分时自动触发后台探测,冷启动和换号后的未知余额按 5 秒重读。
11
+ - 快速关闭再开启某来源时,新网关等待旧网关释放端口;首选端口被占用时改用实际绑定的端口,不再造成地址漂移。
12
+ - 插件重载后重新计算当天的签到时段,不再漏掉未领的时段,旧一轮仍在收尾时也不会并发第二轮;手动「立即运行」与命令面板签到记入当前已到点的时段,Qoder 当日轮次晚于签到时点开出时会在开出时刻补收。
13
+ - WorkBuddy、Trae、Qoder 收到上游终止标记即完成响应,不再等待 TCP 连接关闭;覆盖空终止回复、跨分块标记和 Trae 终止事件中的正文,加载期取消的请求也不再创建上游请求。
14
+ - 上游开始输出后才失败时,流不再裸断开:改为发出带内错误帧、终止帧与 `[DONE]`,客户端能正常收尾;取消或断开导致的连接中断不再被记为上游流失败。
15
+ - 上游回显的凭据不再原样出现在错误信息里,JSON 字段形式与 `Cosy-Key`、`X-Cloudide-Token`、`X-Ide-Token` 这类厂商写法一并覆盖,带内错误帧同样脱敏;凭据后面的字段不再被连带抹掉。
16
+ - Trae 拒绝回包中途断开时保留上游真实状态码,429 保留软限流分类;Qoder 登录过期帧不再被嵌套对象覆盖,每日限额的等待时长在消息内携带时也能读到。
17
+ - 修复国内 Trae、Qoder 的有效登录被误判为已过期,账号池因此为空、对应网关不可用的问题;没有过期时间的登录不再被当成已过期。
18
+ - Trae、Qoder 的轮流使用只在对话请求上换号,刷新模型列表和健康检查不再拨动游标;首选来源账号改名后,轮询与到期排序不再因旧标签永久停用;连登奖励只兑换已解锁的档位,签到程序关闭时不再被计为已领取。
19
+ - 输入框积分框切换账号时会报告结果:切到当前不能服务的账号时说明选择已保存、恢复后自动生效;刷新后账号已被停用则明确报无法切换,而不是假装已切过去。
20
+ - 模型 id 为 `__proto__` 时按普通 id 保存与读回;provider 注册失败时清空发现缓存,不再返回已释放的模型;到期时间或令牌刷新返回异常时长时按默认有效期记录,面板照常打开。
21
+ - 面板配色统一为同一组低饱和色相,四个语义色在暗色与亮色下协调一致,亮色下警告色与输入框积分圆点的对比度、模型页选中项的悬停配色一并修正。
22
+ - 显示名、包名与仓库名统一为 **WTQ Pool** / `dsh-wtq-pool`(WorkBuddy / Trae / Qoder 三个来源的首字母),插件卡片、模型选择器与面板标题一致;命令 id 与设置命名空间不变,升级后原有配置照常生效。
23
+ - Trae 模型目录自带的倍率传到面板,模型行显示 `x0.79` 这样的费率标签,模型选择器里的名称带上同一后缀,未给出费率的模型保持不标注;面板右下角的入口收成一排 GitHub、npm、文档与许可四个链接,标签跟随界面语言。
24
+ - 中英文文档明确 WorkBuddy 故障转移、Trae/Qoder 分发限制、主题重载与本地安装方式;报错指引与日志中的平台残留已清理,网关拒绝凭据的提示改为指向连接检查。
25
+
26
+ ## [1.0.0]
27
+
28
+ 首个版本。
29
+
30
+ ### 功能
31
+
32
+ - 只读本机 WorkBuddy、Trae、Qoder 桌面 App 的登录文件,不发起独立的 OAuth 流程。
33
+ - 按 region 把账号合成模型池并注册成 provider:WorkBuddy 国内/国际、Trae 国内/国际、Qoder 国内/国际;没有账号的 region 不注册。
34
+ - WorkBuddy 被限流或额度用尽时自动换号,支持优先使用、轮询、临期积分优先和会话固定;Trae、Qoder 按请求分发,支持轮询与临期积分优先。
35
+ - 后台积分自动化:每日签到、任务奖励领取、连登解锁。到点和「立即运行」执行同一轮,顺带领取 WorkBuddy 国内账号已解锁的连登档位和已完成的任务奖励。
36
+ - 会话积分展开框带刷新按钮,重读当前模型这一组账号的积分。
37
+ - 插件页提供 **WTQ Pool** 配置卡片:账号池、模型勾选、连接检查三屏,覆盖三个来源。
38
+ - `xdpool.open` / `xdpool.rescan` / `xdpool.resetCooldowns` / `xdpool.doctor` / `xdpool.checkin` 命令。
39
+
40
+ ### 说明
41
+
42
+ - provider 通过运行时注册接入(`ctx.llm.registerAdapter` + `ctx.llm.registerConfigurableProviders`),不改写宿主 provider 配置;插件设置由宿主持久化至 profile。
43
+ - 每个网关只绑 `127.0.0.1`,首选端口为 `42831`–`42881`,占用时使用临时端口;面板只接受实际回环对端。
44
+ - 对 `@earendil-works/pi-ai` 按实际解析到的版本适配请求上下文:新旧两代对 system 提示的承载方式不同,插件按当前解析结果选择形态,因此宿主换代或 profile 提升旧版都不会打断发消息。
45
+ - 会话输入框左侧显示当前模型的账号积分,点开可切换账号。
46
+ - 面板以同源 `iframe` 嵌在插件页的配置卡片里,样式与宿主页面互不影响。
package/LICENSE ADDED
@@ -0,0 +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.
package/README.en.md ADDED
@@ -0,0 +1,133 @@
1
+ # WTQ Pool
2
+
3
+ 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 do not guarantee retries after failure. Each source has its own switch, with domestic and international accounts grouped separately.
4
+
5
+ [中文文档](./README.md)
6
+
7
+ ## Preview
8
+
9
+ The settings panel, in its default light theme:
10
+
11
+ ![Account pool](docs/preview-pool.png)
12
+
13
+ The panel reads DeepSeek Harness's appearance setting on load. Reload the panel after changing the host theme:
14
+
15
+ ![Dark theme](docs/preview-dark.png)
16
+
17
+ The model page edits the display name, context window, output limit, thinking levels and image support. A Trae model whose directory states a rate carries a cost tag such as `x0.79`; models that state none (and every Qoder model) stay unlabelled:
18
+
19
+ ![Model settings](docs/preview-models.png)
20
+
21
+ Live preview: <https://chengzhi-c.github.io/dsh-wtq-pool/>.
22
+
23
+ `docs/index.html` loads the actual panel code with synthetic demo data. It supports source switching, model settings and theme previews without reading local accounts or tokens.
24
+
25
+ ![Preview page](docs/preview-page.png)
26
+
27
+ With `showComposerPoints` enabled, the composer shows the current model's account credits. Click it to inspect the group and switch accounts. The image below is an off-screen render of the actual composer extension, not a conversation-test screenshot:
28
+
29
+ ![Composer credits](docs/preview-composer.png)
30
+
31
+ Run it locally: `node docs/serve.cjs`, then open the address it prints. (`docs/index.html` has to be served over http: a `file://` page cannot read the panel files beside it.)
32
+
33
+ ## Features
34
+
35
+ - Reuse the local sign-ins: the plugin only reads the sign-in files the three desktop apps already saved. It starts no OAuth flow of its own and asks for no extra authorization.
36
+ - Register model groups by region: each of the three vendors' regions becomes its own provider, and they can be on at once; a region with no account is not registered.
37
+ - Account distribution: WorkBuddy supports priority, round-robin, expiring credits first and conversation-sticky accounts, with failover on rate limits or exhausted quota. Trae and Qoder support round-robin and expiring credits first.
38
+ - Credit automation: automatic check-in is off by default. The scheduled run and "Run now" perform the same round: vendor check-ins plus domestic WorkBuddy streak and task rewards and cat travel.
39
+ - Composer credits: with `showComposerPoints` on, the composer shows the balance of the account behind the current model; click it to switch accounts.
40
+ - One panel: account state, pool state, model selection and the connection check all live in the WTQ Pool card on the plugin page. The model catalog loads at startup and refreshes on demand once its cache expires; it does not poll while idle.
41
+
42
+ ## Install
43
+
44
+ For a local package, run `pnpm install && pnpm run build && npm pack --pack-destination dist` in the source directory, then install the generated `.tgz`:
45
+
46
+ ```powershell
47
+ $package = (Resolve-Path .\dist\dsh-wtq-pool-1.0.1.tgz).Path
48
+ dsh plugin --profile desktop add $package
49
+ ```
50
+
51
+ Replace `desktop` with your actual profile name. If `dsh` is not on PATH, use the CLI in its installation directory. The npm name `dsh-wtq-pool` and the repository URL work as install sources too.
52
+
53
+ **Where the panel is**: go to **Plugins** in the sidebar and 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, restart dsh as the note at the top of the panel says.
54
+
55
+ ## Usage
56
+
57
+ Sign in inside each vendor's desktop app, then click "Detect accounts again". WorkBuddy reads multiple saved sign-ins; `$wbEncrypted` sign-ins from 5.6 onward use a key obtained from the local WorkBuddy installation. Domestic Trae has two sign-in slots, Trae CN and TRAE SOLO CN. Qoder keeps one sign-in per installation; signing in again overwrites the previous one.
58
+
59
+ A source is selected at the top level; below it are three screens:
60
+
61
+ - **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 a region can be pinned to prefer one account. WorkBuddy distributes with use one first, round-robin, expiring credits first, or pin one per conversation; Trae and Qoder have round-robin and expiring credits first.
62
+ - **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.
63
+ - **Connection check**: reports one line at a time whether each gateway is listening, how many models its catalog returned, whether the published address matches the one actually bound, and whether the host accepted each provider, and can copy the whole report.
64
+
65
+ 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 missed slot is claimed at the next start. Trae's daily check-in is once per device. Qoder's new round opens at 10:00 (Beijing time).
66
+
67
+ ## Settings
68
+
69
+ | Key | Default | Meaning |
70
+ | --- | --- | --- |
71
+ | `enabled` | `true` | Off: the gateways do not start |
72
+ | `sourceWorkbuddy` / `sourceTrae` / `sourceQoder` | `true` | Off: that source is not scanned, published or requested |
73
+ | `distribution` | `priority` | How the WorkBuddy pool spreads requests: `priority` uses one first, `round-robin` spreads evenly, `expiry` spends expiring credits first, `sticky` pins one account per conversation |
74
+ | `sourceDistributions` | `{}` | Trae/Qoder distribution: `round-robin` / `expiry`; legacy `priority` is accepted |
75
+ | `cooldownSeconds` | `60` | Rate-limit cooldown. A reset time the upstream reports takes precedence; Beijing time |
76
+ | `authFile` | `""` | WorkBuddy sign-in file path; every `.info` sign-in in its directory is scanned. Empty discovers it |
77
+ | `autoCheckin` | `{"enabled":false,"hours":[9]}` | Automatic check-in switch and times; `hours` are Beijing-time hours, empty means 09:00 |
78
+ | `creditReserves` | `{}` | Per-account credit floor, keyed by account id; an account below its floor is not distributed to |
79
+ | `showComposerPoints` | `false` | Show the active account's credits in the composer |
80
+
81
+ Model selection and preferred accounts are saved by the panel. The command palette also opens the panel, detects accounts again, clears cooldowns, checks in everywhere and runs the connection check.
82
+
83
+ ## Ports
84
+
85
+ ```
86
+ WorkBuddy 42831 / 42841
87
+ Trae 42851 / 42861
88
+ Qoder 42871 / 42881
89
+ ```
90
+
91
+ These are preferred ports. If occupied, the gateway binds an ephemeral port and runtime provider registration uses that actual address. The panel reports the fallback. Domestic models only use domestic accounts.
92
+
93
+ ## Data and outbound requests
94
+
95
+ The plugin only reads local vendor sign-in files and does not modify them. Providers are registered at runtime without rewriting host provider configuration; the host still persists plugin settings in the profile. Tokens stay in the plugin process and are sent to the relevant vendor endpoints. Gateways listen on `127.0.0.1`. Panel assets and RPC require an actual loopback peer and ignore forwarded address headers, so remote browsers cannot access the panel directly. The plugin does not directly manage or delete host conversation records.
96
+
97
+ Another process on the same machine can call these loopback endpoints and spend a signed-in account's quota.
98
+
99
+ Tokens go only to the hosts below:
100
+
101
+ - WorkBuddy: `copilot.tencent.com`, `www.codebuddy.cn`, `www.codebuddy.ai`, `www.workbuddy.ai`, `www.workbuddy.cn`
102
+ - Trae: `api.trae.cn`, `solo.trae.cn`, `trae-api-cn.mchost.guru`, `coresg-normal.trae.ai`, `growsg-normal.trae.ai`
103
+ - Qoder: `gateway.qoder.com.cn`, `openapi.qoder.com.cn`, `api3.qoder.sh`, `openapi.qoder.sh`
104
+
105
+ The plugin sends no telemetry. Panel links open only when clicked.
106
+
107
+ ## Development
108
+
109
+ ```sh
110
+ pnpm install
111
+ pnpm run build # emits lib/ (host half as ESM, client half as CJS)
112
+ pnpm run typecheck # host half
113
+ pnpm run typecheck:client
114
+ pnpm test # Node's own test runner, offline regressions
115
+ ```
116
+
117
+ `src/host.ts` is the engine (account discovery, the pool, the gateways, the panel channels), `src/index.ts` is the Cordis entry (settings schema, provider registration, panel routes), `src/pi-compat.ts` adapts the host's capabilities to the calls the engine already makes, and `src/client/` is the React half: the panel and the composer readout.
118
+
119
+ ## Credits
120
+
121
+ Several modules are ported from, or reference, the MIT projects below:
122
+
123
+ | Project | Copyright | Used for |
124
+ | --- | --- | --- |
125
+ | [XDTrees/dsh-workbuddy-xdpool](https://github.com/XDTrees/dsh-workbuddy-xdpool) | (c) 2026 XDTrees | WorkBuddy account pool and the port this plugin came from |
126
+ | [corrinehu/dsh-workbuddy-connect](https://github.com/corrinehu/dsh-workbuddy-connect) | (c) 2026 Corrine Hu | The loopback endpoint's security model |
127
+ | [dingminhua/dsh-connect-workbuddy](https://github.com/dingminhua/dsh-connect-workbuddy) | (c) 2026 LaoDing | Upstream API and error classification |
128
+ | [dingminhua/dsh-connect-trae](https://github.com/dingminhua/dsh-connect-trae) | (c) 2026 dingminhua | Trae protocol reference |
129
+ | [eghrhegpe/dsh-connect-qoder](https://github.com/eghrhegpe/dsh-connect-qoder) | (c) 2026 eghrhegpe | Qoder protocol reference |
130
+
131
+ ## License
132
+
133
+ MIT, see [LICENSE](./LICENSE).
package/README.md CHANGED
@@ -1,3 +1,134 @@
1
- # Temporary Holding Version
1
+ # WTQ账号池
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 把本机 WorkBuddy、Trae、Qoder 的桌面登录接入 DeepSeek Harness。WorkBuddy 被限流或额度用尽时自动换号;Trae、Qoder 按请求选择账号,不保证失败后重试。三个来源独立开关,国内与国际账号分别成组。
4
+
5
+ [English](./README.en.md)
6
+
7
+ ## 预览
8
+
9
+ 设置面板界面如下(默认亮色):
10
+
11
+ ![账号池](docs/preview-pool.png)
12
+
13
+ 面板载入时读取 DeepSeek Harness 的外观设置;宿主切换主题后须重新载入面板:
14
+
15
+ ![暗色主题](docs/preview-dark.png)
16
+
17
+ 模型页可以改显示名、上下文窗口、输出上限、思考等级和贴图。Trae 目录给出费率的模型会带上 `x0.79` 这样的费率标签,未给出费率的模型(以及 Qoder 全部模型)不标注:
18
+
19
+ ![模型设置](docs/preview-models.png)
20
+
21
+ 在线预览:<https://chengzhi-c.github.io/dsh-wtq-pool/>。
22
+
23
+ `docs/index.html` 加载实际面板代码并使用虚构演示数据,支持来源切换、模型设置和主题预览,不读取本机账号或令牌。
24
+
25
+ ![预览页](docs/preview-page.png)
26
+
27
+ 开启 `showComposerPoints` 后,输入区显示当前模型的账号积分,点击可查看该组账号并切换账号。下图由实际输入框扩展离屏渲染,非对话测试截图:
28
+
29
+ ![输入框积分](docs/preview-composer.png)
30
+
31
+ 本地运行:`node docs/serve.cjs`,然后打开它输出的地址。
32
+ (`docs/index.html` 需经本地服务器打开:`file://` 页面无法读取同目录的面板文件。)
33
+
34
+ ## 功能
35
+
36
+ - 复用本机登录:只读三家桌面 App 已保存的登录文件,不发起自己的 OAuth,不额外要一次授权。
37
+ - 按 region 注册模型分组:三家各自的 region 各注册成一个 provider,可以同时开启;没有账号的 region 不注册。
38
+ - 账号分发:WorkBuddy 支持优先使用、轮询、临期积分优先和会话固定账号,并在限流或额度用尽时自动换号;Trae、Qoder 支持轮询与临期积分优先。
39
+ - 积分自动化:自动签到默认关闭。开启后的定时任务与「立即运行」执行同一轮,包含三家的签到、WorkBuddy 国内账号的连登和任务奖励及猫猫旅行。
40
+ - 输入框积分:开启 `showComposerPoints` 后,输入区显示当前模型使用的账号余额,点开可换号。
41
+ - 面板:账号状态、池状态、模型勾选、连接检查都在插件页的 WTQ Pool 卡片里。模型目录启动时加载,缓存过期后按需刷新,空闲不轮询。
42
+
43
+ ## 安装
44
+
45
+ 本地包:在源码目录执行 `pnpm install && pnpm run build && npm pack --pack-destination dist`,再安装生成的 `.tgz`:
46
+
47
+ ```powershell
48
+ $package = (Resolve-Path .\dist\dsh-wtq-pool-1.0.1.tgz).Path
49
+ dsh plugin --profile desktop add $package
50
+ ```
51
+
52
+ 使用实际 profile 名替换 `desktop`。若 `dsh` 不在 PATH,使用安装目录中的 CLI。也可按 npm 包名 `dsh-wtq-pool` 或仓库地址安装。
53
+
54
+ **面板在哪儿**:侧边栏进 **插件**,点 **dsh-wtq-pool** 那张卡片(或它旁边的 **配置**),完整面板嵌在卡片里。模型分组没出现时,按面板顶部的提示重启 dsh。
55
+
56
+ ## 使用
57
+
58
+ 在各家桌面 App 中登录后,点击「重新检测账号」。WorkBuddy 支持读取多个已保存登录,5.6 起的 `$wbEncrypted` 登录通过本机 WorkBuddy 获取密钥。Trae 国内版有 Trae CN 与 TRAE SOLO CN 两个登录位;Qoder 每个安装仅保存一个登录,重新登录会覆盖前一个。
59
+
60
+ 顶层选来源,下面三屏:
61
+
62
+ - **账号池**:每个号的标签、剩余积分、额度到期时间、冷却状态、签到进度;可单独停用某个号,或指定某个 region 优先用哪个号。WorkBuddy 的分发有优先用一个、轮流使用、优先使用临期积分、同一对话固定;Trae 与 Qoder 有轮流使用和优先使用临期积分。
63
+ - **模型**:勾选这个 region 要暴露的模型,未勾选的不进模型选择器。可改显示名、上下文窗口、输出上限、思考等级和贴图支持。一个模型组最多发布 64 个,超出的标「未发布」,网关仍会服务它们。
64
+ - **连接检查**:逐条报出网关在不在听、模型目录读到几个、注册的地址与实际绑定的是否一致、每个 provider 有没有被宿主接受,并可复制整份报告。
65
+
66
+ 签到可单账号执行,也可在标题栏一次领完该来源。自动签到默认关闭,开启后默认于 09:00(北京时间)执行,错过时段将在下次启动补领。Trae 的每日签到是一台设备一次,Qoder 的新一轮在每天 10:00(北京时间)开出。
67
+
68
+ ## 设置
69
+
70
+ | 键 | 默认 | 说明 |
71
+ | --- | --- | --- |
72
+ | `enabled` | `true` | 关闭后网关不启动 |
73
+ | `sourceWorkbuddy` / `sourceTrae` / `sourceQoder` | `true` | 关闭后该来源不扫描、不发布、不请求 |
74
+ | `distribution` | `priority` | WorkBuddy 池的发放方式:`priority` 先用一个,`round-robin` 均摊,`expiry` 优先消耗临期积分,`sticky` 同一对话固定 |
75
+ | `sourceDistributions` | `{}` | Trae、Qoder 的分发方式:`round-robin` / `expiry`;兼容旧值 `priority` |
76
+ | `cooldownSeconds` | `60` | 限流冷却时长。上游报出重置时间时以它为准,按北京时间 |
77
+ | `authFile` | `""` | WorkBuddy 登录文件路径;扫描其所在目录的全部 `.info` 登录,留空自动发现 |
78
+ | `autoCheckin` | `{"enabled":false,"hours":[9]}` | 自动签到的开关与时点,`hours` 为北京时间整点,留空用 09:00 |
79
+ | `creditReserves` | `{}` | 按账号 id 设定的积分保底,余额低于它的账号不参与分发 |
80
+ | `showComposerPoints` | `false` | 在输入区显示当前账号积分 |
81
+
82
+ 模型勾选和首选账号由面板保存。命令面板里也可打开面板、重新检测、清除冷却、全部签到、连接检查。
83
+
84
+ ## 端口
85
+
86
+ ```
87
+ WorkBuddy 42831 / 42841
88
+ Trae 42851 / 42861
89
+ Qoder 42871 / 42881
90
+ ```
91
+
92
+ 以上为首选端口。被占用时网关绑定临时端口,运行时 provider 注册使用本次实际地址,面板显示回退结果。国内模型仅使用国内账号。
93
+
94
+ ## 数据与出网
95
+
96
+ 只读三家 App 的本机登录文件,不写回登录状态。provider 通过运行时注册接入,不改写宿主 provider 配置;插件设置仍由宿主持久化至 profile。令牌仅在插件进程中使用,并发往对应厂商接口。网关仅监听 `127.0.0.1`;面板资源与 RPC 只接受实际回环对端,不信任代理转发头,因此远程浏览器不能直接使用面板。插件不直接管理或删除宿主会话记录。
97
+
98
+ 同一台机器上的其他进程可以调用这些回环端点,从而消耗已登录账号的额度。
99
+
100
+ 令牌只会发往以下主机:
101
+
102
+ - WorkBuddy:`copilot.tencent.com`、`www.codebuddy.cn`、`www.codebuddy.ai`、`www.workbuddy.ai`、`www.workbuddy.cn`
103
+ - Trae:`api.trae.cn`、`solo.trae.cn`、`trae-api-cn.mchost.guru`、`coresg-normal.trae.ai`、`growsg-normal.trae.ai`
104
+ - Qoder:`gateway.qoder.com.cn`、`openapi.qoder.com.cn`、`api3.qoder.sh`、`openapi.qoder.sh`
105
+
106
+ 插件不发送遥测。面板外链仅在用户点击时打开。
107
+
108
+ ## 开发
109
+
110
+ ```sh
111
+ pnpm install
112
+ pnpm run build # 产出 lib/(宿主半为 ESM,客户端半为 CJS)
113
+ pnpm run typecheck # 宿主半
114
+ pnpm run typecheck:client
115
+ pnpm test # Node 自带测试,离线回归
116
+ ```
117
+
118
+ `src/host.ts` 是引擎(账号发现、池、网关、面板通道),`src/index.ts` 是 Cordis 入口(设置 schema、provider 注册、面板路由),`src/pi-compat.ts` 把宿主能力适配成引擎已在用的那套调用,`src/client/` 是面板与输入区的 React 半。
119
+
120
+ ## 致谢
121
+
122
+ 若干模块移植或参考自下列 MIT 项目,特此鸣谢:
123
+
124
+ | 项目 | 版权 | 用于 |
125
+ | --- | --- | --- |
126
+ | [XDTrees/dsh-workbuddy-xdpool](https://github.com/XDTrees/dsh-workbuddy-xdpool) | (c) 2026 XDTrees | WorkBuddy 账号池与整体移植来源 |
127
+ | [corrinehu/dsh-workbuddy-connect](https://github.com/corrinehu/dsh-workbuddy-connect) | (c) 2026 Corrine Hu | 回环端点的安全模型 |
128
+ | [dingminhua/dsh-connect-workbuddy](https://github.com/dingminhua/dsh-connect-workbuddy) | (c) 2026 LaoDing | 上游接口与错误分类 |
129
+ | [dingminhua/dsh-connect-trae](https://github.com/dingminhua/dsh-connect-trae) | (c) 2026 dingminhua | Trae 协议参考 |
130
+ | [eghrhegpe/dsh-connect-qoder](https://github.com/eghrhegpe/dsh-connect-qoder) | (c) 2026 eghrhegpe | Qoder 协议参考 |
131
+
132
+ ## 许可
133
+
134
+ MIT,见 [LICENSE](./LICENSE)。
@@ -0,0 +1,6 @@
1
+ # Register the WTQ Pool host half. Discovery is read-only: the plugin reuses the
2
+ # WorkBuddy, Trae and Qoder desktop apps' own sign-in files and never starts a
3
+ # separate OAuth flow. Requests rotate across every discovered account.
4
+ - insert:
5
+ - id: llm-dsh-xdpool
6
+ name: dsh-wtq-pool
@@ -0,0 +1,181 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>WTQ账号池 · 预览</title>
7
+ <!--
8
+ Preview page for the plugin panel.
9
+
10
+ The iframe mounts the repository's own renderer/index.html, panel.css and
11
+ panel.js against a stubbed host bridge, so what you click is the shipping
12
+ component. Screenshots for the README are taken from this same page.
13
+
14
+ Run it: node docs/serve.cjs then open the printed address.
15
+ -->
16
+ <style>
17
+ /* Palette mirrors renderer/panel.css so the wrapper reads as part of the
18
+ plugin. Same design language: borders and spacing carry the hierarchy,
19
+ no shadows. */
20
+ :root {
21
+ color-scheme: light;
22
+ --bg: #f4f5f7;
23
+ --panel: #ffffff;
24
+ --card: #ffffff;
25
+ --fg: #1b1d21;
26
+ --muted: #6b7280;
27
+ --border: #e3e5ea;
28
+ --accent: #2e706a;
29
+ --on-accent: #ffffff;
30
+ }
31
+ :root[data-base="dark"] {
32
+ color-scheme: dark;
33
+ --bg: #101216;
34
+ --panel: #16181d;
35
+ --card: #1c1f25;
36
+ --fg: #e8eaee;
37
+ --muted: #9aa1ad;
38
+ --border: #2c3038;
39
+ --accent: #67c1b8;
40
+ --on-accent: #163633;
41
+ }
42
+ * { box-sizing: border-box; }
43
+ body {
44
+ margin: 0;
45
+ background: var(--bg);
46
+ color: var(--fg);
47
+ font: 14px/1.6 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
48
+ }
49
+ a { color: var(--accent); }
50
+
51
+ .wrap { max-width: 1180px; margin: 0 auto; padding: 28px 20px 56px; }
52
+
53
+ header.top {
54
+ display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px;
55
+ padding-bottom: 16px; border-bottom: 1px solid var(--border);
56
+ }
57
+ header.top h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
58
+ header.top .tag {
59
+ font-size: 12px; color: var(--muted);
60
+ border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px;
61
+ }
62
+ header.top .spacer { flex: 1 1 auto; }
63
+ header.top .links { display: flex; gap: 14px; font-size: 13px; }
64
+
65
+ .lede { margin: 18px 0 22px; max-width: 70ch; color: var(--fg); }
66
+ .lede p { margin: 0 0 8px; }
67
+ .lede .muted { color: var(--muted); font-size: 13px; }
68
+
69
+ .toolbar {
70
+ display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
71
+ margin: 0 0 12px;
72
+ }
73
+ .toolbar .label { font-size: 12px; color: var(--muted); margin-right: 2px; }
74
+ .seg { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
75
+ .seg button {
76
+ appearance: none; border: 0; background: transparent; color: var(--muted);
77
+ font: inherit; font-size: 13px; padding: 5px 12px; cursor: pointer;
78
+ }
79
+ .seg button + button { border-left: 1px solid var(--border); }
80
+ .seg button:hover { color: var(--fg); }
81
+ .seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
82
+
83
+ .stage {
84
+ border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
85
+ background: var(--panel);
86
+ }
87
+ .stage .caption {
88
+ display: flex; align-items: center; gap: 8px;
89
+ padding: 9px 14px; font-size: 12px; color: var(--muted);
90
+ border-bottom: 1px solid var(--border);
91
+ }
92
+ .stage .caption .dot {
93
+ width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
94
+ }
95
+ iframe { display: block; width: 100%; height: 820px; border: 0; background: var(--panel); }
96
+
97
+ footer.foot {
98
+ margin-top: 18px; font-size: 12px; color: var(--muted);
99
+ display: flex; flex-wrap: wrap; gap: 6px 16px;
100
+ }
101
+ @media (max-width: 720px) { iframe { height: 720px; } }
102
+ </style>
103
+ </head>
104
+ <body>
105
+ <div class="wrap">
106
+ <header class="top">
107
+ <h1>WTQ账号池</h1>
108
+ <span class="tag">MIT</span>
109
+ <span class="spacer"></span>
110
+ <nav class="links">
111
+ <a href="https://github.com/chengzhi-c/dsh-wtq-pool#readme">README</a>
112
+ <a href="https://github.com/chengzhi-c/dsh-wtq-pool">GitHub</a>
113
+ </nav>
114
+ </header>
115
+
116
+ <div class="lede">
117
+ <p>把本机 WorkBuddy、Trae、Qoder 的桌面登录接入 DeepSeek Harness。WorkBuddy 支持限流换号,Trae、Qoder 按请求分发。</p>
118
+ <p class="muted">
119
+ 下面加载实际面板代码,使用虚构演示数据,支持来源切换、模型设置和主题预览,不读取本机账号或令牌。
120
+ </p>
121
+ </div>
122
+
123
+ <div class="toolbar">
124
+ <span class="label">主题</span>
125
+ <div class="seg" id="segBase">
126
+ <button type="button" data-base="light" aria-pressed="true">亮色</button>
127
+ <button type="button" data-base="dark" aria-pressed="false">暗色</button>
128
+ </div>
129
+ </div>
130
+
131
+ <div class="stage">
132
+ <div class="caption"><span class="dot"></span>实际面板代码 · 演示数据</div>
133
+ <iframe id="panel" src="./preview-panel.html" title="WTQ Pool 面板预览"></iframe>
134
+ </div>
135
+
136
+ <footer class="foot">
137
+ <span>演示数据为虚构,不含任何真实账号或令牌。</span>
138
+ <span>本地运行:<code>node docs/serve.cjs</code></span>
139
+ </footer>
140
+ </div>
141
+
142
+ <script>
143
+ (function () {
144
+ "use strict";
145
+ var frame = document.getElementById("panel");
146
+ var root = document.documentElement;
147
+ var base = "light";
148
+
149
+ function press(segId, attr, value) {
150
+ var buttons = document.getElementById(segId).querySelectorAll("button");
151
+ for (var i = 0; i < buttons.length; i += 1) {
152
+ buttons[i].setAttribute("aria-pressed", String(buttons[i].getAttribute(attr) === value));
153
+ }
154
+ }
155
+
156
+ /* The panel ships its own source and view tabs, so the wrapper only has to
157
+ hand it the theme. The frame is same-origin, hence the direct call. */
158
+ function apply() {
159
+ if (frame.contentWindow.__previewSetAppearance) {
160
+ frame.contentWindow.__previewSetAppearance(base);
161
+ }
162
+ }
163
+
164
+ function onSegment(segId, attr, pick) {
165
+ document.getElementById(segId).addEventListener("click", function (event) {
166
+ var button = event.target.closest("button[" + attr + "]");
167
+ if (!button) return;
168
+ pick(button.getAttribute(attr));
169
+ press(segId, attr, button.getAttribute(attr));
170
+ apply();
171
+ });
172
+ }
173
+ onSegment("segBase", "data-base", function (v) { base = v; root.dataset.base = v; });
174
+
175
+ root.dataset.base = base;
176
+ // The panel boots asynchronously after the frame fetches its markup.
177
+ frame.addEventListener("load", function () { setTimeout(apply, 400); });
178
+ })();
179
+ </script>
180
+ </body>
181
+ </html>
Binary file
Binary file