nothumanallowed 13.5.49 → 13.5.50

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.50",
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,26 @@ 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())"],
4129
4141
  ];
4130
4142
  function patchJsFiles(dir) {
4131
4143
  if (!fs.existsSync(dir)) return;
@@ -4226,7 +4238,20 @@ module.exports = { get, set, del, exists };
4226
4238
  global._wcSandboxDir = sandboxDir;
4227
4239
 
4228
4240
  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); });
4241
+ proc.stderr.on('data', d => {
4242
+ const raw = d.toString();
4243
+ // Extract meaningful error: MODULE_NOT_FOUND
4244
+ const modMatch = raw.match(/Cannot find module '([^']+)'/);
4245
+ if (modMatch) {
4246
+ sendLog(' ❌ Modulo mancante: ' + modMatch[1]);
4247
+ sendLog(' → Questo modulo non è supportato in sandbox. Contatta il supporto NHA.');
4248
+ return;
4249
+ }
4250
+ // Skip node internals noise
4251
+ const l = raw.trim();
4252
+ if (!l || l.startsWith('at ') || l.startsWith('(node:') || l === '^') return;
4253
+ sendLog(' [server] ' + l);
4254
+ });
4230
4255
 
4231
4256
  // Wait for server to be ready (max 10s)
4232
4257
  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.50';
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>' +