nothumanallowed 13.5.25 → 13.5.27

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.25",
3
+ "version": "13.5.27",
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": {
@@ -3910,7 +3910,7 @@ DELIBERATION ROUND 2 — REFINEMENT:
3910
3910
  let r2Out = '';
3911
3911
  let r2TokCount = 0;
3912
3912
  try {
3913
- await callLLMStream(config, r2Sys, 'Produce your refined Round 2 response.',
3913
+ await callLLMStream(config, r2Sys, 'Produce your refined Round 2 response. Write complete content under every heading — never leave a section title without body text.',
3914
3914
  (tok) => {
3915
3915
  r2Out += tok;
3916
3916
  r2TokCount += Math.ceil(tok.length / 4);
@@ -3918,7 +3918,7 @@ DELIBERATION ROUND 2 — REFINEMENT:
3918
3918
  if (r2TokCount % 20 < 3) {
3919
3919
  sendTok2(`[Round 2 ${proposal.label || proposal.agent}: ${r2TokCount} token] `);
3920
3920
  }
3921
- }, { max_tokens: 6144 });
3921
+ }, { max_tokens: 8192 });
3922
3922
  } catch (e) { r2Out = proposal.output; }
3923
3923
  r2Results.push({ agent: proposal.agent, label: proposal.label, icon: proposal.icon, output: r2Out });
3924
3924
  sendEv2({ deliberation_r2: { agent: proposal.agent, label: proposal.label, icon: proposal.icon, output: r2Out } });
@@ -3976,10 +3976,15 @@ ${allR2Ctx}${contradictionBlock}
3976
3976
 
3977
3977
  ${medTask}
3978
3978
 
3979
- CRITICAL: Every agent's contribution must be traceable in the final synthesis. If an agent raised a point that was NOT incorporated, explicitly state why. The reader must understand WHO said WHAT and WHETHER it was listened to.`;
3979
+ CRITICAL WRITING RULES ENFORCE STRICTLY:
3980
+ - NEVER write a heading or numbered title without immediately writing its full content below it. A heading with no body text beneath it is FORBIDDEN.
3981
+ - Every section (e.g. "3.1. Sito Web") MUST be followed by at least 3-5 concrete bullet points or sentences explaining WHAT to do and HOW. Never just list the title and move on.
3982
+ - Every agent's contribution must be traceable. If an agent raised a point not incorporated, explicitly state why.
3983
+ - Do NOT summarize sections at the end without first writing their full content.
3984
+ - Write the complete content of each section before moving to the next.`;
3980
3985
  try {
3981
3986
  await callLLMStream(config, medSys, 'Produce the Parliament final synthesis.',
3982
- (tok) => { mediationOutput += tok; }, { max_tokens: 6144 });
3987
+ (tok) => { mediationOutput += tok; }, { max_tokens: 8192 });
3983
3988
  } catch (e) { mediationOutput = ''; }
3984
3989
  sendEv2({ deliberation_r3: { output: mediationOutput, converged } });
3985
3990
  }
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.25';
8
+ export const VERSION = '13.5.27';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -3325,7 +3325,7 @@ var studioAbortController = null;
3325
3325
  var parlActiveAgent = null; // active agent label during parliament streaming
3326
3326
  var parlDoneAgents = {}; // set of completed agent labels during parliament
3327
3327
  var _parlPersistHtml = null; // persists parliament block HTML across tab navigations
3328
- var _PARL_STAMP = '<!--nha-parl-v13.5.25-->';
3328
+ var _PARL_STAMP = '<!--nha-parl-v13.5.27-->';
3329
3329
 
3330
3330
  function stopStudio() {
3331
3331
  if (!studioState.running) return;
@@ -5296,18 +5296,31 @@ async function runStudio() {
5296
5296
  function saveStudioSession(task, nodes, log, result) {
5297
5297
  try {
5298
5298
  var sessions = JSON.parse(localStorage.getItem('nha_studio_sessions') || '[]');
5299
- // Save parliament block HTML if present (static snapshot animations not needed on restore)
5299
+ // Save parliament as compact node list NOT raw HTML (too large, gets truncated)
5300
5300
  var parlEl = document.getElementById('studioParliamentBlock');
5301
- var parlRaw = (parlEl && parlEl.style.display !== 'none') ? parlEl.innerHTML : null;
5302
- // Limit parlHtml to 30KB to avoid localStorage quota issues
5303
- var parlHtml = parlRaw ? (parlRaw.length > 30000 ? parlRaw.slice(0, 30000) : parlRaw) : null;
5301
+ var hasParl = parlEl && parlEl.style.display !== 'none' && parlEl.innerHTML.length > 200;
5302
+ // Derive parliament nodes from workflow nodes (exclude Canvas/tool-only agents)
5303
+ var parlNodes = hasParl ? nodes
5304
+ .filter(function(n){ return n.agent !== 'CanvasAgent' && n.agent !== 'GitHubAgent' && n.agent !== 'EmailAgent' && n.agent !== 'CalendarAgent'; })
5305
+ .map(function(n){ return {label:n.label,agent:n.agent,icon:n.icon}; })
5306
+ : null;
5307
+ // Extract r2Conv from the Consiglio node label e.g. "Consiglio (72%)"
5308
+ var r2Conv = 0;
5309
+ if (hasParl) {
5310
+ var parlNode = nodes.find(function(n){ return n.agent === 'Consiglio'; });
5311
+ if (parlNode && parlNode.label) {
5312
+ var cm = parlNode.label.match(/\((\d+)%\)/);
5313
+ if (cm) r2Conv = parseInt(cm[1], 10);
5314
+ }
5315
+ }
5304
5316
  sessions.unshift({
5305
5317
  id: Date.now(),
5306
5318
  task: task,
5307
5319
  nodes: nodes.map(function(n){return {label:n.label,icon:n.icon,agent:n.agent,output:n.output||''};}),
5308
5320
  result: result,
5309
5321
  canvas: studioState.canvas || null,
5310
- parlHtml: parlHtml,
5322
+ parlNodes: parlNodes,
5323
+ parlR2Conv: r2Conv,
5311
5324
  log: log.map(function(e){return {agent:e.agent,icon:e.icon,text:e.text,type:e.type,time:e.time};}),
5312
5325
  ts: new Date().toLocaleString()
5313
5326
  });
@@ -5350,6 +5363,79 @@ function renderStudioSessionsBar() {
5350
5363
  }).join('') + '</div>';
5351
5364
  }
5352
5365
 
5366
+ // Renders the parliament boardroom in "done" state from a compact node list.
5367
+ // Used by restoreStudioSession — independent of the runStudio closure.
5368
+ function renderParlBlockStatic(parlNodes, r2Conv) {
5369
+ var pb = document.getElementById('studioParliamentBlock');
5370
+ if (!pb || !parlNodes || parlNodes.length < 1) return;
5371
+ pb.style.display = 'block';
5372
+
5373
+ var proposals2 = parlNodes;
5374
+ var crownEm = String.fromCodePoint(0x1F451);
5375
+ var orchEmoji2 = String.fromCodePoint(0x1F9D1,0x200D,0x1F4BC);
5376
+
5377
+ function buildSeat2(prop) {
5378
+ var lbl = prop.label || prop.agent;
5379
+ var safeLbl = lbl.replace(/[^a-zA-Z0-9_-]/g,'_');
5380
+ var emojiIdx = Math.abs(lbl.charCodeAt(0)+(lbl.charCodeAt(lbl.length-1)||0)) % AGENT_EMOJIS.length;
5381
+ var agentEmoji = AGENT_EMOJIS[emojiIdx];
5382
+ return '<div class="br-seat" id="brseat_'+safeLbl+'" data-lbl="'+esc(lbl)+'">' +
5383
+ '<div class="br-char" style="font-size:40px;filter:none">'+agentEmoji+'</div>' +
5384
+ '<div class="br-seat-name">'+esc(lbl)+'</div>' +
5385
+ '</div>';
5386
+ }
5387
+
5388
+ var topSeats2 = []; var botSeats2 = [];
5389
+ proposals2.forEach(function(p,i){ if(i%2===0) topSeats2.push(p); else botSeats2.push(p); });
5390
+
5391
+ var tblSvg2 = '<svg viewBox="0 0 1000 200" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" style="position:absolute;top:50%;left:0;width:100%;height:140px;transform:translateY(-50%);z-index:1;pointer-events:none">' +
5392
+ '<defs><linearGradient id="tblGrad2" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#6b4423"/><stop offset="0.4" stop-color="#4a2e12"/><stop offset="1" stop-color="#2e1a08"/></linearGradient></defs>' +
5393
+ '<rect x="6" y="10" width="988" height="178" rx="22" fill="rgba(0,0,0,.28)"/>' +
5394
+ '<rect x="0" y="2" width="1000" height="178" rx="20" fill="url(#tblGrad2)"/>' +
5395
+ '<text x="500" y="118" text-anchor="middle" font-family="system-ui" font-size="58" font-weight="900" fill="rgba(160,140,255,.09)" letter-spacing="10">NHA</text>' +
5396
+ '</svg>';
5397
+
5398
+ var bgSvg2 = '<svg viewBox="0 0 1000 600" preserveAspectRatio="xMidYMid slice" xmlns="http://www.w3.org/2000/svg" style="position:absolute;top:0;left:0;width:100%;height:100%;z-index:0;pointer-events:none">' +
5399
+ '<defs>' +
5400
+ '<linearGradient id="brWall2" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#f5f0e8"/><stop offset="1" stop-color="#e8e0d0"/></linearGradient>' +
5401
+ '<linearGradient id="winGrad2" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#b8dff8"/><stop offset="1" stop-color="#d8f0ff"/></linearGradient>' +
5402
+ '<linearGradient id="doorGrad2" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#a0724a"/><stop offset="0.5" stop-color="#c8905c"/><stop offset="1" stop-color="#a0724a"/></linearGradient>' +
5403
+ '</defs>' +
5404
+ '<rect x="0" y="0" width="1000" height="215" fill="url(#brWall2)"/>' +
5405
+ '<rect x="0" y="0" width="1000" height="8" fill="#d8cfc0"/>' +
5406
+ '<rect x="0" y="206" width="1000" height="9" fill="#c8b898" rx="1"/>' +
5407
+ (function(){ var s=''; var pC=['#c8a06a','#bf9860','#d4aa72','#ba9458','#caa86e']; for(var fy=215;fy<600+32;fy+=32){var ro=(Math.floor((fy-215)/32)%2)*60; for(var fx=-120+ro;fx<1000+120;fx+=120){var pc=pC[Math.abs(Math.round(fx/120+fy/32*1.3))%pC.length]; s+='<rect x="'+Math.round(fx)+'" y="'+fy+'" width="118" height="30" fill="'+pc+'" rx="2"/>';}} return s; }()) +
5408
+ '<rect x="28" y="18" width="126" height="96" rx="3" fill="#4a6080" stroke="#2a3a50" stroke-width="4"/>' +
5409
+ '<rect x="34" y="24" width="114" height="84" rx="2" fill="url(#winGrad2)"/>' +
5410
+ '<rect x="846" y="18" width="126" height="96" rx="3" fill="#4a6080" stroke="#2a3a50" stroke-width="4"/>' +
5411
+ '<rect x="852" y="24" width="114" height="84" rx="2" fill="url(#winGrad2)"/>' +
5412
+ '<rect x="455" y="0" width="90" height="215" fill="url(#doorGrad2)" stroke="#7a5030" stroke-width="3"/>' +
5413
+ '<line x1="500" y1="0" x2="500" y2="28" stroke="#aaa" stroke-width="4"/>' +
5414
+ '<ellipse cx="500" cy="36" rx="52" ry="14" fill="#f0d830" stroke="#c8a820" stroke-width="3"/>' +
5415
+ '<circle cx="470" cy="47" r="9" fill="#fffce0"/><circle cx="500" cy="50" r="9" fill="#fffce0"/><circle cx="530" cy="47" r="9" fill="#fffce0"/>' +
5416
+ '</svg>';
5417
+
5418
+ var convPct = r2Conv || 0;
5419
+ pb.innerHTML =
5420
+ '<div class="br-wrap">' +
5421
+ '<div class="br-header"><span class="br-phase-chip" style="--pc:#22c55e">Consiglio concluso — convergenza ' + convPct + '%</span></div>' +
5422
+ '<div class="br-room">' +
5423
+ bgSvg2 +
5424
+ '<div style="position:absolute;bottom:8px;left:10px;font-size:44px;z-index:5">' + String.fromCodePoint(0x1FAB4) + '</div>' +
5425
+ '<div style="position:absolute;bottom:8px;right:10px;font-size:44px;z-index:5">' + String.fromCodePoint(0x1FAB4) + '</div>' +
5426
+ '<div style="position:relative;z-index:10;display:flex;flex-direction:column;justify-content:center;min-height:480px;padding:20px 16px;gap:0;box-sizing:border-box">' +
5427
+ '<div class="br-seats-row">' + topSeats2.map(buildSeat2).join('') + '</div>' +
5428
+ '<div style="position:relative;display:flex;align-items:center;width:100%;min-height:160px">' +
5429
+ '<div class="br-orch" id="brOrch"><div class="br-orch-inner"><span class="br-orch-crown">' + crownEm + '</span><span class="br-orch-emoji">' + orchEmoji2 + '</span></div><div class="br-orch-label">Orchestratore</div></div>' +
5430
+ '<div style="position:relative;flex:1;min-height:140px">' + tblSvg2 + '</div>' +
5431
+ '</div>' +
5432
+ '<div class="br-seats-row">' + botSeats2.map(buildSeat2).join('') + '</div>' +
5433
+ '</div>' +
5434
+ '</div>' +
5435
+ '<div class="br-convergence" style="display:block">Consenso raggiunto — convergenza R2: <strong>' + convPct + '%</strong></div>' +
5436
+ '</div>';
5437
+ }
5438
+
5353
5439
  function restoreStudioSession(idx) {
5354
5440
  var sessions = loadStudioSessions();
5355
5441
  var s = sessions[idx]; if (!s) return;
@@ -5362,13 +5448,13 @@ function restoreStudioSession(idx) {
5362
5448
  var ta = document.getElementById('studioTaskInput');
5363
5449
  if (ta) ta.value = s.task;
5364
5450
  renderStudioNodes(); renderStudioLog(); renderStudioResult();
5365
- // Restore parliament block if present
5451
+ // Restore parliament block rebuild from compact parlNodes (not raw HTML)
5366
5452
  var parlEl = document.getElementById('studioParliamentBlock');
5367
5453
  if (parlEl) {
5368
- if (s.parlHtml) {
5369
- parlEl.innerHTML = s.parlHtml;
5370
- parlEl.style.display = 'block';
5371
- // Scroll into view after DOM settles
5454
+ var parlNodes = s.parlNodes || null;
5455
+ // Legacy: old sessions might have parlHtml instead — ignore it (it was truncated)
5456
+ if (parlNodes && parlNodes.length >= 2) {
5457
+ renderParlBlockStatic(parlNodes, s.parlR2Conv || 0);
5372
5458
  setTimeout(function() {
5373
5459
  if (parlEl) parlEl.scrollIntoView({behavior: 'smooth', block: 'start'});
5374
5460
  }, 150);
@@ -6380,7 +6466,7 @@ input:focus,textarea:focus{border-color:var(--green3)}
6380
6466
  .wf-sbraita-bubble::after{content:"";position:absolute;top:100%;left:50%;transform:translateX(-50%);border:5px solid transparent;border-top-color:#ef4444}
6381
6467
  @keyframes sbraitaPop{0%{transform:translateX(-50%) scale(1) rotate(-2deg)}100%{transform:translateX(-50%) scale(1.06) rotate(2deg)}}
6382
6468
  /* ── Parliament Boardroom — bright office, same palette as workflow scene ── */
6383
- .br-wrap{background:var(--bg2);border:1.5px solid var(--border);border-radius:14px;padding:12px 14px;margin-bottom:16px;animation:stNodeIn .35s ease forwards;overflow:hidden}
6469
+ .br-wrap{background:var(--bg2);border:1.5px solid var(--border);border-radius:14px;padding:12px 14px;margin-bottom:16px;animation:stNodeIn .35s ease forwards;overflow:hidden;width:100%;box-sizing:border-box}
6384
6470
  .br-header{display:flex;align-items:center;gap:10px;margin-bottom:10px;flex-wrap:wrap}
6385
6471
  .br-phase-chip{font-size:10px;font-weight:800;font-family:var(--mono);letter-spacing:.3px;color:var(--pc,#6366f1);background:rgba(99,102,241,.1);border:1px solid var(--pc,rgba(99,102,241,.35));border-radius:20px;padding:3px 12px;display:inline-block;transition:color .4s,border-color .4s}
6386
6472
  .br-progress-wrap{flex:1;height:3px;background:var(--border);border-radius:4px;overflow:hidden;min-width:60px}