dsh-xdpool 2.1.0 → 2.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/README.en.md CHANGED
@@ -2,11 +2,15 @@
2
2
 
3
3
  <p align="center">
4
4
  <a href="https://www.npmjs.com/package/dsh-xdpool"><img src="https://img.shields.io/npm/v/dsh-xdpool?style=flat-square&label=npm&color=cb3837" alt="npm version"></a>
5
- <a href="https://www.npmjs.com/package/dsh-xdpool"><img src="https://img.shields.io/npm/d18m/dsh-xdpool?style=flat-square&label=downloads&color=cb3837" alt="npm downloads"></a>
5
+ <a href="https://www.npmjs.com/package/dsh-workbuddy-xdpool"><img src="https://img.shields.io/badge/downloads-9k%2Fmo%20%28prev%20name%29-cb3837?style=flat-square" alt="npm downloads under the previous name"></a>
6
6
  <a href="LICENSE"><img src="https://img.shields.io/github/license/XDTrees/dsh-xdpool?style=flat-square" alt="MIT license"></a>
7
7
  <a href="https://github.com/XDTrees/dsh-xdpool/stargazers"><img src="https://img.shields.io/github/stars/XDTrees/dsh-xdpool?style=flat-square" alt="GitHub stars"></a>
8
8
  </p>
9
9
 
10
+ <p align="center">
11
+ <sub>Download stats still come from the previous package name <code>dsh-workbuddy-xdpool</code> (8,976/month as of 2026-10-12 — every download before the rename; the live shields badge kept getting rate-limited by the npm upstream, hence the snapshot figure). The new <code>dsh-xdpool</code> package accumulates its own stats, and the badge switches back to live data later.</sub>
12
+ </p>
13
+
10
14
  English | [中文](./README.md)
11
15
 
12
16
  **Every free model quota you can get your hands on, wired into one DSH model pool.**
@@ -27,7 +31,7 @@ Then it grew into seven pages. Beyond the account pool: sign in to thirteen vend
27
31
 
28
32
  **It also throws in a full points-automation suite**: check-ins, task rewards, streak redemption, the buddy trip — all the chores you'd otherwise click through every day, done in the background.
29
33
 
30
- > **How this differs from the single-account connectors**: plugins like `dsh-workbuddy-connect` handle one account at a time. XD Pool treats **multiple accounts as the normal case** — it doesn't pick favourites or ask you to import anything. Every sign-in snapshot on this machine goes into one shared pool, exposed as a single `xdpool` provider group, with automatic failover inside.
34
+ > **How this differs from the single-account connectors**: plugins like `dsh-workbuddy-connect` handle one account at a time. XD Pool treats **multiple accounts as the normal case** — it doesn't pick favourites or ask you to import anything. Every account you've switched through on the desktop app is remembered across restarts, exposed as a single `xdpool` provider group, with automatic failover inside.
31
35
 
32
36
  > **Upgrading from the old name**: this plugin used to be `dsh-workbuddy-xdpool`. Your data is **carried over automatically** (API keys, ignore list, account pin). The one thing you may need to do by hand is a default model pinned to an old id — see [Upgrading from an older version](#upgrading-from-an-older-version).
33
37
 
@@ -46,9 +50,9 @@ Then it grew into seven pages. Beyond the account pool: sign in to thirteen vend
46
50
 
47
51
  ![Aggregate channels: the aggregate switch, a search box, and the category filters — all 76 / API key 60 / free 1 / has free quota 10 / local 3 / needs authorization 2](assets/aggregate-channels.png)
48
52
 
49
- **The plugin card (Settings → Plugins → DSH WorkBuddy XD Pool)**
53
+ **Account credit detail (a pool account: credit packages, streak, today's check-in, the credit reserve)**
50
54
 
51
- ![WorkBuddy pool card: CN/global tabs, pool health, account panels with credit packages, per-account check-in, the points-automation panel, and the model directory](assets/settings-card.png)
55
+ ![Account credit detail: the active account expanded shows the credit total, a 16-day streak, the daily +100 credits, a checked-in-today button, CodeBuddy package balances with their expiry dates, and the credit-reserve input](assets/account-credits.png)
52
56
 
53
57
  **The points-automation panel**
54
58
 
@@ -210,7 +214,7 @@ dsh plugin --profile desktop exec dsh-xdpool login # guide to adding another
210
214
 
211
215
  ## How accounts get into the pool
212
216
 
213
- 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.
217
+ The desktop app keeps only the **currently signed-in** account on disk (each switch overwrites the same file), so XD Pool remembers accounts itself: every time you switch sign-ins in the desktop app, the outgoing account is captured into `~/.dsh/.xdpool/accounts.json` and **survives restarts**. Hit "Detect accounts again" or just start using the pool — every historical account comes back.
214
218
 
215
219
  To snapshot an extra login explicitly (e.g. to pin one account for verification):
216
220
 
@@ -220,7 +224,7 @@ dsh plugin --profile desktop exec dsh-xdpool accounts
220
224
  dsh plugin --profile desktop exec dsh-xdpool remove myKey
221
225
  ```
222
226
 
223
- Snapshots are stored under `~/.dsh/.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`.
227
+ Imported snapshots live in the same directory, `~/.dsh/.xdpool/`, and every scan absorbs them into the pool — they are no longer written and never read back. Snapshots are 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`.
224
228
 
225
229
  ## Configuration
226
230
 
@@ -242,7 +246,7 @@ xdpool:
242
246
 
243
247
  - **Host side** (`src/`, inside the DSH main process)
244
248
  - `index.ts` — registers the `xdpool` provider, the `xdpool` settings section, the same-origin routes (status / re-scan / clear cooldowns / check-in / automation run / credit reserve), plus account discovery and catalog seeding.
245
- - `accounts.ts` — `WorkBuddyAccountPool`: reads the desktop auth snapshots, 429 cooldowns, rotation and token refresh; account disabling and credit reserves live here too.
249
+ - `accounts.ts` — `WorkBuddyAccountPool`: discovers and durably stores local WorkBuddy accounts (`account-store.ts`), 429 cooldowns, rotation and token refresh; account disabling and credit reserves live here too.
246
250
  - `scheduler.ts` — the points-automation scheduler: runs five jobs on local time points (check-in / report / tasks / streak / travel), persists the daily earnings ledger, and backs the card's "Run now" button with the same code path.
247
251
  - `task-events.ts` — builds the 13 task event chains. Each chain is plain data plus the fingerprint channel it must go out on (desktop or web); the tasks that need a REAL conversation (skill, experts) open one here to get the server-side id.
248
252
  - `catalog.ts` / `upstream.ts` — the upstream client: model catalog (with per-model multipliers and free / image tags), credits, check-in, and every automation endpoint, switching CN/global by credential domain.
package/README.md CHANGED
@@ -2,11 +2,15 @@
2
2
 
3
3
  <p align="center">
4
4
  <a href="https://www.npmjs.com/package/dsh-xdpool"><img src="https://img.shields.io/npm/v/dsh-xdpool?style=flat-square&label=npm&color=cb3837" alt="npm version"></a>
5
- <a href="https://www.npmjs.com/package/dsh-xdpool"><img src="https://img.shields.io/npm/d18m/dsh-xdpool?style=flat-square&label=downloads&color=cb3837" alt="npm downloads"></a>
5
+ <a href="https://www.npmjs.com/package/dsh-workbuddy-xdpool"><img src="https://img.shields.io/badge/downloads-9k%2F%E6%9C%88%20%28%E6%97%A7%E5%90%8D%29-cb3837?style=flat-square" alt="npm downloads under the previous name"></a>
6
6
  <a href="LICENSE"><img src="https://img.shields.io/github/license/XDTrees/dsh-xdpool?style=flat-square" alt="MIT license"></a>
7
7
  <a href="https://github.com/XDTrees/dsh-xdpool/stargazers"><img src="https://img.shields.io/github/stars/XDTrees/dsh-xdpool?style=flat-square" alt="GitHub stars"></a>
8
8
  </p>
9
9
 
10
+ <p align="center">
11
+ <sub>下载量统计沿用旧包名 <code>dsh-workbuddy-xdpool</code>(截至 2026-10-12 为 8,976 次/月,改名前的全部下载;shields 的实时徽章常被 npm 上游限流,所以这里用了快照数字)。新包 <code>dsh-xdpool</code> 的统计会随时间累积,之后徽章会换回实时数据。</sub>
12
+ </p>
13
+
10
14
  [English](./README.en.md) | 中文
11
15
 
12
16
  **把你手上所有能白嫖的模型额度,接进 DSH 的同一个模型池。**
@@ -27,7 +31,7 @@
27
31
 
28
32
  **另外附送一整套「积分自动化」**:签到、领任务奖励、连登兑换、开猫猫旅行……这些每天都要手动点一遍的活儿,插件在后台替你干完了。
29
33
 
30
- > **和单账号连接插件的区别**:`dsh-workbuddy-connect` 那类插件是「一次一个账号」。XD Pool 把**多账号当默认情况**——不挑号、不手动导入,本机 WorkBuddy 所有历史登录快照全部收进一个共享池,对外用一个 `xdpool` provider 分组,池内自动容错。
34
+ > **和单账号连接插件的区别**:`dsh-workbuddy-connect` 那类插件是「一次一个账号」。XD Pool 把**多账号当默认情况**——不挑号、不手动导入,你在桌面 App 换登过的每个号都被池记下并跨重启保存,对外用一个 `xdpool` provider 分组,池内自动容错。
31
35
 
32
36
  > **从旧名升级**:这个插件以前叫 `dsh-workbuddy-xdpool`。改名后**旧数据会自动接过来**(你的 API key、忽略名单、账号 pin 都还在);唯一需要你动手的是「默认模型」如果指向旧 id,见[从旧版升级](#从旧版升级)。
33
37
 
@@ -46,9 +50,9 @@
46
50
 
47
51
  ![聚合渠道:聚合开关、搜索框、全部分类 76 / API Key 60 / 免费 1 / 有免费额度 10 / 本地 3 / 需授权 2 的分类筛选](assets/aggregate-channels.png)
48
52
 
49
- **插件配置卡片(设置 → 「XD Pool」一节)**
53
+ **账号积分详情(池中账号:积分包、连签天数、今日已签、保留积分)**
50
54
 
51
- ![WorkBuddy 池设置卡片:国内版 / 国际版切换栏、池健康状态、账号面板、积分包与合计、每账号每日签到、积分自动化面板、模型管理](assets/settings-card.png)
55
+ ![账号积分详情:当前使用的账号展开后显示合计积分、连签 16 天、每日 +100 积分、今日已签按钮、CodeBuddy 积分包余额与到期时间,以及保留积分输入框](assets/account-credits.png)
52
56
 
53
57
  **积分自动化面板**
54
58
 
@@ -66,7 +70,7 @@
66
70
 
67
71
  ### 一、多账号池
68
72
 
69
- - **零配置**:装上、打开,就完事了。WorkBuddy 桌面 App 里每个登过的账号都会被自动发现并入池,不需要在插件里录任何东西。
73
+ - **零配置**:装上、打开,就完事了。WorkBuddy 桌面 App 里每个登过的账号都会被自动发现、持久保存并入池(重启不丢),不需要在插件里录任何东西。
70
74
 
71
75
  - **自动容错换号**:池子记着每个账号的限流状态。某个号触发 429 就冷却它,后面的请求自动落到下一个健康的号上;冷却结束自动恢复。所有号都在冷却时,请求才排队等待。
72
76
  - **四种账号分配方式**:`priority` 先用完一个号;`round-robin` 按顺序轮换;`balanced` 随机抽、偏向闲置久的;`sticky` 让**一个对话只用一个账号,新对话才换下一个**——上游缓存按账号隔离,中途换号等于把整段对话的缓存作废,`sticky` 就是为这件事准备的。卡片上点一下即可切换,默认仍是 `priority`。
@@ -217,7 +221,7 @@ dsh plugin --profile desktop exec dsh-xdpool login # 教你怎么在桌面
217
221
 
218
222
  ## 池里怎么多账号?
219
223
 
220
- 池子走**自动发现**:WorkBuddy 桌面 App 每次登录都会在本机留一个带令牌的历史快照,XD Pool 扫描这些快照,把每个账号都收进池。所以多账号 = 在桌面 App 里换着登几次,之后点卡片上的「重新检测账号」或者重启 DSH,新号就自动进池了。
224
+ 桌面 App 同一时间只保留**当前登录账号**的凭据(每次换号都会覆盖同一个文件),所以 XD Pool 自己把账号记下来:你在桌面 App 里换着登几个号,每个号在切走的瞬间就被池收进 `~/.dsh/.xdpool/accounts.json` 持久保存——**重启 DSH 也不会丢**。之后点卡片上的「重新检测账号」,或者直接开始用,池都会带着全部历史账号服务。
221
225
 
222
226
  如果你想给桌面 App 之外的一次登录做个**显式快照**(比如临时固定某个号做验证),也可以手动导入:
223
227
 
@@ -229,7 +233,7 @@ dsh plugin --profile desktop exec dsh-xdpool accounts
229
233
  dsh plugin --profile desktop exec dsh-xdpool remove myKey
230
234
  ```
231
235
 
232
- 导入的快照以 key 的 **MD5 前 8 位**命名,放在 `~/.dsh/.xdpool/`(key 本身记在文件里),中文、带 `/`、带空格的 key 都安全。长期使用靠 refresh token 自动续期;失效了就回桌面重新登录,再 `import <key> --force` 覆盖。
236
+ 导入的快照与自动保存的账号存在同一个目录 `~/.dsh/.xdpool/` 下,每次扫描都会被一并收进池——不再是「导入了但没人读」。快照以 key 的 **MD5 前 8 位**命名(key 本身记在文件里),中文、带 `/`、带空格的 key 都安全。长期使用靠 refresh token 自动续期;失效了就回桌面重新登录,再 `import <key> --force` 覆盖。
233
237
 
234
238
  ## 配置
235
239
 
@@ -255,7 +259,7 @@ xdpool:
255
259
 
256
260
  - **宿主侧**(`src/`,跑在 DSH 主进程里)
257
261
  - `index.ts` —— 注册 `xdpool` provider、`xdpool` 设置节、各条同源路由(状态 / 重新检测 / 清除冷却 / 签到 / 自动化运行 / 保留积分),以及账号发现与模型目录播种。
258
- - `accounts.ts` —— `WorkBuddyAccountPool`:读本机 WorkBuddy 桌面 auth 快照、429 冷却、轮换与 token 刷新;账号停用与积分保留也在这里。
262
+ - `accounts.ts` —— `WorkBuddyAccountPool`:发现并持久保存本机 WorkBuddy 账号(`account-store.ts` 落盘)、429 冷却、轮换与 token 刷新;账号停用与积分保留也在这里。
259
263
  - `scheduler.ts` —— 积分自动化的调度器:按本地时点跑五个任务(签到 / 上报 / 任务 / 连登 / 旅行),每日收益账本落盘,手动「立即运行」走的是同一套逻辑。
260
264
  - `task-events.ts` —— 13 条任务事件链的构造。每条链都是纯数据,外加它该走哪个指纹通道(桌面 / 网页);需要真实会话的任务(技能、专家)在这里先开一次真对话,拿到服务端 id。
261
265
  - `catalog.ts` / `upstream.ts` —— 上游模型目录(含每模型积分倍率、免费 / 图片能力标签)、积分查询、签到、自动化各接口的上游客户端(按凭据域名自动切国内外)。
Binary file
package/cordis.patch.yml CHANGED
@@ -1,49 +1,48 @@
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-xdpool
6
- name: dsh-xdpool
7
- # Bring up billion-context alongside us, so the card's billion page has a live
8
- # compressor to read instead of asking the user to install a second plugin.
9
- #
10
- # WHY THIS ROW LIVES HERE
11
- #
12
- # billion-context is a full plugin in its own right: it owns a loopback proxy, a
13
- # compaction lane and its own CLI. Nothing about it is a feature of this pool, and
14
- # this layer must never configure it — the row below only asks the host to mount
15
- # the package, and every other decision stays billion-context's.
16
- #
17
- # WHY IT IS NOT A DEPENDENCY OF OURS IN THE USUAL SENSE
18
- #
19
- # `dependencies` would make this a transitive requirement of the pool: upgrading
20
- # the pool would silently move the compressor's version under a user who only
21
- # ever installed the pool, and uninstalling the pool would take a feature the user
22
- # may still be using. Declaring it optional keeps both directions under the
23
- # user's control while still letting the host install it.
24
- #
25
- # THE DUPLICATE-MOUNT HAZARD, AND WHY IT IS SAFE HERE
26
- #
27
- # Mounting billion-context twice throws. The proxy provides a cordis service
28
- # under its own name, and the host refuses a second registration
29
- # (`service "…" has been registered at <…>`) rather than handing back the first
30
- # one, so the loser dies inside its own `apply`. That is exactly the failure this
31
- # pool already hit once with the shared sign-in channel pack, and it is why
32
- # `src/index.ts` checks the loader for a live entry before mounting anything.
33
- #
34
- # This row does not need that guard of its own: the host's own loader disables a
35
- # row whose module is already mounted elsewhere rather than letting it collide,
36
- # and the row id is unique to this layer. If a user has already added
37
- # billion-context to their profile themselves, this row is simply a second copy
38
- # of an existing layer and the host resolves that, not us.
39
- #
40
- # THE ID IS OURS AND MUST STAY OURS
41
- #
42
- # `bili-native` is declared by billion-context's own patch. A non-insert patch
43
- # replaces a row's whole config with no deep merge, so we must not restate its
44
- # config here — we only ever insert a row, which is additive and safe. Naming
45
- # this row `billion-context-xdpool` rather than `bili-native` keeps the two layers
46
- # from ever addressing the same entry.
47
- - insert:
48
- - id: billion-context-xdpool
49
- name: billion-context
1
+ # Register the XD Pool provider. Discovery is read-only: the plugin reuses the
2
+ # WorkBuddy desktop app's own sign-in files and never starts a separate OAuth
3
+ # flow. Requests rotate across every discovered account.
4
+ - insert:
5
+ - id: llm-xdpool
6
+ name: dsh-xdpool
7
+ # billion-context is deliberately NOT mounted by this layer.
8
+ #
9
+ # 2.0.0 tried to. It inserted a row (`billion-context-xdpool`) so a profile that
10
+ # had not installed the compressor would get one for free, and `src/billion-mount.ts`
11
+ # held a runtime `create()` as a second path for the same job. Measured against a
12
+ # profile that had ALREADY installed billion-context — which is the normal state
13
+ # for anyone using that feature, since `bili-native` comes from billion-context's
14
+ # own `dsh.bundle.patch.yml` — neither safeguard held:
15
+ #
16
+ # the host did not disable our duplicate row, and it did not resolve it to a
17
+ # no-op. It left `enabled: true` and ran the fiber to `failed`, because
18
+ # billion-context registers a cordis service under its own name and a second
19
+ # registration is refused outright (`service "…" has been registered at <…>`).
20
+ #
21
+ # So every user who had installed billion-context got a permanently failed entry
22
+ # in their plugin list — visible, unexplained, and pointing at us.
23
+ #
24
+ # The row below is kept, but DISABLED, for three reasons:
25
+ #
26
+ # 1. Addressability. `disabled: true` keeps the row's id resolvable, so a
27
+ # profile that wants to flip it on can do so with one edit instead of
28
+ # inventing a row.
29
+ # 2. It states the decision where the old attempt lived, where the next person
30
+ # to wonder "why doesn't the pool bring up the compressor?" will look.
31
+ # 3. It keeps `bili-native` (billion-context's own row) as the ONLY mount of
32
+ # that module, which is the arrangement that actually works.
33
+ #
34
+ # CONSEQUENCE, STATED PLAINLY
35
+ #
36
+ # A profile that has not installed billion-context sees the billion card report
37
+ # "not installed". That is the honest reading of the facts, and it is already a
38
+ # first-class state on that page — the page distinguishes not-installed from
39
+ # no-answer from ready precisely so this case reads as information rather than
40
+ # as a bug. Installing billion-context remains a decision the user makes; the
41
+ # pool no longer makes it for them.
42
+ #
43
+ # `src/billion-mount.ts` no longer calls `create()` for the same reason: with
44
+ # this row disabled, a runtime create would fight the very row it sits beside.
45
+ # The function still runs — it is what lets the card distinguish
46
+ # already-installed from not-installed — it just never mounts anything.
47
+ - id: billion-context-xdpool
48
+ disabled: true