dsh-locator 0.2.1 → 0.4.0

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0 — 2026-11-09
4
+
5
+ * macOS now ships **FSEvents** in the cgo darwin binaries (arm64 and x64): a pure-C stream callback serializes events into a pipe, so the recursive watcher has no per-directory descriptor limit. The previous crash was `FSEventStreamCreate` receiving the callback context instead of a real `FSEventStreamContext`.
6
+ * kqueue remains the `CGO_ENABLED=0` fallback and is used by the cross-built binaries in custom builds.
7
+ * CI builds the cgo darwin binaries on the macOS runner and the FSEvents create/delete test runs there.
8
+ * Replaces the 0.3.0 darwin binaries with the cgo builds; other platforms are unchanged.
9
+
10
+ ## 0.3.0 — 2026-11-09
11
+
12
+ * Web panel: double-click a row to reveal it in the platform file manager (Explorer `/select`, Finder `open -R`, `xdg-open` on the directory). The path must be inside the configured roots and is passed as an argument vector, never through a shell; failure falls back to copying the path.
13
+ * DSH compatibility widened to `>=0.2.1-rc.2 <0.3.0` (peer `dsh-tools` `>=0.2.1-0`). Verified end to end on DSH 0.2.1-rc.5: plugin loads, reuses the snapshot, HTTP search answers, and the panel returns 964 matches in 24.4 ms with no console errors.
14
+ * `locator_export` and the rest of 0.2.x are unchanged.
15
+
3
16
  ## 0.2.1 — 2026-11-09
4
17
 
5
18
  * Rebuild `lib/` before packing: 0.2.0's npm tarball was built from a stale
package/README-zh.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm](https://img.shields.io/npm/v/dsh-locator)](https://www.npmjs.com/package/dsh-locator)
4
4
  [![ci](https://github.com/PerryLink/dsh-locator/actions/workflows/ci.yml/badge.svg)](https://github.com/PerryLink/dsh-locator/actions/workflows/ci.yml)
5
5
 
6
- 中文 | [English](README.md)
6
+ [English](README.md) | [中文](README-zh.md) | [Español](README-es.md) | [Português](README-pt.md) | [हिन्दी](README-hi.md)
7
7
 
8
8
  给 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 用的全盘毫秒级文件搜索,**自建索引**:不装 Everything、不用 `es.exe`、不需要 Everything 服务。
9
9
 
@@ -55,7 +55,7 @@ npm 包内置 `linux-x64`、`linux-arm64`、`win32-x64`、`win32-arm64`、`darwi
55
55
  * 空查询按修改时间倒序列出最近条目;输入后 110 ms 防抖,走和工具完全相同的 Everything 风格语法。
56
56
  * 点列头按名称、大小、修改时间、路径排序,再点切换升降序。
57
57
  * `只看文件` / `只看目录` 过滤类型;底栏显示命中数、分页上限和查询耗时。
58
- * `↑`/`↓` 选择,`Enter` 复制选中路径,`Esc` 关闭。
58
+ * `↑`/`↓` 选择,`Enter` 复制选中路径,**双击在文件管理器中定位**(Explorer / Finder / `xdg-open`),`Esc` 关闭。
59
59
  * 面板是可选的:没有 Web server 的 profile 不会挂载它,三个工具照常工作。
60
60
 
61
61
  ## 工具
@@ -97,7 +97,7 @@ npm 包内置 `linux-x64`、`linux-arm64`、`win32-x64`、`win32-arm64`、`darwi
97
97
  | `roots` | `[]` | 要索引的目录;空 = 用户主目录。 |
98
98
  | `excludes` | 开发/缓存目录 | 扫描与监听都跳过的基础名 glob。 |
99
99
  | `watch` | `true` | 启用原生文件系统通知。 |
100
- | `refreshIntervalMs` | `1800000` | 没有原生监听时(目前是 macOS)的重建周期;0 关闭。 |
100
+ | `refreshIntervalMs` | `1800000` | 没有原生监听时(kqueue 回退或监听失败)的重建周期;0 关闭。 |
101
101
  | `scanWorkers` | `0` | 扫描时的目录读取并发;0 = CPU 数。 |
102
102
  | `windowsUsn` | `false` | 扫描时先试 NTFS USN/MFT 枚举(Windows,需管理员;失败自动回退)。 |
103
103
  | `stateDir` | `''` | 快照目录;空 = 平台缓存目录。 |
@@ -114,7 +114,7 @@ npm 包内置 `linux-x64`、`linux-arm64`、`win32-x64`、`win32-arm64`、`darwi
114
114
  |---|---|---|---|
115
115
  | Linux | 是 | inotify,递归 | 每个目录一个 watch;极大目录树可能撞 `fs.inotify.max_user_watches`。 |
116
116
  | Windows | 是 | `ReadDirectoryChangesW`,递归 | 不需要管理员,不需要 Everything。提权时可选用 USN/MFT 枚举。WSL 写 `/mnt/<盘>` 可能不产生 Windows 通知,用 `locator_rebuild` 补。 |
117
- | macOS | 是 | kqueue vnode 监听(最多 4,096 个目录)+ 周期性重建 | 目录级事件覆盖新建、删除、重命名;文件内容变化不产生 vnode 事件,大小/时间由 `refreshIntervalMs` 或 `locator_rebuild` 刷新。 |
117
+ | macOS | 是 | 随包发布的 cgo 二进制使用 FSEvents(递归、无上限) | `CGO_ENABLED=0` 构建回退到 kqueue(最多 4,096 个目录);回退模式下内容变化仍由 `refreshIntervalMs` 或 `locator_rebuild` 刷新。 |
118
118
 
119
119
  引擎是纯 Go、无 cgo,一台机器交叉编译全部平台;运行时从不需要管理员权限。
120
120
 
@@ -202,7 +202,7 @@ pnpm build:engine:all # 或 build:engine 只构建本机
202
202
  * Linux inotify 每个目录一个描述符;几十万目录的主目录可能超过内核上限。插件会报警告,快照仍可用,重建可以补齐。
203
203
  * WSL 写 `/mnt/c` 可能不产生 Windows 侧通知(Windows 监听看不到 9p 写入方的变更流),需显式重建。
204
204
  * 网络共享只有在能当普通目录访问时才会被扫描;没有 SMB 专用变更源。
205
- * macOS 是目录级监听(kqueue,每目录一个描述符,上限 4,096):新建/删除/重命名即时生效;文件内容变化靠周期重建。无上限、文件级的 FSEvents 仍在路线图。
205
+ * macOS 随包二进制使用 FSEvents(递归);`CGO_ENABLED=0` 构建回退到 kqueue(每目录一个描述符,上限 4,096)。两种模式的内容变更都靠周期重建兜底。
206
206
  * 还没有 USN/MFT 快速枚举(见上)。
207
207
 
208
208
  ## 路线图
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm](https://img.shields.io/npm/v/dsh-locator)](https://www.npmjs.com/package/dsh-locator)
4
4
  [![ci](https://github.com/PerryLink/dsh-locator/actions/workflows/ci.yml/badge.svg)](https://github.com/PerryLink/dsh-locator/actions/workflows/ci.yml)
5
5
 
6
- [中文](README-zh.md) | English
6
+ [English](README.md) | [中文](README-zh.md) | [Español](README-es.md) | [Português](README-pt.md) | [हिन्दी](README-hi.md)
7
7
 
8
8
  A whole-disk, millisecond file search for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) that builds its **own** index. No Everything installation, no `es.exe`, no Everything service.
9
9
 
@@ -55,7 +55,7 @@ Press `Ctrl+Shift+F` anywhere in the Web GUI, or click the magnifier at the side
55
55
  * Empty query lists the most recently modified entries; typing runs the same Everything-style syntax as the tool after a 110 ms debounce.
56
56
  * Click a column header to sort by name, size, modification time or path; toggle ascending/descending.
57
57
  * `只看文件` / `只看目录` filter the kind; the footer reports matches, the page cap and query latency.
58
- * `↑`/`↓` select, `Enter` copies the selected path, `Esc` closes.
58
+ * `↑`/`↓` select, `Enter` copies the selected path, **double-click reveals it** in Explorer/Finder/`xdg-open`, `Esc` closes.
59
59
  * The panel is optional: profiles without a Web server never mount it, and the three tools keep working.
60
60
 
61
61
  ## Tools
@@ -97,7 +97,7 @@ Every field is a Schemastery config field; edit the `dsh-locator` entry in the p
97
97
  | `roots` | `[]` | Directories to index; empty means the home directory. |
98
98
  | `excludes` | dev/cache directories | Base-name globs skipped by scanner and watcher. |
99
99
  | `watch` | `true` | Apply native filesystem notifications. |
100
- | `refreshIntervalMs` | `1800000` | Rebuild cadence when no native watcher exists (macOS today); `0` disables. |
100
+ | `refreshIntervalMs` | `1800000` | Rebuild cadence when no native watcher is active (kqueue fallback or a watcher failure); `0` disables. |
101
101
  | `scanWorkers` | `0` | Directory reader concurrency during scans; `0` uses the CPU count. |
102
102
  | `windowsUsn` | `false` | Try the NTFS USN/MFT enumeration before the walk (Windows, administrator; falls back automatically). |
103
103
  | `stateDir` | `''` | Snapshot directory; empty means the platform cache directory. |
@@ -114,9 +114,9 @@ Narrow `roots` if indexing the whole home directory is too much I/O. A small, fo
114
114
  |---|---|---|---|
115
115
  | Linux | yes | inotify, recursive | Watch descriptors are per directory; very large trees can hit `fs.inotify.max_user_watches`. |
116
116
  | Windows | yes | `ReadDirectoryChangesW`, recursive | No admin rights and no Everything needed. Optional USN/MFT enumeration when running elevated. Changes made by WSL to `/mnt/<drive>` may not raise notifications; use `locator_rebuild` for those. |
117
- | macOS | yes | kqueue vnode watches for up to 4,096 directories, plus periodic rebuild | Directory-level events cover creates, deletes and renames. File content changes do not raise vnode events, so size/mtime refresh comes from `refreshIntervalMs` or `locator_rebuild`. |
117
+ | macOS | yes | FSEvents in the shipped cgo binaries, recursive and uncapped | kqueue is the `CGO_ENABLED=0` fallback (up to 4,096 directories). File content changes do not raise vnode events in the fallback, so size/mtime refresh comes from `refreshIntervalMs` or `locator_rebuild`. |
118
118
 
119
- The engine is pure Go with no cgo, cross-compiled from one machine. It never needs admin privileges.
119
+ The engine is pure Go except the macOS FSEvents backend, which uses cgo and is built on a macOS runner. Linux, Windows and the kqueue fallback build with `CGO_ENABLED=0`; USN is optional and needs admin rights, everything else does not.
120
120
 
121
121
  ### Windows and the USN journal
122
122
 
@@ -202,14 +202,14 @@ The engine is a separate Go module under `engine/`; run its tests with `cd engin
202
202
  * Linux inotify watches one descriptor per directory; a home directory with hundreds of thousands of directories can exceed the kernel limit. The plugin reports the warning and the snapshot stays usable; rebuilds catch up.
203
203
  * WSL writes into `/mnt/c` may not produce Windows notifications (the Windows watcher cannot see the 9p writer's change stream). Rebuild those roots explicitly.
204
204
  * Network shares are scanned only if they are reachable as ordinary directories; no SMB-specific change feed.
205
- * macOS watches are directory-level (kqueue, one descriptor per directory, capped at 4,096). Creates/deletes/renames land immediately; file content changes rely on the periodic rebuild. FSEvents remains the roadmap item for an uncapped, file-level feed.
206
- * No USN/MFT fast enumeration yet (see above).
205
+ * macOS uses FSEvents (recursive) in the shipped binaries; a `CGO_ENABLED=0` build falls back to kqueue, capped at 4,096 directories. Content-only changes rely on the periodic rebuild either way.
206
+ * Windows USN/MFT is optional and only used when the process can read the volume and the journal is active; otherwise the portable walk is used.
207
207
 
208
208
  ## Roadmap
209
209
 
210
- 1. macOS FSEvents watcher.
211
- 2. Windows USN/MFT fast enumeration when the process can read the volume; journal-based catch-up after downtime.
212
- 3. Dedicated Web GUI panel (table, sortable columns, filters, preview, insert-as-`@file`).
210
+ 1. USN journal catch-up after downtime (persist the journal cursor and FRN map).
211
+ 2. Panel actions: insert a result as `@file`, richer previews.
212
+ 3. More platform runtime coverage (Electron desktop, Windows on ARM).
213
213
  4. Optional lowercase-name arena and trigram prefilter for large indexes.
214
214
  5. Incremental snapshot compaction and per-root journals.
215
215
 
Binary file
Binary file
package/client.js CHANGED
@@ -262,6 +262,16 @@ window.__ModuleLoader__.load({
262
262
  }
263
263
  }, [])
264
264
 
265
+ const reveal = useCallback(hit => {
266
+ if (!hit) return
267
+ post('/dsh-locator/reveal', { path: hit.path }).then(() => {
268
+ setToast('已在文件管理器中定位')
269
+ setTimeout(() => setToast(''), 1500)
270
+ }).catch(() => {
271
+ copy(hit)
272
+ })
273
+ }, [copy])
274
+
265
275
  const onKeyDown = useCallback(event => {
266
276
  if (event.key === 'Escape') {
267
277
  event.preventDefault()
@@ -362,7 +372,7 @@ window.__ModuleLoader__.load({
362
372
  className: 'dsh-locator-row' + (index === selected ? ' sel' : ''),
363
373
  title: hit.path,
364
374
  onClick: () => setSelected(index),
365
- onDoubleClick: () => copy(hit),
375
+ onDoubleClick: () => reveal(hit),
366
376
  },
367
377
  h('td', null, h('div', { className: 'dsh-locator-name' },
368
378
  h('span', { className: 'dsh-locator-badge' }, hit.dir ? '目录' : (hit.ext || '文件').toUpperCase()),
@@ -383,7 +393,7 @@ window.__ModuleLoader__.load({
383
393
  + (status && status.scanning ? ' · 索引构建中,结果可能不完整' : '')),
384
394
  h('span', { className: 'grow' }),
385
395
  toast === '' ? null : h('span', { className: 'dsh-locator-toast' }, toast),
386
- h('span', null, '↑↓ 选择 · Enter 复制路径 · Esc 关闭'),
396
+ h('span', null, '↑↓ 选择 · Enter 复制路径 · 双击定位 · Esc 关闭'),
387
397
  ),
388
398
  ))
389
399
  }
package/lib/http.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,cAAc,CAAA;AA6B9D,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,cAAc,GAAG,IAAI,CAmBnE"}
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,cAAc,CAAA;AA+B9D,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,cAAc,GAAG,IAAI,CAwBnE"}
package/lib/http.js CHANGED
@@ -11,6 +11,8 @@
11
11
  * service, and the plugin still works there through its tools.
12
12
  * @module dsh-locator/http
13
13
  */
14
+ import { revealInFileManager, withinRoots } from "./reveal.js";
15
+ import { statSync } from 'node:fs';
14
16
  const BODY_LIMIT = 64 * 1024;
15
17
  /** Mount the panel's routes when this profile runs a Web server. */
16
18
  export function registerHttp(ctx, rt) {
@@ -31,6 +33,11 @@ export function registerHttp(ctx, rt) {
31
33
  path: '/dsh-locator/status',
32
34
  handler: handler(scoped, async () => await status(rt)),
33
35
  }));
36
+ scoped.effect(() => server.register({
37
+ kind: 'exact',
38
+ path: '/dsh-locator/reveal',
39
+ handler: handler(scoped, async (body) => await reveal(rt, body)),
40
+ }));
34
41
  });
35
42
  }
36
43
  function handler(scoped, run) {
@@ -83,6 +90,27 @@ async function search(rt, raw) {
83
90
  hits: result.hits,
84
91
  };
85
92
  }
93
+ async function reveal(rt, raw) {
94
+ const path = typeof raw.path === 'string' ? raw.path : '';
95
+ if (path === '' || !withinRoots(path, rt.roots)) {
96
+ return { ok: false, error: 'path is outside the indexed roots' };
97
+ }
98
+ try {
99
+ const info = statSync(path);
100
+ if (!info.isFile() && !info.isDirectory())
101
+ return { ok: false, error: 'not a file or directory' };
102
+ }
103
+ catch {
104
+ return { ok: false, error: 'path does not exist' };
105
+ }
106
+ try {
107
+ await revealInFileManager(path);
108
+ return { ok: true };
109
+ }
110
+ catch (error) {
111
+ return { ok: false, error: messageOf(error) };
112
+ }
113
+ }
86
114
  async function status(rt) {
87
115
  rt.start();
88
116
  const engine = await rt.engineStatus();
package/lib/http.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA+BH,MAAM,UAAU,GAAG,EAAE,GAAG,IAAI,CAAA;AAE5B,oEAAoE;AACpE,MAAM,UAAU,YAAY,CAAC,GAAY,EAAE,EAAkB;IAC3D,MAAM,MAAM,GAAI,GAEd,CAAC,MAAM,CAAA;IACT,IAAI,OAAO,MAAM,KAAK,UAAU;QAAE,OAAM;IACxC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,MAAe,EAAE,EAAE;QAClD,MAAM,MAAM,GAAI,MAAmD,CAAC,SAAS,CAAA;QAC7E,IAAI,MAAM,KAAK,SAAS;YAAE,OAAM;QAChC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC;YAClC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAC,IAAI,EAAC,EAAE,CAAC,MAAM,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;SAC/D,CAAC,CAAC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K,MAAM,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAA;AAC3H,CAAC;AAED,SAAS,WAAW,CAAC,KAAc,EAAE,GAAW,EAAE,GAAW,EAAE,QAAgB;IAC7E,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAA;IACzE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACxD,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAgC,CAAC,CAAC,CAAC,EAAE,CAAA;AAC5F,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC/D,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Reveal one indexed path in the platform file manager.
3
+ * @module dsh-locator/reveal
4
+ */
5
+ /** Whether target is one of the roots or lives below one of them. */
6
+ export declare function withinRoots(target: string, roots: readonly string[]): boolean;
7
+ /**
8
+ * Ask the platform file manager to select a path. Uses an argument vector, not
9
+ * a shell, so a path can never be interpreted as a command. The child is
10
+ * detached: the opener outlives the plugin call.
11
+ */
12
+ export declare function revealInFileManager(target: string): Promise<void>;
13
+ //# sourceMappingURL=reveal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reveal.d.ts","sourceRoot":"","sources":["../src/reveal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAS7E;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBvE"}
package/lib/reveal.js ADDED
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Reveal one indexed path in the platform file manager.
3
+ * @module dsh-locator/reveal
4
+ */
5
+ import { spawn } from 'node:child_process';
6
+ import { dirname, isAbsolute, relative, resolve } from 'node:path';
7
+ /** Whether target is one of the roots or lives below one of them. */
8
+ export function withinRoots(target, roots) {
9
+ if (!isAbsolute(target))
10
+ return false;
11
+ const absolute = resolve(target);
12
+ for (const root of roots) {
13
+ const base = resolve(root);
14
+ const rel = relative(base, absolute);
15
+ if (rel === '' || (!rel.startsWith('..') && !isAbsolute(rel)))
16
+ return true;
17
+ }
18
+ return false;
19
+ }
20
+ /**
21
+ * Ask the platform file manager to select a path. Uses an argument vector, not
22
+ * a shell, so a path can never be interpreted as a command. The child is
23
+ * detached: the opener outlives the plugin call.
24
+ */
25
+ export async function revealInFileManager(target) {
26
+ const absolute = resolve(target);
27
+ let command;
28
+ let args;
29
+ if (process.platform === 'win32') {
30
+ command = 'explorer.exe';
31
+ args = [`/select,${absolute}`];
32
+ }
33
+ else if (process.platform === 'darwin') {
34
+ command = 'open';
35
+ args = ['-R', absolute];
36
+ }
37
+ else {
38
+ command = 'xdg-open';
39
+ args = [dirname(absolute)];
40
+ }
41
+ await new Promise((resolvePromise, reject) => {
42
+ const child = spawn(command, args, { detached: true, stdio: 'ignore', windowsHide: true });
43
+ child.once('error', reject);
44
+ child.once('spawn', () => {
45
+ child.unref();
46
+ resolvePromise();
47
+ });
48
+ });
49
+ }
50
+ //# sourceMappingURL=reveal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reveal.js","source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ACN,OAAO,GAAG,UAAU,CAAA;QACpB,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC5B,CAAC;IACD,MAAM,IAAI,OAAO,CAAO,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE;QACjD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAA;QAC1F,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAC3B,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE;YACvB,KAAK,CAAC,KAAK,EAAE,CAAA;YACb,cAAc,EAAE,CAAA;QAClB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-locator",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "description": "Whole-disk, millisecond file search for DeepSeek Harness without Everything: a self-built cross-platform index, an Everything-style query language, agent tools and a Web search panel (Ctrl+Shift+F). Windows, macOS and Linux.",
5
5
  "author": "PerryLink contributors",
6
6
  "repository": {
@@ -62,12 +62,12 @@
62
62
  ],
63
63
  "engines": {
64
64
  "node": "^22.19.0 || >=24.9.0",
65
- "dsh": ">=0.2.2-rc.1 <0.3.0"
65
+ "dsh": ">=0.2.1-rc.2 <0.3.0"
66
66
  },
67
67
  "packageManager": "pnpm@12.16.1",
68
68
  "peerDependencies": {
69
69
  "@deepseek-ai/cordis": "^4.0.5-alpha.1",
70
- "@deepseek-ai/dsh-tools": ">=0.2.2-0 <0.3.0",
70
+ "@deepseek-ai/dsh-tools": ">=0.2.1-0 <0.3.0",
71
71
  "@deepseek-ai/schemastery": "^3.18.5-alpha.1"
72
72
  },
73
73
  "dependencies": {},
package/src/http.ts CHANGED
@@ -15,6 +15,8 @@
15
15
  import type { Context } from '@deepseek-ai/cordis'
16
16
  import type { IncomingMessage, ServerResponse } from 'node:http'
17
17
  import type { LocatorRuntime, SearchArgs } from './runtime.ts'
18
+ import { revealInFileManager, withinRoots } from './reveal.ts'
19
+ import { statSync } from 'node:fs'
18
20
 
19
21
  interface WebServerLike {
20
22
  register(route: {
@@ -62,6 +64,11 @@ export function registerHttp(ctx: Context, rt: LocatorRuntime): void {
62
64
  path: '/dsh-locator/status',
63
65
  handler: handler(scoped, async () => await status(rt)),
64
66
  }))
67
+ scoped.effect(() => server.register({
68
+ kind: 'exact',
69
+ path: '/dsh-locator/reveal',
70
+ handler: handler(scoped, async body => await reveal(rt, body)),
71
+ }))
65
72
  })
66
73
  }
67
74
 
@@ -119,6 +126,25 @@ async function search(rt: LocatorRuntime, raw: Record<string, unknown>): Promise
119
126
  }
120
127
  }
121
128
 
129
+ async function reveal(rt: LocatorRuntime, raw: Record<string, unknown>): Promise<unknown> {
130
+ const path = typeof raw.path === 'string' ? raw.path : ''
131
+ if (path === '' || !withinRoots(path, rt.roots)) {
132
+ return { ok: false, error: 'path is outside the indexed roots' }
133
+ }
134
+ try {
135
+ const info = statSync(path)
136
+ if (!info.isFile() && !info.isDirectory()) return { ok: false, error: 'not a file or directory' }
137
+ } catch {
138
+ return { ok: false, error: 'path does not exist' }
139
+ }
140
+ try {
141
+ await revealInFileManager(path)
142
+ return { ok: true }
143
+ } catch (error) {
144
+ return { ok: false, error: messageOf(error) }
145
+ }
146
+ }
147
+
122
148
  async function status(rt: LocatorRuntime): Promise<unknown> {
123
149
  rt.start()
124
150
  const engine = await rt.engineStatus()
package/src/reveal.ts ADDED
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Reveal one indexed path in the platform file manager.
3
+ * @module dsh-locator/reveal
4
+ */
5
+
6
+ import { spawn } from 'node:child_process'
7
+ import { dirname, isAbsolute, relative, resolve } from 'node:path'
8
+
9
+ /** Whether target is one of the roots or lives below one of them. */
10
+ export function withinRoots(target: string, roots: readonly string[]): boolean {
11
+ if (!isAbsolute(target)) return false
12
+ const absolute = resolve(target)
13
+ for (const root of roots) {
14
+ const base = resolve(root)
15
+ const rel = relative(base, absolute)
16
+ if (rel === '' || (!rel.startsWith('..') && !isAbsolute(rel))) return true
17
+ }
18
+ return false
19
+ }
20
+
21
+ /**
22
+ * Ask the platform file manager to select a path. Uses an argument vector, not
23
+ * a shell, so a path can never be interpreted as a command. The child is
24
+ * detached: the opener outlives the plugin call.
25
+ */
26
+ export async function revealInFileManager(target: string): Promise<void> {
27
+ const absolute = resolve(target)
28
+ let command: string
29
+ let args: string[]
30
+ if (process.platform === 'win32') {
31
+ command = 'explorer.exe'
32
+ args = [`/select,${absolute}`]
33
+ } else if (process.platform === 'darwin') {
34
+ command = 'open'
35
+ args = ['-R', absolute]
36
+ } else {
37
+ command = 'xdg-open'
38
+ args = [dirname(absolute)]
39
+ }
40
+ await new Promise<void>((resolvePromise, reject) => {
41
+ const child = spawn(command, args, { detached: true, stdio: 'ignore', windowsHide: true })
42
+ child.once('error', reject)
43
+ child.once('spawn', () => {
44
+ child.unref()
45
+ resolvePromise()
46
+ })
47
+ })
48
+ }