orchestrating 0.1.26 → 0.1.27

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 +36 -4
  2. package/package.json +1 -1
package/bin/orch CHANGED
@@ -179,12 +179,20 @@ if (firstArg === "logout") {
179
179
  }
180
180
 
181
181
  if (firstArg === "daemon") {
182
- await handleDaemon();
182
+ // Parse daemon flags: orch daemon [--projects <path>]
183
+ const daemonArgs = process.argv.slice(3);
184
+ let projectsDir = null;
185
+ for (let di = 0; di < daemonArgs.length; di++) {
186
+ if ((daemonArgs[di] === "--projects" || daemonArgs[di] === "-d") && daemonArgs[di + 1]) {
187
+ projectsDir = daemonArgs[++di];
188
+ }
189
+ }
190
+ await handleDaemon(projectsDir);
183
191
  // handleDaemon runs forever (or exits on fatal error)
184
192
  }
185
193
 
186
194
  // --- Daemon mode ---
187
- async function handleDaemon() {
195
+ async function handleDaemon(projectsDir) {
188
196
  const DIM = "\x1b[2m";
189
197
  const GREEN = "\x1b[32m";
190
198
  const RED = "\x1b[31m";
@@ -218,7 +226,25 @@ async function handleDaemon() {
218
226
  let pongTimer = null;
219
227
  let reconnectTimer = null;
220
228
 
229
+ // Scan project directories
230
+ const homeDir = os.homedir();
231
+ const scanRoot = projectsDir || path.join(homeDir, "projects");
232
+ let directories = [];
233
+ try {
234
+ const { readdirSync, statSync } = await import("fs");
235
+ const entries = readdirSync(scanRoot);
236
+ directories = entries
237
+ .filter((e) => !e.startsWith("."))
238
+ .map((e) => path.join(scanRoot, e))
239
+ .filter((p) => { try { return statSync(p).isDirectory(); } catch { return false; } })
240
+ .sort();
241
+ } catch {
242
+ // scanRoot doesn't exist — fall back to home dir
243
+ directories = [homeDir];
244
+ }
245
+
221
246
  process.stderr.write(`${GREEN}${PREFIX} Listening for remote sessions as "${hostname}"${RESET}\n`);
247
+ process.stderr.write(`${DIM}${PREFIX} Projects: ${scanRoot} (${directories.length} dirs)${RESET}\n`);
222
248
  process.stderr.write(`${DIM}${PREFIX} Tip: Use 'nohup orch daemon &' to run in background${RESET}\n`);
223
249
 
224
250
  let reconnecting = false;
@@ -260,6 +286,7 @@ async function handleDaemon() {
260
286
  token,
261
287
  hostname,
262
288
  cliVersion,
289
+ directories,
263
290
  }));
264
291
  process.stderr.write(`${GREEN}${PREFIX} Connected${RESET}\n`);
265
292
 
@@ -416,8 +443,12 @@ while (i < args.length) {
416
443
  console.error(" orch logout — Clear stored credentials");
417
444
  console.error(" orch daemon — Run background daemon for remote session launching");
418
445
  console.error("");
419
- console.error(" -l <label> Optional human-readable session label");
420
- console.error(" -y, --yolo Skip all permission prompts (auto-approve everything)");
446
+ console.error(" -l <label> Optional human-readable session label");
447
+ console.error(" -y, --yolo Skip all permission prompts (auto-approve everything)");
448
+ console.error("");
449
+ console.error("Daemon options:");
450
+ console.error(" --projects <path> Directory to scan for projects (default: ~/projects)");
451
+ console.error(" -d <path> Short alias for --projects");
421
452
  console.error("");
422
453
  console.error("Examples:");
423
454
  console.error(' orch claude "refactor auth"');
@@ -425,6 +456,7 @@ while (i < args.length) {
425
456
  console.error(' orch -l "deploy fix" codex');
426
457
  console.error(" orch bash");
427
458
  console.error(" orch daemon");
459
+ console.error(" orch daemon --projects ~/work");
428
460
  console.error("");
429
461
  console.error("Environment:");
430
462
  console.error(" ORC_URL WebSocket server URL (default: wss://api.orchestrat.ing/ws)");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orchestrating",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "description": "Stream terminal sessions to the orchestrat.ing dashboard",
5
5
  "type": "module",
6
6
  "bin": {