@deepseek-ai/dsh-llm-deepseek-api-key 0.2.1-alpha.2 → 0.2.1-alpha.3
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.i18n.yaml +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/index.js +8 -2
- package/lib/types/index.d.ts +1 -1
- package/locale/en.json +5 -0
- package/locale/zh.json +6 -0
- package/package.json +17 -15
package/README.i18n.yaml
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
en: 23386452a66b2fbd
|
|
16
16
|
zh: 4cf93c4bf17b3da2
|
|
17
17
|
/deepseek-ai-dsh-llm-deepseek-api-key/use-this-package:
|
|
18
|
-
en:
|
|
19
|
-
zh:
|
|
18
|
+
en: 10333177c9033b9e
|
|
19
|
+
zh: 069faa6a125cb6a9
|
|
20
20
|
/deepseek-ai-dsh-llm-deepseek-api-key/understand-the-implementation:
|
|
21
21
|
en: 002ac925beb4e75b
|
|
22
22
|
zh: 815d06f116604a09
|
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Authentication resolution returns the validated API key in `x-api-key` for both
|
|
|
25
25
|
<a id="use-this-package"></a>
|
|
26
26
|
## Use this package
|
|
27
27
|
|
|
28
|
-
`apiKeyEnv` defaults to `DEEPSEEK_API_KEY` and resolves per request. When the credentials service exists, its precedence applies; only compositions without that service read the launch environment directly. Requests with missing credentials fail with `MISSING_CREDENTIAL`; malformed credentials fail with `INVALID_CREDENTIAL`. Model discovery returns
|
|
28
|
+
`apiKeyEnv` defaults to `DEEPSEEK_API_KEY` and resolves per request and model discovery. When the credentials service exists, its precedence applies; only compositions without that service read the launch environment directly. Requests with missing credentials fail with `MISSING_CREDENTIAL`; malformed credentials fail with `INVALID_CREDENTIAL`. Model discovery returns an empty catalog when the credential is missing, hiding the route from model selectors while retaining its settings entry. Malformed credentials and other lookup failures propagate. Adding or removing a key affects the next discovery call.
|
|
29
29
|
|
|
30
30
|
```yaml
|
|
31
31
|
- id: llm-deepseek
|
package/README.zh.md
CHANGED
|
@@ -25,7 +25,7 @@ kind: "package-reference"
|
|
|
25
25
|
<a id="use-this-package"></a>
|
|
26
26
|
## 使用此包
|
|
27
27
|
|
|
28
|
-
`apiKeyEnv` 默认为 `DEEPSEEK_API_KEY
|
|
28
|
+
`apiKeyEnv` 默认为 `DEEPSEEK_API_KEY`,在每次请求和模型发现时解析凭据。已组合 credentials 服务时,按其优先级解析;只有未组合该服务时才直接读取启动环境。请求时凭据缺失以 `MISSING_CREDENTIAL` 失败;格式错误以 `INVALID_CREDENTIAL` 失败。模型发现在凭据缺失时返回空目录,在模型选择器中隐藏该路由,但保留其设置入口。凭据格式错误和其他读取失败继续上报。添加或删除密钥会影响下一次模型发现。
|
|
29
29
|
|
|
30
30
|
```yaml
|
|
31
31
|
- id: llm-deepseek
|
package/lib/index.js
CHANGED
|
@@ -59,9 +59,15 @@ function apply(ctx, config) {
|
|
|
59
59
|
options,
|
|
60
60
|
providerName: "DeepSeek",
|
|
61
61
|
resolveAuth: async (connection) => ({ headers: { "x-api-key": await resolveApiKey(connection) } }),
|
|
62
|
-
discoverModels: (provider) => {
|
|
62
|
+
discoverModels: async (provider) => {
|
|
63
63
|
const connection = options();
|
|
64
|
-
|
|
64
|
+
try {
|
|
65
|
+
await resolveApiKey(connection);
|
|
66
|
+
} catch (error) {
|
|
67
|
+
if (error instanceof LlmError && error.code === "MISSING_CREDENTIAL") return [];
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
return connection.models.map((model) => catalogModelInfo(provider, model));
|
|
65
71
|
}
|
|
66
72
|
});
|
|
67
73
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** API-key authentication and discovery for the official DeepSeek route. */
|
|
1
|
+
/** API-key authentication and credential-gated discovery for the official DeepSeek route. */
|
|
2
2
|
import type { Context } from '@deepseek-ai/cordis';
|
|
3
3
|
import { Config } from './config.ts';
|
|
4
4
|
export { Config, plainOptions, resolveAdapterOptions } from './config.ts';
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-llm-deepseek-api-key",
|
|
3
3
|
"description": "DeepSeek api-key provider authentication and discovery",
|
|
4
|
-
"version": "0.2.1-alpha.
|
|
4
|
+
"version": "0.2.1-alpha.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -19,28 +19,30 @@
|
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
21
|
"./src/*": "./src/*",
|
|
22
|
-
"./package.json": "./package.json"
|
|
22
|
+
"./package.json": "./package.json",
|
|
23
|
+
"./locale/*.json": "./locale/*.json"
|
|
23
24
|
},
|
|
24
25
|
"files": [
|
|
26
|
+
"locale/*.json",
|
|
25
27
|
"lib/index.js",
|
|
26
28
|
"lib/types/**/*.d.ts"
|
|
27
29
|
],
|
|
28
30
|
"license": "MIT",
|
|
29
31
|
"peerDependencies": {
|
|
30
|
-
"@deepseek-ai/cordis": "~4.0.5-alpha.
|
|
31
|
-
"@deepseek-ai/dsh-llm": "0.2.1-alpha.
|
|
32
|
-
"@deepseek-ai/dsh-llm-deepseek": "0.2.1-alpha.
|
|
33
|
-
"@deepseek-ai/dsh-launch-environment": "0.2.1-alpha.
|
|
34
|
-
"@deepseek-ai/dsh-credentials": "0.2.1-alpha.
|
|
35
|
-
"@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.
|
|
32
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2",
|
|
33
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
|
|
34
|
+
"@deepseek-ai/dsh-llm-deepseek": "0.2.1-alpha.3",
|
|
35
|
+
"@deepseek-ai/dsh-launch-environment": "0.2.1-alpha.3",
|
|
36
|
+
"@deepseek-ai/dsh-credentials": "0.2.1-alpha.3",
|
|
37
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.2"
|
|
36
38
|
},
|
|
37
39
|
"devDependencies": {
|
|
38
|
-
"@deepseek-ai/cordis": "~4.0.5-alpha.
|
|
39
|
-
"@deepseek-ai/dsh-llm": "0.2.1-alpha.
|
|
40
|
-
"@deepseek-ai/dsh-llm-deepseek": "0.2.1-alpha.
|
|
41
|
-
"@deepseek-ai/dsh-launch-environment": "0.2.1-alpha.
|
|
42
|
-
"@deepseek-ai/dsh-credentials": "0.2.1-alpha.
|
|
43
|
-
"@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.
|
|
40
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2",
|
|
41
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
|
|
42
|
+
"@deepseek-ai/dsh-llm-deepseek": "0.2.1-alpha.3",
|
|
43
|
+
"@deepseek-ai/dsh-launch-environment": "0.2.1-alpha.3",
|
|
44
|
+
"@deepseek-ai/dsh-credentials": "0.2.1-alpha.3",
|
|
45
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.2"
|
|
44
46
|
},
|
|
45
47
|
"peerDependenciesMeta": {
|
|
46
48
|
"@deepseek-ai/cordis-plugin-loader": {
|
|
@@ -48,6 +50,6 @@
|
|
|
48
50
|
}
|
|
49
51
|
},
|
|
50
52
|
"dependencies": {
|
|
51
|
-
"@deepseek-ai/schemastery": "~3.18.5-alpha.
|
|
53
|
+
"@deepseek-ai/schemastery": "~3.18.5-alpha.2"
|
|
52
54
|
}
|
|
53
55
|
}
|