dsh-web-search-plugin 0.4.0 → 0.4.1
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/CHANGELOG.md +10 -0
- package/README.md +3 -2
- package/cordis.patch.yml +6 -4
- package/lib/brave.js +4 -6
- package/lib/client.js +3 -3
- package/lib/index.js +2 -3
- package/lib/shared.js +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
本项目的重要变更都记录在此。格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [0.4.1] - 2026-09-10
|
|
6
|
+
|
|
7
|
+
### 变更
|
|
8
|
+
|
|
9
|
+
- **适配 DeepSeek Harness `0.1.5-rc.1`**:四个 DSH peerDependencies 提升到 `^0.1.5-rc.1`,Node.js 运行要求对齐为 `^22.19.0 || >=24.0.0`。
|
|
10
|
+
- 浏览器端显式注入 `remote.credentials`,避免 API remote 尚未挂载时访问凭据服务的启动顺序竞态。
|
|
11
|
+
- Bundle 覆盖 `web.config` 时保留上游 `fetchProvider: http`,不再因切换搜索 provider 而隐式清除抓取 provider。
|
|
12
|
+
- Brave 的 `proxy` 仅作为 provider 级显式覆盖;留空时继承 DSH 的全局代理分发器,统一支持 `HTTP_PROXY` / `HTTPS_PROXY` / `ALL_PROXY` / `NO_PROXY`。
|
|
13
|
+
- 版本号及 `User-Agent` 更新为 `0.4.1`。
|
|
14
|
+
|
|
5
15
|
## [0.4.0] - 2026-09-02
|
|
6
16
|
|
|
7
17
|
### 变更
|
package/README.md
CHANGED
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
|
|
30
30
|
## 运行要求
|
|
31
31
|
|
|
32
|
-
- DeepSeek Harness `0.1.
|
|
32
|
+
- DeepSeek Harness `0.1.5-rc.1` 或兼容版本
|
|
33
|
+
- Node.js `^22.19.0` 或 `>=24.0.0`
|
|
33
34
|
- pnpm,用于通过 `dsh plugin` 把插件装进 profile
|
|
34
35
|
|
|
35
36
|
## 安装
|
|
@@ -72,7 +73,7 @@ dsh plugin --profile web add dsh-web-search-plugin
|
|
|
72
73
|
| `country` | — | Brave 的 `country`(ISO 两位码,如 `cn`);留空使用 Brave 默认 |
|
|
73
74
|
| `searchLang` | — | Brave 的 `search_lang`(如 `zh-hans`);留空使用 Brave 默认 |
|
|
74
75
|
| `freshness` | — | Brave 的 `freshness`:`pd` / `pw` / `pm` / `py` |
|
|
75
|
-
| `proxy` | — | Brave 使用的 HTTP(S)
|
|
76
|
+
| `proxy` | — | Brave 使用的 HTTP(S) 代理覆盖;留空继承 DSH 的全局 `HTTP_PROXY` / `HTTPS_PROXY` / `ALL_PROXY` / `NO_PROXY` 策略 |
|
|
76
77
|
| `serperApiKey` / `serperApiKeyEnv` / `serperBaseURL` | — / `SERPER_API_KEY` / — | Serper 的 key 字面量 / 凭据引用名 / 端点覆盖 |
|
|
77
78
|
| `serpapiApiKey` / `serpapiApiKeyEnv` / `serpapiBaseURL` | — / `SERPAPI_API_KEY` / — | SerpApi 的 key 字面量 / 凭据引用名 / 端点覆盖 |
|
|
78
79
|
| `exaApiKey` / `exaApiKeyEnv` / `exaBaseURL` | — / `EXA_API_KEY` / — | Exa 的 key 字面量 / 凭据引用名 / 端点覆盖 |
|
package/cordis.patch.yml
CHANGED
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
# installs the package as a plain library: no loader row, no Host apply, no
|
|
4
4
|
# `/plugins/<name>/client.js`.
|
|
5
5
|
#
|
|
6
|
-
# `searchProvider`
|
|
7
|
-
# targeted row's whole `config`. The
|
|
8
|
-
# wins if it later overrides `web`. The
|
|
9
|
-
# backend (DeepSeek / Tavily / Brave) is the
|
|
6
|
+
# `searchProvider` and the upstream `fetchProvider` are restated in full
|
|
7
|
+
# because a Cordis patch replaces the targeted row's whole `config`. The
|
|
8
|
+
# profile's own cordis.patch.yml still wins if it later overrides `web`. The
|
|
9
|
+
# seam id is `dsh-web-search`; the backend (DeepSeek / Tavily / Brave) is the
|
|
10
|
+
# plugin's own `provider` setting.
|
|
10
11
|
- id: web
|
|
11
12
|
name: '@deepseek-ai/dsh-web'
|
|
12
13
|
config:
|
|
13
14
|
searchProvider: dsh-web-search
|
|
15
|
+
fetchProvider: http
|
|
14
16
|
|
|
15
17
|
# This plugin re-hosts the DeepSeek backend, so the in-box DeepSeek host
|
|
16
18
|
# plugin is redundant: disabling it removes its `deepseek-official` provider
|
package/lib/brave.js
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { ProxyAgent } from "undici";
|
|
14
14
|
import { WebError } from "@deepseek-ai/dsh-web";
|
|
15
|
-
import { launchEnvironmentOf } from "@deepseek-ai/dsh-launch-environment";
|
|
16
15
|
import { MAX_RESULTS_CAP, USER_AGENT, isAbortError, isPositiveInteger, resolveApiKey, resolveSecret, searchAborted, throwIfSearchAborted } from "./shared.js";
|
|
17
16
|
|
|
18
17
|
/** Default Brave Search API web-results endpoint. */
|
|
@@ -123,9 +122,9 @@ export class BraveSearchProvider {
|
|
|
123
122
|
}
|
|
124
123
|
|
|
125
124
|
/**
|
|
126
|
-
* Cached undici ProxyAgent for
|
|
127
|
-
*
|
|
128
|
-
*
|
|
125
|
+
* Cached undici ProxyAgent for an explicit provider-level proxy override.
|
|
126
|
+
* With no override, fetch inherits the dispatcher installed by DSH so its
|
|
127
|
+
* HTTP_PROXY / HTTPS_PROXY / ALL_PROXY / NO_PROXY policy remains intact.
|
|
129
128
|
*/
|
|
130
129
|
dispatcher(options) {
|
|
131
130
|
const proxy = options.proxy;
|
|
@@ -142,7 +141,6 @@ export class BraveSearchProvider {
|
|
|
142
141
|
|
|
143
142
|
/** Project the plugin section into Brave backend options. */
|
|
144
143
|
export function resolveBraveOptions(ctx, config) {
|
|
145
|
-
const environment = launchEnvironmentOf(ctx);
|
|
146
144
|
return {
|
|
147
145
|
...resolveSecret(ctx, {
|
|
148
146
|
literal: config.braveApiKey,
|
|
@@ -153,6 +151,6 @@ export function resolveBraveOptions(ctx, config) {
|
|
|
153
151
|
country: config.country,
|
|
154
152
|
searchLang: config.searchLang,
|
|
155
153
|
freshness: config.freshness,
|
|
156
|
-
proxy: config.proxy
|
|
154
|
+
proxy: config.proxy
|
|
157
155
|
};
|
|
158
156
|
}
|
package/lib/client.js
CHANGED
|
@@ -132,7 +132,7 @@ window.__ModuleLoader__.load({
|
|
|
132
132
|
freshnessMonth: "Past month",
|
|
133
133
|
freshnessYear: "Past year",
|
|
134
134
|
proxy: "Proxy",
|
|
135
|
-
proxyPlaceholder: "Leave blank to
|
|
135
|
+
proxyPlaceholder: "Leave blank to inherit the DSH proxy settings.",
|
|
136
136
|
deepseekApiKeyEnv: "Credential reference",
|
|
137
137
|
deepseekApiKeyEnvHint: "Name of the credential/env var resolved for DeepSeek search.",
|
|
138
138
|
deepseekBaseURL: "Endpoint",
|
|
@@ -228,7 +228,7 @@ window.__ModuleLoader__.load({
|
|
|
228
228
|
freshnessMonth: "过去一月",
|
|
229
229
|
freshnessYear: "过去一年",
|
|
230
230
|
proxy: "代理",
|
|
231
|
-
proxyPlaceholder: "
|
|
231
|
+
proxyPlaceholder: "留空继承 DSH 全局代理设置",
|
|
232
232
|
deepseekApiKeyEnv: "凭据引用名",
|
|
233
233
|
deepseekApiKeyEnvHint: "DeepSeek 搜索解析的凭据/环境变量名。",
|
|
234
234
|
deepseekBaseURL: "接口地址",
|
|
@@ -1168,7 +1168,7 @@ window.__ModuleLoader__.load({
|
|
|
1168
1168
|
}, makeSection(ctx, controller)));
|
|
1169
1169
|
}
|
|
1170
1170
|
|
|
1171
|
-
const inject = ["slots", "locale", "remote", "settingsScope"];
|
|
1171
|
+
const inject = ["slots", "locale", "remote", "remote.credentials", "settingsScope"];
|
|
1172
1172
|
|
|
1173
1173
|
exports.apply = apply;
|
|
1174
1174
|
exports.inject = inject;
|
package/lib/index.js
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
* @module dsh-web-search-plugin
|
|
18
18
|
*/
|
|
19
19
|
import z from "@deepseek-ai/schemastery";
|
|
20
|
-
import { launchEnvironmentOf } from "@deepseek-ai/dsh-launch-environment";
|
|
21
20
|
import { MAX_RESULTS_CAP } from "./shared.js";
|
|
22
21
|
import { TAVILY_DEFAULT_API_KEY_ENV, TAVILY_DEFAULT_BASE_URL, TavilySearchProvider, resolveTavilyOptions } from "./tavily.js";
|
|
23
22
|
import { BRAVE_DEFAULT_API_KEY_ENV, BRAVE_DEFAULT_BASE_URL, BraveSearchProvider, resolveBraveOptions } from "./brave.js";
|
|
@@ -68,7 +67,7 @@ const Config = z.object({
|
|
|
68
67
|
searchLang: z.string().default(""),
|
|
69
68
|
/** Optional Brave `freshness` (`pd` / `pw` / `pm` / `py`). */
|
|
70
69
|
freshness: z.string().default(""),
|
|
71
|
-
/** Optional HTTP(S) proxy URL for Brave
|
|
70
|
+
/** Optional HTTP(S) proxy URL for Brave; blank inherits DSH's global proxy policy. */
|
|
72
71
|
proxy: z.string().default(""),
|
|
73
72
|
/** Literal Serper API key; prefer {@link serperApiKeyEnv}. */
|
|
74
73
|
serperApiKey: z.string().role("secret").default(""),
|
|
@@ -173,7 +172,7 @@ function resolveOptions(ctx, config) {
|
|
|
173
172
|
// metadata row's default is not enough (self-hosted SearXNG, proxied
|
|
174
173
|
// providers, custom key refs).
|
|
175
174
|
const keySourceByProvider = {
|
|
176
|
-
brave: { literal: config.braveApiKey, envName: config.braveApiKeyEnv ?? BRAVE_DEFAULT_API_KEY_ENV, baseURL: config.braveBaseURL ?? "", proxy: config.proxy
|
|
175
|
+
brave: { literal: config.braveApiKey, envName: config.braveApiKeyEnv ?? BRAVE_DEFAULT_API_KEY_ENV, baseURL: config.braveBaseURL ?? "", proxy: config.proxy ?? "" },
|
|
177
176
|
tavily: { literal: config.apiKey, envName: config.apiKeyEnv ?? TAVILY_DEFAULT_API_KEY_ENV, baseURL: config.baseURL ?? "" },
|
|
178
177
|
serper: { literal: config.serperApiKey, envName: config.serperApiKeyEnv ?? "SERPER_API_KEY", baseURL: config.serperBaseURL ?? "" },
|
|
179
178
|
serpapi: { literal: config.serpapiApiKey, envName: config.serpapiApiKeyEnv ?? "SERPAPI_API_KEY", baseURL: config.serpapiBaseURL ?? "" },
|
package/lib/shared.js
CHANGED
|
@@ -7,7 +7,7 @@ import { launchEnvironmentOf } from "@deepseek-ai/dsh-launch-environment";
|
|
|
7
7
|
import { WebError } from "@deepseek-ai/dsh-web";
|
|
8
8
|
|
|
9
9
|
/** Attribution header sent on every request. */
|
|
10
|
-
export const USER_AGENT = "dsh-web-search-plugin/0.4.
|
|
10
|
+
export const USER_AGENT = "dsh-web-search-plugin/0.4.1";
|
|
11
11
|
/** Shared cap: Tavily `max_results` and Brave `count` both accept 1..20. */
|
|
12
12
|
export const MAX_RESULTS_CAP = 20;
|
|
13
13
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-web-search-plugin",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Unified web search for the DeepSeek Harness seam (ctx.web): DeepSeek (official), Tavily, Brave, Serper, SerpApi, Exa, SearXNG, Scavio, and Firecrawl backends",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh-plugin",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"LICENSE"
|
|
25
25
|
],
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
27
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
28
28
|
},
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"undici": "^6.21.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@deepseek-ai/dsh-web": "^0.1.
|
|
61
|
-
"@deepseek-ai/dsh-credentials": "^0.1.
|
|
62
|
-
"@deepseek-ai/dsh-settings": "^0.1.
|
|
63
|
-
"@deepseek-ai/dsh-launch-environment": "^0.1.
|
|
60
|
+
"@deepseek-ai/dsh-web": "^0.1.5-rc.1",
|
|
61
|
+
"@deepseek-ai/dsh-credentials": "^0.1.5-rc.1",
|
|
62
|
+
"@deepseek-ai/dsh-settings": "^0.1.5-rc.1",
|
|
63
|
+
"@deepseek-ai/dsh-launch-environment": "^0.1.5-rc.1",
|
|
64
64
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
65
65
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
66
66
|
},
|