nothumanallowed 13.5.96 → 13.5.98

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.96",
3
+ "version": "13.5.98",
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": {
@@ -4391,7 +4391,7 @@ module.exports = { validateEmail, sanitizeText, validatePassword, validateUserna
4391
4391
  [/require\(['"]winston['"]\)/g, "{createLogger:()=>({info:()=>{},error:()=>{},warn:()=>{}}),transports:{Console:function(){}},format:{combine:()=>{},timestamp:()=>{},json:()=>{}}}"],
4392
4392
  [/require\(['"]morgan['"]\)/g, "(()=>(r,s,n)=>n())"],
4393
4393
  [/require\(['"]compression['"]\)/g, "(()=>(r,s,n)=>n())"],
4394
- [/require\(['"]express-validator['"]\)/g, "{body:()=>({isEmail:()=>({normalizeEmail:()=>({run:async()=>{}})}),isLength:()=>({run:async()=>{}}),trim:()=>({escape:()=>({run:async()=>{}})}),notEmpty:()=>({run:async()=>{}})}),validationResult:()=>({isEmpty:()=>true,array:()=>[]})}"],
4394
+ [/require\(['"]express-validator['"]\)/g, "(()=>{function chain(){var p=new Proxy(function(){return p},{get:function(_,k){if(k==='run')return async function(){};if(k==='withMessage'||k==='bail'||k==='optional')return function(){return p};return function(){return p};}});return p;}return {body:chain,param:chain,query:chain,header:chain,cookie:chain,check:chain,validationResult:function(req){return {isEmpty:function(){return true},array:function(){return []},throw:function(){}};},matchedData:function(){return {};},oneOf:function(){return chain();}};})()"],
4395
4395
  [/require\(['"]validator['"]\)/g, "{isEmail:(s)=>/^[^@\\s]+@[^@\\s]+[.][^@\\s]+$/.test(s),escape:(s)=>String(s).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;'),trim:(s)=>String(s).trim(),isEmpty:(s)=>!s||!String(s).trim(),isLength:(s,o)=>{ var l=String(s).length; return (!o.min||l>=o.min)&&(!o.max||l<=o.max); }}"],
4396
4396
  [/require\(['"]handlebars['"]\)/g, "{compile:(t)=>(d)=>t.replace(/\\{\\{([^}]+)\\}\\}/g,(_,k)=>d[k.trim()]||''),registerHelper:()=>{},registerPartial:()=>{}}"],
4397
4397
  [/require\(['"]express-handlebars['"]\)/g, "{engine:()=>(p,o,cb)=>cb(null,'<html>'+JSON.stringify(o)+'</html>')}"],
@@ -4595,6 +4595,29 @@ module.exports = { validateEmail, sanitizeText, validatePassword, validateUserna
4595
4595
  sendLog(' [server] ' + l);
4596
4596
  });
4597
4597
 
4598
+ // Helper: write sandbox log to skills/ dir (called on both success and error)
4599
+ const writeSandboxLog = (extraLines, isError) => {
4600
+ try {
4601
+ const _nl = '\n';
4602
+ const _now = new Date();
4603
+ const _pad = n => String(n).padStart(2,'0');
4604
+ const logTs = _now.getFullYear()+'-'+_pad(_now.getMonth()+1)+'-'+_pad(_now.getDate())+' '+_pad(_now.getHours())+':'+_pad(_now.getMinutes())+':'+_pad(_now.getSeconds());
4605
+ const logName = projName + '-latest.log';
4606
+ const logsDir = path.join(sandboxDir, 'skills');
4607
+ fs.mkdirSync(logsDir, { recursive: true });
4608
+ const oldLogs = fs.readdirSync(logsDir).filter(f => f.endsWith('.log') && f.startsWith(projName + '-') && f !== logName);
4609
+ oldLogs.forEach(f => { try { fs.unlinkSync(path.join(logsDir, f)); } catch(_) {} });
4610
+ const title = isError ? '# Sandbox Log — ' + projName + ' [ERRORE]' : '# Sandbox Log — ' + projName;
4611
+ const logContent = title + _nl + 'Avviato: ' + logTs + _nl + 'Porta: ' + freePort + _nl + _nl + _sbLogLines.join(_nl) + (extraLines ? _nl + _nl + extraLines : '');
4612
+ fs.writeFileSync(path.join(logsDir, logName), logContent, 'utf8');
4613
+ const idxPath = path.join(logsDir, '_index.json');
4614
+ let idx = {};
4615
+ try { idx = JSON.parse(fs.readFileSync(idxPath, 'utf8')); } catch(_) {}
4616
+ idx[logName] = 'log';
4617
+ fs.writeFileSync(idxPath, JSON.stringify(idx), 'utf8');
4618
+ } catch(_) {}
4619
+ };
4620
+
4598
4621
  // Wait for server to be ready (max 10s)
4599
4622
  await new Promise((resolve, reject) => {
4600
4623
  let attempts = 0;
@@ -4611,49 +4634,11 @@ module.exports = { validateEmail, sanitizeText, validatePassword, validateUserna
4611
4634
  });
4612
4635
 
4613
4636
  sendLog(`✅ Sandbox pronta!`);
4614
-
4615
- // Write sandbox log to skills/ so the agent can read it as context
4616
- // Always overwrite the same file (latest.log) — no accumulation across restarts
4617
- try {
4618
- const _nl = '\n';
4619
- const _now = new Date();
4620
- const _pad = n => String(n).padStart(2,'0');
4621
- const logTs = _now.getFullYear()+'-'+_pad(_now.getMonth()+1)+'-'+_pad(_now.getDate())+' '+_pad(_now.getHours())+':'+_pad(_now.getMinutes())+':'+_pad(_now.getSeconds());
4622
- const logName = projName + '-latest.log';
4623
- const logsDir = path.join(sandboxDir, 'skills');
4624
- fs.mkdirSync(logsDir, { recursive: true });
4625
- // Clean up old timestamped log files (migration from previous format)
4626
- const oldLogs = fs.readdirSync(logsDir).filter(f => f.endsWith('.log') && f.startsWith(projName + '-') && f !== logName);
4627
- oldLogs.forEach(f => { try { fs.unlinkSync(path.join(logsDir, f)); } catch(_) {} });
4628
- const logContent = '# Sandbox Log — ' + projName + _nl + 'Avviato: ' + logTs + _nl + 'Porta: ' + freePort + _nl + _nl + _sbLogLines.join(_nl);
4629
- fs.writeFileSync(path.join(logsDir, logName), logContent, 'utf8');
4630
- // Also update _index.json so the UI knows the type
4631
- const idxPath = path.join(logsDir, '_index.json');
4632
- let idx = {};
4633
- try { idx = JSON.parse(fs.readFileSync(idxPath, 'utf8')); } catch(_) {}
4634
- idx[logName] = 'log';
4635
- fs.writeFileSync(idxPath, JSON.stringify(idx), 'utf8');
4636
- } catch(_) {}
4637
+ writeSandboxLog(null, false);
4637
4638
 
4638
4639
  sendReady(freePort, sandboxDir);
4639
4640
  } catch (e) {
4640
- // Write error log too
4641
- try {
4642
- const _nl = '\n';
4643
- const _now2 = new Date();
4644
- const _pad2 = n => String(n).padStart(2,'0');
4645
- const logTs = _now2.getFullYear()+'-'+_pad2(_now2.getMonth()+1)+'-'+_pad2(_now2.getDate())+' '+_pad2(_now2.getHours())+':'+_pad2(_now2.getMinutes())+':'+_pad2(_now2.getSeconds());
4646
- const logName = projName + '-latest.log';
4647
- const logsDir = path.join(sandboxDir, 'skills');
4648
- fs.mkdirSync(logsDir, { recursive: true });
4649
- const logContent = '# Sandbox Log — ' + projName + ' [ERRORE]' + _nl + 'Avviato: ' + logTs + _nl + _nl + _sbLogLines.join(_nl) + _nl + _nl + '❌ ERRORE: ' + e.message;
4650
- fs.writeFileSync(path.join(logsDir, logName), logContent, 'utf8');
4651
- const idxPath = path.join(logsDir, '_index.json');
4652
- let idx = {};
4653
- try { idx = JSON.parse(fs.readFileSync(idxPath, 'utf8')); } catch(_) {}
4654
- idx[logName] = 'log';
4655
- fs.writeFileSync(idxPath, JSON.stringify(idx), 'utf8');
4656
- } catch(_) {}
4641
+ writeSandboxLog('❌ ERRORE: ' + e.message, true);
4657
4642
  sendError(e.message);
4658
4643
  }
4659
4644
  res.end();
@@ -6777,11 +6777,11 @@ function renderWebCraft(el) {
6777
6777
  '</div>' +
6778
6778
  '<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">' +
6779
6779
  (wcState.repairing ?
6780
- '<div 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">'
6780
+ '<div id="wcRepairOverlay" 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">'
6781
6781
  +'<div style="font-size:38px;animation:wcRobotBob 1s ease-in-out infinite">&#128295;</div>'
6782
6782
  +'<div style="font-size:13px;font-weight:700;color:#facc15;margin-top:12px">Correzione automatica in corso...</div>'
6783
- +'<div style="font-size:11px;color:var(--dim);margin-top:6px">'+wcState.repairDone+' / '+wcState.repairTotal+' file</div>'
6784
- +(wcState.repairCurrent ? '<div style="font-size:10px;color:#fde68a;font-family:var(--mono);margin-top:4px;max-width:280px;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">'+wcEsc(wcState.repairCurrent)+'</div>' : '')
6783
+ +'<div id="wcRepairCounter" style="font-size:11px;color:var(--dim);margin-top:6px">'+wcState.repairDone+' / '+wcState.repairTotal+' file</div>'
6784
+ +'<div id="wcRepairFile" style="font-size:10px;color:#fde68a;font-family:var(--mono);margin-top:4px;max-width:280px;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">'+wcEsc(wcState.repairCurrent)+'</div>'
6785
6785
  +'<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:#facc15;animation:wcDot 1.1s ease-in-out infinite '+(idx*0.14)+'s"></div>'; }).join('')+'</div>'
6786
6786
  +'</div>'
6787
6787
  : wcState.running ? (
@@ -8148,7 +8148,7 @@ async function wcAutoRepair(filePlan, sysPreamble) {
8148
8148
  var plan = planMap[broken.name];
8149
8149
  wcState.repairDone = ri;
8150
8150
  wcState.repairCurrent = broken.name;
8151
- renderWebCraft(document.getElementById('content'));
8151
+ wcUpdateRepairOverlay();
8152
8152
 
8153
8153
  await new Promise(function(resolve){ setTimeout(resolve, 2000); });
8154
8154
  try {
@@ -8185,7 +8185,7 @@ async function wcAutoRepair(filePlan, sysPreamble) {
8185
8185
  } catch(e) { /* keep as broken */ }
8186
8186
 
8187
8187
  wcState.repairDone = ri + 1;
8188
- renderWebCraft(document.getElementById('content'));
8188
+ wcUpdateRepairOverlay();
8189
8189
  }
8190
8190
 
8191
8191
  _wcRepairRunning = false;
@@ -8206,6 +8206,13 @@ async function wcAutoRepair(filePlan, sysPreamble) {
8206
8206
  }
8207
8207
 
8208
8208
  // Manual trigger for repair — called from "Correggi tutti" button
8209
+ function wcUpdateRepairOverlay() {
8210
+ var counter = document.getElementById('wcRepairCounter');
8211
+ var fileEl = document.getElementById('wcRepairFile');
8212
+ if (counter) counter.textContent = wcState.repairDone + ' / ' + wcState.repairTotal + ' file';
8213
+ if (fileEl) fileEl.textContent = wcState.repairCurrent;
8214
+ }
8215
+
8209
8216
  function wcTriggerRepair() {
8210
8217
  if (_wcRepairRunning) return;
8211
8218
  wcAutoRepair(_wcLastFilePlan, _wcLastSysPreamble);