dsh-hot-search 0.1.1 → 0.1.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/README.md +10 -4
- package/cordis.patch.yml +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,9 +33,9 @@ dsh --dump-config | Select-String hot-search
|
|
|
33
33
|
- id: hot-search
|
|
34
34
|
config:
|
|
35
35
|
roots:
|
|
36
|
-
- path: D:\
|
|
36
|
+
- path: D:\path\to\your-vault
|
|
37
37
|
label: main
|
|
38
|
-
- path: D:\notes
|
|
38
|
+
- path: D:\path\to\another\notes
|
|
39
39
|
label: work
|
|
40
40
|
```
|
|
41
41
|
|
|
@@ -52,7 +52,7 @@ dsh --dump-config | Select-String hot-search
|
|
|
52
52
|
| `refreshIntervalMs` | `120000` | 索引陈旧后自动重建的检查间隔;`0` = 不自动重建。**本 bundle 的 `cordis.patch.yml` 显式设成了 `60000`**,所以装完 `--dump-config` 看到的是 60 秒 |
|
|
53
53
|
| `fuzzyMaxErrors` | `0` | 模糊匹配容错字数;`0` = 按词长自动(`len//4`,短于 4 字不自动容错) |
|
|
54
54
|
| `watch` | `true` | FFF finder 是否文件监视(长驻进程建议开) |
|
|
55
|
-
| `stateDir` | `""` | frecency/历史库的**根**目录;空 = `$DSH_HOME/hot-search
|
|
55
|
+
| `stateDir` | `""` | frecency/历史库的**根**目录;空 = 先试 `$DSH_HOME/hot-search`,**进程环境里**没有 `DSH_HOME` 时退化到系统 cache(Windows:`%LOCALAPPDATA%\dsh-hot-search`)。详见「权限与隐私」——**同一台机器上宿主进程与 shell 子进程可能落在不同分支** |
|
|
56
56
|
| `maxResults` | `50` | 单次返回上限 |
|
|
57
57
|
| `promptSection` | `true` | 是否向系统提示注入用法说明 |
|
|
58
58
|
|
|
@@ -91,7 +91,13 @@ node dsh-hot-search\dev\hot-search-smoke.mjs
|
|
|
91
91
|
## 权限与隐私
|
|
92
92
|
|
|
93
93
|
- **读**:只读 `roots` 下的、匹配 `extensions` 的文本文件,用于建内存索引。不传任何内容给网络。
|
|
94
|
-
- **写**:只写自己的运行时状态(frecency、FFF 的 history 库),位置 = `stateDir
|
|
94
|
+
- **写**:只写自己的运行时状态(frecency、FFF 的 history 库),位置 = `stateDir`。**空值时按此顺序解析**:① `$DSH_HOME/hot-search/<根目录名>-<路径哈希>`;② **进程环境里**没有 `DSH_HOME` 时退化到系统 cache 目录(Windows:`%LOCALAPPDATA%\dsh-hot-search\<根目录名>-<路径哈希>`)。
|
|
95
|
+
⚠️ **落在哪一支取决于"该进程的环境里有没有 `DSH_HOME`",同一台机器上不同进程可能落在不同地方**。本机实测(2026-10-04):
|
|
96
|
+
- **DSH 宿主进程**:环境里没有 `DSH_HOME`(它是 DSH 只注入给 shell 子进程的)→ 宿主写 `%LOCALAPPDATA%\dsh-hot-search\…`
|
|
97
|
+
- **从 DSH 的 shell 工具里启动的脚本**(如本仓库的 `dev/*.mjs`):继承到了 `DSH_HOME` → 写 `$DSH_HOME\hot-search\…`
|
|
98
|
+
|
|
99
|
+
所以**别用"跑个脚本看它打印的 base"来判断宿主落在哪**——那只反映脚本自己的环境。想知道**宿主**用哪支:两边都看一眼,调用一次 `hot_find` 之后**谁的 `frecency.json` 更新时间在变**,就是宿主那支(`hot_find` 会同步落盘该文件)。
|
|
100
|
+
想固定位置就显式配 `stateDir`。**两条路径都不会写进你被索引的仓库**,所以不会脏你的 `git status`。
|
|
95
101
|
- **网络**:插件本身零网络请求。
|
|
96
102
|
- **原生依赖**:`hot_find`/`hot_grep` 依赖 Rust 原生库 `@ff-labs/fff-node`(含平台二进制)。加载失败时**不会崩**:`hot_find` 自动降级为内置子序列匹配,`hot_grep` 明确报错并指路 `hot_fuzzy`;`hot_fuzzy`/`hot_plan`/`hot_stats` 完全不依赖它。`hot_stats` 会显示降级原因。
|
|
97
103
|
- **平台**:在 Windows x64 上实测。非 win-x64 平台需要 `@ff-labs/fff-node` 对应的平台二进制包;拿不到就走上面的降级路径。
|
package/cordis.patch.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-hot-search",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Resident hot search for DSH: FFF-backed fuzzy filename + indexed grep + CJK typo-tolerant content search, all in the host process (no per-query process spawn).",
|
|
6
6
|
"main": "src/index.mjs",
|