neural-loom 0.3.0 → 0.3.2

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.
Files changed (48) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/diagnostics/route-bundle-stats.json +1 -1
  5. package/.next/fallback-build-manifest.json +3 -3
  6. package/.next/server/app/_global-error.html +1 -1
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found.html +1 -1
  14. package/.next/server/app/_not-found.rsc +1 -1
  15. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  21. package/.next/server/app/index.html +1 -1
  22. package/.next/server/app/index.rsc +2 -2
  23. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  24. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  25. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  26. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  27. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  28. package/.next/server/app/page/react-loadable-manifest.json +2 -2
  29. package/.next/server/app/page_client-reference-manifest.js +1 -1
  30. package/.next/server/chunks/[root-of-the-server]__0li1h1u._.js +1 -1
  31. package/.next/server/chunks/[root-of-the-server]__0li1h1u._.js.map +1 -1
  32. package/.next/server/chunks/[root-of-the-server]__0tq0maq._.js +1 -1
  33. package/.next/server/chunks/[root-of-the-server]__0tq0maq._.js.map +1 -1
  34. package/.next/server/middleware/middleware-manifest.json +1 -1
  35. package/.next/server/middleware-build-manifest.js +3 -3
  36. package/.next/server/middleware-manifest.json +1 -1
  37. package/.next/server/pages/404.html +1 -1
  38. package/.next/server/pages/500.html +1 -1
  39. package/.next/static/chunks/{0uyuco-451j.n.js → 0qc.k.i3-z5fx.js} +1 -1
  40. package/.next/static/chunks/{14~-ojwsxf~oe.js → 0ru16isbveym7.js} +4 -4
  41. package/.next/trace +1 -1
  42. package/.next/trace-build +1 -1
  43. package/package.json +1 -1
  44. package/src/app/components/TerminalConsole.tsx +98 -38
  45. package/src/lib/agents/SessionPersister.ts +24 -8
  46. /package/.next/static/{04j4ht7eCOOXSLQ5Wixq0 → 2ep0r9tVD7fxPpgavvvkt}/_buildManifest.js +0 -0
  47. /package/.next/static/{04j4ht7eCOOXSLQ5Wixq0 → 2ep0r9tVD7fxPpgavvvkt}/_clientMiddlewareManifest.js +0 -0
  48. /package/.next/static/{04j4ht7eCOOXSLQ5Wixq0 → 2ep0r9tVD7fxPpgavvvkt}/_ssgManifest.js +0 -0
@@ -8,4 +8,4 @@
8
8
  outline: 1px dashed rgba(255, 255, 255, 0.2);
9
9
  }
10
10
  `,document.head.appendChild(e)}e.s(["default",0,function({workspaceRoot:e}){let[eh,eg]=(0,r.useState)({global:[],workspace:[]}),[ex,ey]=(0,r.useState)(null),[eb,ej]=(0,r.useState)(!0),[ev,e_]=(0,r.useState)(!0),[ew,eS]=(0,r.useState)([]),[ek,eC]=(0,r.useState)(null),[eN,eR]=(0,r.useState)({}),[eE,eL]=(0,r.useState)(!1),[eW,eO]=(0,r.useState)("SELECT * FROM sqlite_master;"),[eT,eI]=(0,r.useState)(!1),[eD,eP]=(0,r.useState)(null),[ez,eq]=(0,r.useState)(null),[eA,eB]=(0,r.useState)(null),[e$,eF]=(0,r.useState)(null),[eM,eU]=(0,r.useState)(!1),[eH,eG]=(0,r.useState)(!1),[eJ,eQ]=(0,r.useState)({id:"",name:"",type:"sqlite",filepath:"./dev.db",host:"localhost",port:5432,database:"postgres",username:"postgres",password:"",ssl:!1,readOnly:!0}),[eK,eY]=(0,r.useState)(!1),[eV,eX]=(0,r.useState)(null),eZ=async()=>{try{let t=await fetch(`/api/sql/connections?root=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();e.success&&(eg({global:e.global||[],workspace:e.workspace||[]}),ey(e.activeId),ej(e.isActiveGlobal))}}catch(e){console.error("Failed to load connection profiles:",e)}},e0=async()=>{if(!ex)return void eS([]);eL(!0);try{let t=await fetch(`/api/sql/schema?action=list_tables&root=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();e.success?(eS(e.tables||[]),eP(null)):eP(e.error||"Failed to load database schema.")}else{let e=await t.json();eP(e.error||"Failed to load database schema.")}}catch(e){console.error("Failed to load schema:",e)}finally{eL(!1)}},e1=async t=>{if(eN[t])return void eC(ek===t?null:t);try{let r=await fetch(`/api/sql/schema?action=describe_table&table=${encodeURIComponent(t)}&root=${encodeURIComponent(e)}`);if(r.ok){let e=await r.json();e.success&&(eR(r=>({...r,[t]:e.columns})),eC(t))}}catch(e){console.error(`Failed to load columns for table ${t}:`,e)}};(0,r.useEffect)(()=>{eZ()},[e]),(0,r.useEffect)(()=>{e0(),eq(null),eC(null),eR({});let e=eb?eh.global.find(e=>e.id===ex):eh.workspace.find(e=>e.id===ex);e&&("sqlite"===e.type?eO("SELECT name, type FROM sqlite_master WHERE type='table';"):"mssql"===e.type?eO("SELECT * FROM sys.tables;"):eO("SELECT * FROM information_schema.tables LIMIT 10;"))},[ex,eb,eh.global.length,eh.workspace.length]);let e5=async(t,r)=>{try{(await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"set_active",profileId:t,isGlobal:r,root:e})})).ok&&(ey(t),ej(r))}catch(e){console.error("Failed to set active profile:",e)}},e2=async()=>{eX(null);try{let t=await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"test",profile:eJ,root:e})}),r=await t.json();r.success?eX({success:!0,message:"Connection test successful!"}):eX({success:!1,message:r.error||"Connection test failed."})}catch(e){eX({success:!1,message:e.message||"Failed to make test query."})}},e8=async t=>{if(t.preventDefault(),!eJ.name||!eJ.type)return;eY(!0);let r=eJ.id||`profile_${Math.random().toString(36).substring(7)}`,s={...eJ,id:r,name:eJ.name,type:eJ.type};try{(await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"save",profile:s,isGlobal:eH,root:e})})).ok&&(await eZ(),eU(!1),ex||e5(r,eH))}catch(e){console.error("Failed to save profile:",e)}finally{eY(!1)}},e6=async(t,r)=>{if(confirm("Are you sure you want to delete this connection profile?"))try{(await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",profileId:t,isGlobal:r,root:e})})).ok&&(await eZ(),ex===t&&ey(null))}catch(e){console.error("Failed to delete connection profile:",e)}},e7=async(t,r,s,a)=>{if(e3?.readOnly)return void alert("Database connection is Read-Only. Updates are disabled.");let n=(e=>{let t=e.match(/from\s+([a-zA-Z0-9_\`"\[\]\.]+)/i);if(!t)return null;let r=t[1].trim(),s=(r=r.replace(/[\`"\[\]]/g,"")).split(".");return s[s.length-1]})(eW);if(!n)return void alert("Could not extract table name from query for inline edit. Please ensure your query includes 'FROM tableName'.");eF({rowIndex:t,field:r,status:"saving"});try{let a=eN[n];if(!a){let t=await fetch(`/api/sql/schema?action=describe_table&table=${encodeURIComponent(n)}&root=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();e.success&&e.columns&&(a=e.columns,eR(t=>({...t,[n]:e.columns})))}}if(!a)throw Error(`Could not load schema columns for table "${n}".`);let l=a.find(e=>e.isPrimaryKey);if(!l)throw Error(`Table "${n}" does not have a primary key. Inline editing requires a primary key.`);let o=ez?.rows[t];if(!o||!(l.name in o))throw Error(`Primary key column "${l.name}" was not returned in the query results. Please include it in your SELECT statement.`);let i=o[l.name],d=a.find(e=>e.name===r);if(!d)throw Error(`Column "${r}" was not found in schema columns.`);let c=e=>{let t=e.toLowerCase();return t.includes("int")||t.includes("decimal")||t.includes("numeric")||t.includes("float")||t.includes("double")||t.includes("real")},u="";if("NULL"===s.toUpperCase())u=`${r} = NULL`;else if(c(d.type)){if(""===s||isNaN(Number(s)))throw Error(`Value "${s}" is not a valid number for column "${r}".`);u=`${r} = ${s}`}else u=`${r} = '${s.replace(/'/g,"''")}'`;let p="";p=c(l.type)?`${l.name} = ${i}`:`${l.name} = '${String(i).replace(/'/g,"''")}'`;let m=`UPDATE ${n} SET ${u} WHERE ${p};`,f=await fetch("/api/sql/query",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sql:m,root:e})}),h=await f.json();if(f.ok&&h.success){if(ez){let e=[...ez.rows],a=s;"NULL"===s.toUpperCase()?a=null:c(d.type)&&(a=Number(s)),e[t]={...e[t],[r]:a},eq({...ez,rows:e})}eF({rowIndex:t,field:r,status:"success"}),setTimeout(()=>eF(null),1500)}else throw Error(h.error||"Update database query failed.")}catch(e){eF({rowIndex:t,field:r,status:"error",message:e.message}),alert(`Inline Update Failed:
11
- ${e.message}`)}},e4=async()=>{if(eW.trim()&&ex){eI(!0),eP(null),eq(null);try{let t=await fetch("/api/sql/query",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sql:eW.trim(),root:e})}),r=await t.json();t.ok&&r.success?(eq({rows:r.rows||[],fields:r.fields||[],durationMs:r.durationMs||0,affectedRows:r.affectedRows}),(eW.toLowerCase().includes("create table")||eW.toLowerCase().includes("drop table")||eW.toLowerCase().includes("alter table"))&&e0()):eP(r.error||"Failed to execute query.")}catch(e){eP(e.message||"An unexpected error occurred during execution.")}finally{eI(!1)}}},e3=eb?eh.global.find(e=>e.id===ex):eh.workspace.find(e=>e.id===ex);return(0,t.jsxs)("div",{style:a,children:[(0,t.jsx)("div",{style:{...n,width:ev?"220px":"0px",borderRight:ev?"1px solid var(--border)":"none",overflow:"hidden",transition:"all 0.25s cubic-bezier(0.4, 0, 0.2, 1)"},children:ev&&(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",minWidth:"220px",minHeight:0},children:[(0,t.jsxs)("div",{style:l,children:[(0,t.jsxs)("div",{style:o,children:[(0,t.jsx)("span",{style:i,children:"Connections"}),(0,t.jsx)("button",{style:d,onClick:()=>{eX(null),eQ({id:"",name:"",type:"sqlite",filepath:"./dev.db",host:"localhost",port:5432,database:"postgres",username:"postgres",password:"",ssl:!1,readOnly:!0}),eG(!1),eU(!0)},title:"Add Database Connection Profile",children:"➕ Add"})]}),(0,t.jsxs)("div",{style:c,children:[0===eh.global.length&&0===eh.workspace.length&&(0,t.jsx)("div",{style:b,children:"No connections configured. Add one to start."}),eh.workspace.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:u,children:"WORKSPACE CONNECTIONS"}),eh.workspace.map(e=>(0,t.jsxs)("div",{style:{...p,...ex===e.id&&!eb?m:{}},onClick:()=>e5(e.id,!1),children:[(0,t.jsxs)("div",{style:f,children:[(0,t.jsxs)("span",{style:h,children:["📁 ",e.name]}),(0,t.jsx)("span",{style:g,children:e.type})]}),(0,t.jsx)("button",{style:x,onClick:t=>{t.stopPropagation(),e6(e.id,!1)},children:"✖"})]},e.id))]}),eh.global.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:u,children:"GLOBAL CONNECTIONS"}),eh.global.map(e=>(0,t.jsxs)("div",{style:{...p,...ex===e.id&&eb?m:{}},onClick:()=>e5(e.id,!0),children:[(0,t.jsxs)("div",{style:f,children:[(0,t.jsxs)("span",{style:h,children:["🌐 ",e.name]}),(0,t.jsx)("span",{style:g,children:e.type})]}),(0,t.jsx)("button",{style:x,onClick:t=>{t.stopPropagation(),e6(e.id,!0)},children:"✖"})]},e.id))]})]})]}),(0,t.jsxs)("div",{style:{...l,flex:1,borderTop:"1px solid var(--border)"},children:[(0,t.jsxs)("div",{style:o,children:[(0,t.jsx)("span",{style:i,children:"Schema Tables"}),eE&&(0,t.jsx)("span",{style:es})]}),(0,t.jsxs)("div",{style:y,children:[!ex&&(0,t.jsx)("div",{style:b,children:"Select an active connection to view tables."}),ex&&0===ew.length&&!eE&&(0,t.jsx)("div",{style:b,children:"No tables found in database schema."}),ew.map(e=>(0,t.jsxs)("div",{style:j,children:[(0,t.jsxs)("div",{style:v,onClick:()=>e1(e.name),children:[(0,t.jsx)("span",{style:_,children:"view"===e.type?"👁️":"📊"}),(0,t.jsx)("span",{style:w,children:e.name}),(0,t.jsx)("span",{style:S,children:ek===e.name?"▼":"▶"})]}),ek===e.name&&eN[e.name]&&(0,t.jsx)("div",{style:k,children:eN[e.name].map(e=>(0,t.jsxs)("div",{style:C,children:[(0,t.jsx)("span",{style:N,children:e.isPrimaryKey?"🔑":e.isForeignKey?"🔗":"▫"}),(0,t.jsx)("span",{style:R,title:e.type,children:e.name}),(0,t.jsx)("span",{style:E,children:e.type.toLowerCase().substring(0,12)})]},e.name))})]},e.name))]})]})]})}),(0,t.jsxs)("div",{style:L,children:[(0,t.jsxs)("div",{style:W,children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>e_(!ev),style:{background:"rgba(255, 255, 255, 0.05)",border:"1px solid var(--border)",borderRadius:"6px",color:"var(--muted)",cursor:"pointer",padding:"0.25rem 0.5rem",fontSize:"0.75rem",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.15s ease"},title:ev?"Collapse Connections List":"Expand Connections List",children:ev?"◀ Collapse":"📂 Schema Connections"}),(0,t.jsx)("span",{style:O,children:"Active Connection:"}),e3?(0,t.jsxs)("span",{style:T,children:[eb?"🌐":"📁"," ",e3.name," (",e3.type,")",e3.readOnly&&(0,t.jsx)("span",{style:I,children:"Read-Only"})]}):(0,t.jsx)("span",{style:{...T,color:"var(--danger)"},children:"No Connection Selected"})]}),(0,t.jsx)("button",{style:{...D,opacity:!ex||eT?.6:1,cursor:!ex||eT?"not-allowed":"pointer"},onClick:e4,disabled:!ex||eT,children:eT?"⌛ Running...":"⚡ Execute Query (F5)"})]}),(0,t.jsx)("div",{style:P,children:(0,t.jsx)("textarea",{style:z,value:eW,onChange:e=>eO(e.target.value),placeholder:"Write your SQL query script here...",onKeyDown:e=>{("F5"===e.key||e.ctrlKey&&"Enter"===e.key)&&(e.preventDefault(),e4())}})}),(0,t.jsxs)("div",{style:q,children:[eD&&(0,t.jsxs)("div",{style:A,children:[(0,t.jsx)("h4",{style:{margin:"0 0 0.5rem 0",color:"var(--danger)"},children:"⚠️ Execution Error"}),(0,t.jsx)("pre",{style:B,children:eD}),eD.includes("not installed")&&(0,t.jsxs)("div",{style:$,children:[(0,t.jsx)("p",{style:{margin:"0 0 0.5rem 0"},children:"To resolve this, run this installer command in your workspace terminal:"}),(0,t.jsx)("code",{style:F,children:e3?.type==="sqlite"?"npm install better-sqlite3":e3?.type==="postgres"?"npm install pg":e3?.type==="mysql"?"npm install mysql2":"npm install mssql"})]})]}),ez&&(0,t.jsxs)("div",{style:M,children:[(0,t.jsxs)("div",{style:U,children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[(0,t.jsxs)("span",{children:["Query completed."," ",void 0!==ez.affectedRows?`Affected rows: ${ez.affectedRows}`:`Returned ${ez.rows.length} rows`]}),(0,t.jsxs)("span",{children:["Duration: ",ez.durationMs,"ms"]})]}),ez.rows.length>0&&(0,t.jsxs)("div",{style:{display:"flex",gap:"0.4rem"},children:[(0,t.jsx)("button",{onClick:()=>{if(ez&&0!==ez.rows.length)try{let e=ez.fields.join(","),t=ez.rows.map(e=>ez.fields.map(t=>{let r=e[t];if(null===r)return"NULL";let s=String(r);return s.includes(",")||s.includes('"')||s.includes("\n")||s.includes("\r")?`"${s.replace(/"/g,'""')}"`:s}).join(",")),r=[e,...t].join("\r\n"),s=new Blob([r],{type:"text/csv;charset=utf-8;"}),a=URL.createObjectURL(s),n=document.createElement("a");n.setAttribute("href",a),n.setAttribute("download",`query-results-${Date.now()}.csv`),document.body.appendChild(n),n.click(),document.body.removeChild(n)}catch(e){console.error("Export CSV failed:",e),alert("Failed to export as CSV")}},style:K,children:"📥 Export CSV"}),(0,t.jsx)("button",{onClick:()=>{if(ez&&0!==ez.rows.length)try{let e=JSON.stringify(ez.rows,null,2),t=new Blob([e],{type:"application/json;charset=utf-8;"}),r=URL.createObjectURL(t),s=document.createElement("a");s.setAttribute("href",r),s.setAttribute("download",`query-results-${Date.now()}.json`),document.body.appendChild(s),s.click(),document.body.removeChild(s)}catch(e){console.error("Export JSON failed:",e),alert("Failed to export as JSON")}},style:K,children:"📥 Export JSON"})]})]}),ez.rows.length>0?(0,t.jsx)("div",{style:H,children:(0,t.jsxs)("table",{style:G,children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{children:ez.fields.map(e=>(0,t.jsx)("th",{style:J,children:e},e))})}),(0,t.jsx)("tbody",{children:ez.rows.map((e,r)=>(0,t.jsx)("tr",{style:r%2==0?X:Z,children:ez.fields.map(s=>{let a=eA&&eA.rowIndex===r&&eA.field===s,n=e$&&e$.rowIndex===r&&e$.field===s&&"saving"===e$.status,l=e$&&e$.rowIndex===r&&e$.field===s&&"success"===e$.status,o=e$&&e$.rowIndex===r&&e$.field===s&&"error"===e$.status,i={...Q,...V};return n?i={...i,backgroundColor:"rgba(168, 85, 247, 0.15)"}:l?i={...i,backgroundColor:"rgba(16, 185, 129, 0.25)"}:o&&(i={...i,backgroundColor:"rgba(239, 68, 68, 0.25)"}),(0,t.jsx)("td",{style:i,onDoubleClick:()=>{e3?.readOnly?alert("Database connection is Read-Only. Editing is disabled."):eB({rowIndex:r,field:s,value:null===e[s]?"NULL":String(e[s])})},className:"db-cell",title:"Double click to edit cell",children:a?(0,t.jsx)("input",{style:Y,value:eA.value,autoFocus:!0,onChange:e=>eB({...eA,value:e.target.value}),onKeyDown:async t=>{if("Enter"===t.key){t.preventDefault();let a=eA.value;eB(null),a!==(null===e[s]?"NULL":String(e[s]))&&await e7(r,s,a,e[s])}else"Escape"===t.key&&eB(null)},onBlur:async()=>{let t=eA.value;eB(null),t!==(null===e[s]?"NULL":String(e[s]))&&await e7(r,s,t,e[s])}}):null===e[s]?"NULL":"object"==typeof e[s]?JSON.stringify(e[s]):String(e[s])},s)})},r))})]})}):void 0===ez.affectedRows&&(0,t.jsx)("div",{style:ee,children:"Query executed successfully, but returned 0 results."})]}),!eD&&!ez&&!eT&&(0,t.jsx)("div",{style:ee,children:"Write a query script and click Execute to view table records."}),eT&&(0,t.jsxs)("div",{style:et,children:[(0,t.jsx)("span",{style:er}),(0,t.jsx)("span",{style:{color:"var(--muted)"},children:"Running database statement..."})]})]})]}),eM&&"u">typeof document&&(0,s.createPortal)((0,t.jsx)("div",{style:ea,children:(0,t.jsxs)("div",{style:en,children:[(0,t.jsxs)("h3",{style:{margin:"0 0 1rem 0",display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:"🔌 Add Database Profile"}),(0,t.jsx)("span",{style:{cursor:"pointer"},onClick:()=>eU(!1),children:"✖"})]}),(0,t.jsxs)("form",{onSubmit:e8,children:[(0,t.jsxs)("div",{style:el,children:[(0,t.jsx)("label",{style:eo,children:"Profile Name"}),(0,t.jsx)("input",{style:ei,type:"text",required:!0,value:eJ.name,onChange:e=>eQ(t=>({...t,name:e.target.value})),placeholder:"e.g. Local Postgres, Dev SQLite"})]}),(0,t.jsxs)("div",{style:el,children:[(0,t.jsx)("label",{style:eo,children:"Scope Level"}),(0,t.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"radio",checked:!eH,onChange:()=>eG(!1)}),"Workspace Local"]}),(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"radio",checked:eH,onChange:()=>eG(!0)}),"Global User Profile"]})]})]}),(0,t.jsxs)("div",{style:el,children:[(0,t.jsx)("label",{style:eo,children:"Database Type"}),(0,t.jsxs)("select",{style:ed,value:eJ.type,onChange:e=>{let t=e.target.value,r=5432;"mysql"===t&&(r=3306),"mssql"===t&&(r=1433),eQ(e=>({...e,type:t,filepath:"sqlite"===t?"./dev.db":void 0,port:"sqlite"!==t?r:void 0,database:"sqlite"===t?void 0:"mssql"===t?"master":"postgres"===t?"postgres":"",username:"sqlite"===t?void 0:"mssql"===t?"sa":"postgres"===t?"postgres":"root"}))},children:[(0,t.jsx)("option",{value:"sqlite",children:"SQLite (Local File)"}),(0,t.jsx)("option",{value:"postgres",children:"PostgreSQL"}),(0,t.jsx)("option",{value:"mysql",children:"MySQL"}),(0,t.jsx)("option",{value:"mssql",children:"Microsoft SQL Server"})]})]}),"sqlite"===eJ.type?(0,t.jsxs)("div",{style:el,children:[(0,t.jsx)("label",{style:eo,children:"Database File Path"}),(0,t.jsx)("input",{style:ei,type:"text",required:!0,value:eJ.filepath||"",onChange:e=>eQ(t=>({...t,filepath:e.target.value})),placeholder:"Relative (e.g. ./data/dev.db) or Absolute path"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,t.jsxs)("div",{style:{...el,flex:3},children:[(0,t.jsx)("label",{style:eo,children:"Host IP Address"}),(0,t.jsx)("input",{style:ei,type:"text",required:!0,value:eJ.host||"",onChange:e=>eQ(t=>({...t,host:e.target.value})),placeholder:"localhost or IP"})]}),(0,t.jsxs)("div",{style:{...el,flex:1},children:[(0,t.jsx)("label",{style:eo,children:"Port"}),(0,t.jsx)("input",{style:ei,type:"number",required:!0,value:eJ.port||0,onChange:e=>eQ(t=>({...t,port:parseInt(e.target.value)}))})]})]}),(0,t.jsxs)("div",{style:el,children:[(0,t.jsx)("label",{style:eo,children:"Database Name"}),(0,t.jsx)("input",{style:ei,type:"text",required:!0,value:eJ.database||"",onChange:e=>eQ(t=>({...t,database:e.target.value}))})]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,t.jsxs)("div",{style:{...el,flex:1},children:[(0,t.jsx)("label",{style:eo,children:"Username"}),(0,t.jsx)("input",{style:ei,type:"text",required:!0,value:eJ.username||"",onChange:e=>eQ(t=>({...t,username:e.target.value}))})]}),(0,t.jsxs)("div",{style:{...el,flex:1},children:[(0,t.jsx)("label",{style:eo,children:"Password"}),(0,t.jsx)("input",{style:ei,type:"password",value:eJ.password||"",onChange:e=>eQ(t=>({...t,password:e.target.value}))})]})]}),("postgres"===eJ.type||"mssql"===eJ.type)&&(0,t.jsx)("div",{style:el,children:(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"checkbox",checked:!!eJ.ssl,onChange:e=>eQ(t=>({...t,ssl:e.target.checked}))}),"Require SSL Secure Connection"]})})]}),(0,t.jsx)("div",{style:el,children:(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"checkbox",checked:!!eJ.readOnly,onChange:e=>eQ(t=>({...t,readOnly:e.target.checked}))}),"Enforce Read-Only Connection (Disable mutations)"]})}),eV&&(0,t.jsx)("div",{style:{...ec,backgroundColor:eV.success?"rgba(16, 185, 129, 0.12)":"rgba(239, 68, 68, 0.12)",border:eV.success?"1px solid var(--success)":"1px solid var(--danger)",color:eV.success?"var(--success)":"var(--danger)"},children:eV.message}),(0,t.jsxs)("div",{style:eu,children:[(0,t.jsx)("button",{type:"button",style:ep,onClick:e2,children:"🔍 Test Connection"}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,t.jsx)("button",{type:"button",style:em,onClick:()=>eU(!1),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",style:ef,disabled:eK,children:eK?"Saving...":"Save Profile"})]})]})]})]})}),document.body)]})}])},20897,e=>{e.v({activeBorder:"page-module___8aEwW__activeBorder",agentBadge:"page-module___8aEwW__agentBadge",agentCard:"page-module___8aEwW__agentCard",agentGrid:"page-module___8aEwW__agentGrid",agentHeader:"page-module___8aEwW__agentHeader",agentName:"page-module___8aEwW__agentName",agentStateBadge:"page-module___8aEwW__agentStateBadge",ansiCyan:"page-module___8aEwW__ansiCyan",ansiGreen:"page-module___8aEwW__ansiGreen",ansiMagenta:"page-module___8aEwW__ansiMagenta",ansiRed:"page-module___8aEwW__ansiRed",ansiYellow:"page-module___8aEwW__ansiYellow",cardBody:"page-module___8aEwW__cardBody",container:"page-module___8aEwW__container",containerActive:"page-module___8aEwW__containerActive",contextDetails:"page-module___8aEwW__contextDetails",contextItem:"page-module___8aEwW__contextItem",contextList:"page-module___8aEwW__contextList",contextMeta:"page-module___8aEwW__contextMeta",contextTitle:"page-module___8aEwW__contextTitle",dashboardGrid:"page-module___8aEwW__dashboardGrid",envGrid:"page-module___8aEwW__envGrid",envName:"page-module___8aEwW__envName",envRow:"page-module___8aEwW__envRow",envStatus:"page-module___8aEwW__envStatus",footer:"page-module___8aEwW__footer",header:"page-module___8aEwW__header",logoArea:"page-module___8aEwW__logoArea",mainPanel:"page-module___8aEwW__mainPanel",pulse:"page-module___8aEwW__pulse","pulse-attention":"page-module___8aEwW__pulse-attention","pulse-thinking":"page-module___8aEwW__pulse-thinking",pulseDot:"page-module___8aEwW__pulseDot",quickLaunchBtn:"page-module___8aEwW__quickLaunchBtn",sectionTitle:"page-module___8aEwW__sectionTitle",sidePanel:"page-module___8aEwW__sidePanel","state-complete":"page-module___8aEwW__state-complete","state-idle":"page-module___8aEwW__state-idle","state-needs-input":"page-module___8aEwW__state-needs-input","state-thinking":"page-module___8aEwW__state-thinking",statusIndicator:"page-module___8aEwW__statusIndicator",stoppedBadge:"page-module___8aEwW__stoppedBadge",subtitle:"page-module___8aEwW__subtitle",terminalContainer:"page-module___8aEwW__terminalContainer",terminalInput:"page-module___8aEwW__terminalInput",terminalInputArea:"page-module___8aEwW__terminalInputArea",terminalLine:"page-module___8aEwW__terminalLine",terminalSendBtn:"page-module___8aEwW__terminalSendBtn",title:"page-module___8aEwW__title"})},52683,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(70703),a=e.i(20897),n=e.i(66381);let l=e=>"mock"===e?"🧪":e.includes("-docker")?"🐳":e.includes("-ssh")?"🌐":"💻",o=(0,s.default)(()=>e.A(45344),{loadableGenerated:{modules:[37314]},ssr:!1,loading:()=>(0,t.jsx)("div",{style:{height:"400px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#05070a",color:"var(--muted)",border:"1px solid var(--border)",borderBottomLeftRadius:"12px",borderBottomRightRadius:"12px"},children:(0,t.jsx)("span",{children:"Initializing terminal emulator..."})})}),i=(0,s.default)(()=>e.A(39429),{loadableGenerated:{modules:[1985]},ssr:!1,loading:()=>(0,t.jsx)("div",{style:{height:"280px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--card)",border:"1px solid var(--border)",borderRadius:"12px",marginTop:"1.5rem"},children:(0,t.jsx)("span",{style:{color:"var(--muted)"},children:"Initializing prompt editor..."})})}),d=(0,s.default)(()=>e.A(56915),{loadableGenerated:{modules:[99026]},ssr:!1}),c=(0,s.default)(()=>e.A(78716),{loadableGenerated:{modules:[9949]},ssr:!1}),u=(0,s.default)(()=>e.A(33789),{loadableGenerated:{modules:[20032]},ssr:!1}),p=(0,s.default)(()=>e.A(78003),{loadableGenerated:{modules:[97722]},ssr:!1});e.s(["default",0,function(){let[e,s]=(0,r.useState)([]),[m,f]=(0,r.useState)(null),[h,g]=(0,r.useState)(!1),[x,y]=(0,r.useState)(!1),[b,j]=(0,r.useState)(!1),[v,_]=(0,r.useState)(!1),[w,S]=(0,r.useState)(!1),[k,C]=(0,r.useState)(!1),[N,R]=(0,r.useState)(""),[E,L]=(0,r.useState)(9601),[W,O]=(0,r.useState)("0.2.19"),[T,I]=(0,r.useState)(null),[D,P]=(0,r.useState)([]),z=e.filter(e=>"workspace-terminal"!==e.id),q=e.find(e=>e.id===m),A=z.some(e=>("claude-docker"===e.type||"aider-docker"===e.type)&&"running"===e.status),B=z.some(e=>"claude-ssh"===e.type&&"running"===e.status),$=async()=>{try{let e=await fetch("/api/sessions"),t=await e.json();t.sessions&&s(t.sessions),t.wsPort&&L(t.wsPort),t.originalCwd&&R(t.originalCwd),t.version&&O(t.version)}catch(e){console.error("Failed to fetch sessions:",e)}},F=async()=>{try{let e=await fetch("/api/recents");if(e.ok){let t=await e.json();t.success&&t.recents&&t.recents.lastSession&&I(t.recents.lastSession)}}catch(e){console.error("Failed to fetch recents:",e)}},M=async()=>{try{let e=await fetch("/api/configs");if(e.ok){let t=await e.json();t.configs&&P(t.configs)}}catch(e){console.error("Failed to fetch configs:",e)}};(0,r.useEffect)(()=>{(async()=>{await $(),await F(),await M()})(),"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").then(e=>console.log("Service Worker registered:",e.scope)).catch(e=>console.error("Service Worker registration failed:",e));let e=setInterval($,4e3);return()=>clearInterval(e)},[]);let U=async(e,t,r,s)=>{g(!0);try{let a=t;a||("claude"===e?a="Claude Local":"claude-docker"===e?a="Claude Docker":"claude-ssh"===e?a="Claude SSH":"aider"===e?a="Aider Local":"aider-docker"===e?a="Aider Docker":"mock"===e&&(a="Mock Session"));let n={type:e,name:a,workspaceRoot:r,scopedDirs:s};if(("aider"===e||"aider-docker"===e)&&!r)try{let e=await fetch("/api/context/aider");if(e.ok){let t=await e.json();t.success&&t.config&&(n.workspaceRoot=t.config.workspaceRoot,n.scopedDirs=t.config.scopedDirs)}}catch(e){console.error("Failed to load aider configuration before launch:",e)}let l=await fetch("/api/sessions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),o=await l.json();o.success&&(await $(),await M(),f(o.session.id),I({type:e,name:a,workspaceRoot:r,scopedDirs:s}))}catch(e){console.error("Failed to launch session:",e)}finally{g(!1)}},H=async e=>{g(!0);try{let t=await fetch("/api/sessions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e.type,name:e.name,workspaceRoot:e.workspaceRoot,scopedDirs:e.scopedDirs})}),r=await t.json();r.success?(await $(),f(r.session.id)):alert(r.error||"Failed to launch configuration.")}catch(e){console.error(e),alert("Network error: failed to launch configuration.")}finally{g(!1)}},G=async e=>{if(window.confirm("Are you sure you want to delete this configuration template?"))try{(await fetch("/api/configs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",id:e})})).ok?await M():alert("Failed to delete configuration template.")}catch(e){console.error(e),alert("Network error: failed to delete configuration template.")}},J=async(e,t=!1)=>{try{let r=await fetch("/api/sessions/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,delete:t})});(await r.json()).success&&(t&&m===e&&f(null),await $())}catch(e){console.error("Failed to stop session:",e)}};return(0,t.jsxs)("div",{className:`${a.default.container} ${q?a.default.containerActive:""}`,children:[(0,t.jsxs)("header",{className:a.default.header,children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1.5rem"},children:[(0,t.jsx)("img",{src:"/logo.png",alt:"NeuralLoom Logo",style:{width:"160px",height:"160px",borderRadius:"16px",objectFit:"contain"}}),(0,t.jsxs)("div",{className:a.default.logoArea,children:[(0,t.jsx)("h1",{className:a.default.title,style:{margin:0,lineHeight:1.1},children:"NeuralLoom"}),(0,t.jsx)("span",{className:a.default.subtitle,children:"Unified AI Orchestrator & Context Bridge"})]})]}),(0,t.jsxs)("div",{className:a.default.statusIndicator,children:[(0,t.jsx)("span",{className:a.default.pulseDot}),(0,t.jsx)("span",{children:"Orchestrator Online"})]})]}),q?(0,t.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:(0,t.jsx)(p,{sessionId:q.id,workspaceRoot:q.workspaceRoot||"",scopedDirs:q.scopedDirs||[],onClose:()=>f(null),sessions:e,onSwitchSession:e=>f(e),onRefreshSessions:$,wsPort:E})}):(0,t.jsxs)("div",{className:a.default.dashboardGrid,children:[(0,t.jsxs)("div",{className:a.default.mainPanel,children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Built-in Database Explorer & SQL Client"}),(0,t.jsx)("div",{className:"card",style:{padding:0,overflow:"hidden",height:"450px",border:"1px solid var(--border)"},children:(0,t.jsx)(n.default,{workspaceRoot:N||""})})]}),(0,t.jsxs)("section",{style:{marginTop:"1.5rem"},children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Shared Context Hub & Slash Commands"}),(0,t.jsxs)("div",{className:a.default.contextList,children:[(0,t.jsxs)("div",{className:`${a.default.contextItem} card`,children:[(0,t.jsxs)("div",{className:a.default.contextMeta,children:[(0,t.jsx)("span",{className:a.default.contextTitle,children:"Staged Context & System Rules (/ccc)"}),(0,t.jsx)("span",{className:a.default.contextDetails,children:"Compiles AGENTS.md guidelines and files map."})]}),(0,t.jsx)("button",{onClick:async()=>{m&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:m,command:"/ccc"})})},disabled:!m,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.75rem",fontWeight:600,opacity:m?1:.5,cursor:m?"pointer":"not-allowed"},children:"🚀 Mount (/ccc)"})]}),(0,t.jsxs)("div",{className:`${a.default.contextItem} card`,children:[(0,t.jsxs)("div",{className:a.default.contextMeta,children:[(0,t.jsx)("span",{className:a.default.contextTitle,children:"Staged Developer Prompt (/ccp)"}),(0,t.jsx)("span",{className:a.default.contextDetails,children:"Executes prompt in .ai/neural-loom/cprompt.md."})]}),(0,t.jsx)("button",{onClick:async()=>{m&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:m,command:"/ccp"})})},disabled:!m,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--success)",backgroundColor:"transparent",color:"var(--success)",fontSize:"0.75rem",fontWeight:600,opacity:m?1:.5,cursor:m?"pointer":"not-allowed"},children:"⚡ Run (/ccp)"})]})]}),(0,t.jsx)(i,{})]})]}),(0,t.jsxs)("div",{className:a.default.mainPanel,children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Active AI Agents"}),0===z.length?(0,t.jsxs)("div",{className:"card",style:{padding:"3rem 1.5rem",textAlign:"center"},children:[(0,t.jsx)("p",{style:{color:"var(--muted)",marginBottom:"1.5rem"},children:"No active agent sessions. Launch a Claude or Aider agent session to begin."}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.75rem",flexDirection:"column"},children:[T&&(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{U(T.type,T.name,T.workspaceRoot,T.scopedDirs)},disabled:h,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none"},title:`Re-launch: ${T.name||T.type}`,children:"⚡ Re-launch Last Session"}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{C(!1),S(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none",flex:1},children:"Launch Claude"}),(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{_(!1),j(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none",flex:1},children:"Launch Aider"})]})]}),(0,t.jsxs)("div",{style:{marginTop:"1.5rem",fontSize:"0.75rem",color:"var(--muted)"},children:["Need a simulator?"," ",(0,t.jsx)("span",{onClick:()=>U("mock"),style:{color:"var(--primary)",cursor:"pointer",textDecoration:"underline"},children:"Start mock playground"})]})]}):(0,t.jsx)("div",{className:a.default.agentGrid,children:z.map(e=>(0,t.jsxs)("div",{className:`${a.default.agentCard} card ${m===e.id?a.default.activeBorder:""}`,children:[(0,t.jsxs)("div",{className:a.default.agentHeader,children:[(0,t.jsx)("span",{className:a.default.agentName,children:e.name}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.35rem",alignItems:"center"},children:["running"===e.status&&e.agentState&&(0,t.jsxs)("span",{className:`${a.default.agentStateBadge} ${a.default["state-"+e.agentState]}`,children:["thinking"===e.agentState&&`${l(e.type)} 💭`,"needs-input"===e.agentState&&`${l(e.type)} ⚠️`,"complete"===e.agentState&&`${l(e.type)} ✅`,"idle"===e.agentState&&`${l(e.type)} 💤`]}),(0,t.jsx)("span",{className:`${a.default.agentBadge} ${"stopped"===e.status?a.default.stoppedBadge:""}`,children:e.status})]})]}),(0,t.jsxs)("div",{className:a.default.cardBody,style:{padding:"1rem"},children:[(0,t.jsxs)("p",{style:{fontSize:"0.8rem",color:"var(--muted)",margin:0},children:["ID: ",(0,t.jsx)("code",{style:{fontSize:"0.72rem"},children:e.id.substring(0,8)})," | Type: ",e.type,(0,t.jsx)("br",{}),"Logs: ",e.logsCount," lines"]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.75rem"},children:["running"===e.status?(0,t.jsx)("button",{onClick:()=>J(e.id,!1),style:{flex:1,padding:"0.35rem",borderRadius:"6px",border:"1px solid var(--danger)",backgroundColor:"transparent",fontSize:"0.75rem",color:"var(--danger)",cursor:"pointer"},children:"Stop"}):(0,t.jsx)("button",{onClick:()=>J(e.id,!0),style:{flex:1,padding:"0.35rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"transparent",fontSize:"0.75rem",color:"var(--muted)",cursor:"pointer"},children:"Delete"}),(0,t.jsx)("button",{onClick:()=>f(e.id),style:{flex:2,padding:"0.35rem",borderRadius:"6px",border:"none",backgroundColor:m===e.id?"var(--border-focus)":"var(--primary)",fontSize:"0.75rem",fontWeight:600,color:"#fff",cursor:"pointer"},children:m===e.id?"Connected":"Open Console"})]})]})]},e.id))})]}),m&&"workspace-terminal"!==m&&(0,t.jsxs)("section",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border-focus)",marginTop:"1rem"},children:[(0,t.jsxs)("div",{className:a.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(109, 40, 217, 0.08)",padding:"0.5rem 1rem"},children:[(0,t.jsxs)("span",{style:{fontWeight:600,fontSize:"0.85rem",display:"flex",alignItems:"center",gap:"0.5rem"},children:["🖥️ Console — ",e.find(e=>e.id===m)?.name]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.find(e=>e.id===m)?.status==="stopped"&&(0,t.jsx)("button",{onClick:async()=>{try{let t=e.find(e=>e.id===m),r=t&&("claude"===t.type||"claude-docker"===t.type||"claude-ssh"===t.type),s=!1;r&&(s=window.confirm("Would you like to resume your previous Claude session?"));let a=await fetch("/api/sessions/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:m,resume:s})});if(a.ok)await $();else{let e=await a.json();alert(e.error||"Failed to restart session.")}}catch(e){console.error("Failed to restart session:",e)}},style:{padding:"0.15rem 0.4rem",borderRadius:"4px",border:"1px solid #eab308",backgroundColor:"rgba(234, 179, 8, 0.15)",color:"#eab308",fontSize:"0.65rem",fontWeight:600,cursor:"pointer"},children:"⚡ Restart"}),(0,t.jsx)("button",{onClick:()=>f(null),style:{border:"none",background:"none",color:"var(--muted)",cursor:"pointer",fontSize:"0.75rem"},children:"✖"})]})]}),(0,t.jsx)(o,{sessionId:m,wsPort:E})]})]}),(0,t.jsxs)("div",{className:a.default.sidePanel,children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Execution Environments"}),(0,t.jsxs)("div",{className:a.default.envGrid,children:[(0,t.jsxs)("div",{className:a.default.envRow,style:{padding:"0.5rem 0.75rem"},children:[(0,t.jsx)("span",{className:a.default.envName,children:"💻 Local Host"}),(0,t.jsx)("span",{className:a.default.envStatus,style:{color:"var(--success)"},children:"Active"})]}),(0,t.jsxs)("div",{className:a.default.envRow,style:{opacity:A?1:.6,padding:"0.5rem 0.75rem"},children:[(0,t.jsx)("span",{className:a.default.envName,children:"🐳 Docker Sandbox"}),(0,t.jsx)("span",{className:a.default.envStatus,style:{color:A?"var(--success)":"var(--muted)"},children:A?"Active":"Not Mounted"})]}),(0,t.jsxs)("div",{className:a.default.envRow,style:{opacity:B?1:.6,padding:"0.5rem 0.75rem"},children:[(0,t.jsx)("span",{className:a.default.envName,children:"🌐 Remote VM (SSH)"}),(0,t.jsx)("span",{className:a.default.envStatus,style:{color:B?"var(--success)":"var(--muted)"},children:B?"Active":"Offline"})]})]})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Saved Configurations"}),(0,t.jsx)("div",{className:"card",style:{padding:"1rem",display:"flex",flexDirection:"column",gap:"0.75rem"},children:0===D.length?(0,t.jsx)("p",{style:{color:"var(--muted)",fontSize:"0.8rem",textAlign:"center",margin:"1rem 0"},children:"No configuration templates saved yet. Save a template from the Claude/Aider launch wizards."}):(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",maxHeight:"200px",overflowY:"auto"},children:D.map(e=>(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(255, 255, 255, 0.02)",padding:"0.5rem",borderRadius:"6px",border:"1px solid var(--border)"},children:[(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.15rem",minWidth:0},children:[(0,t.jsx)("span",{style:{fontSize:"0.8rem",fontWeight:600,color:"var(--foreground)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name}),(0,t.jsx)("span",{style:{fontSize:"0.65rem",color:"var(--muted)",textTransform:"uppercase"},children:e.type})]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.25rem"},children:[(0,t.jsx)("button",{onClick:()=>H(e),disabled:h,style:{padding:"0.2rem 0.4rem",borderRadius:"4px",backgroundColor:"var(--primary)",color:"#fff",border:"none",fontSize:"0.7rem",cursor:"pointer"},children:"Launch"}),(0,t.jsx)("button",{onClick:()=>G(e.id),style:{padding:"0.2rem 0.4rem",borderRadius:"4px",backgroundColor:"transparent",color:"var(--danger)",border:"1px solid var(--danger)",fontSize:"0.7rem",cursor:"pointer"},children:"Delete"})]})]},e.id))})})]}),(0,t.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:[(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{C(!1),S(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none",padding:"0.6rem",fontSize:"0.8rem",flex:1},children:"🤖 Claude Local"}),(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{C(!0),S(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(170, 72%, 40%) 0%, hsl(195, 100%, 40%) 100%)",border:"none",padding:"0.6rem",fontSize:"0.8rem",flex:1},children:"🐳 Claude Docker"})]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{_(!1),j(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none",padding:"0.6rem",fontSize:"0.8rem",flex:1},children:"🐍 Aider Local"}),(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{_(!0),j(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(195, 100%, 40%) 0%, hsl(262, 80%, 55%) 100%)",border:"none",padding:"0.6rem",fontSize:"0.8rem",flex:1},children:"🐳 Aider Docker"})]}),(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>y(!0),disabled:h,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none",padding:"0.6rem",fontSize:"0.8rem"},children:"🌐 Connect Remote SSH"})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Workspace Terminal"}),(0,t.jsxs)("div",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border)",padding:0},children:[(0,t.jsx)("div",{className:a.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(255, 255, 255, 0.02)",padding:"0.4rem 0.75rem"},children:(0,t.jsxs)("span",{style:{fontWeight:600,fontSize:"0.75rem"},children:["💻 Local Shell (CWD: ",N.split(/[/\\]/).pop()||"root",")"]})}),(0,t.jsx)(o,{sessionId:"workspace-terminal",height:"180px",wsPort:E})]})]}),(0,t.jsxs)("section",{className:"card",style:{padding:"1rem",display:"flex",flexDirection:"column",gap:"0.5rem"},children:[(0,t.jsx)("h3",{style:{fontSize:"0.9rem",fontWeight:700,margin:0},children:"Quick Actions"}),(0,t.jsxs)("ul",{style:{listStyle:"none",fontSize:"0.75rem",display:"flex",flexDirection:"column",gap:"0.35rem",color:"var(--muted)",padding:0,margin:0},children:[(0,t.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:"Configure API Keys"}),(0,t.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,t.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:"Edit rules templates"}),(0,t.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,t.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:"Inspect process locks"}),(0,t.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]})]})]})]})]}),(0,t.jsxs)("footer",{className:a.default.footer,children:[(0,t.jsxs)("span",{children:["NeuralLoom v",W," — Experimental AI Orchestrator Bridge"]}),(0,t.jsxs)("span",{children:["Directory: ",N||"Loading..."]})]}),x&&(0,t.jsx)(d,{onClose:()=>y(!1),onConfirmLaunch:()=>{y(!1),U("claude-ssh")}}),b&&(0,t.jsx)(c,{onClose:()=>j(!1),isDocker:v,onConfirmLaunch:(e,t,r)=>{j(!1),U(v?"aider-docker":"aider",e,t,r)}}),w&&(0,t.jsx)(u,{onClose:()=>S(!1),isDocker:k,onConfirmLaunch:(e,t,r)=>{S(!1),U(k?"claude-docker":"claude",e,t,r)}})]})}])},45344,e=>{e.v(t=>Promise.all(["static/chunks/03g6xpslyid3~.js","static/chunks/14~-ojwsxf~oe.js","static/chunks/0ga14ztvrhau2.css"].map(t=>e.l(t))).then(()=>t(37314)))},39429,e=>{e.v(t=>Promise.all(["static/chunks/16w4~t4h7gk13.js"].map(t=>e.l(t))).then(()=>t(1985)))},56915,e=>{e.v(t=>Promise.all(["static/chunks/0lnobx4eh3~-_.js"].map(t=>e.l(t))).then(()=>t(99026)))},78716,e=>{e.v(t=>Promise.all(["static/chunks/0xhaghhxllgzs.js"].map(t=>e.l(t))).then(()=>t(9949)))},33789,e=>{e.v(t=>Promise.all(["static/chunks/15sigqif_v.mu.js"].map(t=>e.l(t))).then(()=>t(20032)))},78003,e=>{e.v(t=>Promise.all(["static/chunks/0gy2rolwxzjl8.js","static/chunks/14~-ojwsxf~oe.js","static/chunks/11c6f8pb_6s91.js","static/chunks/0ga14ztvrhau2.css"].map(t=>e.l(t))).then(()=>t(97722)))}]);
11
+ ${e.message}`)}},e4=async()=>{if(eW.trim()&&ex){eI(!0),eP(null),eq(null);try{let t=await fetch("/api/sql/query",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sql:eW.trim(),root:e})}),r=await t.json();t.ok&&r.success?(eq({rows:r.rows||[],fields:r.fields||[],durationMs:r.durationMs||0,affectedRows:r.affectedRows}),(eW.toLowerCase().includes("create table")||eW.toLowerCase().includes("drop table")||eW.toLowerCase().includes("alter table"))&&e0()):eP(r.error||"Failed to execute query.")}catch(e){eP(e.message||"An unexpected error occurred during execution.")}finally{eI(!1)}}},e3=eb?eh.global.find(e=>e.id===ex):eh.workspace.find(e=>e.id===ex);return(0,t.jsxs)("div",{style:a,children:[(0,t.jsx)("div",{style:{...n,width:ev?"220px":"0px",borderRight:ev?"1px solid var(--border)":"none",overflow:"hidden",transition:"all 0.25s cubic-bezier(0.4, 0, 0.2, 1)"},children:ev&&(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",minWidth:"220px",minHeight:0},children:[(0,t.jsxs)("div",{style:l,children:[(0,t.jsxs)("div",{style:o,children:[(0,t.jsx)("span",{style:i,children:"Connections"}),(0,t.jsx)("button",{style:d,onClick:()=>{eX(null),eQ({id:"",name:"",type:"sqlite",filepath:"./dev.db",host:"localhost",port:5432,database:"postgres",username:"postgres",password:"",ssl:!1,readOnly:!0}),eG(!1),eU(!0)},title:"Add Database Connection Profile",children:"➕ Add"})]}),(0,t.jsxs)("div",{style:c,children:[0===eh.global.length&&0===eh.workspace.length&&(0,t.jsx)("div",{style:b,children:"No connections configured. Add one to start."}),eh.workspace.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:u,children:"WORKSPACE CONNECTIONS"}),eh.workspace.map(e=>(0,t.jsxs)("div",{style:{...p,...ex===e.id&&!eb?m:{}},onClick:()=>e5(e.id,!1),children:[(0,t.jsxs)("div",{style:f,children:[(0,t.jsxs)("span",{style:h,children:["📁 ",e.name]}),(0,t.jsx)("span",{style:g,children:e.type})]}),(0,t.jsx)("button",{style:x,onClick:t=>{t.stopPropagation(),e6(e.id,!1)},children:"✖"})]},e.id))]}),eh.global.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:u,children:"GLOBAL CONNECTIONS"}),eh.global.map(e=>(0,t.jsxs)("div",{style:{...p,...ex===e.id&&eb?m:{}},onClick:()=>e5(e.id,!0),children:[(0,t.jsxs)("div",{style:f,children:[(0,t.jsxs)("span",{style:h,children:["🌐 ",e.name]}),(0,t.jsx)("span",{style:g,children:e.type})]}),(0,t.jsx)("button",{style:x,onClick:t=>{t.stopPropagation(),e6(e.id,!0)},children:"✖"})]},e.id))]})]})]}),(0,t.jsxs)("div",{style:{...l,flex:1,borderTop:"1px solid var(--border)"},children:[(0,t.jsxs)("div",{style:o,children:[(0,t.jsx)("span",{style:i,children:"Schema Tables"}),eE&&(0,t.jsx)("span",{style:es})]}),(0,t.jsxs)("div",{style:y,children:[!ex&&(0,t.jsx)("div",{style:b,children:"Select an active connection to view tables."}),ex&&0===ew.length&&!eE&&(0,t.jsx)("div",{style:b,children:"No tables found in database schema."}),ew.map(e=>(0,t.jsxs)("div",{style:j,children:[(0,t.jsxs)("div",{style:v,onClick:()=>e1(e.name),children:[(0,t.jsx)("span",{style:_,children:"view"===e.type?"👁️":"📊"}),(0,t.jsx)("span",{style:w,children:e.name}),(0,t.jsx)("span",{style:S,children:ek===e.name?"▼":"▶"})]}),ek===e.name&&eN[e.name]&&(0,t.jsx)("div",{style:k,children:eN[e.name].map(e=>(0,t.jsxs)("div",{style:C,children:[(0,t.jsx)("span",{style:N,children:e.isPrimaryKey?"🔑":e.isForeignKey?"🔗":"▫"}),(0,t.jsx)("span",{style:R,title:e.type,children:e.name}),(0,t.jsx)("span",{style:E,children:e.type.toLowerCase().substring(0,12)})]},e.name))})]},e.name))]})]})]})}),(0,t.jsxs)("div",{style:L,children:[(0,t.jsxs)("div",{style:W,children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>e_(!ev),style:{background:"rgba(255, 255, 255, 0.05)",border:"1px solid var(--border)",borderRadius:"6px",color:"var(--muted)",cursor:"pointer",padding:"0.25rem 0.5rem",fontSize:"0.75rem",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.15s ease"},title:ev?"Collapse Connections List":"Expand Connections List",children:ev?"◀ Collapse":"📂 Schema Connections"}),(0,t.jsx)("span",{style:O,children:"Active Connection:"}),e3?(0,t.jsxs)("span",{style:T,children:[eb?"🌐":"📁"," ",e3.name," (",e3.type,")",e3.readOnly&&(0,t.jsx)("span",{style:I,children:"Read-Only"})]}):(0,t.jsx)("span",{style:{...T,color:"var(--danger)"},children:"No Connection Selected"})]}),(0,t.jsx)("button",{style:{...D,opacity:!ex||eT?.6:1,cursor:!ex||eT?"not-allowed":"pointer"},onClick:e4,disabled:!ex||eT,children:eT?"⌛ Running...":"⚡ Execute Query (F5)"})]}),(0,t.jsx)("div",{style:P,children:(0,t.jsx)("textarea",{style:z,value:eW,onChange:e=>eO(e.target.value),placeholder:"Write your SQL query script here...",onKeyDown:e=>{("F5"===e.key||e.ctrlKey&&"Enter"===e.key)&&(e.preventDefault(),e4())}})}),(0,t.jsxs)("div",{style:q,children:[eD&&(0,t.jsxs)("div",{style:A,children:[(0,t.jsx)("h4",{style:{margin:"0 0 0.5rem 0",color:"var(--danger)"},children:"⚠️ Execution Error"}),(0,t.jsx)("pre",{style:B,children:eD}),eD.includes("not installed")&&(0,t.jsxs)("div",{style:$,children:[(0,t.jsx)("p",{style:{margin:"0 0 0.5rem 0"},children:"To resolve this, run this installer command in your workspace terminal:"}),(0,t.jsx)("code",{style:F,children:e3?.type==="sqlite"?"npm install better-sqlite3":e3?.type==="postgres"?"npm install pg":e3?.type==="mysql"?"npm install mysql2":"npm install mssql"})]})]}),ez&&(0,t.jsxs)("div",{style:M,children:[(0,t.jsxs)("div",{style:U,children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[(0,t.jsxs)("span",{children:["Query completed."," ",void 0!==ez.affectedRows?`Affected rows: ${ez.affectedRows}`:`Returned ${ez.rows.length} rows`]}),(0,t.jsxs)("span",{children:["Duration: ",ez.durationMs,"ms"]})]}),ez.rows.length>0&&(0,t.jsxs)("div",{style:{display:"flex",gap:"0.4rem"},children:[(0,t.jsx)("button",{onClick:()=>{if(ez&&0!==ez.rows.length)try{let e=ez.fields.join(","),t=ez.rows.map(e=>ez.fields.map(t=>{let r=e[t];if(null===r)return"NULL";let s=String(r);return s.includes(",")||s.includes('"')||s.includes("\n")||s.includes("\r")?`"${s.replace(/"/g,'""')}"`:s}).join(",")),r=[e,...t].join("\r\n"),s=new Blob([r],{type:"text/csv;charset=utf-8;"}),a=URL.createObjectURL(s),n=document.createElement("a");n.setAttribute("href",a),n.setAttribute("download",`query-results-${Date.now()}.csv`),document.body.appendChild(n),n.click(),document.body.removeChild(n)}catch(e){console.error("Export CSV failed:",e),alert("Failed to export as CSV")}},style:K,children:"📥 Export CSV"}),(0,t.jsx)("button",{onClick:()=>{if(ez&&0!==ez.rows.length)try{let e=JSON.stringify(ez.rows,null,2),t=new Blob([e],{type:"application/json;charset=utf-8;"}),r=URL.createObjectURL(t),s=document.createElement("a");s.setAttribute("href",r),s.setAttribute("download",`query-results-${Date.now()}.json`),document.body.appendChild(s),s.click(),document.body.removeChild(s)}catch(e){console.error("Export JSON failed:",e),alert("Failed to export as JSON")}},style:K,children:"📥 Export JSON"})]})]}),ez.rows.length>0?(0,t.jsx)("div",{style:H,children:(0,t.jsxs)("table",{style:G,children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{children:ez.fields.map(e=>(0,t.jsx)("th",{style:J,children:e},e))})}),(0,t.jsx)("tbody",{children:ez.rows.map((e,r)=>(0,t.jsx)("tr",{style:r%2==0?X:Z,children:ez.fields.map(s=>{let a=eA&&eA.rowIndex===r&&eA.field===s,n=e$&&e$.rowIndex===r&&e$.field===s&&"saving"===e$.status,l=e$&&e$.rowIndex===r&&e$.field===s&&"success"===e$.status,o=e$&&e$.rowIndex===r&&e$.field===s&&"error"===e$.status,i={...Q,...V};return n?i={...i,backgroundColor:"rgba(168, 85, 247, 0.15)"}:l?i={...i,backgroundColor:"rgba(16, 185, 129, 0.25)"}:o&&(i={...i,backgroundColor:"rgba(239, 68, 68, 0.25)"}),(0,t.jsx)("td",{style:i,onDoubleClick:()=>{e3?.readOnly?alert("Database connection is Read-Only. Editing is disabled."):eB({rowIndex:r,field:s,value:null===e[s]?"NULL":String(e[s])})},className:"db-cell",title:"Double click to edit cell",children:a?(0,t.jsx)("input",{style:Y,value:eA.value,autoFocus:!0,onChange:e=>eB({...eA,value:e.target.value}),onKeyDown:async t=>{if("Enter"===t.key){t.preventDefault();let a=eA.value;eB(null),a!==(null===e[s]?"NULL":String(e[s]))&&await e7(r,s,a,e[s])}else"Escape"===t.key&&eB(null)},onBlur:async()=>{let t=eA.value;eB(null),t!==(null===e[s]?"NULL":String(e[s]))&&await e7(r,s,t,e[s])}}):null===e[s]?"NULL":"object"==typeof e[s]?JSON.stringify(e[s]):String(e[s])},s)})},r))})]})}):void 0===ez.affectedRows&&(0,t.jsx)("div",{style:ee,children:"Query executed successfully, but returned 0 results."})]}),!eD&&!ez&&!eT&&(0,t.jsx)("div",{style:ee,children:"Write a query script and click Execute to view table records."}),eT&&(0,t.jsxs)("div",{style:et,children:[(0,t.jsx)("span",{style:er}),(0,t.jsx)("span",{style:{color:"var(--muted)"},children:"Running database statement..."})]})]})]}),eM&&"u">typeof document&&(0,s.createPortal)((0,t.jsx)("div",{style:ea,children:(0,t.jsxs)("div",{style:en,children:[(0,t.jsxs)("h3",{style:{margin:"0 0 1rem 0",display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:"🔌 Add Database Profile"}),(0,t.jsx)("span",{style:{cursor:"pointer"},onClick:()=>eU(!1),children:"✖"})]}),(0,t.jsxs)("form",{onSubmit:e8,children:[(0,t.jsxs)("div",{style:el,children:[(0,t.jsx)("label",{style:eo,children:"Profile Name"}),(0,t.jsx)("input",{style:ei,type:"text",required:!0,value:eJ.name,onChange:e=>eQ(t=>({...t,name:e.target.value})),placeholder:"e.g. Local Postgres, Dev SQLite"})]}),(0,t.jsxs)("div",{style:el,children:[(0,t.jsx)("label",{style:eo,children:"Scope Level"}),(0,t.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"radio",checked:!eH,onChange:()=>eG(!1)}),"Workspace Local"]}),(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"radio",checked:eH,onChange:()=>eG(!0)}),"Global User Profile"]})]})]}),(0,t.jsxs)("div",{style:el,children:[(0,t.jsx)("label",{style:eo,children:"Database Type"}),(0,t.jsxs)("select",{style:ed,value:eJ.type,onChange:e=>{let t=e.target.value,r=5432;"mysql"===t&&(r=3306),"mssql"===t&&(r=1433),eQ(e=>({...e,type:t,filepath:"sqlite"===t?"./dev.db":void 0,port:"sqlite"!==t?r:void 0,database:"sqlite"===t?void 0:"mssql"===t?"master":"postgres"===t?"postgres":"",username:"sqlite"===t?void 0:"mssql"===t?"sa":"postgres"===t?"postgres":"root"}))},children:[(0,t.jsx)("option",{value:"sqlite",children:"SQLite (Local File)"}),(0,t.jsx)("option",{value:"postgres",children:"PostgreSQL"}),(0,t.jsx)("option",{value:"mysql",children:"MySQL"}),(0,t.jsx)("option",{value:"mssql",children:"Microsoft SQL Server"})]})]}),"sqlite"===eJ.type?(0,t.jsxs)("div",{style:el,children:[(0,t.jsx)("label",{style:eo,children:"Database File Path"}),(0,t.jsx)("input",{style:ei,type:"text",required:!0,value:eJ.filepath||"",onChange:e=>eQ(t=>({...t,filepath:e.target.value})),placeholder:"Relative (e.g. ./data/dev.db) or Absolute path"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,t.jsxs)("div",{style:{...el,flex:3},children:[(0,t.jsx)("label",{style:eo,children:"Host IP Address"}),(0,t.jsx)("input",{style:ei,type:"text",required:!0,value:eJ.host||"",onChange:e=>eQ(t=>({...t,host:e.target.value})),placeholder:"localhost or IP"})]}),(0,t.jsxs)("div",{style:{...el,flex:1},children:[(0,t.jsx)("label",{style:eo,children:"Port"}),(0,t.jsx)("input",{style:ei,type:"number",required:!0,value:eJ.port||0,onChange:e=>eQ(t=>({...t,port:parseInt(e.target.value)}))})]})]}),(0,t.jsxs)("div",{style:el,children:[(0,t.jsx)("label",{style:eo,children:"Database Name"}),(0,t.jsx)("input",{style:ei,type:"text",required:!0,value:eJ.database||"",onChange:e=>eQ(t=>({...t,database:e.target.value}))})]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,t.jsxs)("div",{style:{...el,flex:1},children:[(0,t.jsx)("label",{style:eo,children:"Username"}),(0,t.jsx)("input",{style:ei,type:"text",required:!0,value:eJ.username||"",onChange:e=>eQ(t=>({...t,username:e.target.value}))})]}),(0,t.jsxs)("div",{style:{...el,flex:1},children:[(0,t.jsx)("label",{style:eo,children:"Password"}),(0,t.jsx)("input",{style:ei,type:"password",value:eJ.password||"",onChange:e=>eQ(t=>({...t,password:e.target.value}))})]})]}),("postgres"===eJ.type||"mssql"===eJ.type)&&(0,t.jsx)("div",{style:el,children:(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"checkbox",checked:!!eJ.ssl,onChange:e=>eQ(t=>({...t,ssl:e.target.checked}))}),"Require SSL Secure Connection"]})})]}),(0,t.jsx)("div",{style:el,children:(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"checkbox",checked:!!eJ.readOnly,onChange:e=>eQ(t=>({...t,readOnly:e.target.checked}))}),"Enforce Read-Only Connection (Disable mutations)"]})}),eV&&(0,t.jsx)("div",{style:{...ec,backgroundColor:eV.success?"rgba(16, 185, 129, 0.12)":"rgba(239, 68, 68, 0.12)",border:eV.success?"1px solid var(--success)":"1px solid var(--danger)",color:eV.success?"var(--success)":"var(--danger)"},children:eV.message}),(0,t.jsxs)("div",{style:eu,children:[(0,t.jsx)("button",{type:"button",style:ep,onClick:e2,children:"🔍 Test Connection"}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,t.jsx)("button",{type:"button",style:em,onClick:()=>eU(!1),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",style:ef,disabled:eK,children:eK?"Saving...":"Save Profile"})]})]})]})]})}),document.body)]})}])},20897,e=>{e.v({activeBorder:"page-module___8aEwW__activeBorder",agentBadge:"page-module___8aEwW__agentBadge",agentCard:"page-module___8aEwW__agentCard",agentGrid:"page-module___8aEwW__agentGrid",agentHeader:"page-module___8aEwW__agentHeader",agentName:"page-module___8aEwW__agentName",agentStateBadge:"page-module___8aEwW__agentStateBadge",ansiCyan:"page-module___8aEwW__ansiCyan",ansiGreen:"page-module___8aEwW__ansiGreen",ansiMagenta:"page-module___8aEwW__ansiMagenta",ansiRed:"page-module___8aEwW__ansiRed",ansiYellow:"page-module___8aEwW__ansiYellow",cardBody:"page-module___8aEwW__cardBody",container:"page-module___8aEwW__container",containerActive:"page-module___8aEwW__containerActive",contextDetails:"page-module___8aEwW__contextDetails",contextItem:"page-module___8aEwW__contextItem",contextList:"page-module___8aEwW__contextList",contextMeta:"page-module___8aEwW__contextMeta",contextTitle:"page-module___8aEwW__contextTitle",dashboardGrid:"page-module___8aEwW__dashboardGrid",envGrid:"page-module___8aEwW__envGrid",envName:"page-module___8aEwW__envName",envRow:"page-module___8aEwW__envRow",envStatus:"page-module___8aEwW__envStatus",footer:"page-module___8aEwW__footer",header:"page-module___8aEwW__header",logoArea:"page-module___8aEwW__logoArea",mainPanel:"page-module___8aEwW__mainPanel",pulse:"page-module___8aEwW__pulse","pulse-attention":"page-module___8aEwW__pulse-attention","pulse-thinking":"page-module___8aEwW__pulse-thinking",pulseDot:"page-module___8aEwW__pulseDot",quickLaunchBtn:"page-module___8aEwW__quickLaunchBtn",sectionTitle:"page-module___8aEwW__sectionTitle",sidePanel:"page-module___8aEwW__sidePanel","state-complete":"page-module___8aEwW__state-complete","state-idle":"page-module___8aEwW__state-idle","state-needs-input":"page-module___8aEwW__state-needs-input","state-thinking":"page-module___8aEwW__state-thinking",statusIndicator:"page-module___8aEwW__statusIndicator",stoppedBadge:"page-module___8aEwW__stoppedBadge",subtitle:"page-module___8aEwW__subtitle",terminalContainer:"page-module___8aEwW__terminalContainer",terminalInput:"page-module___8aEwW__terminalInput",terminalInputArea:"page-module___8aEwW__terminalInputArea",terminalLine:"page-module___8aEwW__terminalLine",terminalSendBtn:"page-module___8aEwW__terminalSendBtn",title:"page-module___8aEwW__title"})},52683,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(70703),a=e.i(20897),n=e.i(66381);let l=e=>"mock"===e?"🧪":e.includes("-docker")?"🐳":e.includes("-ssh")?"🌐":"💻",o=(0,s.default)(()=>e.A(45344),{loadableGenerated:{modules:[37314]},ssr:!1,loading:()=>(0,t.jsx)("div",{style:{height:"400px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#05070a",color:"var(--muted)",border:"1px solid var(--border)",borderBottomLeftRadius:"12px",borderBottomRightRadius:"12px"},children:(0,t.jsx)("span",{children:"Initializing terminal emulator..."})})}),i=(0,s.default)(()=>e.A(39429),{loadableGenerated:{modules:[1985]},ssr:!1,loading:()=>(0,t.jsx)("div",{style:{height:"280px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--card)",border:"1px solid var(--border)",borderRadius:"12px",marginTop:"1.5rem"},children:(0,t.jsx)("span",{style:{color:"var(--muted)"},children:"Initializing prompt editor..."})})}),d=(0,s.default)(()=>e.A(56915),{loadableGenerated:{modules:[99026]},ssr:!1}),c=(0,s.default)(()=>e.A(78716),{loadableGenerated:{modules:[9949]},ssr:!1}),u=(0,s.default)(()=>e.A(33789),{loadableGenerated:{modules:[20032]},ssr:!1}),p=(0,s.default)(()=>e.A(78003),{loadableGenerated:{modules:[97722]},ssr:!1});e.s(["default",0,function(){let[e,s]=(0,r.useState)([]),[m,f]=(0,r.useState)(null),[h,g]=(0,r.useState)(!1),[x,y]=(0,r.useState)(!1),[b,j]=(0,r.useState)(!1),[v,_]=(0,r.useState)(!1),[w,S]=(0,r.useState)(!1),[k,C]=(0,r.useState)(!1),[N,R]=(0,r.useState)(""),[E,L]=(0,r.useState)(9601),[W,O]=(0,r.useState)("0.2.19"),[T,I]=(0,r.useState)(null),[D,P]=(0,r.useState)([]),z=e.filter(e=>"workspace-terminal"!==e.id),q=e.find(e=>e.id===m),A=z.some(e=>("claude-docker"===e.type||"aider-docker"===e.type)&&"running"===e.status),B=z.some(e=>"claude-ssh"===e.type&&"running"===e.status),$=async()=>{try{let e=await fetch("/api/sessions"),t=await e.json();t.sessions&&s(t.sessions),t.wsPort&&L(t.wsPort),t.originalCwd&&R(t.originalCwd),t.version&&O(t.version)}catch(e){console.error("Failed to fetch sessions:",e)}},F=async()=>{try{let e=await fetch("/api/recents");if(e.ok){let t=await e.json();t.success&&t.recents&&t.recents.lastSession&&I(t.recents.lastSession)}}catch(e){console.error("Failed to fetch recents:",e)}},M=async()=>{try{let e=await fetch("/api/configs");if(e.ok){let t=await e.json();t.configs&&P(t.configs)}}catch(e){console.error("Failed to fetch configs:",e)}};(0,r.useEffect)(()=>{(async()=>{await $(),await F(),await M()})(),"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").then(e=>console.log("Service Worker registered:",e.scope)).catch(e=>console.error("Service Worker registration failed:",e));let e=setInterval($,4e3);return()=>clearInterval(e)},[]);let U=async(e,t,r,s)=>{g(!0);try{let a=t;a||("claude"===e?a="Claude Local":"claude-docker"===e?a="Claude Docker":"claude-ssh"===e?a="Claude SSH":"aider"===e?a="Aider Local":"aider-docker"===e?a="Aider Docker":"mock"===e&&(a="Mock Session"));let n={type:e,name:a,workspaceRoot:r,scopedDirs:s};if(("aider"===e||"aider-docker"===e)&&!r)try{let e=await fetch("/api/context/aider");if(e.ok){let t=await e.json();t.success&&t.config&&(n.workspaceRoot=t.config.workspaceRoot,n.scopedDirs=t.config.scopedDirs)}}catch(e){console.error("Failed to load aider configuration before launch:",e)}let l=await fetch("/api/sessions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),o=await l.json();o.success&&(await $(),await M(),f(o.session.id),I({type:e,name:a,workspaceRoot:r,scopedDirs:s}))}catch(e){console.error("Failed to launch session:",e)}finally{g(!1)}},H=async e=>{g(!0);try{let t=await fetch("/api/sessions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e.type,name:e.name,workspaceRoot:e.workspaceRoot,scopedDirs:e.scopedDirs})}),r=await t.json();r.success?(await $(),f(r.session.id)):alert(r.error||"Failed to launch configuration.")}catch(e){console.error(e),alert("Network error: failed to launch configuration.")}finally{g(!1)}},G=async e=>{if(window.confirm("Are you sure you want to delete this configuration template?"))try{(await fetch("/api/configs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",id:e})})).ok?await M():alert("Failed to delete configuration template.")}catch(e){console.error(e),alert("Network error: failed to delete configuration template.")}},J=async(e,t=!1)=>{try{let r=await fetch("/api/sessions/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,delete:t})});(await r.json()).success&&(t&&m===e&&f(null),await $())}catch(e){console.error("Failed to stop session:",e)}};return(0,t.jsxs)("div",{className:`${a.default.container} ${q?a.default.containerActive:""}`,children:[(0,t.jsxs)("header",{className:a.default.header,children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1.5rem"},children:[(0,t.jsx)("img",{src:"/logo.png",alt:"NeuralLoom Logo",style:{width:"160px",height:"160px",borderRadius:"16px",objectFit:"contain"}}),(0,t.jsxs)("div",{className:a.default.logoArea,children:[(0,t.jsx)("h1",{className:a.default.title,style:{margin:0,lineHeight:1.1},children:"NeuralLoom"}),(0,t.jsx)("span",{className:a.default.subtitle,children:"Unified AI Orchestrator & Context Bridge"})]})]}),(0,t.jsxs)("div",{className:a.default.statusIndicator,children:[(0,t.jsx)("span",{className:a.default.pulseDot}),(0,t.jsx)("span",{children:"Orchestrator Online"})]})]}),q?(0,t.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:(0,t.jsx)(p,{sessionId:q.id,workspaceRoot:q.workspaceRoot||"",scopedDirs:q.scopedDirs||[],onClose:()=>f(null),sessions:e,onSwitchSession:e=>f(e),onRefreshSessions:$,wsPort:E})}):(0,t.jsxs)("div",{className:a.default.dashboardGrid,children:[(0,t.jsxs)("div",{className:a.default.mainPanel,children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Built-in Database Explorer & SQL Client"}),(0,t.jsx)("div",{className:"card",style:{padding:0,overflow:"hidden",height:"450px",border:"1px solid var(--border)"},children:(0,t.jsx)(n.default,{workspaceRoot:N||""})})]}),(0,t.jsxs)("section",{style:{marginTop:"1.5rem"},children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Shared Context Hub & Slash Commands"}),(0,t.jsxs)("div",{className:a.default.contextList,children:[(0,t.jsxs)("div",{className:`${a.default.contextItem} card`,children:[(0,t.jsxs)("div",{className:a.default.contextMeta,children:[(0,t.jsx)("span",{className:a.default.contextTitle,children:"Staged Context & System Rules (/ccc)"}),(0,t.jsx)("span",{className:a.default.contextDetails,children:"Compiles AGENTS.md guidelines and files map."})]}),(0,t.jsx)("button",{onClick:async()=>{m&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:m,command:"/ccc"})})},disabled:!m,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.75rem",fontWeight:600,opacity:m?1:.5,cursor:m?"pointer":"not-allowed"},children:"🚀 Mount (/ccc)"})]}),(0,t.jsxs)("div",{className:`${a.default.contextItem} card`,children:[(0,t.jsxs)("div",{className:a.default.contextMeta,children:[(0,t.jsx)("span",{className:a.default.contextTitle,children:"Staged Developer Prompt (/ccp)"}),(0,t.jsx)("span",{className:a.default.contextDetails,children:"Executes prompt in .ai/neural-loom/cprompt.md."})]}),(0,t.jsx)("button",{onClick:async()=>{m&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:m,command:"/ccp"})})},disabled:!m,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--success)",backgroundColor:"transparent",color:"var(--success)",fontSize:"0.75rem",fontWeight:600,opacity:m?1:.5,cursor:m?"pointer":"not-allowed"},children:"⚡ Run (/ccp)"})]})]}),(0,t.jsx)(i,{})]})]}),(0,t.jsxs)("div",{className:a.default.mainPanel,children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Active AI Agents"}),0===z.length?(0,t.jsxs)("div",{className:"card",style:{padding:"3rem 1.5rem",textAlign:"center"},children:[(0,t.jsx)("p",{style:{color:"var(--muted)",marginBottom:"1.5rem"},children:"No active agent sessions. Launch a Claude or Aider agent session to begin."}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.75rem",flexDirection:"column"},children:[T&&(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{U(T.type,T.name,T.workspaceRoot,T.scopedDirs)},disabled:h,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none"},title:`Re-launch: ${T.name||T.type}`,children:"⚡ Re-launch Last Session"}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{C(!1),S(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none",flex:1},children:"Launch Claude"}),(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{_(!1),j(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none",flex:1},children:"Launch Aider"})]})]}),(0,t.jsxs)("div",{style:{marginTop:"1.5rem",fontSize:"0.75rem",color:"var(--muted)"},children:["Need a simulator?"," ",(0,t.jsx)("span",{onClick:()=>U("mock"),style:{color:"var(--primary)",cursor:"pointer",textDecoration:"underline"},children:"Start mock playground"})]})]}):(0,t.jsx)("div",{className:a.default.agentGrid,children:z.map(e=>(0,t.jsxs)("div",{className:`${a.default.agentCard} card ${m===e.id?a.default.activeBorder:""}`,children:[(0,t.jsxs)("div",{className:a.default.agentHeader,children:[(0,t.jsx)("span",{className:a.default.agentName,children:e.name}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.35rem",alignItems:"center"},children:["running"===e.status&&e.agentState&&(0,t.jsxs)("span",{className:`${a.default.agentStateBadge} ${a.default["state-"+e.agentState]}`,children:["thinking"===e.agentState&&`${l(e.type)} 💭`,"needs-input"===e.agentState&&`${l(e.type)} ⚠️`,"complete"===e.agentState&&`${l(e.type)} ✅`,"idle"===e.agentState&&`${l(e.type)} 💤`]}),(0,t.jsx)("span",{className:`${a.default.agentBadge} ${"stopped"===e.status?a.default.stoppedBadge:""}`,children:e.status})]})]}),(0,t.jsxs)("div",{className:a.default.cardBody,style:{padding:"1rem"},children:[(0,t.jsxs)("p",{style:{fontSize:"0.8rem",color:"var(--muted)",margin:0},children:["ID: ",(0,t.jsx)("code",{style:{fontSize:"0.72rem"},children:e.id.substring(0,8)})," | Type: ",e.type,(0,t.jsx)("br",{}),"Logs: ",e.logsCount," lines"]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.75rem"},children:["running"===e.status?(0,t.jsx)("button",{onClick:()=>J(e.id,!1),style:{flex:1,padding:"0.35rem",borderRadius:"6px",border:"1px solid var(--danger)",backgroundColor:"transparent",fontSize:"0.75rem",color:"var(--danger)",cursor:"pointer"},children:"Stop"}):(0,t.jsx)("button",{onClick:()=>J(e.id,!0),style:{flex:1,padding:"0.35rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"transparent",fontSize:"0.75rem",color:"var(--muted)",cursor:"pointer"},children:"Delete"}),(0,t.jsx)("button",{onClick:()=>f(e.id),style:{flex:2,padding:"0.35rem",borderRadius:"6px",border:"none",backgroundColor:m===e.id?"var(--border-focus)":"var(--primary)",fontSize:"0.75rem",fontWeight:600,color:"#fff",cursor:"pointer"},children:m===e.id?"Connected":"Open Console"})]})]})]},e.id))})]}),m&&"workspace-terminal"!==m&&(0,t.jsxs)("section",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border-focus)",marginTop:"1rem"},children:[(0,t.jsxs)("div",{className:a.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(109, 40, 217, 0.08)",padding:"0.5rem 1rem"},children:[(0,t.jsxs)("span",{style:{fontWeight:600,fontSize:"0.85rem",display:"flex",alignItems:"center",gap:"0.5rem"},children:["🖥️ Console — ",e.find(e=>e.id===m)?.name]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.find(e=>e.id===m)?.status==="stopped"&&(0,t.jsx)("button",{onClick:async()=>{try{let t=e.find(e=>e.id===m),r=t&&("claude"===t.type||"claude-docker"===t.type||"claude-ssh"===t.type),s=!1;r&&(s=window.confirm("Would you like to resume your previous Claude session?"));let a=await fetch("/api/sessions/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:m,resume:s})});if(a.ok)await $();else{let e=await a.json();alert(e.error||"Failed to restart session.")}}catch(e){console.error("Failed to restart session:",e)}},style:{padding:"0.15rem 0.4rem",borderRadius:"4px",border:"1px solid #eab308",backgroundColor:"rgba(234, 179, 8, 0.15)",color:"#eab308",fontSize:"0.65rem",fontWeight:600,cursor:"pointer"},children:"⚡ Restart"}),(0,t.jsx)("button",{onClick:()=>f(null),style:{border:"none",background:"none",color:"var(--muted)",cursor:"pointer",fontSize:"0.75rem"},children:"✖"})]})]}),(0,t.jsx)(o,{sessionId:m,wsPort:E})]})]}),(0,t.jsxs)("div",{className:a.default.sidePanel,children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Execution Environments"}),(0,t.jsxs)("div",{className:a.default.envGrid,children:[(0,t.jsxs)("div",{className:a.default.envRow,style:{padding:"0.5rem 0.75rem"},children:[(0,t.jsx)("span",{className:a.default.envName,children:"💻 Local Host"}),(0,t.jsx)("span",{className:a.default.envStatus,style:{color:"var(--success)"},children:"Active"})]}),(0,t.jsxs)("div",{className:a.default.envRow,style:{opacity:A?1:.6,padding:"0.5rem 0.75rem"},children:[(0,t.jsx)("span",{className:a.default.envName,children:"🐳 Docker Sandbox"}),(0,t.jsx)("span",{className:a.default.envStatus,style:{color:A?"var(--success)":"var(--muted)"},children:A?"Active":"Not Mounted"})]}),(0,t.jsxs)("div",{className:a.default.envRow,style:{opacity:B?1:.6,padding:"0.5rem 0.75rem"},children:[(0,t.jsx)("span",{className:a.default.envName,children:"🌐 Remote VM (SSH)"}),(0,t.jsx)("span",{className:a.default.envStatus,style:{color:B?"var(--success)":"var(--muted)"},children:B?"Active":"Offline"})]})]})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Saved Configurations"}),(0,t.jsx)("div",{className:"card",style:{padding:"1rem",display:"flex",flexDirection:"column",gap:"0.75rem"},children:0===D.length?(0,t.jsx)("p",{style:{color:"var(--muted)",fontSize:"0.8rem",textAlign:"center",margin:"1rem 0"},children:"No configuration templates saved yet. Save a template from the Claude/Aider launch wizards."}):(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",maxHeight:"200px",overflowY:"auto"},children:D.map(e=>(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(255, 255, 255, 0.02)",padding:"0.5rem",borderRadius:"6px",border:"1px solid var(--border)"},children:[(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.15rem",minWidth:0},children:[(0,t.jsx)("span",{style:{fontSize:"0.8rem",fontWeight:600,color:"var(--foreground)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name}),(0,t.jsx)("span",{style:{fontSize:"0.65rem",color:"var(--muted)",textTransform:"uppercase"},children:e.type})]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.25rem"},children:[(0,t.jsx)("button",{onClick:()=>H(e),disabled:h,style:{padding:"0.2rem 0.4rem",borderRadius:"4px",backgroundColor:"var(--primary)",color:"#fff",border:"none",fontSize:"0.7rem",cursor:"pointer"},children:"Launch"}),(0,t.jsx)("button",{onClick:()=>G(e.id),style:{padding:"0.2rem 0.4rem",borderRadius:"4px",backgroundColor:"transparent",color:"var(--danger)",border:"1px solid var(--danger)",fontSize:"0.7rem",cursor:"pointer"},children:"Delete"})]})]},e.id))})})]}),(0,t.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:[(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{C(!1),S(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none",padding:"0.6rem",fontSize:"0.8rem",flex:1},children:"🤖 Claude Local"}),(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{C(!0),S(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(170, 72%, 40%) 0%, hsl(195, 100%, 40%) 100%)",border:"none",padding:"0.6rem",fontSize:"0.8rem",flex:1},children:"🐳 Claude Docker"})]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{_(!1),j(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none",padding:"0.6rem",fontSize:"0.8rem",flex:1},children:"🐍 Aider Local"}),(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{_(!0),j(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(195, 100%, 40%) 0%, hsl(262, 80%, 55%) 100%)",border:"none",padding:"0.6rem",fontSize:"0.8rem",flex:1},children:"🐳 Aider Docker"})]}),(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>y(!0),disabled:h,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none",padding:"0.6rem",fontSize:"0.8rem"},children:"🌐 Connect Remote SSH"})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Workspace Terminal"}),(0,t.jsxs)("div",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border)",padding:0},children:[(0,t.jsx)("div",{className:a.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(255, 255, 255, 0.02)",padding:"0.4rem 0.75rem"},children:(0,t.jsxs)("span",{style:{fontWeight:600,fontSize:"0.75rem"},children:["💻 Local Shell (CWD: ",N.split(/[/\\]/).pop()||"root",")"]})}),(0,t.jsx)(o,{sessionId:"workspace-terminal",height:"180px",wsPort:E})]})]}),(0,t.jsxs)("section",{className:"card",style:{padding:"1rem",display:"flex",flexDirection:"column",gap:"0.5rem"},children:[(0,t.jsx)("h3",{style:{fontSize:"0.9rem",fontWeight:700,margin:0},children:"Quick Actions"}),(0,t.jsxs)("ul",{style:{listStyle:"none",fontSize:"0.75rem",display:"flex",flexDirection:"column",gap:"0.35rem",color:"var(--muted)",padding:0,margin:0},children:[(0,t.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:"Configure API Keys"}),(0,t.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,t.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:"Edit rules templates"}),(0,t.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,t.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:"Inspect process locks"}),(0,t.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]})]})]})]})]}),(0,t.jsxs)("footer",{className:a.default.footer,children:[(0,t.jsxs)("span",{children:["NeuralLoom v",W," — Experimental AI Orchestrator Bridge"]}),(0,t.jsxs)("span",{children:["Directory: ",N||"Loading..."]})]}),x&&(0,t.jsx)(d,{onClose:()=>y(!1),onConfirmLaunch:()=>{y(!1),U("claude-ssh")}}),b&&(0,t.jsx)(c,{onClose:()=>j(!1),isDocker:v,onConfirmLaunch:(e,t,r)=>{j(!1),U(v?"aider-docker":"aider",e,t,r)}}),w&&(0,t.jsx)(u,{onClose:()=>S(!1),isDocker:k,onConfirmLaunch:(e,t,r)=>{S(!1),U(k?"claude-docker":"claude",e,t,r)}})]})}])},45344,e=>{e.v(t=>Promise.all(["static/chunks/03g6xpslyid3~.js","static/chunks/0ru16isbveym7.js","static/chunks/0ga14ztvrhau2.css"].map(t=>e.l(t))).then(()=>t(37314)))},39429,e=>{e.v(t=>Promise.all(["static/chunks/16w4~t4h7gk13.js"].map(t=>e.l(t))).then(()=>t(1985)))},56915,e=>{e.v(t=>Promise.all(["static/chunks/0lnobx4eh3~-_.js"].map(t=>e.l(t))).then(()=>t(99026)))},78716,e=>{e.v(t=>Promise.all(["static/chunks/0xhaghhxllgzs.js"].map(t=>e.l(t))).then(()=>t(9949)))},33789,e=>{e.v(t=>Promise.all(["static/chunks/15sigqif_v.mu.js"].map(t=>e.l(t))).then(()=>t(20032)))},78003,e=>{e.v(t=>Promise.all(["static/chunks/0gy2rolwxzjl8.js","static/chunks/0ru16isbveym7.js","static/chunks/11c6f8pb_6s91.js","static/chunks/0ga14ztvrhau2.css"].map(t=>e.l(t))).then(()=>t(97722)))}]);
@@ -8,11 +8,11 @@ WARNING: This link could potentially be dangerous`)){let t=window.open();if(t){t
8
8
  `).slice(2).join(`
9
9
  `))}},P=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},I=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},H=0,F=class{constructor(e){this.value=e,this.id=H++}},W=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new L(e?.onListenerError??c,this._options?.leakWarningThreshold??-1):void 0,this._perfMon=this._options?._profName?new k(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],i=new I(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||c)(i),b.None}if(this._disposed)return b.None;t&&(e=e.bind(t));let r=new F(e),s;this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(r.stack=O.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof F?(this._deliveryQueue??=new N,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let n=S(()=>{B?.unregister(n),s?.(),this._removeListener(r)});if(i instanceof C?i.add(n):Array.isArray(i)&&i.push(n),B){let e=Error().stack.split(`
10
10
  `).slice(2,3).join(`
11
- `).trim(),t=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(e);B.register(n,t?.[2]??e,n)}return n},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(1===this._size){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(-1===i)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let r=this._deliveryQueue.current===this;if(2*this._size<=t.length){let e=0;for(let i=0;i<t.length;i++)t[i]?t[e++]=t[i]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||c;try{e.value(t)}catch(e){i(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof F)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},N=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},U=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(j=M||={}).isCancellationToken=function(e){return e===j.None||e===j.Cancelled||e instanceof K||!!e&&"object"==typeof e&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},j.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:T.None}),j.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:U});var j,$,z,K=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?U:(this._emitter||(this._emitter=new W),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},q=!1,V="en",G=globalThis;"u">typeof G.vscode&&"u">typeof G.vscode.process?z=G.vscode.process:"u">typeof h.default&&"string"==typeof h.default?.versions?.node&&(z=h.default);var X="string"==typeof z?.versions?.electron&&z?.type==="renderer";if("object"==typeof z){z.platform,z.platform,"linux"===z.platform&&z.env.SNAP&&z.env.SNAP_REVISION,z.env.CI||z.env.BUILD_ARTIFACTSTAGINGDIRECTORY,V="en";let e=z.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,V=t.resolvedLanguage||"en",t.languagePack?.translationsConfigFile}catch{}}else"object"!=typeof navigator||X?console.error("Unable to resolve platform."):(($=navigator.userAgent).indexOf("Windows"),$.indexOf("Macintosh"),($.indexOf("Macintosh")>=0||$.indexOf("iPad")>=0||$.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,$.indexOf("Linux"),$?.indexOf("Mobi"),q=!0,V=globalThis._VSCODE_NLS_LANGUAGE||"en",navigator.language.toLowerCase());q&&"function"==typeof G.importScripts&&G.origin;var Y,J=$,Z=V;(t=Y||={}).value=function(){return Z},t.isDefaultVariant=function(){return 2===Z.length?"en"===Z:Z.length>=3&&"e"===Z[0]&&"n"===Z[1]&&"-"===Z[2]},t.isDefault=function(){return"en"===Z};var Q="function"==typeof G.postMessage&&!G.importScripts,ee=(()=>{if(Q){let e=[];G.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,r=e.length;i<r;i++){let r=e[i];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(i,1),r.callback();return}}});let t=0;return i=>{let r=++t;e.push({id:r,callback:i}),G.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})(),et=!!(J&&J.indexOf("Chrome")>=0);function ei(e,t=0,i){let r=setTimeout(()=>{e(),i&&s.dispose()},t),s=S(()=>{clearTimeout(r),i?.deleteAndLeak(s)});return i?.add(s),s}J&&J.indexOf("Firefox"),!et&&J&&J.indexOf("Safari"),J&&J.indexOf("Edg/"),J&&J.indexOf("Android"),Symbol("MicrotaskDelay"),(i=r||={}).settled=async function(e){let t,i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if("u">typeof t)throw t;return i},i.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(e){i(e)}})};var er=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let i of t)e.emitOne(i)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new W,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await T.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new e(async e=>{for await(let r of t)e.emitOne(i(r))})}map(t){return e.map(this,t)}static filter(t,i){return new e(async e=>{for await(let r of t)i(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let i of e)t.push(i);return t}toPromise(){return e.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}};er.EMPTY=er.fromArray([]);var es=class extends b{constructor(e){super(),this._terminal=e,this._linesCacheTimeout=this._register(new y),this._linesCacheDisposables=this._register(new y),this._register(S(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=m(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=ei(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(e){return this._linesCache?.[e]}setLineInCache(e,t){this._linesCache&&(this._linesCache[e]=t)}translateBufferLineToStringWithWrap(e,t){let i=[],r=[0],s=this._terminal.buffer.active.getLine(e);for(;s;){let n=this._terminal.buffer.active.getLine(e+1),o=!!n&&n.isWrapped,a=s.translateToString(!o&&t);if(o&&n){let e=s.getCell(s.length-1);e&&0===e.getCode()&&1===e.getWidth()&&n.getCell(0)?.getWidth()===2&&(a=a.slice(0,-1))}if(i.push(a),o)r.push(r[r.length-1]+a.length);else break;e++,s=n}return[i.join(""),r]}},en=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(e){this._cachedSearchTerm=e}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(e){this._lastSearchOptions=e}isValidSearchTerm(e){return!!(e&&e.length>0)}didOptionsChange(e){return!this._lastSearchOptions||!!e&&(this._lastSearchOptions.caseSensitive!==e.caseSensitive||this._lastSearchOptions.regex!==e.regex||this._lastSearchOptions.wholeWord!==e.wholeWord)}shouldUpdateHighlighting(e,t){return!!t?.decorations&&(void 0===this._cachedSearchTerm||e!==this._cachedSearchTerm||this.didOptionsChange(t))}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},eo=class{constructor(e,t){this._terminal=e,this._lineCache=t}find(e,t,i,r){if(!e||0===e.length)return void this._terminal.clearSelection();if(i>this._terminal.cols)throw Error(`Invalid col: ${i} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let s={startRow:t,startCol:i},n=this._findInLine(e,s,r);if(!n)for(let i=t+1;i<this._terminal.buffer.active.baseY+this._terminal.rows&&(s.startRow=i,s.startCol=0,!(n=this._findInLine(e,s,r)));i++);return n}findNextWithSelection(e,t,i){if(!e||0===e.length)return void this._terminal.clearSelection();let r=this._terminal.getSelectionPosition();this._terminal.clearSelection();let s=0,n=0;r&&(i===e?(s=r.end.x,n=r.end.y):(s=r.start.x,n=r.start.y)),this._lineCache.initLinesCache();let o={startRow:n,startCol:s},a=this._findInLine(e,o,t);if(!a)for(let i=n+1;i<this._terminal.buffer.active.baseY+this._terminal.rows&&(o.startRow=i,o.startCol=0,!(a=this._findInLine(e,o,t)));i++);if(!a&&0!==n)for(let i=0;i<n&&(o.startRow=i,o.startCol=0,!(a=this._findInLine(e,o,t)));i++);return!a&&r&&(o.startRow=r.start.y,o.startCol=0,a=this._findInLine(e,o,t)),a}findPreviousWithSelection(e,t,i){if(!e||0===e.length)return void this._terminal.clearSelection();let r=this._terminal.getSelectionPosition();this._terminal.clearSelection();let s=this._terminal.buffer.active.baseY+this._terminal.rows-1,n=this._terminal.cols;this._lineCache.initLinesCache();let o={startRow:s,startCol:n},a;if(r&&(o.startRow=s=r.start.y,o.startCol=n=r.start.x,i!==e&&((a=this._findInLine(e,o,t,!1))||(o.startRow=s=r.end.y,o.startCol=n=r.end.x))),a||(a=this._findInLine(e,o,t,!0)),!a){o.startCol=Math.max(o.startCol,this._terminal.cols);for(let i=s-1;i>=0&&(o.startRow=i,!(a=this._findInLine(e,o,t,!0)));i--);}if(!a&&s!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let i=this._terminal.buffer.active.baseY+this._terminal.rows-1;i>=s&&(o.startRow=i,!(a=this._findInLine(e,o,t,!0)));i--);return a}_isWholeWord(e,t,i){return(0===e||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e-1]))&&(e+i.length===t.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e+i.length]))}_findInLine(e,t,i={},r=!1){let s=t.startRow,n=t.startCol;if(this._terminal.buffer.active.getLine(s)?.isWrapped){if(r){t.startCol+=this._terminal.cols;return}return t.startRow--,t.startCol+=this._terminal.cols,this._findInLine(e,t,i)}let o=this._lineCache.getLineFromCache(s);o||(o=this._lineCache.translateBufferLineToStringWithWrap(s,!0),this._lineCache.setLineInCache(s,o));let[a,h]=o,l=this._bufferColsToStringOffset(s,n),c=e,d=a;i.regex||(c=i.caseSensitive?e:e.toLowerCase(),d=i.caseSensitive?a:a.toLowerCase());let _=-1;if(i.regex){let t=RegExp(c,i.caseSensitive?"g":"gi"),s;if(r)for(;s=t.exec(d.slice(0,l));)_=t.lastIndex-s[0].length,e=s[0],t.lastIndex-=e.length-1;else(s=t.exec(d.slice(l)))&&s[0].length>0&&(_=l+(t.lastIndex-s[0].length),e=s[0])}else r?l-c.length>=0&&(_=d.lastIndexOf(c,l-c.length)):_=d.indexOf(c,l);if(_>=0){if(i.wholeWord&&!this._isWholeWord(_,d,e))return;let t=0;for(;t<h.length-1&&_>=h[t+1];)t++;let r=t;for(;r<h.length-1&&_+e.length>=h[r+1];)r++;let n=_-h[t],o=_+e.length-h[r],a=this._stringLengthToBufferSize(s+t,n),l=this._stringLengthToBufferSize(s+r,o)-a+this._terminal.cols*(r-t);return{term:e,col:a,row:s+t,size:l}}}_stringLengthToBufferSize(e,t){let i=this._terminal.buffer.active.getLine(e);if(!i)return 0;for(let e=0;e<t;e++){let r=i.getCell(e);if(!r)break;let s=r.getChars();s.length>1&&(t-=s.length-1);let n=i.getCell(e+1);n&&0===n.getWidth()&&t++}return t}_bufferColsToStringOffset(e,t){let i=e,r=0,s=this._terminal.buffer.active.getLine(i);for(;t>0&&s;){for(let e=0;e<t&&e<this._terminal.cols;e++){let t=s.getCell(e);if(!t)break;t.getWidth()&&(r+=0===t.getCode()?1:t.getChars().length)}if(i++,(s=this._terminal.buffer.active.getLine(i))&&!s.isWrapped)break;t-=this._terminal.cols}return r}},ea=class extends b{constructor(e){super(),this._terminal=e,this._highlightDecorations=[],this._highlightedLines=new Set,this._register(S(()=>this.clearHighlightDecorations()))}createHighlightDecorations(e,t){for(let i of(this.clearHighlightDecorations(),e)){let e=this._createResultDecorations(i,t,!1);if(e)for(let t of e)this._storeDecoration(t,i)}}createActiveDecoration(e,t){let i=this._createResultDecorations(e,t,!0);if(i)return{decorations:i,match:e,dispose(){g(i)}}}clearHighlightDecorations(){g(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(e,t){this._highlightedLines.add(e.marker.line),this._highlightDecorations.push({decoration:e,match:t,dispose(){e.dispose()}})}_applyStyles(e,t,i){e.classList.contains("xterm-find-result-decoration")||(e.classList.add("xterm-find-result-decoration"),t&&(e.style.outline=`1px solid ${t}`)),i&&e.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(e,t,i){let r=[],s=e.col,n=e.size,o=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+e.row;for(;n>0;){let e=Math.min(this._terminal.cols-s,n);r.push([o,s,e]),s=0,n-=e,o++}let a=[];for(let e of r){let r=this._terminal.registerMarker(e[0]),s=this._terminal.registerDecoration({marker:r,x:e[1],width:e[2],backgroundColor:i?t.activeMatchBackground:t.matchBackground,overviewRulerOptions:this._highlightedLines.has(r.line)?void 0:{color:i?t.activeMatchColorOverviewRuler:t.matchOverviewRuler,position:"center"}});if(s){let e=[];e.push(r),e.push(s.onRender(e=>this._applyStyles(e,i?t.activeMatchBorder:t.matchBorder,!1))),e.push(s.onDispose(()=>g(e))),a.push(s)}}return 0===a.length?void 0:a}},eh=class extends b{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new W)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(e){this._selectedDecoration=e}updateResults(e,t){this._searchResults=e.slice(0,t)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(e){for(let t=0;t<this._searchResults.length;t++){let i=this._searchResults[t];if(i.row===e.row&&i.col===e.col&&i.size===e.size)return t}return -1}fireResultsChanged(e){if(!e)return;let t=-1;this._selectedDecoration&&(t=this.findResultIndex(this._selectedDecoration.match)),this._onDidChangeResults.fire({resultIndex:t,resultCount:this._searchResults.length})}reset(){this.clearSelectedDecoration(),this.clearResults()}},el=class extends b{constructor(e){super(),this._highlightTimeout=this._register(new y),this._lineCache=this._register(new y),this._state=new en,this._resultTracker=this._register(new eh),this._highlightLimit=e?.highlightLimit??1e3}get onDidChangeResults(){return this._resultTracker.onDidChangeResults}activate(e){this._terminal=e,this._lineCache.value=new es(e),this._engine=new eo(e,this._lineCache.value),this._decorationManager=new ea(e),this._register(this._terminal.onWriteParsed(()=>this._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(S(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=ei(()=>{let e=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(e,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(e){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),e||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(e,t,i){if(!this._terminal||!this._engine)throw Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let r=this._findNextAndSelect(e,t,i);return this._fireResults(t),this._state.cachedSearchTerm=e,r}_highlightAllMatches(e,t){if(!this._terminal||!this._engine||!this._decorationManager)throw Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(e))return void this.clearDecorations();this.clearDecorations(!0);let i=[],r,s=this._engine.find(e,0,0,t);for(;s&&(r?.row!==s.row||r?.col!==s.col)&&!(i.length>=this._highlightLimit);)r=s,i.push(r),s=this._engine.find(e,r.col+r.term.length>=this._terminal.cols?r.row+1:r.row,r.col+r.term.length>=this._terminal.cols?0:r.col+1,t);this._resultTracker.updateResults(i,this._highlightLimit),t.decorations&&this._decorationManager.createHighlightDecorations(i,t.decorations)}_findNextAndSelect(e,t,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let r=this._engine.findNextWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(r,t?.decorations,i?.noScroll)}findPrevious(e,t,i){if(!this._terminal||!this._engine)throw Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let r=this._findPreviousAndSelect(e,t,i);return this._fireResults(t),this._state.cachedSearchTerm=e,r}_fireResults(e){this._resultTracker.fireResultsChanged(!!e?.decorations)}_findPreviousAndSelect(e,t,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let r=this._engine.findPreviousWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(r,t?.decorations,i?.noScroll)}_selectResult(e,t,i){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!e)return this._terminal.clearSelection(),!1;if(this._terminal.select(e.col,e.row,e.size),t){let i=this._decorationManager.createActiveDecoration(e,t);i&&(this._resultTracker.selectedDecoration=i)}if(!i&&(e.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||e.row<this._terminal.buffer.active.viewportY)){let t=e.row-this._terminal.buffer.active.viewportY;t-=Math.floor(this._terminal.rows/2),this._terminal.scrollLines(t)}return!0}};async function ec(e){if(!e)return!1;if(window.isSecureContext&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let i=document.execCommand("copy");return document.body.removeChild(t),i}catch(e){return console.warn("Clipboard copy failed:",e),!1}}e.s(["default",0,function({sessionId:e,height:t="400px",wsPort:i=9601}){let r=(0,n.useRef)(null),h=(0,n.useRef)(null),l=(0,n.useRef)(null),c=(0,n.useRef)(null),[d,_]=(0,n.useState)(!1),[u,f]=(0,n.useState)(0),v=(0,n.useRef)(!1),p=(0,n.useRef)([]),[g,m]=(0,n.useState)(!1),[S,C]=(0,n.useState)(""),[b,y]=(0,n.useState)(!1),w=(0,n.useRef)(null),[E,x]=(0,n.useState)(!1),k=(0,n.useRef)(null),L=(0,n.useCallback)(e=>{let t=h.current,i=(e??t?.getSelection()??"").trim();i&&ec(i).then(e=>{e&&(x(!0),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>x(!1),1200))})},[]);(0,n.useEffect)(()=>()=>{k.current&&clearTimeout(k.current)},[]),(0,n.useEffect)(()=>{g&&c.current&&(c.current.focus(),c.current.select())},[g]);let D=()=>{w.current&&S&&w.current.findNext(S,{caseSensitive:b,incremental:!1})},R=()=>{w.current&&S&&w.current.findPrevious(S,{caseSensitive:b,incremental:!1})};(0,n.useEffect)(()=>{w.current&&S&&w.current.findNext(S,{caseSensitive:b,incremental:!0})},[S,b]);(0,n.useEffect)(()=>{if(_(!1),v.current=!1,p.current=[],f(0),m(!1),C(""),!r.current)return;let t=!1,s=new o.Terminal({cursorBlink:!0,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',fontSize:13,lineHeight:1.2,scrollback:5e3,theme:{background:"#05070a",foreground:"#c9d1d9",cursor:"#a855f7",black:"#000000",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#bd93f9",magenta:"#ff79c6",cyan:"#8be9fd",white:"#ffffff"}}),n=new a.FitAddon;s.loadAddon(n);let c=new el;s.loadAddon(c),w.current=c,s.open(r.current),s.focus();let d=r.current,u=e=>{2===e.button&&s.hasSelection()&&e.stopPropagation()},g=e=>{2===e.button&&s.hasSelection()&&e.stopPropagation()},S=e=>{s.hasSelection()&&(e.preventDefault(),L(s.getSelection()),s.clearSelection())};d&&(d.addEventListener("mousedown",u,!0),d.addEventListener("mouseup",g,!0),d.addEventListener("contextmenu",S));let b=null,y=s.onSelectionChange(()=>{let e=s.getSelection();e&&e.trim()&&(b&&clearTimeout(b),b=setTimeout(()=>L(e),150))});s.attachCustomKeyEventHandler(e=>e.ctrlKey&&"f"===e.key&&"keydown"===e.type?(e.preventDefault(),m(!0),!1):!((e.ctrlKey||e.metaKey)&&e.shiftKey&&("c"===e.key||"C"===e.key)&&"keydown"===e.type&&s.hasSelection()||(e.ctrlKey||e.metaKey)&&!e.shiftKey&&"c"===e.key&&"keydown"===e.type&&s.hasSelection())||(L(s.getSelection()),!1));try{let e=s._core;if(e){for(let t of[e.viewport,e._viewport,s.viewport,s._viewport].filter(Boolean)){let e=t._innerRefresh;if(e&&!t._innerRefresh.__patched){let i=function(...t){try{return e.apply(this,t)}catch(e){console.warn("Suppressed xterm viewport refresh error during unmount:",e)}};i.__patched=!0,t._innerRefresh=i}}for(let t of[e._renderService,e.renderService,s._renderService,s.renderService].filter(Boolean))t&&!t.__dimensionsPatched&&(t.__dimensionsPatched=!0,Object.defineProperty(t,"dimensions",{get(){try{if(this._renderer&&this._renderer.value)return this._renderer.value.dimensions}catch{}return{device:{cell:{width:0,height:0},canvas:{width:0,height:0}},css:{cell:{width:0,height:0},canvas:{width:0,height:0}}}},configurable:!0}))}}catch(e){console.warn("Failed to apply xterm monkeypatch:",e)}let E=setTimeout(()=>{if(!t)try{r.current&&r.current.clientWidth>0&&r.current.clientHeight>0&&n.fit()}catch(e){console.warn("Failed to fit terminal on mount",e)}},100);h.current=s;let x="https:"===window.location.protocol?"wss:":"ws:",k=new WebSocket(`${x}//${window.location.hostname}:${i}`);l.current=k,k.onopen=()=>{t||(s.write("\r\n\x1b[1;36m[System] Console bridge connected to gateway WebSocket...\x1b[0m\r\n"),k.send(JSON.stringify({type:"handshake",sessionId:e})),k.send(JSON.stringify({type:"resize",cols:s.cols,rows:s.rows})),s.focus())},k.onmessage=e=>{if(!t)try{let t=JSON.parse(e.data);"handshake-ack"===t.type?(s.clear(),t.history&&s.write(t.history),s.focus()):"output"===t.type?v.current?(p.current.push({type:"output",data:t.data}),f(p.current.length)):s.write(t.data):"error"===t.type&&(v.current?(p.current.push({type:"error",message:t.message}),f(p.current.length)):s.write(`\r
11
+ `).trim(),t=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(e);B.register(n,t?.[2]??e,n)}return n},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(1===this._size){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(-1===i)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let r=this._deliveryQueue.current===this;if(2*this._size<=t.length){let e=0;for(let i=0;i<t.length;i++)t[i]?t[e++]=t[i]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||c;try{e.value(t)}catch(e){i(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof F)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},N=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},U=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(j=M||={}).isCancellationToken=function(e){return e===j.None||e===j.Cancelled||e instanceof K||!!e&&"object"==typeof e&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},j.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:T.None}),j.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:U});var j,$,z,K=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?U:(this._emitter||(this._emitter=new W),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},q=!1,V="en",G=globalThis;"u">typeof G.vscode&&"u">typeof G.vscode.process?z=G.vscode.process:"u">typeof h.default&&"string"==typeof h.default?.versions?.node&&(z=h.default);var X="string"==typeof z?.versions?.electron&&z?.type==="renderer";if("object"==typeof z){z.platform,z.platform,"linux"===z.platform&&z.env.SNAP&&z.env.SNAP_REVISION,z.env.CI||z.env.BUILD_ARTIFACTSTAGINGDIRECTORY,V="en";let e=z.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,V=t.resolvedLanguage||"en",t.languagePack?.translationsConfigFile}catch{}}else"object"!=typeof navigator||X?console.error("Unable to resolve platform."):(($=navigator.userAgent).indexOf("Windows"),$.indexOf("Macintosh"),($.indexOf("Macintosh")>=0||$.indexOf("iPad")>=0||$.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,$.indexOf("Linux"),$?.indexOf("Mobi"),q=!0,V=globalThis._VSCODE_NLS_LANGUAGE||"en",navigator.language.toLowerCase());q&&"function"==typeof G.importScripts&&G.origin;var Y,J=$,Z=V;(t=Y||={}).value=function(){return Z},t.isDefaultVariant=function(){return 2===Z.length?"en"===Z:Z.length>=3&&"e"===Z[0]&&"n"===Z[1]&&"-"===Z[2]},t.isDefault=function(){return"en"===Z};var Q="function"==typeof G.postMessage&&!G.importScripts,ee=(()=>{if(Q){let e=[];G.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,r=e.length;i<r;i++){let r=e[i];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(i,1),r.callback();return}}});let t=0;return i=>{let r=++t;e.push({id:r,callback:i}),G.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})(),et=!!(J&&J.indexOf("Chrome")>=0);function ei(e,t=0,i){let r=setTimeout(()=>{e(),i&&s.dispose()},t),s=S(()=>{clearTimeout(r),i?.deleteAndLeak(s)});return i?.add(s),s}J&&J.indexOf("Firefox"),!et&&J&&J.indexOf("Safari"),J&&J.indexOf("Edg/"),J&&J.indexOf("Android"),Symbol("MicrotaskDelay"),(i=r||={}).settled=async function(e){let t,i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if("u">typeof t)throw t;return i},i.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(e){i(e)}})};var er=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let i of t)e.emitOne(i)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new W,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await T.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new e(async e=>{for await(let r of t)e.emitOne(i(r))})}map(t){return e.map(this,t)}static filter(t,i){return new e(async e=>{for await(let r of t)i(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let i of e)t.push(i);return t}toPromise(){return e.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}};er.EMPTY=er.fromArray([]);var es=class extends b{constructor(e){super(),this._terminal=e,this._linesCacheTimeout=this._register(new y),this._linesCacheDisposables=this._register(new y),this._register(S(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=m(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=ei(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(e){return this._linesCache?.[e]}setLineInCache(e,t){this._linesCache&&(this._linesCache[e]=t)}translateBufferLineToStringWithWrap(e,t){let i=[],r=[0],s=this._terminal.buffer.active.getLine(e);for(;s;){let n=this._terminal.buffer.active.getLine(e+1),o=!!n&&n.isWrapped,a=s.translateToString(!o&&t);if(o&&n){let e=s.getCell(s.length-1);e&&0===e.getCode()&&1===e.getWidth()&&n.getCell(0)?.getWidth()===2&&(a=a.slice(0,-1))}if(i.push(a),o)r.push(r[r.length-1]+a.length);else break;e++,s=n}return[i.join(""),r]}},en=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(e){this._cachedSearchTerm=e}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(e){this._lastSearchOptions=e}isValidSearchTerm(e){return!!(e&&e.length>0)}didOptionsChange(e){return!this._lastSearchOptions||!!e&&(this._lastSearchOptions.caseSensitive!==e.caseSensitive||this._lastSearchOptions.regex!==e.regex||this._lastSearchOptions.wholeWord!==e.wholeWord)}shouldUpdateHighlighting(e,t){return!!t?.decorations&&(void 0===this._cachedSearchTerm||e!==this._cachedSearchTerm||this.didOptionsChange(t))}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},eo=class{constructor(e,t){this._terminal=e,this._lineCache=t}find(e,t,i,r){if(!e||0===e.length)return void this._terminal.clearSelection();if(i>this._terminal.cols)throw Error(`Invalid col: ${i} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let s={startRow:t,startCol:i},n=this._findInLine(e,s,r);if(!n)for(let i=t+1;i<this._terminal.buffer.active.baseY+this._terminal.rows&&(s.startRow=i,s.startCol=0,!(n=this._findInLine(e,s,r)));i++);return n}findNextWithSelection(e,t,i){if(!e||0===e.length)return void this._terminal.clearSelection();let r=this._terminal.getSelectionPosition();this._terminal.clearSelection();let s=0,n=0;r&&(i===e?(s=r.end.x,n=r.end.y):(s=r.start.x,n=r.start.y)),this._lineCache.initLinesCache();let o={startRow:n,startCol:s},a=this._findInLine(e,o,t);if(!a)for(let i=n+1;i<this._terminal.buffer.active.baseY+this._terminal.rows&&(o.startRow=i,o.startCol=0,!(a=this._findInLine(e,o,t)));i++);if(!a&&0!==n)for(let i=0;i<n&&(o.startRow=i,o.startCol=0,!(a=this._findInLine(e,o,t)));i++);return!a&&r&&(o.startRow=r.start.y,o.startCol=0,a=this._findInLine(e,o,t)),a}findPreviousWithSelection(e,t,i){if(!e||0===e.length)return void this._terminal.clearSelection();let r=this._terminal.getSelectionPosition();this._terminal.clearSelection();let s=this._terminal.buffer.active.baseY+this._terminal.rows-1,n=this._terminal.cols;this._lineCache.initLinesCache();let o={startRow:s,startCol:n},a;if(r&&(o.startRow=s=r.start.y,o.startCol=n=r.start.x,i!==e&&((a=this._findInLine(e,o,t,!1))||(o.startRow=s=r.end.y,o.startCol=n=r.end.x))),a||(a=this._findInLine(e,o,t,!0)),!a){o.startCol=Math.max(o.startCol,this._terminal.cols);for(let i=s-1;i>=0&&(o.startRow=i,!(a=this._findInLine(e,o,t,!0)));i--);}if(!a&&s!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let i=this._terminal.buffer.active.baseY+this._terminal.rows-1;i>=s&&(o.startRow=i,!(a=this._findInLine(e,o,t,!0)));i--);return a}_isWholeWord(e,t,i){return(0===e||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e-1]))&&(e+i.length===t.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e+i.length]))}_findInLine(e,t,i={},r=!1){let s=t.startRow,n=t.startCol;if(this._terminal.buffer.active.getLine(s)?.isWrapped){if(r){t.startCol+=this._terminal.cols;return}return t.startRow--,t.startCol+=this._terminal.cols,this._findInLine(e,t,i)}let o=this._lineCache.getLineFromCache(s);o||(o=this._lineCache.translateBufferLineToStringWithWrap(s,!0),this._lineCache.setLineInCache(s,o));let[a,h]=o,l=this._bufferColsToStringOffset(s,n),c=e,d=a;i.regex||(c=i.caseSensitive?e:e.toLowerCase(),d=i.caseSensitive?a:a.toLowerCase());let _=-1;if(i.regex){let t=RegExp(c,i.caseSensitive?"g":"gi"),s;if(r)for(;s=t.exec(d.slice(0,l));)_=t.lastIndex-s[0].length,e=s[0],t.lastIndex-=e.length-1;else(s=t.exec(d.slice(l)))&&s[0].length>0&&(_=l+(t.lastIndex-s[0].length),e=s[0])}else r?l-c.length>=0&&(_=d.lastIndexOf(c,l-c.length)):_=d.indexOf(c,l);if(_>=0){if(i.wholeWord&&!this._isWholeWord(_,d,e))return;let t=0;for(;t<h.length-1&&_>=h[t+1];)t++;let r=t;for(;r<h.length-1&&_+e.length>=h[r+1];)r++;let n=_-h[t],o=_+e.length-h[r],a=this._stringLengthToBufferSize(s+t,n),l=this._stringLengthToBufferSize(s+r,o)-a+this._terminal.cols*(r-t);return{term:e,col:a,row:s+t,size:l}}}_stringLengthToBufferSize(e,t){let i=this._terminal.buffer.active.getLine(e);if(!i)return 0;for(let e=0;e<t;e++){let r=i.getCell(e);if(!r)break;let s=r.getChars();s.length>1&&(t-=s.length-1);let n=i.getCell(e+1);n&&0===n.getWidth()&&t++}return t}_bufferColsToStringOffset(e,t){let i=e,r=0,s=this._terminal.buffer.active.getLine(i);for(;t>0&&s;){for(let e=0;e<t&&e<this._terminal.cols;e++){let t=s.getCell(e);if(!t)break;t.getWidth()&&(r+=0===t.getCode()?1:t.getChars().length)}if(i++,(s=this._terminal.buffer.active.getLine(i))&&!s.isWrapped)break;t-=this._terminal.cols}return r}},ea=class extends b{constructor(e){super(),this._terminal=e,this._highlightDecorations=[],this._highlightedLines=new Set,this._register(S(()=>this.clearHighlightDecorations()))}createHighlightDecorations(e,t){for(let i of(this.clearHighlightDecorations(),e)){let e=this._createResultDecorations(i,t,!1);if(e)for(let t of e)this._storeDecoration(t,i)}}createActiveDecoration(e,t){let i=this._createResultDecorations(e,t,!0);if(i)return{decorations:i,match:e,dispose(){g(i)}}}clearHighlightDecorations(){g(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(e,t){this._highlightedLines.add(e.marker.line),this._highlightDecorations.push({decoration:e,match:t,dispose(){e.dispose()}})}_applyStyles(e,t,i){e.classList.contains("xterm-find-result-decoration")||(e.classList.add("xterm-find-result-decoration"),t&&(e.style.outline=`1px solid ${t}`)),i&&e.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(e,t,i){let r=[],s=e.col,n=e.size,o=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+e.row;for(;n>0;){let e=Math.min(this._terminal.cols-s,n);r.push([o,s,e]),s=0,n-=e,o++}let a=[];for(let e of r){let r=this._terminal.registerMarker(e[0]),s=this._terminal.registerDecoration({marker:r,x:e[1],width:e[2],backgroundColor:i?t.activeMatchBackground:t.matchBackground,overviewRulerOptions:this._highlightedLines.has(r.line)?void 0:{color:i?t.activeMatchColorOverviewRuler:t.matchOverviewRuler,position:"center"}});if(s){let e=[];e.push(r),e.push(s.onRender(e=>this._applyStyles(e,i?t.activeMatchBorder:t.matchBorder,!1))),e.push(s.onDispose(()=>g(e))),a.push(s)}}return 0===a.length?void 0:a}},eh=class extends b{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new W)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(e){this._selectedDecoration=e}updateResults(e,t){this._searchResults=e.slice(0,t)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(e){for(let t=0;t<this._searchResults.length;t++){let i=this._searchResults[t];if(i.row===e.row&&i.col===e.col&&i.size===e.size)return t}return -1}fireResultsChanged(e){if(!e)return;let t=-1;this._selectedDecoration&&(t=this.findResultIndex(this._selectedDecoration.match)),this._onDidChangeResults.fire({resultIndex:t,resultCount:this._searchResults.length})}reset(){this.clearSelectedDecoration(),this.clearResults()}},el=class extends b{constructor(e){super(),this._highlightTimeout=this._register(new y),this._lineCache=this._register(new y),this._state=new en,this._resultTracker=this._register(new eh),this._highlightLimit=e?.highlightLimit??1e3}get onDidChangeResults(){return this._resultTracker.onDidChangeResults}activate(e){this._terminal=e,this._lineCache.value=new es(e),this._engine=new eo(e,this._lineCache.value),this._decorationManager=new ea(e),this._register(this._terminal.onWriteParsed(()=>this._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(S(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=ei(()=>{let e=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(e,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(e){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),e||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(e,t,i){if(!this._terminal||!this._engine)throw Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let r=this._findNextAndSelect(e,t,i);return this._fireResults(t),this._state.cachedSearchTerm=e,r}_highlightAllMatches(e,t){if(!this._terminal||!this._engine||!this._decorationManager)throw Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(e))return void this.clearDecorations();this.clearDecorations(!0);let i=[],r,s=this._engine.find(e,0,0,t);for(;s&&(r?.row!==s.row||r?.col!==s.col)&&!(i.length>=this._highlightLimit);)r=s,i.push(r),s=this._engine.find(e,r.col+r.term.length>=this._terminal.cols?r.row+1:r.row,r.col+r.term.length>=this._terminal.cols?0:r.col+1,t);this._resultTracker.updateResults(i,this._highlightLimit),t.decorations&&this._decorationManager.createHighlightDecorations(i,t.decorations)}_findNextAndSelect(e,t,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let r=this._engine.findNextWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(r,t?.decorations,i?.noScroll)}findPrevious(e,t,i){if(!this._terminal||!this._engine)throw Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let r=this._findPreviousAndSelect(e,t,i);return this._fireResults(t),this._state.cachedSearchTerm=e,r}_fireResults(e){this._resultTracker.fireResultsChanged(!!e?.decorations)}_findPreviousAndSelect(e,t,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let r=this._engine.findPreviousWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(r,t?.decorations,i?.noScroll)}_selectResult(e,t,i){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!e)return this._terminal.clearSelection(),!1;if(this._terminal.select(e.col,e.row,e.size),t){let i=this._decorationManager.createActiveDecoration(e,t);i&&(this._resultTracker.selectedDecoration=i)}if(!i&&(e.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||e.row<this._terminal.buffer.active.viewportY)){let t=e.row-this._terminal.buffer.active.viewportY;t-=Math.floor(this._terminal.rows/2),this._terminal.scrollLines(t)}return!0}};async function ec(e){if(!e)return{ok:!1,error:"empty selection"};if(window.isSecureContext){if(!navigator.clipboard?.writeText)return{ok:!1,error:"Clipboard API unavailable in this browser"};try{return await navigator.clipboard.writeText(e),{ok:!0,method:"clipboard-api"}}catch(e){return{ok:!1,method:"clipboard-api",error:e instanceof Error?`${e.name}: ${e.message}`:String(e)}}}try{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let i=document.execCommand("copy");if(document.body.removeChild(t),i)return{ok:!0,method:"execCommand"};return{ok:!1,method:"execCommand",error:"execCommand returned false (use http://localhost for the Clipboard API)"}}catch(e){return{ok:!1,method:"execCommand",error:e instanceof Error?e.message:String(e)}}}e.s(["default",0,function({sessionId:e,height:t="400px",wsPort:i=9601}){let r=(0,n.useRef)(null),h=(0,n.useRef)(null),l=(0,n.useRef)(null),c=(0,n.useRef)(null),[d,_]=(0,n.useState)(!1),[u,f]=(0,n.useState)(0),v=(0,n.useRef)(!1),p=(0,n.useRef)([]),[g,m]=(0,n.useState)(!1),[S,C]=(0,n.useState)(""),[b,y]=(0,n.useState)(!1),w=(0,n.useRef)(null),[E,x]=(0,n.useState)(!1),[k,L]=(0,n.useState)(null),D=(0,n.useRef)(null),R=(0,n.useRef)(""),A=(0,n.useCallback)((e,t=!1)=>{let i=h.current,r=i?.getSelection()??"",s=(e??(r||R.current)??"").trim();if(!s){t&&(L("Nothing selected to copy"),setTimeout(()=>L(null),2500));return}ec(s).then(e=>{e.ok?(L(null),x(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>x(!1),1200)):(console.error("[TerminalConsole] copy failed:",e.error),L(e.error||"copy failed"))})},[]);(0,n.useEffect)(()=>()=>{D.current&&clearTimeout(D.current)},[]),(0,n.useEffect)(()=>{g&&c.current&&(c.current.focus(),c.current.select())},[g]);let T=()=>{w.current&&S&&w.current.findNext(S,{caseSensitive:b,incremental:!1})},B=()=>{w.current&&S&&w.current.findPrevious(S,{caseSensitive:b,incremental:!1})};(0,n.useEffect)(()=>{w.current&&S&&w.current.findNext(S,{caseSensitive:b,incremental:!0})},[S,b]);(0,n.useEffect)(()=>{if(_(!1),v.current=!1,p.current=[],f(0),m(!1),C(""),!r.current)return;let t=!1,s=new o.Terminal({cursorBlink:!0,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',fontSize:13,lineHeight:1.2,scrollback:5e3,theme:{background:"#05070a",foreground:"#c9d1d9",cursor:"#a855f7",black:"#000000",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#bd93f9",magenta:"#ff79c6",cyan:"#8be9fd",white:"#ffffff"}}),n=new a.FitAddon;s.loadAddon(n);let c=new el;s.loadAddon(c),w.current=c,s.open(r.current),s.focus();let d=r.current,u=e=>{2===e.button&&s.hasSelection()&&e.stopPropagation()},g=e=>{if(2===e.button&&s.hasSelection())return void e.stopPropagation();if(0===e.button){let e=s.getSelection();e&&e.trim()&&A(e)}},S=e=>{let t=s.getSelection()||R.current;t&&t.trim()&&(e.preventDefault(),A(t))};d&&(d.addEventListener("mousedown",u,!0),d.addEventListener("mouseup",g),d.addEventListener("contextmenu",S));let b=s.onSelectionChange(()=>{let e=s.getSelection();e&&e.trim()&&(R.current=e)});s.attachCustomKeyEventHandler(e=>e.ctrlKey&&"f"===e.key&&"keydown"===e.type?(e.preventDefault(),m(!0),!1):!((e.ctrlKey||e.metaKey)&&e.shiftKey&&("c"===e.key||"C"===e.key)&&"keydown"===e.type&&s.hasSelection()||(e.ctrlKey||e.metaKey)&&!e.shiftKey&&"c"===e.key&&"keydown"===e.type&&s.hasSelection())||(A(s.getSelection()),!1));try{let e=s._core;if(e){for(let t of[e.viewport,e._viewport,s.viewport,s._viewport].filter(Boolean)){let e=t._innerRefresh;if(e&&!t._innerRefresh.__patched){let i=function(...t){try{return e.apply(this,t)}catch(e){console.warn("Suppressed xterm viewport refresh error during unmount:",e)}};i.__patched=!0,t._innerRefresh=i}}for(let t of[e._renderService,e.renderService,s._renderService,s.renderService].filter(Boolean))t&&!t.__dimensionsPatched&&(t.__dimensionsPatched=!0,Object.defineProperty(t,"dimensions",{get(){try{if(this._renderer&&this._renderer.value)return this._renderer.value.dimensions}catch{}return{device:{cell:{width:0,height:0},canvas:{width:0,height:0}},css:{cell:{width:0,height:0},canvas:{width:0,height:0}}}},configurable:!0}))}}catch(e){console.warn("Failed to apply xterm monkeypatch:",e)}let y=setTimeout(()=>{if(!t)try{r.current&&r.current.clientWidth>0&&r.current.clientHeight>0&&n.fit()}catch(e){console.warn("Failed to fit terminal on mount",e)}},100);h.current=s;let E="https:"===window.location.protocol?"wss:":"ws:",x=new WebSocket(`${E}//${window.location.hostname}:${i}`);l.current=x,x.onopen=()=>{t||(s.write("\r\n\x1b[1;36m[System] Console bridge connected to gateway WebSocket...\x1b[0m\r\n"),x.send(JSON.stringify({type:"handshake",sessionId:e})),x.send(JSON.stringify({type:"resize",cols:s.cols,rows:s.rows})),s.focus())},x.onmessage=e=>{if(!t)try{let t=JSON.parse(e.data);"handshake-ack"===t.type?(s.clear(),t.history&&s.write(t.history),s.focus()):"output"===t.type?v.current?(p.current.push({type:"output",data:t.data}),f(p.current.length)):s.write(t.data):"error"===t.type&&(v.current?(p.current.push({type:"error",message:t.message}),f(p.current.length)):s.write(`\r
12
12
  \x1b[1;31m[System Error] ${t.message}\x1b[0m\r
13
- `))}catch{v.current?(p.current.push({type:"raw",data:e.data}),f(p.current.length)):s.write(e.data)}},k.onclose=()=>{t||s.write("\r\n\x1b[1;31m[System] Connection closed. Terminal session ended.\x1b[0m\r\n")},s.onData(e=>{t||k.readyState===WebSocket.OPEN&&k.send(JSON.stringify({type:"input",data:e}))}),s.onResize(({cols:e,rows:i})=>{t||k.readyState===WebSocket.OPEN&&k.send(JSON.stringify({type:"resize",cols:e,rows:i}))});let D=new ResizeObserver(()=>{if(!t)try{r.current&&r.current.isConnected&&r.current.clientWidth>0&&r.current.clientHeight>0&&n.fit()}catch{}});return D.observe(r.current),()=>{t=!0,clearTimeout(E),b&&clearTimeout(b),y.dispose(),D.disconnect(),k.close(),d&&(d.removeEventListener("mousedown",u,!0),d.removeEventListener("mouseup",g,!0),d.removeEventListener("contextmenu",S));try{n.dispose(),s.dispose()}catch(e){console.warn("Error disposing terminal:",e)}}},[e,i,L]);let A=async t=>{let i=t.clipboardData?.items;if(i)for(let r=0;r<i.length;r++){let s=i[r];if(-1!==s.type.indexOf("image")){let i=s.getAsFile();if(!i)continue;t.preventDefault();let r=new FileReader;r.onload=async t=>{let i=t.target?.result;if(i)try{h.current?.write("\r\n\x1b[1;33m[System] Uploading pasted clipboard image to workspace...\x1b[0m\r\n");let t=await fetch("/api/sessions/upload-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,base64Data:i,fileName:`pasted_image_${Date.now()}.png`})});if(t.ok){let e=await t.json();e.success&&e.path?(h.current?.write(`\x1b[1;32m[System] Saved clipboard image to ${e.path}\x1b[0m\r
13
+ `))}catch{v.current?(p.current.push({type:"raw",data:e.data}),f(p.current.length)):s.write(e.data)}},x.onclose=()=>{t||s.write("\r\n\x1b[1;31m[System] Connection closed. Terminal session ended.\x1b[0m\r\n")},s.onData(e=>{t||x.readyState===WebSocket.OPEN&&x.send(JSON.stringify({type:"input",data:e}))}),s.onResize(({cols:e,rows:i})=>{t||x.readyState===WebSocket.OPEN&&x.send(JSON.stringify({type:"resize",cols:e,rows:i}))});let k=new ResizeObserver(()=>{if(!t)try{r.current&&r.current.isConnected&&r.current.clientWidth>0&&r.current.clientHeight>0&&n.fit()}catch{}});return k.observe(r.current),()=>{t=!0,clearTimeout(y),b.dispose(),k.disconnect(),x.close(),d&&(d.removeEventListener("mousedown",u,!0),d.removeEventListener("mouseup",g),d.removeEventListener("contextmenu",S));try{n.dispose(),s.dispose()}catch(e){console.warn("Error disposing terminal:",e)}}},[e,i,A]);let M=async t=>{let i=t.clipboardData?.items;if(i)for(let r=0;r<i.length;r++){let s=i[r];if(-1!==s.type.indexOf("image")){let i=s.getAsFile();if(!i)continue;t.preventDefault();let r=new FileReader;r.onload=async t=>{let i=t.target?.result;if(i)try{h.current?.write("\r\n\x1b[1;33m[System] Uploading pasted clipboard image to workspace...\x1b[0m\r\n");let t=await fetch("/api/sessions/upload-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,base64Data:i,fileName:`pasted_image_${Date.now()}.png`})});if(t.ok){let e=await t.json();e.success&&e.path?(h.current?.write(`\x1b[1;32m[System] Saved clipboard image to ${e.path}\x1b[0m\r
14
14
  `),l.current&&l.current.readyState===WebSocket.OPEN&&l.current.send(JSON.stringify({type:"input",data:e.path}))):h.current?.write(`\x1b[1;31m[System Error] Failed to save image: ${e.error||"unknown"}\x1b[0m\r
15
15
  `)}else h.current?.write("\x1b[1;31m[System Error] HTTP upload failed.\x1b[0m\r\n")}catch(t){let e=t instanceof Error?t.message:String(t);h.current?.write(`\x1b[1;31m[System Error] Upload failed: ${e}\x1b[0m\r
16
- `)}},r.readAsDataURL(i);break}}};return(0,s.jsxs)("div",{onPaste:A,style:{width:"100%",height:t,backgroundColor:"#05070a",border:"1px solid var(--border)",borderBottomLeftRadius:"12px",borderBottomRightRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column",position:"relative"},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 12px",backgroundColor:"#030406",borderBottom:"1px solid var(--border)",fontSize:"0.7rem",color:"var(--muted)",userSelect:"none"},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[(0,s.jsxs)("span",{children:["Session ID: ",(0,s.jsx)("strong",{style:{color:"#cbd5e1",fontFamily:"var(--font-mono)"},children:e.substring(0,8)})]}),d&&(0,s.jsxs)("span",{style:{backgroundColor:"rgba(217, 119, 82, 0.15)",color:"#e0825f",padding:"1px 6px",borderRadius:"3px",fontWeight:600,fontSize:"0.6rem",border:"1px solid rgba(217, 119, 82, 0.25)"},children:["⏸️ Scroll Paused (",u," queued)"]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"0.35rem",alignItems:"center"},children:[E&&(0,s.jsx)("span",{style:{color:"#50fa7b",fontSize:"0.65rem",fontWeight:600},children:"✓ Copied"}),(0,s.jsx)("button",{onClick:()=>L(),style:{padding:"2px 6px",borderRadius:"3px",border:"1px solid var(--border)",backgroundColor:"transparent",color:"var(--muted)",fontSize:"0.65rem",fontWeight:600,cursor:"pointer"},title:"Copy selected terminal text (also auto-copies on selection)",children:"📋 Copy"}),(0,s.jsx)("button",{onClick:()=>{_(e=>{let t=!e;return v.current=t,t||(()=>{let e=p.current;p.current=[],f(0);let t=h.current;if(t)for(let i of e)"output"===i.type&&i.data?t.write(i.data):"error"===i.type&&i.message?t.write(`\r
16
+ `)}},r.readAsDataURL(i);break}}};return(0,s.jsxs)("div",{onPaste:M,style:{width:"100%",height:t,backgroundColor:"#05070a",border:"1px solid var(--border)",borderBottomLeftRadius:"12px",borderBottomRightRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column",position:"relative"},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 12px",backgroundColor:"#030406",borderBottom:"1px solid var(--border)",fontSize:"0.7rem",color:"var(--muted)",userSelect:"none"},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[(0,s.jsxs)("span",{children:["Session ID: ",(0,s.jsx)("strong",{style:{color:"#cbd5e1",fontFamily:"var(--font-mono)"},children:e.substring(0,8)})]}),d&&(0,s.jsxs)("span",{style:{backgroundColor:"rgba(217, 119, 82, 0.15)",color:"#e0825f",padding:"1px 6px",borderRadius:"3px",fontWeight:600,fontSize:"0.6rem",border:"1px solid rgba(217, 119, 82, 0.25)"},children:["⏸️ Scroll Paused (",u," queued)"]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"0.35rem",alignItems:"center"},children:[E&&(0,s.jsx)("span",{style:{color:"#50fa7b",fontSize:"0.65rem",fontWeight:600},children:"✓ Copied"}),k&&(0,s.jsxs)("span",{title:k,style:{color:"#ff6b6b",fontSize:"0.65rem",fontWeight:600,maxWidth:"260px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["⚠ Copy failed: ",k]}),(0,s.jsx)("button",{onClick:()=>A(void 0,!0),style:{padding:"2px 6px",borderRadius:"3px",border:"1px solid var(--border)",backgroundColor:"transparent",color:"var(--muted)",fontSize:"0.65rem",fontWeight:600,cursor:"pointer"},title:"Copy selected terminal text (also auto-copies on selection)",children:"📋 Copy"}),(0,s.jsx)("button",{onClick:()=>{_(e=>{let t=!e;return v.current=t,t||(()=>{let e=p.current;p.current=[],f(0);let t=h.current;if(t)for(let i of e)"output"===i.type&&i.data?t.write(i.data):"error"===i.type&&i.message?t.write(`\r
17
17
  \x1b[1;31m[System Error] ${i.message}\x1b[0m\r
18
- `):"raw"===i.type&&i.data&&t.write(i.data)})(),t})},style:{padding:"2px 6px",borderRadius:"3px",border:d?"1px solid #d97706":"1px solid var(--border)",backgroundColor:d?"rgba(217, 119, 82, 0.15)":"transparent",color:d?"#e0825f":"var(--muted)",fontSize:"0.65rem",fontWeight:600,cursor:"pointer"},title:d?"Resume stdout scrolling":"Pause stdout scroll buffering",children:d?"▶️ Resume":"⏸️ Pause Scroll"}),(0,s.jsx)("button",{onClick:()=>m(!g),style:{padding:"2px 6px",borderRadius:"3px",border:g?"1px solid var(--primary)":"1px solid var(--border)",backgroundColor:g?"rgba(168, 85, 247, 0.15)":"transparent",color:g?"#c084fc":"var(--muted)",fontSize:"0.65rem",fontWeight:600,cursor:"pointer"},title:"Search console output (Ctrl+F)",children:"🔍 Search"})]})]}),(0,s.jsxs)("div",{style:{flex:1,position:"relative",minHeight:0},children:[g&&(0,s.jsxs)("div",{style:{position:"absolute",top:"8px",right:"24px",zIndex:50,backgroundColor:"#0b101b",border:"1px solid var(--border-focus)",borderRadius:"6px",padding:"6px 8px",display:"flex",alignItems:"center",gap:"0.35rem",boxShadow:"0 4px 12px rgba(0,0,0,0.5)"},children:[(0,s.jsx)("input",{ref:c,type:"text",value:S,onChange:e=>C(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),e.shiftKey?R():D()):"Escape"===e.key&&(e.preventDefault(),m(!1),h.current?.focus())},placeholder:"Find...",style:{backgroundColor:"#05070a",border:"1px solid var(--border)",borderRadius:"4px",padding:"2px 6px",color:"#e2e8f0",fontSize:"0.7rem",outline:"none",width:"120px"}}),(0,s.jsx)("button",{onClick:R,style:{backgroundColor:"transparent",border:"1px solid var(--border)",color:"var(--foreground)",borderRadius:"3px",padding:"2px 4px",cursor:"pointer",fontSize:"0.65rem"},title:"Previous match (Shift+Enter)",children:"▲"}),(0,s.jsx)("button",{onClick:D,style:{backgroundColor:"transparent",border:"1px solid var(--border)",color:"var(--foreground)",borderRadius:"3px",padding:"2px 4px",cursor:"pointer",fontSize:"0.65rem"},title:"Next match (Enter)",children:"▼"}),(0,s.jsx)("button",{onClick:()=>y(!b),style:{border:b?"1px solid var(--primary)":"1px solid var(--border)",backgroundColor:b?"rgba(168, 85, 247, 0.15)":"transparent",color:b?"#c084fc":"var(--muted)",borderRadius:"3px",padding:"2px 4px",cursor:"pointer",fontSize:"0.65rem",fontWeight:600},title:"Match Case",children:"Aa"}),(0,s.jsx)("button",{onClick:()=>{m(!1),h.current?.focus()},style:{background:"none",border:"none",color:"var(--muted)",cursor:"pointer",fontSize:"0.75rem",padding:"0 2px"},title:"Close search panel",children:"✖"})]}),(0,s.jsx)("div",{ref:r,style:{width:"100%",height:"100%",padding:"8px"}})]})]})}],5991)}]);
18
+ `):"raw"===i.type&&i.data&&t.write(i.data)})(),t})},style:{padding:"2px 6px",borderRadius:"3px",border:d?"1px solid #d97706":"1px solid var(--border)",backgroundColor:d?"rgba(217, 119, 82, 0.15)":"transparent",color:d?"#e0825f":"var(--muted)",fontSize:"0.65rem",fontWeight:600,cursor:"pointer"},title:d?"Resume stdout scrolling":"Pause stdout scroll buffering",children:d?"▶️ Resume":"⏸️ Pause Scroll"}),(0,s.jsx)("button",{onClick:()=>m(!g),style:{padding:"2px 6px",borderRadius:"3px",border:g?"1px solid var(--primary)":"1px solid var(--border)",backgroundColor:g?"rgba(168, 85, 247, 0.15)":"transparent",color:g?"#c084fc":"var(--muted)",fontSize:"0.65rem",fontWeight:600,cursor:"pointer"},title:"Search console output (Ctrl+F)",children:"🔍 Search"})]})]}),(0,s.jsxs)("div",{style:{flex:1,position:"relative",minHeight:0},children:[g&&(0,s.jsxs)("div",{style:{position:"absolute",top:"8px",right:"24px",zIndex:50,backgroundColor:"#0b101b",border:"1px solid var(--border-focus)",borderRadius:"6px",padding:"6px 8px",display:"flex",alignItems:"center",gap:"0.35rem",boxShadow:"0 4px 12px rgba(0,0,0,0.5)"},children:[(0,s.jsx)("input",{ref:c,type:"text",value:S,onChange:e=>C(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),e.shiftKey?B():T()):"Escape"===e.key&&(e.preventDefault(),m(!1),h.current?.focus())},placeholder:"Find...",style:{backgroundColor:"#05070a",border:"1px solid var(--border)",borderRadius:"4px",padding:"2px 6px",color:"#e2e8f0",fontSize:"0.7rem",outline:"none",width:"120px"}}),(0,s.jsx)("button",{onClick:B,style:{backgroundColor:"transparent",border:"1px solid var(--border)",color:"var(--foreground)",borderRadius:"3px",padding:"2px 4px",cursor:"pointer",fontSize:"0.65rem"},title:"Previous match (Shift+Enter)",children:"▲"}),(0,s.jsx)("button",{onClick:T,style:{backgroundColor:"transparent",border:"1px solid var(--border)",color:"var(--foreground)",borderRadius:"3px",padding:"2px 4px",cursor:"pointer",fontSize:"0.65rem"},title:"Next match (Enter)",children:"▼"}),(0,s.jsx)("button",{onClick:()=>y(!b),style:{border:b?"1px solid var(--primary)":"1px solid var(--border)",backgroundColor:b?"rgba(168, 85, 247, 0.15)":"transparent",color:b?"#c084fc":"var(--muted)",borderRadius:"3px",padding:"2px 4px",cursor:"pointer",fontSize:"0.65rem",fontWeight:600},title:"Match Case",children:"Aa"}),(0,s.jsx)("button",{onClick:()=>{m(!1),h.current?.focus()},style:{background:"none",border:"none",color:"var(--muted)",cursor:"pointer",fontSize:"0.75rem",padding:"0 2px"},title:"Close search panel",children:"✖"})]}),(0,s.jsx)("div",{ref:r,style:{width:"100%",height:"100%",padding:"8px"}})]})]})}],5991)}]);
package/.next/trace CHANGED
@@ -1 +1 @@
1
- [{"name":"generate-buildid","duration":219,"timestamp":233876345970,"id":4,"parentId":1,"tags":{},"startTime":1782347164645,"traceId":"2e92a23698cf4a14"},{"name":"load-custom-routes","duration":312,"timestamp":233876346289,"id":5,"parentId":1,"tags":{},"startTime":1782347164646,"traceId":"2e92a23698cf4a14"},{"name":"create-dist-dir","duration":3894,"timestamp":233876346630,"id":6,"parentId":1,"tags":{},"startTime":1782347164646,"traceId":"2e92a23698cf4a14"},{"name":"clean","duration":14611,"timestamp":233876351369,"id":7,"parentId":1,"tags":{},"startTime":1782347164651,"traceId":"2e92a23698cf4a14"},{"name":"discover-routes","duration":8641,"timestamp":233876398033,"id":8,"parentId":1,"tags":{},"startTime":1782347164697,"traceId":"2e92a23698cf4a14"},{"name":"create-root-mapping","duration":85,"timestamp":233876406718,"id":9,"parentId":1,"tags":{},"startTime":1782347164706,"traceId":"2e92a23698cf4a14"},{"name":"generate-route-types","duration":23338,"timestamp":233876408989,"id":10,"parentId":1,"tags":{},"startTime":1782347164708,"traceId":"2e92a23698cf4a14"},{"name":"public-dir-conflict-check","duration":68,"timestamp":233876432381,"id":11,"parentId":1,"tags":{},"startTime":1782347164732,"traceId":"2e92a23698cf4a14"},{"name":"generate-routes-manifest","duration":2370,"timestamp":233876432513,"id":12,"parentId":1,"tags":{},"startTime":1782347164732,"traceId":"2e92a23698cf4a14"},{"name":"run-turbopack","duration":15861021,"timestamp":233876442205,"id":14,"parentId":1,"tags":{},"startTime":1782347164742,"traceId":"2e92a23698cf4a14"},{"name":"turbopack-build-events","duration":65,"timestamp":233876797972,"id":15,"parentId":1,"tags":{},"startTime":1782347165097,"traceId":"2e92a23698cf4a14"},{"name":"run-typescript","duration":12909530,"timestamp":233892314135,"id":16,"parentId":1,"tags":{},"startTime":1782347180614,"traceId":"2e92a23698cf4a14"},{"name":"generate-required-server-files","duration":635,"timestamp":233905224068,"id":18,"parentId":1,"tags":{},"startTime":1782347193523,"traceId":"2e92a23698cf4a14"},{"name":"check-static-error-page","duration":32077,"timestamp":233905266729,"id":20,"parentId":19,"tags":{},"startTime":1782347193566,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":525529,"timestamp":233905311548,"id":46,"parentId":21,"tags":{},"startTime":1782347193611,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":568277,"timestamp":233905268872,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1782347193568,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":526171,"timestamp":233905311789,"id":47,"parentId":22,"tags":{},"startTime":1782347193611,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":563034,"timestamp":233905274955,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1782347193574,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":626600,"timestamp":233905311812,"id":48,"parentId":23,"tags":{},"startTime":1782347193611,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":656149,"timestamp":233905282297,"id":23,"parentId":19,"tags":{"page":"/api/configs"},"startTime":1782347193582,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":632322,"timestamp":233905311831,"id":49,"parentId":24,"tags":{},"startTime":1782347193611,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":661823,"timestamp":233905282369,"id":24,"parentId":19,"tags":{"page":"/api/context/aider"},"startTime":1782347193582,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":638987,"timestamp":233905311847,"id":50,"parentId":25,"tags":{},"startTime":1782347193611,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":668431,"timestamp":233905282436,"id":25,"parentId":19,"tags":{"page":"/api/context/claude"},"startTime":1782347193582,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":647588,"timestamp":233905311866,"id":51,"parentId":26,"tags":{},"startTime":1782347193611,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":677014,"timestamp":233905282475,"id":26,"parentId":19,"tags":{"page":"/api/context"},"startTime":1782347193582,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":651895,"timestamp":233905313508,"id":52,"parentId":27,"tags":{},"startTime":1782347193613,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":682931,"timestamp":233905282503,"id":27,"parentId":19,"tags":{"page":"/api/context/ssh"},"startTime":1782347193582,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":656349,"timestamp":233905313575,"id":53,"parentId":29,"tags":{},"startTime":1782347193613,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":678128,"timestamp":233905291825,"id":29,"parentId":19,"tags":{"page":"/api/git"},"startTime":1782347193591,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":664803,"timestamp":233905313597,"id":54,"parentId":30,"tags":{},"startTime":1782347193613,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":686434,"timestamp":233905291998,"id":30,"parentId":19,"tags":{"page":"/api/recents"},"startTime":1782347193591,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":687234,"timestamp":233905313618,"id":55,"parentId":31,"tags":{},"startTime":1782347193613,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":708811,"timestamp":233905292074,"id":31,"parentId":19,"tags":{"page":"/api/sessions/inject"},"startTime":1782347193591,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":695626,"timestamp":233905313640,"id":56,"parentId":32,"tags":{},"startTime":1782347193613,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":717162,"timestamp":233905292137,"id":32,"parentId":19,"tags":{"page":"/api/sessions/input"},"startTime":1782347193592,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":702823,"timestamp":233905313651,"id":57,"parentId":33,"tags":{},"startTime":1782347193613,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":724334,"timestamp":233905292173,"id":33,"parentId":19,"tags":{"page":"/api/sessions/launch"},"startTime":1782347193592,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":707081,"timestamp":233905313659,"id":58,"parentId":34,"tags":{},"startTime":1782347193613,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":722728,"timestamp":233905298043,"id":34,"parentId":19,"tags":{"page":"/api/sessions"},"startTime":1782347193597,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":710760,"timestamp":233905313666,"id":59,"parentId":35,"tags":{},"startTime":1782347193613,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":726197,"timestamp":233905298261,"id":35,"parentId":19,"tags":{"page":"/api/sessions/scope"},"startTime":1782347193598,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":708091,"timestamp":233905319058,"id":60,"parentId":36,"tags":{},"startTime":1782347193618,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":728845,"timestamp":233905298336,"id":36,"parentId":19,"tags":{"page":"/api/sessions/start"},"startTime":1782347193598,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":711752,"timestamp":233905319088,"id":61,"parentId":37,"tags":{},"startTime":1782347193618,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":732495,"timestamp":233905298372,"id":37,"parentId":19,"tags":{"page":"/api/sessions/stats"},"startTime":1782347193598,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":717939,"timestamp":233905319094,"id":62,"parentId":38,"tags":{},"startTime":1782347193618,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":738654,"timestamp":233905298413,"id":38,"parentId":19,"tags":{"page":"/api/sessions/stop"},"startTime":1782347193598,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":731793,"timestamp":233905319098,"id":63,"parentId":39,"tags":{},"startTime":1782347193618,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":752479,"timestamp":233905298445,"id":39,"parentId":19,"tags":{"page":"/api/sessions/upload-image"},"startTime":1782347193598,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":735028,"timestamp":233905319102,"id":64,"parentId":40,"tags":{},"startTime":1782347193618,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":755685,"timestamp":233905298477,"id":40,"parentId":19,"tags":{"page":"/api/sql/connections"},"startTime":1782347193598,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":740122,"timestamp":233905319106,"id":65,"parentId":41,"tags":{},"startTime":1782347193618,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":760744,"timestamp":233905298510,"id":41,"parentId":19,"tags":{"page":"/api/sql/mcp"},"startTime":1782347193598,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":743727,"timestamp":233905319114,"id":66,"parentId":42,"tags":{},"startTime":1782347193618,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":764323,"timestamp":233905298540,"id":42,"parentId":19,"tags":{"page":"/api/sql/query"},"startTime":1782347193598,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":750659,"timestamp":233905319118,"id":67,"parentId":43,"tags":{},"startTime":1782347193618,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":771229,"timestamp":233905298571,"id":43,"parentId":19,"tags":{"page":"/api/sql/schema"},"startTime":1782347193598,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":755032,"timestamp":233905319123,"id":68,"parentId":44,"tags":{},"startTime":1782347193618,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":775577,"timestamp":233905298602,"id":44,"parentId":19,"tags":{"page":"/api/telemetry"},"startTime":1782347193598,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":738882,"timestamp":233905336589,"id":69,"parentId":28,"tags":{},"startTime":1782347193636,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":792957,"timestamp":233905282534,"id":28,"parentId":19,"tags":{"page":"/api/files"},"startTime":1782347193582,"traceId":"2e92a23698cf4a14"},{"name":"is-page-static","duration":745111,"timestamp":233905336903,"id":70,"parentId":45,"tags":{},"startTime":1782347193636,"traceId":"2e92a23698cf4a14"},{"name":"check-page","duration":783411,"timestamp":233905298631,"id":45,"parentId":19,"tags":{"page":"/"},"startTime":1782347193598,"traceId":"2e92a23698cf4a14"},{"name":"static-check","duration":815852,"timestamp":233905266211,"id":19,"parentId":1,"tags":{},"startTime":1782347193566,"traceId":"2e92a23698cf4a14"},{"name":"write-routes-manifest","duration":224,"timestamp":233906090308,"id":72,"parentId":1,"tags":{},"startTime":1782347194390,"traceId":"2e92a23698cf4a14"},{"name":"load-dotenv","duration":27,"timestamp":233906126796,"id":75,"parentId":74,"tags":{},"startTime":1782347194426,"traceId":"2e92a23698cf4a14"},{"name":"run-export-path-map","duration":370,"timestamp":233906145276,"id":76,"parentId":74,"tags":{},"startTime":1782347194445,"traceId":"2e92a23698cf4a14"},{"name":"next-export","duration":422442,"timestamp":233906126050,"id":74,"parentId":1,"tags":{},"startTime":1782347194425,"traceId":"2e92a23698cf4a14"},{"name":"move-exported-app-not-found-","duration":340,"timestamp":233906550274,"id":77,"parentId":73,"tags":{},"startTime":1782347194850,"traceId":"2e92a23698cf4a14"},{"name":"move-exported-app-global-error-","duration":306,"timestamp":233906550706,"id":78,"parentId":73,"tags":{},"startTime":1782347194850,"traceId":"2e92a23698cf4a14"},{"name":"static-generation","duration":446996,"timestamp":233906104861,"id":73,"parentId":1,"tags":{},"startTime":1782347194404,"traceId":"2e92a23698cf4a14"},{"name":"write-routes-manifest","duration":494,"timestamp":233906551936,"id":79,"parentId":1,"tags":{},"startTime":1782347194851,"traceId":"2e92a23698cf4a14"},{"name":"print-tree-view","duration":24352,"timestamp":233906554938,"id":80,"parentId":1,"tags":{},"startTime":1782347194854,"traceId":"2e92a23698cf4a14"},{"name":"write-route-bundle-stats","duration":20359,"timestamp":233906579309,"id":81,"parentId":1,"tags":{},"startTime":1782347194879,"traceId":"2e92a23698cf4a14"},{"name":"telemetry-flush","duration":459012,"timestamp":233906599685,"id":82,"parentId":1,"tags":{},"startTime":1782347194899,"traceId":"2e92a23698cf4a14"},{"name":"next-build","duration":30807859,"timestamp":233876250863,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1782347164550,"traceId":"2e92a23698cf4a14"}]
1
+ [{"name":"generate-buildid","duration":185,"timestamp":238730837363,"id":4,"parentId":1,"tags":{},"startTime":1782352019137,"traceId":"69f6318164c8db3e"},{"name":"load-custom-routes","duration":322,"timestamp":238730837676,"id":5,"parentId":1,"tags":{},"startTime":1782352019137,"traceId":"69f6318164c8db3e"},{"name":"create-dist-dir","duration":489,"timestamp":238730838042,"id":6,"parentId":1,"tags":{},"startTime":1782352019137,"traceId":"69f6318164c8db3e"},{"name":"clean","duration":21405,"timestamp":238730839811,"id":7,"parentId":1,"tags":{},"startTime":1782352019139,"traceId":"69f6318164c8db3e"},{"name":"discover-routes","duration":4761,"timestamp":238730885426,"id":8,"parentId":1,"tags":{},"startTime":1782352019185,"traceId":"69f6318164c8db3e"},{"name":"create-root-mapping","duration":69,"timestamp":238730890227,"id":9,"parentId":1,"tags":{},"startTime":1782352019190,"traceId":"69f6318164c8db3e"},{"name":"generate-route-types","duration":16332,"timestamp":238730891799,"id":10,"parentId":1,"tags":{},"startTime":1782352019191,"traceId":"69f6318164c8db3e"},{"name":"public-dir-conflict-check","duration":79,"timestamp":238730908187,"id":11,"parentId":1,"tags":{},"startTime":1782352019208,"traceId":"69f6318164c8db3e"},{"name":"generate-routes-manifest","duration":2166,"timestamp":238730908465,"id":12,"parentId":1,"tags":{},"startTime":1782352019208,"traceId":"69f6318164c8db3e"},{"name":"run-turbopack","duration":11704867,"timestamp":238730913672,"id":14,"parentId":1,"tags":{},"startTime":1782352019213,"traceId":"69f6318164c8db3e"},{"name":"turbopack-build-events","duration":63,"timestamp":238731156640,"id":15,"parentId":1,"tags":{},"startTime":1782352019456,"traceId":"69f6318164c8db3e"},{"name":"run-typescript","duration":17487777,"timestamp":238742623100,"id":16,"parentId":1,"tags":{},"startTime":1782352030922,"traceId":"69f6318164c8db3e"},{"name":"generate-required-server-files","duration":756,"timestamp":238760111460,"id":18,"parentId":1,"tags":{},"startTime":1782352048411,"traceId":"69f6318164c8db3e"},{"name":"check-static-error-page","duration":15230,"timestamp":238760137624,"id":20,"parentId":19,"tags":{},"startTime":1782352048437,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":390677,"timestamp":238760153283,"id":46,"parentId":21,"tags":{},"startTime":1782352048453,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":401618,"timestamp":238760142423,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1782352048442,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":395728,"timestamp":238760153454,"id":47,"parentId":22,"tags":{},"startTime":1782352048453,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":405586,"timestamp":238760143633,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1782352048443,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":436398,"timestamp":238760153477,"id":48,"parentId":23,"tags":{},"startTime":1782352048453,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":446103,"timestamp":238760143800,"id":23,"parentId":19,"tags":{"page":"/api/configs"},"startTime":1782352048443,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":448682,"timestamp":238760153498,"id":49,"parentId":24,"tags":{},"startTime":1782352048453,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":458352,"timestamp":238760143857,"id":24,"parentId":19,"tags":{"page":"/api/context/aider"},"startTime":1782352048443,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":452543,"timestamp":238760153517,"id":50,"parentId":25,"tags":{},"startTime":1782352048453,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":462184,"timestamp":238760143903,"id":25,"parentId":19,"tags":{"page":"/api/context/claude"},"startTime":1782352048443,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":455040,"timestamp":238760155534,"id":51,"parentId":26,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":466629,"timestamp":238760143973,"id":26,"parentId":19,"tags":{"page":"/api/context"},"startTime":1782352048443,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":458410,"timestamp":238760155568,"id":52,"parentId":27,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":465944,"timestamp":238760148054,"id":27,"parentId":19,"tags":{"page":"/api/context/ssh"},"startTime":1782352048447,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":463484,"timestamp":238760155599,"id":53,"parentId":29,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":467546,"timestamp":238760151564,"id":29,"parentId":19,"tags":{"page":"/api/git"},"startTime":1782352048451,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":469767,"timestamp":238760155620,"id":54,"parentId":30,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":473735,"timestamp":238760151684,"id":30,"parentId":19,"tags":{"page":"/api/recents"},"startTime":1782352048451,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":479508,"timestamp":238760155635,"id":55,"parentId":31,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":483431,"timestamp":238760151740,"id":31,"parentId":19,"tags":{"page":"/api/sessions/inject"},"startTime":1782352048451,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":482933,"timestamp":238760155655,"id":56,"parentId":32,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":486834,"timestamp":238760151778,"id":32,"parentId":19,"tags":{"page":"/api/sessions/input"},"startTime":1782352048451,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":487417,"timestamp":238760155665,"id":57,"parentId":33,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":491298,"timestamp":238760151813,"id":33,"parentId":19,"tags":{"page":"/api/sessions/launch"},"startTime":1782352048451,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":488628,"timestamp":238760155669,"id":58,"parentId":34,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":492194,"timestamp":238760152126,"id":34,"parentId":19,"tags":{"page":"/api/sessions"},"startTime":1782352048452,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":490849,"timestamp":238760155674,"id":59,"parentId":35,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":494421,"timestamp":238760152275,"id":35,"parentId":19,"tags":{"page":"/api/sessions/scope"},"startTime":1782352048452,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":494053,"timestamp":238760155679,"id":60,"parentId":36,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":497478,"timestamp":238760152339,"id":36,"parentId":19,"tags":{"page":"/api/sessions/start"},"startTime":1782352048452,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":496460,"timestamp":238760155683,"id":61,"parentId":37,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":499729,"timestamp":238760152434,"id":37,"parentId":19,"tags":{"page":"/api/sessions/stats"},"startTime":1782352048452,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":498678,"timestamp":238760155687,"id":62,"parentId":38,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":501899,"timestamp":238760152488,"id":38,"parentId":19,"tags":{"page":"/api/sessions/stop"},"startTime":1782352048452,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":500289,"timestamp":238760155691,"id":63,"parentId":39,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":503477,"timestamp":238760152518,"id":39,"parentId":19,"tags":{"page":"/api/sessions/upload-image"},"startTime":1782352048452,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":502651,"timestamp":238760155694,"id":64,"parentId":40,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":505813,"timestamp":238760152548,"id":40,"parentId":19,"tags":{"page":"/api/sql/connections"},"startTime":1782352048452,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":512074,"timestamp":238760155698,"id":65,"parentId":41,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":515227,"timestamp":238760152579,"id":41,"parentId":19,"tags":{"page":"/api/sql/mcp"},"startTime":1782352048452,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":520350,"timestamp":238760155702,"id":66,"parentId":42,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":523478,"timestamp":238760152606,"id":42,"parentId":19,"tags":{"page":"/api/sql/query"},"startTime":1782352048452,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":520890,"timestamp":238760155705,"id":67,"parentId":43,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":523980,"timestamp":238760152634,"id":43,"parentId":19,"tags":{"page":"/api/sql/schema"},"startTime":1782352048452,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":522541,"timestamp":238760155708,"id":68,"parentId":44,"tags":{},"startTime":1782352048455,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":525601,"timestamp":238760152662,"id":44,"parentId":19,"tags":{"page":"/api/telemetry"},"startTime":1782352048452,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":525606,"timestamp":238760167577,"id":69,"parentId":28,"tags":{},"startTime":1782352048467,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":545018,"timestamp":238760148195,"id":28,"parentId":19,"tags":{"page":"/api/files"},"startTime":1782352048448,"traceId":"69f6318164c8db3e"},{"name":"is-page-static","duration":534245,"timestamp":238760167873,"id":70,"parentId":45,"tags":{},"startTime":1782352048467,"traceId":"69f6318164c8db3e"},{"name":"check-page","duration":549457,"timestamp":238760152688,"id":45,"parentId":19,"tags":{"page":"/"},"startTime":1782352048452,"traceId":"69f6318164c8db3e"},{"name":"static-check","duration":565438,"timestamp":238760136726,"id":19,"parentId":1,"tags":{},"startTime":1782352048436,"traceId":"69f6318164c8db3e"},{"name":"write-routes-manifest","duration":203,"timestamp":238760707623,"id":72,"parentId":1,"tags":{},"startTime":1782352049007,"traceId":"69f6318164c8db3e"},{"name":"load-dotenv","duration":31,"timestamp":238760715380,"id":75,"parentId":74,"tags":{},"startTime":1782352049015,"traceId":"69f6318164c8db3e"},{"name":"run-export-path-map","duration":2353,"timestamp":238760720771,"id":76,"parentId":74,"tags":{},"startTime":1782352049020,"traceId":"69f6318164c8db3e"},{"name":"next-export","duration":310568,"timestamp":238760713645,"id":74,"parentId":1,"tags":{},"startTime":1782352049013,"traceId":"69f6318164c8db3e"},{"name":"move-exported-app-not-found-","duration":366,"timestamp":238761025900,"id":77,"parentId":73,"tags":{},"startTime":1782352049325,"traceId":"69f6318164c8db3e"},{"name":"move-exported-app-global-error-","duration":230,"timestamp":238761026332,"id":78,"parentId":73,"tags":{},"startTime":1782352049326,"traceId":"69f6318164c8db3e"},{"name":"static-generation","duration":316696,"timestamp":238760710810,"id":73,"parentId":1,"tags":{},"startTime":1782352049010,"traceId":"69f6318164c8db3e"},{"name":"write-routes-manifest","duration":299,"timestamp":238761027576,"id":79,"parentId":1,"tags":{},"startTime":1782352049327,"traceId":"69f6318164c8db3e"},{"name":"print-tree-view","duration":8108,"timestamp":238761037714,"id":80,"parentId":1,"tags":{},"startTime":1782352049337,"traceId":"69f6318164c8db3e"},{"name":"write-route-bundle-stats","duration":8919,"timestamp":238761045845,"id":81,"parentId":1,"tags":{},"startTime":1782352049345,"traceId":"69f6318164c8db3e"},{"name":"telemetry-flush","duration":476271,"timestamp":238761054786,"id":82,"parentId":1,"tags":{},"startTime":1782352049354,"traceId":"69f6318164c8db3e"},{"name":"next-build","duration":30759270,"timestamp":238730771808,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1782352019071,"traceId":"69f6318164c8db3e"}]
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-turbopack","duration":15861021,"timestamp":233876442205,"id":14,"parentId":1,"tags":{},"startTime":1782347164742,"traceId":"2e92a23698cf4a14"},{"name":"turbopack-build-events","duration":65,"timestamp":233876797972,"id":15,"parentId":1,"tags":{},"startTime":1782347165097,"traceId":"2e92a23698cf4a14"},{"name":"run-typescript","duration":12909530,"timestamp":233892314135,"id":16,"parentId":1,"tags":{},"startTime":1782347180614,"traceId":"2e92a23698cf4a14"},{"name":"static-check","duration":815852,"timestamp":233905266211,"id":19,"parentId":1,"tags":{},"startTime":1782347193566,"traceId":"2e92a23698cf4a14"},{"name":"static-generation","duration":446996,"timestamp":233906104861,"id":73,"parentId":1,"tags":{},"startTime":1782347194404,"traceId":"2e92a23698cf4a14"},{"name":"telemetry-flush","duration":459012,"timestamp":233906599685,"id":82,"parentId":1,"tags":{},"startTime":1782347194899,"traceId":"2e92a23698cf4a14"},{"name":"next-build","duration":30807859,"timestamp":233876250863,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1782347164550,"traceId":"2e92a23698cf4a14"}]
1
+ [{"name":"run-turbopack","duration":11704867,"timestamp":238730913672,"id":14,"parentId":1,"tags":{},"startTime":1782352019213,"traceId":"69f6318164c8db3e"},{"name":"turbopack-build-events","duration":63,"timestamp":238731156640,"id":15,"parentId":1,"tags":{},"startTime":1782352019456,"traceId":"69f6318164c8db3e"},{"name":"run-typescript","duration":17487777,"timestamp":238742623100,"id":16,"parentId":1,"tags":{},"startTime":1782352030922,"traceId":"69f6318164c8db3e"},{"name":"static-check","duration":565438,"timestamp":238760136726,"id":19,"parentId":1,"tags":{},"startTime":1782352048436,"traceId":"69f6318164c8db3e"},{"name":"static-generation","duration":316696,"timestamp":238760710810,"id":73,"parentId":1,"tags":{},"startTime":1782352049010,"traceId":"69f6318164c8db3e"},{"name":"telemetry-flush","duration":476271,"timestamp":238761054786,"id":82,"parentId":1,"tags":{},"startTime":1782352049354,"traceId":"69f6318164c8db3e"},{"name":"next-build","duration":30759270,"timestamp":238730771808,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1782352019071,"traceId":"69f6318164c8db3e"}]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neural-loom",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "bin": {
5
5
  "neural-loom": "./bin/cli.js"
6
6
  },