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.
- package/package.json +1 -1
- package/src/tools/delegate.js +653 -653
- package/src/tools/files.js +18 -15
package/src/tools/files.js
CHANGED
|
@@ -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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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')
|