@darlingc/dsh-freesearch 0.5.6 → 0.5.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/lib/client.js +1 -1
- package/lib/index.js +14 -12
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -176,7 +176,7 @@ window.__ModuleLoader__.load({
|
|
|
176
176
|
};
|
|
177
177
|
const tt = (lang) => I18N[lang === "en" ? "en" : "zh"];
|
|
178
178
|
// 当前插件版本(与 lib/index.js 的 PLUGIN_VERSION、package.json 保持一致)
|
|
179
|
-
const PLUGIN_VERSION = "0.5.
|
|
179
|
+
const PLUGIN_VERSION = "0.5.7";
|
|
180
180
|
const ENGINES = [
|
|
181
181
|
{ id: "ddg", label: "DuckDuckGo · HTML", badge: "FREE", link: "https://duckduckgo.com" },
|
|
182
182
|
{ id: "ddg-lite", label: "DuckDuckGo · Lite", badge: "FREE", link: "https://duckduckgo.com" },
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SettingsConflictError
|
|
1
|
+
import { SettingsConflictError } 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 =
|
|
18
|
+
const FREE_SEARCH_NS = "free-search";
|
|
19
19
|
// bridge 路径的【单一权威】定义(M1)。
|
|
20
20
|
// client.js 为独立浏览器 bundle,无法 import 本文件,故在其中保留一份同步副本(同名常量);
|
|
21
21
|
// 改动本路径时,必须同步改 lib/client.js 的 BRIDGE_PREFIX,否则两端桥接会断。
|
|
@@ -34,7 +34,7 @@ const GEMINI_MODEL = "gemini-2.5-flash";
|
|
|
34
34
|
const GEMINI_URL = `https://generativelanguage.googleapis.com/v1beta/models/${GEMINI_MODEL}:generateContent`;
|
|
35
35
|
|
|
36
36
|
// 当前插件版本(发布时与 package.json 同步)
|
|
37
|
-
const PLUGIN_VERSION = "0.5.
|
|
37
|
+
const PLUGIN_VERSION = "0.5.7";
|
|
38
38
|
// 检查更新的 npm registry 元数据地址(@darlingc/dsh-freesearch 是 npmjs 上的公开包)
|
|
39
39
|
const NPM_REGISTRY_URL = "https://registry.npmjs.org/@darlingc%2Fdsh-freesearch/latest";
|
|
40
40
|
const PLUGIN_NPM_URL = "https://www.npmjs.com/package/@darlingc/dsh-freesearch";
|
|
@@ -1330,7 +1330,7 @@ function makeBridgeRoutes(settings, search, testEngine, getCredentials) {
|
|
|
1330
1330
|
}
|
|
1331
1331
|
const expectedRevision = typeof body.expectedRevision === "number" ? body.expectedRevision : undefined;
|
|
1332
1332
|
try {
|
|
1333
|
-
await settings.mutate(
|
|
1333
|
+
await settings.mutate(ns, body.ops, expectedRevision);
|
|
1334
1334
|
} catch (error) {
|
|
1335
1335
|
if (error instanceof SettingsConflictError) {
|
|
1336
1336
|
return { ok: false, code: "settings-conflict", message: error.message };
|
|
@@ -1739,14 +1739,16 @@ function apply(ctx, config) {
|
|
|
1739
1739
|
},
|
|
1740
1740
|
};
|
|
1741
1741
|
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1742
|
+
ctx.inject(["settings"], (settingsCtx) => {
|
|
1743
|
+
settingsCtx.settings.installSection(ctx, FREE_SEARCH_NS, Config, config ?? {}, {
|
|
1744
|
+
setSource: (source) => {
|
|
1745
|
+
current = source;
|
|
1746
|
+
},
|
|
1747
|
+
onChange: () => {
|
|
1748
|
+
// settings 变更时刷新系统提示词(显示最新引擎)
|
|
1749
|
+
if (typeof refreshPrompt === "function") refreshPrompt();
|
|
1750
|
+
},
|
|
1751
|
+
});
|
|
1750
1752
|
});
|
|
1751
1753
|
|
|
1752
1754
|
ctx.inject(["webServer", "settings"], (sctx) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darlingc/dsh-freesearch",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "Free web search for DeepSeek Harness: 11 engines (Bing/DuckDuckGo/AnySearch/SearXNG/Exa/Tavily/Keenable keyless + Gemini grounding) + time filtering + platform search + web_fetch, with web settings UI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|