nothumanallowed 12.4.0 → 12.4.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": "12.4.0",
3
+ "version": "12.4.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/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.4.0';
8
+ export const VERSION = '12.4.1';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -729,8 +729,7 @@ function closeCanvas(){var p=document.getElementById('canvasPanel');if(p)p.class
729
729
  function canvasCopyText(){
730
730
  var d=getConvCanvasData();var item=d.canvases[canvasIdx];
731
731
  if(!item){alert('No canvas content');return;}
732
- // Extract text from the HTML
733
- var tmp=document.createElement('div');tmp.innerHTML=item.html.replace(/<script[\s\S]*?<\/script>/gi,'');
732
+ var tmp=document.createElement('div');tmp.innerHTML=item.html.replace(/<script[^>]*>[\\s\\S]*?<\\/script>/gi,'');
734
733
  var text=tmp.textContent||tmp.innerText||'';
735
734
  navigator.clipboard.writeText(text).then(function(){alert('Text copied!')}).catch(function(){alert('Copy failed')});
736
735
  }
@@ -743,33 +742,19 @@ function canvasCopyImage(){
743
742
  var f=document.getElementById('canvasFrame');
744
743
  if(!f){alert('No canvas frame');return;}
745
744
  try{
746
- // Use html2canvas approach — render iframe to canvas then copy
747
- var iframe=f;
748
- // For sandboxed iframes, we capture via srcdoc render
749
- var w=iframe.offsetWidth||800;var h=iframe.offsetHeight||400;
745
+ var w=f.offsetWidth||800;var h=f.offsetHeight||400;
750
746
  var canvas=document.createElement('canvas');canvas.width=w*2;canvas.height=h*2;
751
747
  var ctx=canvas.getContext('2d');ctx.scale(2,2);
752
- // Draw white background
753
748
  ctx.fillStyle='#0a0a0a';ctx.fillRect(0,0,w,h);
754
- // Render the srcdoc HTML to an image via SVG foreignObject
755
749
  var d=getConvCanvasData();var item=d.canvases[canvasIdx];
756
750
  if(!item){alert('No canvas');return;}
757
- var svg='<svg xmlns="http://www.w3.org/2000/svg" width="'+w+'" height="'+h+'"><foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="background:#0a0a0a">'+item.html.replace(/<script[\s\S]*?<\/script>/gi,'')+'</div></foreignObject></svg>';
751
+ var cleanHtml=item.html.replace(/<script[^>]*>[\\s\\S]*?<\\/script>/gi,'');
752
+ var svgStr='<svg xmlns="http://www.w3.org/2000/svg" width="'+w+'" height="'+h+'"><foreignObject width="100%25" height="100%25"><div xmlns="http://www.w3.org/1999/xhtml" style="background:%230a0a0a">'+cleanHtml+'</div></foreignObject></svg>';
758
753
  var img=new Image();
759
- img.onload=function(){
760
- ctx.drawImage(img,0,0,w,h);
761
- canvas.toBlob(function(blob){
762
- if(blob){
763
- navigator.clipboard.write([new ClipboardItem({'image/png':blob})]).then(function(){alert('Image copied!')}).catch(function(){
764
- // Fallback: download
765
- var a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download='canvas.png';a.click();
766
- });
767
- }
768
- },'image/png');
769
- };
770
- img.onerror=function(){alert('Image render failed — try Copy HTML instead');};
771
- img.src='data:image/svg+xml;charset=utf-8,'+encodeURIComponent(svg);
772
- }catch(e){alert('Image copy failed: '+e.message);}
754
+ img.onload=function(){ctx.drawImage(img,0,0,w,h);canvas.toBlob(function(blob){if(blob){navigator.clipboard.write([new ClipboardItem({'image/png':blob})]).then(function(){alert('Image copied!')}).catch(function(){var a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download='canvas.png';a.click();});}},'image/png');};
755
+ img.onerror=function(){alert('Image copy failed — use HTML button instead');};
756
+ img.src='data:image/svg+xml;charset=utf-8,'+encodeURIComponent(svgStr);
757
+ }catch(e){alert('Copy failed: '+e.message);}
773
758
  }
774
759
  function toggleCanvasSize(){
775
760
  var p=document.getElementById('canvasPanel');if(!p)return;