@omdp/dsh-key-fallback 3.0.0 → 3.0.1
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/lib/index.js +2 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -275,7 +275,7 @@ export function apply(ctx) {
|
|
|
275
275
|
pool.currentRef = key.ref
|
|
276
276
|
diag('agent/request', 'PICK ' + key.ref + ' env=' + pool.cfg.env)
|
|
277
277
|
try { process.env[pool.cfg.env] = key.value } catch (e) {}
|
|
278
|
-
try { backupFile(CRED_FILE, 'credentials')
|
|
278
|
+
try { backupFile(CRED_FILE, 'credentials') } catch (e) {}
|
|
279
279
|
} catch (e) {}
|
|
280
280
|
return config
|
|
281
281
|
}).catch((e) => {})
|
|
@@ -302,7 +302,7 @@ export function apply(ctx) {
|
|
|
302
302
|
// 失败后优先按 nextRef 轮换(用户配置的顺序);useKeyRef 只决定初始选择
|
|
303
303
|
const nextKey = nextKeyFor(pool, curRef)
|
|
304
304
|
if (nextKey) {
|
|
305
|
-
try { await backupFile(CRED_FILE, 'credentials');
|
|
305
|
+
try { await backupFile(CRED_FILE, 'credentials'); process.env[pool.cfg.env] = nextKey.value } catch (e) {}
|
|
306
306
|
pool.currentRef = nextKey.ref
|
|
307
307
|
} else {
|
|
308
308
|
// 无 nextRef 可选时:若 useKeyRef 锁定 key 仍 live 则退回它,否则放弃
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omdp/dsh-key-fallback",
|
|
3
3
|
"description": "Elliptic key pool with automatic rotation for DeepSeek Harness LLM providers. Settings → API Key 回退 UI: pick provider, add multiple keys (write-only). v3.",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|