dsh-free-search 0.4.18 → 0.4.19

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 (2) hide show
  1. package/lib/index.js +13 -11
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { SettingsConflictError, installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-settings";
1
+ import { SettingsConflictError, SettingsProvider } from "@deepseek-ai/dsh-settings";
2
2
  import { defineTool } from "@deepseek-ai/dsh-tools";
3
3
  import z from "@deepseek-ai/schemastery";
4
4
  import fs from "node:fs";
@@ -15,7 +15,7 @@ const USER_AGENT =
15
15
  "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36";
16
16
  const ACCEPT_LANG = "zh-CN,zh;q=0.9,en;q=0.8";
17
17
 
18
- const FREE_SEARCH_NS = settingsNamespace("free-search");
18
+ const FREE_SEARCH_NS = "free-search";
19
19
  const BRIDGE_PREFIX = "/api/dsh-free-search-settings";
20
20
  const FREE_ENGINES = ["ddg", "ddg-lite", "bing", "searxng", "anysearch"];
21
21
  const ALL_ENGINES = ["ddg", "ddg-lite", "bing", "searxng", "anysearch", "exa", "tavily", "keenable", "perplexity", "deepseek-official"];
@@ -1243,7 +1243,7 @@ function makeBridgeRoutes(settings, search, testEngine, getCredentials) {
1243
1243
  }
1244
1244
  const expectedRevision = typeof body.expectedRevision === "number" ? body.expectedRevision : undefined;
1245
1245
  try {
1246
- await settings.mutate(settingsNamespace(ns), body.ops, expectedRevision);
1246
+ await settings.mutate(ns, body.ops, expectedRevision);
1247
1247
  } catch (error) {
1248
1248
  if (error instanceof SettingsConflictError) {
1249
1249
  return { ok: false, code: "settings-conflict", message: error.message };
@@ -1642,14 +1642,16 @@ function apply(ctx, config) {
1642
1642
  },
1643
1643
  };
1644
1644
 
1645
- installSettingsSection(ctx, FREE_SEARCH_NS, Config, config ?? {}, {
1646
- setSource: (source) => {
1647
- current = source;
1648
- },
1649
- onChange: () => {
1650
- // settings 变更时刷新系统提示词(显示最新引擎)
1651
- if (typeof refreshPrompt === "function") refreshPrompt();
1652
- },
1645
+ ctx.inject(["settings"], (sctx) => {
1646
+ sctx.settings.installSection(ctx, FREE_SEARCH_NS, Config, config ?? {}, {
1647
+ setSource: (source) => {
1648
+ current = source;
1649
+ },
1650
+ onChange: () => {
1651
+ // settings 变更时刷新系统提示词(显示最新引擎)
1652
+ if (typeof refreshPrompt === "function") refreshPrompt();
1653
+ },
1654
+ });
1653
1655
  });
1654
1656
 
1655
1657
  ctx.inject(["webServer", "settings"], (sctx) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-free-search",
3
- "version": "0.4.18",
3
+ "version": "0.4.19",
4
4
  "description": "Free web search for DeepSeek Harness: 10 engines (Bing/DuckDuckGo/AnySearch/SearXNG/Exa/Tavily/Keenable keyless) + time filtering + platform search + web_fetch, with web settings UI.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",