nothumanallowed 13.5.48 → 13.5.49
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 +1 -1
- package/src/commands/ui.mjs +29 -1
- package/src/constants.mjs +1 -1
- package/src/services/web-ui.mjs +38 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "13.5.
|
|
3
|
+
"version": "13.5.49",
|
|
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": {
|
package/src/commands/ui.mjs
CHANGED
|
@@ -4115,7 +4115,35 @@ module.exports = { get, set, del, exists };
|
|
|
4115
4115
|
fs.mkdirSync(path.join(sandboxDir, 'server', 'services'), { recursive: true });
|
|
4116
4116
|
fs.writeFileSync(path.join(sandboxDir, 'server', 'services', 'cache.js'), cacheShim, 'utf8');
|
|
4117
4117
|
|
|
4118
|
-
|
|
4118
|
+
// Patch all generated JS files: fix known wrong require() names
|
|
4119
|
+
// The LLM often uses 'bcrypt' instead of 'bcryptjs', 'pg' instead of nothing, etc.
|
|
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()})"],
|
|
4129
|
+
];
|
|
4130
|
+
function patchJsFiles(dir) {
|
|
4131
|
+
if (!fs.existsSync(dir)) return;
|
|
4132
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
4133
|
+
const full = path.join(dir, entry.name);
|
|
4134
|
+
if (entry.isDirectory()) { patchJsFiles(full); continue; }
|
|
4135
|
+
if (!entry.name.endsWith('.js')) continue;
|
|
4136
|
+
let src = fs.readFileSync(full, 'utf8');
|
|
4137
|
+
let changed = false;
|
|
4138
|
+
for (const [pat, rep] of requireFixes) {
|
|
4139
|
+
const next = src.replace(pat, rep);
|
|
4140
|
+
if (next !== src) { src = next; changed = true; }
|
|
4141
|
+
}
|
|
4142
|
+
if (changed) fs.writeFileSync(full, src, 'utf8');
|
|
4143
|
+
}
|
|
4144
|
+
}
|
|
4145
|
+
patchJsFiles(path.join(sandboxDir, 'server'));
|
|
4146
|
+
sendLog('🔧 Shim iniettati: DB (in-memory), Sentinel WAF, Cache — require() patchati');
|
|
4119
4147
|
|
|
4120
4148
|
// Patch package.json to remove pg, add only what's needed
|
|
4121
4149
|
const pkgPath = path.join(sandboxDir, 'package.json');
|
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.
|
|
8
|
+
export const VERSION = '13.5.49';
|
|
9
9
|
export const BASE_URL = 'https://nothumanallowed.com/cli';
|
|
10
10
|
export const API_BASE = 'https://nothumanallowed.com/api/v1';
|
|
11
11
|
|
package/src/services/web-ui.mjs
CHANGED
|
@@ -6245,6 +6245,7 @@ var wcState = {
|
|
|
6245
6245
|
var wcRightTab = 'files';
|
|
6246
6246
|
var wcMainTab = 'new'; // 'new' | 'projects'
|
|
6247
6247
|
var wcProjectsList = []; // cached list from server
|
|
6248
|
+
var wcSandboxExpanded = {}; // { phaseKey: true/false }
|
|
6248
6249
|
|
|
6249
6250
|
function wcEsc(s){return s?String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'):''}
|
|
6250
6251
|
|
|
@@ -6375,6 +6376,7 @@ function wcPickExample(i) {
|
|
|
6375
6376
|
function wcTabFiles() { wcRightTab = 'files'; renderWebCraft(document.getElementById('content')); }
|
|
6376
6377
|
function wcTabPreview() { wcRightTab = 'preview'; renderWebCraft(document.getElementById('content')); }
|
|
6377
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')); }
|
|
6378
6380
|
|
|
6379
6381
|
function wcMainTabNew() { wcMainTab = 'new'; renderWebCraft(document.getElementById('content')); }
|
|
6380
6382
|
function wcMainTabProjects() {
|
|
@@ -6643,27 +6645,46 @@ function wcSandboxPanelHtml() {
|
|
|
6643
6645
|
var phasesHtml = phases.map(function(ph){
|
|
6644
6646
|
var st = phaseStatus(ph.key);
|
|
6645
6647
|
var lines = byPhase[ph.key] || [];
|
|
6646
|
-
// Filter noise: skip npm audit/funding lines
|
|
6647
6648
|
var clean = lines.filter(function(l){ return l.indexOf('npm fund') === -1 && l.indexOf('run ') === -1 && l.indexOf('npm audit') === -1; });
|
|
6648
|
-
|
|
6649
|
-
var
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
var
|
|
6655
|
-
|
|
6649
|
+
var isOpen = !!wcSandboxExpanded[ph.key];
|
|
6650
|
+
var hasContent = clean.length > 0;
|
|
6651
|
+
|
|
6652
|
+
// Summary line (always visible)
|
|
6653
|
+
var summary = '';
|
|
6654
|
+
if (ph.key === 'files') {
|
|
6655
|
+
var cnt = clean.filter(function(l){ return l.indexOf('✓') !== -1; }).length;
|
|
6656
|
+
summary = cnt ? cnt + ' file scritti' : '';
|
|
6657
|
+
} else if (ph.key === 'deps') {
|
|
6658
|
+
var dcnt = clean.filter(function(l){ return l.indexOf('•') !== -1; }).length;
|
|
6659
|
+
summary = dcnt ? dcnt + ' dipendenze' : '';
|
|
6656
6660
|
} else if (clean.length > 0) {
|
|
6657
|
-
var
|
|
6658
|
-
|
|
6661
|
+
var last = clean.filter(function(l){ return l.trim(); }).slice(-1)[0] || '';
|
|
6662
|
+
summary = wcEsc(last.trim().slice(0, 60));
|
|
6659
6663
|
}
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6664
|
+
|
|
6665
|
+
// Expanded detail — all lines
|
|
6666
|
+
var expandedHtml = '';
|
|
6667
|
+
if (isOpen && hasContent) {
|
|
6668
|
+
expandedHtml = '<div style="margin-top:6px;padding:8px;background:var(--bg);border-radius:6px;max-height:180px;overflow-y:auto">' +
|
|
6669
|
+
clean.map(function(l){
|
|
6670
|
+
var col = l.indexOf('❌') !== -1 || l.indexOf('Error') !== -1 ? 'var(--red)' : l.indexOf('✓') !== -1 || l.indexOf('✅') !== -1 ? 'var(--green)' : 'var(--dim)';
|
|
6671
|
+
return '<div style="font-size:10px;font-family:var(--mono);color:'+col+';line-height:1.6;white-space:pre-wrap;word-break:break-all">'+wcEsc(l)+'</div>';
|
|
6672
|
+
}).join('') +
|
|
6673
|
+
'</div>';
|
|
6674
|
+
}
|
|
6675
|
+
|
|
6676
|
+
var clickable = hasContent && st !== 'pending';
|
|
6677
|
+
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
|
+
'<span style="font-size:13px;flex-shrink:0">'+ph.icon+'</span>' +
|
|
6680
|
+
'<div style="flex:1;min-width:0">' +
|
|
6681
|
+
'<div style="font-size:11px;font-weight:600;color:'+(st==='pending'?'var(--dim)':'var(--text)')+'">'+ph.label+'</div>' +
|
|
6682
|
+
(summary && !isOpen ? '<div style="font-size:10px;color:var(--dim);margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis">'+summary+'</div>' : '') +
|
|
6683
|
+
'</div>' +
|
|
6684
|
+
(clickable ? '<span style="font-size:10px;color:var(--dim);flex-shrink:0">'+(isOpen?'▲':'▼')+'</span>' : '') +
|
|
6685
|
+
'<span style="font-size:13px;color:'+statusColor[st]+';flex-shrink:0;margin-left:4px">'+statusIcon[st]+'</span>' +
|
|
6665
6686
|
'</div>' +
|
|
6666
|
-
'<
|
|
6687
|
+
(isOpen ? '<div style="padding:0 12px 10px">' + expandedHtml + '</div>' : '') +
|
|
6667
6688
|
'</div>';
|
|
6668
6689
|
}).join('');
|
|
6669
6690
|
|