nothumanallowed 12.5.4 → 12.5.5

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": "12.5.4",
3
+ "version": "12.5.5",
4
4
  "description": "NotHumanAllowed — 38 AI agents, 80 tools. 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 = '12.5.4';
8
+ export const VERSION = '12.5.5';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -939,7 +939,15 @@ function sendChat(){
939
939
  var payload={message:msg,history:allHistory,conversationId:activeConvId,isRetry:isRetry};
940
940
 
941
941
  fetch(API+'/api/chat/stream',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(payload),signal:chatAbortController.signal}).then(function(response){
942
- if(!response.ok||!response.body){chatHistory[streamIdx].content='Error: connection failed';endStreaming();renderMessages();return;}
942
+ if(!response.ok||!response.body||typeof response.body.getReader!=='function'){
943
+ // Fallback for browsers without ReadableStream support — use non-streaming endpoint
944
+ chatHistory[streamIdx].content='Thinking...';renderMessages();
945
+ apiPost('/api/chat',{message:msg,history:allHistory,conversationId:activeConvId,isRetry:isRetry}).then(function(r){
946
+ chatHistory[streamIdx].content=(r&&r.response)||(r&&r.error?'Error: '+r.error:'Error: no response');
947
+ endStreaming();renderMessages();loadConvList();
948
+ });
949
+ return;
950
+ }
943
951
  var reader=response.body.getReader();var decoder=new TextDecoder();var buffer='';var currentEvent='';
944
952
  function pump(){
945
953
  reader.read().then(function(result){
@@ -2465,7 +2473,9 @@ function askAgent(){
2465
2473
  }
2466
2474
 
2467
2475
  apiPost('/api/ask', payload).then(function(r){
2468
- resp.textContent=(r&&r.response)||'Error: no response';
2476
+ if(r&&r.error) resp.textContent='Error: '+r.error;
2477
+ else if(r&&r.response) resp.textContent=r.response;
2478
+ else resp.textContent='Error: no response. Run "nha update" in Termux to download agents.';
2469
2479
  // Reset file after ask
2470
2480
  attachedFileContent = null;
2471
2481
  attachedFileName = null;