nothumanallowed 6.4.1 → 6.4.2
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/commands/ui.mjs +7 -3
- package/src/constants.mjs +1 -1
- package/src/services/web-ui.mjs +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.2",
|
|
4
4
|
"description": "NotHumanAllowed — 38 AI agents for security, code, DevOps, data & daily ops. Per-agent memory, Telegram + Discord auto-responder, proactive intelligence daemon, voice chat, plugin system.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/commands/ui.mjs
CHANGED
|
@@ -887,11 +887,12 @@ export async function cmdUI(args) {
|
|
|
887
887
|
|
|
888
888
|
const server = http.createServer(handleRequest);
|
|
889
889
|
|
|
890
|
-
// ── WebSocket
|
|
890
|
+
// ── WebSocket on separate port (3848) to avoid HTTP handler conflicts ──
|
|
891
|
+
const wsPort = port + 1; // 3848 when port is 3847
|
|
892
|
+
const wsHttpServer = http.createServer((req, res) => { res.writeHead(426); res.end(); });
|
|
891
893
|
const wsClients = new Set();
|
|
892
894
|
|
|
893
|
-
|
|
894
|
-
if (req.url !== '/ws') { socket.destroy(); return; }
|
|
895
|
+
wsHttpServer.on('upgrade', (req, socket, head) => {
|
|
895
896
|
const key = req.headers['sec-websocket-key'];
|
|
896
897
|
if (!key) { socket.destroy(); return; }
|
|
897
898
|
|
|
@@ -920,6 +921,9 @@ export async function cmdUI(args) {
|
|
|
920
921
|
socket.on('error', () => wsClients.delete(socket));
|
|
921
922
|
});
|
|
922
923
|
|
|
924
|
+
wsHttpServer.on('error', () => {}); // Silently ignore if port busy
|
|
925
|
+
wsHttpServer.listen(wsPort, HOST, () => {});
|
|
926
|
+
|
|
923
927
|
server.on('error', (err) => {
|
|
924
928
|
if (err.code === 'EADDRINUSE') {
|
|
925
929
|
fail(`Port ${port} is already in use. Try: nha ui --port=${port + 1}`);
|
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 = '6.4.
|
|
8
|
+
export const VERSION = '6.4.2';
|
|
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/services/web-ui.mjs
CHANGED
|
@@ -880,7 +880,8 @@ var ws = null;
|
|
|
880
880
|
var wsReconnectTimer = null;
|
|
881
881
|
function connectWebSocket() {
|
|
882
882
|
try {
|
|
883
|
-
|
|
883
|
+
var wsPort = parseInt(window.location.port || '3847') + 1;
|
|
884
|
+
ws = new WebSocket('ws://' + window.location.hostname + ':' + wsPort);
|
|
884
885
|
} catch(e) { return; }
|
|
885
886
|
|
|
886
887
|
ws.onopen = function() {
|