neural-loom 0.2.49 → 0.2.50

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 (52) 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/index.html +1 -1
  25. package/.next/server/app/index.rsc +2 -2
  26. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  27. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  28. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  29. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  30. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  31. package/.next/server/app/page/react-loadable-manifest.json +1 -1
  32. package/.next/server/app/page_client-reference-manifest.js +1 -1
  33. package/.next/server/chunks/[root-of-the-server]__0_o7_jj._.js +1 -1
  34. package/.next/server/chunks/[root-of-the-server]__0_o7_jj._.js.map +1 -1
  35. package/.next/server/chunks/ssr/_0t7oqy6._.js +6 -1
  36. package/.next/server/chunks/ssr/_0t7oqy6._.js.map +1 -1
  37. package/.next/server/middleware-build-manifest.js +3 -3
  38. package/.next/server/pages/404.html +1 -1
  39. package/.next/server/pages/500.html +1 -1
  40. package/.next/server/server-reference-manifest.js +1 -1
  41. package/.next/server/server-reference-manifest.json +1 -1
  42. package/.next/static/chunks/01mol-lwap~v1.js +6 -0
  43. package/.next/static/chunks/0p28yw2f2duy-.js +1 -0
  44. package/.next/trace +1 -1
  45. package/.next/trace-build +1 -1
  46. package/package.json +1 -1
  47. package/src/app/page.tsx +9 -0
  48. package/.next/static/chunks/03f4bqk_d65hs.js +0 -6
  49. package/.next/static/chunks/0~6gm~u8rgtpd.js +0 -1
  50. /package/.next/static/{BoncS4SNz6CDpSdR8oY-K → df_RTMKU1wNmlZ4ehP9yW}/_buildManifest.js +0 -0
  51. /package/.next/static/{BoncS4SNz6CDpSdR8oY-K → df_RTMKU1wNmlZ4ehP9yW}/_clientMiddlewareManifest.js +0 -0
  52. /package/.next/static/{BoncS4SNz6CDpSdR8oY-K → df_RTMKU1wNmlZ4ehP9yW}/_ssgManifest.js +0 -0
@@ -1,3 +1,8 @@
1
- module.exports=[41997,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={BailoutToCSRError:function(){return g},isBailoutToCSRError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="BAILOUT_TO_CLIENT_SIDE_RENDERING";class g extends Error{constructor(a){super(`Bail out to client-side rendering: ${a}`),this.reason=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&a.digest===f}},32245,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"BailoutToCSR",{enumerable:!0,get:function(){return e}});let d=a.r(41997);function e({reason:a,children:b}){throw Object.defineProperty(new d.BailoutToCSRError(a),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}},7773,(a,b,c)=>{"use strict";function d(a){return a.split("/").map(a=>encodeURIComponent(a)).join("/")}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"encodeURIPath",{enumerable:!0,get:function(){return d}})},68063,(a,b,c)=>{"use strict";let d;Object.defineProperty(c,"__esModule",{value:!0});var e={getAssetToken:function(){return i},getAssetTokenQuery:function(){return j},getDeploymentId:function(){return g},getDeploymentIdQuery:function(){return h}};for(var f in e)Object.defineProperty(c,f,{enumerable:!0,get:e[f]});function g(){return d}function h(a=!1){return d?`${a?"&":"?"}dpl=${d}`:""}function i(){return!1}function j(a=!1){return""}d=void 0},97458,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"PreloadChunks",{enumerable:!0,get:function(){return i}});let d=a.r(87924),e=a.r(35112),f=a.r(56704),g=a.r(7773),h=a.r(68063);function i({moduleIds:a}){let b=f.workAsyncStorage.getStore();if(void 0===b)return null;let c=[];if(b.reactLoadableManifest&&a){let d=b.reactLoadableManifest;for(let b of a){if(!d[b])continue;let a=d[b].files;c.push(...a)}}if(0===c.length)return null;let j=(0,h.getAssetTokenQuery)();return(0,d.jsx)(d.Fragment,{children:c.map(a=>{let c=`${b.assetPrefix}/_next/${(0,g.encodeURIPath)(a)}${j}`;return a.endsWith(".css")?(0,d.jsx)("link",{precedence:"dynamic",href:c,rel:"stylesheet",as:"style",nonce:b.nonce},a):((0,e.preload)(c,{as:"script",fetchPriority:"low",nonce:b.nonce}),null)})})}},69853,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return j}});let d=a.r(87924),e=a.r(72131),f=a.r(32245),g=a.r(97458);function h(a){return{default:a&&"default"in a?a.default:a}}let i={loader:()=>Promise.resolve(h(()=>null)),loading:null,ssr:!0},j=function(a){let b={...i,...a},c=(0,e.lazy)(()=>b.loader().then(h)),j=b.loading;function k(a){let h=j?(0,d.jsx)(j,{isLoading:!0,pastDelay:!0,error:null}):null,i=!b.ssr||!!b.loading,k=i?e.Suspense:e.Fragment,l=b.ssr?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.PreloadChunks,{moduleIds:b.modules}),(0,d.jsx)(c,{...a})]}):(0,d.jsx)(f.BailoutToCSR,{reason:"next/dynamic",children:(0,d.jsx)(c,{...a})});return(0,d.jsx)(k,{...i?{fallback:h}:{},children:l})}return k.displayName="LoadableComponent",k}},19721,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return e}});let d=a.r(33354)._(a.r(69853));function e(a,b){let c={};"function"==typeof a&&(c.loader=a);let e={...c,...b};return(0,d.default)({...e,modules:e.loadableGenerated?.modules})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},46845,a=>{a.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"})},40777,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(19721),e=a.i(46845);let f=(0,d.default)(async()=>{},{loadableGenerated:{modules:[37314]},ssr:!1,loading:()=>(0,b.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,b.jsx)("span",{children:"Initializing terminal emulator..."})})}),g=(0,d.default)(async()=>{},{loadableGenerated:{modules:[1985]},ssr:!1,loading:()=>(0,b.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,b.jsx)("span",{style:{color:"var(--muted)"},children:"Initializing prompt editor..."})})}),h=(0,d.default)(async()=>{},{loadableGenerated:{modules:[99026]},ssr:!1}),i=(0,d.default)(async()=>{},{loadableGenerated:{modules:[9949]},ssr:!1}),j=(0,d.default)(async()=>{},{loadableGenerated:{modules:[20032]},ssr:!1}),k=(0,d.default)(async()=>{},{loadableGenerated:{modules:[97722]},ssr:!1});a.s(["default",0,function(){let[a,d]=(0,c.useState)([]),[l,m]=(0,c.useState)(null),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(""),[B,C]=(0,c.useState)(3001),[D,E]=(0,c.useState)("0.2.19"),[F,G]=(0,c.useState)(null),H=a.filter(a=>"workspace-terminal"!==a.id),I=a.find(a=>a.id===l),J=H.some(a=>("claude-docker"===a.type||"aider-docker"===a.type)&&"running"===a.status),K=H.some(a=>"claude-ssh"===a.type&&"running"===a.status),L=async()=>{try{let a=await fetch("/api/sessions"),b=await a.json();b.sessions&&d(b.sessions),b.wsPort&&C(b.wsPort),b.originalCwd&&A(b.originalCwd),b.version&&E(b.version)}catch(a){console.error("Failed to fetch sessions:",a)}},M=async()=>{try{let a=await fetch("/api/recents");if(a.ok){let b=await a.json();b.success&&b.recents&&b.recents.lastSession&&G(b.recents.lastSession)}}catch(a){console.error("Failed to fetch recents:",a)}};(0,c.useEffect)(()=>{(async()=>{await L(),await M()})(),"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").then(a=>console.log("Service Worker registered:",a.scope)).catch(a=>console.error("Service Worker registration failed:",a));let a=setInterval(L,4e3);return()=>clearInterval(a)},[]);let N=async(a,b,c,d)=>{o(!0);try{let e=b;e||("claude"===a?e="Claude Local":"claude-docker"===a?e="Claude Docker":"claude-ssh"===a?e="Claude SSH":"aider"===a?e="Aider Local":"aider-docker"===a?e="Aider Docker":"mock"===a&&(e="Mock Session"));let f={type:a,name:e,workspaceRoot:c,scopedDirs:d};if(("aider"===a||"aider-docker"===a)&&!c)try{let a=await fetch("/api/context/aider");if(a.ok){let b=await a.json();b.success&&b.config&&(f.workspaceRoot=b.config.workspaceRoot,f.scopedDirs=b.config.scopedDirs)}}catch(a){console.error("Failed to load aider configuration before launch:",a)}let g=await fetch("/api/sessions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}),h=await g.json();h.success&&(await L(),m(h.session.id),G({type:a,name:e,workspaceRoot:c,scopedDirs:d}))}catch(a){console.error("Failed to launch session:",a)}finally{o(!1)}},O=async(a,b=!1)=>{try{let c=await fetch("/api/sessions/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,delete:b})});(await c.json()).success&&(b&&l===a&&m(null),await L())}catch(a){console.error("Failed to stop session:",a)}};return(0,b.jsxs)("div",{className:`${e.default.container} ${I?e.default.containerActive:""}`,children:[(0,b.jsxs)("header",{className:e.default.header,children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1.5rem"},children:[(0,b.jsx)("img",{src:"/logo.png",alt:"NeuralLoom Logo",style:{width:"160px",height:"160px",borderRadius:"16px",objectFit:"contain"}}),(0,b.jsxs)("div",{className:e.default.logoArea,children:[(0,b.jsx)("h1",{className:e.default.title,style:{margin:0,lineHeight:1.1},children:"NeuralLoom"}),(0,b.jsx)("span",{className:e.default.subtitle,children:"Unified AI Orchestrator & Context Bridge"})]})]}),(0,b.jsxs)("div",{className:e.default.statusIndicator,children:[(0,b.jsx)("span",{className:e.default.pulseDot}),(0,b.jsx)("span",{children:"Orchestrator Online"})]})]}),I?(0,b.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:(0,b.jsx)(k,{sessionId:I.id,workspaceRoot:I.workspaceRoot||"",scopedDirs:I.scopedDirs||[],onClose:()=>m(null),sessions:a,onSwitchSession:a=>m(a),onRefreshSessions:L,wsPort:B})}):(0,b.jsxs)("div",{className:e.default.dashboardGrid,children:[(0,b.jsxs)("main",{className:e.default.mainPanel,children:[(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Active AI Agents"}),0===H.length?(0,b.jsxs)("div",{className:"card",style:{padding:"3rem 1.5rem",textAlign:"center"},children:[(0,b.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,b.jsxs)("div",{style:{display:"flex",gap:"1rem",justifyContent:"center",flexWrap:"wrap"},children:[F&&(0,b.jsx)("button",{className:e.default.quickLaunchBtn,onClick:()=>{N(F.type,F.name,F.workspaceRoot,F.scopedDirs)},disabled:n,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none",maxWidth:"200px"},title:`Re-launch: ${F.name||F.type}`,children:"⚡ Re-launch Last Session"}),(0,b.jsx)("button",{className:e.default.quickLaunchBtn,onClick:()=>{y(!1),w(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none",maxWidth:"200px"},children:"Launch Claude PTY"}),(0,b.jsx)("button",{className:e.default.quickLaunchBtn,onClick:()=>{u(!1),s(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none",maxWidth:"200px"},children:"Launch Aider PTY"})]}),(0,b.jsxs)("div",{style:{marginTop:"1.5rem",fontSize:"0.75rem",color:"var(--muted)"},children:["Want to verify layout features first?"," ",(0,b.jsx)("span",{onClick:()=>N("mock"),style:{color:"var(--primary)",cursor:"pointer",textDecoration:"underline"},children:"Start simulated sandbox session"})]})]}):(0,b.jsx)("div",{className:e.default.agentGrid,children:H.map(a=>(0,b.jsxs)("div",{className:`${e.default.agentCard} card ${l===a.id?e.default.activeBorder:""}`,children:[(0,b.jsxs)("div",{className:e.default.agentHeader,children:[(0,b.jsx)("span",{className:e.default.agentName,children:a.name}),(0,b.jsx)("span",{className:`${e.default.agentBadge} ${"stopped"===a.status?e.default.stoppedBadge:""}`,children:a.status})]}),(0,b.jsxs)("div",{className:e.default.cardBody,children:[(0,b.jsxs)("p",{style:{fontSize:"0.825rem",color:"var(--muted)"},children:["ID: ",(0,b.jsx)("code",{style:{fontSize:"0.75rem"},children:a.id.substring(0,8)}),(0,b.jsx)("br",{}),"Type: ","claude"===a.type?"Claude Local PTY":"claude-docker"===a.type?"Claude Docker PTY":"claude-ssh"===a.type?"Claude SSH PTY":"aider"===a.type?"Aider Local PTY":"aider-docker"===a.type?"Aider Docker PTY":"mock"===a.type?"Simulated Mock PTY":"Unknown PTY",(0,b.jsx)("br",{}),"Logs: ",a.logsCount," captured lines"]}),(0,b.jsxs)("div",{style:{display:"flex",gap:"0.5rem",marginTop:"1rem"},children:["running"===a.status?(0,b.jsx)("button",{onClick:()=>O(a.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,b.jsx)("button",{onClick:()=>O(a.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,b.jsx)("button",{onClick:()=>m(a.id),style:{flex:2,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"none",backgroundColor:l===a.id?"var(--border-focus)":"var(--primary)",fontSize:"0.75rem",fontWeight:600,color:"#fff"},children:l===a.id?"Connected":"Open Session"})]})]})]},a.id))})]}),l&&"workspace-terminal"!==l&&(0,b.jsxs)("section",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border-focus)"},children:[(0,b.jsxs)("div",{className:e.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(109, 40, 217, 0.08)"},children:[(0,b.jsxs)("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:["🖥️ Console Bridge — ",a.find(a=>a.id===l)?.name]}),(0,b.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[a.find(a=>a.id===l)?.status==="stopped"&&(0,b.jsx)("button",{onClick:async()=>{try{let a=await fetch("/api/sessions/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:l})});if(a.ok)await L();else{let b=await a.json();alert(b.error||"Failed to restart session.")}}catch(a){console.error("Failed to restart session:",a),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,b.jsx)("button",{onClick:()=>m(null),style:{border:"none",background:"none",color:"var(--muted)",cursor:"pointer",fontSize:"0.75rem"},children:"Close Panel ✖"})]})]}),(0,b.jsx)(f,{sessionId:l,wsPort:B})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Workspace Shell Terminal"}),(0,b.jsxs)("div",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border)",padding:0},children:[(0,b.jsxs)("div",{className:e.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(255, 255, 255, 0.02)"},children:[(0,b.jsxs)("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem",fontSize:"0.85rem"},children:["💻 Local Workspace Shell (CWD: ",z||"root",")"]}),(0,b.jsx)("span",{style:{fontSize:"0.7rem",color:"var(--muted)"},children:"Pre-configured environment"})]}),(0,b.jsx)(f,{sessionId:"workspace-terminal",height:"300px",wsPort:B})]})]}),(0,b.jsxs)("section",{style:{marginTop:"2rem"},children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Shared Context Hub & Slash Commands"}),(0,b.jsxs)("div",{className:e.default.contextList,children:[(0,b.jsxs)("div",{className:`${e.default.contextItem} card`,children:[(0,b.jsxs)("div",{className:e.default.contextMeta,children:[(0,b.jsx)("span",{className:e.default.contextTitle,children:"Staged Context & System Rules (/ccc)"}),(0,b.jsx)("span",{className:e.default.contextDetails,children:"Compiles AGENTS.md guidelines and project files folder hierarchy map."})]}),(0,b.jsx)("button",{onClick:async()=>{l&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:l,command:"/ccc"})})},disabled:!l,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.75rem",fontWeight:600,opacity:l?1:.5,cursor:l?"pointer":"not-allowed"},children:"🚀 Mount Context (/ccc)"})]}),(0,b.jsxs)("div",{className:`${e.default.contextItem} card`,children:[(0,b.jsxs)("div",{className:e.default.contextMeta,children:[(0,b.jsx)("span",{className:e.default.contextTitle,children:"Staged Developer Prompt (/ccp)"}),(0,b.jsx)("span",{className:e.default.contextDetails,children:"Executes instructions written in .ai/neural-loom/cprompt.md."})]}),(0,b.jsx)("button",{onClick:async()=>{l&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:l,command:"/ccp"})})},disabled:!l,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--success)",backgroundColor:"transparent",color:"var(--success)",fontSize:"0.75rem",fontWeight:600,opacity:l?1:.5,cursor:l?"pointer":"not-allowed"},children:"⚡ Trigger Prompt (/ccp)"})]})]}),(0,b.jsx)(g,{})]})]}),(0,b.jsxs)("aside",{className:e.default.sidePanel,children:[(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Execution Environments"}),(0,b.jsxs)("div",{className:e.default.envGrid,children:[(0,b.jsxs)("div",{className:e.default.envRow,children:[(0,b.jsx)("span",{className:e.default.envName,children:"💻 Local host OS"}),(0,b.jsx)("span",{className:e.default.envStatus,style:{color:"var(--success)"},children:"Active"})]}),(0,b.jsxs)("div",{className:e.default.envRow,style:{opacity:J?1:.6},children:[(0,b.jsx)("span",{className:e.default.envName,children:"🐳 Docker Sandbox"}),(0,b.jsx)("span",{className:e.default.envStatus,style:{color:J?"var(--success)":"var(--muted)"},children:J?"Active":"Not Mounted"})]}),(0,b.jsxs)("div",{className:e.default.envRow,style:{opacity:K?1:.6},children:[(0,b.jsx)("span",{className:e.default.envName,children:"🌐 Remote VM (SSH)"}),(0,b.jsx)("span",{className:e.default.envStatus,style:{color:K?"var(--success)":"var(--muted)"},children:K?"Active":"Disconnected"})]})]})]}),(0,b.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{y(!1),w(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🤖"}),(0,b.jsx)("span",{children:"Launch Claude PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{y(!0),w(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(170, 72%, 40%) 0%, hsl(195, 100%, 40%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🐳"}),(0,b.jsx)("span",{children:"Launch Docker PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>q(!0),disabled:n,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🌐"}),(0,b.jsx)("span",{children:"Launch SSH PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{u(!1),s(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🐍"}),(0,b.jsx)("span",{children:"Launch Aider PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{u(!0),s(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(195, 100%, 40%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🐳"}),(0,b.jsx)("span",{children:"Launch Aider Docker"})]})]}),(0,b.jsxs)("section",{className:"card",style:{padding:"1.5rem",display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,b.jsx)("h3",{style:{fontSize:"1rem",fontWeight:700},children:"Quick Actions"}),(0,b.jsxs)("ul",{style:{listStyle:"none",fontSize:"0.875rem",display:"flex",flexDirection:"column",gap:"0.5rem",color:"var(--muted)"},children:[(0,b.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,b.jsx)("span",{children:"Configure global API Keys"}),(0,b.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,b.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,b.jsx)("span",{children:"Edit rules templates"}),(0,b.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,b.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,b.jsx)("span",{children:"Inspect process locks"}),(0,b.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]})]}),(0,b.jsxs)("div",{style:{marginTop:"1.2rem",textAlign:"center",fontSize:"0.72rem",color:"var(--muted)"},children:["Need to troubleshoot?"," ",(0,b.jsx)("span",{onClick:()=>N("mock"),style:{color:"var(--primary)",cursor:"pointer",textDecoration:"underline"},children:"Launch simulated playground sandbox"})]})]})]})]}),(0,b.jsxs)("footer",{className:e.default.footer,children:[(0,b.jsxs)("span",{children:["NeuralLoom v",D," — Experimental AI Orchestrator Bridge"]}),(0,b.jsxs)("span",{children:["Directory: ",z||"Loading..."]})]}),p&&(0,b.jsx)(h,{onClose:()=>q(!1),onConfirmLaunch:()=>{q(!1),N("claude-ssh")}}),r&&(0,b.jsx)(i,{onClose:()=>s(!1),isDocker:t,onConfirmLaunch:()=>{s(!1),N(t?"aider-docker":"aider")}}),v&&(0,b.jsx)(j,{onClose:()=>w(!1),isDocker:x,onConfirmLaunch:(a,b,c)=>{w(!1),N(x?"claude-docker":"claude",a,b,c)}})]})}])}];
1
+ module.exports=[41997,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={BailoutToCSRError:function(){return g},isBailoutToCSRError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="BAILOUT_TO_CLIENT_SIDE_RENDERING";class g extends Error{constructor(a){super(`Bail out to client-side rendering: ${a}`),this.reason=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&a.digest===f}},32245,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"BailoutToCSR",{enumerable:!0,get:function(){return e}});let d=a.r(41997);function e({reason:a,children:b}){throw Object.defineProperty(new d.BailoutToCSRError(a),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}},7773,(a,b,c)=>{"use strict";function d(a){return a.split("/").map(a=>encodeURIComponent(a)).join("/")}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"encodeURIPath",{enumerable:!0,get:function(){return d}})},68063,(a,b,c)=>{"use strict";let d;Object.defineProperty(c,"__esModule",{value:!0});var e={getAssetToken:function(){return i},getAssetTokenQuery:function(){return j},getDeploymentId:function(){return g},getDeploymentIdQuery:function(){return h}};for(var f in e)Object.defineProperty(c,f,{enumerable:!0,get:e[f]});function g(){return d}function h(a=!1){return d?`${a?"&":"?"}dpl=${d}`:""}function i(){return!1}function j(a=!1){return""}d=void 0},97458,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"PreloadChunks",{enumerable:!0,get:function(){return i}});let d=a.r(87924),e=a.r(35112),f=a.r(56704),g=a.r(7773),h=a.r(68063);function i({moduleIds:a}){let b=f.workAsyncStorage.getStore();if(void 0===b)return null;let c=[];if(b.reactLoadableManifest&&a){let d=b.reactLoadableManifest;for(let b of a){if(!d[b])continue;let a=d[b].files;c.push(...a)}}if(0===c.length)return null;let j=(0,h.getAssetTokenQuery)();return(0,d.jsx)(d.Fragment,{children:c.map(a=>{let c=`${b.assetPrefix}/_next/${(0,g.encodeURIPath)(a)}${j}`;return a.endsWith(".css")?(0,d.jsx)("link",{precedence:"dynamic",href:c,rel:"stylesheet",as:"style",nonce:b.nonce},a):((0,e.preload)(c,{as:"script",fetchPriority:"low",nonce:b.nonce}),null)})})}},69853,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return j}});let d=a.r(87924),e=a.r(72131),f=a.r(32245),g=a.r(97458);function h(a){return{default:a&&"default"in a?a.default:a}}let i={loader:()=>Promise.resolve(h(()=>null)),loading:null,ssr:!0},j=function(a){let b={...i,...a},c=(0,e.lazy)(()=>b.loader().then(h)),j=b.loading;function k(a){let h=j?(0,d.jsx)(j,{isLoading:!0,pastDelay:!0,error:null}):null,i=!b.ssr||!!b.loading,k=i?e.Suspense:e.Fragment,l=b.ssr?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.PreloadChunks,{moduleIds:b.modules}),(0,d.jsx)(c,{...a})]}):(0,d.jsx)(f.BailoutToCSR,{reason:"next/dynamic",children:(0,d.jsx)(c,{...a})});return(0,d.jsx)(k,{...i?{fallback:h}:{},children:l})}return k.displayName="LoadableComponent",k}},19721,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return e}});let d=a.r(33354)._(a.r(69853));function e(a,b){let c={};"function"==typeof a&&(c.loader=a);let e={...c,...b};return(0,d.default)({...e,modules:e.loadableGenerated?.modules})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},46845,a=>{a.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"})},40777,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(19721),e=a.i(46845);function f({workspaceRoot:a}){let[d,e]=(0,c.useState)({global:[],workspace:[]}),[h,i]=(0,c.useState)(null),[j,k]=(0,c.useState)(!0),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)(null),[p,q]=(0,c.useState)({}),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)("SELECT * FROM sqlite_master;"),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(null),[z,A]=(0,c.useState)(null),[B,C]=(0,c.useState)(!1),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)({id:"",name:"",type:"sqlite",filepath:"./dev.db",host:"localhost",port:5432,database:"postgres",username:"postgres",password:"",ssl:!1,readOnly:!0}),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(null),L=async()=>{try{let b=await fetch(`/api/sql/connections?root=${encodeURIComponent(a)}`);if(b.ok){let a=await b.json();a.success&&(e({global:a.global||[],workspace:a.workspace||[]}),i(a.activeId),k(a.isActiveGlobal))}}catch(a){console.error("Failed to load connection profiles:",a)}},M=async()=>{if(!h)return void m([]);s(!0);try{let b=await fetch(`/api/sql/schema?action=list_tables&root=${encodeURIComponent(a)}`);if(b.ok){let a=await b.json();a.success?(m(a.tables||[]),y(null)):y(a.error||"Failed to load database schema.")}else{let a=await b.json();y(a.error||"Failed to load database schema.")}}catch(a){console.error("Failed to load schema:",a)}finally{s(!1)}},N=async b=>{if(p[b])return void o(n===b?null:b);try{let c=await fetch(`/api/sql/schema?action=describe_table&table=${encodeURIComponent(b)}&root=${encodeURIComponent(a)}`);if(c.ok){let a=await c.json();a.success&&(q(c=>({...c,[b]:a.columns})),o(b))}}catch(a){console.error(`Failed to load columns for table ${b}:`,a)}};(0,c.useEffect)(()=>{L()},[a]),(0,c.useEffect)(()=>{M(),A(null),o(null),q({});let a=j?d.global.find(a=>a.id===h):d.workspace.find(a=>a.id===h);a&&("sqlite"===a.type?u("SELECT name, type FROM sqlite_master WHERE type='table';"):u("SELECT * FROM information_schema.tables LIMIT 10;"))},[h,j,d.global.length,d.workspace.length]);let O=async(b,c)=>{try{(await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"set_active",profileId:b,isGlobal:c,root:a})})).ok&&(i(b),k(c))}catch(a){console.error("Failed to set active profile:",a)}},P=async()=>{K(null);try{let b=await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"test",profile:F,root:a})}),c=await b.json();c.success?K({success:!0,message:"Connection test successful!"}):K({success:!1,message:c.error||"Connection test failed."})}catch(a){K({success:!1,message:a.message||"Failed to make test query."})}},Q=async b=>{if(b.preventDefault(),!F.name||!F.type)return;I(!0);let c=F.id||`profile_${Math.random().toString(36).substring(7)}`,d={...F,id:c,name:F.name,type:F.type};try{(await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"save",profile:d,isGlobal:D,root:a})})).ok&&(await L(),C(!1),h||O(c,D))}catch(a){console.error("Failed to save profile:",a)}finally{I(!1)}},R=async(b,c)=>{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:b,isGlobal:c,root:a})})).ok&&(await L(),h===b&&i(null))}catch(a){console.error("Failed to delete connection profile:",a)}},S=async()=>{if(t.trim()&&h){w(!0),y(null),A(null);try{let b=await fetch("/api/sql/query",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sql:t.trim(),root:a})}),c=await b.json();b.ok&&c.success?(A({rows:c.rows||[],fields:c.fields||[],durationMs:c.durationMs||0,affectedRows:c.affectedRows}),(t.toLowerCase().includes("create table")||t.toLowerCase().includes("drop table")||t.toLowerCase().includes("alter table"))&&M()):y(c.error||"Failed to execute query.")}catch(a){y(a.message||"An unexpected error occurred during execution.")}finally{w(!1)}}},T=j?d.global.find(a=>a.id===h):d.workspace.find(a=>a.id===h);return(0,b.jsxs)("div",{style:g.container,children:[(0,b.jsxs)("div",{style:g.sidebar,children:[(0,b.jsxs)("div",{style:g.section,children:[(0,b.jsxs)("div",{style:g.sectionHeader,children:[(0,b.jsx)("span",{style:g.sectionTitle,children:"Connections"}),(0,b.jsx)("button",{style:g.addBtn,onClick:()=>{K(null),G({id:"",name:"",type:"sqlite",filepath:"./dev.db",host:"localhost",port:5432,database:"postgres",username:"postgres",password:"",ssl:!1,readOnly:!0}),E(!1),C(!0)},title:"Add Database Connection Profile",children:"➕ Add"})]}),(0,b.jsxs)("div",{style:g.profileList,children:[0===d.global.length&&0===d.workspace.length&&(0,b.jsx)("div",{style:g.emptyText,children:"No connections configured. Add one to start."}),d.workspace.length>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{style:g.groupHeader,children:"WORKSPACE CONNECTIONS"}),d.workspace.map(a=>(0,b.jsxs)("div",{style:{...g.profileItem,...h===a.id&&!j?g.profileItemActive:{}},onClick:()=>O(a.id,!1),children:[(0,b.jsxs)("div",{style:g.profileMeta,children:[(0,b.jsxs)("span",{style:g.profileName,children:["📁 ",a.name]}),(0,b.jsx)("span",{style:g.profileType,children:a.type})]}),(0,b.jsx)("button",{style:g.deleteProfileBtn,onClick:b=>{b.stopPropagation(),R(a.id,!1)},children:"✖"})]},a.id))]}),d.global.length>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{style:g.groupHeader,children:"GLOBAL CONNECTIONS"}),d.global.map(a=>(0,b.jsxs)("div",{style:{...g.profileItem,...h===a.id&&j?g.profileItemActive:{}},onClick:()=>O(a.id,!0),children:[(0,b.jsxs)("div",{style:g.profileMeta,children:[(0,b.jsxs)("span",{style:g.profileName,children:["🌐 ",a.name]}),(0,b.jsx)("span",{style:g.profileType,children:a.type})]}),(0,b.jsx)("button",{style:g.deleteProfileBtn,onClick:b=>{b.stopPropagation(),R(a.id,!0)},children:"✖"})]},a.id))]})]})]}),(0,b.jsxs)("div",{style:{...g.section,flex:1,borderTop:"1px solid var(--border)"},children:[(0,b.jsxs)("div",{style:g.sectionHeader,children:[(0,b.jsx)("span",{style:g.sectionTitle,children:"Schema Tables"}),r&&(0,b.jsx)("span",{style:g.spinnerMini})]}),(0,b.jsxs)("div",{style:g.tableList,children:[!h&&(0,b.jsx)("div",{style:g.emptyText,children:"Select an active connection to view tables."}),h&&0===l.length&&!r&&(0,b.jsx)("div",{style:g.emptyText,children:"No tables found in database schema."}),l.map(a=>(0,b.jsxs)("div",{style:g.tableTreeItem,children:[(0,b.jsxs)("div",{style:g.tableRow,onClick:()=>N(a.name),children:[(0,b.jsx)("span",{style:g.tableIcon,children:"view"===a.type?"👁️":"📊"}),(0,b.jsx)("span",{style:g.tableName,children:a.name}),(0,b.jsx)("span",{style:g.tableChevron,children:n===a.name?"▼":"▶"})]}),n===a.name&&p[a.name]&&(0,b.jsx)("div",{style:g.columnList,children:p[a.name].map(a=>(0,b.jsxs)("div",{style:g.columnItem,children:[(0,b.jsx)("span",{style:g.columnIcon,children:a.isPrimaryKey?"🔑":a.isForeignKey?"🔗":"▫"}),(0,b.jsx)("span",{style:g.columnName,title:a.type,children:a.name}),(0,b.jsx)("span",{style:g.columnType,children:a.type.toLowerCase().substring(0,12)})]},a.name))})]},a.name))]})]})]}),(0,b.jsxs)("div",{style:g.mainContent,children:[(0,b.jsxs)("div",{style:g.statusBar,children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[(0,b.jsx)("span",{style:g.statusLabel,children:"Active Connection:"}),T?(0,b.jsxs)("span",{style:g.statusValue,children:[j?"🌐":"📁"," ",T.name," (",T.type,")",T.readOnly&&(0,b.jsx)("span",{style:g.readOnlyBadge,children:"Read-Only"})]}):(0,b.jsx)("span",{style:{...g.statusValue,color:"var(--danger)"},children:"No Connection Selected"})]}),(0,b.jsx)("button",{style:{...g.runBtn,opacity:!h||v?.6:1,cursor:!h||v?"not-allowed":"pointer"},onClick:S,disabled:!h||v,children:v?"⌛ Running...":"⚡ Execute Query (F5)"})]}),(0,b.jsx)("div",{style:g.editorArea,children:(0,b.jsx)("textarea",{style:g.textarea,value:t,onChange:a=>u(a.target.value),placeholder:"Write your SQL query script here...",onKeyDown:a=>{("F5"===a.key||a.ctrlKey&&"Enter"===a.key)&&(a.preventDefault(),S())}})}),(0,b.jsxs)("div",{style:g.resultsArea,children:[x&&(0,b.jsxs)("div",{style:g.errorContainer,children:[(0,b.jsx)("h4",{style:{margin:"0 0 0.5rem 0",color:"var(--danger)"},children:"⚠️ Execution Error"}),(0,b.jsx)("pre",{style:g.errorText,children:x}),x.includes("not installed")&&(0,b.jsxs)("div",{style:g.driverPrompt,children:[(0,b.jsx)("p",{style:{margin:"0 0 0.5rem 0"},children:"To resolve this, run this installer command in your workspace terminal:"}),(0,b.jsx)("code",{style:g.driverCode,children:T?.type==="sqlite"?"npm install better-sqlite3":T?.type==="postgres"?"npm install pg":"npm install mysql2"})]})]}),z&&(0,b.jsxs)("div",{style:g.resultsWrapper,children:[(0,b.jsxs)("div",{style:g.resultsMeta,children:[(0,b.jsxs)("span",{children:["Query completed."," ",void 0!==z.affectedRows?`Affected rows: ${z.affectedRows}`:`Returned ${z.rows.length} rows`]}),(0,b.jsxs)("span",{children:["Duration: ",z.durationMs,"ms"]})]}),z.rows.length>0?(0,b.jsx)("div",{style:g.tableContainer,children:(0,b.jsxs)("table",{style:g.table,children:[(0,b.jsx)("thead",{children:(0,b.jsx)("tr",{children:z.fields.map(a=>(0,b.jsx)("th",{style:g.th,children:a},a))})}),(0,b.jsx)("tbody",{children:z.rows.map((a,c)=>(0,b.jsx)("tr",{style:c%2==0?g.trEven:g.trOdd,children:z.fields.map(c=>(0,b.jsx)("td",{style:g.td,children:null===a[c]?"NULL":"object"==typeof a[c]?JSON.stringify(a[c]):String(a[c])},c))},c))})]})}):void 0===z.affectedRows&&(0,b.jsx)("div",{style:g.emptyResults,children:"Query executed successfully, but returned 0 results."})]}),!x&&!z&&!v&&(0,b.jsx)("div",{style:g.emptyResults,children:"Write a query script and click Execute to view table records."}),v&&(0,b.jsxs)("div",{style:g.loadingWrapper,children:[(0,b.jsx)("span",{style:g.spinnerLarge}),(0,b.jsx)("span",{style:{color:"var(--muted)"},children:"Running database statement..."})]})]})]}),B&&(0,b.jsx)("div",{style:g.modalOverlay,children:(0,b.jsxs)("div",{style:g.modalContent,children:[(0,b.jsxs)("h3",{style:{margin:"0 0 1rem 0",display:"flex",justifyContent:"space-between"},children:[(0,b.jsx)("span",{children:"🔌 Add Database Profile"}),(0,b.jsx)("span",{style:{cursor:"pointer"},onClick:()=>C(!1),children:"✖"})]}),(0,b.jsxs)("form",{onSubmit:Q,children:[(0,b.jsxs)("div",{style:g.formRow,children:[(0,b.jsx)("label",{style:g.label,children:"Profile Name"}),(0,b.jsx)("input",{style:g.input,type:"text",required:!0,value:F.name,onChange:a=>G(b=>({...b,name:a.target.value})),placeholder:"e.g. Local Postgres, Dev SQLite"})]}),(0,b.jsxs)("div",{style:g.formRow,children:[(0,b.jsx)("label",{style:g.label,children:"Scope Level"}),(0,b.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,b.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,b.jsx)("input",{type:"radio",checked:!D,onChange:()=>E(!1)}),"Workspace Local"]}),(0,b.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,b.jsx)("input",{type:"radio",checked:D,onChange:()=>E(!0)}),"Global User Profile"]})]})]}),(0,b.jsxs)("div",{style:g.formRow,children:[(0,b.jsx)("label",{style:g.label,children:"Database Type"}),(0,b.jsxs)("select",{style:g.select,value:F.type,onChange:a=>G(b=>({...b,type:a.target.value,filepath:"sqlite"===a.target.value?"./dev.db":void 0})),children:[(0,b.jsx)("option",{value:"sqlite",children:"SQLite (Local File)"}),(0,b.jsx)("option",{value:"postgres",children:"PostgreSQL"}),(0,b.jsx)("option",{value:"mysql",children:"MySQL"})]})]}),"sqlite"===F.type?(0,b.jsxs)("div",{style:g.formRow,children:[(0,b.jsx)("label",{style:g.label,children:"Database File Path"}),(0,b.jsx)("input",{style:g.input,type:"text",required:!0,value:F.filepath||"",onChange:a=>G(b=>({...b,filepath:a.target.value})),placeholder:"Relative (e.g. ./data/dev.db) or Absolute path"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,b.jsxs)("div",{style:{...g.formRow,flex:3},children:[(0,b.jsx)("label",{style:g.label,children:"Host IP Address"}),(0,b.jsx)("input",{style:g.input,type:"text",required:!0,value:F.host||"",onChange:a=>G(b=>({...b,host:a.target.value})),placeholder:"localhost or IP"})]}),(0,b.jsxs)("div",{style:{...g.formRow,flex:1},children:[(0,b.jsx)("label",{style:g.label,children:"Port"}),(0,b.jsx)("input",{style:g.input,type:"number",required:!0,value:F.port||0,onChange:a=>G(b=>({...b,port:parseInt(a.target.value)}))})]})]}),(0,b.jsxs)("div",{style:g.formRow,children:[(0,b.jsx)("label",{style:g.label,children:"Database Name"}),(0,b.jsx)("input",{style:g.input,type:"text",required:!0,value:F.database||"",onChange:a=>G(b=>({...b,database:a.target.value}))})]}),(0,b.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,b.jsxs)("div",{style:{...g.formRow,flex:1},children:[(0,b.jsx)("label",{style:g.label,children:"Username"}),(0,b.jsx)("input",{style:g.input,type:"text",required:!0,value:F.username||"",onChange:a=>G(b=>({...b,username:a.target.value}))})]}),(0,b.jsxs)("div",{style:{...g.formRow,flex:1},children:[(0,b.jsx)("label",{style:g.label,children:"Password"}),(0,b.jsx)("input",{style:g.input,type:"password",value:F.password||"",onChange:a=>G(b=>({...b,password:a.target.value}))})]})]}),"postgres"===F.type&&(0,b.jsx)("div",{style:g.formRow,children:(0,b.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,b.jsx)("input",{type:"checkbox",checked:!!F.ssl,onChange:a=>G(b=>({...b,ssl:a.target.checked}))}),"Require SSL Secure Connection"]})})]}),(0,b.jsx)("div",{style:g.formRow,children:(0,b.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,b.jsx)("input",{type:"checkbox",checked:!!F.readOnly,onChange:a=>G(b=>({...b,readOnly:a.target.checked}))}),"Enforce Read-Only Connection (Disable mutations)"]})}),J&&(0,b.jsx)("div",{style:{...g.testResult,backgroundColor:J.success?"rgba(16, 185, 129, 0.12)":"rgba(239, 68, 68, 0.12)",border:J.success?"1px solid var(--success)":"1px solid var(--danger)",color:J.success?"var(--success)":"var(--danger)"},children:J.message}),(0,b.jsxs)("div",{style:g.modalFooter,children:[(0,b.jsx)("button",{type:"button",style:g.testBtn,onClick:P,children:"🔍 Test Connection"}),(0,b.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,b.jsx)("button",{type:"button",style:g.cancelBtn,onClick:()=>C(!1),children:"Cancel"}),(0,b.jsx)("button",{type:"submit",style:g.saveBtn,disabled:H,children:H?"Saving...":"Save Profile"})]})]})]})]})})]})}let g={container:{display:"flex",height:"100%",width:"100%",backgroundColor:"#05070a",color:"#cbd5e1",fontSize:"0.875rem",minHeight:0},sidebar:{width:"280px",borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",minHeight:0,backgroundColor:"rgba(10, 15, 24, 0.4)",flexShrink:0},section:{display:"flex",flexDirection:"column",padding:"1rem",minHeight:0},sectionHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.75rem"},sectionTitle:{fontWeight:700,letterSpacing:"0.05em",textTransform:"uppercase",fontSize:"0.75rem",color:"var(--muted)"},addBtn:{padding:"0.2rem 0.5rem",borderRadius:"4px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.7rem",fontWeight:600,cursor:"pointer"},profileList:{display:"flex",flexDirection:"column",gap:"0.4rem",overflowY:"auto",maxHeight:"220px"},groupHeader:{fontSize:"0.65rem",fontWeight:600,color:"var(--muted)",marginTop:"0.5rem",marginBottom:"0.2rem",letterSpacing:"0.05em"},profileItem:{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"},profileItemActive:{backgroundColor:"rgba(109, 40, 217, 0.08)",border:"1px solid var(--border-focus)",boxShadow:"0 0 10px rgba(109, 40, 217, 0.1)"},profileMeta:{display:"flex",flexDirection:"column",gap:"0.15rem",flex:1,minWidth:0},profileName:{fontWeight:600,fontSize:"0.8rem",color:"#fff",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},profileType:{fontSize:"0.7rem",color:"var(--muted)",textTransform:"uppercase"},deleteProfileBtn:{background:"none",border:"none",color:"rgba(239, 68, 68, 0.4)",cursor:"pointer",fontSize:"0.75rem",padding:"0.25rem"},tableList:{display:"flex",flexDirection:"column",gap:"0.25rem",overflowY:"auto",flex:1,minHeight:0},emptyText:{fontSize:"0.75rem",color:"var(--muted)",textAlign:"center",padding:"1rem 0"},tableTreeItem:{display:"flex",flexDirection:"column"},tableRow:{display:"flex",alignItems:"center",padding:"0.35rem 0.5rem",borderRadius:"4px",cursor:"pointer",userSelect:"none",transition:"background 0.2s ease"},tableIcon:{marginRight:"0.4rem",fontSize:"0.9rem"},tableName:{flex:1,fontSize:"0.8rem",color:"#e2e8f0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},tableChevron:{fontSize:"0.6rem",color:"var(--muted)",marginLeft:"0.25rem"},columnList:{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"},columnItem:{display:"flex",alignItems:"center",padding:"0.15rem 0.25rem",fontSize:"0.75rem"},columnIcon:{marginRight:"0.3rem",fontSize:"0.7rem"},columnName:{flex:1,color:"var(--muted)",overflow:"hidden",textOverflow:"ellipsis"},columnType:{fontSize:"0.65rem",color:"rgba(109, 40, 217, 0.75)",fontFamily:"monospace",paddingLeft:"0.5rem"},mainContent:{flex:1,display:"flex",flexDirection:"column",minHeight:0,backgroundColor:"#05070a"},statusBar:{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},statusLabel:{fontSize:"0.75rem",color:"var(--muted)"},statusValue:{fontSize:"0.8rem",fontWeight:600,color:"#fff",display:"flex",alignItems:"center",gap:"0.4rem"},readOnlyBadge:{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)"},runBtn:{padding:"0.4rem 0.9rem",borderRadius:"6px",border:"none",backgroundColor:"var(--primary)",color:"#fff",fontSize:"0.8rem",fontWeight:600,transition:"all 0.2s ease"},editorArea:{height:"180px",borderBottom:"1px solid var(--border)",position:"relative",flexShrink:0},textarea:{width:"100%",height:"100%",backgroundColor:"#080c14",border:"none",resize:"none",color:"#e2e8f0",fontFamily:"monospace",fontSize:"0.85rem",padding:"1rem",outline:"none",lineHeight:"1.4"},resultsArea:{flex:1,display:"flex",flexDirection:"column",minHeight:0,padding:"1rem"},errorContainer:{padding:"1rem",borderRadius:"8px",backgroundColor:"rgba(239, 68, 68, 0.08)",border:"1px solid rgba(239, 68, 68, 0.2)",overflowY:"auto"},errorText:{margin:0,fontFamily:"monospace",fontSize:"0.8rem",color:"#f87171",whiteSpace:"pre-wrap"},driverPrompt:{marginTop:"1rem",padding:"0.75rem",borderRadius:"6px",backgroundColor:"rgba(0, 0, 0, 0.3)",border:"1px solid var(--border)"},driverCode:{display:"block",padding:"0.5rem",backgroundColor:"#090d16",borderRadius:"4px",fontFamily:"monospace",fontSize:"0.8rem",color:"var(--primary)",border:"1px solid var(--border)"},resultsWrapper:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},resultsMeta:{display:"flex",justifyContent:"space-between",fontSize:"0.75rem",color:"var(--muted)",marginBottom:"0.5rem"},tableContainer:{flex:1,overflow:"auto",border:"1px solid var(--border)",borderRadius:"6px"},table:{width:"100%",borderCollapse:"collapse",fontFamily:"monospace",fontSize:"0.8rem"},th:{padding:"0.5rem 0.75rem",textAlign:"left",backgroundColor:"#0f172a",borderBottom:"1px solid var(--border)",color:"#94a3b8",fontWeight:600,position:"sticky",top:0,zIndex:1},td:{padding:"0.4rem 0.75rem",borderBottom:"1px solid rgba(255, 255, 255, 0.03)",color:"#cbd5e1",whiteSpace:"nowrap"},trEven:{backgroundColor:"transparent"},trOdd:{backgroundColor:"rgba(255, 255, 255, 0.01)"},emptyResults:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--muted)",fontSize:"0.8rem",textAlign:"center"},loadingWrapper:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"1rem"},spinnerLarge:{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"},spinnerMini:{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"},modalOverlay:{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},modalContent:{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)"},formRow:{display:"flex",flexDirection:"column",gap:"0.35rem",marginBottom:"1rem"},label:{fontSize:"0.75rem",fontWeight:600,color:"var(--muted)"},input:{padding:"0.5rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"#070a12",color:"#fff",outline:"none",fontSize:"0.8rem"},select:{padding:"0.5rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"#070a12",color:"#fff",outline:"none",fontSize:"0.8rem"},testResult:{padding:"0.5rem",borderRadius:"6px",fontSize:"0.75rem",marginBottom:"1rem"},modalFooter:{display:"flex",justifyContent:"space-between",marginTop:"1.5rem"},testBtn:{padding:"0.4rem 0.75rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"transparent",color:"var(--muted)",fontSize:"0.75rem",fontWeight:600,cursor:"pointer"},cancelBtn:{padding:"0.4rem 0.75rem",borderRadius:"6px",border:"none",backgroundColor:"transparent",color:"var(--muted)",fontSize:"0.75rem",fontWeight:600,cursor:"pointer"},saveBtn:{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 a=document.createElement("style");a.innerHTML=`
2
+ @keyframes spin {
3
+ 0% { transform: rotate(0deg); }
4
+ 100% { transform: rotate(360deg); }
5
+ }
6
+ `,document.head.appendChild(a)}let h=(0,d.default)(async()=>{},{loadableGenerated:{modules:[37314]},ssr:!1,loading:()=>(0,b.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,b.jsx)("span",{children:"Initializing terminal emulator..."})})}),i=(0,d.default)(async()=>{},{loadableGenerated:{modules:[1985]},ssr:!1,loading:()=>(0,b.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,b.jsx)("span",{style:{color:"var(--muted)"},children:"Initializing prompt editor..."})})}),j=(0,d.default)(async()=>{},{loadableGenerated:{modules:[99026]},ssr:!1}),k=(0,d.default)(async()=>{},{loadableGenerated:{modules:[9949]},ssr:!1}),l=(0,d.default)(async()=>{},{loadableGenerated:{modules:[20032]},ssr:!1}),m=(0,d.default)(async()=>{},{loadableGenerated:{modules:[97722]},ssr:!1});a.s(["default",0,function(){let[a,d]=(0,c.useState)([]),[g,n]=(0,c.useState)(null),[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(!1),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(!1),[w,x]=(0,c.useState)(!1),[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(""),[C,D]=(0,c.useState)(3001),[E,F]=(0,c.useState)("0.2.19"),[G,H]=(0,c.useState)(null),I=a.filter(a=>"workspace-terminal"!==a.id),J=a.find(a=>a.id===g),K=I.some(a=>("claude-docker"===a.type||"aider-docker"===a.type)&&"running"===a.status),L=I.some(a=>"claude-ssh"===a.type&&"running"===a.status),M=async()=>{try{let a=await fetch("/api/sessions"),b=await a.json();b.sessions&&d(b.sessions),b.wsPort&&D(b.wsPort),b.originalCwd&&B(b.originalCwd),b.version&&F(b.version)}catch(a){console.error("Failed to fetch sessions:",a)}},N=async()=>{try{let a=await fetch("/api/recents");if(a.ok){let b=await a.json();b.success&&b.recents&&b.recents.lastSession&&H(b.recents.lastSession)}}catch(a){console.error("Failed to fetch recents:",a)}};(0,c.useEffect)(()=>{(async()=>{await M(),await N()})(),"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").then(a=>console.log("Service Worker registered:",a.scope)).catch(a=>console.error("Service Worker registration failed:",a));let a=setInterval(M,4e3);return()=>clearInterval(a)},[]);let O=async(a,b,c,d)=>{p(!0);try{let e=b;e||("claude"===a?e="Claude Local":"claude-docker"===a?e="Claude Docker":"claude-ssh"===a?e="Claude SSH":"aider"===a?e="Aider Local":"aider-docker"===a?e="Aider Docker":"mock"===a&&(e="Mock Session"));let f={type:a,name:e,workspaceRoot:c,scopedDirs:d};if(("aider"===a||"aider-docker"===a)&&!c)try{let a=await fetch("/api/context/aider");if(a.ok){let b=await a.json();b.success&&b.config&&(f.workspaceRoot=b.config.workspaceRoot,f.scopedDirs=b.config.scopedDirs)}}catch(a){console.error("Failed to load aider configuration before launch:",a)}let g=await fetch("/api/sessions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}),h=await g.json();h.success&&(await M(),n(h.session.id),H({type:a,name:e,workspaceRoot:c,scopedDirs:d}))}catch(a){console.error("Failed to launch session:",a)}finally{p(!1)}},P=async(a,b=!1)=>{try{let c=await fetch("/api/sessions/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,delete:b})});(await c.json()).success&&(b&&g===a&&n(null),await M())}catch(a){console.error("Failed to stop session:",a)}};return(0,b.jsxs)("div",{className:`${e.default.container} ${J?e.default.containerActive:""}`,children:[(0,b.jsxs)("header",{className:e.default.header,children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1.5rem"},children:[(0,b.jsx)("img",{src:"/logo.png",alt:"NeuralLoom Logo",style:{width:"160px",height:"160px",borderRadius:"16px",objectFit:"contain"}}),(0,b.jsxs)("div",{className:e.default.logoArea,children:[(0,b.jsx)("h1",{className:e.default.title,style:{margin:0,lineHeight:1.1},children:"NeuralLoom"}),(0,b.jsx)("span",{className:e.default.subtitle,children:"Unified AI Orchestrator & Context Bridge"})]})]}),(0,b.jsxs)("div",{className:e.default.statusIndicator,children:[(0,b.jsx)("span",{className:e.default.pulseDot}),(0,b.jsx)("span",{children:"Orchestrator Online"})]})]}),J?(0,b.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:(0,b.jsx)(m,{sessionId:J.id,workspaceRoot:J.workspaceRoot||"",scopedDirs:J.scopedDirs||[],onClose:()=>n(null),sessions:a,onSwitchSession:a=>n(a),onRefreshSessions:M,wsPort:C})}):(0,b.jsxs)("div",{className:e.default.dashboardGrid,children:[(0,b.jsxs)("main",{className:e.default.mainPanel,children:[(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Active AI Agents"}),0===I.length?(0,b.jsxs)("div",{className:"card",style:{padding:"3rem 1.5rem",textAlign:"center"},children:[(0,b.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,b.jsxs)("div",{style:{display:"flex",gap:"1rem",justifyContent:"center",flexWrap:"wrap"},children:[G&&(0,b.jsx)("button",{className:e.default.quickLaunchBtn,onClick:()=>{O(G.type,G.name,G.workspaceRoot,G.scopedDirs)},disabled:o,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none",maxWidth:"200px"},title:`Re-launch: ${G.name||G.type}`,children:"⚡ Re-launch Last Session"}),(0,b.jsx)("button",{className:e.default.quickLaunchBtn,onClick:()=>{z(!1),x(!0)},disabled:o,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none",maxWidth:"200px"},children:"Launch Claude PTY"}),(0,b.jsx)("button",{className:e.default.quickLaunchBtn,onClick:()=>{v(!1),t(!0)},disabled:o,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none",maxWidth:"200px"},children:"Launch Aider PTY"})]}),(0,b.jsxs)("div",{style:{marginTop:"1.5rem",fontSize:"0.75rem",color:"var(--muted)"},children:["Want to verify layout features first?"," ",(0,b.jsx)("span",{onClick:()=>O("mock"),style:{color:"var(--primary)",cursor:"pointer",textDecoration:"underline"},children:"Start simulated sandbox session"})]})]}):(0,b.jsx)("div",{className:e.default.agentGrid,children:I.map(a=>(0,b.jsxs)("div",{className:`${e.default.agentCard} card ${g===a.id?e.default.activeBorder:""}`,children:[(0,b.jsxs)("div",{className:e.default.agentHeader,children:[(0,b.jsx)("span",{className:e.default.agentName,children:a.name}),(0,b.jsx)("span",{className:`${e.default.agentBadge} ${"stopped"===a.status?e.default.stoppedBadge:""}`,children:a.status})]}),(0,b.jsxs)("div",{className:e.default.cardBody,children:[(0,b.jsxs)("p",{style:{fontSize:"0.825rem",color:"var(--muted)"},children:["ID: ",(0,b.jsx)("code",{style:{fontSize:"0.75rem"},children:a.id.substring(0,8)}),(0,b.jsx)("br",{}),"Type: ","claude"===a.type?"Claude Local PTY":"claude-docker"===a.type?"Claude Docker PTY":"claude-ssh"===a.type?"Claude SSH PTY":"aider"===a.type?"Aider Local PTY":"aider-docker"===a.type?"Aider Docker PTY":"mock"===a.type?"Simulated Mock PTY":"Unknown PTY",(0,b.jsx)("br",{}),"Logs: ",a.logsCount," captured lines"]}),(0,b.jsxs)("div",{style:{display:"flex",gap:"0.5rem",marginTop:"1rem"},children:["running"===a.status?(0,b.jsx)("button",{onClick:()=>P(a.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,b.jsx)("button",{onClick:()=>P(a.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,b.jsx)("button",{onClick:()=>n(a.id),style:{flex:2,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"none",backgroundColor:g===a.id?"var(--border-focus)":"var(--primary)",fontSize:"0.75rem",fontWeight:600,color:"#fff"},children:g===a.id?"Connected":"Open Session"})]})]})]},a.id))})]}),g&&"workspace-terminal"!==g&&(0,b.jsxs)("section",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border-focus)"},children:[(0,b.jsxs)("div",{className:e.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(109, 40, 217, 0.08)"},children:[(0,b.jsxs)("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:["🖥️ Console Bridge — ",a.find(a=>a.id===g)?.name]}),(0,b.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[a.find(a=>a.id===g)?.status==="stopped"&&(0,b.jsx)("button",{onClick:async()=>{try{let a=await fetch("/api/sessions/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:g})});if(a.ok)await M();else{let b=await a.json();alert(b.error||"Failed to restart session.")}}catch(a){console.error("Failed to restart session:",a),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,b.jsx)("button",{onClick:()=>n(null),style:{border:"none",background:"none",color:"var(--muted)",cursor:"pointer",fontSize:"0.75rem"},children:"Close Panel ✖"})]})]}),(0,b.jsx)(h,{sessionId:g,wsPort:C})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Workspace Shell Terminal"}),(0,b.jsxs)("div",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border)",padding:0},children:[(0,b.jsxs)("div",{className:e.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(255, 255, 255, 0.02)"},children:[(0,b.jsxs)("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem",fontSize:"0.85rem"},children:["💻 Local Workspace Shell (CWD: ",A||"root",")"]}),(0,b.jsx)("span",{style:{fontSize:"0.7rem",color:"var(--muted)"},children:"Pre-configured environment"})]}),(0,b.jsx)(h,{sessionId:"workspace-terminal",height:"300px",wsPort:C})]})]}),(0,b.jsxs)("section",{style:{marginTop:"2rem"},children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Shared Context Hub & Slash Commands"}),(0,b.jsxs)("div",{className:e.default.contextList,children:[(0,b.jsxs)("div",{className:`${e.default.contextItem} card`,children:[(0,b.jsxs)("div",{className:e.default.contextMeta,children:[(0,b.jsx)("span",{className:e.default.contextTitle,children:"Staged Context & System Rules (/ccc)"}),(0,b.jsx)("span",{className:e.default.contextDetails,children:"Compiles AGENTS.md guidelines and project files folder hierarchy map."})]}),(0,b.jsx)("button",{onClick:async()=>{g&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:g,command:"/ccc"})})},disabled:!g,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.75rem",fontWeight:600,opacity:g?1:.5,cursor:g?"pointer":"not-allowed"},children:"🚀 Mount Context (/ccc)"})]}),(0,b.jsxs)("div",{className:`${e.default.contextItem} card`,children:[(0,b.jsxs)("div",{className:e.default.contextMeta,children:[(0,b.jsx)("span",{className:e.default.contextTitle,children:"Staged Developer Prompt (/ccp)"}),(0,b.jsx)("span",{className:e.default.contextDetails,children:"Executes instructions written in .ai/neural-loom/cprompt.md."})]}),(0,b.jsx)("button",{onClick:async()=>{g&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:g,command:"/ccp"})})},disabled:!g,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--success)",backgroundColor:"transparent",color:"var(--success)",fontSize:"0.75rem",fontWeight:600,opacity:g?1:.5,cursor:g?"pointer":"not-allowed"},children:"⚡ Trigger Prompt (/ccp)"})]})]}),(0,b.jsx)(i,{})]}),(0,b.jsxs)("section",{style:{marginTop:"2rem"},children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Built-in Database Explorer & SQL Client"}),(0,b.jsx)("div",{className:"card",style:{padding:0,overflow:"hidden",height:"480px",border:"1px solid var(--border)"},children:(0,b.jsx)(f,{workspaceRoot:A||""})})]})]}),(0,b.jsxs)("aside",{className:e.default.sidePanel,children:[(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Execution Environments"}),(0,b.jsxs)("div",{className:e.default.envGrid,children:[(0,b.jsxs)("div",{className:e.default.envRow,children:[(0,b.jsx)("span",{className:e.default.envName,children:"💻 Local host OS"}),(0,b.jsx)("span",{className:e.default.envStatus,style:{color:"var(--success)"},children:"Active"})]}),(0,b.jsxs)("div",{className:e.default.envRow,style:{opacity:K?1:.6},children:[(0,b.jsx)("span",{className:e.default.envName,children:"🐳 Docker Sandbox"}),(0,b.jsx)("span",{className:e.default.envStatus,style:{color:K?"var(--success)":"var(--muted)"},children:K?"Active":"Not Mounted"})]}),(0,b.jsxs)("div",{className:e.default.envRow,style:{opacity:L?1:.6},children:[(0,b.jsx)("span",{className:e.default.envName,children:"🌐 Remote VM (SSH)"}),(0,b.jsx)("span",{className:e.default.envStatus,style:{color:L?"var(--success)":"var(--muted)"},children:L?"Active":"Disconnected"})]})]})]}),(0,b.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{z(!1),x(!0)},disabled:o,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🤖"}),(0,b.jsx)("span",{children:"Launch Claude PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{z(!0),x(!0)},disabled:o,style:{background:"linear-gradient(135deg, hsl(170, 72%, 40%) 0%, hsl(195, 100%, 40%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🐳"}),(0,b.jsx)("span",{children:"Launch Docker PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>r(!0),disabled:o,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🌐"}),(0,b.jsx)("span",{children:"Launch SSH PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{v(!1),t(!0)},disabled:o,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🐍"}),(0,b.jsx)("span",{children:"Launch Aider PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{v(!0),t(!0)},disabled:o,style:{background:"linear-gradient(135deg, hsl(195, 100%, 40%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🐳"}),(0,b.jsx)("span",{children:"Launch Aider Docker"})]})]}),(0,b.jsxs)("section",{className:"card",style:{padding:"1.5rem",display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,b.jsx)("h3",{style:{fontSize:"1rem",fontWeight:700},children:"Quick Actions"}),(0,b.jsxs)("ul",{style:{listStyle:"none",fontSize:"0.875rem",display:"flex",flexDirection:"column",gap:"0.5rem",color:"var(--muted)"},children:[(0,b.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,b.jsx)("span",{children:"Configure global API Keys"}),(0,b.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,b.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,b.jsx)("span",{children:"Edit rules templates"}),(0,b.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,b.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,b.jsx)("span",{children:"Inspect process locks"}),(0,b.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]})]}),(0,b.jsxs)("div",{style:{marginTop:"1.2rem",textAlign:"center",fontSize:"0.72rem",color:"var(--muted)"},children:["Need to troubleshoot?"," ",(0,b.jsx)("span",{onClick:()=>O("mock"),style:{color:"var(--primary)",cursor:"pointer",textDecoration:"underline"},children:"Launch simulated playground sandbox"})]})]})]})]}),(0,b.jsxs)("footer",{className:e.default.footer,children:[(0,b.jsxs)("span",{children:["NeuralLoom v",E," — Experimental AI Orchestrator Bridge"]}),(0,b.jsxs)("span",{children:["Directory: ",A||"Loading..."]})]}),q&&(0,b.jsx)(j,{onClose:()=>r(!1),onConfirmLaunch:()=>{r(!1),O("claude-ssh")}}),s&&(0,b.jsx)(k,{onClose:()=>t(!1),isDocker:u,onConfirmLaunch:()=>{t(!1),O(u?"aider-docker":"aider")}}),w&&(0,b.jsx)(l,{onClose:()=>x(!1),isDocker:y,onConfirmLaunch:(a,b,c)=>{x(!1),O(y?"claude-docker":"claude",a,b,c)}})]})}],40777)}];
2
7
 
3
8
  //# sourceMappingURL=_0t7oqy6._.js.map