dsh-mesh-node 0.0.8 → 0.0.9

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.
@@ -154,21 +154,24 @@ function findFiles(ctx, { query, root, limit = 100, exts = null, minSizeBytes =
154
154
  if (exts?.length) args.push('-r', `.*\\.(${exts.map((e) => String(e).replace(/^\\./, '')).join('|')})$`)
155
155
  args.push(String(query || ''))
156
156
  const r = spawnSync(es.path, args, { encoding: 'utf8', windowsHide: true, timeout: 15000 })
157
- try {
158
- const rows = JSON.parse(r.stdout || '[]')
159
- return ok({
160
- tool: 'everything',
161
- count: rows.length,
162
- entries: rows.slice(0, 500).map((row) => ({
163
- path: String(row.path || row.full_path || ''),
164
- name: String(row.name || basename(String(row.path || ''))),
165
- type: Number(row.type) === 2 ? 'dir' : 'file',
166
- sizeBytes: row.size == null ? null : Number(row.size),
167
- mtimeMs: isoMs(row.date_modified)
168
- }))
169
- })
170
- } catch {
171
- /* fallthrough */
157
+ // es.exe 在 session 0 连不上 Everything IPC 时退出码非 0(stderr: Error 8),必须回退 fd/walk
158
+ if (r.status === 0) {
159
+ try {
160
+ const rows = JSON.parse(r.stdout || '[]')
161
+ return ok({
162
+ tool: 'everything',
163
+ count: rows.length,
164
+ entries: rows.slice(0, 500).map((row) => ({
165
+ path: String(row.path || row.full_path || ''),
166
+ name: String(row.name || basename(String(row.path || ''))),
167
+ type: Number(row.type) === 2 ? 'dir' : 'file',
168
+ sizeBytes: row.size == null ? null : Number(row.size),
169
+ mtimeMs: isoMs(row.date_modified)
170
+ }))
171
+ })
172
+ } catch {
173
+ /* fallthrough */
174
+ }
172
175
  }
173
176
  }
174
177
  const fd = toolInfo('fd')