nothumanallowed 10.7.0 → 10.8.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": "10.7.0",
3
+ "version": "10.8.1",
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": {
@@ -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
- const data = await r.json();
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 = '';
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.7.0';
8
+ export const VERSION = '10.8.1';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -1720,12 +1720,10 @@ function collabJoinChannel(){
1720
1720
 
1721
1721
  function collabDeleteChannel(id){
1722
1722
  if(!confirm('Delete this channel? Messages will be lost.'))return;
1723
- // Remove from local file
1724
1723
  collabChannels=collabChannels.filter(function(c){return c.id!==id});
1725
- apiPost('/api/collab/channels',{id:'__delete__'+id}).catch(function(){});
1726
- // Delete from server
1727
- fetch(API+'/api/collab/delete',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({channelId:id})}).catch(function(){});
1728
- if(collabActiveChannel===id)collabActiveChannel=null;
1724
+ // Call delete endpoint on local server
1725
+ apiPost('/api/collab/delete',{channelId:id}).catch(function(){});
1726
+ if(collabActiveChannel===id){collabActiveChannel=null;if(collabPolling)clearInterval(collabPolling);}
1729
1727
  renderCollabChannelList();
1730
1728
  var msgEl=document.getElementById('collabMessages');
1731
1729
  if(msgEl)msgEl.innerHTML='<div style="text-align:center;color:var(--dim);padding:40px;font-size:12px">Channel deleted</div>';
@@ -1733,13 +1731,9 @@ function collabDeleteChannel(id){
1733
1731
  function collabSelect(id){
1734
1732
  collabActiveChannel=id;
1735
1733
  collabLoadMessages();
1736
- // Auto-refresh every 2s while channel is selected
1734
+ // No polling messages arrive via WebSocket in real-time
1737
1735
  if(collabPolling)clearInterval(collabPolling);
1738
- collabPolling=setInterval(function(){
1739
- if(currentView==='collab'&&collabActiveChannel===id){
1740
- collabLoadMessages();
1741
- }
1742
- },2000);
1736
+ collabPolling=null;
1743
1737
  }
1744
1738
 
1745
1739
  function collabLoadMessages(){
@@ -1749,7 +1743,9 @@ function collabLoadMessages(){
1749
1743
  apiGet('/api/collab/messages?channelId='+collabActiveChannel).then(function(r){
1750
1744
  if(r&&r.error){
1751
1745
  var el=document.getElementById('collabMessages');
1752
- 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;}
1753
1749
  return;
1754
1750
  }
1755
1751
  if(!r||!r.messages)return;