nothumanallowed 13.5.139 → 13.5.141

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.139",
3
+ "version": "13.5.141",
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": {
@@ -5145,6 +5145,7 @@ module.exports.notFoundHandler = notFoundHandler;
5145
5145
  // Always overwrite — older shim versions may be missing exports like notFoundHandler
5146
5146
  fs.writeFileSync(path.join(sandboxDir, 'server', 'middleware', 'errors.js'), errorsShim, 'utf8');
5147
5147
 
5148
+
5148
5149
  // Models shim — LLM often generates require('../models/User') etc. that don't exist
5149
5150
  // Create a generic User model shim backed by the in-memory DB shim
5150
5151
  const userModelShim = `
@@ -5705,11 +5706,23 @@ module.exports = { validateEmail, sanitizeText, validatePassword, validateUserna
5705
5706
  return abs.startsWith(sandboxDir) ? abs.slice(sandboxDir.length + 1) : abs.split('/').slice(-3).join('/');
5706
5707
  }));
5707
5708
 
5709
+ // For autofix: also detect "Cannot find module './redis'" style errors and extract the requiring file
5710
+ // Stack trace line: "at Object.<anonymous> (/path/server/middleware/security.js:3:X)"
5711
+ // We want to guarantee the file that contains the bad require() is always in context.
5712
+ const moduleNotFoundMatch = autofix ? message.match(/Cannot find module '([^']+)'[\s\S]*?at Object[^(]*\(([^)]+\.js):\d+:\d+\)/) : null;
5713
+ if (moduleNotFoundMatch) {
5714
+ const requirerAbs = moduleNotFoundMatch[2];
5715
+ const requirerRel = requirerAbs.startsWith(sandboxDir) ? requirerAbs.slice(sandboxDir.length + 1) : requirerAbs.split('/').slice(-3).join('/');
5716
+ stackFiles.add(requirerRel);
5717
+ }
5718
+
5719
+ const isStackFile = (f) => stackFiles.size > 0 && [...stackFiles].some(sf => f.name.includes(sf) || sf.includes(f.name));
5720
+
5708
5721
  const relevantFiles = allFiles.filter(f => {
5709
5722
  const nameLower = f.name.toLowerCase();
5710
5723
  if (alwaysInclude.some(a => nameLower.endsWith(a))) return true;
5711
- // Always include files mentioned in stack trace (autofix)
5712
- if (stackFiles.size > 0 && [...stackFiles].some(sf => f.name.includes(sf) || sf.includes(f.name))) return true;
5724
+ // Always include files mentioned in stack trace (autofix) — highest priority
5725
+ if (isStackFile(f)) return true;
5713
5726
  // Include if file name or path fragment mentioned in message
5714
5727
  const parts = f.name.split('/');
5715
5728
  if (parts.some(p => msgLower.includes(p.replace(/\.[^.]+$/, '').toLowerCase()))) return true;
@@ -5717,11 +5730,19 @@ module.exports = { validateEmail, sanitizeText, validatePassword, validateUserna
5717
5730
  if (/errore|error|fix|crash|module|require|import/i.test(message) && f.name.startsWith('server/') && f.name.endsWith('.js')) return true;
5718
5731
  return false;
5719
5732
  });
5733
+ // Sort: stack trace files first (guaranteed to be in context regardless of budget)
5734
+ relevantFiles.sort((a, b) => {
5735
+ const aStack = isStackFile(a) ? 0 : 1;
5736
+ const bStack = isStackFile(b) ? 0 : 1;
5737
+ return aStack - bStack;
5738
+ });
5720
5739
  // Cap total context at ~24KB to stay within 7B model limits
5740
+ // Stack trace files are always included even if over budget
5721
5741
  let contextBudget = 24 * 1024;
5722
5742
  const selectedFiles = [];
5723
5743
  for (const f of relevantFiles) {
5724
- if (contextBudget <= 0) break;
5744
+ const isRequired = isStackFile(f) || alwaysInclude.some(a => f.name.toLowerCase().endsWith(a));
5745
+ if (contextBudget <= 0 && !isRequired) break;
5725
5746
  selectedFiles.push(f);
5726
5747
  contextBudget -= f.content.length;
5727
5748
  }
@@ -5755,7 +5776,7 @@ Per leggere un file (se hai bisogno di piu contesto):
5755
5776
 
5756
5777
  REGOLE CRITICHE:
5757
5778
  - Spiega SEMPRE in linguaggio naturale cosa stai facendo PRIMA dei blocchi tool
5758
- - ${autofix ? 'MODALITA AUTO-FIX: usa "write" per riscrivere i file problematici nella loro interezza — è più affidabile di "edit" quando il file ha già subito modifiche. Includi il contenuto COMPLETO del file nel campo "content".' : 'Usa "edit" (old/new) quando possibile, "write" solo per file nuovi o riscritture complete'}
5779
+ - ${autofix ? 'MODALITA AUTO-FIX: il file incriminato è già incluso qui sotto. Riscrivilo COMPLETAMENTE con "write" — è più affidabile di "edit" quando il file ha già subito modifiche. REGOLE CRITICHE PER IL FIX: (1) SyntaxError "Unexpected token \';\'" in helmet/CSP = stai usando punto-e-virgola invece di virgola negli oggetti JS — usa VIRGOLE. (2) "Cannot find module \'./redis\'" = rimuovi il require e usa solo i moduli in package.json. (3) NON aggiungere require() di moduli non in package.json. Includi il contenuto COMPLETO del file nel campo "content".' : 'Usa "edit" (old/new) quando possibile, "write" solo per file nuovi o riscritture complete'}
5759
5780
  - old_string deve essere ESATTO come appare nel file (copy-paste)
5760
5781
  - Non inventare moduli npm: usa solo quelli in package.json o standard Node.js
5761
5782
  - Dopo ogni fix spiega brevemente cosa hai cambiato e perche
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.139';
8
+ export const VERSION = '13.5.141';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -8545,7 +8545,7 @@ function wcDiffPanelHtml() {
8545
8545
  var items = _wcDiffQueue.map(function(d, di) {
8546
8546
  var addedLines = (d.after||'').split(String.fromCharCode(10)).length - (d.before||'').split(String.fromCharCode(10)).length;
8547
8547
  var sign = addedLines >= 0 ? '+' : '';
8548
- return '<details style="border:1px solid var(--border);border-radius:6px;margin-bottom:6px;background:var(--bg3)">' +
8548
+ return '<details open style="border:1px solid var(--border);border-radius:6px;margin-bottom:6px;background:var(--bg3)">' +
8549
8549
  '<summary style="padding:7px 10px;cursor:pointer;font-size:11px;font-family:var(--mono);color:var(--text);list-style:none;display:flex;align-items:center;gap:8px">' +
8550
8550
  '<span style="color:var(--green);font-size:10px">&#9650;</span>' +
8551
8551
  '<span style="flex:1">' + wcEsc(d.file) + '</span>' +