nothumanallowed 6.4.0 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nothumanallowed",
3
- "version": "6.4.0",
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": {
@@ -533,8 +533,8 @@ export async function cmdUI(args) {
533
533
  return;
534
534
  }
535
535
 
536
- // ── Favicon (no-content) ──────────────────────────────────────────
537
- if (pathname === '/favicon.ico') {
536
+ // ── Favicon + Apple touch icons (no-content, suppress 404) ────────
537
+ if (pathname === '/favicon.ico' || pathname.startsWith('/apple-touch-icon')) {
538
538
  res.writeHead(204);
539
539
  res.end();
540
540
  return;
@@ -887,11 +887,12 @@ export async function cmdUI(args) {
887
887
 
888
888
  const server = http.createServer(handleRequest);
889
889
 
890
- // ── WebSocket integrated in main server (same port, /ws path) ──────
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
- server.on('upgrade', (req, socket, head) => {
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.0';
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
 
@@ -724,7 +724,7 @@ function renderSettings(el) {
724
724
  }
725
725
 
726
726
  function settingsSection(id, title, desc, fields) {
727
- var h = '<div class="card" style="margin-bottom:16px" id="settings-' + id + '">' +
727
+ var h = '<form class="card" style="margin-bottom:16px" id="settings-' + id + '" onsubmit="event.preventDefault();saveSettingsSection(\\x27' + id + '\\x27)">' +
728
728
  '<div class="card__title" style="color:var(--green);font-size:14px;margin-bottom:4px">' + esc(title) + '</div>' +
729
729
  '<div style="font-size:11px;color:var(--dim);margin-bottom:12px">' + esc(desc) + '</div>';
730
730
 
@@ -753,7 +753,7 @@ function settingsSection(id, title, desc, fields) {
753
753
  '<span id="settings-status-' + id + '" style="font-size:11px;color:var(--dim)"></span>' +
754
754
  '</div>';
755
755
 
756
- h += '</div>';
756
+ h += '</form>';
757
757
  return h;
758
758
  }
759
759
 
@@ -880,7 +880,8 @@ var ws = null;
880
880
  var wsReconnectTimer = null;
881
881
  function connectWebSocket() {
882
882
  try {
883
- ws = new WebSocket('ws://' + window.location.host + '/ws');
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() {