nothumanallowed 12.4.1 → 12.5.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 +1 -1
- package/src/commands/ui.mjs +5 -3
- package/src/constants.mjs +1 -1
- package/src/services/web-ui.mjs +45 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.5.1",
|
|
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/commands/ui.mjs
CHANGED
|
@@ -2074,12 +2074,14 @@ export async function cmdUI(args) {
|
|
|
2074
2074
|
// Extract memory
|
|
2075
2075
|
try { extractMemory('chat', msg, finalResponse); } catch {}
|
|
2076
2076
|
|
|
2077
|
-
//
|
|
2078
|
-
if (inlineEmbeds)
|
|
2077
|
+
// Send inline embeds (search cards, browser frames) via SSE
|
|
2078
|
+
if (inlineEmbeds) {
|
|
2079
|
+
sendSSE('inline_embeds', { html: inlineEmbeds });
|
|
2080
|
+
}
|
|
2079
2081
|
|
|
2080
2082
|
const ssFiles = res._screenshotFiles || [];
|
|
2081
2083
|
const browserThumbs = res._browserThumbs || [];
|
|
2082
|
-
sendSSE('done', { content: finalResponse, screenshotFiles: ssFiles, browserThumbs });
|
|
2084
|
+
sendSSE('done', { content: finalResponse, screenshotFiles: ssFiles, browserThumbs, inlineHtml: inlineEmbeds || '' });
|
|
2083
2085
|
} catch (e) {
|
|
2084
2086
|
sendSSE('error', { message: e.message });
|
|
2085
2087
|
}
|
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.
|
|
8
|
+
export const VERSION = '12.5.0';
|
|
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
|
@@ -14,7 +14,7 @@ export function getHTML(port) {
|
|
|
14
14
|
--bg:#0a0a0a;--bg2:#111;--bg3:#1a1a1a;--bg4:#222;
|
|
15
15
|
--green:#00ff41;--green2:#00cc33;--green3:#00aa28;--greendim:#0a3a12;
|
|
16
16
|
--cyan:#00e5ff;--amber:#ffb300;--red:#ff1744;
|
|
17
|
-
--text:#
|
|
17
|
+
--text:#d4d4d8;--dim:#9ca3af;--bright:#fff;
|
|
18
18
|
--border:#1e1e1e;--border2:#333;
|
|
19
19
|
--font:'JetBrains Mono','Fira Code','SF Mono','Consolas',monospace;
|
|
20
20
|
--r:6px;
|
|
@@ -93,7 +93,7 @@ input:focus,textarea:focus{border-color:var(--green3)}
|
|
|
93
93
|
.chat__empty-hint{font-size:11px;margin-top:12px}
|
|
94
94
|
.msg{margin-bottom:12px}
|
|
95
95
|
.msg--user .msg__bubble{background:var(--bg3);border:1px solid var(--border2);border-radius:8px 8px 2px 8px;padding:10px 14px;max-width:85%;margin-left:auto;color:var(--bright)}
|
|
96
|
-
.msg--assistant .msg__bubble{background:var(--greendim);border:1px solid var(--green3);border-radius:8px 8px 8px 2px;padding:10px 14px;max-width:85%;color:var(--text);white-space:pre-wrap;word-wrap:break-word}
|
|
96
|
+
.msg--assistant .msg__bubble{background:var(--greendim);border:1px solid var(--green3);border-radius:8px 8px 8px 2px;padding:10px 14px;max-width:85%;color:var(--text);white-space:pre-wrap;word-wrap:break-word;line-height:1.5}
|
|
97
97
|
.msg--assistant .msg__bubble img{max-width:100%;border-radius:8px;margin:8px 0;border:1px solid rgba(0,255,65,0.2)}
|
|
98
98
|
.msg__label{font-size:10px;color:var(--dim);margin-bottom:2px}
|
|
99
99
|
.msg__actions{display:flex;gap:6px;margin-top:4px;opacity:0.4;transition:opacity 0.2s}
|
|
@@ -135,9 +135,21 @@ input:focus,textarea:focus{border-color:var(--green3)}
|
|
|
135
135
|
@media(max-width:600px){.browser-viewer{width:calc(100vw - 24px);top:8px;left:8px}}
|
|
136
136
|
@media(min-width:901px){.browser-viewer{left:232px}}
|
|
137
137
|
.chat__bar{display:flex;gap:8px;padding:10px 0 12px 0;border-top:1px solid var(--border);flex-shrink:0}
|
|
138
|
-
.chat__input{flex:1;resize:none;min-height:
|
|
139
|
-
.chat__send{background:var(--green3);color:var(--bg);padding:10px
|
|
138
|
+
.chat__input{flex:1;resize:none;min-height:44px;max-height:120px;padding:10px 14px;font-size:14px}
|
|
139
|
+
.chat__send{background:var(--green3);color:var(--bg);padding:10px 20px;border-radius:var(--r);font-weight:700;font-size:14px}
|
|
140
140
|
.chat__send:disabled{opacity:.4}
|
|
141
|
+
|
|
142
|
+
/* ---- MOBILE TOUCH (Termux / small screens) ---- */
|
|
143
|
+
@media(max-width:600px){
|
|
144
|
+
.msg--user .msg__bubble,.msg--assistant .msg__bubble{font-size:14px;padding:12px 14px;max-width:92%;line-height:1.55}
|
|
145
|
+
.msg__label{font-size:11px}
|
|
146
|
+
.chat__input{min-height:48px;font-size:15px;padding:12px 14px}
|
|
147
|
+
.chat__send{padding:12px 20px;font-size:15px}
|
|
148
|
+
.chat__empty-title{font-size:22px}
|
|
149
|
+
.header{padding:10px 12px}
|
|
150
|
+
.header__title{font-size:15px}
|
|
151
|
+
.content{padding:10px}
|
|
152
|
+
}
|
|
141
153
|
.chat__stop{background:var(--red);color:var(--bright);padding:10px 16px;border-radius:var(--r);font-weight:700;font-size:12px;display:none}
|
|
142
154
|
.chat__stop--visible{display:block}
|
|
143
155
|
|
|
@@ -495,7 +507,11 @@ function renderMessages(){
|
|
|
495
507
|
// Fork navigation placeholder (filled after render by loadForkInfo)
|
|
496
508
|
if(m.id){acts+='<span class="msg__fork" data-node-id="'+m.id+'"></span>';}
|
|
497
509
|
acts+='</div>';
|
|
498
|
-
|
|
510
|
+
var inlineBlock='';
|
|
511
|
+
if(isA&&m.inlineHtml){
|
|
512
|
+
inlineBlock=m.inlineHtml.replace(/\\[INLINE_CARD\\]([\\s\\S]*?)\\[\\/INLINE_CARD\\]/g,function(_,htm){return '<div class="inline-card">'+htm+'</div>';}).replace(/\\[INLINE_BROWSER\\]([^|]+)\\|([^\\]]+)\\[\\/INLINE_BROWSER\\]/g,function(_,file,url){return '<div class="inline-browser"><div class="inline-browser-bar"><span class="inline-browser-dot"></span><span class="inline-browser-dot"></span><span class="inline-browser-dot"></span><span class="inline-browser-url">'+esc(url)+'</span></div><img src="/api/screenshots/'+esc(file)+'" alt="'+esc(url)+'"></div>';});
|
|
513
|
+
}
|
|
514
|
+
h+='<div class="msg msg--'+esc(m.role)+'"><div class="msg__label">'+esc(m.role==='user'?'You':'NHA')+'</div><div class="msg__bubble">'+content+'</div>'+inlineBlock+acts+'</div>';
|
|
499
515
|
});
|
|
500
516
|
el.innerHTML=h;el.scrollTop=el.scrollHeight;
|
|
501
517
|
// Load fork info for messages that have IDs
|
|
@@ -742,18 +758,31 @@ function canvasCopyImage(){
|
|
|
742
758
|
var f=document.getElementById('canvasFrame');
|
|
743
759
|
if(!f){alert('No canvas frame');return;}
|
|
744
760
|
try{
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
var ctx=canvas.getContext('2d');ctx.scale(2,2);
|
|
748
|
-
ctx.fillStyle='#0a0a0a';ctx.fillRect(0,0,w,h);
|
|
761
|
+
// Ask the iframe to capture itself via postMessage
|
|
762
|
+
// Inject a capture script into the iframe
|
|
749
763
|
var d=getConvCanvasData();var item=d.canvases[canvasIdx];
|
|
750
764
|
if(!item){alert('No canvas');return;}
|
|
751
|
-
|
|
752
|
-
var
|
|
753
|
-
var
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
765
|
+
// Re-render with capture script added
|
|
766
|
+
var captureScript='<script>window.addEventListener("message",function(e){if(e.data==="capture"){try{var c=document.querySelector("canvas");if(c){window.parent.postMessage({type:"canvasCapture",dataUrl:c.toDataURL("image/png")},"*");return;}import("https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js").then(function(m){return m.default||window.html2canvas}).then(function(h2c){h2c(document.body,{backgroundColor:"#0a0a0a",scale:2}).then(function(cv){window.parent.postMessage({type:"canvasCapture",dataUrl:cv.toDataURL("image/png")},"*")})}).catch(function(){window.parent.postMessage({type:"canvasCapture",error:"Capture failed"},"*")})}catch(err){window.parent.postMessage({type:"canvasCapture",error:err.message},"*")}}});<\\/script>';
|
|
767
|
+
var htmlWithCapture=item.html.replace('</body>',captureScript+'</body>');
|
|
768
|
+
if(htmlWithCapture===item.html)htmlWithCapture=item.html+captureScript;
|
|
769
|
+
f.srcdoc=htmlWithCapture;
|
|
770
|
+
// Listen for the capture response
|
|
771
|
+
var handler=function(e){
|
|
772
|
+
if(e.data&&e.data.type==='canvasCapture'){
|
|
773
|
+
window.removeEventListener('message',handler);
|
|
774
|
+
if(e.data.error){alert('Capture failed: '+e.data.error);return;}
|
|
775
|
+
// Convert dataUrl to blob and copy/download
|
|
776
|
+
fetch(e.data.dataUrl).then(function(r){return r.blob()}).then(function(blob){
|
|
777
|
+
navigator.clipboard.write([new ClipboardItem({'image/png':blob})]).then(function(){alert('Image copied!')}).catch(function(){
|
|
778
|
+
var a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download='canvas.png';a.click();alert('Image downloaded as canvas.png');
|
|
779
|
+
});
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
window.addEventListener('message',handler);
|
|
784
|
+
// Wait for iframe to load, then trigger capture
|
|
785
|
+
setTimeout(function(){f.contentWindow.postMessage('capture','*')},1500);
|
|
757
786
|
}catch(e){alert('Copy failed: '+e.message);}
|
|
758
787
|
}
|
|
759
788
|
function toggleCanvasSize(){
|
|
@@ -946,7 +975,7 @@ function sendChat(){
|
|
|
946
975
|
if(data.markers.indexOf('[CANVAS_CLEAR]')!==-1)closeCanvas();
|
|
947
976
|
}
|
|
948
977
|
if(currentEvent==='tool_synthesis'){chatHistory[streamIdx].content='';renderMessages();}
|
|
949
|
-
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\\n';}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);}}
|
|
978
|
+
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\\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);}}
|
|
950
979
|
if(currentEvent==='error'){endStreaming();chatHistory[streamIdx].content='Error: '+(data.message||'Unknown');renderMessages();}
|
|
951
980
|
}catch(e){}
|
|
952
981
|
}
|