@deepseek-ai/dsh-web-deepseek-api 0.2.1-rc.3 → 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
@@ -9,20 +9,20 @@
9
9
  en: a56113c9530cb046
10
10
  zh: bb07334e63fd9204
11
11
  /deepseek-ai-dsh-web-deepseek-api/summary:
12
- en: 49ea0208c97514dc
13
- zh: 5ad4698f3588ebdb
12
+ en: 0519addcba3db93f
13
+ zh: 7c8bb421d7c89a1e
14
14
  /deepseek-ai-dsh-web-deepseek-api/table-of-contents:
15
15
  en: 76368b6b1da79c80
16
16
  zh: 1e8f931a56b7d34d
17
17
  /deepseek-ai-dsh-web-deepseek-api/use-this-package:
18
- en: 408a1ef777a98309
19
- zh: 30c6b52c20de3b67
18
+ en: 918391d0d2ef5e75
19
+ zh: b9030f54ba1adfc5
20
20
  /deepseek-ai-dsh-web-deepseek-api/use-this-package/authentication:
21
- en: 491f4c93c0d02152
22
- zh: 4888cd52667bdc39
21
+ en: 3037d291178a5b62
22
+ zh: 27ed3abccd9d5cf3
23
23
  /deepseek-ai-dsh-web-deepseek-api/use-this-package/results-and-failures:
24
- en: b8bfad1c79b2f05a
25
- zh: b8d89fabbc028ac1
24
+ en: ed83053d3e5a7e57
25
+ zh: 4c82d231fb6847d7
26
26
  /deepseek-ai-dsh-web-deepseek-api/understand-the-implementation:
27
27
  en: 0372c46bac133870
28
28
  zh: 0c803f4fb04a7ee4
@@ -36,14 +36,26 @@
36
36
  en: a9fbb78ffe886f0b
37
37
  zh: 813dc7ee283018d2
38
38
  /deepseek-ai-dsh-web-deepseek-api/model-experience/conversation-tool-results/token-effect:
39
- en: d82cd03f38fb4b38
40
- zh: 7049a13d2373a7b9
39
+ en: 1f33560e768d18c5
40
+ zh: edeedeef2662e4bb
41
41
  /deepseek-ai-dsh-web-deepseek-api/model-experience/conversation-tool-results/kv-cache-effect:
42
42
  en: 54ed534b58469807
43
43
  zh: c3f8f178abb86ccb
44
+ /deepseek-ai-dsh-web-deepseek-api/model-experience/conversation-tool-list-indirectly:
45
+ en: ddcce72a4a4e0def
46
+ zh: 338aa339f5708d7d
47
+ /deepseek-ai-dsh-web-deepseek-api/model-experience/conversation-tool-list-indirectly/what-the-model-sees:
48
+ en: 3b1fb6c686d294af
49
+ zh: 98cc7a8e99d89155
50
+ /deepseek-ai-dsh-web-deepseek-api/model-experience/conversation-tool-list-indirectly/token-effect:
51
+ en: 4e75bf3d1e75e28c
52
+ zh: 608bfad662133716
53
+ /deepseek-ai-dsh-web-deepseek-api/model-experience/conversation-tool-list-indirectly/kv-cache-effect:
54
+ en: 14f9af39f3be4fac
55
+ zh: 3c7139fba0f17862
44
56
  /deepseek-ai-dsh-web-deepseek-api/known-limitations-and-deferred-work:
45
- en: d4877c8f4e158a5d
46
- zh: 45177b6d6c3ecc40
57
+ en: 14dbc927803b012a
58
+ zh: 09104e6062d80aa3
47
59
  /deepseek-ai-dsh-web-deepseek-api/known-limitations-and-deferred-work/dev-note:
48
60
  en: 0a1253c6f7b5e8b9
49
61
  zh: 9f56528562c7c914
package/README.md CHANGED
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
9
9
 
10
10
  ## Summary
11
11
 
12
- Search and fetch the web through the DeepSeek Search and Fetch APIs: one direct request per operation, without an auxiliary model request. The plugin registers `deepseek-search-api` and `deepseek-fetch-api`, which share one credential and one API base, and authenticates with an API key or the configured account integration. Search returns titles, URLs, available snippets, and available publication dates; Fetch returns page Markdown. Messages search stays in [dsh-web-search-deepseek](../web-search-deepseek/README.md); the model-facing tools live in `dsh-tool-web`.
12
+ Search and fetch the web through the DeepSeek Search and Fetch APIs: one direct request per operation, without an auxiliary model request. The plugin registers `deepseek-search-api` and `deepseek-fetch-api`, which share one credential and one API base, and authenticates with an API key or the configured account integration. Search returns titles, URLs, available snippets and summaries, and available publication dates; Fetch returns page Markdown. Messages search stays in [dsh-web-search-deepseek](../web-search-deepseek/README.md); the model-facing tools live in `dsh-tool-web`.
13
13
 
14
14
  ## Table of Contents
15
15
 
@@ -48,13 +48,16 @@ Fill `baseURL` with the complete API base, including its path prefix and excludi
48
48
 
49
49
  Run the real API tests with `DEEPSEEK_API_KEY` and `DEEPSEEK_SEARCH_API_TEST_BASE_URL`; both are required, and the latter includes the API path prefix.
50
50
 
51
+ <a id="authentication"></a>
51
52
  ### Authentication
52
53
 
53
54
  A Session using the `deepseek-account` route asks the account service for a token authorized for the resolved endpoint and sends it as `x-dsh-auth-token`; the public Search and Fetch routes accepted it on 2026-10-16. Otherwise a non-empty literal `apiKey` wins over `apiKeyEnv`; the reference resolves through `ctx.credentials`, or the launch environment when that service is absent. API keys use `Authorization: Bearer`. Credential resolution and endpoint selection share one settings snapshot.
54
55
 
56
+ Each provider's `ready()` answers whether an operation for a model request has a credential, on any model route: the request's route is `deepseek-account` and `ctx.deepseekAccount` resolves a token for the API base, or a literal `apiKey` is set or `ctx.credentials.describe` reports the `apiKeyEnv` reference configured (without that service, the launch environment must carry it). A failed account-token or credential-store read answers false. While these providers are selected, [`dsh-tool-web`](../tool-web/README.md#search-readiness) withholds `web_search` and `web_fetch` with their prompt guidance from each request for which they answer false. Only presence is checked: a wrong key counts as ready and fails each call.
57
+
55
58
  ### Results and failures
56
59
 
57
- The Search API receives `query`, `count` (the configured count, or the request's smaller `maxResults`), `need_content: false`, and, unless `sendOriginalQuestion` is off, `ori_question`: the text of the initiating Session's latest human prompt with whitespace collapsed and cut to 128 characters. A search outside a Session or without such a prompt omits it. The provider maps `results[].snippet` directly and maps nullable `date` to optional `publishedAt`. An empty results array is successful. Fetch sends `url` and returns the original Markdown as a text body with HTTP status 200, because the API answers with an error status when the target yields no usable content. Its URL is the requested URL: the API reports no final redirected URL.
60
+ The Search API receives `query`, `count` (the configured count, or the request's smaller `maxResults`), `need_content: false`, and, unless `sendOriginalQuestion` is off, `ori_question`: the text of the initiating Session's latest human prompt with whitespace collapsed and cut to 128 characters. A search outside a Session or without such a prompt omits it. The provider maps `results[].snippet` as the display excerpt and `results[].summary` as the model-facing excerpt, and maps nullable `date` to optional `publishedAt`; `dsh-tool-web` caps each summary. An empty results array is successful. Fetch sends `url` and returns the original Markdown as a text body with HTTP status 200, because the API answers with an error status when the target yields no usable content. Its URL is the requested URL: the API reports no final redirected URL.
58
61
 
59
62
  A blank or unparseable `baseURL` makes both providers unavailable, and a `count` outside 1 to 50 makes Search unavailable. Missing credentials fail with `WEB_PROVIDER_CREDENTIAL_MISSING`; cancellation uses `WEB_ABORTED`; transport, HTTP, and malformed response failures use `WEB_PROVIDER_ERROR`. Redirects are rejected before contacting their target. Non-success Fetch API statuses are retrieval failures, not target-page statuses. Account-authenticated HTTP 401 responses provide sign-in guidance; other dispatch failures identify the endpoint and the `baseURL` settings field. No automatic retry or provider fallback occurs.
60
63
 
@@ -85,20 +88,35 @@ The `web_search` and `web_fetch` tools render sources or Markdown with an extern
85
88
 
86
89
  #### Token effect
87
90
 
88
- No auxiliary model tokens are consumed. Conversation result tokens scale with returned snippets or Markdown and are bounded by the consumer. API retrieval billing is independent of model tokens.
91
+ No auxiliary model tokens are consumed. Conversation result tokens scale with returned summaries, snippets, or Markdown and are bounded by the consumer. API retrieval billing is independent of model tokens.
89
92
 
90
93
  #### KV Cache effect
91
94
 
92
95
  Tool results append after the existing conversation prefix. Provider registration adds no model context.
93
96
 
97
+ ### Conversation tool list, indirectly
98
+
99
+ #### What the model sees
100
+
101
+ While these providers are selected, a conversation request for which one is not ready carries neither its tool's schema, `web_search` or `web_fetch`, nor that tool's prompt guidance; [`dsh-tool-web`](../tool-web/README.md#search-readiness) owns that effect.
102
+
103
+ #### Token effect
104
+
105
+ Withholding removes the tool's schema and its prompt guidance from the request.
106
+
107
+ #### KV Cache effect
108
+
109
+ A returning or removed web tool changes the declared tools as [`dsh-tool-web`](../tool-web/README.md#search-readiness) describes.
110
+
94
111
  ## Known Limitations and Deferred Work
95
112
 
96
113
  <a id="known-limitations-and-deferred-work"></a>
97
114
 
98
- - The shared search request does not expose `localization`; the provider requests snippets only and does not consume `summary`, `site_name`, `site_icon`, or full search content. Returned summaries measured 1,000–2,300 characters on 2026-10-16.
115
+ - The shared search request does not expose `localization`; the provider does not request full search content or consume `site_name`, `site_icon`, `rerank_score`, or `authority`. Returned summaries measured 1,000–2,300 characters on 2026-10-16, above the consumer's default cap.
99
116
  - In 2026-10-16 probes, different `ori_question` values left result order, scores, and summaries unchanged; the provider still sends it because the guide documents it as an intent signal.
100
117
  - API query and URL constraints are enforced by the remote service. An unresolvable Fetch target returned HTTP 500 rather than the documented 404 on 2026-10-16, and its failure carries the same endpoint guidance as an endpoint failure. Fetch exposes neither the target status nor the final redirect URL, so results report HTTP 200 and the requested URL; the provider discards the API's page title.
101
- - Availability checks cannot query asynchronous credential stores. A configured resolver can still fail with a missing-credential error when called.
118
+ - `available()` cannot query asynchronous credential stores; `ready()` does, so model steps withhold the tools when the store lacks the key. A direct `ctx.web.search()` or `ctx.web.fetch()` call can still fail with a missing-credential error.
119
+ - When the official route chats through a gateway, operations still send the key to the configured API base and fail unless it accepts the key.
102
120
 
103
121
  <a id="dev-note"></a>
104
122
  ### Dev Note
package/README.zh.md CHANGED
@@ -9,7 +9,7 @@ kind: "package-reference"
9
9
 
10
10
  ## 概述
11
11
 
12
- 通过 DeepSeek Search 与 Fetch API 搜索和抓取网页:每次操作只发起一次直接请求,无需辅助模型请求。插件注册 `deepseek-search-api` 和 `deepseek-fetch-api`,两者共用一份凭据和一个 API 基础地址,并使用 API key(API 密钥)或已配置的账号集成鉴权。Search 返回标题、URL、可用的摘要和可用的发布时间;Fetch 返回页面 Markdown。Messages 搜索仍由 [dsh-web-search-deepseek](../web-search-deepseek/README.zh.md) 提供;面向模型的工具由 `dsh-tool-web` 提供。
12
+ 通过 DeepSeek Search 与 Fetch API 搜索和抓取网页:每次操作只发起一次直接请求,无需辅助模型请求。插件注册 `deepseek-search-api` 和 `deepseek-fetch-api`,两者共用一份凭据和一个 API 基础地址,并使用 API key(API 密钥)或已配置的账号集成鉴权。Search 返回标题、URL、可用的 snippet 与 summary 以及可用的发布时间;Fetch 返回页面 Markdown。Messages 搜索仍由 [dsh-web-search-deepseek](../web-search-deepseek/README.zh.md) 提供;面向模型的工具由 `dsh-tool-web` 提供。
13
13
 
14
14
  ## 目录
15
15
 
@@ -48,13 +48,16 @@ kind: "package-reference"
48
48
 
49
49
  真实 API 测试要求同时设置 `DEEPSEEK_API_KEY` 和 `DEEPSEEK_SEARCH_API_TEST_BASE_URL`,后者包含 API 路径前缀。
50
50
 
51
+ <a id="authentication"></a>
51
52
  ### 鉴权
52
53
 
53
54
  使用 `deepseek-account` 路由的会话向账号服务请求已授权用于解析后端点的令牌,并通过 `x-dsh-auth-token` 发送;2026-10-16 公网 Search 与 Fetch 路由已接受该令牌。其他情况下,非空的字面 `apiKey` 优先于 `apiKeyEnv`;凭据引用通过 `ctx.credentials` 解析,该服务缺省时使用启动环境。API 密钥使用 `Authorization: Bearer`。凭据解析和端点选择使用同一份设置快照。
54
55
 
56
+ 每个提供者的 `ready()` 回答模型请求将发起的操作是否有凭据,不论模型路由:该请求的路由是 `deepseek-account` 且 `ctx.deepseekAccount` 为 API 基础地址解析出令牌,或者设置了字面 `apiKey`,或 `ctx.credentials.describe` 报告 `apiKeyEnv` 引用已配置(没有该服务时,启动环境必须包含它)。账号令牌或凭据存储读取失败时回答 false。这两个提供者被选中时,[`dsh-tool-web`](../tool-web/README.zh.md#search-readiness) 会从它们回答 false 的每个请求中撤下 `web_search` 与 `web_fetch` 及其提示词指引。只检查是否存在:错误的密钥仍算就绪,并使每次调用失败。
57
+
55
58
  ### 结果与失败
56
59
 
57
- Search API 接收 `query`、`count`(配置的结果数,或请求中更小的 `maxResults`)、`need_content: false`,以及在 `sendOriginalQuestion` 未关闭时的 `ori_question`:发起会话中最近一条用户提示的文本,空白折叠后截取至 128 个字符。在会话之外或没有此类提示的搜索不发送该字段。提供者直接映射 `results[].snippet`,并将可为 null 的 `date` 映射为可选的 `publishedAt`。空结果数组表示成功。Fetch 发送 `url`,以文本正文返回原始 Markdown,并报告 HTTP 状态 200,因为目标没有可用内容时 API 会返回错误状态。返回 URL 为请求 URL:API 不报告重定向后的最终 URL。
60
+ Search API 接收 `query`、`count`(配置的结果数,或请求中更小的 `maxResults`)、`need_content: false`,以及在 `sendOriginalQuestion` 未关闭时的 `ori_question`:发起会话中最近一条用户提示的文本,空白折叠后截取至 128 个字符。在会话之外或没有此类提示的搜索不发送该字段。提供者将 `results[].snippet` 映射为展示用摘录,将 `results[].summary` 映射为面向模型的摘录,并将可为 null 的 `date` 映射为可选的 `publishedAt`;`dsh-tool-web` 限制每条摘要的长度。空结果数组表示成功。Fetch 发送 `url`,以文本正文返回原始 Markdown,并报告 HTTP 状态 200,因为目标没有可用内容时 API 会返回错误状态。返回 URL 为请求 URL:API 不报告重定向后的最终 URL。
58
61
 
59
62
  `baseURL` 为空白或无法解析时,两个提供者都不可用;`count` 不在 1 至 50 之间时,Search 不可用。凭据缺失以 `WEB_PROVIDER_CREDENTIAL_MISSING` 失败;取消使用 `WEB_ABORTED`;传输、HTTP 和响应格式错误使用 `WEB_PROVIDER_ERROR`。重定向在联系目标前即被拒绝。Fetch API 的非成功状态表示抓取失败,不代表目标页面的状态。账号鉴权的 HTTP 401 响应提供重新登录指引;其他请求失败指出端点及 `baseURL` 设置字段。不会自动重试或回退至其他提供者。
60
63
 
@@ -85,20 +88,35 @@ Search API 接收 `query`、`count`(配置的结果数,或请求中更小的
85
88
 
86
89
  #### Token 影响
87
90
 
88
- 不消耗辅助模型 token。会话结果 token 随返回的摘要或 Markdown 增长,并受消费方限制。API 抓取计费独立于模型 token。
91
+ 不消耗辅助模型 token。会话结果 token 随返回的 summary、snippet 或 Markdown 增长,并受消费方限制。API 抓取计费独立于模型 token。
89
92
 
90
93
  #### KV Cache 影响
91
94
 
92
95
  工具结果追加在已有会话前缀之后。提供者注册不增加模型上下文。
93
96
 
97
+ ### 会话工具列表(间接)
98
+
99
+ #### 模型看到什么
100
+
101
+ 这两个提供者被选中时,其中一个未就绪的会话请求既不包含对应工具(`web_search` 或 `web_fetch`)的 schema,也不包含该工具的提示词指引;该效果由 [`dsh-tool-web`](../tool-web/README.zh.md#search-readiness) 负责。
102
+
103
+ #### Token 影响
104
+
105
+ 撤下时,请求中不再包含该工具的 schema 及其提示词指引。
106
+
107
+ #### KV Cache 影响
108
+
109
+ 重新提供或移除 Web 工具会按 [`dsh-tool-web`](../tool-web/README.zh.md#search-readiness) 所述改变声明的工具。
110
+
94
111
  ## 已知限制与待办工作
95
112
 
96
113
  <a id="known-limitations-and-deferred-work"></a>
97
114
 
98
- - 共享搜索请求不暴露 `localization`;提供者仅请求摘要,不消费 `summary`、`site_name`、`site_icon` 或搜索全文。2026-10-16 实测返回的 `summary` 长度为 1,000–2,300 个字符。
115
+ - 共享搜索请求不暴露 `localization`;提供者不请求搜索全文,也不消费 `site_name`、`site_icon`、`rerank_score` 或 `authority`。2026-10-16 实测返回的 `summary` 长度为 1,000–2,300 个字符,超过消费方的默认上限。
99
116
  - 2026-10-16 的探测中,不同的 `ori_question` 未改变结果顺序、评分或摘要;由于指南将其列为意图信号,提供者仍会发送。
100
117
  - 查询和 URL 约束由远端服务执行。2026-10-16 抓取无法解析的目标域名时返回 HTTP 500,而非文档所述的 404,其失败信息与端点失败附带相同的端点指引。Fetch 既不暴露目标状态,也不暴露最终重定向 URL,因此结果报告 HTTP 200 和请求 URL;提供者丢弃 API 返回的页面标题。
101
- - 可用性检查无法查询异步凭据存储。已配置的解析器在调用时仍可能因凭据缺失失败。
118
+ - `available()` 无法查询异步凭据存储;`ready()` 可以,因此凭据存储缺少密钥时,模型步骤会撤下这两个工具。直接调用 `ctx.web.search()` 或 `ctx.web.fetch()` 仍可能因凭据缺失失败。
119
+ - 官方路由经网关对话时,操作仍把密钥发往配置的 API 基础地址,除非该地址接受这个密钥,否则调用失败。
102
120
 
103
121
  <a id="dev-note"></a>
104
122
  ### 开发备注
package/lib/index.js CHANGED
@@ -30,6 +30,41 @@ function deepSeekWebAuth(ctx, config) {
30
30
  };
31
31
  }
32
32
  /**
33
+ * Whether an operation for a model request on `route` has a credential, checked in the order the
34
+ * operation resolves them: the account token first on the account route, then the API key. A failed
35
+ * read answers false, because the operation fails on that read instead of trying the next credential.
36
+ * Only presence is checked: the key's value is not read and the endpoint is not contacted, so a wrong
37
+ * key still counts as configured.
38
+ * @param ctx - Provider context with the account, credential, and environment planes.
39
+ * @param config - Literal key, credential reference, and API base from the settings snapshot.
40
+ * @param route - Provider route of the model request being prepared.
41
+ * @returns Whether the account token or an API key is available to that operation.
42
+ */
43
+ async function deepSeekWebCredentialReady(ctx, config, route) {
44
+ const account = ctx.get("deepseekAccount");
45
+ if (route === ACCOUNT_PROVIDER && account !== void 0) {
46
+ let token;
47
+ try {
48
+ token = await account.resolveToken(config.baseURL);
49
+ } catch (_unreadableGrant) {
50
+ return false;
51
+ }
52
+ if (token !== void 0 && token.length > 0) return true;
53
+ }
54
+ if (config.apiKey !== void 0 && config.apiKey.length > 0) return true;
55
+ const apiKeyEnv = credentialRef(config.apiKeyEnv);
56
+ const credentials = ctx.get("credentials");
57
+ if (credentials === void 0) {
58
+ const ambient = launchEnvironmentOf(ctx).get(apiKeyEnv);
59
+ return ambient !== void 0 && ambient.value.length > 0;
60
+ }
61
+ try {
62
+ return (await credentials.describe(apiKeyEnv)).configured;
63
+ } catch (_unreadableStore) {
64
+ return false;
65
+ }
66
+ }
67
+ /**
33
68
  * Check whether an authentication source exists; does not resolve credentials.
34
69
  * @param auth - Sources for the operation.
35
70
  * @returns Whether a literal key or resolver is present.
@@ -229,18 +264,20 @@ const DEEPSEEK_WEB_API_GUIDANCE = {
229
264
  /**
230
265
  * Validate a Search API response and project its sources into the web service.
231
266
  * @param response - untrusted JSON from the Search endpoint.
232
- * @returns sources with provider order and nullable publication dates preserved.
267
+ * @returns sources with provider order, the display `snippet`, the model-facing `summary`, and nullable
268
+ * publication dates preserved.
233
269
  * @throws {@link WebError} when the response does not contain valid search results.
234
270
  */
235
271
  function mapSearchResponse(response) {
236
272
  if (!isRecord(response) || !Array.isArray(response.results)) throw invalidResponse();
237
273
  return {
238
274
  sources: response.results.map((item) => {
239
- if (!isRecord(item) || typeof item.url !== "string" || item.url.length === 0 || typeof item.title !== "string" || typeof item.snippet !== "string" || item.date !== null && typeof item.date !== "string") throw invalidResponse();
275
+ if (!isRecord(item) || typeof item.url !== "string" || item.url.length === 0 || typeof item.title !== "string" || typeof item.snippet !== "string" || item.summary !== void 0 && typeof item.summary !== "string" || item.date !== null && typeof item.date !== "string") throw invalidResponse();
240
276
  return {
241
277
  url: item.url,
242
278
  ...item.title.length > 0 ? { title: item.title } : {},
243
279
  ...item.snippet.length > 0 ? { snippet: item.snippet } : {},
280
+ ...typeof item.summary === "string" && item.summary.length > 0 ? { summary: item.summary } : {},
244
281
  ...item.date !== null && item.date.length > 0 ? { publishedAt: item.date } : {}
245
282
  };
246
283
  }),
@@ -368,25 +405,44 @@ function latestUserQuestion(session) {
368
405
  return prompt.content.flatMap((block) => block.type === "text" ? [block.text] : []).join("\n");
369
406
  }
370
407
  /**
371
- * Register the Search API and Fetch API providers over one live settings section.
408
+ * Register the Search API and Fetch API providers over one live settings section. Each provider's
409
+ * `ready()` answers whether an operation for a model request on the given route would have a
410
+ * credential to send.
372
411
  * @param ctx - plugin context owning both registrations.
373
412
  * @param config - live settings, read once per operation.
374
413
  */
375
414
  function apply(ctx, config) {
376
- const auth = () => deepSeekWebAuth(ctx, {
415
+ const keyConfig = () => ({
377
416
  apiKey: config.apiKey.get(),
378
417
  apiKeyEnv: config.apiKeyEnv.get()
379
418
  });
380
- ctx.web.registerSearchProvider(new DeepSeekSearchApiProvider(() => ({
419
+ const auth = () => deepSeekWebAuth(ctx, keyConfig());
420
+ const ready = (llmProvider) => deepSeekWebCredentialReady(ctx, {
421
+ ...keyConfig(),
422
+ baseURL: config.baseURL.get()
423
+ }, llmProvider);
424
+ const searchApi = new DeepSeekSearchApiProvider(() => ({
381
425
  ...auth(),
382
426
  baseURL: config.baseURL.get(),
383
427
  count: config.count.get(),
384
428
  ...config.sendOriginalQuestion.get() ? { originalQuestion: () => latestUserQuestion(ctx.get("agents")?.currentInitiator()?.session) } : {}
385
- })));
386
- ctx.web.registerFetchProvider(new DeepSeekFetchApiProvider(() => ({
429
+ }));
430
+ const fetchApi = new DeepSeekFetchApiProvider(() => ({
387
431
  ...auth(),
388
432
  baseURL: config.baseURL.get()
389
- })));
433
+ }));
434
+ ctx.web.registerSearchProvider({
435
+ id: searchApi.id,
436
+ available: () => searchApi.available(),
437
+ ready,
438
+ search: (request, signal) => searchApi.search(request, signal)
439
+ });
440
+ ctx.web.registerFetchProvider({
441
+ id: fetchApi.id,
442
+ available: () => fetchApi.available(),
443
+ ready,
444
+ fetch: (request, signal) => fetchApi.fetch(request, signal)
445
+ });
390
446
  }
391
447
  //#endregion
392
448
  export { Config, DEEPSEEK_DEFAULT_COUNT, DEEPSEEK_FETCH_API_PROVIDER_ID, DEEPSEEK_SEARCH_API_PROVIDER_ID, DEEPSEEK_WEB_API_BASE_URL, DeepSeekFetchApiProvider, DeepSeekSearchApiProvider, apply, inject, mapSearchResponse, name };
@@ -4,7 +4,9 @@
4
4
  * auxiliary model request; both providers read this section's credential and API
5
5
  * base. `web.searchProvider` and `web.fetchProvider` select them. A Session on the
6
6
  * DeepSeek account route authenticates with the account token when the account
7
- * service allows the endpoint; every other request uses the configured key.
7
+ * service allows the endpoint; every other request uses the configured key. Both
8
+ * providers report themselves not ready for a model request whose operation would
9
+ * have no credential.
8
10
  * @module @deepseek-ai/dsh-web-deepseek-api
9
11
  */
10
12
  import type { Context, Volatile } from '@deepseek-ai/cordis';
@@ -44,7 +46,9 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
44
46
  sendOriginalQuestion: z<boolean, boolean, "volatile-defined">;
45
47
  }>>, "plain">;
46
48
  /**
47
- * Register the Search API and Fetch API providers over one live settings section.
49
+ * Register the Search API and Fetch API providers over one live settings section. Each provider's
50
+ * `ready()` answers whether an operation for a model request on the given route would have a
51
+ * credential to send.
48
52
  * @param ctx - plugin context owning both registrations.
49
53
  * @param config - live settings, read once per operation.
50
54
  */
@@ -25,7 +25,8 @@ export interface DeepSeekSearchApiOptions extends DeepSeekWebAuth {
25
25
  /**
26
26
  * Validate a Search API response and project its sources into the web service.
27
27
  * @param response - untrusted JSON from the Search endpoint.
28
- * @returns sources with provider order and nullable publication dates preserved.
28
+ * @returns sources with provider order, the display `snippet`, the model-facing `summary`, and nullable
29
+ * publication dates preserved.
29
30
  * @throws {@link WebError} when the response does not contain valid search results.
30
31
  */
31
32
  export declare function mapSearchResponse(response: unknown): WebSearchResult;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Authentication and redirect-rejecting transport shared by the Search and
3
- * Fetch API providers in this package. Credential resolution, the dispatch
4
- * call, and the cancellation helpers deliberately repeat
3
+ * Fetch API providers in this package. Credential resolution and its readiness
4
+ * check, the dispatch call, and the cancellation helpers deliberately repeat
5
5
  * `dsh-web-search-deepseek`, so neither plugin depends on the other; the
6
6
  * `jscpd:ignore` regions mark those repeats
7
7
  * ([rationale](../../../../.agents/notes/implemented/feature/2026-10-15-deepseek-search-fetch-api.md)).
@@ -61,6 +61,22 @@ export declare function deepSeekWebAuth(ctx: Context, config: {
61
61
  apiKey: string | undefined;
62
62
  apiKeyEnv: string;
63
63
  }): DeepSeekWebAuth;
64
+ /**
65
+ * Whether an operation for a model request on `route` has a credential, checked in the order the
66
+ * operation resolves them: the account token first on the account route, then the API key. A failed
67
+ * read answers false, because the operation fails on that read instead of trying the next credential.
68
+ * Only presence is checked: the key's value is not read and the endpoint is not contacted, so a wrong
69
+ * key still counts as configured.
70
+ * @param ctx - Provider context with the account, credential, and environment planes.
71
+ * @param config - Literal key, credential reference, and API base from the settings snapshot.
72
+ * @param route - Provider route of the model request being prepared.
73
+ * @returns Whether the account token or an API key is available to that operation.
74
+ */
75
+ export declare function deepSeekWebCredentialReady(ctx: Context, config: {
76
+ apiKey: string | undefined;
77
+ apiKeyEnv: string;
78
+ baseURL: string;
79
+ }, route: string | undefined): Promise<boolean>;
64
80
  /**
65
81
  * Check whether an authentication source exists; does not resolve credentials.
66
82
  * @param auth - Sources for the operation.
package/locale/de.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek Websuche und Crawling API",
4
+ "description": "Verwenden Sie DeepSeekSuchenAPI, um die Webseite zu durchsuchen, und Abrufen API, um den Webseitentext zu crawlen."
5
+ }
6
+ }
package/locale/es.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek Búsqueda y rastreo web API",
4
+ "description": "Utilice DeepSeekBuscar API para buscar en la página web y Buscar API para rastrear el texto de la página web."
5
+ }
6
+ }
package/locale/fr.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek Recherche et exploration sur le Web API",
4
+ "description": "Utilisez DeepSeekRechercherAPI pour rechercher la page Web et RécupérerAPI pour explorer le texte de la page Web."
5
+ }
6
+ }
package/locale/ja.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek Web 検索・取得 API",
4
+ "description": "DeepSeek Search API で Web ページを検索し、Fetch API で本文を取得します。"
5
+ }
6
+ }
package/locale/pt.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek Pesquisa e rastreamento na Web API",
4
+ "description": "Use DeepSeekPesquisarAPI para pesquisar a página da web e Buscar API para rastrear o texto da página da web."
5
+ }
6
+ }
package/locale/ru.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek Поиск и сканирование в Интернете API",
4
+ "description": "Используйте DeepSeekПоиск API для поиска на веб-странице и функцию \"Поиск\" API для сканирования текста веб-страницы."
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-web-deepseek-api",
3
3
  "description": "DeepSeek Search and Fetch API providers for the DeepSeek Harness web capability seam (ctx.web)",
4
- "version": "0.2.1-rc.3",
4
+ "version": "0.2.2-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -29,27 +29,28 @@
29
29
  ],
30
30
  "license": "MIT",
31
31
  "peerDependencies": {
32
- "@deepseek-ai/dsh-agent": "0.2.1-rc.3",
33
- "@deepseek-ai/dsh-credentials": "0.2.1-rc.3",
34
- "@deepseek-ai/dsh-deepseek-account": "0.2.1-rc.3",
35
- "@deepseek-ai/dsh-launch-environment": "0.2.1-rc.3",
36
- "@deepseek-ai/dsh-session": "0.2.1-rc.3",
37
- "@deepseek-ai/dsh-web": "0.2.1-rc.3",
38
- "@deepseek-ai/cordis": "~4.0.5"
32
+ "@deepseek-ai/dsh-agent": "0.2.2-alpha.2",
33
+ "@deepseek-ai/dsh-credentials": "0.2.2-alpha.2",
34
+ "@deepseek-ai/dsh-deepseek-account": "0.2.2-alpha.2",
35
+ "@deepseek-ai/dsh-launch-environment": "0.2.2-alpha.2",
36
+ "@deepseek-ai/dsh-session": "0.2.2-alpha.2",
37
+ "@deepseek-ai/dsh-web": "0.2.2-alpha.2",
38
+ "@deepseek-ai/cordis": "~4.0.6-alpha.1"
39
39
  },
40
40
  "dependencies": {
41
- "@deepseek-ai/schemastery": "~3.18.5"
41
+ "@deepseek-ai/schemastery": "~3.18.6-alpha.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@deepseek-ai/dsh-agent": "0.2.1-rc.3",
45
- "@deepseek-ai/dsh-credentials": "0.2.1-rc.3",
46
- "@deepseek-ai/dsh-credentials-local": "0.2.1-rc.3",
47
- "@deepseek-ai/dsh-deepseek-account": "0.2.1-rc.3",
48
- "@deepseek-ai/dsh-launch-environment": "0.2.1-rc.3",
49
- "@deepseek-ai/dsh-session": "0.2.1-rc.3",
50
- "@deepseek-ai/dsh-web": "0.2.1-rc.3",
51
- "@deepseek-ai/cordis": "~4.0.5",
52
- "@deepseek-ai/dsh-http-proxy": "0.2.1-rc.3"
44
+ "@deepseek-ai/dsh-agent": "0.2.2-alpha.2",
45
+ "@deepseek-ai/dsh-credentials": "0.2.2-alpha.2",
46
+ "@deepseek-ai/dsh-credentials-local": "0.2.2-alpha.2",
47
+ "@deepseek-ai/dsh-deepseek-account": "0.2.2-alpha.2",
48
+ "@deepseek-ai/dsh-launch-environment": "0.2.2-alpha.2",
49
+ "@deepseek-ai/dsh-session": "0.2.2-alpha.2",
50
+ "@deepseek-ai/dsh-session-projection": "0.2.2-alpha.2",
51
+ "@deepseek-ai/dsh-web": "0.2.2-alpha.2",
52
+ "@deepseek-ai/cordis": "~4.0.6-alpha.1",
53
+ "@deepseek-ai/dsh-http-proxy": "0.2.2-alpha.2"
53
54
  },
54
55
  "peerDependenciesMeta": {
55
56
  "@deepseek-ai/dsh-deepseek-account": {