nothumanallowed 16.0.5 → 16.0.7
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/ws.mjs +22 -0
- package/src/ui-dist/assets/{index-CDZ036__.js → index-C5ZOpcVO.js} +2 -2
- package/src/ui-dist/assets/index-nUBdqB1O.css +1 -0
- package/src/ui-dist/index.html +2 -2
- package/src/ui-dist/assets/index-hwUKkj3l.css +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.7",
|
|
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 = '16.0.
|
|
8
|
+
export const VERSION = '16.0.7';
|
|
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/ws.mjs
CHANGED
|
@@ -29,6 +29,13 @@ export function setupWebSocket(server) {
|
|
|
29
29
|
ws.send(JSON.stringify({ type: 'connected', ts: Date.now() }));
|
|
30
30
|
ws.send(JSON.stringify({ type: 'version', version: VERSION }));
|
|
31
31
|
|
|
32
|
+
// ── Heartbeat: ping every 30 s so the OS / proxy / browser don't
|
|
33
|
+
// close the connection for inactivity. The client just discards the
|
|
34
|
+
// ping frame; pongs come back automatically per RFC 6455. We also
|
|
35
|
+
// track `isAlive` to detect stale clients and drop them.
|
|
36
|
+
ws.isAlive = true;
|
|
37
|
+
ws.on('pong', () => { ws.isAlive = true; });
|
|
38
|
+
|
|
32
39
|
ws.on('message', (data) => {
|
|
33
40
|
try {
|
|
34
41
|
const msg = JSON.parse(data.toString());
|
|
@@ -39,6 +46,21 @@ export function setupWebSocket(server) {
|
|
|
39
46
|
ws.on('error', () => {});
|
|
40
47
|
});
|
|
41
48
|
|
|
49
|
+
// Server-wide heartbeat loop: every 30 s, ping all clients and prune the ones
|
|
50
|
+
// that didn't pong since the last cycle (they're stale).
|
|
51
|
+
const heartbeatInterval = setInterval(() => {
|
|
52
|
+
if (!wss) return;
|
|
53
|
+
for (const client of wss.clients) {
|
|
54
|
+
if (client.isAlive === false) {
|
|
55
|
+
try { client.terminate(); } catch {}
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
client.isAlive = false;
|
|
59
|
+
try { client.ping(); } catch {}
|
|
60
|
+
}
|
|
61
|
+
}, 30_000);
|
|
62
|
+
wss.on('close', () => clearInterval(heartbeatInterval));
|
|
63
|
+
|
|
42
64
|
// ── Terminal WS — interactive shell ──
|
|
43
65
|
wssTerminal = new WebSocketServer({ noServer: true });
|
|
44
66
|
|