myaiforone 1.1.39 → 1.1.41

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/cli.js CHANGED
@@ -509,15 +509,25 @@ function startAndOpen() {
509
509
  console.log(' ✅ Menu bar indicator installed (xbar)');
510
510
  }
511
511
  } else if (IS_WIN) {
512
- // Launch PowerShell tray app hidden
512
+ // Copy tray script to a stable data-dir location so it survives npx cache
513
+ // updates, then register it in the Windows registry auto-start so it
514
+ // comes back after every reboot.
513
515
  const trayScript = join(PROJECT_ROOT, 'scripts', 'tray-indicator.ps1');
514
516
  if (existsSync(trayScript)) {
515
- const tray = spawn('powershell', ['-WindowStyle', 'Hidden', '-ExecutionPolicy', 'Bypass', '-File', trayScript], {
517
+ mkdirSync(DATA_DIR, { recursive: true });
518
+ const stableTray = join(DATA_DIR, 'tray-indicator.ps1');
519
+ try { copyFileSync(trayScript, stableTray); } catch { /* non-critical */ }
520
+ const launchPath = existsSync(stableTray) ? stableTray : trayScript;
521
+ const launchPathEsc = launchPath.replace(/\\/g, '\\\\');
522
+ // Register in auto-start so it persists across reboots
523
+ run(`powershell -Command "Set-ItemProperty -Path 'HKCU:\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Run' -Name 'MyAIforOneTray' -Value 'powershell -WindowStyle Hidden -ExecutionPolicy Bypass -File \\"${launchPathEsc}\\"'"`, { silent: true });
524
+ // Launch now
525
+ const tray = spawn('powershell', ['-WindowStyle', 'Hidden', '-ExecutionPolicy', 'Bypass', '-File', launchPath], {
516
526
  detached: true,
517
527
  stdio: 'ignore',
518
528
  });
519
529
  tray.unref();
520
- console.log(' ✅ System tray indicator launched');
530
+ console.log(' ✅ System tray indicator launched (auto-starts on login)');
521
531
  }
522
532
  }
523
533
  } catch {
@@ -1 +1 @@
1
- {"version":3,"file":"web-ui.d.ts","sourceRoot":"","sources":["../src/web-ui.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAa7C,UAAU,YAAY;IACpB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrG,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,qBAAqB,EAAE,aAAa,CAAC,CAAC;CACtE;AAyBD,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CA0sLnD"}
1
+ {"version":3,"file":"web-ui.d.ts","sourceRoot":"","sources":["../src/web-ui.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAa7C,UAAU,YAAY;IACpB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrG,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,qBAAqB,EAAE,aAAa,CAAC,CAAC;CACtE;AAyBD,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAgvLnD"}
package/dist/web-ui.js CHANGED
@@ -5377,6 +5377,51 @@ Project context and credentials are at: ${projectDir}/context.md and ${projectDi
5377
5377
  res.status(500).json({ error: e.message });
5378
5378
  }
5379
5379
  });
5380
+ // POST /api/open-terminal — open a system terminal with a pre-loaded command
5381
+ app.post("/api/open-terminal", (req, res) => {
5382
+ const { command } = req.body;
5383
+ if (!command?.trim())
5384
+ return res.status(400).json({ error: "command required" });
5385
+ const platform = process.platform;
5386
+ try {
5387
+ if (platform === "darwin") {
5388
+ // Open Terminal.app with the command pre-loaded (doesn't auto-run, user presses Enter)
5389
+ const escaped = command.replace(/'/g, "'\\''");
5390
+ cpSpawn("osascript", [
5391
+ "-e", `tell application "Terminal" to do script "${escaped}"`,
5392
+ "-e", `tell application "Terminal" to activate`,
5393
+ ], { stdio: "ignore" }).unref();
5394
+ }
5395
+ else if (platform === "win32") {
5396
+ cpSpawn("cmd.exe", ["/c", "start", "cmd.exe", "/k", command], {
5397
+ stdio: "ignore", detached: true, shell: false,
5398
+ }).unref();
5399
+ }
5400
+ else {
5401
+ // Linux: try common terminal emulators
5402
+ const terminals = ["gnome-terminal", "xterm", "konsole", "xfce4-terminal"];
5403
+ let launched = false;
5404
+ for (const term of terminals) {
5405
+ try {
5406
+ cpSpawn(term, ["--", "bash", "-c", `${command}; exec bash`], {
5407
+ stdio: "ignore", detached: true,
5408
+ }).unref();
5409
+ launched = true;
5410
+ break;
5411
+ }
5412
+ catch {
5413
+ continue;
5414
+ }
5415
+ }
5416
+ if (!launched)
5417
+ return res.status(500).json({ error: "No terminal emulator found. Run the command manually." });
5418
+ }
5419
+ res.json({ ok: true });
5420
+ }
5421
+ catch (e) {
5422
+ res.status(500).json({ error: e.message });
5423
+ }
5424
+ });
5380
5425
  // ─── API: Skills ────────────────────────────────────────────────────
5381
5426
  // GET /api/agents/:agentId/skills — list all skills available to an agent
5382
5427
  app.get("/api/agents/:agentId/skills", (req, res) => {