@eum-agent/llm-provider-deepseek 0.0.0-stage → 1.1.0

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/assets/NOTICE ADDED
@@ -0,0 +1,28 @@
1
+ Vendor marks from lobehub/lobe-icons (@lobehub/icons-static-svg 1.95.1, MIT), except where noted. Each file is named for the catalogue row contributed by its owning provider extension.
2
+
3
+ - zhipu*.svg: the Z glyph from Z.ai's own logo (https://z-cdn.chatglm.cn/z-ai/static/logo.svg), without its dark tile.
4
+ - kimi-coding*.svg: the K filled black, as kimi.com's light-scheme favicon draws it; the lobe-icons original fills it white.
5
+
6
+ The lobe-icons marks are distributed under the MIT License:
7
+
8
+ MIT License
9
+
10
+ Copyright (c) 2023 LobeHub
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ <svg height="24" style="flex:none;line-height:1" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><title>DeepSeek</title><path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z" fill="#4D6BFE"></path></svg>
package/dist/index.js ADDED
@@ -0,0 +1,241 @@
1
+ //#endregion
2
+ //#region src/catalog.ts
3
+ /** Supplier-owned catalogue rows; protocol request facts belong to protocol registrations. */
4
+ const catalog = {
5
+ vendors: [{
6
+ kind: "vendor",
7
+ id: "deepseek",
8
+ logo: "data:image/svg+xml,%3Csvg%20height%3D%2224%22%20style%3D%22flex%3Anone%3Bline-height%3A1%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ctitle%3EDeepSeek%3C%2Ftitle%3E%3Cpath%20d%3D%22M23.748%204.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434%201.202-.422%201.84.027%201.436.633%202.58%201.838%203.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526%205.526%200%2001-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365%2011.365%200%2000-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055%203.055%200%2001-.465.137%209.597%209.597%200%2000-2.883-.102c-1.885.21-3.39%201.102-4.497%202.623C.082%208.606-.231%2010.684.152%2012.85c.403%202.284%201.569%204.175%203.36%205.653%201.858%201.533%203.997%202.284%206.438%202.14%201.482-.085%203.133-.284%204.994-1.86.47.234.962.327%201.78.397.63.059%201.236-.03%201.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926%201.096-1.296%202.746-2.642%203.392-7.003.05-.347.007-.565%200-.845-.004-.17.035-.237.23-.256a4.173%204.173%200%20001.545-.475c1.396-.763%201.96-2.015%202.093-3.517.02-.23-.004-.467-.247-.588zM11.581%2018c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696%204.696%200%20011.529-.039c2.132.312%203.946%201.265%205.468%202.774.868.86%201.525%201.887%202.202%202.891.72%201.066%201.494%202.082%202.48%202.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306%200%2001.415-.287.302.302%200%2001.2.288.306.306%200%2001-.31.307.303.303%200%2001-.304-.308zm3.11%201.596c-.2.081-.399.151-.59.16a1.245%201.245%200%2001-.798-.254c-.274-.23-.47-.358-.552-.758a1.73%201.73%200%2001.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559%200%2001-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136%201.146.016.352.144.618.408%201.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z%22%20fill%3D%22%234D6BFE%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E",
9
+ name: "DeepSeek",
10
+ region: null,
11
+ market: "domestic",
12
+ catalogKey: "deepseek",
13
+ canListModels: true,
14
+ endpoints: [{
15
+ baseUrl: "https://api.deepseek.com",
16
+ thinkingSwitch: true,
17
+ type: "deepseek",
18
+ endpointId: "openai",
19
+ protocolIds: [
20
+ "openai",
21
+ "openai-responses",
22
+ "anthropic"
23
+ ]
24
+ }]
25
+ }],
26
+ snapshot: { "deepseek": {
27
+ "deepseek-v4-flash-vision-exp": {
28
+ "id": "deepseek-v4-flash-vision-exp",
29
+ "name": "DeepSeek V4 Flash Vision Exp",
30
+ "family": "deepseek-flash",
31
+ "reasoning": true,
32
+ "reasoning_options": [{ "type": "toggle" }, {
33
+ "type": "effort",
34
+ "values": [
35
+ "low",
36
+ "high",
37
+ "max"
38
+ ]
39
+ }],
40
+ "temperature": true,
41
+ "tool_call": true,
42
+ "attachment": true,
43
+ "modalities": {
44
+ "input": ["text", "image"],
45
+ "output": ["text"]
46
+ },
47
+ "limit": {
48
+ "context": 1e6,
49
+ "output": 384e3
50
+ },
51
+ "release_date": "2026-09-10"
52
+ },
53
+ "deepseek-v4-flash": {
54
+ "id": "deepseek-v4-flash",
55
+ "name": "DeepSeek V4 Flash",
56
+ "family": "deepseek-flash",
57
+ "reasoning": true,
58
+ "reasoning_options": [{ "type": "toggle" }, {
59
+ "type": "effort",
60
+ "values": [
61
+ "low",
62
+ "high",
63
+ "max"
64
+ ]
65
+ }],
66
+ "temperature": true,
67
+ "tool_call": true,
68
+ "attachment": true,
69
+ "modalities": {
70
+ "input": ["text", "image"],
71
+ "output": ["text"]
72
+ },
73
+ "limit": {
74
+ "context": 1e6,
75
+ "output": 384e3
76
+ },
77
+ "release_date": "2026-09-10"
78
+ },
79
+ "deepseek-v4-pro": {
80
+ "id": "deepseek-v4-pro",
81
+ "name": "DeepSeek V4 Pro",
82
+ "family": "deepseek-thinking",
83
+ "reasoning": true,
84
+ "reasoning_options": [{ "type": "toggle" }, {
85
+ "type": "effort",
86
+ "values": ["high", "max"]
87
+ }],
88
+ "temperature": true,
89
+ "tool_call": true,
90
+ "attachment": false,
91
+ "modalities": {
92
+ "input": ["text"],
93
+ "output": ["text"]
94
+ },
95
+ "limit": {
96
+ "context": 1e6,
97
+ "output": 384e3
98
+ },
99
+ "release_date": "2026-08-12"
100
+ },
101
+ "deepseek-flash": {
102
+ "id": "deepseek-flash",
103
+ "name": "DeepSeek V4.1 Flash",
104
+ "family": "deepseek-flash",
105
+ "reasoning": true,
106
+ "reasoning_options": [{ "type": "toggle" }, {
107
+ "type": "effort",
108
+ "values": [
109
+ "low",
110
+ "high",
111
+ "max"
112
+ ]
113
+ }],
114
+ "temperature": true,
115
+ "tool_call": true,
116
+ "attachment": true,
117
+ "modalities": {
118
+ "input": ["text", "image"],
119
+ "output": ["text"]
120
+ },
121
+ "limit": {
122
+ "context": 1e6,
123
+ "output": 384e3
124
+ },
125
+ "release_date": "2026-09-10"
126
+ }
127
+ } },
128
+ snapshotAt: Date.parse("2026-09-17")
129
+ };
130
+ //#endregion
131
+ //#region src/routing.ts
132
+ /** Maps only declared official roots; protocol implementations own the remaining resource URI. */
133
+ function connectionConfig(endpoint, protocolId, config, aliases = []) {
134
+ const defaults = Object.values(endpoint.capabilities).find((one) => one.protocolIds.includes(protocolId))?.protocolDefaults?.[protocolId] ?? {};
135
+ const configured = config.baseUrl;
136
+ const canonical = [
137
+ endpoint.defaults?.baseUrl,
138
+ ...Object.values(endpoint.capabilities).flatMap((one) => Object.values(one.protocolDefaults ?? {}).map((value) => value.baseUrl)),
139
+ ...aliases
140
+ ].filter((value) => typeof value === "string");
141
+ const isOfficial = configured === void 0 || typeof configured === "string" && canonical.some((value) => value.replace(/\/+$/, "") === configured.replace(/\/+$/, ""));
142
+ const selected = defaults.baseUrl ?? endpoint.defaults?.baseUrl;
143
+ return {
144
+ ...endpoint.defaults,
145
+ ...defaults,
146
+ ...config,
147
+ ...isOfficial && selected !== void 0 ? { baseUrl: selected } : {}
148
+ };
149
+ }
150
+ //#endregion
151
+ //#region src/type.ts
152
+ /** Stable supplier registration identity. */
153
+ const TYPE = "deepseek";
154
+ const endpoints = [{
155
+ id: "openai",
156
+ label: "DeepSeek API",
157
+ capabilities: { chat: {
158
+ protocolIds: [
159
+ "openai",
160
+ "openai-responses",
161
+ "anthropic"
162
+ ],
163
+ listingVia: {
164
+ endpointId: "openai",
165
+ protocolId: "openai"
166
+ },
167
+ defaultProtocolId: "openai-responses",
168
+ protocolDefaults: { anthropic: { baseUrl: "https://api.deepseek.com/anthropic/v1" } }
169
+ } },
170
+ defaults: { baseUrl: "https://api.deepseek.com" },
171
+ credentialGroup: "deepseek"
172
+ }];
173
+ const protocolOptions = {
174
+ openai: {
175
+ reasoningReplay: "reasoning-content",
176
+ thinkingField: true
177
+ },
178
+ "openai-responses": {
179
+ reasoningReplay: "reasoning-content",
180
+ reasoningSummary: false,
181
+ effortCache: false,
182
+ promptCacheKey: false
183
+ },
184
+ anthropic: {
185
+ reasoningReplay: "unsigned-thinking",
186
+ effortCache: false,
187
+ cacheBreakpoints: false,
188
+ thinkingEffort: true,
189
+ thinkingBeta: false,
190
+ thinkingMode: "enabled"
191
+ }
192
+ };
193
+ /** Builds this supplier's declaration without network activity or protocol imports. */
194
+ function deepseekProviderType(support) {
195
+ return {
196
+ type: TYPE,
197
+ label: "DeepSeek",
198
+ fields: [{
199
+ key: "apiKey",
200
+ kind: "secret",
201
+ label: "API Key",
202
+ required: true
203
+ }],
204
+ endpoints,
205
+ catalog: support ? {
206
+ ...catalog,
207
+ source: support.catalogueSource("https://models.dev/api.json", "models")
208
+ } : catalog,
209
+ describeModel({ model }) {
210
+ return Object.values(catalog.snapshot).some((row) => Object.hasOwn(row, model)) ? {
211
+ id: model,
212
+ outputLimit: {
213
+ ordinary: 16384,
214
+ thinking: 32768
215
+ }
216
+ } : void 0;
217
+ },
218
+ prepareConnection(input) {
219
+ const endpoint = endpoints.find((one) => one.id === input.endpointId);
220
+ if (!endpoint || !Object.values(endpoint.capabilities).some((one) => one.protocolIds.includes(input.protocolId))) throw new Error("unsupported supplier endpoint or protocol");
221
+ return {
222
+ config: connectionConfig(endpoint, input.protocolId, input.config, endpoints.map((one) => one.defaults.baseUrl)),
223
+ options: protocolOptions[input.protocolId] ?? {}
224
+ };
225
+ }
226
+ };
227
+ }
228
+ //#endregion
229
+ //#region src/index.ts
230
+ /** Suppliers contribute no tools. */
231
+ const TOOL_NAMES = [];
232
+ const plugin = {
233
+ name: "@eum-agent/llm-provider-deepseek",
234
+ requires: ["model-catalogue-sources"],
235
+ apply(ctx) {
236
+ const support = ctx.services.get("model-catalogue-sources");
237
+ ctx.modelProviders.register(deepseekProviderType(support));
238
+ }
239
+ };
240
+ //#endregion
241
+ export { TOOL_NAMES, plugin as default };
package/package.json CHANGED
@@ -1,6 +1,41 @@
1
1
  {
2
2
  "name": "@eum-agent/llm-provider-deepseek",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "displayName": {
4
+ "en-US": "DeepSeek Model Connection",
5
+ "zh-CN": "模型接入 · DeepSeek"
6
+ },
7
+ "version": "1.1.0",
8
+ "type": "module",
9
+ "description": "DeepSeek model provider using registered OpenAI and Anthropic protocols",
10
+ "license": "MIT",
11
+ "exports": {
12
+ ".": {
13
+ "default": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "assets"
19
+ ],
20
+ "devDependencies": {
21
+ "@eum-agent/plugin": "1.1.0"
22
+ },
23
+ "dependencies": {
24
+ "zod": "^4.4.3"
25
+ },
26
+ "yaoguang": {
27
+ "description": {
28
+ "en-US": "DeepSeek model provider using registered OpenAI and Anthropic protocols",
29
+ "zh-CN": "通过已注册的 OpenAI 与 Anthropic 协议接入 DeepSeek 模型"
30
+ },
31
+ "dependencies": {
32
+ "@eum-agent/llm-management": "1.1.0"
33
+ },
34
+ "kind": "extension"
35
+ },
36
+ "scripts": {
37
+ "build": "tsdown",
38
+ "test": "vitest run",
39
+ "typecheck": "tsc --noEmit"
40
+ }
6
41
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.