@deepseek-ai/dsh-llm-deepseek-api-key 0.2.1-rc.4 → 0.2.2-alpha.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.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: 2aad8a660b90561d
19
- zh: 3f425b3d1ea023e1
18
+ en: 007427bed9bd469b
19
+ zh: 5089b5781746357f
20
20
  /deepseek-ai-dsh-llm-deepseek-api-key/understand-the-implementation:
21
21
  en: d614c1ea3a9eb382
22
22
  zh: 5ca070349bb22d56
package/README.md CHANGED
@@ -39,7 +39,7 @@ The endpoint and credential reference come from one configuration resolution. In
39
39
 
40
40
  `models` is an independently configurable catalog for this provider; defaults and protocol capabilities come from the shared transport. While `models` equals the built-in catalog and the Messages origin is the official API, `https://api.deepseek.com`, the route serves the official `GET https://api.deepseek.com/models` listing instead. Listing requests carry the API key in `x-api-key` and the harness `User-Agent`, and reject redirects; without an API key the route requests nothing. Any other endpoint, including one named by `baseURL` or `$DEEPSEEK_BASE_URL`, serves `models` and requests no listing. Discovery does not probe inference endpoints.
41
41
 
42
- The first access waits for the listing up to `modelsTimeoutMs`. Later accesses use the loaded listing and refresh it in the background once it is older than `modelsMaxAgeMs`; an idle route sends no requests. A failed or empty listing keeps the previous one; before any listing loads, the route serves the built-in catalog of the current version (`deepseek-flash` and `deepseek-v4-pro`). A listing HTTP 401 fails only that load. Each loaded listing, the first failure of a failing streak with the catalog it falls back to, and each listing entry hidden because its declarations are unreadable or unusable are written to stderr with the `[llm-deepseek-api-key]` tag; stdout remains available for protocol messages, and secrets are never logged.
42
+ The first access waits for the listing up to `modelsTimeoutMs`. After first use, the Host refreshes automatically every `modelsMaxAgeMs` (ten minutes by default), including while the page is idle. Later accesses return the cached listing while a refresh runs. A failed or empty listing retains the previous listing, including badges; before any listing loads, the route serves the built-in catalog of the current version (`deepseek-flash` and `deepseek-v4-pro`). A listing HTTP 401 fails only that load. Each loaded listing, the first failure of a failing streak with the catalog it falls back to, each listing entry hidden because its declarations are unreadable or unusable, and each dropped badge are written to stderr with the `[llm-deepseek-api-key]` tag; stdout remains available for protocol messages, and secrets are never logged. Changed listings emit `llm/models-updated`, so open selectors reload without a page refresh. Omitted or `null` badge metadata clears a previous badge; no separate clear operation is needed. Plugin disposal stops refreshes and waits for active loads.
43
43
 
44
44
  Listed models are offered, merged with this build's entries, and refused before network I/O with `CLIENT_UPGRADE_REQUIRED` or `MODEL_UNSUPPORTED` by the [account route's rules](../llm-deepseek-account/README.md#use-this-package); model ids the listing does not name pass through unchanged.
45
45
 
@@ -48,7 +48,7 @@ A `models` list that differs from the built-in catalog replaces the catalog and
48
48
  | Field | Default | Meaning |
49
49
  |---|---|---|
50
50
  | `modelsTimeoutMs` | `5,000` | Deadline of one listing request and of a first-access wait |
51
- | `modelsMaxAgeMs` | `600,000` | Listing age after which the next access refreshes it; a failed load retries after the same age |
51
+ | `modelsMaxAgeMs` | `600,000` | Automatic refresh interval after first use, also used after failure; `0` refreshes on access only |
52
52
 
53
53
  The settings namespace is the Cordis entry id, or the plugin name without an entry. Product profiles retain the official entry id `llm-deepseek` and use `llm-deepseek-account` for the account route.
54
54
 
package/README.zh.md CHANGED
@@ -39,7 +39,7 @@ kind: "package-reference"
39
39
 
40
40
  `models` 是该 provider 独立的可配置目录;默认值和协议能力来自共享传输包。当 `models` 等于内置目录、且 Messages 的 origin 是官方 API `https://api.deepseek.com` 时,路由改为提供官方 `GET https://api.deepseek.com/models` 列表。列表请求用 `x-api-key` 携带 API key,带上 harness 的 `User-Agent`,并拒绝重定向;没有 API key 时不发任何请求。其他端点,包括由 `baseURL` 或 `$DEEPSEEK_BASE_URL` 指定的端点,提供 `models`,不请求列表。目录判断不探测推理端点。
41
41
 
42
- 第一次访问会等待列表,最长 `modelsTimeoutMs`。之后的访问直接使用已加载的列表,列表超过 `modelsMaxAgeMs` 后在后台刷新;路由空闲时不发请求。获取失败或得到空列表时保留上一份;还没有加载到任何列表时,路由提供当前版本内置的目录(`deepseek-flash` 与 `deepseek-v4-pro`)。列表请求返回 HTTP 401 只让这一次加载失败。每次加载成功、连续失败中的第一次失败及其退回的目录、以及每个因声明无法读取或不可用而被隐藏的列表条目,都会以 `[llm-deepseek-api-key]` 标签写到 stderr;stdout 保留给协议消息,且不记录任何密钥。
42
+ 第一次访问会等待列表,最长 `modelsTimeoutMs`。首次使用后,Host 每隔 `modelsMaxAgeMs`(默认十分钟)自动刷新,页面空闲时也会刷新。刷新过程中,后续访问直接返回缓存列表。获取失败或得到空列表时保留上一份列表及其角标;还没有加载到任何列表时,路由提供当前版本内置的目录(`deepseek-flash` 与 `deepseek-v4-pro`)。列表请求返回 HTTP 401 只让这一次加载失败。每次加载成功、连续失败中的第一次失败及其退回的目录、每个因声明无法读取或不可用而被隐藏的列表条目,以及每个被丢弃的角标,都会以 `[llm-deepseek-api-key]` 标签写到 stderr;stdout 保留给协议消息,且不记录任何密钥。 列表变化时发出 `llm/models-updated`,已打开的选择器会重新加载,无需刷新页面。省略角标元数据或将其设为 `null` 会清除旧角标,无需单独的清除操作。插件卸载会停止刷新并等待进行中的加载结束。
43
43
 
44
44
  列出的模型按[账号路由的规则](../llm-deepseek-account/README.zh.md#use-this-package)提供、与本版本的内置条目合并,并在网络请求之前以 `CLIENT_UPGRADE_REQUIRED` 或 `MODEL_UNSUPPORTED` 拒绝;列表没有列出的模型 id 照常透传。
45
45
 
@@ -48,7 +48,7 @@ kind: "package-reference"
48
48
  | 字段 | 默认值 | 含义 |
49
49
  |---|---|---|
50
50
  | `modelsTimeoutMs` | `5,000` | 单次列表请求以及首次访问等待的上限 |
51
- | `modelsMaxAgeMs` | `600,000` | 列表超过这个时长后,下一次访问时刷新;获取失败后同样在这个时长后重试 |
51
+ | `modelsMaxAgeMs` | `600,000` | 首次使用后的自动刷新间隔,失败后也按此间隔重试;`0` 表示只在访问时刷新 |
52
52
 
53
53
  设置命名空间采用 Cordis entry id,没有 entry 时采用插件名。产品保留 official 的 `llm-deepseek` entry id,账号使用 `llm-deepseek-account`。
54
54
 
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { APP_IDENTITY, LlmError, assertUsableApiKey } from "@deepseek-ai/dsh-llm";
2
2
  import { launchEnvironmentOf } from "@deepseek-ai/dsh-launch-environment";
3
- import { ModelListingCache, PUBLIC_BASE_URL, catalogModelInfo, deepSeekConfigFields, isBuiltInCatalog, modelListingConfigFields, modelListingURL, plainOptions as plainOptions$1, refuseListedModel, registerDeepSeekProvider, requestModelListing, resolveAdapterOptions as resolveAdapterOptions$1, resolveListedCatalog, resolveListingTiming } from "@deepseek-ai/dsh-llm-deepseek";
3
+ import { PUBLIC_BASE_URL, catalogModelInfo, createModelListingCache, deepSeekConfigFields, isBuiltInCatalog, modelListingConfigFields, modelListingURL, plainOptions as plainOptions$1, refuseListedModel, registerDeepSeekProvider, requestModelListing, resolveAdapterOptions as resolveAdapterOptions$1, resolveListedCatalog, resolveListingTiming } from "@deepseek-ai/dsh-llm-deepseek";
4
4
  import z from "@deepseek-ai/schemastery";
5
5
  import { credentialRef } from "@deepseek-ai/dsh-credentials";
6
6
  //#region lib/types/config.js
@@ -71,24 +71,19 @@ function apply(ctx, config) {
71
71
  throw error;
72
72
  }
73
73
  };
74
- const listings = new ModelListingCache({
74
+ const listings = createModelListingCache(ctx, name, PROVIDER, {
75
+ settings: () => options().listing,
75
76
  credential: async () => presentApiKey(options()),
76
- load: (url, apiKey, signal) => requestModelListing(url, { "x-api-key": apiKey }, signal),
77
- now: () => Date.now(),
78
- info: (message) => {
79
- console.error(LOG_TAG, message);
80
- },
81
- warn: (message) => {
82
- console.warn(LOG_TAG, message);
83
- }
77
+ load: (url, apiKey, signal) => requestModelListing(url, { "x-api-key": apiKey }, signal)
84
78
  });
85
79
  let reportedListing;
86
- /** Resolve the catalog of one operation, reporting each listing's hidden entries once. */
80
+ /** Resolve the catalog, reporting each listing's hidden entries and dropped badges once. */
87
81
  const connectionOf = (connection, view) => {
88
82
  if (view === void 0) return {
89
83
  ...connection,
90
84
  offered: connection.models,
91
- refusals: /* @__PURE__ */ new Map()
85
+ refusals: /* @__PURE__ */ new Map(),
86
+ badges: /* @__PURE__ */ new Map()
92
87
  };
93
88
  const catalog = resolveListedCatalog({
94
89
  listing: view.listing?.entries,
@@ -105,7 +100,8 @@ function apply(ctx, config) {
105
100
  ...connection,
106
101
  models: catalog.resolution,
107
102
  offered: catalog.offered,
108
- refusals: catalog.refusals
103
+ refusals: catalog.refusals,
104
+ badges: catalog.badges
109
105
  };
110
106
  };
111
107
  ctx.llm.registerConfigurableProviders([{
@@ -143,7 +139,9 @@ function apply(ctx, config) {
143
139
  return connection.models.map((model) => catalogModelInfo(provider, model));
144
140
  }
145
141
  const view = await listings.view(connection.listing);
146
- return view.authenticated ? connectionOf(connection, view).offered.map((model) => catalogModelInfo(provider, model)) : [];
142
+ if (!view.authenticated) return [];
143
+ const { offered, badges } = connectionOf(connection, view);
144
+ return offered.map((model) => catalogModelInfo(provider, model, badges.get(model.id)));
147
145
  }
148
146
  });
149
147
  let following = options().listing !== void 0;
@@ -157,9 +155,6 @@ function apply(ctx, config) {
157
155
  if (next !== following) listings.invalidate();
158
156
  following = next;
159
157
  });
160
- ctx.effect(() => () => {
161
- listings.dispose();
162
- }, "llm-deepseek-api-key: model listing");
163
158
  }
164
159
  //#endregion
165
160
  export { Config, apply, inject, name, plainOptions, resolveAdapterOptions };
package/locale/de.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek API Schlüsselzugriff",
4
+ "description": "Stellen Sie mit der Taste API eine Verbindung zum Modelldienst DeepSeek her."
5
+ }
6
+ }
package/locale/es.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek API Acceso clave",
4
+ "description": "Conéctese al servicio del modelo DeepSeek usando la clave API."
5
+ }
6
+ }
package/locale/fr.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek API Clé d'accès",
4
+ "description": "Connectez-vous au service de modèle DeepSeek à l'aide de la clé API."
5
+ }
6
+ }
package/locale/ja.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek API キー接続",
4
+ "description": "API キーを使用して DeepSeek モデルサービスに接続します。"
5
+ }
6
+ }
package/locale/pt.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek API Acesso chave",
4
+ "description": "Conecte-se ao serviço de modelo DeepSeek usando a chave API."
5
+ }
6
+ }
package/locale/ru.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek API Доступ по ключу",
4
+ "description": "Подключитесь к сервису модели DeepSeek, используя ключ API."
5
+ }
6
+ }
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-rc.4",
4
+ "version": "0.2.2-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -29,20 +29,20 @@
29
29
  ],
30
30
  "license": "MIT",
31
31
  "peerDependencies": {
32
- "@deepseek-ai/cordis": "~4.0.5",
33
- "@deepseek-ai/dsh-llm": "0.2.1-rc.4",
34
- "@deepseek-ai/dsh-llm-deepseek": "0.2.1-rc.4",
35
- "@deepseek-ai/dsh-launch-environment": "0.2.1-rc.4",
36
- "@deepseek-ai/dsh-credentials": "0.2.1-rc.4",
37
- "@deepseek-ai/cordis-plugin-loader": "~1.0.6"
32
+ "@deepseek-ai/cordis": "~4.0.6-alpha.1",
33
+ "@deepseek-ai/dsh-llm": "0.2.2-alpha.2",
34
+ "@deepseek-ai/dsh-llm-deepseek": "0.2.2-alpha.2",
35
+ "@deepseek-ai/dsh-launch-environment": "0.2.2-alpha.2",
36
+ "@deepseek-ai/dsh-credentials": "0.2.2-alpha.2",
37
+ "@deepseek-ai/cordis-plugin-loader": "~1.0.7-alpha.1"
38
38
  },
39
39
  "devDependencies": {
40
- "@deepseek-ai/cordis": "~4.0.5",
41
- "@deepseek-ai/dsh-llm": "0.2.1-rc.4",
42
- "@deepseek-ai/dsh-llm-deepseek": "0.2.1-rc.4",
43
- "@deepseek-ai/dsh-launch-environment": "0.2.1-rc.4",
44
- "@deepseek-ai/dsh-credentials": "0.2.1-rc.4",
45
- "@deepseek-ai/cordis-plugin-loader": "~1.0.6"
40
+ "@deepseek-ai/cordis": "~4.0.6-alpha.1",
41
+ "@deepseek-ai/dsh-llm": "0.2.2-alpha.2",
42
+ "@deepseek-ai/dsh-llm-deepseek": "0.2.2-alpha.2",
43
+ "@deepseek-ai/dsh-launch-environment": "0.2.2-alpha.2",
44
+ "@deepseek-ai/dsh-credentials": "0.2.2-alpha.2",
45
+ "@deepseek-ai/cordis-plugin-loader": "~1.0.7-alpha.1"
46
46
  },
47
47
  "peerDependenciesMeta": {
48
48
  "@deepseek-ai/cordis-plugin-loader": {
@@ -50,6 +50,6 @@
50
50
  }
51
51
  },
52
52
  "dependencies": {
53
- "@deepseek-ai/schemastery": "~3.18.5"
53
+ "@deepseek-ai/schemastery": "~3.18.6-alpha.1"
54
54
  }
55
55
  }