@240xu/dsh-websearch 2.13.6 → 2.13.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
@@ -269,7 +269,7 @@ tests/
269
269
  node --test tests/
270
270
  ```
271
271
 
272
- 当前 239/239 pass(`node --test tests/*.test.js`;`tests/up-health.test.mjs` 单独跑)。
272
+ 当前 240/240 pass(`node --test tests/*.test.js`;`tests/up-health.test.mjs` 单独跑)。
273
273
 
274
274
  ### Test-only dependencies
275
275
 
package/lib/client.js CHANGED
@@ -40,6 +40,10 @@ window.__ModuleLoader__.load({
40
40
  };
41
41
  /** Boolean settings staged as "true"/"false" strings by the selects. */
42
42
  const BOOLEAN_FIELDS = ["rerank", "safeSearch", "resultTelemetry", "resultHeader", "cacheEnabled"];
43
+ // resolveOptions forces these under official; a draft left behind would
44
+ // be saved while having no runtime effect, and could block Save with an
45
+ // invalid value the disabled control cannot correct.
46
+ const OFFICIAL_IGNORED_FIELDS = ["numResults", "rerank", "resultTelemetry", "resultHeader"];
43
47
  // split metered, opt-in backends out of the
44
48
  // "keyless / ready to use" group. They work without a key but are rate
45
49
  // limited and default OFF, so a separate section with an explicit hint
@@ -503,6 +507,9 @@ window.__ModuleLoader__.load({
503
507
  }
504
508
  this.savedAt = 0;
505
509
  this.staged.set(field, { text });
510
+ if (field === "intervention" && String(text) === "official") {
511
+ for (const ignored of OFFICIAL_IGNORED_FIELDS) this.staged.delete(ignored);
512
+ }
506
513
  this.republish();
507
514
  }
508
515
  /** Drop a staged field edit; the stored value is untouched. */
@@ -958,7 +965,7 @@ window.__ModuleLoader__.load({
958
965
  const hasDraft = (f) => state.stagedText(f) !== undefined;
959
966
  // A gate only locks untouched fields; a field with a pending edit
960
967
  // stays editable so the user can correct or discard it.
961
- const officialLocked = (f) => official && !hasDraft(f);
968
+ const officialLocked = (f) => official && !hasDraft(f); // drafts are dropped on switching to official
962
969
  const ttlLocked = !cacheOn && !hasDraft("cacheTtl");
963
970
  const recencyOptions = [
964
971
  { value: "any", label: t("recencyAny") },
@@ -1137,7 +1144,7 @@ window.__ModuleLoader__.load({
1137
1144
  const hasDraft = (f) => state.stagedText(f) !== undefined;
1138
1145
  // A gate only locks untouched fields; a field with a pending edit
1139
1146
  // stays editable so the user can correct or discard it.
1140
- const officialLocked = (f) => official && !hasDraft(f);
1147
+ const officialLocked = (f) => official && !hasDraft(f); // drafts are dropped on switching to official
1141
1148
  const ttlLocked = !cacheOn && !hasDraft("cacheTtl");
1142
1149
 
1143
1150
  return react_jsx_runtime.jsxs("div", { className: "wsc-card", children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@240xu/dsh-websearch",
3
- "version": "2.13.6",
3
+ "version": "2.13.7",
4
4
  "description": "Unified web search provider for DeepSeek Harness (ctx.web): 13 backends — Exa + Parallel + DDG + SearXNG (keyless), DeepSeek + Anthropic + OpenAI + Brave + Tavily + Serper + Mojeek (key-gated via Settings credentials), Firecrawl + TinyFish (metered keyless, opt-in). Registers provider id \"unified\" for zero-config web_search. 统一网页搜索聚合:13 后端并发扇出、去重合并。See CHANGELOG.md for version history.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",