nothumanallowed 10.8.0 → 10.8.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 +20 -4
- package/src/constants.mjs +1 -1
- package/src/services/web-ui.mjs +5 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "10.8.
|
|
3
|
+
"version": "10.8.2",
|
|
4
4
|
"description": "NotHumanAllowed — 38 AI agents, 53 tools. Email, calendar, browser automation, screen capture, canvas, cron/heartbeat, GitHub, Notion, Slack, voice chat, 28 languages. Zero-dependency CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/commands/ui.mjs
CHANGED
|
@@ -354,7 +354,17 @@ export async function cmdUI(args) {
|
|
|
354
354
|
const chId = url.searchParams.get('channelId');
|
|
355
355
|
if (!chId) { sendJSON(res, 400, { error: 'channelId required' }); return; }
|
|
356
356
|
const r = await fetch(ALEX_API + '/channels/' + chId + '/messages?fp=' + identity.fingerprint);
|
|
357
|
-
|
|
357
|
+
if (!r.ok) {
|
|
358
|
+
sendJSON(res, 200, { error: 'Channel not found or expired', messages: [] });
|
|
359
|
+
logRequest(method, pathname, 200, Date.now() - start);
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
let data;
|
|
363
|
+
try { data = await r.json(); } catch {
|
|
364
|
+
sendJSON(res, 200, { error: 'Invalid response from server', messages: [] });
|
|
365
|
+
logRequest(method, pathname, 200, Date.now() - start);
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
358
368
|
// Decrypt using channel key (ID + secret from local file)
|
|
359
369
|
const chFile2 = path.join(collabDir, 'channels.json');
|
|
360
370
|
let chSecret = '';
|
|
@@ -2107,12 +2117,12 @@ export async function cmdUI(args) {
|
|
|
2107
2117
|
function connectAlexandriaWs(channelId, channelName) {
|
|
2108
2118
|
if (alexWsConnections.has(channelId)) return;
|
|
2109
2119
|
try {
|
|
2110
|
-
const { WebSocket: WsClient } = require('ws');
|
|
2111
2120
|
const wsUrl = 'wss://nothumanallowed.com/ws/alexandria/' + channelId;
|
|
2112
2121
|
const alexWs = new WsClient(wsUrl);
|
|
2113
2122
|
|
|
2114
2123
|
alexWs.on('open', () => {
|
|
2115
2124
|
alexWsConnections.set(channelId, alexWs);
|
|
2125
|
+
console.log(` [Alexandria WS] Connected to channel ${channelId.slice(0, 8)}...`);
|
|
2116
2126
|
});
|
|
2117
2127
|
|
|
2118
2128
|
alexWs.on('message', (data) => {
|
|
@@ -2156,7 +2166,8 @@ export async function cmdUI(args) {
|
|
|
2156
2166
|
// Reconnect after 5s
|
|
2157
2167
|
setTimeout(() => connectAlexandriaWs(channelId, channelName), 5000);
|
|
2158
2168
|
});
|
|
2159
|
-
alexWs.on('error', () => {
|
|
2169
|
+
alexWs.on('error', (e) => {
|
|
2170
|
+
console.log(` [Alexandria WS] Error on ${channelId.slice(0, 8)}: ${e.message}`);
|
|
2160
2171
|
alexWsConnections.delete(channelId);
|
|
2161
2172
|
});
|
|
2162
2173
|
} catch {}
|
|
@@ -2168,11 +2179,16 @@ export async function cmdUI(args) {
|
|
|
2168
2179
|
const chFile = path.join(collabDir, 'channels.json');
|
|
2169
2180
|
if (fs.existsSync(chFile)) {
|
|
2170
2181
|
const channels = JSON.parse(fs.readFileSync(chFile, 'utf-8'));
|
|
2182
|
+
console.log(` [Alexandria WS] Connecting to ${channels.length} channel(s)...`);
|
|
2171
2183
|
for (const ch of channels) {
|
|
2172
2184
|
connectAlexandriaWs(ch.id, ch.name);
|
|
2173
2185
|
}
|
|
2186
|
+
} else {
|
|
2187
|
+
console.log(' [Alexandria WS] No channels file found');
|
|
2174
2188
|
}
|
|
2175
|
-
} catch {
|
|
2189
|
+
} catch (e) {
|
|
2190
|
+
console.log(` [Alexandria WS] Startup error: ${e.message}`);
|
|
2191
|
+
}
|
|
2176
2192
|
}, 2000);
|
|
2177
2193
|
|
|
2178
2194
|
} catch {
|
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 = '10.8.
|
|
8
|
+
export const VERSION = '10.8.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
|
@@ -1731,13 +1731,9 @@ function collabDeleteChannel(id){
|
|
|
1731
1731
|
function collabSelect(id){
|
|
1732
1732
|
collabActiveChannel=id;
|
|
1733
1733
|
collabLoadMessages();
|
|
1734
|
-
//
|
|
1734
|
+
// No polling — messages arrive via WebSocket in real-time
|
|
1735
1735
|
if(collabPolling)clearInterval(collabPolling);
|
|
1736
|
-
collabPolling=
|
|
1737
|
-
if(currentView==='collab'&&collabActiveChannel===id){
|
|
1738
|
-
collabLoadMessages();
|
|
1739
|
-
}
|
|
1740
|
-
},2000);
|
|
1736
|
+
collabPolling=null;
|
|
1741
1737
|
}
|
|
1742
1738
|
|
|
1743
1739
|
function collabLoadMessages(){
|
|
@@ -1747,7 +1743,9 @@ function collabLoadMessages(){
|
|
|
1747
1743
|
apiGet('/api/collab/messages?channelId='+collabActiveChannel).then(function(r){
|
|
1748
1744
|
if(r&&r.error){
|
|
1749
1745
|
var el=document.getElementById('collabMessages');
|
|
1750
|
-
if(el)el.innerHTML='<div style="text-align:center;color:var(--red);padding:20px;font-size:11px">'+esc(r.error)+'<br><span style="color:var(--dim);font-size:10px">This channel may have expired or the server was restarted.</span></div>';
|
|
1746
|
+
if(el)el.innerHTML='<div style="text-align:center;color:var(--red);padding:20px;font-size:11px">'+esc(r.error)+'<br><span style="color:var(--dim);font-size:10px">This channel may have expired or the server was restarted.<br>Delete it and create a new one.</span></div>';
|
|
1747
|
+
// Stop any polling for this dead channel
|
|
1748
|
+
if(collabPolling){clearInterval(collabPolling);collabPolling=null;}
|
|
1751
1749
|
return;
|
|
1752
1750
|
}
|
|
1753
1751
|
if(!r||!r.messages)return;
|