nothumanallowed 14.1.15 → 14.1.17
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 +1 -1
- package/src/constants.mjs +1 -1
- package/src/server/index.mjs +20 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.17",
|
|
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.1.
|
|
8
|
+
export const VERSION = '14.1.17';
|
|
9
9
|
export const BASE_URL = 'https://nothumanallowed.com/cli';
|
|
10
10
|
export const API_BASE = 'https://nothumanallowed.com/api/v1';
|
|
11
11
|
|
package/src/server/index.mjs
CHANGED
|
@@ -290,14 +290,32 @@ async function handleRequest(req, res) {
|
|
|
290
290
|
export async function startServer({ port = 3847, host = '127.0.0.1', noBrowser = false } = {}) {
|
|
291
291
|
_router = await buildRouter();
|
|
292
292
|
const { setupWebSocket } = await import('./ws.mjs');
|
|
293
|
+
const { execSync } = await import('child_process');
|
|
294
|
+
|
|
295
|
+
// Kill any existing process on the port before binding
|
|
296
|
+
try {
|
|
297
|
+
const pids = execSync(`lsof -ti tcp:${port} 2>/dev/null || true`).toString().trim();
|
|
298
|
+
if (pids) {
|
|
299
|
+
pids.split('\n').filter(Boolean).forEach((p) => {
|
|
300
|
+
try { process.kill(parseInt(p), 'SIGTERM'); } catch {}
|
|
301
|
+
});
|
|
302
|
+
await new Promise((r) => setTimeout(r, 900));
|
|
303
|
+
}
|
|
304
|
+
} catch {}
|
|
293
305
|
|
|
294
306
|
const server = http.createServer(handleRequest);
|
|
295
|
-
setupWebSocket(server);
|
|
296
307
|
|
|
308
|
+
// Attach WebSocket AFTER HTTP server is listening to avoid WS error events
|
|
297
309
|
await new Promise((resolve, reject) => {
|
|
298
|
-
server.
|
|
310
|
+
server.once('error', reject);
|
|
311
|
+
server.listen(port, host, () => {
|
|
312
|
+
server.removeListener('error', reject);
|
|
313
|
+
resolve(undefined);
|
|
314
|
+
});
|
|
299
315
|
});
|
|
300
316
|
|
|
317
|
+
setupWebSocket(server);
|
|
318
|
+
|
|
301
319
|
const G = '\x1b[0;32m', NC = '\x1b[0m', D = '\x1b[2m', BOLD = '\x1b[1m';
|
|
302
320
|
const { VERSION } = await import('../constants.mjs');
|
|
303
321
|
console.log(`\n ${BOLD}${G}NHA${NC} ${D}v${VERSION}${NC}`);
|