dsh-wtq-pool 1.1.0 → 1.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 CHANGED
@@ -1,11 +1,25 @@
1
1
  # 更新说明
2
2
 
3
+ ## [1.2.0]
4
+
5
+ - 品牌:模型提供商 ID 由 `xdpool-*` 改为 `wtqpool-*`;升级后模型选择需要重新选一次。
6
+
7
+ ## [1.1.1]
8
+
9
+ - 登录:刷新失败的账号在本轮请求内跳过,不再反复重试同一个账号;200 信封的登录失效也区分「被拒」与「刷新失败」,后者不再写 6 小时停用。
10
+ - 渠道校验:11128 出现在 HTTP 200 的 JSON 信封时同样折叠系统消息并重试一次,通过的提示照常按 region 记住。
11
+ - 签到:Trae、Qoder 的单账号签到在超时后继续占用守卫,避免第二次点击与仍在进行的领取并行。
12
+ - Qoder:展示用量只带到期时间、没有可用额度时回退到 quota 路由,不再直接报「用量不可用」。
13
+ - 设置:宿主推送的旧设置文档不再覆盖刚保存的账号停用、移除与模型选择;DSH 重载保留 provider 声明与 Trae/Qoder 目录,地址漂移按实际发布地址判断。
14
+ - 面板与文档:保活卡片只在 WorkBuddy 页签显示;补充刷新重置时间的 2 小时上限、输入框积分关闭后的慢轮询、助手历史改名说明。
15
+
3
16
  ## [1.1.0]
4
17
 
5
18
  - 登录:多处登录按签发时间取最新;续期写回插件自管文件;被拒登录先刷新重试,刷新令牌也失效才挂起 6 小时,挂起期间跳过轮询、签到、成长与保活。
6
19
  - 账号限制:11140 标注「已限制」并换号,全部受限回 403 提示申诉;11158 按账号 × 模型停用 24 小时,全部被拒回 400。
7
20
  - 网络:刷新超时、限流或网络故障时账号留在轮换;网络错误结束本轮,不冷却账号。
8
21
  - 网关:200 信封里的账号级业务码按原因处理;缺结束帧时补 `finish_reason` 与 `[DONE]`;Trae、Qoder 等待期间发保活;路由支持查询串;空正文回 502。
22
+ - 对话:国内版渠道校验(11128)拒绝提示词时,自动把系统消息并入首条用户消息并重试一次;通过的提示按 region 记住,后续轮次不再重复这次往返。移除「客户端名称」开关。
9
23
  - 面板:区分「需重新登录」「已限制」与普通冷却;删除立即消失且不被桌面快照带回;签到防连点;重载后提示刷新。
10
24
  - 令牌保活:独立卡片,按签发时间续期;桌面遗留快照由插件接管,正在使用的由桌面端续期。
11
25
  - 连接检查:网关启动失败原因与端口记入报告,停用、重启与卸载时清除;重载清掉未完成的设备登录。
package/README.en.md CHANGED
@@ -77,7 +77,7 @@ To run the preview locally, clone the repository, run `node docs/serve.cjs`, and
77
77
  - Gateway responses are SSE streams of `chat.completion.chunk`; the `stream` field in the request body does not change the format.
78
78
  - Credit automation: automatic check-in is off by default. Once enabled, the scheduled run and "Run now" perform the same round: the three check-ins plus the WorkBuddy streak bonus and cat travel. The upstream advances the streak on a conversation, so the round reports one chat activity per account before reading the streak tiers, and a tier that comes due is unlocked and collected without the user opening WorkBuddy to send a message. The streak step also spends a make-up card when yesterday was missed, collects the one-off starter gift and campaign compensation, and spends the draws a redeemed tier awards. These growth steps run for domestic and international accounts alike; cat travel runs for domestic accounts only, because the international host has no such API.
79
79
  - Token keep-alive: on demand, on a card of its own. A snapshot the desktop client left behind is adopted into the plugin's own sign-in directory when the pool scans, and the plugin renews it from then on; the desktop app renews the sign-in it is using. "Refresh now" works on the plugin's own copies and judges by issue time: anything signed more than six hours ago is refreshed, and a token within five minutes of expiry takes the same path. The answer is written back into the sign-in file the plugin owns, so a sign-in the upstream refused is found the same day. When one account has sign-ins in several places, the newest issue time wins. Disabled accounts, disabled regions and accounts whose sign-in the upstream refused stay out.
80
- - Composer credits: with `showComposerPoints` on, the composer toolbar shows the balance of the account behind the current model; click it to switch accounts, and switching the feature off stops the readout's polling.
80
+ - Composer credits: with `showComposerPoints` on, the composer toolbar shows the balance of the account behind the current model; click it to switch accounts. Switching the feature off hides the readout and slows the poll to once every five minutes, so switching it back on recovers without a model change.
81
81
  - Panel: account and pool state, model selection, the connection check and the growth centre all live in the account-pool card on the plugin page. The model catalogue loads at startup and refreshes on demand once its cache expires; it does not poll while idle. Disabled accounts and accounts whose sign-in the upstream refused are never probed.
82
82
  - Connection check: every finding carries a verdict. A gateway that is not listening, a catalogue that could not be read, a published address that differs from the one actually bound, and a provider the host did not accept all count as failures and say what to change. A gateway whose start failed is reported with the reason, and the panel surfaces address drift as a reload hint. A check that fails on its own becomes a finding, and the rest of the report still appears.
83
83
 
@@ -92,6 +92,8 @@ dsh plugin --profile desktop add $package
92
92
 
93
93
  Requires DeepSeek Harness on the 0.2.0 line (`engines.dsh` in `package.json`: `>=0.2.0-rc.1 <0.2.1`) and Node `^22.19.0 || >=24.0.0`.
94
94
 
95
+ > After upgrading from 1.1.x to 1.2.0, provider ids are `wtqpool-*`; reselect your model once.
96
+
95
97
  Replace `desktop` with the profile name actually in use. If `dsh` is not on `PATH`, use the CLI in its installation directory. The npm name `dsh-wtq-pool` and the repository URL also work as install sources; a repository-URL install builds from source through the `prepare` script, which requires `allowBuilds: dsh-wtq-pool: true` in the profile's `pnpm-workspace.yaml` and a pinned commit.
96
98
 
97
99
  **Where the panel is**: open **Plugins** in the sidebar, then 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, reload the plugin as the note at the top of the panel says.
@@ -117,9 +119,7 @@ To back them up, copy the `signins/` directory, which already has the format a b
117
119
 
118
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.
119
121
 
120
- The domestic WorkBuddy host refuses conversational requests whose client identifies itself as DeepSeek Harness (11128, channel check failed). Check-in, the growth centre and the keep-alive use their own endpoints.
121
-
122
- The panel's **Client name** switch controls that rewrite and is off by default. Turned on, every occurrence of `DeepSeek Harness` in the prompt is sent as `DeepSeek`; turned off, the original wording is sent.
122
+ 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
123
 
124
124
  "Refresh now" reports refreshed, already fresh, failed and without a refresh token separately.
125
125
 
@@ -127,7 +127,7 @@ A read stays in the host process, so reloading the panel still paints the last f
127
127
 
128
128
  ## Settings
129
129
 
130
- Every key below is editable in the plugin page and saved on confirm:
130
+ Every key below is editable in the plugin page or the DSH settings page and saved on confirm:
131
131
 
132
132
  | Key | Default (effective) | Meaning |
133
133
  | --- | --- | --- |
@@ -135,12 +135,11 @@ Every key below is editable in the plugin page and saved on confirm:
135
135
  | `sourceWorkbuddy` / `sourceTrae` / `sourceQoder` | `true` | Off: that source is not scanned, published or requested |
136
136
  | `distribution` | `priority` | How the WorkBuddy pool spreads requests: `priority` uses one account first, `round-robin` spreads evenly, `expiry` spends expiring credits first, `sticky` pins one account per conversation |
137
137
  | `sourceDistributions` | `{}` | Trae/Qoder distribution: `priority` / `round-robin` / `expiry`; unset behaves as `priority` |
138
- | `cooldownSeconds` | `60` | Rate-limit cooldown. A reset time the upstream reports takes precedence; with none, consecutive limits double it up to 15 minutes (a longer configured window is left alone) |
138
+ | `cooldownSeconds` | `60` | Rate-limit cooldown. A reset time the upstream reports takes precedence; with none, consecutive limits double it up to 15 minutes (a longer configured window is left alone). A reported reset is capped at two hours; a spent balance or a refused sign-in is held for six hours instead |
139
139
  | `creditReserves` | `{}` | Per-account credit floor, keyed by account id; an account at or below its floor is not distributed to |
140
140
  | `authFile` | `""` | WorkBuddy sign-in file path; every `.info` sign-in in its directory is scanned. Empty discovers it |
141
141
  | `autoCheckin` | `{"enabled":false,"hours":[9]}` | Automatic check-in switch and times; `hours` are Beijing-time hours, empty means 09:00 |
142
142
  | `showComposerPoints` | `false` | Show the active account's credits in the composer |
143
- | `rewriteClientName` | `false` | Send `DeepSeek` in place of the client name `DeepSeek Harness` in the prompt going to the domestic host, so its channel check (11128) passes; the international host accepts either name |
144
143
  | `disabledAccountIds` | `[]` | Account ids disabled in the panel |
145
144
  | `disabledRegions` | `[]` | Regions disabled on their own, as `source:region` keys |
146
145
  | `modelSelection` | `{}` | Which models each gateway publishes, plus display name, context window and other overrides |
@@ -170,7 +169,7 @@ The PI-Desktop edition uses a separate range starting at 41831, so both plugins
170
169
 
171
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`; the panel accepts loopback requests only.
172
171
 
173
- The plugin's own data directory, `~/.dsh/dsh-wtq-pool/` (or `$DSH_HOME` 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, kept for three days. `doctor.txt` is the most recent connection report, item by item, and names no account. `credentials-archive.json` keeps the sign-ins a later account switch overwrote, access tokens included, by token expiry, dropping each 30 days after it. `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.
172
+ The plugin's own data directory, `~/.dsh/dsh-wtq-pool/` (or `$DSH_HOME` 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 names no account. `credentials-archive.json` keeps the sign-ins a later account switch overwrote, access tokens included, by token expiry, dropping each 30 days after it. `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.
174
173
 
175
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.
176
175
 
package/README.md CHANGED
@@ -77,7 +77,7 @@
77
77
  - 网关以 SSE 返回 `chat.completion.chunk`;请求体里的 `stream` 字段不改变响应格式。
78
78
  - 积分自动化:自动签到默认关闭。开启后的定时任务与「立即运行」执行同一轮,包含三家签到、WorkBuddy 的连登奖励和猫猫旅行。连登天数由上游按对话推进,该轮在每个账号读取连登档位前先补发一次对话活动上报,因此档位到点即可解锁领取,用户无需再进 WorkBuddy 发一句消息。连登环节还会在昨日漏签且持有补签卡时自动补签以保住连续天数,领取一次性的新手礼包与活动补偿,并在兑换解锁的档位后把由此获得的抽奖次数抽完。这些成长步骤国内版与国际版都执行;猫猫旅行只跑国内账号,国际版没有对应接口。
79
79
  - 登录令牌保活:独立卡片,按需执行。桌面端留下的登录快照在扫描时并入插件自己的登录目录,由插件接管续期;桌面端正在使用的登录由桌面端续期。「立即刷新」处理插件自管的副本,按签发时间判断:签发满 6 小时的刷新,距到期不足 5 分钟的同样刷新。刷新结果写回插件自己的登录文件,登录被上游拒绝时当天即可发现。同一账号在多处留有登录时按签发时间取最新的一份。停用账号、已停用的 region 与登录已被上游拒绝的账号不参与。
80
- - 输入框积分:开启 `showComposerPoints` 后,输入框工具栏显示当前模型所用账号的余额,点开可换号。功能关闭后浮层停止轮询。
80
+ - 输入框积分:开启 `showComposerPoints` 后,输入框工具栏显示当前模型所用账号的余额,点开可换号。功能关闭后浮层隐藏,读数降为每 5 分钟一次,重新开启后无需切换模型即可恢复。
81
81
  - 面板:账号与池状态、模型勾选、连接检查、成长中心都在插件页的「账号池」卡片内。模型目录在启动时加载,缓存过期后按需刷新,空闲时不轮询。停用的账号与登录已被上游拒绝的账号不参与探测。
82
82
  - 连接检查:每条发现都带判定。网关没有监听、模型目录读取失败、发布的地址与实际绑定的不一致、provider 未被宿主接受,都算失败并给出需要修改的内容。网关启动失败时给出原因,面板按地址漂移提示重新加载插件。检查自身出错也记一条发现,报告照常给出其余结果。
83
83
 
@@ -92,6 +92,8 @@ dsh plugin --profile desktop add $package
92
92
 
93
93
  需要 DeepSeek Harness 0.2.0 线(`package.json` 的 `engines.dsh`:`>=0.2.0-rc.1 <0.2.1`)与 Node `^22.19.0 || >=24.0.0`。
94
94
 
95
+ > 从 1.1.x 升级到 1.2.0 后,模型提供商 ID 改为 `wtqpool-*`,请在模型选择里重新选一次。
96
+
95
97
  请将 `desktop` 替换为实际使用的 profile 名。若 `dsh` 不在 `PATH` 中,改用安装目录中的 CLI。也可按 npm 包名 `dsh-wtq-pool` 或仓库地址安装;按仓库地址安装时 pnpm 会通过 `prepare` 脚本从源码构建,需要在 profile 的 `pnpm-workspace.yaml` 中写入 `allowBuilds: dsh-wtq-pool: true`,并固定在某个 commit 上。
96
98
 
97
99
  **面板位置**:在侧边栏进入 **插件**,打开 **dsh-wtq-pool** 卡片(或其旁的 **配置**),完整面板嵌在该卡片内。模型分组未出现时,按面板顶部的提示重新加载插件。
@@ -117,9 +119,7 @@ node tools/import-signins.cjs --data <插件数据目录> --from <账号文件
117
119
 
118
120
  签到可对单个账号执行,也可在标题栏一次领完该来源。自动签到默认关闭,开启后默认于 09:00(北京时间)执行;当天错过的时段在当天内的下一次启动仍会补领,跨天则不补。Trae 的每日签到每台设备限领一次;Qoder 的新一轮于每天 10:00(北京时间)开放。登录被上游拒绝的账号在该轮被跳过。
119
121
 
120
- WorkBuddy 国内版上游会拒绝「客户端身份写着 DeepSeek Harness」的对话请求(返回 11128,渠道校验未通过)。签到、成长中心与保活走各自的接口。
121
-
122
- 面板的「客户端名称」开关控制这条改写,默认关闭。开启后,提示词里 `DeepSeek Harness` 的每一处都改为 `DeepSeek`;关闭后恢复原名。
122
+ WorkBuddy 国内版上游会拒绝「客户端身份写着 DeepSeek Harness」的对话请求(返回 11128,渠道校验未通过)。插件遇到这条拒绝时,会把系统消息并入首条用户消息并重试一次;助手历史里的客户端名称也会移除,因为渠道校验同样读取助手消息。通过的提示按 region 记住,同一段提示之后不再重复这次往返。签到、成长中心与保活走各自的接口。
123
123
 
124
124
  「立即刷新」的结果按刷新、已是最新、失败、无刷新令牌分项报告。
125
125
 
@@ -127,7 +127,7 @@ WorkBuddy 国内版上游会拒绝「客户端身份写着 DeepSeek Harness」
127
127
 
128
128
  ## 设置
129
129
 
130
- 以下键在插件页修改,保存后生效:
130
+ 以下键在插件页或 DSH 的设置页修改,保存后生效:
131
131
 
132
132
  | 键 | 默认(生效值) | 说明 |
133
133
  | --- | --- | --- |
@@ -135,12 +135,11 @@ WorkBuddy 国内版上游会拒绝「客户端身份写着 DeepSeek Harness」
135
135
  | `sourceWorkbuddy` / `sourceTrae` / `sourceQoder` | `true` | 关闭后该来源不扫描、不发布、不请求 |
136
136
  | `distribution` | `priority` | WorkBuddy 池的发放方式:`priority` 先用一个账号,`round-robin` 均摊,`expiry` 优先消耗临期积分,`sticky` 同一对话固定 |
137
137
  | `sourceDistributions` | `{}` | Trae、Qoder 的分发方式:`priority` / `round-robin` / `expiry`;未设时按 `priority` |
138
- | `cooldownSeconds` | `60` | 限流冷却时长。上游报出重置时间时以它为准;没有重置时间时,连续限流会让它逐次翻倍,封顶 15 分钟(窗口本身超过 15 分钟时不再翻倍) |
138
+ | `cooldownSeconds` | `60` | 限流冷却时长。上游报出重置时间时以它为准;没有重置时间时,连续限流会让它逐次翻倍,封顶 15 分钟(窗口本身超过 15 分钟时不再翻倍)。上游给出的重置时间最长按 2 小时计;余额耗尽或登录被上游拒绝另按 6 小时停用 |
139
139
  | `creditReserves` | `{}` | 按账号 id 设定的积分保底,余额不高于它的账号不参与分发 |
140
140
  | `authFile` | `""` | WorkBuddy 登录文件路径;扫描其所在目录的全部 `.info` 登录,留空则自动发现 |
141
141
  | `autoCheckin` | `{"enabled":false,"hours":[9]}` | 自动签到的开关与时点;`hours` 为北京时间整点,留空用 09:00 |
142
142
  | `showComposerPoints` | `false` | 在输入框工具栏显示当前账号积分 |
143
- | `rewriteClientName` | `false` | 发往国内版的提示词里把客户端名称 `DeepSeek Harness` 改为 `DeepSeek`,供渠道校验(11128)通过;国际版接受任一名称 |
144
143
  | `disabledAccountIds` | `[]` | 面板中停用的账号 id |
145
144
  | `disabledRegions` | `[]` | 单独停用的 region,形如 `source:region` |
146
145
  | `modelSelection` | `{}` | 每个网关勾选哪些模型,以及显示名、上下文窗口等覆写 |
@@ -170,7 +169,7 @@ PI-Desktop 版使用 41831 开头的另一段端口,两个插件可以同时
170
169
 
171
170
  读取三家 App 的本机登录文件。provider 通过运行时注册接入,插件设置由宿主持久化至 profile。令牌由插件保管,只发往对应厂商的接口。网关监听 `127.0.0.1`,面板只接受本机回环请求。
172
171
 
173
- 插件自管数据目录 `~/.dsh/dsh-wtq-pool/`(设置了 `DSH_HOME` 时改用它)包含四个文件(写删除记录时会短暂多一个 `deleted-signins.json.lock`)。`checkin-slots.json` 记录已领取的签到时段,只保留三天。`doctor.txt` 是最近一次连接检查的报告,逐项记录通过与否,不含账号名称。`credentials-archive.json` 留存被切号覆盖的登录,含访问令牌;按令牌到期时间保留,到期后再过 30 天清除。`deleted-signins.json` 记录已删除的登录,只存令牌摘要、该登录的签发时间与删除时间,用来阻止扫描把桌面端遗留的同一份快照重新接管回来;同一个账号重新登录后(签发时间更新)该记录自动失效。
172
+ 插件自管数据目录 `~/.dsh/dsh-wtq-pool/`(设置了 `DSH_HOME` 时改用它)包含四个文件(写删除记录时会短暂多一个 `deleted-signins.json.lock`)。`checkin-slots.json` 记录已领取的签到时段和待重试的 Qoder 时点,时段只保留三天。`doctor.txt` 是最近一次连接检查的报告,逐项记录通过与否,不含账号名称。`credentials-archive.json` 留存被切号覆盖的登录,含访问令牌;按令牌到期时间保留,到期后再过 30 天清除。`deleted-signins.json` 记录已删除的登录,只存令牌摘要、该登录的签发时间与删除时间,用来阻止扫描把桌面端遗留的同一份快照重新接管回来;同一个账号重新登录后(签发时间更新)该记录自动失效。
174
173
 
175
174
  插件写入的登录都在同目录的 `signins/`:面板添加的、接管桌面端快照的、续期后的副本。文件名带账号的计费身份,与桌面登录同等参与分发。在面板中「删除」该账号会连同 `credentials-archive.json` 里的留档一起清除,桌面端遗留的同一份快照随之失效;重新登录该账号即解除。「移除」只是停用,可在「已移除的账号」中恢复。
176
175
 
package/lib/client.js CHANGED
@@ -350,7 +350,7 @@ window.__ModuleLoader__.load({
350
350
  if (stopped) return;
351
351
  if (next.enabled === false) {
352
352
  setPoints(null);
353
- window.clearTimeout(timer);
353
+ schedule(null);
354
354
  return;
355
355
  }
356
356
  const shown = next.show === true ? next : null;
@@ -754,7 +754,6 @@ window.__ModuleLoader__.load({
754
754
  ...composerEn
755
755
  }
756
756
  }), "dsh-wtq-pool: copy");
757
- ctx.locale.bind(NAMESPACE);
758
757
  } catch (error) {
759
758
  console.error("[dsh-wtq-pool] the copy did not register (the labels fall back to their keys):", error);
760
759
  }
package/lib/index.d.ts CHANGED
@@ -73,8 +73,6 @@ interface Config {
73
73
  removedAccounts?: unknown[];
74
74
  /** Whether the credits readout is shown beside the composer. */
75
75
  showComposerPoints?: boolean;
76
- /** Whether the client name is rewritten for the domestic host's channel check. */
77
- rewriteClientName?: boolean;
78
76
  /** How each Trae/Qoder region spreads requests. */
79
77
  sourceDistributions?: Record<string, string>;
80
78
  }