nothumanallowed 13.5.69 → 13.5.70
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 +25 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "13.5.
|
|
3
|
+
"version": "13.5.70",
|
|
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
|
@@ -4274,6 +4274,21 @@ module.exports = { get, set, del, exists };
|
|
|
4274
4274
|
fs.mkdirSync(path.join(sandboxDir, 'server', 'services'), { recursive: true });
|
|
4275
4275
|
fs.writeFileSync(path.join(sandboxDir, 'server', 'services', 'cache.js'), cacheShim, 'utf8');
|
|
4276
4276
|
|
|
4277
|
+
// Validators shim — LLM often generates require('../utils/validators') with helpers that don't exist
|
|
4278
|
+
const validatorsShim = `
|
|
4279
|
+
// NHA WebCraft Sandbox — utils/validators shim
|
|
4280
|
+
function validateEmail(email) { return typeof email === 'string' && /^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/.test(email.trim()); }
|
|
4281
|
+
function sanitizeText(str) { return typeof str === 'string' ? str.replace(/<[^>]*>/g, '').trim() : ''; }
|
|
4282
|
+
function validatePassword(pwd) { return typeof pwd === 'string' && pwd.length >= 8; }
|
|
4283
|
+
function validateUsername(u) { return typeof u === 'string' && u.length >= 2 && u.length <= 50; }
|
|
4284
|
+
function validatePhone(p) { return typeof p === 'string' && /^[+]?[\\d\\s\\-().]{7,20}$/.test(p.trim()); }
|
|
4285
|
+
module.exports = { validateEmail, sanitizeText, validatePassword, validateUsername, validatePhone };
|
|
4286
|
+
`;
|
|
4287
|
+
fs.mkdirSync(path.join(sandboxDir, 'server', 'utils'), { recursive: true });
|
|
4288
|
+
if (!fs.existsSync(path.join(sandboxDir, 'server', 'utils', 'validators.js'))) {
|
|
4289
|
+
fs.writeFileSync(path.join(sandboxDir, 'server', 'utils', 'validators.js'), validatorsShim, 'utf8');
|
|
4290
|
+
}
|
|
4291
|
+
|
|
4277
4292
|
// Patch all generated JS files: fix known wrong require() names
|
|
4278
4293
|
// The LLM often uses 'bcrypt' instead of 'bcryptjs', 'pg' instead of nothing, etc.
|
|
4279
4294
|
const requireFixes = [
|
|
@@ -4293,6 +4308,8 @@ module.exports = { get, set, del, exists };
|
|
|
4293
4308
|
[/require\(['"]winston['"]\)/g, "{createLogger:()=>({info:()=>{},error:()=>{},warn:()=>{}}),transports:{Console:function(){}},format:{combine:()=>{},timestamp:()=>{},json:()=>{}}}"],
|
|
4294
4309
|
[/require\(['"]morgan['"]\)/g, "(()=>(r,s,n)=>n())"],
|
|
4295
4310
|
[/require\(['"]compression['"]\)/g, "(()=>(r,s,n)=>n())"],
|
|
4311
|
+
[/require\(['"]express-validator['"]\)/g, "{body:()=>({isEmail:()=>({normalizeEmail:()=>({run:async()=>{}})}),isLength:()=>({run:async()=>{}}),trim:()=>({escape:()=>({run:async()=>{}})}),notEmpty:()=>({run:async()=>{}})}),validationResult:()=>({isEmpty:()=>true,array:()=>[]})}"],
|
|
4312
|
+
[/require\(['"]validator['"]\)/g, "{isEmail:(s)=>/^[^@\\s]+@[^@\\s]+[.][^@\\s]+$/.test(s),escape:(s)=>String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'),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); }}"],
|
|
4296
4313
|
[/require\(['"]cookie-parser['"]\)/g, "(()=>(r,s,n)=>{r.cookies=r.cookies||{};n()})"],
|
|
4297
4314
|
[/require\(['"]passport['"]\)/g, "{initialize:()=>(r,s,n)=>n(),session:()=>(r,s,n)=>n(),authenticate:()=>(r,s,n)=>n&&n()}"],
|
|
4298
4315
|
[/require\(['"]express-session['"]\)/g, "(()=>(r,s,n)=>{r.session=r.session||{};n()})"],
|
|
@@ -4313,6 +4330,14 @@ module.exports = { get, set, del, exists };
|
|
|
4313
4330
|
[/require\(['"]\.\.\/\.\.\/config['"]\)/g, "{env:process.env}"],
|
|
4314
4331
|
[/require\(['"]\.\.\/config['"]\)/g, "{env:process.env}"],
|
|
4315
4332
|
[/require\(['"]\.\/config['"]\)/g, "{env:process.env}"],
|
|
4333
|
+
// utils/* — LLM generates helpers that don't exist; redirect to shim
|
|
4334
|
+
[/require\(['"]\.\.\/utils\/validators['"]\)/g, "require('../utils/validators')"],
|
|
4335
|
+
[/require\(['"]\.\/utils\/validators['"]\)/g, "require('./utils/validators')"],
|
|
4336
|
+
[/require\(['"]\.\.\/utils\/validation['"]\)/g, "require('../utils/validators')"],
|
|
4337
|
+
[/require\(['"]\.\.\/helpers\/validators['"]\)/g, "require('../utils/validators')"],
|
|
4338
|
+
[/require\(['"]\.\.\/utils\/helpers['"]\)/g, "{sanitize:(s)=>String(s).trim(),escape:(s)=>String(s).replace(/</g,'<')}"],
|
|
4339
|
+
[/require\(['"]\.\.\/utils\/logger['"]\)/g, "{info:()=>{},error:()=>{},warn:()=>{},debug:()=>{}}"],
|
|
4340
|
+
[/require\(['"]\.\.\/utils\/errors['"]\)/g, "{AppError:class AppError extends Error{constructor(m,s){super(m);this.statusCode=s||500;}}}"],
|
|
4316
4341
|
// rateLimiter: LLM sometimes creates a separate file instead of importing from security.js
|
|
4317
4342
|
[/require\(['"]\.\.\/middleware\/rateLimiter['"]\)/g, "require('../middleware/security')"],
|
|
4318
4343
|
[/require\(['"]\.\/middleware\/rateLimiter['"]\)/g, "require('./middleware/security')"],
|