kdczyz-dsh-model 1.1.2 → 1.2.0-beta

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.
@@ -193,6 +193,25 @@ props(`opts.inject()` 求值一次,`settingsScope` 是同一对象引用)
193
193
  - 上游源码**一行未改**,日后仍可逐字节对照升级;
194
194
  - 个别失效的 effect 按标签丢弃(见下)。
195
195
 
196
+ ### 完全手动切换账号(三渠道统一,无任何轮询/冷却策略)
197
+
198
+ 三个渠道(WorkBuddy / Trae / Qoder)的账号池**全部改为完全手动取号**:
199
+
200
+ - **取号语义**:请求只用你「切换到此账号」选中的那一张;未选、选中账号被停用、
201
+ 不在池里或区域不符时,请求**直接失败**(503 + 「请手动切换账号」提示),
202
+ **绝不自动让位 / 自动换号**;
203
+ - **已删除**:分配策略(优先 / 轮换 / 均衡,含 `priority` / `round-robin` /
204
+ `balanced` 与随机权重)、「参与轮换」开关、冷却机制(`cooldownMs` /
205
+ `exhaustCooldownMs` / 冷却重置路由 `/cooldowns/reset`、冷却展示与
206
+ 「清除冷却」按钮)、保留额度(`creditReserves` / `/credit-reserve` 路由);
207
+ - **保留**(手动管理):停用 / 启用、移出池子 / 恢复、切换到此账号、
208
+ 签到领取。WorkBuddy 额外保留「取消固定」(取消后 = 未选,请求失败直到手动切换);
209
+ Trae / Qoder 选中即服务,没有「清空选择」状态。
210
+
211
+ 管理页(`console.mjs`)与号池实现(`vendor/xdpool/lib/index.js`、`lib/trae.js`、
212
+ `lib/qoder-pool.mjs`)已同步精简:统计格、卡片标签、按钮与路由都只留下与
213
+ 「手动选中」相关的部分。
214
+
196
215
  ### trae tab:本包自写
197
216
 
198
217
  上游 `dsh-connect-trae` 的浏览器半边(`vendor/trae/client.js`)**已整体移除**,
@@ -453,7 +472,10 @@ Trae 的凭据刷新原本写到 `.trae-auth.<region>.json`,**每区域一个
453
472
 
454
473
  ## 凭据
455
474
 
456
- - **WorkBuddy**:由 vendored xdpool 读取(用 `currentApi().pool` 拿**已解密**的凭证)
475
+ - **WorkBuddy**:池**同时扫描两处** —— 桌面端 app 的登录态目录
476
+ (vendored `defaultDesktopAuthDirs()`)+ 插件自有凭据目录
477
+ `$DSH_HOME/.wb-auth`(`dsh-wotr-<账号id>.info`,本 fork 新增,对齐 Trae 半边);
478
+ 由 vendored xdpool 读取(用 `currentApi().pool` 拿**已解密**的凭证)
457
479
  - **Trae**:只读桌面端 `User/globalStorage/storage.json` 或 CLI 的
458
480
  `trae-jwt-token`,刷新后写到 `$DSH_HOME/.trae-auth.<region>.json`
459
481
 
@@ -476,8 +498,10 @@ GET /v2/plugin/accounts → 账号身份(uin/uid/nickn
476
498
  没有 `client_id`、没有 `redirect_uri`、没有 PKCE、不需要本地回调服务。
477
499
  实现见 `lib/wb-auth.mjs`,路由挂在 `lib/index.js`。
478
500
 
479
- **凭据落盘**:写成 `dsh-wotr-<账号id>.info`,放进**池本来就在扫描的目录**
480
- (`defaultDesktopAuthDirs()`,不可写时退回插件数据目录),权限 `0600`。
501
+ **凭据落盘**:写成 `dsh-wotr-<账号id>.info`,放进 **`$DSH_HOME/.wb-auth`**
502
+ (vendored 池的 `candidateAuthDirs()` 同时扫描桌面目录与本目录,对齐 Trae 的
503
+ `.trae-auth.*` 双源模型),权限 `0600`。删掉桌面端 app、卸载清掉它的数据目录
504
+ **都不影响插件账号**;桌面端登录态照常被扫描,同账号按 id 合并、取较新的那份。
481
505
  池按 `*.info` 逐个解析,账号 id 由 `uin/uid` 派生,所以**多账号天然成立**:
482
506
  登录几个账号就有几个文件,互不覆盖;重复登录同一账号只会覆盖自己那份。
483
507
 
@@ -1,17 +1,10 @@
1
- # Register kdczyz-dsh-model — ONE package, THREE Loader entries.
1
+ # Register dsh-kdczyz-mode — ONE package, THREE Loader entries.
2
2
  #
3
3
  # Why several entries, and why they use DIFFERENT module specifiers:
4
4
  #
5
- # entry A name: kdczyz-dsh-model -> lib/index.js (WorkBuddy pool half)
6
- # entry B name: kdczyz-dsh-model/trae -> lib/trae.js (Trae half)
7
- # entry C name: kdczyz-dsh-model/qoder -> lib/qoder.js (Qoder half)
8
- #
9
- # The `name:` must be the INSTALLED package name (`kdczyz-dsh-model`), because the
10
- # Loader resolves each entry by that specifier — `import 'kdczyz-dsh-model/trae'`
11
- # has to work from the profile. The inner directory `dsh-kdczyz-mode/` is NOT a
12
- # resolvable package, so naming an entry after it fails with ERR_MODULE_NOT_FOUND
13
- # and the plugin silently never runs ("未运行" in the plugin manager, with only a
14
- # passing "1 entry did not activate" warning).
5
+ # entry A name: dsh-kdczyz-mode -> lib/index.js (WorkBuddy pool half)
6
+ # entry B name: dsh-kdczyz-mode/trae -> lib/trae.js (Trae half)
7
+ # entry C name: dsh-kdczyz-mode/qoder -> lib/qoder.js (Qoder half)
15
8
  #
16
9
  # The two halves each declare `enabledModelIds` / `imageModelIds` /
17
10
  # `contextBudgets` / `authFile` with DIFFERENT semantics. Cordis keys a plugin's
@@ -42,8 +35,8 @@
42
35
  # comment in YAML and breaks parsing.
43
36
  - insert:
44
37
  - id: llm-workbuddy-xdpool
45
- name: kdczyz-dsh-model
38
+ name: dsh-kdczyz-mode
46
39
  - id: dsh-connect-trae
47
- name: kdczyz-dsh-model/trae
40
+ name: dsh-kdczyz-mode/trae
48
41
  - id: dsh-connect-qoder
49
- name: kdczyz-dsh-model/qoder
42
+ name: dsh-kdczyz-mode/qoder
@@ -6034,18 +6034,17 @@ const __WBC_CONSOLE_FACTORY__ = (react, jsxRuntime, embedded) => {
6034
6034
  // 内联执行可以只注册一次、顺序可控,且 vendored 代码一行都不用改
6035
6035
  // (便于日后对照上游升级)。
6036
6036
  //
6037
- // 注意注册 id:本 bundle 用**安装包名** kdczyz-dsh-model 注册,
6038
- // 因为 client-modules 是按包名建表、按包名 require 的(规范原文:
6039
- // "the browser artifact registers a lazy factory whose id equals the package name");
6040
- // 两个 vendored 脚本各自声明的 id 由下面的替身加载器捕获,不会真的注册进模块表。
6037
+ // 注意注册 id:本 bundle 用**合并后的包名** dsh-kdczyz-mode 注册,
6038
+ // 因为 client-modules 是按包名建表、按包名 require 的;两个 vendored 脚本
6039
+ // 各自声明的 id 由下面的替身加载器捕获,不会真的注册进模块表。
6041
6040
  window.__ModuleLoader__.load({
6042
- id: 'kdczyz-dsh-model',
6041
+ id: 'dsh-kdczyz-mode',
6043
6042
  factory: (require) => {
6044
6043
  var module = { exports: {} };
6045
6044
  var exports = module.exports;
6046
6045
 
6047
6046
  /** 与 package.json 的 name 一致;cordis 用它定位模块 */
6048
- const pkgName = 'kdczyz-dsh-model';
6047
+ const pkgName = 'dsh-kdczyz-mode';
6049
6048
 
6050
6049
  // React 运行时:管理页组件要用。
6051
6050
  //