nothumanallowed 14.1.29 → 14.1.30

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": "14.1.29",
3
+ "version": "14.1.30",
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/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 = '14.1.29';
8
+ export const VERSION = '14.1.30';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -230,12 +230,12 @@ export function register(router) {
230
230
 
231
231
  // Pre-fetch web data BEFORE the LLM call so the model writes with real facts
232
232
  if (useWebTools) {
233
- sse({ token: '[Raccolta dati web...]\n' });
233
+ sse({ token: '[Raccolta dati web...]' });
234
234
 
235
235
  const queries = extractSearchQueries(task, stepDef?.prompt);
236
236
  const searchResults = await Promise.all(
237
237
  queries.map(async (q) => {
238
- sse({ token: `[Searching: "${q}"]\n` });
238
+ sse({ token: `[Searching: "${q}"]` });
239
239
  return { query: q, result: await runWebSearch(q) };
240
240
  })
241
241
  );
@@ -248,7 +248,7 @@ export function register(router) {
248
248
 
249
249
  const fetchResults = await Promise.all(
250
250
  urlMatches.map(async (url) => {
251
- sse({ token: `[Fetching: ${url}]\n` });
251
+ sse({ token: `[Fetching: ${url}]` });
252
252
  return { url, content: await runFetchUrl(url) };
253
253
  })
254
254
  );
@@ -230,7 +230,7 @@ Provide specific, actionable levels. Use technical analysis (EMA, RSI, MACD, Fib
230
230
  - Maximum drawdown and recovery expectations
231
231
  - Strategy capacity (AUM limits before alpha decay)
232
232
  - Implementation costs: slippage, market impact, transaction costs
233
- - Key risks: overfitting, regime change, crowding`,agents:[{icon:`📊`,agent:`oracle`,label:`Oracle`,status:`waiting`,output:``},{icon:`💹`,agent:`mercury`,label:`Mercury`,status:`waiting`,output:``},{icon:`📈`,agent:`edi`,label:`Edi`,status:`waiting`,output:``},{icon:`⚠️`,agent:`cassandra`,label:`Cassandra`,status:`waiting`,output:``},{icon:`🔥`,agent:`prometheus`,label:`Prometheus`,status:`waiting`,output:``}]}],Te=`trading strategy.fundamental analysis.portfolio risk.sector deep dive.crypto analysis.quant factor.macro regime.cross-asset.hedge.derivative.yield curve.market_price.market_chart.market_indicators.macro_data.crypto_data.valuation.equity.earnings.dividend.short interest.volatility.options.futures.bitcoin.ethereum`.split(`.`),Ee=[`Analyze my unread emails and create a priority action plan`,`Search the web for AI news today and summarize it in a canvas report`,`Check my calendar for this week and suggest how to optimize my schedule`,`Review my GitHub notifications and draft responses to open issues`,`Search for information about a topic, fact-check it, and write a report`],R={bg:`#0a0d14`,wall:`#0d1117`,wallStripe:`#0f1520`,baseboard:`#1e293b`,floorA:`#111827`,floorB:`#141c2b`,floorLine:`#1e293b`,ceiling:`#0b0f18`,lampBody:`#854d0e`,lampGlow:`#fef08a`,partition:`#1a2436`,partitionH:`#253347`,partitionT:`#2d4a6e`,deskTop:`#2d4263`,deskFace:`#1e3352`,deskSide:`#192b43`,deskLeg:`#0f1e30`,monBody:`#0f172a`,monFace:`#162032`,monScrIdle:`#060b12`,monScrOn:`#001208`,monScrDone:`#001a08`,monStand:`#0d1625`,keyboard:`#162032`,chairBack:`#1a3a5c`,chairSeat:`#1e4068`,chairLeg:`#0f1e30`,plant1:`#14532d`,plant2:`#166534`,pot:`#78350f`,cup:`#7c2d12`,paper:`#e2e8f0`,paperLine:`#94a3b8`,skin:[`#f5c97a`,`#fbbf24`,`#fca5a5`,`#86efac`,`#a5f3fc`,`#c4b5fd`,`#fde68a`,`#f9a8d4`],shirt:[`#1e40af`,`#065f46`,`#312e81`,`#be123c`,`#164e63`,`#7c3aed`,`#7f1d1d`,`#0e7490`],hair:[`#7c3aed`,`#92400e`,`#1e293b`,`#6b21a8`,`#78350f`,`#292524`,`#422006`,`#0c4a6e`],pants:`#1e293b`,shoes:`#0f172a`,cSkin:`#fbbf24`,cShirt:`#4f46e5`,cHair:`#111827`,cTie:`#dc2626`,cPants:`#1e293b`,cShoes:`#0f172a`,cBag:`#78350f`,green:`#22c55e`,greenDim:`#14532d`,cyan:`#67e8f9`,purple:`#a78bfa`,red:`#ef4444`,amber:`#fbbf24`,dim:`#334155`,white:`#f1f5f9`,bubbleBg:`#0f172a`,bubbleBdr:`#334155`},z=2,De=1200,Oe=140,ke=De*z,Ae=Oe*z,je=Math.round(Oe*.78),Me=130,Ne=14,Pe=je-Ne-2,Fe=8,Ie=36;function B(e,t,n,r,i=1,a=1){e.fillStyle=t,e.fillRect(n*z,r*z,i*z,a*z)}function Le(e){B(e,R.ceiling,0,0,De,7);for(let t=0;t<De;t++)B(e,t%20<10?R.wall:R.wallStripe,t,7,1,je-7);B(e,R.baseboard,0,je-3,De,3);for(let t=0;t<De;t+=14)for(let n=je;n<Oe;n+=7)B(e,(Math.floor(t/14)+Math.floor((n-je)/7))%2==0?R.floorA:R.floorB,t,n,14,7),B(e,R.floorLine,t,n,14,1),B(e,R.floorLine,t,n,1,7);for(let t=40;t<De;t+=120){B(e,R.lampBody,t,1,40,4),B(e,R.lampGlow,t+2,2,36,2);for(let n=0;n<18;n++)e.fillStyle=`rgba(254,240,138,${(.06-n*.003).toFixed(4)})`,e.fillRect((t+20-n*1.1)*z,(5+n)*z,n*2.2*z,z)}}function Re(e,t,n,r){let i=t.x,a=t.status===`running`,o=t.status===`done`,s=t.status===`error`,c=Math.abs(n-(i+Me/2))<30;a&&(e.fillStyle=`rgba(99,102,241,0.09)`,e.fillRect(i*z,10*z,Me*z,(Oe-10)*z)),o&&(e.fillStyle=`rgba(34,197,94,0.05)`,e.fillRect(i*z,10*z,Me*z,(Oe-10)*z));let l=je-8;B(e,R.partition,i,8,3,l),B(e,R.partitionH,i+1,8,2,l),B(e,R.partition,i+Me,8,3,l),B(e,a?R.partitionT:o?`#1a3a2e`:s?`#3a1a1a`:R.partitionH,i,8,Me+3,4),B(e,`#0f172a`,i+5,14,16,10),B(e,`#162032`,i+6,15,14,3),a?(B(e,R.green,i+7,19,11,1),B(e,R.greenDim,i+7,21,12,1)):o?(B(e,R.green,i+7,18,12,1),B(e,R.green,i+7,20,9,1),B(e,R.green,i+7,22,11,1)):(B(e,R.dim,i+7,19,10,1),B(e,R.dim,i+7,21,7,1));let u=i+Me-14;B(e,R.pot,u+2,Pe+Ne-5,7,5),B(e,R.plant1,u,Pe+Ne-13,10,8),B(e,R.plant2,u+2,Pe+Ne-17,6,5),B(e,R.plant2,u-2,Pe+Ne-12,5,4),B(e,R.plant2,u+7,Pe+Ne-13,5,4),B(e,R.deskTop,i+4,Pe,Me-6,3),B(e,R.deskFace,i+4,Pe+3,Me-6,Ne-3),B(e,R.deskSide,i+4,Pe+Ne,Me-6,3);let d=je-Pe-Ne-3;B(e,R.deskLeg,i+8,Pe+Ne+3,4,d),B(e,R.deskLeg,i+Me-10,Pe+Ne+3,4,d);let f=i+14,p=Pe-18;if(B(e,R.monBody,f,p,22,14),B(e,R.monFace,f+1,p+1,20,12),B(e,a?R.monScrOn:o?R.monScrDone:R.monScrIdle,f+2,p+2,18,8),a)for(let t=0;t<3;t++){let n=3+Math.floor((r/90+t*5)%12);B(e,R.green,f+3,p+3+t*2,n,1),B(e,R.greenDim,f+3+n,p+3+t*2,12-n,1)}else o?(B(e,R.green,f+3,p+3,10,1),B(e,R.green,f+3,p+5,8,1),B(e,R.green,f+3,p+7,9,1),B(e,R.green,f+13,p+3,2,4)):s?(B(e,R.red,f+8,p+2,4,6),B(e,R.red,f+8,p+9,4,2)):(B(e,R.dim,f+3,p+3,12,1),B(e,R.dim,f+3,p+5,8,1),B(e,R.dim,f+3,p+7,10,1));B(e,R.monStand,f+8,p+14,4,3),B(e,R.monStand,f+5,p+17,10,1),B(e,R.keyboard,f-1,Pe+1,16,4);for(let t=0;t<5;t++)B(e,R.monFace,f+t*3,Pe+2,2,2);B(e,R.cup,i+7,Pe+2,5,5),B(e,`#92400e`,i+12,Pe+4,2,3),B(e,R.paper,i+52,Pe+2,12,7),B(e,R.paper,i+54,Pe+1,12,7),B(e,R.paperLine,i+56,Pe+3,7,1),B(e,R.paperLine,i+56,Pe+5,5,1),B(e,R.chairBack,i+Me/2-12,je-20,24,3),B(e,R.chairSeat,i+Me/2-13,je-14,26,8),B(e,R.chairLeg,i+Me/2-8,je-6,4,6),B(e,R.chairLeg,i+Me/2+5,je-6,4,6),ze(e,t,i+Me/2-8,je-Ie,a,c,r);let m=a?R.cyan:o?R.green:s?R.red:R.dim;e.font=`bold ${4*z}px monospace`,e.fillStyle=m,e.textBaseline=`alphabetic`;let h=t.label.length>14?t.label.slice(0,13)+`…`:t.label;e.fillText(h,(i+4)*z,8*z),B(e,m,i+Me-4,9,4,4),a&&Math.floor(r/250)%2==0&&B(e,R.white,i+Me-3,10,2,2)}function ze(e,t,n,r,i,a,o){let s=R.skin[t.skinIdx],c=R.shirt[t.shirtIdx],l=R.hair[t.hairIdx],u=i&&!a?Math.floor(o/700)%2:0;B(e,l,n+1,r+u,12,3),B(e,l,n,r+1+u,14,2),B(e,l,n,r+3+u,2,5),B(e,l,n+12,r+3+u,2,5),B(e,s,n+1,r+3+u,12,9);let d=l;B(e,d,n+2,r+4+u,3,1),B(e,d,n+9,r+4+u,3,1),B(e,`#e2e8f0`,n+2,r+5+u,3,3),B(e,`#e2e8f0`,n+9,r+5+u,3,3);let f=t.skinIdx%2==0?`#1d4ed8`:`#065f46`;if(B(e,f,n+3,r+6+u,2,2),B(e,f,n+10,r+6+u,2,2),B(e,`#0f172a`,n+3,r+7+u,1,1),B(e,`#0f172a`,n+10,r+7+u,1,1),B(e,`#c97a4a`,n+7,r+9+u,1,2),t.status===`done`)B(e,`#991b1b`,n+4,r+11+u,6,1),B(e,`#991b1b`,n+3,r+10+u,1,1),B(e,`#991b1b`,n+10,r+10+u,1,1);else if(t.status===`error`)B(e,`#991b1b`,n+4,r+10+u,6,1),B(e,`#991b1b`,n+3,r+11+u,1,1),B(e,`#991b1b`,n+10,r+11+u,1,1);else if(t.status===`running`){let t=Math.floor(o/250)%2;B(e,`#991b1b`,n+5,r+10+u,4,t?2:1)}else B(e,`#7f1d1d`,n+5,r+11+u,4,1);if(B(e,s,n+4,r+12,6,2),B(e,c,n+1,r+14,14,11),B(e,`#f1f5f9`,n+4,r+14,3,4),B(e,`#f1f5f9`,n+9,r+14,3,4),e.font=`${4*z}px serif`,e.textBaseline=`middle`,e.textAlign=`center`,e.fillText(t.icon,(n+8)*z,(r+19)*z),e.textAlign=`left`,i&&!a){let t=Math.floor(o/120)%2;B(e,c,n-2,r+14,3,9),B(e,s,n-2,r+22-t,3,3),B(e,c,n+15,r+14,3,9),B(e,s,n+15,r+22-(1-t),3,3)}else if(a&&i){let t=Math.floor(o/180)%3;B(e,c,n-2,r+14,3,8),B(e,s,n-2,r+22,3,3),B(e,c,n+15,r+8+t,3,9),B(e,s,n+15,r+5+t,3,4)}else B(e,c,n-2,r+14,3,9),B(e,s,n-2,r+23,3,2),B(e,c,n+15,r+14,3,9),B(e,s,n+15,r+23,3,2);B(e,R.pants,n+2,r+25,5,7),B(e,R.pants,n+9,r+25,5,7),B(e,`#2d3f5f`,n+3,r+29,3,1),B(e,`#2d3f5f`,n+10,r+29,3,1),B(e,R.shoes,n,r+32,7,4),B(e,R.shoes,n+9,r+32,7,4),B(e,`#1e2a3a`,n+1,r+32,5,1),B(e,`#1e2a3a`,n+10,r+32,5,1),e.fillStyle=`rgba(0,0,0,0.35)`,e.beginPath(),e.ellipse((n+8)*z,(je-1)*z,9*z,2*z,0,0,Math.PI*2),e.fill()}function Be(e){e.papers.length>=6||e.papers.push({x:e.x+20+Math.random()*(Me-40),y:Pe-4,vx:(Math.random()-.5)*1.5,vy:-1.5-Math.random()*1,rot:Math.random()*360,vrot:(Math.random()-.5)*10,life:0,maxLife:70+Math.random()*40})}function Ve(e){e.papers=e.papers.filter(e=>e.life<e.maxLife);for(let t of e.papers)t.x+=t.vx,t.y+=t.vy,t.vy+=.06,t.rot+=t.vrot,t.life++}function He(e,t){for(let n of t.papers){let t=1-n.life/n.maxLife;e.save(),e.globalAlpha=t,e.translate(n.x*z,n.y*z),e.rotate(n.rot*Math.PI/180),e.fillStyle=R.paper,e.fillRect(-7*z,-5*z,14*z,10*z),e.fillStyle=R.paperLine,e.fillRect(-5*z,-2*z,8*z,z),e.fillRect(-5*z,0,6*z,z),e.restore()}e.globalAlpha=1}var Ue=`ABCDEFGHIJKLMNOPRSTUVWXYZ0123456789!?-_.:`;function We(e,t){return t<=0?e:Ue[Math.floor(Math.random()*41)]??e}function Ge(e,t,n,r,i,a=110,o=`down`){if(t.length===0)return;e.fillStyle=R.bubbleBg,e.fillRect(r*z,i*z,a*z,36*z),e.strokeStyle=R.bubbleBdr,e.lineWidth=z,e.strokeRect(r*z,i*z,a*z,36*z),e.fillStyle=R.cyan,e.fillRect(r*z,i*z,a*z,z),e.fillStyle=R.bubbleBdr,e.fillRect(r*z,(i+13+5)*z,a*z,z);for(let o=0;o<2;o++){let s=t[(Math.floor(n)+o)%t.length];if(!s)continue;let c=i+5+o*14;e.fillStyle=o%2==0?`#0f172a`:`#111827`,e.fillRect(r*z,c*z,a*z,13*z);let l=n-Math.floor(n),u=s.text.split(``);e.font=`bold ${5*z}px monospace`,e.textBaseline=`middle`;let d=Math.floor(a/7)-1;for(let t=0;t<Math.min(u.length,d);t++){let n=l>.3&&t>u.length*(1-l)?We(u[t],3):u[t];e.globalAlpha=l>0&&t>u.length*(1-l)?.5+l*.5:1,e.fillStyle=s.color,e.fillText(n,(r+4+t*7)*z,(c+6)*z)}e.globalAlpha=1}let s=r+a/2;if(e.fillStyle=R.bubbleBdr,o===`down`){let t=i+36;e.fillRect((s-2)*z,t*z,4*z,4*z),e.fillRect((s-3)*z,(t+4)*z,6*z,3*z)}else e.fillRect((s-2)*z,(i-4)*z,4*z,4*z),e.fillRect((s-3)*z,(i-7)*z,6*z,3*z)}function Ke(e,t,n,r){let i=je-Ie-8,a=n%2,o=a===0?2:0,s=a===0?0:2;e.fillStyle=`rgba(0,0,0,0.4)`,e.beginPath(),e.ellipse(t*z,(je-1)*z,9*z,2*z,0,0,Math.PI*2),e.fill(),e.save(),e.translate(t*z,0),e.scale(r?1:-1,1),B(e,R.cHair,-4,i,9,3),B(e,R.cHair,-5,i+1,11,2),B(e,R.cHair,-5,i+3,2,3),B(e,R.cHair,5,i+3,2,3),B(e,R.cSkin,-4,i+3,8,7),B(e,`#0f172a`,-2,i+5,2,2),B(e,`#0f172a`,2,i+5,2,2),B(e,`#1d4ed8`,-1,i+6,1,1),B(e,`#1d4ed8`,3,i+6,1,1),B(e,`#7f1d1d`,-2,i+9,5,1),B(e,R.cSkin,-1,i+10,3,2),B(e,R.cShirt,-5,i+12,11,9),B(e,`#3730a3`,-5,i+12,3,5),B(e,`#3730a3`,3,i+12,3,5),B(e,R.cTie,-1,i+12,3,7),B(e,`#f1f5f9`,-2,i+12,1,3),B(e,`#f1f5f9`,2,i+12,1,3),B(e,R.cShirt,-7,i+13,3,9),B(e,R.cSkin,-7,i+21,3,3),B(e,R.cShirt,5,i+13,3,9),B(e,R.cSkin,5,i+21,3,3),B(e,R.cBag,6,i+24,6,4),B(e,`#92400e`,7,i+23,4,1),B(e,R.cPants,-3,i+21+o,5,10),B(e,R.cPants,1,i+21+s,5,10),B(e,R.cShoes,-5,i+29+o,6,3),B(e,R.cShoes,-1,i+29+s,6,3),e.restore()}var qe=[[{text:`RUNNING WORKFLOW`,color:R.cyan},{text:`DISPATCHING...`,color:R.amber}],[{text:`ORCHESTRATING`,color:R.cyan},{text:`ALL SYSTEMS GO`,color:R.green}],[{text:`AGENT PIPELINE`,color:R.purple},{text:`EXECUTING...`,color:R.cyan}],[{text:`MONITORING ALL`,color:R.amber},{text:`ON SCHEDULE`,color:R.green}]];function Je(e,t){let n=e.toUpperCase().slice(0,14);return t===`running`?[{text:n,color:R.cyan},{text:`WORKING...`,color:R.green}]:t===`done`?[{text:n,color:R.green},{text:`TASK DONE`,color:R.green}]:t===`error`?[{text:n,color:R.red},{text:`ERR`,color:R.red}]:[{text:n,color:R.dim},{text:`STANDBY`,color:R.dim}]}function Ye({nodes:e,running:t}){let n=(0,_.useRef)(null),r=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(e.length===0)return;let t=Math.min(e.length,8)*(Me+Fe)-Fe,n=Math.max(6,Math.round((De-t)/2));if(!r.current)r.current={agents:e.slice(0,8).map((e,t)=>({x:n+t*(Me+Fe),icon:e.icon,label:e.label,status:e.status,skinIdx:t%R.skin.length,shirtIdx:t%R.shirt.length,hairIdx:t%R.hair.length,papers:[],bubbleLines:Je(e.label,e.status),bubbleScroll:0,bubbleTimer:0})),condX:n+Me/2,condTargetX:n+Me/2,condFacing:!0,condFrame:0,condFrameTimer:0,condIdleTimer:0,condBubble:qe[0],condBubbleScroll:0,condBubbleTimer:0,rafId:0};else{let t=r.current;for(let r=0;r<Math.min(e.length,8);r++){let i=e[r],a=t.agents[r];a?(a.status!==i.status&&(a.status=i.status,a.bubbleLines=Je(i.label,i.status),a.bubbleScroll=0),a.icon=i.icon,a.label=i.label):t.agents.push({x:n+r*(Me+Fe),icon:i.icon,label:i.label,status:i.status,skinIdx:r%R.skin.length,shirtIdx:r%R.shirt.length,hairIdx:r%R.hair.length,papers:[],bubbleLines:Je(i.label,i.status),bubbleScroll:0,bubbleTimer:0})}}},[e]),(0,_.useEffect)(()=>{let e=n.current;if(!e)return;let i=e.getContext(`2d`);if(!i||(i.imageSmoothingEnabled=!1,!r.current))return;let a=0,o=0;function s(e){let n=r.current,c=Math.min(e-a,50);a=e;let l=e,u=n.agents.find(e=>e.status===`running`);if(u)n.condTargetX=u.x+Me/2,n.condBubbleTimer+=c,n.condBubbleTimer>2e3&&(n.condBubbleTimer=0,n.condBubble=qe[Math.floor(Math.random()*qe.length)],n.condBubbleScroll=(n.condBubbleScroll+1)%4);else if(n.condIdleTimer-=c,n.condIdleTimer<=0){let e=n.agents[Math.floor(Math.random()*n.agents.length)];e&&(n.condTargetX=e.x+Me/2),n.condIdleTimer=2e3+Math.random()*3e3}let d=n.condTargetX-n.condX;if(Math.abs(d)>1&&(n.condX+=d*(t?.12:.04)*(c/16),n.condFacing=d>0,n.condFrameTimer+=c,n.condFrameTimer>100&&(n.condFrame++,n.condFrameTimer=0)),o+=c,o>200){o=0;for(let e of n.agents)e.status===`running`&&Be(e)}for(let e of n.agents)Ve(e);for(let e of n.agents)e.bubbleTimer+=c,e.bubbleTimer>1800&&(e.bubbleTimer=0,e.bubbleScroll=(e.bubbleScroll+1)%4);i.clearRect(0,0,ke,Ae),Le(i),Ke(i,n.condX,n.condFrame,n.condFacing);for(let e of n.agents)Re(i,e,n.condX,l),He(i,e);for(let e of n.agents){if(e.status===`waiting`)continue;let t=Math.min(e.label.length*6+16,90),n=Math.max(e.x+1,Math.min(e.x+(Me-t)/2,De-t-2)),r=je-Ie-36;Ge(i,e.bubbleLines,e.bubbleScroll,n,r,t,`down`)}let f=je-Ie-8-38,p=Math.max(4,Math.min(n.condX-50,De-106));Ge(i,n.condBubble,n.condBubbleScroll,p,f,100,`down`);for(let e=0;e<Ae;e+=z*3)i.fillStyle=`rgba(0,0,0,0.04)`,i.fillRect(0,e,ke,z);n.rafId=requestAnimationFrame(s)}return r.current.rafId=requestAnimationFrame(s),()=>{r.current&&cancelAnimationFrame(r.current.rafId)}},[t]),e.length===0?null:(0,k.jsx)(`div`,{style:{width:`100%`,lineHeight:0},children:(0,k.jsx)(`canvas`,{ref:n,width:ke,height:Ae,style:{width:`100%`,height:`auto`,imageRendering:`pixelated`,display:`block`,background:R.bg,boxShadow:`0 0 40px rgba(99,102,241,0.15), inset 0 0 80px rgba(0,0,0,0.4)`}})})}function Xe(e){let t=e.toLowerCase();return Te.some(e=>t.includes(e.toLowerCase()))}function Ze(e,t){let n=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`),r=t.map(e=>e.output).join(`
233
+ - Key risks: overfitting, regime change, crowding`,agents:[{icon:`📊`,agent:`oracle`,label:`Oracle`,status:`waiting`,output:``},{icon:`💹`,agent:`mercury`,label:`Mercury`,status:`waiting`,output:``},{icon:`📈`,agent:`edi`,label:`Edi`,status:`waiting`,output:``},{icon:`⚠️`,agent:`cassandra`,label:`Cassandra`,status:`waiting`,output:``},{icon:`🔥`,agent:`prometheus`,label:`Prometheus`,status:`waiting`,output:``}]}],Te=`trading strategy.fundamental analysis.portfolio risk.sector deep dive.crypto analysis.quant factor.macro regime.cross-asset.hedge.derivative.yield curve.market_price.market_chart.market_indicators.macro_data.crypto_data.valuation.equity.earnings.dividend.short interest.volatility.options.futures.bitcoin.ethereum`.split(`.`),Ee=[`Analyze my unread emails and create a priority action plan`,`Search the web for AI news today and summarize it in a canvas report`,`Check my calendar for this week and suggest how to optimize my schedule`,`Review my GitHub notifications and draft responses to open issues`,`Search for information about a topic, fact-check it, and write a report`],R={bg:`#0a0d14`,wall:`#0d1117`,wallStripe:`#0f1520`,baseboard:`#1e293b`,floorA:`#111827`,floorB:`#141c2b`,floorLine:`#1e293b`,ceiling:`#0b0f18`,lampBody:`#854d0e`,lampGlow:`#fef08a`,partition:`#1a2436`,partitionH:`#253347`,partitionT:`#2d4a6e`,deskTop:`#2d4263`,deskFace:`#1e3352`,deskSide:`#192b43`,deskLeg:`#0f1e30`,monBody:`#0f172a`,monFace:`#162032`,monScrIdle:`#060b12`,monScrOn:`#001208`,monScrDone:`#001a08`,monStand:`#0d1625`,keyboard:`#162032`,chairBack:`#1a3a5c`,chairSeat:`#1e4068`,chairLeg:`#0f1e30`,plant1:`#14532d`,plant2:`#166534`,pot:`#78350f`,cup:`#7c2d12`,paper:`#e2e8f0`,paperLine:`#94a3b8`,skin:[`#f5c97a`,`#fbbf24`,`#fca5a5`,`#86efac`,`#a5f3fc`,`#c4b5fd`,`#fde68a`,`#f9a8d4`],shirt:[`#1e40af`,`#065f46`,`#312e81`,`#be123c`,`#164e63`,`#7c3aed`,`#7f1d1d`,`#0e7490`],hair:[`#7c3aed`,`#92400e`,`#1e293b`,`#6b21a8`,`#78350f`,`#292524`,`#422006`,`#0c4a6e`],pants:`#1e293b`,shoes:`#0f172a`,cSkin:`#fbbf24`,cShirt:`#4f46e5`,cHair:`#111827`,cTie:`#dc2626`,cPants:`#1e293b`,cShoes:`#0f172a`,cBag:`#78350f`,green:`#22c55e`,greenDim:`#14532d`,cyan:`#67e8f9`,purple:`#a78bfa`,red:`#ef4444`,amber:`#fbbf24`,dim:`#334155`,white:`#f1f5f9`,bubbleBg:`#0f172a`,bubbleBdr:`#334155`},z=2,De=1200,Oe=140,ke=De*z,Ae=Oe*z,je=Math.round(Oe*.78),Me=130,Ne=14,Pe=je-Ne-2,Fe=8,Ie=36;function B(e,t,n,r,i=1,a=1){e.fillStyle=t,e.fillRect(n*z,r*z,i*z,a*z)}function Le(e){B(e,R.ceiling,0,0,De,7);for(let t=0;t<De;t++)B(e,t%20<10?R.wall:R.wallStripe,t,7,1,je-7);B(e,R.baseboard,0,je-3,De,3);for(let t=0;t<De;t+=14)for(let n=je;n<Oe;n+=7)B(e,(Math.floor(t/14)+Math.floor((n-je)/7))%2==0?R.floorA:R.floorB,t,n,14,7),B(e,R.floorLine,t,n,14,1),B(e,R.floorLine,t,n,1,7);for(let t=40;t<De;t+=120){B(e,R.lampBody,t,1,40,4),B(e,R.lampGlow,t+2,2,36,2);for(let n=0;n<18;n++)e.fillStyle=`rgba(254,240,138,${(.06-n*.003).toFixed(4)})`,e.fillRect((t+20-n*1.1)*z,(5+n)*z,n*2.2*z,z)}}function Re(e,t,n,r){let i=t.x,a=t.status===`running`,o=t.status===`done`,s=t.status===`error`,c=Math.abs(n-(i+Me/2))<30;a&&(e.fillStyle=`rgba(99,102,241,0.09)`,e.fillRect(i*z,10*z,Me*z,(Oe-10)*z)),o&&(e.fillStyle=`rgba(34,197,94,0.05)`,e.fillRect(i*z,10*z,Me*z,(Oe-10)*z));let l=je-8;B(e,R.partition,i,8,3,l),B(e,R.partitionH,i+1,8,2,l),B(e,R.partition,i+Me,8,3,l),B(e,a?R.partitionT:o?`#1a3a2e`:s?`#3a1a1a`:R.partitionH,i,8,Me+3,4),B(e,`#0f172a`,i+5,14,16,10),B(e,`#162032`,i+6,15,14,3),a?(B(e,R.green,i+7,19,11,1),B(e,R.greenDim,i+7,21,12,1)):o?(B(e,R.green,i+7,18,12,1),B(e,R.green,i+7,20,9,1),B(e,R.green,i+7,22,11,1)):(B(e,R.dim,i+7,19,10,1),B(e,R.dim,i+7,21,7,1));let u=i+Me-14;B(e,R.pot,u+2,Pe+Ne-5,7,5),B(e,R.plant1,u,Pe+Ne-13,10,8),B(e,R.plant2,u+2,Pe+Ne-17,6,5),B(e,R.plant2,u-2,Pe+Ne-12,5,4),B(e,R.plant2,u+7,Pe+Ne-13,5,4),B(e,R.deskTop,i+4,Pe,Me-6,3),B(e,R.deskFace,i+4,Pe+3,Me-6,Ne-3),B(e,R.deskSide,i+4,Pe+Ne,Me-6,3);let d=je-Pe-Ne-3;B(e,R.deskLeg,i+8,Pe+Ne+3,4,d),B(e,R.deskLeg,i+Me-10,Pe+Ne+3,4,d);let f=i+14,p=Pe-18;if(B(e,R.monBody,f,p,22,14),B(e,R.monFace,f+1,p+1,20,12),B(e,a?R.monScrOn:o?R.monScrDone:R.monScrIdle,f+2,p+2,18,8),a)for(let t=0;t<3;t++){let n=3+Math.floor((r/90+t*5)%12);B(e,R.green,f+3,p+3+t*2,n,1),B(e,R.greenDim,f+3+n,p+3+t*2,12-n,1)}else o?(B(e,R.green,f+3,p+3,10,1),B(e,R.green,f+3,p+5,8,1),B(e,R.green,f+3,p+7,9,1),B(e,R.green,f+13,p+3,2,4)):s?(B(e,R.red,f+8,p+2,4,6),B(e,R.red,f+8,p+9,4,2)):(B(e,R.dim,f+3,p+3,12,1),B(e,R.dim,f+3,p+5,8,1),B(e,R.dim,f+3,p+7,10,1));B(e,R.monStand,f+8,p+14,4,3),B(e,R.monStand,f+5,p+17,10,1),B(e,R.keyboard,f-1,Pe+1,16,4);for(let t=0;t<5;t++)B(e,R.monFace,f+t*3,Pe+2,2,2);B(e,R.cup,i+7,Pe+2,5,5),B(e,`#92400e`,i+12,Pe+4,2,3),B(e,R.paper,i+52,Pe+2,12,7),B(e,R.paper,i+54,Pe+1,12,7),B(e,R.paperLine,i+56,Pe+3,7,1),B(e,R.paperLine,i+56,Pe+5,5,1),B(e,R.chairBack,i+Me/2-12,je-20,24,3),B(e,R.chairSeat,i+Me/2-13,je-14,26,8),B(e,R.chairLeg,i+Me/2-8,je-6,4,6),B(e,R.chairLeg,i+Me/2+5,je-6,4,6),ze(e,t,i+Me/2-8,je-Ie,a,c,r);let m=a?R.cyan:o?R.green:s?R.red:R.dim;e.font=`bold ${4*z}px monospace`,e.fillStyle=m,e.textBaseline=`alphabetic`;let h=t.label.length>14?t.label.slice(0,13)+`…`:t.label;e.fillText(h,(i+4)*z,8*z),B(e,m,i+Me-4,9,4,4),a&&Math.floor(r/250)%2==0&&B(e,R.white,i+Me-3,10,2,2)}function ze(e,t,n,r,i,a,o){let s=R.skin[t.skinIdx],c=R.shirt[t.shirtIdx],l=R.hair[t.hairIdx],u=i&&!a?Math.floor(o/700)%2:0;B(e,l,n+1,r+u,12,3),B(e,l,n,r+1+u,14,2),B(e,l,n,r+3+u,2,5),B(e,l,n+12,r+3+u,2,5),B(e,s,n+1,r+3+u,12,9);let d=l;B(e,d,n+2,r+4+u,3,1),B(e,d,n+9,r+4+u,3,1),B(e,`#e2e8f0`,n+2,r+5+u,3,3),B(e,`#e2e8f0`,n+9,r+5+u,3,3);let f=t.skinIdx%2==0?`#1d4ed8`:`#065f46`;if(B(e,f,n+3,r+6+u,2,2),B(e,f,n+10,r+6+u,2,2),B(e,`#0f172a`,n+3,r+7+u,1,1),B(e,`#0f172a`,n+10,r+7+u,1,1),B(e,`#c97a4a`,n+7,r+9+u,1,2),t.status===`done`)B(e,`#991b1b`,n+4,r+11+u,6,1),B(e,`#991b1b`,n+3,r+10+u,1,1),B(e,`#991b1b`,n+10,r+10+u,1,1);else if(t.status===`error`)B(e,`#991b1b`,n+4,r+10+u,6,1),B(e,`#991b1b`,n+3,r+11+u,1,1),B(e,`#991b1b`,n+10,r+11+u,1,1);else if(t.status===`running`){let t=Math.floor(o/250)%2;B(e,`#991b1b`,n+5,r+10+u,4,t?2:1)}else B(e,`#7f1d1d`,n+5,r+11+u,4,1);if(B(e,s,n+4,r+12,6,2),B(e,c,n+1,r+14,14,11),B(e,`#f1f5f9`,n+4,r+14,3,4),B(e,`#f1f5f9`,n+9,r+14,3,4),e.font=`${4*z}px serif`,e.textBaseline=`middle`,e.textAlign=`center`,e.fillText(t.icon,(n+8)*z,(r+19)*z),e.textAlign=`left`,i&&!a){let t=Math.floor(o/120)%2;B(e,c,n-2,r+14,3,9),B(e,s,n-2,r+22-t,3,3),B(e,c,n+15,r+14,3,9),B(e,s,n+15,r+22-(1-t),3,3)}else if(a&&i){let t=Math.floor(o/180)%3;B(e,c,n-2,r+14,3,8),B(e,s,n-2,r+22,3,3),B(e,c,n+15,r+8+t,3,9),B(e,s,n+15,r+5+t,3,4)}else B(e,c,n-2,r+14,3,9),B(e,s,n-2,r+23,3,2),B(e,c,n+15,r+14,3,9),B(e,s,n+15,r+23,3,2);B(e,R.pants,n+2,r+25,5,7),B(e,R.pants,n+9,r+25,5,7),B(e,`#2d3f5f`,n+3,r+29,3,1),B(e,`#2d3f5f`,n+10,r+29,3,1),B(e,R.shoes,n,r+32,7,4),B(e,R.shoes,n+9,r+32,7,4),B(e,`#1e2a3a`,n+1,r+32,5,1),B(e,`#1e2a3a`,n+10,r+32,5,1),e.fillStyle=`rgba(0,0,0,0.35)`,e.beginPath(),e.ellipse((n+8)*z,(je-1)*z,9*z,2*z,0,0,Math.PI*2),e.fill()}function Be(e){e.papers.length>=6||e.papers.push({x:e.x+20+Math.random()*(Me-40),y:Pe-4,vx:(Math.random()-.5)*1.5,vy:-1.5-Math.random()*1,rot:Math.random()*360,vrot:(Math.random()-.5)*10,life:0,maxLife:70+Math.random()*40})}function Ve(e){e.papers=e.papers.filter(e=>e.life<e.maxLife);for(let t of e.papers)t.x+=t.vx,t.y+=t.vy,t.vy+=.06,t.rot+=t.vrot,t.life++}function He(e,t){for(let n of t.papers){let t=1-n.life/n.maxLife;e.save(),e.globalAlpha=t,e.translate(n.x*z,n.y*z),e.rotate(n.rot*Math.PI/180),e.fillStyle=R.paper,e.fillRect(-7*z,-5*z,14*z,10*z),e.fillStyle=R.paperLine,e.fillRect(-5*z,-2*z,8*z,z),e.fillRect(-5*z,0,6*z,z),e.restore()}e.globalAlpha=1}var Ue=`ABCDEFGHIJKLMNOPRSTUVWXYZ0123456789!?-_.:`;function We(e,t){return t<=0?e:Ue[Math.floor(Math.random()*41)]??e}function Ge(e,t,n,r,i,a=110,o=`down`){if(t.length===0)return;e.fillStyle=R.bubbleBg,e.fillRect(r*z,i*z,a*z,36*z),e.strokeStyle=R.bubbleBdr,e.lineWidth=z,e.strokeRect(r*z,i*z,a*z,36*z),e.fillStyle=R.cyan,e.fillRect(r*z,i*z,a*z,z),e.fillStyle=R.bubbleBdr,e.fillRect(r*z,(i+13+5)*z,a*z,z);for(let o=0;o<2;o++){let s=t[(Math.floor(n)+o)%t.length];if(!s)continue;let c=i+5+o*14;e.fillStyle=o%2==0?`#0f172a`:`#111827`,e.fillRect(r*z,c*z,a*z,13*z);let l=n-Math.floor(n),u=s.text.split(``);e.font=`bold ${5*z}px monospace`,e.textBaseline=`middle`;let d=Math.floor(a/7)-1;for(let t=0;t<Math.min(u.length,d);t++){let n=l>.3&&t>u.length*(1-l)?We(u[t],3):u[t];e.globalAlpha=l>0&&t>u.length*(1-l)?.5+l*.5:1,e.fillStyle=s.color,e.fillText(n,(r+4+t*7)*z,(c+6)*z)}e.globalAlpha=1}let s=r+a/2;if(e.fillStyle=R.bubbleBdr,o===`down`){let t=i+36;e.fillRect((s-2)*z,t*z,4*z,4*z),e.fillRect((s-3)*z,(t+4)*z,6*z,3*z)}else e.fillRect((s-2)*z,(i-4)*z,4*z,4*z),e.fillRect((s-3)*z,(i-7)*z,6*z,3*z)}function Ke(e,t,n,r){let i=je-Ie-8,a=n%2,o=a===0?2:0,s=a===0?0:2;e.fillStyle=`rgba(0,0,0,0.4)`,e.beginPath(),e.ellipse(t*z,(je-1)*z,9*z,2*z,0,0,Math.PI*2),e.fill(),e.save(),e.translate(t*z,0),e.scale(r?1:-1,1),B(e,R.cHair,-4,i,9,3),B(e,R.cHair,-5,i+1,11,2),B(e,R.cHair,-5,i+3,2,3),B(e,R.cHair,5,i+3,2,3),B(e,R.cSkin,-4,i+3,8,7),B(e,`#0f172a`,-2,i+5,2,2),B(e,`#0f172a`,2,i+5,2,2),B(e,`#1d4ed8`,-1,i+6,1,1),B(e,`#1d4ed8`,3,i+6,1,1),B(e,`#7f1d1d`,-2,i+9,5,1),B(e,R.cSkin,-1,i+10,3,2),B(e,R.cShirt,-5,i+12,11,9),B(e,`#3730a3`,-5,i+12,3,5),B(e,`#3730a3`,3,i+12,3,5),B(e,R.cTie,-1,i+12,3,7),B(e,`#f1f5f9`,-2,i+12,1,3),B(e,`#f1f5f9`,2,i+12,1,3),B(e,R.cShirt,-7,i+13,3,9),B(e,R.cSkin,-7,i+21,3,3),B(e,R.cShirt,5,i+13,3,9),B(e,R.cSkin,5,i+21,3,3),B(e,R.cBag,6,i+24,6,4),B(e,`#92400e`,7,i+23,4,1),B(e,R.cPants,-3,i+21+o,5,10),B(e,R.cPants,1,i+21+s,5,10),B(e,R.cShoes,-5,i+29+o,6,3),B(e,R.cShoes,-1,i+29+s,6,3),e.restore()}var qe=[[{text:`RUNNING WORKFLOW`,color:R.cyan},{text:`DISPATCHING...`,color:R.amber}],[{text:`ORCHESTRATING`,color:R.cyan},{text:`ALL SYSTEMS GO`,color:R.green}],[{text:`AGENT PIPELINE`,color:R.purple},{text:`EXECUTING...`,color:R.cyan}],[{text:`MONITORING ALL`,color:R.amber},{text:`ON SCHEDULE`,color:R.green}]];function Je(e,t){let n=e.toUpperCase().slice(0,14);return t===`running`?[{text:n,color:R.cyan},{text:`WORKING...`,color:R.green}]:t===`done`?[{text:n,color:R.green},{text:`TASK DONE`,color:R.green}]:t===`error`?[{text:n,color:R.red},{text:`ERR`,color:R.red}]:[{text:n,color:R.dim},{text:`STANDBY`,color:R.dim}]}function Ye({nodes:e,running:t}){let n=(0,_.useRef)(null),r=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(e.length===0)return;let t=Math.min(e.length,8)*(Me+Fe)-Fe,n=Math.max(6,Math.round((De-t)/2));if(!r.current)r.current={agents:e.slice(0,8).map((e,t)=>({x:n+t*(Me+Fe),icon:e.icon,label:e.label,status:e.status,skinIdx:t%R.skin.length,shirtIdx:t%R.shirt.length,hairIdx:t%R.hair.length,papers:[],bubbleLines:Je(e.label,e.status),bubbleScroll:0,bubbleTimer:0})),condX:n+Me/2,condTargetX:n+Me/2,condFacing:!0,condFrame:0,condFrameTimer:0,condIdleTimer:0,condBubble:qe[0],condBubbleScroll:0,condBubbleTimer:0,rafId:0};else{let t=r.current;for(let r=0;r<Math.min(e.length,8);r++){let i=e[r],a=t.agents[r];a?(a.status!==i.status&&(a.status=i.status,a.bubbleLines=Je(i.label,i.status),a.bubbleScroll=0),a.icon=i.icon,a.label=i.label):t.agents.push({x:n+r*(Me+Fe),icon:i.icon,label:i.label,status:i.status,skinIdx:r%R.skin.length,shirtIdx:r%R.shirt.length,hairIdx:r%R.hair.length,papers:[],bubbleLines:Je(i.label,i.status),bubbleScroll:0,bubbleTimer:0})}}},[e]),(0,_.useEffect)(()=>{let e=n.current;if(!e)return;let i=e.getContext(`2d`);if(!i||(i.imageSmoothingEnabled=!1,!r.current))return;let a=0,o=0;function s(e){let n=r.current,c=Math.min(e-a,50);a=e;let l=e,u=n.agents.find(e=>e.status===`running`);if(u){let e=u.x+Me+12,t=u.x-18;n.condTargetX=e<De-30?e:t,n.condBubbleTimer+=c,n.condBubbleTimer>2e3&&(n.condBubbleTimer=0,n.condBubble=qe[Math.floor(Math.random()*qe.length)],n.condBubbleScroll=(n.condBubbleScroll+1)%4)}else if(n.condIdleTimer-=c,n.condIdleTimer<=0){let e=n.agents[Math.floor(Math.random()*n.agents.length)];e&&(n.condTargetX=e.x+Me/2),n.condIdleTimer=2e3+Math.random()*3e3}let d=n.condTargetX-n.condX;if(Math.abs(d)>1&&(n.condX+=d*(t?.12:.04)*(c/16),n.condFacing=d>0,n.condFrameTimer+=c,n.condFrameTimer>100&&(n.condFrame++,n.condFrameTimer=0)),o+=c,o>200){o=0;for(let e of n.agents)e.status===`running`&&Be(e)}for(let e of n.agents)Ve(e);for(let e of n.agents)e.bubbleTimer+=c,e.bubbleTimer>1800&&(e.bubbleTimer=0,e.bubbleScroll=(e.bubbleScroll+1)%4);i.clearRect(0,0,ke,Ae),Le(i),Ke(i,n.condX,n.condFrame,n.condFacing);for(let e of n.agents)Re(i,e,n.condX,l),He(i,e);for(let e of n.agents){if(e.status===`waiting`)continue;let t=Math.min(e.label.length*6+16,90),n=Math.max(e.x+1,Math.min(e.x+(Me-t)/2,De-t-2)),r=je-Ie-36;Ge(i,e.bubbleLines,e.bubbleScroll,n,r,t,`down`)}let f=je-Ie-8-38,p=Math.max(4,Math.min(n.condX-50,De-106));Ge(i,n.condBubble,n.condBubbleScroll,p,f,100,`down`);for(let e=0;e<Ae;e+=z*3)i.fillStyle=`rgba(0,0,0,0.04)`,i.fillRect(0,e,ke,z);n.rafId=requestAnimationFrame(s)}return r.current.rafId=requestAnimationFrame(s),()=>{r.current&&cancelAnimationFrame(r.current.rafId)}},[t]),e.length===0?null:(0,k.jsx)(`div`,{style:{width:`100%`,lineHeight:0},children:(0,k.jsx)(`canvas`,{ref:n,width:ke,height:Ae,style:{width:`100%`,height:`auto`,imageRendering:`pixelated`,display:`block`,background:R.bg,boxShadow:`0 0 40px rgba(99,102,241,0.15), inset 0 0 80px rgba(0,0,0,0.4)`}})})}function Xe(e){let t=e.toLowerCase();return Te.some(e=>t.includes(e.toLowerCase()))}function Ze(e,t){let n=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`),r=t.map(e=>e.output).join(`
234
234
 
235
235
  `),i=/([+-]?\d+(?:\.\d+)?)\s*%/g,a=[],o;for(;(o=i.exec(r))!==null;){let e=parseFloat(o[1]);e>=-100&&e<=500&&a.push(e)}let s=t.filter(e=>e.output&&e.output!==`(no output)`).map(e=>{let t=ye(e.output);return`
236
236
  <div class="section">
@@ -501,8 +501,8 @@ ${c}
501
501
  ${u}
502
502
  <div class="footer">NHA Studio · nothumanallowed.com · ${new Date().getFullYear()}</div>
503
503
  </body></html>`}function $e(e){try{localStorage.setItem(`nha_studio_sessions`,JSON.stringify(e.slice(0,20)))}catch{}}function et(){try{return JSON.parse(localStorage.getItem(`nha_studio_sessions`)??`[]`)}catch{return[]}}var tt=`nha_studio_active`;function nt(e){try{sessionStorage.setItem(tt,JSON.stringify(e))}catch{}}function rt(){try{let e=sessionStorage.getItem(tt);return e?JSON.parse(e):null}catch{return null}}function it(e){let t=[];return{clean:e.replace(/```json\s*\n?\s*\{[^`]*"action"\s*:\s*"canvas_render"[^`]*\}\s*```/g,e=>{try{let n=JSON.parse(e.replace(/```json\s*|\s*```/g,``).trim());n?.params?.html&&t.push(n.params.html)}catch{}return``}).replace(/\{"action"\s*:\s*"canvas_render"[^}]*"html"\s*:\s*"((?:[^"\\]|\\.)*)"/g,e=>{try{let n=JSON.parse(e+`}`);n?.params?.html&&t.push(n.params.html)}catch{try{let n=e.match(/"html"\s*:\s*"((?:[^"\\]|\\.)*?)"/);n&&t.push(JSON.parse(`"`+n[1]+`"`))}catch{}}return``}).trim(),canvasBlocks:t}}function at(){return ne.getState().apiBase}async function ot(e,t,n,r){let i=await fetch(at()+e,{method:`POST`,headers:{"Content-Type":`application/json`,"x-nha-client":`web-ui`},body:JSON.stringify(t),signal:r});if(!i.ok||!i.body)throw Error(`HTTP ${i.status}`);let a=i.body.getReader(),o=new TextDecoder,s=``;for(;;){let{done:e,value:t}=await a.read();if(e)break;s+=o.decode(t,{stream:!0});let r=s.split(`
504
- `);s=r.pop()??``;for(let e of r){if(!e.startsWith(`data: `))continue;let t=e.slice(6).trim();if(t===`[DONE]`)return;try{n(JSON.parse(t))}catch{}}}}function st({label:e,value:t}){let n=Math.round(t*100),r=n>=60?`#22c55e`:n>=30?`#f59e0b`:`#ef4444`;return(0,k.jsxs)(`div`,{className:L.convRow,children:[(0,k.jsx)(`span`,{className:L.convLabel,children:e}),(0,k.jsx)(`div`,{className:L.convTrack,children:(0,k.jsx)(`div`,{className:L.convFill,style:{width:`${n}%`,background:r}})}),(0,k.jsxs)(`span`,{className:L.convPct,style:{color:r},children:[n,`%`]})]})}function ct({council:e}){let[t,n]=(0,_.useState)(null);if(e.skipped)return(0,k.jsxs)(`div`,{className:L.councilSkipped,children:[(0,k.jsx)(`span`,{className:L.councilSkipIcon,children:`🏛️`}),(0,k.jsxs)(`span`,{children:[`Council skipped — `,e.skipReason??`fewer than 2 eligible agents`]})]});let r=e.phase===`r2`?`⚡ Cross-reading & Refinement (Round 2)…`:e.phase===`r3`?`🏛️ HERALD Mediation (Round 3)…`:e.phase===`done`?`✅ Council Consensus Reached`:`🏛️ Council…`,i=e.converged?(0,k.jsx)(`span`,{className:L.councilConvergedBadge,children:`CONSENSUS`}):(0,k.jsx)(`span`,{className:L.councilDivergedBadge,children:`MEDIATED`});return(0,k.jsxs)(`div`,{className:L.councilPanel,children:[(0,k.jsxs)(`div`,{className:L.councilHeader,children:[(0,k.jsxs)(`div`,{className:L.councilHeaderLeft,children:[(0,k.jsx)(`span`,{className:L.councilIcon,children:`🏛️`}),(0,k.jsx)(`span`,{className:L.councilTitle,children:`Council · Geth Consensus`}),e.phase===`done`&&i]}),(0,k.jsx)(`div`,{className:L.councilHeaderRight,children:e.phase!==`idle`&&(0,k.jsx)(`span`,{className:`${L.councilPhaseTag} ${e.phase===`done`?L.councilPhaseDone:L.councilPhaseActive}`,children:r})})]}),(e.r1Convergence>0||e.r2Convergence>0)&&(0,k.jsxs)(`div`,{className:L.councilMetrics,children:[e.r1Convergence>0&&(0,k.jsx)(st,{label:`Round 1`,value:e.r1Convergence}),e.r2Convergence>0&&(0,k.jsx)(st,{label:`Round 2`,value:e.r2Convergence})]}),e.r2Nodes.length>0&&(0,k.jsxs)(`div`,{className:L.councilNodes,children:[(0,k.jsx)(`div`,{className:L.councilSectionTitle,children:`Refined Positions (Round 2)`}),e.r2Nodes.map(e=>(0,k.jsxs)(`div`,{className:L.councilNode,children:[(0,k.jsxs)(`button`,{className:L.councilNodeHeader,onClick:()=>n(t===e.agent?null:e.agent),children:[(0,k.jsx)(`span`,{className:L.councilNodeIcon,children:e.icon}),(0,k.jsx)(`span`,{className:L.councilNodeLabel,children:e.label}),(0,k.jsx)(`span`,{className:L.councilNodeToggle,children:t===e.agent?`▲`:`▼`})]}),t===e.agent&&(0,k.jsx)(`div`,{className:L.councilNodeBody,dangerouslySetInnerHTML:{__html:ye(e.output)}})]},e.agent))]}),e.synthesis&&(0,k.jsxs)(`div`,{className:L.councilSynthesis,children:[(0,k.jsxs)(`div`,{className:L.councilSynthesisHeader,children:[(0,k.jsx)(`span`,{className:L.heraldIcon,children:`📰`}),(0,k.jsx)(`span`,{className:L.heraldLabel,children:`HERALD — Final Synthesis`}),e.phase===`r3`&&(0,k.jsx)(`span`,{className:L.heraldStreaming,children:(0,k.jsx)(`span`,{className:`studio-cursor`})})]}),(0,k.jsx)(`div`,{className:L.councilSynthesisBody,dangerouslySetInnerHTML:{__html:ye(e.synthesis)+(e.phase===`r3`?`<span class="studio-cursor"></span>`:``)}})]})]})}function lt(){let e=ne(e=>e.setView),t=rt(),[n,r]=(0,_.useState)(t?.task??``),[i,a]=(0,_.useState)(t?.nodes??[]),[o,s]=(0,_.useState)(t?.log??[]),[c,l]=(0,_.useState)(t?.result??``),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(et),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)({in:0,out:0}),[x,S]=(0,_.useState)(t?.canvasHtml??``),[C,w]=(0,_.useState)(t?.council??null),[ee,te]=(0,_.useState)(!1),[T,E]=(0,_.useState)([]),[D,re]=(0,_.useState)(!1),[ie,O]=(0,_.useState)(`canvas`),[ae,A]=(0,_.useState)(``),[j,oe]=(0,_.useState)(null),se=(0,_.useRef)(null),ce=(0,_.useRef)(null),le=(0,_.useRef)(t?.canvasHtml??``),M=(0,_.useRef)(t?.council??null),N=(0,_.useRef)([]),P=(0,_.useRef)(null);(0,_.useEffect)(()=>{nt({task:n,nodes:i,log:o,result:c,canvasHtml:x,council:C})},[n,i,o,c,x,C]),(0,_.useEffect)(()=>{ce.current&&(ce.current.scrollTop=ce.current.scrollHeight)},[o]),(0,_.useEffect)(()=>{if(!m)return;let e=e=>{P.current&&!P.current.contains(e.target)&&h(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[m]);let F=(0,_.useCallback)((e,t,n,r=`agent`)=>{let i=new Date().toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1});s(a=>[...a,{agent:e,icon:t,text:n,time:i,type:r}])},[]),ue=e=>{if(!e)return;let t=e.name.toLowerCase();if(!t.endsWith(`.pdf`)&&!/\.(png|jpe?g|gif|webp)$/i.test(t)){alert(`Supported: PDF, PNG, JPG, GIF, WEBP`);return}let n=new FileReader;n.onload=t=>v({name:e.name,data:t.target?.result}),n.readAsDataURL(e)},de=async()=>{if(!n.trim()||u)return;d(!0),a([]),s([]),l(``),w(null),M.current=null,b({in:0,out:0}),le.current=``,S(``),F(`Studio`,`🎬`,`Planning workflow…`,`system`);let e=new AbortController;se.current=e;try{let t={task:n.trim()};g&&(t[g.name.endsWith(`.pdf`)?`pdfBase64`:`imageBase64`]=g.data,g.name.endsWith(`.pdf`)&&(t.pdfName=g.name));let r=[];try{let n=await fetch(at()+`/api/studio/plan`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),signal:e.signal});if(n.ok){let e=await n.json();r=e.steps??e.nodes??[]}}catch{}r.length||(r=[{icon:`🤖`,agent:`general`,label:`Assistant`,status:`waiting`,output:``}]);let i=r.map(e=>({...e,status:`waiting`,output:``}));a(i),F(`Studio`,`📋`,`${i.length} agents planned: ${i.map(e=>e.label).join(` → `)}`,`system`);let o=``,s=[...i];for(let t=0;t<s.length&&!e.signal.aborted;t++){let r=s[t];s[t]={...r,status:`running`,output:``},a([...s]),F(r.label,r.icon,`Running ${r.label}…`,`agent`);let i=``;try{await ot(`/api/studio/run`,{stepIdx:t,agent:r.agent,task:n.trim(),prompt:(r.reason,void 0),context:o.length>12e4?o.slice(-12e4):o,...t===0&&g?g.name.endsWith(`.pdf`)?{pdfBase64:g.data,pdfName:g.name}:{imageBase64:g.data}:{}},e=>{let n=e.token??e.content??``;n&&(n.startsWith(`[`)&&n.indexOf(`]`)>0&&n.length<80&&!n.includes(`
505
- `)?(s[t]={...s[t],statusLine:n.replace(/^\[|\]\s*$/g,``)},a([...s])):(s[t]={...s[t],output:(s[t].output||``)+n,statusLine:void 0},i=s[t].output,a([...s])))},e.signal);let{clean:c,canvasBlocks:l}=it(i),u=c||`(no output)`;if(s[t]={...s[t],status:`done`,output:u},a([...s]),o+=`\n\n[${r.label}]:\n${u}`,F(r.label,r.icon,`Done (${u.length} chars)`,`agent`),l.length>0){let e=l[l.length-1];le.current=e,S(e),re(!0),O(`canvas`),F(r.label,r.icon,`Canvas render captured`,`system`)}}catch(n){if(e.signal.aborted)break;s[t]={...s[t],status:`error`,output:n.message??`Error`},a([...s]),F(r.label,r.icon,`Error: ${n.message}`,`error`)}}let c=s.filter(e=>e.status===`done`&&e.output&&e.output!==`(no output)`&&![`CanvasAgent`,`GitHubAgent`,`EmailAgent`,`CalendarAgent`].includes(e.agent));c.length>=2?(N.current=c,E(c),te(!0),F(`Consiglio`,`🏛️`,`${c.length} agenti pronti — attendi conferma utente`,`system`)):F(`Studio`,`ℹ️`,`Council skipped — fewer than 2 eligible specialist agents`,`system`);let u=M.current,d=s.filter(e=>e.output&&e.output!==`(no output)`).map(e=>`## ${e.icon} ${e.label}\n\n${e.output}`).join(`
504
+ `);s=r.pop()??``;for(let e of r){if(!e.startsWith(`data: `))continue;let t=e.slice(6).trim();if(t===`[DONE]`)return;try{n(JSON.parse(t))}catch{}}}}function st({label:e,value:t}){let n=Math.round(t*100),r=n>=60?`#22c55e`:n>=30?`#f59e0b`:`#ef4444`;return(0,k.jsxs)(`div`,{className:L.convRow,children:[(0,k.jsx)(`span`,{className:L.convLabel,children:e}),(0,k.jsx)(`div`,{className:L.convTrack,children:(0,k.jsx)(`div`,{className:L.convFill,style:{width:`${n}%`,background:r}})}),(0,k.jsxs)(`span`,{className:L.convPct,style:{color:r},children:[n,`%`]})]})}function ct({council:e}){let[t,n]=(0,_.useState)(null);if(e.skipped)return(0,k.jsxs)(`div`,{className:L.councilSkipped,children:[(0,k.jsx)(`span`,{className:L.councilSkipIcon,children:`🏛️`}),(0,k.jsxs)(`span`,{children:[`Council skipped — `,e.skipReason??`fewer than 2 eligible agents`]})]});let r=e.phase===`r2`?`⚡ Cross-reading & Refinement (Round 2)…`:e.phase===`r3`?`🏛️ HERALD Mediation (Round 3)…`:e.phase===`done`?`✅ Council Consensus Reached`:`🏛️ Council…`,i=e.converged?(0,k.jsx)(`span`,{className:L.councilConvergedBadge,children:`CONSENSUS`}):(0,k.jsx)(`span`,{className:L.councilDivergedBadge,children:`MEDIATED`});return(0,k.jsxs)(`div`,{className:L.councilPanel,children:[(0,k.jsxs)(`div`,{className:L.councilHeader,children:[(0,k.jsxs)(`div`,{className:L.councilHeaderLeft,children:[(0,k.jsx)(`span`,{className:L.councilIcon,children:`🏛️`}),(0,k.jsx)(`span`,{className:L.councilTitle,children:`Council · Geth Consensus`}),e.phase===`done`&&i]}),(0,k.jsx)(`div`,{className:L.councilHeaderRight,children:e.phase!==`idle`&&(0,k.jsx)(`span`,{className:`${L.councilPhaseTag} ${e.phase===`done`?L.councilPhaseDone:L.councilPhaseActive}`,children:r})})]}),(e.r1Convergence>0||e.r2Convergence>0)&&(0,k.jsxs)(`div`,{className:L.councilMetrics,children:[e.r1Convergence>0&&(0,k.jsx)(st,{label:`Round 1`,value:e.r1Convergence}),e.r2Convergence>0&&(0,k.jsx)(st,{label:`Round 2`,value:e.r2Convergence})]}),e.r2Nodes.length>0&&(0,k.jsxs)(`div`,{className:L.councilNodes,children:[(0,k.jsx)(`div`,{className:L.councilSectionTitle,children:`Refined Positions (Round 2)`}),e.r2Nodes.map(e=>(0,k.jsxs)(`div`,{className:L.councilNode,children:[(0,k.jsxs)(`button`,{className:L.councilNodeHeader,onClick:()=>n(t===e.agent?null:e.agent),children:[(0,k.jsx)(`span`,{className:L.councilNodeIcon,children:e.icon}),(0,k.jsx)(`span`,{className:L.councilNodeLabel,children:e.label}),(0,k.jsx)(`span`,{className:L.councilNodeToggle,children:t===e.agent?`▲`:`▼`})]}),t===e.agent&&(0,k.jsx)(`div`,{className:L.councilNodeBody,dangerouslySetInnerHTML:{__html:ye(e.output)}})]},e.agent))]}),e.synthesis&&(0,k.jsxs)(`div`,{className:L.councilSynthesis,children:[(0,k.jsxs)(`div`,{className:L.councilSynthesisHeader,children:[(0,k.jsx)(`span`,{className:L.heraldIcon,children:`📰`}),(0,k.jsx)(`span`,{className:L.heraldLabel,children:`HERALD — Final Synthesis`}),e.phase===`r3`&&(0,k.jsx)(`span`,{className:L.heraldStreaming,children:(0,k.jsx)(`span`,{className:`studio-cursor`})})]}),(0,k.jsx)(`div`,{className:L.councilSynthesisBody,dangerouslySetInnerHTML:{__html:ye(e.synthesis)+(e.phase===`r3`?`<span class="studio-cursor"></span>`:``)}})]})]})}function lt(){let e=ne(e=>e.setView),t=rt(),[n,r]=(0,_.useState)(t?.task??``),[i,a]=(0,_.useState)(t?.nodes??[]),[o,s]=(0,_.useState)(t?.log??[]),[c,l]=(0,_.useState)(t?.result??``),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(et),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)({in:0,out:0}),[x,S]=(0,_.useState)(t?.canvasHtml??``),[C,w]=(0,_.useState)(t?.council??null),[ee,te]=(0,_.useState)(!1),[T,E]=(0,_.useState)([]),[D,re]=(0,_.useState)(!1),[ie,O]=(0,_.useState)(`canvas`),[ae,A]=(0,_.useState)(``),[j,oe]=(0,_.useState)(null),se=(0,_.useRef)(null),ce=(0,_.useRef)(null),le=(0,_.useRef)(t?.canvasHtml??``),M=(0,_.useRef)(t?.council??null),N=(0,_.useRef)([]),P=(0,_.useRef)(null);(0,_.useEffect)(()=>{nt({task:n,nodes:i,log:o,result:c,canvasHtml:x,council:C})},[n,i,o,c,x,C]),(0,_.useEffect)(()=>{ce.current&&(ce.current.scrollTop=ce.current.scrollHeight)},[o]),(0,_.useEffect)(()=>{if(!m)return;let e=e=>{P.current&&!P.current.contains(e.target)&&h(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[m]);let F=(0,_.useCallback)((e,t,n,r=`agent`)=>{let i=new Date().toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1});s(a=>[...a,{agent:e,icon:t,text:n,time:i,type:r}])},[]),ue=e=>{if(!e)return;let t=e.name.toLowerCase();if(!t.endsWith(`.pdf`)&&!/\.(png|jpe?g|gif|webp)$/i.test(t)){alert(`Supported: PDF, PNG, JPG, GIF, WEBP`);return}let n=new FileReader;n.onload=t=>v({name:e.name,data:t.target?.result}),n.readAsDataURL(e)},de=async()=>{if(!n.trim()||u)return;d(!0),a([]),s([]),l(``),w(null),M.current=null,b({in:0,out:0}),le.current=``,S(``),F(`Studio`,`🎬`,`Planning workflow…`,`system`);let e=new AbortController;se.current=e;try{let t={task:n.trim()};g&&(t[g.name.endsWith(`.pdf`)?`pdfBase64`:`imageBase64`]=g.data,g.name.endsWith(`.pdf`)&&(t.pdfName=g.name));let r=[];try{let n=await fetch(at()+`/api/studio/plan`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),signal:e.signal});if(n.ok){let e=await n.json();r=e.steps??e.nodes??[]}}catch{}r.length||(r=[{icon:`🤖`,agent:`general`,label:`Assistant`,status:`waiting`,output:``}]);let i=r.map(e=>({...e,status:`waiting`,output:``}));a(i),F(`Studio`,`📋`,`${i.length} agents planned: ${i.map(e=>e.label).join(` → `)}`,`system`);let o=``,s=[...i];for(let t=0;t<s.length&&!e.signal.aborted;t++){let r=s[t];s[t]={...r,status:`running`,output:``},a([...s]),F(r.label,r.icon,`Running ${r.label}…`,`agent`);let i=``;try{await ot(`/api/studio/run`,{stepIdx:t,agent:r.agent,task:n.trim(),prompt:(r.reason,void 0),context:o.length>12e4?o.slice(-12e4):o,...t===0&&g?g.name.endsWith(`.pdf`)?{pdfBase64:g.data,pdfName:g.name}:{imageBase64:g.data}:{}},e=>{let n=e.token??e.content??``;n&&(n.startsWith(`[`)&&n.trimEnd().endsWith(`]`)&&!n.includes(`
505
+ `)&&!n.includes(`*`)&&!n.includes(`#`)?(s[t]={...s[t],statusLine:n.replace(/^\[|\]\s*$/g,``)},a([...s])):(s[t]={...s[t],output:(s[t].output||``)+n,statusLine:void 0},i=s[t].output,a([...s])))},e.signal);let{clean:c,canvasBlocks:l}=it(i),u=c||`(no output)`;if(s[t]={...s[t],status:`done`,output:u},a([...s]),o+=`\n\n[${r.label}]:\n${u}`,F(r.label,r.icon,`Done (${u.length} chars)`,`agent`),l.length>0){let e=l[l.length-1];le.current=e,S(e),re(!0),O(`canvas`),F(r.label,r.icon,`Canvas render captured`,`system`)}}catch(n){if(e.signal.aborted)break;s[t]={...s[t],status:`error`,output:n.message??`Error`},a([...s]),F(r.label,r.icon,`Error: ${n.message}`,`error`)}}let c=s.filter(e=>e.status===`done`&&e.output&&e.output!==`(no output)`&&![`CanvasAgent`,`GitHubAgent`,`EmailAgent`,`CalendarAgent`].includes(e.agent));c.length>=2?(N.current=c,E(c),te(!0),F(`Consiglio`,`🏛️`,`${c.length} agenti pronti — attendi conferma utente`,`system`)):F(`Studio`,`ℹ️`,`Council skipped — fewer than 2 eligible specialist agents`,`system`);let u=M.current,d=s.filter(e=>e.output&&e.output!==`(no output)`).map(e=>`## ${e.icon} ${e.label}\n\n${e.output}`).join(`
506
506
 
507
507
  ---
508
508
 
@@ -8,7 +8,7 @@
8
8
  <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
9
9
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
10
10
  <title>NHA — NotHumanAllowed</title>
11
- <script type="module" crossorigin src="/assets/index-Rb33WyGG.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-BJa3LUyK.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-BRTO-LWg.css">
13
13
  </head>
14
14
  <body>