dsh-free-search 0.8.8 → 0.8.9
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 +1 -1
- package/lib/research.js +19 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -368,7 +368,7 @@ window.__ModuleLoader__.load({
|
|
|
368
368
|
};
|
|
369
369
|
const tt = (lang) => I18N[lang === "en" ? "en" : "zh"];
|
|
370
370
|
// 当前插件版本(与 lib/index.js 的 PLUGIN_VERSION 保持一致;跟随上游 v0.7.5)
|
|
371
|
-
const PLUGIN_VERSION = "0.8.
|
|
371
|
+
const PLUGIN_VERSION = "0.8.9";
|
|
372
372
|
const ENGINES = [
|
|
373
373
|
{ id: "auto", label: "Auto · 智能路由", badge: "AUTO", link: null },
|
|
374
374
|
{ id: "multi", label: "Multi Search · 多引擎", badge: "MULTI", link: null },
|
package/lib/index.js
CHANGED
|
@@ -242,7 +242,7 @@ function routeEngines(query, { timeRange, disabledEngines = [], fallbackOrder =
|
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
// 当前插件版本(发布时与 package.json 同步;跟随上游 v0.7.5,不在 PR 里 bump)
|
|
245
|
-
const PLUGIN_VERSION = "0.8.
|
|
245
|
+
const PLUGIN_VERSION = "0.8.9";
|
|
246
246
|
// 检查更新的 npm registry 元数据地址(dsh-free-search 是 npmjs 上的公开包)
|
|
247
247
|
const NPM_REGISTRY_URL = "https://registry.npmjs.org/dsh-free-search/latest";
|
|
248
248
|
const PLUGIN_NPM_URL = "https://www.npmjs.com/package/dsh-free-search";
|
package/lib/research.js
CHANGED
|
@@ -12,6 +12,25 @@ import { isDomainBlocked } from "./domain_filter.js";
|
|
|
12
12
|
// 模型组件的受控替身(测试/评审用;抓取层的替身在 fetch_upstream.js 的 CONTROLLED_STUBS)
|
|
13
13
|
export const CONTROLLED_STUBS = { rerank: null, embed: null, decide: null, judgeQueryIntent: null };
|
|
14
14
|
|
|
15
|
+
// ---------- 模型层调用包装(#75)----------
|
|
16
|
+
// 这四个 call* 包装层自 PR #59(v0.8.0)起被 9 处调用却从未定义:
|
|
17
|
+
// 平时被 state.rerankKey / state.decisionKey 守卫短路,所以看不出来;一旦配了
|
|
18
|
+
// SILICONFLOW_RERANK_API_KEY 走 embed 分支就 ReferenceError,整个 research 工具不可用。
|
|
19
|
+
// DECISION_MODEL_* 同理:现在没人配所以不炸,配了会以相同方式炸(callDecide is not defined)。
|
|
20
|
+
// 统一在这里透传:替身优先,否则走底层实现——与上面 CONTROLLED_STUBS 的既有设计一致。
|
|
21
|
+
async function callRerank(query, documents, apiKey) {
|
|
22
|
+
return CONTROLLED_STUBS.rerank ? CONTROLLED_STUBS.rerank(query, documents, apiKey) : rerank(query, documents, apiKey);
|
|
23
|
+
}
|
|
24
|
+
async function callEmbed(texts, apiKey) {
|
|
25
|
+
return CONTROLLED_STUBS.embed ? CONTROLLED_STUBS.embed(texts, apiKey) : embed(texts, apiKey);
|
|
26
|
+
}
|
|
27
|
+
async function callDecide(state, questions, apiKey) {
|
|
28
|
+
return CONTROLLED_STUBS.decide ? CONTROLLED_STUBS.decide(state, questions, apiKey) : decide(state, questions, apiKey);
|
|
29
|
+
}
|
|
30
|
+
async function callJudgeQueryIntent(question, apiKey) {
|
|
31
|
+
return CONTROLLED_STUBS.judgeQueryIntent ? CONTROLLED_STUBS.judgeQueryIntent(question, apiKey) : judgeQueryIntent(question, apiKey);
|
|
32
|
+
}
|
|
33
|
+
|
|
15
34
|
// ---------- 阶段开关(补搜/embedding 去重已实现,默认开启;key 缺失或调用失败一律静默降级为阶段一行为;宽模式已被升级池取代并移除) ----------
|
|
16
35
|
|
|
17
36
|
export const ENABLE_REWRITE = true; // 阶段二:闸门双信号(规则缺口 + decision noul P(yes)<0.6)一致指向不足才补搜一轮
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-free-search",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9",
|
|
4
4
|
"description": "Free web search for DeepSeek Harness: 24 engines (Bing/DuckDuckGo/AnySearch/SearXNG/Exa/Tavily/Keenable/Firecrawl/Parallel keyless; Zhihu global/site via MCP and Perplexity/SerpBase/DeepSeek/You.com/Baidu/Kimi/Aliyun/Doubao with key; OpenAI/Gemini/Claude model built-in search, explicit-only) + auto smart routing + global engine enable/disable & fallback priority + editable zh/en language pools + multi mode (parallel full language-pool merge) + multi_search cross-source tool + failure-aware fallback (quota/auth cooldown, transient retry, fallbackOn) + time filtering + platform search + domain blocklist (blockedDomains) + web_fetch, with web settings UI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|