nothumanallowed 6.3.2 → 6.3.4

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.3.2",
3
+ "version": "6.3.4",
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": {
@@ -9,6 +9,7 @@
9
9
 
10
10
  import http from 'http';
11
11
  import os from 'os';
12
+ import crypto from 'crypto';
12
13
  import { exec } from 'child_process';
13
14
  import fs from 'fs';
14
15
  import path from 'path';
@@ -868,6 +869,57 @@ export async function cmdUI(args) {
868
869
 
869
870
  const server = http.createServer(handleRequest);
870
871
 
872
+ // ── WebSocket server on port 3848 (so the frontend can connect) ──────
873
+ const wsServer = http.createServer((req, res) => {
874
+ if (req.url === '/health') {
875
+ res.writeHead(200, { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*' });
876
+ res.end(JSON.stringify({ ok: true }));
877
+ return;
878
+ }
879
+ res.writeHead(404);
880
+ res.end();
881
+ });
882
+
883
+ const wsClients = new Set();
884
+
885
+ wsServer.on('upgrade', (req, socket, head) => {
886
+ const key = req.headers['sec-websocket-key'];
887
+ if (!key) { socket.destroy(); return; }
888
+
889
+ const acceptKey = crypto
890
+ .createHash('sha1')
891
+ .update(key + '258EAFA5-E914-47DA-95CA-5AB5DC86C11B')
892
+ .digest('base64');
893
+
894
+ socket.write(
895
+ 'HTTP/1.1 101 Switching Protocols\r\n' +
896
+ 'Upgrade: websocket\r\n' +
897
+ 'Connection: Upgrade\r\n' +
898
+ `Sec-WebSocket-Accept: ${acceptKey}\r\n` +
899
+ '\r\n'
900
+ );
901
+
902
+ wsClients.add(socket);
903
+
904
+ socket.on('data', (buf) => {
905
+ if (buf.length < 2) return;
906
+ const opcode = buf[0] & 0x0f;
907
+ if (opcode === 0x08) { wsClients.delete(socket); socket.end(); }
908
+ if (opcode === 0x09) { socket.write(Buffer.from([0x8a, 0])); }
909
+ });
910
+ socket.on('close', () => wsClients.delete(socket));
911
+ socket.on('error', () => wsClients.delete(socket));
912
+ });
913
+
914
+ wsServer.on('error', (err) => {
915
+ if (err.code === 'EADDRINUSE') {
916
+ // Daemon already has it — that's fine, frontend will connect to daemon
917
+ return;
918
+ }
919
+ });
920
+
921
+ wsServer.listen(3848, '127.0.0.1', () => {});
922
+
871
923
  server.on('error', (err) => {
872
924
  if (err.code === 'EADDRINUSE') {
873
925
  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.3.2';
8
+ export const VERSION = '6.3.4';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -655,16 +655,16 @@ function renderSettings(el) {
655
655
 
656
656
  el.innerHTML = '<div style="max-width:600px;margin:0 auto">' +
657
657
  settingsSection('profile', 'User Profile', 'Agents use this when you say "my home", "my city", etc.', [
658
- ['name', 'Name', 'Your full name'],
659
- ['email', 'Email', 'your@email.com'],
660
- ['phone', 'Phone', '+39 ...'],
661
- ['home-address', 'Home Address', 'Via Roma 1, Modena'],
662
- ['work-address', 'Work Address', 'Via Ufficio 10, Modena'],
663
- ['city', 'City', 'Modena'],
664
- ['country', 'Country', 'Italy'],
665
- ['company', 'Company', 'Your company'],
666
- ['role', 'Role', 'Your role'],
667
- ['profile-notes', 'Notes', 'Anything agents should know about you'],
658
+ ['name', 'Name', 'e.g. John Smith'],
659
+ ['email', 'Email', 'e.g. john@example.com'],
660
+ ['phone', 'Phone', 'e.g. +1 555 123 4567'],
661
+ ['home-address', 'Home Address', 'e.g. 123 Main St, New York'],
662
+ ['work-address', 'Work Address', 'e.g. 456 Office Blvd, New York'],
663
+ ['city', 'City', 'e.g. New York'],
664
+ ['country', 'Country', 'e.g. USA'],
665
+ ['company', 'Company', 'e.g. Acme Inc'],
666
+ ['role', 'Role', 'e.g. Software Engineer'],
667
+ ['profile-notes', 'Notes', 'Anything else agents should know about you'],
668
668
  ]) +
669
669
  settingsSection('llm', 'LLM Provider', 'The AI model that powers your agents.', [
670
670
  ['provider', 'Provider', 'anthropic / openai / gemini / deepseek / grok / mistral'],