@fffangchenghao/dsh-web-search 0.13.2 → 0.13.3
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 +7 -0
- package/README.md +5 -5
- package/README.zh-CN.md +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.3
|
|
4
|
+
|
|
5
|
+
### Documentation
|
|
6
|
+
- Both READMEs no longer claim that `fetchFormat` and `fetchMaxLength` need a
|
|
7
|
+
restart. They are resolved per request; only `cachePersist`, `cacheFile`,
|
|
8
|
+
`proxy` and `timeoutMs` are fixed when the plugin mounts.
|
|
9
|
+
|
|
3
10
|
## 0.13.2
|
|
4
11
|
|
|
5
12
|
### Documentation
|
package/README.md
CHANGED
|
@@ -239,8 +239,8 @@ Each line is the plain version first, the technical note second. The technical n
|
|
|
239
239
|
*Technical: proxy sources in order — the `proxy` setting, then `DSH_WEB_SEARCH_PROXY` / `HTTPS_PROXY` / `ALL_PROXY` / `HTTP_PROXY`, then macOS `scutil --proxy`; HTTP proxies only (`CONNECT`), not `socks5://`.*
|
|
240
240
|
|
|
241
241
|
14. **Every setting is editable in the UI.**
|
|
242
|
-
Twenty-six controls in five groups; a save takes effect on the next search, apart from
|
|
243
|
-
*Technical: all twenty-six fields carry `.volatile()`, so the Host commits them in place instead of remounting the plugin; `cacheTtlMs` and `cacheEntries` are re-read per use,
|
|
242
|
+
Twenty-six controls in five groups; a save takes effect on the next search, apart from `cachePersist` and `cacheFile`, which decide the cache wiring at mount.
|
|
243
|
+
*Technical: all twenty-six fields carry `.volatile()`, so the Host commits them in place instead of remounting the plugin; `cacheTtlMs` and `cacheEntries` are re-read per use, `fetchFormat` and `fetchMaxLength` are resolved per request, `renderJs` and `renderTimeoutMs` per fetch; `proxy` and `timeoutMs` are taken at mount, and so is the cache wiring that `cachePersist` and `cacheFile` decide.*
|
|
244
244
|
|
|
245
245
|
15. **Failures are explained, not silently empty.**
|
|
246
246
|
When nothing succeeds, the error lists which engines were tried and why each one failed.
|
|
@@ -452,7 +452,7 @@ Only these situations are worth changing:
|
|
|
452
452
|
|
|
453
453
|
Three things to keep in mind:
|
|
454
454
|
|
|
455
|
-
- A save is immediate and applies to the next search, no restart — except
|
|
455
|
+
- A save is immediate and applies to the next search, no restart — except `cachePersist` and `cacheFile`, which decide the cache wiring when the plugin mounts.
|
|
456
456
|
- **Ranking changes can be hidden by the cache**: the cache key holds `lead|wait|limit|engine set|time window|query`, not the ranking knobs. Ask the same question within ten minutes and you get the old order — and with persistence on, restarting DSH does not clear it. Rephrase it, or wait ten minutes. Changing the window changes the key, so an old entry cannot interfere.
|
|
457
457
|
- **`web_fetch` cannot continue from the middle**: it makes one request per URL, so if the tail is missing, raise `fetchMaxLength` or use `read_page` to continue from the break; fetching a narrower page still costs the least context.
|
|
458
458
|
|
|
@@ -563,7 +563,7 @@ Use `search_many`. One call carries one to five `queries`, runs three at a time,
|
|
|
563
563
|
|
|
564
564
|
Three cases:
|
|
565
565
|
|
|
566
|
-
- **Changed on the Settings page**: saved immediately and read on the next search
|
|
566
|
+
- **Changed on the Settings page**: saved immediately and read on the next search — `fetchFormat` and `fetchMaxLength` per request, `renderJs` and `renderTimeoutMs` per fetch; only `cachePersist` and `cacheFile` are read when the plugin mounts. But if you ask the same question again within ten minutes you may hit the cache and see no difference — try rephrasing; with persistence on, a restart does not clear the cache either.
|
|
567
567
|
- **Changed the profile's `cordis.patch.yml`**: requires a full restart of the harness.
|
|
568
568
|
- **Changed `src/*.ts`**: requires `npm run build` and then a restart. Source edits without a build still run the old code in `lib/`.
|
|
569
569
|
|
|
@@ -691,7 +691,7 @@ The conversion is dependency-free (`src/markdown.ts`): a tolerant tokenizer and
|
|
|
691
691
|
- Tables become Markdown tables; a table outside the chosen article root is dropped with the rest of the furniture.
|
|
692
692
|
- The character budget applies **after** conversion: `truncateFetchText` cuts at `fetchMaxLength`, trims trailing whitespace, avoids splitting a surrogate pair, and appends `[truncated at 20000 chars; original length 40891 chars; the rest is not shown]`.
|
|
693
693
|
- Measured on `docs.python.org/3/library/urllib.parse.html`: 119,614 characters of HTML → 40,891 characters of Markdown → 20,080 characters returned.
|
|
694
|
-
-
|
|
694
|
+
- `fetchFormat` and `fetchMaxLength` are resolved on every request and `renderJs` / `renderTimeoutMs` on every fetch, so a Settings edit applies without a restart; only `proxy` and `timeoutMs` are fixed at mount, along with the cache wiring.
|
|
695
695
|
- **`web_fetch` cannot resume**: the host's `WebFetchRequest` has exactly one field, `url` — no offset, no maxLength, no format, so every fetch starts at the top. The plugin's separate `read_page` tool fills that gap (see "The read_page pipeline"); without switching tools, the remedies are still raising `fetchMaxLength` or fetching a narrower page.
|
|
696
696
|
|
|
697
697
|
### The domain_search pipeline
|
package/README.zh-CN.md
CHANGED
|
@@ -452,7 +452,7 @@ pnpm install
|
|
|
452
452
|
|
|
453
453
|
三个提醒:
|
|
454
454
|
|
|
455
|
-
-
|
|
455
|
+
- 保存是即时的,下一次搜索就按新值走,不用重启——只有 `cachePersist` 和 `cacheFile` 例外,它们决定缓存怎么接线,在插件挂载时读取。
|
|
456
456
|
- 但**排序类的改动可能被缓存挡住**:缓存键里只有 `lead|wait|limit|引擎集合|时间窗|query`,没有排序参数。同一个问题十分钟内再问,拿到的还是旧顺序——开了持久化后,重启 DSH 也清不掉。换个问法,或者等十分钟。改时间窗会换一个键,所以不受旧缓存影响。
|
|
457
457
|
- **`web_fetch` 不能从中间续读**:它对一个网址只发一次请求,尾巴缺了可以调大 `fetchMaxLength`,也可以用 `read_page` 从断点接着读;抓一个更窄的页面仍然最省上下文。
|
|
458
458
|
|
|
@@ -563,7 +563,7 @@ pnpm install
|
|
|
563
563
|
|
|
564
564
|
分三种情况:
|
|
565
565
|
|
|
566
|
-
-
|
|
566
|
+
- **在设置页改的**:保存即生效,下一次搜索就读新值;`fetchFormat`、`fetchMaxLength` 每次请求重新解析,`renderJs`、`renderTimeoutMs` 每次抓取重新解析,所以都不用重启——只有 `cachePersist` 和 `cacheFile` 在挂载时决定缓存接线。如果问的是同一个问题、十分钟内又问了一遍,可能命中了缓存,看起来像没变——换个问法试试;开了持久化后,重启也不会清掉缓存。
|
|
567
567
|
- **改的是 profile 里的 `cordis.patch.yml`**:需要完全重启 Harness。
|
|
568
568
|
- **改的是 `src/*.ts`**:需要 `npm run build` 再重启。只改源码不构建,跑的还是 `lib/` 里的旧代码。
|
|
569
569
|
|
|
@@ -691,7 +691,7 @@ Playwright 不在依赖里,也不在启动时导入:抓取提供方在第一
|
|
|
691
691
|
- 表格转成 Markdown 表格;不在选定正文根里的表格会跟导航一起丢掉。
|
|
692
692
|
- 字符预算在**转换之后**才生效:`truncateFetchText` 按 `fetchMaxLength` 切,去掉尾部空白,避免把代理对切成半个,并追加 `[truncated at 20000 chars; original length 40891 chars; the rest is not shown]`。
|
|
693
693
|
- 实测 `docs.python.org/3/library/urllib.parse.html`:119,614 字符 HTML → 40,891 字符 Markdown → 实际返回 20,080 字符。
|
|
694
|
-
-
|
|
694
|
+
- `fetchFormat` 和 `fetchMaxLength` 每次请求重新解析、`renderJs` 和 `renderTimeoutMs` 每次抓取重新解析,设置页改完立即生效;`proxy`、`timeoutMs` 以及缓存接线在挂载时固定。
|
|
695
695
|
- **`web_fetch` 不支持续读**:宿主的 `WebFetchRequest` 只有 `url` 一个字段,没有 offset、maxLength、format,所以每次抓取都从头开始。插件另外注册的 `read_page` 补上了这个缺口(见「read_page 的管道」);不换工具时,办法仍然是调大 `fetchMaxLength`,或抓更窄的页面。
|
|
696
696
|
|
|
697
697
|
### domain_search 的管道
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fffangchenghao/dsh-web-search",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.3",
|
|
4
4
|
"description": "DSH bundle: a key-free web search provider. Leads with the anonymous AnySearch API and falls back to public result pages (DuckDuckGo, Bing, 360), merged by reciprocal-rank fusion with a bilingual region policy, an engine cooldown and a TTL cache.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|