dsh-free-search 0.6.6 → 0.6.7

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 CHANGED
@@ -108,28 +108,33 @@ dsh web
108
108
 
109
109
  #### 接管行为与验证
110
110
 
111
- 插件加载后**自动接管搜索**:
111
+ 插件加载后**自动接管搜索**(运行时接管,不改配置层):
112
112
 
113
- - `web.searchProvider` 未设置,或仍是 DSH 出厂默认的官方搜索 `deepseek-official` 时,自动切换为本插件;
113
+ - `web.searchProvider` 未设置,或仍是 DSH 出厂默认的官方搜索 `deepseek-official` 时,自动切换为本插件的 provider(id 固定为 `ddg`);
114
114
  - 如果(你或别的插件)已显式选择其他 provider,本插件不抢占,只在启动日志输出 WARN 与切换用的 YAML。
115
115
 
116
- 正常安装(`dsh plugin add` / 插件管理器)时,插件自带的 **bundle patch**(`cordis.patch.yml`)还会在配置层显式写入 `searchProvider: ddg`;即使这层没生效(例如把插件作为普通依赖手工安装、或 profile patch 整体覆盖了 `web` 条目),上面的运行时兜底也会接管官方默认,不会再静默退回官方搜索。
116
+ **不再往配置里写 `searchProvider: ddg`**:静态覆盖曾导致"悬空引用"——patch 是整段覆盖 config,一旦插件那一行被**停用或跳过**(比如在插件管理器里关掉),配置仍指向 `ddg` 而没有任何东西注册它,于是每次搜索都失败:
117
117
 
118
- 需要显式声明、或从其他 provider 切过来时(`profiles/<profile>/cordis.patch.yml`):
118
+ ```
119
+ Error: configured web provider "ddg" is not registered
120
+ ```
121
+
122
+ 现在没有这层覆盖:插件被停用时 `web.searchProvider` 保持官方默认(`deepseek-official`),搜索至少还能走官方通道;插件启用时由上面的运行时接管切到 `ddg`。
123
+
124
+ > 如果你曾按旧文档手动在 `profiles/<profile>/cordis.patch.yml` 里加过下面这段,而插件没有启用,就会看到上面那条错误——**删掉这段即可**(或重新启用插件):
119
125
 
120
126
  ```yaml
121
- # 让 harness 的 web_search 使用本插件。
122
- # DSH 0.1.2+ 的 patch 是"整段覆盖 config"而不是深度合并:
123
- # 已有 web 条目里的字段(如 fetchProvider)必须在这里一并重述,否则会被抹掉。
127
+ # 可选,通常不需要:只有你想强制指定时才加。
128
+ # DSH 0.1.2+ 的 patch 是"整段覆盖 config",必须保留 fetchProvider。
124
129
  - id: web
125
130
  config:
126
131
  searchProvider: ddg
127
132
  fetchProvider: http
128
133
  ```
129
134
 
130
- - `searchProvider: ddg` —— `ddg` 是**本插件注册的 provider id(固定值)**,不是"使用 DuckDuckGo 引擎"的意思;具体用哪个引擎由设置页的 `provider` 字段决定(可填 `bing`/`baidu`/`auto` 等)。
131
- - `fetchProvider: http` —— 官方网页抓取(web-fetch-http),请保留;漏掉会导致网页抓取失效或重复注册。
132
- - 想改回官方搜索:在插件管理器里停用本插件条目即可。
135
+ - `searchProvider: ddg` —— 本插件的 **provider id(固定值)**,不是"使用 DuckDuckGo 引擎";用哪个引擎由设置页的 `provider` 字段决定(`bing`/`baidu`/`auto`/…)。
136
+ - `fetchProvider: http` —— 官方网页抓取(web-fetch-http),手动声明时必须保留。
137
+ - 想改用官方搜索:在插件管理器里停用本插件条目即可,不需要改配置。
133
138
 
134
139
  #### 姊妹插件:dsh-preset-workbench(预设工作台)
135
140
 
@@ -431,28 +436,33 @@ dsh web
431
436
 
432
437
  #### Takeover behavior and verification
433
438
 
434
- The plugin **takes over search automatically** once loaded:
439
+ The plugin **takes over search at runtime** once loaded (it does not touch the config layer):
435
440
 
436
- - When `web.searchProvider` is unset, or still the shipped default `deepseek-official`, it switches to this plugin;
441
+ - When `web.searchProvider` is unset, or still the shipped default `deepseek-official`, it switches to this plugin's provider (id: `ddg`);
437
442
  - If you (or another plugin) explicitly selected a different provider, it does not steal it — it only logs a WARN with a copy-pasteable YAML snippet.
438
443
 
439
- With a normal install (`dsh plugin add` / plugin manager) the bundled **bundle patch** (`cordis.patch.yml`) additionally writes `searchProvider: ddg` into the config layer. Even if that layer does not apply (e.g. the plugin was added as a plain dependency, or a profile patch replaced the whole `web` entry), the runtime fallback above still takes over from the official default — search no longer silently falls back to the official provider.
444
+ **It no longer writes `searchProvider: ddg` into the config layer.** A static override used to create a dangling reference: a patch replaces the whole row config, so when the plugin's row was **disabled or skipped** (e.g. switched off in the plugin manager) the config still said `ddg` while nothing registered it, and every search failed with:
445
+
446
+ ```
447
+ Error: configured web provider "ddg" is not registered
448
+ ```
449
+
450
+ Without that override, a disabled plugin leaves `web.searchProvider` at the shipped default (`deepseek-official`) so search still works through the official provider; when the plugin is enabled the runtime takeover above points it at `ddg`.
440
451
 
441
- To declare it explicitly, or to switch over from another provider (`profiles/<profile>/cordis.patch.yml`):
452
+ > If you previously added the snippet below by hand to `profiles/<profile>/cordis.patch.yml` *and* the plugin is not enabled, you will see that error — **just remove the snippet** (or re-enable the plugin):
442
453
 
443
454
  ```yaml
444
- # Route the harness web_search through this plugin.
445
- # Since DSH 0.1.2 a patch REPLACES the whole entry config (no deep merge):
446
- # restate any existing web.* fields (e.g. fetchProvider) or they are dropped.
455
+ # Optional; normally unnecessary — only to force a specific provider.
456
+ # Since DSH 0.1.2 a patch REPLACES the whole entry config: keep fetchProvider.
447
457
  - id: web
448
458
  config:
449
459
  searchProvider: ddg
450
460
  fetchProvider: http
451
461
  ```
452
462
 
453
- - `searchProvider: ddg` — `ddg` is this plugin's **fixed provider id**, not "use the DuckDuckGo engine". The engine is chosen by the `provider` field in the settings page (`bing` / `baidu` / `auto` / …).
454
- - `fetchProvider: http` — the official web-fetch provider; keep it, or page fetching breaks or double-registers.
455
- - To go back to official search: disable this plugin's entry in the plugin manager.
463
+ - `searchProvider: ddg` — this plugin's **fixed provider id**, not "use the DuckDuckGo engine"; the engine is chosen by the `provider` field in settings (`bing` / `baidu` / `auto` / …).
464
+ - `fetchProvider: http` — the official web-fetch provider; keep it when declaring the row by hand.
465
+ - To go back to official search: disable this plugin's entry in the plugin manager — no config edit needed.
456
466
 
457
467
  #### Sister Plugin: dsh-preset-workbench
458
468
 
package/cordis.patch.yml CHANGED
@@ -10,10 +10,20 @@
10
10
  # A legacy ~/.dsh/settings.yaml "free-search:" section is migrated into this
11
11
  # entry's config once at startup (see README).
12
12
  # Failed/empty engines automatically fall back to the next free engine.
13
- # web.searchProvider must point at this plugin's provider id (ddg); the runtime
14
- # also takes over when it is unset or still the shipped default
15
- # (deepseek-official), and only warns when another provider was chosen
16
- # explicitly.
13
+ #
14
+ # NOTE (2026-10, issue #51): this bundle does NOT touch `web.searchProvider`.
15
+ # The plugin takes the search provider over at runtime instead — when the field
16
+ # is unset or still the shipped default (`deepseek-official`) it points it at its
17
+ # own provider id (`ddg`); when another provider was chosen explicitly it leaves
18
+ # it alone and only warns.
19
+ #
20
+ # A static `- id: web config: searchProvider: ddg` used to live here. It was
21
+ # removed because it created a dangling reference: a patch replaces the whole
22
+ # row config, so rows that came from a *disabled* or skipped plugin left
23
+ # `searchProvider: ddg` behind while nothing registered `ddg` — every web search
24
+ # then failed with `configured web provider "ddg" is not registered`. Leaving the
25
+ # base default (`deepseek-official`) in place means a disabled plugin degrades to
26
+ # the official provider instead of breaking search outright.
17
27
  - insert:
18
28
  - id: web-search-free
19
29
  name: dsh-free-search
@@ -21,10 +31,3 @@
21
31
  provider: bing
22
32
  disabledEngines: []
23
33
  bingMarket: zh-CN
24
- # 自动接管默认搜索:让 harness 的 web_search 直接用本插件的 provider(内部含全部引擎)
25
- # 注意 patch 语义是"整行替换 config"(DSH 0.1.2+):必须保留 fetchProvider,否则
26
- # web-fetch-http 会被另一层重新注册,与 base bundle 的注册造成 duplicate loader entry。
27
- - id: web
28
- config:
29
- searchProvider: ddg
30
- fetchProvider: http
package/lib/client.js CHANGED
@@ -290,7 +290,7 @@ window.__ModuleLoader__.load({
290
290
  };
291
291
  const tt = (lang) => I18N[lang === "en" ? "en" : "zh"];
292
292
  // 当前插件版本(与 lib/index.js 的 PLUGIN_VERSION 保持一致)
293
- const PLUGIN_VERSION = "0.6.6";
293
+ const PLUGIN_VERSION = "0.6.7";
294
294
  const ENGINES = [
295
295
  { id: "auto", label: "Auto · 智能路由", badge: "AUTO", link: null },
296
296
  { id: "multi", label: "Multi Search · 多引擎", badge: "MULTI", link: null },
package/lib/index.js CHANGED
@@ -121,7 +121,7 @@ function routeEngines(query, { timeRange, disabledEngines = [], fallbackOrder =
121
121
  }
122
122
 
123
123
  // 当前插件版本(发布时与 package.json 同步)
124
- const PLUGIN_VERSION = "0.6.6";
124
+ const PLUGIN_VERSION = "0.6.7";
125
125
  // 检查更新的 npm registry 元数据地址(dsh-free-search 是 npmjs 上的公开包)
126
126
  const NPM_REGISTRY_URL = "https://registry.npmjs.org/dsh-free-search/latest";
127
127
  const PLUGIN_NPM_URL = "https://www.npmjs.com/package/dsh-free-search";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-free-search",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "description": "Free web search for DeepSeek Harness: 18 engines (Bing/DuckDuckGo/AnySearch/SearXNG/Exa/Tavily/Keenable/Firecrawl/Parallel keyless; Perplexity/SerpBase/DeepSeek/You.com/Baidu/Kimi/Aliyun/Doubao with key) + auto smart routing + global engine enable/disable & fallback priority + multi mode (parallel top-3 merge) + multi_search cross-source tool + time filtering + platform search + web_fetch, with web settings UI.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",