nothumanallowed 13.5.143 → 13.5.145

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.143",
3
+ "version": "13.5.145",
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": {
@@ -5273,6 +5273,9 @@ module.exports = { validateEmail, sanitizeText, validatePassword, validateUserna
5273
5273
  [/require\(['"]\.\/middleware\/rateLimit['"]\)/g, "require('./middleware/security')"],
5274
5274
  [/require\(['"]\.\.\/middleware\/limiter['"]\)/g, "require('../middleware/security')"],
5275
5275
  [/require\(['"]\.\/middleware\/limiter['"]\)/g, "require('./middleware/security')"],
5276
+ // nodemailer: LLM calls createTransporter (wrong) instead of createTransport (correct)
5277
+ [/nodemailer\.createTransporter\s*\(/g, "nodemailer.createTransport("],
5278
+ [/\{createTransporter\s*:/g, "{createTransport:"],
5276
5279
  ];
5277
5280
  function patchJsFiles(dir, rootDir) {
5278
5281
  if (!fs.existsSync(dir)) return;
@@ -5776,7 +5779,7 @@ Per leggere un file (se hai bisogno di piu contesto):
5776
5779
 
5777
5780
  REGOLE CRITICHE:
5778
5781
  - Spiega SEMPRE in linguaggio naturale cosa stai facendo PRIMA dei blocchi tool
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'}
5782
+ - ${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. (4) SyntaxError "Unexpected identifier" con nomi spezzati tipo "create Transport" o "SMTP _HOST" o "trans porter" = c\'è uno SPAZIO nel mezzo di un nome di variabile/metodo/property — unisci le parole: createTransport, SMTP_HOST, transporter. (5) "nodemailer.createTransporter is not a function" = il metodo corretto di nodemailer e\' createTransport (senza r finale). Includi il contenuto COMPLETO del file nel campo "content".' : 'Usa "edit" (old/new) quando possibile, "write" solo per file nuovi o riscritture complete'}
5780
5783
  - old_string deve essere ESATTO come appare nel file (copy-paste)
5781
5784
  - Non inventare moduli npm: usa solo quelli in package.json o standard Node.js
5782
5785
  - Dopo ogni fix spiega brevemente cosa hai cambiato e perche
@@ -5834,7 +5837,7 @@ REGOLE CRITICHE:
5834
5837
  _inTool = false;
5835
5838
  }
5836
5839
  }
5837
- }, { max_tokens: 4096 });
5840
+ }, { max_tokens: 8192 });
5838
5841
  // Flush any remaining visible text after stream ends
5839
5842
  if (!_inTool && _toolBuf.trim()) sendEv({ type: 'text', token: _toolBuf });
5840
5843
  }
@@ -5854,18 +5857,35 @@ REGOLE CRITICHE:
5854
5857
  }
5855
5858
 
5856
5859
  // Parse and execute tool calls from response
5857
- // Sanitize JSON from LLM: replace literal newlines inside JSON strings with \n
5858
- // Models often write multiline strings without escaping, which breaks JSON.parse
5860
+ // Sanitize JSON from LLM: replace literal newlines and invalid escape sequences inside JSON strings
5861
+ // Models often write multiline strings without escaping, or use \s \d \w in regex inside content
5859
5862
  const sanitizeToolJson = (raw) => {
5860
- // Replace literal CR/LF inside JSON string values with escaped versions
5861
- // Strategy: walk char by char, track if we're inside a JSON string
5863
+ // Valid JSON escape chars after backslash: " \ / b f n r t u
5864
+ const validEscapes = new Set(['"', '\\', '/', 'b', 'f', 'n', 'r', 't', 'u']);
5862
5865
  let out = '';
5863
5866
  let inStr = false;
5864
5867
  let escaped = false;
5865
5868
  for (let ci = 0; ci < raw.length; ci++) {
5866
5869
  const ch = raw[ci];
5867
- if (escaped) { out += ch; escaped = false; continue; }
5868
- if (ch === '\\') { out += ch; escaped = true; continue; }
5870
+ if (escaped) {
5871
+ escaped = false;
5872
+ // If this is not a valid JSON escape char, double the backslash
5873
+ if (!validEscapes.has(ch)) {
5874
+ out += '\\\\' + ch;
5875
+ } else {
5876
+ out += ch;
5877
+ }
5878
+ continue;
5879
+ }
5880
+ if (ch === '\\') {
5881
+ if (inStr) {
5882
+ escaped = true;
5883
+ out += ch;
5884
+ } else {
5885
+ out += ch;
5886
+ }
5887
+ continue;
5888
+ }
5869
5889
  if (ch === '"') { inStr = !inStr; out += ch; continue; }
5870
5890
  if (inStr && (ch === '\n' || ch === '\r')) {
5871
5891
  out += ch === '\n' ? '\\n' : '\\r';
@@ -5937,7 +5957,7 @@ REGOLE CRITICHE:
5937
5957
  const fallbackSys = `Sei un esperto di Node.js. Riscrivi il seguente file correggendo questo problema: ${message.slice(0, 500)}
5938
5958
  Rispondi SOLO con il contenuto completo del file corretto, senza markdown fence, senza spiegazioni.`;
5939
5959
  const fallbackUser = `FILE: ${toolCall.path}\n\`\`\`\n${content}\n\`\`\``;
5940
- const newContent = await callLLM(config, fallbackSys, fallbackUser, { max_tokens: 4096 });
5960
+ const newContent = await callLLM(config, fallbackSys, fallbackUser, { max_tokens: 8192 });
5941
5961
  const cleaned = newContent.replace(/^```[\w]*\n?/m, '').replace(/\n?```\s*$/m, '').trim();
5942
5962
  if (cleaned && cleaned.length > 20) {
5943
5963
  fs.writeFileSync(fp, cleaned, 'utf8');
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.143';
8
+ export const VERSION = '13.5.145';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11