orchestrating 0.1.30 → 0.1.31
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/bin/orch +32 -0
- package/package.json +1 -1
package/bin/orch
CHANGED
|
@@ -372,6 +372,38 @@ async function handleDaemon(projectsDir) {
|
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
|
+
|
|
376
|
+
if (msg.type === "browse_directory") {
|
|
377
|
+
const { requestId: browseReqId, path: dirPath } = msg;
|
|
378
|
+
try {
|
|
379
|
+
const entries = readdirSync(dirPath)
|
|
380
|
+
.filter((e) => !e.startsWith("."))
|
|
381
|
+
.map((e) => {
|
|
382
|
+
const full = path.join(dirPath, e);
|
|
383
|
+
try { return statSync(full).isDirectory() ? full : null; } catch { return null; }
|
|
384
|
+
})
|
|
385
|
+
.filter(Boolean)
|
|
386
|
+
.sort();
|
|
387
|
+
if (sock.readyState === WebSocket.OPEN) {
|
|
388
|
+
sock.send(JSON.stringify({
|
|
389
|
+
type: "directory_listing",
|
|
390
|
+
requestId: browseReqId,
|
|
391
|
+
path: dirPath,
|
|
392
|
+
directories: entries,
|
|
393
|
+
}));
|
|
394
|
+
}
|
|
395
|
+
} catch (err) {
|
|
396
|
+
if (sock.readyState === WebSocket.OPEN) {
|
|
397
|
+
sock.send(JSON.stringify({
|
|
398
|
+
type: "directory_listing",
|
|
399
|
+
requestId: browseReqId,
|
|
400
|
+
path: dirPath,
|
|
401
|
+
directories: [],
|
|
402
|
+
error: err.message,
|
|
403
|
+
}));
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
375
407
|
});
|
|
376
408
|
|
|
377
409
|
sock.on("close", () => {
|