dsh-search-enhance 0.2.1 → 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.
- package/README.md +14 -24
- package/README.zh.md +14 -26
- package/client/client.js +10 -102
- package/client/types/client/locales.d.ts +4 -7
- package/client/types/web-config/contracts.d.ts +0 -8
- package/cordis.patch.yml +4 -0
- package/lib/config.d.ts +2 -10
- package/lib/config.js +7 -62
- package/lib/contracts/sources.d.ts +0 -5
- package/lib/diagnostics/status.js +0 -2
- package/lib/diagnostics/types.d.ts +1 -3
- package/lib/documentation/service.js +0 -2
- package/lib/index.js +18 -104
- package/lib/orchestration/orchestrator.js +1 -8
- package/lib/orchestration/types.d.ts +1 -5
- package/lib/presentation/render.js +1 -1
- package/lib/prompt/tool-discovery.d.ts +1 -1
- package/lib/prompt/tool-discovery.js +5 -3
- package/lib/providers/search-api-request.d.ts +1 -1
- package/lib/providers/search-api-request.js +2 -2
- package/lib/providers/search-api.d.ts +1 -4
- package/lib/providers/search-api.js +1 -4
- package/lib/research/bridge.d.ts +29 -0
- package/lib/research/bridge.js +106 -0
- package/lib/research/child.d.ts +13 -0
- package/lib/research/child.js +133 -0
- package/lib/research/executor.d.ts +28 -0
- package/lib/research/executor.js +94 -0
- package/lib/research/model.d.ts +19 -0
- package/lib/research/model.js +43 -0
- package/lib/research/persona.d.ts +2 -0
- package/lib/research/persona.js +14 -0
- package/lib/research/profile.d.ts +8 -0
- package/lib/research/profile.js +48 -0
- package/lib/research/protocol.d.ts +29 -0
- package/lib/research/protocol.js +3 -0
- package/lib/research/report.d.ts +89 -0
- package/lib/research/report.js +51 -0
- package/lib/research/sdk.d.ts +45 -0
- package/lib/research/sdk.js +66 -0
- package/lib/research/session-mirror.d.ts +10 -0
- package/lib/research/session-mirror.js +135 -0
- package/lib/research/session-observer.d.ts +7 -0
- package/lib/research/session-observer.js +57 -0
- package/lib/search/index.d.ts +1 -1
- package/lib/search/index.js +1 -1
- package/lib/search/policy.d.ts +12 -0
- package/lib/search/policy.js +35 -0
- package/lib/source-storage/domain.js +4 -4
- package/lib/source-storage/retention.js +0 -2
- package/lib/source-storage/service.d.ts +1 -0
- package/lib/source-storage/service.js +3 -0
- package/lib/source-storage/store.d.ts +2 -0
- package/lib/source-storage/store.js +17 -0
- package/lib/tool-discovery/capabilities.d.ts +4 -5
- package/lib/tool-discovery/capabilities.js +11 -25
- package/lib/tool-discovery/fold.d.ts +14 -6
- package/lib/tool-discovery/fold.js +49 -34
- package/lib/tool-discovery/manager.d.ts +11 -2
- package/lib/tool-discovery/manager.js +81 -16
- package/lib/tools/docs-search.js +2 -2
- package/lib/tools/index.d.ts +1 -1
- package/lib/tools/index.js +1 -1
- package/lib/tools/schemas.d.ts +0 -10
- package/lib/tools/schemas.js +1 -11
- package/lib/tools/services.d.ts +15 -0
- package/lib/tools/services.js +96 -0
- package/lib/tools/web-research.d.ts +9 -0
- package/lib/tools/web-research.js +28 -0
- package/lib/tools/web-search.d.ts +1 -1
- package/lib/tools/web-search.js +2 -4
- package/lib/web-config/contracts.d.ts +0 -8
- package/lib/web-config/contracts.js +0 -4
- package/lib/web-config/host.js +1 -12
- package/package.json +27 -8
- package/lib/search/profiles.d.ts +0 -45
- package/lib/search/profiles.js +0 -213
- package/lib/tools/search-tools.d.ts +0 -62
- package/lib/tools/search-tools.js +0 -65
package/README.md
CHANGED
|
@@ -6,16 +6,18 @@ English | [简体中文](README.zh.md)
|
|
|
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
|
|
9
|
+
> Bring your own service addresses and keys; none are included. Ordinary web search needs a Grok-compatible service. Other services are optional.
|
|
10
10
|
|
|
11
11
|
## Key characteristics
|
|
12
12
|
|
|
13
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.
|
|
14
14
|
- Sources are normalized, de-duplicated, and reordered using source category, requested version, and publication-time signals before they are shown.
|
|
15
|
-
- `
|
|
16
|
-
-
|
|
17
|
-
- `
|
|
18
|
-
-
|
|
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.
|
|
19
21
|
- Supplemental search defaults to no Providers selected. Unselected Providers are never requested; missing credentials and failures of selected Providers remain visible as warnings.
|
|
20
22
|
|
|
21
23
|
For implementation details, see [Search workflow architecture](https://github.com/umineko987/dsh-search-enhance/blob/main/guides/search-workflow.md).
|
|
@@ -32,6 +34,8 @@ Install the [published npm bundle](https://www.npmjs.com/package/dsh-search-enha
|
|
|
32
34
|
dsh plugin --profile web add dsh-search-enhance@latest
|
|
33
35
|
```
|
|
34
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
|
+
|
|
35
39
|
### 2. Start DSH Web
|
|
36
40
|
|
|
37
41
|
```bash
|
|
@@ -52,16 +56,8 @@ In the settings card:
|
|
|
52
56
|
2. Choose the matching `completions` or `responses` protocol and model under **Grok search backend**.
|
|
53
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.
|
|
54
58
|
|
|
55
|
-
The default credential reference is `SEARCH_API_KEY`. Credential values are stored through DSH Credentials and are not exposed as model parameters.
|
|
56
|
-
|
|
57
|
-
Official Grok endpoints automatically enable native search without another protocol or toggle:
|
|
58
|
-
- 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.
|
|
59
|
-
- **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.
|
|
60
|
-
- **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.
|
|
61
|
-
- 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.
|
|
62
|
-
- 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.
|
|
63
59
|
|
|
64
|
-
|
|
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.
|
|
65
61
|
|
|
66
62
|
## Example requests
|
|
67
63
|
|
|
@@ -70,6 +66,7 @@ Use normal language; the plugin gives the Agent routing guidance.
|
|
|
70
66
|
- “Find the most important React 19 user-visible changes. Prefer official release notes and include source links.”
|
|
71
67
|
- “Look up the current FastAPI JWT authentication API and show a minimal example from the official documentation.”
|
|
72
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.”
|
|
73
70
|
|
|
74
71
|
Ask explicitly when you need more sources or pages from a specific website. Check the plugin settings for service configuration status.
|
|
75
72
|
|
|
@@ -86,19 +83,12 @@ Configure only the routes you need.
|
|
|
86
83
|
| Firecrawl | Supplementary search and page extraction | `FIRECRAWL_API_KEY` | No |
|
|
87
84
|
| Parallel | Supplementary search and Markdown page extraction | `PARALLEL_API_KEY` | No |
|
|
88
85
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
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. Parallel extraction supports Markdown only and is disabled by default; enable it explicitly. Other extraction Providers are enabled by default; disable any you do not want the Agent to use.
|
|
92
|
-
|
|
93
|
-
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.
|
|
94
|
-
|
|
95
|
-
## 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.
|
|
96
87
|
|
|
97
|
-
|
|
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.
|
|
98
89
|
|
|
99
|
-
|
|
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.
|
|
100
91
|
|
|
101
|
-
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.
|
|
102
92
|
|
|
103
93
|
## Update and uninstall
|
|
104
94
|
|
package/README.zh.md
CHANGED
|
@@ -6,16 +6,18 @@
|
|
|
6
6
|
|
|
7
7
|
插件将搜索结果、参考来源和网页正文分开呈现。搜索时先给出回答或文档片段及来源链接,需要更多来源时可以继续追问;核对重要内容时,再要求读取原网页。搜索摘要与实际读取的正文会明确区分。
|
|
8
8
|
|
|
9
|
-
>
|
|
9
|
+
> 需自行提供服务地址和密钥,插件不附带密钥。普通网页搜索需要 Grok-compatible 服务,其他服务按需配置。
|
|
10
10
|
|
|
11
11
|
## 主要特点
|
|
12
12
|
|
|
13
13
|
- `web_search` 使用 Grok-compatible 端点生成主要回答,并行调用用户勾选的全部补充搜索 Provider(Exa、Tavily、Firecrawl、Parallel),每家使用独立的来源数量上限。
|
|
14
14
|
- 来源在展示前会经过 URL 标准化、去重,并根据来源类别、目标版本和发布时间信号重新排序。
|
|
15
|
-
- `
|
|
16
|
-
-
|
|
17
|
-
- `
|
|
18
|
-
-
|
|
15
|
+
- `web_research` 由独立研究 Agent 完成多步比较和来源核对,沿用当前模型;返回结论、链接、摘录和局限,不带回完整调查历史。
|
|
16
|
+
- DSH Web 可从原对话的子智能体入口查看研究记录。启用历史保存后,完成、取消或失败的研究在重启后仍可查看;记录只读,不支持逐字更新、状态灯或继续执行。
|
|
17
|
+
- `source_ref` 单独保存完整来源记录,可继续分页查看首次回答未展示的来源。
|
|
18
|
+
- 文档检索默认在明确指定软件名称或文档库时使用 Context7,否则使用 Exa。
|
|
19
|
+
- `web_extract` 每次读取一家已启用服务(Tavily、Firecrawl、Parallel、智能直连或直连),说明读取路径、证据等级和页面信息;失败不自动换服务。
|
|
20
|
+
- 成功搜索保留了可读来源后,下一步自动启用来源分页;站点映射仅提供给研究 Agent,主 Agent 不直接持有该工具,无需手动加载器。
|
|
19
21
|
- 补充搜索默认不选择任何 Provider。未选中的服务不会被请求;选中服务缺少凭据或执行失败会在结果中显示警告。
|
|
20
22
|
|
|
21
23
|
实现细节见[搜索链路架构](https://github.com/umineko987/dsh-search-enhance/blob/main/guides/search-workflow.zh.md)。
|
|
@@ -32,6 +34,8 @@
|
|
|
32
34
|
dsh plugin --profile web add dsh-search-enhance@latest
|
|
33
35
|
```
|
|
34
36
|
|
|
37
|
+
研究仅支持已配置且能正常使用的 DeepSeek 官方服务或 DeepSeek 账号,其他接入方式会明确失败,不自动切换。运行研究需要本机能启动 DSH。
|
|
38
|
+
|
|
35
39
|
### 2. 启动 DSH Web
|
|
36
40
|
|
|
37
41
|
```bash
|
|
@@ -52,16 +56,7 @@ dsh web
|
|
|
52
56
|
2. 在 **Grok 搜索后端** 中选择匹配的 `completions` 或 `responses` 协议及模型;
|
|
53
57
|
3. 用 **补充搜索服务** 和 **可用网页提取服务** 的下拉框多选需要的服务。其他服务的接口地址、超时和凭据引用也位于各自的凭据卡片中。
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
官方 Grok 端点会自动启用原生搜索,无需新增协议或开关:
|
|
58
|
-
- 版本路径可省略:`https://api.x.ai` / `https://us.api.x.ai` 自动补 `/v1`;`https://openrouter.ai` 自动补 `/api/v1`,填到 `/api` 时补 `/v1`。搜索与模型列表请求都会补全,不重复追加完整路径,也不改写自定义中转地址。
|
|
59
|
-
- **xAI**:`https://api.x.ai/v1`(也支持 `https://us.api.x.ai/v1`),模型如 `grok-4.6`。自动使用 Responses 并发送 `web_search` + `x_search`,即使设置选择了 `completions`;不改写已保存的设置。
|
|
60
|
-
- **OpenRouter**:`https://openrouter.ai/api/v1`,模型如 `x-ai/grok-4.6`。保留所选协议,发送 `openrouter:web_search`、`engine: native`,无需 `:online` 后缀。OpenRouter 的模型能力和工作区策略仍可能影响实际搜索引擎;严格禁止其回退时,在工作区仅允许 `native`。
|
|
61
|
-
- 只对上述官方 HTTPS 域名及 Grok 模型启用原生搜索;自定义网关使用所选协议。官方适配中 `minimal` 映射为 `low`、`max` 映射为 `xhigh`,`off` 表示省略思考参数。
|
|
62
|
-
- 结构化引用会进入来源列表。若 API 未报告完成的搜索、结构化引用或搜索用量,结果会明确提示原生搜索未确认;正文链接本身不作为执行证明。
|
|
63
|
-
|
|
64
|
-
保存设置后即可询问一个需要当前信息的问题。保存配置时 DSH 会在进程内自动热重载本插件,配置立即生效,无需重启 DSH;正在执行的插件请求可能被中断。成功时会看到 `Search` 工具行、回答和来源链接。
|
|
59
|
+
保存后设置立即生效,无需重启 DSH,但可能中断正在进行的查询。成功时会看到 `Search` 工具行、回答和来源链接。
|
|
65
60
|
|
|
66
61
|
## 使用示例
|
|
67
62
|
|
|
@@ -70,6 +65,7 @@ dsh web
|
|
|
70
65
|
- “查找 React 19 最重要的用户可见变化,优先引用官方发布说明并附上来源链接。”
|
|
71
66
|
- “查找 FastAPI 当前 JWT 认证 API,并根据官方文档给出最小示例。”
|
|
72
67
|
- “读取并总结 `https://example.com/article`,区分页面原文与推断。”
|
|
68
|
+
- “深度比较这三种方案,交叉核对关键结论,返回来源摘录与尚未解决的局限。”
|
|
73
69
|
|
|
74
70
|
需要更多参考来源或网站内的相关页面时,可以继续追问;服务配置状态可在插件设置中查看。
|
|
75
71
|
|
|
@@ -86,19 +82,11 @@ dsh web
|
|
|
86
82
|
| Firecrawl | 补充搜索和网页提取 | `FIRECRAWL_API_KEY` | 否 |
|
|
87
83
|
| Parallel | 补充搜索和 Markdown 网页提取 | `PARALLEL_API_KEY` | 否 |
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
另外,多选 **网页提取 Provider** 可以限制 Agent 可用的服务范围。每次 `web_extract` 必须明确选择一家已启用服务,例如 `{ "url": "https://example.com/", "provider": "direct", "format": "markdown" }`。服务被禁用、缺少凭据、不支持格式或执行失败时,直接报告错误,不自动回退。Parallel 提取仅支持 Markdown,默认关闭,需要手动启用;其他提取服务默认启用,可取消勾选不希望使用的服务。
|
|
92
|
-
|
|
93
|
-
对于 `docs_search`,Context7 需要明确的 `library_name` 或 `library_id`。两者都未提供时,`provider: "auto"` 使用 Exa,不会根据完整问题猜测包名。
|
|
94
|
-
|
|
95
|
-
## 按需功能
|
|
96
|
-
|
|
97
|
-
想查看更多搜索来源时,可以直接追问:“把这次搜索的其他来源也列出来。”
|
|
85
|
+
在插件设置中多选 **补充搜索服务**,所选服务会与主搜索并行执行。每家默认最多收集 `5` 条来源,可调整至 `100` 条;未勾选的服务不会被请求。
|
|
98
86
|
|
|
99
|
-
|
|
87
|
+
多选 **可用网页提取服务**,可以限制助手读取网页时使用的服务。一次只用一家,禁用、缺少密钥、不支持格式或读取失败都会明确报错,不自动换服务。Parallel 仅支持 Markdown,默认关闭;其他读取服务默认开启,可取消勾选。
|
|
100
88
|
|
|
101
|
-
|
|
89
|
+
Context7 需要明确的软件名称或文档库标识。未指定时,默认使用 Exa 查找,不从整句问题里猜软件名称。
|
|
102
90
|
|
|
103
91
|
## 更新与卸载
|
|
104
92
|
|
package/client/client.js
CHANGED
|
@@ -35,27 +35,8 @@ window.__ModuleLoader__.load({
|
|
|
35
35
|
"direct"
|
|
36
36
|
];
|
|
37
37
|
const WEB_EDITABLE_PATHS = [
|
|
38
|
-
["defaultProfile"],
|
|
39
|
-
["defaultDepth"],
|
|
40
38
|
["toolTimeoutMs"],
|
|
41
39
|
["retention", "docsSearchMaxResults"],
|
|
42
|
-
...[
|
|
43
|
-
"auto",
|
|
44
|
-
"coding_docs",
|
|
45
|
-
"code_examples",
|
|
46
|
-
"project_research",
|
|
47
|
-
"academic",
|
|
48
|
-
"fact_check"
|
|
49
|
-
].flatMap((profile) => [
|
|
50
|
-
"compact",
|
|
51
|
-
"normal",
|
|
52
|
-
"deep"
|
|
53
|
-
].map((depth) => [
|
|
54
|
-
"budgets",
|
|
55
|
-
profile,
|
|
56
|
-
depth,
|
|
57
|
-
"maxVisibleSources"
|
|
58
|
-
])),
|
|
59
40
|
["toolDiscovery", "mode"],
|
|
60
41
|
...WEB_SUPPLEMENTAL_SEARCH_PROVIDERS.map((provider) => ["supplementalSearch", provider]),
|
|
61
42
|
["supplementalSearch", "maxSourcesPerProvider"],
|
|
@@ -447,11 +428,8 @@ window.__ModuleLoader__.load({
|
|
|
447
428
|
};
|
|
448
429
|
function cloneConfig(config) {
|
|
449
430
|
return {
|
|
450
|
-
defaultProfile: config.defaultProfile,
|
|
451
|
-
defaultDepth: config.defaultDepth,
|
|
452
431
|
toolTimeoutMs: config.toolTimeoutMs,
|
|
453
432
|
retention: { ...config.retention },
|
|
454
|
-
budgets: Object.fromEntries(Object.entries(config.budgets).map(([profile, depths]) => [profile, Object.fromEntries(Object.entries(depths).map(([depth, budget]) => [depth, { ...budget }]))])),
|
|
455
433
|
toolDiscovery: { ...config.toolDiscovery },
|
|
456
434
|
supplementalSearch: { ...config.supplementalSearch },
|
|
457
435
|
searchApi: { ...config.searchApi },
|
|
@@ -714,7 +692,7 @@ window.__ModuleLoader__.load({
|
|
|
714
692
|
]);
|
|
715
693
|
const mutations = (0, react.useMemo)(() => snapshot === void 0 || draft === void 0 ? [] : mutationsFor(snapshot.value, draft), [draft, snapshot]);
|
|
716
694
|
const dirty = mutations.length > 0;
|
|
717
|
-
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
|
|
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;
|
|
718
696
|
const editable = phase === "ready" && snapshot?.writable === true && !saving;
|
|
719
697
|
const updateProvider = (provider, value) => {
|
|
720
698
|
setDraft((current) => current === void 0 ? current : provider === "searchApi" ? {
|
|
@@ -985,40 +963,6 @@ window.__ModuleLoader__.load({
|
|
|
985
963
|
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
986
964
|
style: gridStyle,
|
|
987
965
|
children: [
|
|
988
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
989
|
-
label: t("defaultProfile"),
|
|
990
|
-
overridden: isOverridden(snapshot.user, ["defaultProfile"]),
|
|
991
|
-
t,
|
|
992
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Select, {
|
|
993
|
-
value: draft.defaultProfile,
|
|
994
|
-
options: snapshot.options.profiles,
|
|
995
|
-
disabled: !editable,
|
|
996
|
-
onChange: (defaultProfile) => {
|
|
997
|
-
setDraft((current) => current === void 0 ? current : {
|
|
998
|
-
...current,
|
|
999
|
-
defaultProfile
|
|
1000
|
-
});
|
|
1001
|
-
setFeedback("idle");
|
|
1002
|
-
}
|
|
1003
|
-
})
|
|
1004
|
-
}),
|
|
1005
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
1006
|
-
label: t("defaultDepth"),
|
|
1007
|
-
overridden: isOverridden(snapshot.user, ["defaultDepth"]),
|
|
1008
|
-
t,
|
|
1009
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Select, {
|
|
1010
|
-
value: draft.defaultDepth,
|
|
1011
|
-
options: snapshot.options.depths,
|
|
1012
|
-
disabled: !editable,
|
|
1013
|
-
onChange: (defaultDepth) => {
|
|
1014
|
-
setDraft((current) => current === void 0 ? current : {
|
|
1015
|
-
...current,
|
|
1016
|
-
defaultDepth
|
|
1017
|
-
});
|
|
1018
|
-
setFeedback("idle");
|
|
1019
|
-
}
|
|
1020
|
-
})
|
|
1021
|
-
}),
|
|
1022
966
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
1023
967
|
label: t("toolDiscoveryMode"),
|
|
1024
968
|
overridden: isOverridden(snapshot.user, ["toolDiscovery", "mode"]),
|
|
@@ -1036,37 +980,6 @@ window.__ModuleLoader__.load({
|
|
|
1036
980
|
}
|
|
1037
981
|
})
|
|
1038
982
|
}),
|
|
1039
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
1040
|
-
label: t("maxVisibleSources"),
|
|
1041
|
-
overridden: isOverridden(snapshot.user, [
|
|
1042
|
-
"budgets",
|
|
1043
|
-
draft.defaultProfile,
|
|
1044
|
-
draft.defaultDepth,
|
|
1045
|
-
"maxVisibleSources"
|
|
1046
|
-
]),
|
|
1047
|
-
t,
|
|
1048
|
-
hint: t("maxVisibleSourcesHint"),
|
|
1049
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberInput, {
|
|
1050
|
-
label: t("maxVisibleSources"),
|
|
1051
|
-
value: draft.budgets[draft.defaultProfile][draft.defaultDepth].maxVisibleSources,
|
|
1052
|
-
min: 0,
|
|
1053
|
-
max: snapshot.options.visibleSourcesMax,
|
|
1054
|
-
disabled: !editable,
|
|
1055
|
-
onChange: (maxVisibleSources) => {
|
|
1056
|
-
setDraft((current) => current === void 0 ? current : {
|
|
1057
|
-
...current,
|
|
1058
|
-
budgets: {
|
|
1059
|
-
...current.budgets,
|
|
1060
|
-
[current.defaultProfile]: {
|
|
1061
|
-
...current.budgets[current.defaultProfile],
|
|
1062
|
-
[current.defaultDepth]: { maxVisibleSources }
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
});
|
|
1066
|
-
setFeedback("idle");
|
|
1067
|
-
}
|
|
1068
|
-
})
|
|
1069
|
-
}),
|
|
1070
983
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
1071
984
|
label: t("docsSearchMaxResults"),
|
|
1072
985
|
overridden: isOverridden(snapshot.user, ["retention", "docsSearchMaxResults"]),
|
|
@@ -1094,6 +1007,7 @@ window.__ModuleLoader__.load({
|
|
|
1094
1007
|
label: t("toolTimeoutMs"),
|
|
1095
1008
|
overridden: isOverridden(snapshot.user, ["toolTimeoutMs"]),
|
|
1096
1009
|
t,
|
|
1010
|
+
hint: t("toolTimeoutHint"),
|
|
1097
1011
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberInput, {
|
|
1098
1012
|
label: t("toolTimeoutMs"),
|
|
1099
1013
|
value: draft.toolTimeoutMs,
|
|
@@ -1511,16 +1425,13 @@ window.__ModuleLoader__.load({
|
|
|
1511
1425
|
timeoutMs: "Timeout (ms)",
|
|
1512
1426
|
credentialRef: "Credential reference name",
|
|
1513
1427
|
thirdPartyHint: "Example: https://gateway.example/grok/v1",
|
|
1514
|
-
strategyHeading: "
|
|
1515
|
-
strategyIntro: "
|
|
1516
|
-
defaultProfile: "Default profile",
|
|
1517
|
-
defaultDepth: "Default depth",
|
|
1518
|
-
maxVisibleSources: "Initial web_search source limit",
|
|
1519
|
-
maxVisibleSourcesHint: "Applies to the profile/depth selected above, not Provider collection or storage. Use source_ref for retained sources; model-text byte limits still apply.",
|
|
1428
|
+
strategyHeading: "Tool settings",
|
|
1429
|
+
strategyIntro: "Configure source pagination, documentation result limits, and tool timeouts.",
|
|
1520
1430
|
docsSearchMaxResults: "docs_search request ceiling",
|
|
1521
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.",
|
|
1522
|
-
toolDiscoveryMode: "
|
|
1432
|
+
toolDiscoveryMode: "Source pagination (all preloads; mapping stays research-only)",
|
|
1523
1433
|
toolTimeoutMs: "Whole tool timeout (ms)",
|
|
1434
|
+
toolTimeoutHint: "Budget for a single search or similar tool call, not the total research duration.",
|
|
1524
1435
|
extraSourcesHeading: "Supplemental search providers",
|
|
1525
1436
|
extraSourcesIntro: "Select any of Exa, Tavily, Firecrawl, and Parallel. Every selected provider searches in parallel.",
|
|
1526
1437
|
selectProviders: "Select providers (multiple allowed)",
|
|
@@ -1596,16 +1507,13 @@ window.__ModuleLoader__.load({
|
|
|
1596
1507
|
timeoutMs: "超时(毫秒)",
|
|
1597
1508
|
credentialRef: "凭据引用名",
|
|
1598
1509
|
thirdPartyHint: "示例:https://gateway.example/grok/v1",
|
|
1599
|
-
strategyHeading: "
|
|
1600
|
-
strategyIntro: "
|
|
1601
|
-
defaultProfile: "默认 Profile",
|
|
1602
|
-
defaultDepth: "默认深度",
|
|
1603
|
-
maxVisibleSources: "web_search 首次展示来源上限",
|
|
1604
|
-
maxVisibleSourcesHint: "只影响上方所选 Profile / 深度的首次展示,不限制服务收集或存储;已保留来源可通过 source_ref 分页,模型文本仍受字节上限约束。",
|
|
1510
|
+
strategyHeading: "工具设置",
|
|
1511
|
+
strategyIntro: "配置来源分页、文档结果数量上限和工具超时。",
|
|
1605
1512
|
docsSearchMaxResults: "docs_search 请求数量最高值",
|
|
1606
1513
|
docsSearchMaxResultsHint: "允许 max_results 从 1 到此最高值(调用默认 6 条),不会覆盖模型明确传入的较小值。需要更多结果时提高 max_results 后重搜;分页只能读取已保留记录。",
|
|
1607
|
-
toolDiscoveryMode: "
|
|
1514
|
+
toolDiscoveryMode: "来源分页(all 提前启用;站点映射仅研究 Agent 可用)",
|
|
1608
1515
|
toolTimeoutMs: "工具总超时(毫秒)",
|
|
1516
|
+
toolTimeoutHint: "单次搜索等工具调用的预算,不是研究总时限。",
|
|
1609
1517
|
extraSourcesHeading: "补充搜索服务",
|
|
1610
1518
|
extraSourcesIntro: "可多选 Exa、Tavily、Firecrawl、Parallel;每次搜索都会并行请求选中项。",
|
|
1611
1519
|
selectProviders: "选择服务(可多选)",
|
|
@@ -16,16 +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: "
|
|
20
|
-
readonly strategyIntro: "
|
|
21
|
-
readonly defaultProfile: "Default profile";
|
|
22
|
-
readonly defaultDepth: "Default depth";
|
|
23
|
-
readonly maxVisibleSources: "Initial web_search source limit";
|
|
24
|
-
readonly maxVisibleSourcesHint: "Applies to the profile/depth selected above, not Provider collection or storage. Use source_ref for retained sources; model-text byte limits still apply.";
|
|
19
|
+
readonly strategyHeading: "Tool settings";
|
|
20
|
+
readonly strategyIntro: "Configure source pagination, documentation result limits, and tool timeouts.";
|
|
25
21
|
readonly docsSearchMaxResults: "docs_search request ceiling";
|
|
26
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.";
|
|
27
|
-
readonly toolDiscoveryMode: "
|
|
23
|
+
readonly toolDiscoveryMode: "Source pagination (all preloads; mapping stays research-only)";
|
|
28
24
|
readonly toolTimeoutMs: "Whole tool timeout (ms)";
|
|
25
|
+
readonly toolTimeoutHint: "Budget for a single search or similar tool call, not the total research duration.";
|
|
29
26
|
readonly extraSourcesHeading: "Supplemental search providers";
|
|
30
27
|
readonly extraSourcesIntro: "Select any of Exa, Tavily, Firecrawl, and Parallel. Every selected provider searches in parallel.";
|
|
31
28
|
readonly selectProviders: "Select providers (multiple allowed)";
|
|
@@ -27,15 +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;
|
|
33
31
|
retention: {
|
|
34
32
|
docsSearchMaxResults: number;
|
|
35
33
|
};
|
|
36
|
-
budgets: Record<string, Record<string, {
|
|
37
|
-
maxVisibleSources: number;
|
|
38
|
-
}>>;
|
|
39
34
|
toolDiscovery: {
|
|
40
35
|
mode: string;
|
|
41
36
|
};
|
|
@@ -74,8 +69,6 @@ export type WebConfigLayer = {
|
|
|
74
69
|
} : WebEditableConfig[Key];
|
|
75
70
|
};
|
|
76
71
|
export interface WebConfigOptions {
|
|
77
|
-
profiles: readonly string[];
|
|
78
|
-
depths: readonly string[];
|
|
79
72
|
protocols: readonly string[];
|
|
80
73
|
thinkingLevels: readonly string[];
|
|
81
74
|
toolDiscoveryModes: readonly string[];
|
|
@@ -84,7 +77,6 @@ export interface WebConfigOptions {
|
|
|
84
77
|
supplementalSearchMaxSources: number;
|
|
85
78
|
docsSearchMinResults: number;
|
|
86
79
|
docsSearchMaxResults: number;
|
|
87
|
-
visibleSourcesMax: number;
|
|
88
80
|
}
|
|
89
81
|
export interface WebCredentialState {
|
|
90
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
|
|
39
|
-
export
|
|
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,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CredentialProvider } from '@deepseek-ai/dsh-credentials';
|
|
2
|
-
import type { Config, FallbackMode, MinimumCapabilityProfile, SearchApiProtocol,
|
|
2
|
+
import type { Config, FallbackMode, MinimumCapabilityProfile, SearchApiProtocol, ThinkingLevel } from '../config.js';
|
|
3
3
|
import type { ProviderErrorKind } from '../provider-runtime/index.js';
|
|
4
4
|
export declare const DIAGNOSTIC_ACTIONS: readonly ["show", "test"];
|
|
5
5
|
export type DiagnosticAction = (typeof DIAGNOSTIC_ACTIONS)[number];
|
|
@@ -38,8 +38,6 @@ export interface DiagnosticMinimumProfile {
|
|
|
38
38
|
}
|
|
39
39
|
/** Safe deployment facts. Values, refs, endpoints, proxies, and paths do not fit this type. */
|
|
40
40
|
export interface DiagnosticConfigurationStatus {
|
|
41
|
-
readonly defaultProfile: SearchProfile;
|
|
42
|
-
readonly defaultDepth: SearchDepth;
|
|
43
41
|
readonly searchApiProtocol: SearchApiProtocol;
|
|
44
42
|
readonly searchModelConfigured: boolean;
|
|
45
43
|
readonly thinkingLevel: ThinkingLevel;
|
|
@@ -623,8 +623,6 @@ export class DocumentationSearchService extends Service {
|
|
|
623
623
|
const cache = contextOutcome.cache ?? cacheReport(cachePath('skipped', 0, 'provider_not_selected'), cachePath('skipped', 0, 'provider_not_selected'));
|
|
624
624
|
const persistence = Object.freeze({
|
|
625
625
|
collectionTruncated: exaOutcome.truncated,
|
|
626
|
-
depth: 'compact',
|
|
627
|
-
profile: 'coding_docs',
|
|
628
626
|
query: validated.query,
|
|
629
627
|
sources: Object.freeze(qualitySources),
|
|
630
628
|
});
|