nothumanallowed 13.5.174 → 13.5.175

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": "13.5.174",
3
+ "version": "13.5.175",
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": {
@@ -2814,7 +2814,12 @@ export async function cmdUI(args) {
2814
2814
  const browserThumbs = res._browserThumbs || [];
2815
2815
  sendSSE('done', { content: finalResponse, screenshotFiles: ssFiles, browserThumbs, inlineHtml: inlineEmbeds || '' });
2816
2816
  } catch (e) {
2817
- sendSSE('error', { message: e.message });
2817
+ // SENTINEL blocked — send done with flag so client shows message but does NOT save to history
2818
+ if (e.__sentinel_blocked) {
2819
+ sendSSE('done', { content: e.message, __sentinel_blocked: true, screenshotFiles: [], browserThumbs: [], inlineHtml: '' });
2820
+ } else {
2821
+ sendSSE('error', { message: e.message });
2822
+ }
2818
2823
  }
2819
2824
 
2820
2825
  res.end();
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 = '13.5.174';
8
+ export const VERSION = '13.5.175';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -563,6 +563,14 @@ export async function callLLMStream(config, systemPrompt, userMessage, onToken,
563
563
  }
564
564
  // Non-streaming: vLLM returns complete text — no BPE subword splitting issues
565
565
  const nhaJson = await nhaRes.json();
566
+ // SENTINEL blocked — throw special error so caller skips conversation persistence
567
+ if (nhaJson.__sentinel_blocked) {
568
+ const blockedMsg = nhaJson.choices?.[0]?.message?.content || 'Message blocked by SENTINEL.';
569
+ if (onToken) onToken(blockedMsg);
570
+ const err = new Error(blockedMsg);
571
+ err.__sentinel_blocked = true;
572
+ throw err;
573
+ }
566
574
  let fullNhaText = nhaJson.choices?.[0]?.message?.content || '';
567
575
  // Strip <think>...</think> blocks
568
576
  fullNhaText = fullNhaText.replace(/<think>[\s\S]*?<\/think>/g, '').trim();
@@ -1036,7 +1036,7 @@ function sendChat(){
1036
1036
  if(data.markers.indexOf('[CANVAS_CLEAR]')!==-1)closeCanvas();
1037
1037
  }
1038
1038
  if(currentEvent==='tool_synthesis'){chatHistory[streamIdx].content='';renderMessages();}
1039
- if(currentEvent==='done'){endStreaming();if(data.content){chatHistory[streamIdx].content=data.content.replace(/<think>[\\s\\S]*?<\\/think>/g,'').trim();}else{chatHistory[streamIdx].content=chatHistory[streamIdx].content.replace(/<think>[\\s\\S]*?<\\/think>/g,'').trim();}var ssf=data.screenshotFiles||[];for(var fi=0;fi<ssf.length;fi++){chatHistory[streamIdx].content+='\\n![Screenshot](/api/screenshots/'+ssf[fi]+')\\n';}if(data.inlineHtml){chatHistory[streamIdx].inlineHtml=data.inlineHtml;}var bt=data.browserThumbs||[];if(bt.length>0){var cd=getConvCanvasData();for(var bti=0;bti<bt.length;bti++){var exists=cd.browsers.some(function(b){return b.file===bt[bti].file;});if(!exists)cd.browsers.push({file:bt[bti].file,url:bt[bti].url,ts:new Date().toLocaleTimeString()});}browserIdx=cd.browsers.length-1;saveCanvasData();}renderMessages();loadConvList();if(activeConvId){setTimeout(function(){loadConv(activeConvId);},500);}}
1039
+ if(currentEvent==='done'){endStreaming();if(data.__sentinel_blocked){chatHistory.splice(streamIdx-1,2);var sentinelWarn=data.content||'Message blocked by SENTINEL.';var el=document.getElementById('chatMessages');if(el){var warn=document.createElement('div');warn.className='msg msg--assistant';warn.style.cssText='border-left:3px solid #ff9800;margin:8px 0;opacity:0.85';warn.innerHTML='<div class="msg__label">SENTINEL</div><div class="msg__bubble md-body" style="color:#ff9800">'+esc(sentinelWarn)+'</div>';el.appendChild(warn);el.scrollTop=el.scrollHeight;}renderMessages();return;}if(data.content){chatHistory[streamIdx].content=data.content.replace(/<think>[\\s\\S]*?<\\/think>/g,'').trim();}else{chatHistory[streamIdx].content=chatHistory[streamIdx].content.replace(/<think>[\\s\\S]*?<\\/think>/g,'').trim();}var ssf=data.screenshotFiles||[];for(var fi=0;fi<ssf.length;fi++){chatHistory[streamIdx].content+='\\n![Screenshot](/api/screenshots/'+ssf[fi]+')\\n';}if(data.inlineHtml){chatHistory[streamIdx].inlineHtml=data.inlineHtml;}var bt=data.browserThumbs||[];if(bt.length>0){var cd=getConvCanvasData();for(var bti=0;bti<bt.length;bti++){var exists=cd.browsers.some(function(b){return b.file===bt[bti].file;});if(!exists)cd.browsers.push({file:bt[bti].file,url:bt[bti].url,ts:new Date().toLocaleTimeString()});}browserIdx=cd.browsers.length-1;saveCanvasData();}renderMessages();loadConvList();if(activeConvId){setTimeout(function(){loadConv(activeConvId);},500);}}
1040
1040
  if(currentEvent==='error'){endStreaming();chatHistory[streamIdx].content='Error: '+(data.message||'Unknown');renderMessages();}
1041
1041
  }catch(e){}
1042
1042
  }