nothumanallowed 14.3.5 → 14.3.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nothumanallowed",
3
- "version": "14.3.5",
3
+ "version": "14.3.6",
4
4
  "description": "NotHumanAllowed — 38 AI agents, 80 tools, Studio (visual agentic workflows). Email, calendar, browser automation, screen capture, canvas, cron/heartbeat, Alexandria E2E messaging, GitHub, Notion, Slack, voice chat, free AI (Liara), 28 languages. Zero-dependency CLI.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/constants.mjs CHANGED
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'url';
5
5
  const __filename = fileURLToPath(import.meta.url);
6
6
  const __dirname = path.dirname(__filename);
7
7
 
8
- export const VERSION = '14.3.5';
8
+ export const VERSION = '14.3.6';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -117,19 +117,18 @@ export function register(router) {
117
117
  }
118
118
  } catch { /* daemon restart is best-effort */ }
119
119
 
120
- // Self-restart: launch a shell script that waits for us to die, then starts nha ui.
121
- // This avoids the port-in-use race condition.
122
- // Detect current port from the server's address
120
+ // Self-restart: write a temp script, run it with nohup, then exit.
121
+ // This survives parent death on macOS/Linux/Windows.
123
122
  let port = '3847';
124
123
  try { port = String(req.socket?.localPort || 3847); } catch {}
125
- const { spawn } = await import('child_process');
126
- const restartScript = `sleep 2 && nha ui --port ${port}`;
127
- const child = spawn('sh', ['-c', restartScript], {
128
- detached: true,
124
+ const os = await import('os');
125
+ const tmpScript = path.join(os.default.tmpdir(), '.nha-restart.sh');
126
+ fs.writeFileSync(tmpScript, `#!/bin/sh\nsleep 3\nnha ui --port ${port}\n`, { mode: 0o755 });
127
+ execSync(`nohup ${tmpScript} > /dev/null 2>&1 &`, {
128
+ timeout: 3000,
129
129
  stdio: 'ignore',
130
- env: { ...process.env, NHA_RESTARTED: '1' },
130
+ shell: true,
131
131
  });
132
- child.unref();
133
132
  } catch { /* ignore errors */ }
134
133
  process.exit(0);
135
134
  }, 1500);