dsh-sensenova-pool 0.1.0 → 0.1.2
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/README.md +24 -2
- package/lib/index.js +15 -1
- package/package.json +78 -78
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
填入任意多把商汤 Key,请求在多把 Key 之间自动轮转,把每把 Key 的额度摊开使用。
|
|
24
24
|
|
|
25
|
-

|
|
25
|
+

|
|
26
26
|
|
|
27
27
|
- **一次粘贴多把**:换行、逗号、分号、空格分隔都可以
|
|
28
28
|
- **自动清洗**:识别并去除 `Bearer ` 前缀、首尾引号、重复项、明显无效的短串
|
|
@@ -112,7 +112,7 @@ pnpm --dir "$DSH_PROFILE_DIR" add "link:$PWD"
|
|
|
112
112
|
|
|
113
113
|
改完 `package.json` 后**重启 DeepSeek Harness**。确认安装成功:插件页的「已安装」列表里会出现本插件。
|
|
114
114
|
|
|
115
|
-

|
|
115
|
+

|
|
116
116
|
|
|
117
117
|
---
|
|
118
118
|
|
|
@@ -179,6 +179,28 @@ sk-cccccccccccccccccccccccccccccc
|
|
|
179
179
|
|
|
180
180
|
在卡片上点某把 Key 的「测试」看真实原因。`403 model is not available in the current token plan` 表示该模型不在这个 Key 的套餐里 —— 换模型,而不是换 Key。
|
|
181
181
|
|
|
182
|
+
**DSH 弹「The application could not start or stopped unexpectedly」,完全起不来?**
|
|
183
|
+
|
|
184
|
+
先看崩溃日志里的失败插件名。如果 `Failed plugins` 指向 `credentials`,且错误是
|
|
185
|
+
`record "dsh-sensenova-pool/keys" ... has unknown field "payload"`,说明凭据库里那条记录
|
|
186
|
+
的标签写错了 —— DSH 的凭据库对记录做白名单校验,`api-key` 只认 `kind`/`key`/`env`,
|
|
187
|
+
`grant` 只认 `kind`/`payload`,**一条记录不合规就会让 `credentials` 插件激活失败,进而
|
|
188
|
+
中止整个应用启动**(0.1.1 及更早版本存在这个写入 bug,已修复)。
|
|
189
|
+
|
|
190
|
+
手工修复:编辑 `$DSH_HOME/.credentials.yaml`,把该记录的 `kind: api-key` 改成
|
|
191
|
+
`kind: grant`(`payload.keys` 里的 Key 原样保留),然后重启 DSH。
|
|
192
|
+
|
|
193
|
+
```yaml
|
|
194
|
+
records:
|
|
195
|
+
dsh-sensenova-pool/keys:
|
|
196
|
+
kind: grant # ← 必须是 grant;api-key 不接受 payload
|
|
197
|
+
payload:
|
|
198
|
+
keys:
|
|
199
|
+
- sk-…
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
崩溃日志位置:Windows 下为 `%APPDATA%\@deepseek-ai\dsh-desktop\logs\crash-*-host.log`。
|
|
203
|
+
|
|
182
204
|
**Key 会泄漏吗?**
|
|
183
205
|
|
|
184
206
|
不会。界面只显示掩码;明文只存在 DSH 凭据库(`$DSH_HOME/.credentials.yaml`)中,不会写入任何配置文件,也不会出现在日志里。
|
package/lib/index.js
CHANGED
|
@@ -194,8 +194,22 @@ export function apply(ctx, config) {
|
|
|
194
194
|
if (credentials === undefined)
|
|
195
195
|
throw new Error('凭据服务不可用,无法保存 key');
|
|
196
196
|
const keys = pool.keys();
|
|
197
|
+
// 必须用 `grant`,不能用 `api-key`。
|
|
198
|
+
//
|
|
199
|
+
// credentials-local 对记录做白名单校验(`assertFields`),两种标签允许的字段
|
|
200
|
+
// 是互斥的:`api-key` 只认 `kind` / `key` / `env`,`grant` 只认 `kind` /
|
|
201
|
+
// `payload`。而 `api-key` 的 `key` 是**单值**字符串,根本表达不了 key 池,
|
|
202
|
+
// 所以池子只能落在 `grant` 的 `payload` 里(存储对 grant payload 逐字保留,
|
|
203
|
+
// 不做解释)。
|
|
204
|
+
//
|
|
205
|
+
// 踩过的坑:这里原先写的是 `kind: 'api-key'` + `payload`。写入路径的
|
|
206
|
+
// `assertStorableApiKey` 只校验 `key` 是否为空和 `env` 值,**不查未知字段**,
|
|
207
|
+
// 于是坏记录顺利落盘;下次启动时 credentials-local 在 loadInitial 阶段
|
|
208
|
+
// 解析失败 → credentials 插件激活失败 → 整个 dsh 启动中止(弹「could not
|
|
209
|
+
// start or stopped unexpectedly」)。一条记录写错就能锁死整个应用,所以这里
|
|
210
|
+
// 的标签必须与 schema 严格对齐。
|
|
197
211
|
await credentials.modifyRecord(RECORD_ID, async () => ({
|
|
198
|
-
kind: '
|
|
212
|
+
kind: 'grant',
|
|
199
213
|
payload: { keys },
|
|
200
214
|
}));
|
|
201
215
|
}
|
package/package.json
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-sensenova-pool",
|
|
3
|
-
"displayName": "DSH SenseNova Key Pool",
|
|
4
|
-
"description": "商汤日日新(SenseNova)多 Key 轮换池 — 填入多把 Key 即可零配置接入 DeepSeek Harness,遇 429 限流自动切换下一把 Key。",
|
|
5
|
-
"version": "0.1.
|
|
6
|
-
"author": "Phoeky",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"dsh-plugin",
|
|
9
|
-
"deepseek-harness",
|
|
10
|
-
"deepseek",
|
|
11
|
-
"sensenova",
|
|
12
|
-
"日日新",
|
|
13
|
-
"key-rotation",
|
|
14
|
-
"key-pool",
|
|
15
|
-
"rate-limit",
|
|
16
|
-
"429",
|
|
17
|
-
"model-provider"
|
|
18
|
-
],
|
|
19
|
-
"type": "module",
|
|
20
|
-
"engines": {
|
|
21
|
-
"node": "^22.19.0 || >=24.0.0"
|
|
22
|
-
},
|
|
23
|
-
"main": "lib/index.js",
|
|
24
|
-
"types": "lib/index.d.ts",
|
|
25
|
-
"exports": {
|
|
26
|
-
".": {
|
|
27
|
-
"types": "./lib/index.d.ts",
|
|
28
|
-
"default": "./lib/index.js"
|
|
29
|
-
},
|
|
30
|
-
"./client": "./lib/client.js",
|
|
31
|
-
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
32
|
-
"./package.json": "./package.json"
|
|
33
|
-
},
|
|
34
|
-
"files": [
|
|
35
|
-
"lib",
|
|
36
|
-
"cordis.patch.yml",
|
|
37
|
-
"README.md",
|
|
38
|
-
"LICENSE"
|
|
39
|
-
],
|
|
40
|
-
"license": "MIT",
|
|
41
|
-
"repository": {
|
|
42
|
-
"type": "git",
|
|
43
|
-
"url": "git+https://github.com/Phoeky/dsh-sensenova-pool.git"
|
|
44
|
-
},
|
|
45
|
-
"homepage": "https://github.com/Phoeky/dsh-sensenova-pool#readme",
|
|
46
|
-
"bugs": "https://github.com/Phoeky/dsh-sensenova-pool/issues",
|
|
47
|
-
"scripts": {
|
|
48
|
-
"prepack": "npm run build",
|
|
49
|
-
"prepare": "npm run build",
|
|
50
|
-
"build": "tsc -p tsconfig.json && node tools/build-client.mjs",
|
|
51
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
52
|
-
"test": "node tools/test-all.mjs"
|
|
53
|
-
},
|
|
54
|
-
"dsh": {
|
|
55
|
-
"bundle": {
|
|
56
|
-
"patch": "./cordis.patch.yml"
|
|
57
|
-
},
|
|
58
|
-
"client": {
|
|
59
|
-
"inject": [
|
|
60
|
-
"@deepseek-ai/dsh-client-ui-plugin-manager",
|
|
61
|
-
"@deepseek-ai/dsh-client-ui-settings-plugins",
|
|
62
|
-
"@deepseek-ai/dsh-client-locale"
|
|
63
|
-
],
|
|
64
|
-
"platform": "web"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"peerDependencies": {
|
|
68
|
-
"@deepseek-ai/cordis": "^4.0.4",
|
|
69
|
-
"@deepseek-ai/
|
|
70
|
-
"@deepseek-ai/dsh-llm
|
|
71
|
-
"@deepseek-ai/
|
|
72
|
-
"@earendil-works/pi-ai": "^0.87.1"
|
|
73
|
-
},
|
|
74
|
-
"devDependencies": {
|
|
75
|
-
"@types/node": "22.19.19",
|
|
76
|
-
"typescript": "5.9.3"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-sensenova-pool",
|
|
3
|
+
"displayName": "DSH SenseNova Key Pool",
|
|
4
|
+
"description": "商汤日日新(SenseNova)多 Key 轮换池 — 填入多把 Key 即可零配置接入 DeepSeek Harness,遇 429 限流自动切换下一把 Key。",
|
|
5
|
+
"version": "0.1.2",
|
|
6
|
+
"author": "Phoeky",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"dsh-plugin",
|
|
9
|
+
"deepseek-harness",
|
|
10
|
+
"deepseek",
|
|
11
|
+
"sensenova",
|
|
12
|
+
"日日新",
|
|
13
|
+
"key-rotation",
|
|
14
|
+
"key-pool",
|
|
15
|
+
"rate-limit",
|
|
16
|
+
"429",
|
|
17
|
+
"model-provider"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
22
|
+
},
|
|
23
|
+
"main": "lib/index.js",
|
|
24
|
+
"types": "lib/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./lib/index.d.ts",
|
|
28
|
+
"default": "./lib/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./client": "./lib/client.js",
|
|
31
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"lib",
|
|
36
|
+
"cordis.patch.yml",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE"
|
|
39
|
+
],
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/Phoeky/dsh-sensenova-pool.git"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/Phoeky/dsh-sensenova-pool#readme",
|
|
46
|
+
"bugs": "https://github.com/Phoeky/dsh-sensenova-pool/issues",
|
|
47
|
+
"scripts": {
|
|
48
|
+
"prepack": "npm run build",
|
|
49
|
+
"prepare": "npm run build",
|
|
50
|
+
"build": "tsc -p tsconfig.json && node tools/build-client.mjs",
|
|
51
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
52
|
+
"test": "node tools/test-all.mjs"
|
|
53
|
+
},
|
|
54
|
+
"dsh": {
|
|
55
|
+
"bundle": {
|
|
56
|
+
"patch": "./cordis.patch.yml"
|
|
57
|
+
},
|
|
58
|
+
"client": {
|
|
59
|
+
"inject": [
|
|
60
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager",
|
|
61
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins",
|
|
62
|
+
"@deepseek-ai/dsh-client-locale"
|
|
63
|
+
],
|
|
64
|
+
"platform": "web"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"@deepseek-ai/cordis": "^4.0.4 || >=4.0.4-0 <5.0.0-0",
|
|
69
|
+
"@deepseek-ai/schemastery": "~3.18.4 || >=3.18.4-0 <3.19.0-0",
|
|
70
|
+
"@deepseek-ai/dsh-llm": "0.2.0-rc.2 || >=0.2.0-rc.2 <0.3.0-0",
|
|
71
|
+
"@deepseek-ai/dsh-llm-pi-ai": "0.2.0-rc.2 || >=0.2.0-rc.2 <0.3.0-0",
|
|
72
|
+
"@earendil-works/pi-ai": "^0.87.1 || >=0.87.1-0 <0.88.0-0"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@types/node": "22.19.19",
|
|
76
|
+
"typescript": "5.9.3"
|
|
77
|
+
}
|
|
78
|
+
}
|