nothumanallowed 13.5.129 → 13.5.131

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.129",
3
+ "version": "13.5.131",
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": {
@@ -5308,8 +5308,14 @@ module.exports = { validateEmail, sanitizeText, validatePassword, validateUserna
5308
5308
  let pkg = {};
5309
5309
  try { pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); } catch(_) {}
5310
5310
  if (!pkg.dependencies) pkg.dependencies = {};
5311
+ // Remove server-side deps that can't run in sandbox
5311
5312
  delete pkg.dependencies.pg;
5312
5313
  delete pkg.dependencies.ioredis;
5314
+ delete pkg.dependencies['pg-pool'];
5315
+ delete pkg.dependencies.redis;
5316
+ delete pkg.dependencies.mongoose;
5317
+ delete pkg.dependencies.mysql2;
5318
+ delete pkg.dependencies.sequelize;
5313
5319
  // Force known-good versions — LLM often generates non-existent patch versions
5314
5320
  pkg.dependencies.express = '^4.19.0';
5315
5321
  pkg.dependencies.bcryptjs = '^2.4.3';
@@ -5320,10 +5326,63 @@ module.exports = { validateEmail, sanitizeText, validatePassword, validateUserna
5320
5326
  pkg.dependencies.dotenv = '^16.4.0';
5321
5327
  pkg.dependencies.nodemailer = '^6.9.0';
5322
5328
  pkg.dependencies['express-validator'] = '^7.0.1';
5329
+ // Auto-detect any require('pkg') in server JS files and add missing deps
5330
+ const KNOWN_VERSIONS = {
5331
+ 'xss-clean': '^0.1.4', 'morgan': '^1.10.0', 'compression': '^1.7.4',
5332
+ 'multer': '^1.4.5-lts.1', 'uuid': '^9.0.0', 'axios': '^1.6.0',
5333
+ 'lodash': '^4.17.21', 'moment': '^2.30.1', 'dayjs': '^1.11.10',
5334
+ 'joi': '^17.12.0', 'zod': '^3.22.4', 'yup': '^1.3.3',
5335
+ 'stripe': '^14.21.0', 'passport': '^0.7.0', 'passport-local': '^1.0.0',
5336
+ 'passport-jwt': '^4.0.1', 'cookie-parser': '^1.4.6', 'body-parser': '^1.20.2',
5337
+ 'express-session': '^1.18.0', 'connect-flash': '^0.1.1', 'method-override': '^3.0.0',
5338
+ 'serve-static': '^1.15.0', 'path': '0.12.7', 'crypto': '^1.0.1',
5339
+ 'sanitize-html': '^2.12.0', 'dompurify': '^3.0.9', 'validator': '^13.11.0',
5340
+ 'express-mongo-sanitize': '^2.2.0', 'hpp': '^0.2.3', 'xss': '^1.0.14',
5341
+ 'winston': '^3.12.0', 'pino': '^8.19.0', 'chalk': '^5.3.0',
5342
+ 'socket.io': '^4.7.4', 'ws': '^8.16.0', 'ejs': '^3.1.9', 'pug': '^3.0.2',
5343
+ 'handlebars': '^4.7.8', 'nunjucks': '^3.2.4', 'sharp': '^0.33.3',
5344
+ 'qrcode': '^1.5.3', 'pdf-lib': '^1.17.1',
5345
+ };
5346
+ const NODE_BUILTINS = new Set(['fs','path','os','crypto','http','https','net','url','util',
5347
+ 'events','stream','buffer','child_process','process','querystring','readline','assert',
5348
+ 'zlib','dns','tls','cluster','worker_threads','perf_hooks','vm','v8','module',
5349
+ 'string_decoder','timers','punycode','domain','console','sys']);
5350
+ function scanRequires(dir) {
5351
+ const found = new Set();
5352
+ const walk = (d) => {
5353
+ let entries;
5354
+ try { entries = fs.readdirSync(d, { withFileTypes: true }); } catch { return; }
5355
+ for (const e of entries) {
5356
+ if (e.name === 'node_modules' || e.name.startsWith('.')) continue;
5357
+ const full = path.join(d, e.name);
5358
+ if (e.isDirectory()) { walk(full); continue; }
5359
+ if (!e.name.endsWith('.js') && !e.name.endsWith('.mjs') && !e.name.endsWith('.cjs')) continue;
5360
+ let src;
5361
+ try { src = fs.readFileSync(full, 'utf8'); } catch { continue; }
5362
+ const re = /require\s*\(\s*['"]([^'"./][^'"]*)['"]\s*\)/g;
5363
+ let m;
5364
+ while ((m = re.exec(src)) !== null) {
5365
+ const pkg2 = m[1].startsWith('@') ? m[1].split('/').slice(0,2).join('/') : m[1].split('/')[0];
5366
+ if (!NODE_BUILTINS.has(pkg2)) found.add(pkg2);
5367
+ }
5368
+ }
5369
+ };
5370
+ walk(dir);
5371
+ return found;
5372
+ }
5373
+ const detected = scanRequires(sandboxDir);
5374
+ const missing = [];
5375
+ for (const mod of detected) {
5376
+ if (!pkg.dependencies[mod] && !pkg.devDependencies?.[mod]) {
5377
+ pkg.dependencies[mod] = KNOWN_VERSIONS[mod] || 'latest';
5378
+ missing.push(mod);
5379
+ }
5380
+ }
5381
+ if (missing.length > 0) sendLog('🔍 Dipendenze auto-rilevate e aggiunte: ' + missing.join(', '));
5323
5382
  pkg.scripts = pkg.scripts || {};
5324
5383
  pkg.scripts.start = 'node server/index.js';
5325
5384
  fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2), 'utf8');
5326
- sendLog('📦 package.json ottimizzato per sandbox (rimosso pg, redis)');
5385
+ sendLog('📦 package.json ottimizzato per sandbox (rimosso pg/redis, auto-scan require)');
5327
5386
 
5328
5387
  // Create minimal .env for sandbox
5329
5388
  const envContent = [
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.129';
8
+ export const VERSION = '13.5.131';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -7548,13 +7548,22 @@ function renderWebCraft(el) {
7548
7548
  '</div>' +
7549
7549
  '<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">' +
7550
7550
  (wcState.repairing ?
7551
- '<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">'
7552
- +'<div style="font-size:38px;animation:wcRobotBob 1s ease-in-out infinite">&#128295;</div>'
7553
- +'<div style="font-size:13px;font-weight:700;color:#facc15;margin-top:12px">Correzione automatica in corso...</div>'
7554
- +'<div id="wcRepairCounter" style="font-size:11px;color:var(--dim);margin-top:6px">'+wcState.repairDone+' / '+wcState.repairTotal+' file</div>'
7555
- +'<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>'
7556
- +'<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>'
7557
- +'</div>'
7551
+ (_wcOverlayMinimized
7552
+ ? '<div id="wcRepairOverlay" onclick="wcOverlayRestore()" style="position:absolute;bottom:12px;right:12px;z-index:50;background:rgba(0,0,0,0.85);border:1px solid rgba(234,179,8,0.6);border-radius:20px;padding:5px 12px;display:flex;align-items:center;gap:7px;cursor:pointer;animation:wcBubbleIn .2s ease;backdrop-filter:blur(4px)">'
7553
+ +'<span style="font-size:16px;animation:wcRobotBob .9s ease-in-out infinite">&#128295;</span>'
7554
+ +'<span style="font-size:10px;color:#facc15;font-weight:700;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">'+wcEsc(wcState.repairCurrent || 'Correzione...')+'</span>'
7555
+ +'<span style="font-size:9px;color:var(--dim)">'+wcState.repairDone+'/'+wcState.repairTotal+'</span>'
7556
+ +'<span style="display:flex;gap:3px">'+[0,1,2].map(function(_,idx){ return '<span style="width:4px;height:4px;border-radius:50%;background:#facc15;animation:wcDot 1.1s ease-in-out infinite '+(idx*0.18)+'s"></span>'; }).join('')+'</span>'
7557
+ +'</div>'
7558
+ : '<div id="wcRepairOverlay" onclick="wcOverlayMinimize()" title="Clicca per 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;cursor:pointer;animation:wcBubbleIn .3s ease">'
7559
+ +'<div style="font-size:38px;animation:wcRobotBob 1s ease-in-out infinite">&#128295;</div>'
7560
+ +'<div style="font-size:13px;font-weight:700;color:#facc15;margin-top:12px">Correzione automatica in corso...</div>'
7561
+ +'<div style="font-size:10px;color:var(--dim);margin-top:4px">Clicca per navigare i file</div>'
7562
+ +'<div id="wcRepairCounter" style="font-size:11px;color:var(--dim);margin-top:6px">'+wcState.repairDone+' / '+wcState.repairTotal+' file</div>'
7563
+ +'<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>'
7564
+ +'<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>'
7565
+ +'</div>'
7566
+ )
7558
7567
  : wcState.running ? (
7559
7568
  _wcOverlayMinimized
7560
7569
  // Minimized: small pill in bottom-right corner
@@ -8069,7 +8078,7 @@ function wcOverlayMinimize() {
8069
8078
  renderWebCraft(document.getElementById('content'));
8070
8079
  if (_wcOverlayTimer) clearTimeout(_wcOverlayTimer);
8071
8080
  _wcOverlayTimer = setTimeout(function() {
8072
- if (wcState.running) { _wcOverlayMinimized = false; renderWebCraft(document.getElementById('content')); }
8081
+ if (wcState.running || wcState.repairing) { _wcOverlayMinimized = false; renderWebCraft(document.getElementById('content')); }
8073
8082
  }, 10000);
8074
8083
  }
8075
8084