@refeain/dsh-xdpool 3.0.6 → 3.0.8

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@refeain/dsh-xdpool",
3
3
  "displayName": "DSH XD Pool",
4
4
  "description": "One DSH model pool for every free quota you have: merge all locally signed-in WorkBuddy accounts with auto-failover, sign in to 22 vendors by QR/web, aggregate 77 external vendors' keys, plus a usage dashboard, model routing, a local OpenAI-compatible gateway and a points-automation suite.",
5
- "version": "3.0.6",
5
+ "version": "3.0.8",
6
6
  "license": "MIT",
7
7
  "author": "XDTrees",
8
8
  "homepage": "https://github.com/XDTrees/dsh-xdpool#readme",
@@ -30203,21 +30203,19 @@ var AccountPool = class {
30203
30203
  /**
30204
30204
  * [xdpool-local] 空表保护 —— issue #200。
30205
30205
  *
30206
- * 升级/重装过程中出现过「账号表被写成空、且没有 .bak」的报告:用户的 5 个
30207
- * 账号在界面上消失,磁盘上也没有可恢复的旧版本。一条空快照覆盖一张非空表
30208
- * 几乎总是故障(读失败、并发写、装包时的空状态),而不是用户意图 —— 逐个
30209
- * 删除账号走的是 `removeAccount`,那条路径显式传 `allowEmpty`。
30210
- *
30211
- * 拒绝时保留内存与磁盘上的旧表,并留下可查的日志;真要一次性清空(迁移、
30212
- * 重置)可以设 `DSH_XDPOOL_ALLOW_EMPTY_ACCOUNTS=1`。
30206
+ * 升级/重装期间出现过「账号表被空快照覆盖、且没有 .bak」的报告:用户的账号
30207
+ * 在界面上全部消失。用空表覆盖一张非空表几乎总是故障(读失败、并发写、装包时
30208
+ * 的空状态),不是用户意图 —— 逐个删号走 removeAccount,那条路径显式允许清空。
30209
+ * 真要一次性重置可设 DSH_XDPOOL_ALLOW_EMPTY_ACCOUNTS=1。
30213
30210
  */
30214
30211
  const empty = Array.isArray(accounts) && accounts.length === 0
30215
30212
  const hadRows = Array.isArray(this.cache) && this.cache.length > 0
30216
30213
  const forced = typeof process !== 'undefined' && process.env.DSH_XDPOOL_ALLOW_EMPTY_ACCOUNTS === '1'
30217
30214
  if (empty && hadRows && options.allowEmpty !== true && !forced) {
30218
30215
  this.ctx.logger?.warn?.(
30219
- `[channel-pack] 拒绝用空账号表覆盖现有 ${this.cache.length} 个账号(疑似升级/重装时的空快照);`
30220
- + '确需清空请逐个删除,或设 DSH_XDPOOL_ALLOW_EMPTY_ACCOUNTS=1'
30216
+ '[channel-pack] 拒绝用空账号表覆盖现有 ' + this.cache.length
30217
+ + ' 个账号(疑似升级/重装时的空快照);逐个删除可正常清空,'
30218
+ + '强制重置请设 DSH_XDPOOL_ALLOW_EMPTY_ACCOUNTS=1'
30221
30219
  )
30222
30220
  return
30223
30221
  }
@@ -30685,7 +30683,7 @@ var AccountPool = class {
30685
30683
  await this.ctx.credentials.unset(credentialRef(entry.credentialRef));
30686
30684
  } catch {
30687
30685
  }
30688
- // 显式删除:删到空也要写进去,所以带上 allowEmpty。
30686
+ // 显式删除:可以删到空,带上 allowEmpty。
30689
30687
  await this.writeAccounts(this.readAccounts().filter((a) => a.id !== id), { allowEmpty: true });
30690
30688
  }
30691
30689
  /**
@@ -32811,23 +32809,19 @@ async function* recordThroughStream(openStream, meta) {
32811
32809
  }
32812
32810
  function registerAdapterIdempotent(llm, providers, adapter, warn) {
32813
32811
  /**
32814
- * [xdpool-local] 让位:dsh-xdpool 自己服务 buddy / workbuddy 时,pack 不再注册。
32815
- *
32816
- * 这两个 lane 有两条注册来源 —— 本插件注册 `xdpool` / `xdpool-global`(桌面
32817
- * 客户端读到的账号只活在我们的池里),pack 注册 `buddy` / `workbuddy`。两边
32818
- * 都注册时,模型选择器里「WorkBuddy 国内版 / 国际版」各出现两次(issue #201)。
32812
+ * [xdpool-local] lane 让位 —— issue #201。
32819
32813
  *
32820
- * 插件在 mount 时按「自己池里有没有账号」决定要不要写
32821
- * `DSH_XDPOOL_OWNS_POOL_LANES`:有账号就让位,没账号就删掉这个变量让 pack
32822
- * 继续提供目录(否则那台机器上一个模型都看不到)。判断放在注册这一层,是因为
32823
- * pack 的 pool-owned 清单只负责「不静音」,从来不是「不注册」。
32814
+ * buddy / workbuddy 两条 lane 有两条注册来源:本插件注册 xdpool / xdpool-global,
32815
+ * pack 注册 buddy / workbuddy。两边都注册时,选择器里 WorkBuddy 国内版/国际版
32816
+ * 各出现两次。插件在 mount 时按「自己池里有没有账号」写
32817
+ * DSH_XDPOOL_OWNS_POOL_LANES:有账号就让位,没账号删掉变量让 pack 继续提供目录。
32824
32818
  */
32825
32819
  const owned = (typeof process === 'undefined' ? '' : process.env.DSH_XDPOOL_OWNS_POOL_LANES ?? '')
32826
32820
  .split(',')
32827
32821
  .map((id) => id.trim())
32828
32822
  .filter((id) => id !== '')
32829
32823
  if (owned.length > 0 && providers.length > 0 && providers.every((id) => owned.includes(id))) {
32830
- warn?.(`[llm-register] ${providers.join(', ')} 由 dsh-xdpool 自己服务,pack 跳过注册(避免重复分组)`)
32824
+ warn?.('[llm-register] ' + providers.join(', ') + ' 由 dsh-xdpool 自己服务,pack 跳过注册')
32831
32825
  return void 0
32832
32826
  }
32833
32827
  let target = wrapAdapterWithTokenLedger(providers, adapter);