nothumanallowed 15.1.1 → 15.1.3

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": "15.1.1",
3
+ "version": "15.1.3",
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/cli.mjs CHANGED
@@ -57,7 +57,7 @@ export async function main(argv) {
57
57
  if (result?.updateAvailable) {
58
58
  console.log('');
59
59
  warn(`New NHA version available: ${result.current} → ${result.latest}`);
60
- info('Run "nha update" to upgrade (includes npm self-update).');
60
+ info(`Run "nha update" to upgrade, or: npm cache clean --force && npm install -g nothumanallowed@${result.latest}`);
61
61
  }
62
62
  }).catch(() => {});
63
63
  }
@@ -245,10 +245,15 @@ async function cmdSelfUpdate() {
245
245
 
246
246
  info(`Updating: ${npmCheck.current} → ${npmCheck.latest}`);
247
247
 
248
- // Try without sudo first, then with sudo if needed (Linux/VM)
248
+ // Clear npm cache first to avoid stale versions
249
+ try { execSync('npm cache clean --force 2>/dev/null', { timeout: 15000, stdio: 'ignore' }); } catch {}
250
+ try { execSync('sudo npm cache clean --force 2>/dev/null', { timeout: 15000, stdio: 'ignore' }); } catch {}
251
+
252
+ // Install exact version (not @latest tag which can be stale)
253
+ const target = npmCheck.latest;
249
254
  const cmds = [
250
- 'npm install -g nothumanallowed@latest',
251
- 'sudo npm install -g nothumanallowed@latest',
255
+ `npm install -g nothumanallowed@${target}`,
256
+ `sudo npm install -g nothumanallowed@${target}`,
252
257
  ];
253
258
 
254
259
  for (const cmd of cmds) {
@@ -286,8 +286,25 @@ Select the optimal agent pipeline. Output ONLY the JSON.`;
286
286
  const useWebTools = WEB_TOOL_AGENTS.has(agent);
287
287
  let webDataBlock = '';
288
288
 
289
+ // ALWAYS pre-fetch URLs found in the task — every agent needs real data
290
+ const taskUrls = [...(task || '').matchAll(/https?:\/\/[^\s,)]+/gi)].map(m => m[0]);
291
+ if (taskUrls.length > 0 && !webDataBlock) {
292
+ sse({ token: '[Fetching task URLs...]' });
293
+ const urlFetches = await Promise.all(
294
+ taskUrls.slice(0, 3).map(async (url) => {
295
+ sse({ token: `[Fetching: ${url}]` });
296
+ return { url, content: await runFetchUrl(url) };
297
+ })
298
+ );
299
+ const urlBlock = urlFetches.filter(f => f.content).map(f => `### Content from ${f.url}:\n${f.content}`).join('\n\n---\n\n');
300
+ if (urlBlock) {
301
+ webDataBlock = `\n\n## FETCHED WEBSITE CONTENT (THIS IS THE REAL DATA — base your analysis ONLY on this, do NOT invent):\n\n${urlBlock}`;
302
+ }
303
+ sse({ token: '\n' });
304
+ }
305
+
289
306
  // Pre-fetch web data BEFORE the LLM call so the model writes with real facts
290
- if (useWebTools) {
307
+ if (useWebTools && !webDataBlock) {
291
308
  sse({ token: '[Raccolta dati web...]' });
292
309
 
293
310
  const queries = extractSearchQueries(task, stepDef?.prompt);
@@ -461,7 +478,8 @@ function buildKeywordFallback(task, sanitizedTask, hasPdf, pdfName, it) {
461
478
 
462
479
  const hasEmail = /email|mail|inbox|posta/i.test(taskLow);
463
480
  const hasCalendar = /calendar|agenda|calendari|eventi|schedule/i.test(taskLow);
464
- const hasSearch = /cerca|search|notizie|news|ultime|latest|web|internet|tendenz|trend|acquista|compra|dove\s+trovare|where\s+to\s+buy|similar|simile/i.test(taskLow);
481
+ const hasUrl = /https?:\/\/[^\s]+/i.test(taskLow);
482
+ const hasSearch = hasUrl || /cerca|search|notizie|news|ultime|latest|web|internet|tendenz|trend|acquista|compra|dove\s+trovare|where\s+to\s+buy|similar|simile|esamina|analizza.*sito|analisi.*sito|sito\s+web/i.test(taskLow);
465
483
  const hasCanvas = /html|dashboard|visua|report|grafico|chart/i.test(taskLow);
466
484
  const hasGitHub = /github|git\b|issue\b|pull request|\bPR\b/i.test(taskLow);
467
485
  const hasSlack = /slack/i.test(taskLow);