myaiforone 1.1.39 → 1.1.40

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.
@@ -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) => {