dsh-search-enhance 0.2.0 → 0.2.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.
Files changed (84) hide show
  1. package/README.md +17 -28
  2. package/README.zh.md +17 -30
  3. package/client/client.js +37 -47
  4. package/client/types/client/locales.d.ts +7 -6
  5. package/client/types/web-config/contracts.d.ts +5 -4
  6. package/cordis.patch.yml +4 -0
  7. package/lib/config.d.ts +2 -10
  8. package/lib/config.js +7 -62
  9. package/lib/contracts/sources.d.ts +0 -5
  10. package/lib/diagnostics/status.js +0 -2
  11. package/lib/diagnostics/types.d.ts +1 -3
  12. package/lib/documentation/service.d.ts +1 -1
  13. package/lib/documentation/service.js +16 -8
  14. package/lib/index.js +18 -104
  15. package/lib/orchestration/orchestrator.js +4 -9
  16. package/lib/orchestration/types.d.ts +2 -6
  17. package/lib/orchestration/types.js +2 -0
  18. package/lib/presentation/render.d.ts +3 -0
  19. package/lib/presentation/render.js +61 -35
  20. package/lib/presentation/web-card.js +16 -6
  21. package/lib/prompt/tool-discovery.d.ts +1 -1
  22. package/lib/prompt/tool-discovery.js +10 -12
  23. package/lib/providers/context7.js +11 -1
  24. package/lib/providers/search-api-request.d.ts +1 -1
  25. package/lib/providers/search-api-request.js +2 -2
  26. package/lib/providers/search-api.d.ts +1 -4
  27. package/lib/providers/search-api.js +1 -4
  28. package/lib/research/bridge.d.ts +29 -0
  29. package/lib/research/bridge.js +106 -0
  30. package/lib/research/child.d.ts +13 -0
  31. package/lib/research/child.js +133 -0
  32. package/lib/research/executor.d.ts +28 -0
  33. package/lib/research/executor.js +94 -0
  34. package/lib/research/model.d.ts +19 -0
  35. package/lib/research/model.js +43 -0
  36. package/lib/research/persona.d.ts +2 -0
  37. package/lib/research/persona.js +14 -0
  38. package/lib/research/profile.d.ts +8 -0
  39. package/lib/research/profile.js +48 -0
  40. package/lib/research/protocol.d.ts +29 -0
  41. package/lib/research/protocol.js +3 -0
  42. package/lib/research/report.d.ts +89 -0
  43. package/lib/research/report.js +51 -0
  44. package/lib/research/sdk.d.ts +45 -0
  45. package/lib/research/sdk.js +66 -0
  46. package/lib/research/session-mirror.d.ts +10 -0
  47. package/lib/research/session-mirror.js +135 -0
  48. package/lib/research/session-observer.d.ts +7 -0
  49. package/lib/research/session-observer.js +57 -0
  50. package/lib/search/index.d.ts +1 -1
  51. package/lib/search/index.js +1 -1
  52. package/lib/search/policy.d.ts +12 -0
  53. package/lib/search/policy.js +35 -0
  54. package/lib/source-storage/domain.js +4 -4
  55. package/lib/source-storage/retention.js +0 -2
  56. package/lib/source-storage/service.d.ts +1 -0
  57. package/lib/source-storage/service.js +3 -0
  58. package/lib/source-storage/store.d.ts +2 -0
  59. package/lib/source-storage/store.js +17 -0
  60. package/lib/tool-discovery/capabilities.d.ts +4 -5
  61. package/lib/tool-discovery/capabilities.js +11 -25
  62. package/lib/tool-discovery/fold.d.ts +14 -6
  63. package/lib/tool-discovery/fold.js +49 -34
  64. package/lib/tool-discovery/manager.d.ts +11 -2
  65. package/lib/tool-discovery/manager.js +81 -16
  66. package/lib/tools/docs-search.js +5 -4
  67. package/lib/tools/index.d.ts +1 -1
  68. package/lib/tools/index.js +1 -1
  69. package/lib/tools/schemas.d.ts +6 -14
  70. package/lib/tools/schemas.js +8 -14
  71. package/lib/tools/services.d.ts +15 -0
  72. package/lib/tools/services.js +96 -0
  73. package/lib/tools/web-research.d.ts +9 -0
  74. package/lib/tools/web-research.js +28 -0
  75. package/lib/tools/web-search.d.ts +1 -1
  76. package/lib/tools/web-search.js +8 -9
  77. package/lib/web-config/contracts.d.ts +5 -4
  78. package/lib/web-config/contracts.js +1 -2
  79. package/lib/web-config/host.js +4 -5
  80. package/package.json +54 -17
  81. package/lib/search/profiles.d.ts +0 -45
  82. package/lib/search/profiles.js +0 -213
  83. package/lib/tools/search-tools.d.ts +0 -62
  84. package/lib/tools/search-tools.js +0 -65
package/README.md CHANGED
@@ -2,22 +2,22 @@
2
2
 
3
3
  English | [简体中文](README.zh.md)
4
4
 
5
- `dsh-search-enhance` is a search extension for DeepSeek Harness. It uses a Grok-compatible Search API for primary web answers and can optionally use Context7, Exa, Tavily, and Firecrawl for documentation lookup, supplementary discovery, page extraction, and site mapping.
5
+ `dsh-search-enhance` is a search extension for DeepSeek Harness. It uses a Grok-compatible Search API for primary web answers and can optionally use Context7, Exa, Tavily, Firecrawl, and Parallel for documentation lookup, supplementary discovery, page extraction, and site mapping.
6
6
 
7
7
  The plugin presents search results, sources, and page content separately. Searches return an answer or documentation snippets with source links; you can ask for more sources when needed. To check important details, ask it to read the original page. Search snippets remain distinct from fetched page content.
8
8
 
9
- > Bring your own endpoints and credentials. The plugin ships no API keys. A Grok-compatible endpoint is required for `web_search`; Context7, Exa, Tavily, and Firecrawl are optional.
10
-
11
- ![A DSH Web session that searches, checks documentation, extracts an official page, and returns a sourced answer](https://raw.githubusercontent.com/umineko987/dsh-search-enhance/main/assets/search-workflow.png)
9
+ > Bring your own service addresses and keys; none are included. Ordinary web search needs a Grok-compatible service. Other services are optional.
12
10
 
13
11
  ## Key characteristics
14
12
 
15
- - `web_search` uses the Grok-compatible endpoint for the main answer and runs all user-selected supplemental Providers (Exa, Tavily, Firecrawl) in parallel, with an independent per-Provider source limit.
13
+ - `web_search` uses the Grok-compatible endpoint for the main answer and runs all user-selected supplemental Providers (Exa, Tavily, Firecrawl, Parallel) in parallel, with an independent per-Provider source limit.
16
14
  - Sources are normalized, de-duplicated, and reordered using source category, requested version, and publication-time signals before they are shown.
17
- - `source_ref` keeps the complete source record in private durable storage, allowing the Agent to paginate beyond the links included in the initial result.
18
- - `docs_search` uses Context7 only with an explicit `library_name` or `library_id`; requests without a library identity use Exa discovery.
19
- - `web_extract` requires one explicit `provider` from the user-enabled set: `tavily_extract`, `firecrawl_scrape`, `smart_direct`, or `direct`. It reports the route, evidence level, and available page metadata; failures never switch Providers.
20
- - Ask for more sources or related pages on a specific website when needed; no manual tool loading is required.
15
+ - `web_research` uses a separate research Agent for comparisons and source checks, keeping the current model. It returns conclusions, links, excerpts, and limitations, not the full investigation history.
16
+ - In DSH Web, open research records from the original conversation's subagent entry. With history saving enabled, completed, cancelled, and failed research remains readable after restart. Records are read-only, without word-by-word updates, a running indicator, or continuation.
17
+ - `source_ref` stores complete source records separately, allowing pagination beyond the links shown initially.
18
+ - Documentation search defaults to Context7 for a named software product or documentation library, and Exa otherwise.
19
+ - `web_extract` reads through one enabled service: Tavily, Firecrawl, Parallel, smart direct reading, or direct reading. It reports the reading route, evidence level, and page details; failure does not switch services.
20
+ - Source pagination becomes available automatically after a successful search retains readable sources. Website mapping is available to the research Agent, not the main Agent; no manual tool loader is needed.
21
21
  - Supplemental search defaults to no Providers selected. Unselected Providers are never requested; missing credentials and failures of selected Providers remain visible as warnings.
22
22
 
23
23
  For implementation details, see [Search workflow architecture](https://github.com/umineko987/dsh-search-enhance/blob/main/guides/search-workflow.md).
@@ -34,6 +34,8 @@ Install the [published npm bundle](https://www.npmjs.com/package/dsh-search-enha
34
34
  dsh plugin --profile web add dsh-search-enhance@latest
35
35
  ```
36
36
 
37
+ Research requires a configured, working official DeepSeek service or DeepSeek account. Other connections fail explicitly without switching services. DSH must be runnable locally for research to start.
38
+
37
39
  ### 2. Start DSH Web
38
40
 
39
41
  ```bash
@@ -54,16 +56,8 @@ In the settings card:
54
56
  2. Choose the matching `completions` or `responses` protocol and model under **Grok search backend**.
55
57
  3. Use the **Supplemental search providers** and **Available extraction providers** dropdowns to select multiple services. Each service's endpoint, timeout, and credential reference are grouped in its credential card.
56
58
 
57
- The default credential reference is `SEARCH_API_KEY`. Credential values are stored through DSH Credentials and are not exposed as model parameters.
58
-
59
- Official Grok endpoints automatically enable native search without another protocol or toggle:
60
- - Version paths may be omitted: `https://api.x.ai` / `https://us.api.x.ai` gain `/v1`; `https://openrouter.ai` gains `/api/v1` (or `/api` gains `/v1`). This applies to search and model-list requests, without duplicating complete paths or changing custom gateways.
61
- - **xAI**: `https://api.x.ai/v1` (also `https://us.api.x.ai/v1`), with a model such as `grok-4.6`. Requests use Responses with `web_search` + `x_search`, even when `completions` is selected; saved settings are not rewritten.
62
- - **OpenRouter**: `https://openrouter.ai/api/v1`, with a model such as `x-ai/grok-4.6`. The selected protocol is retained and `openrouter:web_search` with `engine: native` is sent; no `:online` suffix is needed. Model support and workspace policy still govern OpenRouter's actual engine; to prohibit its fallback, allow only `native` in the workspace.
63
- - Native search detection is restricted to official HTTPS hosts and Grok models; custom gateways use the configured protocol. Native adapters map `minimal` to `low` and `max` to `xhigh`; `off` omits the reasoning parameter.
64
- - Structured citations enter the source list. If the API reports no completed search, structured citations, or search usage, the result explicitly warns that native search is unconfirmed; prose links alone are not execution evidence.
65
59
 
66
- Save the settings, then ask a current-information question. DSH automatically reloads this plugin in-process when configuration is saved, so changes take effect without restarting DSH; in-flight plugin requests may be interrupted. A successful run shows a `Search` tool row, an answer, and source links.
60
+ Saved settings take effect immediately without restarting DSH, but may interrupt ongoing searches. A successful run shows a `Search` tool row, an answer, and source links.
67
61
 
68
62
  ## Example requests
69
63
 
@@ -72,6 +66,7 @@ Use normal language; the plugin gives the Agent routing guidance.
72
66
  - “Find the most important React 19 user-visible changes. Prefer official release notes and include source links.”
73
67
  - “Look up the current FastAPI JWT authentication API and show a minimal example from the official documentation.”
74
68
  - “Read and summarize `https://example.com/article`, separating what the page states from your inference.”
69
+ - “Research these three competing solutions, corroborate the important claims, and return source excerpts and unresolved limitations.”
75
70
 
76
71
  Ask explicitly when you need more sources or pages from a specific website. Check the plugin settings for service configuration status.
77
72
 
@@ -86,20 +81,14 @@ Configure only the routes you need.
86
81
  | Exa | Broad documentation and supplementary discovery | `EXA_API_KEY` | No |
87
82
  | Tavily | Supplementary search, page extraction, and site mapping | `TAVILY_API_KEY` | No |
88
83
  | Firecrawl | Supplementary search and page extraction | `FIRECRAWL_API_KEY` | No |
84
+ | Parallel | Supplementary search and Markdown page extraction | `PARALLEL_API_KEY` | No |
89
85
 
90
- In the plugin settings, select any combination of **supplemental search Providers**. Each selected Provider runs alongside the main search, using `supplementalSearch.maxSourcesPerProvider` (default `5`, maximum `100`). This selection applies to all search profiles.
91
-
92
- Separately, select the **extraction Providers** available to the Agent. Each `web_extract` call must choose exactly one enabled Provider, for example `{ "url": "https://example.com/", "provider": "direct", "format": "markdown" }`. Disabled, unconfigured, unsupported, or failed Providers do not trigger automatic fallback. Extraction Providers are enabled by default; disable any you do not want the Agent to use.
93
-
94
- For `docs_search`, Context7 requires an explicit `library_name` or `library_id`. Without one, `provider: "auto"` uses Exa instead of guessing a package name from the full question.
95
-
96
- ## On-demand features
86
+ Select any combination of **supplemental search services** in the plugin settings. Selected services run alongside the main search. Each collects up to `5` sources by default, adjustable to `100`; unselected services are not requested.
97
87
 
98
- To see more sources from a search, ask: “Show me the other sources from this search.”
88
+ Select **available extraction services** to limit which ones the assistant may use. Each page read uses one service. Disabled services, missing keys, unsupported formats, and reading failures are reported without switching services automatically. Parallel supports Markdown only and starts disabled; other reading services start enabled and can be deselected.
99
89
 
100
- To find relevant pages on a website, ask: “Find pages about authentication on this website.” This feature requires Tavily to be configured.
90
+ Context7 needs a software name or documentation-library identifier. Without one, the default is Exa rather than guessing a software name from the whole question.
101
91
 
102
- The assistant uses these features when needed. You do not have to call tools manually or switch modes. To verify an important claim, you can then ask it to read the original pages.
103
92
 
104
93
  ## Update and uninstall
105
94
 
package/README.zh.md CHANGED
@@ -2,22 +2,22 @@
2
2
 
3
3
  [English](README.md) | 简体中文
4
4
 
5
- `dsh-search-enhance` 是 DeepSeek Harness 的搜索增强插件。它使用 Grok-compatible Search API 生成普通网页搜索的主要回答,并可选用 Context7、Exa、Tavily 和 Firecrawl 完成文档检索、补充来源、网页正文提取和站点页面发现。
5
+ `dsh-search-enhance` 是 DeepSeek Harness 的搜索增强插件。它使用 Grok-compatible Search API 生成普通网页搜索的主要回答,并可选用 Context7、Exa、Tavily、Firecrawl 和 Parallel 完成文档检索、补充来源、网页正文提取和站点页面发现。
6
6
 
7
7
  插件将搜索结果、参考来源和网页正文分开呈现。搜索时先给出回答或文档片段及来源链接,需要更多来源时可以继续追问;核对重要内容时,再要求读取原网页。搜索摘要与实际读取的正文会明确区分。
8
8
 
9
- > 你需要自行提供所选服务的端点和凭据,插件不内置任何 API Key。`web_search` 需要 Grok-compatible 端点;Context7、Exa、Tavily 和 Firecrawl 均为可选 Provider。
10
-
11
- ![DSH Web 会话:搜索、检索文档、提取官方页面并生成带来源的回答](https://raw.githubusercontent.com/umineko987/dsh-search-enhance/main/assets/search-workflow.png)
9
+ > 需自行提供服务地址和密钥,插件不附带密钥。普通网页搜索需要 Grok-compatible 服务,其他服务按需配置。
12
10
 
13
11
  ## 主要特点
14
12
 
15
- - `web_search` 使用 Grok-compatible 端点生成主要回答,并行调用用户勾选的全部补充搜索 Provider(Exa、Tavily、Firecrawl),每家使用独立的来源数量上限。
13
+ - `web_search` 使用 Grok-compatible 端点生成主要回答,并行调用用户勾选的全部补充搜索 Provider(Exa、Tavily、Firecrawl、Parallel),每家使用独立的来源数量上限。
16
14
  - 来源在展示前会经过 URL 标准化、去重,并根据来源类别、目标版本和发布时间信号重新排序。
17
- - `source_ref` 将完整来源记录保存在插件私有持久存储中,Agent 可以继续分页读取首次结果未展示的来源。
18
- - `docs_search` 只在提供明确 `library_name` 或 `library_id` 时使用 Context7;没有库身份的请求使用 Exa 发现。
19
- - `web_extract` 每次必须通过 `provider` 指定一家用户已启用的服务:`tavily_extract`、`firecrawl_scrape`、`smart_direct` 或 `direct`。结果报告提取路径、证据等级和页面元数据,失败不自动换服务。
20
- - 需要时可继续查看更多来源,或查找某个网站下的相关页面,无需手动加载工具。
15
+ - `web_research` 由独立研究 Agent 完成多步比较和来源核对,沿用当前模型;返回结论、链接、摘录和局限,不带回完整调查历史。
16
+ - DSH Web 可从原对话的子智能体入口查看研究记录。启用历史保存后,完成、取消或失败的研究在重启后仍可查看;记录只读,不支持逐字更新、状态灯或继续执行。
17
+ - `source_ref` 单独保存完整来源记录,可继续分页查看首次回答未展示的来源。
18
+ - 文档检索默认在明确指定软件名称或文档库时使用 Context7,否则使用 Exa。
19
+ - `web_extract` 每次读取一家已启用服务(Tavily、Firecrawl、Parallel、智能直连或直连),说明读取路径、证据等级和页面信息;失败不自动换服务。
20
+ - 成功搜索保留了可读来源后,下一步自动启用来源分页;站点映射仅提供给研究 Agent,主 Agent 不直接持有该工具,无需手动加载器。
21
21
  - 补充搜索默认不选择任何 Provider。未选中的服务不会被请求;选中服务缺少凭据或执行失败会在结果中显示警告。
22
22
 
23
23
  实现细节见[搜索链路架构](https://github.com/umineko987/dsh-search-enhance/blob/main/guides/search-workflow.zh.md)。
@@ -34,6 +34,8 @@
34
34
  dsh plugin --profile web add dsh-search-enhance@latest
35
35
  ```
36
36
 
37
+ 研究仅支持已配置且能正常使用的 DeepSeek 官方服务或 DeepSeek 账号,其他接入方式会明确失败,不自动切换。运行研究需要本机能启动 DSH。
38
+
37
39
  ### 2. 启动 DSH Web
38
40
 
39
41
  ```bash
@@ -54,16 +56,7 @@ dsh web
54
56
  2. 在 **Grok 搜索后端** 中选择匹配的 `completions` 或 `responses` 协议及模型;
55
57
  3. 用 **补充搜索服务** 和 **可用网页提取服务** 的下拉框多选需要的服务。其他服务的接口地址、超时和凭据引用也位于各自的凭据卡片中。
56
58
 
57
- 默认凭据引用名是 `SEARCH_API_KEY`。密钥值通过 DSH Credentials 保存,不会暴露为模型参数。
58
-
59
- 官方 Grok 端点会自动启用原生搜索,无需新增协议或开关:
60
- - 版本路径可省略:`https://api.x.ai` / `https://us.api.x.ai` 自动补 `/v1`;`https://openrouter.ai` 自动补 `/api/v1`,填到 `/api` 时补 `/v1`。搜索与模型列表请求都会补全,不重复追加完整路径,也不改写自定义中转地址。
61
- - **xAI**:`https://api.x.ai/v1`(也支持 `https://us.api.x.ai/v1`),模型如 `grok-4.6`。自动使用 Responses 并发送 `web_search` + `x_search`,即使设置选择了 `completions`;不改写已保存的设置。
62
- - **OpenRouter**:`https://openrouter.ai/api/v1`,模型如 `x-ai/grok-4.6`。保留所选协议,发送 `openrouter:web_search`、`engine: native`,无需 `:online` 后缀。OpenRouter 的模型能力和工作区策略仍可能影响实际搜索引擎;严格禁止其回退时,在工作区仅允许 `native`。
63
- - 只对上述官方 HTTPS 域名及 Grok 模型启用原生搜索;自定义网关使用所选协议。官方适配中 `minimal` 映射为 `low`、`max` 映射为 `xhigh`,`off` 表示省略思考参数。
64
- - 结构化引用会进入来源列表。若 API 未报告完成的搜索、结构化引用或搜索用量,结果会明确提示原生搜索未确认;正文链接本身不作为执行证明。
65
-
66
- 保存设置后即可询问一个需要当前信息的问题。保存配置时 DSH 会在进程内自动热重载本插件,配置立即生效,无需重启 DSH;正在执行的插件请求可能被中断。成功时会看到 `Search` 工具行、回答和来源链接。
59
+ 保存后设置立即生效,无需重启 DSH,但可能中断正在进行的查询。成功时会看到 `Search` 工具行、回答和来源链接。
67
60
 
68
61
  ## 使用示例
69
62
 
@@ -72,6 +65,7 @@ dsh web
72
65
  - “查找 React 19 最重要的用户可见变化,优先引用官方发布说明并附上来源链接。”
73
66
  - “查找 FastAPI 当前 JWT 认证 API,并根据官方文档给出最小示例。”
74
67
  - “读取并总结 `https://example.com/article`,区分页面原文与推断。”
68
+ - “深度比较这三种方案,交叉核对关键结论,返回来源摘录与尚未解决的局限。”
75
69
 
76
70
  需要更多参考来源或网站内的相关页面时,可以继续追问;服务配置状态可在插件设置中查看。
77
71
 
@@ -86,20 +80,13 @@ dsh web
86
80
  | Exa | 广泛文档发现和补充发现 | `EXA_API_KEY` | 否 |
87
81
  | Tavily | 补充搜索、网页提取和站点映射 | `TAVILY_API_KEY` | 否 |
88
82
  | Firecrawl | 补充搜索和网页提取 | `FIRECRAWL_API_KEY` | 否 |
83
+ | Parallel | 补充搜索和 Markdown 网页提取 | `PARALLEL_API_KEY` | 否 |
89
84
 
90
- 在插件设置中,可以多选 **补充搜索 Provider**。选中项与主搜索并行执行,每家使用 `supplementalSearch.maxSourcesPerProvider` 限制来源数量(默认 `5`,最大 `100`)。选择对所有搜索 profile 生效。
91
-
92
- 另外,多选 **网页提取 Provider** 可以限制 Agent 可用的服务范围。每次 `web_extract` 必须明确选择一家已启用服务,例如 `{ "url": "https://example.com/", "provider": "direct", "format": "markdown" }`。服务被禁用、缺少凭据、不支持格式或执行失败时,直接报告错误,不自动回退。提取服务默认全部启用,可取消勾选不希望使用的服务。
93
-
94
- 对于 `docs_search`,Context7 需要明确的 `library_name` 或 `library_id`。两者都未提供时,`provider: "auto"` 使用 Exa,不会根据完整问题猜测包名。
95
-
96
- ## 按需功能
97
-
98
- 想查看更多搜索来源时,可以直接追问:“把这次搜索的其他来源也列出来。”
85
+ 在插件设置中多选 **补充搜索服务**,所选服务会与主搜索并行执行。每家默认最多收集 `5` 条来源,可调整至 `100` 条;未勾选的服务不会被请求。
99
86
 
100
- 想查找某个网站下的相关页面时,可以提出:“查找这个网站下与认证有关的页面。”该功能需要先配置 Tavily。
87
+ 多选 **可用网页提取服务**,可以限制助手读取网页时使用的服务。一次只用一家,禁用、缺少密钥、不支持格式或读取失败都会明确报错,不自动换服务。Parallel 仅支持 Markdown,默认关闭;其他读取服务默认开启,可取消勾选。
101
88
 
102
- 助手会按需使用这些功能,你不必手动调用工具或切换模式。核对重要结论时,还可以继续要求读取原网页。
89
+ Context7 需要明确的软件名称或文档库标识。未指定时,默认使用 Exa 查找,不从整句问题里猜软件名称。
103
90
 
104
91
  ## 更新与卸载
105
92
 
package/client/client.js CHANGED
@@ -35,9 +35,8 @@ window.__ModuleLoader__.load({
35
35
  "direct"
36
36
  ];
37
37
  const WEB_EDITABLE_PATHS = [
38
- ["defaultProfile"],
39
- ["defaultDepth"],
40
38
  ["toolTimeoutMs"],
39
+ ["retention", "docsSearchMaxResults"],
41
40
  ["toolDiscovery", "mode"],
42
41
  ...WEB_SUPPLEMENTAL_SEARCH_PROVIDERS.map((provider) => ["supplementalSearch", provider]),
43
42
  ["supplementalSearch", "maxSourcesPerProvider"],
@@ -429,9 +428,8 @@ window.__ModuleLoader__.load({
429
428
  };
430
429
  function cloneConfig(config) {
431
430
  return {
432
- defaultProfile: config.defaultProfile,
433
- defaultDepth: config.defaultDepth,
434
431
  toolTimeoutMs: config.toolTimeoutMs,
432
+ retention: { ...config.retention },
435
433
  toolDiscovery: { ...config.toolDiscovery },
436
434
  supplementalSearch: { ...config.supplementalSearch },
437
435
  searchApi: { ...config.searchApi },
@@ -694,7 +692,7 @@ window.__ModuleLoader__.load({
694
692
  ]);
695
693
  const mutations = (0, react.useMemo)(() => snapshot === void 0 || draft === void 0 ? [] : mutationsFor(snapshot.value, draft), [draft, snapshot]);
696
694
  const dirty = mutations.length > 0;
697
- const valid = draft !== void 0 && snapshot !== void 0 && validTimeouts(draft) && validSupplementalSearch(draft, snapshot.options.supplementalSearchMaxSources);
695
+ const valid = draft !== void 0 && snapshot !== void 0 && validTimeouts(draft) && validSupplementalSearch(draft, snapshot.options.supplementalSearchMaxSources) && Number.isInteger(draft.retention.docsSearchMaxResults) && draft.retention.docsSearchMaxResults >= snapshot.options.docsSearchMinResults && draft.retention.docsSearchMaxResults <= snapshot.options.docsSearchMaxResults;
698
696
  const editable = phase === "ready" && snapshot?.writable === true && !saving;
699
697
  const updateProvider = (provider, value) => {
700
698
  setDraft((current) => current === void 0 ? current : provider === "searchApi" ? {
@@ -966,51 +964,40 @@ window.__ModuleLoader__.load({
966
964
  style: gridStyle,
967
965
  children: [
968
966
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
969
- label: t("defaultProfile"),
970
- overridden: isOverridden(snapshot.user, ["defaultProfile"]),
971
- t,
972
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Select, {
973
- value: draft.defaultProfile,
974
- options: snapshot.options.profiles,
975
- disabled: !editable,
976
- onChange: (defaultProfile) => {
977
- setDraft((current) => current === void 0 ? current : {
978
- ...current,
979
- defaultProfile
980
- });
981
- setFeedback("idle");
982
- }
983
- })
984
- }),
985
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
986
- label: t("defaultDepth"),
987
- overridden: isOverridden(snapshot.user, ["defaultDepth"]),
967
+ label: t("toolDiscoveryMode"),
968
+ overridden: isOverridden(snapshot.user, ["toolDiscovery", "mode"]),
988
969
  t,
989
970
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Select, {
990
- value: draft.defaultDepth,
991
- options: snapshot.options.depths,
971
+ value: draft.toolDiscovery.mode,
972
+ options: snapshot.options.toolDiscoveryModes,
992
973
  disabled: !editable,
993
- onChange: (defaultDepth) => {
974
+ onChange: (mode) => {
994
975
  setDraft((current) => current === void 0 ? current : {
995
976
  ...current,
996
- defaultDepth
977
+ toolDiscovery: { mode }
997
978
  });
998
979
  setFeedback("idle");
999
980
  }
1000
981
  })
1001
982
  }),
1002
983
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
1003
- label: t("toolDiscoveryMode"),
1004
- overridden: isOverridden(snapshot.user, ["toolDiscovery", "mode"]),
984
+ label: t("docsSearchMaxResults"),
985
+ overridden: isOverridden(snapshot.user, ["retention", "docsSearchMaxResults"]),
1005
986
  t,
1006
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Select, {
1007
- value: draft.toolDiscovery.mode,
1008
- options: snapshot.options.toolDiscoveryModes,
987
+ hint: t("docsSearchMaxResultsHint"),
988
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberInput, {
989
+ label: t("docsSearchMaxResults"),
990
+ value: draft.retention.docsSearchMaxResults,
991
+ min: snapshot.options.docsSearchMinResults,
992
+ max: snapshot.options.docsSearchMaxResults,
1009
993
  disabled: !editable,
1010
- onChange: (mode) => {
994
+ onChange: (docsSearchMaxResults) => {
1011
995
  setDraft((current) => current === void 0 ? current : {
1012
996
  ...current,
1013
- toolDiscovery: { mode }
997
+ retention: {
998
+ ...current.retention,
999
+ docsSearchMaxResults
1000
+ }
1014
1001
  });
1015
1002
  setFeedback("idle");
1016
1003
  }
@@ -1020,6 +1007,7 @@ window.__ModuleLoader__.load({
1020
1007
  label: t("toolTimeoutMs"),
1021
1008
  overridden: isOverridden(snapshot.user, ["toolTimeoutMs"]),
1022
1009
  t,
1010
+ hint: t("toolTimeoutHint"),
1023
1011
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberInput, {
1024
1012
  label: t("toolTimeoutMs"),
1025
1013
  value: draft.toolTimeoutMs,
@@ -1437,12 +1425,13 @@ window.__ModuleLoader__.load({
1437
1425
  timeoutMs: "Timeout (ms)",
1438
1426
  credentialRef: "Credential reference name",
1439
1427
  thirdPartyHint: "Example: https://gateway.example/grok/v1",
1440
- strategyHeading: "Default search strategy",
1441
- strategyIntro: "Defaults used when a tool call does not choose its own profile or depth.",
1442
- defaultProfile: "Default profile",
1443
- defaultDepth: "Default depth",
1444
- toolDiscoveryMode: "Tool discovery",
1428
+ strategyHeading: "Tool settings",
1429
+ strategyIntro: "Configure source pagination, documentation result limits, and tool timeouts.",
1430
+ docsSearchMaxResults: "docs_search request ceiling",
1431
+ docsSearchMaxResultsHint: "Allows max_results values from 1 up to this ceiling (default call: 6). Does not override an explicit smaller value. Collect more by increasing max_results and rerunning; pagination reads only retained records.",
1432
+ toolDiscoveryMode: "Source pagination (all preloads; mapping stays research-only)",
1445
1433
  toolTimeoutMs: "Whole tool timeout (ms)",
1434
+ toolTimeoutHint: "Budget for a single search or similar tool call, not the total research duration.",
1446
1435
  extraSourcesHeading: "Supplemental search providers",
1447
1436
  extraSourcesIntro: "Select any of Exa, Tavily, Firecrawl, and Parallel. Every selected provider searches in parallel.",
1448
1437
  selectProviders: "Select providers (multiple allowed)",
@@ -1496,7 +1485,7 @@ window.__ModuleLoader__.load({
1496
1485
  conflict: "The configuration changed elsewhere. Reload before saving again.",
1497
1486
  saveFailed: "The configuration could not be saved.",
1498
1487
  readOnly: "The Settings document is read-only.",
1499
- invalidNumber: "Timeouts must be positive whole numbers, and supplementary source counts must be whole numbers within their allowed range.",
1488
+ invalidNumber: "Timeouts must be positive whole numbers; source and request limits must be whole numbers within their allowed range.",
1500
1489
  overridden: "User override",
1501
1490
  inherited: "Inherited"
1502
1491
  };
@@ -1518,12 +1507,13 @@ window.__ModuleLoader__.load({
1518
1507
  timeoutMs: "超时(毫秒)",
1519
1508
  credentialRef: "凭据引用名",
1520
1509
  thirdPartyHint: "示例:https://gateway.example/grok/v1",
1521
- strategyHeading: "默认搜索策略",
1522
- strategyIntro: "工具调用未显式选择 profile 或 depth 时使用这些默认值。",
1523
- defaultProfile: "默认 Profile",
1524
- defaultDepth: "默认深度",
1525
- toolDiscoveryMode: "工具披露模式",
1510
+ strategyHeading: "工具设置",
1511
+ strategyIntro: "配置来源分页、文档结果数量上限和工具超时。",
1512
+ docsSearchMaxResults: "docs_search 请求数量最高值",
1513
+ docsSearchMaxResultsHint: "允许 max_results 从 1 到此最高值(调用默认 6 条),不会覆盖模型明确传入的较小值。需要更多结果时提高 max_results 后重搜;分页只能读取已保留记录。",
1514
+ toolDiscoveryMode: "来源分页(all 提前启用;站点映射仅研究 Agent 可用)",
1526
1515
  toolTimeoutMs: "工具总超时(毫秒)",
1516
+ toolTimeoutHint: "单次搜索等工具调用的预算,不是研究总时限。",
1527
1517
  extraSourcesHeading: "补充搜索服务",
1528
1518
  extraSourcesIntro: "可多选 Exa、Tavily、Firecrawl、Parallel;每次搜索都会并行请求选中项。",
1529
1519
  selectProviders: "选择服务(可多选)",
@@ -1577,7 +1567,7 @@ window.__ModuleLoader__.load({
1577
1567
  conflict: "配置已在其他位置发生变化。请重新读取后再保存。",
1578
1568
  saveFailed: "无法保存配置。",
1579
1569
  readOnly: "Settings 文档为只读。",
1580
- invalidNumber: "超时必须是正整数;补充来源数量必须是允许范围内的整数。",
1570
+ invalidNumber: "超时必须是正整数;来源与请求数量上限必须是允许范围内的整数。",
1581
1571
  overridden: "用户覆盖",
1582
1572
  inherited: "继承值"
1583
1573
  };
@@ -16,12 +16,13 @@ export declare const en: {
16
16
  readonly timeoutMs: "Timeout (ms)";
17
17
  readonly credentialRef: "Credential reference name";
18
18
  readonly thirdPartyHint: "Example: https://gateway.example/grok/v1";
19
- readonly strategyHeading: "Default search strategy";
20
- readonly strategyIntro: "Defaults used when a tool call does not choose its own profile or depth.";
21
- readonly defaultProfile: "Default profile";
22
- readonly defaultDepth: "Default depth";
23
- readonly toolDiscoveryMode: "Tool discovery";
19
+ readonly strategyHeading: "Tool settings";
20
+ readonly strategyIntro: "Configure source pagination, documentation result limits, and tool timeouts.";
21
+ readonly docsSearchMaxResults: "docs_search request ceiling";
22
+ readonly docsSearchMaxResultsHint: "Allows max_results values from 1 up to this ceiling (default call: 6). Does not override an explicit smaller value. Collect more by increasing max_results and rerunning; pagination reads only retained records.";
23
+ readonly toolDiscoveryMode: "Source pagination (all preloads; mapping stays research-only)";
24
24
  readonly toolTimeoutMs: "Whole tool timeout (ms)";
25
+ readonly toolTimeoutHint: "Budget for a single search or similar tool call, not the total research duration.";
25
26
  readonly extraSourcesHeading: "Supplemental search providers";
26
27
  readonly extraSourcesIntro: "Select any of Exa, Tavily, Firecrawl, and Parallel. Every selected provider searches in parallel.";
27
28
  readonly selectProviders: "Select providers (multiple allowed)";
@@ -75,7 +76,7 @@ export declare const en: {
75
76
  readonly conflict: "The configuration changed elsewhere. Reload before saving again.";
76
77
  readonly saveFailed: "The configuration could not be saved.";
77
78
  readonly readOnly: "The Settings document is read-only.";
78
- readonly invalidNumber: "Timeouts must be positive whole numbers, and supplementary source counts must be whole numbers within their allowed range.";
79
+ readonly invalidNumber: "Timeouts must be positive whole numbers; source and request limits must be whole numbers within their allowed range.";
79
80
  readonly overridden: "User override";
80
81
  readonly inherited: "Inherited";
81
82
  };
@@ -27,9 +27,10 @@ export interface WebProxyConfig {
27
27
  proxyUrl: string;
28
28
  }
29
29
  export interface WebEditableConfig {
30
- defaultProfile: string;
31
- defaultDepth: string;
32
30
  toolTimeoutMs: number;
31
+ retention: {
32
+ docsSearchMaxResults: number;
33
+ };
33
34
  toolDiscovery: {
34
35
  mode: string;
35
36
  };
@@ -68,14 +69,14 @@ export type WebConfigLayer = {
68
69
  } : WebEditableConfig[Key];
69
70
  };
70
71
  export interface WebConfigOptions {
71
- profiles: readonly string[];
72
- depths: readonly string[];
73
72
  protocols: readonly string[];
74
73
  thinkingLevels: readonly string[];
75
74
  toolDiscoveryModes: readonly string[];
76
75
  parallelSearchModes: readonly string[];
77
76
  proxyUrlMaxCharacters: number;
78
77
  supplementalSearchMaxSources: number;
78
+ docsSearchMinResults: number;
79
+ docsSearchMaxResults: number;
79
80
  }
80
81
  export interface WebCredentialState {
81
82
  ref: string;
package/cordis.patch.yml CHANGED
@@ -1,3 +1,7 @@
1
1
  - insert:
2
+ - id: search-enhance-subagents
3
+ name: '@deepseek-ai/dsh-subagent'
4
+ disabled: !!js |-
5
+ ctx[Symbol.for('cordis.entry')].parent.data.some(e => e.name === '@deepseek-ai/dsh-subagent' && e.id !== 'search-enhance-subagents' && !e.disabled)
2
6
  - id: search-enhance
3
7
  name: 'dsh-search-enhance'
package/lib/config.d.ts CHANGED
@@ -1,10 +1,6 @@
1
1
  import { type CredentialRef } from '@deepseek-ai/dsh-credentials';
2
2
  import Schema from '@deepseek-ai/schemastery';
3
3
  import { type SmartDirectBrowserProfile, type SmartDirectOperatingSystem } from './providers/smart-direct-profiles.js';
4
- export declare const SEARCH_PROFILES: readonly ["auto", "coding_docs", "code_examples", "project_research", "academic", "fact_check"];
5
- export type SearchProfile = (typeof SEARCH_PROFILES)[number];
6
- export declare const SEARCH_DEPTHS: readonly ["compact", "normal", "deep"];
7
- export type SearchDepth = (typeof SEARCH_DEPTHS)[number];
8
4
  export declare const TOOL_DISCOVERY_MODES: readonly ["progressive", "all"];
9
5
  export type ToolDiscoveryMode = (typeof TOOL_DISCOVERY_MODES)[number];
10
6
  export interface ToolDiscoveryConfig {
@@ -35,8 +31,8 @@ export interface OutputBudget {
35
31
  readonly maxVisibleSources: number;
36
32
  readonly maxModelTextBytes: number;
37
33
  }
38
- export type ProfileBudgets = Record<SearchDepth, OutputBudget>;
39
- export type SearchBudgets = Record<SearchProfile, ProfileBudgets>;
34
+ export declare const WEB_SEARCH_OUTPUT_BUDGET: Readonly<OutputBudget>;
35
+ export declare const DOCS_SEARCH_MODEL_TEXT_MAX_BYTES = 9000;
40
36
  export declare const SUPPLEMENTAL_SEARCH_PROVIDERS: readonly ["exa", "tavily", "firecrawl", "parallel"];
41
37
  export type SupplementalSearchProvider = (typeof SUPPLEMENTAL_SEARCH_PROVIDERS)[number];
42
38
  export type SupplementalSearchConfig = Record<SupplementalSearchProvider, boolean> & {
@@ -265,15 +261,12 @@ export interface SiteMapConfig {
265
261
  readonly maxLinks: number;
266
262
  }
267
263
  export interface Config {
268
- readonly defaultProfile: SearchProfile;
269
- readonly defaultDepth: SearchDepth;
270
264
  readonly searchApi: SearchApiConfig;
271
265
  readonly providers: ProviderConfig;
272
266
  readonly fallbackMode: FallbackMode;
273
267
  readonly minimumProfile: MinimumCapabilityProfile;
274
268
  readonly toolTimeoutMs: number;
275
269
  readonly retry: RetryConfig;
276
- readonly budgets: SearchBudgets;
277
270
  readonly supplementalSearch: SupplementalSearchConfig;
278
271
  readonly retention: RetentionConfig;
279
272
  readonly cache: CacheConfig;
@@ -287,7 +280,6 @@ export interface Config {
287
280
  readonly siteMap: SiteMapConfig;
288
281
  }
289
282
  export declare const DEFAULT_CREDENTIAL_REFS: CredentialReferences;
290
- export declare const DEFAULT_SEARCH_BUDGETS: SearchBudgets;
291
283
  /** Source-count ceiling for each explicitly selected supplementary Provider. */
292
284
  export declare const SUPPLEMENTAL_SEARCH_MAX_SOURCES = 100;
293
285
  export declare const SEARCH_ENHANCE_SETTINGS_NAMESPACE = "search-enhance";
package/lib/config.js CHANGED
@@ -1,15 +1,6 @@
1
1
  import { credentialRef } from '@deepseek-ai/dsh-credentials';
2
2
  import Schema from '@deepseek-ai/schemastery';
3
3
  import { SMART_DIRECT_BROWSER_PROFILES, SMART_DIRECT_OPERATING_SYSTEMS, } from './providers/smart-direct-profiles.js';
4
- export const SEARCH_PROFILES = [
5
- 'auto',
6
- 'coding_docs',
7
- 'code_examples',
8
- 'project_research',
9
- 'academic',
10
- 'fact_check',
11
- ];
12
- export const SEARCH_DEPTHS = ['compact', 'normal', 'deep'];
13
4
  export const TOOL_DISCOVERY_MODES = ['progressive', 'all'];
14
5
  /** Stable high-level docs_search default; the Settings cap is independently bounded. */
15
6
  export const DOCS_SEARCH_DEFAULT_MAX_RESULTS = 6;
@@ -34,6 +25,12 @@ export const FALLBACK_MODES = ['auto', 'off'];
34
25
  export const MINIMUM_CAPABILITY_PROFILES = ['standard', 'off'];
35
26
  /** Shared deployment bound for explicit local-route HTTP proxy URLs. */
36
27
  export const WEB_EXTRACT_PROXY_URL_MAX_CHARACTERS = 2048;
28
+ export const WEB_SEARCH_OUTPUT_BUDGET = Object.freeze({
29
+ maxAnswerCharacters: 6000,
30
+ maxVisibleSources: 8,
31
+ maxModelTextBytes: 12 * 1024,
32
+ });
33
+ export const DOCS_SEARCH_MODEL_TEXT_MAX_BYTES = 9000;
37
34
  export const SUPPLEMENTAL_SEARCH_PROVIDERS = ['exa', 'tavily', 'firecrawl', 'parallel'];
38
35
  export const PARALLEL_SEARCH_MODES = ['turbo', 'fast', 'basic', 'advanced'];
39
36
  export const DEFAULT_CREDENTIAL_REFS = Object.freeze({
@@ -44,38 +41,6 @@ export const DEFAULT_CREDENTIAL_REFS = Object.freeze({
44
41
  firecrawl: credentialRef('FIRECRAWL_API_KEY'),
45
42
  parallel: credentialRef('PARALLEL_API_KEY'),
46
43
  });
47
- export const DEFAULT_SEARCH_BUDGETS = {
48
- auto: {
49
- compact: { maxAnswerCharacters: 6000, maxVisibleSources: 8, maxModelTextBytes: 12 * 1024 },
50
- normal: { maxAnswerCharacters: 12000, maxVisibleSources: 12, maxModelTextBytes: 20 * 1024 },
51
- deep: { maxAnswerCharacters: 24000, maxVisibleSources: 20, maxModelTextBytes: 32 * 1024 },
52
- },
53
- coding_docs: {
54
- compact: { maxAnswerCharacters: 3500, maxVisibleSources: 6, maxModelTextBytes: 9000 },
55
- normal: { maxAnswerCharacters: 7000, maxVisibleSources: 10, maxModelTextBytes: 14 * 1024 },
56
- deep: { maxAnswerCharacters: 14000, maxVisibleSources: 16, maxModelTextBytes: 24 * 1024 },
57
- },
58
- code_examples: {
59
- compact: { maxAnswerCharacters: 4000, maxVisibleSources: 8, maxModelTextBytes: 10000 },
60
- normal: { maxAnswerCharacters: 8000, maxVisibleSources: 12, maxModelTextBytes: 16 * 1024 },
61
- deep: { maxAnswerCharacters: 16000, maxVisibleSources: 20, maxModelTextBytes: 26 * 1024 },
62
- },
63
- project_research: {
64
- compact: { maxAnswerCharacters: 6000, maxVisibleSources: 10, maxModelTextBytes: 12 * 1024 },
65
- normal: { maxAnswerCharacters: 12000, maxVisibleSources: 16, maxModelTextBytes: 20 * 1024 },
66
- deep: { maxAnswerCharacters: 24000, maxVisibleSources: 24, maxModelTextBytes: 32 * 1024 },
67
- },
68
- academic: {
69
- compact: { maxAnswerCharacters: 12000, maxVisibleSources: 20, maxModelTextBytes: 24 * 1024 },
70
- normal: { maxAnswerCharacters: 18000, maxVisibleSources: 30, maxModelTextBytes: 32 * 1024 },
71
- deep: { maxAnswerCharacters: 32000, maxVisibleSources: 40, maxModelTextBytes: 48 * 1024 },
72
- },
73
- fact_check: {
74
- compact: { maxAnswerCharacters: 7000, maxVisibleSources: 12, maxModelTextBytes: 16 * 1024 },
75
- normal: { maxAnswerCharacters: 12000, maxVisibleSources: 18, maxModelTextBytes: 24 * 1024 },
76
- deep: { maxAnswerCharacters: 22000, maxVisibleSources: 28, maxModelTextBytes: 36 * 1024 },
77
- },
78
- };
79
44
  /** Source-count ceiling for each explicitly selected supplementary Provider. */
80
45
  export const SUPPLEMENTAL_SEARCH_MAX_SOURCES = 100;
81
46
  export const SEARCH_ENHANCE_SETTINGS_NAMESPACE = 'search-enhance';
@@ -117,16 +82,6 @@ const credentialReference = (defaultValue) => Schema.string()
117
82
  .pattern(/^[A-Za-z_][A-Za-z0-9_]*$/)
118
83
  .role('credential-ref')
119
84
  .default(defaultValue);
120
- const outputBudget = (defaults) => Schema.object({
121
- maxAnswerCharacters: nonNegativeInteger(defaults.maxAnswerCharacters, 100_000),
122
- maxVisibleSources: nonNegativeInteger(defaults.maxVisibleSources, 1000),
123
- maxModelTextBytes: positiveInteger(defaults.maxModelTextBytes, 1024 * 1024),
124
- });
125
- const profileBudgets = (profile) => Schema.object({
126
- compact: outputBudget(DEFAULT_SEARCH_BUDGETS[profile].compact),
127
- normal: outputBudget(DEFAULT_SEARCH_BUDGETS[profile].normal),
128
- deep: outputBudget(DEFAULT_SEARCH_BUDGETS[profile].deep),
129
- });
130
85
  const discoveryProvider = (baseUrl, ref) => Schema.object({
131
86
  baseUrl: httpUrl(baseUrl),
132
87
  credentialRef: credentialReference(ref),
@@ -139,8 +94,6 @@ const remoteExtract = () => Schema.object({
139
94
  maxContentCharacters: positiveInteger(50_000, 1_000_000),
140
95
  });
141
96
  export const Config = Schema.object({
142
- defaultProfile: Schema.union(SEARCH_PROFILES).default('auto'),
143
- defaultDepth: Schema.union(SEARCH_DEPTHS).default('compact'),
144
97
  searchApi: Schema.object({
145
98
  baseUrl: httpUrl('https://api.x.ai/v1'),
146
99
  protocol: Schema.union(SEARCH_API_PROTOCOLS).default('completions'),
@@ -172,14 +125,6 @@ export const Config = Schema.object({
172
125
  maxTotalDelayMs: nonNegativeInteger(20_000, 900_000),
173
126
  jitterRatio: Schema.number().min(0).max(1).default(0.2),
174
127
  }),
175
- budgets: Schema.object({
176
- auto: profileBudgets('auto'),
177
- coding_docs: profileBudgets('coding_docs'),
178
- code_examples: profileBudgets('code_examples'),
179
- project_research: profileBudgets('project_research'),
180
- academic: profileBudgets('academic'),
181
- fact_check: profileBudgets('fact_check'),
182
- }),
183
128
  supplementalSearch: Schema.object({
184
129
  exa: Schema.boolean().default(false),
185
130
  tavily: Schema.boolean().default(false),
@@ -216,7 +161,7 @@ export const Config = Schema.object({
216
161
  maxEntries: positiveInteger(500, 100_000),
217
162
  }),
218
163
  toolDiscovery: Schema.object({
219
- mode: Schema.union(TOOL_DISCOVERY_MODES).default('progressive'),
164
+ mode: Schema.union(TOOL_DISCOVERY_MODES).default('progressive').description('progressive 自动启用可读来源的分页;all 提前启用分页,仍不向主 Agent 提供站点映射或工具加载器。'),
220
165
  }),
221
166
  diagnostics: Schema.object({
222
167
  timeoutMs: positiveInteger(30_000, 120_000),
@@ -1,4 +1,3 @@
1
- import type { SearchDepth, SearchProfile } from '../config.js';
2
1
  export declare const SOURCE_PROVIDERS: readonly ["search-api", "context7", "exa", "tavily", "firecrawl", "smart-direct", "direct", "parallel"];
3
2
  export type SourceProvider = (typeof SOURCE_PROVIDERS)[number];
4
3
  export declare const SOURCE_CATEGORIES: readonly ["official", "primary", "documentation", "code", "academic", "news", "community", "aggregate", "unknown"];
@@ -29,8 +28,6 @@ export interface SourceCallIdentity {
29
28
  /** Complete merged source candidate passed from orchestration to the durable layer. */
30
29
  export interface SourceRecordCandidate {
31
30
  readonly query: string;
32
- readonly profile: SearchProfile;
33
- readonly depth: SearchDepth;
34
31
  readonly sources: readonly CanonicalSource[];
35
32
  /** A Provider had already bounded its collection before this layer observed it. */
36
33
  readonly collectionTruncated: boolean;
@@ -41,8 +38,6 @@ export interface StoredSourceRecord {
41
38
  readonly sourceRef: SourceRef;
42
39
  readonly ownerSessionId: string;
43
40
  readonly query: string;
44
- readonly profile: SearchProfile;
45
- readonly depth: SearchDepth;
46
41
  readonly call: SourceCallIdentity;
47
42
  readonly sources: readonly CanonicalSource[];
48
43
  readonly totalBeforeRetention: number;
@@ -101,8 +101,6 @@ export async function inspectDiagnosticStatus(credentials, config, signal) {
101
101
  capabilityStatus('site_map', mapProviders, mapProviders.some(provider => provider.state === 'configured'), false),
102
102
  ]);
103
103
  const configuration = Object.freeze({
104
- defaultProfile: config.defaultProfile,
105
- defaultDepth: config.defaultDepth,
106
104
  searchApiProtocol: config.searchApi.protocol,
107
105
  searchModelConfigured,
108
106
  thinkingLevel: config.searchApi.thinkingLevel,