dsh-workbuddy-xdpool 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/LICENSE +21 -0
- package/README.en.md +152 -0
- package/README.md +170 -0
- package/assets/model-picker.png +0 -0
- package/assets/settings-card.png +0 -0
- package/cordis.patch.yml +6 -0
- package/lib/bin.js +1294 -0
- package/lib/client.js +858 -0
- package/lib/index.d.ts +629 -0
- package/lib/index.js +1920 -0
- package/package.json +109 -0
- package/screenshots.json +4 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
本项目的所有重要变更都会记录在此文件。
|
|
4
|
+
|
|
5
|
+
版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
6
|
+
|
|
7
|
+
## 0.2.0 (2026-09-16)
|
|
8
|
+
|
|
9
|
+
本次更新在既有的多账号自动容错池基础上,补齐了每日签到、国内/国际版双区域适配,并把做签到的多账号体验做成了「一个账号一个按钮」的形态。
|
|
10
|
+
|
|
11
|
+
### 新增
|
|
12
|
+
|
|
13
|
+
- **每日签到**:设置卡片在每个账号的积分区下方新增签到区块,显示当前连签天数、每日可领积分与里程碑额外奖励,并提供一键领取按钮。
|
|
14
|
+
|
|
15
|
+
- 多账号**逐个领取**:池里每个账号各有一个签到按钮,可一次领完所有账号的当日奖励,**不需要先把池的优先账号切过去**。
|
|
16
|
+
- **不会重复领取**:领取前会先重新查询该账号的签到状态;今日已领取的账号直接返回「今日已签到」,不会再打一次领取接口。按钮在已领取 / 未开通签到活动时自动置灰。
|
|
17
|
+
- **失败不拖垮卡片**:某个账号的签到查询失败时,只在该账号下显示一行错误提示,其余账号与整个池状态照常渲染。
|
|
18
|
+
- 新增 CLI 子命令 `checkin`:不带参数查询所有账号今日签到状态,`checkin all` 领取全部账号奖励,`checkin <账号标签>` 只领指定账号;支持 `--json` 输出机器可读结果。
|
|
19
|
+
|
|
20
|
+
- **国内版 / 国际版自动适配**:按每个账号凭据里的登录域名自动选择上游域名——国际版登录(`workbuddy.ai`)走 `www.workbuddy.ai`,国内版(默认)走 `copilot.tencent.com` 与 `www.codebuddy.cn`。同一池内可以混用两种区域的账号,各自请求各自区域的接口,账号切换与自动容错轮换对两种区域一并生效。
|
|
21
|
+
|
|
22
|
+
- **签到按钮的连签奖励提示**:到达连签里程碑时,签到区块额外显示里程碑天数与额外奖励积分。
|
|
23
|
+
|
|
24
|
+
### 安全
|
|
25
|
+
|
|
26
|
+
- 签到是本插件唯一的写操作,按四重守卫保护:仅接受 `POST`、仅接受回环(same-origin)来源、请求必须显式携带目标 `accountId`(缺失返回 400、未知账号返回 404),且在领取前二次确认当日状态。请求体读取带 64 KB 上限,避免超大/挂起请求占用宿主内存。
|
|
27
|
+
- 签到状态进入卡片文档前同样经过脱敏处理,令牌类文本不会外泄到浏览器。
|
|
28
|
+
|
|
29
|
+
### 修复
|
|
30
|
+
|
|
31
|
+
- 修正测试中两处已过期的断言:一是 provider 名(`workbuddy-pool` → `workbuddy-xdpool`);二是限流断言仍按「账号级冷却」校验,与现有的**按 (账号, 模型) 粒度冷却**语义不符——现按 `modelCooldowns` 校验,并断言账号级冷却未被误置。这两处修正让多账号自动容错的回归测试重新可用(测试总数 17 → 26)。
|
|
32
|
+
|
|
33
|
+
### 安装体验
|
|
34
|
+
|
|
35
|
+
- **安装速度优化(约 140 秒 → 数秒)**:把 6 个由 DSH 宿主进程提供的运行时包(`@deepseek-ai/dsh-llm`、`dsh-llm-pi-ai`、`dsh-settings`、`cordis`、`schemastery`、`@earendil-works/pi-ai`)在 `peerDependenciesMeta` 中标记为 **optional**。插件自身从不拉取它们;此前未标记 optional,包管理器会自动解析并安装它们的整棵依赖树(含 AWS / Google / Anthropic / Mistral SDK 等),实测安装 112 个包、耗时约 140 秒 —— 现在只需约 1 个包、数秒完成。
|
|
36
|
+
|
|
37
|
+
- **构建产物随仓库提交**:`lib/`(`index.js` + `index.d.ts` + `bin.js` + `client.js`)不再被忽略,直接从 GitHub 安装时**不需要任何安装期脚本**,因此不会再出现 pnpm 的「构建脚本被拦截,请放行后重试」提示,装完即用。
|
|
38
|
+
- 相应地,`prepare` 脚本改为 `prepublishOnly`(发布到 npm 前仍会自动构建),安装路径上不再有脚本触发点。
|
|
39
|
+
- 新增 `lib/index.d.ts` 类型声明(此前 `package.json` 的 `types` 指向该文件但构建未产出)。
|
|
40
|
+
|
|
41
|
+
### 说明
|
|
42
|
+
|
|
43
|
+
- 保留了原有的额度/限流自动切换能力,并在本次改动后重新做了回归验证:单账号限流时同请求内轮换到下一个健康账号、按 (账号, 模型) 粒度冷却(一个模型限流不影响该账号其它模型)、令牌失效自动刷新重试、全部账号耗尽后才向调用方返回 429。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 aosi526
|
|
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,152 @@
|
|
|
1
|
+
# DSH WorkBuddy XD Pool
|
|
2
|
+
|
|
3
|
+
English | [中文](./README.md)
|
|
4
|
+
|
|
5
|
+
Merge **every WorkBuddy account** you have ever signed into on this machine into a single **DeepSeek Harness model pool**. No manual setup: each account you sign in on the WorkBuddy desktop app automatically becomes a pool member, and when one account gets rate-limited (HTTP 429), requests automatically fail over to the next healthy account.
|
|
6
|
+
|
|
7
|
+
> Unlike single-account connectors (e.g. `dsh-workbuddy-connect`), XD Pool treats multi-account as the norm — it never picks or imports an account by hand. It scans every historical sign-in snapshot left by the WorkBuddy desktop app, merges them all into one shared pool, and exposes them as a single `workbuddy-xdpool` provider group whose requests auto-fail-over across members.
|
|
8
|
+
|
|
9
|
+
**Settings card (Settings → Plugins → DSH WorkBuddy XD Pool)**
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
**Model picker (rate multiplier baked into model.name; DSH 0.1.2 composer only reads name)**
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- **Zero-config**: install, enable, done. Every account signed into the WorkBuddy desktop app is auto-discovered into the rotation pool on first use.
|
|
20
|
+
- **Automatic failover**: the pool tracks each account's `429` cooldown. A cooling account is skipped in favor of the next healthy one; cooldowns expire automatically. Requests pause only when every account is cooling at once.
|
|
21
|
+
- **Pool health at a glance**: the settings card shows pool health (N accounts / X cooling, which account is next), each account's token expiry, and cooldown countdowns.
|
|
22
|
+
- **Live remaining credits**: per-account credit packages (`package · remain / size`) and a big green total, refreshed from upstream in real time.
|
|
23
|
+
- **Annotated model catalog**: the card lists pool models with their credit multiplier (e.g. `GLM-5.2 · x0.79`), free / limited-free / night-discount tags, image-input capability, and context window — kept live from upstream `credits` / `tags`.
|
|
24
|
+
- **Daily check-in**: below each account's credits the card offers a check-in button showing the current streak, the per-day credit, and any milestone bonus. Collect an account's reward with one click — several accounts can be collected in turn, with no need to switch the pool's preferred account first. The status is re-read before claiming, so an account that already collected today is **never double-collected**. Also available as the `checkin` CLI command.
|
|
25
|
+
- **CN / global region auto-detection**: the upstream origin is picked per account from its login domain — a global sign-in (`workbuddy.ai`) uses `www.workbuddy.ai`, while a CN sign-in (the default) uses `copilot.tencent.com` and `www.codebuddy.cn`. Both regions can coexist in one pool, each account talking to its own region, with rotation and failover working across both.
|
|
26
|
+
- **Three manual actions**: re-detect desktop sign-ins, clear all cooldowns, and daily check-in — available both on the card and via the CLI.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
Prerequisite: WorkBuddy desktop app installed and signed in (the plugin reuses the app's sign-in state; adding accounts = signing in / switching accounts in the desktop app — each is absorbed into the pool automatically). Tested against DSH Desktop host `0.1.2`; compatible with `0.1.1-rc.2` / `0.1.2` (the settings-section install picks `settings.installSection` on `0.1.2-rc.1+`, or the older free function earlier).
|
|
31
|
+
|
|
32
|
+
**Option A — install from npm (recommended)**
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
# if dsh is not on PATH, use node ~/.dsh/profiles/node_modules/@deepseek-ai/dsh/lib/bin.js instead
|
|
36
|
+
dsh plugin --profile desktop add dsh-workbuddy-xdpool
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
> npm is the fast path: the only dependency pulled in is the plugin itself (**roughly 1 package, a few seconds**).
|
|
40
|
+
> Installing from GitHub source also installs the dev toolchain (bundler, test runner, hundreds of packages), which is markedly slower.
|
|
41
|
+
|
|
42
|
+
**Option B — install from GitHub source**
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
dsh plugin --profile desktop add github:aosi526/dsh-workbuddy-xdpool
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Option C — manual bundle registration**
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
# 1) install the package (npm or GitHub)
|
|
52
|
+
dsh plugin --profile desktop add dsh-workbuddy-xdpool
|
|
53
|
+
|
|
54
|
+
# 2) register the bundle: edit ~/.dsh/profiles/desktop/package.json and append
|
|
55
|
+
# "dsh-workbuddy-xdpool" to the end of the "dsh" → "profile" → "bundles" array
|
|
56
|
+
|
|
57
|
+
# 3) restart DSH Desktop
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Build locally** (developers):
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
pnpm install
|
|
64
|
+
pnpm build # outputs lib/index.js + lib/index.d.ts + lib/bin.js + lib/client.js
|
|
65
|
+
pnpm test # 26 tests (failover rotation, per-(account,model) cooldowns, check-in guards)
|
|
66
|
+
pnpm typecheck # host side
|
|
67
|
+
pnpm typecheck:client # client side
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
> `pnpm install` needs pnpm 11 (`npx pnpm@11`); add `--config.confirmModulesPurge=false --config.minimumReleaseAge=0` if the supply-chain age policy blocks freshly published rc packages.
|
|
71
|
+
|
|
72
|
+
> **The built output is committed** (`lib/` is no longer ignored). A GitHub install therefore runs
|
|
73
|
+
> no install-time script and never hits pnpm's "build scripts are blocked" prompt. **After changing
|
|
74
|
+
> `src/`, re-run `pnpm build` and commit `lib/` too**, or users would receive the old build.
|
|
75
|
+
|
|
76
|
+
After install: a **WorkBuddy XD Pool** group appears in the model picker; Settings → Plugins → **DSH WorkBuddy XD Pool** card shows pool health, per-account tokens/credits/check-in/cooldowns, plus "Detect accounts again" and "Clear all cooldowns" buttons. Works on Web / TUI profiles too (`--profile web` / `--profile dsh-tui`).
|
|
77
|
+
|
|
78
|
+
## CLI
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool status # pool accounts/cooldown + shim state (--credits, --json, --rates)
|
|
82
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool accounts # discovered accounts (--json)
|
|
83
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool doctor # diagnose discovery/cooldown/upstream
|
|
84
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool reset # clear all 429 cooldowns now
|
|
85
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool checkin # today's check-in state per account (--json)
|
|
86
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool checkin all
|
|
87
|
+
# collect every account's daily reward (or pass one label)
|
|
88
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool login # guide to adding another desktop account
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## How accounts get into the pool
|
|
92
|
+
|
|
93
|
+
Auto-discovery. Every sign-in on the WorkBuddy desktop app leaves a token-bearing snapshot; XD Pool scans them and absorbs each into the pool. So multi-account = sign in / switch accounts in the desktop app, then hit "Detect accounts again" or restart DSH.
|
|
94
|
+
|
|
95
|
+
To snapshot an extra login explicitly (e.g. to pin one account for verification):
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool import myKey
|
|
99
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool accounts
|
|
100
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool remove myKey
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Snapshots are stored under `~/.dsh/.workbuddy-xdpool/` named by the **MD5-8 prefix** of their key (so keys with Chinese, `/`, or spaces are safe). Long-lived use relies on refresh-token auto-renewal; if it lapses, re-sign-in on the desktop and `import <key> --force`.
|
|
104
|
+
|
|
105
|
+
## Configuration
|
|
106
|
+
|
|
107
|
+
Effective config is read from the plugin settings section (`settings.workbuddy-xdpool`), editable on the Models settings page and applied live:
|
|
108
|
+
|
|
109
|
+
| Field | Description | Default |
|
|
110
|
+
| --- | --- | --- |
|
|
111
|
+
| `authFile` | Override the WorkBuddy desktop auth-file path (equiv. to `WORKBUDDY_AUTH_FILE`) | auto-probed |
|
|
112
|
+
| `cooldownMs` | Per-account 429 cooldown in milliseconds | `60000` |
|
|
113
|
+
|
|
114
|
+
Or set it directly in `~/.dsh/settings.yaml`:
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
workbuddy-xdpool:
|
|
118
|
+
cooldownMs: 120000
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Architecture
|
|
122
|
+
|
|
123
|
+
- **Host side** (`src/`): registers the `workbuddy-xdpool` provider, the `workbuddy-xdpool` settings section (`settings.installSection`), four same-origin routes (status / re-scan / clear cooldowns / check-in), and account discovery + catalog seeding. The upstream client picks the CN or global origin per credential from its login domain.
|
|
124
|
+
- **Client** (`src/client/`): the browser card loaded via `dsh.client`; the collapsible shell reuses the host's `dsm-plugin-card*` style language (`--dsw-alias-*` theme tokens), with content classes namespaced `dsm-workbuddy-xdpool-*`. Check-in is the plugin's only mutating route: POST-only, loopback-origin-only, an explicit per-account `accountId`, and a pre-claim status re-check.
|
|
125
|
+
- **Build**: `tsdown` produces `lib/index.js` (host entry) + `lib/index.d.ts` (types) + `lib/bin.js` (CLI) + `lib/client.js` (CJS browser bundle wrapped in `window.__ModuleLoader__.load`). All four are committed, so an install needs no build-time script.
|
|
126
|
+
|
|
127
|
+
## Known limitations
|
|
128
|
+
|
|
129
|
+
- **Only accounts on this machine**: the pool cannot and will not perform WorkBuddy sign-in / QR auth for you (tokens are minted by the WorkBuddy desktop app's own Tencent SSO and are device-bound). Add accounts by signing in on the desktop app.
|
|
130
|
+
- Depends on WorkBuddy client endpoints (not an official public API); may need updates when WorkBuddy changes.
|
|
131
|
+
- If Windows/Linux usernames differ and Windows env vars aren't forwarded into WSL, point `WORKBUDDY_AUTH_FILE` or the config `authFile` at the real location.
|
|
132
|
+
|
|
133
|
+
## Disclaimer
|
|
134
|
+
|
|
135
|
+
- For **personal study and research only** — drives your own WorkBuddy accounts on your own machine. Do not use commercially or beyond reasonable personal use.
|
|
136
|
+
- You are responsible for complying with WorkBuddy's terms of service; any consequences (account limits, emptied quotas, outages) are your own.
|
|
137
|
+
- The authors are not liable for any direct or indirect loss from using or misusing this project.
|
|
138
|
+
- This project is not affiliated with, endorsed by, or authorized by Tencent, WorkBuddy, or DeepSeek; all names belong to their respective owners.
|
|
139
|
+
|
|
140
|
+
## Acknowledgments
|
|
141
|
+
|
|
142
|
+
This project was built with reference to the following public projects, whose copyright notices are retained as their licenses require. The reference is to **design ideas and established findings**; the code is an independent implementation, and the modules that draw on an existing pattern say so in their file headers:
|
|
143
|
+
|
|
144
|
+
- [corrinehu/dsh-workbuddy-connect](https://github.com/corrinehu/dsh-workbuddy-connect) (MIT) — the core reference for settings-section registration (`settings.installSection`) and the DSH plugin structure, client-card loading, desktop credential refresh, and loopback shim hardening.
|
|
145
|
+
- [dingminhua/dsh-connect-workbuddy](https://github.com/dingminhua/dsh-connect-workbuddy) (MIT, Copyright (c) 2026 LaoDing) — the reference for the `dsm-plugin-card*` card style language and `--dsw-alias-*` theme tokens; the **daily check-in** endpoints (`/v2/billing/meter/checkin-activity-status` and `/v2/billing/meter/daily-checkin`), the credit-package aggregation rules (monthly-cycle vs one-off gift), and picking the upstream origin per credential domain for CN/global follow interface shapes that project had already validated.
|
|
146
|
+
- [Sliverkiss/workbuddy2api](https://github.com/Sliverkiss/workbuddy2api) (MIT) — reference implementation of the upstream WorkBuddy protocol (`copilot.tencent.com` wire behavior) and credits endpoints.
|
|
147
|
+
|
|
148
|
+
All copyrights belong to their respective authors. This project takes the **reference-the-design, implement-independently** approach and does not wholesale copy any reference project's source. If an attribution is missing or wrong, please open an issue.
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
[MIT](./LICENSE)
|
package/README.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# DSH WorkBuddy XD Pool
|
|
2
|
+
|
|
3
|
+
[English](./README.en.md) | 中文
|
|
4
|
+
|
|
5
|
+
将 WorkBuddy 桌面 App 里登录过的**所有账号**自动并入一个 **DeepSeek Harness 模型池**:无需任何手动配置,你在 WorkBuddy 桌面登录的每个账号都会成为一个池成员;某个账号被限流(429)时,请求会自动切换到下一个可用账号,实现多账号自动容错轮换。
|
|
6
|
+
|
|
7
|
+
> 与单账号连接插件(如 dsh-workbuddy-connect)的区别:**XD Pool 把多账号当成常态**——它不挑账号、不做手动导入,而是把本机 WorkBuddy 桌面 App 的所有历史登录快照全部纳入一个共享池,用一个 `workbuddy-xdpool` provider 分组对外暴露,模型请求在池内自动 failover。
|
|
8
|
+
|
|
9
|
+
**插件配置卡片(设置 → 插件 → DSH WorkBuddy XD Pool)**
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
**模型选择器(倍率直接拼进 model.name:DSH 0.1.2 composer 只读 name)**
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## 功能
|
|
18
|
+
|
|
19
|
+
- **零配置开箱即用**:安装并启用后,WorkBuddy 桌面 App 里每个已登录账号都会在第一次被请求时自动发现、进入池中轮换。无需在插件里手动录入账号。
|
|
20
|
+
|
|
21
|
+
- **自动容错轮换**:池维护每个账号的 `429` 冷却状态。当某个账号触发限流进入冷却,后续请求会跳过它、落到下一个健康账号;冷却结束自动恢复。所有账号同时冷却时请求才暂停。
|
|
22
|
+
|
|
23
|
+
- **账号健康一目了然**:插件设置卡片显示池健康状态(N 账号 / X 冷却、当前会轮到哪个账号)、每个账号的令牌有效期与冷却倒计时。
|
|
24
|
+
|
|
25
|
+
- **剩余积分实时可见**:卡片按账号展示积分包(`套餐名 · 剩余 / 总量`)与合计剩余(大字绿色高亮),跟随上游实时刷新。
|
|
26
|
+
|
|
27
|
+
- **模型目录直接标注**:卡片列出当前在池内可用的模型,并标注积分倍率(如 `GLM-5.2 · x0.79`)、免费 / 限时免费 / 夜间折扣标签、图片输入能力与上下文窗口,倍率与标签跟随上游 `credits` / `tags` 实时更新。
|
|
28
|
+
|
|
29
|
+
- **每日签到**:卡片在每个账号的积分区下方提供签到按钮,并显示连签天数、每日积分与里程碑额外奖励;一键领取该账号当日签到奖励。多账号可逐个领取,无需先切换账号。领取前会重新查询状态,**今日已领取的账号不会被重复领取**。CLI 亦提供 `checkin` 命令。
|
|
30
|
+
|
|
31
|
+
- **国内版 / 国际版自动适配**:按账号凭据里的登录域名自动选择上游域名——国际版登录(`workbuddy.ai`)走 `www.workbuddy.ai`;国内版(默认)走 `copilot.tencent.com` 与 `www.codebuddy.cn`。同一池内可混用两种区域的账号,各自请求各自区域的上游。
|
|
32
|
+
|
|
33
|
+
- **三种人工动作**:卡片与 CLI 都提供「重新检测账号」(重新扫描桌面登录快照,把新登录的账号并入池)、「清除所有冷却」(立即解除全部 429 冷却)与「每日签到」三个操作。
|
|
34
|
+
|
|
35
|
+
## 安装
|
|
36
|
+
|
|
37
|
+
前置:已安装并登录 WorkBuddy 桌面 App(插件复用 App 的登录状态;多账号 = 在桌面 App 里逐个登录/切换账号即可,每次登录都会被自动吸收进池)。已针对 DSH Desktop host `0.1.2` 兼容。
|
|
38
|
+
|
|
39
|
+
> 与 host 兼容 `0.1.1-rc.2` / `0.1.2` 系:设置节安装会按 host 能力自动选择 `settings.installSection`(0.1.2-rc.1+)或自由函数(更早)。
|
|
40
|
+
|
|
41
|
+
**方式一:从 npm 安装(推荐)**
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
# dsh 不在 PATH 时,用 node ~/.dsh/profiles/node_modules/@deepseek-ai/dsh/lib/bin.js 代替 dsh
|
|
45
|
+
dsh plugin --profile desktop add dsh-workbuddy-xdpool
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
> 推荐 npm 安装:pnpm / npm 需要拉取的依赖只有插件自身(**约 1 个包,数秒完成**)。
|
|
49
|
+
> 从 GitHub 源码安装会连带安装开发依赖(构建器、测试框架等数百个包),明显更慢。
|
|
50
|
+
|
|
51
|
+
**方式二:从 GitHub 源码安装**
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
dsh plugin --profile desktop add github:aosi526/dsh-workbuddy-xdpool
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**方式三:手动注册 bundle**
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
# 1) 安装包(npm 或 GitHub 任选其一)
|
|
61
|
+
dsh plugin --profile desktop add dsh-workbuddy-xdpool
|
|
62
|
+
|
|
63
|
+
# 2) 注册 bundle:编辑 ~/.dsh/profiles/desktop/package.json,
|
|
64
|
+
# 在 "dsh" → "profile" → "bundles" 数组末尾追加 "dsh-workbuddy-xdpool"
|
|
65
|
+
|
|
66
|
+
# 3) 重启 DSH Desktop
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**本地构建**(开发者):
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
pnpm install
|
|
73
|
+
pnpm build # 产出 lib/index.js + lib/index.d.ts + lib/bin.js + lib/client.js
|
|
74
|
+
pnpm test # 26 项测试(自动容错轮换、按(账号,模型)冷却、签到守卫)
|
|
75
|
+
pnpm typecheck # 宿主侧
|
|
76
|
+
pnpm typecheck:client # 客户端
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
> **构建产物已随仓库提交**(`lib/` 不再 gitignore)。因此从 GitHub 安装时不需要任何安装期脚本,不会触发 pnpm 的「构建脚本被拦截,请放行」提示。**改动 `src/` 后请重新 `pnpm build` 并把 `lib/` 一并提交**,否则用户拿到的是旧产物。
|
|
80
|
+
|
|
81
|
+
> 注意:`pnpm install` 需用 pnpm 11(`npx pnpm@11`),必要时加 `--config.confirmModulesPurge=false --config.minimumReleaseAge=0`(pnpm 11 默认的 `minimumReleaseAge` 供应链年龄策略会拦截刚发布的 rc 包)。
|
|
82
|
+
|
|
83
|
+
装好后:模型选择器里会出现 **WorkBuddy XD Pool** 分组;设置 → 插件 → **DSH WorkBuddy XD Pool** 卡片可查看池健康、各账号令牌/积分/签到/冷却,以及「重新检测账号」「清除所有冷却」按钮与每个账号的签到按钮。
|
|
84
|
+
|
|
85
|
+
插件在 Web / TUI profile 下同样可用(`--profile web` / `--profile dsh-tui`)。
|
|
86
|
+
|
|
87
|
+
## 命令行
|
|
88
|
+
|
|
89
|
+
统一用 `dsh plugin --profile desktop exec dsh-workbuddy-xdpool <子命令>` 调用:
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool status # 池账号数/冷却 + shim 状态(--credits 查积分、--json 机器可读、--rates 看倍率)
|
|
93
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool accounts # 已发现账号(--json)
|
|
94
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool doctor # 诊断发现/冷却/上游连通性
|
|
95
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool reset # 立即清除所有 429 冷却
|
|
96
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool checkin # 查询每个账号今日签到状态(--json 机器可读)
|
|
97
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool checkin all
|
|
98
|
+
# 领取所有账号今日签到奖励;也可传账号标签只领一个
|
|
99
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool login # 引导如何在桌面再加一个账号入池
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## 池里怎么多账号?
|
|
103
|
+
|
|
104
|
+
池走**自动发现**:WorkBuddy 桌面 App 每次登录都会在本机留下一个带令牌的历史快照,XD Pool 扫描这些快照,把每个账号都吸收入池。因此多账号 = 在 WorkBuddy 桌面 App 里逐个登录 / 切换账号即可,之后点卡片「重新检测账号」或重启 DSH,新账号自动成为池成员。
|
|
105
|
+
|
|
106
|
+
若你想对桌面 App 之外的某个登录做**显式快照**(例如临时固定某个账号再验证),也可手动导入:
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
# 在 WorkBuddy 桌面 App 登录账号后(key 自己起名):
|
|
110
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool import myKey
|
|
111
|
+
# 查看/删除已导入快照:
|
|
112
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool accounts
|
|
113
|
+
dsh plugin --profile desktop exec dsh-workbuddy-xdpool remove myKey
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
导入快照以 key 的 **MD5 前 8 位**命名落在 `~/.dsh/.workbuddy-xdpool/`(key 本身记在文件里),中文、带 `/`、带空格的 key 都安全;长期使用靠 refresh token 自动续期,失效则回到桌面重新登录后 `import <key> --force` 覆盖。
|
|
117
|
+
|
|
118
|
+
## 配置
|
|
119
|
+
|
|
120
|
+
池的有效配置经插件设置节(`settings.workbuddy-xdpool`)读取,模型设置页可改,改动即时生效:
|
|
121
|
+
|
|
122
|
+
| 字段 | 说明 | 默认 |
|
|
123
|
+
| --- | --- | --- |
|
|
124
|
+
| `authFile` | 覆盖 WorkBuddy 桌面 auth 文件路径(跨平台探测异常时用,等价于 `WORKBUDDY_AUTH_FILE`) | 自动探测 |
|
|
125
|
+
| `cooldownMs` | 单账号 429 冷却时长(毫秒) | `60000` |
|
|
126
|
+
|
|
127
|
+
也可直接写在 `~/.dsh/settings.yaml`:
|
|
128
|
+
|
|
129
|
+
```yaml
|
|
130
|
+
workbuddy-xdpool:
|
|
131
|
+
cooldownMs: 120000
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## 架构
|
|
135
|
+
|
|
136
|
+
- **宿主侧**(`src/`,DSH 主进程内):
|
|
137
|
+
- `index.ts` —— 注册 `workbuddy-xdpool` provider、`workbuddy-xdpool` 设置节(`settings.installSection`)、4 条同源路由(状态 / 重新检测 / 清除冷却 / 签到)、账号发现与模型目录播种。
|
|
138
|
+
- `accounts.ts` —— `WorkBuddyAccountPool`:读本机 WorkBuddy 桌面 auth 快照、429 冷却、round-robin failover 与 token 刷新。
|
|
139
|
+
- `catalog.ts` / `upstream.ts` —— 上游模型目录(含每模型积分倍率、免费/图片能力标签)、积分查询与每日签到的上游客户端(按凭据域名自动切换国内 / 国际版域名)。
|
|
140
|
+
- `web-status.ts` / `status-paths.ts` —— 卡片消费的同源状态文档与路由;签到是本插件唯一的写操作,按「POST + 回环来源 + 显式 accountId + 领取前二次确认」四重守卫。
|
|
141
|
+
- `bin.ts` —— 上述 CLI。
|
|
142
|
+
- **客户端**(`src/client/`,浏览器卡片,经 `dsh.client` 由宿主加载):折叠卡片外壳沿用宿主内置卡的 `dsm-plugin-card*` 样式语言(`--dsw-alias-*` 主题变量),内容用 `dsm-workbuddy-xdpool-*` 前缀,绝不污染宿主其它卡片;命名空间 `settings.workbuddy-xdpool`。
|
|
143
|
+
- **构建**:`tsdown` 产出 `lib/index.js`(宿主入口)+ `lib/index.d.ts`(类型)+ `lib/bin.js`(CLI)+ `lib/client.js`(CJS,`window.__ModuleLoader__.load` 包裹的浏览器 bundle)。四个产物均随仓库提交,因此安装时不需要任何构建脚本。
|
|
144
|
+
|
|
145
|
+
## 已知限制
|
|
146
|
+
|
|
147
|
+
- **仅使用本机桌面 App 的账号**:池不会、也无法替你发起 WorkBuddy 的登录/扫码(token 由 WorkBuddy 桌面 App 自己的腾讯 SSO 登录铸造并设备绑定)。加池账号 = 在 WorkBuddy 桌面 App 里登录/切换,XD Pool 自动吸收。
|
|
148
|
+
- 依赖 WorkBuddy 客户端接口(非官方开放 API),WorkBuddy 更新后插件可能需要随之调整;若某账号 refresh token 失效,回到桌面重新登录即可。
|
|
149
|
+
- 若 Windows 与 Linux 用户名不同且 Windows 环境变量未传入 WSL,请用 `WORKBUDDY_AUTH_FILE` 或配置节的 `authFile` 指定实际位置。
|
|
150
|
+
|
|
151
|
+
## 免责声明
|
|
152
|
+
|
|
153
|
+
- 本项目**仅供个人学习和研究使用**,仅驱动使用者自己的 WorkBuddy 账号在本机调用,请勿用于商业用途或超出个人合理使用的场景。
|
|
154
|
+
- 使用者需遵守 WorkBuddy 的服务条款;因使用本项目产生的任何后果(包括但不限于账号被限制、额度被清空、服务中断),由使用者自行承担。
|
|
155
|
+
- 本项目作者不对任何因使用或滥用本项目产生的直接或间接损失负责。
|
|
156
|
+
- 本项目与腾讯、WorkBuddy、DeepSeek 均无关联,未获其授权或认可;文中出现的名称仅用于描述兼容关系,其商标权利归各自所有。
|
|
157
|
+
|
|
158
|
+
## 致谢
|
|
159
|
+
|
|
160
|
+
本项目的实现参考了以下已公开的项目,并按其许可证要求保留版权声明。参考方向为**设计思路与既有结论**,代码为独立实现;关键模块在源文件头部注释中也标注了所参考的项目与模式:
|
|
161
|
+
|
|
162
|
+
- [corrinehu/dsh-workbuddy-connect](https://github.com/corrinehu/dsh-workbuddy-connect)(MIT)—— 设置节注册(`settings.installSection`)与 DSH 插件结构、客户端卡片加载机制、桌面端凭据刷新与 loopback shim 加固的核心参照;本项目沿用其「宿主通过 installSection 挂卡片」的打通路径。
|
|
163
|
+
- [dingminhua/dsh-connect-workbuddy](https://github.com/dingminhua/dsh-connect-workbuddy)(MIT,Copyright (c) 2026 LaoDing)—— `dsm-plugin-card*` 卡片样式语言与 `--dsw-alias-*` 主题变量的参照实现;**每日签到**(`/v2/billing/meter/checkin-activity-status` 与 `/v2/billing/meter/daily-checkin`)、积分包聚合口径(月度周期套餐 / 一次性礼包区分)与国内 / 国际版按 `domain` 选择上游域名的做法,参考了该项目已验证的接口形态。
|
|
164
|
+
- [Sliverkiss/workbuddy2api](https://github.com/Sliverkiss/workbuddy2api)(MIT)—— WorkBuddy 上游协议(`copilot.tencent.com` 的 wire behavior)与积分接口的参照实现。
|
|
165
|
+
|
|
166
|
+
以上项目的版权归各自作者所有。本项目采用**参考设计思路 + 独立实现**的方式,未整体复制任何参考项目的源码。若标注有遗漏或不当之处,欢迎提交 issue 指正。
|
|
167
|
+
|
|
168
|
+
## 许可证
|
|
169
|
+
|
|
170
|
+
[MIT](./LICENSE)
|
|
Binary file
|
|
Binary file
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Register the WorkBuddy XD Pool provider. Discovery is read-only: the plugin
|
|
2
|
+
# reuses the WorkBuddy desktop app's own sign-in files and never starts a
|
|
3
|
+
# separate OAuth flow. Requests rotate across every discovered account.
|
|
4
|
+
- insert:
|
|
5
|
+
- id: llm-workbuddy-xdpool
|
|
6
|
+
name: dsh-workbuddy-xdpool
|