@wenaixi/searchfuse 0.0.0-stage → 0.1.2
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 +287 -0
- package/LICENSE +21 -0
- package/README.md +161 -2
- package/README.zh-CN.md +162 -0
- package/SECURITY.md +54 -0
- package/claude/.claude-plugin/plugin.json +17 -0
- package/claude/SKILL.md +53 -0
- package/claude/hooks/hooks.json +3 -0
- package/claude/hooks/register.ts +624 -0
- package/cordis.patch.yml +16 -0
- package/dist/config-schema.js +40 -0
- package/dist/errorCause-BY0A0XKN.js +17 -0
- package/dist/kernel.js +73 -0
- package/dist/main.js +1414 -0
- package/dist/mcp-protocol.js +1 -0
- package/dist/mcp-registry.js +155 -0
- package/dist/protocol-ClnjMnGV.js +259 -0
- package/dist/proxy-DodOSGiI.js +50 -0
- package/dist/search-DeT416xs.js +4173 -0
- package/dist/serve-ensure.js +1 -0
- package/dist/serveEnsure-BTj9IifL.js +632 -0
- package/dsh/client.js +2917 -0
- package/dsh/fetch-schema.json +1 -0
- package/dsh/index.js +2774 -0
- package/dsh/search-schema.json +65 -0
- package/dsh/spawnHidden.d.ts +7 -0
- package/dsh/spawnHidden.js +8 -0
- package/omp/extension.ts +565 -0
- package/omp/host-types.d.ts +47 -0
- package/omp/tsconfig.json +13 -0
- package/package.json +91 -4
- package/skills/searchfuse/SKILL.md +139 -0
- package/skills/searchfuse/references/cli.md +78 -0
- package/skills/searchfuse/references/configure.md +407 -0
- package/skills/searchfuse/references/output-schema.md +182 -0
- package/skills/searchfuse/references/runtime.md +58 -0
- package/skills/searchfuse/scripts/run.ps1 +279 -0
- package/skills/searchfuse/scripts/run.sh +315 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
版本号从 0.1.0 重新起算。此前那轮 2.x–5.x 的开发记录仍在 git 历史里,但不再
|
|
9
|
+
作为发布线的一部分:它是同一个产品的多轮重写,不是 0.1.0 之前的版本。本文件
|
|
10
|
+
从这一版起重新记账。
|
|
11
|
+
|
|
12
|
+
## [Unreleased]
|
|
13
|
+
|
|
14
|
+
暂无。
|
|
15
|
+
|
|
16
|
+
## [0.1.2] - 2026-11-28
|
|
17
|
+
|
|
18
|
+
这一版只做一件事:**让冷却机制在生产路径上真的工作,并补齐 omp 那一端**。
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- **omp 扩展没有候选端口探测。** 删掉 `runtime.json` 后(服务被 kill 时
|
|
23
|
+
`close()` 跑不到),omp 的 `readServeRuntime` 直接返回 undefined,会认为服务
|
|
24
|
+
不在,白等 15 秒再报不可用。主包、dsh、claude 三端在 0.1.1 都有候选探测,
|
|
25
|
+
只有这一端漏了——CHANGELOG 里「三端都能找回」的说法对它不成立。现已内联
|
|
26
|
+
同一套身份算法,`tryServe` 与 `healthOnce` 都改走 `locateServeRuntime`。
|
|
27
|
+
实测:删文件后用真实 `omp -p` 搜索,13 条结果,仍只有 1 个实例。
|
|
28
|
+
- **冷却控制器从未传入三端的真实链路。** `src/kernel.ts`(dsh / claude hook /
|
|
29
|
+
omp 扩展全部走它)与 `src/serve.ts` 的三个端点都没传 `cooldown`,只有 CLI 的
|
|
30
|
+
`searchfuse search` 传了——而三端没有一个走那条路。结果是 `state.json`
|
|
31
|
+
永远是空的,被额度耗尽的引擎每次运行都被重新撞一遍墙。三个端点里
|
|
32
|
+
`/v1/read-page` 是最晚被发现的:修前两个时漏了它,而 omp 的 `read_page`
|
|
33
|
+
走的正是这条。
|
|
34
|
+
- **融合模式只读冷却、从不写。** 即使控制器传进去了,默认的 `rrf` 模式下
|
|
35
|
+
`record`/`clear` 也只挂在链式路径上。`FanoutResult` 现在带 `outcomes`
|
|
36
|
+
(保留原始 `Error` 对象,而不只是格式化后的字符串),融合路径据此记冷却;
|
|
37
|
+
全灭时 `fanout` 抛出的 error 上也挂着 `outcomes`,那正是最该记的情况。
|
|
38
|
+
- **多密钥引擎在融合模式下会一直用那把已耗尽的 key。** 所有 HTTP provider 只读
|
|
39
|
+
`splitApiKeys(apiKey)[0]`,而密钥轮换只发生在链式路径。链式把 key1 记成冷却
|
|
40
|
+
后,下一次融合运行仍拿它去打同一堵墙。现在融合组目标时把健康的 key 排到首位,
|
|
41
|
+
不必改任何 provider。
|
|
42
|
+
- **429 携带额度原因时被当成瞬时限流。** firecrawl 的免注册额度用完回 429,
|
|
43
|
+
正文写着 `"reason":"credits"` 与 `"retry_after_seconds":66233`——那是花光的
|
|
44
|
+
预算,不是每秒一次的抖动。`classifyQuota` 早先只看 `/429/` 就返回 null,
|
|
45
|
+
而 `retry_after_seconds` 这个权威恢复时间全仓库没人读。现在认这类 JSON
|
|
46
|
+
字段,恢复时间按 `retry_after_seconds` → `Resets in 94h19m9s` → 兜底 TTL
|
|
47
|
+
的精度顺序取。
|
|
48
|
+
- **额度码的复合形态被判漏。** 判定「额度类」的正则早先写 `credits?\b`,
|
|
49
|
+
但 JS 正则里 `_` 属于 `\w`,`_` 与字母之间**不构成词边界**,于是
|
|
50
|
+
`"reason":"credits_exhausted"`、`credits_depleted` 这种最常见形状全部漏判;
|
|
51
|
+
连字符形态 `daily-limit` 也漏(`[_-]?` 只允许下划线)。漏判的后果是每次运行
|
|
52
|
+
都重新撞一次墙。现在改成显式后跟断言 `credits(?=["_]|$)`,并接受连字符。
|
|
53
|
+
- **瞬时限流码被误判成额度。** 同一个正则里独立成词的 `limit_reached` 会命中
|
|
54
|
+
`rate_limit_reached` / `requests_limit_reached` 这类极常见的限流码,把一秒钟的
|
|
55
|
+
抖动记成 45 分钟冷却——正是这段逻辑声明要避免的反向错误。现在 `limit` 必须
|
|
56
|
+
带 `usage`/`daily`/`monthly`/`plan`/`billing` 这类表示配额的前缀。
|
|
57
|
+
- **外部可控的秒数能让冷却记录抛 RangeError。** `"retry_after_seconds":99999999999999`
|
|
58
|
+
会算出 Invalid Date,而 Date 对象永远 truthy,`if (!until)` 拦不住,调用方
|
|
59
|
+
`toISOString()` 抛出并**替换掉原本的引擎失败原因**。现在验证结果日期有效,
|
|
60
|
+
并在记录侧包一层兜底。
|
|
61
|
+
- **`claude/.claude-plugin/plugin.json` 的版本号不在盖章表里。** 0.1.1 发版后
|
|
62
|
+
`searchfuse --version` 报 0.1.1,而宿主里显示的仍是 0.1.0。已纳入
|
|
63
|
+
`stampTargets`。
|
|
64
|
+
|
|
65
|
+
### Changed
|
|
66
|
+
|
|
67
|
+
- **成功引擎只在确实有冷却记录时才清状态。** `clearEngineCooldown` 无条件读盘
|
|
68
|
+
(写被短路,读不会),融合模式下每个成功引擎触发一次,六个引擎就是每请求
|
|
69
|
+
六次读盘,而绝大多数时候是空操作。
|
|
70
|
+
|
|
71
|
+
## [0.1.1] - 2026-11-27
|
|
72
|
+
|
|
73
|
+
这一版只做一件事:**服务定位不再依赖一个会消失的文件**。
|
|
74
|
+
|
|
75
|
+
### Fixed
|
|
76
|
+
|
|
77
|
+
- **`runtime.json` 消失后三端全部失联(僵尸态)。** 该文件曾是服务身份的唯一
|
|
78
|
+
凭证,而它在 `close()` 里被删除;进程被信号杀掉或崩溃时 `close` 跑不到,于是
|
|
79
|
+
出现「服务还在听、文件已经没了」的状态。实测 PID 27056 监听 64683(**旧机制
|
|
80
|
+
下的观测值**:那时端口由内核随机分配)而 `runtime.json` 不存在,三端读不到
|
|
81
|
+
端口,全部退回 spawn 慢路径。
|
|
82
|
+
- **并发 `serve --ensure` 的进程雪崩。** `serve.port` 默认 0(内核随机挑端口),
|
|
83
|
+
并发的多个实例各绑各的端口、全部成功、全部常驻,谁最后写 `runtime.json` 谁赢,
|
|
84
|
+
其余成为占坑的孤儿。
|
|
85
|
+
- **先退出的实例会删掉后退出的那个的文件。** `close()` 原先无条件 `rmSync`,
|
|
86
|
+
服务 A 关闭时把服务 B 写下的 `runtime.json` 一并删掉,B 瞬间变瞎。
|
|
87
|
+
- **5xx 错误正文被吞。** dsh 的 `tryServe` 早先「先探 `/healthz` 再返回」,
|
|
88
|
+
服务活着但健康检查恰好不通时被判成「服务不存在」,于是回退 spawn kernel,
|
|
89
|
+
服务端 5xx 正文里逐引擎的尝试轨迹就此消失,用户看到「不可达」而非真实原因。
|
|
90
|
+
|
|
91
|
+
### Added
|
|
92
|
+
|
|
93
|
+
- **目录指纹与确定性候选端口。** 指纹是 `sha256(realpath(~/.searchfuse).toLowerCase())`
|
|
94
|
+
的前 8 位,归一化消除尾斜杠、`.` 段与大小写差异。候选端口从
|
|
95
|
+
`42000 + (指纹 % 2000)` 起连续 8 个,同一份状态目录必然得到同一组。
|
|
96
|
+
服务按候选顺序找第一个能绑的,被占则顺延,全部被占才报错。
|
|
97
|
+
- **`GET /identity` 端点。** 返回 `{port, pid, fingerprint, version}`,免鉴权、
|
|
98
|
+
不泄露 token。客户端按候选端口逐个探测,**必须比对指纹**才认——只看 `/healthz`
|
|
99
|
+
200 会把恰好占着那个端口的别的程序认成自己的服务,然后把 token 发给它。
|
|
100
|
+
- **两级服务定位。** `runtime.json` 降级为缓存:文件在且形状合法就直接用;
|
|
101
|
+
文件不在才走候选探测。三端(CLI / dsh / Claude Code)同一套判定。
|
|
102
|
+
- **`hosts sync` 把身份写进 Claude settings。** mod 的沙箱里既没有 `process`
|
|
103
|
+
也没有 `crypto`,算不了指纹,只能拿 CLI 预先算好的 `fingerprint` 与 `ports`。
|
|
104
|
+
|
|
105
|
+
### Changed
|
|
106
|
+
|
|
107
|
+
- **`/healthz` 的 body 保持纯文本 `OK`。** 四个现存消费者都只看状态码,
|
|
108
|
+
把 body 换成 JSON 是无谓的破坏性变更;身份校验走独立的 `/identity`。
|
|
109
|
+
- **`typecheck` 接上 `omp/tsconfig.json` 与 `claude/tsconfig.json`。**
|
|
110
|
+
此前这两份从来不在 CI 里跑,「四道类型门禁」实际只有两道在跑。
|
|
111
|
+
|
|
112
|
+
### Tests
|
|
113
|
+
|
|
114
|
+
- 新增 `src/serveIdentity.test.ts`(6 条):确定性、归一化、候选范围与连续性。
|
|
115
|
+
- 新增 `src/serveIdentity.postcondition.test.ts`(8 条):用真实 HTTP 服务
|
|
116
|
+
钉住核心承诺——文件删掉后靠指纹找回服务、`ensureServeRunning` 不另起实例、
|
|
117
|
+
陌生服务占着候选端口不会被误认、`/identity` 与目录推导一致、候选被占时顺延。
|
|
118
|
+
- 新增 `src/serveIdentity.parity.test.ts`(4 条):锁住三份拷贝一致。任何一份
|
|
119
|
+
漂移都会造成「服务绑一个端口、客户端去探另一个」,症状与「服务没起来」
|
|
120
|
+
一模一样,是最难查的一类故障。
|
|
121
|
+
- 反向验证:破坏指纹校验 → 「陌生服务」那条变红;去掉候选探测层 →
|
|
122
|
+
「不另起实例」那条变红。两条都亲眼看到变红再恢复。
|
|
123
|
+
|
|
124
|
+
三项实测的端到端结果:
|
|
125
|
+
|
|
126
|
+
1. **服务绑在候选段内。** 本机指纹 `21fe1ece` → 候选 `42158..42165`,服务实际绑
|
|
127
|
+
42158,`runtime.json` 与 `/identity` 报出的指纹与推导值一致。
|
|
128
|
+
2. **文件消失后三端都能找回。** 删掉 `runtime.json` 后:CLI / serveEnsure 在
|
|
129
|
+
42158 认出指纹;dsh 的 `locateServeRuntime` 走候选探测,真实搜到 28 条结果
|
|
130
|
+
(内容 809 字符);Claude Code 从 settings 里的 `ports` 逐个探测。
|
|
131
|
+
3. **并发不雪崩。** 6 个进程同时跑 `serve --ensure`:1 个起服务、5 个报
|
|
132
|
+
「Already running」退出,候选段内只有 1 个 LISTENING。
|
|
133
|
+
4. **删掉 runtime.json 后再 ensure 不起第二个。** 这是审查员实证击穿的那条:
|
|
134
|
+
修复前 A 活 42800 → 删文件 → B 起在 42801 → 两个都在听。修复后报
|
|
135
|
+
「Already running on 42158」,监听数始终为 1。
|
|
136
|
+
|
|
137
|
+
### 审查后补齐(第二轮)
|
|
138
|
+
|
|
139
|
+
两轮独立审查(代码审查 + 测试守护力)之后补的:
|
|
140
|
+
|
|
141
|
+
- **`serve --ensure` 接上候选探测**(阻断级)。它是唯一真正起服务的入口,
|
|
142
|
+
早先只信 `runtime.json`,文件一消失就在下一个候选上起第二个实例。判据
|
|
143
|
+
抽成 `findRunningServe`,CLI 与插件侧共用同一个函数。
|
|
144
|
+
- **指纹改用 `realpathSync`**。junction 与它指向的目标现在算出同一个指纹。
|
|
145
|
+
Windows 的 8.3 短名(`C:\Users\ADMINI~1`)仍不会被展开——实测确认,
|
|
146
|
+
`os.homedir()` 正常返回长名时碰不到,文档已如实写明这个限制。
|
|
147
|
+
- **`syncClaudeSettings` 的早退判据**从「只比 enabled」改成「所有要写的字段
|
|
148
|
+
都比」。升级用户的旧 settings 没有 fingerprint/ports,只看 enabled 会早退,
|
|
149
|
+
新字段永远写不进去。
|
|
150
|
+
- **omp 与 claude 的 `runtime.json` 形状检查**补齐 `Number.isInteger` 校验,
|
|
151
|
+
与 `serveEnsure` / `main.ts` 逐条一致。
|
|
152
|
+
- **`__APP_VERSION__` 只守卫一次**、`/identity` 与 runtime.json 写入共用。
|
|
153
|
+
早先裸跑时服务能起、`/identity` 能答,但 runtime.json 永远写不出。
|
|
154
|
+
- **`parity` 测试改成抽取 dsh 真身函数体求值**。先前从源码抓数字再自己重建,
|
|
155
|
+
常量对得上但归一化/取模/截断任一漂移时全量测试零红——实测把 dsh 的
|
|
156
|
+
`.toLowerCase()` 删掉,838 条一条不红。现在三条反向验证都能变红
|
|
157
|
+
(去掉 toLowerCase → 4 红、取模 2000→2001 → 2 红、截断 8→6 → 3 红)。
|
|
158
|
+
- **候选端口遇 `EACCES` 也换下一个**(不只是 `EADDRINUSE`);`listening`
|
|
159
|
+
改 `once`,避免候选重试时重复写 runtime.json。
|
|
160
|
+
- **候选模式下的实例收敛**:启动成功后检查前序候选,有同指纹服务就让位退出。
|
|
161
|
+
- **锁等待超时的错误文案**区分「持锁者还在跑」与「持锁者已死」两种真相。
|
|
162
|
+
- 删掉 `candidatePorts` 里永不触发的 `<= 65535` 守卫(它让函数可能返回少于
|
|
163
|
+
8 个元素,与契约矛盾);`serve.ts` 两处「固定端口」过时注释改成候选语义。
|
|
164
|
+
|
|
165
|
+
<!-- 0.1.0 的完整记录见下 -->
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
<!-- 0.1.0 的完整记录见下 -->
|
|
169
|
+
|
|
170
|
+
## [0.1.0] - 2026-11-26
|
|
171
|
+
|
|
172
|
+
首个正式版本。searchfuse 是一个给模型用的联网搜索插件:把搜索查询变成带来源
|
|
173
|
+
的结构化证据,并把这套能力同时以 CLI、技能和 dsh 插件三种形态交付。
|
|
174
|
+
|
|
175
|
+
### Added
|
|
176
|
+
|
|
177
|
+
- **融合搜索。** `web_search` 默认并发询问每个可达引擎,用倒数排名融合
|
|
178
|
+
(`score = Σ 1/(60 + 名次)`)合并它们的排序列表,而不是逐个回退。一个被两个
|
|
179
|
+
引擎分别排在第一和第三的页面,得分高于只有一个引擎喜欢的页面。可用
|
|
180
|
+
`aggregate.mode chain` 退回旧的串行行为。
|
|
181
|
+
- **结果去重与佐证。** 合并前按规范化 URL 归一:去掉片段标识与追踪参数
|
|
182
|
+
(`utm_*`、`fbclid`、`gclid`、`mc_cid`、`mc_eid`、`ref`、`source`、`spm`),
|
|
183
|
+
剩余参数排序,host 小写,去掉默认端口与非根路径的尾斜杠。`www.` 前缀与路径
|
|
184
|
+
大小写刻意保留,因为合并它们会悄悄丢掉一个真实的第二来源。融合后的条目带
|
|
185
|
+
`score` 与 `foundIn`,读者据此能分辨多源共识与单一引擎的看法。
|
|
186
|
+
- **十个搜索与抓取引擎。** 搜索链固定为 Firecrawl、Keenable、AnySearch、
|
|
187
|
+
You.com、SearXNG、Antigravity CLI、Tavily、Exa;抓取链是 Firecrawl、
|
|
188
|
+
Antigravity CLI、`local`;Grok 覆盖 X 语料。前五台免注册或免 key:Firecrawl、
|
|
189
|
+
Keenable、AnySearch、You.com 各有自己的免注册额度,SearXNG 默认用随包实例
|
|
190
|
+
(它自己的七十多个上游引擎经一个适配器进来)。Tavily、Exa 各带免费月度额度,
|
|
191
|
+
Antigravity CLI 靠浏览器登录并合成答案(默认关闭,因为它慢到超出融合预算)。
|
|
192
|
+
AnySearch 可配 `ANYSEARCH_API_KEY` 提升额度;带 key 的请求被 401/403 拒绝时
|
|
193
|
+
自动降级匿名档重试一次,并在 `warnings` 里注明。它的结果带相关性过滤:与查询
|
|
194
|
+
无共享词汇的整批判空,让融合有机会换下一个引擎。
|
|
195
|
+
- **能力矩阵。** 每个引擎用两个正交开关自由组合:`expose.aggregate` 决定它是否
|
|
196
|
+
进入融合答案,`expose.tool` 决定它是否另成一个可按名调用的独立工具,两者可
|
|
197
|
+
同时开启。`toolName` 覆盖独立工具的名字。
|
|
198
|
+
- **每引擎独立代理。** `engines.<name>.proxy` 三态:留空跟随本机代理环境变量,
|
|
199
|
+
`direct`/`none` 表示仅此引擎绕过系统代理,完整 URL 表示仅此引擎走它。既不是
|
|
200
|
+
关键字也不是 http(s) URL 的值会被拒绝而不是忽略——笔误时回落到环境变量,会把
|
|
201
|
+
流量送进用户正想避开的那个代理。
|
|
202
|
+
- **内建 MCP 客户端。** 写在 `mcp` 下的 Streamable HTTP 服务端变成普通工具,
|
|
203
|
+
命名与宿主自己的 MCP 客户端一致(`mcp__<server>__<tool>`)。握手并发的,
|
|
204
|
+
一个服务端连不上只损失它自己的工具,并在 30 秒后自动重试一次。握手与工具调用
|
|
205
|
+
使用各自独立的超时上限。
|
|
206
|
+
- **配额冷却。** 额度耗尽的引擎自动退到链尾并记下恢复时间,月度额度(Tavily 的
|
|
207
|
+
432/433)按二十四小时算,其余按四十五分钟算。冷却中的引擎不参与融合,并在
|
|
208
|
+
`uncertainty` 里写明"未参与"而非"失败"。
|
|
209
|
+
- **`searchfuse doctor`。** 不花额度、不发网络请求地诊断本机配置:Node 版本、
|
|
210
|
+
引擎选择与其来源、配置文件权限、每个角色的候选引擎及其就绪原因、融合与 MCP
|
|
211
|
+
两节的配置事实,缺什么附一条可直接复制的修复命令。
|
|
212
|
+
- **dsh 设置卡片。** 网页端没有终端,所以卡片提供首选引擎、密钥与端点、引擎
|
|
213
|
+
开关、曝光矩阵与每引擎代理。密钥永远不下发到浏览器,只报告"有没有存过"。
|
|
214
|
+
- **单引擎多密钥轮换。** 一个引擎可配逗号分隔的多个 key,鉴权、限流或配额失败
|
|
215
|
+
时按顺序轮换,再把工作交给下一个引擎。
|
|
216
|
+
|
|
217
|
+
### Changed
|
|
218
|
+
|
|
219
|
+
- **Antigravity CLI 默认不激活。** 它靠模型合成并引用答案,动辄一分钟以上,
|
|
220
|
+
超过任何有用的融合预算,留在链里也只能被跳过。它仍出现在设置卡片上,一键即可
|
|
221
|
+
打开,`doctor` 也照常报告它是否可用。想要它就写
|
|
222
|
+
`engines.antigravity-cli.enabled: true`。
|
|
223
|
+
- **代理遵循 `no_proxy`。** 引擎 API 调用与单页抓取走同一套代理规则,不再出现
|
|
224
|
+
"抓网页能通、搜索全失败"的分裂状态。失败的调用会点名原因(`ECONNREFUSED`、
|
|
225
|
+
`EAI_AGAIN`),而不是一句光秃秃的 `fetch failed`。
|
|
226
|
+
- **权限收紧。** 配置文件以 `0600` 写入,目录以 `0700` 创建,采用同目录临时
|
|
227
|
+
文件加原子重命名,避免写到一半的 JSON 变成下一次启动的故障源。
|
|
228
|
+
|
|
229
|
+
### Removed
|
|
230
|
+
|
|
231
|
+
- **Hacker News 与 Stack Overflow 适配器。** 它们返回的内容对通用检索的价值低于
|
|
232
|
+
维护成本,把名次让给语义更匹配的来源。
|
|
233
|
+
- **Playwright 抓取路径。** 页面抓取只保留 Firecrawl 云端、Antigravity CLI 与
|
|
234
|
+
内置直连三种,少一个需要额外安装的运行时依赖。
|
|
235
|
+
|
|
236
|
+
### Fixed
|
|
237
|
+
|
|
238
|
+
- **融合不再把无链接条目合并成一条。** 五个 HTTP 引擎都用 `url: r.url ?? ''`
|
|
239
|
+
构造条目,上游漏一个链接就会送来空串。空串经规范化后仍是空串,于是所有无链接
|
|
240
|
+
条目共用同一个键:一批互不相干的结果被合并成一条、`foundIn` 声称多个引擎都投了
|
|
241
|
+
它、虚高的分数还把它顶到第一位。现在空 URL 使用由引擎名与列表内序号组成的合成
|
|
242
|
+
键,各自独立保留。
|
|
243
|
+
- **超时不再被报成"被取消"。** 原先只用一份信号判定归因,而调用方手里没有取消
|
|
244
|
+
信号,只能把自己的超时信号传进来,于是每次预算耗尽都写成"the run was
|
|
245
|
+
cancelled",用户会以为是自己点了停止。现在以"预算先到即超时、外部先到即取消"
|
|
246
|
+
两份精确信息区分。
|
|
247
|
+
- **关掉的引擎不会以工具身份复活。** `enabled: false` 是彻底的总开关,不只是
|
|
248
|
+
"不参与融合"。
|
|
249
|
+
- **切换配置不再吞掉 `aggregate` 与 `mcp` 段。** 配置读取是一次白名单式重建,
|
|
250
|
+
新增的顶层段必须在其中被搬运过去,否则每次 `config set` 都会把它们抹掉,而且
|
|
251
|
+
不会报错——只会让工具在下次加载时安静地消失。
|
|
252
|
+
- **`__proto__` 不会伪装成引擎设置。** 引擎映射使用 null 原型对象,因为手工编辑
|
|
253
|
+
的 `engines["__proto__"] = {...}` 在普通对象字面量上会设置原型而不是定义属性,
|
|
254
|
+
于是该条目在枚举与序列化里隐形,却仍能被点号访问看到。
|
|
255
|
+
- **Windows 上退出时不再崩溃。** 已经打印完结果的搜索会设置退出码并让 Node 自行
|
|
256
|
+
收尾,而不是立刻结束进程——后者可能拆掉一个仍在关闭中的网络连接,让检查退出码
|
|
257
|
+
的调用方丢掉一份好结果。
|
|
258
|
+
|
|
259
|
+
### Security
|
|
260
|
+
|
|
261
|
+
- **SSRF 防护与 DNS 重绑定闭合。** 安全检查解析一次主机名后,连接会钉在它验证过
|
|
262
|
+
的那个 IP 上,Host 头与 TLS SNI 仍保留原主机名;每个重定向跳转都重新校验并重新
|
|
263
|
+
钉住,堵住"检查后 DNS 答案变化"的时间窗。
|
|
264
|
+
- **私有与保留地址默认拦截。** `allowPrivateNetwork` 打开后才放行,且它从不授权
|
|
265
|
+
Firecrawl 云端披露——URL 中直写的私有目标在任何配置下都不会发往云端。
|
|
266
|
+
- **工具可执行文件不经 shell 启动。** 子进程引擎一律 `spawn(bin, args)` 且不带
|
|
267
|
+
shell,避免把参数拼进命令行。图形宿主下子进程窗口被隐藏,并有契约测试扫描发布
|
|
268
|
+
源码,防止以后新加的 provider 悄悄把黑窗口闪回来。
|
|
269
|
+
- **密钥从不进入模型可读的输出。** `config show`、`doctor` 与卡片一律打码,只报告
|
|
270
|
+
密钥来自环境变量还是配置文件。
|
|
271
|
+
|
|
272
|
+
### Compatibility
|
|
273
|
+
|
|
274
|
+
- **cordis 4.2 兼容**:`engines.dsh` 补上 `<0.3.0-0` 上界(DSH 0.2.3 系列
|
|
275
|
+
随包带入 cordis 4.2.0-alpha.1 与 schemastery 3.20.0-alpha.1,实测引擎闸门
|
|
276
|
+
与 bundle 组合均无回归)。
|
|
277
|
+
- **工具链在发版前全部升到最新**:TypeScript 5.9 → 7.0、Vite 6.4 → 8.3、
|
|
278
|
+
Vitest 3.2 → 5.1、Biome 2.5 → 2.6、commander 13 → 15、undici 7.30 → 8.13、
|
|
279
|
+
`@searxng-js/searxng` 0.1.2 → 0.1.3,CI 与 `packageManager` 一并钉在
|
|
280
|
+
pnpm 12.23。两处必须跟着改:TypeScript 7 要求 `tsconfig.dsh.json` 显式写
|
|
281
|
+
`rootDir`(否则退出码 2、`dsh/index.js` 不生成,包装不上);undici 8 对
|
|
282
|
+
`http://` 目标改用标准代理转发而非 CONNECT 隧道,测试里的假代理两条路都要接。
|
|
283
|
+
|
|
284
|
+
[Unreleased]: https://github.com/Wenaixi/searchfuse/compare/v0.1.2...HEAD
|
|
285
|
+
[0.1.2]: https://github.com/Wenaixi/searchfuse/releases/tag/v0.1.2
|
|
286
|
+
[0.1.1]: https://github.com/Wenaixi/searchfuse/releases/tag/v0.1.1
|
|
287
|
+
[0.1.0]: https://github.com/Wenaixi/searchfuse/releases/tag/v0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Leon Liu (liustack)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,162 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/Wenaixi/searchfuse/main/assets/banner.jpg" width="100%" alt="SearchFuse" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">SearchFuse</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center"><b>In the chat app your model can search the web. On the API it cannot. SearchFuse puts the web back: web search, X search, page fetch. Free, no signup, no API key.</b></p>
|
|
8
|
+
|
|
9
|
+
<p align="center"><b>The strongest free web search plugin for DeepSeek Harness (dsh)</b></p>
|
|
10
|
+
|
|
11
|
+
<p align="center">Engines: <b>Firecrawl</b> (keyless, default) · <b>Keenable</b> (keyless) · <b>AnySearch</b> (keyless) · <b>You.com</b> (keyless) · <b>SearXNG</b> (bundled) · <b>Tavily</b> · <b>Exa</b> · <b>Antigravity CLI</b> · <b>Grok (X)</b> · <b>local</b>, fused by default</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="./README.zh-CN.md">简体中文</a> ·
|
|
15
|
+
<a href="skills/searchfuse/references/configure.md">Configuration</a> ·
|
|
16
|
+
<a href="skills/searchfuse/references/output-schema.md">Output contract</a> ·
|
|
17
|
+
<a href="https://github.com/liustack/modlens">ModLens (vision)</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<a href="https://x.com/liustack"><img src="https://img.shields.io/badge/follow-%40liustack-black?style=flat-square&logo=x&logoColor=white" alt="Follow @liustack on X"></a>
|
|
22
|
+
<a href="https://www.npmjs.com/package/@wenaixi/searchfuse"><img src="https://img.shields.io/npm/v/@wenaixi/searchfuse?style=flat-square&label=npm&color=cb3837" alt="npm"></a>
|
|
23
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/node/v/@wenaixi/searchfuse?style=flat-square" alt="Node.js"></a>
|
|
24
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License"></a>
|
|
25
|
+
<img src="https://img.shields.io/badge/Not%20backed%20by-Y%20Combinator-FF6600?style=flat-square&logo=ycombinator&logoColor=white" alt="Not backed by Y Combinator">
|
|
26
|
+
<img src="https://img.shields.io/badge/users-unknown-lightgrey?style=flat-square" alt="Users unknown">
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
Models like DeepSeek and GLM have no web access, or a weak one. SearchFuse is a plug-in that greatly strengthens web search, X search, and single-page fetch. It works the moment it lands: the default engine is Firecrawl's keyless tier, [1,000 free credits every month](https://www.firecrawl.dev/blog/firecrawl-keyless-launch), with no account, no API key, and no card.
|
|
30
|
+
|
|
31
|
+
## Talk to us
|
|
32
|
+
|
|
33
|
+
Hit a problem? [Open an issue](https://github.com/Wenaixi/searchfuse/issues/new/choose). Everything else is welcome on X: **[@liustack](https://x.com/liustack)**. What you built with it, which harness you are on, what should come next. New releases land there first. A community space is on the way.
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
- **The strongest free web search plugin for DeepSeek Harness (dsh):** one command installs it, `npx -y @deepseek-ai/dsh plugin --profile web add @wenaixi/searchfuse@0.1.2`. In the desktop app's Add plugin dialog, enter `@wenaixi/searchfuse`, not the GitHub URL.
|
|
38
|
+
- **Free out of the box, no signup.** Search and page fetch run on Firecrawl Keyless by default: [1,000 free credits/month](https://www.firecrawl.dev/blog/firecrawl-keyless-launch), no account, no API key, no card. Every fallback channel is free too: Keenable, AnySearch, and You.com each add a keyless pool, the bundled SearXNG instance needs no key at all, Antigravity CLI needs only a browser sign-in, and Tavily, Exa, and a free Firecrawl key each add their own monthly quota with no card required.
|
|
39
|
+
- **Fused search, not failover.** By default `web_search` asks every reachable engine at once and merges their ranked lists with reciprocal rank fusion, so an answer reflects several indexes and a page two engines agree on outranks one only a single engine liked. Set `aggregate.mode: chain` in `~/.searchfuse/config.json` for the old sequential behaviour.
|
|
40
|
+
- **Automatic failover.** When a channel fails or exhausts its quota, the next one takes over. Under fusion, one engine erroring costs only its own contribution; the rest of the answer stands and the failure is named in `uncertainty`.
|
|
41
|
+
- **Per-engine key rotation.** Give Tavily, Exa, Firecrawl, Keenable, or AnySearch multiple comma-separated keys. Authentication, rate-limit, and quota failures rotate to the next key before the engine chain falls back.
|
|
42
|
+
- **Every engine on its own leash.** Each engine can join the fused answer, become a standalone tool the model calls by name, do both, or be switched off — independently. Each can also take its own proxy, so one engine leaves the machine's proxy while the rest keep using it.
|
|
43
|
+
- **MCP servers become tools.** Point the plugin at any Streamable HTTP MCP server and its tools appear as `mcp__<server>__<tool>`, no separate plugin to install. Connections are made concurrently and a server that cannot be reached costs only its own tools.
|
|
44
|
+
- **Searches X (Twitter).** With Grok Build installed, SearchFuse queries the corpus that web indexes cannot reach.
|
|
45
|
+
- **Install once, use everywhere.** Works in Claude Code, Codex, Pi, and OpenCode.
|
|
46
|
+
|
|
47
|
+
## See it work
|
|
48
|
+
|
|
49
|
+
All four screenshots are unedited runs, the first two from the Codex desktop app and the last two from dsh web, driving DeepSeek models with no web access of their own.
|
|
50
|
+
|
|
51
|
+
Give it a blog link and ask what the post says. Twenty-five seconds later: a structured summary of the whole post, with no browser involved.
|
|
52
|
+
|
|
53
|
+

|
|
54
|
+
|
|
55
|
+
Give it no target at all, just "anything interesting in AI today?". Thirty-six seconds later: six sourced stories, with a closing note on which details came from aggregation and deserve a second look. The note comes from the `uncertainty` field.
|
|
56
|
+
|
|
57
|
+

|
|
58
|
+
|
|
59
|
+
Ask dsh web for today's top AI stories. dsh's native search tool row runs straight on the searchfuse engine chain, and eighteen seconds later three stories come back, each with a source link.
|
|
60
|
+
|
|
61
|
+

|
|
62
|
+
|
|
63
|
+
Ask which Node.js line is still in maintenance. `read_page` reads the release page and the release schedule in turn, and sixty seconds later the verdict arrives with a version status table and sources at the end.
|
|
64
|
+
|
|
65
|
+

|
|
66
|
+
|
|
67
|
+
## Supported engines
|
|
68
|
+
|
|
69
|
+
Firecrawl, Keenable, AnySearch, You.com, and the bundled SearXNG work with zero setup. Every other engine is one command away. Keys live in `~/.searchfuse/config.json` (0600, masked when shown):
|
|
70
|
+
|
|
71
|
+
| Engine | Does | Free tier | Turn it on |
|
|
72
|
+
| :-- | :-- | :-- | :-- |
|
|
73
|
+
| Firecrawl (default) | web search + page fetch | keyless: 1,000 free credits/month, no signup. A free key adds your own 1,000/month | nothing, it works as installed |
|
|
74
|
+
| Keenable | web search | keyless: 1,000 requests/hour per IP (shared by everyone on that IP), no signup. A free key gives 100,000 requests/month of your own | nothing, it works as installed |
|
|
75
|
+
| AnySearch | web search | keyless: anonymous quota, rate-limited per IP. A free key lifts the rate limit; a rejected key falls back to the anonymous tier automatically | nothing, it works as installed |
|
|
76
|
+
| You.com | web search | keyless: 100 searches/day per IP (shared by everyone on that IP), no signup | nothing, it works as installed |
|
|
77
|
+
| SearXNG | web search (its own 70+ upstream engines behind one adapter) | free, bundled instance by default | nothing, it works as installed. Point it at your own instance with `searchfuse config set searxng.baseURL <url>` |
|
|
78
|
+
| Tavily | web search | 1,000 credits/month, no card | `searchfuse config set tavily.apiKey <key>` |
|
|
79
|
+
| Exa | web search | $10/month recurring credit (~1,400 searches), no card | `searchfuse config set exa.apiKey <key>` |
|
|
80
|
+
| Antigravity CLI | web search + page fetch | free, browser sign-in | off by default: install `agy`, sign in, then `searchfuse config set engines.antigravity-cli.enabled true` |
|
|
81
|
+
| Grok Build | X (Twitter) search | rides SuperGrok or X Premium | install `grok` and sign in |
|
|
82
|
+
| local | page fetch | built in, nothing to install | nothing |
|
|
83
|
+
|
|
84
|
+
Keys can also come from the environment (`TAVILY_API_KEY`, `EXA_API_KEY`, `FIRECRAWL_API_KEY`, `KEENABLE_API_KEY`, `ANYSEARCH_API_KEY`). One engine can take multiple keys as a comma-separated value such as `key-one,key-two`, in either the config file or its environment variable. Multiple engines configured means they run together and their results are fused. Every engine participates by default except `antigravity-cli`, which stays off until you turn it on with `searchfuse config set engines.antigravity-cli.enabled true` because it is too slow for a fusion budget. Exclude any engine with `searchfuse config set <engine>.enabled false`. Using a Tavily-, Exa-, Firecrawl-, Keenable-, or AnySearch-compatible third-party or self-hosted endpoint? Point the engine at it: `searchfuse config set tavily.baseURL <url>`. Official endpoints stay built into the code and are never written as default config. Every knob, engine by engine, is in the [configuration guide](skills/searchfuse/references/configure.md).
|
|
85
|
+
|
|
86
|
+
## Installation
|
|
87
|
+
|
|
88
|
+
**Step 1, hand it to your AI.** Search and page fetch work as soon as the skill lands, on Firecrawl's free keyless quota, so installation is one message:
|
|
89
|
+
|
|
90
|
+
> Install and configure the searchfuse skill following INSTALL.md at https://github.com/Wenaixi/searchfuse, then run the health check and tell me the result.
|
|
91
|
+
|
|
92
|
+
On DeepSeek Harness (dsh), send the same message. INSTALL.md recognizes dsh and switches to the native plugin instead of the skill, so dsh's own `web_search` runs on searchfuse. In the browser UI your AI installs it. The desktop app only takes plugins from its own window, so there your AI asks you to open **Plugins**, click **Add plugin**, and enter `@wenaixi/searchfuse`.
|
|
93
|
+
|
|
94
|
+
Prefer a direct command? Install the same skill through [skills.sh](https://skills.sh/):
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npx skills add Wenaixi/searchfuse
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Step 2 (optional), add more free engines.** Antigravity CLI writes better synthesized answers. A free Tavily, Exa, or Firecrawl key adds a personal quota on top of the keyless one. None requires a card. agy's browser sign-in is the only step that needs your hands:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
curl -fsSL https://antigravity.google/cli/install.sh | bash
|
|
104
|
+
agy # sign in, then exit
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Picked a key instead? Send one line to your AI: "set my tavily key to tvly-...".
|
|
108
|
+
|
|
109
|
+
dsh users have a path that never touches the command line. Open **Plugins** in the dsh sidebar and pick `@wenaixi/searchfuse`: pick the preferred engine, fill in an API key or a self-hosted endpoint, tick which engines join failover, hit save and it takes effect. On dsh releases before 0.1.6-alpha.2 the same card lives under Settings → Plugins → Plugin config.
|
|
110
|
+
|
|
111
|
+

|
|
112
|
+
|
|
113
|
+
## Usage
|
|
114
|
+
|
|
115
|
+
Once installed, you do not need to remember any commands. Just chat. Ask anything that needs checking, or paste a URL, and the skill triggers on its own: it picks an engine, runs the search or fetch, and the answer comes back with sources.
|
|
116
|
+
|
|
117
|
+
## Documentation
|
|
118
|
+
|
|
119
|
+
| Doc | Read it when |
|
|
120
|
+
| :-- | :-- |
|
|
121
|
+
| [INSTALL.md](INSTALL.md) | Installing the skill step by step (written for an agent) |
|
|
122
|
+
| [CLI manual](skills/searchfuse/references/cli.md) | The CLI the skill drives: flags, config, doctor |
|
|
123
|
+
| [Configuration](skills/searchfuse/references/configure.md) | Setting a key, switching engines, fixing config |
|
|
124
|
+
| [Output contract](skills/searchfuse/references/output-schema.md) | Parsing the JSON or building on it |
|
|
125
|
+
| [CHANGELOG](CHANGELOG.md) | Finding what changed in a version |
|
|
126
|
+
|
|
127
|
+
Proxy fake-IP mode (Clash, Clash Verge Rev, mihomo, Surge) works out of the box. DNS answers in `198.18.0.0/15` are treated as fake-IP placeholders with no switch needed. Literal URLs such as `http://198.18.0.5/` stay blocked when `allowPrivateNetwork` is off.
|
|
128
|
+
|
|
129
|
+
## Contributing
|
|
130
|
+
|
|
131
|
+
This repo does not accept pull requests. The project is maintained by the author alone. Every line is reviewed in person, and that review is the premise of its reliability. Two effective ways to contribute:
|
|
132
|
+
|
|
133
|
+
- **[Open an issue](https://github.com/Wenaixi/searchfuse/issues).** Bugs, suggestions, confusing errors, unclear docs. Issues are read and shape what gets built next.
|
|
134
|
+
- **Fork it.** Under MIT your copy is fully yours to modify and publish.
|
|
135
|
+
|
|
136
|
+
## Shameless plug
|
|
137
|
+
|
|
138
|
+
Follow the WeChat official account **liustack** (Chinese-language): AI tools, practice, and ideas, posted as they land. Scan the code, or search WeChat for "liustack":
|
|
139
|
+
|
|
140
|
+
<p align="center">
|
|
141
|
+
<img src="https://raw.githubusercontent.com/Wenaixi/searchfuse/main/assets/wechat-qrcode.png" width="420" alt="WeChat official account liustack" />
|
|
142
|
+
</p>
|
|
143
|
+
|
|
144
|
+
If it helps, star [SearchFuse](https://github.com/Wenaixi/searchfuse). Stars are how the next developer finds it.
|
|
145
|
+
|
|
146
|
+
## Star History
|
|
147
|
+
|
|
148
|
+
<a href="https://www.star-history.com/?repos=Wenaixi%2Fsearchfuse&type=date&legend=top-left">
|
|
149
|
+
<picture>
|
|
150
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=Wenaixi/searchfuse&type=date&theme=dark&legend=top-left&sealed_token=ymc92zQxHuDgpexZjaqDbEhMCuCjGHskpQGkzkwwrU0FksWoq5MasrMA64y9G2CxNV9O3EFeRjKneWSDYmHH4HWjpUiaAme0haCp-1Y72cRmHDv8coW35A" />
|
|
151
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=Wenaixi/searchfuse&type=date&legend=top-left&sealed_token=ymc92zQxHuDgpexZjaqDbEhMCuCjGHskpQGkzkwwrU0FksWoq5MasrMA64y9G2CxNV9O3EFeRjKneWSDYmHH4HWjpUiaAme0haCp-1Y72cRmHDv8coW35A" />
|
|
152
|
+
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=Wenaixi/searchfuse&type=date&legend=top-left&sealed_token=ymc92zQxHuDgpexZjaqDbEhMCuCjGHskpQGkzkwwrU0FksWoq5MasrMA64y9G2CxNV9O3EFeRjKneWSDYmHH4HWjpUiaAme0haCp-1Y72cRmHDv8coW35A" />
|
|
153
|
+
</picture>
|
|
154
|
+
</a>
|
|
155
|
+
|
|
156
|
+
## Disclaimer
|
|
157
|
+
|
|
158
|
+
SearchFuse is MIT-licensed, so use is not restricted. The author gives no warranty and no endorsement for any particular use, commercial or otherwise. The upstream engines it drives (Antigravity CLI, Tavily, Exa, Firecrawl, Keenable, You.com, Grok Build) each carry their own terms and quotas, and complying with them is the user's responsibility.
|
|
159
|
+
|
|
160
|
+
## License
|
|
161
|
+
|
|
162
|
+
MIT
|