@deepseek-ai/dsh-web-search-deepseek 0.2.2-rc.4 → 0.2.2-rc.5

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,11 +15,11 @@
15
15
  en: d152484eb41ac6b4
16
16
  zh: 09388d293f9be9cb
17
17
  /deepseek-ai-dsh-web-search-deepseek/use-this-package:
18
- en: e0d352d6402d9d3b
19
- zh: a449234557ef8bd6
18
+ en: 9a454a87296117c4
19
+ zh: 460c22441b1dab1f
20
20
  /deepseek-ai-dsh-web-search-deepseek/use-this-package/when-to-choose-it:
21
- en: 0187c8af8d2d98c5
22
- zh: 1c9607b3a662bcaa
21
+ en: 60c58e847abc01ab
22
+ zh: 730e65a38783002a
23
23
  /deepseek-ai-dsh-web-search-deepseek/use-this-package/minimal-configuration:
24
24
  en: 3ed88edabdf63c8d
25
25
  zh: c66176c8a7c9a434
@@ -27,14 +27,14 @@
27
27
  en: 7a765ba931329067
28
28
  zh: 6fc14edcc378684a
29
29
  /deepseek-ai-dsh-web-search-deepseek/use-this-package/what-a-search-returns:
30
- en: e30442c90365357b
31
- zh: 9c9e2f1182963a8a
30
+ en: 8f852321e5c111a7
31
+ zh: ae43d88540e0ccde
32
32
  /deepseek-ai-dsh-web-search-deepseek/use-this-package/request-logging:
33
33
  en: 467b8238cf7e140c
34
34
  zh: 85a519c8811557aa
35
35
  /deepseek-ai-dsh-web-search-deepseek/use-this-package/failures-and-recovery:
36
- en: 8e69cf009b707c49
37
- zh: f7d50bfc06b01b6d
36
+ en: 64814d2b8679eb05
37
+ zh: 0234a8494663fc4e
38
38
  /deepseek-ai-dsh-web-search-deepseek/understand-the-implementation:
39
39
  en: 9842c69ad3636bb3
40
40
  zh: 3cdc3f816cbdd0cb
@@ -45,8 +45,8 @@
45
45
  en: 6488e1c85646339f
46
46
  zh: 2b5ca1c6b5939a8c
47
47
  /deepseek-ai-dsh-web-search-deepseek/understand-the-implementation/request-flow:
48
- en: d6c3f30b70a5f4b5
49
- zh: ab7c5b7d6fc3cae6
48
+ en: 9918bcc18ad1cf49
49
+ zh: ba0a08146f74bdd2
50
50
  /deepseek-ai-dsh-web-search-deepseek/further-exploration:
51
51
  en: 3a650478cf33d792
52
52
  zh: ab4247c4c31f4a90
@@ -69,8 +69,8 @@
69
69
  en: 666f5753c99783ab
70
70
  zh: b44328e99bcc45c9
71
71
  /deepseek-ai-dsh-web-search-deepseek/model-experience/conversation-tool-result-indirectly/what-the-model-sees:
72
- en: 0764d19c9b82aa98
73
- zh: 88b0ba22ef64225b
72
+ en: 6df8e6cbf927a701
73
+ zh: 82c4a625a9ec5957
74
74
  /deepseek-ai-dsh-web-search-deepseek/model-experience/conversation-tool-result-indirectly/token-effect:
75
75
  en: 01ec43a9b616139d
76
76
  zh: 0a5b7c28fde34bcf
@@ -90,11 +90,11 @@
90
90
  en: 1d836a33dfa97fcf
91
91
  zh: 2593ccf2a5716b02
92
92
  /deepseek-ai-dsh-web-search-deepseek/known-limitations-and-deferred-work:
93
- en: 1cb15cc5e9b1967d
94
- zh: 64f1d93e94bbc9c3
93
+ en: 3eb9f8b55ffc5305
94
+ zh: 4f4bf14e3d695335
95
95
  /deepseek-ai-dsh-web-search-deepseek/known-limitations-and-deferred-work/dev-note:
96
96
  en: 7f775cc79dbce94b
97
97
  zh: 12b8f68f9e7c48ca
98
98
  /deepseek-ai-dsh-web-search-deepseek/known-limitations-and-deferred-work/dev-note/dedicated-retrieval-endpoint:
99
- en: 188ca3400a73352e
100
- zh: f948e2c565ec6ac1
99
+ en: 33df5365305ef1d7
100
+ zh: 3dff758d01d9bcd8
package/README.md CHANGED
@@ -25,11 +25,11 @@ With `dsh-web-search-deepseek`, the harness searches the web through DeepSeek's
25
25
  <a id="use-this-package"></a>
26
26
  ## Use this package
27
27
 
28
- Mount the provider in a composition that already loads the web service; it registers as the `deepseek-official` search provider, so `ctx.web.search()` resolves it automatically when it is the only usable search backend — or pin it with `searchProvider: deepseek-official`.
28
+ Mount the provider in a composition that already loads the web service; it registers as the `deepseek-official` search provider, so `ctx.web.search()` resolves it automatically when it is the only usable search backend, and while no search provider is configured also for a model request on the `deepseek-official` or `deepseek-account` model route ([provider selection](../web/README.md#provider-selection)) — or pin it with `searchProvider: deepseek-official`.
29
29
 
30
30
  ### When to choose it
31
31
 
32
- Choose this backend when a deployment wants DeepSeek's native server-side web search and its users either sign in to a DeepSeek account or hold a `DEEPSEEK_API_KEY` — the provider reuses those credentials as [Authentication](#authentication) describes. One search is heavier than a dedicated retrieval endpoint: DeepSeek runs the search inside a full model turn, so expect one Messages call's latency and generated tokens per search, with up to `maxUses` server-side searches per request. Avoid it when per-search cost or latency dominates.
32
+ Choose this backend when a deployment wants DeepSeek's native server-side web search and its users either sign in to a DeepSeek account or hold a `DEEPSEEK_API_KEY` — the provider reuses those credentials as [Authentication](#authentication) describes. One search is heavier than a dedicated retrieval endpoint: DeepSeek runs the search inside a full model turn, so expect one Messages call's latency and generated tokens per search, with up to `maxUses` server-side searches per request. DeepSeek makes no per-search charge for it, so its cost is that model turn's tokens. Avoid it when latency dominates.
33
33
 
34
34
  ### Minimal configuration
35
35
 
@@ -66,7 +66,7 @@ Referenced keys use the [shared DeepSeek credential helpers](../../llm/llm-deeps
66
66
 
67
67
  ### What a search returns
68
68
 
69
- `content` is always omitted: DeepSeek's provider prose is not trusted as an answer. `sources[]` comes from `web_search_result` items inside `web_search_tool_result` blocks — `url` and `title` directly, and `publishedAt` from `page_age` — with snippets joined from URL-keyed `cited_text` entries where an excerpt exists. Results are deduplicated by URL, and because DeepSeek exposes no result-count knob, the service enforces `maxResults` by truncating and flagging.
69
+ `content` is always omitted: DeepSeek's provider prose is not trusted as an answer. `sources[]` comes from `web_search_result` items inside `web_search_tool_result` blocks — `url` and `title` directly, and `publishedAt` from `page_age` — and `snippet` from the item's own `snippet`, or for an item without one from the URL-keyed `cited_text` entry where an excerpt exists. Results are deduplicated by URL, and because DeepSeek exposes no result-count knob, the service enforces `maxResults` by truncating and flagging.
70
70
 
71
71
  ### Request logging
72
72
 
@@ -74,7 +74,7 @@ A search running under an initiating agent appends the log-only `web/deepseek-se
74
74
 
75
75
  ### Failures and recovery
76
76
 
77
- Failures throw `WebError` with a machine-routable code: a missing credential is `WEB_PROVIDER_CREDENTIAL_MISSING`, caller cancellation is `WEB_ABORTED`, and provider or transport failures — including a response with no `web_search_tool_result` block — are `WEB_PROVIDER_ERROR`. HTTP redirects are rejected before the `Location` target is contacted. Every failure after dispatch names the resolved search endpoint and explains that search endpoint configuration is separate from chat. If the endpoint is unintended, the message tells the conversation model to guide the user to Plugins > Built-in plugin settings > Web search and fetch, select DeepSeek (legacy) under Search, and save its Base URL. When that page is unavailable, it names `web-search-deepseek.baseURL` as the deployment configuration alternative. The model must not choose or change the endpoint. The model-facing `web_search` tool surfaces this text under its own error wrapper.
77
+ Failures throw `WebError` with a machine-routable code: a missing credential is `WEB_PROVIDER_CREDENTIAL_MISSING`, caller cancellation is `WEB_ABORTED`, and provider or transport failures — including a response with no `web_search_tool_result` block — are `WEB_PROVIDER_ERROR`. HTTP redirects are rejected before the `Location` target is contacted. Every failure after dispatch names the resolved search endpoint and explains that search endpoint configuration is separate from chat. If the endpoint is unintended, the message tells the conversation model to guide the user to Plugins > Built-in plugin settings > Web search and fetch, select DeepSeek server-side search under Search, and save its Base URL. When that page is unavailable, it names `web-search-deepseek.baseURL` as the deployment configuration alternative. The model must not choose or change the endpoint. The model-facing `web_search` tool surfaces this text under its own error wrapper.
78
78
 
79
79
  -----
80
80
 
@@ -103,7 +103,7 @@ The provider is built on two commitments:
103
103
 
104
104
  ### Request flow
105
105
 
106
- Each search captures the current Config values into provider options — endpoint, model, key reference, limits — then asks `ctx.deepseekAccount` for a token when the initiating Session uses the account route, otherwise resolves the credential reference through `ctx.credentials` (or the environment), appends the log-only session event, and dispatches the Messages request with the native `web_search` server tool. The response's `web_search_tool_result` blocks become `sources[]`; `cited_text` entries from text blocks are joined to their URLs as snippets; results are deduplicated by URL; and the service enforces the requested source bound on the way back.
106
+ Each search captures the current Config values into provider options — endpoint, model, key reference, limits — then asks `ctx.deepseekAccount` for a token when the initiating Session uses the account route, otherwise resolves the credential reference through `ctx.credentials` (or the environment), appends the log-only session event, and dispatches the Messages request with the native `web_search` server tool. The response's `web_search_tool_result` blocks become `sources[]`, each with its item's own snippet; `cited_text` entries from text blocks are joined by URL as the snippets of items without one; results are deduplicated by URL; and the service enforces the requested source bound on the way back.
107
107
 
108
108
  Readiness captures the same options but reads no API key value: on the account route it first asks `ctx.deepseekAccount` for a token, then checks the literal key or asks `ctx.credentials.describe()` (or the environment) whether the key reference is configured.
109
109
 
@@ -147,7 +147,7 @@ Independent of the conversation request cache. The auxiliary instruction and nat
147
147
 
148
148
  #### What the model sees
149
149
 
150
- Through `dsh-tool-web`, the conversation model sees deduplicated URLs, titles, dates, and citation snippets from structured search blocks; provider prose is not trusted as an answer. This provider's exact failures include the actionable missing-credential message, which also names DeepSeek Account sign-in, `DeepSeek search credential resolution failed: <error>`, and `DeepSeek search aborted`. An HTTP 401 to an account-authenticated search appends an instruction to guide the user to sign in to DeepSeek again. Other request, HTTP, native-search, and response-body failures append the resolved endpoint and the conditional configuration instruction described above. The consumer owns the error wrapper.
150
+ Through `dsh-tool-web`, the conversation model sees deduplicated URLs, titles, dates, and snippets from structured search blocks; provider prose is not trusted as an answer. This provider's exact failures include the actionable missing-credential message, which also names DeepSeek Account sign-in, `DeepSeek search credential resolution failed: <error>`, and `DeepSeek search aborted`. An HTTP 401 to an account-authenticated search appends an instruction to guide the user to sign in to DeepSeek again. Other request, HTTP, native-search, and response-body failures append the resolved endpoint and the conditional configuration instruction described above. The consumer owns the error wrapper.
151
151
 
152
152
  #### Token effect
153
153
 
@@ -183,7 +183,7 @@ These limits define when the provider is expensive or incomplete. They are curre
183
183
  - **Readiness checks presence, not validity** — a wrong key, or an endpoint without the native `web_search_20250305` server tool, counts as ready, so `web_search` stays offered and each call fails with a structured error.
184
184
  - **Search does not follow the chat endpoint** — when the official route chats through a gateway, search still sends its key to the configured search endpoint, the official one by default, and fails unless that endpoint accepts the key.
185
185
  - **Over-returned sources still cost tokens** — with no result-count knob on the wire, `maxResults` is enforced only post-hoc by service truncation.
186
- - **Sources usually carry no `snippet`** — a source gains one only when a text-block citation (`cited_text`) matches its URL, and DeepSeek's Anthropic-compatible endpoint returns text blocks without `citations`.
186
+ - **A source's `snippet` depends on the endpoint** — it is the excerpt the endpoint returns with the result item, or else a text-block citation (`cited_text`) matching its URL; an Anthropic-compatible endpoint that returns neither yields sources without snippets.
187
187
 
188
188
  <a id="dev-note"></a>
189
189
  ### Dev Note
@@ -195,6 +195,6 @@ This Dev Note is working context for maintainers: open questions and undecided d
195
195
 
196
196
  #### Dedicated retrieval endpoint
197
197
 
198
- DeepSeek's Search and Fetch APIs, which avoid the full model turn, live in [dsh-web-deepseek-api](../web-deepseek-api/README.md) and are selected with the Search and Fetch menus on the Web search and fetch settings page. Shipped profiles select the Search API, so this provider runs only when `searchProvider: deepseek-official` is selected (for example, on gateways without Search API routes).
198
+ DeepSeek's Search and Fetch APIs, which avoid the full model turn, live in [dsh-web-deepseek-api](../web-deepseek-api/README.md) and are selected with the Search and Fetch menus on the Web search and fetch settings page. Shipped profiles fix no search provider, so this provider runs for model requests on the DeepSeek model routes and the Search API runs on other routes; `searchProvider: deepseek-official` selects this provider for every route (for example, on gateways without Search API routes).
199
199
 
200
200
  </details>
package/README.zh.md CHANGED
@@ -25,11 +25,11 @@ kind: "package-reference"
25
25
  <a id="use-this-package"></a>
26
26
  ## 使用本包
27
27
 
28
- 在已加载 web 服务的组合中挂载本提供方;它以 `deepseek-official` 搜索提供方身份注册,因此当它是唯一可用的搜索后端时,`ctx.web.search()` 会自动解析到它——也可以用 `searchProvider: deepseek-official` 固定。
28
+ 在已加载 web 服务的组合中挂载本提供方;它以 `deepseek-official` 搜索提供方身份注册,因此当它是唯一可用的搜索后端时,`ctx.web.search()` 会自动解析到它;没有配置搜索提供方时,为 `deepseek-official` 或 `deepseek-account` 模型路由上的模型请求发起的搜索也解析到它([提供方选择](../web/README.zh.md#provider-selection))——也可以用 `searchProvider: deepseek-official` 固定。
29
29
 
30
30
  ### 何时选择
31
31
 
32
- 当部署希望使用 DeepSeek 原生服务端 web 搜索、且其用户登录 DeepSeek 账号或持有 `DEEPSEEK_API_KEY` 时选择此后端——提供方按[鉴权](#authentication)所述复用这些凭据。一次搜索比专用检索端点更重:DeepSeek 在完整模型轮次内执行搜索,因此每次搜索都要预期一次 Messages 调用的延迟与生成 token,每次请求最多 `maxUses` 次服务端搜索。当单次搜索的成本或延迟占主导时避免使用它。
32
+ 当部署希望使用 DeepSeek 原生服务端 web 搜索、且其用户登录 DeepSeek 账号或持有 `DEEPSEEK_API_KEY` 时选择此后端——提供方按[鉴权](#authentication)所述复用这些凭据。一次搜索比专用检索端点更重:DeepSeek 在完整模型轮次内执行搜索,因此每次搜索都要预期一次 Messages 调用的延迟与生成 token,每次请求最多 `maxUses` 次服务端搜索。DeepSeek 不对它按次收费,因此其成本是该模型轮次的 token。当延迟占主导时避免使用它。
33
33
 
34
34
  ### 最小配置
35
35
 
@@ -66,7 +66,7 @@ kind: "package-reference"
66
66
 
67
67
  ### 搜索返回什么
68
68
 
69
- `content` 始终省略:DeepSeek 的提供方文本不作为答案受到信任。`sources[]` 来自 `web_search_tool_result` 块内的 `web_search_result` 条目——`url` 和 `title` 直接取自同名字段,`publishedAt` 取自 `page_age`——snippet 在存在摘录时按 URL 关联的 `cited_text` 条目拼接。结果按 URL 去重,且由于 DeepSeek 不公开结果数量旋钮,服务通过截断并标记来强制执行 `maxResults`。
69
+ `content` 始终省略:DeepSeek 的提供方文本不作为答案受到信任。`sources[]` 来自 `web_search_tool_result` 块内的 `web_search_result` 条目——`url` 和 `title` 直接取自同名字段,`publishedAt` 取自 `page_age`,`snippet` 取自条目自带的 `snippet`,条目没有时取自按 URL 关联且存在摘录的 `cited_text` 条目。结果按 URL 去重,且由于 DeepSeek 不公开结果数量旋钮,服务通过截断并标记来强制执行 `maxResults`。
70
70
 
71
71
  ### 请求日志
72
72
 
@@ -74,7 +74,7 @@ kind: "package-reference"
74
74
 
75
75
  ### 失败与恢复
76
76
 
77
- 失败抛出携带可按机器路由 code 的 `WebError`:凭据缺失为 `WEB_PROVIDER_CREDENTIAL_MISSING`,调用方取消为 `WEB_ABORTED`,提供方或传输失败,包括响应中没有 `web_search_tool_result` 块,为 `WEB_PROVIDER_ERROR`。HTTP 重定向会在接触 `Location` 指向的目标之前被拒绝。请求发出后的每项失败都会指出已解析的搜索端点,并说明搜索端点配置独立于聊天端点。如果该端点不符合用户预期,错误消息会要求会话模型指导用户进入 Plugins > Built-in plugin settings > Web search and fetch,在 Search 中选择 DeepSeek(旧版),修改其 Base URL 并保存。该页面不可用时,消息会把 `web-search-deepseek.baseURL` 作为部署配置方式。模型不得替用户选择或修改端点。面向模型的 `web_search` 工具会在自己的错误包装层内呈现这段文本。
77
+ 失败抛出携带可按机器路由 code 的 `WebError`:凭据缺失为 `WEB_PROVIDER_CREDENTIAL_MISSING`,调用方取消为 `WEB_ABORTED`,提供方或传输失败,包括响应中没有 `web_search_tool_result` 块,为 `WEB_PROVIDER_ERROR`。HTTP 重定向会在接触 `Location` 指向的目标之前被拒绝。请求发出后的每项失败都会指出已解析的搜索端点,并说明搜索端点配置独立于聊天端点。如果该端点不符合用户预期,错误消息会要求会话模型指导用户进入 Plugins > Built-in plugin settings > Web search and fetch,在 Search 中选择 DeepSeek 服务端搜索,修改其 Base URL 并保存。该页面不可用时,消息会把 `web-search-deepseek.baseURL` 作为部署配置方式。模型不得替用户选择或修改端点。面向模型的 `web_search` 工具会在自己的错误包装层内呈现这段文本。
78
78
 
79
79
  -----
80
80
 
@@ -103,7 +103,7 @@ kind: "package-reference"
103
103
 
104
104
  ### 请求流程
105
105
 
106
- 每次搜索先把当前 Config 段投影为提供方选项——端点、模型、密钥引用、上限——然后在发起会话使用账号路由时向 `ctx.deepseekAccount` 请求 token,否则通过 `ctx.credentials`(或环境)解析凭据引用,追加仅用于日志的会话事件,并以原生 `web_search` 服务器工具分发 Messages 请求。响应中的 `web_search_tool_result` 块变为 `sources[]`;文本块中的 `cited_text` 条目按其 URL 拼接为 snippet;结果按 URL 去重;服务在返回路径上强制执行请求的来源上限。
106
+ 每次搜索先把当前 Config 段投影为提供方选项——端点、模型、密钥引用、上限——然后在发起会话使用账号路由时向 `ctx.deepseekAccount` 请求 token,否则通过 `ctx.credentials`(或环境)解析凭据引用,追加仅用于日志的会话事件,并以原生 `web_search` 服务器工具分发 Messages 请求。响应中的 `web_search_tool_result` 块变为 `sources[]`,各带其条目自带的 snippet;文本块中的 `cited_text` 条目按 URL 关联,作为没有 snippet 的条目的 snippet;结果按 URL 去重;服务在返回路径上强制执行请求的来源上限。
107
107
 
108
108
  就绪判断捕获相同的选项,但不读取 API 密钥的值:账号路由先向 `ctx.deepseekAccount` 请求 token,再检查字面密钥,或询问 `ctx.credentials.describe()`(或环境)密钥引用是否已配置。
109
109
 
@@ -147,7 +147,7 @@ kind: "package-reference"
147
147
 
148
148
  #### 模型看到的内容
149
149
 
150
- 通过 `dsh-tool-web`,会话模型会看到结构化搜索块中去重后的 URL、标题、日期与引用 snippet;提供方文本不会作为答案受到信任。该提供方的具体失败消息包括带有处理指引的凭据缺失消息(其中也提到 DeepSeek 账号登录)、`DeepSeek search credential resolution failed: <error>` 和 `DeepSeek search aborted`。账号鉴权的搜索收到 HTTP 401 时,会追加引导用户重新登录 DeepSeek 的指引。其他请求、HTTP、原生搜索和响应正文失败会追加已解析端点及前述条件式配置指引。错误包装属于消费方。
150
+ 通过 `dsh-tool-web`,会话模型会看到结构化搜索块中去重后的 URL、标题、日期与 snippet;提供方文本不会作为答案受到信任。该提供方的具体失败消息包括带有处理指引的凭据缺失消息(其中也提到 DeepSeek 账号登录)、`DeepSeek search credential resolution failed: <error>` 和 `DeepSeek search aborted`。账号鉴权的搜索收到 HTTP 401 时,会追加引导用户重新登录 DeepSeek 的指引。其他请求、HTTP、原生搜索和响应正文失败会追加已解析端点及前述条件式配置指引。错误包装属于消费方。
151
151
 
152
152
  #### Token 影响
153
153
 
@@ -183,7 +183,7 @@ kind: "package-reference"
183
183
  - **就绪判断只检查凭据是否存在,不检查是否有效**——错误的密钥,或不提供原生 `web_search_20250305` 服务器工具的端点,都视为就绪,因此 `web_search` 继续提供,每次调用都以结构化错误失败。
184
184
  - **搜索不跟随聊天地址**——官方路由经网关聊天时,搜索仍把密钥发往配置的搜索端点(默认是官方端点),除非该端点接受这个密钥,否则调用失败。
185
185
  - **超量返回的来源仍消耗 token**——协议没有结果数量旋钮,`maxResults` 只能由服务在事后截断。
186
- - **来源通常没有 `snippet`**——只有当文本块引用(`cited_text`)匹配其 URL 时,来源才会获得 snippet,而 DeepSeek 的 Anthropic 兼容端点返回的文本块不带 `citations`。
186
+ - **来源的 `snippet` 取决于端点**——它是端点随结果条目返回的摘录,否则是匹配其 URL 的文本块引用(`cited_text`);两者都不返回的 Anthropic 兼容端点产生没有 snippet 的来源。
187
187
 
188
188
  <a id="dev-note"></a>
189
189
  ### 开发备注
@@ -195,6 +195,6 @@ kind: "package-reference"
195
195
 
196
196
  #### 专用检索端点
197
197
 
198
- 无需完整模型轮次的 DeepSeek Search 与 Fetch API 位于 [dsh-web-deepseek-api](../web-deepseek-api/README.zh.md),由「网页搜索与获取」设置页的搜索和获取下拉框分别选择。内置配置选择 Search API,因此仅在选用 `searchProvider: deepseek-official` 时(例如网关未提供 Search API 路由)本提供方才会运行。
198
+ 无需完整模型轮次的 DeepSeek Search 与 Fetch API 位于 [dsh-web-deepseek-api](../web-deepseek-api/README.zh.md),由「网页搜索与获取」设置页的搜索和获取下拉框分别选择。内置配置不固定搜索提供方,因此本提供方为 DeepSeek 模型路由上的模型请求运行,其他路由运行 Search API;`searchProvider: deepseek-official` 会在所有路由上选用本提供方(例如网关未提供 Search API 路由时)。
199
199
 
200
200
  </details>
package/lib/index.js CHANGED
@@ -31,9 +31,9 @@ const DEEPSEEK_DEFAULT_MAX_USES = 5;
31
31
  const USER_AGENT = "deepseek-harness/0.0.1";
32
32
  /**
33
33
  * Build a `url → cited_text` map from every `text` block's `citations[]`. This
34
- * is the snippet source: Anthropic `web_search_result` items carry
35
- * `url`/`title`/`page_age` but typically NO inline snippet — the excerpt lives
36
- * in a separate `text` block's citation, keyed by `url` (first occurrence wins).
34
+ * is the snippet source for a `web_search_result` item that carries no `snippet`
35
+ * of its own: the excerpt then lives in a separate `text` block's citation, keyed
36
+ * by `url` (first occurrence wins).
37
37
  *
38
38
  * @param blocks - the response's content blocks; non-`text` blocks are skipped.
39
39
  * @returns the `url → cited_text` map (empty when no citations are present).
@@ -48,13 +48,13 @@ function citationSnippets(blocks) {
48
48
  }
49
49
  /**
50
50
  * Map a DeepSeek Anthropic Messages response to a normalized search result. Walks
51
- * `web_search_tool_result` blocks for citeable `web_search_result` items, joins each to its
52
- * citation excerpt as `snippet`, and dedupes by `url` (a `max_uses > 1` request can surface
53
- * the same URL across searches). The web service owns the final `maxResults` truncation, so
54
- * `truncated` is always `false` here.
51
+ * `web_search_tool_result` blocks for citeable `web_search_result` items, takes each item's own
52
+ * `snippet` or else its citation excerpt as `snippet`, and dedupes by `url` (a `max_uses > 1`
53
+ * request can surface the same URL across searches). The web service owns the final `maxResults`
54
+ * truncation, so `truncated` is always `false` here.
55
55
  *
56
56
  * @param response - the parsed Messages response body.
57
- * @returns the normalized result with deduped, snippet-joined sources.
57
+ * @returns the normalized result with deduped sources and their snippets.
58
58
  * @throws {@link WebError} when native search produced no result block.
59
59
  */
60
60
  function mapAnthropicResponse(response) {
@@ -67,7 +67,7 @@ function mapAnthropicResponse(response) {
67
67
  for (const block of resultBlocks) for (const item of block.content ?? []) {
68
68
  if (item.type !== "web_search_result" || item.url.length === 0 || seen.has(item.url)) continue;
69
69
  seen.add(item.url);
70
- const snippet = snippets.get(item.url);
70
+ const snippet = item.snippet != null && item.snippet.length > 0 ? item.snippet : snippets.get(item.url);
71
71
  sources.push({
72
72
  url: item.url,
73
73
  ...item.title != null && item.title.length > 0 ? { title: item.title } : {},
@@ -89,14 +89,14 @@ var DeepSeekSearchProvider = class {
89
89
  id = DEEPSEEK_PROVIDER_ID;
90
90
  /** Picker description: what this provider suits and what it costs or cannot do. */
91
91
  description = {
92
- en: "Slower, and every search uses extra model tokens. Requires a DeepSeek account or API key.",
93
- zh: "速度较慢,每次搜索都会额外消耗模型 token。需要 DeepSeek 账号或 API Key。",
94
- ja: "低速で、検索のたびに追加のモデルトークンを消費します。DeepSeek アカウントまたは API キーが必要です。",
95
- es: "Más lenta, y cada búsqueda consume tokens adicionales del modelo. Requiere una cuenta de DeepSeek o una clave de API.",
96
- fr: "Plus lente, et chaque recherche consomme des jetons de modèle supplémentaires. Nécessite un compte DeepSeek ou une clé API.",
97
- de: "Langsamer, und jede Suche verbraucht zusätzliche Modell-Tokens. Erfordert ein DeepSeek-Konto oder einen API-Schlüssel.",
98
- ru: "Работает медленнее, и каждый поиск расходует дополнительные токены модели. Требуется учётная запись DeepSeek или ключ API.",
99
- pt: "Mais lenta, e cada pesquisa consome tokens extras do modelo. Requer uma conta DeepSeek ou uma chave de API."
92
+ en: "No per-search charge, but every search uses extra model tokens. Requires a DeepSeek account or API key.",
93
+ zh: "搜索不按次收费,每次搜索都会额外消耗模型 token。需要 DeepSeek 账号或 API Key。",
94
+ ja: "検索ごとの料金はかかりませんが、検索のたびに追加のモデルトークンを消費します。DeepSeek アカウントまたは API キーが必要です。",
95
+ es: "Sin cargo por búsqueda, pero cada búsqueda consume tokens adicionales del modelo. Requiere una cuenta de DeepSeek o una clave de API.",
96
+ fr: "Sans frais par recherche, mais chaque recherche consomme des jetons de modèle supplémentaires. Nécessite un compte DeepSeek ou une clé API.",
97
+ de: "Keine Kosten pro Suche, aber jede Suche verbraucht zusätzliche Modell-Tokens. Erfordert ein DeepSeek-Konto oder einen API-Schlüssel.",
98
+ ru: "Плата за каждый поиск не взимается, но каждый поиск расходует дополнительные токены модели. Требуется учётная запись DeepSeek или ключ API.",
99
+ pt: "Sem cobrança por pesquisa, mas cada pesquisa consome tokens extras do modelo. Requer uma conta DeepSeek ou uma chave de API."
100
100
  };
101
101
  /**
102
102
  * @param resolveOptions - the options for the NEXT operation, snapshotted
@@ -248,7 +248,7 @@ function accountRejectedError(message) {
248
248
  }
249
249
  /** Add endpoint recovery instructions to failures that occur after request dispatch begins. */
250
250
  function searchEndpointError(endpoint, message, cause) {
251
- return new WebError(`${message}\n\nThe web request used endpoint ${JSON.stringify(endpoint)}. Search endpoint configuration is separate from chat. If that endpoint is not intended, guide the user to Plugins > Built-in plugin settings > Web search and fetch, select DeepSeek (legacy) under Search, and change and save its Base URL. If that settings page is unavailable, the user can set web-search-deepseek.baseURL to a trusted DeepSeek endpoint. Only the user should choose or change the endpoint.`, "WEB_PROVIDER_ERROR", cause === void 0 ? void 0 : { cause });
251
+ return new WebError(`${message}\n\nThe web request used endpoint ${JSON.stringify(endpoint)}. Search endpoint configuration is separate from chat. If that endpoint is not intended, guide the user to Plugins > Built-in plugin settings > Web search and fetch, select DeepSeek server-side search under Search, and change and save its Base URL. If that settings page is unavailable, the user can set web-search-deepseek.baseURL to a trusted DeepSeek endpoint. Only the user should choose or change the endpoint.`, "WEB_PROVIDER_ERROR", cause === void 0 ? void 0 : { cause });
252
252
  }
253
253
  /**
254
254
  * Race a same-process asynchronous preflight against caller cancellation. The
@@ -106,9 +106,9 @@ export interface DeepSeekSearchProviderOptions {
106
106
  }
107
107
  /**
108
108
  * Build a `url → cited_text` map from every `text` block's `citations[]`. This
109
- * is the snippet source: Anthropic `web_search_result` items carry
110
- * `url`/`title`/`page_age` but typically NO inline snippet — the excerpt lives
111
- * in a separate `text` block's citation, keyed by `url` (first occurrence wins).
109
+ * is the snippet source for a `web_search_result` item that carries no `snippet`
110
+ * of its own: the excerpt then lives in a separate `text` block's citation, keyed
111
+ * by `url` (first occurrence wins).
112
112
  *
113
113
  * @param blocks - the response's content blocks; non-`text` blocks are skipped.
114
114
  * @returns the `url → cited_text` map (empty when no citations are present).
@@ -116,13 +116,13 @@ export interface DeepSeekSearchProviderOptions {
116
116
  export declare function citationSnippets(blocks: readonly ContentBlock[]): Map<string, string>;
117
117
  /**
118
118
  * Map a DeepSeek Anthropic Messages response to a normalized search result. Walks
119
- * `web_search_tool_result` blocks for citeable `web_search_result` items, joins each to its
120
- * citation excerpt as `snippet`, and dedupes by `url` (a `max_uses > 1` request can surface
121
- * the same URL across searches). The web service owns the final `maxResults` truncation, so
122
- * `truncated` is always `false` here.
119
+ * `web_search_tool_result` blocks for citeable `web_search_result` items, takes each item's own
120
+ * `snippet` or else its citation excerpt as `snippet`, and dedupes by `url` (a `max_uses > 1`
121
+ * request can surface the same URL across searches). The web service owns the final `maxResults`
122
+ * truncation, so `truncated` is always `false` here.
123
123
  *
124
124
  * @param response - the parsed Messages response body.
125
- * @returns the normalized result with deduped, snippet-joined sources.
125
+ * @returns the normalized result with deduped sources and their snippets.
126
126
  * @throws {@link WebError} when native search produced no result block.
127
127
  */
128
128
  export declare function mapAnthropicResponse(response: AnthropicResponse): WebSearchResult;
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAiB/C,+CAA+C;AAC/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CAAA;AAEvD;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,uCAAuC,CAAA;AAEhF,+FAA+F;AAC/F,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAA;AAEzD,gDAAgD;AAChD,MAAM,CAAC,MAAM,4BAA4B,GAAG,YAAY,CAAA;AAExD,wEAAwE;AACxE,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAA;AAE/C,iEAAiE;AACjE,MAAM,CAAC,MAAM,yBAAyB,GAA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,CAAA;AAC3D,CAAC;AAED,0FAA0F;AAC1F,SAAS,aAAa,CAAC,MAAoB,EAAE,QAAkB;IAC7D,OAAO,IAAI,QAAQ,CAAC,yBAAyB,EAAE,aAAa,EAAE;QAC5D,KAAK,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;KAC3D,CAAC,CAAA;AACJ,CAAC;AAED,uEAAuE;AACvE,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,CAAA;AACrE,CAAC;AAED,6EAA6E;AAC7E,SAAS,iBAAiB,CAAC,KAAa;IACtC,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAA;AAC7C,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Provider-private wire types for DeepSeek's Anthropic-compatible Messages API. Citeable
3
- * result items and citation excerpts arrive in separate blocks; the provider joins them by
4
- * URL. These types do not create a dependency on `ctx.llm`.
2
+ * Provider-private wire types for DeepSeek's Anthropic-compatible Messages API. A citeable
3
+ * result item may carry its own excerpt; citation excerpts arrive in separate blocks, and the
4
+ * provider joins them to items by URL. These types do not create a dependency on `ctx.llm`.
5
5
  * @module @deepseek-ai/dsh-web-search-deepseek/types
6
6
  */
7
7
  /** A `web_search_result` item inside a `web_search_tool_result` block. */
@@ -11,6 +11,8 @@ export interface WebSearchResultItem {
11
11
  title?: string | null;
12
12
  /** Provider-supplied page age/recency string (mapped to `publishedAt`). */
13
13
  page_age?: string | null;
14
+ /** Excerpt of the page, when the endpoint returns one with the item. */
15
+ snippet?: string | null;
14
16
  }
15
17
  /** A `web_search_tool_result` content block: the citeable result shape. */
16
18
  export interface WebSearchToolResultBlock {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"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IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAED,2EAA2E;AAC3E,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,wBAAwB,CAAA;IAC9B,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAA;CAChC;AAED,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B;AAED,wEAAwE;AACxE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAA;CAC/B;AAED,gFAAgF;AAChF,MAAM,MAAM,YAAY,GAAG,wBAAwB,GAAG,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAElF,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;CACzB;AAED,qEAAqE;AACrE,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAA;IACrC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-web-search-deepseek",
3
3
  "description": "DeepSeek-backed search provider (native web_search via the Anthropic-compatible API) for the DeepSeek Harness web capability seam (ctx.web)",
4
- "version": "0.2.2-rc.4",
4
+ "version": "0.2.2-rc.5",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -32,29 +32,29 @@
32
32
  ],
33
33
  "license": "MIT",
34
34
  "peerDependencies": {
35
- "@deepseek-ai/dsh-agent": "0.2.2-rc.4",
36
- "@deepseek-ai/dsh-credentials": "0.2.2-rc.4",
37
- "@deepseek-ai/dsh-deepseek-account": "0.2.2-rc.4",
38
- "@deepseek-ai/dsh-launch-environment": "0.2.2-rc.4",
39
- "@deepseek-ai/dsh-llm-deepseek": "0.2.2-rc.4",
40
- "@deepseek-ai/dsh-session": "0.2.2-rc.4",
41
- "@deepseek-ai/dsh-web": "0.2.2-rc.4",
35
+ "@deepseek-ai/dsh-agent": "0.2.2-rc.5",
36
+ "@deepseek-ai/dsh-credentials": "0.2.2-rc.5",
37
+ "@deepseek-ai/dsh-deepseek-account": "0.2.2-rc.5",
38
+ "@deepseek-ai/dsh-launch-environment": "0.2.2-rc.5",
39
+ "@deepseek-ai/dsh-llm-deepseek": "0.2.2-rc.5",
40
+ "@deepseek-ai/dsh-session": "0.2.2-rc.5",
41
+ "@deepseek-ai/dsh-web": "0.2.2-rc.5",
42
42
  "@deepseek-ai/cordis": "~4.1.0"
43
43
  },
44
44
  "dependencies": {
45
45
  "@deepseek-ai/schemastery": "~3.19.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@deepseek-ai/dsh-agent": "0.2.2-rc.4",
49
- "@deepseek-ai/dsh-credentials": "0.2.2-rc.4",
50
- "@deepseek-ai/dsh-credentials-local": "0.2.2-rc.4",
51
- "@deepseek-ai/dsh-deepseek-account": "0.2.2-rc.4",
52
- "@deepseek-ai/dsh-launch-environment": "0.2.2-rc.4",
53
- "@deepseek-ai/dsh-llm-deepseek": "0.2.2-rc.4",
54
- "@deepseek-ai/dsh-session": "0.2.2-rc.4",
55
- "@deepseek-ai/dsh-web": "0.2.2-rc.4",
48
+ "@deepseek-ai/dsh-agent": "0.2.2-rc.5",
49
+ "@deepseek-ai/dsh-credentials": "0.2.2-rc.5",
50
+ "@deepseek-ai/dsh-credentials-local": "0.2.2-rc.5",
51
+ "@deepseek-ai/dsh-deepseek-account": "0.2.2-rc.5",
52
+ "@deepseek-ai/dsh-launch-environment": "0.2.2-rc.5",
53
+ "@deepseek-ai/dsh-llm-deepseek": "0.2.2-rc.5",
54
+ "@deepseek-ai/dsh-session": "0.2.2-rc.5",
55
+ "@deepseek-ai/dsh-web": "0.2.2-rc.5",
56
56
  "@deepseek-ai/cordis": "~4.1.0",
57
- "@deepseek-ai/dsh-http-proxy": "0.2.2-rc.4"
57
+ "@deepseek-ai/dsh-http-proxy": "0.2.2-rc.5"
58
58
  },
59
59
  "peerDependenciesMeta": {
60
60
  "@deepseek-ai/dsh-deepseek-account": {
package/src/provider.ts CHANGED
@@ -125,9 +125,9 @@ export interface DeepSeekSearchProviderOptions {
125
125
 
126
126
  /**
127
127
  * Build a `url → cited_text` map from every `text` block's `citations[]`. This
128
- * is the snippet source: Anthropic `web_search_result` items carry
129
- * `url`/`title`/`page_age` but typically NO inline snippet — the excerpt lives
130
- * in a separate `text` block's citation, keyed by `url` (first occurrence wins).
128
+ * is the snippet source for a `web_search_result` item that carries no `snippet`
129
+ * of its own: the excerpt then lives in a separate `text` block's citation, keyed
130
+ * by `url` (first occurrence wins).
131
131
  *
132
132
  * @param blocks - the response's content blocks; non-`text` blocks are skipped.
133
133
  * @returns the `url → cited_text` map (empty when no citations are present).
@@ -147,13 +147,13 @@ export function citationSnippets(blocks: readonly ContentBlock[]): Map<string, s
147
147
 
148
148
  /**
149
149
  * Map a DeepSeek Anthropic Messages response to a normalized search result. Walks
150
- * `web_search_tool_result` blocks for citeable `web_search_result` items, joins each to its
151
- * citation excerpt as `snippet`, and dedupes by `url` (a `max_uses > 1` request can surface
152
- * the same URL across searches). The web service owns the final `maxResults` truncation, so
153
- * `truncated` is always `false` here.
150
+ * `web_search_tool_result` blocks for citeable `web_search_result` items, takes each item's own
151
+ * `snippet` or else its citation excerpt as `snippet`, and dedupes by `url` (a `max_uses > 1`
152
+ * request can surface the same URL across searches). The web service owns the final `maxResults`
153
+ * truncation, so `truncated` is always `false` here.
154
154
  *
155
155
  * @param response - the parsed Messages response body.
156
- * @returns the normalized result with deduped, snippet-joined sources.
156
+ * @returns the normalized result with deduped sources and their snippets.
157
157
  * @throws {@link WebError} when native search produced no result block.
158
158
  */
159
159
  export function mapAnthropicResponse(response: AnthropicResponse): WebSearchResult {
@@ -175,7 +175,7 @@ export function mapAnthropicResponse(response: AnthropicResponse): WebSearchResu
175
175
  for (const item of block.content ?? []) {
176
176
  if (item.type !== 'web_search_result' || item.url.length === 0 || seen.has(item.url)) continue
177
177
  seen.add(item.url)
178
- const snippet = snippets.get(item.url)
178
+ const snippet = item.snippet != null && item.snippet.length > 0 ? item.snippet : snippets.get(item.url)
179
179
  sources.push({
180
180
  url: item.url,
181
181
  ...item.title != null && item.title.length > 0 ? { title: item.title } : {},
@@ -205,14 +205,14 @@ export class DeepSeekSearchProvider implements WebSearchProvider {
205
205
  readonly id = DEEPSEEK_PROVIDER_ID
206
206
  /** Picker description: what this provider suits and what it costs or cannot do. */
207
207
  readonly description: NonNullable<WebSearchProvider['description']> = {
208
- en: 'Slower, and every search uses extra model tokens. Requires a DeepSeek account or API key.',
209
- zh: '速度较慢,每次搜索都会额外消耗模型 token。需要 DeepSeek 账号或 API Key。',
210
- ja: '低速で、検索のたびに追加のモデルトークンを消費します。DeepSeek アカウントまたは API キーが必要です。',
211
- es: 'Más lenta, y cada búsqueda consume tokens adicionales del modelo. Requiere una cuenta de DeepSeek o una clave de API.',
212
- fr: 'Plus lente, et chaque recherche consomme des jetons de modèle supplémentaires. Nécessite un compte DeepSeek ou une clé API.',
213
- de: 'Langsamer, und jede Suche verbraucht zusätzliche Modell-Tokens. Erfordert ein DeepSeek-Konto oder einen API-Schlüssel.',
214
- ru: 'Работает медленнее, и каждый поиск расходует дополнительные токены модели. Требуется учётная запись DeepSeek или ключ API.',
215
- pt: 'Mais lenta, e cada pesquisa consome tokens extras do modelo. Requer uma conta DeepSeek ou uma chave de API.',
208
+ en: 'No per-search charge, but every search uses extra model tokens. Requires a DeepSeek account or API key.',
209
+ zh: '搜索不按次收费,每次搜索都会额外消耗模型 token。需要 DeepSeek 账号或 API Key。',
210
+ ja: '検索ごとの料金はかかりませんが、検索のたびに追加のモデルトークンを消費します。DeepSeek アカウントまたは API キーが必要です。',
211
+ es: 'Sin cargo por búsqueda, pero cada búsqueda consume tokens adicionales del modelo. Requiere una cuenta de DeepSeek o una clave de API.',
212
+ fr: 'Sans frais par recherche, mais chaque recherche consomme des jetons de modèle supplémentaires. Nécessite un compte DeepSeek ou une clé API.',
213
+ de: 'Keine Kosten pro Suche, aber jede Suche verbraucht zusätzliche Modell-Tokens. Erfordert ein DeepSeek-Konto oder einen API-Schlüssel.',
214
+ ru: 'Плата за каждый поиск не взимается, но каждый поиск расходует дополнительные токены модели. Требуется учётная запись DeepSeek или ключ API.',
215
+ pt: 'Sem cobrança por pesquisa, mas cada pesquisa consome tokens extras do modelo. Requer uma conta DeepSeek ou uma chave de API.',
216
216
  }
217
217
 
218
218
  /**
@@ -407,7 +407,7 @@ function searchEndpointError(endpoint: string, message: string, cause?: unknown)
407
407
  return new WebError(
408
408
  `${message}\n\nThe web request used endpoint ${JSON.stringify(endpoint)}. `
409
409
  + 'Search endpoint configuration is separate from chat. If that endpoint is not intended, '
410
- + 'guide the user to Plugins > Built-in plugin settings > Web search and fetch, select DeepSeek (legacy) under Search, '
410
+ + 'guide the user to Plugins > Built-in plugin settings > Web search and fetch, select DeepSeek server-side search under Search, '
411
411
  + 'and change and save its Base URL. If that settings page is unavailable, the user can set '
412
412
  + 'web-search-deepseek.baseURL to a trusted DeepSeek endpoint. Only the user should choose or change the endpoint.',
413
413
  'WEB_PROVIDER_ERROR',
package/src/types.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Provider-private wire types for DeepSeek's Anthropic-compatible Messages API. Citeable
3
- * result items and citation excerpts arrive in separate blocks; the provider joins them by
4
- * URL. These types do not create a dependency on `ctx.llm`.
2
+ * Provider-private wire types for DeepSeek's Anthropic-compatible Messages API. A citeable
3
+ * result item may carry its own excerpt; citation excerpts arrive in separate blocks, and the
4
+ * provider joins them to items by URL. These types do not create a dependency on `ctx.llm`.
5
5
  * @module @deepseek-ai/dsh-web-search-deepseek/types
6
6
  */
7
7
 
@@ -12,6 +12,8 @@ export interface WebSearchResultItem {
12
12
  title?: string | null
13
13
  /** Provider-supplied page age/recency string (mapped to `publishedAt`). */
14
14
  page_age?: string | null
15
+ /** Excerpt of the page, when the endpoint returns one with the item. */
16
+ snippet?: string | null
15
17
  }
16
18
 
17
19
  /** A `web_search_tool_result` content block: the citeable result shape. */