orchestrating 0.1.29 → 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.
Files changed (2) hide show
  1. package/bin/orch +35 -1
  2. 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", () => {
@@ -814,7 +846,9 @@ if (adapter) {
814
846
  }
815
847
  if (historyEvents.length > 0) {
816
848
  process.stderr.write(`${DIM}[orch] Forwarding ${historyEvents.length} history events to dashboard${RESET}\n`);
817
- sendToServer({ type: "agent_history_replay", sessionId, events: historyEvents });
849
+ // Prepend to eventHistory so they get replayed on reconnect too
850
+ eventHistory.unshift(...historyEvents);
851
+ while (eventHistory.length > MAX_EVENT_HISTORY) eventHistory.pop();
818
852
  }
819
853
  }
820
854
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orchestrating",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "description": "Stream terminal sessions to the orchestrat.ing dashboard",
5
5
  "type": "module",
6
6
  "bin": {