nothumanallowed 14.3.0 → 14.3.1

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.3.0",
3
+ "version": "14.3.1",
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.3.0';
8
+ export const VERSION = '14.3.1';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -728,7 +728,7 @@ FRONTEND:
728
728
  Errore: `+e.msg,F(!1))}catch{}}}}catch(e){Oe(t=>[...t,{role:`agent`,text:`Errore di rete: `+e.message,tools:[]}])}F(!1)}async function Tt(e,t){if(!a)return;let n=await T(`/api/studio/webcraft/projects/load/${encodeURIComponent(a)}`);if(n?.files&&(m(n.files),e.length>0)){let r=e.map(e=>{let r=n.files.find(t=>t.name===e);return r?{file:e,before:t[e]??``,after:r.content}:null}).filter(Boolean);Ye(e=>[...e,...r])}}function z(){ht.current&&=(ht.current.abort(),null),me(!1),F(!1),Oe(e=>[...e,{role:`system`,text:`⏹ Generazione interrotta.`}])}async function Et(){return a?(await E(`/api/studio/webcraft/snapshot`,{projectName:a}))?.snapshot??null:null}async function Dt(){let e=await Et();e&&(Oe(t=>[...t,{role:`system`,text:`💾 Snapshot salvato (${e.slice(0,16).replace(`T`,` `)})`}]),Ot())}async function Ot(){if(!a)return;let e=await T(`/api/studio/webcraft/snapshots/${encodeURIComponent(a)}`);e?.snapshots&&Ve(e.snapshots)}async function kt(e){confirm(`Ripristinare lo snapshot del ${e.replace(`T`,` `).slice(0,16)}? I file attuali verranno sovrascritti.`)&&await E(`/api/studio/webcraft/restore`,{projectName:a,ts:e})!==null&&(Oe(t=>[...t,{role:`agent`,text:`Snapshot ripristinato (${e}). Ricarico i file...`}]),Tt([],{}))}async function At(){if(!a)return;let e=await E(`/api/studio/webcraft/syntax-check`,{projectName:a});if(e?.results){let t=e.results.filter(e=>!e.ok);t.length>0?Oe(e=>[...e,{role:`system`,text:`⚠ Syntax check: ${t.length} errore/i trovato/i.`,syntaxErrors:t}]):Oe(e=>[...e,{role:`system`,text:`✓ Syntax check: tutti i file JS sono validi.`}])}}async function jt(){let e=p.filter(e=>e._error||e._syntaxError);if(e.length===0){yt.current?.();return}ge(!0),ve(0),be(e.length),L.current=Date.now(),ft(`0s`);for(let t=0;t<e.length;t++){let n=e[t];Se(n.name),ve(t),await wt(`REPAIR FILE: ${n.name}\nErrore: ${n._syntaxError??`generazione fallita`}\nRigenera il file correttamente. Output SOLO il contenuto del file, nessuna spiegazione.`,null,[])}ve(e.length),Se(``),ge(!1),setTimeout(()=>yt.current?.(),500)}let Mt={cleanup:`🧹`,shims:`🔌`,deps:`📦`,start:`🚀`,autofix:`🔧`,ready:`✅`};function Nt(e,t=`info`){let n=new Date().toLocaleTimeString();rt(r=>[...r,`${t===`phase`?`
729
729
  `:``}[${n}] ${e}`]),setTimeout(()=>{ct.current?.scrollTo(0,ct.current.scrollHeight)},50)}async function Pt(e){if(!et){tt(!0),at(null),$e(null),rt([]),st(!0),i(`preview`);try{let t=await fetch(`/api/studio/webcraft/sandbox/start`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectName:e})});if(!t.ok||!t.body){let e=t.ok?`No response body`:`HTTP ${t.status}`;Nt(`ERROR: ${e}`,`error`),at(e),tt(!1);return}let n=t.body.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:t}=await n.read();if(e)break;i+=r.decode(t,{stream:!0});let a=i.split(`
730
730
 
731
- `);i=a.pop()??``;for(let e of a){let t=e.replace(/^data: /,``).trim();if(t)try{let e=JSON.parse(t);e.type===`phase`?Nt(`${Mt[e.phase]||`▸`} ${e.msg}`,`phase`):e.type===`ready`&&e.port?(Nt(`✅ Server ready on port ${e.port}`,`ok`),$e(e.port),tt(!1),setTimeout(()=>st(!1),1500)):e.type===`status`?Nt(` ${e.msg||`Processing...`}`,`info`):e.type===`log`?Nt(` ${e.msg||``}`,`log`):e.type===`warn`?Nt(`⚠ ${e.msg}`,`warn`):e.type===`error`?(Nt(`❌ ${e.msg}`,`error`),at(e.msg)):e.type===`exit`&&e.code!==0&&Nt(`💥 Process crashed (exit code ${e.code})`,`error`)}catch{}}}}catch(e){let t=e.message||`Connection failed`;Nt(`❌ ${t}`,`error`),at(t)}tt(!1)}}async function B(){a&&await Pt(a)}(0,_.useEffect)(()=>{vt.current=jt,yt.current=B});async function Ft(){if(!We||!a)return;let e=await E(`/api/studio/webcraft/grep`,{projectName:a,query:We});e?.matches&&qe(e.matches)}function It(e){let t=p.findIndex(t=>t.name===e);t>=0&&(g(t),i(`files`))}function Lt(){window.open(`/api/studio/webcraft/download/${encodeURIComponent(a)}`,`_blank`)}async function Rt(e,t,n,r){t.endsWith(`.md`)||(t+=`.md`);let i={name:t,content:n,type:r},s;s=e.mode===`edit`&&e.idx!==null?Fe.map((t,n)=>n===e.idx?i:t):[...Fe,i],Ie(s),Be(null);let c=a||`MyProject`;a||o(c),await E(`/api/studio/webcraft/skills/${encodeURIComponent(c)}`,{skills:s})}async function zt(e){let t=Fe[e];!t||!confirm(`Eliminare "${t.name}"?`)||(await E(`/api/studio/webcraft/skills/${encodeURIComponent(a)}/delete`,{name:t.name}),Ie(Fe.filter((t,n)=>n!==e)))}async function Bt(e){let t=Fe[e];if(!t||!confirm(`Svuotare "${t.name}"? Il file rimane ma il contenuto viene cancellato.`))return;let n=Fe.map((t,n)=>n===e?{...t,content:``}:t);Ie(n),await E(`/api/studio/webcraft/skills/${encodeURIComponent(a)}`,{skills:n})}async function Vt(){let e=await T(`/api/studio/webcraft/projects`);e?.projects&&Ze(e.projects)}async function V(e){let t=await T(`/api/studio/webcraft/projects/load/${encodeURIComponent(e.name)}`);if(!t)return;o(t.projectName??e.name),c(t.description??``),m(t.files??[]),g(0),n(`new`),i(`files`),Oe([]),Ie([]),Re(!1);let r=await T(`/api/studio/webcraft/projects/chat/load/${encodeURIComponent(t.projectName??e.name)}`);r?.chat&&Oe(r.chat);let a=await T(`/api/studio/webcraft/skills/${encodeURIComponent(t.projectName??e.name)}`);a?.skills&&(Ie(a.skills),Re(!0))}async function Ht(e){confirm(`Eliminare: ${e.name} - ${e.dir}?`)&&(await E(`/api/studio/webcraft/projects/${encodeURIComponent(e.name)}`,{},`DELETE`),Ze(Xe.filter(t=>t.name!==e.name)),a===e.name&&(o(``),m([]),Oe([]),c(``)))}async function Ut(){if(!Ne)return;let e=Ne.originalMessage;Pe(null),await wt(e+`
731
+ `);i=a.pop()??``;for(let e of a){let t=e.replace(/^data: /,``).trim();if(t)try{let e=JSON.parse(t);if(e.type===`phase`){let t=Mt[e.phase]||`▸`;Nt(`${t} ${e.msg}`,`phase`),k(n=>[...n,`${t} ${e.msg}`]),D(!0)}else e.type===`ready`&&e.port?(Nt(`✅ Server ready on port ${e.port}`,`ok`),$e(e.port),tt(!1),k(t=>[...t,`\x1b[32m✓ Server ready on port ${e.port}\x1b[0m`]),setTimeout(()=>st(!1),1500)):e.type===`status`?(Nt(` ${e.msg||`Processing...`}`,`info`),k(t=>[...t,e.msg||``])):e.type===`log`?(Nt(` ${e.msg||``}`,`log`),k(t=>[...t,e.msg||``])):e.type===`warn`?Nt(`⚠ ${e.msg}`,`warn`):e.type===`error`?(Nt(`❌ ${e.msg}`,`error`),at(e.msg)):e.type===`exit`&&e.code!==0&&Nt(`💥 Process crashed (exit code ${e.code})`,`error`)}catch{}}}}catch(e){let t=e.message||`Connection failed`;Nt(`❌ ${t}`,`error`),at(t)}tt(!1)}}async function B(){a&&await Pt(a)}(0,_.useEffect)(()=>{vt.current=jt,yt.current=B});async function Ft(){if(!We||!a)return;let e=await E(`/api/studio/webcraft/grep`,{projectName:a,query:We});e?.matches&&qe(e.matches)}function It(e){let t=p.findIndex(t=>t.name===e);t>=0&&(g(t),i(`files`))}function Lt(){window.open(`/api/studio/webcraft/download/${encodeURIComponent(a)}`,`_blank`)}async function Rt(e,t,n,r){t.endsWith(`.md`)||(t+=`.md`);let i={name:t,content:n,type:r},s;s=e.mode===`edit`&&e.idx!==null?Fe.map((t,n)=>n===e.idx?i:t):[...Fe,i],Ie(s),Be(null);let c=a||`MyProject`;a||o(c),await E(`/api/studio/webcraft/skills/${encodeURIComponent(c)}`,{skills:s})}async function zt(e){let t=Fe[e];!t||!confirm(`Eliminare "${t.name}"?`)||(await E(`/api/studio/webcraft/skills/${encodeURIComponent(a)}/delete`,{name:t.name}),Ie(Fe.filter((t,n)=>n!==e)))}async function Bt(e){let t=Fe[e];if(!t||!confirm(`Svuotare "${t.name}"? Il file rimane ma il contenuto viene cancellato.`))return;let n=Fe.map((t,n)=>n===e?{...t,content:``}:t);Ie(n),await E(`/api/studio/webcraft/skills/${encodeURIComponent(a)}`,{skills:n})}async function Vt(){let e=await T(`/api/studio/webcraft/projects`);e?.projects&&Ze(e.projects)}async function V(e){let t=await T(`/api/studio/webcraft/projects/load/${encodeURIComponent(e.name)}`);if(!t)return;o(t.projectName??e.name),c(t.description??``),m(t.files??[]),g(0),n(`new`),i(`files`),Oe([]),Ie([]),Re(!1);let r=await T(`/api/studio/webcraft/projects/chat/load/${encodeURIComponent(t.projectName??e.name)}`);r?.chat&&Oe(r.chat);let a=await T(`/api/studio/webcraft/skills/${encodeURIComponent(t.projectName??e.name)}`);a?.skills&&(Ie(a.skills),Re(!0))}async function Ht(e){confirm(`Eliminare: ${e.name} - ${e.dir}?`)&&(await E(`/api/studio/webcraft/projects/${encodeURIComponent(e.name)}`,{},`DELETE`),Ze(Xe.filter(t=>t.name!==e.name)),a===e.name&&(o(``),m([]),Oe([]),c(``)))}async function Ut(){if(!Ne)return;let e=Ne.originalMessage;Pe(null),await wt(e+`
732
732
  [Piano approvato — procedi con le modifiche]`,null,[])}function Wt(e){e&&Array.from(e).forEach(e=>{let t=new FileReader;t.onload=t=>{let n=(t.target?.result).split(`,`)[1];Me(t=>[...t,{name:e.name,mimeType:e.type,base64:n,size:e.size}])},t.readAsDataURL(e)})}let Gt=a&&p.length>0,Kt=p[h],H=P||pe;return(0,O.jsxs)(`div`,{className:Q.root,children:[(0,O.jsxs)(`div`,{className:Q.header,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:Q.title,children:`⚙ WebCraft`}),(0,O.jsx)(`div`,{className:Q.subtitle,children:`Genera progetti web completi con agenti AI`})]}),(0,O.jsxs)(`div`,{className:Q.headerTabs,children:[(0,O.jsx)(`button`,{className:`${Q.tabBtn} ${t===`new`?Q.tabActive:``}`,onClick:()=>n(`new`),children:`+ Nuovo`}),(0,O.jsx)(`button`,{className:`${Q.tabBtn} ${t===`projects`?Q.tabActive:``}`,onClick:()=>{n(`projects`),Vt()},children:`📁 Progetti`})]})]}),(0,O.jsx)(`div`,{className:Q.body,children:t===`projects`?(0,O.jsx)(`div`,{className:Q.projectsList,children:Xe.length===0?(0,O.jsxs)(`div`,{className:Q.emptyProjects,children:[(0,O.jsx)(`span`,{className:Q.emptyIcon,children:`📁`}),(0,O.jsx)(`span`,{children:e(`webcraft.noProjects`)}),(0,O.jsx)(`span`,{className:Q.emptyHint,children:`Crea un progetto nella tab Nuovo`})]}):Xe.map(e=>(0,O.jsxs)(`div`,{className:Q.projectCard,children:[(0,O.jsxs)(`div`,{className:Q.projectInfo,children:[(0,O.jsx)(`div`,{className:Q.projectName,children:e.name}),(0,O.jsx)(`div`,{className:Q.projectDesc,children:e.description}),(0,O.jsxs)(`div`,{className:Q.projectMeta,children:[(0,O.jsxs)(`span`,{children:[`📄 `,e.fileCount,` file`]}),(0,O.jsxs)(`span`,{children:[`📅 `,e.createdAt?new Date(e.createdAt).toLocaleString():``]})]})]}),(0,O.jsx)(`button`,{className:Q.openBtn,onClick:()=>V(e),children:`↗ Apri`}),(0,O.jsx)(`button`,{className:Q.deleteBtn,onClick:()=>Ht(e),children:`🗑`})]},e.name))}):(0,O.jsxs)(`div`,{className:Q.editor,children:[(0,O.jsxs)(`div`,{className:Q.examples,children:[(0,O.jsx)(`div`,{className:Q.sectionLabel,children:`Esempi`}),(0,O.jsx)(`div`,{className:Q.examplePills,children:PT.map(e=>(0,O.jsx)(`button`,{className:Q.examplePill,onClick:()=>{o(e.name),c(e.desc),Ae(e.desc)},children:e.name},e.name))})]}),(0,O.jsxs)(`div`,{className:Q.editorCols,children:[(0,O.jsxs)(`div`,{className:Q.leftSidebar,children:[(0,O.jsxs)(`div`,{className:Q.panel,children:[(0,O.jsx)(`div`,{className:Q.panelTitle,children:`Blocchi`}),FT.map(e=>(0,O.jsxs)(`label`,{className:Q.blockLabel,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:l[e.key],onChange:t=>u(n=>({...n,[e.key]:t.target.checked})),className:Q.blockCheck}),(0,O.jsx)(`span`,{children:e.icon}),(0,O.jsx)(`span`,{children:e.label})]},e.key))]}),l.auth&&(0,O.jsxs)(`div`,{className:Q.panel,children:[(0,O.jsxs)(`div`,{className:Q.panelHeader,children:[(0,O.jsx)(`div`,{className:Q.panelTitle,children:`Campi Auth`}),(0,O.jsx)(`button`,{className:Q.addBtn,onClick:()=>f(e=>[...e,{label:`New field`,type:`text`,required:!1}]),children:`+ Campo`})]}),d.map((e,t)=>(0,O.jsxs)(`div`,{className:Q.authField,children:[(0,O.jsx)(`input`,{value:e.label,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,label:e.target.value}:n)),className:Q.authFieldInput}),(0,O.jsx)(`select`,{value:e.type,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,type:e.target.value}:n)),className:Q.authFieldSelect,children:[`text`,`email`,`password`,`tel`,`date`,`number`].map(e=>(0,O.jsx)(`option`,{value:e,children:e},e))}),(0,O.jsx)(`input`,{type:`checkbox`,checked:e.required,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,required:e.target.checked}:n)),title:`Required`,className:Q.authFieldReq}),(0,O.jsx)(`button`,{onClick:()=>f(e=>e.filter((e,n)=>n!==t)),className:Q.removeFieldBtn,children:`×`})]},t))]}),(0,O.jsxs)(`div`,{className:Q.panel,children:[(0,O.jsxs)(`div`,{className:Q.panelHeader,children:[(0,O.jsx)(`div`,{className:Q.panelTitle,children:`🗂 Contesto AI`}),(0,O.jsx)(`button`,{className:Q.addBtn,onClick:()=>Be({mode:`new`,idx:null,name:``,content:``,type:`skill`,generating:!1}),children:`+ Skill`})]}),Fe.length>0?(0,O.jsx)(`div`,{className:Q.skillsList,children:Fe.map((e,t)=>(0,O.jsxs)(`div`,{className:Q.skillRow,children:[(0,O.jsx)(`span`,{className:Q.skillIcon,children:zT(e.type)}),(0,O.jsx)(`span`,{className:Q.skillName,title:e.name,children:e.name}),(0,O.jsx)(`span`,{className:`${Q.skillBadge} ${Q[`skillBadge_`+e.type]}`,children:e.type}),!e.content&&e.type!==`log`&&(0,O.jsx)(`span`,{className:Q.skillEmpty,children:`⚠`}),(0,O.jsx)(`button`,{className:Q.skillBtn,onClick:()=>Be({mode:e.type===`log`?`view`:`edit`,idx:t,name:e.name,content:e.content,type:e.type,generating:!1}),children:e.type===`log`?`👁`:`✏`}),e.type!==`memory`&&e.type!==`provider`&&e.type!==`log`&&(0,O.jsx)(`button`,{className:Q.skillBtn,onClick:()=>Bt(t),children:`🗑`}),e.type===`log`&&(0,O.jsx)(`button`,{className:Q.skillBtn,onClick:()=>zt(t),children:`🗑`})]},t))}):(0,O.jsx)(`div`,{className:Q.skillsEmpty,children:Le?`Nessun file di contesto. Clicca "+ Skill" per aggiungerne uno.`:`Crea o carica un progetto per i file di contesto.`})]}),I.length>0&&(0,O.jsxs)(`div`,{className:Q.panel,children:[(0,O.jsx)(`div`,{className:Q.panelTitle,children:`💾 Snapshot`}),I.slice(0,5).map(e=>{let t=e.ts.replace(`T`,` `).slice(0,16);return(0,O.jsxs)(`div`,{className:Q.snapshotRow,children:[(0,O.jsx)(`span`,{className:Q.snapshotTs,children:t}),(0,O.jsxs)(`span`,{className:Q.snapshotCount,children:[e.fileCount,`f`]}),(0,O.jsx)(`button`,{className:Q.snapshotBtn,onClick:()=>kt(e.ts),children:`↺`})]},e.ts)})]}),pe&&(0,O.jsx)(`div`,{className:Q.genStatus,children:`⏳ Generazione...`}),he&&(0,O.jsxs)(`div`,{className:Q.repairStatus,children:[(0,O.jsx)(`div`,{className:Q.repairStatusTitle,children:`🔧 Correzione automatica...`}),(0,O.jsxs)(`div`,{className:Q.repairStatusProg,children:[_e,` / `,ye,` file`]}),(0,O.jsx)(`div`,{className:Q.repairStatusFile,children:xe})]}),p.length>0&&!pe&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:Q.actionRow,children:[(0,O.jsx)(`button`,{className:Q.actionBtn,onClick:Lt,children:`⬇ ZIP`}),(0,O.jsx)(`button`,{className:Q.actionBtnIcon,title:`Syntax check`,onClick:At,children:`✅`}),(0,O.jsx)(`button`,{className:`${Q.actionBtnIcon} ${He?Q.actionBtnActive:``}`,title:`Grep`,onClick:()=>Ue(!He),children:`🔍`}),(0,O.jsx)(`button`,{className:Q.actionBtnIcon,title:`Snapshot`,onClick:Dt,children:`💾`})]}),p.some(e=>e._error||e._syntaxError)&&!he&&(0,O.jsx)(`button`,{className:Q.repairBtn,onClick:jt,children:`🔧 Correggi tutti i file rossi`}),(0,O.jsx)(`button`,{className:Q.sandboxBtn,onClick:()=>{a?Pt(a):i(`preview`)},children:et?`⏳ Starting...`:Qe?`🌐 Sandbox Live`:`▶ Sandbox`}),Ee&&(0,O.jsxs)(`div`,{className:Q.statsBar,children:[(0,O.jsxs)(`span`,{children:[`⏱ `,Ee.seconds>=60?`${Math.floor(Ee.seconds/60)}m ${Ee.seconds%60}s`:`${Ee.seconds}s`]}),(0,O.jsxs)(`span`,{children:[`↑ `,Ee.tokIn.toLocaleString(),` tok`]}),(0,O.jsxs)(`span`,{children:[`↓ `,Ee.tokOut.toLocaleString(),` tok`]}),(0,O.jsxs)(`span`,{children:[`📄 `,Ee.files,` file`]})]})]})]}),(0,O.jsxs)(`div`,{className:Q.rightPanel,children:[(0,O.jsxs)(`div`,{className:Q.rightTabBar,children:[(0,O.jsx)(`button`,{className:`${Q.rightTab} ${r===`preview`?``:Q.rightTabActive}`,onClick:()=>i(`files`),children:`📄 File`}),(0,O.jsx)(`button`,{className:`${Q.rightTab} ${r===`preview`?Q.rightTabActive:``}`,onClick:()=>i(`preview`),children:`🌐 Sandbox`})]}),he&&(0,O.jsxs)(`div`,{className:Q.repairBar,children:[(0,O.jsxs)(`div`,{className:Q.repairBarRow,children:[(0,O.jsx)(`span`,{className:Q.repairBarIcon,children:`🔧`}),(0,O.jsx)(`span`,{className:Q.repairBarLabel,children:`Auto-fix`}),(0,O.jsx)(`span`,{className:Q.repairBarFile,children:xe}),(0,O.jsxs)(`span`,{className:Q.repairBarCounter,children:[_e,` / `,ye]}),(0,O.jsx)(`span`,{className:Q.repairBarTime,children:dt}),(0,O.jsx)(`button`,{className:Q.stopBtn,onClick:z,children:`⏹ Stop`})]}),(0,O.jsx)(`div`,{className:Q.progressTrack,children:(0,O.jsx)(`div`,{className:Q.repairProgress,style:{width:ye>0?`${Math.round(_e/ye*100)}%`:`0%`}})})]}),pe&&(0,O.jsxs)(`div`,{className:Q.genBar,children:[(0,O.jsxs)(`div`,{className:Q.genBarRow,children:[(0,O.jsx)(`span`,{className:Q.genBarRobot,children:`🤖`}),(0,O.jsx)(`span`,{className:Q.genBarLabel,children:Ce.total===0?`Pianificazione...`:`Generazione`}),(0,O.jsx)(`span`,{className:Q.genBarFile,children:Ce.name.split(`,`)[0].trim()}),(0,O.jsx)(`span`,{className:Q.genBarCounter,children:Ce.total>0?`${Ce.fi} / ${Ce.total}`:``}),(0,O.jsx)(`span`,{className:Q.genBarCounter,children:we.tokIn+we.tokOut>0?`↑${bt(we.tokIn)} ↓${bt(we.tokOut)}`:``}),(0,O.jsx)(`span`,{className:Q.genBarTime,children:lt}),(0,O.jsxs)(`span`,{className:Q.genDots,children:[(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot1}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot2}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot3}`})]})]}),(0,O.jsx)(`div`,{className:Q.progressTrack,children:(0,O.jsx)(`div`,{className:Q.genProgress,style:{width:Ce.total>0?`${Math.round(Ce.fi/Ce.total*100)}%`:`0%`}})})]}),r===`preview`?(0,O.jsxs)(`div`,{className:Q.sandboxWrap,children:[nt.length>0&&(0,O.jsxs)(`div`,{className:`${Q.sandboxConsole} ${ot?``:Q.sandboxConsoleCollapsed}`,children:[(0,O.jsxs)(`div`,{className:Q.sandboxConsoleHeader,onClick:()=>st(!ot),children:[(0,O.jsxs)(`span`,{className:Q.sandboxConsoleTitle,children:[et?`⏳`:it?`❌`:Qe?`✅`:`🌐`,` Console`]}),Qe&&(0,O.jsxs)(`span`,{className:Q.sandboxConsolePort,children:[`:`,Qe]}),et&&(0,O.jsxs)(`span`,{className:Q.sandboxConsoleDots,children:[(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot1}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot2}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot3}`})]}),(0,O.jsx)(`span`,{className:Q.sandboxConsoleToggle,children:ot?`▼`:`▶`}),Qe&&(0,O.jsx)(`button`,{className:Q.sandboxReloadBtn,onClick:e=>{e.stopPropagation();let t=document.querySelector(`iframe[title="WebCraft Sandbox"]`);t&&(t.src=t.src)},children:`↻`}),Qe&&(0,O.jsx)(`button`,{className:Q.sandboxStopBtn,onClick:e=>{e.stopPropagation(),fetch(`/api/studio/webcraft/sandbox`,{method:`DELETE`}),$e(null),rt([])},children:`⏹`})]}),ot&&(0,O.jsx)(`div`,{className:Q.sandboxConsoleBody,ref:ct,children:nt.map((e,t)=>(0,O.jsx)(`div`,{className:`${Q.sandboxLogLine} ${e.includes(`❌`)||e.includes(`💥`)?Q.sandboxLogError:e.includes(`⚠`)?Q.sandboxLogWarn:e.includes(`✅`)?Q.sandboxLogOk:e.includes(`🔌`)||e.includes(`📦`)||e.includes(`🚀`)||e.includes(`🔧`)||e.includes(`🧹`)?Q.sandboxLogPhase:``}`,children:e},t))})]}),Qe?(0,O.jsx)(`iframe`,{src:`http://127.0.0.1:${Qe}`,className:Q.sandboxFrame,title:`WebCraft Sandbox`,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups`}):(0,O.jsxs)(`div`,{className:Q.sandboxEmpty,children:[(0,O.jsx)(`span`,{style:{fontSize:40},children:et?`⏳`:it?`❌`:`🌐`}),(0,O.jsx)(`span`,{style:{fontWeight:600},children:et?`Avvio sandbox in corso...`:it?`Errore sandbox`:`Sandbox`}),it&&(0,O.jsx)(`span`,{style:{fontSize:11,maxWidth:400,textAlign:`center`},children:it}),!et&&(0,O.jsxs)(`button`,{className:Q.sandboxStartBtn,onClick:()=>{a&&Pt(a)},children:[`▶ `,it?`Riprova`:`Avvia Sandbox`]})]})]}):(0,O.jsx)(`div`,{className:Q.codeArea,children:p.length===0&&pe?(0,O.jsx)(`div`,{className:Q.noFiles,children:(0,O.jsxs)(`div`,{className:Q.noFilesHero,children:[(0,O.jsx)(`span`,{className:Q.noFilesIcon,children:`⏳`}),(0,O.jsx)(`span`,{className:Q.noFilesTitle,children:`Pianificazione...`}),(0,O.jsx)(`span`,{className:Q.noFilesTagline,children:Ce.name||`Analisi della struttura del progetto in corso`})]})}):p.length===0?(0,O.jsxs)(`div`,{className:Q.noFiles,children:[(0,O.jsxs)(`div`,{className:Q.noFilesHero,children:[(0,O.jsx)(`span`,{className:Q.noFilesIcon,children:`🔨`}),(0,O.jsx)(`span`,{className:Q.noFilesTitle,children:`WebCraft`}),(0,O.jsx)(`span`,{className:Q.noFilesTagline,children:`Genera progetti web completi con AI`})]}),(0,O.jsxs)(`div`,{className:Q.noFilesSteps,children:[(0,O.jsxs)(`div`,{className:Q.noFilesStep,children:[(0,O.jsx)(`span`,{className:Q.noFilesStepNum,children:`1`}),(0,O.jsx)(`span`,{children:`Scegli un esempio o scrivi una descrizione nel box in basso`})]}),(0,O.jsxs)(`div`,{className:Q.noFilesStep,children:[(0,O.jsx)(`span`,{className:Q.noFilesStepNum,children:`2`}),(0,O.jsxs)(`span`,{children:[`Premi `,(0,O.jsx)(`strong`,{children:`▶ Genera`}),` — l'AI crea tutti i file del progetto`]})]}),(0,O.jsxs)(`div`,{className:Q.noFilesStep,children:[(0,O.jsx)(`span`,{className:Q.noFilesStepNum,children:`3`}),(0,O.jsx)(`span`,{children:`Chiedi modifiche in chat, scarica lo ZIP o avvia il Sandbox`})]})]}),(0,O.jsxs)(`div`,{className:Q.noFilesExamplesHint,children:[`💡 Prova: `,(0,O.jsx)(`button`,{className:Q.noFilesExampleBtn,onClick:()=>{let e=PT[0];o(e.name),c(e.desc),Ae(e.desc)},children:`MySaaS`}),(0,O.jsx)(`button`,{className:Q.noFilesExampleBtn,onClick:()=>{let e=PT[1];o(e.name),c(e.desc),Ae(e.desc)},children:`MyShop`}),(0,O.jsx)(`button`,{className:Q.noFilesExampleBtn,onClick:()=>{let e=PT[3];o(e.name),c(e.desc),Ae(e.desc)},children:`MyPortfolio`})]})]}):(0,O.jsxs)(`div`,{className:Q.codeLayout,children:[(0,O.jsx)(`div`,{className:Q.ideTabBar,children:p.map((e,t)=>{let n=e._error||!!e._syntaxError,r=t===h;return(0,O.jsxs)(`button`,{className:`${Q.ideTab} ${r?Q.ideTabActive:``} ${n?Q.ideTabError:``} ${e._pending?Q.ideTabPending:``}`,onClick:()=>{g(t),x(null),y(null)},title:e.name,children:[(0,O.jsx)(`span`,{className:Q.ideTabIcon,children:e._pending?`⌛`:n?`⚠`:LT(e.name)}),(0,O.jsx)(`span`,{className:Q.ideTabName,children:e.name.split(`/`).pop()}),S.has(e.name)&&(0,O.jsx)(`span`,{className:Q.ideTabUnsaved,children:`●`}),n&&(0,O.jsx)(`span`,{className:Q.ideTabDot})]},t)})}),de&&(0,O.jsxs)(`div`,{className:Q.diffOverlay,children:[(0,O.jsxs)(`div`,{className:Q.diffOverlayHeader,children:[(0,O.jsxs)(`span`,{children:[`✏ Modifica proposta — `,(0,O.jsx)(`strong`,{children:de.file})]}),(0,O.jsxs)(`div`,{className:Q.diffOverlayActions,children:[(0,O.jsx)(`button`,{className:Q.diffAcceptBtn,onClick:()=>{m(e=>e.map(e=>e.name===de.file?{...e,content:de.after}:e)),fe(null)},children:`✓ Accetta`}),(0,O.jsx)(`button`,{className:Q.diffRejectBtn,onClick:()=>fe(null),children:`✕ Rifiuta`})]})]}),(0,O.jsxs)(`div`,{className:Q.diffOverlayBody,children:[de.before.split(`
733
733
  `).map((e,t)=>e===(de.after.split(`
734
734
  `)[t]??``)?(0,O.jsxs)(`div`,{className:Q.diffSame,children:[`\xA0`,e||` `]},t):(0,O.jsxs)(`div`,{className:Q.diffRem,children:[`- `,e]},`r${t}`)),de.after.split(`
@@ -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-QFXhoDBT.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-Dpm2XufS.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-CVtta8J-.css">
13
13
  </head>
14
14
  <body>