@fffangchenghao/dsh-web-search 0.24.5 → 0.24.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/CHANGELOG.md +30 -0
- package/README.md +5 -5
- package/README.zh-CN.md +4 -4
- package/client.js +1 -1
- package/docs/comparison.md +1 -1
- package/docs/images/web-tools-demo.svg +1 -1
- package/docs/latency-and-sources.md +1 -1
- package/docs/store-evidence.md +1 -1
- package/lib/cache.d.ts +11 -0
- package/lib/cache.js +11 -1
- package/lib/engines.js +35 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.24.7
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **A pre-aborted search no longer resolves a proxy or starts an engine.** The
|
|
7
|
+
public `search()` entry checks the caller signal before `resolveProxy()`, and
|
|
8
|
+
`runTier()` repeats the guard.
|
|
9
|
+
- **All AnySearch keys resting no longer causes a `TypeError`.** When
|
|
10
|
+
`KeyPool.pick()` returns `undefined`, the engine now falls back to anonymous
|
|
11
|
+
access instead of returning `undefined` into the tier's `.ok` callback.
|
|
12
|
+
- **Search-cache keys include ranking knobs and the AnySearch domain.** Changing
|
|
13
|
+
`rrfConstant`, authority/freshness settings, per-engine weights or
|
|
14
|
+
`anysearchDomain` now produces a new entry instead of reusing results ranked
|
|
15
|
+
for the old configuration.
|
|
16
|
+
- **`wait: "fast"` releases on the first settled engine, even below `limit`.**
|
|
17
|
+
It no longer waits for the soft deadline just because the first answer was
|
|
18
|
+
short.
|
|
19
|
+
|
|
20
|
+
**Test suite: 720 tests across 56 files** (719 pass, 1 skipped).
|
|
21
|
+
|
|
22
|
+
## 0.24.6
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- **A pre-aborted search no longer resolves a proxy or starts an engine.** The
|
|
26
|
+
public `search()` entry checks the caller signal before `resolveProxy()`, and
|
|
27
|
+
`runTier()` repeats the guard so a cancellation arriving at the tier boundary
|
|
28
|
+
cannot dispatch a request. The regression test stubs `fetch` and asserts it is
|
|
29
|
+
never called.
|
|
30
|
+
|
|
31
|
+
**Test suite: 718 tests across 56 files** (717 pass, 1 skipped).
|
|
32
|
+
|
|
3
33
|
## 0.24.5
|
|
4
34
|
|
|
5
35
|
Completed the delayed GPT-6-astra `xhigh` audit batch: tool registration,
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://www.npmjs.com/package/@fffangchenghao/dsh-web-search"><img src="https://img.shields.io/npm/v/@fffangchenghao/dsh-web-search.svg" alt="npm version"></a>
|
|
13
|
-
<img src="https://img.shields.io/badge/tests-
|
|
13
|
+
<img src="https://img.shields.io/badge/tests-720%20tests-brightgreen" alt="tests">
|
|
14
14
|
<img src="https://img.shields.io/badge/engines-8%2C%20zero%20API%20key-brightgreen" alt="engines">
|
|
15
15
|
<img src="https://img.shields.io/badge/node-%3E%3D22.18-blue" alt="node">
|
|
16
16
|
<img src="https://img.shields.io/badge/dsh-%3E%3D0.2.1--rc.2%20%3C0.3.0-blueviolet" alt="dsh">
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
- **Measured in public, including the losses.** A 30-query bilingual comparison records availability, latency, unique domains, official-domain presence and every failure against keyless Firecrawl and anonymous Exa. The follow-up documents the Exa architecture difference, the 3 s CJK budget and the Rust official-source lookup. Exa is faster here; this plugin returns more distinct domains. Both test arms were keyless. The method and raw results are in [docs/comparison.md](docs/comparison.md) and a [public gist](https://gist.github.com/fangchenghao/3db9838fa98928435c1c2df38202c373).
|
|
29
29
|
- **Fetching admits failure.** Binary documents and empty 200 responses are rejected by name (`SEARCH_UNSUPPORTED`, `SEARCH_EMPTY`) instead of being returned as noise; arXiv PDF links are the deliberate exception and are read through the HTML full-text view; the direct → tunnel → render → extract ladder shares one 25 s budget and stops when there is no time left. The budget is per request — there is a regression test for exactly that.
|
|
30
30
|
- **Windows is a first-class host.** Pure ESM, no native addon or install script; the system proxy is discovered from Windows Internet Settings, and the full suite runs on a `windows-latest` CI runner. See [Install on Windows](#windows).
|
|
31
|
-
- **
|
|
31
|
+
- **720 tests across 56 files**, a committed `lib/`, declared `engines.dsh` / `engines.node`, and a [SECURITY.md](SECURITY.md) that lists every process, host and file the plugin touches.
|
|
32
32
|
- **Bilingual documentation.** This README and [中文说明](README.zh-CN.md) are maintained side by side.
|
|
33
33
|
|
|
34
34
|

|
|
@@ -45,7 +45,7 @@ The web-search corner of the DSH plugin ecosystem is crowded. A dated snapshot
|
|
|
45
45
|
| Key-free path | 8 engines, all key-free | ~30-engine free/paid chain | 5 defaults (seam, Exa, DDG, Bing, Jina) | Firecrawl + Keenable keyless defaults | 1 anonymous AnySearch API |
|
|
46
46
|
| Dedicated vertical sources | 34 (8 on by default) | 41 | platform registry, not a vertical catalog | web + X, no vertical catalog | vertical API behind AnySearch |
|
|
47
47
|
| Model-facing tools | 1 (`web_tools`, 8 actions) + 4 MCP tools | ~10 | 2 (`web_index` / `web_call`, 20 actions) | native search/fetch + skill | 5 |
|
|
48
|
-
| Tests | 56 files /
|
|
48
|
+
| Tests | 56 files / 720 cases, locally verified | no test script in `package.json` | 774 unit + 94 bench, self-reported | Vitest configured; count not published | Vitest configured; count not published |
|
|
49
49
|
| GitHub stars | 0 | 620 | 77 | 836 | 663 |
|
|
50
50
|
| npm downloads, last month | 1,087 | 52,436 | 6,420 | 43,151 | 9,251 |
|
|
51
51
|
| npm unpacked size | 1.2 MB | 0.70 MB | 3.05 MB | 0.51 MB | 0.27 MB |
|
|
@@ -56,7 +56,7 @@ read is:
|
|
|
56
56
|
- **Feature depth:** upper-middle. `dsh-free-search` has more engines and
|
|
57
57
|
verticals; `dsh-web-search-pro` has a deeper evidence/ranking pipeline and far
|
|
58
58
|
more platform backends; `modsearch` is the stronger cross-host bridge.
|
|
59
|
-
- **Engineering and verification:** near the top.
|
|
59
|
+
- **Engineering and verification:** near the top. 720 local tests, a replayable
|
|
60
60
|
ranking benchmark, declared security boundaries and one runtime dependency
|
|
61
61
|
put it alongside the best-maintained entries, while remaining much smaller
|
|
62
62
|
than the Playwright-heavy option.
|
|
@@ -65,7 +65,7 @@ read is:
|
|
|
65
65
|
common in the other plugins.
|
|
66
66
|
- **Adoption and maturity:** bottom third of this sample. At the 2026-10-25
|
|
67
67
|
snapshot the repository was four days old, had no stars and little
|
|
68
|
-
independent adoption; the current npm release is 0.24.
|
|
68
|
+
independent adoption; the current npm release is 0.24.7.
|
|
69
69
|
- **Tool-surface economy:** now competitive. 0.20.x exposes one `web_tools`
|
|
70
70
|
entry with eight actions, close to `dsh-web-search-pro`'s two tools with 20
|
|
71
71
|
actions; the legacy eight-name surface remains opt-in for old prompts.
|
package/README.zh-CN.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
<p align="center">
|
|
11
11
|
<a href="https://www.npmjs.com/package/@fffangchenghao/dsh-web-search"><img src="https://img.shields.io/npm/v/@fffangchenghao/dsh-web-search.svg" alt="npm 版本"></a>
|
|
12
|
-
<img src="https://img.shields.io/badge/tests-
|
|
12
|
+
<img src="https://img.shields.io/badge/tests-720%20tests-brightgreen" alt="测试">
|
|
13
13
|
<img src="https://img.shields.io/badge/engines-8%2C%20zero%20API%20key-brightgreen" alt="引擎">
|
|
14
14
|
<img src="https://img.shields.io/badge/node-%3E%3D22.18-blue" alt="node">
|
|
15
15
|
<img src="https://img.shields.io/badge/dsh-%3E%3D0.2.1--rc.2%20%3C0.3.0-blueviolet" alt="dsh">
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
- **公开测量,也公开输的地方。** 30 条中英查询对比记录可用性、延迟、独立域名、官方域名命中与每一条失败;对比对象是免 key Firecrawl 和匿名 Exa。这里 Exa 更快,本插件返回的独立域名更多;两条对比路径都未使用 key。方法和原始结果在 [docs/comparison.md](docs/comparison.md);Exa 架构差异、中文 3 秒预算和 Rust 官方源见 [延迟与官方源](docs/latency-and-sources.md)。
|
|
28
28
|
- **抓取会承认失败。** 二进制文档和「200 但正文为空」会被明确拒绝(`SEARCH_UNSUPPORTED`、`SEARCH_EMPTY`),而不是当噪音返回;arXiv 的 PDF 链接是有意保留的例外,会改读 HTML 全文;direct → tunnel → render → extract 四级阶梯共享 25 秒预算,预算不足就不再起新的一级。预算是「每次请求」而不是「插件启动时」,这点有回归测试守着。
|
|
29
29
|
- **Windows 是一等宿主。** 纯 ESM,没有原生扩展或安装脚本;会自动读取 Windows 的 Internet 设置代理,完整测试套件也在 `windows-latest` CI 上跑通。安装见[Windows 小节](#windows)。
|
|
30
|
-
- **56 个测试文件、
|
|
30
|
+
- **56 个测试文件、720 个用例**,`lib/` 产物入库,声明了 `engines.dsh` / `engines.node`,[SECURITY.md](SECURITY.md) 逐项列出插件会碰的进程、主机和文件。
|
|
31
31
|
- **双语文档。** 本文件和 [English README](README.md) 同步维护。
|
|
32
32
|
|
|
33
33
|

|
|
@@ -54,11 +54,11 @@ DSH 插件生态里的「联网搜索」已经很挤。下面是一张 2026-10-2
|
|
|
54
54
|
- **功能深度:中上。** `dsh-free-search` 引擎和垂直源更多;
|
|
55
55
|
`dsh-web-search-pro` 的证据/排序管线和平台后端更深;`modsearch` 的跨宿主
|
|
56
56
|
能力更强。
|
|
57
|
-
- **工程质量与可验证性:接近第一梯队。**
|
|
57
|
+
- **工程质量与可验证性:接近第一梯队。** 720 个本地测试、可重放的排序基准、
|
|
58
58
|
明确的安全边界、只有 1 个运行时依赖,同时体积远小于 Playwright 重型方案。
|
|
59
59
|
- **免 key + 官方源纠错:最强卖点。** Chrome、PostgreSQL、AI Act 的官方路径
|
|
60
60
|
和 34 个垂直源,不是其他插件普遍具备的。
|
|
61
|
-
- **采用度与成熟度:这个样本里的后段。** 2026-10-25 快照时 GitHub 仓库刚创建 4 天、0 stars,还缺少独立采用;当前 npm 版本是 0.24.
|
|
61
|
+
- **采用度与成熟度:这个样本里的后段。** 2026-10-25 快照时 GitHub 仓库刚创建 4 天、0 stars,还缺少独立采用;当前 npm 版本是 0.24.7。
|
|
62
62
|
- **工具面的经济性:现在有竞争力。** 0.20.x 只暴露一个 `web_tools` + 8 个
|
|
63
63
|
action,接近 `dsh-web-search-pro` 的 2 工具 + 20 动作;旧的八个工具名保留为
|
|
64
64
|
可选兼容模式。
|
package/client.js
CHANGED
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
var ENTRY = 'web-search-bing';
|
|
75
75
|
var PACKAGE_NAME = 'dsh-web-search-bing';
|
|
76
76
|
/** Keep in step with package.json; compared with the npm registry. */
|
|
77
|
-
var VERSION = '0.24.
|
|
77
|
+
var VERSION = '0.24.7';
|
|
78
78
|
/** Snapshot used while no configuration service is reachable. */
|
|
79
79
|
var EMPTY_STATE = { status: 'unavailable', value: undefined, base: undefined, user: undefined, revision: undefined, writable: false };
|
|
80
80
|
|
package/docs/comparison.md
CHANGED
|
@@ -6,7 +6,7 @@ whether a provider answers at all, how long it takes, how many distinct domains
|
|
|
6
6
|
it returns, and whether a page on a known official domain appears in the top 8.
|
|
7
7
|
The failures are part of the result.
|
|
8
8
|
|
|
9
|
-
> **Version note (2026-11-02):** 0.24.0 added Windows system-proxy discovery, and 0.24.1 and 0.24.2 are documentation/metadata patches; 0.24.3–0.24.
|
|
9
|
+
> **Version note (2026-11-02):** 0.24.0 added Windows system-proxy discovery, and 0.24.1 and 0.24.2 are documentation/metadata patches; 0.24.3–0.24.7 fix fetch/proxy/markdown/cache/tool reliability without changing the measured search path. These patches do not change the search, ranking or source-adapter path measured below, so the 0.23.0 numbers remain the latest comparison.
|
|
10
10
|
|
|
11
11
|
## Method
|
|
12
12
|
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
<rect x="70" y="620" width="330" height="76" rx="14" fill="#101d31" stroke="#26364f"/>
|
|
53
53
|
<text x="92" y="651" class="m" font-size="13">Engines</text><text x="92" y="677" class="t" font-size="20" font-weight="700">8 key-free paths</text>
|
|
54
54
|
<rect x="420" y="620" width="330" height="76" rx="14" fill="#101d31" stroke="#26364f"/>
|
|
55
|
-
<text x="442" y="651" class="m" font-size="13">Tests</text><text x="442" y="677" class="t" font-size="20" font-weight="700">
|
|
55
|
+
<text x="442" y="651" class="m" font-size="13">Tests</text><text x="442" y="677" class="t" font-size="20" font-weight="700">720 local cases</text>
|
|
56
56
|
<rect x="770" y="620" width="360" height="76" rx="14" fill="#101d31" stroke="#26364f"/>
|
|
57
57
|
<text x="792" y="651" class="m" font-size="13">Cross-agent</text><text x="792" y="677" class="t" font-size="20" font-weight="700">MCP stdio server</text>
|
|
58
58
|
</g>
|
|
@@ -6,7 +6,7 @@ This note answers three questions from the public 30-query comparison:
|
|
|
6
6
|
2. Can the AnySearch tail and the Chinese Rust miss be fixed?
|
|
7
7
|
3. Does the fix require a vector database or a different retrieval model?
|
|
8
8
|
|
|
9
|
-
> **Version note (2026-11-02):** 0.24.0 added Windows system-proxy discovery, and 0.24.1 and 0.24.2 are documentation/metadata patches; 0.24.3–0.24.
|
|
9
|
+
> **Version note (2026-11-02):** 0.24.0 added Windows system-proxy discovery, and 0.24.1 and 0.24.2 are documentation/metadata patches; 0.24.3–0.24.7 fix fetch/proxy/markdown/cache/tool reliability without changing the measured search path. The search path is unchanged, so these 0.23.0 measurements still describe 0.24.x.
|
|
10
10
|
|
|
11
11
|
The short answer: Exa is a different architecture, not a faster RRF loop. This
|
|
12
12
|
plugin can borrow tail-tolerance and source-specific facts, but copying Exa's
|
package/docs/store-evidence.md
CHANGED
|
@@ -29,7 +29,7 @@ Only `0.2.1-rc.2` is declared, because that is the version actually exercised.
|
|
|
29
29
|
`mktemp -d`; the real `~/.dsh` was never written to. Bundled pnpm 11.28.5.
|
|
30
30
|
- **Windows CI:** GitHub Actions `windows-latest`, Node 24. Install, typecheck,
|
|
31
31
|
the full test suite, build and the entry-point import all pass. Run:
|
|
32
|
-
https://github.com/fangchenghao/dsh-web-search/actions/runs/
|
|
32
|
+
https://github.com/fangchenghao/dsh-web-search/actions/runs/44274476452
|
|
33
33
|
(the matrix also runs on macOS and Ubuntu). This is a CI environment, not a
|
|
34
34
|
claim about every Windows terminal or proxy client.
|
|
35
35
|
|
package/lib/cache.d.ts
CHANGED
|
@@ -50,6 +50,17 @@ export interface CacheKeyParts {
|
|
|
50
50
|
fallbackOn?: readonly string[];
|
|
51
51
|
/** Domain blocklist; omitted and an empty list share a key. */
|
|
52
52
|
blockedDomains?: readonly string[];
|
|
53
|
+
/** Ranking knobs that affect the fused order; omitted means defaults. */
|
|
54
|
+
rank?: {
|
|
55
|
+
rrfConstant?: number;
|
|
56
|
+
authorityDomains?: readonly string[];
|
|
57
|
+
authorityBoost?: number;
|
|
58
|
+
freshnessBoost?: number;
|
|
59
|
+
freshnessDays?: number;
|
|
60
|
+
weights?: readonly number[];
|
|
61
|
+
};
|
|
62
|
+
/** AnySearch vertical domain; it selects a different result set. */
|
|
63
|
+
anysearchDomain?: string;
|
|
53
64
|
}
|
|
54
65
|
/**
|
|
55
66
|
* Build the cache key for one search request.
|
package/lib/cache.js
CHANGED
|
@@ -26,8 +26,16 @@ export function cacheKey(parts) {
|
|
|
26
26
|
// A JSON tuple is unambiguous and keeps every optional value in its own
|
|
27
27
|
// slot. The old delimiter join let `safeSearch: 'off'` + a query containing
|
|
28
28
|
// `safe=strict|` collide with `safeSearch: 'strict'` + a shorter query.
|
|
29
|
+
const rank = parts.rank === undefined ? null : {
|
|
30
|
+
rrfConstant: parts.rank.rrfConstant ?? null,
|
|
31
|
+
authorityDomains: [...(parts.rank.authorityDomains ?? [])].sort(),
|
|
32
|
+
authorityBoost: parts.rank.authorityBoost ?? null,
|
|
33
|
+
freshnessBoost: parts.rank.freshnessBoost ?? null,
|
|
34
|
+
freshnessDays: parts.rank.freshnessDays ?? null,
|
|
35
|
+
weights: parts.rank.weights === undefined ? null : [...parts.rank.weights],
|
|
36
|
+
};
|
|
29
37
|
return JSON.stringify([
|
|
30
|
-
'
|
|
38
|
+
'v3',
|
|
31
39
|
parts.lead,
|
|
32
40
|
parts.wait,
|
|
33
41
|
parts.limit,
|
|
@@ -36,6 +44,8 @@ export function cacheKey(parts) {
|
|
|
36
44
|
parts.safeSearch === undefined || parts.safeSearch === 'off' ? null : parts.safeSearch,
|
|
37
45
|
parts.fallbackOn === undefined ? null : [...parts.fallbackOn].sort(),
|
|
38
46
|
parts.blockedDomains === undefined || parts.blockedDomains.length === 0 ? null : [...parts.blockedDomains].sort(),
|
|
47
|
+
rank,
|
|
48
|
+
parts.anysearchDomain === undefined || parts.anysearchDomain.length === 0 ? null : parts.anysearchDomain,
|
|
39
49
|
query,
|
|
40
50
|
]);
|
|
41
51
|
}
|
package/lib/engines.js
CHANGED
|
@@ -288,6 +288,12 @@ async function searchHostWithKeys(host, query, signal, timeoutMs, proxy, timeRan
|
|
|
288
288
|
}
|
|
289
289
|
let key = pool.pick();
|
|
290
290
|
let last;
|
|
291
|
+
if (key === undefined) {
|
|
292
|
+
// All configured keys are resting. Fall back to anonymous access instead
|
|
293
|
+
// of returning `undefined` (which made the tier callback read `.ok` of
|
|
294
|
+
// undefined and throw a TypeError).
|
|
295
|
+
return searchHost(host, query, signal, timeoutMs, proxy, timeRange, safeSearch, health);
|
|
296
|
+
}
|
|
291
297
|
for (let attempt = 0; attempt < 2 && key !== undefined; attempt += 1) {
|
|
292
298
|
const configured = resolveHost(host, {
|
|
293
299
|
anysearchApiKey: key,
|
|
@@ -326,6 +332,10 @@ async function runTier(hosts, query, signal, timeoutMs, failures, failureDetails
|
|
|
326
332
|
const counters = limits.lead === 'all' || !hosts.some((host) => leadsQuery(host, limits.lead))
|
|
327
333
|
? () => true
|
|
328
334
|
: (host) => leadsQuery(host, limits.lead);
|
|
335
|
+
if (isAborted(signal)) {
|
|
336
|
+
const reason = signal?.reason;
|
|
337
|
+
throw reason instanceof Error ? reason : new SearchError('web search was cancelled', 'SEARCH_ABORTED', false);
|
|
338
|
+
}
|
|
329
339
|
const controller = new AbortController();
|
|
330
340
|
const relayAbort = () => controller.abort();
|
|
331
341
|
signal?.addEventListener('abort', relayAbort, { once: true });
|
|
@@ -348,6 +358,7 @@ async function runTier(hosts, query, signal, timeoutMs, failures, failureDetails
|
|
|
348
358
|
// the soft deadline.
|
|
349
359
|
const leadSettled = () => outcomes.filter((outcome, index) => counters(hosts[index]) && outcome !== undefined).length >= leadTotal;
|
|
350
360
|
const done = () => answered().length === hosts.length ||
|
|
361
|
+
(limits.fast && answered().length > 0) ||
|
|
351
362
|
leadSettled() ||
|
|
352
363
|
tierReleaseReady(available(), contributors(), limits.limit, needed);
|
|
353
364
|
let releasedEarly = false;
|
|
@@ -418,6 +429,10 @@ async function runTier(hosts, query, signal, timeoutMs, failures, failureDetails
|
|
|
418
429
|
}
|
|
419
430
|
return answers;
|
|
420
431
|
}
|
|
432
|
+
/** Read an abort flag without TypeScript assuming it cannot change after a throw. */
|
|
433
|
+
function isAborted(signal) {
|
|
434
|
+
return signal !== undefined && signal.aborted;
|
|
435
|
+
}
|
|
421
436
|
/**
|
|
422
437
|
* Search the web with every configured engine and fuse the answers.
|
|
423
438
|
* @param query - the user query.
|
|
@@ -470,6 +485,8 @@ export async function search(query, signal, options) {
|
|
|
470
485
|
if (typeof query !== 'string' || query.trim().length === 0) {
|
|
471
486
|
throw new SearchError('the search query is empty', 'SEARCH_INVALID', false);
|
|
472
487
|
}
|
|
488
|
+
if (isAborted(signal))
|
|
489
|
+
throw new SearchError('web search was cancelled', 'SEARCH_ABORTED', false);
|
|
473
490
|
const limit = Math.max(1, Math.min(options.limit, 20));
|
|
474
491
|
const timeoutMs = options.timeoutMs ?? 15000;
|
|
475
492
|
const wait = options.wait ?? 'auto';
|
|
@@ -513,7 +530,14 @@ export async function search(query, signal, options) {
|
|
|
513
530
|
// for the full soft deadline. `all` still asks for every engine, and `fast`
|
|
514
531
|
// keeps its first-answer behavior.
|
|
515
532
|
const needed = wait === 'all' ? usable.length : wait === 'fast' ? 1 : Math.min(2, usable.length);
|
|
516
|
-
const limits = {
|
|
533
|
+
const limits = {
|
|
534
|
+
limit,
|
|
535
|
+
softMs,
|
|
536
|
+
needed,
|
|
537
|
+
fast: wait === 'fast',
|
|
538
|
+
lead: wait === 'all' ? 'all' : lead,
|
|
539
|
+
timeRange,
|
|
540
|
+
};
|
|
517
541
|
// Ranking does not drop rows; the engine layer does. `timeRange` is passed
|
|
518
542
|
// into the rank options only so undated rows are scored lower while a window
|
|
519
543
|
// is active. Keeping it out of the configured `rank` object preserves the
|
|
@@ -548,6 +572,15 @@ export async function search(query, signal, options) {
|
|
|
548
572
|
...(safeSearch === 'off' ? {} : { safeSearch }),
|
|
549
573
|
...(fallbackOn === undefined || fallbackOn.length === FAILURE_KINDS.length ? {} : { fallbackOn }),
|
|
550
574
|
...(blocked.length === 0 ? {} : { blockedDomains: blocked }),
|
|
575
|
+
rank: {
|
|
576
|
+
...(rank.rrfConstant === undefined ? {} : { rrfConstant: rank.rrfConstant }),
|
|
577
|
+
...(rank.authorityDomains === undefined ? {} : { authorityDomains: rank.authorityDomains }),
|
|
578
|
+
...(rank.authorityBoost === undefined ? {} : { authorityBoost: rank.authorityBoost }),
|
|
579
|
+
...(rank.freshnessBoost === undefined ? {} : { freshnessBoost: rank.freshnessBoost }),
|
|
580
|
+
...(rank.freshnessDays === undefined ? {} : { freshnessDays: rank.freshnessDays }),
|
|
581
|
+
...(rank.weights === undefined ? {} : { weights: rank.weights }),
|
|
582
|
+
},
|
|
583
|
+
...(anysearchDomain.length === 0 ? {} : { anysearchDomain }),
|
|
551
584
|
});
|
|
552
585
|
const cached = key === undefined ? undefined : options.cache?.get(key);
|
|
553
586
|
const cachedSources = cached === undefined ? undefined : removeBlocked(cached, blocked);
|
|
@@ -590,7 +623,7 @@ export async function search(query, signal, options) {
|
|
|
590
623
|
note = `fallback skipped: ${blockedKind} is not enabled in fallbackOn.`;
|
|
591
624
|
}
|
|
592
625
|
}
|
|
593
|
-
if (signal
|
|
626
|
+
if (isAborted(signal))
|
|
594
627
|
throw new SearchError('web search was cancelled', 'SEARCH_ABORTED', false);
|
|
595
628
|
sources = removeBlocked(sources, blocked);
|
|
596
629
|
if (key !== undefined && sources.length > 0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fffangchenghao/dsh-web-search",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.7",
|
|
4
4
|
"description": "DSH bundle: key-free web search, page fetch and research for DeepSeek Harness; eight engines fused with RRF, 34 vertical sources, arXiv, Windows/macOS system-proxy support and a dependency-free MCP server.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|