nothumanallowed 13.5.49 → 13.5.51

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.49",
3
+ "version": "13.5.51",
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": {
@@ -4118,14 +4118,35 @@ module.exports = { get, set, del, exists };
4118
4118
  // Patch all generated JS files: fix known wrong require() names
4119
4119
  // The LLM often uses 'bcrypt' instead of 'bcryptjs', 'pg' instead of nothing, etc.
4120
4120
  const requireFixes = [
4121
- [/require\(['"]bcrypt['"]\)/g, "require('bcryptjs')"],
4122
- [/require\(['"]node-postgres['"]\)/g, "require('bcryptjs')"],
4123
- [/require\(['"]pg['"]\)/g, "require('./db')"],
4124
- [/require\(['"]ioredis['"]\)/g, "require('../services/cache')"],
4125
- [/require\(['"]redis['"]\)/g, "require('../services/cache')"],
4126
- [/require\(['"]ip['"]\)/g, "({address:()=>'127.0.0.1'})"],
4127
- [/require\(['"]express-async-errors['"]\)/g, "{}"],
4128
- [/require\(['"]multer['"]\)/g, "({single:()=>(r,s,n)=>n(),array:()=>(r,s,n)=>n()})"],
4121
+ [/require\(['"]bcrypt['"]\)/g, "require('bcryptjs')"],
4122
+ [/require\(['"]node-postgres['"]\)/g, "require('./db')"],
4123
+ [/require\(['"]pg['"]\)/g, "require('./db')"],
4124
+ [/require\(['"]ioredis['"]\)/g, "require('../services/cache')"],
4125
+ [/require\(['"]redis['"]\)/g, "require('../services/cache')"],
4126
+ [/require\(['"]ip['"]\)/g, "({address:()=>'127.0.0.1',toLong:()=>0})"],
4127
+ [/require\(['"]express-async-errors['"]\)/g, "{}"],
4128
+ [/require\(['"]multer['"]\)/g, "({single:()=>(r,s,n)=>n(),array:()=>(r,s,n)=>n(),memoryStorage:()=>({})})"],
4129
+ [/require\(['"]sharp['"]\)/g, "({})"],
4130
+ [/require\(['"]uuid['"]\)/g, "{v4:()=>Math.random().toString(36).slice(2)}"],
4131
+ [/require\(['"]nanoid['"]\)/g, "{nanoid:()=>Math.random().toString(36).slice(2)}"],
4132
+ [/require\(['"]joi['"]\)/g, "{object:()=>({keys:()=>({validate:()=>({error:null})})})}"],
4133
+ [/require\(['"]zod['"]\)/g, "{z:{object:()=>({parse:(x)=>x}),string:()=>({min:()=>({max:()=>({email:()=>({optional:()=>({})})})})})}"],
4134
+ [/require\(['"]winston['"]\)/g, "{createLogger:()=>({info:()=>{},error:()=>{},warn:()=>{}}),transports:{Console:function(){}},format:{combine:()=>{},timestamp:()=>{},json:()=>{}}}"],
4135
+ [/require\(['"]morgan['"]\)/g, "(()=>(r,s,n)=>n())"],
4136
+ [/require\(['"]compression['"]\)/g, "(()=>(r,s,n)=>n())"],
4137
+ [/require\(['"]cookie-parser['"]\)/g, "(()=>(r,s,n)=>{r.cookies=r.cookies||{};n()})"],
4138
+ [/require\(['"]passport['"]\)/g, "{initialize:()=>(r,s,n)=>n(),session:()=>(r,s,n)=>n(),authenticate:()=>(r,s,n)=>n&&n()}"],
4139
+ [/require\(['"]express-session['"]\)/g, "(()=>(r,s,n)=>{r.session=r.session||{};n()})"],
4140
+ [/require\(['"]connect-flash['"]\)/g, "(()=>(r,s,n)=>n())"],
4141
+ // Fix wrong relative paths the LLM generates
4142
+ [/require\(['"]\.\.\/middleware\/securityMiddleware['"]\)/g, "require('../middleware/security')"],
4143
+ [/require\(['"]\.\/middleware\/securityMiddleware['"]\)/g, "require('./middleware/security')"],
4144
+ [/require\(['"]\.\.\/middleware\/authMiddleware['"]\)/g, "require('../middleware/validate')"],
4145
+ [/require\(['"]\.\/middleware\/authMiddleware['"]\)/g, "require('./middleware/validate')"],
4146
+ [/require\(['"]\.\.\/config\/database['"]\)/g, "require('../db')"],
4147
+ [/require\(['"]\.\/config\/database['"]\)/g, "require('./db')"],
4148
+ [/require\(['"]\.\.\/config\/db['"]\)/g, "require('../db')"],
4149
+ [/require\(['"]\.\/config\/db['"]\)/g, "require('./db')"],
4129
4150
  ];
4130
4151
  function patchJsFiles(dir) {
4131
4152
  if (!fs.existsSync(dir)) return;
@@ -4226,7 +4247,20 @@ module.exports = { get, set, del, exists };
4226
4247
  global._wcSandboxDir = sandboxDir;
4227
4248
 
4228
4249
  proc.stdout.on('data', d => { const l = d.toString().trim(); if (l) sendLog(' [server] ' + l); });
4229
- proc.stderr.on('data', d => { const l = d.toString().trim(); if (l) sendLog(' [server] ' + l); });
4250
+ proc.stderr.on('data', d => {
4251
+ const raw = d.toString();
4252
+ // Extract meaningful error: MODULE_NOT_FOUND
4253
+ const modMatch = raw.match(/Cannot find module '([^']+)'/);
4254
+ if (modMatch) {
4255
+ sendLog(' ❌ Modulo mancante: ' + modMatch[1]);
4256
+ sendLog(' → Questo modulo non è supportato in sandbox. Contatta il supporto NHA.');
4257
+ return;
4258
+ }
4259
+ // Skip node internals noise
4260
+ const l = raw.trim();
4261
+ if (!l || l.startsWith('at ') || l.startsWith('(node:') || l === '^') return;
4262
+ sendLog(' [server] ' + l);
4263
+ });
4230
4264
 
4231
4265
  // Wait for server to be ready (max 10s)
4232
4266
  await new Promise((resolve, reject) => {
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.49';
8
+ export const VERSION = '13.5.51';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -6376,7 +6376,8 @@ function wcPickExample(i) {
6376
6376
  function wcTabFiles() { wcRightTab = 'files'; renderWebCraft(document.getElementById('content')); }
6377
6377
  function wcTabPreview() { wcRightTab = 'preview'; renderWebCraft(document.getElementById('content')); }
6378
6378
  function wcOpenSandbox() { if (wcState.sandbox.port) window.open('http://127.0.0.1:' + wcState.sandbox.port, '_blank'); }
6379
- function wcTogglePhase(key) { wcSandboxExpanded[key] = !wcSandboxExpanded[key]; renderWebCraft(document.getElementById('content')); }
6379
+ var _wcPhaseKeys = ['files','shims','pkg','env','deps','install','start'];
6380
+ function wcTogglePhase(idx) { var k = _wcPhaseKeys[idx]; if (k) { wcSandboxExpanded[k] = !wcSandboxExpanded[k]; renderWebCraft(document.getElementById('content')); } }
6380
6381
 
6381
6382
  function wcMainTabNew() { wcMainTab = 'new'; renderWebCraft(document.getElementById('content')); }
6382
6383
  function wcMainTabProjects() {
@@ -6642,7 +6643,7 @@ function wcSandboxPanelHtml() {
6642
6643
  var statusColor = { done:'var(--green)', active:'var(--amber)', pending:'var(--dim)', error:'var(--red)' };
6643
6644
  var statusIcon = { done:'✓', active:'⏳', pending:'○', error:'❌' };
6644
6645
 
6645
- var phasesHtml = phases.map(function(ph){
6646
+ var phasesHtml = phases.map(function(ph, phi){
6646
6647
  var st = phaseStatus(ph.key);
6647
6648
  var lines = byPhase[ph.key] || [];
6648
6649
  var clean = lines.filter(function(l){ return l.indexOf('npm fund') === -1 && l.indexOf('run ') === -1 && l.indexOf('npm audit') === -1; });
@@ -6675,7 +6676,7 @@ function wcSandboxPanelHtml() {
6675
6676
 
6676
6677
  var clickable = hasContent && st !== 'pending';
6677
6678
  return '<div style="border-bottom:1px solid var(--border)">' +
6678
- '<div onclick="'+( clickable ? 'wcTogglePhase('+JSON.stringify(ph.key)+')' : '' )+'" style="display:flex;gap:10px;align-items:center;padding:9px 12px;cursor:'+(clickable?'pointer':'default')+'">' +
6679
+ '<div onclick="'+(clickable?'wcTogglePhase('+phi+')':'')+'" style="display:flex;gap:10px;align-items:center;padding:9px 12px;cursor:'+(clickable?'pointer':'default')+'">' +
6679
6680
  '<span style="font-size:13px;flex-shrink:0">'+ph.icon+'</span>' +
6680
6681
  '<div style="flex:1;min-width:0">' +
6681
6682
  '<div style="font-size:11px;font-weight:600;color:'+(st==='pending'?'var(--dim)':'var(--text)')+'">'+ph.label+'</div>' +
@@ -6688,7 +6689,7 @@ function wcSandboxPanelHtml() {
6688
6689
  '</div>';
6689
6690
  }).join('');
6690
6691
 
6691
- return '<div style="display:flex;flex-direction:column;flex:1;min-height:0">' +
6692
+ return '<div style="display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto">' +
6692
6693
  phasesHtml +
6693
6694
  (sb.error ? '<div style="padding:10px 14px;color:var(--red);font-size:11px;font-family:var(--mono);border-top:1px solid var(--border)">&#10060; '+wcEsc(sb.error)+'</div>' : '') +
6694
6695
  '</div>';