neural-loom 0.2.53 → 0.2.54

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 (94) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/cache/.previewinfo +1 -1
  4. package/.next/cache/.rscinfo +1 -1
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/diagnostics/route-bundle-stats.json +2 -2
  7. package/.next/fallback-build-manifest.json +3 -3
  8. package/.next/prerender-manifest.json +3 -3
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.html +1 -1
  17. package/.next/server/app/_not-found.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  24. package/.next/server/app/api/context/aider/route.js.nft.json +1 -1
  25. package/.next/server/app/api/context/claude/route.js.nft.json +1 -1
  26. package/.next/server/app/api/context/route.js.nft.json +1 -1
  27. package/.next/server/app/api/context/ssh/route.js.nft.json +1 -1
  28. package/.next/server/app/api/recents/route.js.nft.json +1 -1
  29. package/.next/server/app/api/sessions/inject/route.js.nft.json +1 -1
  30. package/.next/server/app/api/sessions/input/route.js.nft.json +1 -1
  31. package/.next/server/app/api/sessions/launch/route.js.nft.json +1 -1
  32. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  33. package/.next/server/app/api/sessions/scope/route.js.nft.json +1 -1
  34. package/.next/server/app/api/sessions/start/route.js.nft.json +1 -1
  35. package/.next/server/app/api/sessions/stats/route.js.nft.json +1 -1
  36. package/.next/server/app/api/sessions/stop/route.js.nft.json +1 -1
  37. package/.next/server/app/api/sql/connections/route.js.nft.json +1 -1
  38. package/.next/server/app/api/sql/mcp/route.js.nft.json +1 -1
  39. package/.next/server/app/api/sql/query/route.js.nft.json +1 -1
  40. package/.next/server/app/api/sql/schema/route.js.nft.json +1 -1
  41. package/.next/server/app/index.html +1 -1
  42. package/.next/server/app/index.rsc +3 -3
  43. package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  44. package/.next/server/app/index.segments/_full.segment.rsc +3 -3
  45. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  46. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  47. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  48. package/.next/server/app/page/react-loadable-manifest.json +3 -3
  49. package/.next/server/app/page_client-reference-manifest.js +1 -1
  50. package/.next/server/chunks/[root-of-the-server]__0.ptwor._.js +8 -8
  51. package/.next/server/chunks/[root-of-the-server]__0.ptwor._.js.map +1 -1
  52. package/.next/server/chunks/[root-of-the-server]__00l5btc._.js +5 -5
  53. package/.next/server/chunks/[root-of-the-server]__00l5btc._.js.map +1 -1
  54. package/.next/server/chunks/[root-of-the-server]__06men8g._.js +5 -5
  55. package/.next/server/chunks/[root-of-the-server]__06men8g._.js.map +1 -1
  56. package/.next/server/chunks/[root-of-the-server]__0_o7_jj._.js +1 -1
  57. package/.next/server/chunks/[root-of-the-server]__0_o7_jj._.js.map +1 -1
  58. package/.next/server/chunks/[root-of-the-server]__0co.g5k._.js +5 -5
  59. package/.next/server/chunks/[root-of-the-server]__0co.g5k._.js.map +1 -1
  60. package/.next/server/chunks/[root-of-the-server]__0d0pykb._.js +12 -12
  61. package/.next/server/chunks/[root-of-the-server]__0d0pykb._.js.map +1 -1
  62. package/.next/server/chunks/ssr/_0t7oqy6._.js +2 -2
  63. package/.next/server/chunks/ssr/_0t7oqy6._.js.map +1 -1
  64. package/.next/server/middleware-build-manifest.js +3 -3
  65. package/.next/server/pages/404.html +1 -1
  66. package/.next/server/pages/500.html +1 -1
  67. package/.next/server/server-reference-manifest.js +1 -1
  68. package/.next/server/server-reference-manifest.json +1 -1
  69. package/.next/static/chunks/{070hz362~_h8n.js → 0-vb7c~yrtpon.js} +1 -1
  70. package/.next/static/chunks/{0p28yw2f2duy-.js → 0ki2coq0yvb09.js} +1 -1
  71. package/.next/static/chunks/0lxxsee_tqtnv.js +6 -0
  72. package/.next/static/chunks/{0m-_sw1425nkp.css → 0osemmcuiexj3.css} +1 -1
  73. package/.next/trace +1 -1
  74. package/.next/trace-build +1 -1
  75. package/package.json +1 -1
  76. package/src/app/components/IdeLayout.tsx +30 -1
  77. package/src/app/components/TerminalConsole.tsx +3 -0
  78. package/src/app/page.module.css +54 -0
  79. package/src/app/page.tsx +14 -3
  80. package/src/lib/agents/AgentRunner.ts +74 -0
  81. package/src/lib/agents/AiderRunner.ts +4 -2
  82. package/src/lib/agents/ClaudeRunner.ts +4 -3
  83. package/src/lib/agents/DockerRunner.ts +4 -2
  84. package/src/lib/agents/MockRunner.ts +2 -1
  85. package/src/lib/agents/SSHRunner.ts +4 -2
  86. package/src/lib/agents/ShellRunner.ts +4 -1
  87. package/src/lib/sql/adapters/MssqlAdapter.ts +1 -1
  88. package/src/lib/sql/adapters/MysqlAdapter.ts +1 -1
  89. package/src/lib/sql/adapters/PostgresAdapter.ts +1 -1
  90. package/src/lib/sql/adapters/SqliteAdapter.ts +1 -1
  91. package/.next/static/chunks/0z0d3-6aolefr.js +0 -6
  92. /package/.next/static/{WLQchpoAU3XMEr3Ep5w4b → ZDEUElwAIl3MojuVa8D4O}/_buildManifest.js +0 -0
  93. /package/.next/static/{WLQchpoAU3XMEr3Ep5w4b → ZDEUElwAIl3MojuVa8D4O}/_clientMiddlewareManifest.js +0 -0
  94. /package/.next/static/{WLQchpoAU3XMEr3Ep5w4b → ZDEUElwAIl3MojuVa8D4O}/_ssgManifest.js +0 -0
@@ -1,6 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66381,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(74080);let a={display:"flex",height:"100%",width:"100%",backgroundColor:"#05070a",color:"#cbd5e1",fontSize:"0.875rem",minHeight:0},n={width:"280px",borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",minHeight:0,backgroundColor:"rgba(10, 15, 24, 0.4)",flexShrink:0},l={display:"flex",flexDirection:"column",padding:"1rem",minHeight:0},o={display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.75rem"},i={fontWeight:700,letterSpacing:"0.05em",textTransform:"uppercase",fontSize:"0.75rem",color:"var(--muted)"},d={padding:"0.2rem 0.5rem",borderRadius:"4px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.7rem",fontWeight:600,cursor:"pointer"},c={display:"flex",flexDirection:"column",gap:"0.4rem",overflowY:"auto",maxHeight:"220px"},u={fontSize:"0.65rem",fontWeight:600,color:"var(--muted)",marginTop:"0.5rem",marginBottom:"0.2rem",letterSpacing:"0.05em"},p={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0.5rem 0.6rem",borderRadius:"6px",backgroundColor:"rgba(255, 255, 255, 0.02)",border:"1px solid var(--border)",cursor:"pointer",transition:"all 0.2s ease"},m={backgroundColor:"rgba(109, 40, 217, 0.08)",border:"1px solid var(--border-focus)",boxShadow:"0 0 10px rgba(109, 40, 217, 0.1)"},h={display:"flex",flexDirection:"column",gap:"0.15rem",flex:1,minWidth:0},x={fontWeight:600,fontSize:"0.8rem",color:"#fff",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},f={fontSize:"0.7rem",color:"var(--muted)",textTransform:"uppercase"},g={background:"none",border:"none",color:"rgba(239, 68, 68, 0.4)",cursor:"pointer",fontSize:"0.75rem",padding:"0.25rem"},y={display:"flex",flexDirection:"column",gap:"0.25rem",overflowY:"auto",flex:1,minHeight:0},b={fontSize:"0.75rem",color:"var(--muted)",textAlign:"center",padding:"1rem 0"},j={display:"flex",flexDirection:"column"},v={display:"flex",alignItems:"center",padding:"0.35rem 0.5rem",borderRadius:"4px",cursor:"pointer",userSelect:"none",transition:"background 0.2s ease"},_={marginRight:"0.4rem",fontSize:"0.9rem"},w={flex:1,fontSize:"0.8rem",color:"#e2e8f0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},k={fontSize:"0.6rem",color:"var(--muted)",marginLeft:"0.25rem"},S={display:"flex",flexDirection:"column",gap:"0.2rem",paddingLeft:"1.5rem",marginTop:"0.15rem",borderLeft:"1px dashed rgba(255,255,255,0.06)",marginLeft:"0.8rem",marginBottom:"0.25rem"},C={display:"flex",alignItems:"center",padding:"0.15rem 0.25rem",fontSize:"0.75rem"},N={marginRight:"0.3rem",fontSize:"0.7rem"},R={flex:1,color:"var(--muted)",overflow:"hidden",textOverflow:"ellipsis"},T={fontSize:"0.65rem",color:"rgba(109, 40, 217, 0.75)",fontFamily:"monospace",paddingLeft:"0.5rem"},P={flex:1,display:"flex",flexDirection:"column",minHeight:0,backgroundColor:"#05070a"},W={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0.75rem 1rem",borderBottom:"1px solid var(--border)",backgroundColor:"rgba(15, 23, 42, 0.3)",flexShrink:0},E={fontSize:"0.75rem",color:"var(--muted)"},L={fontSize:"0.8rem",fontWeight:600,color:"#fff",display:"flex",alignItems:"center",gap:"0.4rem"},I={padding:"0.1rem 0.4rem",borderRadius:"4px",backgroundColor:"rgba(234, 179, 8, 0.12)",color:"#eab308",fontSize:"0.65rem",fontWeight:700,border:"1px solid rgba(234, 179, 8, 0.2)"},O={padding:"0.4rem 0.9rem",borderRadius:"6px",border:"none",backgroundColor:"var(--primary)",color:"#fff",fontSize:"0.8rem",fontWeight:600,transition:"all 0.2s ease"},D={height:"180px",borderBottom:"1px solid var(--border)",position:"relative",flexShrink:0},z={width:"100%",height:"100%",backgroundColor:"#080c14",border:"none",resize:"none",color:"#e2e8f0",fontFamily:"monospace",fontSize:"0.85rem",padding:"1rem",outline:"none",lineHeight:"1.4"},q={flex:1,display:"flex",flexDirection:"column",minHeight:0,padding:"1rem"},A={padding:"1rem",borderRadius:"8px",backgroundColor:"rgba(239, 68, 68, 0.08)",border:"1px solid rgba(239, 68, 68, 0.2)",overflowY:"auto"},B={margin:0,fontFamily:"monospace",fontSize:"0.8rem",color:"#f87171",whiteSpace:"pre-wrap"},F={marginTop:"1rem",padding:"0.75rem",borderRadius:"6px",backgroundColor:"rgba(0, 0, 0, 0.3)",border:"1px solid var(--border)"},M={display:"block",padding:"0.5rem",backgroundColor:"#090d16",borderRadius:"4px",fontFamily:"monospace",fontSize:"0.8rem",color:"var(--primary)",border:"1px solid var(--border)"},H={display:"flex",flexDirection:"column",height:"100%",minHeight:0},G={display:"flex",justifyContent:"space-between",fontSize:"0.75rem",color:"var(--muted)",marginBottom:"0.5rem"},$={flex:1,overflow:"auto",border:"1px solid var(--border)",borderRadius:"6px"},Y={width:"100%",borderCollapse:"collapse",fontFamily:"monospace",fontSize:"0.8rem"},U={padding:"0.5rem 0.75rem",textAlign:"left",backgroundColor:"#0f172a",borderBottom:"1px solid var(--border)",color:"#94a3b8",fontWeight:600,position:"sticky",top:0,zIndex:1},Q={padding:"0.4rem 0.75rem",borderBottom:"1px solid rgba(255, 255, 255, 0.03)",color:"#cbd5e1",whiteSpace:"nowrap"},J={backgroundColor:"transparent"},K={backgroundColor:"rgba(255, 255, 255, 0.01)"},V={flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--muted)",fontSize:"0.8rem",textAlign:"center"},X={flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"1rem"},Z={width:"24px",height:"24px",border:"3px solid rgba(109, 40, 217, 0.15)",borderTop:"3px solid var(--primary)",borderRadius:"50%",animation:"spin 1s linear infinite"},ee={width:"12px",height:"12px",border:"2px solid rgba(255, 255, 255, 0.1)",borderTop:"2px solid var(--muted)",borderRadius:"50%",animation:"spin 1s linear infinite"},et={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:999},es={width:"480px",backgroundColor:"#0d131f",borderRadius:"12px",border:"1px solid var(--border-focus)",padding:"1.5rem",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.5)"},er={display:"flex",flexDirection:"column",gap:"0.35rem",marginBottom:"1rem"},ea={fontSize:"0.75rem",fontWeight:600,color:"var(--muted)"},en={padding:"0.5rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"#070a12",color:"#fff",outline:"none",fontSize:"0.8rem"},el={padding:"0.5rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"#070a12",color:"#fff",outline:"none",fontSize:"0.8rem"},eo={padding:"0.5rem",borderRadius:"6px",fontSize:"0.75rem",marginBottom:"1rem"},ei={display:"flex",justifyContent:"space-between",marginTop:"1.5rem"},ed={padding:"0.4rem 0.75rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"transparent",color:"var(--muted)",fontSize:"0.75rem",fontWeight:600,cursor:"pointer"},ec={padding:"0.4rem 0.75rem",borderRadius:"6px",border:"none",backgroundColor:"transparent",color:"var(--muted)",fontSize:"0.75rem",fontWeight:600,cursor:"pointer"},eu={padding:"0.4rem 0.75rem",borderRadius:"6px",border:"none",backgroundColor:"var(--primary)",color:"#fff",fontSize:"0.75rem",fontWeight:600,cursor:"pointer"};if("u">typeof document){let e=document.createElement("style");e.innerHTML=`
2
- @keyframes spin {
3
- 0% { transform: rotate(0deg); }
4
- 100% { transform: rotate(360deg); }
5
- }
6
- `,document.head.appendChild(e)}e.s(["default",0,function({workspaceRoot:e}){let[ep,em]=(0,s.useState)({global:[],workspace:[]}),[eh,ex]=(0,s.useState)(null),[ef,eg]=(0,s.useState)(!0),[ey,eb]=(0,s.useState)([]),[ej,ev]=(0,s.useState)(null),[e_,ew]=(0,s.useState)({}),[ek,eS]=(0,s.useState)(!1),[eC,eN]=(0,s.useState)("SELECT * FROM sqlite_master;"),[eR,eT]=(0,s.useState)(!1),[eP,eW]=(0,s.useState)(null),[eE,eL]=(0,s.useState)(null),[eI,eO]=(0,s.useState)(!1),[eD,ez]=(0,s.useState)(!1),[eq,eA]=(0,s.useState)({id:"",name:"",type:"sqlite",filepath:"./dev.db",host:"localhost",port:5432,database:"postgres",username:"postgres",password:"",ssl:!1,readOnly:!0}),[eB,eF]=(0,s.useState)(!1),[eM,eH]=(0,s.useState)(null),eG=async()=>{try{let t=await fetch(`/api/sql/connections?root=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();e.success&&(em({global:e.global||[],workspace:e.workspace||[]}),ex(e.activeId),eg(e.isActiveGlobal))}}catch(e){console.error("Failed to load connection profiles:",e)}},e$=async()=>{if(!eh)return void eb([]);eS(!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?(eb(e.tables||[]),eW(null)):eW(e.error||"Failed to load database schema.")}else{let e=await t.json();eW(e.error||"Failed to load database schema.")}}catch(e){console.error("Failed to load schema:",e)}finally{eS(!1)}},eY=async t=>{if(e_[t])return void ev(ej===t?null:t);try{let s=await fetch(`/api/sql/schema?action=describe_table&table=${encodeURIComponent(t)}&root=${encodeURIComponent(e)}`);if(s.ok){let e=await s.json();e.success&&(ew(s=>({...s,[t]:e.columns})),ev(t))}}catch(e){console.error(`Failed to load columns for table ${t}:`,e)}};(0,s.useEffect)(()=>{eG()},[e]),(0,s.useEffect)(()=>{e$(),eL(null),ev(null),ew({});let e=ef?ep.global.find(e=>e.id===eh):ep.workspace.find(e=>e.id===eh);e&&("sqlite"===e.type?eN("SELECT name, type FROM sqlite_master WHERE type='table';"):"mssql"===e.type?eN("SELECT * FROM sys.tables;"):eN("SELECT * FROM information_schema.tables LIMIT 10;"))},[eh,ef,ep.global.length,ep.workspace.length]);let eU=async(t,s)=>{try{(await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"set_active",profileId:t,isGlobal:s,root:e})})).ok&&(ex(t),eg(s))}catch(e){console.error("Failed to set active profile:",e)}},eQ=async()=>{eH(null);try{let t=await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"test",profile:eq,root:e})}),s=await t.json();s.success?eH({success:!0,message:"Connection test successful!"}):eH({success:!1,message:s.error||"Connection test failed."})}catch(e){eH({success:!1,message:e.message||"Failed to make test query."})}},eJ=async t=>{if(t.preventDefault(),!eq.name||!eq.type)return;eF(!0);let s=eq.id||`profile_${Math.random().toString(36).substring(7)}`,r={...eq,id:s,name:eq.name,type:eq.type};try{(await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"save",profile:r,isGlobal:eD,root:e})})).ok&&(await eG(),eO(!1),eh||eU(s,eD))}catch(e){console.error("Failed to save profile:",e)}finally{eF(!1)}},eK=async(t,s)=>{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:s,root:e})})).ok&&(await eG(),eh===t&&ex(null))}catch(e){console.error("Failed to delete connection profile:",e)}},eV=async()=>{if(eC.trim()&&eh){eT(!0),eW(null),eL(null);try{let t=await fetch("/api/sql/query",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sql:eC.trim(),root:e})}),s=await t.json();t.ok&&s.success?(eL({rows:s.rows||[],fields:s.fields||[],durationMs:s.durationMs||0,affectedRows:s.affectedRows}),(eC.toLowerCase().includes("create table")||eC.toLowerCase().includes("drop table")||eC.toLowerCase().includes("alter table"))&&e$()):eW(s.error||"Failed to execute query.")}catch(e){eW(e.message||"An unexpected error occurred during execution.")}finally{eT(!1)}}},eX=ef?ep.global.find(e=>e.id===eh):ep.workspace.find(e=>e.id===eh);return(0,t.jsxs)("div",{style:a,children:[(0,t.jsxs)("div",{style:n,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:()=>{eH(null),eA({id:"",name:"",type:"sqlite",filepath:"./dev.db",host:"localhost",port:5432,database:"postgres",username:"postgres",password:"",ssl:!1,readOnly:!0}),ez(!1),eO(!0)},title:"Add Database Connection Profile",children:"➕ Add"})]}),(0,t.jsxs)("div",{style:c,children:[0===ep.global.length&&0===ep.workspace.length&&(0,t.jsx)("div",{style:b,children:"No connections configured. Add one to start."}),ep.workspace.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:u,children:"WORKSPACE CONNECTIONS"}),ep.workspace.map(e=>(0,t.jsxs)("div",{style:{...p,...eh===e.id&&!ef?m:{}},onClick:()=>eU(e.id,!1),children:[(0,t.jsxs)("div",{style:h,children:[(0,t.jsxs)("span",{style:x,children:["📁 ",e.name]}),(0,t.jsx)("span",{style:f,children:e.type})]}),(0,t.jsx)("button",{style:g,onClick:t=>{t.stopPropagation(),eK(e.id,!1)},children:"✖"})]},e.id))]}),ep.global.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:u,children:"GLOBAL CONNECTIONS"}),ep.global.map(e=>(0,t.jsxs)("div",{style:{...p,...eh===e.id&&ef?m:{}},onClick:()=>eU(e.id,!0),children:[(0,t.jsxs)("div",{style:h,children:[(0,t.jsxs)("span",{style:x,children:["🌐 ",e.name]}),(0,t.jsx)("span",{style:f,children:e.type})]}),(0,t.jsx)("button",{style:g,onClick:t=>{t.stopPropagation(),eK(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"}),ek&&(0,t.jsx)("span",{style:ee})]}),(0,t.jsxs)("div",{style:y,children:[!eh&&(0,t.jsx)("div",{style:b,children:"Select an active connection to view tables."}),eh&&0===ey.length&&!ek&&(0,t.jsx)("div",{style:b,children:"No tables found in database schema."}),ey.map(e=>(0,t.jsxs)("div",{style:j,children:[(0,t.jsxs)("div",{style:v,onClick:()=>eY(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:k,children:ej===e.name?"▼":"▶"})]}),ej===e.name&&e_[e.name]&&(0,t.jsx)("div",{style:S,children:e_[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:T,children:e.type.toLowerCase().substring(0,12)})]},e.name))})]},e.name))]})]})]}),(0,t.jsxs)("div",{style:P,children:[(0,t.jsxs)("div",{style:W,children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[(0,t.jsx)("span",{style:E,children:"Active Connection:"}),eX?(0,t.jsxs)("span",{style:L,children:[ef?"🌐":"📁"," ",eX.name," (",eX.type,")",eX.readOnly&&(0,t.jsx)("span",{style:I,children:"Read-Only"})]}):(0,t.jsx)("span",{style:{...L,color:"var(--danger)"},children:"No Connection Selected"})]}),(0,t.jsx)("button",{style:{...O,opacity:!eh||eR?.6:1,cursor:!eh||eR?"not-allowed":"pointer"},onClick:eV,disabled:!eh||eR,children:eR?"⌛ Running...":"⚡ Execute Query (F5)"})]}),(0,t.jsx)("div",{style:D,children:(0,t.jsx)("textarea",{style:z,value:eC,onChange:e=>eN(e.target.value),placeholder:"Write your SQL query script here...",onKeyDown:e=>{("F5"===e.key||e.ctrlKey&&"Enter"===e.key)&&(e.preventDefault(),eV())}})}),(0,t.jsxs)("div",{style:q,children:[eP&&(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:eP}),eP.includes("not installed")&&(0,t.jsxs)("div",{style:F,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:M,children:eX?.type==="sqlite"?"npm install better-sqlite3":eX?.type==="postgres"?"npm install pg":eX?.type==="mysql"?"npm install mysql2":"npm install mssql"})]})]}),eE&&(0,t.jsxs)("div",{style:H,children:[(0,t.jsxs)("div",{style:G,children:[(0,t.jsxs)("span",{children:["Query completed."," ",void 0!==eE.affectedRows?`Affected rows: ${eE.affectedRows}`:`Returned ${eE.rows.length} rows`]}),(0,t.jsxs)("span",{children:["Duration: ",eE.durationMs,"ms"]})]}),eE.rows.length>0?(0,t.jsx)("div",{style:$,children:(0,t.jsxs)("table",{style:Y,children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{children:eE.fields.map(e=>(0,t.jsx)("th",{style:U,children:e},e))})}),(0,t.jsx)("tbody",{children:eE.rows.map((e,s)=>(0,t.jsx)("tr",{style:s%2==0?J:K,children:eE.fields.map(s=>(0,t.jsx)("td",{style:Q,children:null===e[s]?"NULL":"object"==typeof e[s]?JSON.stringify(e[s]):String(e[s])},s))},s))})]})}):void 0===eE.affectedRows&&(0,t.jsx)("div",{style:V,children:"Query executed successfully, but returned 0 results."})]}),!eP&&!eE&&!eR&&(0,t.jsx)("div",{style:V,children:"Write a query script and click Execute to view table records."}),eR&&(0,t.jsxs)("div",{style:X,children:[(0,t.jsx)("span",{style:Z}),(0,t.jsx)("span",{style:{color:"var(--muted)"},children:"Running database statement..."})]})]})]}),eI&&"u">typeof document&&(0,r.createPortal)((0,t.jsx)("div",{style:et,children:(0,t.jsxs)("div",{style:es,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:()=>eO(!1),children:"✖"})]}),(0,t.jsxs)("form",{onSubmit:eJ,children:[(0,t.jsxs)("div",{style:er,children:[(0,t.jsx)("label",{style:ea,children:"Profile Name"}),(0,t.jsx)("input",{style:en,type:"text",required:!0,value:eq.name,onChange:e=>eA(t=>({...t,name:e.target.value})),placeholder:"e.g. Local Postgres, Dev SQLite"})]}),(0,t.jsxs)("div",{style:er,children:[(0,t.jsx)("label",{style:ea,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:!eD,onChange:()=>ez(!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:eD,onChange:()=>ez(!0)}),"Global User Profile"]})]})]}),(0,t.jsxs)("div",{style:er,children:[(0,t.jsx)("label",{style:ea,children:"Database Type"}),(0,t.jsxs)("select",{style:el,value:eq.type,onChange:e=>{let t=e.target.value,s=5432;"mysql"===t&&(s=3306),"mssql"===t&&(s=1433),eA(e=>({...e,type:t,filepath:"sqlite"===t?"./dev.db":void 0,port:"sqlite"!==t?s: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"===eq.type?(0,t.jsxs)("div",{style:er,children:[(0,t.jsx)("label",{style:ea,children:"Database File Path"}),(0,t.jsx)("input",{style:en,type:"text",required:!0,value:eq.filepath||"",onChange:e=>eA(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:{...er,flex:3},children:[(0,t.jsx)("label",{style:ea,children:"Host IP Address"}),(0,t.jsx)("input",{style:en,type:"text",required:!0,value:eq.host||"",onChange:e=>eA(t=>({...t,host:e.target.value})),placeholder:"localhost or IP"})]}),(0,t.jsxs)("div",{style:{...er,flex:1},children:[(0,t.jsx)("label",{style:ea,children:"Port"}),(0,t.jsx)("input",{style:en,type:"number",required:!0,value:eq.port||0,onChange:e=>eA(t=>({...t,port:parseInt(e.target.value)}))})]})]}),(0,t.jsxs)("div",{style:er,children:[(0,t.jsx)("label",{style:ea,children:"Database Name"}),(0,t.jsx)("input",{style:en,type:"text",required:!0,value:eq.database||"",onChange:e=>eA(t=>({...t,database:e.target.value}))})]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,t.jsxs)("div",{style:{...er,flex:1},children:[(0,t.jsx)("label",{style:ea,children:"Username"}),(0,t.jsx)("input",{style:en,type:"text",required:!0,value:eq.username||"",onChange:e=>eA(t=>({...t,username:e.target.value}))})]}),(0,t.jsxs)("div",{style:{...er,flex:1},children:[(0,t.jsx)("label",{style:ea,children:"Password"}),(0,t.jsx)("input",{style:en,type:"password",value:eq.password||"",onChange:e=>eA(t=>({...t,password:e.target.value}))})]})]}),("postgres"===eq.type||"mssql"===eq.type)&&(0,t.jsx)("div",{style:er,children:(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"checkbox",checked:!!eq.ssl,onChange:e=>eA(t=>({...t,ssl:e.target.checked}))}),"Require SSL Secure Connection"]})})]}),(0,t.jsx)("div",{style:er,children:(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"checkbox",checked:!!eq.readOnly,onChange:e=>eA(t=>({...t,readOnly:e.target.checked}))}),"Enforce Read-Only Connection (Disable mutations)"]})}),eM&&(0,t.jsx)("div",{style:{...eo,backgroundColor:eM.success?"rgba(16, 185, 129, 0.12)":"rgba(239, 68, 68, 0.12)",border:eM.success?"1px solid var(--success)":"1px solid var(--danger)",color:eM.success?"var(--success)":"var(--danger)"},children:eM.message}),(0,t.jsxs)("div",{style:ei,children:[(0,t.jsx)("button",{type:"button",style:ed,onClick:eQ,children:"🔍 Test Connection"}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,t.jsx)("button",{type:"button",style:ec,onClick:()=>eO(!1),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",style:eu,disabled:eB,children:eB?"Saving...":"Save Profile"})]})]})]})]})}),document.body)]})}])},67585,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let r=e.r(32061);function a({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new r.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,s)=>{"use strict";function r(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"encodeURIPath",{enumerable:!0,get:function(){return r}})},52157,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"PreloadChunks",{enumerable:!0,get:function(){return i}});let r=e.r(43476),a=e.r(74080),n=e.r(63599),l=e.r(9885),o=e.r(43369);function i({moduleIds:e}){if("u">typeof window)return null;let t=n.workAsyncStorage.getStore();if(void 0===t)return null;let s=[];if(t.reactLoadableManifest&&e){let r=t.reactLoadableManifest;for(let t of e){if(!r[t])continue;let e=r[t].files;s.push(...e)}}if(0===s.length)return null;let d=(0,o.getAssetTokenQuery)();return(0,r.jsx)(r.Fragment,{children:s.map(e=>{let s=`${t.assetPrefix}/_next/${(0,l.encodeURIPath)(e)}${d}`;return e.endsWith(".css")?(0,r.jsx)("link",{precedence:"dynamic",href:s,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,a.preload)(s,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return d}});let r=e.r(43476),a=e.r(71645),n=e.r(67585),l=e.r(52157);function o(e){return{default:e&&"default"in e?e.default:e}}let i={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},d=function(e){let t={...i,...e},s=(0,a.lazy)(()=>t.loader().then(o)),d=t.loading;function c(e){let o=d?(0,r.jsx)(d,{isLoading:!0,pastDelay:!0,error:null}):null,i=!t.ssr||!!t.loading,c=i?a.Suspense:a.Fragment,u=t.ssr?(0,r.jsxs)(r.Fragment,{children:["u"<typeof window?(0,r.jsx)(l.PreloadChunks,{moduleIds:t.modules}):null,(0,r.jsx)(s,{...e})]}):(0,r.jsx)(n.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(s,{...e})});return(0,r.jsx)(c,{...i?{fallback:o}:{},children:u})}return c.displayName="LoadableComponent",c}},70703,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return a}});let r=e.r(55682)._(e.r(69093));function a(e,t){let s={};"function"==typeof e&&(s.loader=e);let a={...s,...t};return(0,r.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},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",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",pulseDot:"page-module___8aEwW__pulseDot",quickLaunchBtn:"page-module___8aEwW__quickLaunchBtn",sectionTitle:"page-module___8aEwW__sectionTitle",sidePanel:"page-module___8aEwW__sidePanel",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),s=e.i(71645),r=e.i(70703),a=e.i(20897),n=e.i(66381);let l=(0,r.default)(()=>e.A(33779),{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..."})})}),o=(0,r.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..."})})}),i=(0,r.default)(()=>e.A(56915),{loadableGenerated:{modules:[99026]},ssr:!1}),d=(0,r.default)(()=>e.A(78716),{loadableGenerated:{modules:[9949]},ssr:!1}),c=(0,r.default)(()=>e.A(33789),{loadableGenerated:{modules:[20032]},ssr:!1}),u=(0,r.default)(()=>e.A(78003),{loadableGenerated:{modules:[97722]},ssr:!1});e.s(["default",0,function(){let[e,r]=(0,s.useState)([]),[p,m]=(0,s.useState)(null),[h,x]=(0,s.useState)(!1),[f,g]=(0,s.useState)(!1),[y,b]=(0,s.useState)(!1),[j,v]=(0,s.useState)(!1),[_,w]=(0,s.useState)(!1),[k,S]=(0,s.useState)(!1),[C,N]=(0,s.useState)(""),[R,T]=(0,s.useState)(3001),[P,W]=(0,s.useState)("0.2.19"),[E,L]=(0,s.useState)(null),I=e.filter(e=>"workspace-terminal"!==e.id),O=e.find(e=>e.id===p),D=I.some(e=>("claude-docker"===e.type||"aider-docker"===e.type)&&"running"===e.status),z=I.some(e=>"claude-ssh"===e.type&&"running"===e.status),q=async()=>{try{let e=await fetch("/api/sessions"),t=await e.json();t.sessions&&r(t.sessions),t.wsPort&&T(t.wsPort),t.originalCwd&&N(t.originalCwd),t.version&&W(t.version)}catch(e){console.error("Failed to fetch sessions:",e)}},A=async()=>{try{let e=await fetch("/api/recents");if(e.ok){let t=await e.json();t.success&&t.recents&&t.recents.lastSession&&L(t.recents.lastSession)}}catch(e){console.error("Failed to fetch recents:",e)}};(0,s.useEffect)(()=>{(async()=>{await q(),await A()})(),"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(q,4e3);return()=>clearInterval(e)},[]);let B=async(e,t,s,r)=>{x(!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:s,scopedDirs:r};if(("aider"===e||"aider-docker"===e)&&!s)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 q(),m(o.session.id),L({type:e,name:a,workspaceRoot:s,scopedDirs:r}))}catch(e){console.error("Failed to launch session:",e)}finally{x(!1)}},F=async(e,t=!1)=>{try{let s=await fetch("/api/sessions/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,delete:t})});(await s.json()).success&&(t&&p===e&&m(null),await q())}catch(e){console.error("Failed to stop session:",e)}};return(0,t.jsxs)("div",{className:`${a.default.container} ${O?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"})]})]}),O?(0,t.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:(0,t.jsx)(u,{sessionId:O.id,workspaceRoot:O.workspaceRoot||"",scopedDirs:O.scopedDirs||[],onClose:()=>m(null),sessions:e,onSwitchSession:e=>m(e),onRefreshSessions:q,wsPort:R})}):(0,t.jsxs)("div",{className:a.default.dashboardGrid,children:[(0,t.jsxs)("main",{className:a.default.mainPanel,children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Active AI Agents"}),0===I.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 in this workspace. Launch a Claude or Aider agent session to begin."}),(0,t.jsxs)("div",{style:{display:"flex",gap:"1rem",justifyContent:"center",flexWrap:"wrap"},children:[E&&(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{B(E.type,E.name,E.workspaceRoot,E.scopedDirs)},disabled:h,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none",maxWidth:"200px"},title:`Re-launch: ${E.name||E.type}`,children:"⚡ Re-launch Last Session"}),(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{S(!1),w(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none",maxWidth:"200px"},children:"Launch Claude PTY"}),(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{v(!1),b(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none",maxWidth:"200px"},children:"Launch Aider PTY"})]}),(0,t.jsxs)("div",{style:{marginTop:"1.5rem",fontSize:"0.75rem",color:"var(--muted)"},children:["Want to verify layout features first?"," ",(0,t.jsx)("span",{onClick:()=>B("mock"),style:{color:"var(--primary)",cursor:"pointer",textDecoration:"underline"},children:"Start simulated sandbox session"})]})]}):(0,t.jsx)("div",{className:a.default.agentGrid,children:I.map(e=>(0,t.jsxs)("div",{className:`${a.default.agentCard} card ${p===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.jsx)("span",{className:`${a.default.agentBadge} ${"stopped"===e.status?a.default.stoppedBadge:""}`,children:e.status})]}),(0,t.jsxs)("div",{className:a.default.cardBody,children:[(0,t.jsxs)("p",{style:{fontSize:"0.825rem",color:"var(--muted)"},children:["ID: ",(0,t.jsx)("code",{style:{fontSize:"0.75rem"},children:e.id.substring(0,8)}),(0,t.jsx)("br",{}),"Type: ","claude"===e.type?"Claude Local PTY":"claude-docker"===e.type?"Claude Docker PTY":"claude-ssh"===e.type?"Claude SSH PTY":"aider"===e.type?"Aider Local PTY":"aider-docker"===e.type?"Aider Docker PTY":"mock"===e.type?"Simulated Mock PTY":"Unknown PTY",(0,t.jsx)("br",{}),"Logs: ",e.logsCount," captured lines"]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem",marginTop:"1rem"},children:["running"===e.status?(0,t.jsx)("button",{onClick:()=>F(e.id,!1),style:{flex:1,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"1px solid var(--danger)",backgroundColor:"transparent",fontSize:"0.75rem",fontWeight:600,color:"var(--danger)"},children:"Stop"}):(0,t.jsx)("button",{onClick:()=>F(e.id,!0),style:{flex:1,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"transparent",fontSize:"0.75rem",fontWeight:600,color:"var(--muted)"},children:"Delete"}),(0,t.jsx)("button",{onClick:()=>m(e.id),style:{flex:2,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"none",backgroundColor:p===e.id?"var(--border-focus)":"var(--primary)",fontSize:"0.75rem",fontWeight:600,color:"#fff"},children:p===e.id?"Connected":"Open Session"})]})]})]},e.id))})]}),p&&"workspace-terminal"!==p&&(0,t.jsxs)("section",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border-focus)"},children:[(0,t.jsxs)("div",{className:a.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(109, 40, 217, 0.08)"},children:[(0,t.jsxs)("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:["🖥️ Console Bridge — ",e.find(e=>e.id===p)?.name]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.find(e=>e.id===p)?.status==="stopped"&&(0,t.jsx)("button",{onClick:async()=>{try{let e=await fetch("/api/sessions/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:p})});if(e.ok)await q();else{let t=await e.json();alert(t.error||"Failed to restart session.")}}catch(e){console.error("Failed to restart session:",e),alert("Network error: failed to restart session.")}},style:{padding:"0.2rem 0.5rem",borderRadius:"4px",border:"1px solid #eab308",backgroundColor:"rgba(234, 179, 8, 0.15)",color:"#eab308",fontSize:"0.7rem",fontWeight:600,cursor:"pointer",boxShadow:"0 0 8px rgba(234, 179, 8, 0.2)"},title:"Restart the stopped session process runner",children:"⚡ Restart Session"}),(0,t.jsx)("button",{onClick:()=>m(null),style:{border:"none",background:"none",color:"var(--muted)",cursor:"pointer",fontSize:"0.75rem"},children:"Close Panel ✖"})]})]}),(0,t.jsx)(l,{sessionId:p,wsPort:R})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Workspace Shell Terminal"}),(0,t.jsxs)("div",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border)",padding:0},children:[(0,t.jsxs)("div",{className:a.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(255, 255, 255, 0.02)"},children:[(0,t.jsxs)("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem",fontSize:"0.85rem"},children:["💻 Local Workspace Shell (CWD: ",C||"root",")"]}),(0,t.jsx)("span",{style:{fontSize:"0.7rem",color:"var(--muted)"},children:"Pre-configured environment"})]}),(0,t.jsx)(l,{sessionId:"workspace-terminal",height:"300px",wsPort:R})]})]}),(0,t.jsxs)("section",{style:{marginTop:"2rem"},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 project files folder hierarchy map."})]}),(0,t.jsx)("button",{onClick:async()=>{p&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:p,command:"/ccc"})})},disabled:!p,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.75rem",fontWeight:600,opacity:p?1:.5,cursor:p?"pointer":"not-allowed"},children:"🚀 Mount Context (/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 instructions written in .ai/neural-loom/cprompt.md."})]}),(0,t.jsx)("button",{onClick:async()=>{p&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:p,command:"/ccp"})})},disabled:!p,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--success)",backgroundColor:"transparent",color:"var(--success)",fontSize:"0.75rem",fontWeight:600,opacity:p?1:.5,cursor:p?"pointer":"not-allowed"},children:"⚡ Trigger Prompt (/ccp)"})]})]}),(0,t.jsx)(o,{})]}),(0,t.jsxs)("section",{style:{marginTop:"2rem"},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:"480px",border:"1px solid var(--border)"},children:(0,t.jsx)(n.default,{workspaceRoot:C||""})})]})]}),(0,t.jsxs)("aside",{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,children:[(0,t.jsx)("span",{className:a.default.envName,children:"💻 Local host OS"}),(0,t.jsx)("span",{className:a.default.envStatus,style:{color:"var(--success)"},children:"Active"})]}),(0,t.jsxs)("div",{className:a.default.envRow,style:{opacity:D?1:.6},children:[(0,t.jsx)("span",{className:a.default.envName,children:"🐳 Docker Sandbox"}),(0,t.jsx)("span",{className:a.default.envStatus,style:{color:D?"var(--success)":"var(--muted)"},children:D?"Active":"Not Mounted"})]}),(0,t.jsxs)("div",{className:a.default.envRow,style:{opacity:z?1:.6},children:[(0,t.jsx)("span",{className:a.default.envName,children:"🌐 Remote VM (SSH)"}),(0,t.jsx)("span",{className:a.default.envStatus,style:{color:z?"var(--success)":"var(--muted)"},children:z?"Active":"Disconnected"})]})]})]}),(0,t.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,t.jsxs)("button",{className:a.default.quickLaunchBtn,onClick:()=>{S(!1),w(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none"},children:[(0,t.jsx)("span",{children:"🤖"}),(0,t.jsx)("span",{children:"Launch Claude PTY"})]}),(0,t.jsxs)("button",{className:a.default.quickLaunchBtn,onClick:()=>{S(!0),w(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(170, 72%, 40%) 0%, hsl(195, 100%, 40%) 100%)",border:"none"},children:[(0,t.jsx)("span",{children:"🐳"}),(0,t.jsx)("span",{children:"Launch Docker PTY"})]}),(0,t.jsxs)("button",{className:a.default.quickLaunchBtn,onClick:()=>g(!0),disabled:h,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none"},children:[(0,t.jsx)("span",{children:"🌐"}),(0,t.jsx)("span",{children:"Launch SSH PTY"})]}),(0,t.jsxs)("button",{className:a.default.quickLaunchBtn,onClick:()=>{v(!1),b(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,t.jsx)("span",{children:"🐍"}),(0,t.jsx)("span",{children:"Launch Aider PTY"})]}),(0,t.jsxs)("button",{className:a.default.quickLaunchBtn,onClick:()=>{v(!0),b(!0)},disabled:h,style:{background:"linear-gradient(135deg, hsl(195, 100%, 40%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,t.jsx)("span",{children:"🐳"}),(0,t.jsx)("span",{children:"Launch Aider Docker"})]})]}),(0,t.jsxs)("section",{className:"card",style:{padding:"1.5rem",display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,t.jsx)("h3",{style:{fontSize:"1rem",fontWeight:700},children:"Quick Actions"}),(0,t.jsxs)("ul",{style:{listStyle:"none",fontSize:"0.875rem",display:"flex",flexDirection:"column",gap:"0.5rem",color:"var(--muted)"},children:[(0,t.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:"Configure global 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)("div",{style:{marginTop:"1.2rem",textAlign:"center",fontSize:"0.72rem",color:"var(--muted)"},children:["Need to troubleshoot?"," ",(0,t.jsx)("span",{onClick:()=>B("mock"),style:{color:"var(--primary)",cursor:"pointer",textDecoration:"underline"},children:"Launch simulated playground sandbox"})]})]})]})]}),(0,t.jsxs)("footer",{className:a.default.footer,children:[(0,t.jsxs)("span",{children:["NeuralLoom v",P," — Experimental AI Orchestrator Bridge"]}),(0,t.jsxs)("span",{children:["Directory: ",C||"Loading..."]})]}),f&&(0,t.jsx)(i,{onClose:()=>g(!1),onConfirmLaunch:()=>{g(!1),B("claude-ssh")}}),y&&(0,t.jsx)(d,{onClose:()=>b(!1),isDocker:j,onConfirmLaunch:()=>{b(!1),B(j?"aider-docker":"aider")}}),_&&(0,t.jsx)(c,{onClose:()=>w(!1),isDocker:k,onConfirmLaunch:(e,t,s)=>{w(!1),B(k?"claude-docker":"claude",e,t,s)}})]})}])},33779,e=>{e.v(t=>Promise.all(["static/chunks/03g6xpslyid3~.js","static/chunks/070hz362~_h8n.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/0k2co3uj4w81_.js"].map(t=>e.l(t))).then(()=>t(9949)))},33789,e=>{e.v(t=>Promise.all(["static/chunks/076_b43_kienv.js"].map(t=>e.l(t))).then(()=>t(20032)))},78003,e=>{e.v(t=>Promise.all(["static/chunks/0eidfx-s54367.js","static/chunks/070hz362~_h8n.js","static/chunks/0p28yw2f2duy-.js","static/chunks/0ga14ztvrhau2.css"].map(t=>e.l(t))).then(()=>t(97722)))}]);