# DSH WorkBuddy XD Pool
English | [中文](./README.md) 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. > 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. **Settings card (Settings → Plugins → DSH WorkBuddy XD Pool)**  **Model picker (domestic and international appear as two separate supplier groups; the rate multiplier is baked into model.name because the DSH 0.1.2 composer only reads name)**  **Domestic / international dual suppliers (each with its own accounts, credits and models, usable at the same time)**  ## Features - **Zero-config**: install, enable, done. Every account signed into the WorkBuddy desktop app is auto-discovered into the rotation pool on first use. - **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. - **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. - **Live remaining credits**: per-account credit packages (`package · remain / size`) and a big green total, refreshed from upstream in real time. - **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`. - **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. - **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. - **Three manual actions**: re-detect desktop sign-ins, clear all cooldowns, and daily check-in — available both on the card and via the CLI. ## Install 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). **Option A — install from npm (recommended)** ```sh # if dsh is not on PATH, use node ~/.dsh/profiles/node_modules/@deepseek-ai/dsh/lib/bin.js instead dsh plugin --profile desktop add dsh-workbuddy-xdpool ``` > npm is the fast path: the only dependency pulled in is the plugin itself (**roughly 1 package, a few seconds**). > Installing from GitHub source also installs the dev toolchain (bundler, test runner, hundreds of packages), which is markedly slower. **Option B — install from GitHub source** ```sh dsh plugin --profile desktop add github:aosi526/dsh-workbuddy-xdpool ``` **Option C — manual bundle registration** ```sh # 1) install the package (npm or GitHub) dsh plugin --profile desktop add dsh-workbuddy-xdpool # 2) register the bundle: edit ~/.dsh/profiles/desktop/package.json and append # "dsh-workbuddy-xdpool" to the end of the "dsh" → "profile" → "bundles" array # 3) restart DSH Desktop ``` **Build locally** (developers): ```sh pnpm install pnpm build # outputs lib/index.js + lib/index.d.ts + lib/bin.js + lib/client.js pnpm test # 26 tests (failover rotation, per-(account,model) cooldowns, check-in guards) pnpm typecheck # host side pnpm typecheck:client # client side ``` > `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. > **The built output is committed** (`lib/` is no longer ignored). A GitHub install therefore runs > no install-time script and never hits pnpm's "build scripts are blocked" prompt. **After changing > `src/`, re-run `pnpm build` and commit `lib/` too**, or users would receive the old build. 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`). ## CLI ```sh dsh plugin --profile desktop exec dsh-workbuddy-xdpool status # pool accounts/cooldown + shim state (--credits, --json, --rates) dsh plugin --profile desktop exec dsh-workbuddy-xdpool accounts # discovered accounts (--json) dsh plugin --profile desktop exec dsh-workbuddy-xdpool doctor # diagnose discovery/cooldown/upstream dsh plugin --profile desktop exec dsh-workbuddy-xdpool reset # clear all 429 cooldowns now dsh plugin --profile desktop exec dsh-workbuddy-xdpool checkin # today's check-in state per account (--json) dsh plugin --profile desktop exec dsh-workbuddy-xdpool checkin all # collect every account's daily reward (or pass one label) dsh plugin --profile desktop exec dsh-workbuddy-xdpool login # guide to adding another desktop account ``` ## How accounts get into the pool 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. To snapshot an extra login explicitly (e.g. to pin one account for verification): ```sh dsh plugin --profile desktop exec dsh-workbuddy-xdpool import myKey dsh plugin --profile desktop exec dsh-workbuddy-xdpool accounts dsh plugin --profile desktop exec dsh-workbuddy-xdpool remove myKey ``` 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