nothumanallowed 6.4.4 → 6.5.1

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.4",
3
+ "version": "6.5.1",
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": {
@@ -46,5 +46,8 @@
46
46
  "type": "git",
47
47
  "url": "https://github.com/adoslabsproject-gif/nothumanallowed"
48
48
  },
49
- "homepage": "https://nothumanallowed.com"
49
+ "homepage": "https://nothumanallowed.com",
50
+ "dependencies": {
51
+ "ws": "^8.18.0"
52
+ }
50
53
  }
@@ -398,10 +398,10 @@ async function executeTool(action, params, config) {
398
398
  function formatEvents(events) {
399
399
  return events.map((e, i) => {
400
400
  const time = e.isAllDay ? 'All day' : `${formatTime(e.start)} - ${formatTime(e.end)}`;
401
- const location = e.location ? ` | ${e.location}` : '';
401
+ const location = e.location ? ` | Location: ${e.location}` : '';
402
402
  const link = e.hangoutLink ? ` | ${e.hangoutLink}` : '';
403
403
  const cal = e.calendarName ? ` (${e.calendarName})` : '';
404
- return `${i + 1}. ${time} — ${e.summary}${location}${link}${cal}`;
404
+ return `${i + 1}. [ID:${e.id}] ${time} — ${e.summary}${location}${link}${cal}`;
405
405
  }).join('\n');
406
406
  }
407
407
 
@@ -173,7 +173,7 @@ async function executeTool(action, params, config) {
173
173
  if (events.length === 0) return 'No events scheduled for today.';
174
174
  return events.map((e, i) => {
175
175
  const time = e.isAllDay ? 'All day' : `${fmtTime(e.start)} - ${fmtTime(e.end)}`;
176
- return `${i + 1}. ${time} — ${e.summary}${e.location ? ' @ ' + e.location : ''}`;
176
+ return `${i + 1}. [ID:${e.id}] ${time} — ${e.summary}${e.location ? ' @ ' + e.location : ''}`;
177
177
  }).join('\n');
178
178
  }
179
179
  case 'calendar_upcoming': {
@@ -209,7 +209,7 @@ async function executeTool(action, params, config) {
209
209
  if (events.length === 0) return 'No events scheduled for tomorrow.';
210
210
  return events.map((e, i) => {
211
211
  const time = e.isAllDay ? 'All day' : `${fmtTime(e.start)} - ${fmtTime(e.end)}`;
212
- return `${i + 1}. ${time} — ${e.summary}${e.location ? ' @ ' + e.location : ''}`;
212
+ return `${i + 1}. [ID:${e.id}] ${time} — ${e.summary}${e.location ? ' @ ' + e.location : ''}`;
213
213
  }).join('\n');
214
214
  }
215
215
  case 'task_move': {
@@ -490,11 +490,6 @@ export async function cmdUI(args) {
490
490
  // ── Route Handlers ──────────────────────────────────────────────────────
491
491
 
492
492
  async function handleRequest(req, res) {
493
- // Skip WebSocket upgrade requests — handled by server.on('upgrade')
494
- if (req.headers.upgrade && req.headers.upgrade.toLowerCase() === 'websocket') {
495
- return; // Don't respond — let the upgrade event handle it
496
- }
497
-
498
493
  const start = Date.now();
499
494
  const url = new URL(req.url, `http://${HOST}:${port}`);
500
495
  const pathname = url.pathname;
@@ -892,37 +887,17 @@ export async function cmdUI(args) {
892
887
 
893
888
  const server = http.createServer(handleRequest);
894
889
 
895
- // ── WebSocket on same port as HTTP (upgrade handler) ──────────────────
896
- const wsClients = new Set();
897
-
898
- server.on('upgrade', (req, socket, head) => {
899
- const key = req.headers['sec-websocket-key'];
900
- if (!key) { socket.destroy(); return; }
901
-
902
- const acceptKey = crypto
903
- .createHash('sha1')
904
- .update(key + '258EAFA5-E914-47DA-95CA-5AB5DC86C11B')
905
- .digest('base64');
906
-
907
- socket.write(
908
- 'HTTP/1.1 101 Switching Protocols\r\n' +
909
- 'Upgrade: websocket\r\n' +
910
- 'Connection: Upgrade\r\n' +
911
- `Sec-WebSocket-Accept: ${acceptKey}\r\n` +
912
- '\r\n'
913
- );
914
-
915
- wsClients.add(socket);
916
-
917
- socket.on('data', (buf) => {
918
- if (buf.length < 2) return;
919
- const opcode = buf[0] & 0x0f;
920
- if (opcode === 0x08) { wsClients.delete(socket); socket.end(); }
921
- if (opcode === 0x09) { socket.write(Buffer.from([0x8a, 0])); }
890
+ // ── WebSocket via ws package (compatible with Node.js 20-24+) ──────
891
+ let wss = null;
892
+ try {
893
+ const { WebSocketServer } = await import('ws');
894
+ wss = new WebSocketServer({ server });
895
+ wss.on('connection', (ws) => {
896
+ ws.on('error', () => {});
922
897
  });
923
- socket.on('close', () => wsClients.delete(socket));
924
- socket.on('error', () => wsClients.delete(socket));
925
- });
898
+ } catch {
899
+ // ws package not available — WS disabled, everything else works
900
+ }
926
901
 
927
902
  server.on('error', (err) => {
928
903
  if (err.code === 'EADDRINUSE') {
package/src/config.mjs CHANGED
@@ -123,7 +123,18 @@ const DEFAULT_CONFIG = {
123
123
  export function loadConfig() {
124
124
  if (fs.existsSync(CONFIG_FILE)) {
125
125
  try {
126
- return JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf-8'));
126
+ const saved = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf-8'));
127
+ // Deep merge with defaults so new config sections (profile, responder, etc.)
128
+ // are always present even if the file was created before they existed
129
+ const merged = structuredClone(DEFAULT_CONFIG);
130
+ for (const [key, value] of Object.entries(saved)) {
131
+ if (typeof value === 'object' && value !== null && !Array.isArray(value) && typeof merged[key] === 'object' && merged[key] !== null) {
132
+ merged[key] = { ...merged[key], ...value };
133
+ } else {
134
+ merged[key] = value;
135
+ }
136
+ }
137
+ return merged;
127
138
  } catch {
128
139
  return structuredClone(DEFAULT_CONFIG);
129
140
  }
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.4';
8
+ export const VERSION = '6.5.1';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11