nothumanallowed 13.5.64 → 13.5.66

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.64",
3
+ "version": "13.5.66",
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": {
@@ -6544,6 +6544,9 @@ var _wcDiffQueue = []; // [{file, before, after}] diffs from last agent ru
6544
6544
  var _wcGrepOpen = false; // grep panel visible
6545
6545
  var _wcGrepQuery = '';
6546
6546
  var _wcGrepResults = [];
6547
+ var _wcOverlayMinimized = false; // overlay minimized by user click
6548
+ var _wcOverlayTimer = null; // inactivity timer to restore overlay
6549
+ var _wcGenAbortCtrl = null; // AbortController for generation stop
6547
6550
  var _wcSyntaxResults = []; // [{file, ok, error}]
6548
6551
  var _wcSnapshots = []; // [{ts, fileCount}]
6549
6552
  // Skills state
@@ -6621,7 +6624,7 @@ function renderWebCraft(el) {
6621
6624
  '<div style="display:flex;flex-direction:column;height:100%">' +
6622
6625
  wcExHtml +
6623
6626
  '<div style="display:flex;gap:14px;align-items:flex-start;flex:1;min-height:0">' +
6624
- '<div style="width:240px;flex-shrink:0;display:flex;flex-direction:column;gap:10px;overflow-y:auto;height:100%">' +
6627
+ '<div style="width:260px;flex-shrink:0;display:flex;flex-direction:column;gap:10px;overflow-y:auto;height:100%">' +
6625
6628
  '<div style="background:var(--bg2);border:1px solid var(--border);border-radius:10px;padding:14px">' +
6626
6629
  '<div style="font-size:10px;color:var(--dim);text-transform:uppercase;letter-spacing:.8px;margin-bottom:10px">'+t('wc_blocks')+'</div>' +
6627
6630
  ['auth','cookieBanner','securityMiddleware','emailVerification'].map(function(b){
@@ -6656,7 +6659,23 @@ function renderWebCraft(el) {
6656
6659
  '<button onclick="wcStartSandbox()" id="wcSandboxBtn" style="width:100%;padding:10px;background:var(--bg3);border:1px solid var(--green3);border-radius:8px;color:var(--green);font-size:12px;font-weight:600;cursor:pointer">&#9654; '+t('wc_sandbox_start')+'</button>'
6657
6660
  : '') +
6658
6661
  '</div>' +
6659
- '<div style="flex:1;min-width:0;background:var(--bg2);border:1px solid var(--border);border-radius:10px;display:flex;flex-direction:column;height:100%;overflow:hidden">' +
6662
+ '<div data-wc-files style="position:relative;flex:1;min-width:0;background:var(--bg2);border:1px solid var(--border);border-radius:10px;display:flex;flex-direction:column;height:100%;overflow:hidden">' +
6663
+ (wcState.running ? (
6664
+ _wcOverlayMinimized
6665
+ // Minimized: small pill in bottom-right corner
6666
+ ? '<div id="wcGenOverlay" onclick="wcOverlayRestore()" style="position:absolute;bottom:12px;right:12px;z-index:50;background:rgba(0,0,0,0.85);border:1px solid var(--green3);border-radius:20px;padding:5px 12px;display:flex;align-items:center;gap:7px;cursor:pointer;animation:wcBubbleIn .2s ease;backdrop-filter:blur(4px)">'
6667
+ +'<span style="font-size:16px;animation:wcRobotBob .9s ease-in-out infinite">&#129302;</span>'
6668
+ +'<span style="font-size:10px;color:var(--green);font-weight:700">Generando...</span>'
6669
+ +'<span style="display:flex;gap:3px">'+[0,1,2].map(function(_,idx){ return '<span style="width:4px;height:4px;border-radius:50%;background:var(--green);animation:wcDot 1.1s ease-in-out infinite '+(idx*0.18)+'s"></span>'; }).join('')+'</span>'
6670
+ +'</div>'
6671
+ // Full overlay
6672
+ : '<div id="wcGenOverlay" onclick="wcOverlayMinimize()" title="Clicca per nascondere e navigare i file" style="position:absolute;inset:0;background:rgba(0,0,0,0.75);backdrop-filter:blur(4px);border-radius:10px;z-index:50;display:flex;flex-direction:column;align-items:center;justify-content:center;animation:wcBubbleIn .3s ease;cursor:pointer">'
6673
+ +'<div style="font-size:38px;animation:wcRobotBob 1s ease-in-out infinite">&#129302;</div>'
6674
+ +'<div style="font-size:13px;font-weight:700;color:var(--green);margin-top:12px">Generazione in corso...</div>'
6675
+ +'<div style="font-size:10px;color:var(--dim);margin-top:4px">Clicca per navigare i file</div>'
6676
+ +'<div style="display:flex;gap:4px;margin-top:16px">'+[0,1,2,3,4].map(function(_,idx){ return '<div style="width:6px;height:6px;border-radius:50%;background:var(--green);animation:wcDot 1.1s ease-in-out infinite '+(idx*0.14)+'s"></div>'; }).join('')+'</div>'
6677
+ +'</div>'
6678
+ ) : '') +
6660
6679
  '<div style="display:flex;border-bottom:1px solid var(--border);flex-shrink:0">' +
6661
6680
  '<button onclick="wcTabFiles()" style="padding:8px 16px;background:'+(wcRightTab==='preview'?'transparent':'var(--bg3)')+';border:none;border-right:1px solid var(--border);color:'+(wcRightTab==='preview'?'var(--dim)':'var(--text)')+';font-size:11px;font-weight:600;cursor:pointer">&#128196; File</button>' +
6662
6681
  '<button onclick="wcTabPreview()" style="padding:8px 16px;background:'+(wcRightTab==='preview'?'var(--bg3)':'transparent')+';border:none;color:'+(wcRightTab==='preview'?'var(--text)':'var(--dim)')+';font-size:11px;font-weight:600;cursor:pointer">&#127760; Sandbox</button>' +
@@ -7030,7 +7049,21 @@ function wcChatPanelHtml() {
7030
7049
  }
7031
7050
  }
7032
7051
  if (wcChatRunning) {
7033
- messagesHtml += '<div id="wcChatTyping" style="margin:4px 12px;font-size:11px;color:var(--dim)">&#129302; <span style="opacity:.6">&#8230;</span></div>';
7052
+ messagesHtml +=
7053
+ '<div id="wcAgentLiveBubble" style="margin:6px 12px;border:1px solid rgba(255,255,255,0.12);border-radius:10px;background:var(--bg3);overflow:hidden;animation:wcBubbleIn .25s cubic-bezier(.22,1,.36,1)">' +
7054
+ '<div style="display:flex;align-items:center;gap:6px;padding:6px 10px;border-bottom:1px solid rgba(255,255,255,0.06);background:rgba(255,255,255,0.03)">' +
7055
+ '<span style="font-size:13px;animation:wcRobotBob .9s ease-in-out infinite">&#129302;</span>' +
7056
+ '<span style="font-size:10px;font-weight:700;color:var(--green)">WebCraft Agent</span>' +
7057
+ '<span style="margin-left:auto;display:flex;gap:3px;align-items:center">' +
7058
+ '<span style="width:5px;height:5px;border-radius:50%;background:var(--green);opacity:.9;animation:wcDot 1.1s ease-in-out infinite 0s"></span>' +
7059
+ '<span style="width:5px;height:5px;border-radius:50%;background:var(--green);opacity:.9;animation:wcDot 1.1s ease-in-out infinite .18s"></span>' +
7060
+ '<span style="width:5px;height:5px;border-radius:50%;background:var(--green);opacity:.9;animation:wcDot 1.1s ease-in-out infinite .36s"></span>' +
7061
+ '</span>' +
7062
+ '</div>' +
7063
+ '<div id="wcAgentLiveText" style="padding:8px 10px;font-size:11px;color:var(--text);line-height:1.6;white-space:pre-wrap;min-height:24px">' +
7064
+ '<span style="display:inline-block;width:2px;height:11px;background:var(--green);vertical-align:text-bottom;animation:streamBlink .7s step-end infinite;margin-left:1px">&#8203;</span>' +
7065
+ '</div>' +
7066
+ '</div>';
7034
7067
  }
7035
7068
 
7036
7069
  // Attachments preview
@@ -7072,7 +7105,10 @@ function wcChatPanelHtml() {
7072
7105
  '<input type="file" id="wcFileInput" multiple accept="image/*,.pdf" style="display:none" onchange="wcHandleFileAttach(this)">' +
7073
7106
  '</label>' +
7074
7107
  '<textarea id="wcChatInput" rows="4" placeholder="'+placeholder+'" '+(inputDisabled?'disabled':'')+' style="flex:1;padding:8px 10px;font-size:12px;border-radius:8px;border:1px solid var(--border2);background:var(--bg3);color:var(--text);resize:vertical;min-height:80px;line-height:1.5;font-family:inherit" onkeydown="wcChatKeydown(event)"></textarea>' +
7075
- '<button onclick="wcChatSend()" '+(inputDisabled?'disabled':'')+' style="padding:8px 14px;background:var(--green3);border:none;border-radius:8px;color:var(--bg);font-size:13px;font-weight:700;cursor:pointer;flex-shrink:0;height:38px">'+sendBtnLabel+'</button>' +
7108
+ '<div style="display:flex;flex-direction:column;gap:5px;flex-shrink:0">' +
7109
+ '<button onclick="wcChatSend()" '+(inputDisabled?'disabled':'')+' style="padding:8px 14px;background:var(--green3);border:none;border-radius:8px;color:var(--bg);font-size:13px;font-weight:700;cursor:pointer;height:38px;white-space:nowrap">'+sendBtnLabel+'</button>' +
7110
+ (inputDisabled ? '<button onclick="wcStopAll()" style="padding:5px 10px;background:rgba(239,68,68,0.12);border:1px solid rgba(239,68,68,0.4);border-radius:7px;color:#f87171;font-size:11px;font-weight:700;cursor:pointer;white-space:nowrap">&#9632; Stop</button>' : '') +
7111
+ '</div>' +
7076
7112
  '</div>' +
7077
7113
  '</div>';
7078
7114
  }
@@ -7081,6 +7117,17 @@ function wcChatKeydown(e) {
7081
7117
  if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); wcChatSend(); }
7082
7118
  }
7083
7119
 
7120
+ function wcStopAll() {
7121
+ // Abort ongoing generation
7122
+ if (_wcGenAbortCtrl) { _wcGenAbortCtrl.abort(); _wcGenAbortCtrl = null; }
7123
+ wcState.running = false;
7124
+ wcChatRunning = false;
7125
+ _wcOverlayMinimized = false;
7126
+ if (_wcOverlayTimer) { clearTimeout(_wcOverlayTimer); _wcOverlayTimer = null; }
7127
+ wcChat.push({ role: 'system', text: '&#9632; Generazione interrotta.' });
7128
+ renderWebCraft(document.getElementById('content'));
7129
+ }
7130
+
7084
7131
  function wcRemoveAttachment(ai) {
7085
7132
  wcChatAttachments.splice(ai, 1);
7086
7133
  renderWebCraft(document.getElementById('content'));
@@ -7205,8 +7252,12 @@ async function wcExecuteAgentCall(message, isPlanExec, planOrigMsg, attachments)
7205
7252
  var ev = JSON.parse(line);
7206
7253
  if (ev.type === 'text') {
7207
7254
  agentMsg.text += ev.token;
7208
- var typingEl = document.getElementById('wcChatTyping');
7209
- if (typingEl) typingEl.textContent = '...';
7255
+ // Inject token directly into live bubble (no re-render)
7256
+ var liveEl = document.getElementById('wcAgentLiveText');
7257
+ if (liveEl) {
7258
+ var cursor = '<span style="display:inline-block;width:2px;height:11px;background:var(--green);vertical-align:text-bottom;animation:streamBlink .7s step-end infinite;margin-left:1px">&#8203;</span>';
7259
+ liveEl.innerHTML = wcEsc(agentMsg.text) + cursor;
7260
+ }
7210
7261
  wcScrollChatToBottom();
7211
7262
  } else if (ev.type === 'tool') {
7212
7263
  agentMsg.tools.push({ op: ev.op, path: ev.path, result: ev.result, oldSnippet: ev.oldSnippet || '', newSnippet: ev.newSnippet || '' });
@@ -7652,6 +7703,8 @@ async function wcGenerate() {
7652
7703
  wcState.running = true;
7653
7704
  wcState.generatedFiles = [];
7654
7705
  wcState.activeFile = 0;
7706
+ _wcOverlayMinimized = false;
7707
+ _wcGenAbortCtrl = new AbortController();
7655
7708
  renderWebCraft(document.getElementById('content'));
7656
7709
 
7657
7710
  // Security rules always injected
@@ -7711,13 +7764,47 @@ async function wcGenerate() {
7711
7764
  var _nl = String.fromCharCode(10);
7712
7765
  var sysPreamble = 'You are an expert full-stack engineer generating production-quality code.' + _nl + _nl + 'SECURITY RULES (non-negotiable):' + _nl + SECURITY_RULES + _nl + _nl + 'Project: ' + projName + _nl + 'Description: ' + desc + _nl + 'Enabled blocks: ' + blocksEnabled + _nl + _nl + 'Generate ONLY the file content requested. No explanations, no markdown code fences, no comments like "here is the file". Output raw file content only.';
7713
7766
 
7767
+ function wcUpdateGenOverlay(fi2, total, name) {
7768
+ if (_wcOverlayMinimized) return; // don't touch minimized pill
7769
+ var ov = document.getElementById('wcGenOverlay');
7770
+ if (!ov) return;
7771
+ var pct = Math.round((fi2 / total) * 100);
7772
+ ov.innerHTML =
7773
+ '<div style="font-size:38px;animation:wcRobotBob 1s ease-in-out infinite">&#129302;</div>' +
7774
+ '<div style="font-size:13px;font-weight:700;color:var(--green);margin-top:12px">Generazione in corso...</div>' +
7775
+ '<div style="font-size:10px;color:var(--dim);margin-top:2px">Clicca per navigare i file</div>' +
7776
+ '<div style="font-size:11px;color:var(--dim);font-family:var(--mono);max-width:300px;text-align:center;word-break:break-all;margin-top:8px">'+wcEsc(name)+'</div>' +
7777
+ '<div style="width:220px;height:4px;background:rgba(255,255,255,0.1);border-radius:2px;overflow:hidden;margin-top:12px">' +
7778
+ '<div style="height:100%;width:'+pct+'%;background:var(--green);border-radius:2px;transition:width .4s ease;animation:wcBarPulse 1.5s ease-in-out infinite"></div>' +
7779
+ '</div>' +
7780
+ '<div style="font-size:10px;color:var(--dim);margin-top:6px">'+fi2+' / '+total+' file</div>' +
7781
+ '<div style="display:flex;gap:4px;margin-top:10px">'+[0,1,2,3,4].map(function(_,idx){ return '<div style="width:6px;height:6px;border-radius:50%;background:var(--green);animation:wcDot 1.1s ease-in-out infinite '+(idx*0.14)+'s"></div>'; }).join('')+'</div>';
7782
+ }
7783
+
7784
+ function wcOverlayMinimize() {
7785
+ _wcOverlayMinimized = true;
7786
+ renderWebCraft(document.getElementById('content'));
7787
+ // Restore after 10s of inactivity
7788
+ if (_wcOverlayTimer) clearTimeout(_wcOverlayTimer);
7789
+ _wcOverlayTimer = setTimeout(function() {
7790
+ if (wcState.running) { _wcOverlayMinimized = false; renderWebCraft(document.getElementById('content')); }
7791
+ }, 10000);
7792
+ }
7793
+
7794
+ function wcOverlayRestore() {
7795
+ if (_wcOverlayTimer) { clearTimeout(_wcOverlayTimer); _wcOverlayTimer = null; }
7796
+ _wcOverlayMinimized = false;
7797
+ renderWebCraft(document.getElementById('content'));
7798
+ }
7799
+
7714
7800
  for (var fi = 0; fi < filePlan.length; fi++) {
7715
7801
  var fp = filePlan[fi];
7716
- var runBtn = document.getElementById('wcRunBtn');
7717
- if (runBtn) runBtn.innerHTML = '&#9203; '+t('wc_generating')+' ' + fp.name + ' (' + (fi+1) + '/' + filePlan.length + ')...';
7802
+ wcUpdateGenOverlay(fi, filePlan.length, fp.name);
7803
+ // Check if aborted
7804
+ if (_wcGenAbortCtrl && _wcGenAbortCtrl.signal.aborted) break;
7718
7805
  try {
7719
7806
  var _nl2 = String.fromCharCode(10);
7720
- var content = await wcCallLLM(sysPreamble, fp.prompt + _nl2 + _nl2 + 'File to generate: ' + fp.name);
7807
+ var content = await wcCallLLM(sysPreamble, fp.prompt + _nl2 + _nl2 + 'File to generate: ' + fp.name, _wcGenAbortCtrl ? _wcGenAbortCtrl.signal : null);
7721
7808
  // Strip markdown code fences if model added them anyway
7722
7809
  var _fence = String.fromCharCode(96,96,96);
7723
7810
  var wcLines = content.split(_nl2);
@@ -7728,11 +7815,14 @@ async function wcGenerate() {
7728
7815
  if (fi === 0) wcState.activeFile = 0;
7729
7816
  renderWebCraft(document.getElementById('content'));
7730
7817
  } catch(e) {
7818
+ if (e && e.name === 'AbortError') break;
7731
7819
  wcState.generatedFiles.push({ name: fp.name, content: '// Error generating this file: ' + e.message, lang: fp.lang });
7732
7820
  }
7733
7821
  }
7734
7822
 
7735
7823
  wcState.running = false;
7824
+ _wcGenAbortCtrl = null;
7825
+ _wcOverlayMinimized = false;
7736
7826
 
7737
7827
  // Auto-save project to ~/.nha/webcraft/<projectName>/
7738
7828
  try {
@@ -7746,12 +7836,14 @@ async function wcGenerate() {
7746
7836
  renderWebCraft(document.getElementById('content'));
7747
7837
  }
7748
7838
 
7749
- async function wcCallLLM(sys, user) {
7750
- var r = await fetch(API + '/api/studio/webcraft', {
7839
+ async function wcCallLLM(sys, user, signal) {
7840
+ var fetchOpts = {
7751
7841
  method: 'POST',
7752
7842
  headers: {'Content-Type':'application/json'},
7753
7843
  body: JSON.stringify({system: sys, user: user, max_tokens: 4096})
7754
- });
7844
+ };
7845
+ if (signal) fetchOpts.signal = signal;
7846
+ var r = await fetch(API + '/api/studio/webcraft', fetchOpts);
7755
7847
  if (!r.ok) throw new Error('LLM error ' + r.status);
7756
7848
  var d = await r.json();
7757
7849
  return (d && (d.text || d.content || d.result)) || '';
@@ -8625,6 +8717,10 @@ input:focus,textarea:focus{border-color:var(--green3)}
8625
8717
  .prl-action-bubble--active{color:#000000;font-weight:700;border-color:#374151;background:#ffffff;animation:parlBubblePop .4s ease}
8626
8718
  @keyframes parlBubblePop{0%{transform:scale(.85);opacity:.5}100%{transform:scale(1);opacity:1}}
8627
8719
  @keyframes streamBlink{0%,100%{opacity:1}50%{opacity:0}}
8720
+ @keyframes wcBubbleIn{from{opacity:0;transform:translateY(8px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
8721
+ @keyframes wcRobotBob{0%,100%{transform:translateY(0) rotate(0deg)}50%{transform:translateY(-5px) rotate(-4deg)}}
8722
+ @keyframes wcDot{0%,80%,100%{opacity:.25;transform:scale(.7)}40%{opacity:1;transform:scale(1.2)}}
8723
+ @keyframes wcBarPulse{0%,100%{opacity:1}50%{opacity:.65}}
8628
8724
  /* Character SVG animations */
8629
8725
  @keyframes parlArmType{0%,100%{transform:rotate(-8deg) translateY(0)}50%{transform:rotate(8deg) translateY(2px)}}
8630
8726
  @keyframes parlHeadNod{0%,100%{transform:translateY(0) rotate(0deg)}50%{transform:translateY(2px) rotate(4deg)}}