myaiforone 1.1.38 → 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.
package/bin/cli.js CHANGED
@@ -202,7 +202,7 @@ async function runClaudeAuth(version) {
202
202
  console.log(' B) Show a URL + code — copy the URL, open it, sign in, paste the code back');
203
203
  console.log('');
204
204
 
205
- if (IS_WINDOWS) {
205
+ if (IS_WIN) {
206
206
  // On Windows, the code-paste prompt can get stuck. Give it 60 seconds —
207
207
  // enough for the browser auto-open flow to complete. If stuck, times out
208
208
  // and setup continues. User can run "claude auth login" later in a fresh terminal.
@@ -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) => {