nothumanallowed 13.2.23 → 13.2.25

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.2.23",
3
+ "version": "13.2.25",
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": {
@@ -2544,82 +2544,32 @@ export async function cmdUI(args) {
2544
2544
  if (!task) { sendJSON(res, 400, { error: 'task required' }); logRequest(method, pathname, 400, Date.now() - start); return; }
2545
2545
 
2546
2546
  const plannerLang = (() => { const LANG_MAP2 = {en:'English',it:'Italian',es:'Spanish',fr:'French',de:'German',pt:'Portuguese',zh:'Chinese',ja:'Japanese',ar:'Arabic',hi:'Hindi',ru:'Russian',nl:'Dutch',pl:'Polish',tr:'Turkish',ko:'Korean'}; const lc = (config?.language||'it').slice(0,2); return LANG_MAP2[lc]||'Italian'; })();
2547
- const planPrompt = `You are a workflow planner for NHA Studio. The user wants to accomplish this task: "${task}"
2548
- The workflow will run in ${plannerLang} all agent prompts must be in ${plannerLang}.
2549
-
2550
- Design a sequential workflow of 2-6 steps. RULES:
2551
- - Use tool-agents (WebSearchAgent, EmailAgent, CalendarAgent, GitHubAgent, NotionAgent, SlackAgent) FIRST when real live data is needed
2552
- - ALWAYS use specialist agents (HERALD, ORACLE, NAVI, ATHENA, CASSANDRA, etc.) for analysis, briefings, and synthesis — NOT WriterAgent or DataAnalystAgent
2553
- - For executive briefings use HERALD. For data analysis use NAVI or ORACLE. For tech analysis use ATHENA. For risk use CASSANDRA.
2554
- - Use CanvasAgent as the LAST step ONLY when a visual HTML report/dashboard is explicitly requested
2555
- - The "prompt" field must be a plain language instruction in ${plannerLang} — never JSON or code
2556
- - Each agent receives the previous step's output as context automatically
2557
- - Pick the most relevant agents for the task don't use all of them
2558
-
2559
- TOOL AGENTS (fetch real live data):
2560
- - WebSearchAgent: search the web for current information
2561
- - EmailAgent: read user's real unread emails
2562
- - CalendarAgent: read user's real calendar events for today
2563
- - GitHubAgent: read user's GitHub notifications and issues
2564
- - NotionAgent: search user's Notion workspace
2565
- - SlackAgent: read user's Slack messages
2566
- - WriterAgent: write, summarize, synthesize text (no live data)
2567
- - SummaryAgent: condense and summarize content
2568
- - DataAnalystAgent: analyze data, find patterns, generate insights
2569
- - SecurityAgent: security audit, threat analysis
2570
- - DevOpsAgent: infrastructure, deployment, CI/CD analysis
2571
- - CanvasAgent: generate a beautiful HTML visual dashboard (LAST step only)
2572
-
2573
- SPECIALIST AGENTS (deep domain experts with rich system prompts):
2574
- - SABER: security audits, OWASP, penetration testing, vulnerability analysis
2575
- - ATLAS: infrastructure-as-code, Terraform, Kubernetes, cloud architecture
2576
- - JARVIS: full-stack architecture, API design, system design, ADRs
2577
- - VERITAS: fact-checking, evidence verification, claim validation
2578
- - CASSANDRA: risk analysis, failure modes, worst-case scenarios
2579
- - MERCURY: financial analysis, ROI, unit economics, market modeling
2580
- - HERALD: news analysis, trend detection, executive briefings
2581
- - ATHENA: tech evaluation, framework comparison, benchmarks
2582
- - ORACLE: business intelligence, KPIs, OKRs, dashboards
2583
- - NAVI: data exploration, statistical analysis, pattern detection
2584
- - MUSE: creative brainstorming, ideation, naming, taglines
2585
- - QUILL: short-form content, summaries, press releases
2586
- - SCHEHERAZADE: long-form technical writing, documentation, tutorials
2587
- - ECHO: content adaptation, cross-platform distribution
2588
- - POLYGLOT: translation, localization, multilingual content
2589
- - FORGE: CI/CD pipelines, GitHub Actions, Docker builds
2590
- - FLUX: deployment strategies, blue/green, canary releases
2591
- - SHOGUN: Kubernetes, Helm, container orchestration
2592
- - PIPE: data pipelines, Airflow, dbt, ETL
2593
- - MACRO: bulk operations, data migration, batch processing
2594
- - SHELL: shell scripting, CLI tools, automation scripts
2595
- - CONDUCTOR: workflow orchestration, task decomposition
2596
- - CRON: scheduling, cron jobs, time-based automation
2597
- - HERMES: webhooks, event-driven architecture, integrations
2598
- - BABEL: API design, microservices, OpenAPI specs
2599
- - CARTOGRAPHER: data mapping, schema inference, knowledge graphs
2600
- - LOGOS: logical analysis, argument mapping, decision theory
2601
- - EDI: A/B testing, statistical modeling, hypothesis testing
2602
- - EPICURE: nutrition, recipes, meal planning
2603
- - MURASAKI: creative writing, storytelling, narrative craft
2604
- - LINK: community management, reputation systems
2605
- - GLITCH: chaos engineering, resilience testing
2606
- - TEMPEST: performance engineering, load testing
2607
- - SAURON: observability, monitoring, alerting
2608
- - PROMETHEUS: capability routing, task decomposition
2609
- - ADE: agent design, system prompt engineering
2610
- - ZERO: vulnerability scanning, dependency audit, secret detection
2611
-
2612
- Icon values must be actual emoji characters — never HTML entities.
2613
-
2614
- Respond with ONLY valid JSON, no markdown:
2615
- {"steps":[{"icon":"🔍","agent":"WebSearchAgent","label":"Search AI news","prompt":"Search for the latest AI agent news"},{"icon":"🧠","agent":"ATHENA","label":"Tech analysis","prompt":"Analyze the search results and compare the key technologies mentioned"}]}`;
2547
+ const planPrompt = `You are a workflow planner. Task: "${task}"
2548
+ Language: ${plannerLang}. All prompts must be in ${plannerLang}.
2549
+
2550
+ Output ONLY valid JSON (no markdown, no explanation, no thinking):
2551
+ {"steps":[{"icon":"EMOJI","agent":"AGENT_NAME","label":"SHORT LABEL","prompt":"INSTRUCTION IN ${plannerLang}"}]}
2552
+
2553
+ Rules:
2554
+ - 2-5 steps max
2555
+ - Use WebSearchAgent to fetch live web data
2556
+ - Use EmailAgent/CalendarAgent/GitHubAgent/SlackAgent for personal live data
2557
+ - Use HERALD for news briefings, ORACLE for business analysis, NAVI for data analysis, ATHENA for tech evaluation, CASSANDRA for risk, MERCURY for finance, HERALD for trends, QUILL for summaries
2558
+ - Use CanvasAgent LAST only if user explicitly asks for HTML/visual/dashboard
2559
+ - icon must be a real emoji character
2560
+
2561
+ Example output:
2562
+ {"steps":[{"icon":"🔍","agent":"WebSearchAgent","label":"Cerca notizie","prompt":"Cerca le ultime notizie su intelligenza artificiale oggi"},{"icon":"📰","agent":"HERALD","label":"Analisi notizie","prompt":"Analizza le notizie trovate e crea un briefing esecutivo"},{"icon":"📊","agent":"CanvasAgent","label":"Dashboard HTML","prompt":"Crea una dashboard HTML visuale con i risultati"}]}`;
2616
2563
 
2617
2564
  try {
2618
- const planRaw = await callLLM(config, 'You are a JSON workflow planner. Respond only with valid JSON.', planPrompt, { max_tokens: 800 });
2565
+ const planRaw = await callLLM(config, 'You are a JSON workflow planner. Respond only with valid JSON, no markdown, no explanation.', planPrompt, { max_tokens: 1200 });
2619
2566
  let steps;
2620
2567
  try {
2621
- const jsonMatch = planRaw.match(/\{[\s\S]*\}/);
2622
- const parsed = JSON.parse(jsonMatch ? jsonMatch[0] : planRaw);
2568
+ // Strip <think>...</think> blocks and markdown fences before parsing
2569
+ let clean = planRaw.replace(/<think>[\s\S]*?<\/think>/g, '').trim();
2570
+ clean = clean.replace(/^```[\w]*\n?/,'').replace(/\n?```$/,'').trim();
2571
+ const jsonMatch = clean.match(/\{[\s\S]*\}/);
2572
+ const parsed = JSON.parse(jsonMatch ? jsonMatch[0] : clean);
2623
2573
  steps = parsed.steps;
2624
2574
  } catch {
2625
2575
  sendJSON(res, 500, { error: 'Failed to parse workflow plan' });
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.2.23';
8
+ export const VERSION = '13.2.25';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -2275,8 +2275,8 @@ function renderSettings(el) {
2275
2275
  ['profile-notes', 'Notes', 'Anything else agents should know about you'],
2276
2276
  ]) +
2277
2277
  '<div style="padding:12px 16px;margin-bottom:16px;background:var(--amberdim);border:1px solid var(--amber3);border-radius:8px"><span style="font-family:var(--term);color:var(--amber);font-size:13px;font-weight:700">NHA Free (Liara)</span><div style="font-size:11px;color:var(--dim);margin:4px 0 8px">Powered by Qwen3 32B. Free, no API key needed. Slower (5-15s).</div><button onclick="apiPost(\\x27/api/config\\x27,{key:\\x27provider\\x27,value:\\x27nha\\x27}).then(function(){location.reload()})" style="padding:6px 16px;background:var(--amber3);color:var(--bg);border:none;border-radius:6px;cursor:pointer;font-family:var(--mono);font-size:11px;font-weight:700">Use NHA Free</button></div>' +
2278
- settingsSection('language', 'Language / Lingua', 'Set the UI language. Applies on reload.', [
2279
- ['lang', 'Language', 'en / it / es / fr / de / pt / zh / ja / ar / hi / ru / nl / pl / tr / ko / sv / da / fi / no / cs'],
2278
+ settingsSection('language', 'Language / Lingua', 'Select the language used by all agents and Studio workflows.', [
2279
+ ['lang', 'Language', ''],
2280
2280
  ]) +
2281
2281
  settingsSection('llm', 'LLM Provider', 'Or use your own API key for faster, more capable responses.', [
2282
2282
  ['provider', 'Provider', 'nha (free) / anthropic / openai / gemini / deepseek / grok / mistral'],
@@ -2345,6 +2345,35 @@ function settingsSection(id, title, desc, fields) {
2345
2345
  h += '<option value="' + providers[pi].value + '"' + sel + '>' + providers[pi].label + '</option>';
2346
2346
  }
2347
2347
  h += '</select>';
2348
+ } else if (key === 'lang') {
2349
+ var langs = [
2350
+ {value:'it',label:'🇮🇹 Italiano'},
2351
+ {value:'en',label:'🇬🇧 English'},
2352
+ {value:'es',label:'🇪🇸 Español'},
2353
+ {value:'fr',label:'🇫🇷 Français'},
2354
+ {value:'de',label:'🇩🇪 Deutsch'},
2355
+ {value:'pt',label:'🇵🇹 Português'},
2356
+ {value:'nl',label:'🇳🇱 Nederlands'},
2357
+ {value:'pl',label:'🇵🇱 Polski'},
2358
+ {value:'ru',label:'🇷🇺 Русский'},
2359
+ {value:'zh',label:'🇨🇳 中文'},
2360
+ {value:'ja',label:'🇯🇵 日本語'},
2361
+ {value:'ko',label:'🇰🇷 한국어'},
2362
+ {value:'ar',label:'🇸🇦 العربية'},
2363
+ {value:'hi',label:'🇮🇳 हिन्दी'},
2364
+ {value:'tr',label:'🇹🇷 Türkçe'},
2365
+ {value:'sv',label:'🇸🇪 Svenska'},
2366
+ {value:'da',label:'🇩🇰 Dansk'},
2367
+ {value:'fi',label:'🇫🇮 Suomi'},
2368
+ {value:'cs',label:'🇨🇿 Čeština'},
2369
+ ];
2370
+ var curLang = currentVal || 'it';
2371
+ h += '<select style="width:100%;padding:8px 12px;font-size:13px;background:var(--bg);color:var(--fg);border:1px solid var(--border2);border-radius:var(--r)" data-config-key="lang" data-section="' + esc(id) + '">';
2372
+ for (var li=0;li<langs.length;li++) {
2373
+ var lsel = curLang === langs[li].value ? ' selected' : '';
2374
+ h += '<option value="' + langs[li].value + '"' + lsel + '>' + langs[li].label + '</option>';
2375
+ }
2376
+ h += '</select>';
2348
2377
  } else if (key === 'thinking') {
2349
2378
  // Dropdown for thinking toggle
2350
2379
  h += '<select style="width:100%;padding:8px 12px;font-size:13px;background:var(--bg);color:var(--fg);border:1px solid var(--border2);border-radius:var(--r)" data-config-key="thinking" data-section="' + esc(id) + '">' +
@@ -2404,13 +2433,22 @@ function saveSettingsSection(sectionId) {
2404
2433
  var allOk = results.every(function(r) { return r; });
2405
2434
  if (statusEl) {
2406
2435
  if (allOk) {
2407
- statusEl.textContent = 'Saved!';
2436
+ if (sectionId === 'language') {
2437
+ var langNames = {it:'Italiano',en:'English',es:'Español',fr:'Français',de:'Deutsch',pt:'Português',nl:'Nederlands',pl:'Polski',ru:'Русский',zh:'中文',ja:'日本語',ko:'한국어',ar:'العربية',hi:'हिन्दी',tr:'Türkçe',sv:'Svenska',da:'Dansk',fi:'Suomi',cs:'Čeština'};
2438
+ try {
2439
+ var cfg2 = JSON.parse(localStorage.getItem('nha_config_cache') || '{}');
2440
+ var ln = langNames[cfg2.lang] || cfg2.lang || 'Italian';
2441
+ statusEl.textContent = '✓ Language set to ' + ln + '. All agents and Studio will now respond in ' + ln + '.';
2442
+ } catch(e) { statusEl.textContent = '✓ Saved!'; }
2443
+ } else {
2444
+ statusEl.textContent = 'Saved!';
2445
+ }
2408
2446
  statusEl.style.color = 'var(--green)';
2409
2447
  } else {
2410
2448
  statusEl.textContent = 'Some fields failed to save.';
2411
2449
  statusEl.style.color = 'var(--red)';
2412
2450
  }
2413
- setTimeout(function() { statusEl.textContent = ''; }, 3000);
2451
+ setTimeout(function() { statusEl.textContent = ''; }, 4000);
2414
2452
  }
2415
2453
  });
2416
2454
  }
@@ -3042,8 +3080,13 @@ var studioTokens = {in: 0, out: 0};
3042
3080
  function studioAddTokens(inp, out) {
3043
3081
  studioTokens.in += (inp||0);
3044
3082
  studioTokens.out += (out||0);
3083
+ studioUpdateTokenBar();
3084
+ }
3085
+ function studioUpdateTokenBar() {
3045
3086
  var el = document.getElementById('studioTokenBar');
3046
- if (el) el.textContent = 'Tokens: ' + studioTokens.in + ' in / ' + studioTokens.out + ' out';
3087
+ if (!el) return;
3088
+ if (studioTokens.in === 0 && studioTokens.out === 0) { el.textContent = ''; return; }
3089
+ el.textContent = '⬆ ' + studioTokens.in.toLocaleString() + ' in ⬇ ' + studioTokens.out.toLocaleString() + ' out';
3047
3090
  }
3048
3091
 
3049
3092
  function runStudioStep(idx, node, task, context, stepDef, signal) {
@@ -3104,6 +3147,7 @@ function runStudioStep(idx, node, task, context, stepDef, signal) {
3104
3147
  if (scb) scb.style.display = '';
3105
3148
  }
3106
3149
  if (ev.usage) { studioAddTokens(ev.usage.input||0, ev.usage.output||0); }
3150
+ else if (ev.token && !isStatus) { studioTokens.out += Math.ceil(ev.token.length/4); studioUpdateTokenBar(); }
3107
3151
  if (ev.done) { resolve({output: output || '(no output)', canvas: canvasHtml}); return; }
3108
3152
  if (ev.error) { resolve({error: ev.error}); return; }
3109
3153
  } catch(e) {}