@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/CHANGELOG.md +27 -0
- package/README.md +22 -0
- package/lib/bin.js +88 -4
- package/lib/client.js +9 -6
- package/lib/index.d.ts +12 -0
- package/lib/index.js +534 -300
- package/package.json +1 -1
- package/vendor/channel-pack/pack.js +14 -20
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.
|
|
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
|
-
*
|
|
30207
|
-
*
|
|
30208
|
-
*
|
|
30209
|
-
*
|
|
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
|
-
|
|
30220
|
-
+ '
|
|
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
|
-
//
|
|
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]
|
|
32815
|
-
*
|
|
32816
|
-
* 这两个 lane 有两条注册来源 —— 本插件注册 `xdpool` / `xdpool-global`(桌面
|
|
32817
|
-
* 客户端读到的账号只活在我们的池里),pack 注册 `buddy` / `workbuddy`。两边
|
|
32818
|
-
* 都注册时,模型选择器里「WorkBuddy 国内版 / 国际版」各出现两次(issue #201)。
|
|
32812
|
+
* [xdpool-local] lane 让位 —— issue #201。
|
|
32819
32813
|
*
|
|
32820
|
-
*
|
|
32821
|
-
*
|
|
32822
|
-
*
|
|
32823
|
-
* pack
|
|
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?.(
|
|
32824
|
+
warn?.('[llm-register] ' + providers.join(', ') + ' 由 dsh-xdpool 自己服务,pack 跳过注册')
|
|
32831
32825
|
return void 0
|
|
32832
32826
|
}
|
|
32833
32827
|
let target = wrapAdapterWithTokenLedger(providers, adapter);
|